From c402768a41332661f868f0dac249715dbeb0afa2 Mon Sep 17 00:00:00 2001 From: ForeverInLaw <44206490+ForeverInLaw@users.noreply.github.com> Date: Fri, 4 Dec 2026 12:30:37 +0000 Subject: [PATCH 001/128] settings: add the [server] section that redshell-server reads --- crates/redshell-core/src/settings.rs | 51 ++++++++++++++++++++++++++++ docs/CONFIG.md | 13 +++++++ 2 files changed, 64 insertions(+) diff --git a/crates/redshell-core/src/settings.rs b/crates/redshell-core/src/settings.rs index e26b0f9..0c1f7e9 100644 --- a/crates/redshell-core/src/settings.rs +++ b/crates/redshell-core/src/settings.rs @@ -31,6 +31,8 @@ pub struct Settings { pub agents: AgentSettings, pub plugins: PluginSettings, pub updates: UpdateSettings, + /// `redshell-server` only; the desktop ignores it. + pub server: ServerSettings, /// Keystroke → command id, e.g. `"ctrl-shift-t" = "tab.new"`. /// Entries here override (or with an empty value, remove) the defaults. pub keybindings: BTreeMap, @@ -630,6 +632,39 @@ impl Default for UpdateSettings { } } +/// The `[server]` section, read by `redshell-server` from its own config +/// directory. Values stay strings here so a typo never stops the desktop +/// from loading the file; the server parses and checks them at start. +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(default)] +pub struct ServerSettings { + /// Address and port to listen on. Anything but loopback needs TLS. + pub listen: String, + /// The HTTPS origin clients use (`https://box.tailnet.ts.net`): setup + /// links, Origin checks, passkeys and push. + pub public_url: Option, + /// PEM certificate chain and private key for built-in TLS. + pub tls_cert: Option, + pub tls_key: Option, + /// Peers (IP addresses) whose `X-Forwarded-For` names the real client. + pub trusted_proxies: Vec, + /// How long an agent's permission request waits for an answer. + pub approval_timeout_secs: u64, +} + +impl Default for ServerSettings { + fn default() -> Self { + Self { + listen: "127.0.0.1:4747".into(), + public_url: None, + tls_cert: None, + tls_key: None, + trusted_proxies: Vec::new(), + approval_timeout_secs: 600, + } + } +} + impl Settings { /// Parses TOML text. pub fn from_toml(text: &str) -> Result { @@ -729,6 +764,12 @@ check = true # look for a newer release once a day; nothing [keybindings] # "ctrl-shift-t" = "tab.new" + +# [server] # read by redshell-server only +# listen = "127.0.0.1:4747" # anything but loopback needs tls_cert and tls_key +# public_url = "https://box.example.ts.net" +# trusted_proxies = ["127.0.0.1"] +# approval_timeout_secs = 600 "#; #[cfg(test)] @@ -743,6 +784,16 @@ mod tests { assert_eq!(parsed.safety, d.safety); assert_eq!(parsed.history, d.history); assert_eq!(parsed.terminal, d.terminal); + assert_eq!(parsed.server, d.server); + } + + #[test] + fn server_section_is_optional_and_lenient() { + let s = Settings::from_toml("[server]\nlisten = \"0.0.0.0:443\"\ntrusted_proxies = [\"127.0.0.1\"]\n").unwrap(); + assert_eq!(s.server.listen, "0.0.0.0:443"); + assert_eq!(s.server.trusted_proxies, ["127.0.0.1"]); + assert_eq!(s.server.approval_timeout_secs, 600); + assert_eq!(Settings::default().server.listen, "127.0.0.1:4747"); } #[test] diff --git a/docs/CONFIG.md b/docs/CONFIG.md index 21d1fa1..fca8d8a 100644 --- a/docs/CONFIG.md +++ b/docs/CONFIG.md @@ -336,6 +336,19 @@ whatever this setting says, and also reports when you are up to date or the chec Releases are compared by version (`v0.0.10` is newer than `v0.0.9`). A pre-release tag such as `v0.1.0-beta.1` is only offered to builds that are pre-releases themselves. +## `[server]` + +Read only by `redshell-server` from its own config directory; the desktop ignores it. See +[REMOTE.md](REMOTE.md) for running the server. + +| Key | Default | Notes | +|---|---|---| +| `listen` | `"127.0.0.1:4747"` | Address and port. A non-loopback address is refused unless `tls_cert` and `tls_key` are set. | +| `public_url` | none | The HTTPS origin clients open, such as `https://box.tailnet.ts.net`. Used for the setup link and the Origin check. | +| `tls_cert`, `tls_key` | none | PEM certificate chain and private key for built-in TLS. | +| `trusted_proxies` | `[]` | Peer IP addresses whose `X-Forwarded-For` header names the real client (sign-in throttling and the audit log). Behind Tailscale Serve or cloudflared, set `["127.0.0.1", "::1"]`. | +| `approval_timeout_secs` | `600` | How long an agent's permission request waits for an answer before the agent asks in its own terminal. | + ## `[keybindings]` Keys use GPUI's syntax: `ctrl-shift-t`, `ctrl-alt-1`, `f11`, or `ctrl-k ctrl-t` for a chord. The value is From 819ec8e61a0fa99aaf9a34db04ba89fab4d11473 Mon Sep 17 00:00:00 2001 From: ForeverInLaw <44206490+ForeverInLaw@users.noreply.github.com> Date: Fri, 4 Dec 2026 12:32:30 +0000 Subject: [PATCH 002/128] terminal: hand OSC 9 / OSC 777 notifications and the bell to the observer --- crates/redshell-core/src/observer.rs | 6 +++++ crates/redshell-terminal/src/engine.rs | 25 ++++++++++++++++++ crates/redshell-terminal/src/lib.rs | 1 + crates/redshell-terminal/src/osc.rs | 36 +++++++++++++++++++++++--- crates/redshell-terminal/src/output.rs | 6 +++++ 5 files changed, 71 insertions(+), 3 deletions(-) diff --git a/crates/redshell-core/src/observer.rs b/crates/redshell-core/src/observer.rs index e284e66..d65bdac 100644 --- a/crates/redshell-core/src/observer.rs +++ b/crates/redshell-core/src/observer.rs @@ -20,6 +20,10 @@ pub trait SessionObserver: Send { fn on_command(&mut self, _command: &str) {} /// Child exited. fn on_exit(&mut self, _code: Option) {} + /// The program rang the bell (BEL). + fn on_bell(&mut self) {} + /// The program asked for a desktop notification (OSC 9 / OSC 777). + fn on_notification(&mut self, _title: Option<&str>, _body: &str) {} } /// Fans one stream out to several observers. @@ -58,4 +62,6 @@ fan_out! { on_cwd(cwd: &str), on_command(command: &str), on_exit(code: Option), + on_bell(), + on_notification(title: Option<&str>, body: &str), } diff --git a/crates/redshell-terminal/src/engine.rs b/crates/redshell-terminal/src/engine.rs index ffddc30..9fc9276 100644 --- a/crates/redshell-terminal/src/engine.rs +++ b/crates/redshell-terminal/src/engine.rs @@ -217,6 +217,7 @@ impl EventListener for Listener { let _ = shared.events.send(TerminalEvent::ResetTitle); } VtEvent::Bell => { + shared.observe(|o| o.on_bell()); let _ = shared.events.send(TerminalEvent::Bell); } VtEvent::ClipboardStore(_, text) => { @@ -868,6 +869,7 @@ fn io_loop(mut reader: Box, term: &FairMutex>, s Parsed::CommandFinished(code) => { let _ = shared.events.send(TerminalEvent::CommandFinished(code)); } + Parsed::Notify { title, body } => shared.observe(|o| o.on_notification(title.as_deref(), &body)), }); shared.observe(|o| o.on_output(chunk)); shared.wake(); @@ -1166,6 +1168,29 @@ mod tests { assert!(t.plain_text().contains("hi-from-pty")); } + #[derive(Clone, Default)] + struct Alerts(Arc>>); + + impl SessionObserver for Alerts { + fn on_output(&mut self, _bytes: &[u8]) {} + fn on_bell(&mut self) { + self.0.lock().push("bell".into()); + } + fn on_notification(&mut self, title: Option<&str>, body: &str) { + self.0.lock().push(format!("{title:?}: {body}")); + } + } + + #[cfg(unix)] + #[test] + fn bell_and_notifications_reach_the_observer() { + let alerts = Alerts::default(); + let spec = CommandSpec::new("/bin/sh").arg("-c").arg(r"printf '\033]777;notify;Agent;Done\007\a'"); + let t = Terminal::spawn(&spec, TerminalOptions { observer: Some(Box::new(alerts.clone())), ..opts() }).unwrap(); + wait_for(&t, |ev| matches!(ev, TerminalEvent::Exited(_))); + assert_eq!(*alerts.0.lock(), ["Some(\"Agent\"): Done", "bell"]); + } + #[cfg(unix)] #[test] fn interrupted_program_exits_like_in_a_shell() { diff --git a/crates/redshell-terminal/src/lib.rs b/crates/redshell-terminal/src/lib.rs index 4ec071e..3cf3a35 100644 --- a/crates/redshell-terminal/src/lib.rs +++ b/crates/redshell-terminal/src/lib.rs @@ -13,6 +13,7 @@ //! * [`mouse`] encodes mouse reports in the protocol a program enabled. //! * [`osc`] picks up shell integration marks (OSC 7 / OSC 9;9 / OSC 133); //! prompt positions are kept in the grid for prompt-to-prompt navigation. +//! Notifications (OSC 9 / OSC 777) and the bell go to the observer. pub mod engine; mod exit_status; diff --git a/crates/redshell-terminal/src/osc.rs b/crates/redshell-terminal/src/osc.rs index ad9a8d8..4b91ee6 100644 --- a/crates/redshell-terminal/src/osc.rs +++ b/crates/redshell-terminal/src/osc.rs @@ -1,7 +1,8 @@ //! Streaming scanner for the OSC sequences RedShell cares about but the VT -//! parser does not surface: OSC 7 and OSC 9;9 (working directory) and OSC 133 -//! (shell integration prompt/command marks). Sequences may be split across -//! reads. +//! parser does not surface: OSC 7 and OSC 9;9 (working directory), OSC 133 +//! (shell integration prompt/command marks) and the desktop notifications of +//! OSC 9 (iTerm2) and OSC 777 (`notify`, urxvt). Sequences may be split +//! across reads. //! //! Each event carries the offset just past its terminator within the fed //! chunk, so the caller can advance the VT parser exactly up to the mark and @@ -21,6 +22,9 @@ pub enum OscEvent { OutputStart, /// OSC 133;D[;code] CommandFinished(Option), + /// OSC 9;`body` or OSC 777;notify;`title`;`body`: the program asks for + /// a desktop notification. + Notify { title: Option, body: String }, } #[derive(Debug, Default, Clone, Copy, PartialEq, Eq)] @@ -91,6 +95,16 @@ impl OscScanner { Some(path) => OscEvent::Cwd(path), None => return, } + } else if let Some(rest) = text.strip_prefix("777;notify;") { + let (title, body) = rest.split_once(';').unwrap_or(("", rest)); + OscEvent::Notify { title: (!title.is_empty()).then(|| title.to_owned()), body: body.to_owned() } + } else if let Some(body) = text.strip_prefix("9;") { + // ConEmu uses OSC 9;;… for progress, cwd and more. + let code = body.split(';').next().unwrap_or_default(); + if !code.is_empty() && code.bytes().all(|b| b.is_ascii_digit()) { + return; + } + OscEvent::Notify { title: None, body: body.to_owned() } } else if let Some(rest) = text.strip_prefix("133;") { let mut parts = rest.split(';'); match parts.next() { @@ -343,6 +357,22 @@ mod tests { assert_eq!(PathStyle::Unix.conemu_path("relative"), None); } + #[test] + fn notifications() { + let mut s = OscScanner::default(); + let mut out = Vec::new(); + s.feed(b"\x1b]9;Build done\x07\x1b]777;notify;Claude;Needs; input\x1b\\\x1b]777;notify;;x\x07", &mut out); + let events: Vec<_> = out.into_iter().map(|(_, e)| e).collect(); + assert_eq!( + events, + vec![ + OscEvent::Notify { title: None, body: "Build done".into() }, + OscEvent::Notify { title: Some("Claude".into()), body: "Needs; input".into() }, + OscEvent::Notify { title: None, body: "x".into() }, + ] + ); + } + #[test] fn osc_9_9_is_scanned_and_other_9_codes_ignored() { let path = if cfg!(windows) { r"C:\x" } else { "/x" }; diff --git a/crates/redshell-terminal/src/output.rs b/crates/redshell-terminal/src/output.rs index 67b0306..f0b8a0d 100644 --- a/crates/redshell-terminal/src/output.rs +++ b/crates/redshell-terminal/src/output.rs @@ -31,6 +31,11 @@ pub(crate) enum Parsed { /// The text of a submitted command (between OSC 133;B and ;C). Command(String), CommandFinished(Option), + /// A desktop notification (OSC 9 / OSC 777). + Notify { + title: Option, + body: String, + }, } #[derive(Default)] @@ -77,6 +82,7 @@ impl OutputParser { self.stop_marking(term); emit(Parsed::CommandFinished(code)); } + OscEvent::Notify { title, body } => emit(Parsed::Notify { title, body }), } } self.osc = events; From 5d5712215f28288d2c810c769cff76ed632992e5 Mon Sep 17 00:00:00 2001 From: ForeverInLaw <44206490+ForeverInLaw@users.noreply.github.com> Date: Fri, 4 Dec 2026 12:32:45 +0000 Subject: [PATCH 003/128] terminal: replay the screen, scrollback and modes as ANSI for a client that joins late --- crates/redshell-terminal/src/engine.rs | 42 ++- crates/redshell-terminal/src/lib.rs | 4 + crates/redshell-terminal/src/replay.rs | 416 +++++++++++++++++++++++++ 3 files changed, 460 insertions(+), 2 deletions(-) create mode 100644 crates/redshell-terminal/src/replay.rs diff --git a/crates/redshell-terminal/src/engine.rs b/crates/redshell-terminal/src/engine.rs index 9fc9276..2346394 100644 --- a/crates/redshell-terminal/src/engine.rs +++ b/crates/redshell-terminal/src/engine.rs @@ -23,6 +23,7 @@ use crate::input::{InputModes, encode_paste}; use crate::links::{self, Link}; use crate::mouse::{MouseProtocol, MouseReport}; use crate::output::{OutputParser, Parsed, prompt_lines, row_text}; +use crate::replay::{Replay, build_replay}; use crate::search::{self, SearchDirection, SearchQuery, SearchStatus}; use crate::snapshot::{Snapshot, SnapshotOptions, build_snapshot}; @@ -172,6 +173,8 @@ struct Shared { /// Answer terminal queries (DA, colour and size reports). Off for /// external terminals whose far end (tmux) answers them itself. answers_queries: AtomicBool, + /// Window title (OSC 0/2), which alacritty keeps to itself. + title: RwLock>, } impl Shared { @@ -211,9 +214,11 @@ impl EventListener for Listener { VtEvent::PtyWrite(text) => shared.reply(text.as_bytes()), VtEvent::Title(title) => { shared.observe(|o| o.on_title(&title)); + *shared.title.write() = Some(title.clone()); let _ = shared.events.send(TerminalEvent::Title(title)); } VtEvent::ResetTitle => { + *shared.title.write() = None; let _ = shared.events.send(TerminalEvent::ResetTitle); } VtEvent::Bell => { @@ -308,6 +313,7 @@ impl Terminal { integrated: AtomicBool::new(false), bytes_out: AtomicU64::new(0), answers_queries: AtomicBool::new(true), + title: RwLock::new(None), }); let config = TermConfig { scrolling_history: opts.scrollback, @@ -546,6 +552,31 @@ impl Terminal { build_snapshot(&self.term.lock(), &palette, opts, search.as_mut()) } + /// The screen, up to `scrollback` lines of history and the modes, as + /// bytes that redraw them in a fresh terminal (see [`Replay`]). + pub fn replay(&self, scrollback: usize) -> Replay { + let term = self.term.lock(); + let offset = self.shared.bytes_out.load(Ordering::Acquire); + build_replay(&term, self.shared.title.read().as_deref(), scrollback, offset) + } + + /// The window title the program set, if any. + pub fn title(&self) -> Option { + self.shared.title.read().clone() + } + + /// The last line on screen, up to the cursor, that holds text. + pub fn last_line(&self) -> Option { + let term = self.term.lock(); + let cursor = term.grid().cursor.point.line; + (0..=cursor.0).rev().map(|l| Self::line_text(&term, Line(l))).find(|text| !text.trim().is_empty()) + } + + #[cfg(test)] + pub(crate) fn with_term(&self, f: impl FnOnce(&Term) -> R) -> R { + f(&self.term.lock()) + } + // ----- find ------------------------------------------------------------- /// Sets the find pattern and focuses the nearest match (keeping the @@ -801,6 +832,9 @@ impl Terminal { } } + /// Output bytes read from the program so far. The count moves together + /// with the grid, so it marks where a [`Replay`] leaves off: output + /// reported to the observer ends at this offset after each chunk. pub fn bytes_received(&self) -> u64 { self.shared.bytes_out.load(Ordering::Relaxed) } @@ -858,8 +892,8 @@ fn io_loop(mut reader: Box, term: &FairMutex>, s Err(_) => break, }; let chunk = &buf[..n]; - shared.bytes_out.fetch_add(n as u64, Ordering::Relaxed); - parser.advance(&mut *term.lock(), chunk, |event| match event { + let mut grid = term.lock(); + parser.advance(&mut grid, chunk, |event| match event { Parsed::Cwd(cwd) => { shared.observe(|o| o.on_cwd(&cwd)); let _ = shared.events.send(TerminalEvent::Cwd(cwd)); @@ -871,6 +905,9 @@ fn io_loop(mut reader: Box, term: &FairMutex>, s } Parsed::Notify { title, body } => shared.observe(|o| o.on_notification(title.as_deref(), &body)), }); + // Counted under the lock, so a replay's offset matches its grid. + shared.bytes_out.fetch_add(n as u64, Ordering::Release); + drop(grid); shared.observe(|o| o.on_output(chunk)); shared.wake(); } @@ -1189,6 +1226,7 @@ mod tests { let t = Terminal::spawn(&spec, TerminalOptions { observer: Some(Box::new(alerts.clone())), ..opts() }).unwrap(); wait_for(&t, |ev| matches!(ev, TerminalEvent::Exited(_))); assert_eq!(*alerts.0.lock(), ["Some(\"Agent\"): Done", "bell"]); + assert_eq!(t.replay(0).offset, t.bytes_received()); } #[cfg(unix)] diff --git a/crates/redshell-terminal/src/lib.rs b/crates/redshell-terminal/src/lib.rs index 3cf3a35..e6ce556 100644 --- a/crates/redshell-terminal/src/lib.rs +++ b/crates/redshell-terminal/src/lib.rs @@ -14,6 +14,8 @@ //! * [`osc`] picks up shell integration marks (OSC 7 / OSC 9;9 / OSC 133); //! prompt positions are kept in the grid for prompt-to-prompt navigation. //! Notifications (OSC 9 / OSC 777) and the bell go to the observer. +//! * [`replay`] serializes the screen and its modes as ANSI, for a client +//! joining a running session. pub mod engine; mod exit_status; @@ -24,6 +26,7 @@ pub mod osc; mod output; #[cfg(any(windows, test))] mod process_tree; +pub mod replay; pub mod search; mod selection_guard; pub mod snapshot; @@ -32,6 +35,7 @@ pub use engine::{ExternalFeed, ExternalIo, GridSize, Terminal, TerminalEvent, Te pub use input::{InputModes, KeyMods, encode_key, encode_paste}; pub use links::Link; pub use mouse::{MouseAction, MouseButton, MouseEncoding, MouseProtocol, MouseReport, MouseTracking}; +pub use replay::{Replay, ScreenModes}; pub use search::{SearchDirection, SearchQuery, SearchStatus}; pub use snapshot::{BgSpan, CursorShape, CursorState, MatchSpan, Segment, Snapshot, SnapshotOptions}; diff --git a/crates/redshell-terminal/src/replay.rs b/crates/redshell-terminal/src/replay.rs new file mode 100644 index 0000000..79654ee --- /dev/null +++ b/crates/redshell-terminal/src/replay.rs @@ -0,0 +1,416 @@ +//! The screen as a byte stream that redraws it in a fresh terminal. +//! +//! A client that joins a running session (a phone attaching to a server +//! session) needs what is on screen now, not the whole history of bytes. A +//! [`Replay`] holds the recent scrollback and the screen as ANSI text, then +//! the state a program left behind that is invisible in the cells: the +//! cursor position and pen, the input and mouse modes, the cursor style and +//! the title. Feeding it into a terminal of the same size, right after a +//! reset, gives that terminal the same grid and modes; the live output that +//! follows (from [`Replay::offset`] on) then lands exactly as it would have. +//! +//! Known gaps: a scroll region (DECSTBM), saved cursors and character sets +//! are not carried, and while a full-screen program uses the alternate +//! screen only that screen is sent (the normal screen behind it is not +//! reachable through alacritty's API), so it comes back blank once the +//! program exits. Programs redraw on the resize a joining client causes. + +use std::fmt::Write as _; + +use alacritty_terminal::grid::Dimensions; +use alacritty_terminal::index::{Column, Line}; +use alacritty_terminal::term::cell::{Cell, Flags}; +use alacritty_terminal::term::{Term, TermMode}; +use alacritty_terminal::vte::ansi::{Color, CursorShape as VtCursorShape}; + +use crate::mouse::MouseProtocol; +use crate::snapshot::CursorShape; + +/// Terminal state that decides how input is encoded and how the screen is +/// drawn, as carried by a [`Replay`]. +#[derive(Debug, Clone, PartialEq, Eq)] +pub struct ScreenModes { + pub alt_screen: bool, + /// DECCKM: arrows send `ESC O A` instead of `ESC [ A`. + pub app_cursor: bool, + /// DECKPAM: the keypad sends application sequences. + pub app_keypad: bool, + pub bracketed_paste: bool, + /// Mouse reporting the program asked for, with its encoding. + pub mouse: Option, + /// DECSET 1004: focus in and out are reported. + pub focus_reporting: bool, + pub cursor_visible: bool, + pub cursor_shape: CursorShape, + pub cursor_blinking: bool, + pub title: Option, +} + +/// The screen and recent scrollback serialized as ANSI, plus the modes. +#[derive(Debug, Clone, PartialEq, Eq)] +pub struct Replay { + pub cols: u16, + pub rows: u16, + /// Write this into a reset terminal of `cols` × `rows`. + pub data: String, + pub modes: ScreenModes, + /// Output bytes parsed into the grid when this was taken (see + /// [`crate::Terminal::output_offset`]); live output continues from here. + pub offset: u64, +} + +/// SGR state of a cell: what the pen has to be to draw it. +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +struct Pen { + fg: Color, + bg: Color, + flags: Flags, + underline: Option, +} + +/// Flags that are not drawing attributes. +const LAYOUT_FLAGS: Flags = + Flags::WRAPLINE.union(Flags::WIDE_CHAR).union(Flags::WIDE_CHAR_SPACER).union(Flags::LEADING_WIDE_CHAR_SPACER); + +impl Pen { + fn of(cell: &Cell) -> Self { + Self { fg: cell.fg, bg: cell.bg, flags: cell.flags - LAYOUT_FLAGS, underline: cell.underline_color() } + } + + fn plain() -> Self { + Self::of(&Cell::default()) + } + + /// `ESC [ 0 ; … m`: resets, then sets every attribute of this pen. + fn write(&self, out: &mut String) { + out.push_str("\x1b[0"); + let flags = [ + (Flags::BOLD, "1"), + (Flags::DIM, "2"), + (Flags::ITALIC, "3"), + (Flags::UNDERLINE, "4"), + (Flags::DOUBLE_UNDERLINE, "4:2"), + (Flags::UNDERCURL, "4:3"), + (Flags::DOTTED_UNDERLINE, "4:4"), + (Flags::DASHED_UNDERLINE, "4:5"), + (Flags::INVERSE, "7"), + (Flags::HIDDEN, "8"), + (Flags::STRIKEOUT, "9"), + ]; + for (flag, code) in flags { + if self.flags.contains(flag) { + out.push(';'); + out.push_str(code); + } + } + write_color(out, self.fg, 30, 90, 38); + write_color(out, self.bg, 40, 100, 48); + if let Some(color) = self.underline { + write_color(out, color, 58, 58, 58); + } + out.push('m'); + } +} + +/// Appends `;` for `color`: `base + n` for the 8 standard colours, +/// `bright + n` for the bright ones, `extended;5;i` or `extended;2;r;g;b` +/// otherwise. Default colours add nothing. +fn write_color(out: &mut String, color: Color, base: u8, bright: u8, extended: u8) { + let _ = match color { + Color::Named(named) => match named as usize { + n @ 0..=7 if base != extended => write!(out, ";{}", base as usize + n), + n @ 8..=15 if base != extended => write!(out, ";{}", bright as usize + n - 8), + n @ 0..=15 => write!(out, ";{extended};5;{n}"), + _ => Ok(()), + }, + Color::Indexed(i) => write!(out, ";{extended};5;{i}"), + Color::Spec(rgb) => write!(out, ";{extended};2;{};{};{}", rgb.r, rgb.g, rgb.b), + }; +} + +/// Draws cells while keeping track of the pen, so SGR is written only when +/// the style changes. +struct Painter { + out: String, + pen: Pen, +} + +impl Painter { + fn cell(&mut self, cell: &Cell) { + let pen = Pen::of(cell); + if pen != self.pen { + pen.write(&mut self.out); + self.pen = pen; + } + self.out.push(cell.c); + if let Some(zerowidth) = cell.zerowidth() { + self.out.extend(zerowidth); + } + } + + fn reset_pen(&mut self) { + if self.pen != Pen::plain() { + self.out.push_str("\x1b[0m"); + self.pen = Pen::plain(); + } + } +} + +/// Whether a cell is an unstyled blank: trailing ones are not written. +fn is_blank(cell: &Cell) -> bool { + cell.c == ' ' && Pen::of(cell) == Pen::plain() +} + +/// Whether a cell is the right half of a wide glyph, or the gap left where +/// one did not fit; the terminal recreates both when the glyph is written. +fn is_spacer(cell: &Cell) -> bool { + cell.flags.intersects(Flags::WIDE_CHAR_SPACER | Flags::LEADING_WIDE_CHAR_SPACER) +} + +/// Serializes `term` (with at most `scrollback` lines of history) for a +/// fresh terminal of the same size. `title` is the window title, which +/// alacritty keeps private. +pub(crate) fn build_replay(term: &Term, title: Option<&str>, scrollback: usize, offset: u64) -> Replay { + let grid = term.grid(); + let mode = *term.mode(); + let (cols, rows) = (term.columns(), term.screen_lines()); + let history = grid.history_size().min(scrollback); + let mut painter = Painter { out: String::from("\x1bc"), pen: Pen::plain() }; + if mode.contains(TermMode::ALT_SCREEN) { + painter.out.push_str("\x1b[?1049h"); + } + + let total = history + rows; + for i in 0..total { + let row = &grid[Line(i as i32 - history as i32)]; + let wrapped = row[Column(cols - 1)].flags.contains(Flags::WRAPLINE); + let end = + if wrapped { cols } else { (0..cols).rev().find(|&c| !is_blank(&row[Column(c)])).map_or(0, |c| c + 1) }; + for c in 0..end { + let cell = &row[Column(c)]; + if !is_spacer(cell) { + painter.cell(cell); + } + } + if i + 1 < total && !wrapped { + // A newline that scrolls fills the new row with the pen's background. + painter.reset_pen(); + painter.out.push_str("\r\n"); + } + } + + restore_cursor(&mut painter, term); + let out = &mut painter.out; + write_modes(out, mode); + let style = term.cursor_style(); + let shape = match style.shape { + VtCursorShape::Block => CursorShape::Block, + VtCursorShape::Underline => CursorShape::Underline, + VtCursorShape::Beam => CursorShape::Bar, + VtCursorShape::HollowBlock => CursorShape::Hollow, + VtCursorShape::Hidden => CursorShape::Hidden, + }; + let decscusr = match shape { + CursorShape::Underline => Some(3), + CursorShape::Bar => Some(5), + CursorShape::Block if style.blinking => Some(1), + _ => None, + }; + if let Some(code) = decscusr { + // Odd codes blink, the even code after each is steady. + let _ = write!(out, "\x1b[{} q", code + u8::from(!style.blinking && code != 1)); + } + let title = title.map(|t| t.chars().filter(|c| !c.is_control()).collect::()); + if let Some(title) = &title { + let _ = write!(out, "\x1b]2;{title}\x07"); + } + + Replay { + cols: cols as u16, + rows: rows as u16, + data: painter.out, + modes: ScreenModes { + alt_screen: mode.contains(TermMode::ALT_SCREEN), + app_cursor: mode.contains(TermMode::APP_CURSOR), + app_keypad: mode.contains(TermMode::APP_KEYPAD), + bracketed_paste: mode.contains(TermMode::BRACKETED_PASTE), + mouse: MouseProtocol::from_mode(mode), + focus_reporting: mode.contains(TermMode::FOCUS_IN_OUT), + cursor_visible: mode.contains(TermMode::SHOW_CURSOR), + cursor_shape: shape, + cursor_blinking: style.blinking, + title, + }, + offset, + } +} + +/// Moves the cursor where it is, with a pending wrap when the program left +/// one (the next glyph goes to the next row), and sets the pen it draws with. +fn restore_cursor(painter: &mut Painter, term: &Term) { + let grid = term.grid(); + let cursor = &grid.cursor; + let line = cursor.point.line; + let last = term.columns() - 1; + painter.reset_pen(); + if cursor.input_needs_wrap { + // Rewriting the last glyph of the row leaves the terminal waiting to wrap. + let row = &grid[line]; + let col = if row[Column(last)].flags.contains(Flags::WIDE_CHAR_SPACER) { last - 1 } else { last }; + let _ = write!(painter.out, "\x1b[{};{}H", line.0 + 1, col + 1); + painter.cell(&row[Column(col)]); + } else { + let _ = write!(painter.out, "\x1b[{};{}H", line.0 + 1, cursor.point.column.0 + 1); + } + painter.reset_pen(); + let pen = Pen::of(&cursor.template); + if pen != Pen::plain() { + pen.write(&mut painter.out); + } +} + +/// DECSET/DECRST sequences for the modes that differ from a reset terminal. +fn write_modes(out: &mut String, mode: TermMode) { + let private = [ + (TermMode::APP_CURSOR, 1, true), + (TermMode::LINE_WRAP, 7, false), + (TermMode::SHOW_CURSOR, 25, false), + (TermMode::MOUSE_REPORT_CLICK, 1000, true), + (TermMode::MOUSE_DRAG, 1002, true), + (TermMode::MOUSE_MOTION, 1003, true), + (TermMode::FOCUS_IN_OUT, 1004, true), + (TermMode::UTF8_MOUSE, 1005, true), + (TermMode::SGR_MOUSE, 1006, true), + (TermMode::BRACKETED_PASTE, 2004, true), + ]; + for (flag, code, off_by_default) in private { + let on = mode.contains(flag); + if on == off_by_default { + let _ = write!(out, "\x1b[?{code}{}", if on { 'h' } else { 'l' }); + } + } + if mode.contains(TermMode::INSERT) { + out.push_str("\x1b[4h"); + } + if mode.contains(TermMode::LINE_FEED_NEW_LINE) { + out.push_str("\x1b[20h"); + } + if mode.contains(TermMode::APP_KEYPAD) { + out.push_str("\x1b="); + } +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::engine::{GridSize, Terminal, TerminalOptions}; + use crate::mouse::{MouseEncoding, MouseTracking}; + + fn terminal(cols: u16, rows: u16) -> Terminal { + Terminal::detached(TerminalOptions { + size: GridSize { cols, rows, cell_width: 8, cell_height: 16 }, + ..Default::default() + }) + } + + /// Feeds `bytes` into a terminal, replays it into a fresh one, and checks + /// both agree; then feeds `after` into both and checks again, which + /// catches a wrong pen, cursor or pending wrap. + fn round_trip(cols: u16, rows: u16, bytes: &[u8], after: &[u8]) -> (Terminal, Terminal) { + let source = terminal(cols, rows); + source.feed(bytes); + let replay = source.replay(usize::MAX); + assert_eq!((replay.cols, replay.rows), (cols, rows)); + let copy = terminal(cols, rows); + copy.feed(replay.data.as_bytes()); + assert_same(&source, ©, "after the replay"); + assert_eq!(copy.replay(usize::MAX).modes, replay.modes, "modes survive the replay"); + source.feed(after); + copy.feed(after); + assert_same(&source, ©, "after more output"); + (source, copy) + } + + fn assert_same(a: &Terminal, b: &Terminal, when: &str) { + a.with_term(|ta| { + b.with_term(|tb| { + let (ga, gb) = (ta.grid(), tb.grid()); + assert_eq!(ga.history_size(), gb.history_size(), "history {when}"); + assert_eq!(ga.cursor.point, gb.cursor.point, "cursor {when}"); + assert_eq!(ga.cursor.input_needs_wrap, gb.cursor.input_needs_wrap, "pending wrap {when}"); + assert_eq!(Pen::of(&ga.cursor.template), Pen::of(&gb.cursor.template), "pen {when}"); + let relevant = TermMode::ANY - TermMode::VI; + assert_eq!(*ta.mode() & relevant, *tb.mode() & relevant, "modes {when}"); + assert_eq!(ta.cursor_style(), tb.cursor_style(), "cursor style {when}"); + let history = ga.history_size() as i32; + for line in -history..ta.screen_lines() as i32 { + for col in 0..ta.columns() { + let (ca, cb) = (&ga[Line(line)][Column(col)], &gb[Line(line)][Column(col)]); + let at = format!("cell {line},{col} {when}"); + assert_eq!(ca.c, cb.c, "{at}"); + assert_eq!(Pen::of(ca), Pen::of(cb), "{at}"); + assert_eq!(ca.flags & LAYOUT_FLAGS, cb.flags & LAYOUT_FLAGS, "{at}"); + assert_eq!(ca.zerowidth(), cb.zerowidth(), "{at}"); + } + } + }) + }); + } + + #[test] + fn styled_text_scrollback_and_wrapping() { + let mut bytes = Vec::new(); + for i in 0..12 { + bytes.extend(format!("\x1b[3{}mline {i}\x1b[0m plain\r\n", i % 8).as_bytes()); + } + bytes.extend(b"\x1b[1;4:3;38;5;202;48;2;10;20;30mfancy\x1b[0m \x1b[7;9mrev\x1b[0m\r\n"); + bytes.extend("a long line that wraps across rows: 日本語 e\u{301} 0123456789\r\n".as_bytes()); + bytes.extend(b"\x1b[44m \x1b[0m trailing bg\r\n\x1b[32;1mpen left on "); + round_trip(20, 6, &bytes, b"more\r\n\r\nand more text that wraps around\r\n"); + } + + #[test] + fn pending_wrap_and_wide_glyphs_at_the_edge() { + let (_, copy) = round_trip(10, 4, "0123456789".as_bytes(), b"x"); + assert!(copy.plain_text().contains("0123456789\nx")); + round_trip(10, 4, "abcdefgh日".as_bytes(), "y".as_bytes()); + round_trip(10, 4, "abcdefghi日z".as_bytes(), b"\r\nnext"); + } + + #[test] + fn modes_cursor_and_title() { + let bytes = + b"\x1b]2;my title\x07\x1b[?1h\x1b=\x1b[?2004h\x1b[?1002h\x1b[?1006h\x1b[?1004h\x1b[?25l\x1b[6 q\x1b[3;4Hx"; + let (source, _) = round_trip(20, 5, bytes, b"\x1b[?25hy"); + source.feed(b"\x1b[?25l"); + let modes = source.replay(0).modes; + assert_eq!(modes.title.as_deref(), Some("my title")); + assert!(modes.app_cursor && modes.app_keypad && modes.bracketed_paste && modes.focus_reporting); + assert_eq!(modes.mouse, Some(MouseProtocol { tracking: MouseTracking::Drag, encoding: MouseEncoding::Sgr })); + assert!(!modes.cursor_visible); + assert_eq!((modes.cursor_shape, modes.cursor_blinking), (CursorShape::Bar, false)); + } + + #[test] + fn alternate_screen() { + let bytes = b"shell output\r\n$ vim\r\n\x1b[?1049h\x1b[H\x1b[2J\x1b[7m status \x1b[0m\x1b[2;1H~\x1b[3;1H~"; + let (source, copy) = round_trip(20, 5, bytes, b"\x1b[4;1Hedit"); + assert!(source.replay(0).modes.alt_screen); + // Leaving it shows the normal screen, which the replay could not carry. + copy.feed(b"\x1b[?1049l"); + assert!(!copy.replay(0).modes.alt_screen); + } + + #[test] + fn scrollback_is_capped() { + let t = terminal(20, 3); + for i in 0..50 { + t.feed(format!("row {i}\r\n").as_bytes()); + } + let copy = terminal(20, 3); + copy.feed(t.replay(10).data.as_bytes()); + let text = copy.plain_text(); + assert!(text.starts_with("row 38\n"), "{text}"); + assert!(text.ends_with("row 49")); + } +} From f03389a172376b6cebda09cb6947d1ef14558388 Mon Sep 17 00:00:00 2001 From: ForeverInLaw <44206490+ForeverInLaw@users.noreply.github.com> Date: Fri, 4 Dec 2026 12:35:17 +0000 Subject: [PATCH 004/128] protocol: add the wire types shared by the server, the desktop and the PWA --- Cargo.lock | 32 +++ Cargo.toml | 2 + crates/redshell-protocol/Cargo.toml | 16 ++ crates/redshell-protocol/src/api.rs | 125 ++++++++++++ crates/redshell-protocol/src/lib.rs | 84 ++++++++ crates/redshell-protocol/src/session.rs | 206 +++++++++++++++++++ crates/redshell-protocol/src/ws.rs | 236 ++++++++++++++++++++++ web/src/protocol/AgentState.ts | 6 + web/src/protocol/ApiError.ts | 12 ++ web/src/protocol/Approval.ts | 24 +++ web/src/protocol/ApprovalAnswer.ts | 11 + web/src/protocol/ApprovalDecision.ts | 3 + web/src/protocol/ApprovalOutcome.ts | 6 + web/src/protocol/BrowserSession.ts | 10 + web/src/protocol/ChangePasswordRequest.ts | 6 + web/src/protocol/ClientMessage.ts | 7 + web/src/protocol/CreateSessionRequest.ts | 15 ++ web/src/protocol/CursorShape.ts | 3 + web/src/protocol/Device.ts | 10 + web/src/protocol/ErrorCode.ts | 3 + web/src/protocol/EventKind.ts | 3 + web/src/protocol/ExitState.ts | 10 + web/src/protocol/Modes.ts | 13 ++ web/src/protocol/MouseEncoding.ts | 3 + web/src/protocol/MouseTracking.ts | 3 + web/src/protocol/Profile.ts | 19 ++ web/src/protocol/RenameSessionRequest.ts | 6 + web/src/protocol/ServerInfo.ts | 19 ++ web/src/protocol/ServerMessage.ts | 13 ++ web/src/protocol/SessionEvent.ts | 7 + web/src/protocol/SessionInfo.ts | 47 +++++ web/src/protocol/SessionKind.ts | 6 + web/src/protocol/SetupRequest.ts | 7 + web/src/protocol/SignInRequest.ts | 8 + web/src/protocol/SignInResponse.ts | 9 + web/src/protocol/Snapshot.ts | 9 + web/src/protocol/User.ts | 6 + web/src/protocol/index.ts | 34 ++++ web/src/protocol/serde_json/JsonValue.ts | 3 + 39 files changed, 1042 insertions(+) create mode 100644 crates/redshell-protocol/Cargo.toml create mode 100644 crates/redshell-protocol/src/api.rs create mode 100644 crates/redshell-protocol/src/lib.rs create mode 100644 crates/redshell-protocol/src/session.rs create mode 100644 crates/redshell-protocol/src/ws.rs create mode 100644 web/src/protocol/AgentState.ts create mode 100644 web/src/protocol/ApiError.ts create mode 100644 web/src/protocol/Approval.ts create mode 100644 web/src/protocol/ApprovalAnswer.ts create mode 100644 web/src/protocol/ApprovalDecision.ts create mode 100644 web/src/protocol/ApprovalOutcome.ts create mode 100644 web/src/protocol/BrowserSession.ts create mode 100644 web/src/protocol/ChangePasswordRequest.ts create mode 100644 web/src/protocol/ClientMessage.ts create mode 100644 web/src/protocol/CreateSessionRequest.ts create mode 100644 web/src/protocol/CursorShape.ts create mode 100644 web/src/protocol/Device.ts create mode 100644 web/src/protocol/ErrorCode.ts create mode 100644 web/src/protocol/EventKind.ts create mode 100644 web/src/protocol/ExitState.ts create mode 100644 web/src/protocol/Modes.ts create mode 100644 web/src/protocol/MouseEncoding.ts create mode 100644 web/src/protocol/MouseTracking.ts create mode 100644 web/src/protocol/Profile.ts create mode 100644 web/src/protocol/RenameSessionRequest.ts create mode 100644 web/src/protocol/ServerInfo.ts create mode 100644 web/src/protocol/ServerMessage.ts create mode 100644 web/src/protocol/SessionEvent.ts create mode 100644 web/src/protocol/SessionInfo.ts create mode 100644 web/src/protocol/SessionKind.ts create mode 100644 web/src/protocol/SetupRequest.ts create mode 100644 web/src/protocol/SignInRequest.ts create mode 100644 web/src/protocol/SignInResponse.ts create mode 100644 web/src/protocol/Snapshot.ts create mode 100644 web/src/protocol/User.ts create mode 100644 web/src/protocol/index.ts create mode 100644 web/src/protocol/serde_json/JsonValue.ts diff --git a/Cargo.lock b/Cargo.lock index d6308c9..8c2bf56 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4837,6 +4837,15 @@ dependencies = [ "toml 0.9.12+spec-1.1.0", ] +[[package]] +name = "redshell-protocol" +version = "0.0.2" +dependencies = [ + "serde", + "serde_json", + "ts-rs", +] + [[package]] name = "redshell-remote" version = "0.0.2" @@ -6415,6 +6424,29 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" +[[package]] +name = "ts-rs" +version = "12.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "756050066659291d47a554a9f558125db17428b073c5ffce1daf5dcb0f7231d8" +dependencies = [ + "serde_json", + "thiserror 2.0.21", + "ts-rs-macros", +] + +[[package]] +name = "ts-rs-macros" +version = "12.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38d90eea51bc7988ef9e674bf80a85ba6804739e535e9cab48e4bb34a8b652aa" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", + "termcolor", +] + [[package]] name = "ttf-parser" version = "0.20.0" diff --git a/Cargo.toml b/Cargo.toml index e0a6411..0a55df5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,6 +10,7 @@ members = [ "crates/redshell-plugin", "crates/redshell-ui", "crates/redshell-app", + "crates/redshell-protocol", ] default-members = ["crates/redshell-app"] @@ -29,6 +30,7 @@ redshell-remote = { path = "crates/redshell-remote" } redshell-agents = { path = "crates/redshell-agents" } redshell-plugin = { path = "crates/redshell-plugin" } redshell-ui = { path = "crates/redshell-ui" } +redshell-protocol = { path = "crates/redshell-protocol" } gpui = "0.2.2" alacritty_terminal = "0.26.0" diff --git a/crates/redshell-protocol/Cargo.toml b/crates/redshell-protocol/Cargo.toml new file mode 100644 index 0000000..bdb7738 --- /dev/null +++ b/crates/redshell-protocol/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "redshell-protocol" +description = "Wire types shared by redshell-server, the desktop client and (as TypeScript) the PWA." +version.workspace = true +edition.workspace = true +license.workspace = true +repository.workspace = true +rust-version.workspace = true + +[dependencies] +serde.workspace = true +serde_json.workspace = true + +[dev-dependencies] +# Test builds derive `TS` and write the TypeScript definitions into web/src/protocol. +ts-rs = { version = "12", features = ["serde-json-impl", "no-serde-warnings"] } diff --git a/crates/redshell-protocol/src/api.rs b/crates/redshell-protocol/src/api.rs new file mode 100644 index 0000000..f84c89a --- /dev/null +++ b/crates/redshell-protocol/src/api.rs @@ -0,0 +1,125 @@ +//! REST bodies: server info, setup, sign-in, the account and errors. + +use serde::{Deserialize, Serialize}; + +/// `GET /api/auth/info`, open to everyone: what a client needs before it +/// signs in. +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[cfg_attr(test, derive(ts_rs::TS))] +pub struct ServerInfo { + /// `redshell-server` version. + pub version: String, + /// [`crate::PROTOCOL_VERSION`] of the server. + pub protocol_version: u32, + /// No account exists yet: the setup link from the server log creates one. + pub setup_required: bool, +} + +/// `POST /api/setup`: creates the first account with the one-time code +/// from the server log, and signs the browser in. +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[cfg_attr(test, derive(ts_rs::TS))] +pub struct SetupRequest { + pub code: String, + pub username: String, + pub password: String, +} + +/// `POST /api/auth/sign-in`. Without `device_name` the browser gets a +/// session cookie; with it, the response carries a bearer device token for +/// that device (the desktop) and no cookie is set. +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[cfg_attr(test, derive(ts_rs::TS))] +pub struct SignInRequest { + pub username: String, + pub password: String, + #[serde(default, skip_serializing_if = "Option::is_none")] + #[cfg_attr(test, ts(optional))] + pub device_name: Option, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[cfg_attr(test, derive(ts_rs::TS))] +pub struct SignInResponse { + pub user: User, + /// Bearer token (`Authorization: Bearer …`), shown once. Only when the + /// request named a device. + pub device_token: Option, +} + +/// `GET /api/auth/me`. +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[cfg_attr(test, derive(ts_rs::TS))] +pub struct User { + pub id: i64, + pub username: String, + pub created_at: i64, +} + +/// `POST /api/account/password`. Signs out every other browser and device. +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[cfg_attr(test, derive(ts_rs::TS))] +pub struct ChangePasswordRequest { + pub current_password: String, + pub new_password: String, +} + +/// A device signed in with a bearer token (`GET /api/account/devices`). +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[cfg_attr(test, derive(ts_rs::TS))] +pub struct Device { + pub id: i64, + pub name: String, + pub created_at: i64, + pub last_seen_at: i64, + pub last_ip: Option, + /// The device making this request. + pub current: bool, +} + +/// A signed-in browser (`GET /api/account/sessions`). +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[cfg_attr(test, derive(ts_rs::TS))] +pub struct BrowserSession { + pub id: i64, + pub created_at: i64, + pub last_seen_at: i64, + pub expires_at: i64, + pub last_ip: Option, + pub user_agent: Option, + /// The browser making this request. + pub current: bool, +} + +/// Body of every error response, and of WebSocket `error` messages. +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[cfg_attr(test, derive(ts_rs::TS))] +pub struct ApiError { + pub code: ErrorCode, + pub message: String, + /// With `rate_limited`: seconds until the next attempt is accepted + /// (also in the `Retry-After` header). + #[serde(default, skip_serializing_if = "Option::is_none")] + #[cfg_attr(test, ts(optional))] + pub retry_after_secs: Option, +} + +#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)] +#[cfg_attr(test, derive(ts_rs::TS))] +#[serde(rename_all = "snake_case")] +pub enum ErrorCode { + /// The request is malformed or a value is out of range. + BadRequest, + /// Wrong username or password; the same for an unknown user. + InvalidCredentials, + /// Not signed in, or the session or token is no longer valid. + Unauthorized, + /// Signed in, but not allowed (a foreign Origin, an expired setup code). + Forbidden, + NotFound, + /// The thing exists already, or setup was done. + Conflict, + /// Too many failed sign-ins; see `retry_after_secs`. + RateLimited, + Internal, +} diff --git a/crates/redshell-protocol/src/lib.rs b/crates/redshell-protocol/src/lib.rs new file mode 100644 index 0000000..09aacbe --- /dev/null +++ b/crates/redshell-protocol/src/lib.rs @@ -0,0 +1,84 @@ +//! # redshell-protocol +//! +//! Everything that crosses the wire between `redshell-server` and its +//! clients: REST request and response bodies ([`api`]), sessions, agents and +//! approvals ([`session`]), and the WebSocket messages and binary framing +//! ([`ws`]). The PWA uses the same types as TypeScript, generated into +//! `web/src/protocol/` by this crate's tests (`cargo test -p +//! redshell-protocol`), so there is one source of truth. +//! +//! Conventions: JSON field names are `snake_case`, enums are `snake_case` +//! strings, tagged unions carry a `type` field, timestamps are Unix +//! milliseconds and ids of sessions and approvals are opaque strings. +//! `docs/REMOTE.md` lists the endpoints. + +pub mod api; +pub mod session; +pub mod ws; + +pub use api::*; +pub use session::*; +pub use ws::*; + +/// Version of this protocol. It goes up on every change a client built +/// against the previous version would misread; additions that old clients +/// can ignore (a new optional field, a new message type) keep it. +pub const PROTOCOL_VERSION: u32 = 1; + +#[cfg(test)] +mod typescript { + use std::path::Path; + + use ts_rs::{Config, TS}; + + use super::*; + + /// Writes the TypeScript definitions into `web/src/protocol`. The files + /// are committed; a change here that is not committed shows up as a diff. + #[test] + fn export_typescript() { + let dir = Path::new(env!("CARGO_MANIFEST_DIR")).join("../../web/src/protocol"); + // Everything in the folder is generated: clear it so renamed types leave nothing behind. + if let Ok(entries) = std::fs::read_dir(&dir) { + for entry in entries.flatten().filter(|e| e.path().extension().is_some_and(|x| x == "ts")) { + std::fs::remove_file(entry.path()).unwrap(); + } + } + let cfg = Config::new().with_large_int("number").with_out_dir(&dir); + macro_rules! export { + ($($ty:ty),* $(,)?) => {{ + $(<$ty>::export_all(&cfg).expect(concat!("exporting ", stringify!($ty)));)* + }}; + } + export!( + ServerInfo, + SetupRequest, + SignInRequest, + SignInResponse, + ChangePasswordRequest, + Device, + BrowserSession, + ApiError, + Profile, + CreateSessionRequest, + RenameSessionRequest, + ApprovalAnswer, + ClientMessage, + ServerMessage, + ); + + let mut names: Vec = std::fs::read_dir(&dir) + .unwrap() + .filter_map(|e| e.ok()?.file_name().into_string().ok()) + .filter_map(|n| n.strip_suffix(".ts").map(str::to_owned)) + .filter(|n| n != "index") + .collect(); + names.sort(); + let mut index = String::from("// Generated by redshell-protocol's tests. Do not edit.\n\n"); + index.push_str(&format!("export const PROTOCOL_VERSION = {PROTOCOL_VERSION};\n\n")); + for name in names { + index.push_str(&format!("export type {{ {name} }} from \"./{name}\";\n")); + } + std::fs::write(dir.join("index.ts"), index).unwrap(); + } +} diff --git a/crates/redshell-protocol/src/session.rs b/crates/redshell-protocol/src/session.rs new file mode 100644 index 0000000..e466e37 --- /dev/null +++ b/crates/redshell-protocol/src/session.rs @@ -0,0 +1,206 @@ +//! Sessions, the profiles they start from, agent state, approvals and events. + +use serde::{Deserialize, Serialize}; + +/// What a session runs. +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)] +#[cfg_attr(test, derive(ts_rs::TS))] +#[serde(rename_all = "snake_case")] +pub enum SessionKind { + Shell, + /// A coding agent (Claude Code, Codex, …): see [`SessionInfo::agent`]. + Agent, + Ssh, + /// A custom command line. + Command, +} + +/// Something a session can be started from (`GET /api/profiles`). +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[cfg_attr(test, derive(ts_rs::TS))] +pub struct Profile { + /// `shell`, `agent:` or `ssh:`. + pub id: String, + pub name: String, + pub kind: SessionKind, + pub description: String, + /// `false` when the program is not installed on the server. + pub available: bool, + /// For SSH hosts: the folder they are listed under. + pub group: Option, +} + +/// `POST /api/sessions`. Starts `profile` (the default shell when absent), +/// or `command` when given; `cwd` is the folder it starts in. +#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +#[cfg_attr(test, derive(ts_rs::TS))] +pub struct CreateSessionRequest { + #[serde(default)] + #[cfg_attr(test, ts(optional))] + pub profile: Option, + /// Program and arguments, run without a shell. + #[serde(default)] + #[cfg_attr(test, ts(optional))] + pub command: Option>, + #[serde(default)] + #[cfg_attr(test, ts(optional))] + pub cwd: Option, + #[serde(default)] + #[cfg_attr(test, ts(optional))] + pub name: Option, + /// Initial size; 100 × 30 when absent. + #[serde(default)] + #[cfg_attr(test, ts(optional))] + pub cols: Option, + #[serde(default)] + #[cfg_attr(test, ts(optional))] + pub rows: Option, +} + +/// `PATCH /api/sessions/{id}`: a name, or `null` to go back to the title. +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[cfg_attr(test, derive(ts_rs::TS))] +pub struct RenameSessionRequest { + pub name: Option, +} + +/// Where an agent is in its turn, from its hooks. +#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)] +#[cfg_attr(test, derive(ts_rs::TS))] +#[serde(rename_all = "snake_case")] +pub enum AgentState { + /// Started, nothing asked yet. + Idle, + Working, + /// Waiting for an [`Approval`]. + NeedsApproval, + /// Waiting for the user to type (a question, an idle prompt). + NeedsInput, + /// The turn ended; [`SessionInfo::last_message`] has its last words. + Finished, +} + +/// How a session's program ended. +#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)] +#[cfg_attr(test, derive(ts_rs::TS))] +pub struct ExitState { + /// Exit code; `null` when the OS could not tell. + pub code: Option, + pub at: i64, +} + +/// A session on the server (`GET /api/sessions`, `sessions` messages). +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[cfg_attr(test, derive(ts_rs::TS))] +pub struct SessionInfo { + pub id: String, + /// The name a user gave it. + pub name: Option, + /// The program's title, else the profile's name. + pub title: String, + pub kind: SessionKind, + /// The profile it started from (`shell`, `agent:claude`, `ssh:prod`), + /// absent for a custom command. + pub profile: Option, + /// Agent id (`claude`, `codex`, …) for agent sessions. + pub agent: Option, + pub agent_state: Option, + /// The agent's last message when its turn finished. + pub last_message: Option, + pub cwd: Option, + pub cols: u16, + pub rows: u16, + pub created_at: i64, + /// Last output or input. + pub active_at: i64, + /// The last line of text on screen. + pub last_line: Option, + /// Set once the program exited. The session stays, with its final + /// screen, until it is killed. + pub exit: Option, + /// Approvals waiting for an answer. + pub pending_approvals: u32, +} + +/// A permission request an agent holds open until a client answers it. +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[cfg_attr(test, derive(ts_rs::TS))] +pub struct Approval { + pub id: String, + pub session: String, + /// Tool name, as the agent reports it (`Bash`, `Edit`, `WebFetch`, …). + pub tool: String, + /// The tool's input as the agent sent it (for `Bash`: `command`, + /// `description`; for `Edit`: `file_path`, `old_string`, `new_string`). + pub input: serde_json::Value, + /// One line for lists and notifications: the command, the file, the URL. + pub summary: String, + pub created_at: i64, + /// After this the agent asks in its own terminal. + pub expires_at: i64, +} + +/// `POST /api/approvals/{id}` and the `approve` message. +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[cfg_attr(test, derive(ts_rs::TS))] +pub struct ApprovalAnswer { + pub decision: ApprovalDecision, + /// With `deny`: told to the agent as the reason. + #[serde(default)] + #[cfg_attr(test, ts(optional))] + pub message: Option, +} + +#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)] +#[cfg_attr(test, derive(ts_rs::TS))] +#[serde(rename_all = "snake_case")] +pub enum ApprovalDecision { + Allow, + Deny, + /// No decision: the agent shows its own dialog in the terminal. + Terminal, +} + +/// How an approval ended. +#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)] +#[cfg_attr(test, derive(ts_rs::TS))] +#[serde(rename_all = "snake_case")] +pub enum ApprovalOutcome { + Allowed, + Denied, + /// Left to the agent's own dialog: a client chose to answer in the + /// terminal, or the agent moved on because it was answered there. + Terminal, + TimedOut, + /// The session ended or was killed. + Gone, +} + +/// Something a session wants the user to notice (`event` messages). +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[cfg_attr(test, derive(ts_rs::TS))] +pub struct SessionEvent { + pub session: String, + pub kind: EventKind, + pub title: Option, + pub body: Option, + pub at: i64, +} + +#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)] +#[cfg_attr(test, derive(ts_rs::TS))] +#[serde(rename_all = "snake_case")] +pub enum EventKind { + /// An agent asks for permission; an `approval_requested` message has it. + ApprovalRequested, + /// An agent waits for the user to type. + NeedsInput, + /// An agent finished its turn; `body` is its last message. + Finished, + /// The program asked for a desktop notification (OSC 9 / OSC 777). + Notification, + /// The program rang the bell. + Bell, + /// The program exited; `body` is the exit code. + Exited, +} diff --git a/crates/redshell-protocol/src/ws.rs b/crates/redshell-protocol/src/ws.rs new file mode 100644 index 0000000..901ab1e --- /dev/null +++ b/crates/redshell-protocol/src/ws.rs @@ -0,0 +1,236 @@ +//! The WebSocket at `/api/ws`: one per client. +//! +//! Text frames carry JSON [`ClientMessage`]s and [`ServerMessage`]s, tagged +//! by `type`. Binary frames carry terminal bytes for an attached session: +//! a 2-byte big-endian channel number (from [`ServerMessage::Attached`]) +//! followed by the bytes ([`frame`], [`unframe`]). From the server they are +//! program output, to be written to the client's terminal as they come; +//! from a client they are input, like [`ClientMessage::Input`] but for bytes +//! that are not UTF-8. +//! +//! The server's terminal answers the program's queries (device attributes, +//! cursor position, colours), so a client must not forward the replies its +//! own emulator generates while it draws the output. + +use serde::{Deserialize, Serialize}; + +use crate::api::{ErrorCode, User}; +use crate::session::{Approval, ApprovalDecision, ApprovalOutcome, SessionEvent, SessionInfo}; + +/// Messages a client sends. +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[cfg_attr(test, derive(ts_rs::TS))] +#[serde(tag = "type", rename_all = "snake_case")] +pub enum ClientMessage { + /// Starts streaming a session. The client's terminal is `cols` × `rows`; + /// the session takes that size once this client types into it. Answered + /// by `attached`, then binary output frames. + Attach { + session: String, + cols: u16, + rows: u16, + }, + Detach { + channel: u16, + }, + /// The client's terminal changed size. + Resize { + channel: u16, + cols: u16, + rows: u16, + }, + /// Keys or pasted text for the program, as the terminal encodes them. + Input { + channel: u16, + data: String, + }, + Rename { + session: String, + #[serde(default)] + name: Option, + }, + /// Chooses what is pushed besides attached sessions: the session list + /// (`sessions`, then `session_updated` / `session_removed`) and agent + /// activity (`approvals`, then `approval_requested` / `approval_resolved` + /// / `event`). Each call replaces the previous choice. + Subscribe { + sessions: bool, + events: bool, + }, + Approve { + approval: String, + decision: ApprovalDecision, + #[serde(default)] + message: Option, + }, +} + +/// Messages the server sends. +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[cfg_attr(test, derive(ts_rs::TS))] +#[serde(tag = "type", rename_all = "snake_case")] +pub enum ServerMessage { + /// First message on every connection. + Hello { + protocol_version: u32, + user: User, + }, + /// Reply to `attach`. Reset the terminal, size it to the snapshot and + /// write `snapshot.data`; binary frames on `channel` follow. + Attached { + channel: u16, + session: SessionInfo, + snapshot: Snapshot, + }, + /// The client fell behind and output was dropped: reset the terminal + /// and redraw it from this snapshot, as after `attached`. + Snapshot { + channel: u16, + snapshot: Snapshot, + }, + /// The session's size changed (another client typed, or a resize). + Resized { + channel: u16, + cols: u16, + rows: u16, + }, + /// The channel is closed: the session was killed, or on `detach`. + Detached { + channel: u16, + }, + Sessions { + sessions: Vec, + }, + SessionUpdated { + session: SessionInfo, + }, + SessionRemoved { + id: String, + }, + /// Approvals waiting when the client subscribed to events. + Approvals { + approvals: Vec, + }, + ApprovalRequested { + approval: Approval, + }, + ApprovalResolved { + id: String, + session: String, + outcome: ApprovalOutcome, + }, + Event { + event: SessionEvent, + }, + /// A message could not be carried out. + Error { + code: ErrorCode, + message: String, + }, +} + +/// A session's screen for a client that joins: see `redshell-terminal`'s +/// replay. `data` redraws the scrollback and screen in a terminal reset to +/// `cols` × `rows`, and sets the modes listed in `modes` as it goes. +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[cfg_attr(test, derive(ts_rs::TS))] +pub struct Snapshot { + pub cols: u16, + pub rows: u16, + pub data: String, + pub modes: Modes, +} + +/// Terminal modes a client needs to encode input and draw the screen. +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[cfg_attr(test, derive(ts_rs::TS))] +pub struct Modes { + pub alt_screen: bool, + pub app_cursor: bool, + pub app_keypad: bool, + pub bracketed_paste: bool, + /// Mouse events the program wants, `null` when it does not track it. + pub mouse_tracking: Option, + pub mouse_encoding: MouseEncoding, + pub focus_reporting: bool, + pub cursor_visible: bool, + pub cursor_shape: CursorShape, + pub cursor_blinking: bool, + pub title: Option, +} + +#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)] +#[cfg_attr(test, derive(ts_rs::TS))] +#[serde(rename_all = "snake_case")] +pub enum MouseTracking { + /// DECSET 1000: presses and releases. + Click, + /// DECSET 1002: also motion with a button held. + Drag, + /// DECSET 1003: all motion. + Motion, +} + +#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)] +#[cfg_attr(test, derive(ts_rs::TS))] +#[serde(rename_all = "snake_case")] +pub enum MouseEncoding { + Normal, + /// DECSET 1005. + Utf8, + /// DECSET 1006. + Sgr, +} + +#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)] +#[cfg_attr(test, derive(ts_rs::TS))] +#[serde(rename_all = "snake_case")] +pub enum CursorShape { + Block, + Bar, + Underline, + Hollow, + Hidden, +} + +/// A binary frame: `channel` as 2 big-endian bytes, then `bytes`. +pub fn frame(channel: u16, bytes: &[u8]) -> Vec { + let mut out = Vec::with_capacity(bytes.len() + 2); + out.extend_from_slice(&channel.to_be_bytes()); + out.extend_from_slice(bytes); + out +} + +/// The channel and bytes of a binary frame; `None` when it is too short. +pub fn unframe(frame: &[u8]) -> Option<(u16, &[u8])> { + let (channel, bytes) = frame.split_first_chunk::<2>()?; + Some((u16::from_be_bytes(*channel), bytes)) +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn frames_round_trip() { + let f = frame(0x0102, b"hi"); + assert_eq!(f, [1, 2, b'h', b'i']); + assert_eq!(unframe(&f), Some((0x0102, &b"hi"[..]))); + assert_eq!(unframe(&[7]), None); + assert_eq!(unframe(&[0, 7]), Some((7, &b""[..]))); + } + + #[test] + fn messages_are_tagged_snake_case() { + let msg: ClientMessage = + serde_json::from_str(r#"{"type":"attach","session":"s1","cols":80,"rows":24}"#).unwrap(); + assert_eq!(msg, ClientMessage::Attach { session: "s1".into(), cols: 80, rows: 24 }); + let approve = r#"{"type":"approve","approval":"a","decision":"terminal","message":null}"#; + assert!(matches!( + serde_json::from_str(approve).unwrap(), + ClientMessage::Approve { decision: ApprovalDecision::Terminal, .. } + )); + let out = serde_json::to_string(&ServerMessage::Detached { channel: 3 }).unwrap(); + assert_eq!(out, r#"{"type":"detached","channel":3}"#); + } +} diff --git a/web/src/protocol/AgentState.ts b/web/src/protocol/AgentState.ts new file mode 100644 index 0000000..1cbf841 --- /dev/null +++ b/web/src/protocol/AgentState.ts @@ -0,0 +1,6 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +/** + * Where an agent is in its turn, from its hooks. + */ +export type AgentState = "idle" | "working" | "needs_approval" | "needs_input" | "finished"; diff --git a/web/src/protocol/ApiError.ts b/web/src/protocol/ApiError.ts new file mode 100644 index 0000000..9d7c5d9 --- /dev/null +++ b/web/src/protocol/ApiError.ts @@ -0,0 +1,12 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { ErrorCode } from "./ErrorCode"; + +/** + * Body of every error response, and of WebSocket `error` messages. + */ +export type ApiError = { code: ErrorCode, message: string, +/** + * With `rate_limited`: seconds until the next attempt is accepted + * (also in the `Retry-After` header). + */ +retry_after_secs?: number, }; diff --git a/web/src/protocol/Approval.ts b/web/src/protocol/Approval.ts new file mode 100644 index 0000000..8e28d48 --- /dev/null +++ b/web/src/protocol/Approval.ts @@ -0,0 +1,24 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { JsonValue } from "./serde_json/JsonValue"; + +/** + * A permission request an agent holds open until a client answers it. + */ +export type Approval = { id: string, session: string, +/** + * Tool name, as the agent reports it (`Bash`, `Edit`, `WebFetch`, …). + */ +tool: string, +/** + * The tool's input as the agent sent it (for `Bash`: `command`, + * `description`; for `Edit`: `file_path`, `old_string`, `new_string`). + */ +input: JsonValue, +/** + * One line for lists and notifications: the command, the file, the URL. + */ +summary: string, created_at: number, +/** + * After this the agent asks in its own terminal. + */ +expires_at: number, }; diff --git a/web/src/protocol/ApprovalAnswer.ts b/web/src/protocol/ApprovalAnswer.ts new file mode 100644 index 0000000..a32778c --- /dev/null +++ b/web/src/protocol/ApprovalAnswer.ts @@ -0,0 +1,11 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { ApprovalDecision } from "./ApprovalDecision"; + +/** + * `POST /api/approvals/{id}` and the `approve` message. + */ +export type ApprovalAnswer = { decision: ApprovalDecision, +/** + * With `deny`: told to the agent as the reason. + */ +message?: string, }; diff --git a/web/src/protocol/ApprovalDecision.ts b/web/src/protocol/ApprovalDecision.ts new file mode 100644 index 0000000..40b6bb7 --- /dev/null +++ b/web/src/protocol/ApprovalDecision.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type ApprovalDecision = "allow" | "deny" | "terminal"; diff --git a/web/src/protocol/ApprovalOutcome.ts b/web/src/protocol/ApprovalOutcome.ts new file mode 100644 index 0000000..b566c41 --- /dev/null +++ b/web/src/protocol/ApprovalOutcome.ts @@ -0,0 +1,6 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +/** + * How an approval ended. + */ +export type ApprovalOutcome = "allowed" | "denied" | "terminal" | "timed_out" | "gone"; diff --git a/web/src/protocol/BrowserSession.ts b/web/src/protocol/BrowserSession.ts new file mode 100644 index 0000000..cfcfc89 --- /dev/null +++ b/web/src/protocol/BrowserSession.ts @@ -0,0 +1,10 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +/** + * A signed-in browser (`GET /api/account/sessions`). + */ +export type BrowserSession = { id: number, created_at: number, last_seen_at: number, expires_at: number, last_ip: string | null, user_agent: string | null, +/** + * The browser making this request. + */ +current: boolean, }; diff --git a/web/src/protocol/ChangePasswordRequest.ts b/web/src/protocol/ChangePasswordRequest.ts new file mode 100644 index 0000000..fd81e5b --- /dev/null +++ b/web/src/protocol/ChangePasswordRequest.ts @@ -0,0 +1,6 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +/** + * `POST /api/account/password`. Signs out every other browser and device. + */ +export type ChangePasswordRequest = { current_password: string, new_password: string, }; diff --git a/web/src/protocol/ClientMessage.ts b/web/src/protocol/ClientMessage.ts new file mode 100644 index 0000000..a320a8d --- /dev/null +++ b/web/src/protocol/ClientMessage.ts @@ -0,0 +1,7 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { ApprovalDecision } from "./ApprovalDecision"; + +/** + * Messages a client sends. + */ +export type ClientMessage = { "type": "attach", session: string, cols: number, rows: number, } | { "type": "detach", channel: number, } | { "type": "resize", channel: number, cols: number, rows: number, } | { "type": "input", channel: number, data: string, } | { "type": "rename", session: string, name: string | null, } | { "type": "subscribe", sessions: boolean, events: boolean, } | { "type": "approve", approval: string, decision: ApprovalDecision, message: string | null, }; diff --git a/web/src/protocol/CreateSessionRequest.ts b/web/src/protocol/CreateSessionRequest.ts new file mode 100644 index 0000000..0e3839a --- /dev/null +++ b/web/src/protocol/CreateSessionRequest.ts @@ -0,0 +1,15 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +/** + * `POST /api/sessions`. Starts `profile` (the default shell when absent), + * or `command` when given; `cwd` is the folder it starts in. + */ +export type CreateSessionRequest = { profile?: string, +/** + * Program and arguments, run without a shell. + */ +command?: Array, cwd?: string, name?: string, +/** + * Initial size; 100 × 30 when absent. + */ +cols?: number, rows?: number, }; diff --git a/web/src/protocol/CursorShape.ts b/web/src/protocol/CursorShape.ts new file mode 100644 index 0000000..d8979be --- /dev/null +++ b/web/src/protocol/CursorShape.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type CursorShape = "block" | "bar" | "underline" | "hollow" | "hidden"; diff --git a/web/src/protocol/Device.ts b/web/src/protocol/Device.ts new file mode 100644 index 0000000..ddc93a5 --- /dev/null +++ b/web/src/protocol/Device.ts @@ -0,0 +1,10 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +/** + * A device signed in with a bearer token (`GET /api/account/devices`). + */ +export type Device = { id: number, name: string, created_at: number, last_seen_at: number, last_ip: string | null, +/** + * The device making this request. + */ +current: boolean, }; diff --git a/web/src/protocol/ErrorCode.ts b/web/src/protocol/ErrorCode.ts new file mode 100644 index 0000000..023b6f7 --- /dev/null +++ b/web/src/protocol/ErrorCode.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type ErrorCode = "bad_request" | "invalid_credentials" | "unauthorized" | "forbidden" | "not_found" | "conflict" | "rate_limited" | "internal"; diff --git a/web/src/protocol/EventKind.ts b/web/src/protocol/EventKind.ts new file mode 100644 index 0000000..d12c31f --- /dev/null +++ b/web/src/protocol/EventKind.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type EventKind = "approval_requested" | "needs_input" | "finished" | "notification" | "bell" | "exited"; diff --git a/web/src/protocol/ExitState.ts b/web/src/protocol/ExitState.ts new file mode 100644 index 0000000..b962405 --- /dev/null +++ b/web/src/protocol/ExitState.ts @@ -0,0 +1,10 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +/** + * How a session's program ended. + */ +export type ExitState = { +/** + * Exit code; `null` when the OS could not tell. + */ +code: number | null, at: number, }; diff --git a/web/src/protocol/Modes.ts b/web/src/protocol/Modes.ts new file mode 100644 index 0000000..4ec14c7 --- /dev/null +++ b/web/src/protocol/Modes.ts @@ -0,0 +1,13 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { CursorShape } from "./CursorShape"; +import type { MouseEncoding } from "./MouseEncoding"; +import type { MouseTracking } from "./MouseTracking"; + +/** + * Terminal modes a client needs to encode input and draw the screen. + */ +export type Modes = { alt_screen: boolean, app_cursor: boolean, app_keypad: boolean, bracketed_paste: boolean, +/** + * Mouse events the program wants, `null` when it does not track it. + */ +mouse_tracking: MouseTracking | null, mouse_encoding: MouseEncoding, focus_reporting: boolean, cursor_visible: boolean, cursor_shape: CursorShape, cursor_blinking: boolean, title: string | null, }; diff --git a/web/src/protocol/MouseEncoding.ts b/web/src/protocol/MouseEncoding.ts new file mode 100644 index 0000000..5b7220e --- /dev/null +++ b/web/src/protocol/MouseEncoding.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type MouseEncoding = "normal" | "utf8" | "sgr"; diff --git a/web/src/protocol/MouseTracking.ts b/web/src/protocol/MouseTracking.ts new file mode 100644 index 0000000..06e63a8 --- /dev/null +++ b/web/src/protocol/MouseTracking.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type MouseTracking = "click" | "drag" | "motion"; diff --git a/web/src/protocol/Profile.ts b/web/src/protocol/Profile.ts new file mode 100644 index 0000000..e8bae92 --- /dev/null +++ b/web/src/protocol/Profile.ts @@ -0,0 +1,19 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { SessionKind } from "./SessionKind"; + +/** + * Something a session can be started from (`GET /api/profiles`). + */ +export type Profile = { +/** + * `shell`, `agent:` or `ssh:`. + */ +id: string, name: string, kind: SessionKind, description: string, +/** + * `false` when the program is not installed on the server. + */ +available: boolean, +/** + * For SSH hosts: the folder they are listed under. + */ +group: string | null, }; diff --git a/web/src/protocol/RenameSessionRequest.ts b/web/src/protocol/RenameSessionRequest.ts new file mode 100644 index 0000000..c91f22c --- /dev/null +++ b/web/src/protocol/RenameSessionRequest.ts @@ -0,0 +1,6 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +/** + * `PATCH /api/sessions/{id}`: a name, or `null` to go back to the title. + */ +export type RenameSessionRequest = { name: string | null, }; diff --git a/web/src/protocol/ServerInfo.ts b/web/src/protocol/ServerInfo.ts new file mode 100644 index 0000000..4203c11 --- /dev/null +++ b/web/src/protocol/ServerInfo.ts @@ -0,0 +1,19 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +/** + * `GET /api/auth/info`, open to everyone: what a client needs before it + * signs in. + */ +export type ServerInfo = { +/** + * `redshell-server` version. + */ +version: string, +/** + * [`crate::PROTOCOL_VERSION`] of the server. + */ +protocol_version: number, +/** + * No account exists yet: the setup link from the server log creates one. + */ +setup_required: boolean, }; diff --git a/web/src/protocol/ServerMessage.ts b/web/src/protocol/ServerMessage.ts new file mode 100644 index 0000000..b8a809b --- /dev/null +++ b/web/src/protocol/ServerMessage.ts @@ -0,0 +1,13 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { Approval } from "./Approval"; +import type { ApprovalOutcome } from "./ApprovalOutcome"; +import type { ErrorCode } from "./ErrorCode"; +import type { SessionEvent } from "./SessionEvent"; +import type { SessionInfo } from "./SessionInfo"; +import type { Snapshot } from "./Snapshot"; +import type { User } from "./User"; + +/** + * Messages the server sends. + */ +export type ServerMessage = { "type": "hello", protocol_version: number, user: User, } | { "type": "attached", channel: number, session: SessionInfo, snapshot: Snapshot, } | { "type": "snapshot", channel: number, snapshot: Snapshot, } | { "type": "resized", channel: number, cols: number, rows: number, } | { "type": "detached", channel: number, } | { "type": "sessions", sessions: Array, } | { "type": "session_updated", session: SessionInfo, } | { "type": "session_removed", id: string, } | { "type": "approvals", approvals: Array, } | { "type": "approval_requested", approval: Approval, } | { "type": "approval_resolved", id: string, session: string, outcome: ApprovalOutcome, } | { "type": "event", event: SessionEvent, } | { "type": "error", code: ErrorCode, message: string, }; diff --git a/web/src/protocol/SessionEvent.ts b/web/src/protocol/SessionEvent.ts new file mode 100644 index 0000000..7397ac2 --- /dev/null +++ b/web/src/protocol/SessionEvent.ts @@ -0,0 +1,7 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { EventKind } from "./EventKind"; + +/** + * Something a session wants the user to notice (`event` messages). + */ +export type SessionEvent = { session: string, kind: EventKind, title: string | null, body: string | null, at: number, }; diff --git a/web/src/protocol/SessionInfo.ts b/web/src/protocol/SessionInfo.ts new file mode 100644 index 0000000..84da269 --- /dev/null +++ b/web/src/protocol/SessionInfo.ts @@ -0,0 +1,47 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { AgentState } from "./AgentState"; +import type { ExitState } from "./ExitState"; +import type { SessionKind } from "./SessionKind"; + +/** + * A session on the server (`GET /api/sessions`, `sessions` messages). + */ +export type SessionInfo = { id: string, +/** + * The name a user gave it. + */ +name: string | null, +/** + * The program's title, else the profile's name. + */ +title: string, kind: SessionKind, +/** + * The profile it started from (`shell`, `agent:claude`, `ssh:prod`), + * absent for a custom command. + */ +profile: string | null, +/** + * Agent id (`claude`, `codex`, …) for agent sessions. + */ +agent: string | null, agent_state: AgentState | null, +/** + * The agent's last message when its turn finished. + */ +last_message: string | null, cwd: string | null, cols: number, rows: number, created_at: number, +/** + * Last output or input. + */ +active_at: number, +/** + * The last line of text on screen. + */ +last_line: string | null, +/** + * Set once the program exited. The session stays, with its final + * screen, until it is killed. + */ +exit: ExitState | null, +/** + * Approvals waiting for an answer. + */ +pending_approvals: number, }; diff --git a/web/src/protocol/SessionKind.ts b/web/src/protocol/SessionKind.ts new file mode 100644 index 0000000..bc680e3 --- /dev/null +++ b/web/src/protocol/SessionKind.ts @@ -0,0 +1,6 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +/** + * What a session runs. + */ +export type SessionKind = "shell" | "agent" | "ssh" | "command"; diff --git a/web/src/protocol/SetupRequest.ts b/web/src/protocol/SetupRequest.ts new file mode 100644 index 0000000..829cc90 --- /dev/null +++ b/web/src/protocol/SetupRequest.ts @@ -0,0 +1,7 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +/** + * `POST /api/setup`: creates the first account with the one-time code + * from the server log, and signs the browser in. + */ +export type SetupRequest = { code: string, username: string, password: string, }; diff --git a/web/src/protocol/SignInRequest.ts b/web/src/protocol/SignInRequest.ts new file mode 100644 index 0000000..e0271ba --- /dev/null +++ b/web/src/protocol/SignInRequest.ts @@ -0,0 +1,8 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +/** + * `POST /api/auth/sign-in`. Without `device_name` the browser gets a + * session cookie; with it, the response carries a bearer device token for + * that device (the desktop) and no cookie is set. + */ +export type SignInRequest = { username: string, password: string, device_name?: string, }; diff --git a/web/src/protocol/SignInResponse.ts b/web/src/protocol/SignInResponse.ts new file mode 100644 index 0000000..bd95056 --- /dev/null +++ b/web/src/protocol/SignInResponse.ts @@ -0,0 +1,9 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { User } from "./User"; + +export type SignInResponse = { user: User, +/** + * Bearer token (`Authorization: Bearer …`), shown once. Only when the + * request named a device. + */ +device_token: string | null, }; diff --git a/web/src/protocol/Snapshot.ts b/web/src/protocol/Snapshot.ts new file mode 100644 index 0000000..0bb04cf --- /dev/null +++ b/web/src/protocol/Snapshot.ts @@ -0,0 +1,9 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { Modes } from "./Modes"; + +/** + * A session's screen for a client that joins: see `redshell-terminal`'s + * replay. `data` redraws the scrollback and screen in a terminal reset to + * `cols` × `rows`, and sets the modes listed in `modes` as it goes. + */ +export type Snapshot = { cols: number, rows: number, data: string, modes: Modes, }; diff --git a/web/src/protocol/User.ts b/web/src/protocol/User.ts new file mode 100644 index 0000000..26fb4b1 --- /dev/null +++ b/web/src/protocol/User.ts @@ -0,0 +1,6 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +/** + * `GET /api/auth/me`. + */ +export type User = { id: number, username: string, created_at: number, }; diff --git a/web/src/protocol/index.ts b/web/src/protocol/index.ts new file mode 100644 index 0000000..cb79249 --- /dev/null +++ b/web/src/protocol/index.ts @@ -0,0 +1,34 @@ +// Generated by redshell-protocol's tests. Do not edit. + +export const PROTOCOL_VERSION = 1; + +export type { AgentState } from "./AgentState"; +export type { ApiError } from "./ApiError"; +export type { Approval } from "./Approval"; +export type { ApprovalAnswer } from "./ApprovalAnswer"; +export type { ApprovalDecision } from "./ApprovalDecision"; +export type { ApprovalOutcome } from "./ApprovalOutcome"; +export type { BrowserSession } from "./BrowserSession"; +export type { ChangePasswordRequest } from "./ChangePasswordRequest"; +export type { ClientMessage } from "./ClientMessage"; +export type { CreateSessionRequest } from "./CreateSessionRequest"; +export type { CursorShape } from "./CursorShape"; +export type { Device } from "./Device"; +export type { ErrorCode } from "./ErrorCode"; +export type { EventKind } from "./EventKind"; +export type { ExitState } from "./ExitState"; +export type { Modes } from "./Modes"; +export type { MouseEncoding } from "./MouseEncoding"; +export type { MouseTracking } from "./MouseTracking"; +export type { Profile } from "./Profile"; +export type { RenameSessionRequest } from "./RenameSessionRequest"; +export type { ServerInfo } from "./ServerInfo"; +export type { ServerMessage } from "./ServerMessage"; +export type { SessionEvent } from "./SessionEvent"; +export type { SessionInfo } from "./SessionInfo"; +export type { SessionKind } from "./SessionKind"; +export type { SetupRequest } from "./SetupRequest"; +export type { SignInRequest } from "./SignInRequest"; +export type { SignInResponse } from "./SignInResponse"; +export type { Snapshot } from "./Snapshot"; +export type { User } from "./User"; diff --git a/web/src/protocol/serde_json/JsonValue.ts b/web/src/protocol/serde_json/JsonValue.ts new file mode 100644 index 0000000..320a852 --- /dev/null +++ b/web/src/protocol/serde_json/JsonValue.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type JsonValue = number | string | boolean | Array | { [key in string]: JsonValue } | null; From d6080ddfda01a6404bb70e025d64780b880d39ff Mon Sep 17 00:00:00 2001 From: ForeverInLaw <44206490+ForeverInLaw@users.noreply.github.com> Date: Fri, 4 Dec 2026 12:38:03 +0000 Subject: [PATCH 005/128] terminal: let a Terminal be shared between threads --- crates/redshell-terminal/src/engine.rs | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/crates/redshell-terminal/src/engine.rs b/crates/redshell-terminal/src/engine.rs index 2346394..ff721a3 100644 --- a/crates/redshell-terminal/src/engine.rs +++ b/crates/redshell-terminal/src/engine.rs @@ -275,7 +275,9 @@ impl Default for TerminalOptions { } struct PtyHandle { - master: Box, + /// Locked so a [`Terminal`] can be shared between threads (a server + /// writes input on one and resizes or kills from others). + master: Mutex>, killer: Mutex>, pid: Option, /// The shell is a WSL launcher `bash.exe`, whose programs run in the WSL @@ -442,7 +444,7 @@ impl Terminal { shared, events, pty: Some(PtyHandle { - master: pair.master, + master: Mutex::new(pair.master), killer: Mutex::new(killer), pid, #[cfg(windows)] @@ -533,7 +535,7 @@ impl Terminal { *self.shared.size.write() = size; resize_keeping_top(&mut self.term.lock(), size); if let Some(pty) = &self.pty { - let _ = pty.master.resize(size.pty()); + let _ = pty.master.lock().resize(size.pty()); } if let Some(io) = &self.external { io.resize(size); @@ -796,7 +798,7 @@ impl Terminal { #[cfg(unix)] { if let Some(pty) = &self.pty - && let (Some(leader), Some(pid)) = (pty.master.process_group_leader(), pty.pid) + && let (Some(leader), Some(pid)) = (pty.master.lock().process_group_leader(), pty.pid) { return leader as u32 != pid; } @@ -842,7 +844,7 @@ impl Terminal { pub fn kill(&self) { if let Some(pty) = self.pty.as_ref() { #[cfg(unix)] - disable_eof(pty.master.as_ref()); + disable_eof(pty.master.lock().as_ref()); let _ = pty.killer.lock().kill(); } if let Some(io) = self.external.as_ref() { @@ -1015,6 +1017,12 @@ mod tests { assert_eq!(encode_paste("a\nb\x1b[201~", t.input_modes()), b"\x1b[200~a\rb\x1b[201~"); } + #[test] + fn terminals_can_be_shared_between_threads() { + fn shareable() {} + shareable::(); + } + #[test] fn prompt_stripping() { assert_eq!(strip_prompt("user@box:~$ ls -la").as_deref(), Some("ls -la")); From b1b66267c816ba747ca7544aa281d4931b279916 Mon Sep 17 00:00:00 2001 From: ForeverInLaw <44206490+ForeverInLaw@users.noreply.github.com> Date: Fri, 4 Dec 2026 13:06:09 +0000 Subject: [PATCH 006/128] terminal: build the notification test's observer only on Unix, where it runs --- crates/redshell-terminal/src/engine.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/redshell-terminal/src/engine.rs b/crates/redshell-terminal/src/engine.rs index ff721a3..54c7eed 100644 --- a/crates/redshell-terminal/src/engine.rs +++ b/crates/redshell-terminal/src/engine.rs @@ -1213,9 +1213,11 @@ mod tests { assert!(t.plain_text().contains("hi-from-pty")); } + #[cfg(unix)] #[derive(Clone, Default)] struct Alerts(Arc>>); + #[cfg(unix)] impl SessionObserver for Alerts { fn on_output(&mut self, _bytes: &[u8]) {} fn on_bell(&mut self) { From 713a2a1321780fac8b3b6a6718d398b56addda9a Mon Sep 17 00:00:00 2001 From: ForeverInLaw <44206490+ForeverInLaw@users.noreply.github.com> Date: Fri, 4 Dec 2026 13:06:40 +0000 Subject: [PATCH 007/128] protocol: carry folder listings, start-again details, approval suggestions and who answered --- crates/redshell-protocol/src/api.rs | 15 +++++++++++++++ crates/redshell-protocol/src/lib.rs | 1 + crates/redshell-protocol/src/session.rs | 16 ++++++++++++++++ crates/redshell-protocol/src/ws.rs | 4 ++++ web/src/protocol/Approval.ts | 12 +++++++++++- web/src/protocol/ApprovalDecision.ts | 2 +- web/src/protocol/FolderListing.ts | 19 +++++++++++++++++++ web/src/protocol/ServerInfo.ts | 6 +++++- web/src/protocol/ServerMessage.ts | 8 +++++++- web/src/protocol/SessionInfo.ts | 13 +++++++++++++ web/src/protocol/index.ts | 1 + 11 files changed, 93 insertions(+), 4 deletions(-) create mode 100644 web/src/protocol/FolderListing.ts diff --git a/crates/redshell-protocol/src/api.rs b/crates/redshell-protocol/src/api.rs index f84c89a..13d6954 100644 --- a/crates/redshell-protocol/src/api.rs +++ b/crates/redshell-protocol/src/api.rs @@ -13,6 +13,8 @@ pub struct ServerInfo { pub protocol_version: u32, /// No account exists yet: the setup link from the server log creates one. pub setup_required: bool, + /// Shortest password accepted (the only rule). + pub min_password_length: u32, } /// `POST /api/setup`: creates the first account with the one-time code @@ -91,6 +93,19 @@ pub struct BrowserSession { pub current: bool, } +/// `GET /api/fs/folders?path=`: the folders in a folder +/// on the server, for completing paths. Files are not listed. +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[cfg_attr(test, derive(ts_rs::TS))] +pub struct FolderListing { + /// The folder listed, as given. + pub path: String, + /// Names of its subfolders, sorted. + pub folders: Vec, + /// More folders exist than were listed. + pub truncated: bool, +} + /// Body of every error response, and of WebSocket `error` messages. #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] #[cfg_attr(test, derive(ts_rs::TS))] diff --git a/crates/redshell-protocol/src/lib.rs b/crates/redshell-protocol/src/lib.rs index 09aacbe..9795f64 100644 --- a/crates/redshell-protocol/src/lib.rs +++ b/crates/redshell-protocol/src/lib.rs @@ -57,6 +57,7 @@ mod typescript { SignInResponse, ChangePasswordRequest, Device, + FolderListing, BrowserSession, ApiError, Profile, diff --git a/crates/redshell-protocol/src/session.rs b/crates/redshell-protocol/src/session.rs index e466e37..5bf44b1 100644 --- a/crates/redshell-protocol/src/session.rs +++ b/crates/redshell-protocol/src/session.rs @@ -102,6 +102,13 @@ pub struct SessionInfo { /// The profile it started from (`shell`, `agent:claude`, `ssh:prod`), /// absent for a custom command. pub profile: Option, + /// That profile's name (`Claude Code`, `prod`). + pub profile_name: Option, + /// The custom command it runs, when it was started from one. + pub command: Option>, + /// The folder it was started in: with `profile` or `command`, enough to + /// start it again. + pub start_cwd: Option, /// Agent id (`claude`, `codex`, …) for agent sessions. pub agent: Option, pub agent_state: Option, @@ -135,6 +142,12 @@ pub struct Approval { pub input: serde_json::Value, /// One line for lists and notifications: the command, the file, the URL. pub summary: String, + /// What the agent says the call does (`tool_input.description`). + pub description: Option, + /// Permission rules the agent suggests (Claude Code's + /// `permission_suggestions`); `allow_always` applies them. Absent when + /// there are none, and then "always" is not offered. + pub permission_suggestions: Option, pub created_at: i64, /// After this the agent asks in its own terminal. pub expires_at: i64, @@ -156,6 +169,9 @@ pub struct ApprovalAnswer { #[serde(rename_all = "snake_case")] pub enum ApprovalDecision { Allow, + /// Allow, and apply the approval's `permission_suggestions` so the agent + /// does not ask again. + AllowAlways, Deny, /// No decision: the agent shows its own dialog in the terminal. Terminal, diff --git a/crates/redshell-protocol/src/ws.rs b/crates/redshell-protocol/src/ws.rs index 901ab1e..3692378 100644 --- a/crates/redshell-protocol/src/ws.rs +++ b/crates/redshell-protocol/src/ws.rs @@ -118,6 +118,10 @@ pub enum ServerMessage { id: String, session: String, outcome: ApprovalOutcome, + /// Who answered: a device's name, `browser`, or `terminal` when the + /// agent went on after an answer in its own dialog. `null` when it + /// timed out or the session ended. + answered_by: Option, }, Event { event: SessionEvent, diff --git a/web/src/protocol/Approval.ts b/web/src/protocol/Approval.ts index 8e28d48..4153961 100644 --- a/web/src/protocol/Approval.ts +++ b/web/src/protocol/Approval.ts @@ -17,7 +17,17 @@ input: JsonValue, /** * One line for lists and notifications: the command, the file, the URL. */ -summary: string, created_at: number, +summary: string, +/** + * What the agent says the call does (`tool_input.description`). + */ +description: string | null, +/** + * Permission rules the agent suggests (Claude Code's + * `permission_suggestions`); `allow_always` applies them. Absent when + * there are none, and then "always" is not offered. + */ +permission_suggestions: JsonValue | null, created_at: number, /** * After this the agent asks in its own terminal. */ diff --git a/web/src/protocol/ApprovalDecision.ts b/web/src/protocol/ApprovalDecision.ts index 40b6bb7..3d2e632 100644 --- a/web/src/protocol/ApprovalDecision.ts +++ b/web/src/protocol/ApprovalDecision.ts @@ -1,3 +1,3 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export type ApprovalDecision = "allow" | "deny" | "terminal"; +export type ApprovalDecision = "allow" | "allow_always" | "deny" | "terminal"; diff --git a/web/src/protocol/FolderListing.ts b/web/src/protocol/FolderListing.ts new file mode 100644 index 0000000..a9ed637 --- /dev/null +++ b/web/src/protocol/FolderListing.ts @@ -0,0 +1,19 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +/** + * `GET /api/fs/folders?path=`: the folders in a folder + * on the server, for completing paths. Files are not listed. + */ +export type FolderListing = { +/** + * The folder listed, as given. + */ +path: string, +/** + * Names of its subfolders, sorted. + */ +folders: Array, +/** + * More folders exist than were listed. + */ +truncated: boolean, }; diff --git a/web/src/protocol/ServerInfo.ts b/web/src/protocol/ServerInfo.ts index 4203c11..a91d3f4 100644 --- a/web/src/protocol/ServerInfo.ts +++ b/web/src/protocol/ServerInfo.ts @@ -16,4 +16,8 @@ protocol_version: number, /** * No account exists yet: the setup link from the server log creates one. */ -setup_required: boolean, }; +setup_required: boolean, +/** + * Shortest password accepted (the only rule). + */ +min_password_length: number, }; diff --git a/web/src/protocol/ServerMessage.ts b/web/src/protocol/ServerMessage.ts index b8a809b..bf0d530 100644 --- a/web/src/protocol/ServerMessage.ts +++ b/web/src/protocol/ServerMessage.ts @@ -10,4 +10,10 @@ import type { User } from "./User"; /** * Messages the server sends. */ -export type ServerMessage = { "type": "hello", protocol_version: number, user: User, } | { "type": "attached", channel: number, session: SessionInfo, snapshot: Snapshot, } | { "type": "snapshot", channel: number, snapshot: Snapshot, } | { "type": "resized", channel: number, cols: number, rows: number, } | { "type": "detached", channel: number, } | { "type": "sessions", sessions: Array, } | { "type": "session_updated", session: SessionInfo, } | { "type": "session_removed", id: string, } | { "type": "approvals", approvals: Array, } | { "type": "approval_requested", approval: Approval, } | { "type": "approval_resolved", id: string, session: string, outcome: ApprovalOutcome, } | { "type": "event", event: SessionEvent, } | { "type": "error", code: ErrorCode, message: string, }; +export type ServerMessage = { "type": "hello", protocol_version: number, user: User, } | { "type": "attached", channel: number, session: SessionInfo, snapshot: Snapshot, } | { "type": "snapshot", channel: number, snapshot: Snapshot, } | { "type": "resized", channel: number, cols: number, rows: number, } | { "type": "detached", channel: number, } | { "type": "sessions", sessions: Array, } | { "type": "session_updated", session: SessionInfo, } | { "type": "session_removed", id: string, } | { "type": "approvals", approvals: Array, } | { "type": "approval_requested", approval: Approval, } | { "type": "approval_resolved", id: string, session: string, outcome: ApprovalOutcome, +/** + * Who answered: a device's name, `browser`, or `terminal` when the + * agent went on after an answer in its own dialog. `null` when it + * timed out or the session ended. + */ +answered_by: string | null, } | { "type": "event", event: SessionEvent, } | { "type": "error", code: ErrorCode, message: string, }; diff --git a/web/src/protocol/SessionInfo.ts b/web/src/protocol/SessionInfo.ts index 84da269..672531c 100644 --- a/web/src/protocol/SessionInfo.ts +++ b/web/src/protocol/SessionInfo.ts @@ -20,6 +20,19 @@ title: string, kind: SessionKind, * absent for a custom command. */ profile: string | null, +/** + * That profile's name (`Claude Code`, `prod`). + */ +profile_name: string | null, +/** + * The custom command it runs, when it was started from one. + */ +command: Array | null, +/** + * The folder it was started in: with `profile` or `command`, enough to + * start it again. + */ +start_cwd: string | null, /** * Agent id (`claude`, `codex`, …) for agent sessions. */ diff --git a/web/src/protocol/index.ts b/web/src/protocol/index.ts index cb79249..a08b317 100644 --- a/web/src/protocol/index.ts +++ b/web/src/protocol/index.ts @@ -17,6 +17,7 @@ export type { Device } from "./Device"; export type { ErrorCode } from "./ErrorCode"; export type { EventKind } from "./EventKind"; export type { ExitState } from "./ExitState"; +export type { FolderListing } from "./FolderListing"; export type { Modes } from "./Modes"; export type { MouseEncoding } from "./MouseEncoding"; export type { MouseTracking } from "./MouseTracking"; From 5d8693f91c6ccc14cbdb1372e490bff2e5db538b Mon Sep 17 00:00:00 2001 From: ForeverInLaw <44206490+ForeverInLaw@users.noreply.github.com> Date: Fri, 4 Dec 2026 13:06:40 +0000 Subject: [PATCH 008/128] server: add redshell-server, server-owned sessions for the desktop and the PWA --- Cargo.lock | 391 ++++++++++++- Cargo.toml | 1 + crates/redshell-server/Cargo.toml | 54 ++ crates/redshell-server/build.rs | 16 + crates/redshell-server/placeholder/index.html | 14 + .../redshell-server/src/agents/approvals.rs | 150 +++++ crates/redshell-server/src/agents/claude.rs | 206 +++++++ crates/redshell-server/src/agents/codex.rs | 76 +++ crates/redshell-server/src/agents/hooks.rs | 118 ++++ crates/redshell-server/src/agents/mod.rs | 60 ++ crates/redshell-server/src/auth/limiter.rs | 92 +++ crates/redshell-server/src/auth/mod.rs | 391 +++++++++++++ crates/redshell-server/src/auth/password.rs | 76 +++ crates/redshell-server/src/auth/secret.rs | 42 ++ crates/redshell-server/src/bus.rs | 51 ++ crates/redshell-server/src/cli.rs | 85 +++ crates/redshell-server/src/config.rs | 190 ++++++ crates/redshell-server/src/lib.rs | 148 +++++ crates/redshell-server/src/main.rs | 124 ++++ crates/redshell-server/src/sessions/launch.rs | 188 ++++++ crates/redshell-server/src/sessions/mod.rs | 142 +++++ crates/redshell-server/src/sessions/output.rs | 90 +++ .../redshell-server/src/sessions/session.rs | 398 +++++++++++++ crates/redshell-server/src/store/audit.rs | 79 +++ .../redshell-server/src/store/credentials.rs | 204 +++++++ crates/redshell-server/src/store/mod.rs | 131 +++++ crates/redshell-server/src/store/sessions.rs | 45 ++ crates/redshell-server/src/store/users.rs | 101 ++++ crates/redshell-server/src/web/account.rs | 68 +++ crates/redshell-server/src/web/assets.rs | 82 +++ crates/redshell-server/src/web/auth.rs | 66 +++ crates/redshell-server/src/web/error.rs | 93 +++ crates/redshell-server/src/web/guard.rs | 185 ++++++ crates/redshell-server/src/web/mod.rs | 69 +++ crates/redshell-server/src/web/sessions.rs | 116 ++++ crates/redshell-server/src/web/ws.rs | 350 +++++++++++ crates/redshell-server/tests/server.rs | 552 ++++++++++++++++++ 37 files changed, 5241 insertions(+), 3 deletions(-) create mode 100644 crates/redshell-server/Cargo.toml create mode 100644 crates/redshell-server/build.rs create mode 100644 crates/redshell-server/placeholder/index.html create mode 100644 crates/redshell-server/src/agents/approvals.rs create mode 100644 crates/redshell-server/src/agents/claude.rs create mode 100644 crates/redshell-server/src/agents/codex.rs create mode 100644 crates/redshell-server/src/agents/hooks.rs create mode 100644 crates/redshell-server/src/agents/mod.rs create mode 100644 crates/redshell-server/src/auth/limiter.rs create mode 100644 crates/redshell-server/src/auth/mod.rs create mode 100644 crates/redshell-server/src/auth/password.rs create mode 100644 crates/redshell-server/src/auth/secret.rs create mode 100644 crates/redshell-server/src/bus.rs create mode 100644 crates/redshell-server/src/cli.rs create mode 100644 crates/redshell-server/src/config.rs create mode 100644 crates/redshell-server/src/lib.rs create mode 100644 crates/redshell-server/src/main.rs create mode 100644 crates/redshell-server/src/sessions/launch.rs create mode 100644 crates/redshell-server/src/sessions/mod.rs create mode 100644 crates/redshell-server/src/sessions/output.rs create mode 100644 crates/redshell-server/src/sessions/session.rs create mode 100644 crates/redshell-server/src/store/audit.rs create mode 100644 crates/redshell-server/src/store/credentials.rs create mode 100644 crates/redshell-server/src/store/mod.rs create mode 100644 crates/redshell-server/src/store/sessions.rs create mode 100644 crates/redshell-server/src/store/users.rs create mode 100644 crates/redshell-server/src/web/account.rs create mode 100644 crates/redshell-server/src/web/assets.rs create mode 100644 crates/redshell-server/src/web/auth.rs create mode 100644 crates/redshell-server/src/web/error.rs create mode 100644 crates/redshell-server/src/web/guard.rs create mode 100644 crates/redshell-server/src/web/mod.rs create mode 100644 crates/redshell-server/src/web/sessions.rs create mode 100644 crates/redshell-server/src/web/ws.rs create mode 100644 crates/redshell-server/tests/server.rs diff --git a/Cargo.lock b/Cargo.lock index 8c2bf56..6487608 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -61,7 +61,7 @@ version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bda177466b9524d59f1b12f0dd30b68696788e9992a7e959021c4a0ed96fcf59" dependencies = [ - "base64", + "base64 0.22.1", "bitflags 2.13.2", "home", "libc", @@ -189,6 +189,15 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3bc62ac97cc33321f50863d514c3bc38a453947a8f9e781137e47c7401020aed" +[[package]] +name = "arc-swap" +version = "1.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84a22b5d51209f6de83d37a0b33d320acb8da88823e42a94c075140708f032a5" +dependencies = [ + "rustversion", +] + [[package]] name = "arg_enum_proc_macro" version = "0.3.4" @@ -200,6 +209,18 @@ dependencies = [ "syn 2.0.119", ] +[[package]] +name = "argon2" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c3610892ee6e0cbce8ae2700349fcf8f98adb0dbfbee85aec3c9179d29cc072" +dependencies = [ + "base64ct", + "blake2", + "cpufeatures 0.2.17", + "password-hash", +] + [[package]] name = "arrayref" version = "0.3.9" @@ -578,12 +599,102 @@ dependencies = [ "arrayvec", ] +[[package]] +name = "axum" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31b698c5f9a010f6573133b09e0de5408834d0c82f8d7475a89fc1867a71cd90" +dependencies = [ + "axum-core", + "base64 0.22.1", + "bytes", + "form_urlencoded", + "futures-util", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-util", + "itoa", + "matchit", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite", + "serde_core", + "serde_json", + "serde_path_to_error", + "serde_urlencoded", + "sha1", + "sync_wrapper", + "tokio", + "tokio-tungstenite", + "tower", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "axum-core" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08c78f31d7b1291f7ee735c1c6780ccde7785daae9a9206026862dab7d8792d1" +dependencies = [ + "bytes", + "futures-core", + "http", + "http-body", + "http-body-util", + "mime", + "pin-project-lite", + "sync_wrapper", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "axum-server" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3766086d344b8f8d2a9cf6fb211b581de5b160e052d7bc75a92e58cc41909054" +dependencies = [ + "arc-swap", + "bytes", + "either", + "fs-err", + "http", + "http-body", + "hyper", + "hyper-util", + "pin-project-lite", + "rustls", + "rustls-pki-types", + "socket2", + "tokio", + "tokio-rustls", + "tower-service", +] + [[package]] name = "base64" version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" +[[package]] +name = "base64" +version = "0.23.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac07cdecf99051d9a5238b80f35af32cdeba5b336e55d957b318b50137e18da5" + +[[package]] +name = "base64ct" +version = "1.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2af50177e190e07a26ab74f8b1efbfe2ef87da2116221318cb1c2e82baf7de06" + [[package]] name = "bindgen" version = "0.71.1" @@ -707,6 +818,15 @@ dependencies = [ "profiling", ] +[[package]] +name = "blake2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" +dependencies = [ + "digest 0.10.7", +] + [[package]] name = "block" version = "0.1.6" @@ -996,6 +1116,46 @@ dependencies = [ "libloading", ] +[[package]] +name = "clap" +version = "4.6.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50066ca966813ca8957ee15361752f19424a8ff620dbe9c8993d9f99d99b04b3" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.6.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0ed97c96ef4efb3cc84e09fa388df4463e7cc3224ec38d7b1d9e45749333590" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4c174f11f949b9ca8c60580925e282b9cbd5454750e506f08648b2038080cd7" +dependencies = [ + "heck 0.5.0", + "proc-macro2", + "quote", + "syn 3.0.10", +] + +[[package]] +name = "clap_lex" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0921b3876b3a1df8a1c9f912e7f94342458022c2e84288015893d83c4d62a79" + [[package]] name = "cmov" version = "0.5.4" @@ -1464,6 +1624,12 @@ dependencies = [ "parking_lot_core", ] +[[package]] +name = "data-encoding" +version = "2.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4583a4551df46e2792f82ceeac45e850d2e2d5debba0b91f102385cda5b11f06" + [[package]] name = "data-url" version = "0.3.2" @@ -2068,6 +2234,16 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "fs-err" +version = "3.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5c95b673b8f6f7235229ae11c5642d81b04c2e64c1e2fb417bc0cf73ca45f29" +dependencies = [ + "autocfg", + "tokio", +] + [[package]] name = "futf" version = "0.1.5" @@ -2799,6 +2975,12 @@ version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + [[package]] name = "hybrid-array" version = "0.4.15" @@ -2822,6 +3004,7 @@ dependencies = [ "http", "http-body", "httparse", + "httpdate", "itoa", "pin-project-lite", "smallvec", @@ -2851,6 +3034,7 @@ version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ddc03d96684f9226b8a787cdb71488417b53ab5ea8fdb1dac946cb9431cc8bff" dependencies = [ + "base64 0.23.1", "bytes", "futures-channel", "futures-util", @@ -2858,7 +3042,9 @@ dependencies = [ "http-body", "httparse", "hyper", + "ipnet", "libc", + "percent-encoding", "pin-project-lite", "socket2", "tokio", @@ -3466,6 +3652,12 @@ dependencies = [ "libc", ] +[[package]] +name = "matchit" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47e1ffaa40ddd1f3ed91f717a33c8c0ee23fff369e3aa8772b9605cc1d22f4c3" + [[package]] name = "maybe-rayon" version = "0.1.1" @@ -4105,6 +4297,17 @@ dependencies = [ "windows-link 0.2.1", ] +[[package]] +name = "password-hash" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "346f04948ba92c43e8469c1ee6736c7563d71012b17d40745260fe106aac2166" +dependencies = [ + "base64ct", + "rand_core 0.6.4", + "subtle", +] + [[package]] name = "paste" version = "1.0.15" @@ -4870,6 +5073,48 @@ dependencies = [ "zeroize", ] +[[package]] +name = "redshell-server" +version = "0.0.2" +dependencies = [ + "anyhow", + "argon2", + "axum", + "axum-server", + "base64 0.22.1", + "clap", + "crossbeam-channel", + "dirs 6.0.0", + "env_logger", + "futures-util", + "http-body-util", + "hyper", + "hyper-util", + "log", + "parking_lot", + "rand_core 0.6.4", + "redshell-agents", + "redshell-core", + "redshell-protocol", + "redshell-remote", + "redshell-terminal", + "reqwest", + "rpassword", + "rusqlite", + "rust-embed", + "rustls", + "serde", + "serde_json", + "sha2 0.10.9", + "tempfile", + "thiserror 2.0.21", + "tokio", + "tokio-tungstenite", + "toml 0.9.12+spec-1.1.0", + "tower-http", + "uuid", +] + [[package]] name = "redshell-terminal" version = "0.0.2" @@ -4954,6 +5199,38 @@ version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d902046e6a28a1e4c3cab97258a0ce11e994903f01c2d97a9447a0b3df85f4f6" +[[package]] +name = "reqwest" +version = "0.12.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eddd3ca559203180a307f12d114c268abf583f59b03cb906fd0b3ff8646c1147" +dependencies = [ + "base64 0.22.1", + "bytes", + "futures-core", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-util", + "js-sys", + "log", + "percent-encoding", + "pin-project-lite", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper", + "tokio", + "tower", + "tower-http", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + [[package]] name = "resvg" version = "0.45.1" @@ -4997,6 +5274,27 @@ version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c20b6793b5c2fa6553b250154b78d6d0db37e72700ae35fad9387a46f487c97" +[[package]] +name = "rpassword" +version = "7.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fa2c5d9304b618df61ff17f3d3485c6e1854a3d94902a49abbb8d43dfbe0464" +dependencies = [ + "libc", + "rtoolbox", + "windows-sys 0.61.2", +] + +[[package]] +name = "rtoolbox" +version = "0.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a1efe12a1469752d0e6ff5ebec0b6ef4924cc5c4c71046b0ec730040535819d" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + [[package]] name = "rusqlite" version = "0.37.0" @@ -5052,6 +5350,7 @@ dependencies = [ "proc-macro2", "quote", "rust-embed-utils", + "shellexpand", "syn 2.0.119", "walkdir", ] @@ -5063,6 +5362,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "915e33dccbe7deb2b8a342dc4c517503fe85e0230ddbae40a4fb0220493dad9b" dependencies = [ "globset", + "mime_guess", "sha2 0.11.2", "walkdir", ] @@ -5455,6 +5755,17 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_path_to_error" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10a9ff822e371bb5403e391ecd83e182e0e77ba7f6fe0160b795797109d1b457" +dependencies = [ + "itoa", + "serde", + "serde_core", +] + [[package]] name = "serde_repr" version = "0.1.21" @@ -5507,6 +5818,17 @@ dependencies = [ "windows-sys 0.61.2", ] +[[package]] +name = "sha1" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a978451301f4db1d02937a4ab3ccce137717b81826e79b7d49ffe3244a13c3b8" +dependencies = [ + "cfg-if", + "cpufeatures 0.2.17", + "digest 0.10.7", +] + [[package]] name = "sha1_smol" version = "1.0.1" @@ -5551,6 +5873,15 @@ version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc6fe69c597f9c37bfeeeeeb33da3530379845f10be461a66d16d03eca2ded77" +[[package]] +name = "shellexpand" +version = "3.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32824fab5e16e6c4d86dc1ba84489390419a39f97699852b66480bb87d297ed8" +dependencies = [ + "dirs 6.0.0", +] + [[package]] name = "shlex" version = "1.3.0" @@ -5753,6 +6084,12 @@ dependencies = [ "float-cmp", ] +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + [[package]] name = "strum" version = "0.26.3" @@ -6228,6 +6565,18 @@ dependencies = [ "tokio", ] +[[package]] +name = "tokio-tungstenite" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f72a05e828585856dacd553fba484c242c46e391fb0e58917c942ee9202915c" +dependencies = [ + "futures-util", + "log", + "tokio", + "tungstenite", +] + [[package]] name = "tokio-util" version = "0.7.20" @@ -6373,6 +6722,25 @@ dependencies = [ "tokio", "tower-layer", "tower-service", + "tracing", +] + +[[package]] +name = "tower-http" +version = "0.6.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cfcf7e2740e6fc6d4d688b4ef00650406bb94adf4731e43c096c3a19fe40840" +dependencies = [ + "bitflags 2.13.2", + "bytes", + "futures-util", + "http", + "http-body", + "pin-project-lite", + "tower", + "tower-layer", + "tower-service", + "url", ] [[package]] @@ -6393,6 +6761,7 @@ version = "0.1.44" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" dependencies = [ + "log", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -6468,6 +6837,22 @@ dependencies = [ "core_maths", ] +[[package]] +name = "tungstenite" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c01152af293afb9c7c2a57e4b559c5620b421f6d133261c60dd2d0cdb38e6b8" +dependencies = [ + "bytes", + "data-encoding", + "http", + "httparse", + "log", + "rand 0.9.5", + "sha1", + "thiserror 2.0.21", +] + [[package]] name = "typeid" version = "1.0.3" @@ -6594,7 +6979,7 @@ version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "80be9b06fbae3b8b303400ab20778c80bbaf338f563afe567cf3c9eea17b47ef" dependencies = [ - "base64", + "base64 0.22.1", "data-url", "flate2", "fontdb 0.23.0", @@ -7854,7 +8239,7 @@ version = "0.12.15-zed" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac2d05756ff48539950c3282ad7acf3817ad3f08797c205ad1c34a2ce03b9970" dependencies = [ - "base64", + "base64 0.22.1", "bytes", "encoding_rs", "futures-core", diff --git a/Cargo.toml b/Cargo.toml index 0a55df5..400f377 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,6 +11,7 @@ members = [ "crates/redshell-ui", "crates/redshell-app", "crates/redshell-protocol", + "crates/redshell-server", ] default-members = ["crates/redshell-app"] diff --git a/crates/redshell-server/Cargo.toml b/crates/redshell-server/Cargo.toml new file mode 100644 index 0000000..2cfcb39 --- /dev/null +++ b/crates/redshell-server/Cargo.toml @@ -0,0 +1,54 @@ +[package] +name = "redshell-server" +description = "Headless RedShell: server-owned terminal sessions for the desktop and the RedShell Remote PWA." +version.workspace = true +edition.workspace = true +license.workspace = true +repository.workspace = true +rust-version.workspace = true + +[[bin]] +name = "redshell-server" +path = "src/main.rs" + +[dependencies] +redshell-core.workspace = true +redshell-terminal.workspace = true +redshell-agents.workspace = true +redshell-remote.workspace = true +redshell-protocol.workspace = true +rusqlite.workspace = true +serde.workspace = true +serde_json.workspace = true +toml.workspace = true +anyhow.workspace = true +thiserror.workspace = true +parking_lot.workspace = true +crossbeam-channel.workspace = true +log.workspace = true +env_logger.workspace = true +dirs.workspace = true +uuid.workspace = true + +axum = { version = "0.8", features = ["ws"] } +# TLS through rustls with ring: no OpenSSL and no C toolchain for cross builds. +axum-server = { version = "0.9", features = ["tls-rustls-ring"] } +rustls = { version = "0.23", default-features = false, features = ["ring", "std", "tls12"] } +tokio = { version = "1", features = ["rt-multi-thread", "macros", "net", "signal", "sync", "time"] } +tower-http = { version = "0.6", features = ["set-header"] } +hyper = { version = "1", features = ["client", "http1"] } +hyper-util = { version = "0.1", features = ["tokio"] } +http-body-util = "0.1" +futures-util = { version = "0.3", default-features = false, features = ["sink", "std"] } +rust-embed = { version = "8", features = ["debug-embed", "interpolate-folder-path", "mime-guess"] } +argon2 = "0.5" +rand_core = { version = "0.6", features = ["getrandom"] } +sha2 = "0.10" +base64 = "0.22" +clap = { version = "4", features = ["derive", "env"] } +rpassword = "7" + +[dev-dependencies] +tempfile.workspace = true +reqwest = { version = "0.12", default-features = false, features = ["json"] } +tokio-tungstenite = "0.29" diff --git a/crates/redshell-server/build.rs b/crates/redshell-server/build.rs new file mode 100644 index 0000000..1d8c09d --- /dev/null +++ b/crates/redshell-server/build.rs @@ -0,0 +1,16 @@ +//! Picks the folder the PWA is embedded from: `web/dist` when it has been +//! built (`npm ci && npm run build` in `web/`), else a placeholder page +//! that says so, so `cargo build` works without Node. + +use std::path::PathBuf; + +fn main() { + let manifest = PathBuf::from(std::env::var("CARGO_MANIFEST_DIR").expect("set by cargo")); + let dist = manifest.join("../../web/dist"); + let placeholder = manifest.join("placeholder"); + let folder = if dist.join("index.html").is_file() { &dist } else { &placeholder }; + println!("cargo:rustc-env=REDSHELL_WEB_DIST={}", folder.display()); + println!("cargo:rerun-if-changed={}", placeholder.display()); + // A missing path counts as changed, so a PWA built later is picked up. + println!("cargo:rerun-if-changed={}", dist.display()); +} diff --git a/crates/redshell-server/placeholder/index.html b/crates/redshell-server/placeholder/index.html new file mode 100644 index 0000000..6384e0e --- /dev/null +++ b/crates/redshell-server/placeholder/index.html @@ -0,0 +1,14 @@ + + + + + +RedShell Server + + +

RedShell Server is running

+

This build has no RedShell Remote app inside. Build it in web/ with +npm ci && npm run build, then build redshell-server again.

+

The API under /api works as usual.

+ + diff --git a/crates/redshell-server/src/agents/approvals.rs b/crates/redshell-server/src/agents/approvals.rs new file mode 100644 index 0000000..2645dc0 --- /dev/null +++ b/crates/redshell-server/src/agents/approvals.rs @@ -0,0 +1,150 @@ +//! Permission requests held open until someone answers. +//! +//! An agent's PermissionRequest hook waits on a [`Approvals::open`] +//! receiver. The first answer wins: a client (allow, deny, answer in the +//! terminal), the agent moving on after an answer in its own dialog, the +//! timeout, or the session ending. Answering something already settled +//! does nothing. + +use std::collections::HashMap; + +use parking_lot::Mutex; +use redshell_protocol::{Approval, ApprovalDecision, ApprovalOutcome}; +use tokio::sync::oneshot; + +use crate::bus::{Bus, BusEvent}; + +/// A client's answer, handed to the waiting hook. +#[derive(Debug, Clone, PartialEq, Eq)] +pub struct Answer { + pub decision: ApprovalDecision, + pub message: Option, +} + +struct Pending { + approval: Approval, + reply: oneshot::Sender, +} + +pub struct Approvals { + pending: Mutex>, + bus: Bus, +} + +impl Approvals { + pub fn new(bus: Bus) -> Self { + Self { pending: Mutex::new(HashMap::new()), bus } + } + + /// Registers `approval` and tells the clients. The receiver gets the + /// answer, or an error when it was settled without one. + pub fn open(&self, approval: Approval) -> oneshot::Receiver { + let (reply, rx) = oneshot::channel(); + self.pending.lock().insert(approval.id.clone(), Pending { approval: approval.clone(), reply }); + self.bus.send(BusEvent::ApprovalRequested(approval)); + rx + } + + /// A client answers; `None` when the approval is no longer pending. + pub fn answer(&self, id: &str, answer: Answer, by: &str) -> Option { + let pending = self.pending.lock().remove(id)?; + let outcome = match answer.decision { + ApprovalDecision::Allow | ApprovalDecision::AllowAlways => ApprovalOutcome::Allowed, + ApprovalDecision::Deny => ApprovalOutcome::Denied, + ApprovalDecision::Terminal => ApprovalOutcome::Terminal, + }; + let _ = pending.reply.send(answer); + self.resolved(&pending.approval, outcome, Some(by)); + Some(pending.approval) + } + + /// Settles one approval without an answer (it timed out). + pub fn settle(&self, id: &str, outcome: ApprovalOutcome) { + if let Some(pending) = self.pending.lock().remove(id) { + self.resolved(&pending.approval, outcome, None); + } + } + + /// Settles every approval of `session` without an answer: the agent + /// moved on (`by` = `terminal`) or the session ended. + pub fn settle_session(&self, session: &str, outcome: ApprovalOutcome, by: Option<&str>) { + let settled: Vec = { + let mut pending = self.pending.lock(); + let ids: Vec = + pending.values().filter(|p| p.approval.session == session).map(|p| p.approval.id.clone()).collect(); + ids.iter().filter_map(|id| pending.remove(id)).collect() + }; + for p in settled { + self.resolved(&p.approval, outcome, by); + } + } + + fn resolved(&self, approval: &Approval, outcome: ApprovalOutcome, by: Option<&str>) { + self.bus.send(BusEvent::ApprovalResolved { + id: approval.id.clone(), + session: approval.session.clone(), + outcome, + answered_by: by.map(str::to_owned), + }); + } + + pub fn pending(&self) -> Vec { + let mut list: Vec = self.pending.lock().values().map(|p| p.approval.clone()).collect(); + list.sort_by_key(|a| a.created_at); + list + } + + pub fn count(&self, session: &str) -> u32 { + self.pending.lock().values().filter(|p| p.approval.session == session).count() as u32 + } +} + +#[cfg(test)] +mod tests { + use super::*; + + fn approval(id: &str, session: &str) -> Approval { + Approval { + id: id.into(), + session: session.into(), + tool: "Bash".into(), + input: serde_json::json!({"command": "ls"}), + summary: "ls".into(), + description: None, + permission_suggestions: None, + created_at: 0, + expires_at: 1, + } + } + + #[tokio::test] + async fn first_answer_wins() { + let bus = Bus::default(); + let mut events = bus.subscribe(); + let approvals = Approvals::new(bus); + let rx = approvals.open(approval("a", "s")); + assert_eq!(approvals.count("s"), 1); + let allow = Answer { decision: ApprovalDecision::Allow, message: None }; + assert!(approvals.answer("a", allow.clone(), "phone").is_some()); + assert!(approvals.answer("a", allow.clone(), "laptop").is_none(), "already answered"); + assert_eq!(rx.await.unwrap(), allow); + assert!(matches!(events.recv().await.unwrap(), BusEvent::ApprovalRequested(_))); + assert!(matches!( + events.recv().await.unwrap(), + BusEvent::ApprovalResolved { outcome: ApprovalOutcome::Allowed, answered_by: Some(by), .. } if by == "phone" + )); + } + + #[tokio::test] + async fn settling_a_session_leaves_the_hook_without_a_decision() { + let approvals = Approvals::new(Bus::default()); + let a = approvals.open(approval("a", "s")); + let b = approvals.open(approval("b", "other")); + approvals.settle_session("s", ApprovalOutcome::Terminal, Some("terminal")); + assert!(a.await.is_err()); + assert_eq!(approvals.pending().len(), 1); + approvals.settle("b", ApprovalOutcome::TimedOut); + assert!(b.await.is_err()); + assert!(approvals.pending().is_empty()); + } +} diff --git a/crates/redshell-server/src/agents/claude.rs b/crates/redshell-server/src/agents/claude.rs new file mode 100644 index 0000000..cbd8ff3 --- /dev/null +++ b/crates/redshell-server/src/agents/claude.rs @@ -0,0 +1,206 @@ +//! Claude Code: the settings that add our HTTP hooks, and what each hook +//! means for the session. +//! +//! Hook input and output follow . +//! A PermissionRequest is held until a client answers; Claude shows its own +//! dialog at the same time, and whichever answer comes first wins. When +//! the user answers in the terminal Claude leaves our request open, so any +//! later hook of the session (PostToolUse, PostToolUseFailure, +//! UserPromptSubmit, Stop or another PermissionRequest) settles the older +//! request as answered in the terminal. Notification does not: Claude sends +//! one for a waiting prompt about six seconds in. + +use std::time::Duration; + +use redshell_protocol::{AgentState, Approval, ApprovalDecision}; +use serde::Deserialize; +use serde_json::{Value, json}; + +use super::Answer; + +/// Hook events we subscribe to. +const EVENTS: [&str; 6] = + ["PermissionRequest", "PostToolUse", "PostToolUseFailure", "Notification", "Stop", "UserPromptSubmit"]; + +/// The `--settings` file: one HTTP hook per event, all to `url`. The +/// permission hook outlives our own timeout, so we answer first. +pub fn settings(url: &str, approval_timeout: Duration) -> String { + let hooks: serde_json::Map = EVENTS + .iter() + .map(|event| { + let timeout = if *event == "PermissionRequest" { approval_timeout.as_secs() + 30 } else { 10 }; + (event.to_string(), json!([{ "hooks": [{ "type": "http", "url": url, "timeout": timeout }] }])) + }) + .collect(); + json!({ "hooks": hooks }).to_string() +} + +/// The fields of a hook's input that we use. +#[derive(Debug, Default, Deserialize)] +#[serde(default)] +pub struct HookInput { + pub hook_event_name: String, + pub tool_name: Option, + pub tool_input: Option, + pub permission_suggestions: Option, + pub notification_type: Option, + pub title: Option, + pub message: Option, + pub last_assistant_message: Option, +} + +/// What a hook event does to the session. +#[derive(Debug, PartialEq)] +pub enum Effect { + /// Hold the request open for an approval. + Ask, + /// The agent went on: settle older approvals, then maybe a new state. + MovedOn(Option), + /// A turn ended with this message. + Finished(Option), + /// The agent waits for the user to type. + NeedsInput(Option), + /// Just tell the clients. + Notify { + title: Option, + body: Option, + }, + Nothing, +} + +impl HookInput { + pub fn effect(&self) -> Effect { + match self.hook_event_name.as_str() { + "PermissionRequest" => Effect::Ask, + "PostToolUse" | "PostToolUseFailure" | "UserPromptSubmit" => Effect::MovedOn(Some(AgentState::Working)), + "Stop" => Effect::Finished(self.last_assistant_message.clone()), + "Notification" => match self.notification_type.as_deref() { + // Already shown as an approval. + Some("permission_prompt") => Effect::Nothing, + Some("idle_prompt" | "elicitation_dialog" | "elicitation_url_dialog" | "agent_needs_input") => { + Effect::NeedsInput(self.message.clone()) + } + _ => Effect::Notify { title: self.title.clone(), body: self.message.clone() }, + }, + _ => Effect::Nothing, + } + } + + /// The approval this PermissionRequest asks for. + pub fn approval(&self, id: String, session: String, now: i64, timeout: Duration) -> Approval { + let input = self.tool_input.clone().unwrap_or(Value::Null); + let tool = self.tool_name.clone().unwrap_or_else(|| "tool".into()); + let text = |key: &str| input.get(key).and_then(Value::as_str).map(str::to_owned); + let summary = ["command", "file_path", "url", "pattern", "path", "query", "prompt"] + .iter() + .find_map(|key| text(key)) + .unwrap_or_else(|| tool.clone()); + let suggestions = self.permission_suggestions.clone().filter(|s| s.as_array().is_some_and(|a| !a.is_empty())); + Approval { + id, + session, + summary: summary.chars().take(300).collect(), + description: text("description"), + permission_suggestions: suggestions, + tool, + input, + created_at: now, + expires_at: now + timeout.as_millis() as i64, + } + } +} + +/// The hook's reply for an answer; `None` is no decision (an empty body), +/// which lets Claude ask in its own dialog. +pub fn decision(answer: Option<&Answer>, approval: &Approval) -> Option { + let decision = match answer?.decision { + ApprovalDecision::Allow => json!({ "behavior": "allow" }), + ApprovalDecision::AllowAlways => match &approval.permission_suggestions { + Some(rules) => json!({ "behavior": "allow", "updatedPermissions": rules }), + None => json!({ "behavior": "allow" }), + }, + ApprovalDecision::Deny => { + let message = answer?.message.clone().unwrap_or_else(|| "The user denied this in RedShell.".into()); + json!({ "behavior": "deny", "message": message }) + } + ApprovalDecision::Terminal => return None, + }; + Some(json!({ "hookSpecificOutput": { "hookEventName": "PermissionRequest", "decision": decision } })) +} + +/// The state an answered approval leaves the agent in. +pub fn after_answer(answer: Option<&Answer>) -> Option { + match answer.map(|a| a.decision) { + Some(ApprovalDecision::Allow | ApprovalDecision::AllowAlways | ApprovalDecision::Deny) => { + Some(AgentState::Working) + } + // The dialog is up in the terminal: still waiting for an approval. + _ => None, + } +} + +#[cfg(test)] +mod tests { + use super::*; + + fn input(json: Value) -> HookInput { + serde_json::from_value(json).unwrap() + } + + #[test] + fn settings_hook_every_event_with_a_long_permission_timeout() { + let s: Value = + serde_json::from_str(&settings("http://127.0.0.1:9/claude/s/t", Duration::from_secs(600))).unwrap(); + for event in EVENTS { + assert_eq!(s["hooks"][event][0]["hooks"][0]["url"], "http://127.0.0.1:9/claude/s/t"); + assert_eq!(s["hooks"][event][0]["hooks"][0]["type"], "http"); + } + assert_eq!(s["hooks"]["PermissionRequest"][0]["hooks"][0]["timeout"], 630); + } + + #[test] + fn events_map_to_effects() { + let effect = |json: Value| input(json).effect(); + assert_eq!(effect(json!({"hook_event_name": "PermissionRequest"})), Effect::Ask); + assert_eq!( + effect(json!({"hook_event_name": "PostToolUseFailure"})), + Effect::MovedOn(Some(AgentState::Working)) + ); + assert_eq!( + effect(json!({"hook_event_name": "Stop", "last_assistant_message": "Done."})), + Effect::Finished(Some("Done.".into())) + ); + assert_eq!( + effect(json!({"hook_event_name": "Notification", "notification_type": "permission_prompt"})), + Effect::Nothing + ); + assert_eq!( + effect( + json!({"hook_event_name": "Notification", "notification_type": "idle_prompt", "message": "Waiting"}) + ), + Effect::NeedsInput(Some("Waiting".into())) + ); + } + + #[test] + fn approvals_and_decisions() { + let request = input(json!({ + "hook_event_name": "PermissionRequest", + "tool_name": "Bash", + "tool_input": {"command": "rm -rf node_modules", "description": "Remove node_modules"}, + "permission_suggestions": [{"type": "addRules", "rules": [{"toolName": "Bash"}], "behavior": "allow"}] + })); + let approval = request.approval("a".into(), "s".into(), 1000, Duration::from_secs(600)); + assert_eq!((approval.summary.as_str(), approval.expires_at), ("rm -rf node_modules", 601_000)); + assert_eq!(approval.description.as_deref(), Some("Remove node_modules")); + let answer = |decision| Answer { decision, message: None }; + let allow = decision(Some(&answer(ApprovalDecision::Allow)), &approval).unwrap(); + assert_eq!(allow["hookSpecificOutput"]["decision"], json!({"behavior": "allow"})); + let always = decision(Some(&answer(ApprovalDecision::AllowAlways)), &approval).unwrap(); + assert_eq!(always["hookSpecificOutput"]["decision"]["updatedPermissions"][0]["type"], "addRules"); + let deny = decision(Some(&answer(ApprovalDecision::Deny)), &approval).unwrap(); + assert_eq!(deny["hookSpecificOutput"]["decision"]["behavior"], "deny"); + assert_eq!(decision(Some(&answer(ApprovalDecision::Terminal)), &approval), None); + assert_eq!(decision(None, &approval), None); + } +} diff --git a/crates/redshell-server/src/agents/codex.rs b/crates/redshell-server/src/agents/codex.rs new file mode 100644 index 0000000..282d390 --- /dev/null +++ b/crates/redshell-server/src/agents/codex.rs @@ -0,0 +1,76 @@ +//! Codex: its `notify` program reports finished turns. +//! +//! Codex runs the `notify` command after each turn with one more argument, +//! a JSON object such as `{"type": "agent-turn-complete", +//! "last-assistant-message": "…", "cwd": "…", …}`. The command is +//! `redshell-server hook codex`, which posts that JSON to the URL in +//! [`URL_ENV`]. The URL (with its token) travels in the environment rather +//! than on the command line, which every user of the machine can read. + +use std::path::Path; + +use anyhow::{Context as _, ensure}; +use axum::body::Bytes; +use http_body_util::Full; +use hyper::header::{CONTENT_TYPE, HOST}; +use serde::Deserialize; + +/// Environment variable with the session's hook URL. +pub const URL_ENV: &str = "REDSHELL_HOOK_URL"; + +/// The `-c` override: `notify=["", "hook", "codex"]`. A JSON +/// array of strings is valid TOML, which is how Codex parses `-c` values. +pub fn notify_override(exe: &Path) -> String { + let argv = [exe.display().to_string(), "hook".into(), "codex".into()]; + format!("notify={}", serde_json::to_string(&argv).unwrap_or_default()) +} + +/// The notify payload fields we use. +#[derive(Debug, Default, Deserialize)] +#[serde(default)] +pub struct Notify { + #[serde(rename = "type")] + pub kind: String, + #[serde(rename = "last-assistant-message")] + pub last_assistant_message: Option, +} + +impl Notify { + pub fn turn_complete(&self) -> bool { + self.kind == "agent-turn-complete" + } +} + +/// `redshell-server hook codex `: posts the payload to the hook +/// listener of the session it runs in. +pub async fn post_notify(url: &str, payload: String) -> anyhow::Result<()> { + let uri: hyper::Uri = url.parse().with_context(|| format!("{URL_ENV} is not a URL"))?; + let authority = uri.authority().context("the hook URL has no host")?.as_str().to_owned(); + let stream = tokio::net::TcpStream::connect(&authority).await.context("connecting to redshell-server")?; + let (mut sender, connection) = hyper::client::conn::http1::handshake(hyper_util::rt::TokioIo::new(stream)).await?; + tokio::spawn(connection); + let request = hyper::Request::post(uri.path()) + .header(HOST, authority) + .header(CONTENT_TYPE, "application/json") + .body(Full::new(Bytes::from(payload)))?; + let response = sender.send_request(request).await?; + ensure!(response.status().is_success(), "redshell-server answered {}", response.status()); + Ok(()) +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn override_is_a_toml_array() { + let value = notify_override(Path::new("/opt/redshell server/bin")); + let parsed: toml::Table = toml::from_str(&value).unwrap(); + assert_eq!(parsed["notify"].as_array().unwrap()[0].as_str(), Some("/opt/redshell server/bin")); + let notify: Notify = + serde_json::from_str(r#"{"type":"agent-turn-complete","last-assistant-message":"Done","thread-id":"t"}"#) + .unwrap(); + assert!(notify.turn_complete()); + assert_eq!(notify.last_assistant_message.as_deref(), Some("Done")); + } +} diff --git a/crates/redshell-server/src/agents/hooks.rs b/crates/redshell-server/src/agents/hooks.rs new file mode 100644 index 0000000..840063f --- /dev/null +++ b/crates/redshell-server/src/agents/hooks.rs @@ -0,0 +1,118 @@ +//! The loopback listener agent hooks post to. +//! +//! Routes: `POST /claude/{session}/{token}` and `POST /codex/{session}/{token}`. +//! An unknown session and a wrong token get the same 404. + +use std::sync::Arc; + +use axum::Json; +use axum::Router; +use axum::extract::{Path, State}; +use axum::http::StatusCode; +use axum::response::{IntoResponse, Response}; +use axum::routing::post; +use redshell_protocol::{AgentState, ApprovalOutcome, EventKind}; + +use super::claude::{self, Effect, HookInput}; +use super::codex::Notify; +use crate::now_ms; +use crate::sessions::{Ctx, Session, Sessions}; + +/// Who settles an approval the agent moved on from. +const IN_TERMINAL: &str = "terminal"; + +pub fn router(sessions: Arc) -> Router { + Router::new() + .route("/claude/{session}/{token}", post(claude_hook)) + .route("/codex/{session}/{token}", post(codex_hook)) + .with_state(sessions) +} + +fn session(sessions: &Sessions, id: &str, token: &str) -> Option> { + sessions.get(id).filter(|s| s.hook_token_matches(token)) +} + +async fn claude_hook( + State(sessions): State>, + Path((id, token)): Path<(String, String)>, + Json(input): Json, +) -> Response { + let Some(session) = session(&sessions, &id, &token) else { return StatusCode::NOT_FOUND.into_response() }; + let ctx = sessions.ctx().clone(); + let effect = input.effect(); + if matches!(effect, Effect::Ask | Effect::MovedOn(_) | Effect::Finished(_)) { + // Answered in Claude's own dialog: it never closes our request. + ctx.approvals.settle_session(&id, ApprovalOutcome::Terminal, Some(IN_TERMINAL)); + } + match effect { + Effect::Ask => return ask(&ctx, &session, &input).await, + Effect::MovedOn(state) => { + if let Some(state) = state { + session.update_agent(|_, _| Some((state, None))); + } + } + Effect::Finished(message) => finished(&ctx, &session, message), + Effect::NeedsInput(message) => { + session.update_agent(|_, _| Some((AgentState::NeedsInput, None))); + ctx.event(&id, EventKind::NeedsInput, None, message); + } + Effect::Notify { title, body } => ctx.event(&id, EventKind::Notification, title, body), + Effect::Nothing => {} + } + StatusCode::OK.into_response() +} + +/// Holds a PermissionRequest until it is answered, settled or times out. +async fn ask(ctx: &Arc, session: &Session, input: &HookInput) -> Response { + let id = uuid::Uuid::new_v4().to_string(); + let approval = input.approval(id.clone(), session.id.clone(), now_ms(), ctx.approval_timeout); + session.update_agent(|_, _| Some((AgentState::NeedsApproval, None))); + ctx.event(&session.id, EventKind::ApprovalRequested, Some(approval.tool.clone()), Some(approval.summary.clone())); + let reply = ctx.approvals.open(approval.clone()); + session.changed(); + // Claude may hang up first (it was answered and closed): settle then. + let _guard = SettleOnDrop { ctx: ctx.clone(), id: id.clone() }; + let answer = match tokio::time::timeout(ctx.approval_timeout, reply).await { + Ok(answer) => answer.ok(), + Err(_) => { + ctx.approvals.settle(&id, ApprovalOutcome::TimedOut); + None + } + }; + if let Some(state) = claude::after_answer(answer.as_ref()) { + session.update_agent(|_, _| Some((state, None))); + } + session.changed(); + match claude::decision(answer.as_ref(), &approval) { + Some(body) => Json(body).into_response(), + None => StatusCode::OK.into_response(), + } +} + +struct SettleOnDrop { + ctx: Arc, + id: String, +} + +impl Drop for SettleOnDrop { + fn drop(&mut self) { + self.ctx.approvals.settle(&self.id, ApprovalOutcome::Terminal); + } +} + +fn finished(ctx: &Ctx, session: &Session, message: Option) { + session.update_agent(|_, _| Some((AgentState::Finished, message.clone()))); + ctx.event(&session.id, EventKind::Finished, None, message); +} + +async fn codex_hook( + State(sessions): State>, + Path((id, token)): Path<(String, String)>, + Json(notify): Json, +) -> StatusCode { + let Some(session) = session(&sessions, &id, &token) else { return StatusCode::NOT_FOUND }; + if notify.turn_complete() { + finished(sessions.ctx(), &session, notify.last_assistant_message); + } + StatusCode::OK +} diff --git a/crates/redshell-server/src/agents/mod.rs b/crates/redshell-server/src/agents/mod.rs new file mode 100644 index 0000000..d6e21e3 --- /dev/null +++ b/crates/redshell-server/src/agents/mod.rs @@ -0,0 +1,60 @@ +//! Agent awareness through the agents' own extension points. +//! +//! * Claude Code starts with `--settings `, a private file that adds +//! HTTP hooks posting to the hook listener ([`claude`]). +//! * Codex starts with `-c notify=[…]`, which runs `redshell-server hook +//! codex` after each turn ([`codex`]). +//! +//! The hook listener ([`hooks`]) is bound to 127.0.0.1 on a random port and +//! is never part of the public router. A reverse proxy makes every request +//! look local, so being on loopback proves nothing: each URL carries the +//! session id and a random per-session token. + +mod approvals; +mod claude; +mod codex; +pub mod hooks; + +use std::path::Path; + +pub use approvals::{Answer, Approvals}; +pub use codex::{URL_ENV as HOOK_URL_ENV, post_notify}; + +use crate::auth::secret; +use crate::sessions::launch::Launch; +use crate::sessions::{AgentHook, Ctx}; + +/// Wires `launch` up to report to the hook listener when it starts an +/// agent RedShell understands. +pub fn prepare(launch: &mut Launch, session: &str, ctx: &Ctx) -> anyhow::Result> { + let token = secret::new_token(); + let url = |agent: &str| format!("http://{}/{agent}/{session}/{token}", ctx.hook_addr); + let files = match launch.agent.as_deref() { + Some("claude") => { + let file = ctx.runtime_dir.join(format!("claude-{session}.json")); + write_private(&file, &claude::settings(&url("claude"), ctx.approval_timeout))?; + launch.spec.args.extend(["--settings".to_owned(), file.display().to_string()]); + vec![file] + } + Some("codex") => { + let notify = codex::notify_override(&std::env::current_exe()?); + launch.spec.args.splice(0..0, ["-c".to_owned(), notify]); + launch.spec.env.insert(codex::URL_ENV.into(), url("codex")); + Vec::new() + } + _ => return Ok(None), + }; + Ok(Some(AgentHook { token, files })) +} + +/// Writes a file only the server's user can read. +fn write_private(path: &Path, contents: &str) -> anyhow::Result<()> { + use std::io::Write as _; + let mut options = std::fs::OpenOptions::new(); + options.write(true).create(true).truncate(true); + #[cfg(unix)] + std::os::unix::fs::OpenOptionsExt::mode(&mut options, 0o600); + let mut file = options.open(path)?; + file.write_all(contents.as_bytes())?; + Ok(()) +} diff --git a/crates/redshell-server/src/auth/limiter.rs b/crates/redshell-server/src/auth/limiter.rs new file mode 100644 index 0000000..ff9e240 --- /dev/null +++ b/crates/redshell-server/src/auth/limiter.rs @@ -0,0 +1,92 @@ +//! Exponential backoff after failed sign-ins, per client IP and per user. +//! +//! The first [`FREE_FAILURES`] failures cost nothing; after that each +//! attempt has to wait 1 s, 2 s, 4 s, … (at most [`MAX_DELAY`]) after the +//! previous failure. A success clears the key, and a key with no failure +//! for a day is forgotten. Entries are dropped lazily, so an idle server +//! does no work. + +use std::collections::HashMap; +use std::time::{Duration, Instant}; + +use parking_lot::Mutex; + +const FREE_FAILURES: u32 = 3; +const MAX_DELAY: Duration = Duration::from_secs(15 * 60); +const FORGET_AFTER: Duration = Duration::from_secs(24 * 60 * 60); +/// Beyond this many keys, forgotten ones are swept on the next failure. +const SWEEP_AT: usize = 10_000; + +#[derive(Debug, Clone, Copy)] +struct Entry { + failures: u32, + last: Instant, +} + +impl Entry { + fn delay(self) -> Duration { + match self.failures.checked_sub(FREE_FAILURES) { + None => Duration::ZERO, + Some(extra) => Duration::from_secs(1u64 << extra.min(20)).min(MAX_DELAY), + } + } +} + +#[derive(Default)] +pub struct Limiter { + entries: Mutex>, +} + +impl Limiter { + /// `Err(wait)` while `key` has to wait before the next attempt. + pub fn check(&self, key: &str, now: Instant) -> Result<(), Duration> { + let entries = self.entries.lock(); + let Some(entry) = entries.get(key) else { return Ok(()) }; + let ready = entry.last + entry.delay(); + if now < ready { Err(ready - now) } else { Ok(()) } + } + + pub fn failure(&self, key: &str, now: Instant) { + let mut entries = self.entries.lock(); + if entries.len() >= SWEEP_AT { + entries.retain(|_, e| now.duration_since(e.last) < FORGET_AFTER); + } + let entry = entries.entry(key.to_owned()).or_insert(Entry { failures: 0, last: now }); + if now.duration_since(entry.last) >= FORGET_AFTER { + entry.failures = 0; + } + entry.failures += 1; + entry.last = now; + } + + pub fn success(&self, key: &str) { + self.entries.lock().remove(key); + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn backs_off_exponentially_and_resets() { + let limiter = Limiter::default(); + let t0 = Instant::now(); + for _ in 0..FREE_FAILURES { + assert!(limiter.check("ip:a", t0).is_ok()); + limiter.failure("ip:a", t0); + } + assert_eq!(limiter.check("ip:a", t0), Err(Duration::from_secs(1))); + assert!(limiter.check("ip:a", t0 + Duration::from_secs(1)).is_ok()); + limiter.failure("ip:a", t0 + Duration::from_secs(1)); + assert_eq!(limiter.check("ip:a", t0 + Duration::from_secs(1)), Err(Duration::from_secs(2))); + assert!(limiter.check("ip:b", t0).is_ok(), "keys are independent"); + for _ in 0..40 { + limiter.failure("ip:a", t0); + } + assert_eq!(limiter.check("ip:a", t0), Err(MAX_DELAY)); + assert!(limiter.check("ip:a", t0 + FORGET_AFTER).is_ok()); + limiter.success("ip:a"); + assert!(limiter.check("ip:a", t0).is_ok()); + } +} diff --git a/crates/redshell-server/src/auth/mod.rs b/crates/redshell-server/src/auth/mod.rs new file mode 100644 index 0000000..4d1284d --- /dev/null +++ b/crates/redshell-server/src/auth/mod.rs @@ -0,0 +1,391 @@ +//! Who is signed in: first-run setup, password sign-in with backoff, +//! browser sessions and device tokens. + +mod limiter; +pub mod password; +pub mod secret; + +use std::sync::Arc; +use std::time::{Duration, Instant}; + +use parking_lot::Mutex; +use redshell_protocol::{ChangePasswordRequest, SetupRequest, SignInRequest, User}; + +use crate::bus::{Bus, BusEvent}; +use crate::now_ms; +use crate::store::{AuditEvent, Credential, Store}; +use limiter::Limiter; + +/// Name of the browser session cookie. The `__Host-` prefix makes browsers +/// accept it only when Secure, for this host and path `/`. +pub const COOKIE: &str = "__Host-redshell-session"; +/// A browser session lasts this long after it was last used. +pub const SESSION_TTL: Duration = Duration::from_secs(30 * 24 * 60 * 60); +/// Use of a credential is written back at most this often. +const TOUCH_EVERY_MS: i64 = 60 * 60 * 1000; +/// How long a setup link works. +const SETUP_TTL: Duration = Duration::from_secs(30 * 60); + +/// A signed-in request's user and credential. +#[derive(Debug, Clone)] +pub struct Principal { + pub user: User, + pub credential: Credential, + /// The device's name, or `browser`: who answered an approval. + pub label: String, + /// The browser session's expiry was pushed out: send the cookie again. + pub renewed: bool, +} + +/// A credential handed out by sign-in or setup. +#[derive(Debug, Clone)] +pub enum Issued { + /// Goes into the session cookie. + Cookie(String), + /// Returned once to the device. + DeviceToken(String), +} + +pub struct SignedIn { + pub user: User, + pub issued: Issued, +} + +/// Where a request comes from, for throttling and the audit log. +#[derive(Debug, Clone)] +pub struct Client { + pub ip: String, + pub user_agent: Option, +} + +#[derive(Debug, thiserror::Error)] +pub enum AuthError { + #[error("wrong username or password")] + InvalidCredentials, + #[error("too many failed attempts; try again in {} s", .0.as_secs().max(1))] + RateLimited(Duration), + #[error("{0}")] + BadRequest(String), + #[error("{0}")] + Forbidden(String), + #[error("{0}")] + Conflict(String), + #[error(transparent)] + Internal(#[from] anyhow::Error), +} + +struct SetupCode { + code: String, + expires: Instant, +} + +pub struct Auth { + store: Arc, + bus: Bus, + limiter: Limiter, + setup: Mutex>, + /// Where setup links point. + base_url: String, +} + +impl Auth { + pub fn new(store: Arc, bus: Bus, base_url: String) -> Self { + Self { store, bus, limiter: Limiter::default(), setup: Mutex::new(None), base_url } + } + + pub fn setup_required(&self) -> anyhow::Result { + Ok(self.store.user_count()? == 0) + } + + /// While no account exists, makes sure a setup code is valid (a new one + /// when the last expired) and logs its link. Returns the link. + pub fn announce_setup(&self) -> anyhow::Result> { + if !self.setup_required()? { + *self.setup.lock() = None; + return Ok(None); + } + let mut setup = self.setup.lock(); + let now = Instant::now(); + let fresh = setup.as_ref().is_none_or(|s| s.expires <= now); + if fresh { + *setup = Some(SetupCode { code: secret::random_string(16), expires: now + SETUP_TTL }); + } + let link = + format!("{}/setup?code={}", self.base_url, setup.as_ref().map(|s| s.code.as_str()).unwrap_or_default()); + if fresh { + log::warn!("No account exists yet. Create the first one within 30 minutes at:\n\n {link}\n"); + } + Ok(Some(link)) + } + + /// Creates the first account with the code from the setup link. + pub async fn setup(&self, req: SetupRequest, client: &Client) -> Result { + let ip_key = format!("ip:{}", client.ip); + self.limiter.check(&ip_key, Instant::now()).map_err(AuthError::RateLimited)?; + let valid = self + .setup + .lock() + .as_ref() + .is_some_and(|s| s.expires > Instant::now() && secret::same_secret(&s.code, &req.code)); + if !valid { + self.limiter.failure(&ip_key, Instant::now()); + return Err(AuthError::Forbidden("the setup link is not valid; restart the server for a new one".into())); + } + if !self.setup_required()? { + return Err(AuthError::Conflict("setup is already done".into())); + } + check_username(&req.username)?; + password::check_new(&req.password).map_err(AuthError::BadRequest)?; + let hash = password::hash(req.password).await?; + let user = self + .store + .create_user(&req.username, &hash)? + .ok_or_else(|| AuthError::Conflict("that name is taken".into()))?; + *self.setup.lock() = None; + self.store.audit(AuditEvent::Setup, Some(user.id), Some(&user.username), Some(&client.ip), ""); + log::info!("created the first account, {}", user.username); + self.issue(user, None, client) + } + + /// Password sign-in. Unknown users and wrong passwords fail alike, in + /// time too; repeated failures are throttled per IP and per name. + pub async fn sign_in(&self, req: SignInRequest, client: &Client) -> Result { + let now = Instant::now(); + let keys = [format!("ip:{}", client.ip), format!("user:{}", req.username.to_lowercase())]; + for key in &keys { + if let Err(wait) = self.limiter.check(key, now) { + self.store.audit(AuditEvent::SignInThrottled, None, Some(&req.username), Some(&client.ip), key); + return Err(AuthError::RateLimited(wait)); + } + } + let device = match req.device_name.as_deref().map(str::trim) { + Some(name) if name.is_empty() || name.chars().count() > 100 => { + return Err(AuthError::BadRequest("a device name has 1 to 100 characters".into())); + } + name => name.map(str::to_owned), + }; + let record = self.store.find_user(&req.username)?; + let hash = record.as_ref().map(|r| r.password_hash.clone()); + if !password::verify(req.password, hash).await { + for key in &keys { + self.limiter.failure(key, Instant::now()); + } + self.store.audit(AuditEvent::SignInFailed, None, Some(&req.username), Some(&client.ip), ""); + return Err(AuthError::InvalidCredentials); + } + for key in &keys { + self.limiter.success(key); + } + let user = record.map(|r| r.user).ok_or(AuthError::InvalidCredentials)?; + let detail = device.as_deref().map_or_else(|| "browser".to_owned(), |d| format!("device {d}")); + self.store.audit(AuditEvent::SignIn, Some(user.id), Some(&user.username), Some(&client.ip), &detail); + self.issue(user, device, client) + } + + fn issue(&self, user: User, device: Option, client: &Client) -> Result { + let token = secret::new_token(); + let hash = secret::token_hash(&token); + let issued = match device { + Some(name) => { + self.store.create_device(user.id, &name, &hash, &client.ip)?; + Issued::DeviceToken(token) + } + None => { + let expires = now_ms() + SESSION_TTL.as_millis() as i64; + self.store.create_browser_session(user.id, &hash, expires, &client.ip, client.user_agent.as_deref())?; + Issued::Cookie(token) + } + }; + Ok(SignedIn { user, issued }) + } + + /// The user behind a session cookie or a bearer device token. Use is + /// recorded (and a browser session extended) at most hourly. + pub fn authenticate(&self, cookie: Option<&str>, bearer: Option<&str>, client: &Client) -> Option { + let (device, token) = match (bearer, cookie) { + (Some(token), _) => (true, token), + (None, Some(token)) => (false, token), + (None, None) => return None, + }; + let owner = match self.store.find_token(device, &secret::token_hash(token)) { + Ok(owner) => owner?, + Err(err) => { + log::error!("checking a token: {err:#}"); + return None; + } + }; + let renewed = now_ms() - owner.last_seen_at >= TOUCH_EVERY_MS; + if renewed { + let expires = (!device).then(|| now_ms() + SESSION_TTL.as_millis() as i64); + if let Err(err) = self.store.touch(owner.credential, &client.ip, expires) { + log::error!("recording a sign-in's use: {err:#}"); + } + } + Some(Principal { + user: owner.user, + credential: owner.credential, + label: owner.device_name.unwrap_or_else(|| "browser".into()), + renewed: renewed && !device, + }) + } + + pub fn sign_out(&self, principal: &Principal, client: &Client) -> anyhow::Result<()> { + self.revoke(principal, principal.credential, client).map(drop) + } + + /// Revokes one of the principal's own credentials; `false` when it has + /// no such credential. + pub fn revoke(&self, principal: &Principal, credential: Credential, client: &Client) -> anyhow::Result { + let user = &principal.user; + if !self.store.revoke(user.id, credential)? { + return Ok(false); + } + let (event, detail) = match credential == principal.credential { + true => (AuditEvent::SignOut, String::new()), + false => (AuditEvent::CredentialRevoked, format!("{credential:?}")), + }; + self.store.audit(event, Some(user.id), Some(&user.username), Some(&client.ip), &detail); + self.bus.send(BusEvent::Revoked(credential)); + Ok(true) + } + + /// Changes the password after checking the current one, and signs out + /// every other browser and device. + pub async fn change_password( + &self, + principal: &Principal, + req: ChangePasswordRequest, + client: &Client, + ) -> Result<(), AuthError> { + let user = &principal.user; + let key = format!("user:{}", user.username.to_lowercase()); + self.limiter.check(&key, Instant::now()).map_err(AuthError::RateLimited)?; + password::check_new(&req.new_password).map_err(AuthError::BadRequest)?; + let current = self.store.user_by_id(user.id)?.map(|r| r.password_hash); + if !password::verify(req.current_password, current).await { + self.limiter.failure(&key, Instant::now()); + self.store.audit( + AuditEvent::PasswordChangeFailed, + Some(user.id), + Some(&user.username), + Some(&client.ip), + "", + ); + return Err(AuthError::InvalidCredentials); + } + let hash = password::hash(req.new_password).await?; + self.store.set_password(user.id, &hash)?; + self.store.revoke_all_except(user.id, Some(principal.credential))?; + self.store.audit(AuditEvent::PasswordChanged, Some(user.id), Some(&user.username), Some(&client.ip), ""); + self.bus.send(BusEvent::RevokedAllBut { user_id: user.id, keep: principal.credential }); + Ok(()) + } + + #[cfg(test)] + pub fn setup_code(&self) -> Option { + self.setup.lock().as_ref().map(|s| s.code.clone()) + } +} + +/// Names have 1 to 64 letters, digits and `. _ - @`. +fn check_username(name: &str) -> Result<(), AuthError> { + let ok = (1..=64).contains(&name.chars().count()) + && name.chars().all(|c| c.is_alphanumeric() || matches!(c, '.' | '_' | '-' | '@')); + if ok { + Ok(()) + } else { + Err(AuthError::BadRequest("a name has 1 to 64 letters, digits, '.', '_', '-' or '@'".into())) + } +} + +/// Validation shared with the `user` CLI. +pub fn valid_username(name: &str) -> Result<(), String> { + check_username(name).map_err(|e| e.to_string()) +} + +#[cfg(test)] +mod tests { + use super::*; + + fn auth() -> Auth { + Auth::new(Arc::new(Store::in_memory()), Bus::default(), "http://127.0.0.1:4747".into()) + } + + fn client() -> Client { + Client { ip: "10.0.0.1".into(), user_agent: Some("test".into()) } + } + + #[tokio::test] + async fn setup_then_sign_in_and_tokens() { + let auth = auth(); + let link = auth.announce_setup().unwrap().unwrap(); + let code = auth.setup_code().unwrap(); + assert!(link.ends_with(&code)); + let bad = SetupRequest { code: "nope".into(), username: "me".into(), password: "long password".into() }; + assert!(matches!(auth.setup(bad, &client()).await, Err(AuthError::Forbidden(_)))); + let req = SetupRequest { code, username: "me".into(), password: "long password".into() }; + let done = auth.setup(req.clone(), &client()).await.unwrap(); + let Issued::Cookie(cookie) = done.issued else { panic!("setup signs the browser in") }; + assert!(auth.announce_setup().unwrap().is_none()); + assert!(matches!(auth.setup(req, &client()).await, Err(AuthError::Forbidden(_))), "the code is used up"); + + let principal = auth.authenticate(Some(&cookie), None, &client()).unwrap(); + assert_eq!(principal.user.username, "me"); + let sign_in = |password: &str, device: Option<&str>| SignInRequest { + username: "ME".into(), + password: password.into(), + device_name: device.map(Into::into), + }; + let device = auth.sign_in(sign_in("long password", Some("laptop")), &client()).await.unwrap(); + let Issued::DeviceToken(token) = device.issued else { panic!("a named device gets a token") }; + assert!(auth.authenticate(None, Some(&token), &client()).is_some()); + assert!(auth.authenticate(None, Some(&cookie), &client()).is_none(), "a cookie is no bearer token"); + assert!(matches!(auth.sign_in(sign_in("wrong", None), &client()).await, Err(AuthError::InvalidCredentials))); + + auth.sign_out(&principal, &client()).unwrap(); + assert!(auth.authenticate(Some(&cookie), None, &client()).is_none()); + } + + #[tokio::test] + async fn unknown_users_fail_like_wrong_passwords_and_get_throttled() { + let auth = auth(); + auth.store.create_user("me", &password::hash("long password".into()).await.unwrap()).unwrap(); + let attempt = |name: &str| SignInRequest { username: name.into(), password: "guess".into(), device_name: None }; + for name in ["me", "ghost", "me"] { + assert!(matches!(auth.sign_in(attempt(name), &client()).await, Err(AuthError::InvalidCredentials))); + } + assert!(matches!(auth.sign_in(attempt("other"), &client()).await, Err(AuthError::RateLimited(_)))); + let elsewhere = Client { ip: "10.0.0.2".into(), user_agent: None }; + assert!(matches!(auth.sign_in(attempt("ghost"), &elsewhere).await, Err(AuthError::InvalidCredentials))); + let events = auth.store.audit_events(); + assert_eq!(events.iter().filter(|(e, _)| e == "sign_in_failed").count(), 4); + assert!(events.iter().any(|(e, _)| e == "sign_in_throttled")); + } + + #[tokio::test] + async fn changing_the_password_signs_out_everything_else() { + let auth = auth(); + auth.store.create_user("me", &password::hash("long password".into()).await.unwrap()).unwrap(); + let sign_in = |device: Option<&str>| SignInRequest { + username: "me".into(), + password: "long password".into(), + device_name: device.map(Into::into), + }; + let Issued::Cookie(a) = auth.sign_in(sign_in(None), &client()).await.unwrap().issued else { panic!() }; + let Issued::DeviceToken(b) = auth.sign_in(sign_in(Some("pc")), &client()).await.unwrap().issued else { + panic!() + }; + let principal = auth.authenticate(Some(&a), None, &client()).unwrap(); + let change = |current: &str| ChangePasswordRequest { + current_password: current.into(), + new_password: "new password".into(), + }; + assert!(matches!( + auth.change_password(&principal, change("wrong"), &client()).await, + Err(AuthError::InvalidCredentials) + )); + auth.change_password(&principal, change("long password"), &client()).await.unwrap(); + assert!(auth.authenticate(Some(&a), None, &client()).is_some()); + assert!(auth.authenticate(None, Some(&b), &client()).is_none()); + } +} diff --git a/crates/redshell-server/src/auth/password.rs b/crates/redshell-server/src/auth/password.rs new file mode 100644 index 0000000..8bb3ae6 --- /dev/null +++ b/crates/redshell-server/src/auth/password.rs @@ -0,0 +1,76 @@ +//! Argon2id password hashes (PHC strings), computed off the async workers. + +use std::sync::LazyLock; + +use argon2::Argon2; +use argon2::password_hash::{PasswordHash, PasswordHasher as _, PasswordVerifier as _, SaltString}; +use rand_core::OsRng; + +/// Shortest password accepted. +pub const MIN_LENGTH: usize = 10; +/// Longest password hashed, so a huge body cannot keep a CPU busy. +pub const MAX_LENGTH: usize = 1024; + +/// Checked against when the user does not exist, so an unknown name takes +/// as long as a wrong password. +static DUMMY_HASH: LazyLock = LazyLock::new(|| hash_now("not a real password").unwrap_or_default()); + +/// Why a new password is refused, if it is. +pub fn check_new(password: &str) -> Result<(), String> { + let length = password.chars().count(); + if length < MIN_LENGTH { + Err(format!("the password needs at least {MIN_LENGTH} characters")) + } else if password.len() > MAX_LENGTH { + Err(format!("the password can have at most {MAX_LENGTH} bytes")) + } else { + Ok(()) + } +} + +/// Argon2id with the crate's defaults (19 MiB, 2 passes), as OWASP advises. +fn hash_now(password: &str) -> anyhow::Result { + let salt = SaltString::generate(&mut OsRng); + Ok(Argon2::default().hash_password(password.as_bytes(), &salt).map_err(anyhow::Error::msg)?.to_string()) +} + +fn verify_now(password: &str, hash: &str) -> bool { + password.len() <= MAX_LENGTH + && PasswordHash::new(hash) + .is_ok_and(|parsed| Argon2::default().verify_password(password.as_bytes(), &parsed).is_ok()) +} + +pub async fn hash(password: String) -> anyhow::Result { + tokio::task::spawn_blocking(move || hash_now(&password)).await? +} + +/// Verifies `password` against `hash`, or against a dummy hash when there +/// is no user, which always fails but costs the same. +pub async fn verify(password: String, hash: Option) -> bool { + tokio::task::spawn_blocking(move || { + let ok = verify_now(&password, hash.as_deref().unwrap_or(&DUMMY_HASH)); + ok && hash.is_some() + }) + .await + .unwrap_or(false) +} + +/// For the CLI, which has no runtime. +pub fn hash_blocking(password: &str) -> anyhow::Result { + hash_now(password) +} + +#[cfg(test)] +mod tests { + use super::*; + + #[tokio::test] + async fn hashes_verify_and_unknown_users_fail() { + let h = hash("correct horse".into()).await.unwrap(); + assert!(h.starts_with("$argon2id$")); + assert!(verify("correct horse".into(), Some(h.clone())).await); + assert!(!verify("wrong horse".into(), Some(h)).await); + assert!(!verify("not a real password".into(), None).await); + assert!(check_new("short").is_err()); + assert!(check_new("long enough").is_ok()); + } +} diff --git a/crates/redshell-server/src/auth/secret.rs b/crates/redshell-server/src/auth/secret.rs new file mode 100644 index 0000000..795bb5c --- /dev/null +++ b/crates/redshell-server/src/auth/secret.rs @@ -0,0 +1,42 @@ +//! Random tokens and their hashes. + +use base64::Engine as _; +use base64::engine::general_purpose::URL_SAFE_NO_PAD; +use rand_core::{OsRng, RngCore as _}; +use sha2::{Digest as _, Sha256}; + +/// A fresh random token: 256 bits, base64url (43 characters). +pub fn new_token() -> String { + random_string(32) +} + +/// `bytes` random bytes as base64url. +pub fn random_string(bytes: usize) -> String { + let mut buf = vec![0u8; bytes]; + OsRng.fill_bytes(&mut buf); + URL_SAFE_NO_PAD.encode(buf) +} + +/// SHA-256 of a token: what the database keeps. +pub fn token_hash(token: &str) -> [u8; 32] { + Sha256::digest(token.as_bytes()).into() +} + +/// Compares two secrets without leaking where they differ: their hashes are +/// compared instead of the secrets themselves. +pub fn same_secret(a: &str, b: &str) -> bool { + token_hash(a) == token_hash(b) +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn tokens_are_long_and_distinct() { + let (a, b) = (new_token(), new_token()); + assert_eq!(a.len(), 43); + assert_ne!(a, b); + assert!(same_secret(&a, &a.clone()) && !same_secret(&a, &b)); + } +} diff --git a/crates/redshell-server/src/bus.rs b/crates/redshell-server/src/bus.rs new file mode 100644 index 0000000..f2add42 --- /dev/null +++ b/crates/redshell-server/src/bus.rs @@ -0,0 +1,51 @@ +//! Server-wide notifications, fanned out to every WebSocket. +//! +//! Senders never wait: a connection that falls behind gets `Lagged` and +//! resends its full view (the session list, the pending approvals). + +use redshell_protocol::{Approval, ApprovalOutcome, SessionEvent}; +use tokio::sync::broadcast; + +use crate::store::Credential; + +#[derive(Debug, Clone)] +pub enum BusEvent { + /// Something in the session's [`redshell_protocol::SessionInfo`] changed. + SessionChanged(String), + SessionRemoved(String), + ApprovalRequested(Approval), + ApprovalResolved { + id: String, + session: String, + outcome: ApprovalOutcome, + answered_by: Option, + }, + Event(SessionEvent), + /// A credential was revoked: its WebSockets close. + Revoked(Credential), + /// Every credential of the user except `keep` was revoked. + RevokedAllBut { + user_id: i64, + keep: Credential, + }, +} + +#[derive(Clone)] +pub struct Bus(broadcast::Sender); + +impl Default for Bus { + fn default() -> Self { + Self(broadcast::channel(1024).0) + } +} + +impl Bus { + pub fn send(&self, event: BusEvent) { + // No receivers (no client connected) is fine. + let _ = self.0.send(event); + } + + pub fn subscribe(&self) -> broadcast::Receiver { + self.0.subscribe() + } +} diff --git a/crates/redshell-server/src/cli.rs b/crates/redshell-server/src/cli.rs new file mode 100644 index 0000000..f8cd061 --- /dev/null +++ b/crates/redshell-server/src/cli.rs @@ -0,0 +1,85 @@ +//! `redshell-server user …`: accounts from the command line, straight in +//! the database (also while the server runs). + +use std::io::BufRead as _; +use std::path::Path; + +use anyhow::{Context as _, bail}; + +use crate::auth::{password, valid_username}; +use crate::store::{AuditEvent, Store}; + +/// Where a new password comes from. +pub enum PasswordSource { + /// Asked twice on the terminal. + Prompt, + /// The first line of standard input (scripts). + Stdin, +} + +fn open(config_dir: &Path) -> anyhow::Result { + std::fs::create_dir_all(config_dir)?; + crate::config::restrict_dir(config_dir)?; + Store::open(&config_dir.join("server.sqlite3")) +} + +fn read_password(source: PasswordSource) -> anyhow::Result { + let password = match source { + PasswordSource::Stdin => { + let mut line = String::new(); + std::io::stdin().lock().read_line(&mut line)?; + line.trim_end_matches(['\r', '\n']).to_owned() + } + PasswordSource::Prompt => { + let first = rpassword::prompt_password("New password: ")?; + let second = rpassword::prompt_password("Again: ")?; + if first != second { + bail!("the passwords differ"); + } + first + } + }; + password::check_new(&password).map_err(anyhow::Error::msg)?; + Ok(password) +} + +pub fn add_user(config_dir: &Path, username: &str, source: PasswordSource) -> anyhow::Result<()> { + valid_username(username).map_err(anyhow::Error::msg)?; + let store = open(config_dir)?; + if store.find_user(username)?.is_some() { + bail!("{username} exists already"); + } + let hash = password::hash_blocking(&read_password(source)?)?; + let user = store.create_user(username, &hash)?.with_context(|| format!("{username} exists already"))?; + store.audit(AuditEvent::UserAdded, Some(user.id), Some(&user.username), None, "cli"); + println!("added {}", user.username); + Ok(()) +} + +/// Sets a new password and signs the user out everywhere. +pub fn set_password(config_dir: &Path, username: &str, source: PasswordSource) -> anyhow::Result<()> { + let store = open(config_dir)?; + let user = store.find_user(username)?.with_context(|| format!("no user {username}"))?.user; + let hash = password::hash_blocking(&read_password(source)?)?; + store.set_password(user.id, &hash)?; + store.revoke_all_except(user.id, None)?; + store.audit(AuditEvent::PasswordChanged, Some(user.id), Some(&user.username), None, "cli"); + println!("changed the password of {}; every browser and device of theirs is signed out", user.username); + Ok(()) +} + +pub fn remove_user(config_dir: &Path, username: &str) -> anyhow::Result<()> { + let store = open(config_dir)?; + let user = store.find_user(username)?.with_context(|| format!("no user {username}"))?.user; + store.remove_user(&user.username)?; + store.audit(AuditEvent::UserRemoved, Some(user.id), Some(&user.username), None, "cli"); + println!("removed {}", user.username); + Ok(()) +} + +pub fn list_users(config_dir: &Path) -> anyhow::Result<()> { + for user in open(config_dir)?.users()? { + println!("{}", user.username); + } + Ok(()) +} diff --git a/crates/redshell-server/src/config.rs b/crates/redshell-server/src/config.rs new file mode 100644 index 0000000..b67ab14 --- /dev/null +++ b/crates/redshell-server/src/config.rs @@ -0,0 +1,190 @@ +//! Where the server keeps its files and what `config.toml` tells it. +//! +//! The config directory holds `config.toml` (the desktop's format plus a +//! `[server]` section), the SQLite database, shell integration scripts and +//! `run/`, a private folder for per-session files that live only while the +//! server runs (agent hook settings). + +use std::net::{IpAddr, SocketAddr}; +use std::path::{Path, PathBuf}; +use std::time::Duration; + +use anyhow::{Context as _, bail}; +use redshell_core::Settings; +use redshell_core::settings::SettingsFile; + +/// Written when the config directory has no `config.toml` yet. +const TEMPLATE: &str = r#"# redshell-server configuration: the desktop's config.toml format. +# [ssh], [agents] and [terminal] mean what they mean on the desktop. +# Reference: docs/REMOTE.md and docs/CONFIG.md + +[server] +listen = "127.0.0.1:4747" # anything but loopback needs tls_cert and tls_key +# public_url = "https://box.example.ts.net" +# tls_cert = "/etc/redshell-server/cert.pem" +# tls_key = "/etc/redshell-server/key.pem" +# trusted_proxies = ["127.0.0.1", "::1"] # behind Tailscale Serve or cloudflared +approval_timeout_secs = 600 + +[ssh] +import_ssh_config = true +"#; + +/// PEM files for built-in TLS. +#[derive(Debug, Clone, PartialEq, Eq)] +pub struct TlsFiles { + pub cert: PathBuf, + pub key: PathBuf, +} + +/// The server's configuration, checked. +#[derive(Debug, Clone)] +pub struct ServerConfig { + pub dir: PathBuf, + pub settings: Settings, + pub listen: SocketAddr, + /// Origin (`https://host[:port]`) of `public_url`. + pub public_origin: Option, + pub tls: Option, + pub trusted_proxies: Vec, + pub approval_timeout: Duration, +} + +impl ServerConfig { + /// `~/.config/redshell-server` (or the platform's equivalent). + pub fn default_dir() -> PathBuf { + dirs::config_dir().unwrap_or_else(|| PathBuf::from(".")).join("redshell-server") + } + + /// Reads `/config.toml`, writing a commented template first when it + /// is missing. Unlike the desktop, a broken file stops the server: it + /// would otherwise start with settings nobody chose. + pub fn load(dir: &Path) -> anyhow::Result { + std::fs::create_dir_all(dir).with_context(|| format!("creating {}", dir.display()))?; + restrict_dir(dir)?; + let path = dir.join("config.toml"); + if !path.exists() { + std::fs::write(&path, TEMPLATE).with_context(|| format!("writing {}", path.display()))?; + } + let (file, settings) = SettingsFile::open(path); + if let Some(error) = file.error() { + bail!("{error}"); + } + Self::from_settings(dir, settings.sanitized()) + } + + /// Checks the `[server]` section of `settings`. + pub fn from_settings(dir: &Path, settings: Settings) -> anyhow::Result { + let s = &settings.server; + let listen: SocketAddr = + s.listen.parse().with_context(|| format!("server.listen = {:?} is not an address:port", s.listen))?; + let tls = match (&s.tls_cert, &s.tls_key) { + (Some(cert), Some(key)) => Some(TlsFiles { cert: cert.clone(), key: key.clone() }), + (None, None) => None, + _ => bail!("server.tls_cert and server.tls_key go together"), + }; + if tls.is_none() && !listen.ip().is_loopback() { + bail!( + "server.listen = {listen} is reachable from the network, but there is no TLS: set server.tls_cert and \ + server.tls_key, or listen on 127.0.0.1 behind a TLS proxy (Tailscale Serve, cloudflared)" + ); + } + let public_origin = s.public_url.as_deref().map(origin_of).transpose()?; + let trusted_proxies = s + .trusted_proxies + .iter() + .map(|p| p.parse().with_context(|| format!("server.trusted_proxies: {p:?} is not an IP address"))) + .collect::>()?; + Ok(Self { + dir: dir.to_owned(), + listen, + public_origin, + tls, + trusted_proxies, + approval_timeout: Duration::from_secs(s.approval_timeout_secs.max(1)), + settings, + }) + } + + pub fn database(&self) -> PathBuf { + self.dir.join("server.sqlite3") + } + + /// Per-session files (hook settings), private to the server's user. + pub fn runtime_dir(&self) -> PathBuf { + self.dir.join("run") + } + + /// Where clients reach the server: `public_url`, else the address the + /// listener is `bound` to. + pub fn base_url(&self, bound: SocketAddr) -> String { + self.public_origin.clone().unwrap_or_else(|| { + let scheme = if self.tls.is_some() { "https" } else { "http" }; + format!("{scheme}://{bound}") + }) + } +} + +/// `https://Host:443/path` → `https://host`: scheme, host and a port that is +/// not the scheme's default, as browsers send it in `Origin`. +pub fn origin_of(url: &str) -> anyhow::Result { + let (scheme, rest) = url.split_once("://").with_context(|| format!("{url:?} is not a URL"))?; + let scheme = scheme.to_ascii_lowercase(); + let default_port = match scheme.as_str() { + "https" => ":443", + "http" => ":80", + _ => bail!("{url:?} is not an http(s) URL"), + }; + let authority = rest.split(['/', '?', '#']).next().unwrap_or_default().to_ascii_lowercase(); + if authority.is_empty() || authority.contains('@') { + bail!("{url:?} has no host"); + } + let authority = authority.strip_suffix(default_port).unwrap_or(&authority); + Ok(format!("{scheme}://{authority}")) +} + +/// Makes `dir` private to the server's user (0700). +pub(crate) fn restrict_dir(dir: &Path) -> anyhow::Result<()> { + #[cfg(unix)] + { + use std::os::unix::fs::PermissionsExt as _; + std::fs::set_permissions(dir, std::fs::Permissions::from_mode(0o700)) + .with_context(|| format!("making {} private", dir.display()))?; + } + #[cfg(not(unix))] + let _ = dir; + Ok(()) +} + +#[cfg(test)] +mod tests { + use super::*; + + fn config(toml: &str) -> anyhow::Result { + ServerConfig::from_settings(Path::new("/x"), Settings::from_toml(toml).unwrap()) + } + + #[test] + fn plain_http_only_on_loopback() { + assert!(config("").is_ok()); + assert!(config("[server]\nlisten = \"[::1]:4747\"\n").is_ok()); + let err = config("[server]\nlisten = \"0.0.0.0:4747\"\n").unwrap_err().to_string(); + assert!(err.contains("no TLS"), "{err}"); + let tls = "[server]\nlisten = \"0.0.0.0:443\"\ntls_cert = \"c.pem\"\ntls_key = \"k.pem\"\n"; + assert!(config(tls).unwrap().tls.is_some()); + assert!(config("[server]\ntls_cert = \"c.pem\"\n").is_err()); + assert!(config("[server]\nlisten = \"localhost\"\n").is_err()); + } + + #[test] + fn origins_drop_paths_and_default_ports() { + assert_eq!(origin_of("https://Box.ts.net/").unwrap(), "https://box.ts.net"); + assert_eq!(origin_of("https://box:443/app?x").unwrap(), "https://box"); + assert_eq!(origin_of("http://127.0.0.1:4747").unwrap(), "http://127.0.0.1:4747"); + assert!(origin_of("ftp://x").is_err()); + assert!(origin_of("https://").is_err()); + let c = config("[server]\npublic_url = \"https://box.ts.net\"\ntrusted_proxies = [\"127.0.0.1\"]\n").unwrap(); + assert_eq!(c.base_url(c.listen), "https://box.ts.net"); + assert!(config("[server]\ntrusted_proxies = [\"proxy\"]\n").is_err()); + } +} diff --git a/crates/redshell-server/src/lib.rs b/crates/redshell-server/src/lib.rs new file mode 100644 index 0000000..5a5f863 --- /dev/null +++ b/crates/redshell-server/src/lib.rs @@ -0,0 +1,148 @@ +//! # redshell-server +//! +//! Headless RedShell: terminal sessions (shells, coding agents, SSH hosts) +//! owned by the server, which any number of clients attach to: the desktop +//! and the RedShell Remote PWA it serves. Sessions outlive every client. +//! +//! * [`config`] – the config directory and the `[server]` section. +//! * `store` – SQLite: accounts, credentials, audit log, session metadata. +//! * `auth` – setup, password sign-in with backoff, cookies and device tokens. +//! * `sessions` – PTY sessions, their output fan-out and snapshots. +//! * `agents` – Claude Code and Codex hooks on a loopback listener, and +//! the approvals they hold open. +//! * `web` – the REST API, the WebSocket and the embedded PWA. +//! +//! The wire types live in `redshell-protocol`; `docs/REMOTE.md` describes +//! running the server and the API. + +mod agents; +mod auth; +mod bus; +pub mod cli; +pub mod config; +mod sessions; +mod store; +mod web; + +use std::net::SocketAddr; +use std::sync::Arc; +use std::time::Duration; + +use anyhow::Context as _; + +use crate::agents::Approvals; +use crate::auth::Auth; +use crate::bus::Bus; +pub use crate::config::ServerConfig; +use crate::sessions::{Ctx, Sessions}; +use crate::store::Store; +use crate::web::AppState; + +pub use agents::{HOOK_URL_ENV, post_notify}; +pub use web::CSP; + +/// Unix time in milliseconds. +pub(crate) fn now_ms() -> i64 { + std::time::SystemTime::now().duration_since(std::time::UNIX_EPOCH).map_or(0, |d| d.as_millis() as i64) +} + +/// A started server. +pub struct RunningServer { + /// Where the public listener is bound. + pub addr: SocketAddr, + /// The loopback listener agent hooks post to. + pub hook_addr: SocketAddr, + app: web::Shared, + handle: axum_server::Handle, + serving: Option>>, + hooks: tokio::task::JoinHandle<()>, +} + +impl RunningServer { + /// Binds both listeners and starts serving. With no account yet, the + /// setup link is logged. + pub async fn start(config: ServerConfig) -> anyhow::Result { + let config = Arc::new(config); + let runtime_dir = config.runtime_dir(); + // Files of the last run are stale (and hold dead tokens). + let _ = std::fs::remove_dir_all(&runtime_dir); + std::fs::create_dir_all(&runtime_dir).with_context(|| format!("creating {}", runtime_dir.display()))?; + config::restrict_dir(&runtime_dir)?; + + let store = Arc::new(Store::open(&config.database())?); + store.end_orphaned_sessions()?; + store.prune_expired_sessions()?; + store.prune_audit_log()?; + + let bus = Bus::default(); + let hook_listener = + tokio::net::TcpListener::bind(("127.0.0.1", 0)).await.context("binding the hook listener")?; + let hook_addr = hook_listener.local_addr()?; + let ctx = Arc::new(Ctx { + settings: config.settings.clone(), + config_dir: config.dir.clone(), + runtime_dir, + bus: bus.clone(), + store: store.clone(), + approvals: Approvals::new(bus.clone()), + runtime: tokio::runtime::Handle::current(), + hook_addr, + approval_timeout: config.approval_timeout, + }); + let sessions = Arc::new(Sessions::new(ctx)); + let hook_router = agents::hooks::router(sessions.clone()); + let hooks = tokio::spawn(async move { + if let Err(err) = axum::serve(hook_listener, hook_router).await { + log::error!("hook listener: {err}"); + } + }); + + let listener = + std::net::TcpListener::bind(config.listen).with_context(|| format!("listening on {}", config.listen))?; + let addr = listener.local_addr()?; + let auth = Auth::new(store.clone(), bus.clone(), config.base_url(addr)); + auth.announce_setup()?; + let app = Arc::new(AppState { config: config.clone(), auth, sessions, store, bus }); + let make_service = web::router(app.clone()).into_make_service_with_connect_info::(); + let handle = axum_server::Handle::new(); + let serving = match &config.tls { + Some(tls) => { + let rustls = axum_server::tls_rustls::RustlsConfig::from_pem_file(&tls.cert, &tls.key) + .await + .with_context(|| format!("loading {} and {}", tls.cert.display(), tls.key.display()))?; + let server = axum_server::tls_rustls::from_tcp_rustls(listener, rustls)?.handle(handle.clone()); + tokio::spawn(server.serve(make_service)) + } + None => { + let server = axum_server::from_tcp(listener)?.handle(handle.clone()); + tokio::spawn(server.serve(make_service)) + } + }; + let scheme = if config.tls.is_some() { "https" } else { "http" }; + log::info!("redshell-server {} listening on {scheme}://{addr}", env!("CARGO_PKG_VERSION")); + Ok(Self { addr, hook_addr, app, handle, serving: Some(serving), hooks }) + } + + /// The setup link while no account exists. + pub fn setup_link(&self) -> anyhow::Result> { + self.app.auth.announce_setup() + } + + /// Runs until the listener stops (it only does on an error). + pub async fn wait(&mut self) -> anyhow::Result<()> { + if let Some(serving) = self.serving.take() { + serving.await??; + } + Ok(()) + } + + /// Stops accepting, closes connections, kills every session. + pub async fn shutdown(self) { + self.handle.graceful_shutdown(Some(Duration::from_secs(2))); + self.app.sessions.shutdown(); + self.hooks.abort(); + if let Some(serving) = self.serving { + let _ = serving.await; + } + } +} diff --git a/crates/redshell-server/src/main.rs b/crates/redshell-server/src/main.rs new file mode 100644 index 0000000..79616be --- /dev/null +++ b/crates/redshell-server/src/main.rs @@ -0,0 +1,124 @@ +//! `redshell-server`: see `docs/REMOTE.md`. + +use std::path::PathBuf; + +use anyhow::Context as _; +use clap::{Parser, Subcommand}; +use redshell_server::cli::{self, PasswordSource}; +use redshell_server::{RunningServer, ServerConfig}; + +#[derive(Parser)] +#[command( + name = "redshell-server", + version, + about = "Headless RedShell: terminal sessions for the desktop and RedShell Remote" +)] +struct Args { + /// Config directory: config.toml, the database and runtime files + /// [default: ~/.config/redshell-server] + #[arg(long, global = true, env = "REDSHELL_SERVER_CONFIG")] + config: Option, + #[command(subcommand)] + command: Option, +} + +#[derive(Subcommand)] +enum Command { + /// Run the server (the default) + Serve, + /// Manage accounts + #[command(subcommand)] + User(UserCommand), + /// Report an agent event to the server (agents run this, not people) + #[command(subcommand, hide = true)] + Hook(HookCommand), +} + +#[derive(Subcommand)] +enum UserCommand { + /// Add an account + Add { + name: String, + /// Read the password from the first line of standard input + #[arg(long)] + password_stdin: bool, + }, + /// Set an account's password and sign it out everywhere + Passwd { + name: String, + #[arg(long)] + password_stdin: bool, + }, + /// Remove an account + Remove { name: String }, + /// List accounts + List, +} + +#[derive(Subcommand)] +enum HookCommand { + /// Codex's `notify` program: posts its JSON payload to the session's hook URL + Codex { + /// The JSON payload Codex appends + payload: String, + }, +} + +fn source(stdin: bool) -> PasswordSource { + if stdin { PasswordSource::Stdin } else { PasswordSource::Prompt } +} + +fn main() -> anyhow::Result<()> { + env_logger::Builder::from_env(env_logger::Env::default().default_filter_or("info")).init(); + let args = Args::parse(); + let dir = args.config.unwrap_or_else(ServerConfig::default_dir); + match args.command.unwrap_or(Command::Serve) { + Command::Serve => serve(dir), + Command::User(UserCommand::Add { name, password_stdin }) => cli::add_user(&dir, &name, source(password_stdin)), + Command::User(UserCommand::Passwd { name, password_stdin }) => { + cli::set_password(&dir, &name, source(password_stdin)) + } + Command::User(UserCommand::Remove { name }) => cli::remove_user(&dir, &name), + Command::User(UserCommand::List) => cli::list_users(&dir), + Command::Hook(HookCommand::Codex { payload }) => { + let url = std::env::var(redshell_server::HOOK_URL_ENV).with_context(|| { + format!("{} is not set: run by Codex inside a server session", redshell_server::HOOK_URL_ENV) + })?; + runtime(1)?.block_on(redshell_server::post_notify(&url, payload)) + } + } +} + +fn runtime(workers: usize) -> anyhow::Result { + Ok(tokio::runtime::Builder::new_multi_thread().worker_threads(workers).enable_all().build()?) +} + +fn serve(dir: PathBuf) -> anyhow::Result<()> { + let _ = rustls::crypto::ring::default_provider().install_default(); + let config = ServerConfig::load(&dir)?; + log::info!("config directory: {}", dir.display()); + // Two workers are plenty for a handful of clients, and keep a Pi idle. + runtime(2)?.block_on(async { + let mut server = RunningServer::start(config).await?; + tokio::select! { + result = server.wait() => result?, + () = stop_signal() => log::info!("stopping"), + } + server.shutdown().await; + Ok(()) + }) +} + +async fn stop_signal() { + #[cfg(unix)] + { + use tokio::signal::unix::{SignalKind, signal}; + let mut term = signal(SignalKind::terminate()).expect("installing a SIGTERM handler"); + tokio::select! { + _ = tokio::signal::ctrl_c() => {} + _ = term.recv() => {} + } + } + #[cfg(not(unix))] + let _ = tokio::signal::ctrl_c().await; +} diff --git a/crates/redshell-server/src/sessions/launch.rs b/crates/redshell-server/src/sessions/launch.rs new file mode 100644 index 0000000..9c5ff12 --- /dev/null +++ b/crates/redshell-server/src/sessions/launch.rs @@ -0,0 +1,188 @@ +//! What a new session runs: the profiles the server offers and how a +//! create request becomes a command line. + +use std::path::{Path, PathBuf}; + +use redshell_agents::AgentRegistry; +use redshell_core::shell::LocalShell; +use redshell_core::shell_integration::ShellIntegration; +use redshell_core::{CommandSpec, Launchable as _, Settings}; +use redshell_protocol::{CreateSessionRequest, Profile, SessionKind}; +use redshell_remote::SshProvider; + +/// Id of the default shell's profile. +pub const SHELL: &str = "shell"; + +/// A resolved request: the command and what it was started from. +#[derive(Debug, Clone)] +pub struct Launch { + pub spec: CommandSpec, + pub kind: SessionKind, + pub profile: Option, + pub profile_name: Option, + /// Agent id for agent sessions. + pub agent: Option, + pub command: Option>, + pub start_cwd: Option, + /// Title until the program sets one. + pub title: String, +} + +/// Everything a session can start from, on this server. +pub fn profiles(settings: &Settings) -> Vec { + let shell = LocalShell::from_settings(&settings.terminal); + let mut out = vec![Profile { + id: SHELL.into(), + name: shell.name(), + kind: SessionKind::Shell, + description: shell.description(), + available: true, + group: None, + }]; + for agent in AgentRegistry::detect(&settings.agents).agents() { + out.push(Profile { + id: format!("agent:{}", agent.id), + name: agent.name.clone(), + kind: SessionKind::Agent, + description: agent.description(), + available: agent.available(), + group: None, + }); + } + for host in SshProvider::new(&settings.ssh).hosts() { + out.push(Profile { + id: format!("ssh:{}", host.host.name), + name: host.name(), + kind: SessionKind::Ssh, + description: host.description(), + available: host.available(), + group: host.host.group.clone(), + }); + } + out +} + +/// Turns a create request into a command. Errors are for the client. +pub fn resolve(req: &CreateSessionRequest, settings: &Settings, config_dir: &Path) -> Result { + let cwd = match req.cwd.as_deref().filter(|c| !c.trim().is_empty()) { + Some(cwd) => Some(folder(cwd)?), + None => None, + }; + let mut launch = match (&req.command, req.profile.as_deref()) { + (Some(_), Some(_)) => return Err("give a profile or a command, not both".into()), + (Some(argv), None) => { + let (program, args) = argv.split_first().ok_or("the command is empty")?; + Launch { + spec: CommandSpec::new(program).args(args.iter().cloned()), + kind: SessionKind::Command, + profile: None, + profile_name: None, + agent: None, + command: Some(argv.clone()), + start_cwd: None, + title: program.clone(), + } + } + (None, None | Some(SHELL)) => { + let shell = LocalShell::from_settings(&settings.terminal); + let mut spec = shell.command(); + if settings.terminal.shell_integration + && let Err(err) = ShellIntegration::new(config_dir).apply(&mut spec) + { + log::warn!("shell integration: {err}"); + } + from_profile(SHELL, shell.name(), SessionKind::Shell, None, spec) + } + (None, Some(id)) => { + if let Some(agent_id) = id.strip_prefix("agent:") { + let registry = AgentRegistry::detect(&settings.agents); + let agent = registry.get(agent_id).filter(|a| a.available()).ok_or("that agent is not installed")?; + from_profile(id, agent.name.clone(), SessionKind::Agent, Some(agent_id.into()), agent.command()) + } else if let Some(host) = id.strip_prefix("ssh:") { + let provider = SshProvider::new(&settings.ssh); + let host = provider.find(host).ok_or("no such SSH host")?; + from_profile(id, host.name(), SessionKind::Ssh, None, host.command()) + } else { + return Err(format!("no profile {id:?}")); + } + } + }; + let cwd = cwd + .or_else(|| launch.spec.cwd.clone()) + .or_else(|| settings.terminal.working_directory.clone()) + .or_else(dirs::home_dir); + launch.start_cwd = cwd.as_ref().map(|c| c.display().to_string()); + launch.spec.cwd = cwd; + for (key, value) in &settings.terminal.env { + launch.spec.env.entry(key.clone()).or_insert_with(|| value.clone()); + } + Ok(launch) +} + +fn from_profile(id: &str, name: String, kind: SessionKind, agent: Option, spec: CommandSpec) -> Launch { + Launch { + spec, + kind, + profile: Some(id.into()), + title: name.clone(), + profile_name: Some(name), + agent, + command: None, + start_cwd: None, + } +} + +/// An existing absolute folder (`~` is the server user's home). +pub fn folder(path: &str) -> Result { + let path = match path.strip_prefix('~') { + Some(rest) if rest.is_empty() || rest.starts_with('/') => { + dirs::home_dir().ok_or("the server user has no home folder")?.join(rest.trim_start_matches('/')) + } + _ => PathBuf::from(path), + }; + if !path.is_absolute() { + return Err("the folder must be an absolute path".into()); + } + if !path.is_dir() { + return Err(format!("{} is not a folder", path.display())); + } + Ok(path) +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn commands_profiles_and_folders() { + let dir = tempfile::tempdir().unwrap(); + let settings = Settings::from_toml( + "[ssh]\nimport_ssh_config = false\n[[ssh.hosts]]\nname = \"box\"\nhost = \"box.lan\"\ngroup = \"lab\"\n", + ) + .unwrap(); + let cwd = dir.path().display().to_string(); + let req = CreateSessionRequest { + command: Some(vec!["sh".into(), "-c".into(), "true".into()]), + cwd: Some(cwd.clone()), + ..Default::default() + }; + let launch = resolve(&req, &settings, dir.path()).unwrap(); + assert_eq!((launch.kind, launch.spec.args.len()), (SessionKind::Command, 2)); + assert_eq!(launch.start_cwd.as_deref(), Some(cwd.as_str())); + + let ssh = resolve( + &CreateSessionRequest { profile: Some("ssh:box".into()), ..Default::default() }, + &settings, + dir.path(), + ) + .unwrap(); + assert_eq!((ssh.kind, ssh.profile_name.as_deref()), (SessionKind::Ssh, Some("box"))); + assert!(ssh.spec.args.contains(&"box.lan".to_string())); + assert!(profiles(&settings).iter().any(|p| p.id == "ssh:box" && p.group.as_deref() == Some("lab"))); + + let bad = |req: CreateSessionRequest| resolve(&req, &settings, dir.path()).unwrap_err(); + bad(CreateSessionRequest { profile: Some("nope".into()), ..Default::default() }); + bad(CreateSessionRequest { command: Some(vec![]), ..Default::default() }); + assert!(bad(CreateSessionRequest { cwd: Some("relative".into()), ..Default::default() }).contains("absolute")); + } +} diff --git a/crates/redshell-server/src/sessions/mod.rs b/crates/redshell-server/src/sessions/mod.rs new file mode 100644 index 0000000..ea12ed3 --- /dev/null +++ b/crates/redshell-server/src/sessions/mod.rs @@ -0,0 +1,142 @@ +//! The server's terminal sessions: created from profiles, kept until they +//! are killed, whoever is connected. + +pub mod launch; +mod output; +mod session; + +use std::collections::HashMap; +use std::net::SocketAddr; +use std::path::PathBuf; +use std::sync::Arc; +use std::time::Duration; + +use parking_lot::RwLock; +use redshell_core::Settings; +use redshell_protocol::{CreateSessionRequest, EventKind, SessionInfo, SessionKind, User}; + +pub use output::Feed; +pub use session::{AgentHook, Session}; + +use crate::agents::{self, Approvals}; +use crate::bus::{Bus, BusEvent}; +use crate::now_ms; +use crate::store::Store; + +/// What sessions share with the rest of the server. +pub struct Ctx { + pub settings: Settings, + pub config_dir: PathBuf, + pub runtime_dir: PathBuf, + pub bus: Bus, + pub store: Arc, + pub approvals: Approvals, + pub runtime: tokio::runtime::Handle, + /// The loopback listener agent hooks post to. + pub hook_addr: SocketAddr, + pub approval_timeout: Duration, +} + +impl Ctx { + /// Raises an event on `session` for every subscribed client. + pub fn event(&self, session: &str, kind: EventKind, title: Option, body: Option) { + let event = redshell_protocol::SessionEvent { session: session.to_owned(), kind, title, body, at: now_ms() }; + self.bus.send(BusEvent::Event(event)); + } +} + +#[derive(Debug, thiserror::Error)] +pub enum CreateError { + #[error("{0}")] + BadRequest(String), + #[error(transparent)] + Failed(#[from] anyhow::Error), +} + +pub struct Sessions { + ctx: Arc, + map: RwLock>>, +} + +impl Sessions { + pub fn new(ctx: Arc) -> Self { + Self { ctx, map: RwLock::new(HashMap::new()) } + } + + pub fn ctx(&self) -> &Arc { + &self.ctx + } + + pub fn create(&self, req: CreateSessionRequest, user: &User) -> Result { + let mut launch = + launch::resolve(&req, &self.ctx.settings, &self.ctx.config_dir).map_err(CreateError::BadRequest)?; + let id = uuid::Uuid::new_v4().to_string(); + let hook = agents::prepare(&mut launch, &id, &self.ctx)?; + let size = (req.cols.unwrap_or(100), req.rows.unwrap_or(30)); + let command = launch.spec.display(); + let session = match Session::spawn(id.clone(), launch, hook, size, self.ctx.clone()) { + Ok(session) => session, + Err(err) => return Err(CreateError::BadRequest(format!("{err:#}"))), + }; + if let Some(name) = req.name { + session.rename(Some(name)); + } + let launch = &session.launch; + let kind = match launch.kind { + SessionKind::Shell => "shell", + SessionKind::Agent => "agent", + SessionKind::Ssh => "ssh", + SessionKind::Command => "command", + }; + let row = crate::store::SessionRow { + id: &id, + kind, + profile: launch.profile.as_deref(), + command: &command, + cwd: launch.start_cwd.as_deref(), + created_by: user.id, + created_at: session.created_at, + }; + if let Err(err) = self.ctx.store.record_session(&row) { + log::error!("recording session {id}: {err:#}"); + } + log::info!("{} started session {id}: {command}", user.username); + let info = session.info(); + self.map.write().insert(id.clone(), session); + self.ctx.bus.send(BusEvent::SessionChanged(id)); + Ok(info) + } + + pub fn get(&self, id: &str) -> Option> { + self.map.read().get(id).cloned() + } + + /// Every session, oldest first. + pub fn list(&self) -> Vec { + let sessions: Vec> = self.map.read().values().cloned().collect(); + let mut list: Vec = sessions.iter().map(|s| s.info()).collect(); + list.sort_by(|a, b| a.created_at.cmp(&b.created_at).then_with(|| a.id.cmp(&b.id))); + list + } + + /// Ends a session and forgets it; `false` when there is none. + pub fn kill(&self, id: &str) -> bool { + let Some(session) = self.map.write().remove(id) else { return false }; + session.kill(); + if !session.is_exited() + && let Err(err) = self.ctx.store.record_session_end(id, None) + { + log::error!("recording the end of session {id}: {err:#}"); + } + self.ctx.bus.send(BusEvent::SessionRemoved(id.to_owned())); + true + } + + /// Kills everything (the server is stopping). + pub fn shutdown(&self) { + let ids: Vec = self.map.read().keys().cloned().collect(); + for id in ids { + self.kill(&id); + } + } +} diff --git a/crates/redshell-server/src/sessions/output.rs b/crates/redshell-server/src/sessions/output.rs new file mode 100644 index 0000000..cbfebb8 --- /dev/null +++ b/crates/redshell-server/src/sessions/output.rs @@ -0,0 +1,90 @@ +//! Fans a session's output out to its attached clients without ever +//! waiting for one. +//! +//! Every client gets a bounded queue. The PTY reader pushes with +//! `try_send`; a client whose queue is full is dropped from the hub, sees +//! its queue end, and comes back with a fresh snapshot. So a slow phone on +//! a bad network never holds up the program or the other clients, and its +//! backlog is bounded. + +use std::sync::Arc; + +use parking_lot::Mutex; +use tokio::sync::mpsc; + +/// Chunks a client may have queued before it is dropped and resynced. +const QUEUE: usize = 32; + +#[derive(Debug, Clone)] +pub enum Feed { + /// Program output; `end` is the output offset just past these bytes. + Output { + end: u64, + bytes: Arc<[u8]>, + }, + Resized { + cols: u16, + rows: u16, + }, +} + +#[derive(Default)] +pub struct OutputHub { + /// `None` once the session is gone. + subscribers: Mutex>>>, +} + +impl OutputHub { + pub fn new() -> Self { + Self { subscribers: Mutex::new(Some(Vec::new())) } + } + + /// A queue that receives everything published from now on. It ends + /// when the client falls behind or the session goes away. + pub fn subscribe(&self) -> mpsc::Receiver { + let (tx, rx) = mpsc::channel(QUEUE); + if let Some(subscribers) = self.subscribers.lock().as_mut() { + subscribers.push(tx); + } + rx + } + + pub fn publish(&self, feed: Feed) { + if let Some(subscribers) = self.subscribers.lock().as_mut() { + subscribers.retain(|tx| tx.try_send(feed.clone()).is_ok()); + } + } + + /// Ends every queue for good. + pub fn close(&self) { + self.subscribers.lock().take(); + } +} + +#[cfg(test)] +mod tests { + use super::*; + + fn output(end: u64) -> Feed { + Feed::Output { end, bytes: Arc::from(&b"x"[..]) } + } + + #[tokio::test] + async fn a_full_queue_is_dropped_and_others_keep_going() { + let hub = OutputHub::new(); + let mut slow = hub.subscribe(); + let mut fast = hub.subscribe(); + for end in 1..=QUEUE as u64 + 1 { + hub.publish(output(end)); + assert!(matches!(fast.recv().await, Some(Feed::Output { end: e, .. }) if e == end)); + } + let mut drained = 0; + while slow.recv().await.is_some() { + drained += 1; + } + assert_eq!(drained, QUEUE, "the slow queue ends after what it held"); + hub.close(); + assert!(fast.recv().await.is_none()); + assert!(hub.subscribe().recv().await.is_none(), "nothing after close"); + } +} diff --git a/crates/redshell-server/src/sessions/session.rs b/crates/redshell-server/src/sessions/session.rs new file mode 100644 index 0000000..ec74dfb --- /dev/null +++ b/crates/redshell-server/src/sessions/session.rs @@ -0,0 +1,398 @@ +//! One server-owned terminal session. +//! +//! The session owns a [`Terminal`] (PTY + VT state) that keeps running +//! whoever is connected. Output reaches clients through the [`OutputHub`], +//! tagged with its byte offset so a client that joins gets a snapshot and +//! then exactly the output after it. A small thread per session drains the +//! terminal's events and writes input, so a program that stops reading its +//! input never blocks an async worker. + +use std::path::PathBuf; +use std::sync::atomic::{AtomicBool, AtomicI64, Ordering}; +use std::sync::{Arc, Weak}; +use std::time::{Duration, Instant}; + +use crossbeam_channel::{Receiver, Sender, TrySendError}; +use parking_lot::Mutex; +use redshell_core::SessionObserver; +use redshell_protocol::{AgentState, ApprovalOutcome, EventKind, ExitState, SessionInfo, SessionKind}; +use redshell_terminal::{GridSize, Replay, Terminal, TerminalEvent, TerminalOptions}; + +use super::Ctx; +use super::launch::Launch; +use super::output::{Feed, OutputHub}; +use crate::bus::BusEvent; +use crate::now_ms; + +/// Lines of history a joining client gets. +pub const REPLAY_SCROLLBACK: usize = 2_000; +/// Session list updates for output are sent at most this often. +const ACTIVITY_DEBOUNCE: Duration = Duration::from_secs(1); +/// Bells closer together than this raise one event. +const BELL_QUIET: Duration = Duration::from_secs(2); +/// Input chunks waiting for a program that does not read. +const INPUT_QUEUE: usize = 1024; + +/// A session's hook credentials and the files that carry them. +pub struct AgentHook { + pub token: String, + pub files: Vec, +} + +#[derive(Default)] +struct State { + name: Option, + title: Option, + cwd: Option, + agent_state: Option, + last_message: Option, + exit: Option, + /// The client whose size the session has: the one that typed last. + size_owner: Option, +} + +/// When output last came, and whether a list update for it is scheduled. +struct Activity { + at: AtomicI64, + flush_pending: AtomicBool, +} + +pub struct Session { + pub id: String, + pub launch: Launch, + pub created_at: i64, + terminal: Terminal, + hub: Arc, + activity: Arc, + input: Sender>, + state: Mutex, + hook: Option, + ctx: Arc, +} + +impl Session { + /// Starts `launch` in a PTY of `cols` × `rows`. + pub fn spawn( + id: String, + launch: Launch, + hook: Option, + (cols, rows): (u16, u16), + ctx: Arc, + ) -> anyhow::Result> { + let hub = Arc::new(OutputHub::new()); + let now = now_ms(); + let activity = Arc::new(Activity { at: AtomicI64::new(now), flush_pending: AtomicBool::new(false) }); + let tap = Tap { + session: id.clone(), + hub: hub.clone(), + activity: activity.clone(), + ctx: ctx.clone(), + offset: 0, + last_bell: None, + }; + let terminal = Terminal::spawn( + &launch.spec, + TerminalOptions { + size: grid(cols, rows), + scrollback: ctx.settings.terminal.scrollback_lines, + term_env: ctx.settings.terminal.term.clone(), + observer: Some(Box::new(tap)), + ..Default::default() + }, + ) + .inspect_err(|_| { + for file in hook.iter().flat_map(|h| &h.files) { + let _ = std::fs::remove_file(file); + } + })?; + let (input, input_rx) = crossbeam_channel::bounded(INPUT_QUEUE); + let events = terminal.events().clone(); + let agent_state = (launch.kind == SessionKind::Agent).then_some(AgentState::Idle); + let session = Arc::new(Self { + id, + launch, + created_at: now, + terminal, + hub, + activity, + input, + state: Mutex::new(State { agent_state, ..Default::default() }), + hook, + ctx, + }); + let weak = Arc::downgrade(&session); + std::thread::Builder::new().name("redshell-session".into()).spawn(move || pump(weak, events, input_rx))?; + Ok(session) + } + + pub fn info(&self) -> SessionInfo { + let state = self.state.lock(); + let size = self.terminal.size(); + let launch = &self.launch; + SessionInfo { + id: self.id.clone(), + name: state.name.clone(), + title: state.title.clone().unwrap_or_else(|| launch.title.clone()), + kind: launch.kind, + profile: launch.profile.clone(), + profile_name: launch.profile_name.clone(), + command: launch.command.clone(), + start_cwd: launch.start_cwd.clone(), + agent: launch.agent.clone(), + agent_state: state.agent_state, + last_message: state.last_message.clone(), + cwd: state.cwd.clone().or_else(|| launch.start_cwd.clone()), + cols: size.cols, + rows: size.rows, + created_at: self.created_at, + active_at: self.activity.at.load(Ordering::Relaxed), + last_line: self.terminal.last_line().map(|l| truncate(l.trim_end(), 200)), + exit: state.exit, + pending_approvals: self.ctx.approvals.count(&self.id), + } + } + + /// A queue of output from now on; see [`OutputHub::subscribe`]. + pub fn subscribe(&self) -> tokio::sync::mpsc::Receiver { + self.hub.subscribe() + } + + /// The screen for a joining client. Takes the terminal lock: call it + /// off the async workers. + pub fn replay(&self) -> Replay { + self.terminal.replay(REPLAY_SCROLLBACK) + } + + /// A client attached at its size; the first one sizes the session. + pub fn attached(&self, client: u64, cols: u16, rows: u16) { + let first = { + let mut state = self.state.lock(); + let first = state.size_owner.is_none(); + if first { + state.size_owner = Some(client); + } + first + }; + if first { + self.resize(cols, rows); + } + } + + /// A client's terminal changed size: the session follows if that client + /// owns its size. + pub fn client_resized(&self, client: u64, cols: u16, rows: u16) { + if self.state.lock().size_owner == Some(client) { + self.resize(cols, rows); + } + } + + /// A client detached: it no longer owns the size. + pub fn detached(&self, client: u64) { + let mut state = self.state.lock(); + if state.size_owner == Some(client) { + state.size_owner = None; + } + } + + /// Input from a client, which takes over the size (tmux's + /// `window-size latest`). `false` when the program is not keeping up. + pub fn input(&self, client: u64, (cols, rows): (u16, u16), bytes: Vec) -> bool { + let submits = bytes.contains(&b'\r'); + { + let mut state = self.state.lock(); + state.size_owner = Some(client); + if state.exit.is_some() { + return true; + } + } + self.resize(cols, rows); + self.activity.at.store(now_ms(), Ordering::Relaxed); + if submits { + // Agents without a prompt hook (Codex) go back to work when the user sends a line. + self.update_agent(|state, _| { + matches!(state, Some(AgentState::Finished | AgentState::NeedsInput | AgentState::Idle)) + .then_some((AgentState::Working, None)) + }); + } + match self.input.try_send(bytes) { + Ok(()) => true, + Err(TrySendError::Full(_)) => false, + Err(TrySendError::Disconnected(_)) => true, + } + } + + fn resize(&self, cols: u16, rows: u16) { + let (cols, rows) = (cols.clamp(2, 1000), rows.clamp(1, 500)); + let size = self.terminal.size(); + if (size.cols, size.rows) == (cols, rows) { + return; + } + self.terminal.resize(grid(cols, rows)); + self.hub.publish(Feed::Resized { cols, rows }); + self.changed(); + } + + pub fn rename(&self, name: Option) { + self.state.lock().name = name.map(|n| truncate(n.trim(), 100)).filter(|n| !n.is_empty()); + self.changed(); + } + + /// Changes the agent state when `next` says so, given the current one. + /// `next` returns the new state and, for `Finished`, the last message. + pub fn update_agent( + &self, + next: impl FnOnce(Option, &Option) -> Option<(AgentState, Option)>, + ) { + let changed = { + let mut state = self.state.lock(); + match next(state.agent_state, &state.last_message) { + Some((agent_state, message)) if state.agent_state != Some(agent_state) || message.is_some() => { + state.agent_state = Some(agent_state); + if let Some(message) = message { + state.last_message = Some(truncate(&message, 4000)); + } + true + } + _ => false, + } + }; + if changed { + self.changed(); + } + } + + /// Whether `token` is this session's hook token. + pub fn hook_token_matches(&self, token: &str) -> bool { + self.hook.as_ref().is_some_and(|h| crate::auth::secret::same_secret(&h.token, token)) + } + + pub fn is_exited(&self) -> bool { + self.state.lock().exit.is_some() + } + + /// Ends the program and every client's stream. + pub fn kill(&self) { + self.terminal.kill(); + self.hub.close(); + self.release(); + } + + /// Lets go of what only a running program needs. + fn release(&self) { + self.ctx.approvals.settle_session(&self.id, ApprovalOutcome::Gone, None); + for file in self.hook.iter().flat_map(|h| &h.files) { + let _ = std::fs::remove_file(file); + } + } + + pub fn changed(&self) { + self.ctx.bus.send(BusEvent::SessionChanged(self.id.clone())); + } + + fn on_event(&self, event: TerminalEvent) { + match event { + TerminalEvent::Wakeup => self.terminal.ack_wakeup(), + TerminalEvent::Title(title) => { + self.state.lock().title = Some(truncate(&title, 200)); + self.changed(); + } + TerminalEvent::ResetTitle => { + self.state.lock().title = None; + self.changed(); + } + TerminalEvent::Cwd(cwd) => { + self.state.lock().cwd = Some(cwd); + self.changed(); + } + TerminalEvent::Exited(code) => { + self.state.lock().exit = Some(ExitState { code, at: now_ms() }); + self.release(); + if let Err(err) = self.ctx.store.record_session_end(&self.id, code) { + log::error!("recording the end of session {}: {err:#}", self.id); + } + let body = code.map_or_else(|| "unknown".to_owned(), |c| c.to_string()); + self.ctx.event(&self.id, EventKind::Exited, None, Some(body)); + self.changed(); + } + TerminalEvent::Bell | TerminalEvent::ClipboardStore(_) | TerminalEvent::CommandFinished(_) => {} + } + } +} + +impl Drop for Session { + fn drop(&mut self) { + self.release(); + } +} + +fn grid(cols: u16, rows: u16) -> GridSize { + GridSize { cols, rows, ..GridSize::default() } +} + +fn truncate(text: &str, chars: usize) -> String { + match text.char_indices().nth(chars) { + Some((at, _)) => format!("{}…", &text[..at]), + None => text.to_owned(), + } +} + +/// Drains the terminal's events and writes input, until the session is gone. +fn pump(session: Weak, events: Receiver, input: Receiver>) { + loop { + crossbeam_channel::select! { + recv(events) -> event => { + let (Ok(event), Some(session)) = (event, session.upgrade()) else { break }; + session.on_event(event); + } + recv(input) -> bytes => { + let (Ok(bytes), Some(session)) = (bytes, session.upgrade()) else { break }; + session.terminal.write(&bytes); + } + } + } +} + +/// The session's observer, on the PTY reader thread: output to the hub, +/// bells and notifications to the bus. Never blocks. +struct Tap { + session: String, + hub: Arc, + activity: Arc, + ctx: Arc, + /// Output bytes so far; matches the terminal's count after each chunk. + offset: u64, + last_bell: Option, +} + +impl SessionObserver for Tap { + fn on_output(&mut self, bytes: &[u8]) { + self.offset += bytes.len() as u64; + self.hub.publish(Feed::Output { end: self.offset, bytes: Arc::from(bytes) }); + self.activity.at.store(now_ms(), Ordering::Relaxed); + if !self.activity.flush_pending.swap(true, Ordering::AcqRel) { + let (activity, bus, id) = (self.activity.clone(), self.ctx.bus.clone(), self.session.clone()); + self.ctx.runtime.spawn(async move { + tokio::time::sleep(ACTIVITY_DEBOUNCE).await; + activity.flush_pending.store(false, Ordering::Release); + bus.send(BusEvent::SessionChanged(id)); + }); + } + } + + fn on_bell(&mut self) { + let now = Instant::now(); + if self.last_bell.is_none_or(|last| now.duration_since(last) >= BELL_QUIET) { + self.last_bell = Some(now); + self.ctx.event(&self.session, EventKind::Bell, None, None); + } + } + + fn on_notification(&mut self, title: Option<&str>, body: &str) { + self.ctx.event( + &self.session, + EventKind::Notification, + title.map(|t| truncate(t, 200)), + Some(truncate(body, 1000)), + ); + } +} diff --git a/crates/redshell-server/src/store/audit.rs b/crates/redshell-server/src/store/audit.rs new file mode 100644 index 0000000..defb5a6 --- /dev/null +++ b/crates/redshell-server/src/store/audit.rs @@ -0,0 +1,79 @@ +//! Security-relevant events: sign-ins, failures, revocations, approvals. + +use rusqlite::params; + +use super::Store; +use crate::now_ms; + +/// Entries older than this are dropped when the server starts. +const RETAIN_MS: i64 = 180 * 24 * 60 * 60 * 1000; + +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum AuditEvent { + Setup, + SignIn, + SignInFailed, + SignInThrottled, + SignOut, + PasswordChanged, + PasswordChangeFailed, + CredentialRevoked, + UserAdded, + UserRemoved, + ApprovalAnswered, +} + +impl AuditEvent { + fn name(self) -> &'static str { + match self { + Self::Setup => "setup", + Self::SignIn => "sign_in", + Self::SignInFailed => "sign_in_failed", + Self::SignInThrottled => "sign_in_throttled", + Self::SignOut => "sign_out", + Self::PasswordChanged => "password_changed", + Self::PasswordChangeFailed => "password_change_failed", + Self::CredentialRevoked => "credential_revoked", + Self::UserAdded => "user_added", + Self::UserRemoved => "user_removed", + Self::ApprovalAnswered => "approval_answered", + } + } +} + +impl Store { + /// Appends to the audit log. A failure is logged, never raised: the + /// action itself already happened. + pub fn audit( + &self, + event: AuditEvent, + user_id: Option, + username: Option<&str>, + ip: Option<&str>, + detail: &str, + ) { + let result = self.with(|c| { + c.execute( + "INSERT INTO audit_log (at, event, user_id, username, ip, detail) VALUES (?1, ?2, ?3, ?4, ?5, ?6)", + params![now_ms(), event.name(), user_id, username, ip, detail], + ) + }); + if let Err(err) = result { + log::error!("audit log: {err:#}"); + } + } + + pub fn prune_audit_log(&self) -> anyhow::Result<()> { + self.with(|c| c.execute("DELETE FROM audit_log WHERE at < ?1", [now_ms() - RETAIN_MS]).map(drop)) + } + + #[cfg(test)] + pub fn audit_events(&self) -> Vec<(String, Option)> { + self.with(|c| { + c.prepare("SELECT event, username FROM audit_log ORDER BY id")? + .query_map([], |r| Ok((r.get(0)?, r.get(1)?)))? + .collect() + }) + .unwrap() + } +} diff --git a/crates/redshell-server/src/store/credentials.rs b/crates/redshell-server/src/store/credentials.rs new file mode 100644 index 0000000..88ea278 --- /dev/null +++ b/crates/redshell-server/src/store/credentials.rs @@ -0,0 +1,204 @@ +//! Browser sessions (cookies) and devices (bearer tokens), found by the +//! SHA-256 of their token. + +use redshell_protocol::{BrowserSession, Device, User}; +use rusqlite::{OptionalExtension as _, params}; + +use super::Store; +use crate::now_ms; + +/// One way a user is signed in. +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] +pub enum Credential { + Browser(i64), + Device(i64), +} + +impl Credential { + fn table(self) -> &'static str { + match self { + Self::Browser(_) => "browser_sessions", + Self::Device(_) => "devices", + } + } + + fn id(self) -> i64 { + match self { + Self::Browser(id) | Self::Device(id) => id, + } + } +} + +/// Who a token belongs to. +#[derive(Debug, Clone)] +pub struct TokenOwner { + pub credential: Credential, + pub user: User, + pub last_seen_at: i64, + /// The device's name; `None` for a browser. + pub device_name: Option, +} + +impl Store { + pub fn create_browser_session( + &self, + user_id: i64, + token_hash: &[u8], + expires_at: i64, + ip: &str, + user_agent: Option<&str>, + ) -> anyhow::Result { + self.with(|c| { + c.execute( + "INSERT INTO browser_sessions (user_id, token_hash, created_at, last_seen_at, expires_at, last_ip, user_agent) + VALUES (?1, ?2, ?3, ?3, ?4, ?5, ?6)", + params![user_id, token_hash, now_ms(), expires_at, ip, user_agent], + )?; + Ok(Credential::Browser(c.last_insert_rowid())) + }) + } + + pub fn create_device(&self, user_id: i64, name: &str, token_hash: &[u8], ip: &str) -> anyhow::Result { + self.with(|c| { + c.execute( + "INSERT INTO devices (user_id, name, token_hash, created_at, last_seen_at, last_ip) + VALUES (?1, ?2, ?3, ?4, ?4, ?5)", + params![user_id, name, token_hash, now_ms(), ip], + )?; + Ok(Credential::Device(c.last_insert_rowid())) + }) + } + + /// The owner of a live browser session (`device = false`) or device token. + pub fn find_token(&self, device: bool, token_hash: &[u8]) -> anyhow::Result> { + let (table, name, live) = + if device { ("devices", "t.name", "1") } else { ("browser_sessions", "NULL", "t.expires_at > ?2") }; + let sql = format!( + "SELECT t.id, t.last_seen_at, u.id, u.username, u.created_at, {name} FROM {table} t + JOIN users u ON u.id = t.user_id WHERE t.token_hash = ?1 AND {live}" + ); + self.with(|c| { + let mut stmt = c.prepare_cached(&sql)?; + let params = if device { params![token_hash] } else { params![token_hash, now_ms()] }; + stmt.query_row(params, |r| { + let id = r.get(0)?; + Ok(TokenOwner { + credential: if device { Credential::Device(id) } else { Credential::Browser(id) }, + last_seen_at: r.get(1)?, + user: User { id: r.get(2)?, username: r.get(3)?, created_at: r.get(4)? }, + device_name: r.get(5)?, + }) + }) + .optional() + }) + } + + /// Records use of a credential; a browser session also gets `expires_at`. + pub fn touch(&self, credential: Credential, ip: &str, expires_at: Option) -> anyhow::Result<()> { + self.with(|c| { + let sql = format!( + "UPDATE {} SET last_seen_at = ?2, last_ip = ?3{} WHERE id = ?1", + credential.table(), + if expires_at.is_some() { ", expires_at = ?4" } else { "" } + ); + match expires_at { + Some(expires) => c.execute(&sql, params![credential.id(), now_ms(), ip, expires]), + None => c.execute(&sql, params![credential.id(), now_ms(), ip]), + } + .map(drop) + }) + } + + pub fn browser_sessions(&self, user_id: i64) -> anyhow::Result> { + self.with(|c| { + c.prepare( + "SELECT id, created_at, last_seen_at, expires_at, last_ip, user_agent FROM browser_sessions + WHERE user_id = ?1 AND expires_at > ?2 ORDER BY last_seen_at DESC", + )? + .query_map(params![user_id, now_ms()], |r| { + Ok(BrowserSession { + id: r.get(0)?, + created_at: r.get(1)?, + last_seen_at: r.get(2)?, + expires_at: r.get(3)?, + last_ip: r.get(4)?, + user_agent: r.get(5)?, + current: false, + }) + })? + .collect() + }) + } + + pub fn devices(&self, user_id: i64) -> anyhow::Result> { + self.with(|c| { + c.prepare( + "SELECT id, name, created_at, last_seen_at, last_ip FROM devices + WHERE user_id = ?1 ORDER BY last_seen_at DESC", + )? + .query_map([user_id], |r| { + Ok(Device { + id: r.get(0)?, + name: r.get(1)?, + created_at: r.get(2)?, + last_seen_at: r.get(3)?, + last_ip: r.get(4)?, + current: false, + }) + })? + .collect() + }) + } + + /// Signs `user_id` out of one credential; `false` when it is not theirs. + pub fn revoke(&self, user_id: i64, credential: Credential) -> anyhow::Result { + self.with(|c| { + let sql = format!("DELETE FROM {} WHERE id = ?1 AND user_id = ?2", credential.table()); + Ok(c.execute(&sql, params![credential.id(), user_id])? == 1) + }) + } + + /// Signs `user_id` out everywhere but `keep`. + pub fn revoke_all_except(&self, user_id: i64, keep: Option) -> anyhow::Result<()> { + self.with(|c| { + for table in ["browser_sessions", "devices"] { + let kept = keep.filter(|k| k.table() == table).map_or(-1, Credential::id); + c.execute(&format!("DELETE FROM {table} WHERE user_id = ?1 AND id != ?2"), params![user_id, kept])?; + } + Ok(()) + }) + } + + pub fn prune_expired_sessions(&self) -> anyhow::Result<()> { + self.with(|c| c.execute("DELETE FROM browser_sessions WHERE expires_at <= ?1", [now_ms()]).map(drop)) + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn tokens_resolve_to_their_owner_until_revoked() { + let store = Store::in_memory(); + let user = store.create_user("u", "h").unwrap().unwrap(); + let browser = store.create_browser_session(user.id, b"b", now_ms() + 60_000, "1.2.3.4", None).unwrap(); + let device = store.create_device(user.id, "laptop", b"d", "::1").unwrap(); + store.create_browser_session(user.id, b"old", now_ms() - 1, "1.2.3.4", None).unwrap(); + + assert_eq!(store.find_token(false, b"b").unwrap().unwrap().credential, browser); + assert_eq!(store.find_token(true, b"d").unwrap().unwrap().user.username, "u"); + assert!(store.find_token(true, b"b").unwrap().is_none(), "a cookie is not a device token"); + assert!(store.find_token(false, b"old").unwrap().is_none(), "expired"); + assert_eq!(store.browser_sessions(user.id).unwrap().len(), 1); + + store.touch(browser, "5.6.7.8", Some(now_ms() + 120_000)).unwrap(); + assert_eq!(store.browser_sessions(user.id).unwrap()[0].last_ip.as_deref(), Some("5.6.7.8")); + + assert!(!store.revoke(user.id + 1, device).unwrap(), "only the owner revokes"); + store.revoke_all_except(user.id, Some(device)).unwrap(); + assert!(store.find_token(false, b"b").unwrap().is_none()); + assert!(store.revoke(user.id, device).unwrap()); + assert!(store.devices(user.id).unwrap().is_empty()); + } +} diff --git a/crates/redshell-server/src/store/mod.rs b/crates/redshell-server/src/store/mod.rs new file mode 100644 index 0000000..3b41277 --- /dev/null +++ b/crates/redshell-server/src/store/mod.rs @@ -0,0 +1,131 @@ +//! The server's SQLite database: accounts, credentials, the audit log and +//! session metadata. +//! +//! Secrets are never stored: passwords as Argon2id hashes, browser sessions +//! and device tokens as the SHA-256 of 256-bit random tokens. The schema is +//! versioned with `PRAGMA user_version`; each entry of [`MIGRATIONS`] runs +//! once, so passkeys, pairing requests and push subscriptions arrive later +//! as new entries. + +mod audit; +mod credentials; +mod sessions; +mod users; + +use std::path::Path; + +use anyhow::Context as _; +use parking_lot::Mutex; +use rusqlite::Connection; + +pub use audit::AuditEvent; +pub use credentials::Credential; +pub use sessions::SessionRow; + +/// Schema changes, oldest first. `user_version` counts those applied. +const MIGRATIONS: &[&str] = &[ + // 1: accounts, browser sessions, device tokens, the audit log, sessions. + "CREATE TABLE users ( + id INTEGER PRIMARY KEY, + username TEXT NOT NULL UNIQUE COLLATE NOCASE, + password_hash TEXT NOT NULL, + created_at INTEGER NOT NULL, + password_changed_at INTEGER NOT NULL + ); + CREATE TABLE browser_sessions ( + id INTEGER PRIMARY KEY, + user_id INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE, + token_hash BLOB NOT NULL UNIQUE, + created_at INTEGER NOT NULL, + last_seen_at INTEGER NOT NULL, + expires_at INTEGER NOT NULL, + last_ip TEXT, + user_agent TEXT + ); + CREATE TABLE devices ( + id INTEGER PRIMARY KEY, + user_id INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE, + name TEXT NOT NULL, + token_hash BLOB NOT NULL UNIQUE, + created_at INTEGER NOT NULL, + last_seen_at INTEGER NOT NULL, + last_ip TEXT + ); + CREATE TABLE audit_log ( + id INTEGER PRIMARY KEY, + at INTEGER NOT NULL, + event TEXT NOT NULL, + user_id INTEGER, + username TEXT, + ip TEXT, + detail TEXT + ); + CREATE INDEX audit_log_at ON audit_log(at); + CREATE TABLE sessions ( + id TEXT PRIMARY KEY, + kind TEXT NOT NULL, + profile TEXT, + command TEXT NOT NULL, + cwd TEXT, + created_by INTEGER, + created_at INTEGER NOT NULL, + ended_at INTEGER, + exit_code INTEGER + );", +]; + +/// Thread-safe handle to the database. Queries are short, so callers on +/// async tasks run them inline. +pub struct Store { + conn: Mutex, +} + +impl Store { + pub fn open(path: &Path) -> anyhow::Result { + let conn = Connection::open(path).with_context(|| format!("opening {}", path.display()))?; + Self::init(conn) + } + + #[cfg(test)] + pub fn in_memory() -> Self { + Self::init(Connection::open_in_memory().unwrap()).unwrap() + } + + fn init(mut conn: Connection) -> anyhow::Result { + // The `user` CLI may write while the server runs. + conn.busy_timeout(std::time::Duration::from_secs(5))?; + conn.execute_batch("PRAGMA journal_mode = WAL; PRAGMA synchronous = NORMAL; PRAGMA foreign_keys = ON;")?; + migrate(&mut conn)?; + Ok(Self { conn: Mutex::new(conn) }) + } + + fn with(&self, f: impl FnOnce(&Connection) -> rusqlite::Result) -> anyhow::Result { + Ok(f(&self.conn.lock())?) + } +} + +fn migrate(conn: &mut Connection) -> anyhow::Result<()> { + let applied: usize = conn.query_row("PRAGMA user_version", [], |r| r.get(0))?; + for (version, sql) in MIGRATIONS.iter().enumerate().skip(applied) { + let tx = conn.transaction()?; + tx.execute_batch(sql).with_context(|| format!("migrating the server database to version {}", version + 1))?; + tx.pragma_update(None, "user_version", version + 1)?; + tx.commit()?; + } + Ok(()) +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn migrations_run_once() { + let dir = tempfile::tempdir().unwrap(); + let path = dir.path().join("db"); + Store::open(&path).unwrap(); + let store = Store::open(&path).unwrap(); + let version: usize = store.with(|c| c.query_row("PRAGMA user_version", [], |r| r.get(0))).unwrap(); + assert_eq!(version, MIGRATIONS.len()); + } +} diff --git a/crates/redshell-server/src/store/sessions.rs b/crates/redshell-server/src/store/sessions.rs new file mode 100644 index 0000000..f3177c2 --- /dev/null +++ b/crates/redshell-server/src/store/sessions.rs @@ -0,0 +1,45 @@ +//! Which sessions ran, from what, and how they ended. + +use rusqlite::params; + +use super::Store; +use crate::now_ms; + +/// A session as recorded when it starts. +pub struct SessionRow<'a> { + pub id: &'a str, + pub kind: &'a str, + pub profile: Option<&'a str>, + pub command: &'a str, + pub cwd: Option<&'a str>, + pub created_by: i64, + pub created_at: i64, +} + +impl Store { + pub fn record_session(&self, row: &SessionRow) -> anyhow::Result<()> { + self.with(|c| { + c.execute( + "INSERT INTO sessions (id, kind, profile, command, cwd, created_by, created_at) + VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7)", + params![row.id, row.kind, row.profile, row.command, row.cwd, row.created_by, row.created_at], + ) + .map(drop) + }) + } + + pub fn record_session_end(&self, id: &str, exit_code: Option) -> anyhow::Result<()> { + self.with(|c| { + c.execute( + "UPDATE sessions SET ended_at = ?2, exit_code = ?3 WHERE id = ?1 AND ended_at IS NULL", + params![id, now_ms(), exit_code], + ) + .map(drop) + }) + } + + /// Sessions of an earlier run died with it. + pub fn end_orphaned_sessions(&self) -> anyhow::Result<()> { + self.with(|c| c.execute("UPDATE sessions SET ended_at = ?1 WHERE ended_at IS NULL", [now_ms()]).map(drop)) + } +} diff --git a/crates/redshell-server/src/store/users.rs b/crates/redshell-server/src/store/users.rs new file mode 100644 index 0000000..0e55e56 --- /dev/null +++ b/crates/redshell-server/src/store/users.rs @@ -0,0 +1,101 @@ +//! Accounts. + +use redshell_protocol::User; +use rusqlite::{OptionalExtension as _, Row, params}; + +use super::Store; +use crate::now_ms; + +/// A user with the password hash, which never leaves the server. +#[derive(Debug, Clone)] +pub struct UserRecord { + pub user: User, + pub password_hash: String, +} + +fn user(row: &Row) -> rusqlite::Result { + Ok(User { id: row.get("id")?, username: row.get("username")?, created_at: row.get("created_at")? }) +} + +impl Store { + pub fn user_count(&self) -> anyhow::Result { + self.with(|c| c.query_row("SELECT COUNT(*) FROM users", [], |r| r.get(0))) + } + + /// Creates a user; `None` when the name is taken (names ignore case). + pub fn create_user(&self, username: &str, password_hash: &str) -> anyhow::Result> { + self.with(|c| { + let now = now_ms(); + let inserted = c.execute( + "INSERT INTO users (username, password_hash, created_at, password_changed_at) + VALUES (?1, ?2, ?3, ?3) ON CONFLICT(username) DO NOTHING", + params![username, password_hash, now], + )?; + Ok((inserted == 1).then(|| User { + id: c.last_insert_rowid(), + username: username.to_owned(), + created_at: now, + })) + }) + } + + pub fn find_user(&self, username: &str) -> anyhow::Result> { + self.with(|c| { + c.query_row( + "SELECT id, username, created_at, password_hash FROM users WHERE username = ?1", + [username], + |r| Ok(UserRecord { user: user(r)?, password_hash: r.get("password_hash")? }), + ) + .optional() + }) + } + + pub fn user_by_id(&self, id: i64) -> anyhow::Result> { + self.with(|c| { + c.query_row("SELECT id, username, created_at, password_hash FROM users WHERE id = ?1", [id], |r| { + Ok(UserRecord { user: user(r)?, password_hash: r.get("password_hash")? }) + }) + .optional() + }) + } + + pub fn users(&self) -> anyhow::Result> { + self.with(|c| { + c.prepare("SELECT id, username, created_at FROM users ORDER BY username")?.query_map([], user)?.collect() + }) + } + + pub fn set_password(&self, user_id: i64, password_hash: &str) -> anyhow::Result<()> { + self.with(|c| { + c.execute( + "UPDATE users SET password_hash = ?2, password_changed_at = ?3 WHERE id = ?1", + params![user_id, password_hash, now_ms()], + ) + .map(drop) + }) + } + + /// Removes a user with its browser sessions and devices. + pub fn remove_user(&self, username: &str) -> anyhow::Result { + self.with(|c| Ok(c.execute("DELETE FROM users WHERE username = ?1", [username])? == 1)) + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn names_are_unique_ignoring_case() { + let store = Store::in_memory(); + let alice = store.create_user("Alice", "h1").unwrap().unwrap(); + assert!(store.create_user("alice", "h2").unwrap().is_none()); + let found = store.find_user("ALICE").unwrap().unwrap(); + assert_eq!((found.user.id, found.password_hash.as_str()), (alice.id, "h1")); + store.set_password(alice.id, "h3").unwrap(); + assert_eq!(store.user_by_id(alice.id).unwrap().unwrap().password_hash, "h3"); + assert_eq!(store.user_count().unwrap(), 1); + assert!(store.remove_user("alice").unwrap()); + assert!(store.users().unwrap().is_empty()); + } +} diff --git a/crates/redshell-server/src/web/account.rs b/crates/redshell-server/src/web/account.rs new file mode 100644 index 0000000..fef5368 --- /dev/null +++ b/crates/redshell-server/src/web/account.rs @@ -0,0 +1,68 @@ +//! `/api/account/*`: the password and where the user is signed in. + +use axum::extract::{Path, State}; +use axum::{Extension, Json}; +use redshell_protocol::{BrowserSession, ChangePasswordRequest, Device}; +use serde_json::{Value, json}; + +use super::Shared; +use super::error::{ApiResult, Failure}; +use crate::auth::{Client, Principal}; +use crate::store::Credential; + +pub async fn change_password( + State(app): State, + Extension(principal): Extension, + client: Client, + Json(req): Json, +) -> ApiResult { + app.auth.change_password(&principal, req, &client).await?; + Ok(Json(json!({}))) +} + +pub async fn devices(State(app): State, Extension(principal): Extension) -> ApiResult> { + let mut devices = app.store.devices(principal.user.id)?; + for device in &mut devices { + device.current = principal.credential == Credential::Device(device.id); + } + Ok(Json(devices)) +} + +pub async fn browser_sessions( + State(app): State, + Extension(principal): Extension, +) -> ApiResult> { + let mut sessions = app.store.browser_sessions(principal.user.id)?; + for session in &mut sessions { + session.current = principal.credential == Credential::Browser(session.id); + } + Ok(Json(sessions)) +} + +pub async fn revoke_device( + State(app): State, + Extension(principal): Extension, + client: Client, + Path(id): Path, +) -> ApiResult { + revoke(&app, &principal, &client, Credential::Device(id), "device") +} + +pub async fn revoke_browser_session( + State(app): State, + Extension(principal): Extension, + client: Client, + Path(id): Path, +) -> ApiResult { + revoke(&app, &principal, &client, Credential::Browser(id), "browser session") +} + +fn revoke( + app: &Shared, + principal: &Principal, + client: &Client, + credential: Credential, + what: &str, +) -> ApiResult { + if app.auth.revoke(principal, credential, client)? { Ok(Json(json!({}))) } else { Err(Failure::not_found(what)) } +} diff --git a/crates/redshell-server/src/web/assets.rs b/crates/redshell-server/src/web/assets.rs new file mode 100644 index 0000000..49c1cd3 --- /dev/null +++ b/crates/redshell-server/src/web/assets.rs @@ -0,0 +1,82 @@ +//! The PWA, embedded in the binary at build time (see `build.rs`), and the +//! security headers every response carries. + +use axum::http::{HeaderMap, HeaderName, HeaderValue, Method, StatusCode, Uri, header}; +use axum::response::{IntoResponse, Response}; +use rust_embed::Embed; +use tower_http::set_header::SetResponseHeaderLayer; + +#[derive(Embed)] +#[folder = "$REDSHELL_WEB_DIST"] +struct Pwa; + +/// Scripts, styles and connections only from this origin; no inline script, +/// no plugins, no framing. Inline styles are allowed: terminal renderers +/// (xterm.js) size their elements with them. +pub const CSP: &str = "default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; \ + img-src 'self' data: blob:; font-src 'self' data:; connect-src 'self'; worker-src 'self'; \ + manifest-src 'self'; object-src 'none'; base-uri 'none'; frame-ancestors 'none'; form-action 'self'"; + +/// Header layers for every response; HSTS too when the server speaks TLS. +pub fn security_headers(tls: bool) -> Vec> { + let mut headers = vec![ + (header::CONTENT_SECURITY_POLICY, CSP), + (header::X_FRAME_OPTIONS, "DENY"), + (header::REFERRER_POLICY, "no-referrer"), + (header::X_CONTENT_TYPE_OPTIONS, "nosniff"), + ]; + if tls { + headers.push((header::STRICT_TRANSPORT_SECURITY, "max-age=31536000")); + } + headers + .into_iter() + .map(|(name, value): (HeaderName, &'static str)| { + SetResponseHeaderLayer::if_not_present(name, HeaderValue::from_static(value)) + }) + .collect() +} + +/// Serves a file of the PWA; any other path without a file extension gets +/// `index.html`, so the app's own routes load it. +pub async fn serve(method: Method, uri: Uri, headers: HeaderMap) -> Response { + if method != Method::GET && method != Method::HEAD { + return StatusCode::METHOD_NOT_ALLOWED.into_response(); + } + let path = uri.path().trim_start_matches('/'); + let path = if path.is_empty() { "index.html" } else { path }; + match Pwa::get(path) { + Some(file) => respond(path, file, &headers), + None if path.rsplit('/').next().is_some_and(|name| name.contains('.')) => StatusCode::NOT_FOUND.into_response(), + None => match Pwa::get("index.html") { + Some(index) => respond("index.html", index, &headers), + None => StatusCode::NOT_FOUND.into_response(), + }, + } +} + +fn respond(path: &str, file: rust_embed::EmbeddedFile, request: &HeaderMap) -> Response { + let etag = format!("\"{}\"", hex(&file.metadata.sha256_hash()[..16])); + let cache = if path.starts_with("assets/") { + // Vite puts content hashes in these names. + "public, max-age=31536000, immutable" + } else { + // index.html, the service worker, the manifest: always revalidated. + "no-cache" + }; + let mut headers = HeaderMap::new(); + headers.insert(header::CACHE_CONTROL, HeaderValue::from_static(cache)); + if let Ok(etag) = HeaderValue::from_str(&etag) { + headers.insert(header::ETAG, etag); + } + if request.get(header::IF_NONE_MATCH).is_some_and(|v| v.as_bytes() == etag.as_bytes()) { + return (StatusCode::NOT_MODIFIED, headers).into_response(); + } + if let Ok(mime) = HeaderValue::from_str(file.metadata.mimetype()) { + headers.insert(header::CONTENT_TYPE, mime); + } + (headers, file.data.into_owned()).into_response() +} + +fn hex(bytes: &[u8]) -> String { + bytes.iter().map(|b| format!("{b:02x}")).collect() +} diff --git a/crates/redshell-server/src/web/auth.rs b/crates/redshell-server/src/web/auth.rs new file mode 100644 index 0000000..a30a38a --- /dev/null +++ b/crates/redshell-server/src/web/auth.rs @@ -0,0 +1,66 @@ +//! `/api/auth/*` and `/api/setup`: open to everyone (sign-out and `me` +//! need a sign-in). + +use axum::extract::State; +use axum::http::header; +use axum::response::{IntoResponse, Response}; +use axum::{Extension, Json}; +use redshell_protocol::{PROTOCOL_VERSION, ServerInfo, SetupRequest, SignInRequest, SignInResponse, User}; + +use super::Shared; +use super::error::{ApiResult, Failure}; +use super::guard::{clear_cookie, set_cookie}; +use crate::auth::{Client, Issued, Principal, SignedIn, password}; + +pub async fn info(State(app): State) -> ApiResult { + let setup_required = app.auth.announce_setup()?.is_some(); + Ok(Json(ServerInfo { + version: env!("CARGO_PKG_VERSION").into(), + protocol_version: PROTOCOL_VERSION, + setup_required, + min_password_length: password::MIN_LENGTH as u32, + })) +} + +pub async fn setup( + State(app): State, + client: Client, + Json(req): Json, +) -> Result { + Ok(signed_in(app.auth.setup(req, &client).await?)) +} + +pub async fn sign_in( + State(app): State, + client: Client, + Json(req): Json, +) -> Result { + Ok(signed_in(app.auth.sign_in(req, &client).await?)) +} + +/// The response for a new sign-in: a cookie for a browser, the token in +/// the body for a device. +fn signed_in(done: SignedIn) -> Response { + match done.issued { + Issued::Cookie(token) => { + ([(header::SET_COOKIE, set_cookie(&token))], Json(SignInResponse { user: done.user, device_token: None })) + .into_response() + } + Issued::DeviceToken(token) => { + Json(SignInResponse { user: done.user, device_token: Some(token) }).into_response() + } + } +} + +pub async fn sign_out( + State(app): State, + Extension(principal): Extension, + client: Client, +) -> Result { + app.auth.sign_out(&principal, &client)?; + Ok(([(header::SET_COOKIE, clear_cookie())], Json(serde_json::json!({}))).into_response()) +} + +pub async fn me(Extension(principal): Extension) -> Json { + Json(principal.user) +} diff --git a/crates/redshell-server/src/web/error.rs b/crates/redshell-server/src/web/error.rs new file mode 100644 index 0000000..ee7f31e --- /dev/null +++ b/crates/redshell-server/src/web/error.rs @@ -0,0 +1,93 @@ +//! Error responses: an [`ApiError`] body with a matching status. + +use axum::Json; +use axum::http::{HeaderValue, StatusCode, header}; +use axum::response::{IntoResponse, Response}; +use redshell_protocol::{ApiError, ErrorCode}; + +use crate::auth::AuthError; +use crate::sessions::CreateError; + +#[derive(Debug)] +pub struct Failure(pub ApiError); + +pub type ApiResult = Result, Failure>; + +impl Failure { + pub fn new(code: ErrorCode, message: impl Into) -> Self { + Self(ApiError { code, message: message.into(), retry_after_secs: None }) + } + + pub fn bad_request(message: impl Into) -> Self { + Self::new(ErrorCode::BadRequest, message) + } + + pub fn not_found(what: &str) -> Self { + Self::new(ErrorCode::NotFound, format!("no such {what}")) + } + + pub fn unauthorized() -> Self { + Self::new(ErrorCode::Unauthorized, "sign in first") + } + + pub fn forbidden(message: impl Into) -> Self { + Self::new(ErrorCode::Forbidden, message) + } + + pub fn status(code: ErrorCode) -> StatusCode { + match code { + ErrorCode::BadRequest => StatusCode::BAD_REQUEST, + ErrorCode::InvalidCredentials | ErrorCode::Unauthorized => StatusCode::UNAUTHORIZED, + ErrorCode::Forbidden => StatusCode::FORBIDDEN, + ErrorCode::NotFound => StatusCode::NOT_FOUND, + ErrorCode::Conflict => StatusCode::CONFLICT, + ErrorCode::RateLimited => StatusCode::TOO_MANY_REQUESTS, + ErrorCode::Internal => StatusCode::INTERNAL_SERVER_ERROR, + } + } +} + +impl IntoResponse for Failure { + fn into_response(self) -> Response { + let retry = self.0.retry_after_secs; + let mut response = (Self::status(self.0.code), Json(self.0)).into_response(); + if let Some(secs) = retry { + response.headers_mut().insert(header::RETRY_AFTER, HeaderValue::from(secs)); + } + response + } +} + +impl From for Failure { + fn from(err: anyhow::Error) -> Self { + log::error!("{err:#}"); + Self::new(ErrorCode::Internal, "something went wrong on the server; its log says what") + } +} + +impl From for Failure { + fn from(err: AuthError) -> Self { + let message = err.to_string(); + match err { + AuthError::InvalidCredentials => Self::new(ErrorCode::InvalidCredentials, message), + AuthError::RateLimited(wait) => Self(ApiError { + code: ErrorCode::RateLimited, + message, + retry_after_secs: Some(wait.as_secs_f64().ceil() as u64), + }), + AuthError::BadRequest(_) => Self::new(ErrorCode::BadRequest, message), + AuthError::Forbidden(_) => Self::new(ErrorCode::Forbidden, message), + AuthError::Conflict(_) => Self::new(ErrorCode::Conflict, message), + AuthError::Internal(err) => err.into(), + } + } +} + +impl From for Failure { + fn from(err: CreateError) -> Self { + match err { + CreateError::BadRequest(message) => Self::bad_request(message), + CreateError::Failed(err) => err.into(), + } + } +} diff --git a/crates/redshell-server/src/web/guard.rs b/crates/redshell-server/src/web/guard.rs new file mode 100644 index 0000000..e5ce183 --- /dev/null +++ b/crates/redshell-server/src/web/guard.rs @@ -0,0 +1,185 @@ +//! Request checks: who the client is, whether a browser request comes from +//! our own pages, and who is signed in. +//! +//! **Origin.** A state-changing request (anything but GET, HEAD and +//! OPTIONS) and the WebSocket upgrade must, when they carry an `Origin`, +//! come from `public_url` or from the host the request was sent to (with +//! `https`, or `http` when the server has no TLS of its own). Browsers send +//! `Origin` on all of these, so a missing one with a session cookie is +//! refused as well; clients that are not browsers (the desktop, scripts) +//! send none and authenticate with a bearer token. + +use std::net::{IpAddr, SocketAddr}; + +use axum::extract::{ConnectInfo, FromRequestParts, Request, State}; +use axum::http::request::Parts; +use axum::http::{HeaderMap, HeaderValue, Method, header}; +use axum::middleware::Next; +use axum::response::{IntoResponse, Response}; + +use super::Shared; +use super::error::Failure; +use crate::auth::{COOKIE, Client, SESSION_TTL}; +use crate::config::ServerConfig; + +impl FromRequestParts for Client { + type Rejection = std::convert::Infallible; + + async fn from_request_parts(parts: &mut Parts, app: &Shared) -> Result { + Ok(client(&app.config, parts)) + } +} + +/// The client's address: the peer, or what `X-Forwarded-For` says when the +/// peer is a trusted proxy (the rightmost address no trusted proxy added). +pub fn client(config: &ServerConfig, parts: &Parts) -> Client { + let peer = parts.extensions.get::>().map(|c| c.0.ip()); + let mut ip = peer.unwrap_or(IpAddr::from([0, 0, 0, 0])); + if config.trusted_proxies.contains(&ip) { + let forwarded = parts.headers.get_all("x-forwarded-for").iter().filter_map(|v| v.to_str().ok()); + let hops: Vec = forwarded.flat_map(|v| v.split(',')).filter_map(|h| h.trim().parse().ok()).collect(); + if let Some(real) = hops.iter().rev().find(|h| !config.trusted_proxies.contains(h)) { + ip = *real; + } + } + let user_agent = + parts.headers.get(header::USER_AGENT).and_then(|v| v.to_str().ok()).map(|ua| ua.chars().take(200).collect()); + Client { ip: ip.to_string(), user_agent } +} + +/// Refuses cross-site state changes; see the module docs. +pub async fn check_origin(State(app): State, req: Request, next: Next) -> Response { + let upgrade = req.headers().get(header::UPGRADE).is_some_and(|v| v.as_bytes().eq_ignore_ascii_case(b"websocket")); + let changes_state = !matches!(*req.method(), Method::GET | Method::HEAD | Method::OPTIONS); + if changes_state || upgrade { + let host = + req.headers().get(header::HOST).and_then(|h| h.to_str().ok()).or(req.uri().authority().map(|a| a.as_str())); + match req.headers().get(header::ORIGIN).map(|o| o.to_str().unwrap_or_default()) { + Some(origin) if !origin_allowed(&app.config, origin, host) => { + return Failure::forbidden("this request comes from another site").into_response(); + } + None if session_cookie(req.headers()).is_some() => { + return Failure::forbidden("a browser request without an Origin").into_response(); + } + _ => {} + } + } + next.run(req).await +} + +fn origin_allowed(config: &ServerConfig, origin: &str, host: Option<&str>) -> bool { + let origin = origin.to_ascii_lowercase(); + if config.public_origin.as_deref() == Some(origin.as_str()) { + return true; + } + let Some(host) = host.map(str::to_ascii_lowercase) else { return false }; + let same_host = |scheme: &str| crate::config::origin_of(&format!("{scheme}://{host}")).is_ok_and(|o| o == origin); + same_host("https") || (config.tls.is_none() && same_host("http")) +} + +/// Lets signed-in requests through with their [`crate::auth::Principal`] +/// as an extension; a browser session used after an hour gets its cookie +/// again with a fresh lifetime. +pub async fn require_auth(State(app): State, req: Request, next: Next) -> Response { + let (mut parts, body) = req.into_parts(); + let client = client(&app.config, &parts); + let cookie = session_cookie(&parts.headers); + let principal = app.auth.authenticate(cookie.as_deref(), bearer(&parts.headers).as_deref(), &client); + let Some(principal) = principal else { return Failure::unauthorized().into_response() }; + let renewed = principal.renewed; + parts.extensions.insert(principal); + let mut response = next.run(Request::from_parts(parts, body)).await; + if renewed + && let Some(token) = cookie + && !response.headers().contains_key(header::SET_COOKIE) + { + response.headers_mut().append(header::SET_COOKIE, set_cookie(&token)); + } + response +} + +/// The session cookie's token, if the request has one. +pub fn session_cookie(headers: &HeaderMap) -> Option { + headers + .get_all(header::COOKIE) + .iter() + .filter_map(|v| v.to_str().ok()) + .flat_map(|v| v.split(';')) + .filter_map(|pair| pair.trim().split_once('=')) + .find(|(name, _)| *name == COOKIE) + .map(|(_, value)| value.to_owned()) +} + +fn bearer(headers: &HeaderMap) -> Option { + let value = headers.get(header::AUTHORIZATION)?.to_str().ok()?; + let (scheme, token) = value.split_once(' ')?; + scheme.eq_ignore_ascii_case("bearer").then(|| token.trim().to_owned()) +} + +/// `Set-Cookie` for a browser session. +pub fn set_cookie(token: &str) -> HeaderValue { + cookie(token, SESSION_TTL.as_secs()) +} + +/// `Set-Cookie` that deletes the browser session cookie. +pub fn clear_cookie() -> HeaderValue { + cookie("", 0) +} + +fn cookie(value: &str, max_age: u64) -> HeaderValue { + let cookie = format!("{COOKIE}={value}; Path=/; Secure; HttpOnly; SameSite=Strict; Max-Age={max_age}"); + // Tokens are base64url, so the value is always a valid header. + HeaderValue::from_str(&cookie).unwrap_or_else(|_| HeaderValue::from_static("")) +} + +#[cfg(test)] +mod tests { + use super::*; + use redshell_core::Settings; + use std::path::Path; + + fn config(toml: &str) -> ServerConfig { + ServerConfig::from_settings(Path::new("/x"), Settings::from_toml(toml).unwrap()).unwrap() + } + + #[test] + fn origins() { + let plain = config(""); + assert!(origin_allowed(&plain, "http://127.0.0.1:4747", Some("127.0.0.1:4747"))); + assert!(origin_allowed(&plain, "https://box.ts.net", Some("box.ts.net"))); + assert!(!origin_allowed(&plain, "https://evil.example", Some("box.ts.net"))); + assert!(!origin_allowed(&plain, "null", Some("box.ts.net"))); + assert!(!origin_allowed(&plain, "http://box.ts.net", None)); + let public = config("[server]\npublic_url = \"https://box.ts.net\"\n"); + assert!(origin_allowed(&public, "https://box.ts.net", Some("127.0.0.1:4747"))); + let tls = config("[server]\ntls_cert = \"c\"\ntls_key = \"k\"\n"); + assert!(!origin_allowed(&tls, "http://box:4747", Some("box:4747")), "no plain http next to TLS"); + } + + #[test] + fn forwarded_for_only_from_trusted_proxies() { + let parts = |peer: &str, forwarded: &str| { + let mut req = axum::http::Request::builder().header("x-forwarded-for", forwarded).body(()).unwrap(); + req.extensions_mut().insert(ConnectInfo(peer.parse::().unwrap())); + req.into_parts().0 + }; + let trusting = config("[server]\ntrusted_proxies = [\"127.0.0.1\"]\n"); + assert_eq!(client(&trusting, &parts("127.0.0.1:1", "6.6.6.6, 100.64.0.7")).ip, "100.64.0.7"); + assert_eq!(client(&trusting, &parts("127.0.0.1:1", "junk")).ip, "127.0.0.1"); + assert_eq!(client(&config(""), &parts("127.0.0.1:1", "100.64.0.7")).ip, "127.0.0.1"); + } + + #[test] + fn cookies_and_bearers() { + let mut headers = HeaderMap::new(); + headers.insert(header::COOKIE, HeaderValue::from_static("a=b; __Host-redshell-session=tok; c=d")); + headers.insert(header::AUTHORIZATION, HeaderValue::from_static("Bearer xyz")); + assert_eq!(session_cookie(&headers).as_deref(), Some("tok")); + assert_eq!(bearer(&headers).as_deref(), Some("xyz")); + let cookie = set_cookie("tok"); + let cookie = cookie.to_str().unwrap(); + for flag in ["Secure", "HttpOnly", "SameSite=Strict", "Path=/", "Max-Age=2592000"] { + assert!(cookie.contains(flag), "{cookie}"); + } + } +} diff --git a/crates/redshell-server/src/web/mod.rs b/crates/redshell-server/src/web/mod.rs new file mode 100644 index 0000000..b428aca --- /dev/null +++ b/crates/redshell-server/src/web/mod.rs @@ -0,0 +1,69 @@ +//! The public HTTP side: the REST API under `/api`, the WebSocket and the +//! PWA. Every `/api` route needs a sign-in except `/api/auth/info`, +//! `/api/auth/sign-in` and `/api/setup`. + +mod account; +mod assets; +mod auth; +mod error; +mod guard; +mod sessions; +mod ws; + +use std::sync::Arc; + +use axum::Router; +use axum::middleware::from_fn_with_state; +use axum::routing::{delete, get, patch, post}; + +use crate::auth::Auth; +use crate::bus::Bus; +use crate::config::ServerConfig; +use crate::sessions::Sessions; +use crate::store::Store; +use error::Failure; + +pub use assets::CSP; + +/// What request handlers share. +pub struct AppState { + pub config: Arc, + pub auth: Auth, + pub sessions: Arc, + pub store: Arc, + pub bus: Bus, +} + +pub type Shared = Arc; + +pub fn router(app: Shared) -> Router { + let open = Router::new() + .route("/auth/info", get(auth::info)) + .route("/auth/sign-in", post(auth::sign_in)) + .route("/setup", post(auth::setup)); + let signed_in = Router::new() + .route("/auth/sign-out", post(auth::sign_out)) + .route("/auth/me", get(auth::me)) + .route("/account/password", post(account::change_password)) + .route("/account/devices", get(account::devices)) + .route("/account/devices/{id}", delete(account::revoke_device)) + .route("/account/sessions", get(account::browser_sessions)) + .route("/account/sessions/{id}", delete(account::revoke_browser_session)) + .route("/profiles", get(sessions::profiles)) + .route("/sessions", get(sessions::list).post(sessions::create)) + .route("/sessions/{id}", patch(sessions::rename).delete(sessions::kill)) + .route("/approvals", get(sessions::approvals)) + .route("/approvals/{id}", post(sessions::answer)) + .route("/fs/folders", get(sessions::folders)) + .route("/ws", get(ws::upgrade)) + .route_layer(from_fn_with_state(app.clone(), guard::require_auth)); + let api = open + .merge(signed_in) + .fallback(|| async { Failure::not_found("API endpoint") }) + .layer(from_fn_with_state(app.clone(), guard::check_origin)); + let mut router = Router::new().nest("/api", api).fallback(assets::serve); + for layer in assets::security_headers(app.config.tls.is_some()) { + router = router.layer(layer); + } + router.with_state(app) +} diff --git a/crates/redshell-server/src/web/sessions.rs b/crates/redshell-server/src/web/sessions.rs new file mode 100644 index 0000000..f2100ac --- /dev/null +++ b/crates/redshell-server/src/web/sessions.rs @@ -0,0 +1,116 @@ +//! Sessions, profiles, approvals and folder completion over REST. + +use axum::extract::{Path, Query, State}; +use axum::{Extension, Json}; +use redshell_protocol::{ + Approval, ApprovalAnswer, CreateSessionRequest, FolderListing, Profile, RenameSessionRequest, SessionInfo, +}; +use serde::Deserialize; +use serde_json::{Value, json}; + +use super::Shared; +use super::error::{ApiResult, Failure}; +use crate::agents::Answer; +use crate::auth::{Client, Principal}; +use crate::sessions::launch; +use crate::store::AuditEvent; + +/// Most folders one listing returns. +const MAX_FOLDERS: usize = 200; + +pub async fn profiles(State(app): State) -> ApiResult> { + let settings = app.sessions.ctx().settings.clone(); + Ok(Json(tokio::task::spawn_blocking(move || launch::profiles(&settings)).await.map_err(anyhow::Error::from)?)) +} + +pub async fn list(State(app): State) -> Json> { + Json(app.sessions.list()) +} + +pub async fn create( + State(app): State, + Extension(principal): Extension, + Json(req): Json, +) -> ApiResult { + let sessions = app.sessions.clone(); + let info = tokio::task::spawn_blocking(move || sessions.create(req, &principal.user)) + .await + .map_err(anyhow::Error::from)??; + Ok(Json(info)) +} + +pub async fn rename( + State(app): State, + Path(id): Path, + Json(req): Json, +) -> ApiResult { + let session = app.sessions.get(&id).ok_or_else(|| Failure::not_found("session"))?; + session.rename(req.name); + Ok(Json(session.info())) +} + +pub async fn kill(State(app): State, Path(id): Path) -> ApiResult { + if app.sessions.kill(&id) { Ok(Json(json!({}))) } else { Err(Failure::not_found("session")) } +} + +pub async fn approvals(State(app): State) -> Json> { + Json(app.sessions.ctx().approvals.pending()) +} + +pub async fn answer( + State(app): State, + Extension(principal): Extension, + client: Client, + Path(id): Path, + Json(req): Json, +) -> ApiResult { + answer_approval(&app, &principal, &client, &id, req)?; + Ok(Json(json!({}))) +} + +/// Hands an answer to the waiting agent; also used by the WebSocket. +pub fn answer_approval( + app: &Shared, + principal: &Principal, + client: &Client, + id: &str, + req: ApprovalAnswer, +) -> Result<(), Failure> { + let answer = Answer { decision: req.decision, message: req.message }; + let approval = app + .sessions + .ctx() + .approvals + .answer(id, answer, &principal.label) + .ok_or_else(|| Failure::not_found("approval"))?; + let detail = format!("{:?} {}: {}", req.decision, approval.tool, approval.summary); + let user = &principal.user; + app.store.audit(AuditEvent::ApprovalAnswered, Some(user.id), Some(&user.username), Some(&client.ip), &detail); + Ok(()) +} + +#[derive(Deserialize)] +pub struct FolderQuery { + path: String, +} + +/// Subfolders of an absolute folder, as the server's user sees them. +pub async fn folders(Query(query): Query) -> ApiResult { + let path = launch::folder(&query.path).map_err(Failure::bad_request)?; + let listing = tokio::task::spawn_blocking(move || -> Result { + let entries = std::fs::read_dir(&path).map_err(|err| format!("{}: {err}", path.display()))?; + let mut folders: Vec = entries + .filter_map(Result::ok) + .filter(|e| e.path().is_dir()) + .filter_map(|e| e.file_name().into_string().ok()) + .collect(); + folders.sort_by_key(|name| name.to_lowercase()); + let truncated = folders.len() > MAX_FOLDERS; + folders.truncate(MAX_FOLDERS); + Ok(FolderListing { path: query.path, folders, truncated }) + }) + .await + .map_err(anyhow::Error::from)? + .map_err(Failure::forbidden)?; + Ok(Json(listing)) +} diff --git a/crates/redshell-server/src/web/ws.rs b/crates/redshell-server/src/web/ws.rs new file mode 100644 index 0000000..bde3a9d --- /dev/null +++ b/crates/redshell-server/src/web/ws.rs @@ -0,0 +1,350 @@ +//! `/api/ws`: one WebSocket per client, multiplexing attached sessions. +//! +//! The connection task reads client messages and server-wide events; one +//! writer task owns the socket; each attached session has a forwarder task +//! that turns its output queue into binary frames. A forwarder whose queue +//! ended because the client fell behind sends a fresh snapshot and goes on; +//! one whose session is gone sends `detached`. + +use std::collections::HashMap; +use std::sync::Arc; +use std::sync::atomic::{AtomicU64, Ordering}; +use std::time::Duration; + +use axum::Extension; +use axum::extract::State; +use axum::extract::ws::{CloseFrame, Message, WebSocket, WebSocketUpgrade}; +use axum::response::Response; +use futures_util::{SinkExt as _, StreamExt as _}; +use redshell_protocol::{ + ApprovalAnswer, ClientMessage, ErrorCode, Modes, MouseEncoding as WireEncoding, MouseTracking as WireTracking, + PROTOCOL_VERSION, ServerMessage, Snapshot, frame, unframe, +}; +use redshell_terminal::{CursorShape, MouseEncoding, MouseTracking, Replay}; +use tokio::sync::{broadcast, mpsc}; +use tokio::task::AbortHandle; + +use super::Shared; +use super::error::Failure; +use super::sessions::answer_approval; +use crate::auth::{Client, Principal}; +use crate::bus::BusEvent; +use crate::sessions::{Feed, Session}; + +/// Largest message a client may send. +const MAX_MESSAGE: usize = 1 << 20; +/// Messages waiting for the socket. +const OUTBOX: usize = 32; +/// Pings find connections a phone dropped without closing. +const PING_EVERY: Duration = Duration::from_secs(30); + +/// Ids of attachments across connections, for "the client that typed last". +static NEXT_CLIENT: AtomicU64 = AtomicU64::new(1); + +pub async fn upgrade( + ws: WebSocketUpgrade, + State(app): State, + Extension(principal): Extension, + client: Client, +) -> Response { + ws.max_message_size(MAX_MESSAGE).on_upgrade(move |socket| Connection::run(app, principal, client, socket)) +} + +struct Attachment { + session: Arc, + client: u64, + size: (u16, u16), + forwarder: AbortHandle, +} + +struct Connection { + app: Shared, + principal: Principal, + client: Client, + out: mpsc::Sender, + channels: HashMap, + next_channel: u16, + sessions: bool, + events: bool, +} + +impl Connection { + async fn run(app: Shared, principal: Principal, client: Client, socket: WebSocket) { + let (mut sink, mut stream) = socket.split(); + let (out, mut outbox) = mpsc::channel::(OUTBOX); + let writer = tokio::spawn(async move { + while let Some(message) = outbox.recv().await { + let close = matches!(message, Message::Close(_)); + if sink.send(message).await.is_err() || close { + break; + } + } + }); + let mut bus = app.bus.subscribe(); + let mut this = Self { + app, + principal, + client, + out, + channels: HashMap::new(), + next_channel: 1, + sessions: false, + events: false, + }; + this.send(&ServerMessage::Hello { protocol_version: PROTOCOL_VERSION, user: this.principal.user.clone() }) + .await; + let mut ping = tokio::time::interval_at(tokio::time::Instant::now() + PING_EVERY, PING_EVERY); + loop { + tokio::select! { + message = stream.next() => match message { + Some(Ok(Message::Text(text))) => this.on_text(&text).await, + Some(Ok(Message::Binary(bytes))) => this.on_binary(&bytes).await, + Some(Ok(Message::Ping(_) | Message::Pong(_))) => {} + Some(Ok(Message::Close(_)) | Err(_)) | None => break, + }, + event = bus.recv() => match event { + Ok(event) => if !this.on_bus(event).await { break }, + Err(broadcast::error::RecvError::Lagged(_)) => this.resend_views().await, + Err(broadcast::error::RecvError::Closed) => break, + }, + _ = ping.tick() => { + let _ = this.out.send(Message::Ping(Default::default())).await; + } + } + } + for (_, attachment) in this.channels.drain() { + attachment.forwarder.abort(); + attachment.session.detached(attachment.client); + } + drop(this); + let _ = writer.await; + } + + async fn send(&self, message: &ServerMessage) { + send(&self.out, message).await; + } + + async fn fail(&self, failure: Failure) { + self.send(&ServerMessage::Error { code: failure.0.code, message: failure.0.message }).await; + } + + async fn on_text(&mut self, text: &str) { + match serde_json::from_str::(text) { + Ok(message) => { + if let Err(failure) = self.on_message(message).await { + self.fail(failure).await; + } + } + Err(err) => self.fail(Failure::bad_request(format!("unreadable message: {err}"))).await, + } + } + + async fn on_binary(&mut self, bytes: &[u8]) { + let result = match unframe(bytes) { + Some((channel, data)) => self.input(channel, data.to_vec()), + None => Err(Failure::bad_request("a binary frame starts with a 2-byte channel")), + }; + if let Err(failure) = result { + self.fail(failure).await; + } + } + + async fn on_message(&mut self, message: ClientMessage) -> Result<(), Failure> { + match message { + ClientMessage::Attach { session, cols, rows } => self.attach(&session, cols, rows).await?, + ClientMessage::Detach { channel } => { + let attachment = self.channels.remove(&channel).ok_or_else(|| Failure::not_found("channel"))?; + attachment.forwarder.abort(); + attachment.session.detached(attachment.client); + self.send(&ServerMessage::Detached { channel }).await; + } + ClientMessage::Resize { channel, cols, rows } => { + let attachment = self.channels.get_mut(&channel).ok_or_else(|| Failure::not_found("channel"))?; + attachment.size = (cols, rows); + attachment.session.client_resized(attachment.client, cols, rows); + } + ClientMessage::Input { channel, data } => self.input(channel, data.into_bytes())?, + ClientMessage::Rename { session, name } => { + self.app.sessions.get(&session).ok_or_else(|| Failure::not_found("session"))?.rename(name); + } + ClientMessage::Subscribe { sessions, events } => { + (self.sessions, self.events) = (sessions, events); + self.resend_views().await; + } + ClientMessage::Approve { approval, decision, message } => { + answer_approval( + &self.app, + &self.principal, + &self.client, + &approval, + ApprovalAnswer { decision, message }, + )?; + } + } + Ok(()) + } + + fn input(&self, channel: u16, bytes: Vec) -> Result<(), Failure> { + let attachment = self.channels.get(&channel).ok_or_else(|| Failure::not_found("channel"))?; + if attachment.session.input(attachment.client, attachment.size, bytes) { + Ok(()) + } else { + Err(Failure::new(ErrorCode::Conflict, "input dropped: the program is not reading it")) + } + } + + async fn attach(&mut self, id: &str, cols: u16, rows: u16) -> Result<(), Failure> { + let session = self.app.sessions.get(id).ok_or_else(|| Failure::not_found("session"))?; + let channel = (0..u16::MAX) + .map(|i| self.next_channel.wrapping_add(i).max(1)) + .find(|c| !self.channels.contains_key(c)) + .ok_or_else(|| Failure::bad_request("too many attached sessions"))?; + self.next_channel = channel.wrapping_add(1); + let client = NEXT_CLIENT.fetch_add(1, Ordering::Relaxed); + session.attached(client, cols, rows); + let (queue, replay) = subscribe(&session).await?; + let attached = ServerMessage::Attached { channel, session: session.info(), snapshot: snapshot(&replay) }; + self.send(&attached).await; + let forwarder = + tokio::spawn(forward(self.app.clone(), session.clone(), channel, self.out.clone(), queue, replay.offset)); + self.channels + .insert(channel, Attachment { session, client, size: (cols, rows), forwarder: forwarder.abort_handle() }); + Ok(()) + } + + /// Handles a server-wide event; `false` closes the connection. + async fn on_bus(&mut self, event: BusEvent) -> bool { + let mine = self.principal.credential; + match event { + BusEvent::Revoked(credential) if credential == mine => return self.close().await, + BusEvent::RevokedAllBut { user_id, keep } if user_id == self.principal.user.id && keep != mine => { + return self.close().await; + } + BusEvent::SessionChanged(id) if self.sessions => { + if let Some(session) = self.app.sessions.get(&id) { + self.send(&ServerMessage::SessionUpdated { session: session.info() }).await; + } + } + BusEvent::SessionRemoved(id) if self.sessions => self.send(&ServerMessage::SessionRemoved { id }).await, + BusEvent::ApprovalRequested(approval) if self.events => { + self.send(&ServerMessage::ApprovalRequested { approval }).await; + } + BusEvent::ApprovalResolved { id, session, outcome, answered_by } if self.events => { + self.send(&ServerMessage::ApprovalResolved { id, session, outcome, answered_by }).await; + } + BusEvent::Event(event) if self.events => self.send(&ServerMessage::Event { event }).await, + _ => {} + } + true + } + + /// Sends the full session list and pending approvals the client chose. + async fn resend_views(&self) { + if self.sessions { + self.send(&ServerMessage::Sessions { sessions: self.app.sessions.list() }).await; + } + if self.events { + self.send(&ServerMessage::Approvals { approvals: self.app.sessions.ctx().approvals.pending() }).await; + } + } + + async fn close(&self) -> bool { + let frame = CloseFrame { code: 4001, reason: "signed out".into() }; + let _ = self.out.send(Message::Close(Some(frame))).await; + false + } +} + +async fn send(out: &mpsc::Sender, message: &ServerMessage) -> bool { + match serde_json::to_string(message) { + Ok(text) => out.send(Message::Text(text.into())).await.is_ok(), + Err(err) => { + log::error!("encoding a message: {err}"); + true + } + } +} + +/// Output from now on, and the screen up to where it starts. +async fn subscribe(session: &Arc) -> Result<(mpsc::Receiver, Replay), Failure> { + let queue = session.subscribe(); + let s = session.clone(); + let replay = tokio::task::spawn_blocking(move || s.replay()).await.map_err(anyhow::Error::from)?; + Ok((queue, replay)) +} + +/// Streams a session's output to one channel; see the module docs. +async fn forward( + app: Shared, + session: Arc, + channel: u16, + out: mpsc::Sender, + mut queue: mpsc::Receiver, + mut offset: u64, +) { + loop { + while let Some(feed) = queue.recv().await { + let sent = match feed { + Feed::Output { end, bytes } => { + if end <= offset { + continue; + } + let skip = offset.saturating_sub(end - bytes.len() as u64) as usize; + offset = end; + out.send(Message::Binary(frame(channel, &bytes[skip..]).into())).await.is_ok() + } + Feed::Resized { cols, rows } => send(&out, &ServerMessage::Resized { channel, cols, rows }).await, + }; + if !sent { + return; + } + } + if app.sessions.get(&session.id).is_none() { + send(&out, &ServerMessage::Detached { channel }).await; + return; + } + // The client fell behind: start over from the current screen. + let Ok((fresh, replay)) = subscribe(&session).await else { return }; + (queue, offset) = (fresh, replay.offset); + if !send(&out, &ServerMessage::Snapshot { channel, snapshot: snapshot(&replay) }).await { + return; + } + } +} + +/// The wire form of a terminal replay. +fn snapshot(replay: &Replay) -> Snapshot { + let m = &replay.modes; + Snapshot { + cols: replay.cols, + rows: replay.rows, + data: replay.data.clone(), + modes: Modes { + alt_screen: m.alt_screen, + app_cursor: m.app_cursor, + app_keypad: m.app_keypad, + bracketed_paste: m.bracketed_paste, + mouse_tracking: m.mouse.map(|p| match p.tracking { + MouseTracking::Click => WireTracking::Click, + MouseTracking::Drag => WireTracking::Drag, + MouseTracking::Motion => WireTracking::Motion, + }), + mouse_encoding: match m.mouse.map(|p| p.encoding) { + Some(MouseEncoding::Sgr) => WireEncoding::Sgr, + Some(MouseEncoding::Utf8) => WireEncoding::Utf8, + Some(MouseEncoding::Normal) | None => WireEncoding::Normal, + }, + focus_reporting: m.focus_reporting, + cursor_visible: m.cursor_visible, + cursor_shape: match m.cursor_shape { + CursorShape::Block => redshell_protocol::CursorShape::Block, + CursorShape::Bar => redshell_protocol::CursorShape::Bar, + CursorShape::Underline => redshell_protocol::CursorShape::Underline, + CursorShape::Hollow => redshell_protocol::CursorShape::Hollow, + CursorShape::Hidden => redshell_protocol::CursorShape::Hidden, + }, + cursor_blinking: m.cursor_blinking, + title: m.title.clone(), + }, + } +} diff --git a/crates/redshell-server/tests/server.rs b/crates/redshell-server/tests/server.rs new file mode 100644 index 0000000..2c25d83 --- /dev/null +++ b/crates/redshell-server/tests/server.rs @@ -0,0 +1,552 @@ +//! The server end to end: started on an ephemeral port with a temporary +//! config directory, driven over real HTTP and WebSocket connections. +//! +//! Sessions run `sh` and fake agent scripts, so those tests are Unix only; +//! Windows runs the auth and HTTP tests. + +// The WebSocket helpers serve the Unix-only session tests. +#![cfg_attr(not(unix), allow(dead_code, unused_imports))] + +use std::time::Duration; + +use futures_util::{SinkExt as _, StreamExt as _}; +use redshell_protocol::{ClientMessage, ServerMessage, SessionInfo, frame, unframe}; +use redshell_server::{RunningServer, ServerConfig}; +use reqwest::StatusCode; +use reqwest::header::{HeaderMap, HeaderValue}; +use serde_json::{Value, json}; +use tokio_tungstenite::tungstenite::{self, Message, client::IntoClientRequest as _}; + +const PASSWORD: &str = "a long passphrase"; + +struct Harness { + dir: tempfile::TempDir, + server: RunningServer, + http: reqwest::Client, +} + +type Ws = tokio_tungstenite::WebSocketStream>; + +impl Harness { + async fn start(extra: &str) -> Self { + let _ = rustls::crypto::ring::default_provider().install_default(); + let dir = tempfile::tempdir().unwrap(); + let config = format!( + "[server]\nlisten = \"127.0.0.1:0\"\napproval_timeout_secs = 5\n[ssh]\nimport_ssh_config = false\n\ + [terminal]\nshell = \"/bin/sh\"\nshell_integration = false\n{extra}" + ); + std::fs::write(dir.path().join("config.toml"), config).unwrap(); + let server = RunningServer::start(ServerConfig::load(dir.path()).unwrap()).await.unwrap(); + Self { dir, server, http: reqwest::Client::new() } + } + + fn origin(&self) -> String { + format!("http://{}", self.server.addr) + } + + fn url(&self, path: &str) -> String { + format!("{}{path}", self.origin()) + } + + fn post(&self, path: &str, body: Value) -> reqwest::RequestBuilder { + self.http.post(self.url(path)).header("origin", self.origin()).json(&body) + } + + /// Creates the account through the setup link; returns the cookie. + async fn setup(&self) -> String { + let link = self.server.setup_link().unwrap().expect("no account yet"); + let code = link.split("code=").nth(1).unwrap(); + let res = self + .post("/api/setup", json!({"code": code, "username": "me", "password": PASSWORD})) + .send() + .await + .unwrap(); + assert_eq!(res.status(), StatusCode::OK); + cookie(res.headers()).expect("setup signs the browser in") + } + + async fn device_token(&self) -> String { + let body = json!({"username": "me", "password": PASSWORD, "device_name": "test"}); + let res: Value = self.post("/api/auth/sign-in", body).send().await.unwrap().json().await.unwrap(); + res["device_token"].as_str().unwrap().to_owned() + } + + async fn create(&self, token: &str, body: Value) -> SessionInfo { + let res = self.http.post(self.url("/api/sessions")).bearer_auth(token).json(&body).send().await.unwrap(); + assert_eq!(res.status(), StatusCode::OK, "{}", res.text().await.unwrap()); + res.json().await.unwrap() + } + + async fn ws(&self, token: &str) -> Ws { + let mut req = format!("ws://{}/api/ws", self.server.addr).into_client_request().unwrap(); + req.headers_mut().insert("authorization", HeaderValue::from_str(&format!("Bearer {token}")).unwrap()); + let (mut ws, _) = tokio_tungstenite::connect_async(req).await.unwrap(); + assert!(matches!(next(&mut ws).await, Event::Json(ServerMessage::Hello { .. }))); + ws + } +} + +/// The session cookie a response sets, checking its flags. +fn cookie(headers: &HeaderMap) -> Option { + let set = headers.get("set-cookie")?.to_str().unwrap(); + for flag in ["HttpOnly", "Secure", "SameSite=Strict", "Path=/"] { + assert!(set.contains(flag), "{set}"); + } + let value = set.strip_prefix("__Host-redshell-session=")?.split(';').next()?; + Some(value.to_owned()) +} + +#[expect(clippy::large_enum_variant, reason = "short-lived test values")] +enum Event { + Json(ServerMessage), + /// Output bytes of an attached session. + Output(Vec), + Closed, +} + +async fn next(ws: &mut Ws) -> Event { + loop { + let message = tokio::time::timeout(Duration::from_secs(10), ws.next()).await.expect("no message in 10 s"); + return match message { + Some(Ok(Message::Text(text))) => Event::Json(serde_json::from_str(&text).unwrap()), + Some(Ok(Message::Binary(bytes))) => { + let (_channel, data) = unframe(&bytes).unwrap(); + Event::Output(data.to_vec()) + } + Some(Ok(Message::Ping(_) | Message::Pong(_) | Message::Frame(_))) => continue, + Some(Ok(Message::Close(_)) | Err(_)) | None => Event::Closed, + }; + } +} + +async fn send(ws: &mut Ws, message: ClientMessage) { + ws.send(Message::text(serde_json::to_string(&message).unwrap())).await.unwrap(); +} + +/// Reads until `wanted` returns something, collecting output on the way. +async fn until(ws: &mut Ws, output: &mut Vec, mut wanted: impl FnMut(&Event, &[u8]) -> Option) -> T { + loop { + let event = next(ws).await; + if let Event::Output(data) = &event { + output.extend_from_slice(data); + } + if let Some(found) = wanted(&event, output) { + return found; + } + assert!(!matches!(event, Event::Closed), "the socket closed"); + } +} + +/// Reads until the output collected so far shows `needle`. +async fn output_with(ws: &mut Ws, output: &mut Vec, needle: &str) { + if !contains(output, needle) { + until(ws, output, |_, out| contains(out, needle).then_some(())).await; + } +} + +fn contains(haystack: &[u8], needle: &str) -> bool { + haystack.windows(needle.len()).any(|w| w == needle.as_bytes()) +} + +#[tokio::test] +async fn setup_creates_the_first_account_once() { + let h = Harness::start("").await; + let info: Value = h.http.get(h.url("/api/auth/info")).send().await.unwrap().json().await.unwrap(); + assert_eq!(info["setup_required"], true); + assert_eq!(info["min_password_length"], 10); + assert!(h.server.setup_link().unwrap().unwrap().starts_with(&h.origin())); + + let wrong = + h.post("/api/setup", json!({"code": "guess", "username": "me", "password": PASSWORD})).send().await.unwrap(); + assert_eq!(wrong.status(), StatusCode::FORBIDDEN); + let cookie = h.setup().await; + + let me: Value = h + .http + .get(h.url("/api/auth/me")) + .header("cookie", format!("__Host-redshell-session={cookie}")) + .send() + .await + .unwrap() + .json() + .await + .unwrap(); + assert_eq!(me["username"], "me"); + let info: Value = h.http.get(h.url("/api/auth/info")).send().await.unwrap().json().await.unwrap(); + assert_eq!(info["setup_required"], false); + assert!(h.server.setup_link().unwrap().is_none()); +} + +#[tokio::test] +async fn sign_in_fails_alike_and_backs_off() { + let h = Harness::start("").await; + h.setup().await; + let attempt = |user: &str| h.post("/api/auth/sign-in", json!({"username": user, "password": "wrong password"})); + let unknown = attempt("ghost").send().await.unwrap(); + let wrong = attempt("me").send().await.unwrap(); + assert_eq!((unknown.status(), wrong.status()), (StatusCode::UNAUTHORIZED, StatusCode::UNAUTHORIZED)); + assert_eq!(unknown.text().await.unwrap(), wrong.text().await.unwrap(), "no hint whether the user exists"); + assert_eq!(attempt("me").send().await.unwrap().status(), StatusCode::UNAUTHORIZED); + let throttled = attempt("me").send().await.unwrap(); + assert_eq!(throttled.status(), StatusCode::TOO_MANY_REQUESTS); + assert!(throttled.headers().contains_key("retry-after")); + let body: Value = throttled.json().await.unwrap(); + assert_eq!(body["code"], "rate_limited"); + // Even the right password waits now. + let right = h.post("/api/auth/sign-in", json!({"username": "me", "password": PASSWORD})).send().await.unwrap(); + assert_eq!(right.status(), StatusCode::TOO_MANY_REQUESTS); +} + +#[tokio::test] +async fn browser_requests_need_our_origin() { + let h = Harness::start("").await; + let cookie = format!("__Host-redshell-session={}", h.setup().await); + let create = |origin: Option<&str>| { + let mut req = h.http.post(h.url("/api/auth/sign-out")).header("cookie", &cookie).json(&json!({})); + if let Some(origin) = origin { + req = req.header("origin", origin); + } + req + }; + assert_eq!(create(Some("https://evil.example")).send().await.unwrap().status(), StatusCode::FORBIDDEN); + assert_eq!(create(None).send().await.unwrap().status(), StatusCode::FORBIDDEN); + let mut req = format!("ws://{}/api/ws", h.server.addr).into_client_request().unwrap(); + req.headers_mut().insert("cookie", HeaderValue::from_str(&cookie).unwrap()); + req.headers_mut().insert("origin", HeaderValue::from_static("https://evil.example")); + match tokio_tungstenite::connect_async(req).await { + Err(tungstenite::Error::Http(res)) => assert_eq!(res.status(), 403), + other => panic!("cross-site WebSocket accepted: {:?}", other.map(|_| ())), + } + let ok = create(Some(&h.origin())).send().await.unwrap(); + assert_eq!(ok.status(), StatusCode::OK); + assert!(ok.headers().get("set-cookie").unwrap().to_str().unwrap().contains("Max-Age=0"), "sign-out clears it"); + let after = h.http.get(h.url("/api/auth/me")).header("cookie", &cookie).send().await.unwrap(); + assert_eq!(after.status(), StatusCode::UNAUTHORIZED); +} + +#[tokio::test] +async fn device_tokens_until_revoked() { + let h = Harness::start("").await; + h.setup().await; + let token = h.device_token().await; + assert_eq!(h.http.get(h.url("/api/sessions")).send().await.unwrap().status(), StatusCode::UNAUTHORIZED); + let devices: Value = + h.http.get(h.url("/api/account/devices")).bearer_auth(&token).send().await.unwrap().json().await.unwrap(); + assert_eq!((devices[0]["name"].as_str(), devices[0]["current"].as_bool()), (Some("test"), Some(true))); + let id = devices[0]["id"].as_i64().unwrap(); + + let mut ws = h.ws(&token).await; + let other = h.device_token().await; + let revoke = h.http.delete(h.url(&format!("/api/account/devices/{id}"))).bearer_auth(&other).send().await.unwrap(); + assert_eq!(revoke.status(), StatusCode::OK); + assert!(matches!(next(&mut ws).await, Event::Closed), "a revoked device's socket closes"); + assert_eq!( + h.http.get(h.url("/api/sessions")).bearer_auth(&token).send().await.unwrap().status(), + StatusCode::UNAUTHORIZED + ); +} + +#[tokio::test] +async fn static_pages_carry_security_headers() { + let h = Harness::start("").await; + for path in ["/", "/sessions/abc"] { + let res = h.http.get(h.url(path)).send().await.unwrap(); + assert_eq!(res.status(), StatusCode::OK, "{path}"); + let headers = res.headers(); + assert_eq!(headers["x-frame-options"], "DENY"); + assert_eq!(headers["referrer-policy"], "no-referrer"); + assert_eq!(headers["x-content-type-options"], "nosniff"); + assert_eq!(headers["cache-control"], "no-cache"); + assert!(headers["content-security-policy"].to_str().unwrap().contains("script-src 'self';")); + assert!(headers["content-type"].to_str().unwrap().starts_with("text/html")); + } + assert_eq!(h.http.get(h.url("/missing.js")).send().await.unwrap().status(), StatusCode::NOT_FOUND); + let api = h.http.get(h.url("/api/nope")).send().await.unwrap(); + assert_eq!(api.status(), StatusCode::NOT_FOUND); + assert_eq!(api.json::().await.unwrap()["code"], "not_found"); +} + +#[cfg(unix)] +#[tokio::test] +async fn sessions_stream_to_late_joiners_and_follow_the_typist() { + let h = Harness::start("").await; + h.setup().await; + let token = h.device_token().await; + let script = "printf hi; read line; echo \"got:$line\"; sleep 5"; + let session = h.create(&token, json!({"command": ["sh", "-c", script], "cols": 80, "rows": 24})).await; + assert_eq!(session.kind, redshell_protocol::SessionKind::Command); + + let mut first = h.ws(&token).await; + send(&mut first, ClientMessage::Attach { session: session.id.clone(), cols: 80, rows: 24 }).await; + let mut out1 = Vec::new(); + let (channel, data) = until(&mut first, &mut out1, |e, _| match e { + Event::Json(ServerMessage::Attached { channel, snapshot, .. }) => Some((*channel, snapshot.data.clone())), + _ => None, + }) + .await; + out1.extend_from_slice(data.as_bytes()); + output_with(&mut first, &mut out1, "hi").await; + + // A late joiner gets the screen as a snapshot. + let mut second = h.ws(&token).await; + send(&mut second, ClientMessage::Attach { session: session.id.clone(), cols: 100, rows: 30 }).await; + let mut out2 = Vec::new(); + let (channel2, snapshot) = until(&mut second, &mut out2, |e, _| match e { + Event::Json(ServerMessage::Attached { channel, snapshot, session }) => { + Some((*channel, (snapshot.clone(), session.cols))) + } + _ => None, + }) + .await; + assert!(snapshot.0.data.contains("hi"), "{:?}", snapshot.0.data); + assert_eq!((snapshot.0.cols, snapshot.1), (80, 80), "the first client still sizes it"); + + // Typing from the second client sizes the session to it; both see the output. + second.send(Message::binary(frame(channel2, b"abc\r"))).await.unwrap(); + until(&mut first, &mut out1, |e, _| { + matches!(e, Event::Json(ServerMessage::Resized { cols: 100, rows: 30, .. })).then_some(()) + }) + .await; + output_with(&mut first, &mut out1, "got:abc").await; + output_with(&mut second, &mut out2, "got:abc").await; + let list: Vec = + h.http.get(h.url("/api/sessions")).bearer_auth(&token).send().await.unwrap().json().await.unwrap(); + assert_eq!((list[0].cols, list[0].rows), (100, 30)); + + // The first client resizes; it does not own the size, so nothing changes. + send(&mut first, ClientMessage::Resize { channel, cols: 60, rows: 20 }).await; + send(&mut first, ClientMessage::Input { channel, data: String::new() }).await; + until(&mut second, &mut out2, |e, _| { + matches!(e, Event::Json(ServerMessage::Resized { cols: 60, rows: 20, .. })).then_some(()) + }) + .await; + + let killed = + h.http.delete(h.url(&format!("/api/sessions/{}", session.id))).bearer_auth(&token).send().await.unwrap(); + assert_eq!(killed.status(), StatusCode::OK); + until(&mut first, &mut out1, |e, _| matches!(e, Event::Json(ServerMessage::Detached { .. })).then_some(())).await; + let list: Vec = + h.http.get(h.url("/api/sessions")).bearer_auth(&token).send().await.unwrap().json().await.unwrap(); + assert!(list.is_empty()); +} + +/// Reads until `needle` shows in the output or in a snapshot; returns +/// whether a snapshot (a resync) came on the way. +async fn seen_with_resync(ws: &mut Ws, needle: &str) -> bool { + let mut out = Vec::new(); + let mut resynced = false; + until(ws, &mut out, |e, out| { + if let Event::Json(ServerMessage::Snapshot { snapshot, .. }) = e { + resynced = true; + if snapshot.data.contains(needle) { + return Some(()); + } + } + contains(&out[out.len().saturating_sub(64 * 1024)..], needle).then_some(()) + }) + .await; + resynced +} + +#[cfg(unix)] +#[tokio::test] +async fn a_slow_client_blocks_nobody_and_resyncs() { + let h = Harness::start("").await; + h.setup().await; + let token = h.device_token().await; + let flood = "read go; head -c 40000000 /dev/zero | tr '\\0' x; echo; echo END-MARK; sleep 10"; + let session = h.create(&token, json!({"command": ["sh", "-c", flood]})).await; + let attach = ClientMessage::Attach { session: session.id.clone(), cols: 80, rows: 24 }; + let mut slow = h.ws(&token).await; + send(&mut slow, attach.clone()).await; + let mut fast = h.ws(&token).await; + send(&mut fast, attach).await; + let mut out = Vec::new(); + let channel = until(&mut fast, &mut out, |e, _| match e { + Event::Json(ServerMessage::Attached { channel, .. }) => Some(*channel), + _ => None, + }) + .await; + send(&mut fast, ClientMessage::Input { channel, data: "\r".into() }).await; + // The other client keeps up while `slow` reads nothing at all. + tokio::time::timeout(Duration::from_secs(60), seen_with_resync(&mut fast, "END-MARK")).await.unwrap(); + assert!(seen_with_resync(&mut slow, "END-MARK").await, "the slow client was resynced"); +} + +#[cfg(unix)] +#[tokio::test] +async fn sessions_outlive_clients_and_report_exit() { + let h = Harness::start("").await; + h.setup().await; + let token = h.device_token().await; + let mut ws = h.ws(&token).await; + send(&mut ws, ClientMessage::Subscribe { sessions: true, events: true }).await; + let session = h.create(&token, json!({"command": ["sh", "-c", "printf 'done\\a'; exit 3"], "name": "job"})).await; + let mut out = Vec::new(); + let exited = until(&mut ws, &mut out, |e, _| match e { + Event::Json(ServerMessage::SessionUpdated { session: s }) if s.id == session.id && s.exit.is_some() => { + Some(s.clone()) + } + _ => None, + }) + .await; + assert_eq!(exited.exit.unwrap().code, Some(3)); + assert_eq!(exited.name.as_deref(), Some("job")); + drop(ws); + // Still listed, with its final screen, until killed. + let mut late = h.ws(&token).await; + send(&mut late, ClientMessage::Attach { session: session.id.clone(), cols: 80, rows: 24 }).await; + let data = until(&mut late, &mut out, |e, _| match e { + Event::Json(ServerMessage::Attached { snapshot, .. }) => Some(snapshot.data.clone()), + _ => None, + }) + .await; + assert!(data.contains("done")); +} + +/// Attaches to a session and reads until its screen shows `needle`. +#[cfg(unix)] +async fn screen_with(h: &Harness, token: &str, session: &str, needle: &str) -> String { + let mut ws = h.ws(token).await; + send(&mut ws, ClientMessage::Attach { session: session.into(), cols: 1000, rows: 24 }).await; + let mut out = Vec::new(); + until(&mut ws, &mut out, |e, out| match e { + Event::Json(ServerMessage::Attached { snapshot, .. }) if snapshot.data.contains(needle) => { + Some(snapshot.data.clone()) + } + _ => contains(out, needle).then(|| String::from_utf8_lossy(out).into_owned()), + }) + .await +} + +/// A fake agent: prints its arguments and hook URL, then waits. +#[cfg(unix)] +fn fake_agent(dir: &std::path::Path, name: &str) -> String { + use std::os::unix::fs::PermissionsExt as _; + let path = dir.join(name); + std::fs::write(&path, "#!/bin/sh\nprintf 'ARGS=%s URL=%s END\\n' \"$*\" \"$REDSHELL_HOOK_URL\"\nsleep 30\n") + .unwrap(); + std::fs::set_permissions(&path, std::fs::Permissions::from_mode(0o755)).unwrap(); + path.display().to_string() +} + +#[cfg(unix)] +#[tokio::test] +async fn claude_permission_requests_wait_for_a_client() { + let bin = tempfile::tempdir().unwrap(); + let claude = fake_agent(bin.path(), "claude"); + let h = Harness::start(&format!( + "[[agents.custom]]\nid = \"claude\"\nname = \"Claude Code\"\ncommand = \"{claude}\"\n" + )) + .await; + h.setup().await; + let token = h.device_token().await; + let mut ws = h.ws(&token).await; + send(&mut ws, ClientMessage::Subscribe { sessions: false, events: true }).await; + let session = h.create(&token, json!({"profile": "agent:claude"})).await; + assert_eq!(session.agent.as_deref(), Some("claude")); + + let settings_file = h.dir.path().join(format!("run/claude-{}.json", session.id)); + { + use std::os::unix::fs::PermissionsExt as _; + assert_eq!(std::fs::metadata(&settings_file).unwrap().permissions().mode() & 0o777, 0o600); + } + let settings: Value = serde_json::from_str(&std::fs::read_to_string(&settings_file).unwrap()).unwrap(); + let hook_url = settings["hooks"]["PermissionRequest"][0]["hooks"][0]["url"].as_str().unwrap().to_owned(); + assert!(hook_url.starts_with(&format!("http://{}/claude/{}/", h.server.hook_addr, session.id))); + + let request = json!({ + "session_id": "abc", "cwd": "/tmp", "hook_event_name": "PermissionRequest", "tool_name": "Bash", + "tool_input": {"command": "mkdir zz_probe", "description": "Make a folder"}, + "permission_suggestions": [{"type": "addRules", "rules": [{"toolName": "Bash", "ruleContent": "mkdir:*"}], "behavior": "allow", "destination": "localSettings"}] + }); + let http = h.http.clone(); + let (url, body) = (hook_url.clone(), request.clone()); + let held = tokio::spawn(async move { http.post(url).json(&body).send().await.unwrap().text().await.unwrap() }); + + let mut out = Vec::new(); + let approval = until(&mut ws, &mut out, |e, _| match e { + Event::Json(ServerMessage::ApprovalRequested { approval }) => Some(approval.clone()), + _ => None, + }) + .await; + assert_eq!((approval.tool.as_str(), approval.summary.as_str()), ("Bash", "mkdir zz_probe")); + assert_eq!(approval.description.as_deref(), Some("Make a folder")); + assert!(approval.permission_suggestions.is_some()); + tokio::time::sleep(Duration::from_millis(200)).await; + assert!(!held.is_finished(), "the hook waits for an answer"); + let decision = redshell_protocol::ApprovalDecision::Allow; + send(&mut ws, ClientMessage::Approve { approval: approval.id.clone(), decision, message: None }).await; + let reply: Value = serde_json::from_str(&held.await.unwrap()).unwrap(); + assert_eq!(reply["hookSpecificOutput"]["hookEventName"], "PermissionRequest"); + assert_eq!(reply["hookSpecificOutput"]["decision"]["behavior"], "allow"); + let answered_by = until(&mut ws, &mut out, |e, _| match e { + Event::Json(ServerMessage::ApprovalResolved { answered_by, .. }) => Some(answered_by.clone()), + _ => None, + }) + .await; + assert_eq!(answered_by.as_deref(), Some("test")); + + // Answered in Claude's own dialog: the next hook settles the held request with no decision. + let (http, url, body) = (h.http.clone(), hook_url.clone(), request.clone()); + let held = tokio::spawn(async move { http.post(url).json(&body).send().await.unwrap().text().await.unwrap() }); + until(&mut ws, &mut out, |e, _| matches!(e, Event::Json(ServerMessage::ApprovalRequested { .. })).then_some(())) + .await; + let post_tool = + json!({"hook_event_name": "PostToolUse", "tool_name": "Bash", "tool_input": {}, "tool_response": {}}); + assert_eq!(h.http.post(&hook_url).json(&post_tool).send().await.unwrap().status(), StatusCode::OK); + assert_eq!(held.await.unwrap(), "", "no decision: Claude keeps its own answer"); + let by = until(&mut ws, &mut out, |e, _| match e { + Event::Json(ServerMessage::ApprovalResolved { answered_by, .. }) => Some(answered_by.clone()), + _ => None, + }) + .await; + assert_eq!(by.as_deref(), Some("terminal")); + + let stop = json!({"hook_event_name": "Stop", "last_assistant_message": "All done."}); + h.http.post(&hook_url).json(&stop).send().await.unwrap(); + let finished = until(&mut ws, &mut out, |e, _| match e { + Event::Json(ServerMessage::Event { event }) if event.kind == redshell_protocol::EventKind::Finished => { + Some(event.clone()) + } + _ => None, + }) + .await; + assert_eq!(finished.body.as_deref(), Some("All done.")); + + // A wrong token, and the public port, know nothing of hooks. + let wrong = hook_url.rsplit_once('/').unwrap().0.to_owned() + "/wrong-token"; + assert_eq!(h.http.post(&wrong).json(&stop).send().await.unwrap().status(), StatusCode::NOT_FOUND); + let path = hook_url.split_once(&h.server.hook_addr.to_string()).unwrap().1; + let public = h.http.post(h.url(path)).json(&request).send().await.unwrap(); + assert_eq!(public.status(), StatusCode::METHOD_NOT_ALLOWED); + + // Killing the session removes its settings file. + h.http.delete(h.url(&format!("/api/sessions/{}", session.id))).bearer_auth(&token).send().await.unwrap(); + assert!(!settings_file.exists()); +} + +#[cfg(unix)] +#[tokio::test] +async fn codex_turns_finish_through_notify() { + let bin = tempfile::tempdir().unwrap(); + let codex = fake_agent(bin.path(), "codex"); + let h = + Harness::start(&format!("[[agents.custom]]\nid = \"codex\"\nname = \"Codex\"\ncommand = \"{codex}\"\n")).await; + h.setup().await; + let token = h.device_token().await; + let session = h.create(&token, json!({"profile": "agent:codex", "cols": 1000})).await; + let screen = screen_with(&h, &token, &session.id, " END").await; + let line = screen.lines().find(|l| l.contains(" END")).unwrap(); + assert!(line.contains("ARGS=-c notify=["), "{line}"); + assert!(line.contains("\"hook\",\"codex\"]"), "{line}"); + let url = line.split("URL=").nth(1).unwrap().split(' ').next().unwrap(); + assert!(url.starts_with(&format!("http://{}/codex/{}/", h.server.hook_addr, session.id))); + + let payload = json!({"type": "agent-turn-complete", "last-assistant-message": "Patched it.", "thread-id": "t"}); + redshell_server::post_notify(url, payload.to_string()).await.unwrap(); + let list: Vec = + h.http.get(h.url("/api/sessions")).bearer_auth(&token).send().await.unwrap().json().await.unwrap(); + assert_eq!(list[0].agent_state, Some(redshell_protocol::AgentState::Finished)); + assert_eq!(list[0].last_message.as_deref(), Some("Patched it.")); +} From 56deaf784f4c2e8db57c5af3995609ce21758477 Mon Sep 17 00:00:00 2001 From: ForeverInLaw <44206490+ForeverInLaw@users.noreply.github.com> Date: Fri, 4 Dec 2026 13:06:40 +0000 Subject: [PATCH 009/128] docs: describe running redshell-server, its security model and its protocol --- CHANGELOG.md | 10 ++ docs/ARCHITECTURE.md | 27 ++++ docs/REMOTE.md | 289 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 326 insertions(+) create mode 100644 docs/REMOTE.md diff --git a/CHANGELOG.md b/CHANGELOG.md index cf3259d..4c7eb9b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,6 +34,16 @@ All notable changes to this project are documented here. The format follows dropped files, creates, renames and deletes, copies paths and opens a terminal in the folder shown. Transfers show progress, can be cancelled and keep going while you browse elsewhere or after the dialog closes. + passwords and passphrases in the system keychain (`ssh.askpass`, OpenSSH 8.4 or newer). +- `redshell-server`, a headless server that keeps terminal sessions (shells, coding agents, SSH + hosts) running on an always-on machine for the desktop and the RedShell Remote PWA. It has + first-run setup, password sign-in with backoff, browser sessions and device tokens, a REST + API and one WebSocket per client. See [docs/REMOTE.md](docs/REMOTE.md). +- Claude Code permission requests can be answered from any connected client, and Claude Code + and Codex report when they finish or wait for input. +- `redshell-protocol`, the wire types shared by the server, the desktop and (as TypeScript) the + PWA. +- A `[server]` section in `config.toml`, read only by the server. ## [0.0.2] - 2026-12-01 diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md index 7979e65..11f060c 100644 --- a/docs/ARCHITECTURE.md +++ b/docs/ARCHITECTURE.md @@ -13,8 +13,15 @@ redshell-app ──► redshell-ui ──► redshell-theme (feature "gpui") ├──► redshell-agents ├──► redshell-plugin ──► redshell-theme └──► redshell-core (shared by every crate) + +redshell-server ──► axum, tokio, rustls (ring), rusqlite, argon2 + ├──► redshell-terminal, redshell-agents, redshell-remote, redshell-core + └──► redshell-protocol ──► serde (ts-rs in tests: web/src/protocol/*.ts) ``` +`redshell-server` and `redshell-protocol` do not depend on GPUI either; the server is a separate +binary that builds for a Raspberry Pi with no C toolchain beyond SQLite's. + ## Key abstractions * **`Launchable` / `LaunchProfile`** (core): anything that can open in a tab. Local shells, SSH @@ -25,6 +32,9 @@ redshell-app ──► redshell-ui ──► redshell-theme (feature "gpui") * **`SessionObserver`** (core): the terminal I/O thread reports output, input, resizes, titles, the working directory, commands and exit to it. The history `Recorder` is one observer. `ObserverSet` fans out to several. +* **`Replay`** (terminal): the screen, recent scrollback and the modes a program set, as ANSI + bytes that redraw them in a fresh terminal, cut at the exact output offset the live stream + continues from. A client that joins a server session gets one. * **`Terminal`** (terminal): owns the PTY and the VT state. An I/O thread parses output and scans OSC 7, 9;9 and 133. The parser is advanced exactly up to each mark, and cells printed after `OSC 133;A` carry an internal hyperlink id, so prompt positions follow scrolling and reflow. @@ -97,6 +107,23 @@ session the user picked is re-attached without being created (`attach-session -t native tmux session is attached once in control mode, which brings back all of its windows. The session a tab belongs to is read back from its profile id (`redshell_remote::session_ref`). +## Server + +`redshell-server` (see [REMOTE.md](REMOTE.md)) keeps sessions on an always-on machine: + +* **`Sessions` / `Session`** (`sessions/`): each session owns a `Terminal` and a small thread + that drains its events and writes input, so a program that stops reading never blocks an async + worker. The session's `SessionObserver` (`Tap`) publishes output, tagged with its byte offset, + to an `OutputHub`: one bounded queue per attached client, filled with `try_send`, so a slow + client is dropped and resynced with a fresh `Replay` instead of slowing anyone down. +* **`Auth`** (`auth/`): setup codes, Argon2id passwords, per-IP and per-name backoff, browser + sessions and device tokens stored as SHA-256 hashes. +* **`Store`** (`store/`): SQLite with `user_version` migrations, like the history database. +* **Agent hooks** (`agents/`): a loopback-only listener for Claude Code HTTP hooks and Codex's + `notify`, and `Approvals`, the permission requests held open until a client answers. +* **`Bus`**: a broadcast of session, approval and revocation events that every WebSocket + connection (`web/ws.rs`) filters for its client. + ## Rendering `TerminalView` paints with a single GPUI `canvas`: diff --git a/docs/REMOTE.md b/docs/REMOTE.md new file mode 100644 index 0000000..2263db0 --- /dev/null +++ b/docs/REMOTE.md @@ -0,0 +1,289 @@ +# RedShell Server + +`redshell-server` is RedShell without a window. It owns terminal sessions (shells, coding +agents such as Claude Code and Codex, SSH hosts) on an always-on machine, a Raspberry Pi for +example, and keeps them running whoever is connected. The desktop RedShell attaches to them like +to any tab, and phones use RedShell Remote, the PWA the server serves. The design behind it is +[design/remote-server.md](design/remote-server.md). + +## Running it + +```sh +cargo build --release -p redshell-server +./target/release/redshell-server # same as `redshell-server serve` +``` + +The PWA is embedded in the binary at build time from `web/dist`. Build it first with +`npm ci && npm run build` in `web/`; without it the server serves a page that says so, and the +API works as usual. + +On the first start there is no account, and the server logs a one-time setup link that is valid +for 30 minutes: + +``` +No account exists yet. Create the first one within 30 minutes at: + + https://box.tailnet.ts.net/setup?code=… +``` + +Open it, choose a name and a password, and that browser is signed in. Restart the server for a +new link, or create the account from a shell instead with `redshell-server user add `. + +Everything the server keeps lives in its config directory (`--config `, or +`REDSHELL_SERVER_CONFIG`, default `~/.config/redshell-server`), which it makes private (0700): + +| Path | What | +|---|---| +| `config.toml` | The desktop's configuration format with an extra `[server]` section. | +| `server.sqlite3` | Accounts, sign-ins, the audit log and which sessions ran. | +| `run/` | Files that only live while the server runs, such as agent hook settings. | +| `shell-integration/` | The scripts that report a shell's folder and prompts. | + +### Command line + +``` +redshell-server [--config ] [serve] +redshell-server user add [--password-stdin] +redshell-server user passwd [--password-stdin] # also signs the user out everywhere +redshell-server user remove +redshell-server user list +``` + +The `user` commands write to the database directly, so they also work while the server runs. +`--password-stdin` reads the password from the first line of standard input, for scripts. + +### Configuration + +The server reads `config.toml` like the desktop does: `[terminal]` (shell, environment, +scrollback), `[ssh]` (hosts, `~/.ssh/config`) and `[agents]` (extra arguments, custom agents) +mean the same thing. Unlike the desktop, a file that does not parse stops the server. The +`[server]` keys: + +| Key | Default | Notes | +|---|---|---| +| `listen` | `"127.0.0.1:4747"` | Address and port. A non-loopback address is refused unless `tls_cert` and `tls_key` are set. | +| `public_url` | none | The HTTPS origin clients open (`https://box.tailnet.ts.net`). The setup link uses it, and it is an allowed `Origin`. | +| `tls_cert`, `tls_key` | none | PEM certificate chain and key for built-in TLS (rustls). | +| `trusted_proxies` | `[]` | Peer addresses whose `X-Forwarded-For` names the real client, for sign-in throttling and the audit log. | +| `approval_timeout_secs` | `600` | How long an agent's permission request waits for an answer before the agent asks in its terminal. | + +## Reaching it from a phone + +Keep the server on loopback and put a TLS proxy in front of it. HTTPS is not optional in +practice: passkeys (WebAuthn) and Web Push only work in a secure context, the session cookie is +`Secure`, and a desktop's bearer token would otherwise cross the network in clear. + +### Tailscale Serve (recommended) + +Tailscale gives the machine a name and a certificate inside your tailnet, and nothing is +exposed to the internet. + +```sh +tailscale serve --bg 4747 +``` + +That proxies `https://..ts.net` to `http://127.0.0.1:4747`. Tell the server +about it in `config.toml`: + +```toml +[server] +listen = "127.0.0.1:4747" +public_url = "https://box.tailnet.ts.net" +trusted_proxies = ["127.0.0.1", "::1"] +``` + +Without `trusted_proxies` every client looks like `127.0.0.1`, so a failing client slows down +sign-ins for everyone instead of only for itself. + +### Cloudflare named tunnel + +A named tunnel publishes the server on a hostname of a domain you have on Cloudflare, with no +open port at home: + +```sh +cloudflared tunnel login +cloudflared tunnel create redshell +cloudflared tunnel route dns redshell shell.example.com +``` + +`~/.cloudflared/config.yml`: + +```yaml +tunnel: redshell +credentials-file: /home/pi/.cloudflared/.json +ingress: + - hostname: shell.example.com + service: http://127.0.0.1:4747 + - service: http_status:404 +``` + +Run `cloudflared tunnel run redshell` (or install it as a service), and set +`public_url = "https://shell.example.com"` and `trusted_proxies = ["127.0.0.1", "::1"]`. +Cloudflare terminates TLS, so it sees the traffic; putting Cloudflare Access in front adds a +second sign-in. + +### Built-in TLS + +With a certificate of your own, the server can listen on the network directly: + +```toml +[server] +listen = "0.0.0.0:443" +public_url = "https://shell.example.com" +tls_cert = "/etc/redshell-server/fullchain.pem" +tls_key = "/etc/redshell-server/privkey.pem" +``` + +## Sessions + +A session is a terminal on the server, started from a profile: the default shell (`shell`), +an agent found on the server's `PATH` or in `[[agents.custom]]` (`agent:claude`), an SSH host +(`ssh:prod`), or a command line with a folder. Sessions keep running when every client is +gone; one that exits keeps its final screen until it is killed. + +The session has the size of the client that typed into it last (tmux's `window-size latest`); +the first client to attach sizes it until someone types. Other clients get a `resized` message +and show the session at that size. + +A client that attaches gets a snapshot, then the live output. The snapshot is the screen and up +to 2,000 lines of scrollback as ANSI text, followed by the state a program set that the cells do +not show: cursor position and pen, application cursor and keypad, bracketed paste, mouse +reporting and its encoding, focus reporting, cursor visibility and shape, and the title. It is +cut exactly where the live stream continues, so no output is lost or repeated. Not carried: a +scroll region, saved cursors and character sets, and while a full-screen program uses the +alternate screen, the normal screen behind it (it comes back blank when the program exits). +Full-screen programs redraw on the resize a new client causes. + +A client that cannot keep up never slows the program or the other clients: each client has a +small queue, and when it is full that client's output is dropped and it gets a fresh snapshot +(`snapshot` message) once it catches up. + +## Agents + +The server knows what Claude Code and Codex are doing through their own extension points, so +sessions stay the real terminal programs the desktop shows. + +- **Claude Code** starts with `--settings `, a 0600 file in `run/` that adds HTTP hooks + for PermissionRequest, PostToolUse, PostToolUseFailure, Notification, Stop and + UserPromptSubmit. The user's own settings and hooks still apply; ours are added to them. +- **Codex** starts with `-c notify=["", "hook", "codex"]`. After each turn + Codex runs it with a JSON payload, which it posts to the server. +- **Any program** can raise a notification with OSC 9 (`ESC ] 9 ; text BEL`), OSC 777 + (`ESC ] 777 ; notify ; title ; body BEL`) or the bell. + +Hooks post to a second listener bound to 127.0.0.1 on a random port, which is never part of the +public listener. Every hook URL carries the session id and a random per-session token; the +token for Codex travels in the session's environment (`REDSHELL_HOOK_URL`), not on a command +line that every user of the machine can read. + +A permission request is held open and shown to every client subscribed to events. Claude shows +its own dialog at the same time, and the first answer wins: *allow*, *allow always* (applies the +rules Claude suggested), *deny*, or *answer in terminal* (no decision, so Claude's dialog +decides). When the user answers in Claude's dialog, Claude does not close our request; the next +hook of that session (PostToolUse, PostToolUseFailure, UserPromptSubmit, Stop or another +PermissionRequest) settles it as answered in the terminal. After `approval_timeout_secs` it is +settled with no decision. + +Agent states: `idle` (started), `working`, `needs_approval`, `needs_input` (Claude's idle and +question prompts), `finished` (with the last message). + +## Security model + +- No default account and no default password; the first account comes from the setup link in + the log, or from the `user` command. +- Passwords are Argon2id hashes and need at least 10 characters; nothing else is enforced. + Sign-in has the same error, and takes the same time, for an unknown name and a wrong password. + After 3 failures per client address and per name, each attempt waits 1 s, 2 s, 4 s, … up to + 15 minutes after the last failure; every attempt is in the audit log. +- Tokens are 256-bit random values. The database keeps only their SHA-256. +- Browsers get a `__Host-redshell-session` cookie (HttpOnly, Secure, SameSite=Strict) that + lasts 30 days from its last use. Other clients get a named bearer device token. Both are + listed under the account and can be revoked; revoking one, signing out and changing the + password (which signs out everything else) close its open WebSockets. +- A state-changing request and the WebSocket upgrade are refused when they carry an `Origin` + other than `public_url` or the host they were sent to (`https`, or `http` when the server has + no TLS of its own), and when a cookie comes without any `Origin`. Clients that are not + browsers send no `Origin` and use bearer tokens. +- Every `/api` endpoint needs a sign-in except `/api/auth/info`, `/api/auth/sign-in` and + `/api/setup`. Responses never include password or token hashes. +- Every response carries `Content-Security-Policy` (below), `X-Frame-Options: DENY`, + `Referrer-Policy: no-referrer` and `X-Content-Type-Options: nosniff`, plus HSTS with + built-in TLS: + + ``` + default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob:; + font-src 'self' data:; connect-src 'self'; worker-src 'self'; manifest-src 'self'; object-src 'none'; + base-uri 'none'; frame-ancestors 'none'; form-action 'self' + ``` + +- Every user of a server is trusted with all of its sessions: there is no isolation between + users. Sessions run as the server's user. + +## Protocol + +The wire types are in the `redshell-protocol` crate; its tests generate the TypeScript +definitions in `web/src/protocol/` (`index.ts` re-exports them with `PROTOCOL_VERSION`). JSON +uses `snake_case`, tagged unions carry a `type` field, times are Unix milliseconds. Errors are +an `ApiError` (`{code, message, retry_after_secs?}`) with a matching status. +`GET /api/auth/info` reports the server's `protocol_version`; it goes up when a change would +break an older client. + +### REST + +| Method and path | Body → response | +|---|---| +| `GET /api/auth/info` | → `ServerInfo` (version, protocol version, setup required, password minimum) | +| `POST /api/setup` | `SetupRequest` → `SignInResponse`, sets the cookie | +| `POST /api/auth/sign-in` | `SignInRequest` → `SignInResponse`: a cookie, or with `device_name` a `device_token` | +| `POST /api/auth/sign-out` | → `{}`, revokes this cookie or token | +| `GET /api/auth/me` | → `User` | +| `POST /api/account/password` | `ChangePasswordRequest` → `{}` | +| `GET /api/account/devices` | → `Device[]` | +| `DELETE /api/account/devices/{id}` | → `{}` | +| `GET /api/account/sessions` | → `BrowserSession[]` | +| `DELETE /api/account/sessions/{id}` | → `{}` | +| `GET /api/profiles` | → `Profile[]` | +| `GET /api/sessions` | → `SessionInfo[]` | +| `POST /api/sessions` | `CreateSessionRequest` → `SessionInfo` | +| `PATCH /api/sessions/{id}` | `RenameSessionRequest` → `SessionInfo` | +| `DELETE /api/sessions/{id}` | → `{}`, kills it | +| `GET /api/approvals` | → `Approval[]` waiting for an answer | +| `POST /api/approvals/{id}` | `ApprovalAnswer` → `{}` | +| `GET /api/fs/folders?path=` | → `FolderListing`: up to 200 subfolders, for path completion | +| `GET /api/ws` | WebSocket upgrade | + +### WebSocket + +One connection per client at `/api/ws`. Text frames are JSON, binary frames are terminal bytes: +two bytes of channel number (big-endian), then the bytes. + +Client → server (`ClientMessage`): + +| `type` | Fields | | +|---|---|---| +| `attach` | `session, cols, rows` | Answered by `attached`, then output frames. | +| `detach` | `channel` | Answered by `detached`. | +| `resize` | `channel, cols, rows` | The client's terminal size. | +| `input` | `channel, data` | Keys and pastes as text; binary frames carry any bytes. | +| `rename` | `session, name` | | +| `subscribe` | `sessions, events` | Session list and agent activity; replaces the last choice. | +| `approve` | `approval, decision, message?` | `allow`, `allow_always`, `deny`, `terminal`. | + +Server → client (`ServerMessage`): `hello` (first, with the user), `attached` (channel, session, +snapshot), `snapshot` (a resync after the client fell behind), `resized`, `detached`, +`sessions` / `session_updated` / `session_removed`, `approvals` / `approval_requested` / +`approval_resolved` (with who answered: a device name, `browser` or `terminal`), `event` +(approval requested, needs input, finished, notification, bell, exited) and `error`. + +On `attached` and `snapshot`, reset the terminal, size it to `snapshot.cols` × `snapshot.rows` +and write `snapshot.data`; then write each output frame as it comes. The server's terminal +answers the program's queries (device attributes, cursor position, colours), so a client must +not forward the replies its own terminal emulator generates while drawing. + +The server pings every 30 seconds; a revoked credential's socket is closed with code 4001. + +## Resource use + +An idle server does no work: there are no timers while nothing happens, besides a WebSocket +ping every 30 seconds per connected client. Each session costs a PTY reader thread and a small +event thread. Output to a client is queued at most 32 chunks deep on each side of the socket. From aea929259333685f21d05c48e02aed9f074bea77 Mon Sep 17 00:00:00 2001 From: ForeverInLaw <44206490+ForeverInLaw@users.noreply.github.com> Date: Fri, 4 Dec 2026 13:10:20 +0000 Subject: [PATCH 010/128] server: hand Argon2's memory back to the OS after each sign-in --- Cargo.lock | 1 + crates/redshell-server/Cargo.toml | 3 +++ crates/redshell-server/src/main.rs | 13 +++++++++++++ 3 files changed, 17 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index 6487608..2897d5b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5090,6 +5090,7 @@ dependencies = [ "http-body-util", "hyper", "hyper-util", + "libc", "log", "parking_lot", "rand_core 0.6.4", diff --git a/crates/redshell-server/Cargo.toml b/crates/redshell-server/Cargo.toml index 2cfcb39..d77b2b5 100644 --- a/crates/redshell-server/Cargo.toml +++ b/crates/redshell-server/Cargo.toml @@ -48,6 +48,9 @@ base64 = "0.22" clap = { version = "4", features = ["derive", "env"] } rpassword = "7" +[target.'cfg(all(target_os = "linux", target_env = "gnu"))'.dependencies] +libc = "0.2" + [dev-dependencies] tempfile.workspace = true reqwest = { version = "0.12", default-features = false, features = ["json"] } diff --git a/crates/redshell-server/src/main.rs b/crates/redshell-server/src/main.rs index 79616be..263348c 100644 --- a/crates/redshell-server/src/main.rs +++ b/crates/redshell-server/src/main.rs @@ -94,6 +94,7 @@ fn runtime(workers: usize) -> anyhow::Result { } fn serve(dir: PathBuf) -> anyhow::Result<()> { + return_large_blocks_to_the_os(); let _ = rustls::crypto::ring::default_provider().install_default(); let config = ServerConfig::load(&dir)?; log::info!("config directory: {}", dir.display()); @@ -109,6 +110,18 @@ fn serve(dir: PathBuf) -> anyhow::Result<()> { }) } +/// Every password check takes 19 MiB for Argon2. glibc raises its mmap +/// threshold after the first such block is freed and keeps later ones in +/// the heap, so an idle server would hold ~20 MiB after one sign-in. A fixed +/// threshold sends blocks of 1 MiB and more back to the OS when freed. +fn return_large_blocks_to_the_os() { + #[cfg(all(target_os = "linux", target_env = "gnu"))] + // SAFETY: only tunes the allocator, before any other thread exists. + unsafe { + libc::mallopt(libc::M_MMAP_THRESHOLD, 1 << 20); + } +} + async fn stop_signal() { #[cfg(unix)] { From 2a0f5d46c7b716fee5039064edc4dfb28444df79 Mon Sep 17 00:00:00 2001 From: ForeverInLaw <44206490+ForeverInLaw@users.noreply.github.com> Date: Fri, 4 Dec 2026 13:11:33 +0000 Subject: [PATCH 011/128] server: stop rebuilding on every build while web/dist is missing --- crates/redshell-server/build.rs | 13 +++++++++---- docs/REMOTE.md | 10 ++++++++-- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/crates/redshell-server/build.rs b/crates/redshell-server/build.rs index 1d8c09d..7f64733 100644 --- a/crates/redshell-server/build.rs +++ b/crates/redshell-server/build.rs @@ -1,6 +1,11 @@ //! Picks the folder the PWA is embedded from: `web/dist` when it has been //! built (`npm ci && npm run build` in `web/`), else a placeholder page //! that says so, so `cargo build` works without Node. +//! +//! Cargo reruns a build script whose watched path is missing on every +//! build, so a missing `web/dist` is not watched: after the first PWA build, +//! `cargo clean -p redshell-server` makes the server pick it up. Changes to +//! an existing `web/dist` are picked up by themselves. use std::path::PathBuf; @@ -8,9 +13,9 @@ fn main() { let manifest = PathBuf::from(std::env::var("CARGO_MANIFEST_DIR").expect("set by cargo")); let dist = manifest.join("../../web/dist"); let placeholder = manifest.join("placeholder"); - let folder = if dist.join("index.html").is_file() { &dist } else { &placeholder }; + let built = dist.join("index.html").is_file(); + let folder = if built { &dist } else { &placeholder }; println!("cargo:rustc-env=REDSHELL_WEB_DIST={}", folder.display()); - println!("cargo:rerun-if-changed={}", placeholder.display()); - // A missing path counts as changed, so a PWA built later is picked up. - println!("cargo:rerun-if-changed={}", dist.display()); + println!("cargo:rerun-if-changed=build.rs"); + println!("cargo:rerun-if-changed={}", folder.display()); } diff --git a/docs/REMOTE.md b/docs/REMOTE.md index 2263db0..d62882f 100644 --- a/docs/REMOTE.md +++ b/docs/REMOTE.md @@ -15,7 +15,9 @@ cargo build --release -p redshell-server The PWA is embedded in the binary at build time from `web/dist`. Build it first with `npm ci && npm run build` in `web/`; without it the server serves a page that says so, and the -API works as usual. +API works as usual. When `web/dist` appears after the server was built, run +`cargo clean -p redshell-server` once so the next build embeds it; later PWA builds are picked +up by themselves. On the first start there is no account, and the server logs a one-time setup link that is valid for 30 minutes: @@ -286,4 +288,8 @@ The server pings every 30 seconds; a revoked credential's socket is closed with An idle server does no work: there are no timers while nothing happens, besides a WebSocket ping every 30 seconds per connected client. Each session costs a PTY reader thread and a small -event thread. Output to a client is queued at most 32 chunks deep on each side of the socket. +event thread, plus its scrollback. Output to a client is queued at most 32 chunks deep on each +side of the socket. Measured on Linux x86_64 (release build): 8.8 MB resident at start, most of +it the binary's own pages, 11.5 MB with five idle shell sessions, and no CPU time at all over +15 idle seconds. Each password check briefly takes 19 MiB for Argon2, which goes back to the OS +afterwards. From 5fff7f493ef3c47c08175bdbd7d0c00094a5d559 Mon Sep 17 00:00:00 2001 From: ForeverInLaw <44206490+ForeverInLaw@users.noreply.github.com> Date: Fri, 4 Dec 2026 13:16:52 +0000 Subject: [PATCH 012/128] terminal: replay tabs without shifting the rest of their line --- crates/redshell-terminal/src/replay.rs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/crates/redshell-terminal/src/replay.rs b/crates/redshell-terminal/src/replay.rs index 79654ee..22751b3 100644 --- a/crates/redshell-terminal/src/replay.rs +++ b/crates/redshell-terminal/src/replay.rs @@ -136,13 +136,19 @@ struct Painter { } impl Painter { - fn cell(&mut self, cell: &Cell) { + /// Draws the cell at column `col` (0-based) of the current row. + fn cell(&mut self, cell: &Cell, col: usize) { let pen = Pen::of(cell); if pen != self.pen { pen.write(&mut self.out); self.pen = pen; } self.out.push(cell.c); + if cell.c == '\t' { + // A tab keeps '\t' in its first cell and jumps to the next stop; + // come back so the cells it skipped are drawn like any other. + let _ = write!(self.out, "\x1b[{}G", col + 2); + } if let Some(zerowidth) = cell.zerowidth() { self.out.extend(zerowidth); } @@ -189,7 +195,7 @@ pub(crate) fn build_replay(term: &Term, title: Option<&str>, scrollback: u for c in 0..end { let cell = &row[Column(c)]; if !is_spacer(cell) { - painter.cell(cell); + painter.cell(cell, c); } } if i + 1 < total && !wrapped { @@ -258,7 +264,7 @@ fn restore_cursor(painter: &mut Painter, term: &Term) { let row = &grid[line]; let col = if row[Column(last)].flags.contains(Flags::WIDE_CHAR_SPACER) { last - 1 } else { last }; let _ = write!(painter.out, "\x1b[{};{}H", line.0 + 1, col + 1); - painter.cell(&row[Column(col)]); + painter.cell(&row[Column(col)], col); } else { let _ = write!(painter.out, "\x1b[{};{}H", line.0 + 1, cursor.point.column.0 + 1); } @@ -365,7 +371,7 @@ mod tests { } bytes.extend(b"\x1b[1;4:3;38;5;202;48;2;10;20;30mfancy\x1b[0m \x1b[7;9mrev\x1b[0m\r\n"); bytes.extend("a long line that wraps across rows: 日本語 e\u{301} 0123456789\r\n".as_bytes()); - bytes.extend(b"\x1b[44m \x1b[0m trailing bg\r\n\x1b[32;1mpen left on "); + bytes.extend(b"\x1b[44m \x1b[0m trailing bg\r\na\tb\r\n\tindented\tx\r\n\x1b[32;1mpen left on "); round_trip(20, 6, &bytes, b"more\r\n\r\nand more text that wraps around\r\n"); } From bda926e858ee7661b75cb16cbba20c687b3d0989 Mon Sep 17 00:00:00 2001 From: ForeverInLaw <44206490+ForeverInLaw@users.noreply.github.com> Date: Fri, 4 Dec 2026 13:19:17 +0000 Subject: [PATCH 013/128] server: make a burst of sign-in guesses wait for the backoff --- crates/redshell-server/src/auth/mod.rs | 45 +++++++++++++++++++++-- crates/redshell-server/src/store/audit.rs | 2 - 2 files changed, 41 insertions(+), 6 deletions(-) diff --git a/crates/redshell-server/src/auth/mod.rs b/crates/redshell-server/src/auth/mod.rs index 4d1284d..7b220ab 100644 --- a/crates/redshell-server/src/auth/mod.rs +++ b/crates/redshell-server/src/auth/mod.rs @@ -86,11 +86,21 @@ pub struct Auth { setup: Mutex>, /// Where setup links point. base_url: String, + /// Password checks run one at a time: each takes 19 MiB, and a burst of + /// guesses must meet the backoff the previous guess earned. + password_checks: tokio::sync::Semaphore, } impl Auth { pub fn new(store: Arc, bus: Bus, base_url: String) -> Self { - Self { store, bus, limiter: Limiter::default(), setup: Mutex::new(None), base_url } + Self { + store, + bus, + limiter: Limiter::default(), + setup: Mutex::new(None), + base_url, + password_checks: tokio::sync::Semaphore::new(1), + } } pub fn setup_required(&self) -> anyhow::Result { @@ -120,6 +130,7 @@ impl Auth { /// Creates the first account with the code from the setup link. pub async fn setup(&self, req: SetupRequest, client: &Client) -> Result { + let _turn = self.password_checks.acquire().await.map_err(anyhow::Error::from)?; let ip_key = format!("ip:{}", client.ip); self.limiter.check(&ip_key, Instant::now()).map_err(AuthError::RateLimited)?; let valid = self @@ -129,7 +140,9 @@ impl Auth { .is_some_and(|s| s.expires > Instant::now() && secret::same_secret(&s.code, &req.code)); if !valid { self.limiter.failure(&ip_key, Instant::now()); - return Err(AuthError::Forbidden("the setup link is not valid; restart the server for a new one".into())); + return Err(AuthError::Forbidden( + "the setup link is not valid; open the newest one in the server log".into(), + )); } if !self.setup_required()? { return Err(AuthError::Conflict("setup is already done".into())); @@ -150,11 +163,13 @@ impl Auth { /// Password sign-in. Unknown users and wrong passwords fail alike, in /// time too; repeated failures are throttled per IP and per name. pub async fn sign_in(&self, req: SignInRequest, client: &Client) -> Result { + let _turn = self.password_checks.acquire().await.map_err(anyhow::Error::from)?; let now = Instant::now(); let keys = [format!("ip:{}", client.ip), format!("user:{}", req.username.to_lowercase())]; for key in &keys { if let Err(wait) = self.limiter.check(key, now) { - self.store.audit(AuditEvent::SignInThrottled, None, Some(&req.username), Some(&client.ip), key); + // Logged, not audited: throttled attempts are free to make. + log::warn!("sign-in as {:?} from {} throttled ({key})", req.username, client.ip); return Err(AuthError::RateLimited(wait)); } } @@ -257,6 +272,7 @@ impl Auth { req: ChangePasswordRequest, client: &Client, ) -> Result<(), AuthError> { + let _turn = self.password_checks.acquire().await.map_err(anyhow::Error::from)?; let user = &principal.user; let key = format!("user:{}", user.username.to_lowercase()); self.limiter.check(&key, Instant::now()).map_err(AuthError::RateLimited)?; @@ -359,7 +375,28 @@ mod tests { assert!(matches!(auth.sign_in(attempt("ghost"), &elsewhere).await, Err(AuthError::InvalidCredentials))); let events = auth.store.audit_events(); assert_eq!(events.iter().filter(|(e, _)| e == "sign_in_failed").count(), 4); - assert!(events.iter().any(|(e, _)| e == "sign_in_throttled")); + } + + #[tokio::test] + async fn a_burst_of_guesses_meets_the_backoff() { + let auth = Arc::new(auth()); + auth.store.create_user("me", &password::hash("long password".into()).await.unwrap()).unwrap(); + let guesses = (0..8).map(|i| { + let auth = auth.clone(); + tokio::spawn(async move { + let req = SignInRequest { username: "me".into(), password: format!("guess {i}"), device_name: None }; + auth.sign_in(req, &client()).await + }) + }); + let mut wrong = 0; + for guess in guesses { + match guess.await.unwrap() { + Err(AuthError::InvalidCredentials) => wrong += 1, + Err(AuthError::RateLimited(_)) => {} + other => panic!("{:?}", other.map(|s| s.user)), + } + } + assert_eq!(wrong, 3, "only the free attempts are checked"); } #[tokio::test] diff --git a/crates/redshell-server/src/store/audit.rs b/crates/redshell-server/src/store/audit.rs index defb5a6..d0e13a8 100644 --- a/crates/redshell-server/src/store/audit.rs +++ b/crates/redshell-server/src/store/audit.rs @@ -13,7 +13,6 @@ pub enum AuditEvent { Setup, SignIn, SignInFailed, - SignInThrottled, SignOut, PasswordChanged, PasswordChangeFailed, @@ -29,7 +28,6 @@ impl AuditEvent { Self::Setup => "setup", Self::SignIn => "sign_in", Self::SignInFailed => "sign_in_failed", - Self::SignInThrottled => "sign_in_throttled", Self::SignOut => "sign_out", Self::PasswordChanged => "password_changed", Self::PasswordChangeFailed => "password_change_failed", From e493b661ef8a0c62d16343c773231714b3e9ddf0 Mon Sep 17 00:00:00 2001 From: ForeverInLaw <44206490+ForeverInLaw@users.noreply.github.com> Date: Fri, 4 Dec 2026 13:19:17 +0000 Subject: [PATCH 014/128] server: close WebSockets whose sign-in ended outside the server --- .../redshell-server/src/store/credentials.rs | 19 +++++++++++++++++++ crates/redshell-server/src/web/ws.rs | 13 +++++++++++++ 2 files changed, 32 insertions(+) diff --git a/crates/redshell-server/src/store/credentials.rs b/crates/redshell-server/src/store/credentials.rs index 88ea278..257103a 100644 --- a/crates/redshell-server/src/store/credentials.rs +++ b/crates/redshell-server/src/store/credentials.rs @@ -150,6 +150,22 @@ impl Store { }) } + /// Whether `credential` still signs `user_id` in (not revoked, not expired). + pub fn credential_live(&self, user_id: i64, credential: Credential) -> anyhow::Result { + let sql = format!("SELECT COUNT(*) FROM {} WHERE id = ?1 AND user_id = ?2", credential.table()); + let (sql, now) = match credential { + Credential::Browser(_) => (sql + " AND expires_at > ?3", Some(now_ms())), + Credential::Device(_) => (sql, None), + }; + self.with(|c| { + let count: i64 = match now { + Some(now) => c.query_row(&sql, params![credential.id(), user_id, now], |r| r.get(0))?, + None => c.query_row(&sql, params![credential.id(), user_id], |r| r.get(0))?, + }; + Ok(count == 1) + }) + } + /// Signs `user_id` out of one credential; `false` when it is not theirs. pub fn revoke(&self, user_id: i64, credential: Credential) -> anyhow::Result { self.with(|c| { @@ -195,9 +211,12 @@ mod tests { store.touch(browser, "5.6.7.8", Some(now_ms() + 120_000)).unwrap(); assert_eq!(store.browser_sessions(user.id).unwrap()[0].last_ip.as_deref(), Some("5.6.7.8")); + assert!(store.credential_live(user.id, device).unwrap()); + assert!(!store.credential_live(user.id + 1, device).unwrap()); assert!(!store.revoke(user.id + 1, device).unwrap(), "only the owner revokes"); store.revoke_all_except(user.id, Some(device)).unwrap(); assert!(store.find_token(false, b"b").unwrap().is_none()); + assert!(!store.credential_live(user.id, browser).unwrap()); assert!(store.revoke(user.id, device).unwrap()); assert!(store.devices(user.id).unwrap().is_empty()); } diff --git a/crates/redshell-server/src/web/ws.rs b/crates/redshell-server/src/web/ws.rs index bde3a9d..076260f 100644 --- a/crates/redshell-server/src/web/ws.rs +++ b/crates/redshell-server/src/web/ws.rs @@ -108,6 +108,11 @@ impl Connection { Err(broadcast::error::RecvError::Closed) => break, }, _ = ping.tick() => { + // Also catches sign-outs from elsewhere: the `user` CLI, an expired cookie. + if !this.still_signed_in() { + this.close().await; + break; + } let _ = this.out.send(Message::Ping(Default::default())).await; } } @@ -248,6 +253,14 @@ impl Connection { } } + fn still_signed_in(&self) -> bool { + let principal = &self.principal; + self.app.store.credential_live(principal.user.id, principal.credential).unwrap_or_else(|err| { + log::error!("checking a sign-in: {err:#}"); + true + }) + } + async fn close(&self) -> bool { let frame = CloseFrame { code: 4001, reason: "signed out".into() }; let _ = self.out.send(Message::Close(Some(frame))).await; From 0f627816a5e0e3962096f78f15f912fc0e6cf477 Mon Sep 17 00:00:00 2001 From: ForeverInLaw <44206490+ForeverInLaw@users.noreply.github.com> Date: Fri, 4 Dec 2026 13:19:17 +0000 Subject: [PATCH 015/128] server: keep finished agents finished and debounce title updates --- crates/redshell-server/src/agents/claude.rs | 15 +++++--- crates/redshell-server/src/agents/hooks.rs | 3 ++ .../redshell-server/src/sessions/session.rs | 37 ++++++++++++------- 3 files changed, 36 insertions(+), 19 deletions(-) diff --git a/crates/redshell-server/src/agents/claude.rs b/crates/redshell-server/src/agents/claude.rs index cbd8ff3..17003a9 100644 --- a/crates/redshell-server/src/agents/claude.rs +++ b/crates/redshell-server/src/agents/claude.rs @@ -75,9 +75,10 @@ impl HookInput { "PostToolUse" | "PostToolUseFailure" | "UserPromptSubmit" => Effect::MovedOn(Some(AgentState::Working)), "Stop" => Effect::Finished(self.last_assistant_message.clone()), "Notification" => match self.notification_type.as_deref() { - // Already shown as an approval. - Some("permission_prompt") => Effect::Nothing, - Some("idle_prompt" | "elicitation_dialog" | "elicitation_url_dialog" | "agent_needs_input") => { + // Already shown as an approval; and a minute after a finished + // turn, which Stop reported. + Some("permission_prompt" | "idle_prompt") => Effect::Nothing, + Some("elicitation_dialog" | "elicitation_url_dialog" | "agent_needs_input") => { Effect::NeedsInput(self.message.clone()) } _ => Effect::Notify { title: self.title.clone(), body: self.message.clone() }, @@ -174,11 +175,15 @@ mod tests { effect(json!({"hook_event_name": "Notification", "notification_type": "permission_prompt"})), Effect::Nothing ); + assert_eq!( + effect(json!({"hook_event_name": "Notification", "notification_type": "idle_prompt"})), + Effect::Nothing + ); assert_eq!( effect( - json!({"hook_event_name": "Notification", "notification_type": "idle_prompt", "message": "Waiting"}) + json!({"hook_event_name": "Notification", "notification_type": "elicitation_dialog", "message": "Pick"}) ), - Effect::NeedsInput(Some("Waiting".into())) + Effect::NeedsInput(Some("Pick".into())) ); } diff --git a/crates/redshell-server/src/agents/hooks.rs b/crates/redshell-server/src/agents/hooks.rs index 840063f..07b0353 100644 --- a/crates/redshell-server/src/agents/hooks.rs +++ b/crates/redshell-server/src/agents/hooks.rs @@ -7,6 +7,7 @@ use std::sync::Arc; use axum::Json; use axum::Router; +use axum::extract::DefaultBodyLimit; use axum::extract::{Path, State}; use axum::http::StatusCode; use axum::response::{IntoResponse, Response}; @@ -25,6 +26,8 @@ pub fn router(sessions: Arc) -> Router { Router::new() .route("/claude/{session}/{token}", post(claude_hook)) .route("/codex/{session}/{token}", post(codex_hook)) + // PostToolUse carries the tool's whole response. + .layer(DefaultBodyLimit::max(32 << 20)) .with_state(sessions) } diff --git a/crates/redshell-server/src/sessions/session.rs b/crates/redshell-server/src/sessions/session.rs index ec74dfb..3ce9e91 100644 --- a/crates/redshell-server/src/sessions/session.rs +++ b/crates/redshell-server/src/sessions/session.rs @@ -54,7 +54,21 @@ struct State { /// When output last came, and whether a list update for it is scheduled. struct Activity { at: AtomicI64, - flush_pending: AtomicBool, + flush_pending: Arc, +} + +impl Activity { + /// Sends a session list update in a moment, unless one is on its way. + fn schedule_update(&self, ctx: &Ctx, session: &str) { + if !self.flush_pending.swap(true, Ordering::AcqRel) { + let (pending, bus, id) = (self.flush_pending.clone(), ctx.bus.clone(), session.to_owned()); + ctx.runtime.spawn(async move { + tokio::time::sleep(ACTIVITY_DEBOUNCE).await; + pending.store(false, Ordering::Release); + bus.send(BusEvent::SessionChanged(id)); + }); + } + } } pub struct Session { @@ -81,7 +95,7 @@ impl Session { ) -> anyhow::Result> { let hub = Arc::new(OutputHub::new()); let now = now_ms(); - let activity = Arc::new(Activity { at: AtomicI64::new(now), flush_pending: AtomicBool::new(false) }); + let activity = Arc::new(Activity { at: AtomicI64::new(now), flush_pending: Arc::new(AtomicBool::new(false)) }); let tap = Tap { session: id.clone(), hub: hub.clone(), @@ -207,8 +221,9 @@ impl Session { } self.resize(cols, rows); self.activity.at.store(now_ms(), Ordering::Relaxed); - if submits { - // Agents without a prompt hook (Codex) go back to work when the user sends a line. + if submits && self.launch.agent.as_deref() != Some("claude") { + // Agents without a prompt hook (Codex) go back to work when the user sends a line; + // Claude Code says so itself (UserPromptSubmit). self.update_agent(|state, _| { matches!(state, Some(AgentState::Finished | AgentState::NeedsInput | AgentState::Idle)) .then_some((AgentState::Working, None)) @@ -292,13 +307,14 @@ impl Session { fn on_event(&self, event: TerminalEvent) { match event { TerminalEvent::Wakeup => self.terminal.ack_wakeup(), + // Agents animate their titles: list updates for them are debounced like output. TerminalEvent::Title(title) => { self.state.lock().title = Some(truncate(&title, 200)); - self.changed(); + self.activity.schedule_update(&self.ctx, &self.id); } TerminalEvent::ResetTitle => { self.state.lock().title = None; - self.changed(); + self.activity.schedule_update(&self.ctx, &self.id); } TerminalEvent::Cwd(cwd) => { self.state.lock().cwd = Some(cwd); @@ -369,14 +385,7 @@ impl SessionObserver for Tap { self.offset += bytes.len() as u64; self.hub.publish(Feed::Output { end: self.offset, bytes: Arc::from(bytes) }); self.activity.at.store(now_ms(), Ordering::Relaxed); - if !self.activity.flush_pending.swap(true, Ordering::AcqRel) { - let (activity, bus, id) = (self.activity.clone(), self.ctx.bus.clone(), self.session.clone()); - self.ctx.runtime.spawn(async move { - tokio::time::sleep(ACTIVITY_DEBOUNCE).await; - activity.flush_pending.store(false, Ordering::Release); - bus.send(BusEvent::SessionChanged(id)); - }); - } + self.activity.schedule_update(&self.ctx, &self.session); } fn on_bell(&mut self) { From 561813850647332f1c2cccade6d9593c85f359a0 Mon Sep 17 00:00:00 2001 From: ForeverInLaw <44206490+ForeverInLaw@users.noreply.github.com> Date: Fri, 4 Dec 2026 13:19:17 +0000 Subject: [PATCH 016/128] server: test folder listings and the hook codex command --- crates/redshell-server/tests/server.rs | 32 +++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/crates/redshell-server/tests/server.rs b/crates/redshell-server/tests/server.rs index 2c25d83..6406681 100644 --- a/crates/redshell-server/tests/server.rs +++ b/crates/redshell-server/tests/server.rs @@ -266,6 +266,25 @@ async fn static_pages_carry_security_headers() { assert_eq!(api.json::().await.unwrap()["code"], "not_found"); } +#[tokio::test] +async fn folders_list_subfolders_only() { + let h = Harness::start("").await; + h.setup().await; + let token = h.device_token().await; + let root = tempfile::tempdir().unwrap(); + for folder in ["b", "A"] { + std::fs::create_dir(root.path().join(folder)).unwrap(); + } + std::fs::write(root.path().join("file.txt"), "x").unwrap(); + let list = |path: String| h.http.get(h.url("/api/fs/folders")).query(&[("path", path)]).bearer_auth(&token).send(); + let listing: Value = list(root.path().display().to_string()).await.unwrap().json().await.unwrap(); + assert_eq!(listing["folders"], json!(["A", "b"])); + assert_eq!(listing["truncated"], false); + assert_eq!(list("relative".into()).await.unwrap().status(), StatusCode::BAD_REQUEST); + let missing = root.path().join("missing").display().to_string(); + assert_eq!(list(missing).await.unwrap().status(), StatusCode::BAD_REQUEST); +} + #[cfg(unix)] #[tokio::test] async fn sessions_stream_to_late_joiners_and_follow_the_typist() { @@ -544,7 +563,18 @@ async fn codex_turns_finish_through_notify() { assert!(url.starts_with(&format!("http://{}/codex/{}/", h.server.hook_addr, session.id))); let payload = json!({"type": "agent-turn-complete", "last-assistant-message": "Patched it.", "thread-id": "t"}); - redshell_server::post_notify(url, payload.to_string()).await.unwrap(); + // As Codex runs it: the notify program with the payload appended. + let (url, payload) = (url.to_owned(), payload.to_string()); + let status = tokio::task::spawn_blocking(move || { + std::process::Command::new(env!("CARGO_BIN_EXE_redshell-server")) + .args(["hook", "codex", &payload]) + .env(redshell_server::HOOK_URL_ENV, url) + .status() + .unwrap() + }) + .await + .unwrap(); + assert!(status.success()); let list: Vec = h.http.get(h.url("/api/sessions")).bearer_auth(&token).send().await.unwrap().json().await.unwrap(); assert_eq!(list[0].agent_state, Some(redshell_protocol::AgentState::Finished)); From b86d09c5a74014cb7033b4bb0d41bf176e549e83 Mon Sep 17 00:00:00 2001 From: ForeverInLaw <44206490+ForeverInLaw@users.noreply.github.com> Date: Fri, 4 Dec 2026 13:19:17 +0000 Subject: [PATCH 017/128] docs: correct how setup links renew and when CLI sign-outs apply --- docs/ARCHITECTURE.md | 3 ++- docs/REMOTE.md | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md index 11f060c..39b7b55 100644 --- a/docs/ARCHITECTURE.md +++ b/docs/ARCHITECTURE.md @@ -20,7 +20,8 @@ redshell-server ──► axum, tokio, rustls (ring), rusqlite, argon2 ``` `redshell-server` and `redshell-protocol` do not depend on GPUI either; the server is a separate -binary that builds for a Raspberry Pi with no C toolchain beyond SQLite's. +binary with no OpenSSL, which cross-builds for a Raspberry Pi with the C compiler SQLite and ring +need. ## Key abstractions diff --git a/docs/REMOTE.md b/docs/REMOTE.md index d62882f..0fcf929 100644 --- a/docs/REMOTE.md +++ b/docs/REMOTE.md @@ -28,8 +28,9 @@ No account exists yet. Create the first one within 30 minutes at: https://box.tailnet.ts.net/setup?code=… ``` -Open it, choose a name and a password, and that browser is signed in. Restart the server for a -new link, or create the account from a shell instead with `redshell-server user add `. +Open it, choose a name and a password, and that browser is signed in. Once a link has expired, +the server logs a new one the next time the app asks whether setup is needed. You can also +create the account from a shell with `redshell-server user add `. Everything the server keeps lives in its config directory (`--config `, or `REDSHELL_SERVER_CONFIG`, default `~/.config/redshell-server`), which it makes private (0700): @@ -201,7 +202,8 @@ question prompts), `finished` (with the last message). - Browsers get a `__Host-redshell-session` cookie (HttpOnly, Secure, SameSite=Strict) that lasts 30 days from its last use. Other clients get a named bearer device token. Both are listed under the account and can be revoked; revoking one, signing out and changing the - password (which signs out everything else) close its open WebSockets. + password (which signs out everything else) close its open WebSockets at once. Changes made + with the `user` command, and a cookie that expires, close them within 30 seconds. - A state-changing request and the WebSocket upgrade are refused when they carry an `Origin` other than `public_url` or the host they were sent to (`https`, or `http` when the server has no TLS of its own), and when a cookie comes without any `Origin`. Clients that are not From f4697156c16e4c67462ec9d67f0f01738d3cafc1 Mon Sep 17 00:00:00 2001 From: ForeverInLaw <44206490+ForeverInLaw@users.noreply.github.com> Date: Fri, 4 Dec 2026 13:30:12 +0000 Subject: [PATCH 018/128] packaging: a per-user systemd unit and a .deb for redshell-server --- packaging/server/redshell-server@.service | 24 +++++++++ scripts/package-server-deb.sh | 62 +++++++++++++++++++++++ 2 files changed, 86 insertions(+) create mode 100644 packaging/server/redshell-server@.service create mode 100755 scripts/package-server-deb.sh diff --git a/packaging/server/redshell-server@.service b/packaging/server/redshell-server@.service new file mode 100644 index 0000000..9468564 --- /dev/null +++ b/packaging/server/redshell-server@.service @@ -0,0 +1,24 @@ +# RedShell Server for one user: sessions run as that user, with their home, +# shells, SSH keys and agent sign-ins. Enable it for a user with +# sudo systemctl enable --now redshell-server@pi +# State lives in ~/.config/redshell-server of that user. +[Unit] +Description=RedShell Server for %i +Documentation=https://github.com/redstone-md/RedShell/blob/main/docs/REMOTE.md +After=network-online.target +Wants=network-online.target + +[Service] +Type=simple +User=%i +WorkingDirectory=~ +ExecStart=/usr/bin/redshell-server serve +Restart=on-failure +RestartSec=3 +# Sessions are the user's own shells and agents, so the service is not +# sandboxed further: it must see the user's files like a login would. +KillMode=mixed +TimeoutStopSec=10 + +[Install] +WantedBy=multi-user.target diff --git a/scripts/package-server-deb.sh b/scripts/package-server-deb.sh new file mode 100755 index 0000000..5b5e711 --- /dev/null +++ b/scripts/package-server-deb.sh @@ -0,0 +1,62 @@ +#!/usr/bin/env bash +# Builds the redshell-server .deb from an already built binary: +# scripts/package-server-deb.sh +# It installs /usr/bin/redshell-server, the per-user systemd unit +# redshell-server@.service and the docs. Nothing starts by itself: the +# server is enabled per user with `systemctl enable --now redshell-server@`. +set -euo pipefail + +if [ $# -ne 4 ]; then + echo "usage: $0 " >&2 + exit 2 +fi +binary=$1 version=$2 arch=$3 out=$4 +root=$(cd "$(dirname "$0")/.." && pwd) +stage=$(mktemp -d) +chmod 755 "$stage" +trap 'rm -rf "$stage"' EXIT + +install -Dm755 "$binary" "$stage/usr/bin/redshell-server" +install -Dm644 "$root/packaging/server/redshell-server@.service" "$stage/lib/systemd/system/redshell-server@.service" +install -Dm644 "$root/docs/REMOTE.md" "$stage/usr/share/doc/redshell-server/REMOTE.md" +install -Dm644 "$root/LICENSE" "$stage/usr/share/doc/redshell-server/copyright" + +mkdir -p "$stage/DEBIAN" +cat > "$stage/DEBIAN/control" < +Homepage: https://github.com/redstone-md/RedShell +Section: net +Priority: optional +Depends: libc6 (>= 2.35) +Installed-Size: $(du -sk "$stage/usr" "$stage/lib" | awk '{s += $1} END {print s}') +Description: Headless RedShell: terminal and agent sessions for the desktop and phones + redshell-server keeps shells, coding agents and SSH sessions running on an + always-on machine. The RedShell desktop attaches to them, and phones use the + RedShell Remote web app it serves. Enable it per user with + systemctl enable --now redshell-server@USER. +CONTROL +cat > "$stage/DEBIAN/postinst" <<'POSTINST' +#!/bin/sh +set -e +if [ "$1" = configure ] && [ -d /run/systemd/system ]; then + systemctl daemon-reload >/dev/null 2>&1 || true + # Restart the instances that were running, so an upgrade takes effect. + for unit in $(systemctl list-units --plain --no-legend 'redshell-server@*.service' 2>/dev/null | awk '{print $1}'); do + systemctl try-restart "$unit" >/dev/null 2>&1 || true + done +fi +POSTINST +cat > "$stage/DEBIAN/postrm" <<'POSTRM' +#!/bin/sh +set -e +if [ -d /run/systemd/system ]; then + systemctl daemon-reload >/dev/null 2>&1 || true +fi +POSTRM +chmod 755 "$stage/DEBIAN/postinst" "$stage/DEBIAN/postrm" + +dpkg-deb --root-owner-group --build "$stage" "$out" >/dev/null +echo "$out" From a2af02295abfab04dfca855cdf9b37fdd2b46d19 Mon Sep 17 00:00:00 2001 From: ForeverInLaw <44206490+ForeverInLaw@users.noreply.github.com> Date: Fri, 4 Dec 2026 13:30:12 +0000 Subject: [PATCH 019/128] release: build redshell-server with the PWA for linux x86_64, aarch64 and macos --- .github/workflows/release.yml | 93 ++++++++++++++++++++++++++++++++++- 1 file changed, 92 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4fe43f4..5f0b988 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -247,8 +247,99 @@ jobs: name: ${{ matrix.name }} path: dist/* + server: + # redshell-server with the RedShell Remote PWA embedded: a tarball everywhere and a .deb + # (with the per-user systemd unit) on Linux. The aarch64 build is the one for a Raspberry Pi + # (64-bit Raspberry Pi OS). Linux builds run on 22.04 so the binaries need glibc 2.35. + needs: version + name: server (${{ matrix.name }}) + permissions: + contents: read + strategy: + fail-fast: false + matrix: + include: + - name: linux-x86_64 + os: ubuntu-22.04 + targets: x86_64-unknown-linux-gnu + deb-arch: amd64 + - name: linux-aarch64 + os: ubuntu-22.04-arm + targets: aarch64-unknown-linux-gnu + deb-arch: arm64 + - name: macos-universal + os: macos-15-intel + targets: aarch64-apple-darwin x86_64-apple-darwin + runs-on: ${{ matrix.os }} + env: + TARGETS: ${{ matrix.targets }} + BASE_NAME: redshell-server-${{ github.event.inputs.tag || github.ref_name }}-${{ matrix.name }} + steps: + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 + - uses: actions/setup-node@8fccf151e3ba8038c300f83b40c8fd1e94f9c5ce # v7.2.0 + with: + node-version: 24 + cache: npm + cache-dependency-path: web/package-lock.json + - name: Build the PWA + working-directory: web + run: | + npm ci + npm run build + test -f dist/index.html + - name: Rust toolchain (from rust-toolchain.toml) + shell: bash + run: | + rustup toolchain install || rustup show + rustup target add $TARGETS + - uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3 + with: + key: server-${{ matrix.name }} + - name: Build + shell: bash + run: | + set -euo pipefail + for target in $TARGETS; do + cargo build --release --locked --target "$target" -p redshell-server + done + mkdir -p out + set -- $TARGETS + if [ $# -gt 1 ]; then + lipo -create $(printf 'target/%s/release/redshell-server ' "$@") -output out/redshell-server + lipo -info out/redshell-server + else + cp "target/$1/release/redshell-server" out/redshell-server + fi + # The PWA must be in the binary, not the placeholder page. + if ! grep -q "manifest.webmanifest" out/redshell-server; then + echo "::error::the PWA was not embedded" + exit 1 + fi + out/redshell-server --version + - name: Package + shell: bash + run: | + set -euo pipefail + mkdir -p dist "$BASE_NAME" + cp out/redshell-server README.md LICENSE CHANGELOG.md docs/REMOTE.md "$BASE_NAME/" + cp "packaging/server/redshell-server@.service" "$BASE_NAME/" + tar -czf "dist/$BASE_NAME.tar.gz" "$BASE_NAME" + if [ -n "${{ matrix.deb-arch }}" ]; then + scripts/package-server-deb.sh out/redshell-server "${TAG#v}" "${{ matrix.deb-arch }}" "dist/$BASE_NAME.deb" + dpkg-deb -I "dist/$BASE_NAME.deb" | head -5 + fi + cd dist + for file in *; do + if command -v sha256sum >/dev/null; then sha256sum "$file"; else shasum -a 256 "$file"; fi > "$file.sha256" + done + ls -la + - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + with: + name: server-${{ matrix.name }} + path: dist/* + publish: - needs: [version, build] + needs: [version, build, server] permissions: contents: write # Publish whatever built, so one stuck runner doesn't block a release; re-run From c92a74d305fa515dbffdff16e136f71664a1901a Mon Sep 17 00:00:00 2001 From: ForeverInLaw <44206490+ForeverInLaw@users.noreply.github.com> Date: Fri, 4 Dec 2026 13:30:12 +0000 Subject: [PATCH 020/128] ci: test the server on arm64, check the PWA, and run clippy on windows --- .github/workflows/ci.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b065b11..d512455 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,3 +43,36 @@ jobs: - if: runner.os == 'Linux' uses: ./.github/actions/linux-deps - run: cargo test --workspace --locked + # The lint job runs on Linux; Windows-only code needs its own pass. + - if: runner.os == 'Windows' + run: cargo clippy --workspace --all-targets --locked -- -D warnings + + server-arm64: + # The server's crates on the architecture of a Raspberry Pi. + name: test (server, linux arm64) + runs-on: ubuntu-22.04-arm + steps: + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 + - name: Rust toolchain (from rust-toolchain.toml) + run: rustup toolchain install || rustup show + - uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3 + - run: cargo test --locked -p redshell-server -p redshell-protocol -p redshell-terminal -p redshell-remote -p redshell-core + + web: + name: web (typecheck, lint, test, build) + runs-on: ubuntu-latest + defaults: + run: + working-directory: web + steps: + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 + - uses: actions/setup-node@8fccf151e3ba8038c300f83b40c8fd1e94f9c5ce # v7.2.0 + with: + node-version: 24 + cache: npm + cache-dependency-path: web/package-lock.json + - run: npm ci + - run: npm run typecheck + - run: npm run lint + - run: npm test + - run: npm run build From 4e8608146b41877fece209af35cd8a96c3f6085b Mon Sep 17 00:00:00 2001 From: ForeverInLaw <44206490+ForeverInLaw@users.noreply.github.com> Date: Fri, 4 Dec 2026 13:35:23 +0000 Subject: [PATCH 021/128] web: scaffold RedShell Remote with Vite, React and Tailwind The PWA lives in web/: Vite 8, React 19, strict TypeScript, Tailwind v4 driven by the theme's CSS variables, and an ESLint flat config. `npm run build` writes web/dist for the server to embed. styles/tokens.css adds the PWA tokens of the visual contract on top of crates/redshell-theme/themes/redshell.css: field borders, the solid red, state, attention and diff colours, scrims, elevation and motion, light and dark. JetBrains Mono is self-hosted (Latin, box drawing, blocks and arrows, about 46 KB per weight) with its OFL licence, and an external theme-init.js keeps the dark-first page from flashing light. --- .gitignore | 3 + web/.gitignore | 1 + web/eslint.config.js | 30 + web/index.html | 50 + web/package-lock.json | 9171 ++++++++++++++++++ web/package.json | 54 + web/public/fonts/JetBrainsMono-Bold.woff2 | Bin 0 -> 47788 bytes web/public/fonts/JetBrainsMono-Regular.woff2 | Bin 0 -> 46272 bytes web/public/fonts/OFL.txt | 93 + web/public/theme-init.js | 16 + web/src/styles/app.css | 320 + web/src/styles/tokens.css | 95 + web/tsconfig.app.json | 11 + web/tsconfig.base.json | 19 + web/tsconfig.json | 8 + web/tsconfig.node.json | 9 + web/tsconfig.sw.json | 9 + web/vite.config.ts | 59 + 18 files changed, 9948 insertions(+) create mode 100644 web/.gitignore create mode 100644 web/eslint.config.js create mode 100644 web/index.html create mode 100644 web/package-lock.json create mode 100644 web/package.json create mode 100644 web/public/fonts/JetBrainsMono-Bold.woff2 create mode 100644 web/public/fonts/JetBrainsMono-Regular.woff2 create mode 100644 web/public/fonts/OFL.txt create mode 100644 web/public/theme-init.js create mode 100644 web/src/styles/app.css create mode 100644 web/src/styles/tokens.css create mode 100644 web/tsconfig.app.json create mode 100644 web/tsconfig.base.json create mode 100644 web/tsconfig.json create mode 100644 web/tsconfig.node.json create mode 100644 web/tsconfig.sw.json create mode 100644 web/vite.config.ts diff --git a/.gitignore b/.gitignore index bd003ec..9ae4076 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,6 @@ target/ *.db *.db-journal .DS_Store +web/node_modules +web/dist +web/dev-dist diff --git a/web/.gitignore b/web/.gitignore new file mode 100644 index 0000000..20bba07 --- /dev/null +++ b/web/.gitignore @@ -0,0 +1 @@ +/shots diff --git a/web/eslint.config.js b/web/eslint.config.js new file mode 100644 index 0000000..9a5ba6d --- /dev/null +++ b/web/eslint.config.js @@ -0,0 +1,30 @@ +import js from "@eslint/js"; +import reactHooks from "eslint-plugin-react-hooks"; +import reactRefresh from "eslint-plugin-react-refresh"; +import globals from "globals"; +import tseslint from "typescript-eslint"; + +export default tseslint.config( + // src/protocol is generated by redshell-protocol's tests. + { ignores: ["dist", "dev-dist", "src/protocol", "eslint.config.js"] }, + { + files: ["**/*.{ts,tsx}"], + extends: [js.configs.recommended, ...tseslint.configs.strictTypeChecked], + languageOptions: { + ecmaVersion: 2022, + globals: { ...globals.browser }, + parserOptions: { projectService: true, tsconfigRootDir: import.meta.dirname }, + }, + plugins: { "react-hooks": reactHooks, "react-refresh": reactRefresh }, + rules: { + ...reactHooks.configs.recommended.rules, + "react-refresh/only-export-components": ["warn", { allowConstantExport: true }], + "@typescript-eslint/restrict-template-expressions": ["error", { allowNumber: true }], + "@typescript-eslint/no-confusing-void-expression": ["error", { ignoreArrowShorthand: true }], + }, + }, + { + files: ["scripts/**", "*.config.ts"], + languageOptions: { globals: { ...globals.node } }, + }, +); diff --git a/web/index.html b/web/index.html new file mode 100644 index 0000000..a03948f --- /dev/null +++ b/web/index.html @@ -0,0 +1,50 @@ + + + + + + RedShell + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + diff --git a/web/package-lock.json b/web/package-lock.json new file mode 100644 index 0000000..9ad8bda --- /dev/null +++ b/web/package-lock.json @@ -0,0 +1,9171 @@ +{ + "name": "redshell-remote", + "version": "0.0.3", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "redshell-remote", + "version": "0.0.3", + "dependencies": { + "@simplewebauthn/browser": "^14.0.0", + "@tanstack/react-query": "^5.108.4", + "@xterm/addon-fit": "^0.11.0", + "@xterm/addon-unicode11": "^0.9.0", + "@xterm/addon-web-links": "^0.12.0", + "@xterm/addon-webgl": "^0.19.0", + "@xterm/xterm": "^6.0.0", + "lucide-react": "^1.87.0", + "react": "^19.3.1", + "react-dom": "^19.3.1", + "react-router": "^8.5.3", + "zustand": "^5.1.0" + }, + "devDependencies": { + "@eslint/js": "^10.0.1", + "@tailwindcss/vite": "^4.3.5", + "@types/node": "^26.6.11", + "@types/react": "^19.3.3", + "@types/react-dom": "^19.3.0", + "@vite-pwa/assets-generator": "^2.0.0", + "@vitejs/plugin-react": "^6.3.1", + "eslint": "^10.16.0", + "eslint-plugin-react-hooks": "^7.1.1", + "eslint-plugin-react-refresh": "^0.5.8", + "globals": "^17.15.0", + "playwright-core": "^1.65.2", + "tailwindcss": "^4.3.5", + "typescript": "~6.0.3", + "typescript-eslint": "^8.74.0", + "vite": "^8.4.1", + "vite-plugin-pwa": "^2.0.0", + "vitest": "^5.1.2", + "workbox-build": "^7.4.1", + "workbox-precaching": "^7.4.1", + "workbox-routing": "^7.4.1", + "workbox-window": "^7.4.1" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.17.tgz", + "integrity": "sha512-IdlVpcDeoDATtN2cfmnVk0A4XJKhu7SlpGuSaiOFdko09YC1MD07WokWUSEdw5R2o4o8VObX2LzViQW6VXnzkA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.29.17", + "js-tokens": "^4.0.0", + "picocolors": "^1.1.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/compat-data": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.29.17.tgz", + "integrity": "sha512-pC/HCNB1loXYCLB9S7FDieWKJiXH8LJTUGFvVAm+7hWUKBjL07EcvVITNH9KlXdS/TTSbChZHZCYx/yag6LbRw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.29.17.tgz", + "integrity": "sha512-dP4g0UpATLviwEEb46bBaeL5MyW3q7LwqGoaQJvjXGS8tdpxckLtDTI9FBwA5ioVHnYoR2nRqCf1BmlMwbZV5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.29.17", + "@babel/generator": "^7.29.17", + "@babel/helper-compilation-targets": "^7.29.17", + "@babel/helper-module-transforms": "^7.29.17", + "@babel/helpers": "^7.29.17", + "@babel/parser": "^7.29.17", + "@babel/template": "^7.29.17", + "@babel/traverse": "^7.29.17", + "@babel/types": "^7.29.17", + "@jridgewell/remapping": "^2.3.5", + "convert-source-map": "^2.0.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@babel/generator": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.29.17.tgz", + "integrity": "sha512-xjNUVINWex7s4U0vESYwa8ChCBnmvhCQ6nkAdnhM8WYPlhXvU9D9fPurOSYQLV4FwcNXacDkN/MWIPNHsTI2OA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.29.17", + "@babel/types": "^7.29.17", + "@jridgewell/gen-mapping": "^0.3.12", + "@jridgewell/trace-mapping": "^0.3.28", + "jsesc": "^3.0.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-annotate-as-pure": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.29.17.tgz", + "integrity": "sha512-fvR+p3NNtZADSaekH7R5hVcv8uv0kDCXWlro7XVlH867QOLHs+u1e6NVcmCX7TUJNL9nqIVwNcz0Um3Glo0niQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.29.17" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.29.17.tgz", + "integrity": "sha512-6uFqkZstBw0lSRaEr/7HNuqURHubX4BvnN0FbbIBNFa5/nUcKLp5AFubCcUlbik9mI/Ztsz3mdjjpqoF3dVqrA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/compat-data": "^7.29.17", + "@babel/helper-validator-option": "^7.29.17", + "browserslist": "^4.24.0", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-create-class-features-plugin": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.29.17.tgz", + "integrity": "sha512-wN402n5bTKhdw+DY0VgE+RU7evPzrLgiFpW10yo0Zo24cuPLGmgPVSWojfcAlXs8FkztWde8q+8poku1zACEnw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.29.17", + "@babel/helper-member-expression-to-functions": "^7.29.17", + "@babel/helper-optimise-call-expression": "^7.29.17", + "@babel/helper-replace-supers": "^7.29.17", + "@babel/helper-skip-transparent-expression-wrappers": "^7.29.17", + "@babel/traverse": "^7.29.17", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-create-regexp-features-plugin": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.29.17.tgz", + "integrity": "sha512-SjOQHRXd37vQXhvtfmWO84qZvqZtr193/5Lq2s+4rMuoXylhwt1WYylTaeI4x9Oy5NTVKWCMvN+KrtOf+ok8TQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.29.17", + "regexpu-core": "^6.5.4", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-define-polyfill-provider": { + "version": "0.6.8", + "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.6.8.tgz", + "integrity": "sha512-47UwBLPpQi1NoWzLuHNjRoHlYXMwIJoBf7MFou6viC/sIHWYygpvr0B6IAyh5sBdA2nr2LPIRww8lfaUVQINBA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-compilation-targets": "^7.28.6", + "@babel/helper-plugin-utils": "^7.28.6", + "debug": "^4.4.3", + "lodash.debounce": "^4.0.8", + "resolve": "^1.22.11" + }, + "peerDependencies": { + "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" + } + }, + "node_modules/@babel/helper-globals": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.29.17.tgz", + "integrity": "sha512-SeQUwFlH8hH1vjUmBFeqwxt6Nsjp01MKEZOtZPJ86lpA4GBdb/o0dShjC+Awf7v74/+84KIL1RiJ4TOJj6gU+A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-member-expression-to-functions": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.29.17.tgz", + "integrity": "sha512-/mTo42pDFDxzfYCCL24qxlMPKHcz47iUXr9GfhbV/CHnFkOaAFObtsJQ2y3G3e2qP3eRrvlQ29QqBfVllOhonQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-skip-transparent-expression-wrappers": "^7.29.17", + "@babel/traverse": "^7.29.17", + "@babel/types": "^7.29.17" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-imports": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.29.17.tgz", + "integrity": "sha512-bLxkfvUEHeWShbadKTm7EfDCkosXZh6PjWEa9bYiCuob24c0nm388ara2Hz6KisGaXe+XCsi6VyfJNSJjeUUwg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.29.17", + "@babel/types": "^7.29.17" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.29.17.tgz", + "integrity": "sha512-eY/pAYlV7pC5biPmW0M7fDqv1D+opqI0Ioa6OQeg0AV3465b8K8g9I9fvZIV11u35f7jU6q5RXYlUD6k4QLC3w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-module-imports": "^7.29.17", + "@babel/helper-validator-identifier": "^7.29.17", + "@babel/traverse": "^7.29.17" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-optimise-call-expression": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.29.17.tgz", + "integrity": "sha512-3D6B+IxDVqg0s3oLUe6p5nQ4VYtJSeLLyvd9c2dwrxVbd4uoyPjUNq23uhfhq21kjhFX2pJu15jVcMBYgLstjA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.29.17" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-plugin-utils": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.29.17.tgz", + "integrity": "sha512-pdztM6tDPJu52CYy07frAD1XpDAvndtxPhPyehcarNv5Pyq5hutWmTVXd0XIPaI749vUIJ+vxG6KYWoVExn+lg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-remap-async-to-generator": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.29.17.tgz", + "integrity": "sha512-F9ozmdIK2VONOv/sGnx7hVvA/bEUHMxSnoeaBN/E3FjZ7PnrUqJx7jnRH8qtqvw4mj37qpex00Fc0Bcu1C4RiQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.29.17", + "@babel/helper-wrap-function": "^7.29.17", + "@babel/traverse": "^7.29.17" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-replace-supers": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.29.17.tgz", + "integrity": "sha512-yFmWa/3E81mCG9aHvkgfgnEncEM7QrpYwl5HawGN1ZbJ0n7UgegbcVYZRB+YJraRVAxhsrgqVQXjjnojdumcSw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-member-expression-to-functions": "^7.29.17", + "@babel/helper-optimise-call-expression": "^7.29.17", + "@babel/traverse": "^7.29.17" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-skip-transparent-expression-wrappers": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.29.17.tgz", + "integrity": "sha512-Qu080ZNwb6ZDozXfjjWvPTy+6dTWanQgmBHb/wIivl3yeZvvE27UWBEdn5d6U1WOide3kh+/B+7Xm0tvI/+Ygg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.29.17", + "@babel/types": "^7.29.17" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.29.17.tgz", + "integrity": "sha512-iY5lvqFhfgMXp4o4zWads4NvQZXizBxzCoADPOgFMcMwk1XefAdBJbc9i1y94aflY57lokjOjRTa3AOOW9R7BQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.29.17.tgz", + "integrity": "sha512-AG+olLB+teKhkQ2WYJeaZqJwNLjtWTz1waQIP/tEYITzVzpdHLP7IXx2c/bH2JTsNCgvWlkqdCv91xcb8lul8Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-option": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.29.17.tgz", + "integrity": "sha512-Pr+bjfbd4TYVax16KyHVyElTnid5nbWQWQvA/dPlESoKVZ8B4eTAUhoqug/mtD9hWAEgIQIOyvjUBMI9HjdrGw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-wrap-function": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.29.17.tgz", + "integrity": "sha512-2kpH7/YkL1aHQKBOKRN5gdSkUQmvVbXl0ZIx6q5vTn2Xn6iifvZDAFJyvPfvNSiYBJQN0lMV9yn4ZVGaGqNdYw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/template": "^7.29.17", + "@babel/traverse": "^7.29.17", + "@babel/types": "^7.29.17" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helpers": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.29.17.tgz", + "integrity": "sha512-Q7LRJjIiFAiOtfkVBzXe4op1tQ8dXYsRsdojKzLfERndnXcmyyn9RZIBlSJzFo0O3CouXV3Tvb8AGolaDr1M7A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/template": "^7.29.17", + "@babel/types": "^7.29.17" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.17.tgz", + "integrity": "sha512-I+0olVqWMm9bimQJc/5B3jn1nivNDXtnMtDVs07XdHzZLcWa2N/mlCTPmAsQg95QcKoXSuFD2Yz4fwdtoyk7DQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.29.17" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/plugin-bugfix-firefox-class-in-computed-class-key": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-firefox-class-in-computed-class-key/-/plugin-bugfix-firefox-class-in-computed-class-key-7.29.17.tgz", + "integrity": "sha512-8jtzP+p4ixtQbd+yP3SYJ/T9ocGeUdgf0ZowzozebM3IEdk8iXNMcJfPUv15y3QyD0iE3kjrw8PmuNBZ0wLqZw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.17", + "@babel/traverse": "^7.29.17" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/plugin-bugfix-safari-class-field-initializer-scope": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-class-field-initializer-scope/-/plugin-bugfix-safari-class-field-initializer-scope-7.29.17.tgz", + "integrity": "sha512-bOG06fJnQdsoc0L2eQQQl7NZpuqjMrifAvf2/3RSqzh0pNg6fJYqSowZMfLAxMs6K/LqEy5r5VB/Shfo6GtRxA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.17" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.29.17.tgz", + "integrity": "sha512-PSl5Q1XxtW8y4zuxEqBHU2HzWGJTTlglJVk9RWwUtduKUtX5l8tDiBT06oGhar0WW/3hgdRmc3LbBiEXHPGyUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.17" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/plugin-bugfix-safari-rest-destructuring-rhs-array": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-rest-destructuring-rhs-array/-/plugin-bugfix-safari-rest-destructuring-rhs-array-7.29.17.tgz", + "integrity": "sha512-DNah44OKcoypJTyIeYM0yAYX/DToo16e2rj0bjGwcf4Kelv8XFG/GQWhWGhN/m6gp11v8GrnOQ4UiUxbOvJlMQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.17", + "@babel/helper-skip-transparent-expression-wrappers": "^7.29.17" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.29.17.tgz", + "integrity": "sha512-o8zNqHKXc467fbxtLPEnEFZedQtD5zx/UEClyg3X4G5FHrquHBcFdeUC3SlGT9b9H7Ld9yd4vR4xLbFoiMQGhg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.17", + "@babel/helper-skip-transparent-expression-wrappers": "^7.29.17", + "@babel/plugin-transform-optional-chaining": "^7.29.17" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.13.0" + } + }, + "node_modules/@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly/-/plugin-bugfix-v8-static-class-fields-redefine-readonly-7.29.17.tgz", + "integrity": "sha512-Ok8XJAVmprYl4HyIz+JZqaJrX3NHN2QrDScujOqz1F5wav8DnJ7Qyl0BnNGI59g94S30hLW9TrE3BaIKgd5mEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.17", + "@babel/traverse": "^7.29.17" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/plugin-proposal-private-property-in-object": { + "version": "7.21.0-placeholder-for-preset-env.2", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.0-placeholder-for-preset-env.2.tgz", + "integrity": "sha512-SOSkfJDddaM7mak6cPEpswyTRnuRltl429hMraQEglW+OkovnCzsiszTmsrlY//qLFjCpQDFRvjdm2wA5pPm9w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-import-assertions": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.29.17.tgz", + "integrity": "sha512-UA1lZTaghMx8HgkcLTkpFodJFWEbl3ICWQNNTJOFM9gFv2jxZFwLrhSYja+NS6sFY5jozkLpkcQFBcUlzJciXw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.17" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-import-attributes": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.29.17.tgz", + "integrity": "sha512-LAVq6GOC7+6LSgVP+aPFAyDtqb90dMNdxkAR1y6jG3rP9LTmX4BIshEDV4o4CczrlHv5UL/dXfUK9DnigphOBg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.17" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-unicode-sets-regex": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-unicode-sets-regex/-/plugin-syntax-unicode-sets-regex-7.18.6.tgz", + "integrity": "sha512-727YkEAPwSIQTv5im8QHz3upqp92JTWhidIC81Tdx4VJYIte/VndKf1qKrfnnhPLiPghStWfvC/iFaMCQu7Nqg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.18.6", + "@babel/helper-plugin-utils": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/plugin-transform-arrow-functions": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.29.17.tgz", + "integrity": "sha512-q2MPYTsdY9ct1Iae6m1Dzs0H0PkDoavQtTtEvnvUdkE2xr8pcMnHLNVEdzH9KCDKg7fGxxQgir8mZhpQCIYTcA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.17" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-async-generator-functions": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.29.17.tgz", + "integrity": "sha512-GYhyjAK/sXGs8H941mFVH+Z69nta9jSN1tGY48MJB2xwSc4jQPnNDsRGhcHBFJ8uR3os25sC3r9zdvFhH24FvQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.17", + "@babel/helper-remap-async-to-generator": "^7.29.17", + "@babel/traverse": "^7.29.17" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-async-to-generator": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.29.17.tgz", + "integrity": "sha512-gjOtlu+GMs2WR9zOFNzQTbx5IYAtchEyfolBsYP01iuF0FFz4b9MeSb5cp7MwVcFoFuavaO+EfjB+0pgBtfS/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-module-imports": "^7.29.17", + "@babel/helper-plugin-utils": "^7.29.17", + "@babel/helper-remap-async-to-generator": "^7.29.17" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-block-scoped-functions": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.29.17.tgz", + "integrity": "sha512-Rrjn6t0ItbnLcA35jPK68I8uWxOnA1EsFi7BkLHYQ7eQ9s3FM8JKtiv3FOHKKZVxJfxXkKlmhAQXK2ECfDG4pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.17" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-block-scoping": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.29.17.tgz", + "integrity": "sha512-nUSscxaV0qMvS/ZR4Lc7dXBWcz/PwISV1pySs5xhxRuuWkRGhH7W0/hk/8LojZPgG4r3+rMIFGU8+oaRDBR6Rg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.17" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-class-properties": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-properties/-/plugin-transform-class-properties-7.29.17.tgz", + "integrity": "sha512-bAPPnc6aGv3QzTkKV97Kodh2cruhycr0B9bFq8AGsQm81PyCSG+lcBCmdRtYAhvpKz+xno7REssecXrmrk6qbA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-create-class-features-plugin": "^7.29.17", + "@babel/helper-plugin-utils": "^7.29.17" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-class-static-block": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-static-block/-/plugin-transform-class-static-block-7.29.17.tgz", + "integrity": "sha512-B53EzbzOZgeW+5IE3wv/MWMaPIlpZNuwY1kd0PMGBVr2nmP5ELWZJ8wywgBlfUxLgX97rZNW6j6ljenQUZtK1g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-create-class-features-plugin": "^7.29.17", + "@babel/helper-plugin-utils": "^7.29.17" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.12.0" + } + }, + "node_modules/@babel/plugin-transform-classes": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.29.17.tgz", + "integrity": "sha512-BJZSyh8x5BdNV4LM7gyU8i29vb18R9jpAw/hLPOWPRnmmHblFnlNeu/F+zq638/Bqt1/Gp7BEomQU+142ckbbQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.29.17", + "@babel/helper-compilation-targets": "^7.29.17", + "@babel/helper-globals": "^7.29.17", + "@babel/helper-plugin-utils": "^7.29.17", + "@babel/helper-replace-supers": "^7.29.17", + "@babel/traverse": "^7.29.17" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-computed-properties": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.29.17.tgz", + "integrity": "sha512-8NE8coilcPpSRsqp9Ioufl6DQLPdtAW2+ay5Ke6mqeJLlutyJrHlaZnFLh2gG5FU+YvFBeFZK7mWg/PVnJO2gQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.17", + "@babel/template": "^7.29.17" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-destructuring": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.29.17.tgz", + "integrity": "sha512-iebptXn9fRatXQ/t0TsrZXll2WOqnoGE4NnYmTTOIJ5rto5UQOy/UJ4zfwhk39DwEwl1wWgLd1I183H2SSB3Cw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.17", + "@babel/traverse": "^7.29.17" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-dotall-regex": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.29.17.tgz", + "integrity": "sha512-iqLxKeSRciKpLRladclQ9xFA4kRkeKuFtU9o0HuHJXO9ssgctwqjPwGMNmqr1eibry60h5tSw2PtRZ5x/TLcrg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.29.17", + "@babel/helper-plugin-utils": "^7.29.17" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-duplicate-keys": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.29.17.tgz", + "integrity": "sha512-w7oGKMEvyJV3P7stk2ERELBagPjkn9aawjLeTnfPZ2l8LB4+JCutQGiTP3Bc6rwvdHIGTtJyyKQjgK3/SyV4NQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.17" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-duplicate-named-capturing-groups-regex": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-named-capturing-groups-regex/-/plugin-transform-duplicate-named-capturing-groups-regex-7.29.17.tgz", + "integrity": "sha512-APR4PomE5QAbQ9dNhTipDecw/JiiEOOd8dO9t17X8M2GsZvxfmgdmx2Erwpb/Q7lX3miVpEViVvKwefuGGpmpA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.29.17", + "@babel/helper-plugin-utils": "^7.29.17" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/plugin-transform-dynamic-import": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dynamic-import/-/plugin-transform-dynamic-import-7.29.17.tgz", + "integrity": "sha512-eFBofeV+TMF2mLxkyGWL3yTYqwjX43v5BP5i7lGEVbKZPupLOrQuHrz6KpAYq0JA5oMRYfgkdAQ/PtdZFa984w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.17" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-explicit-resource-management": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-explicit-resource-management/-/plugin-transform-explicit-resource-management-7.29.17.tgz", + "integrity": "sha512-kqsd+xyA/2FFhhnJrdoaBCb1dmsPnGA23mD8YV/gUQd1n/4dulxksX32peqne5Yl48ehPofQCYvl7L5aFsFNEA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.17", + "@babel/plugin-transform-destructuring": "^7.29.17" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-exponentiation-operator": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.29.17.tgz", + "integrity": "sha512-NWti5xxKeoUSIr7K6dCxYTR35ca40QDJMh51AGmzViJqCX0ynJAA90vozSdaYgRmPSpIx/sMbLaVh2KCLYRi6Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.17" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-export-namespace-from": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-export-namespace-from/-/plugin-transform-export-namespace-from-7.29.17.tgz", + "integrity": "sha512-lVj1+lRiOm2RC9SVOFJ8gslt5XWJaJofEFdqzDakbEw6ImtmuJqPVcPnJwofPq16o0zTXaRKNdvWmkIy/ASblg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.17" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-for-of": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.29.17.tgz", + "integrity": "sha512-biX//ow5MvNtYDTzmrn/CBkvCagj3sBCtYbvnz4ID1pjOh9jcH/M+j2ExNijIH0m8gMRrI+JZUVLLA8UHEj2iQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.17", + "@babel/helper-skip-transparent-expression-wrappers": "^7.29.17" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-function-name": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.29.17.tgz", + "integrity": "sha512-4IUF7769cOCnc44O/QAFDHkl/tT5CuMW220NVSNEf5WTiMubN2A6R7dSKS58LuyuJHsUHg4z++nGGCGcclhyMw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-compilation-targets": "^7.29.17", + "@babel/helper-plugin-utils": "^7.29.17", + "@babel/traverse": "^7.29.17" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-json-strings": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-json-strings/-/plugin-transform-json-strings-7.29.17.tgz", + "integrity": "sha512-wESwmOL8vIlODnh3ML4jRj/qmexmF6JOYJItxZm7VV2dddmfQliS4pjVvT0o6dQ7bRKv/pflWsUQc/6ayDixDw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.17" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-literals": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.29.17.tgz", + "integrity": "sha512-9+dpLK5HnTpCSqgRhIEqmy5efBd82wwIWYYA6W+sUhoT9ICFHloD6UYR0hCYfJJMKJS+p6j7rCRXV+A268sTtw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.17" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-logical-assignment-operators": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-logical-assignment-operators/-/plugin-transform-logical-assignment-operators-7.29.17.tgz", + "integrity": "sha512-XNVE+kwpsqhkyhiqQ4TIhuBD5z1sDpp0i9AlZwoeTJQjEgOjO/FsNZawlQ35Ohex3cLwNGog9T76a8pagdF5Ag==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.17" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-member-expression-literals": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.29.17.tgz", + "integrity": "sha512-IT8hmtSjwfIymQ4/sYSs5Ni5hp1uTi173U9G2NTcNPd7b4Crt4fnsIvXcMaBBuXirqkudgdidEGH6eXvd6FGFw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.17" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-modules-amd": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.29.17.tgz", + "integrity": "sha512-pWJUQqVnUdcIIErXDBgbiGbgraz/hc95/RtdqyGyUf4c8KDEVQ/4lFKWz8Q62uipq3+yYMjhCfwiSrGNntBTPw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-module-transforms": "^7.29.17", + "@babel/helper-plugin-utils": "^7.29.17" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-modules-commonjs": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.29.17.tgz", + "integrity": "sha512-pm8Y/ei0BNKnQDlgBxt1Gdh6nD+ulWB0xooAADgiT8TTXXPxDzU93F2OraEfei2s2X0UFvFExc4Ag9A5GE4XWQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-module-transforms": "^7.29.17", + "@babel/helper-plugin-utils": "^7.29.17" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-modules-systemjs": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.29.17.tgz", + "integrity": "sha512-BpPzdCkJTHguUouCuc0S5+35OMzkvSXysD6082AhtoIL74NCJJkvAQNmYiF9hEkQzl+Xo8p5Vq1S3U7FIWxwgQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-module-transforms": "^7.29.17", + "@babel/helper-plugin-utils": "^7.29.17", + "@babel/helper-validator-identifier": "^7.29.17", + "@babel/traverse": "^7.29.17" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-modules-umd": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.29.17.tgz", + "integrity": "sha512-LUwkZJRe1p7xUYSx8EYBThjT7xdNhFUUEHoTJAdDIRoIcxNmEWZRBiKKUvTm+w59SFF6V2tnaeH0kjEwGymHug==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-module-transforms": "^7.29.17", + "@babel/helper-plugin-utils": "^7.29.17" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-named-capturing-groups-regex": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.29.17.tgz", + "integrity": "sha512-TeLMadZJwUx9DXETgUsGNNRJ0tiRBLyCEduJxgqz0euez3cw5OhXp9ooCnkfOSNMZ5kzSXhJXPp6b6s2Tz+rnQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.29.17", + "@babel/helper-plugin-utils": "^7.29.17" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/plugin-transform-new-target": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.29.17.tgz", + "integrity": "sha512-BjpKlXJ+feuIux+ctjdXJHsdM7syyMgXJbYBKAq0Pil2Y9kG0TtXjC+u7wQm3MHHPHHo8WWx2I8McBrPxSQ+Hw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.17" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-nullish-coalescing-operator": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.29.17.tgz", + "integrity": "sha512-hFUy6UxMqhaJSSaSKlBOPreiWWQQV0/W03nS3WSqe14LwLpbeZcvF/HTSC32Njd61JbJS9nGnadGqQB7qPeIVQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.17" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-numeric-separator": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-numeric-separator/-/plugin-transform-numeric-separator-7.29.17.tgz", + "integrity": "sha512-Rmt/dkJf/+xTxlFa/ZrxKp+p/TdQut3x8u1g1w0gNzqXjRvlKsHKZv9oPy/veGZGjEczcLzw4Cry5o5PmuuY+Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.17" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-object-rest-spread": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.29.17.tgz", + "integrity": "sha512-Po5+rRF461T40ARmQUMBuWW+ciqvezMLopf4n2GS6AR/MCVYkMB96nSUmRjMwsZiU9yWSef7Bu9pi3fXTe4F+g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-compilation-targets": "^7.29.17", + "@babel/helper-plugin-utils": "^7.29.17", + "@babel/plugin-transform-destructuring": "^7.29.17", + "@babel/plugin-transform-parameters": "^7.29.17", + "@babel/traverse": "^7.29.17" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-object-super": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.29.17.tgz", + "integrity": "sha512-yruEO4LT5rpkNA65Sp0f6MQO/ioPjvlyoJPj9ghrbmYzmLpF4B3bxTtq90ydy++MxWqkIBoIXWA40h013jM/NA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.17", + "@babel/helper-replace-supers": "^7.29.17" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-optional-catch-binding": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-catch-binding/-/plugin-transform-optional-catch-binding-7.29.17.tgz", + "integrity": "sha512-62+soYiJwm7GqbTsejo23BAASW3lC9x80lJqrEPbDv5P/JNq0D6FEt7mfQkNrr0HRZBG7NOV81FtuSdPru31/w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.17" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-optional-chaining": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.29.17.tgz", + "integrity": "sha512-RY0fenokpzl4GF1zXdWd1c7gPvInnbIQBh9SGlp3VJrcbZ12ZRXijlMMtehTpFsPum/m+7T9j6ZjIBMN9b1KhQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.17", + "@babel/helper-skip-transparent-expression-wrappers": "^7.29.17" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-parameters": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.29.17.tgz", + "integrity": "sha512-AB4p3TS9gGPJnVOWOTFzA0r6JZCQVIonmgBhuGaxUIRPIkR3H91mCxOyFy4nLx/6GxOQ+dVoav1I+aNeKEX4rA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.17" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-private-methods": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-methods/-/plugin-transform-private-methods-7.29.17.tgz", + "integrity": "sha512-pvDf/4JPHHI+qCf/An3PNpqWgPi5nrMTJhF1VQ6TwehNSx8UUALYkeVPoW3mVSdWi88up+OwKCrP3P1EZXY0OA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-create-class-features-plugin": "^7.29.17", + "@babel/helper-plugin-utils": "^7.29.17" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-private-property-in-object": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-property-in-object/-/plugin-transform-private-property-in-object-7.29.17.tgz", + "integrity": "sha512-aL+JlLI+FjgHpMVd6NIMPHKBfEcwA7rfD53knSIUVc4RfqTArr/WyGd7AFEGuew/VgJPJZZThgxDqy0HKFmSRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.29.17", + "@babel/helper-create-class-features-plugin": "^7.29.17", + "@babel/helper-plugin-utils": "^7.29.17" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-property-literals": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.29.17.tgz", + "integrity": "sha512-O/ABojCLBDgi1UkuY/tZPRgd1TZp+8DaNCZUXSaqctopv06RWnNseDlYdGjsPJy3jM4u6eUPCy/9kTIv8psQdg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.17" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-regenerator": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.29.17.tgz", + "integrity": "sha512-eYOeX3AUcgvVatFST0l5R2a7J71sCqkckgB1+I8UT+cQrixj2XKvC/el/zu/2Exe3o8IhmTJ9dBwCUW8DDXr5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.17", + "@babel/traverse": "^7.29.17" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-regexp-modifiers": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regexp-modifiers/-/plugin-transform-regexp-modifiers-7.29.17.tgz", + "integrity": "sha512-mPG8dYn4XF4s2UJjGiAJxUI0YhYRaE9W9OsX9YTSZXFymRaSiC3xOSkITw66ImmP+cam5qYa/W85MNDT4M+iPA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.29.17", + "@babel/helper-plugin-utils": "^7.29.17" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/plugin-transform-reserved-words": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.29.17.tgz", + "integrity": "sha512-rXP/0AGqDzOakfegZpdy0d3aMS5cI7aH8r1tp24M/lYI+tGD9LXWOFf9PqU77WqHNKwEItQfRWFGxE595WBOPw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.17" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-shorthand-properties": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.29.17.tgz", + "integrity": "sha512-Ip4Jg7tcuIj6fS1vHZPW5EWKqoAaojBKXhN+nkIVWP3jZROJj2w4CkgCTgR3YGLLYfoD6HBhE6RESr3DxeZimw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.17" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-spread": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.29.17.tgz", + "integrity": "sha512-HTugAMid6Pb5OVY24Pde7daQqxJUlkFnX1RjLUEbSwKZ5bzwc9N+/c3EtodMvINIyGDlJ20sM+I9kc1CkzRS5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.17", + "@babel/helper-skip-transparent-expression-wrappers": "^7.29.17" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-sticky-regex": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.29.17.tgz", + "integrity": "sha512-N1uO0PX1nQIKO5S5GYc4u7O1a6b0JbVYJvtCgOqgckMdLILUDjfIs/zenF9KAAqSfEWkZOcIMLLt6KIueUIDEw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.17" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-template-literals": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.29.17.tgz", + "integrity": "sha512-FP1wNBcgqBxy5Yun/enep9Qv2T8ur02ObbM+o/TJvwH1qOfqWJTA5G5n+jxjhLOMm5LRA+mjjOhzan3M1RrYEw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.17" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-typeof-symbol": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.29.17.tgz", + "integrity": "sha512-4PWdL3zRYJKtUJ7rCBq5SjmJa+sl0V7C9CsipCrwycPtfmcBmLqI57QO6nlplj5icCkr3MoMeKFe2va3qDbNmQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.17" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-unicode-escapes": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.29.17.tgz", + "integrity": "sha512-jYKefjRRdWw0lgwGTBE8DdC1c7cnZApeRPGxVkXJ+aDCmup4uyEdeMY/bzy/X3+aSg3Rlf3o30X3whqOedXCKw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.17" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-unicode-property-regex": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-property-regex/-/plugin-transform-unicode-property-regex-7.29.17.tgz", + "integrity": "sha512-EOLDjq6FzuPVbfoJO2ad9PmegP5lfJ/O6Fi3l2ZK4qaUZeIaz6Qas51w3CMTYcZrZMnOuhNFGdr3J90qUBlxgQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.29.17", + "@babel/helper-plugin-utils": "^7.29.17" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-unicode-regex": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.29.17.tgz", + "integrity": "sha512-blvNpLZuO4qmj9oMakw/fDhiTxFUDmgR3kd07yRPIPDXR1cWBUdMeYs8amgAp5W4UUWgp5sJ0TODd71WNbAuHQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.29.17", + "@babel/helper-plugin-utils": "^7.29.17" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-unicode-sets-regex": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-sets-regex/-/plugin-transform-unicode-sets-regex-7.29.17.tgz", + "integrity": "sha512-8dh2fnyWihUCt1FtlzbJ37SzZfkgMfqP2I/3KZbRdbZ03xt/3wwQTT7yNfgieJ3svh2VIGObVWmj7PjltPW+DA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.29.17", + "@babel/helper-plugin-utils": "^7.29.17" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/preset-env": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.29.17.tgz", + "integrity": "sha512-LQ72QZm7CZDM/jFE+iDkREhftXu1RIMYz3XZ0W47bgemlfp9vYlLIu/22LE/FwOopTSOIqMheuOgwMlxD/TI/Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/compat-data": "^7.29.17", + "@babel/helper-compilation-targets": "^7.29.17", + "@babel/helper-plugin-utils": "^7.29.17", + "@babel/helper-validator-option": "^7.29.17", + "@babel/plugin-bugfix-firefox-class-in-computed-class-key": "^7.29.17", + "@babel/plugin-bugfix-safari-class-field-initializer-scope": "^7.29.17", + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^7.29.17", + "@babel/plugin-bugfix-safari-rest-destructuring-rhs-array": "^7.29.17", + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.29.17", + "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly": "^7.29.17", + "@babel/plugin-proposal-private-property-in-object": "7.21.0-placeholder-for-preset-env.2", + "@babel/plugin-syntax-import-assertions": "^7.29.17", + "@babel/plugin-syntax-import-attributes": "^7.29.17", + "@babel/plugin-syntax-unicode-sets-regex": "^7.18.6", + "@babel/plugin-transform-arrow-functions": "^7.29.17", + "@babel/plugin-transform-async-generator-functions": "^7.29.17", + "@babel/plugin-transform-async-to-generator": "^7.29.17", + "@babel/plugin-transform-block-scoped-functions": "^7.29.17", + "@babel/plugin-transform-block-scoping": "^7.29.17", + "@babel/plugin-transform-class-properties": "^7.29.17", + "@babel/plugin-transform-class-static-block": "^7.29.17", + "@babel/plugin-transform-classes": "^7.29.17", + "@babel/plugin-transform-computed-properties": "^7.29.17", + "@babel/plugin-transform-destructuring": "^7.29.17", + "@babel/plugin-transform-dotall-regex": "^7.29.17", + "@babel/plugin-transform-duplicate-keys": "^7.29.17", + "@babel/plugin-transform-duplicate-named-capturing-groups-regex": "^7.29.17", + "@babel/plugin-transform-dynamic-import": "^7.29.17", + "@babel/plugin-transform-explicit-resource-management": "^7.29.17", + "@babel/plugin-transform-exponentiation-operator": "^7.29.17", + "@babel/plugin-transform-export-namespace-from": "^7.29.17", + "@babel/plugin-transform-for-of": "^7.29.17", + "@babel/plugin-transform-function-name": "^7.29.17", + "@babel/plugin-transform-json-strings": "^7.29.17", + "@babel/plugin-transform-literals": "^7.29.17", + "@babel/plugin-transform-logical-assignment-operators": "^7.29.17", + "@babel/plugin-transform-member-expression-literals": "^7.29.17", + "@babel/plugin-transform-modules-amd": "^7.29.17", + "@babel/plugin-transform-modules-commonjs": "^7.29.17", + "@babel/plugin-transform-modules-systemjs": "^7.29.17", + "@babel/plugin-transform-modules-umd": "^7.29.17", + "@babel/plugin-transform-named-capturing-groups-regex": "^7.29.17", + "@babel/plugin-transform-new-target": "^7.29.17", + "@babel/plugin-transform-nullish-coalescing-operator": "^7.29.17", + "@babel/plugin-transform-numeric-separator": "^7.29.17", + "@babel/plugin-transform-object-rest-spread": "^7.29.17", + "@babel/plugin-transform-object-super": "^7.29.17", + "@babel/plugin-transform-optional-catch-binding": "^7.29.17", + "@babel/plugin-transform-optional-chaining": "^7.29.17", + "@babel/plugin-transform-parameters": "^7.29.17", + "@babel/plugin-transform-private-methods": "^7.29.17", + "@babel/plugin-transform-private-property-in-object": "^7.29.17", + "@babel/plugin-transform-property-literals": "^7.29.17", + "@babel/plugin-transform-regenerator": "^7.29.17", + "@babel/plugin-transform-regexp-modifiers": "^7.29.17", + "@babel/plugin-transform-reserved-words": "^7.29.17", + "@babel/plugin-transform-shorthand-properties": "^7.29.17", + "@babel/plugin-transform-spread": "^7.29.17", + "@babel/plugin-transform-sticky-regex": "^7.29.17", + "@babel/plugin-transform-template-literals": "^7.29.17", + "@babel/plugin-transform-typeof-symbol": "^7.29.17", + "@babel/plugin-transform-unicode-escapes": "^7.29.17", + "@babel/plugin-transform-unicode-property-regex": "^7.29.17", + "@babel/plugin-transform-unicode-regex": "^7.29.17", + "@babel/plugin-transform-unicode-sets-regex": "^7.29.17", + "@babel/preset-modules": "0.1.6-no-external-plugins", + "babel-plugin-polyfill-corejs2": "^0.4.15", + "babel-plugin-polyfill-corejs3": "^0.14.0", + "babel-plugin-polyfill-regenerator": "^0.6.6", + "core-js-compat": "^3.48.0", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/preset-modules": { + "version": "0.1.6-no-external-plugins", + "resolved": "https://registry.npmjs.org/@babel/preset-modules/-/preset-modules-0.1.6-no-external-plugins.tgz", + "integrity": "sha512-HrcgcIESLm9aIR842yhJ5RWan/gebQUJ6E/E5+rf0y9o6oj7w0Br+sWuL6kEQ/o/AdfvR1Je9jG18/gnpwjEyA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/types": "^7.4.4", + "esutils": "^2.0.2" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0 || ^8.0.0-0 <8.0.0" + } + }, + "node_modules/@babel/runtime": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.29.17.tgz", + "integrity": "sha512-CvlZdpED5dsu21yK0DfpXksJWt1zeW09lY49hp7P9cA5Qedx/QkwEs1PfluSJjijH9i94oT9LmtgGWlPY8ISzw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/template": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.29.17.tgz", + "integrity": "sha512-D4nOLKOzIBwn7/Z78h3UPEwzFObmPVTukBJ9+63BijgMVeLj6mQ77FJb6YCZ4QBo6VjAk/yj4QnpKusTcBy6vA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.29.17", + "@babel/parser": "^7.29.17", + "@babel/types": "^7.29.17" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.29.17.tgz", + "integrity": "sha512-q+CnfQcmNfDdOUARkt9FWtdR0HPOCcyQBj1Z7l2SOpFIfUB/XI3dXS0B5UOlZWwQCun80xVhgcv4ip6w128u9g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.29.17", + "@babel/generator": "^7.29.17", + "@babel/helper-globals": "^7.29.17", + "@babel/parser": "^7.29.17", + "@babel/template": "^7.29.17", + "@babel/types": "^7.29.17", + "debug": "^4.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/types": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.17.tgz", + "integrity": "sha512-kzo3lZUbI0gARA4QvhmOTH/aws2SrZ880ECQRIjPPSrdfBM0bZCkj1U7UN2fB0GNeXayqCiLVXa2+1jAhn377Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^7.29.17", + "@babel/helper-validator-identifier": "^7.29.17" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@cacheable/memory": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@cacheable/memory/-/memory-2.2.0.tgz", + "integrity": "sha512-CTLKqLItRCEixEAewD3/j9DB3/o96gpTPD4eJ1v+DGOlxZRZncRQkGYqqnAGCscYd6RNeXfGeiuCphsPtqyIfQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@cacheable/utils": "^2.5.0", + "@keyv/bigmap": "^1.3.1", + "hookified": "^1.15.1", + "keyv": "^5.6.0" + } + }, + "node_modules/@cacheable/utils": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/@cacheable/utils/-/utils-2.5.0.tgz", + "integrity": "sha512-buipgOVDkkPXNR5+xBpDw7Zk2n1EvU7qBJCNUcL7rhQ//kfpOXPAvQ511Os0vpLYJ1pZnvudNytkQt2hst3wqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "hashery": "^1.5.1", + "keyv": "^5.6.0" + } + }, + "node_modules/@canvas/image-data": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@canvas/image-data/-/image-data-1.1.0.tgz", + "integrity": "sha512-QdObRRjRbcXGmM1tmJ+MrHcaz1MftF2+W7YI+MsphnsCrmtyfS0d5qJbk0MeSbUeyM/jCb0hmnkXPsy026L7dA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@emnapi/runtime": { + "version": "1.11.3", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.11.3.tgz", + "integrity": "sha512-Xz4Tpyki7XyrpbUK1jR1AhdAdaXyhhY4lZ3neLodmhpuWfy2PAQN5B46sAiU4liOXGLkHypn/qU+jvfWSCYYLA==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.10.1", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.10.1.tgz", + "integrity": "sha512-cuadcxVFE8sDK6iWJbs8Sn0av2Nrh2QSGQhVlBW9AaAHqHwjWsZHT8LJ4hFGPh7ASBV2deFdM7H/DPjulmh8rg==", + "dev": true, + "license": "MIT", + "dependencies": { + "eslint-visitor-keys": "^3.4.3" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.12.4", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.4.tgz", + "integrity": "sha512-1qH3WeISXHFS8P3QI0lntHlMrlfTh1OarxlRbPNDEkSCqoyXC3apBE7MDyRKOL8HpuW48aQtff30wvEFww/4ww==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/config-array": { + "version": "0.23.7", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.23.7.tgz", + "integrity": "sha512-Ix1tmZjA7/OmE7ROAfORe83hVnqlDzLpZVHFjHQt5mvLm1U03qMexpaxKqFIL362QV32SoPaZqmKQr3tdqFY2w==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/object-schema": "^3.0.5", + "debug": "^4.3.1", + "minimatch": "^11.0.5" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + } + }, + "node_modules/@eslint/config-helpers": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.7.0.tgz", + "integrity": "sha512-DObd/KKUsU+FaFv4PLxSRenpXfQWmPXXP3pPZ6/K1PCrMu2vQpMDMuQe/BqYeoLcz8ro0bVDF1RxOJgfVEdhUw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^1.2.1" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + } + }, + "node_modules/@eslint/core": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-1.2.1.tgz", + "integrity": "sha512-MwcE1P+AZ4C6DWlpin/OmOA54mmIZ/+xZuJiQd4SyB29oAJjN30UW9wkKNptW2ctp4cEsvhlLY/CsQ1uoHDloQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@types/json-schema": "^7.0.15" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + } + }, + "node_modules/@eslint/js": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-10.0.1.tgz", + "integrity": "sha512-zeR9k5pd4gxjZ0abRoIaxdc7I3nDktoXZk2qOv9gCNWx3mVwEn32VRhyLaRsDiJjTs0xq/T8mfPtyuXu7GWBcA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + }, + "funding": { + "url": "https://eslint.org/donate" + }, + "peerDependencies": { + "eslint": "^10.0.0" + }, + "peerDependenciesMeta": { + "eslint": { + "optional": true + } + } + }, + "node_modules/@eslint/object-schema": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-3.0.5.tgz", + "integrity": "sha512-vqTaUEgxzm+YDSdElad6PiRoX4t8VGDjCtt05zn4nU810UIx/uNEV7/lZJ6KwFThKZOzOxzXy48da+No7HZaMw==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + } + }, + "node_modules/@eslint/plugin-kit": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.7.3.tgz", + "integrity": "sha512-IkO+/KEUvwbVpiURZg+P7zF74z5Jxe0UgJxVni+RtoHQ6IZieXaO02kmadomap/q+l6bc/jdPGGqTjhuZnuz1Q==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^1.2.1", + "levn": "^0.4.1" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + } + }, + "node_modules/@humanfs/core": { + "version": "0.19.2", + "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.2.tgz", + "integrity": "sha512-UhXNm+CFMWcbChXywFwkmhqjs3PRCmcSa/hfBgLIb7oQ5HNb1wS0icWsGtSAUNgefHeI+eBrA8I1fxmbHsGdvA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@humanfs/types": "^0.15.0" + }, + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanfs/node": { + "version": "0.16.8", + "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.8.tgz", + "integrity": "sha512-gE1eQNZ3R++kTzFUpdGlpmy8kDZD/MLyHqDwqjkVQI0JMdI1D51sy1H958PNXYkM2rAac7e5/CnIKZrHtPh3BQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@humanfs/core": "^0.19.2", + "@humanfs/types": "^0.15.0", + "@humanwhocodes/retry": "^0.4.0" + }, + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanfs/types": { + "version": "0.15.0", + "resolved": "https://registry.npmjs.org/@humanfs/types/-/types-0.15.0.tgz", + "integrity": "sha512-ZZ1w0aoQkwuUuC7Yf+7sdeaNfqQiiLcSRbfI08oAxqLtpXQr9AIVX7Ay7HLDuiLYAaFPu8oBYNq/QIi9URHJ3Q==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/retry": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.3.tgz", + "integrity": "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@img/colour": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@img/colour/-/colour-1.1.0.tgz", + "integrity": "sha512-Td76q7j57o/tLVdgS746cYARfSyxk8iEfRxewL9h4OMzYhbW4TAcppl0mT4eyqXddh6L/jwoM75mo7ixa/pCeQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/@img/sharp-darwin-arm64": { + "version": "0.35.6", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.35.6.tgz", + "integrity": "sha512-KYADSb7k/uEBsH4qROTt7d3Kyw/6EhJ7U3cfAnS3lNLahelMWpLkCNkkYQEcC0fvo2B5v4zbRS+iNvcARKS57A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-darwin-arm64": "1.3.5" + } + }, + "node_modules/@img/sharp-darwin-x64": { + "version": "0.35.6", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.35.6.tgz", + "integrity": "sha512-JmPryNzWaIMVgJp0wtGH9Cnzg2y9iZBCh0ZpydpjX81GrrJ6TV5fdZ2iqY/41dzXZNi7zUfNCrOEO/gyxb9WzA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-darwin-x64": "1.3.5" + } + }, + "node_modules/@img/sharp-freebsd-wasm32": { + "version": "0.35.6", + "resolved": "https://registry.npmjs.org/@img/sharp-freebsd-wasm32/-/sharp-freebsd-wasm32-0.35.6.tgz", + "integrity": "sha512-LJKJXPzEEodPm/sxojGM3Hyw+ZRLEyiGWb7kbFSKp45Myu5z6Nz8AtXvPxRPYLqrovf57fVx2vMJjp8QpyK1kw==", + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "freebsd" + ], + "dependencies": { + "@img/sharp-wasm32": "0.35.6" + }, + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-darwin-arm64": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.3.5.tgz", + "integrity": "sha512-MJiGpG6czDeMzK6UdnrrCLYJEouGtLtsqiZZK8MOk0i+GPuKQ+lcpt7Hdi28h5Q0PLGpgTSm1AdWtAxSn6CD+A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "darwin" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-darwin-x64": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.3.5.tgz", + "integrity": "sha512-jFJxbGYWkY2heVwjNBMGq0C3p/iXO185mnTXXHmMsSU++/gUJRKRaeyEkNXAMq4/G5S+0wgI9cgJi6uPI+N1xw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "darwin" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-arm": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.3.5.tgz", + "integrity": "sha512-rxz62CIW3nu8nVQtjNzLsxU3I590vF3KyD5WIlGAxkFRAF8SRgCxuwJDxMUDFoRXDohHFuBO9l3KNOBY4FfPzQ==", + "cpu": [ + "arm" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-arm64": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.3.5.tgz", + "integrity": "sha512-uobFASVW42cKPBb+Vzk/ISzq9POzJ2BurZFvZqamTctzBxcAHc8mOBg3m+kxywHoDaOFziZeTg6uCcMv3s3vkA==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-ppc64": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-ppc64/-/sharp-libvips-linux-ppc64-1.3.5.tgz", + "integrity": "sha512-GGNQrxW1GlzSrAYU1s0e6Uf8w24xefGnqxdeC5nebMq/3vG5zhn1nejvUOEmCP97K2W8OnE3jkz+mJiYZonR9g==", + "cpu": [ + "ppc64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-riscv64": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-riscv64/-/sharp-libvips-linux-riscv64-1.3.5.tgz", + "integrity": "sha512-GPkVkpYZ0SUIntq4rVW5rdw9MDYCMHnRk4rk7jUb9kyBHaK4hZIyzaco5c4scbcOrihrx00ju2moYIVwaQb76g==", + "cpu": [ + "riscv64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-s390x": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.3.5.tgz", + "integrity": "sha512-euEyiYAiYzQsQaMiD2ozdHIhv6z7zpQAQ/+DF4U+rK+WX5O/HOtoUG4gzE9RDG3SnH14fjmb0doIETOmSXIXnQ==", + "cpu": [ + "s390x" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-x64": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.3.5.tgz", + "integrity": "sha512-3VGDsRGFGVidz6AIeLWYxNlo6yZizVkEr0O3dgex6rsNHtCm6jgIj6bseSfOamn8Nq/Hcw6JZ9TxTT5ASjy+Sg==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linuxmusl-arm64": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.3.5.tgz", + "integrity": "sha512-9HL8D3phclHet2O7tYDc2iCvXWwK53K2Aq8vAhyRP0sGlaaPkNrjPSIHB0Zv70OV/k2XEOfM/R/TOQZf5YqTuA==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linuxmusl-x64": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.3.5.tgz", + "integrity": "sha512-jqKulDPZucLJvnGhItA8h48eIiV8NbN5pPhYfv2KOYAA7JhuKSLIyrkhXcSoOpeTGpp6M9ALEPWR3WSD1lWTFg==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-linux-arm": { + "version": "0.35.6", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.35.6.tgz", + "integrity": "sha512-Bt+upJ9wz8U77LRFAX+Js8m4YV77rSJzQaproiujWp+iuGixrb5K7fiB45r4z6Ggr2bNKtwOTAAYz/QwfLtGjw==", + "cpu": [ + "arm" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-arm": "1.3.5" + } + }, + "node_modules/@img/sharp-linux-arm64": { + "version": "0.35.6", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.35.6.tgz", + "integrity": "sha512-XcdFuf3VFqBnbe6GzK2HJVrm4qxZFjvVt7MUO3+kIY2vVVt92/6RgnFlyYPr2jIMMYh2L0u3y6Cu51W+vlDeXg==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-arm64": "1.3.5" + } + }, + "node_modules/@img/sharp-linux-ppc64": { + "version": "0.35.6", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-ppc64/-/sharp-linux-ppc64-0.35.6.tgz", + "integrity": "sha512-kjOL3DyNNtMZp/yMMNjak5F0LrAB0tdkI23mq5vLBqKBbT/z4+Xm3BIt588j/1OIuj2/zT37B6HuuL65KLDUJQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-ppc64": "1.3.5" + } + }, + "node_modules/@img/sharp-linux-riscv64": { + "version": "0.35.6", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-riscv64/-/sharp-linux-riscv64-0.35.6.tgz", + "integrity": "sha512-Py3xmzx9Kdfon125Y8mhUxty+8HT002EZvXpO/5ChlBUssL7/wTsdioqe90ssgcKUacBIY6XPWDCNy3ga3vO7g==", + "cpu": [ + "riscv64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-riscv64": "1.3.5" + } + }, + "node_modules/@img/sharp-linux-s390x": { + "version": "0.35.6", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.35.6.tgz", + "integrity": "sha512-zaUowlVkx7BNhLh4FwTiR3rPK24BzgdS31V2FBdYZPVPqCjevlWj+UyoEvAjUEsaVAIBBWvJ3ykExLgMAIz/rQ==", + "cpu": [ + "s390x" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-s390x": "1.3.5" + } + }, + "node_modules/@img/sharp-linux-x64": { + "version": "0.35.6", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.35.6.tgz", + "integrity": "sha512-z3/TzV7HWy04uyYKJwZPoUIbiKeFhDZCfDbnSs8QidcXNT+EIWm5TqveYCRqcpN3prdZsG4rp58ImdPZXmeKQQ==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-x64": "1.3.5" + } + }, + "node_modules/@img/sharp-linuxmusl-arm64": { + "version": "0.35.6", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.35.6.tgz", + "integrity": "sha512-1Zm1Fls7MArY5PYUDb9NXjm12oKCmhMoT0gd2u+gIzzXURtEe00Z7iBOYmgHmeSOk2vnQt1mQ73wvnRoWLT5Ag==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linuxmusl-arm64": "1.3.5" + } + }, + "node_modules/@img/sharp-linuxmusl-x64": { + "version": "0.35.6", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.35.6.tgz", + "integrity": "sha512-PW4giS1EckJ9xRssMaqByoapbipIlHqeisneFxzyMfe6DzWm7l0n7P/6pYXisNKVG0YCLpGi2O7SHlap0qn7Fg==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linuxmusl-x64": "1.3.5" + } + }, + "node_modules/@img/sharp-wasm32": { + "version": "0.35.6", + "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.35.6.tgz", + "integrity": "sha512-rHnklXQRJbyqcbSXK6mKSep9M9XM70xtiYQfwmlgzlWDgXutzvDXRL8Si2lYleuypW1VENqZoupsiKJEaS0kjg==", + "dev": true, + "license": "Apache-2.0 AND LGPL-3.0-or-later AND MIT", + "optional": true, + "dependencies": { + "@emnapi/runtime": "^1.11.3" + }, + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-webcontainers-wasm32": { + "version": "0.35.6", + "resolved": "https://registry.npmjs.org/@img/sharp-webcontainers-wasm32/-/sharp-webcontainers-wasm32-0.35.6.tgz", + "integrity": "sha512-N7Bw58M1wpNGLdW7i0PQ79Mrp9btFePJEee68kD1ucxBcMbEwbQHGrzClqDZ1S7eNDK5LuSqs661VwW9LilAlA==", + "cpu": [ + "wasm32" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "@img/sharp-wasm32": "0.35.6" + }, + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-arm64": { + "version": "0.35.6", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-arm64/-/sharp-win32-arm64-0.35.6.tgz", + "integrity": "sha512-KpzGhqW+gri4DQI2qWNSWFluXyX6Ads+9I+zAvfTzBJGPV77M8fx7pNSrt/U9LiYpgQwLFxINl0QpKckYD5h3A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0 AND LGPL-3.0-or-later", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-ia32": { + "version": "0.35.6", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.35.6.tgz", + "integrity": "sha512-c/6yly6sQDY0C4f95WJ798K6pkzVETMrxCoWeaZAS7G/GKdQAgJXZZ410KhTle0xsmVYn1APJgiuSERRIgX4FQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "Apache-2.0 AND LGPL-3.0-or-later", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-x64": { + "version": "0.35.6", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.35.6.tgz", + "integrity": "sha512-EUgDbmorr4LYwGXHxhioVad3HkCu3kFVuuDzIQqEKrk6XwOCxXEIgqQchMdZpzfb1rnWLa/jDlC2ZLU5hz6zNQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0 AND LGPL-3.0-or-later", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@isaacs/cliui": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-9.0.0.tgz", + "integrity": "sha512-AokJm4tuBHillT+FpMtxQ60n8ObyXBatq7jD2/JA9dxbDDokKQm8KMht5ibGzLVU9IJDIKK4TPKgMHEYMn3lMg==", + "dev": true, + "license": "BlueOak-1.0.0", + "engines": { + "node": ">=18" + } + }, + "node_modules/@isaacs/nonrecursive-glob-match": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@isaacs/nonrecursive-glob-match/-/nonrecursive-glob-match-1.1.0.tgz", + "integrity": "sha512-GPm/Dbvk5RLmhRnxXIa7nTpK0xtl4E0wj0MslsuNiJ1FIROU+2+9lgUC/dgF7Ey4QCWhfEsgxilMRMCdHPfDfw==", + "dev": true, + "license": "BlueOak-1.0.0" + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/remapping": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", + "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.3.tgz", + "integrity": "sha512-lhTtjtoEArWBjismtfS761S9Hlyn+nIZqOZVYoZ1Xn82PMNMVnk+jj/NhC4fAXGTs7ydONcJiR5vyQBTMDu27g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/source-map": { + "version": "0.3.11", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.11.tgz", + "integrity": "sha512-ZMp1V8ZFcPG5dIWnQLr3NSI1MiCU7UETdS/A0G8V/XWHvJv3ZsFqutJn1Y5RPmAPX6F3BiE397OqveU/9NCuIA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.6.0.tgz", + "integrity": "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@keyv/bigmap": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@keyv/bigmap/-/bigmap-1.3.1.tgz", + "integrity": "sha512-WbzE9sdmQtKy8vrNPa9BRnwZh5UF4s1KTmSK0KUVLo3eff5BlQNNWDnFOouNpKfPKDnms9xynJjsMYjMaT/aFQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "hashery": "^1.4.0", + "hookified": "^1.15.0" + }, + "engines": { + "node": ">= 18" + }, + "peerDependencies": { + "keyv": "^5.6.0" + } + }, + "node_modules/@keyv/serialize": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@keyv/serialize/-/serialize-1.1.1.tgz", + "integrity": "sha512-dXn3FZhPv0US+7dtJsIi2R+c7qWYiReoEh5zUntWCf4oSpMNib8FDhSoed6m3QyZdx5hK7iLFkYk3rNxwt8vTA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@oxc-project/types": { + "version": "0.160.0", + "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.160.0.tgz", + "integrity": "sha512-gw4k9syEmnckbOgw2A2FU1TBDdX9hfwV9jEn/uio65pguPzwWiXQS3OIJDMEhv9m06tj9XiEe6RoD0YA+LgreA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/oxc-project" + } + }, + "node_modules/@quansync/fs": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@quansync/fs/-/fs-1.1.0.tgz", + "integrity": "sha512-qAPG/t3HqML1TlN7sY/pTbEjzFVAKsMjNNMGheyDosro+kT4iw2KCUoHcVdmliwWjorm4elZbgNQyU2eD97eDg==", + "dev": true, + "license": "MIT", + "dependencies": { + "quansync": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sxzz" + } + }, + "node_modules/@remix-run/route-pattern": { + "version": "0.22.1", + "resolved": "https://registry.npmjs.org/@remix-run/route-pattern/-/route-pattern-0.22.1.tgz", + "integrity": "sha512-czdGJWh09Lapvcqt7Vb09KlrU2PhRJ8xQaI+AItTuD9aDJ5MAgxnS38lnys6Ll+6RJEqPiaUqTwIQhVLwFvv+w==", + "license": "MIT" + }, + "node_modules/@rolldown/binding-android-arm-eabi": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm-eabi/-/binding-android-arm-eabi-1.3.4.tgz", + "integrity": "sha512-xCW8CkL/ualx/SbYqeG9iK87lJCZGDQ0soE+kaORJ0Bd+pHALyE4qK7BStmEAyYWLEzZ3/biSIpA6/7GDFvzIg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-android-arm64": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.3.4.tgz", + "integrity": "sha512-5lifIO+b/prcM9sx/bkPN4w6UEToEfQ3gjhx0+0neuL+dkYskI792CfAq03T51jc8JFcaYXs2hi3l8RjiH/VWQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-darwin-arm64": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.3.4.tgz", + "integrity": "sha512-RCgxTI4AJQxhVF//BI3ImQOsXTHrF4Eg+f99jBy8WoETA2kSEGFxpnrVmW0leQq/2aBR4R5AC6csmy3rc66e3Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-darwin-x64": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.3.4.tgz", + "integrity": "sha512-zNPJVVPUaDEj+L0lImoK3rFv2b+Z5gNijI6DWu/fcD3/1TfmRXKb9ZyxbSN+2AhlctqjbNzUvCsMa+EBhnEM4Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-freebsd-x64": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.3.4.tgz", + "integrity": "sha512-upP6g7ZIRy5by1RDQ/EphHIdJ5xK0eUD7sUgfZFWJ49s4XdbYsIvIlAPtrFpayR70Hhf9J22lb4Pm8/9FhrZmg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm-gnueabihf": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.3.4.tgz", + "integrity": "sha512-SAX5C5+poMLCxu8dkPF6h5yst40rkzs+9Y3cbPn2OFSydmHjAEprrGi64zGgnYyPIVZfdGUFqJ2fJbfbnHI+mA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm64-gnu": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.3.4.tgz", + "integrity": "sha512-nwHqdlRZS6GWBef3dG5/pMY6RNTBBUjj7s0Da+m6xsFpe7jx6IC46SLZcCu8f46JOfCovZmwnrz51EzGE+7Fyw==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm64-musl": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.3.4.tgz", + "integrity": "sha512-Gr78X2ur/AgLCkmZgHffk/FerIX8S5zb/eII4bCcvJo0ANzeXhTShahdNbpnY6bpiszIAgIfiuKS9ziziWsamw==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-ppc64-gnu": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.3.4.tgz", + "integrity": "sha512-o9Wcn8nWrsQasaBRYM4d//FwhlBsTJYWkPVlhlt6FwzpwEoovY4IopRZjk5Fq3+ntRuSDORJjF/nA8sFeF2q6w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-s390x-gnu": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.3.4.tgz", + "integrity": "sha512-UDWu4jkVcx2kiBKm3Ec//4lVCbeTWj8gmJ9SyLWCdLWtTlyq7fQVeVV/14nXvRtSLErvJ2+yA/Ux5taS31Y17Q==", + "cpu": [ + "s390x" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-x64-gnu": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.3.4.tgz", + "integrity": "sha512-W9mGtTa0w4fWh8RLMNPyaEhhcuqUfO07Q4I1bBc4PDMNg7gQSw0yPQNQ3D0qwbkXwxbyL4YrIzc8n6k1vuFExQ==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-x64-musl": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.3.4.tgz", + "integrity": "sha512-8B+ofyQZ7/aCmkqnyMonPr5zKLqMVNczhRGFNtdIuItiwNn8iQWJawMq2E58r7bxD1XEbtRRsULY/eCWwZQ01Q==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-openharmony-arm64": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.3.4.tgz", + "integrity": "sha512-TlD0FSZaC7o2B4NCe9V5N11ugTnhzTM9ksj4sgRLvrKosDzjEkvlsTX3ehkw4ZlPv8AADimZZTvJGEa16pfXug==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-wasm32-wasi": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-wasm32-wasi/-/binding-wasm32-wasi-1.3.4.tgz", + "integrity": "sha512-jwO8P3o53ygo7b5061B7BeaJ1BGv3BKZ6jroFdw/01qWry7Z+qNBlDvulzbTle5s/A0Fc1FRgsTxrke9DvsSbA==", + "cpu": [ + "wasm32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@oxc-project/types": "0.160.0" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=23.5.0" + } + }, + "node_modules/@rolldown/binding-win32-arm64-msvc": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.3.4.tgz", + "integrity": "sha512-8adGMrNtrdzi2WD1ozhYapER59gD8Q/DV6SCKJlyG2HqULPdeQUBvMa33lTsiEYwIqTZUaIU2MmvPp5f1wbtXA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-win32-x64-msvc": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.3.4.tgz", + "integrity": "sha512-rIMjtESdXJCIoOiUTroQ1Y1rjVDZkuUVRUxs3APX2vNv175D7TDWvzdELiIhzGq9cUNUFat+co+PTmPHPqSREg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/pluginutils": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.1.1.tgz", + "integrity": "sha512-glFIJDvLNDtJhT9qrMFWLPbvS+skxgt4L0K8Ei2YtnhPysAJnsI7nyxSJxKj4ADeKX0OLjC4ntRkwpLOoS3rwA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@rollup/plugin-babel": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/@rollup/plugin-babel/-/plugin-babel-6.1.0.tgz", + "integrity": "sha512-dFZNuFD2YRcoomP4oYf+DvQNSUA9ih+A3vUqopQx5EdtPGo3WBnQcI/S8pwpz91UsGfL0HsMSOlaMld8HrbubA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-module-imports": "^7.18.6", + "@rollup/pluginutils": "^5.0.1" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0", + "@types/babel__core": "^7.1.9", + "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "@types/babel__core": { + "optional": true + }, + "rollup": { + "optional": true + } + } + }, + "node_modules/@rollup/plugin-node-resolve": { + "version": "16.0.3", + "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-16.0.3.tgz", + "integrity": "sha512-lUYM3UBGuM93CnMPG1YocWu7X802BrNF3jW2zny5gQyLQgRFJhV1Sq0Zi74+dh/6NBx1DxFC4b4GXg9wUCG5Qg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@rollup/pluginutils": "^5.0.1", + "@types/resolve": "1.20.2", + "deepmerge": "^4.2.2", + "is-module": "^1.0.0", + "resolve": "^1.22.1" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^2.78.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "node_modules/@rollup/plugin-replace": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/@rollup/plugin-replace/-/plugin-replace-6.0.3.tgz", + "integrity": "sha512-J4RZarRvQAm5IF0/LwUUg+obsm+xZhYnbMXmXROyoSE1ATJe3oXSb9L5MMppdxP2ylNSjv6zFBwKYjcKMucVfA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@rollup/pluginutils": "^5.0.1", + "magic-string": "^0.30.3" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "node_modules/@rollup/plugin-replace/node_modules/magic-string": { + "version": "0.30.21", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", + "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.5" + } + }, + "node_modules/@rollup/plugin-terser": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@rollup/plugin-terser/-/plugin-terser-1.1.0.tgz", + "integrity": "sha512-b6C6M5XyeKyMe+gmoquyRmrKEmaBfgHO1A/Z5NHDV060ECJEfmi4XV/7UuPm2UcT9IHmB65l0Hmi7ZZYSPRAtA==", + "dev": true, + "license": "MIT", + "dependencies": { + "serialize-javascript": "^7.0.3", + "smob": "^1.0.0", + "terser": "^5.49.2" + }, + "engines": { + "node": ">=20.0.0" + }, + "peerDependencies": { + "rollup": "^2.0.0||^3.0.0||^4.0.0||^5.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "node_modules/@rollup/pluginutils": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.6.0.tgz", + "integrity": "sha512-sHGIxCuydUbd2Rr3eg5TQqXSIA5Gi7esaC0T+v1Wr4n2jbJMXb9r133pRajV+5HM3dgr0bJIQQPO6ZxXabFTYQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0", + "estree-walker": "^2.0.2", + "picomatch": "^4.0.2" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0||^5.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "node_modules/@rollup/pluginutils/node_modules/estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "dev": true, + "license": "MIT" + }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.69.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.69.3.tgz", + "integrity": "sha512-WDG3WNktJVR+OTqdP/OrBg2b+JXXIgIZ+Ppzp7gjaRK9C59fn3vcFhUqjtxiscE9lygTYP3EFxY9xTLUfEFRaw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.69.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.69.3.tgz", + "integrity": "sha512-D5NgwE943sMSNRGoWFg9r2jPUG7EWk0/BYNgG3C/lIHAqY1M+GTA7EvQtCAJxKUv6gtb4lBOvx/0+8GS6yOIdA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-x64": { + "version": "4.69.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-x64/-/rollup-android-x64-4.69.3.tgz", + "integrity": "sha512-qT8AKzfYdZfAsoI/UFggqr1ghJfhW9GgGgDHTrYDviKvgGzqcteSjfaK0AwwJtbnbLu+FrMGF7RlGXfrZ1uFuA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.69.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.69.3.tgz", + "integrity": "sha512-UdQ9EDKcIyJEyQ7rKcxwfTVZt4SoM4o2NxTEWb6WFSK2SDEJKMEXjkEd6csGOfzKnr8xBUAtOLN7WnocRSjqdQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.69.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.69.3.tgz", + "integrity": "sha512-i1a4Erge+lLWo3sSlwX9LU/KK4CkaLZe7kvCc6Fc8NNKiW6mRcXcebRze9pPdGyfdA5SVcnl9pxekXK4O+Gbcw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-freebsd-arm64": { + "version": "4.69.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.69.3.tgz", + "integrity": "sha512-w30OkToJS0ed5UEqXBu61gg8/adzmcnvOc7qoZi+92FsOYtVmLlQGHeVqBn9GGiruk2aiDJpd1fMHwZhOhj8rw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-freebsd-x64": { + "version": "4.69.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.69.3.tgz", + "integrity": "sha512-Ze4Bo4axd2xzxG72ltgQtOcRuY1zyw47Z8bye5gDwgehBglMA0AQwGy2dL1MZ4ZutjdImwVc8jbL/geawm3wjA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.69.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.69.3.tgz", + "integrity": "sha512-hzMaEmx1VYvlfesicuLSI58962aaPvwK+J8Ksi1Qqy6GfM/Nsq8IDKYzw/Mg3DI5JlCwnuEcPj9ymzsAtk+sPA==", + "cpu": [ + "arm" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.69.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.69.3.tgz", + "integrity": "sha512-EZRv+RnscDTuXinvItllk8VNO81mdYjWlupt1QexTPOuSt9UDkRHH6C2ArJBiNyaHqxA/dDAuK3vWAFKLmMgAA==", + "cpu": [ + "arm" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.69.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.69.3.tgz", + "integrity": "sha512-8TNXGRkMqZ7QIL3KvpL0MXGE1ueqWnm1I40CQijo6G/CCKzoMUOsMdVmfgjPGl/G22+FtQMb3+6Moc6obmZ5vQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.69.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.69.3.tgz", + "integrity": "sha512-VWRKTMZq9N9EWxDRYgLAxE4Ory+O9ZO7+m0RjWlTjhtEF9V9ts/fnfgEjDisF2wYmmJA40c98HuREBlIT29S+w==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-gnu": { + "version": "4.69.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.69.3.tgz", + "integrity": "sha512-UNm9BN6OuckVOAYvsDT0JHGQF3Lt7gjcrZL5JzmR8JvzfMb4SGjUcWtBL+fkUjdwT81vsBvUyZMZCman6dwNxw==", + "cpu": [ + "loong64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-musl": { + "version": "4.69.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.69.3.tgz", + "integrity": "sha512-8w6fC76ChAodM1ZAEdpNlIkV7jq+HDHpa1xawVfOdwFsgWVWQkKcYa36bFlo58PWxfinMEuMWnyyWl4Ro3mjZA==", + "cpu": [ + "loong64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-gnu": { + "version": "4.69.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.69.3.tgz", + "integrity": "sha512-5J/hPeDhQ8hZLRpmaNpzI5G4fT0qQQC47uj1dwCdJwd8/yk8v0aiZJ0V+Sw4HGiScgMBANKVZyrzedHqRCilIQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-musl": { + "version": "4.69.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.69.3.tgz", + "integrity": "sha512-MBOWof2RZbbM2gTUagZsEwmIUAesxvB2zxnX3Af4M69NVdqDvGEXGkV8zYfXjLoJjiU7J1mzDHABmXhz5jMlZQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.69.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.69.3.tgz", + "integrity": "sha512-pzpggub9hyhZ89uAcXORCg6loWFoQOoTFatNpcJuiCqRdQvQa1oK37eG+vnVdFbULAzIuRlMZu23l3433OZi1g==", + "cpu": [ + "riscv64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-musl": { + "version": "4.69.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.69.3.tgz", + "integrity": "sha512-kUlaRxOwQKcdLSo2CrHpTVFZaKrrEONZz6yDmX2UUgzSsIUvNPGlgGEQ6mxBwCYWzIrXWtu0nILkYIc+5dZWDA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.69.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.69.3.tgz", + "integrity": "sha512-N/xL1PKN8D+CIX6/Mdnkr/T5FuZVzov5JbzQiGGaMlsVdPBi9If0qN8E91p3ex/JT9nCYKe9WNrKeml7xi87lg==", + "cpu": [ + "s390x" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.69.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.69.3.tgz", + "integrity": "sha512-uBpTadP1uQZZvVe+AV4dsTwNfs1H92Ra231OcHW2PVOYdW83PS899Wr3bXGbJO5erxWVfiZ70oPnhCPJ5utL3A==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.69.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.69.3.tgz", + "integrity": "sha512-4MWQvR0w9Ao4REGwJoFZxKKtU//Bd6vl0wIexJaG0EhxbrzMdIKotNkih+qJxlZjdJHf6/W3ETZ0CrEXeNTTcQ==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-openbsd-x64": { + "version": "4.69.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.69.3.tgz", + "integrity": "sha512-GC5b98fZgnb4MD0GSO/7XFVK7z2m/geaVS4CATdb7QA1VetuXhQJxTdlJblk4uriCmS9oexARH2fVbWR+FQOLA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ] + }, + "node_modules/@rollup/rollup-openharmony-arm64": { + "version": "4.69.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.69.3.tgz", + "integrity": "sha512-jrsZxYM1Zyr0QXuHVHoRGC6tvqakkr96Vvy2eM8HYqxtmlWpjITW7pCEzDkg/X/IjLuUdyGJ693E4WJ5NcUXxQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.69.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.69.3.tgz", + "integrity": "sha512-SnAwiYVNy5lfxVL7BQhtg3UbrAvAhSSonI342A5JbrznG6t8VvvkCDyLRXypQsRBvxIBVDrelpgR9yDIAlwS4w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.69.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.69.3.tgz", + "integrity": "sha512-85tt4vmTGSq04BsY0FKnYif4JHD2aR+MeoC1cUbdZkTvjOIYO3iHmPTpOf2nOympL6yZngvJjLmeoBzUsGUJmA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-gnu": { + "version": "4.69.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.69.3.tgz", + "integrity": "sha512-IpRuzCYcIfSNxcqHertICkJ7JSHM74TeN5lGleOE1jGK9dPphyIB2EfFud/8oZRrt3CVd3z10UIRzLJQflnVcg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.69.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.69.3.tgz", + "integrity": "sha512-dyv+ETPjCDTn03T5ZAnk+OvB+4+yg1onKgTb7jjv9LQ8KEwcvUkZmIPtNTdreULsKX0Amaod6C2W1iSFseTiwQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@simplewebauthn/browser": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/@simplewebauthn/browser/-/browser-14.0.0.tgz", + "integrity": "sha512-1odWVqeEBTl7lJ9zMKLEsmTlnyrDO5iRcTvfMKKk1WThUnp/i8JJdffdj2icP+tty159s4PgwE3BiMoEW9NFow==", + "license": "MIT" + }, + "node_modules/@tailwindcss/node": { + "version": "4.3.5", + "resolved": "https://registry.npmjs.org/@tailwindcss/node/-/node-4.3.5.tgz", + "integrity": "sha512-yT53FzV4ke0cr/BguDxhWMpm5MJu1O2muzk+tKw6lKHjODAsYArBbWwFbJiaksfzFv1tpkO9QHGzmfs1hJT66g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/remapping": "^2.3.5", + "enhanced-resolve": "^5.24.5", + "jiti": "^2.7.0", + "lightningcss": "1.33.0", + "magic-string": "^1.1.0", + "source-map-js": "^1.2.1", + "tailwindcss": "4.3.5" + } + }, + "node_modules/@tailwindcss/oxide": { + "version": "4.3.5", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide/-/oxide-4.3.5.tgz", + "integrity": "sha512-PynqGLZsZvwM9tqD/CUxkOIfyd6K5elZ2MooauzJryP/UqXYgi3yYbtt3N0Xe+MHV/eFKPFQCEfIKAqlAS1CBg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 20" + }, + "optionalDependencies": { + "@tailwindcss/oxide-android-arm64": "4.3.5", + "@tailwindcss/oxide-darwin-arm64": "4.3.5", + "@tailwindcss/oxide-darwin-x64": "4.3.5", + "@tailwindcss/oxide-freebsd-x64": "4.3.5", + "@tailwindcss/oxide-linux-arm-gnueabihf": "4.3.5", + "@tailwindcss/oxide-linux-arm64-gnu": "4.3.5", + "@tailwindcss/oxide-linux-arm64-musl": "4.3.5", + "@tailwindcss/oxide-linux-x64-gnu": "4.3.5", + "@tailwindcss/oxide-linux-x64-musl": "4.3.5", + "@tailwindcss/oxide-wasm32-wasi": "4.3.5", + "@tailwindcss/oxide-win32-arm64-msvc": "4.3.5", + "@tailwindcss/oxide-win32-x64-msvc": "4.3.5" + } + }, + "node_modules/@tailwindcss/oxide-android-arm64": { + "version": "4.3.5", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-android-arm64/-/oxide-android-arm64-4.3.5.tgz", + "integrity": "sha512-Se0z5xMqcSQanJD1IYmO0cGpK3iv0fp3ZsIT7xRJZ1Da5PghvNoc46zz4jIQn+aan3dV9T8AermFNN9QPmsh0Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-darwin-arm64": { + "version": "4.3.5", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-darwin-arm64/-/oxide-darwin-arm64-4.3.5.tgz", + "integrity": "sha512-UPrgTDuUbvmqGMZuCnmI3FKee/tYKzKdp00/kuB4oSGB213VYg8QTdF7lVhnPoBXq/mIfJ+ILoBFqNOboWcMwQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-darwin-x64": { + "version": "4.3.5", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-darwin-x64/-/oxide-darwin-x64-4.3.5.tgz", + "integrity": "sha512-E+p7HEtjI0b8D7kbbWxH067cGui6d4c79COGko9fAPVE3rwc1E7ld2HFCbaG86AOGWS5VKQYqZOaf38ya4uxTQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-freebsd-x64": { + "version": "4.3.5", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-freebsd-x64/-/oxide-freebsd-x64-4.3.5.tgz", + "integrity": "sha512-yWEWcWyAG7rWOcTpJTjdhQ3pcaFY2h+0bqTRfgU3G2fz87ZU3AKdvdZKhslD+kyHnjBUWKvNdRYwIYC5dI1tIg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-linux-arm-gnueabihf": { + "version": "4.3.5", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm-gnueabihf/-/oxide-linux-arm-gnueabihf-4.3.5.tgz", + "integrity": "sha512-WmeVjtJhZlr+smpqcdR2kQkkn6arHIJnUIBxTO2EJcTLGY1ecVXNo2hbSn8xc0IH2aEtys936iMWKGyj0GaKnA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-linux-arm64-gnu": { + "version": "4.3.5", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm64-gnu/-/oxide-linux-arm64-gnu-4.3.5.tgz", + "integrity": "sha512-DTCSyucc6ShMp1QMqV5R94Z7xlgNgUzkGmFF1rL5HH2Qjy4eSmEqy+YLGkqqYvWa4sILtgrBt1JjRKbneQtiFQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-linux-arm64-musl": { + "version": "4.3.5", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm64-musl/-/oxide-linux-arm64-musl-4.3.5.tgz", + "integrity": "sha512-H9lsvO4x9E4nE4Hi8h7NHHw0O/kcVSu+iOyFHNGdYzazGgDjFHZbE6S3hQ8kMcbNXSBlMdNi67LV5EVqtpaJtw==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-linux-x64-gnu": { + "version": "4.3.5", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-x64-gnu/-/oxide-linux-x64-gnu-4.3.5.tgz", + "integrity": "sha512-4uxQvtBvPuIdl13WfUBj9xMZHH14PtHZ8OZdtLmdyDtG66sCa1t599NZT+jagkUzRtWhuul1qRZQ1nAJscXN5g==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-linux-x64-musl": { + "version": "4.3.5", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-x64-musl/-/oxide-linux-x64-musl-4.3.5.tgz", + "integrity": "sha512-0JQAzs7jwbA7O6+z/adU+Jk3AXwsu3npAhtr5escXS7TqEqWcaDV7qHuI+0Vy/KQRuVGnLQREcSJWYauyV3oqg==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-wasm32-wasi": { + "version": "4.3.5", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-wasm32-wasi/-/oxide-wasm32-wasi-4.3.5.tgz", + "integrity": "sha512-OJhFmlEfdzMr+avACdi40RPtnkW0B6hXyxL/8r+tnEHBWZji36CYRjEXrrvgBmaYsD3oEOBqwYFRKsYvzFe7Bw==", + "bundleDependencies": [ + "@napi-rs/wasm-runtime", + "@emnapi/core", + "@emnapi/runtime", + "@tybys/wasm-util", + "@emnapi/wasi-threads", + "tslib" + ], + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/core": "^1.11.3", + "@emnapi/runtime": "^1.11.3", + "@emnapi/wasi-threads": "^1.2.3", + "@napi-rs/wasm-runtime": "^1.2.2", + "@tybys/wasm-util": "^0.10.3", + "tslib": "^2.8.1" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=23.5.0" + } + }, + "node_modules/@tailwindcss/oxide-wasm32-wasi/node_modules/@emnapi/core": { + "version": "1.11.3", + "dev": true, + "inBundle": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/wasi-threads": "1.2.3", + "tslib": "^2.4.0" + } + }, + "node_modules/@tailwindcss/oxide-wasm32-wasi/node_modules/@emnapi/runtime": { + "version": "1.11.3", + "dev": true, + "inBundle": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@tailwindcss/oxide-wasm32-wasi/node_modules/@emnapi/wasi-threads": { + "version": "1.2.3", + "dev": true, + "inBundle": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@tailwindcss/oxide-wasm32-wasi/node_modules/@napi-rs/wasm-runtime": { + "version": "1.2.2", + "dev": true, + "inBundle": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@tybys/wasm-util": "^0.10.3" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=23.5.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Brooooooklyn" + }, + "peerDependencies": { + "@emnapi/core": "^1.7.1 || ^2.0.0-alpha.3", + "@emnapi/runtime": "^1.7.1 || ^2.0.0-alpha.3" + } + }, + "node_modules/@tailwindcss/oxide-wasm32-wasi/node_modules/@tybys/wasm-util": { + "version": "0.10.3", + "dev": true, + "inBundle": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@tailwindcss/oxide-wasm32-wasi/node_modules/tslib": { + "version": "2.8.1", + "dev": true, + "inBundle": true, + "license": "0BSD", + "optional": true + }, + "node_modules/@tailwindcss/oxide-win32-arm64-msvc": { + "version": "4.3.5", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-win32-arm64-msvc/-/oxide-win32-arm64-msvc-4.3.5.tgz", + "integrity": "sha512-9o8jgthi+QE5eandnboiJT64VQfnIArfZzSTdgbhEK5aafdiu2jTW9Honi/mwYHxBZuH1vAC57IFyrh+0iK5Gg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-win32-x64-msvc": { + "version": "4.3.5", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-win32-x64-msvc/-/oxide-win32-x64-msvc-4.3.5.tgz", + "integrity": "sha512-XiKFfIy1RWe7qK4WqByxNW7Oz1/nkOy8o/BWhHminyV1PmpUd8Eedj5v2A8h2kpqeVlz6xRnwk9Fr/ZXNLcZfg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/vite": { + "version": "4.3.5", + "resolved": "https://registry.npmjs.org/@tailwindcss/vite/-/vite-4.3.5.tgz", + "integrity": "sha512-BCNiY0a1ZjdOHVqw7kyb7U72BwfMF3dfUuN+tQsLWky/J5JOI/r7abibglXfygrZhVO/3u3V+E25kkKTeMkXaQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@tailwindcss/node": "4.3.5", + "@tailwindcss/oxide": "4.3.5", + "tailwindcss": "4.3.5" + }, + "peerDependencies": { + "vite": "^5.2.0 || ^6 || ^7 || ^8" + } + }, + "node_modules/@tanstack/query-core": { + "version": "5.108.4", + "resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-5.108.4.tgz", + "integrity": "sha512-2Ks5dlLWz4eXJrthOyG0qW3SLt3xx0RrQmAmN0rnmogiaaOYuWiAe6HAm9KE2b2v8nig+vraNz8fsfZ6fF6zFg==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/tannerlinsley" + } + }, + "node_modules/@tanstack/react-query": { + "version": "5.108.4", + "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.108.4.tgz", + "integrity": "sha512-GlTa94kfEKTVsbzXe58rFA3GZ0ZE7N1aFtbZAfOS3XxMv8YNn4C+8rsz40LorHLazdm5PsqCroWaYAR+ZkMXMQ==", + "license": "MIT", + "dependencies": { + "@tanstack/query-core": "5.108.4" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/tannerlinsley" + }, + "peerDependencies": { + "@types/react": "^18 || ^19", + "react": "^18 || ^19" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@trickfilm400/rollup-plugin-off-main-thread": { + "version": "3.0.0-pre1", + "resolved": "https://registry.npmjs.org/@trickfilm400/rollup-plugin-off-main-thread/-/rollup-plugin-off-main-thread-3.0.0-pre1.tgz", + "integrity": "sha512-/67zpWDBLV+oYAEL682s1ktXL0HgqX76f6gaVGkGnVZlBbm1zd0v4Bz8MFF2GGhoX9rvfq3KSQHubFHwa6w6/Q==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "ejs": "^3.1.10", + "json5": "^2.2.3", + "magic-string": "^0.30.21", + "string.prototype.matchall": "^4.0.12" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@trickfilm400/rollup-plugin-off-main-thread/node_modules/magic-string": { + "version": "0.30.21", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", + "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.5" + } + }, + "node_modules/@types/chai": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-5.2.3.tgz", + "integrity": "sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/deep-eql": "*", + "assertion-error": "^2.0.1" + } + }, + "node_modules/@types/deep-eql": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/deep-eql/-/deep-eql-4.0.2.tgz", + "integrity": "sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/esrecurse": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/@types/esrecurse/-/esrecurse-4.3.1.tgz", + "integrity": "sha512-xJBAbDifo5hpffDBuHl0Y8ywswbiAp/Wi7Y/GtAgSlZyIABppyurxVueOPE8LUQOxdlgi6Zqce7uoEpqNTeiUw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/estree": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.11.tgz", + "integrity": "sha512-YBdNe5JcjYR0sPhJW1QIeRCmI11YhYvaRuGCs9+WCeTTb+Yhb2BE2XMe5/wAqF10FK5g3+q1PDhQABfT7aX0gg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "26.6.11", + "resolved": "https://registry.npmjs.org/@types/node/-/node-26.6.11.tgz", + "integrity": "sha512-uUyQ2XLEz+EXh34lmS3GhKrkqn/8FU7KUiKRpk347At2bmnMVWss45yz8b4FG/tUtmV1tV/+TVkITItPROyeeQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~8.9.0" + } + }, + "node_modules/@types/react": { + "version": "19.3.3", + "resolved": "https://registry.npmjs.org/@types/react/-/react-19.3.3.tgz", + "integrity": "sha512-K8uWpJc4teiuOPdiP1umjeA9rGMgVPiXuoL66fcS1QlwBT1WMqY8PORmub9FadopIs+RCW6siYEs7Lpq+vDlog==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "csstype": "^3.2.2" + } + }, + "node_modules/@types/react-dom": { + "version": "19.3.0", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-19.3.0.tgz", + "integrity": "sha512-ZI7bU42mZXXKHn/qNLEw2IrbiINU7X5+vfgdixBHkCNpYWXjKgfQ/P+uyGb5CjOLB9UcnTeg3rylQtV2hym44Q==", + "devOptional": true, + "license": "MIT", + "peerDependencies": { + "@types/react": "^19.3.0" + } + }, + "node_modules/@types/resolve": { + "version": "1.20.2", + "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.20.2.tgz", + "integrity": "sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/trusted-types": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.7.tgz", + "integrity": "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "8.74.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.74.0.tgz", + "integrity": "sha512-z3KXk1+Vm+d82ZRplOoC89ho4Rf1da5ju6sx8//92GnN532U62DGPjECXkkVqtYzIv0zoJlpO39SX2Z9tk6LVw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/regexpp": "^4.12.2", + "@typescript-eslint/scope-manager": "8.74.0", + "@typescript-eslint/type-utils": "8.74.0", + "@typescript-eslint/utils": "8.74.0", + "@typescript-eslint/visitor-keys": "8.74.0", + "ignore": "^7.0.5", + "natural-compare": "^1.4.0", + "ts-api-utils": "^2.5.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^8.74.0", + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": { + "version": "7.0.17", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.17.tgz", + "integrity": "sha512-0c3zcBRlWmcKhcIQWckzkYncJRv5HHB8O32wO/FcWL8DDXWDJgiEF6SX9ThbTv5h/eZ+xJK+VvDjjQ+cQJhp3Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "8.74.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.74.0.tgz", + "integrity": "sha512-ecr8AYdig7avVkxaHdQvxHnIJ/mOyliO4Gv/uWF8q69vBew/z3sexqBwHUZX5Vql+Ns0w4sH6gBLkICGbOvJkA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/scope-manager": "8.74.0", + "@typescript-eslint/types": "8.74.0", + "@typescript-eslint/typescript-estree": "8.74.0", + "@typescript-eslint/visitor-keys": "8.74.0", + "debug": "^4.4.3" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/project-service": { + "version": "8.74.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.74.0.tgz", + "integrity": "sha512-z/mymuE+JlEeSFIv3Mo70EvgG1Zz74Hl0IDfExfXutARAP834bt+MppTD7mVAwmZO0GdxdOAi0jbTam749eH6g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/tsconfig-utils": "^8.74.0", + "@typescript-eslint/types": "^8.74.0", + "debug": "^4.4.3" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "8.74.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.74.0.tgz", + "integrity": "sha512-kpOdpu4CpWN5U38ox3f727DwWRBtUAVhyUJtqTBYe5gf2wYoxac7PgKP14txrxN7ICVtcjlLdzjqfRgpSnDKvQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.74.0", + "@typescript-eslint/visitor-keys": "8.74.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/tsconfig-utils": { + "version": "8.74.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.74.0.tgz", + "integrity": "sha512-p07wAuaS6BjCYgOSXKJi4YhvTnAf7fiG37e9THcpnYaQEt2QiTTYZWKwUFNgeRiywiMudazhzgddAirZ0GgHtQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/type-utils": { + "version": "8.74.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.74.0.tgz", + "integrity": "sha512-CV3Y3la8l3F9ANfxcfpgSSiQgJTe4IeLEoZV4O/gcW86Ugp8X6SKiQ0vm+QegXaRIbbDMokZZSF3A1CgiU/kPw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.74.0", + "@typescript-eslint/typescript-estree": "8.74.0", + "@typescript-eslint/utils": "8.74.0", + "debug": "^4.4.3", + "ts-api-utils": "^2.5.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/types": { + "version": "8.74.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.74.0.tgz", + "integrity": "sha512-MpnMrJCVNpP1iVL8NiHkQZgQqIMBH5ewDGUPBh1pqQXwFtMFjsl1M03QcYPXmv6stCKEiF0PN7CGbU1ZbXFzEA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "8.74.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.74.0.tgz", + "integrity": "sha512-wL348k6l92DNG+kPP5rVpKwNBoz7a3xRZy3TPKc1uymQttd7u7gcMv3eENmcuh4CjC4mO3FTM0DYstFXMyDLuw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/project-service": "8.74.0", + "@typescript-eslint/tsconfig-utils": "8.74.0", + "@typescript-eslint/types": "8.74.0", + "@typescript-eslint/visitor-keys": "8.74.0", + "debug": "^4.4.3", + "minimatch": "^11.0.1", + "semver": "^7.7.3", + "tinyglobby": "^0.2.15", + "ts-api-utils": "^2.5.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript/native": "npm:typescript@>=7.1.0-dev.20261009.1 || >=7.1.0-beta <7.1.0-dev", + "typescript": ">=4.8.4 <6.1.0" + }, + "peerDependenciesMeta": { + "@typescript/native": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/semver": { + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.6.tgz", + "integrity": "sha512-9lpSSU4Mly3mrtruwLs1eLK6+gzbzqeBFwRNjIjE+9LuDpWdYctrQlQ3ej1Ilgi7gknpsTRnPoLP8DpCHqHIJw==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@typescript-eslint/utils": { + "version": "8.74.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.74.0.tgz", + "integrity": "sha512-IpWXPxXXomzxyTcvjhZJexgdvtTR1TooLAPpuxzaGqQ8BHll1lf4Ysp/BTE/l0U5TJ+x1j7B4bEM8pLRrvY+XA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.9.1", + "@typescript-eslint/scope-manager": "8.74.0", + "@typescript-eslint/types": "8.74.0", + "@typescript-eslint/typescript-estree": "8.74.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "8.74.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.74.0.tgz", + "integrity": "sha512-XSZmOtMUbWCBIM+2BK134FyMFxmll1mW2mPLk/PSwYQYzGIPMgJAqL929U4qXVizLv7Xq5b7r41/o7Ombuwk0g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.74.0", + "eslint-visitor-keys": "^5.0.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@vite-pwa/assets-generator": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@vite-pwa/assets-generator/-/assets-generator-2.0.0.tgz", + "integrity": "sha512-GBjHBLBzOP1GDJTc7MjeDdeJTi+PS9eFjw3HYjNHXnEbkS7vRS/YFwl8VW5/4vWF0Fo35Mji1yXAABvSVzu0Ew==", + "dev": true, + "license": "MIT", + "dependencies": { + "cac": "^7.0.0", + "consola": "^3.4.2", + "picocolors": "^1.1.1", + "sharp": "^0.35.4", + "sharp-ico": "^0.1.5", + "unconfig": "^7.5.0" + }, + "bin": { + "pwa-assets-generator": "bin/pwa-assets-generator.mjs" + }, + "engines": { + "node": ">=20.19.0" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/@vitejs/plugin-react": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-6.3.1.tgz", + "integrity": "sha512-kYc/mQZ8hnpFXNJXdrbm6kUbLya+V+Q5o3V2j06tR+4lVSyY9Pgx0eBw+eYTVseNUiMY2hr/3PM/EHVOYNKuHw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@rolldown/pluginutils": "^1.1.1" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "peerDependencies": { + "@rolldown/plugin-babel": "^0.1.7 || ^0.2.0 || ^0.3.0", + "babel-plugin-react-compiler": "^1.0.0", + "oxc-transform-react": ">=0.152.0 <0.157.0", + "vite": "^8.0.0" + }, + "peerDependenciesMeta": { + "@rolldown/plugin-babel": { + "optional": true + }, + "babel-plugin-react-compiler": { + "optional": true + }, + "oxc-transform-react": { + "optional": true + } + } + }, + "node_modules/@vitest/mocker": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-5.1.2.tgz", + "integrity": "sha512-UGc97wUIy0Ji2+9GxzHEJiOhiwkaukgE7VYcUNnjpX3sWnwQ8XogmNXX4WyOukxYgKb8Nh2XFa7KId0ZjpmVhQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/trace-mapping": "0.3.31", + "@vitest/spy": "5.1.2", + "estree-walker": "^3.0.3", + "magic-string": "^1.4.5" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "msw": "^2.4.9 || ^3.0.0", + "vite": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "msw": { + "optional": true + }, + "vite": { + "optional": true + } + } + }, + "node_modules/@vitest/spy": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-5.1.2.tgz", + "integrity": "sha512-PQl0/3+p9GaY71+MHywN6oyHfLhVDD5kcbm7oNRldA2F0ExMU3S8RQdnpteJ9gFAdK5P6KCgE6LqCpUgy57KzA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@xterm/addon-fit": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@xterm/addon-fit/-/addon-fit-0.11.0.tgz", + "integrity": "sha512-jYcgT6xtVYhnhgxh3QgYDnnNMYTcf8ElbxxFzX0IZo+vabQqSPAjC3c1wJrKB5E19VwQei89QCiZZP86DCPF7g==", + "license": "MIT" + }, + "node_modules/@xterm/addon-unicode11": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/@xterm/addon-unicode11/-/addon-unicode11-0.9.0.tgz", + "integrity": "sha512-FxDnYcyuXhNl+XSqGZL/t0U9eiNb/q3EWT5rYkQT/zuig8Gz/VagnQANKHdDWFM2lTMk9ly0EFQxxxtZUoRetw==", + "license": "MIT" + }, + "node_modules/@xterm/addon-web-links": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/@xterm/addon-web-links/-/addon-web-links-0.12.0.tgz", + "integrity": "sha512-4Smom3RPyVp7ZMYOYDoC/9eGJJJqYhnPLGGqJ6wOBfB8VxPViJNSKdgRYb8NpaM6YSelEKbA2SStD7lGyqaobw==", + "license": "MIT" + }, + "node_modules/@xterm/addon-webgl": { + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/@xterm/addon-webgl/-/addon-webgl-0.19.0.tgz", + "integrity": "sha512-b3fMOsyLVuCeNJWxolACEUED0vm7qC0cy4wRvf3oURSzDTYVQiGPhTnhWZwIHdvC48Y+oLhvYXnY4XDXPoJo6A==", + "license": "MIT" + }, + "node_modules/@xterm/xterm": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@xterm/xterm/-/xterm-6.0.0.tgz", + "integrity": "sha512-TQwDdQGtwwDt+2cgKDLn0IRaSxYu1tSUjgKarSDkUM0ZNiSRXFpjxEsvc/Zgc5kq5omJ+V0a8/kIM2WD3sMOYg==", + "license": "MIT", + "workspaces": [ + "addons/*" + ] + }, + "node_modules/acorn": { + "version": "8.19.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.19.0.tgz", + "integrity": "sha512-oJlA3XiRm7Cyk6qFD2Jn8ak9B7jSy0qy00ADO3+8dpT0LSjFihQYv4C02LFCSYJV3Q37xYwwRy5m+IpIiUzqWw==", + "dev": true, + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/ajv": { + "version": "6.15.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.15.0.tgz", + "integrity": "sha512-fgFx7Hfoq60ytK2c7DhnF8jIvzYgOMxfugjLOSMHjLIPgenqa7S7oaagATUq99mV6IYvN2tRmC0wnTYX6iPbMw==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/array-buffer-byte-length": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.2.tgz", + "integrity": "sha512-LHE+8BuR7RYGDKvnrmcuSq3tDcKv9OFEXQt/HpbZhY7V6h0zlUXutnAD82GiFx9rdieCMjkvtcsPqBwgUl1Iiw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "is-array-buffer": "^3.0.5" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/arraybuffer.prototype.slice": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.4.tgz", + "integrity": "sha512-BNoCY6SXXPQ7gF2opIP4GBE+Xw7U+pHMYKuzjgCN3GwiaIR09UUeKfheyIry77QtrCBlC0KK0q5/TER/tYh3PQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-buffer-byte-length": "^1.0.1", + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.5", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "is-array-buffer": "^3.0.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/assertion-error": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", + "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + } + }, + "node_modules/async": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz", + "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==", + "dev": true, + "license": "MIT" + }, + "node_modules/async-function": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/async-function/-/async-function-1.0.0.tgz", + "integrity": "sha512-hsU18Ae8CDTR6Kgu9DYf0EbCr/a5iGL0rytQDobUcdpYOKokk8LEjVphnXkDkgpi0wYVsqrXuP0bZxJaTqdgoA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/at-least-node": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", + "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">= 4.0.0" + } + }, + "node_modules/available-typed-arrays": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", + "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "possible-typed-array-names": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/babel-plugin-polyfill-corejs2": { + "version": "0.4.17", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.17.tgz", + "integrity": "sha512-aTyf30K/rqAsNwN76zYrdtx8obu0E4KoUME29B1xj+B3WxgvWkp943vYQ+z8Mv3lw9xHXMHpvSPOBxzAkIa94w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/compat-data": "^7.28.6", + "@babel/helper-define-polyfill-provider": "^0.6.8", + "semver": "^6.3.1" + }, + "peerDependencies": { + "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" + } + }, + "node_modules/babel-plugin-polyfill-corejs3": { + "version": "0.14.2", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.14.2.tgz", + "integrity": "sha512-coWpDLJ410R781Npmn/SIBZEsAetR4xVi0SxLMXPaMO4lSf1MwnkGYMtkFxew0Dn8B3/CpbpYxN0JCgg8mn67g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-define-polyfill-provider": "^0.6.8", + "core-js-compat": "^3.48.0" + }, + "peerDependencies": { + "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" + } + }, + "node_modules/babel-plugin-polyfill-regenerator": { + "version": "0.6.8", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.6.8.tgz", + "integrity": "sha512-M762rNHfSF1EV3SLtnCJXFoQbbIIz0OyRwnCmV0KPC7qosSfCO0QLTSuJX3ayAebubhE6oYBAYPrBA5ljowaZg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-define-polyfill-provider": "^0.6.8" + }, + "peerDependencies": { + "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" + } + }, + "node_modules/balanced-match": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/baseline-browser-mapping": { + "version": "2.11.42", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.11.42.tgz", + "integrity": "sha512-zZavzWoNo65+3gcv5AQetEgQ86Rbsge3QPe3wjQFjl1D4/mYzqreOR6DkE0SMMBqYr95w0mLi+69+V0SSeOStQ==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "baseline-browser-mapping": "dist/cli.cjs" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/brace-expansion": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.1.2.tgz", + "integrity": "sha512-ELhY3JEerIBbhgW+rh0/8glkZAaMqn1x3BAvp3yTULSEGozMK/5PT6WTdBgsdvJqwwmv7MAQNOydfYbvK1Vgfw==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^4.0.2" + }, + "engines": { + "node": "20 || >=22" + } + }, + "node_modules/browserslist": { + "version": "4.29.6", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.29.6.tgz", + "integrity": "sha512-CmVVIQ3RVc5HxYEc9X84GvxK/C8C1wH8TlKAiO7uTxF8PDwt7r8t9Qk3J9NkMOVzX5O/HbLv3yzxZg9HPrnI9w==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "baseline-browser-mapping": "^2.11.37", + "caniuse-lite": "^1.0.30001826", + "electron-to-chromium": "^1.5.486", + "node-releases": "^2.0.64", + "update-browserslist-db": "^1.4.0" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/cac": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/cac/-/cac-7.1.1.tgz", + "integrity": "sha512-8zc+h51HxpodKsA7L4PpBNd+9qlrfuUcyUDE5a793BJfN4NZgwk7v9NmrY3ptZ+Sk0+ToigxSzkb47AsEgyizw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=20.19.0" + } + }, + "node_modules/cacheable": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/cacheable/-/cacheable-2.5.0.tgz", + "integrity": "sha512-60cyAOytib/OzBw1JNSoSV/boK1AtHryDIjvVBk7XbN4ugfkM3+Sry7fEjNgPMGgOjuaZPAp8ruZ0Cxafwyq9g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@cacheable/memory": "^2.2.0", + "@cacheable/utils": "^2.5.0", + "hookified": "^1.15.0", + "keyv": "^5.6.0", + "qified": "^0.10.1" + } + }, + "node_modules/call-bind": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.9.tgz", + "integrity": "sha512-a/hy+pNsFUTR+Iz8TCJvXudKVLAnz/DyeSUo10I5yvFDQJBFU2s9uqQpoSrJlroHUKoKqzg+epxyP9lqFdzfBQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "get-intrinsic": "^1.3.0", + "set-function-length": "^1.2.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001830", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001830.tgz", + "integrity": "sha512-0TFl6VuW52V0JxUPXnqjNNxZ9I8bAH9to34KYZZBUWe/5yD+YBWda/mBXxlwnLLHm5LSoGyyo2KeuNheSJXywA==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "CC-BY-4.0" + }, + "node_modules/chai": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/chai/-/chai-6.3.0.tgz", + "integrity": "sha512-XWAtwJ6OHO+tj0EKCs0Y2UamnyOxseZWltU4x2U2wh8g4AigdjwvtUjvLP2tqkA/avxHEtzxNaqGq/YGNwckKg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/common-tags": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/common-tags/-/common-tags-1.8.2.tgz", + "integrity": "sha512-gk/Z852D2Wtb//0I+kRFNKKE9dIIVirjoqPoA1wJU+XePVXZfGeBpk45+A1rKO4Q43prqWBNY/MiIeRLbPWUaA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/consola": { + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/consola/-/consola-3.4.2.tgz", + "integrity": "sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.18.0 || >=16.10.0" + } + }, + "node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true, + "license": "MIT" + }, + "node_modules/cookie-es": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/cookie-es/-/cookie-es-3.1.1.tgz", + "integrity": "sha512-UaXxwISYJPTr9hwQxMFYZ7kNhSXboMXP+Z3TRX6f1/NyaGPfuNUZOWP1pUEb75B2HjfklIYLVRfWiFZJyC6Npg==", + "license": "MIT" + }, + "node_modules/core-js-compat": { + "version": "3.51.0", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.51.0.tgz", + "integrity": "sha512-52r6fkXgxv4GLMjmFcMWRx7X9bw071xTTdrDcdyPGRqU2oE+9pCG0bAOMifSBdLw0JRBZKEF0q3B55qPlLuE8g==", + "dev": true, + "license": "MIT", + "dependencies": { + "browserslist": "^4.29.3" + }, + "engines": { + "node": ">=6.4.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/core-js" + } + }, + "node_modules/cross-spawn": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.1.2.tgz", + "integrity": "sha512-8BPK2r+sKWC8sDinRwLwrFMq2lXTBBwzYYEB9LiCznfMurOi4FOvQflq3XOLGG+HPdMSVpe+k/s96+AtDEOgPg==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/crypto-random-string": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-2.0.0.tgz", + "integrity": "sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/csstype": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.4.tgz", + "integrity": "sha512-PoKaoPzQapnEoqUSnHx1u6W6ku8CVEgKsnpmmzU3m1nwkidpPBQ8V/Zq2+bWNrsOKoKLwTGdbx6xF7BXP1zLVQ==", + "devOptional": true, + "license": "MIT" + }, + "node_modules/data-view-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.2.tgz", + "integrity": "sha512-EmKO5V3OLXh1rtK2wgXRansaK1/mtVdTUEiEI0W8RkvgT05kfxaH29PliLnpLP73yYO6142Q72QNa8Wx/A5CqQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/data-view-byte-length": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.2.tgz", + "integrity": "sha512-tuhGbE6CfTM9+5ANGf+oQb72Ky/0+s3xKUpHvShfiz2RxMFgFPjsXuRLBVMtvMs15awe45SRb83D6wH4ew6wlQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/inspect-js" + } + }, + "node_modules/data-view-byte-offset": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.1.tgz", + "integrity": "sha512-BS8PfmtDGnrgYdOonGZQdLZslWIeCGFP9tpan0hi1Co2Zr2NKADsvGYA8XxuG/4UWgJ6Cjtv+YJnB6MM69QGlQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/decode-bmp": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/decode-bmp/-/decode-bmp-0.2.1.tgz", + "integrity": "sha512-NiOaGe+GN0KJqi2STf24hfMkFitDUaIoUU3eKvP/wAbLe8o6FuW5n/x7MHPR0HKvBokp6MQY/j7w8lewEeVCIA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@canvas/image-data": "^1.0.0", + "to-data-view": "^1.1.0" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/decode-ico": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/decode-ico/-/decode-ico-0.4.1.tgz", + "integrity": "sha512-69NZfbKIzux1vBOd31al3XnMnH+2mqDhEgLdpygErm4d60N+UwA5Sq5WFjmEDQzumgB9fElojGwWG0vybVfFmA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@canvas/image-data": "^1.0.0", + "decode-bmp": "^0.2.0", + "to-data-view": "^1.1.0" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/deepmerge": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", + "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/define-properties": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", + "dev": true, + "license": "MIT", + "dependencies": { + "define-data-property": "^1.0.1", + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/defu": { + "version": "6.1.7", + "resolved": "https://registry.npmjs.org/defu/-/defu-6.1.7.tgz", + "integrity": "sha512-7z22QmUWiQ/2d0KkdYmANbRUVABpZ9SNYyH5vx6PZ+nE5bcC0l7uFvEfHlyld/HcGBFTL536ClDt3DEcSlEJAQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/detect-libc": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=8" + } + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/ejs": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.10.tgz", + "integrity": "sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "jake": "^10.8.5" + }, + "bin": { + "ejs": "bin/cli.js" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/electron-to-chromium": { + "version": "1.5.501", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.501.tgz", + "integrity": "sha512-UVcdnFm1UW3UZBBL/Nsi7mLqdxGqUbzW0rO0WsdEqwJr4vnFWrs93MBig2neS0TnQ5MUCwg3y91FhM/+oZE4hg==", + "dev": true, + "license": "ISC" + }, + "node_modules/enhanced-resolve": { + "version": "5.27.2", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.27.2.tgz", + "integrity": "sha512-Cpp3nuaI7ZdgEsvVP6zzk08uxrfGTSUnDwijv6PZfe8qHjcUYv5X9bJF71WTt5HwOeaeVandf9zACK4jcWroNw==", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.4", + "tapable": "^2.3.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/es-abstract": { + "version": "1.24.2", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.24.2.tgz", + "integrity": "sha512-2FpH9Q5i2RRwyEP1AylXe6nYLR5OhaJTZwmlcP0dL/+JCbgg7yyEo/sEK6HeGZRf3dFpWwThaRHVApXSkW3xeg==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-buffer-byte-length": "^1.0.2", + "arraybuffer.prototype.slice": "^1.0.4", + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.8", + "call-bound": "^1.0.4", + "data-view-buffer": "^1.0.2", + "data-view-byte-length": "^1.0.2", + "data-view-byte-offset": "^1.0.1", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "es-set-tostringtag": "^2.1.0", + "es-to-primitive": "^1.3.0", + "function.prototype.name": "^1.1.8", + "get-intrinsic": "^1.3.0", + "get-proto": "^1.0.1", + "get-symbol-description": "^1.1.0", + "globalthis": "^1.0.4", + "gopd": "^1.2.0", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "internal-slot": "^1.1.0", + "is-array-buffer": "^3.0.5", + "is-callable": "^1.2.7", + "is-data-view": "^1.0.2", + "is-negative-zero": "^2.0.3", + "is-regex": "^1.2.1", + "is-set": "^2.0.3", + "is-shared-array-buffer": "^1.0.4", + "is-string": "^1.1.1", + "is-typed-array": "^1.1.15", + "is-weakref": "^1.1.1", + "math-intrinsics": "^1.1.0", + "object-inspect": "^1.13.4", + "object-keys": "^1.1.1", + "object.assign": "^4.1.7", + "own-keys": "^1.0.1", + "regexp.prototype.flags": "^1.5.4", + "safe-array-concat": "^1.1.3", + "safe-push-apply": "^1.0.0", + "safe-regex-test": "^1.1.0", + "set-proto": "^1.0.0", + "stop-iteration-iterator": "^1.1.0", + "string.prototype.trim": "^1.2.10", + "string.prototype.trimend": "^1.0.9", + "string.prototype.trimstart": "^1.0.8", + "typed-array-buffer": "^1.0.3", + "typed-array-byte-length": "^1.0.3", + "typed-array-byte-offset": "^1.0.4", + "typed-array-length": "^1.0.7", + "unbox-primitive": "^1.1.0", + "which-typed-array": "^1.1.19" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/es-abstract-get": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-abstract-get/-/es-abstract-get-1.0.0.tgz", + "integrity": "sha512-6PMWXpdhshVvFp+FoWYs1EvG1Nj0tvk0dZM+XcK0xMEM1czRVcP6ohqPWHy6qPagSpC8j4+p89WXlT+xXJs/fg==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.2", + "is-callable": "^1.2.7", + "object-inspect": "^1.13.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-module-lexer": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-2.3.2.tgz", + "integrity": "sha512-poHGpORABojJJucnV9KbOavETW8lBVnphkW77ER5/BQ5Fz7oXSoCNek7IH3vR5nRjdsEz926ibFYX8KtLQmdyw==", + "dev": true, + "license": "MIT" + }, + "node_modules/es-object-atoms": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.2.tgz", + "integrity": "sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", + "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-to-primitive": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.3.4.tgz", + "integrity": "sha512-yPDz7wqpg1/mmHLmS3tcfTfbw5f1eryXvyghYBffGdERwe+mV7ZcWzTR8LR17Kvqt3qfPurjlonmnq3MKXIOXw==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-abstract-get": "^1.0.0", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "is-callable": "^1.2.7", + "is-date-object": "^1.1.0", + "is-symbol": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint": { + "version": "10.16.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-10.16.0.tgz", + "integrity": "sha512-Xu3PRLG/wCaZWZ20gkExUcNqL2mWWsXTR+Lln3Sof4Y9WuA678fH9hrlQ8B6UNwbTnsKdDdBYOd2jxtycXVTGQ==", + "dev": true, + "license": "MIT", + "workspaces": [ + "packages/*" + ], + "dependencies": { + "@eslint-community/eslint-utils": "^4.8.0", + "@eslint-community/regexpp": "^4.12.2", + "@eslint/config-array": "^0.23.7", + "@eslint/config-helpers": "^0.7.0", + "@eslint/core": "^1.2.1", + "@eslint/plugin-kit": "^0.7.3", + "@humanfs/node": "^0.16.8", + "@humanwhocodes/module-importer": "^1.0.1", + "@humanwhocodes/retry": "^0.4.2", + "@types/estree": "^1.0.6", + "ajv": "^6.14.0", + "cross-spawn": "^7.0.6", + "debug": "^4.3.2", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^9.1.2", + "eslint-visitor-keys": "^5.0.1", + "espree": "^11.2.0", + "esquery": "^1.7.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "11.1.5 || >11.1.6 <12", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "minimatch": "^11.0.5", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + }, + "funding": { + "url": "https://eslint.org/donate" + }, + "peerDependencies": { + "jiti": "*" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + } + } + }, + "node_modules/eslint-plugin-react-hooks": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-7.1.1.tgz", + "integrity": "sha512-f2I7Gw6JbvCexzIInuSbZpfdQ44D7iqdWX01FKLvrPgqxoE7oMj8clOfto8U6vYiz4yd5oKu39rRSVOe1zRu0g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.24.4", + "@babel/parser": "^7.24.4", + "hermes-parser": "^0.25.1", + "zod": "^3.25.0 || ^4.0.0", + "zod-validation-error": "^3.5.0 || ^4.0.0" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "eslint": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 || ^9.0.0 || ^10.0.0" + } + }, + "node_modules/eslint-plugin-react-refresh": { + "version": "0.5.8", + "resolved": "https://registry.npmjs.org/eslint-plugin-react-refresh/-/eslint-plugin-react-refresh-0.5.8.tgz", + "integrity": "sha512-VYgz1iCC5LxeAd6YRz5ATfg8WKrNb1ulHMpCe4pQpn3CS9DiYpZi5wcag73O8iChLhrl/CmlGMmzA6eXZ2cX4Q==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "eslint": "^9 || ^10" + } + }, + "node_modules/eslint-scope": { + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-9.1.2.tgz", + "integrity": "sha512-xS90H51cKw0jltxmvmHy2Iai1LIqrfbw57b79w/J7MfvDfkIkFZ+kj6zC3BjtUwh150HsSSdxXZcsuv72miDFQ==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "@types/esrecurse": "^4.3.1", + "@types/estree": "^1.0.8", + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-5.0.1.tgz", + "integrity": "sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/espree": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-11.2.0.tgz", + "integrity": "sha512-7p3DrVEIopW1B1avAGLuCSh1jubc01H2JHc8B4qqGblmg5gI9yumBgACjWo4JlIc04ufug4xJ3SQI8HkS/Rgzw==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "acorn": "^8.16.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^5.0.1" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/esquery": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.7.0.tgz", + "integrity": "sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estree-walker": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/eta": { + "version": "4.6.1", + "resolved": "https://registry.npmjs.org/eta/-/eta-4.6.1.tgz", + "integrity": "sha512-odwOCWIEfyStcDCfVBp54924ZnaqXxUUHR9HV8Mt+Kir9pA+EfJ6V8alZRZlLjthQ5jz+Ibm8kscnMYp9qXpMA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/bgub/eta?sponsor=1" + } + }, + "node_modules/expect-type": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.4.0.tgz", + "integrity": "sha512-KfYbmpRm0VbLjEvVa9yGwCi9GI34xvi7A/HXYWQO65CSD2u3MczUJSuwXKFIxlGsgBQizV9q5J9NHj4VG0n+pA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-uri": { + "version": "3.1.9", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.9.tgz", + "integrity": "sha512-hS/0Wt3Ya043oKXs0sIxrMpKQITXhMLIrVAKKXi4gozGC9v7YRWVnXIZzjNPTO02M9BdxLCWqK1yRXgNziVyJQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "BSD-3-Clause" + }, + "node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/file-entry-cache": { + "version": "11.1.5", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-11.1.5.tgz", + "integrity": "sha512-+PFTHITI08JIGhnNpGNI8T8inUpgZfk3GNEqfT9R2zZV2iFXg3CvqzSl/uEhs7TSGujYRELEANyDvS8Fj7+S7Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "flat-cache": "^6.1.23" + } + }, + "node_modules/filelist": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.6.tgz", + "integrity": "sha512-5giy2PkLYY1cP39p17Ech+2xlpTRL9HLspOfEgm0L6CwBXBTgsK5ou0JtzYuepxkaQ/tvhCFIJ5uXo0OrM2DxA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "minimatch": "^5.0.1" + } + }, + "node_modules/filelist/node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/filelist/node_modules/brace-expansion": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.8.tgz", + "integrity": "sha512-BnlDzDYQoplTsZSvPi86CNzmbcb07X8ufR8fk1zivaiEJlXJkiq1MQyDCVmlWcsWbj6aWXqHnrwwevbrm/Saig==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/filelist/node_modules/minimatch": { + "version": "5.1.9", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.9.tgz", + "integrity": "sha512-7o1wEA2RyMP7Iu7GNba9vc0RWWGACJOCZBJX2GJWip0ikV+wcOsgVuY9uE8CPiyQhkGFSlhuSkZPavN7u1c2Fw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat-cache": { + "version": "6.1.23", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-6.1.23.tgz", + "integrity": "sha512-f++BY9pTk+983xK1FLzlLpmM0i0z+jHmx3QESGkURMXujQZz1k5wzwX6hjnQ8goaD0B+sYnDK1yZ6MTyZfUaqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "cacheable": "^2.5.0", + "flatted": "^3.4.2", + "hookified": "^1.15.0" + } + }, + "node_modules/flatted": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.6.0.tgz", + "integrity": "sha512-1Szo+c/GCm/cKBovrfT0Wpqw7fiqZg/xzlZtLtvWlYyvT4zUGZTS8Qo3sXPQ0nWqMg3N4nEFL2Ukzrjnsopwbg==", + "dev": true, + "license": "ISC" + }, + "node_modules/for-each": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.5.tgz", + "integrity": "sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-callable": "^1.2.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/foreground-child": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz", + "integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==", + "dev": true, + "license": "ISC", + "dependencies": { + "cross-spawn": "^7.0.6", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/fs-extra": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", + "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "at-least-node": "^1.0.0", + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/function.prototype.name": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.2.0.tgz", + "integrity": "sha512-jObKIik1P2QjPHP5nz5BaOtUlfgS0fWo8IUByNXkM+o+02sJOi94em77GwJKQSJ3gfPHdgzLNrHc1uokV4P/ew==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.9", + "call-bound": "^1.0.4", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "functions-have-names": "^1.2.3", + "has-property-descriptors": "^1.0.2", + "hasown": "^2.0.4", + "is-callable": "^1.2.7", + "is-document.all": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/functions-have-names": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/generator-function": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/generator-function/-/generator-function-2.0.1.tgz", + "integrity": "sha512-SFdFmIJi+ybC0vjlHN0ZGVGHc3lgE0DxPAT0djjVg+kjOnSqclqmj0KQ7ykTOLP6YxoqOvuAODGdcHJn+43q3g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-own-enumerable-property-symbols": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-3.0.2.tgz", + "integrity": "sha512-I0UBV/XOz1XkIJHEUDMZAbzCThU/H8DxmSfmdGcKPnVhu2VfFqr34jr9777IyaTYvxjedWhqVIilEDsCdP5G6g==", + "dev": true, + "license": "ISC" + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "dev": true, + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/get-symbol-description": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.1.0.tgz", + "integrity": "sha512-w9UMqWwJxHNOvoNzSJ2oPF5wvYcvP7jUvYzhp67yEhTi17ZDBBC1z9pTdGuzjD+EFIqLSYRweZjqfiPzQ06Ebg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/glob": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-11.1.0.tgz", + "integrity": "sha512-vuNwKSaKiqm7g0THUBu2x7ckSs3XJLXE+2ssL7/MfTGPLLcrJQ/4Uq1CjPTtO5cCIiRxqvN6Twy1qOwhL0Xjcw==", + "deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "foreground-child": "^3.3.1", + "jackspeak": "^4.1.1", + "minimatch": "^10.1.1", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^2.0.0" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/glob/node_modules/minimatch": { + "version": "10.2.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.6.tgz", + "integrity": "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "brace-expansion": "^5.0.8" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/globals": { + "version": "17.15.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-17.15.0.tgz", + "integrity": "sha512-OyBOdPnzu9B2lFpums9/4wcyNHx4haAxY2X5PgO9LqCvXJgKYMMr/1y4TU7om/vTy4eYqRsVes1ZTJEJYKap8Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globalthis": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz", + "integrity": "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "define-properties": "^1.2.1", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.12", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.12.tgz", + "integrity": "sha512-iuyGF2E4oafQfPsRrG2wtY2ILupMhvtdrhzrxB+0VcjsPpSPttpfYdjnGFGsTi5MaJFjI1jOKHPQ6UTbTj9TAw==", + "dev": true, + "license": "BlueOak-1.0.0" + }, + "node_modules/has-bigints": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.1.0.tgz", + "integrity": "sha512-R3pbpkcIqv2Pm3dUwgjclDRVmWpTJW2DcMzcIhEXEx1oh/CEMObMm3KLmRJOdvhM7o4uQBnwr8pzRK2sJWIqfg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.2.0.tgz", + "integrity": "sha512-KIL7eQPfHQRC8+XluaIw7BHUwwqL19bQn4hzNgdr+1wXoU0KKj6rufu47lhY7KbJR2C6T6+PfyN0Ea7wkSS+qQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hashery": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/hashery/-/hashery-1.5.1.tgz", + "integrity": "sha512-iZyKG96/JwPz1N55vj2Ie2vXbhu440zfUfJvSwEqEbeLluk7NnapfGqa7LH0mOsnDxTF85Mx8/dyR6HfqcbmbQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "hookified": "^1.15.0" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/hasown": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.4.tgz", + "integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==", + "dev": true, + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/hermes-estree": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/hermes-estree/-/hermes-estree-0.25.1.tgz", + "integrity": "sha512-0wUoCcLp+5Ev5pDW2OriHC2MJCbwLwuRx+gAqMTOkGKJJiBCLjtrvy4PWUGn6MIVefecRpzoOZ/UV6iGdOr+Cw==", + "dev": true, + "license": "MIT" + }, + "node_modules/hermes-parser": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/hermes-parser/-/hermes-parser-0.25.1.tgz", + "integrity": "sha512-6pEjquH3rqaI6cYAXYPcz9MS4rY6R4ngRgrgfDshRptUZIc3lw0MCIJIGDj9++mfySOuPTHB4nrSW99BCvOPIA==", + "dev": true, + "license": "MIT", + "dependencies": { + "hermes-estree": "0.25.1" + } + }, + "node_modules/hookified": { + "version": "1.15.1", + "resolved": "https://registry.npmjs.org/hookified/-/hookified-1.15.1.tgz", + "integrity": "sha512-MvG/clsADq1GPM2KGo2nyfaWVyn9naPiXrqIe4jYjXNZQt238kWyOGrsyc/DmRAQ+Re6yeo6yX/yoNCG5KAEVg==", + "dev": true, + "license": "MIT" + }, + "node_modules/ico-endec": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/ico-endec/-/ico-endec-0.1.6.tgz", + "integrity": "sha512-ZdLU38ZoED3g1j3iEyzcQj+wAkY2xfWNkymszfJPoxucIUhK7NayQ+/C4Kv0nDFMIsbtbEHldv3V8PU494/ueQ==", + "dev": true, + "license": "MPL-2.0" + }, + "node_modules/idb": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/idb/-/idb-7.1.1.tgz", + "integrity": "sha512-gchesWBzyvGHRO9W8tzUWFDycow5gwjvFKfyV9FF32Y7F50yZMp7mP+T2mJIWFx49zicqyC4uefHM17o6xKIVQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/ignore": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/internal-slot": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.1.0.tgz", + "integrity": "sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "hasown": "^2.0.2", + "side-channel": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/is-array-buffer": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.5.tgz", + "integrity": "sha512-DDfANUiiG2wC1qawP66qlTugJeL5HyzMpfr8lLK+jMQirGzNod0B12cFB/9q838Ru27sBwfw78/rdoU7RERz6A==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "get-intrinsic": "^1.2.6" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-async-function": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-async-function/-/is-async-function-2.1.1.tgz", + "integrity": "sha512-9dgM/cZBnNvjzaMYHVoxxfPj2QXt22Ev7SuuPrs+xav0ukGB0S6d4ydZdEiM48kLx5kDV+QBPrpVnFyefL8kkQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "async-function": "^1.0.0", + "call-bound": "^1.0.3", + "get-proto": "^1.0.1", + "has-tostringtag": "^1.0.2", + "safe-regex-test": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-bigint": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.1.0.tgz", + "integrity": "sha512-n4ZT37wG78iz03xPRKJrHTdZbe3IicyucEtdRsV5yglwc3GyUfbAfpSeD0FJ41NbUNSt5wbhqfp1fS+BgnvDFQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-bigints": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-boolean-object": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.2.2.tgz", + "integrity": "sha512-wa56o2/ElJMYqjCjGkXri7it5FbebW5usLw/nPmCMs5DeZ7eziSYZhSmPRn0txqeW4LnAmQQU7FgqLpsEFKM4A==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-callable": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-core-module": { + "version": "2.18.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.18.0.tgz", + "integrity": "sha512-qyax9fgaKOEC4qK8WZn7Q4IcoZC9RC1O1fFxRcRTq/oMMkWT/uXpqpXa12kzWR409zAt1drYN9N9BO26UmBCmw==", + "dev": true, + "license": "MIT", + "dependencies": { + "hasown": "^2.0.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-data-view": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.2.tgz", + "integrity": "sha512-RKtWF8pGmS87i2D6gqQu/l7EYRlVdfzemCJN/P3UOs//x1QE7mfhvzHIApBTRf7axvT6DMGwSwBXYCT0nfB9xw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "get-intrinsic": "^1.2.6", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-date-object": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.1.0.tgz", + "integrity": "sha512-PwwhEakHVKTdRNVOw+/Gyh0+MzlCl4R6qKvkhuvLtPMggI1WAHt9sOwZxQLSGpUaDnrdyDsomoRgNnCfKNSXXg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-document.all": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-document.all/-/is-document.all-1.0.0.tgz", + "integrity": "sha512-+XSoyS05OdBbhFuELhgTCpFNHkpBOJqtsZfUFFpe5QTw+9Sjbh8zitxhQkYAo6wV7e1Vb8cAPvpCk9jGam/82g==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-finalizationregistry": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-finalizationregistry/-/is-finalizationregistry-1.1.1.tgz", + "integrity": "sha512-1pC6N8qWJbWoPtEjgcL2xyhQOP491EQjeUo3qTKcmV8YSDDJrOepfG8pcC7h/QgnQHYSv0mJ3Z/ZWxmatVrysg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-generator-function": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.1.2.tgz", + "integrity": "sha512-upqt1SkGkODW9tsGNG5mtXTXtECizwtS2kA161M+gJPc1xdb/Ax629af6YrTwcOeQHbewrPNlE5Dx7kzvXTizA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.4", + "generator-function": "^2.0.0", + "get-proto": "^1.0.1", + "has-tostringtag": "^1.0.2", + "safe-regex-test": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-map": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.3.tgz", + "integrity": "sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz", + "integrity": "sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==", + "dev": true, + "license": "MIT" + }, + "node_modules/is-negative-zero": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz", + "integrity": "sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-number-object": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.1.1.tgz", + "integrity": "sha512-lZhclumE1G6VYD8VHe35wFaIif+CTy5SJIi5+3y4psDgWu4wPDoBhF8NxUOinEc7pHgiTsT6MaBb92rKhhD+Xw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", + "integrity": "sha512-l4RyHgRqGN4Y3+9JHVrNqO+tN0rV5My76uW5/nuO4K1b6vw5G8d/cmFjP9tRfEsdhZNt0IFdZuK/c2Vr4Nb+Qg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-regex": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.2.1.tgz", + "integrity": "sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "gopd": "^1.2.0", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-regexp": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-regexp/-/is-regexp-1.0.0.tgz", + "integrity": "sha512-7zjFAPO4/gwyQAAgRRmqeEeyIICSdmCqa3tsVHMdBzaXXRiqopZL4Cyghg/XulGWrtABTpbnYYzzIRffLkP4oA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-set": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.3.tgz", + "integrity": "sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-shared-array-buffer": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.4.tgz", + "integrity": "sha512-ISWac8drv4ZGfwKl5slpHG9OwPNty4jOWPRIhBpxOoD+hqITiwuipOQ2bNthAzwA3B4fIjO4Nln74N0S9byq8A==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-string": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.1.1.tgz", + "integrity": "sha512-BtEeSsoaQjlSPBemMQIrY1MY0uM6vnS1g5fmufYOtnxLGUZM2178PKbhsk7Ffv58IX+ZtcvoGwccYsh0PglkAA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-symbol": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.1.1.tgz", + "integrity": "sha512-9gGx6GTtCQM73BgmHQXfDmLtfjjTUDSyoxTCbp5WtoixAhfgsDirWIcVQ/IHpvI5Vgd5i/J5F7B9cN/WlVbC/w==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "has-symbols": "^1.1.0", + "safe-regex-test": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-typed-array": { + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.15.tgz", + "integrity": "sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "which-typed-array": "^1.1.16" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-weakmap": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.2.tgz", + "integrity": "sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-weakref": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.1.1.tgz", + "integrity": "sha512-6i9mGWSlqzNMEqpCp93KwRS1uUOodk2OJ6b+sq7ZPDSy2WuI5NFIxp/254TytR8ftefexkWn5xNiHUNpPOfSew==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-weakset": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.4.tgz", + "integrity": "sha512-mfcwb6IzQyOKTs84CQMrOwW4gQcaTOAWJ0zzJCl2WSPDrWk/OzDaImWFH3djXhb24g4eudZfLRozAvPGw4d9hQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "get-intrinsic": "^1.2.6" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true, + "license": "MIT" + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true, + "license": "ISC" + }, + "node_modules/jackspeak": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-4.2.3.tgz", + "integrity": "sha512-ykkVRwrYvFm1nb2AJfKKYPr0emF6IiXDYUaFx4Zn9ZuIH7MrzEZ3sD5RlqGXNRpHtvUHJyOnCEFxOlNDtGo7wg==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "@isaacs/cliui": "^9.0.0" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/jake": { + "version": "10.9.4", + "resolved": "https://registry.npmjs.org/jake/-/jake-10.9.4.tgz", + "integrity": "sha512-wpHYzhxiVQL+IV05BLE2Xn34zW1S223hvjtqk0+gsPrwd/8JNLXJgZZM/iPFsYc1xyphF+6M6EvdE5E9MBGkDA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "async": "^3.2.6", + "filelist": "^1.0.4", + "picocolors": "^1.1.1" + }, + "bin": { + "jake": "bin/cli.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/jiti": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.7.0.tgz", + "integrity": "sha512-AC/7JofJvZGrrneWNaEnJeOLUx+JlGt7tNa0wZiRPT4MY1wmfKjt2+6O2p2uz2+skll8OZZmJMNqeke7kKbNgQ==", + "dev": true, + "license": "MIT", + "bin": { + "jiti": "lib/jiti-cli.mjs" + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/jsesc": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", + "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", + "dev": true, + "license": "MIT", + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "dev": true, + "license": "MIT", + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/jsonfile": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.1.tgz", + "integrity": "sha512-zwOTdL3rFQ/lRdBnntKVOX6k5cKJwEc1HdilT71BWEu7J41gXIB2MRp+vxduPSwZJPWBxEzv4yH1wYLJGUHX4Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/jsonpointer": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-5.0.1.tgz", + "integrity": "sha512-p/nXbhSEcu3pZRdkW1OfJhpsVtW1gd4Wa1fnQc9YLiTfAjn0312eMKimbdIQzuZl9aa9xUGaRlP9T/CJE/ditQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/keyv": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-5.6.0.tgz", + "integrity": "sha512-CYDD3SOtsHtyXeEORYRx2qBtpDJFjRTGXUtmNEMGyzYOKj1TE3tycdlho7kA1Ufx9OYWZzg52QFBGALTirzDSw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@keyv/serialize": "^1.1.1" + } + }, + "node_modules/leven": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", + "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/lightningcss": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.33.0.tgz", + "integrity": "sha512-WkUDrojuJs0xkgGf2udWxa3yGBRxPtxUkB79i6aCZLRgc7PM8fZe9TosfPDcvEpQZbuFASnHYmRLBLUbmLOIIA==", + "dev": true, + "license": "MPL-2.0", + "dependencies": { + "detect-libc": "^2.0.3" + }, + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + }, + "optionalDependencies": { + "lightningcss-android-arm64": "1.33.0", + "lightningcss-darwin-arm64": "1.33.0", + "lightningcss-darwin-x64": "1.33.0", + "lightningcss-freebsd-x64": "1.33.0", + "lightningcss-linux-arm-gnueabihf": "1.33.0", + "lightningcss-linux-arm64-gnu": "1.33.0", + "lightningcss-linux-arm64-musl": "1.33.0", + "lightningcss-linux-x64-gnu": "1.33.0", + "lightningcss-linux-x64-musl": "1.33.0", + "lightningcss-win32-arm64-msvc": "1.33.0", + "lightningcss-win32-x64-msvc": "1.33.0" + } + }, + "node_modules/lightningcss-android-arm64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-android-arm64/-/lightningcss-android-arm64-1.33.0.tgz", + "integrity": "sha512-gEpRTalKdosp4Bb8qWtc2iOgE5SeIHlpS1up9bFq2wAyYhl1UdTObYiHe98zEM9SQvSoqQZ1IQD0JNpg3Ml5pg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-darwin-arm64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.33.0.tgz", + "integrity": "sha512-Sciaz8eenNTKn9b3t7+xr0ipTp9YxKQY4npwQ3mrRuL0BAVHBLyZxofhaKBAVtzmtRZ/zTyo0/to4B1uWG/Djg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-darwin-x64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.33.0.tgz", + "integrity": "sha512-Z5UPAxzrjlWNNyGy6i65cJzzvgJ5D3T6wMvs+gWpY9d7qRhANrxqAp6LhxIgZhWEw18RfJTGcRxjuLIBr+m8XQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-freebsd-x64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.33.0.tgz", + "integrity": "sha512-QQM/Ti/hQajJwCY+RiWuCZ9sdtI/XQk7nDK5vC8kkdwixezOlDgvDx7+RT+QjK6FcFT4MpsuoBnHIo/O3StRRg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm-gnueabihf": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.33.0.tgz", + "integrity": "sha512-N7FVBe6iS24MlM6R/4RBTxGhQheZGs7tiQ9U32UtF75NzP5Q7xWPRqLBCKxlRQRk3rY1jCIPLzx7WzOhuUIRLQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm64-gnu": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.33.0.tgz", + "integrity": "sha512-j2v/itmy4HlNxlc6voKXYgBqNi0Ng2LShg4z7GufpEgs05P+2suBVyi9I6YHq5uoVFx9ETin3eCEhLVyXGQnKg==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm64-musl": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.33.0.tgz", + "integrity": "sha512-yiO5ROMuYQgXbC60yjZU5CYSFZGKXL0HFATXt9mHJn1+zW55oCtMI9NfcVhYLMFDL7gV7oBPon/EmMMGg2OvtQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-x64-gnu": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.33.0.tgz", + "integrity": "sha512-ar+Ju7LmcN0Jo4FpL4hpFybwNG9/3A/Br5KW2n2jyODg3MEZXaDYADdemoNS+BDNfMgKvylJLj4S5tyRActuAg==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-x64-musl": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.33.0.tgz", + "integrity": "sha512-RYiYbkokw0trfKqqzfF55lginwEPrD3OJDfTuJzFs1MK6iFnDenaz1fqLLtX4ITG3OktJQXOeTaw1awrBAlZPw==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-win32-arm64-msvc": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.33.0.tgz", + "integrity": "sha512-1K+MPfLSFVpphzpdbfkhlWk6wBrTObBzS2T6db10PNOZgR9GoVsAWzwNyuhUYYbTp23j+4RrncfujZ4uAzXvwA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-win32-x64-msvc": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.33.0.tgz", + "integrity": "sha512-OlEICDx/Xl0FqSp4bry8zFnCvGpig3Gl4gCquvYwHuqJKEC1+n9NgDniFvqHGmMv1ZkqDJrDqKKSykTDX+ehuA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash.debounce": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", + "integrity": "sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==", + "dev": true, + "license": "MIT" + }, + "node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^3.0.2" + } + }, + "node_modules/lucide-react": { + "version": "1.87.0", + "resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-1.87.0.tgz", + "integrity": "sha512-SknCZh7z3kMrElgPqccejETuS8GQwm69UoISu9XyeyXZIXdVUmrBukvbfAsy81JwrrojoiyZmnYRo/uzABIpFw==", + "license": "ISC", + "peerDependencies": { + "@types/react": "*", + "react": "^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/magic-string": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-1.4.5.tgz", + "integrity": "sha512-oLLC2+YvQUfAa+vxoufE/yc1icb87M9iXIRqAoR/2EhE/8cb3SF/+Gi0c2By1B+5Vz2e2vQtUvHiu1+63Znh+w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.6.0" + } + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/minimatch": { + "version": "11.0.10", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-11.0.10.tgz", + "integrity": "sha512-L3/cjhQ5E6lft0VCp/2mO3Ic74RnutKy3rz7iGwp/6w1hKcO262g2rbfacFyw6eBig5OdI0nu5PpuA0/WQs9Tw==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "@isaacs/nonrecursive-glob-match": "^1.1.0", + "brace-expansion": "^5.0.12" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/minipass": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.3.tgz", + "integrity": "sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==", + "dev": true, + "license": "BlueOak-1.0.0", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/nanoid": { + "version": "3.3.20", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.20.tgz", + "integrity": "sha512-uKdg2G3GNCKQn9byYOpxbGqrT2fGO5KRt5J/8b3pok8rT6qxGWF6hxMyJiEYtAf+FVyYuD9hRaDqX5uPFYJ4ZQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/napi-windows-process-start-time": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/napi-windows-process-start-time/-/napi-windows-process-start-time-0.1.0.tgz", + "integrity": "sha512-zHxhzKsIFu3elch3eFw69WEUGc79DFhbc3nD/WEOzWL/pFFLZRW13EHnuO0c+0YjncE5uCaS9ICHxOBXkb6vPw==", + "cpu": [ + "x64", + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=20" + } + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true, + "license": "MIT" + }, + "node_modules/node-releases": { + "version": "2.0.67", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.67.tgz", + "integrity": "sha512-qgSZT38oj+YV4qyFmdPQEGRFQRP1l8a0wccOECrcrdGl9KldZlCXrEz7uOviThiOWR1KyqiQYeLrf7M9xRi1bg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/object-inspect": { + "version": "1.14.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.14.0.tgz", + "integrity": "sha512-IVgHNlp/jwQX271+Xzoq9LZNTWXxZK+cEOrGBOBxXNbn7fapnZ+Ts6TVMgNOuAezwG2wdtnMX97tTPK6VEnuOQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.assign": { + "version": "4.1.7", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.7.tgz", + "integrity": "sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0", + "has-symbols": "^1.1.0", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/obug": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/obug/-/obug-3.0.0.tgz", + "integrity": "sha512-5vvB5+W7ePv+p3uqxi+RcW1XAzLW0/hxt3/4X4Lc4qHudzOhmBiBwOY6DRob4WnanAEGvNcLjF+KNOufrUoEQw==", + "dev": true, + "funding": [ + "https://github.com/sponsors/sxzz", + "https://opencollective.com/debug" + ], + "license": "MIT", + "engines": { + "node": ">=12.20.0" + } + }, + "node_modules/optionator": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", + "dev": true, + "license": "MIT", + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/own-keys": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/own-keys/-/own-keys-1.0.2.tgz", + "integrity": "sha512-19YVAg7T+WTrxggPukVq7DjTv6+PJ867TmhCvBsYwmbFCsZd344rq2Ld1p0wo8f8Qrrhgp82c6FJRqdXWtSEhg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.4", + "get-intrinsic": "^1.3.0", + "object-keys": "^1.1.1", + "safe-push-apply": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/package-json-from-dist": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", + "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", + "dev": true, + "license": "BlueOak-1.0.0" + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true, + "license": "MIT" + }, + "node_modules/path-scurry": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.2.tgz", + "integrity": "sha512-3O/iVVsJAPsOnpwWIeD+d6z/7PmqApyQePUtCndjatj/9I5LylHvt5qluFaBT3I5h3r1ejfR056c+FCv+NnNXg==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^11.0.0", + "minipass": "^7.1.2" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/path-scurry/node_modules/lru-cache": { + "version": "11.5.4", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.5.4.tgz", + "integrity": "sha512-B8nJCTi8JuSaDBg0tBdnImV6j5O2CXaqKfdj24ZTCFbyivN8KZ2Z+RL3aHjwJAfLutD9cNnObG4SIgW4gMufiw==", + "dev": true, + "license": "BlueOak-1.0.0", + "engines": { + "node": "20 || >=22" + } + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.7.tgz", + "integrity": "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/playwright-core": { + "version": "1.65.2", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.65.2.tgz", + "integrity": "sha512-aHu9F46Mx5ha9iiB+VLZMUUtex3PBw4am9MHptc0IXaJhz++6YXsH96eEyThwCwMkIUiB8TdZcwXqnb3xKDzmA==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "playwright-core": "cli.js" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/possible-typed-array-names": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.1.0.tgz", + "integrity": "sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/postcss": { + "version": "8.5.34", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.34.tgz", + "integrity": "sha512-P1Qzj0XXZjMda74C7qiVnBG90UKNbyNUAOeQRBW8X63RsIMV57gevRqjnkELdwtZ/S2/uQFksJhmwuN8xShLPw==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.20", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.4" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/pretty-bytes": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-6.1.1.tgz", + "integrity": "sha512-mQUvGU6aUFQ+rNvTIAcZuWGRT9a6f6Yrg9bHs4ImKF+HZCEK+plBvnAZYSIQztknZF2qnzNtr6F8s0+IuptdlQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/qified": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/qified/-/qified-0.10.1.tgz", + "integrity": "sha512-+Owyggi9IxT1ePKGafcI87ubSmxol6smwJ+RAHDQlx9+9cPwFWDiKFFCPuWhr9ignlGpZ9vDQLw67N4dcTVFEA==", + "dev": true, + "license": "MIT", + "dependencies": { + "hookified": "^2.1.1" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/qified/node_modules/hookified": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/hookified/-/hookified-2.2.0.tgz", + "integrity": "sha512-p/LgFzRN5FeoD3DLS6bkUapeye6E4SI6yJs6KetENd18S+FBthqYq2amJUWpt5z0EQwwHemidjY5OqJGEKm5uA==", + "dev": true, + "license": "MIT" + }, + "node_modules/quansync": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/quansync/-/quansync-1.0.0.tgz", + "integrity": "sha512-5xZacEEufv3HSTPQuchrvV6soaiACMFnq1H8wkVioctoH3TRha9Sz66lOxRwPK/qZj7HPiSveih9yAyh98gvqA==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/antfu" + }, + { + "type": "individual", + "url": "https://github.com/sponsors/sxzz" + } + ], + "license": "MIT" + }, + "node_modules/react": { + "version": "19.3.1", + "resolved": "https://registry.npmjs.org/react/-/react-19.3.1.tgz", + "integrity": "sha512-QNhWdt7nrgVWWQG58QuGsAR3jv3Hbe4mb4vz7w2csnHavciZJgda1CPNaldF6eVxv90ud3jUXpKlHL69gO38yw==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-dom": { + "version": "19.3.1", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.3.1.tgz", + "integrity": "sha512-Y0bARz53lhEC1NMCASs0/j+faB/zqt3R8hpvg1e8+61ZVJ4UL0UdC4cBbXfZMcIuhrfgeILTLe+ZeBCavQPtKQ==", + "license": "MIT", + "dependencies": { + "scheduler": "^0.28.0" + }, + "peerDependencies": { + "react": "^19.3.1" + } + }, + "node_modules/react-router": { + "version": "8.5.3", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-8.5.3.tgz", + "integrity": "sha512-oPYDMFH4CFeJ8n2dKvKHPAByYQhEikuvUf6OruNMuxgrq2hvZn7jz0cO/IdFW//EH1a/Vcwi84v405B2Q/gxTw==", + "license": "MIT", + "dependencies": { + "@remix-run/route-pattern": "^0.22.1", + "cookie-es": "^3.1.1" + }, + "engines": { + "node": ">=22.22.0" + }, + "peerDependencies": { + "@types/react": ">=19.2.0", + "@types/react-dom": ">=19.2.0", + "react": ">=19.2.7", + "react-dom": ">=19.2.7" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + }, + "react-dom": { + "optional": true + } + } + }, + "node_modules/reflect.getprototypeof": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.10.tgz", + "integrity": "sha512-00o4I+DVrefhv+nX0ulyi3biSHCPDe+yLv5o/p6d/UVlirijB8E16FtfwSAi4g3tcqrQ4lRAqQSoFEZJehYEcw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.9", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.7", + "get-proto": "^1.0.1", + "which-builtin-type": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/regenerate": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.5.0.tgz", + "integrity": "sha512-1s+CxXjJ71i7LNVy8nYwg47XV4y6lAnOEhsMtSKq3WpmPfhl9LuKlTqKIn/3yUpE8lBz+W+TT88Bxyhnr0U4yw==", + "dev": true, + "license": "MIT" + }, + "node_modules/regenerate-unicode-properties": { + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-10.3.0.tgz", + "integrity": "sha512-9ns8odR8e9q3otKeHj3DE80jZYKg6zVeZKE+zQmRKXFoVUcuiTGeO6iusDhPRoIQQPVPRvH+SfBhrTud4eczuw==", + "dev": true, + "license": "MIT", + "dependencies": { + "regenerate": "^1.4.2" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/regexp.prototype.flags": { + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.4.tgz", + "integrity": "sha512-dYqgNSZbDwkaJ2ceRd9ojCGjBq+mOm9LmtXnAnEGyHhN/5R7iDW2TRw3h+o/jCFxus3P2LfWIIiwowAjANm7IA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-errors": "^1.3.0", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "set-function-name": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/regexpu-core": { + "version": "6.5.5", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-6.5.5.tgz", + "integrity": "sha512-NfnTxZioujrDAhcN0V+sBehScLHgt43JdRJzgoWbo+cJ4SxTvbFd4juBAUNfbVJqi+e1HCJhDiUOsSvXpbqy4Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "regenerate": "^1.5.0", + "regenerate-unicode-properties": "^10.3.0", + "regjsgen": "^0.8.0", + "regjsparser": "^1.0.1", + "unicode-match-property-ecmascript": "^2.0.0", + "unicode-match-property-value-ecmascript": "^2.2.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/regjsgen": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.8.0.tgz", + "integrity": "sha512-RvwtGe3d7LvWiDQXeQw8p5asZUmfU1G/l6WbUXeHta7Y2PEIvBTwH6E2EfmYUK8pxcxEdEmaomqyp0vZZ7C+3Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/regjsparser": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-1.0.1.tgz", + "integrity": "sha512-ZBYo+KTM71P9fdt2tN1WQKGxx0r0VJ/UrVzBAN/x+gLxU8h+jA5D4Alhc66PkrNk/Ii3wP4rcZ1F3M98qxWnDQ==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "jsesc": "~3.1.0" + }, + "bin": { + "regjsparser": "bin/parser" + } + }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/resolve": { + "version": "1.22.14", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.14.tgz", + "integrity": "sha512-1ZjYvR9sbkiwC5+9QHetqW5HmA2pHRMaoupD01t2HlYnV/vydC2zPwLixhsMieSWVZt0JJRg5LVIk0Ow1D/TrA==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "is-core-module": "^2.18.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/rolldown": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.3.4.tgz", + "integrity": "sha512-p2rq4bfBmF0M6yaR8+A89fbkBQynZI2fxUW4G07eq9kpctAkpo7q5BZ4X4Mo4XZ7HHROu33cX9PeopUFN6u+2Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@oxc-project/types": "=0.160.0", + "@rolldown/pluginutils": "^1.0.0" + }, + "bin": { + "rolldown": "bin/cli.mjs" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "optionalDependencies": { + "@rolldown/binding-android-arm-eabi": "1.3.4", + "@rolldown/binding-android-arm64": "1.3.4", + "@rolldown/binding-darwin-arm64": "1.3.4", + "@rolldown/binding-darwin-x64": "1.3.4", + "@rolldown/binding-freebsd-x64": "1.3.4", + "@rolldown/binding-linux-arm-gnueabihf": "1.3.4", + "@rolldown/binding-linux-arm64-gnu": "1.3.4", + "@rolldown/binding-linux-arm64-musl": "1.3.4", + "@rolldown/binding-linux-ppc64-gnu": "1.3.4", + "@rolldown/binding-linux-s390x-gnu": "1.3.4", + "@rolldown/binding-linux-x64-gnu": "1.3.4", + "@rolldown/binding-linux-x64-musl": "1.3.4", + "@rolldown/binding-openharmony-arm64": "1.3.4", + "@rolldown/binding-wasm32-wasi": "1.3.4", + "@rolldown/binding-win32-arm64-msvc": "1.3.4", + "@rolldown/binding-win32-x64-msvc": "1.3.4" + } + }, + "node_modules/rollup": { + "version": "4.69.3", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.69.3.tgz", + "integrity": "sha512-IvHhlznYBMqePMsPb0Z5QLJIweHo4L6gQb5XC1cfmRDMNLfnx3bCLzcepRQFjVi5jXer4areo5CjcqSvab5ftA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.10" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.69.3", + "@rollup/rollup-android-arm64": "4.69.3", + "@rollup/rollup-android-x64": "4.69.3", + "@rollup/rollup-darwin-arm64": "4.69.3", + "@rollup/rollup-darwin-x64": "4.69.3", + "@rollup/rollup-freebsd-arm64": "4.69.3", + "@rollup/rollup-freebsd-x64": "4.69.3", + "@rollup/rollup-linux-arm-gnueabihf": "4.69.3", + "@rollup/rollup-linux-arm-musleabihf": "4.69.3", + "@rollup/rollup-linux-arm64-gnu": "4.69.3", + "@rollup/rollup-linux-arm64-musl": "4.69.3", + "@rollup/rollup-linux-loong64-gnu": "4.69.3", + "@rollup/rollup-linux-loong64-musl": "4.69.3", + "@rollup/rollup-linux-ppc64-gnu": "4.69.3", + "@rollup/rollup-linux-ppc64-musl": "4.69.3", + "@rollup/rollup-linux-riscv64-gnu": "4.69.3", + "@rollup/rollup-linux-riscv64-musl": "4.69.3", + "@rollup/rollup-linux-s390x-gnu": "4.69.3", + "@rollup/rollup-linux-x64-gnu": "4.69.3", + "@rollup/rollup-linux-x64-musl": "4.69.3", + "@rollup/rollup-openbsd-x64": "4.69.3", + "@rollup/rollup-openharmony-arm64": "4.69.3", + "@rollup/rollup-win32-arm64-msvc": "4.69.3", + "@rollup/rollup-win32-ia32-msvc": "4.69.3", + "@rollup/rollup-win32-x64-gnu": "4.69.3", + "@rollup/rollup-win32-x64-msvc": "4.69.3", + "fsevents": "~2.3.2" + } + }, + "node_modules/safe-array-concat": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.4.tgz", + "integrity": "sha512-wtZlHyOje6OZTGqAoaDKxFkgRtkF9CnHAVnCHKfuj200wAgL+bSJhdsCD2l0Qx/2ekEXjPWcyKkfGb5CPboslg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.9", + "call-bound": "^1.0.4", + "get-intrinsic": "^1.3.0", + "has-symbols": "^1.1.0", + "isarray": "^2.0.5" + }, + "engines": { + "node": ">=0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safe-push-apply": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/safe-push-apply/-/safe-push-apply-1.0.0.tgz", + "integrity": "sha512-iKE9w/Z7xCzUMIZqdBsp6pEQvwuEebH4vdpjcDWnyzaI6yl6O9FHvVpmGelvEHNsoY6wGblkxR6Zty/h00WiSA==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "isarray": "^2.0.5" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safe-regex-test": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.1.0.tgz", + "integrity": "sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "is-regex": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/scheduler": { + "version": "0.28.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.28.0.tgz", + "integrity": "sha512-juorfCmIkIw8tT+p5BXSm6PJjQF/ycEYmKyzURCIt/RaZIhL+PulbQ9Yu2z1HdOJDdqDTlxA1+xKBmHXJsczAw==", + "license": "MIT" + }, + "node_modules/semver": { + "version": "6.3.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.2.tgz", + "integrity": "sha512-GYrCADwpu6yV5OAvchkQ27Z5wwMxWAEMg5NNWjyHh/5DboFFqbdbvYNIvZouQpxXyeMPoTOh0vdPYKlf0ZswdQ==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/serialize-javascript": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-7.1.4.tgz", + "integrity": "sha512-FqlEuoTq/zRmA4Lg6aOqyH3lCHbUtCB0bmHCeFniX2GBdDqMJM3FwdvEhlE5Pim1dlt2FfBdVPmUNNiGhhKqpw==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dev": true, + "license": "MIT", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/set-function-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", + "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "functions-have-names": "^1.2.3", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/set-proto": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/set-proto/-/set-proto-1.0.0.tgz", + "integrity": "sha512-RJRdvCo6IAnPdsvP/7m6bsQqNnn1FCBX5ZNtFL98MmFF/4xAIJTIg1YbHW5DC2W5SKZanrC6i4HsJqlajw/dZw==", + "dev": true, + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/sharp": { + "version": "0.35.6", + "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.35.6.tgz", + "integrity": "sha512-6MTx2/BiKtKIqmYG49Rovjaw9pSk/CM8w4Dy6gMCPFKw+ZpK/icwIJQnEGlkIzCR+HS4arUBzxNM6sE9CgNyeA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@img/colour": "^1.1.0", + "detect-libc": "^2.1.2", + "semver": "^7.8.6" + }, + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-darwin-arm64": "0.35.6", + "@img/sharp-darwin-x64": "0.35.6", + "@img/sharp-freebsd-wasm32": "0.35.6", + "@img/sharp-libvips-darwin-arm64": "1.3.5", + "@img/sharp-libvips-darwin-x64": "1.3.5", + "@img/sharp-libvips-linux-arm": "1.3.5", + "@img/sharp-libvips-linux-arm64": "1.3.5", + "@img/sharp-libvips-linux-ppc64": "1.3.5", + "@img/sharp-libvips-linux-riscv64": "1.3.5", + "@img/sharp-libvips-linux-s390x": "1.3.5", + "@img/sharp-libvips-linux-x64": "1.3.5", + "@img/sharp-libvips-linuxmusl-arm64": "1.3.5", + "@img/sharp-libvips-linuxmusl-x64": "1.3.5", + "@img/sharp-linux-arm": "0.35.6", + "@img/sharp-linux-arm64": "0.35.6", + "@img/sharp-linux-ppc64": "0.35.6", + "@img/sharp-linux-riscv64": "0.35.6", + "@img/sharp-linux-s390x": "0.35.6", + "@img/sharp-linux-x64": "0.35.6", + "@img/sharp-linuxmusl-arm64": "0.35.6", + "@img/sharp-linuxmusl-x64": "0.35.6", + "@img/sharp-webcontainers-wasm32": "0.35.6", + "@img/sharp-win32-arm64": "0.35.6", + "@img/sharp-win32-ia32": "0.35.6", + "@img/sharp-win32-x64": "0.35.6" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + } + }, + "node_modules/sharp-ico": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/sharp-ico/-/sharp-ico-0.1.5.tgz", + "integrity": "sha512-a3jODQl82NPp1d5OYb0wY+oFaPk7AvyxipIowCHk7pBsZCWgbe0yAkU2OOXdoH0ENyANhyOQbs9xkAiRHcF02Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "decode-ico": "*", + "ico-endec": "*", + "sharp": "*" + } + }, + "node_modules/sharp/node_modules/semver": { + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.6.tgz", + "integrity": "sha512-9lpSSU4Mly3mrtruwLs1eLK6+gzbzqeBFwRNjIjE+9LuDpWdYctrQlQ3ej1Ilgi7gknpsTRnPoLP8DpCHqHIJw==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/side-channel": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.1.tgz", + "integrity": "sha512-6x6dK6zJdpTzF4sQeNYxwtvBzf6Eg4GtlesS94HOvTudUeyK2WXAaIfmDgsyslYrRBeFIlsi54AYsFGUuhmvrQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.4", + "side-channel-list": "^1.0.1", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-list": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.1.tgz", + "integrity": "sha512-mjn/0bi/oUURjc5Xl7IaWi/OJJJumuoJFQJfDDyO46+hBWsfaVM65TBHq2eoZBhzl9EchxOijpkbRC8SVBQU0w==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/smob": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/smob/-/smob-1.6.2.tgz", + "integrity": "sha512-RQsvleCbF8cVHEv+xuDGaA4pOizFqJ0GgjtMSRo6oP8pnN7WsigHgVGey6aILRBKv4W2YOMHLqbKdnB6hpB9fw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/source-map": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.8.0.tgz", + "integrity": "sha512-d8EqvL+k/SOXCreS/SUzg2ciyHqBBLcN/yuRjFsbvVhHTE2pgei7oAhmPM7kWFbkX6OSMQfUq4KbkF3au9lhYQ==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">= 12" + } + }, + "node_modules/source-map-js": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.3.0.tgz", + "integrity": "sha512-pdUVfIWcK0kCgK831ibqkZDcL7I9zljjOu0TQFnA+fiQ6y1CYqYB7RkTOHHO45FGMg5P/Mvk/+4ToQ7gAYAL5Q==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "dev": true, + "license": "MIT", + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/source-map-support/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/std-env": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-4.3.0.tgz", + "integrity": "sha512-OtU/EgQ1kIm5KwqQpBC6ZEMXrZRui11w8zgfTWp8cdO9B8OaPsbA8bTHO2P+HNo1VlUTGMVBwPhydu6poeXiag==", + "dev": true, + "license": "MIT" + }, + "node_modules/stop-iteration-iterator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.1.0.tgz", + "integrity": "sha512-eLoXW/DHyl62zxY4SCaIgnRhuMr6ri4juEYARS8E6sCEqzKpOiE521Ucofdx+KnDZl5xmvGYaaKCk5FEOxJCoQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "internal-slot": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/string.prototype.matchall": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.1.0.tgz", + "integrity": "sha512-tHNHTxInrYLCga9O9YGxWA3G9/nnzQw8UGAyqGx3Ar1pSTTzIuM4woFSq4SowkXCjJIwq5sIiQvEfRI9tCH1qQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.9", + "call-bound": "^1.0.4", + "define-properties": "^1.2.1", + "es-abstract": "^1.24.2", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.2", + "get-intrinsic": "^1.3.0", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "internal-slot": "^1.1.0", + "regexp.prototype.flags": "^1.5.4", + "set-function-name": "^2.0.2", + "side-channel": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trim": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.11.tgz", + "integrity": "sha512-PwvK7BU+CMTJGYQCTZb5RWXIML92lftJLhQz1tBzgKiqGxJaMlBAa48POXaNAC2s4y8jr3EFqrkF9+44neS46w==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.9", + "call-bound": "^1.0.4", + "define-data-property": "^1.1.4", + "define-properties": "^1.2.1", + "es-abstract": "^1.24.2", + "es-object-atoms": "^1.1.2", + "has-property-descriptors": "^1.0.2", + "safe-regex-test": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimend": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.10.tgz", + "integrity": "sha512-2+3aDAOmPTmuFwjDnmJG2ctEkQKVki7vOSqaxkv42Mowj1V6PnvuwFCRrR5lChUux1TBskPjfkeTOhqczDMxTw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.9", + "call-bound": "^1.0.4", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimstart": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz", + "integrity": "sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/stringify-object": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/stringify-object/-/stringify-object-3.3.0.tgz", + "integrity": "sha512-rHqiFh1elqCQ9WPLIC8I0Q/g/wj5J1eMkyoiD6eoQApWHP0FtlK7rqnhmabL5VUY9JQCcqwwvlOaSuutekgyrw==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "get-own-enumerable-property-symbols": "^3.0.0", + "is-obj": "^1.0.1", + "is-regexp": "^1.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/strip-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-comments/-/strip-comments-2.0.1.tgz", + "integrity": "sha512-ZprKx+bBLXv067WTCALv8SSz5l2+XhpYCsVtSqlMnkAXMWDq+/ekVbl1ghqP9rUHTzv6sm/DwCOiYutU/yp1fw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/tailwindcss": { + "version": "4.3.5", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.3.5.tgz", + "integrity": "sha512-FcQk9BuffmEHJP2G0XmB2SplU1aLTI7j07Kunk+U74Ny+XiWOtzXz9aujFZ/avntw1e2cOv/3PkgzflQ7gX2vQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/tapable": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.3.4.tgz", + "integrity": "sha512-NHFiWnAbMJxNNpBwiO7jJVGDuqMxT9/oV8v57RR+fgBQShkJil5inGD8/xWy0hjLyHQyX1tu27QANhlz3KBqCg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + } + }, + "node_modules/temp-dir": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/temp-dir/-/temp-dir-2.0.0.tgz", + "integrity": "sha512-aoBAniQmmwtcKp/7BzsH8Cxzv8OL736p7v1ihGb5e9DJ9kTwGWHrQrVB5+lfVDzfGrdRzXch+ig7LHaY1JTOrg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/tempy": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tempy/-/tempy-0.6.0.tgz", + "integrity": "sha512-G13vtMYPT/J8A4X2SjdtBTphZlrp1gKv6hZiOjw14RCWg6GbHuQBGtjlx75xLbYV/wEc0D7G5K4rxKP/cXk8Bw==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-stream": "^2.0.0", + "temp-dir": "^2.0.0", + "type-fest": "^0.16.0", + "unique-string": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/terser": { + "version": "5.51.4", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.51.4.tgz", + "integrity": "sha512-VPi1CkDvCWLGUVIToctNBG+NdHbSXwOPjHJnQ3pdB0XknaldnI76wSkAFOGxV2ZdkzOP5d6gpQ5c58XvDghRvw==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "@jridgewell/source-map": "^0.3.3", + "acorn": "^8.15.0", + "commander": "^2.20.0", + "source-map-support": "~0.5.20" + }, + "bin": { + "terser": "bin/terser" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/tinybench": { + "version": "6.2.5", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-6.2.5.tgz", + "integrity": "sha512-b/8GRMdnY4cqkfCLyaFpTGIv1qwfi3oT0mWaepwT++6Z/ZrYehNfZZ2JDKVLKGhNoEkS3IIB1ELtCT0XS5DtOA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/tinyexec": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.4.0.tgz", + "integrity": "sha512-PV6lIcJQh57aFeJDwx16JNHmgFRh5xguzallrDW1qe8nAghYgr5MKz2K5k7wEyV/ygZhdnIAP8+HZSarHPBCsg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/tinyglobby": { + "version": "0.2.17", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz", + "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==", + "dev": true, + "license": "MIT", + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.4" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/to-data-view": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/to-data-view/-/to-data-view-1.1.0.tgz", + "integrity": "sha512-1eAdufMg6mwgmlojAx3QeMnzB/BTVp7Tbndi3U7ftcT2zCZadjxkkmLmd97zmaxWi+sgGcgWrokmpEoy0Dn0vQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/ts-api-utils": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.5.0.tgz", + "integrity": "sha512-OJ/ibxhPlqrMM0UiNHJ/0CKQkoKF243/AEmplt3qpRgkW8VG7IfOS41h7V8TjITqdByHzrjcS/2si+y4lIh8NA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.12" + }, + "peerDependencies": { + "typescript": ">=4.8.4" + } + }, + "node_modules/tslib": { + "version": "2.9.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.9.1.tgz", + "integrity": "sha512-a4Ux9VKuIMHsOS7ENbEq6hK2ZGYIT27Rtl0E4eD9KqwxhKiQeMZE/9xb3IdYwWaSOyIBQLExhQgXDTYoiCxnWA==", + "dev": true, + "license": "0BSD", + "optional": true + }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/type-fest": { + "version": "0.16.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.16.0.tgz", + "integrity": "sha512-eaBzG6MxNzEn9kiwvtre90cXaNLkmadMWa1zQMs3XORCXNbsH/OewwbxC5ia9dCxIxnTAsSxXJaa/p5y8DlvJg==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/typed-array-buffer": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.3.tgz", + "integrity": "sha512-nAYYwfY3qnzX30IkA6AQZjVbtK6duGontcQm1WSG1MD94YLqK0515GNApXkoxKOWMusVssAHWLh9SeaoefYFGw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "is-typed-array": "^1.1.14" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/typed-array-byte-length": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.3.tgz", + "integrity": "sha512-BaXgOuIxz8n8pIq3e7Atg/7s+DpiYrxn4vdot3w9KbnBhcRQq6o3xemQdIfynqSeXeDrF32x+WvfzmOjPiY9lg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "for-each": "^0.3.3", + "gopd": "^1.2.0", + "has-proto": "^1.2.0", + "is-typed-array": "^1.1.14" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-byte-offset": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.5.tgz", + "integrity": "sha512-0FHJvLPqZ7KJzp17O13jfsAjsqazgrxBu2zEK95PmUz8lv2+GjRuxUInCr2Rk9Dms3ihN21zJ929ZO43yJ95QQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.9", + "for-each": "^0.3.5", + "gopd": "^1.2.0", + "is-typed-array": "^1.1.15", + "reflect.getprototypeof": "^1.0.10" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-length": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.8.tgz", + "integrity": "sha512-phPGCwqr2+Qo0fwniCE8e4pKnGu/yFb5nD5Y8bf0EEeiI5GklnACYA9GFy/DrAeRrKHXvHn+1SUsOWgJp6RO+g==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.9", + "for-each": "^0.3.5", + "gopd": "^1.2.0", + "is-typed-array": "^1.1.15", + "possible-typed-array-names": "^1.1.0", + "reflect.getprototypeof": "^1.0.10" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typescript": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-6.0.3.tgz", + "integrity": "sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/typescript-eslint": { + "version": "8.74.0", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.74.0.tgz", + "integrity": "sha512-OsWQlsedt1ZpZXfZZMNK3m4SoQONFFcy4h/uRznsCeRfVuEic3gh4KGUs2pJJ5o0Jj0Jr7keUHQGN1Ns9aDw7Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/eslint-plugin": "8.74.0", + "@typescript-eslint/parser": "8.74.0", + "@typescript-eslint/typescript-estree": "8.74.0", + "@typescript-eslint/utils": "8.74.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/unbox-primitive": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.1.0.tgz", + "integrity": "sha512-nWJ91DjeOkej/TA8pXQ3myruKpKEYgqvpw9lz4OPHj/NWFNluYrjbz9j01CJ8yKQd2g4jFoOkINCTW2I5LEEyw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "has-bigints": "^1.0.2", + "has-symbols": "^1.1.0", + "which-boxed-primitive": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/unconfig": { + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/unconfig/-/unconfig-7.5.0.tgz", + "integrity": "sha512-oi8Qy2JV4D3UQ0PsopR28CzdQ3S/5A1zwsUwp/rosSbfhJ5z7b90bIyTwi/F7hCLD4SGcZVjDzd4XoUQcEanvA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@quansync/fs": "^1.0.0", + "defu": "^6.1.4", + "jiti": "^2.6.1", + "quansync": "^1.0.0", + "unconfig-core": "7.5.0" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/unconfig-core": { + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/unconfig-core/-/unconfig-core-7.5.0.tgz", + "integrity": "sha512-Su3FauozOGP44ZmKdHy2oE6LPjk51M/TRRjHv2HNCWiDvfvCoxC2lno6jevMA91MYAdCdwP05QnWdWpSbncX/w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@quansync/fs": "^1.0.0", + "quansync": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/undici-types": { + "version": "8.9.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-8.9.0.tgz", + "integrity": "sha512-KTDyRTYX8sWmKXAikPHHSyc63CRPETMctyjKFupcC6OBLXT3xsN0e9aF7m+mIXutFWpUXuedtowG7iLOzp0kQg==", + "dev": true, + "license": "MIT" + }, + "node_modules/unicode-canonical-property-names-ecmascript": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.1.tgz", + "integrity": "sha512-dA8WbNeb2a6oQzAQ55YlT5vQAWGV9WXOsi3SskE3bcCdM0P4SDd+24zS/OCacdRq5BkdsRj9q3Pg6YyQoxIGqg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/unicode-match-property-ecmascript": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-2.0.0.tgz", + "integrity": "sha512-5kaZCrbp5mmbz5ulBkDkbY0SsPOjKqVS35VpL9ulMPfSl0J0Xsm+9Evphv9CoIZFwre7aJoa94AY6seMKGVN5Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "unicode-canonical-property-names-ecmascript": "^2.0.0", + "unicode-property-aliases-ecmascript": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/unicode-match-property-value-ecmascript": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.2.1.tgz", + "integrity": "sha512-JQ84qTuMg4nVkx8ga4A16a1epI9H6uTXAknqxkGF/aFfRLw1xC/Bp24HNLaZhHSkWd3+84t8iXnp1J0kYcZHhg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/unicode-property-aliases-ecmascript": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.2.0.tgz", + "integrity": "sha512-hpbDzxUY9BFwX+UeBnxv3Sh1q7HFxj48DTmXchNgRa46lO8uj3/1iEn3MiNUYTg1g9ctIqXCCERn8gYZhHC5lQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/unique-string": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-2.0.0.tgz", + "integrity": "sha512-uNaeirEPvpZWSgzwsPGtU2zVSTrn/8L5q/IexZmH0eH6SA73CmAA5U4GwORTxQAZs95TAXLNqeLoPPNO5gZfWg==", + "dev": true, + "license": "MIT", + "dependencies": { + "crypto-random-string": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/universalify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/upath": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/upath/-/upath-1.2.0.tgz", + "integrity": "sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4", + "yarn": "*" + } + }, + "node_modules/update-browserslist-db": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.4.0.tgz", + "integrity": "sha512-WPJuOnjI9FWDct4fB+ej4Mz8opLaw5CDcZ2t44tFZ0vIQVYWzBhWR3mkixuUj/A7+vY4V9+ApOZ2YYLwdgq46w==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "escalade": "^3.2.0", + "picocolors": "^1.1.1" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/vite": { + "version": "8.4.1", + "resolved": "https://registry.npmjs.org/vite/-/vite-8.4.1.tgz", + "integrity": "sha512-2bl8n3+GkKBKQQR8CZC+t+3NvjWCBNh9S0Dbfu7hr7+Jjeg71jcZk7uKF6mo8GZXjIws+Nl6jhvAfHUO320VuQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "lightningcss": "^1.33.0", + "picomatch": "^4.0.7", + "postcss": "^8.5.34", + "rolldown": "~1.3.4", + "tinyglobby": "^0.2.17" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3", + "napi-windows-process-start-time": "^0.1.0" + }, + "peerDependencies": { + "@types/node": "^20.19.0 || >=22.12.0", + "@vitejs/devtools": "^0.7.1 || ^0.8.0", + "esbuild": "^0.27.0 || ^0.28.0", + "jiti": ">=1.21.0", + "less": "^4.0.0", + "sass": "^1.70.0", + "sass-embedded": "^1.70.0", + "stylus": ">=0.54.8", + "sugarss": "^5.0.0", + "terser": "^5.16.0", + "tsx": "^4.8.1", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "@vitejs/devtools": { + "optional": true + }, + "esbuild": { + "optional": true + }, + "jiti": { + "optional": true + }, + "less": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true + } + } + }, + "node_modules/vite-plugin-pwa": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/vite-plugin-pwa/-/vite-plugin-pwa-2.0.0.tgz", + "integrity": "sha512-6G9dsPKT9QKYpeTuTLJM28zZL3HsXUTUM/QUZBEgQk2jbfrPJDq2i8gTewAKqi1c9Mt6MiidrL4SFI+HthiQMg==", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "^4.3.6", + "pretty-bytes": "^6.1.1", + "tinyglobby": "^0.2.10", + "workbox-build": "^7.4.1", + "workbox-window": "^7.4.1" + }, + "engines": { + "node": ">=20.19.0" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + }, + "peerDependencies": { + "@vite-pwa/assets-generator": "^1.0.0 || ^2.0.0", + "vite": "^3.1.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0", + "workbox-build": "^7.4.1", + "workbox-window": "^7.4.1" + }, + "peerDependenciesMeta": { + "@vite-pwa/assets-generator": { + "optional": true + } + } + }, + "node_modules/vitest": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-5.1.2.tgz", + "integrity": "sha512-VIa2wXV208WraXUbzH+dQUrGcFpPuaiRA8HlhXS8R6/sy9cynw6OMqGj8fmAlH1hot7huTCtWUE14+FdXU3eLw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/chai": "^5.2.2", + "@vitest/mocker": "5.1.2", + "chai": "^6.3.0", + "es-module-lexer": "^2.3.2", + "expect-type": "^1.4.0", + "magic-string": "^1.4.5", + "obug": "^3.0.0", + "picomatch": "^4.0.7", + "std-env": "^4.3.0", + "tinybench": "^6.2.3", + "tinyexec": "^1.3.1", + "tinyglobby": "^0.2.17", + "why-is-node-running": "3.2.1" + }, + "bin": { + "vitest": "vitest.mjs" + }, + "engines": { + "node": "^22.12.0 || ^24.0.0 || >=26.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "@edge-runtime/vm": "*", + "@opentelemetry/api": "^1.9.0", + "@types/node": "^22.0.0 || >=24.0.0", + "@vitest/browser-playwright": "5.1.2", + "@vitest/browser-preview": "5.1.2", + "@vitest/browser-webdriverio": "^5.0.0-beta.5 || >=5.0.0", + "@vitest/coverage-istanbul": "5.1.2", + "@vitest/coverage-v8": "5.1.2", + "@vitest/ui": "5.1.2", + "happy-dom": "*", + "jsdom": "*", + "vite": "^6.4.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "@edge-runtime/vm": { + "optional": true + }, + "@opentelemetry/api": { + "optional": true + }, + "@types/node": { + "optional": true + }, + "@vitest/browser-playwright": { + "optional": true + }, + "@vitest/browser-preview": { + "optional": true + }, + "@vitest/browser-webdriverio": { + "optional": true + }, + "@vitest/coverage-istanbul": { + "optional": true + }, + "@vitest/coverage-v8": { + "optional": true + }, + "@vitest/ui": { + "optional": true + }, + "happy-dom": { + "optional": true + }, + "jsdom": { + "optional": true + }, + "vite": { + "optional": false + } + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/which-boxed-primitive": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.1.1.tgz", + "integrity": "sha512-TbX3mj8n0odCBFVlY8AxkqcHASw3L60jIuF8jFP78az3C2YhmGvqbHBpAjTRH2/xqYunrJ9g1jSyjCjpoWzIAA==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-bigint": "^1.1.0", + "is-boolean-object": "^1.2.1", + "is-number-object": "^1.1.1", + "is-string": "^1.1.1", + "is-symbol": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-builtin-type": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/which-builtin-type/-/which-builtin-type-1.2.1.tgz", + "integrity": "sha512-6iBczoX+kDQ7a3+YJBnh3T+KZRxM/iYNPXicqk66/Qfm1b93iu+yOImkg0zHbj5LNOcNv1TEADiZ0xa34B4q6Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "function.prototype.name": "^1.1.6", + "has-tostringtag": "^1.0.2", + "is-async-function": "^2.0.0", + "is-date-object": "^1.1.0", + "is-finalizationregistry": "^1.1.0", + "is-generator-function": "^1.0.10", + "is-regex": "^1.2.1", + "is-weakref": "^1.0.2", + "isarray": "^2.0.5", + "which-boxed-primitive": "^1.1.0", + "which-collection": "^1.0.2", + "which-typed-array": "^1.1.16" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-collection": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.2.tgz", + "integrity": "sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-map": "^2.0.3", + "is-set": "^2.0.3", + "is-weakmap": "^2.0.2", + "is-weakset": "^2.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-typed-array": { + "version": "1.1.24", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.24.tgz", + "integrity": "sha512-wk4Mf4pR5mRP7eYuuTBCIQ9d0ud2Fv2jRLQpfgnRjbOxAFHmjKFValgTpitVKzJJS8ajnYQV2Du1SZ8j6b/EUQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.9", + "call-bound": "^1.0.4", + "for-each": "^0.3.5", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/why-is-node-running": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-3.2.1.tgz", + "integrity": "sha512-Tb2FUhB4vUsGQlfSquQLYkApkuPAFQXGFzxWKHHumVz2dK+X1RUm/HnID4+TfIGYJ1kTcwOaCk/buYCEJr6YjQ==", + "dev": true, + "license": "MIT", + "bin": { + "why-is-node-running": "cli.js" + }, + "engines": { + "node": ">=20.11" + } + }, + "node_modules/word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/workbox-background-sync": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/workbox-background-sync/-/workbox-background-sync-7.4.1.tgz", + "integrity": "sha512-HhT7KE8tOWDm02wRNshXUnUPofMlhenF2DBdUnDPOubhizzPeItkYTmAB6td1Z2cjYPa98vzEiPLEuzn5hN66g==", + "dev": true, + "license": "MIT", + "dependencies": { + "idb": "^7.0.1", + "workbox-core": "7.4.1" + } + }, + "node_modules/workbox-broadcast-update": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/workbox-broadcast-update/-/workbox-broadcast-update-7.4.1.tgz", + "integrity": "sha512-uAlgslKLvbQY+suirIdnBCSYrcgBhjp81Nj4l1lj/Jmj0MJO2CJERnCJjT0GFVwmReV0N+zs78K6gqd5gr9/+A==", + "dev": true, + "license": "MIT", + "dependencies": { + "workbox-core": "7.4.1" + } + }, + "node_modules/workbox-build": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/workbox-build/-/workbox-build-7.4.1.tgz", + "integrity": "sha512-SDhxIvEAde9Gy/5w4Yo1Jh/M49Z0qE3q0oteyE8zGq0DScxFqVBcCtIXFuLtmtxRQZCMbf0prco4VyEu3KBQuw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@apideck/better-ajv-errors": "^0.3.1", + "@babel/core": "^7.24.4", + "@babel/preset-env": "^7.11.0", + "@babel/runtime": "^7.11.2", + "@rollup/plugin-babel": "^6.1.0", + "@rollup/plugin-node-resolve": "^16.0.3", + "@rollup/plugin-replace": "^6.0.3", + "@rollup/plugin-terser": "^1.0.0", + "@trickfilm400/rollup-plugin-off-main-thread": "^3.0.0-pre1", + "ajv": "^8.6.0", + "common-tags": "^1.8.0", + "eta": "^4.5.1", + "fast-json-stable-stringify": "^2.1.0", + "fs-extra": "^9.0.1", + "glob": "^11.0.1", + "pretty-bytes": "^5.3.0", + "rollup": "^4.53.3", + "source-map": "^0.8.0-beta.0", + "stringify-object": "^3.3.0", + "strip-comments": "^2.0.1", + "tempy": "^0.6.0", + "upath": "^1.2.0", + "workbox-background-sync": "7.4.1", + "workbox-broadcast-update": "7.4.1", + "workbox-cacheable-response": "7.4.1", + "workbox-core": "7.4.1", + "workbox-expiration": "7.4.1", + "workbox-google-analytics": "7.4.1", + "workbox-navigation-preload": "7.4.1", + "workbox-precaching": "7.4.1", + "workbox-range-requests": "7.4.1", + "workbox-recipes": "7.4.1", + "workbox-routing": "7.4.1", + "workbox-strategies": "7.4.1", + "workbox-streams": "7.4.1", + "workbox-sw": "7.4.1", + "workbox-window": "7.4.1" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/workbox-build/node_modules/@apideck/better-ajv-errors": { + "version": "0.3.7", + "resolved": "https://registry.npmjs.org/@apideck/better-ajv-errors/-/better-ajv-errors-0.3.7.tgz", + "integrity": "sha512-TajUJwGWbDwkCx/CZi7tRE8PVB7simCvKJfHUsSdvps+aTM/PDPP4gkLmKnc+x3CE//y9i/nj74GqdL/hwk7Iw==", + "dev": true, + "license": "MIT", + "dependencies": { + "jsonpointer": "^5.0.1", + "leven": "^3.1.0" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "ajv": ">=8" + } + }, + "node_modules/workbox-build/node_modules/ajv": { + "version": "8.20.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.20.0.tgz", + "integrity": "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.3", + "fast-uri": "^3.0.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/workbox-build/node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true, + "license": "MIT" + }, + "node_modules/workbox-build/node_modules/pretty-bytes": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-5.6.0.tgz", + "integrity": "sha512-FFw039TmrBqFK8ma/7OL3sDz/VytdtJr044/QUJtH0wK9lb9jLq9tJyIxUwtQJHwar2BqtiA4iCWSwo9JLkzFg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/workbox-cacheable-response": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/workbox-cacheable-response/-/workbox-cacheable-response-7.4.1.tgz", + "integrity": "sha512-8xaFoJdDc2OjrlbbL3gEeBO1WKcMwRqwLRupgqahYXu75yXajPLuwrbXMrIGZuWYXrQwk0xDjOxZ/ujCy/oJYw==", + "dev": true, + "license": "MIT", + "dependencies": { + "workbox-core": "7.4.1" + } + }, + "node_modules/workbox-core": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/workbox-core/-/workbox-core-7.4.1.tgz", + "integrity": "sha512-DT+vu46eh/2vRsSHTY4Xmc32Z1rr9PRlQUXr1Dx30ZuXRWwOsvZgGgcwxcasubQLQmbTNYZjv44LkBAQ4tT5tQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/workbox-expiration": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/workbox-expiration/-/workbox-expiration-7.4.1.tgz", + "integrity": "sha512-lRKUF7b+OGbeXkQk1s6MHXOa3d7Xxf7Of31W6c6hCfipfIyrtdWZ89stq21AHZMaoG7VNFoHply4Ox+rU31TWg==", + "dev": true, + "license": "MIT", + "dependencies": { + "idb": "^7.0.1", + "workbox-core": "7.4.1" + } + }, + "node_modules/workbox-google-analytics": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/workbox-google-analytics/-/workbox-google-analytics-7.4.1.tgz", + "integrity": "sha512-Mks1JwLEt++ZAkF6sS1OpSh9RtAMIsiDgRpK+codiHGIPXeaUOgi4cPc3GFadUl8V5QPeypEk8Oxgl3HlwVzHw==", + "dev": true, + "license": "MIT", + "dependencies": { + "workbox-background-sync": "7.4.1", + "workbox-core": "7.4.1", + "workbox-routing": "7.4.1", + "workbox-strategies": "7.4.1" + } + }, + "node_modules/workbox-navigation-preload": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/workbox-navigation-preload/-/workbox-navigation-preload-7.4.1.tgz", + "integrity": "sha512-C4KVsjPcYKJOhr631AxR9XoG2rLF3QiTk5aMv36MXOjtWvm8axwNFAtKUPGsWUwLXXAMgYM1En7fsvndaXeXRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "workbox-core": "7.4.1" + } + }, + "node_modules/workbox-precaching": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/workbox-precaching/-/workbox-precaching-7.4.1.tgz", + "integrity": "sha512-cdr/9qByww7yzEp7zg/qI4ukUrrNjQLgN+ONQRpjy/VqGQXwkgHwr00KksGJK8v0VifwDXBb8a4cWNZH71jn3Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "workbox-core": "7.4.1", + "workbox-routing": "7.4.1", + "workbox-strategies": "7.4.1" + } + }, + "node_modules/workbox-range-requests": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/workbox-range-requests/-/workbox-range-requests-7.4.1.tgz", + "integrity": "sha512-7i2oxAUE82gHdAJBCAQ04JzNOdRPqzuOzGfoUyJpFSmeqBNYGPrAH8GPoPjUQTfp+NycwrD2H68VtuF8qxv0vQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "workbox-core": "7.4.1" + } + }, + "node_modules/workbox-recipes": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/workbox-recipes/-/workbox-recipes-7.4.1.tgz", + "integrity": "sha512-gnbVfmV4/TtmQaM4x9AtuXhcdstJsep3XMVeztOrQVPT+R6+6DeBjGTCQ7fFCXm+4GEHUA5VEBTyi5+4gWGeog==", + "dev": true, + "license": "MIT", + "dependencies": { + "workbox-cacheable-response": "7.4.1", + "workbox-core": "7.4.1", + "workbox-expiration": "7.4.1", + "workbox-precaching": "7.4.1", + "workbox-routing": "7.4.1", + "workbox-strategies": "7.4.1" + } + }, + "node_modules/workbox-routing": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/workbox-routing/-/workbox-routing-7.4.1.tgz", + "integrity": "sha512-yubJGErZOusuidAenaL5ypfhQOa7urxP/f8E0ws7FPb4039RiWXUWBAyUkmUoOL/BcQGen3h0J8872d51IYxtA==", + "dev": true, + "license": "MIT", + "dependencies": { + "workbox-core": "7.4.1" + } + }, + "node_modules/workbox-strategies": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/workbox-strategies/-/workbox-strategies-7.4.1.tgz", + "integrity": "sha512-GZxpaw9NbmOelj7667uZ2kpk5BFpOGbO4X0qjwh5ls8XQ8C+Lha5LQchTiUzsTFSS+NlUpftYAyOVXvQUrcqOQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "workbox-core": "7.4.1" + } + }, + "node_modules/workbox-streams": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/workbox-streams/-/workbox-streams-7.4.1.tgz", + "integrity": "sha512-HWWtraKUbJknd9kgqGcpQ3G114HOPYvqs8HaJMDs2ebLNAimDkVDaWfAXE6Ybl+m8U6KsCE6pWyLYuigWmnAXw==", + "dev": true, + "license": "MIT", + "dependencies": { + "workbox-core": "7.4.1", + "workbox-routing": "7.4.1" + } + }, + "node_modules/workbox-sw": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/workbox-sw/-/workbox-sw-7.4.1.tgz", + "integrity": "sha512-fez5f2DUlDJWTFYkCWQpY10N8gtztd849NswCbVFk0QlcSM4HT5A8x4g4ii650yem4I8tHY0R7JZahwp3ltIPw==", + "dev": true, + "license": "MIT" + }, + "node_modules/workbox-window": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/workbox-window/-/workbox-window-7.4.1.tgz", + "integrity": "sha512-notZDH2u8VXaqyuD7xaqIfEFi6SRM4SUSd7ewe9PDsVqADuepxX2ZMY3uvuZGxzY5ZOsGC/vD3A/3smFtJt4/A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/trusted-types": "^2.0.2", + "workbox-core": "7.4.1" + } + }, + "node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true, + "license": "ISC" + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/zod": { + "version": "4.6.7", + "resolved": "https://registry.npmjs.org/zod/-/zod-4.6.7.tgz", + "integrity": "sha512-g8W2D2kU6a8untc053fX1uVBKzM7yqAxW/3zwk83+6RyF2+SKOuV+c0wBDhUwzV1PaGapmZH+rmcUzPf+3CGwg==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, + "node_modules/zod-validation-error": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/zod-validation-error/-/zod-validation-error-4.0.2.tgz", + "integrity": "sha512-Q6/nZLe6jxuU80qb/4uJ4t5v2VEZ44lzQjPDhYJNztRQ4wyWc6VF3D3Kb/fAuPetZQnhS3hnajCf9CsWesghLQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.0.0" + }, + "peerDependencies": { + "zod": "^3.25.0 || ^4.0.0" + } + }, + "node_modules/zustand": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/zustand/-/zustand-5.1.0.tgz", + "integrity": "sha512-ciJZlP48M1PTQbVQq81CGVFxHTLpZNrFjKqwjtCU34AWuXTZT/jrF3p9+fI84Cf1eSCMLapxqBy/SNTfwOBuqA==", + "license": "MIT", + "engines": { + "node": ">=12.20.0" + }, + "peerDependencies": { + "@types/react": ">=18.0.0", + "immer": ">=9.0.6", + "react": ">=18.0.0", + "use-sync-external-store": ">=1.2.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "immer": { + "optional": true + }, + "react": { + "optional": true + }, + "use-sync-external-store": { + "optional": true + } + } + } + } +} diff --git a/web/package.json b/web/package.json new file mode 100644 index 0000000..1ebffdc --- /dev/null +++ b/web/package.json @@ -0,0 +1,54 @@ +{ + "name": "redshell-remote", + "private": true, + "version": "0.0.3", + "type": "module", + "scripts": { + "dev": "vite", + "build": "tsc -b && vite build", + "preview": "vite preview", + "typecheck": "tsc -b", + "lint": "eslint .", + "test": "vitest run", + "icons": "node scripts/icons.ts", + "screenshots": "node scripts/screenshots.ts" + }, + "dependencies": { + "@simplewebauthn/browser": "^14.0.0", + "@tanstack/react-query": "^5.108.4", + "@xterm/addon-fit": "^0.11.0", + "@xterm/addon-unicode11": "^0.9.0", + "@xterm/addon-web-links": "^0.12.0", + "@xterm/addon-webgl": "^0.19.0", + "@xterm/xterm": "^6.0.0", + "lucide-react": "^1.87.0", + "react": "^19.3.1", + "react-dom": "^19.3.1", + "react-router": "^8.5.3", + "zustand": "^5.1.0" + }, + "devDependencies": { + "@eslint/js": "^10.0.1", + "@tailwindcss/vite": "^4.3.5", + "@types/node": "^26.6.11", + "@types/react": "^19.3.3", + "@types/react-dom": "^19.3.0", + "@vite-pwa/assets-generator": "^2.0.0", + "@vitejs/plugin-react": "^6.3.1", + "eslint": "^10.16.0", + "eslint-plugin-react-hooks": "^7.1.1", + "eslint-plugin-react-refresh": "^0.5.8", + "globals": "^17.15.0", + "playwright-core": "^1.65.2", + "tailwindcss": "^4.3.5", + "typescript": "~6.0.3", + "typescript-eslint": "^8.74.0", + "vite": "^8.4.1", + "vite-plugin-pwa": "^2.0.0", + "vitest": "^5.1.2", + "workbox-build": "^7.4.1", + "workbox-precaching": "^7.4.1", + "workbox-routing": "^7.4.1", + "workbox-window": "^7.4.1" + } +} diff --git a/web/public/fonts/JetBrainsMono-Bold.woff2 b/web/public/fonts/JetBrainsMono-Bold.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..c32e1524571977c320b11d7cf0c734e364166ee8 GIT binary patch literal 47788 zcmV(=K-s@{Pew8T0RR910J^LI5dZ)H0u~Se0J=&50RR9100000000000000000000 z0000Qa2p;RfwepaU;v9~2!SXGoD2~N3Wk|jg{uP#jYa?gHUcCAn*anL1%wU}XoboWw0WxEXTIU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sEy9C)4vi`Vh*8bIRxhK;4 z@s`FOU7>w^9G7G1Yt1_-S0n9pVf4;wt!Zm~+R8pvAU{0FzvULIKCaK+ z_Nyk`mCXftbD`Ge{dF(h=%sQXo~6E?111N`GEoLw(nGhzw3Ypy$xKa7pk)C7CHlM9Bfi(KC(J#0J!OJ3uV-;VVg$wc;e3D_&fWy7NU}jA&tFEh!b(E-m0iVk}SNObuGftxqP( z29L*EW1yvE!`-ABLt;|LyYZq=w!-L=0YSG-kY7X#NKSaFR~AdQ*M3G{0;MFy zS6kD?y?72$fsh4WH35fFsU&IZ#`?-!K4bn;_7Qmu3qPlU(kH~58>L|?t-5G z=tF#tznAB7Jv@aI@2a1!@HxJY_vM3JyGKud{qcX|-*}amzJyVzC-e|TpFPF8|C526 ze`@~yHvSBKFH`gIebN0aTsIB)$M`bdlovU3Zu0y; U{J-<__s{;y{`=yOhQIw90FgNui~s-t literal 0 HcmV?d00001 diff --git a/web/public/fonts/JetBrainsMono-Regular.woff2 b/web/public/fonts/JetBrainsMono-Regular.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..ba66ef65e49211adac79d325ecb7dc74274219de GIT binary patch literal 46272 zcmV(=K-s@{Pew8T0RR910JOjW5dZ)H0t@H>0JL2I0RR9100000000000000000000 z0000Qa2p;RfwepaU;v9~2!SXGoD2~N3WkLkg_l+fjYa?gHUcCAn*anL1%xICAPj+4 zTRF{fL)7bjM8ItWs3UOdJ!gIe+g*ds+bq1gCLvMRviR z)Rr41oP;&drW_aKV6tZ~uE=WMt)E9cUvq06-MV9=G=%QPPK_Fgv*dw1df8t79!{pP zpne{|NIUJPE!&H~v0!J%dUXyKi^YFPRC^j`Jk!6uS`9b*Vg)qp+x~0==u{3qSOsrw zvS*R=S5$|baN)#$s`q~>SQrl@eDlgLJW;tL*8!cEfw3{N_7UrxCn~ZIfzBQcFcV6%!d#rDRyP%Vwxz1AK1#!96ZH$2A7*W*h9h-rI4q@pwBJ4;XBW zV}l{bso-^?sd`MoRF#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0UVZt!ZcM-bg(L<>rrQbat|BeZ&@2iy&^Iz`yC;bg8uuHC<=! zsH1l-t$nK2n-BlD@4s5#SXMOBxtCDxnoJK{Zr(4Ge!VtLUI(TX#byj)dgZn<``SFO z_PsI1GPYV?#Q&5|j9PJQsTdLd_tw`u$7;hjuhN%3Kh~o{d4azDV>Z0|#cN5;AKGP9 z%WVO=O|t29o-esTtctOn0(McJVTbiKzpl8hfqK)6lzhBxJ{Ao$(1^aDZTT3F;~)eL z)x;9B9XLiEhy#NFPKNw;X3+s&&eBIYAj~=AGT!yKCf1Q=>bt-2xly=$)zn-vW$x6PnF2!h@sU(`R4Wt z!}|NJadTvSp~CsQo`GPQQ-DzP^~31@sPG!w1+bv)3xGEB2cxR}_8iBU)JEv1FzKc=vGUgsXY|lUondb#SoEAwX+-%i)EgVB, and this removes the class +// when the stored appearance (src/state/prefs.ts) or the system asks for light, so the app +// never flashes the wrong theme. External because the CSP allows no inline script. +(function () { + var appearance = "system"; + try { + var stored = JSON.parse(localStorage.getItem("redshell:prefs") || "null"); + if (stored && stored.state && stored.state.appearance) appearance = stored.state.appearance; + } catch (_) { + // Storage blocked or unreadable: follow the system. + } + var light = + appearance === "light" || + (appearance === "system" && window.matchMedia("(prefers-color-scheme: light)").matches); + if (light) document.documentElement.classList.remove("dark"); +})(); diff --git a/web/src/styles/app.css b/web/src/styles/app.css new file mode 100644 index 0000000..9af058e --- /dev/null +++ b/web/src/styles/app.css @@ -0,0 +1,320 @@ +@import "tailwindcss"; +@import "../../../crates/redshell-theme/themes/redshell.css"; +@import "./tokens.css"; + +@custom-variant dark (&:where(.dark, .dark *)); +@custom-variant pressed (&:active:not(:disabled)); +@custom-variant wide (@media (min-width: 900px)); +@custom-variant hover (@media (hover: hover) and (pointer: fine) { &:hover:not(:disabled) }); + +@theme inline { + --color-background: var(--background); + --color-foreground: var(--foreground); + --color-card: var(--card); + --color-popover: var(--popover); + --color-sunken: var(--sunken); + --color-secondary: var(--secondary); + --color-muted: var(--muted); + --color-muted-foreground: var(--muted-foreground); + --color-accent: var(--accent); + --color-border: var(--border); + --color-field-border: var(--field-border); + --color-ring: var(--ring); + --color-primary: var(--primary); + --color-primary-solid: var(--primary-solid); + --color-primary-solid-pressed: var(--primary-solid-pressed); + --color-primary-foreground: var(--primary-foreground); + --color-destructive: var(--destructive); + --color-state-working: var(--state-working); + --color-state-attention: var(--state-attention); + --color-state-done: var(--state-done); + --color-state-warn: var(--state-warn); + --color-attention-fg: var(--attention-fg); + --color-attention-bg: var(--attention-bg); + --color-diff-add-bg: var(--diff-add-bg); + --color-diff-del-bg: var(--diff-del-bg); + --color-diff-add-fg: var(--diff-add-fg); + --color-diff-del-fg: var(--diff-del-fg); + --color-sidebar: var(--sidebar); + + --font-sans: var(--font-sans); + --font-mono: var(--font-mono); + + --shadow-sheet: var(--shadow-sheet); + --shadow-menu: var(--shadow-menu); + --shadow-float: var(--shadow-float); + + --ease-out: var(--ease-out); + --ease-in: var(--ease-in); + --ease-sheet: var(--ease-sheet); +} + +@theme { + --text-title: 1.75rem; + --text-title--line-height: 1.15; + --text-title--letter-spacing: -0.015em; + --text-title--font-weight: 600; + --text-heading: 1.0625rem; + --text-heading--line-height: 1.3; + --text-heading--font-weight: 600; + --text-body: 1rem; + --text-body--line-height: 1.4; + --text-footnote: 0.8125rem; + --text-footnote--line-height: 1.35; + --text-caption: 0.75rem; + --text-caption--line-height: 1.3; + --text-caption--font-weight: 500; + --text-mono-body: 0.8125rem; + --text-mono-body--line-height: 1.5; + --text-mono-caption: 0.75rem; + --text-mono-caption--line-height: 1.3; + --text-mono-code: 1.25rem; + --text-mono-code--line-height: 1.2; + --text-mono-code--letter-spacing: 0.08em; + --text-mono-code--font-weight: 500; + + --radius-sm: 6px; + --radius-md: 8px; + --radius-lg: 10px; + --radius-xl: 14px; + --radius-sheet: 16px; + + --animate-cursor: cursor-pulse 1.2s ease-in-out infinite alternate; + --animate-enter: enter var(--dur-base) var(--ease-out) both; + --animate-fade: fade var(--dur-fast) var(--ease-out) both; + + @keyframes cursor-pulse { + from { + opacity: 1; + } + to { + opacity: 0.3; + } + } + @keyframes enter { + from { + opacity: 0; + transform: translateY(var(--enter-from, 8px)); + } + } + @keyframes fade { + from { + opacity: 0; + } + } +} + +@layer base { + html { + font-family: var(--font-sans); + background: var(--background); + color: var(--foreground); + -webkit-text-size-adjust: 100%; + -webkit-tap-highlight-color: transparent; + } + + @supports (font: -apple-system-body) { + html { + font: -apple-system-body; + font-family: var(--font-sans); + } + } + + body { + min-height: 100dvh; + font-size: var(--text-body); + line-height: 1.4; + overscroll-behavior-y: none; + } + + button, + input, + textarea, + select { + font: inherit; + color: inherit; + } + + button { + cursor: default; + touch-action: manipulation; + } + + :focus-visible { + outline: none; + box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring) 35%, transparent); + } + + ::selection { + background: color-mix(in oklch, var(--primary) 28%, transparent); + } +} + +@layer utilities { + .tabular { + font-variant-numeric: tabular-nums; + } + + .pt-safe { + padding-top: var(--safe-top); + } + + .pb-safe { + padding-bottom: var(--safe-bottom); + } + + .px-safe { + padding-left: var(--safe-left); + padding-right: var(--safe-right); + } + + /* An ellipsis at the start, so the end of a path (the file name) stays visible. */ + .truncate-start { + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + direction: rtl; + text-align: left; + } + + .scrollbar-none { + scrollbar-width: none; + } + + .scrollbar-none::-webkit-scrollbar { + display: none; + } +} + +@keyframes sheet-in { + from { + transform: translateY(100%); + } +} + +@keyframes sheet-out { + from { + transform: translateY(var(--drag, 0px)); + } + to { + transform: translateY(100%); + } +} + +@keyframes dialog-in { + from { + opacity: 0; + transform: translateY(8px); + } +} + +/* Runs only for its end: the approval sheet's 500ms accidental-tap guard. */ +@keyframes guard { + to { + opacity: 1; + } +} + +@keyframes fade-out { + to { + opacity: 0; + } +} + +@keyframes collapse { + to { + height: 0; + opacity: 0; + } +} + +/* Mobile navigation into a session: 200ms fade with 16px from the right; back reverses it. + The classes are the transition types of src/lib/nav.ts. */ +::view-transition-old(.nav-forward) { + animation: 200ms var(--ease-in) both nav-out; +} + +::view-transition-new(.nav-forward) { + animation: 200ms var(--ease-out) both nav-in; +} + +::view-transition-old(.nav-back) { + animation: 200ms var(--ease-in) both nav-out-back; +} + +::view-transition-new(.nav-back) { + animation: 200ms var(--ease-out) both nav-in-back; +} + +@keyframes nav-in { + from { + opacity: 0; + transform: translateX(16px); + } +} + +@keyframes nav-out { + to { + opacity: 0; + } +} + +@keyframes nav-in-back { + from { + opacity: 0; + } +} + +@keyframes nav-out-back { + to { + opacity: 0; + transform: translateX(16px); + } +} + +@media (prefers-reduced-motion: reduce) { + :root { + --enter-from: 0px; + } + + .animate-cursor { + animation: none; + } + + /* Transforms become 160ms opacity fades; navigation is instant. */ + @keyframes sheet-in { + from { + opacity: 0; + } + } + + @keyframes sheet-out { + to { + opacity: 0; + } + } + + @keyframes dialog-in { + from { + opacity: 0; + } + } + + ::view-transition-group(*), + ::view-transition-old(*), + ::view-transition-new(*) { + animation: none !important; + } +} + +/* On touch screens the terminal scrolls by drag; its scrollbar would only take a column. */ +@media (pointer: coarse) { + .xterm .xterm-scrollable-element > .scrollbar { + display: none !important; + } +} + +/* The Lucide stroke of the desktop icon set. */ +svg.lucide { + stroke-width: 1.75; +} diff --git a/web/src/styles/tokens.css b/web/src/styles/tokens.css new file mode 100644 index 0000000..692cee4 --- /dev/null +++ b/web/src/styles/tokens.css @@ -0,0 +1,95 @@ +/* PWA tokens on top of redshell.css (docs/design/remote-pwa-visual.md §1). Light first, then + the .dark overrides; anything redshell.css also sets in .dark is repeated there, because this + file's :root comes later and would otherwise win. */ + +@font-face { + font-family: "JetBrains Mono"; + font-style: normal; + font-weight: 400; + font-display: block; + src: url("/fonts/JetBrainsMono-Regular.woff2") format("woff2"); +} + +@font-face { + font-family: "JetBrains Mono"; + font-style: normal; + font-weight: 700; + font-display: block; + src: url("/fonts/JetBrainsMono-Bold.woff2") format("woff2"); +} + +:root { + --sunken: var(--sidebar); + --field-border: oklch(0.64 0.012 17); + --primary-solid: #dc233a; + --primary-solid-pressed: #c51b32; + --destructive: oklch(0.53 0.22 27); + + --state-working: var(--foreground); + --state-attention: var(--primary); + --state-done: oklch(0.52 0.13 160); + --state-warn: oklch(0.55 0.13 75); + --attention-fg: oklch(0.52 0.2 22); + --attention-bg: color-mix(in oklch, var(--primary) 9%, var(--card)); + + --diff-add-bg: #d7ece4; + --diff-del-bg: #f7e1e4; + --diff-add-fg: #00683d; + --diff-del-fg: #af2934; + + --scrim-sheet: rgb(10 10 18 / 30%); + --scrim-dialog: rgb(10 10 18 / 45%); + --shadow-sheet: 0 -8px 32px rgb(23 15 16 / 10%); + --shadow-menu: 0 8px 24px rgb(23 15 16 / 12%); + --shadow-float: 0 4px 16px rgb(23 15 16 / 12%); + + --segment-selected: #fff; + --segment-selected-border: transparent; + --segment-selected-shadow: 0 1px 2px rgb(23 15 16 / 10%); + + --dur-press: 100ms; + --dur-fast: 160ms; + --dur-base: 240ms; + --dur-sheet: 340ms; + --ease-out: cubic-bezier(0.23, 1, 0.32, 1); + --ease-sheet: cubic-bezier(0.32, 0.72, 0, 1); + --ease-in: cubic-bezier(0.4, 0, 1, 1); + + --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, + sans-serif; + --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, "Cascadia Mono", "Roboto Mono", monospace; + + --safe-top: env(safe-area-inset-top, 0px); + --safe-bottom: env(safe-area-inset-bottom, 0px); + --safe-left: env(safe-area-inset-left, 0px); + --safe-right: env(safe-area-inset-right, 0px); + + color-scheme: light; +} + +.dark { + --field-border: rgb(255 255 255 / 36%); + --destructive: oklch(0.65 0.22 25); + + --state-done: oklch(0.72 0.15 160); + --state-warn: oklch(0.8 0.15 80); + --attention-fg: oklch(0.7 0.19 22); + --attention-bg: color-mix(in oklch, var(--primary) 12%, var(--card)); + + --diff-add-bg: #0f1d16; + --diff-del-bg: #2c0f11; + --diff-add-fg: #68d7a1; + --diff-del-fg: #fb9795; + + --scrim-sheet: rgb(0 0 0 / 55%); + --scrim-dialog: rgb(0 0 0 / 72%); + --shadow-sheet: none; + --shadow-menu: none; + --shadow-float: 0 8px 24px rgb(0 0 0 / 50%); + + --segment-selected: var(--popover); + --segment-selected-border: var(--border); + --segment-selected-shadow: none; + + color-scheme: dark; +} diff --git a/web/tsconfig.app.json b/web/tsconfig.app.json new file mode 100644 index 0000000..474ec02 --- /dev/null +++ b/web/tsconfig.app.json @@ -0,0 +1,11 @@ +{ + "extends": "./tsconfig.base.json", + "compilerOptions": { + "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo", + "lib": ["ES2023", "DOM", "DOM.Iterable"], + "jsx": "react-jsx", + "types": ["vite/client", "vite-plugin-pwa/client"] + }, + "include": ["src"], + "exclude": ["src/sw.ts"] +} diff --git a/web/tsconfig.base.json b/web/tsconfig.base.json new file mode 100644 index 0000000..05ff977 --- /dev/null +++ b/web/tsconfig.base.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "target": "ES2022", + "module": "ESNext", + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "verbatimModuleSyntax": true, + "moduleDetection": "force", + "noEmit": true, + "skipLibCheck": true, + "strict": true, + "noUncheckedIndexedAccess": true, + "noImplicitOverride": true, + "noFallthroughCasesInSwitch": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "erasableSyntaxOnly": true + } +} diff --git a/web/tsconfig.json b/web/tsconfig.json new file mode 100644 index 0000000..ece72a5 --- /dev/null +++ b/web/tsconfig.json @@ -0,0 +1,8 @@ +{ + "files": [], + "references": [ + { "path": "./tsconfig.app.json" }, + { "path": "./tsconfig.sw.json" }, + { "path": "./tsconfig.node.json" } + ] +} diff --git a/web/tsconfig.node.json b/web/tsconfig.node.json new file mode 100644 index 0000000..3218690 --- /dev/null +++ b/web/tsconfig.node.json @@ -0,0 +1,9 @@ +{ + "extends": "./tsconfig.base.json", + "compilerOptions": { + "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo", + "lib": ["ES2023", "DOM"], + "types": ["node"] + }, + "include": ["vite.config.ts", "scripts"] +} diff --git a/web/tsconfig.sw.json b/web/tsconfig.sw.json new file mode 100644 index 0000000..b4b8bfc --- /dev/null +++ b/web/tsconfig.sw.json @@ -0,0 +1,9 @@ +{ + "extends": "./tsconfig.base.json", + "compilerOptions": { + "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.sw.tsbuildinfo", + "lib": ["ES2023", "WebWorker"], + "types": [] + }, + "include": ["src/sw.ts"] +} diff --git a/web/vite.config.ts b/web/vite.config.ts new file mode 100644 index 0000000..d046004 --- /dev/null +++ b/web/vite.config.ts @@ -0,0 +1,59 @@ +import { fileURLToPath } from "node:url"; +import tailwindcss from "@tailwindcss/vite"; +import react from "@vitejs/plugin-react"; +import { VitePWA } from "vite-plugin-pwa"; +import { defineConfig } from "vitest/config"; + +const repoRoot = fileURLToPath(new URL("..", import.meta.url)); + +export default defineConfig({ + plugins: [ + react(), + tailwindcss(), + VitePWA({ + strategies: "injectManifest", + srcDir: "src", + filename: "sw.ts", + // Registered from src/pwa/register.ts: the CSP allows no inline script. + injectRegister: false, + registerType: "prompt", + manifest: { + id: "/", + name: "RedShell Remote", + short_name: "RedShell", + start_url: "/", + scope: "/", + display: "standalone", + orientation: "any", + background_color: "#0f0b0b", + theme_color: "#0f0b0b", + categories: ["developer", "utilities"], + icons: [ + { src: "/pwa-64.png", sizes: "64x64", type: "image/png" }, + { src: "/pwa-192.png", sizes: "192x192", type: "image/png" }, + { src: "/pwa-512.png", sizes: "512x512", type: "image/png" }, + { src: "/maskable-512.png", sizes: "512x512", type: "image/png", purpose: "maskable" }, + ], + }, + injectManifest: { + globPatterns: ["**/*.{js,css,html,svg,png,ico,woff2,webmanifest}"], + // The mock backend is for development and screenshots only. + globIgnores: ["**/apple-splash-*.png", "**/mock-*.js"], + }, + }), + ], + server: { + fs: { allow: [repoRoot] }, + proxy: { + "/api": { target: "http://127.0.0.1:4747", ws: true, changeOrigin: false }, + }, + }, + build: { + target: "es2022", + sourcemap: false, + }, + test: { + environment: "node", + include: ["src/**/*.test.ts"], + }, +}); From 50135ae00838623aad34dcd3ea98e0356cb1192e Mon Sep 17 00:00:00 2001 From: ForeverInLaw <44206490+ForeverInLaw@users.noreply.github.com> Date: Fri, 4 Dec 2026 13:35:32 +0000 Subject: [PATCH 022/128] web: add the API client, the WebSocket connection and a mock backend src/api/client.ts is the one place that lists what the PWA asks of redshell-server, typed with the protocol generated into src/protocol/. The calls of the next server phase (passkeys, passkey-only sign-in, pairing, Web Push, SSH hosts) are kept apart in src/api/pending/. Connection owns the single /api/ws socket: it subscribes to sessions and events, multiplexes attached sessions over 2-byte binary channels, reconnects with jittered exponential backoff (0.5 s up to 10 s), and after every reconnect subscribes again and re-attaches each session for a fresh snapshot. A close with 4001 stops the retries. The mock backend (`?mock[=scenario]` or VITE_MOCK=1) speaks the same REST and WebSocket protocol in the browser, so the real client runs against it: live agents, approvals, shells that echo, and scenarios for every state the screens have. It is a separate chunk, never precached. --- web/src/api/browser.ts | 50 +++ web/src/api/client.ts | 102 ++++++ web/src/api/framing.ts | 19 + web/src/api/http.ts | 85 +++++ web/src/api/mock/data.ts | 333 +++++++++++++++++ web/src/api/mock/index.ts | 648 ++++++++++++++++++++++++++++++++++ web/src/api/mock/screens.ts | 116 ++++++ web/src/api/mock/socket.ts | 57 +++ web/src/api/pending/client.ts | 66 ++++ web/src/api/pending/types.ts | 84 +++++ web/src/api/queries.ts | 106 ++++++ web/src/api/socket.test.ts | 249 +++++++++++++ web/src/api/socket.ts | 259 ++++++++++++++ web/src/api/types.ts | 7 + 14 files changed, 2181 insertions(+) create mode 100644 web/src/api/browser.ts create mode 100644 web/src/api/client.ts create mode 100644 web/src/api/framing.ts create mode 100644 web/src/api/http.ts create mode 100644 web/src/api/mock/data.ts create mode 100644 web/src/api/mock/index.ts create mode 100644 web/src/api/mock/screens.ts create mode 100644 web/src/api/mock/socket.ts create mode 100644 web/src/api/pending/client.ts create mode 100644 web/src/api/pending/types.ts create mode 100644 web/src/api/queries.ts create mode 100644 web/src/api/socket.test.ts create mode 100644 web/src/api/socket.ts create mode 100644 web/src/api/types.ts diff --git a/web/src/api/browser.ts b/web/src/api/browser.ts new file mode 100644 index 0000000..7e6394c --- /dev/null +++ b/web/src/api/browser.ts @@ -0,0 +1,50 @@ +import { + browserSupportsWebAuthnAutofill, + startAuthentication, + startRegistration, + WebAuthnAbortService, +} from "@simplewebauthn/browser"; +import type { Transport } from "./client"; + +/** The real outside world: the page's origin, its WebSocket and the platform's passkeys. */ +export function browserTransport(): Transport { + const scheme = location.protocol === "https:" ? "wss:" : "ws:"; + return { + fetch: (input, init) => fetch(input, init), + createSocket: (url) => new WebSocket(url), + socketUrl: `${scheme}//${location.host}/api/ws`, + host: location.host, + webauthn: { + authenticate: (optionsJSON, autofill) => startAuthentication({ optionsJSON, useBrowserAutofill: autofill }), + register: (optionsJSON) => startRegistration({ optionsJSON }), + supportsAutofill: browserSupportsWebAuthnAutofill, + cancel: () => WebAuthnAbortService.cancelCeremony(), + }, + }; +} + +const MOCK_KEY = "redshell:mock"; + +/** + * The mock scenario for this tab, or `null` for the real server. `?mock` (or `?mock=`) + * switches it on and is remembered for the tab; `VITE_MOCK=1` switches it on for a whole build. + */ +function mockScenario(): string | null { + const param = new URLSearchParams(location.search).get("mock"); + if (param !== null) { + const scenario = param || "default"; + sessionStorage.setItem(MOCK_KEY, scenario); + return scenario; + } + const remembered = sessionStorage.getItem(MOCK_KEY); + if (remembered !== null) return remembered; + return import.meta.env.VITE_MOCK === "1" ? "default" : null; +} + +/** The transport the app runs on. The mock backend is a separate chunk, loaded only when asked for. */ +export async function createTransport(): Promise { + const scenario = mockScenario(); + if (scenario === null) return browserTransport(); + const { createMockTransport } = await import("./mock"); + return createMockTransport(scenario); +} diff --git a/web/src/api/client.ts b/web/src/api/client.ts new file mode 100644 index 0000000..a611d53 --- /dev/null +++ b/web/src/api/client.ts @@ -0,0 +1,102 @@ +import type { + AuthenticationResponseJSON, + PublicKeyCredentialCreationOptionsJSON, + PublicKeyCredentialRequestOptionsJSON, + RegistrationResponseJSON, +} from "@simplewebauthn/browser"; +import { createHttp, type FetchFn } from "./http"; +import { createPendingApi } from "./pending/client"; +import { Connection, type SocketFactory } from "./socket"; +import type { + Approval, + ApprovalAnswer, + BrowserSession, + ChangePasswordRequest, + CreateSessionRequest, + Device, + FolderListing, + Profile, + RenameSessionRequest, + ServerInfo, + SessionInfo, + SetupRequest, + SignInRequest, + SignInResponse, + User, +} from "./types"; + +/** The platform side of a WebAuthn ceremony (the system passkey sheet). */ +export interface WebAuthn { + /** `autofill` runs it as conditional mediation: the passkey appears in the username field's suggestions. */ + authenticate(options: PublicKeyCredentialRequestOptionsJSON, autofill: boolean): Promise; + register(options: PublicKeyCredentialCreationOptionsJSON): Promise; + supportsAutofill(): Promise; + /** Stops a ceremony in flight, such as the autofill one when the sign-in screen goes away. */ + cancel(): void; +} + +/** Everything the API needs from the outside world; the mock backend provides its own. */ +export interface Transport { + fetch: FetchFn; + createSocket: SocketFactory; + socketUrl: string; + /** The server's host as people know it (`pi.tail9c2.ts.net`). */ + host: string; + webauthn: WebAuthn; +} + +const enc = encodeURIComponent; + +/** + * The typed client of redshell-server (docs/REMOTE.md): REST under `/api` and the one + * WebSocket. Every call the PWA makes is listed here; the calls of the next server phase are + * in ./pending/client.ts and spread in at the end. + */ +export function createApi(transport: Transport, onUnauthorized: () => void) { + const http = createHttp(transport.fetch, onUnauthorized); + const connection = new Connection(transport.socketUrl, transport.createSocket); + + return { + connection, + webauthn: transport.webauthn, + host: transport.host, + + info: () => http.get("/api/auth/info"), + + auth: { + me: () => http.get("/api/auth/me"), + signIn: (body: SignInRequest) => http.post("/api/auth/sign-in", body), + signOut: () => http.post("/api/auth/sign-out"), + setup: (body: SetupRequest) => http.post("/api/setup", body), + }, + + account: { + changePassword: (body: ChangePasswordRequest) => http.post("/api/account/password", body), + devices: () => http.get("/api/account/devices"), + revokeDevice: (id: number) => http.delete(`/api/account/devices/${id}`), + browsers: () => http.get("/api/account/sessions"), + revokeBrowser: (id: number) => http.delete(`/api/account/sessions/${id}`), + }, + + sessions: { + list: () => http.get("/api/sessions"), + create: (body: CreateSessionRequest) => http.post("/api/sessions", body), + rename: (id: string, body: RenameSessionRequest) => http.patch(`/api/sessions/${enc(id)}`, body), + kill: (id: string) => http.delete(`/api/sessions/${enc(id)}`), + }, + + approvals: { + list: () => http.get("/api/approvals"), + answer: (id: string, body: ApprovalAnswer) => http.post(`/api/approvals/${enc(id)}`, body), + }, + + profiles: () => http.get("/api/profiles"), + + /** Subfolders of an absolute folder on the server, for path completion. */ + folders: (path: string) => http.get(`/api/fs/folders?path=${enc(path)}`), + + ...createPendingApi(http), + }; +} + +export type Api = ReturnType; diff --git a/web/src/api/framing.ts b/web/src/api/framing.ts new file mode 100644 index 0000000..6df36a3 --- /dev/null +++ b/web/src/api/framing.ts @@ -0,0 +1,19 @@ +// Binary WebSocket frames: a 2-byte big-endian channel number (from `attached`), then the +// terminal bytes. Mirrors `frame` / `unframe` in crates/redshell-protocol/src/ws.rs. + +export function frame(channel: number, bytes: Uint8Array): Uint8Array { + const out = new Uint8Array(bytes.length + 2); + out[0] = (channel >> 8) & 0xff; + out[1] = channel & 0xff; + out.set(bytes, 2); + return out; +} + +/** The channel and bytes of a frame; `null` when it is too short to carry a channel. */ +export function unframe(data: ArrayBuffer | Uint8Array): { channel: number; bytes: Uint8Array } | null { + const view = data instanceof Uint8Array ? data : new Uint8Array(data); + if (view.length < 2) return null; + const high = view[0] ?? 0; + const low = view[1] ?? 0; + return { channel: (high << 8) | low, bytes: view.subarray(2) }; +} diff --git a/web/src/api/http.ts b/web/src/api/http.ts new file mode 100644 index 0000000..a8e3daf --- /dev/null +++ b/web/src/api/http.ts @@ -0,0 +1,85 @@ +import type { ApiError, ErrorCode } from "./types"; + +/** The server answered with an error body (`ApiError`). */ +export class ApiRequestError extends Error { + readonly status: number; + readonly code: ErrorCode; + readonly retryAfterSecs: number | null; + + constructor(status: number, body: ApiError) { + super(body.message); + this.name = "ApiRequestError"; + this.status = status; + this.code = body.code; + this.retryAfterSecs = body.retry_after_secs ?? null; + } +} + +/** The request never got an answer: offline, DNS, TLS, or the server is down. */ +export class NetworkError extends Error { + constructor(cause: unknown) { + super("The server could not be reached", { cause }); + this.name = "NetworkError"; + } +} + +export type Method = "GET" | "POST" | "PUT" | "PATCH" | "DELETE"; + +export type FetchFn = (input: string, init: RequestInit) => Promise; + +/** Status → error code for responses whose body isn't an `ApiError` (a proxy's 502 page). */ +function codeForStatus(status: number): ErrorCode { + if (status === 401) return "unauthorized"; + if (status === 403) return "forbidden"; + if (status === 404) return "not_found"; + if (status === 409) return "conflict"; + if (status === 429) return "rate_limited"; + if (status < 500) return "bad_request"; + return "internal"; +} + +function isApiError(value: unknown): value is ApiError { + return typeof value === "object" && value !== null && "code" in value && "message" in value; +} + +/** + * JSON over fetch with the session cookie. Every state-changing request carries the page's + * Origin (the browser adds it), which the server checks. Returns the parsed body; responses + * are trusted to match the server's types, as they are generated from the same source. + */ +export function createHttp(fetchFn: FetchFn, onUnauthorized: () => void) { + async function request(method: Method, path: string, body?: unknown): Promise { + let response: Response; + try { + response = await fetchFn(path, { + method, + credentials: "same-origin", + headers: body === undefined ? undefined : { "Content-Type": "application/json" }, + body: body === undefined ? undefined : JSON.stringify(body), + }); + } catch (cause) { + throw new NetworkError(cause); + } + const text = await response.text(); + const parsed: unknown = text ? JSON.parse(text) : null; + if (!response.ok) { + const error = isApiError(parsed) + ? parsed + : { code: codeForStatus(response.status), message: response.statusText || `HTTP ${response.status}` }; + // A wrong password is a 401 too (`invalid_credentials`); only a lost sign-in signs out. + if (error.code === "unauthorized") onUnauthorized(); + throw new ApiRequestError(response.status, error); + } + return parsed as T; + } + + return { + get: (path: string) => request("GET", path), + post: (path: string, body?: unknown) => request("POST", path, body ?? {}), + put: (path: string, body: unknown) => request("PUT", path, body), + patch: (path: string, body: unknown) => request("PATCH", path, body), + delete: (path: string, body?: unknown) => request("DELETE", path, body), + }; +} + +export type Http = ReturnType; diff --git a/web/src/api/mock/data.ts b/web/src/api/mock/data.ts new file mode 100644 index 0000000..00e5f86 --- /dev/null +++ b/web/src/api/mock/data.ts @@ -0,0 +1,333 @@ +import type { Approval, BrowserSession, Device, Passkey, Profile, SessionInfo, SshHost } from "../types"; +import { + asked, + claudeScreen, + codexScreen, + dim, + fail, + opencodeScreen, + pass, + result, + said, + type Screen, + shellScreen, + tool, +} from "./screens"; + +export const HOME = "/home/andy"; +const PROFILE_NAMES: Record = { claude: "Claude Code", codex: "Codex", opencode: "OpenCode" }; + +const MINUTE = 60_000; +const HOUR = 60 * MINUTE; +const DAY = 24 * HOUR; + +export interface Seed { + sessions: SessionInfo[]; + screens: Map; + approvals: Approval[]; +} + +function session(fields: Partial & Pick, now: number): SessionInfo { + return { + name: null, + profile: null, + agent: null, + agent_state: null, + last_message: null, + cwd: null, + profile_name: null, + command: null, + start_cwd: null, + cols: 47, + rows: 39, + created_at: now - DAY, + active_at: now, + last_line: null, + exit: null, + pending_approvals: 0, + ...fields, + }; +} + +function bashApproval(now: number, approvalTimeoutMs: number): Approval { + return { + id: "ap-npm-ci", + session: "aurora", + tool: "Bash", + input: { command: "rm -rf node_modules && npm ci", description: "Reinstall dependencies from scratch" }, + summary: "rm -rf node_modules && npm ci", + description: "Reinstall dependencies from scratch", + permission_suggestions: [ + { type: "addRules", rules: [{ toolName: "Bash", ruleContent: "npm ci:*" }], behavior: "allow", destination: "localSettings" }, + ], + created_at: now - 2 * MINUTE, + expires_at: now - 2 * MINUTE + approvalTimeoutMs, + }; +} + +function editApproval(now: number): Approval { + return { + id: "ap-edit-feed", + session: "aurora", + tool: "Edit", + input: { + file_path: "/home/andy/src/aurora/src/lib/feed.ts", + old_string: [ + "export async function loadFeed(params: URLSearchParams) {", + " const releases = await getReleases()", + " return releases", + "}", + ].join("\n"), + new_string: [ + "export async function loadFeed(params: URLSearchParams) {", + " const releases = await getReleases()", + " const range = parseRange(params)", + " return getReleases({ range })", + "}", + ].join("\n"), + }, + summary: "src/lib/feed.ts", + description: null, + permission_suggestions: [ + { type: "addRules", rules: [{ toolName: "Edit", ruleContent: "src/**" }], behavior: "allow", destination: "localSettings" }, + ], + created_at: now - 12_000, + expires_at: now + 588_000, + }; +} + +function fetchApproval(now: number): Approval { + return { + id: "ap-fetch", + session: "aurora", + tool: "WebFetch", + input: { + url: "https://docs.npmjs.com/cli/v10/commands/npm-ci", + prompt: "Summarise when npm ci refuses to run and what it does with an existing node_modules folder.", + }, + summary: "docs.npmjs.com", + description: null, + permission_suggestions: null, + created_at: now - 30_000, + expires_at: now + 570_000, + }; +} + +/** The sessions, screens and approvals a scenario starts with. */ +function agentSession( + id: string, + agent: string, + state: SessionInfo["agent_state"], + age: number, + fields: Partial, + now: number, +): SessionInfo { + return session( + { id, title: id, kind: "agent", profile: `agent:${agent}`, agent, agent_state: state, cwd: `${HOME}/src/${id}`, start_cwd: `${HOME}/src/${id}`, profile_name: PROFILE_NAMES[agent] ?? agent, active_at: now - age, ...fields }, + now, + ); +} + +function seedSessions(now: number, pending: number): SessionInfo[] { + return [ + agentSession("aurora", "claude", "needs_approval", 2 * MINUTE, { last_line: "Waiting for permission…", pending_approvals: pending }, now), + agentSession( + "api-gateway", + "codex", + "needs_input", + 14 * MINUTE, + { + last_message: "Which port should the gateway listen on? 8080 is taken by the dashboard.", + last_line: "Which port should the gateway listen on?", + }, + now, + ), + agentSession("aurora-web", "opencode", "working", 5_000, { last_line: "Reading src/routes/+page.svelte" }, now), + agentSession("docs", "claude", "finished", HOUR + 4 * MINUTE, { last_message: "Updated REMOTE.md and the endpoint table.", last_line: "Updated REMOTE.md and the endpoint table." }, now), + agentSession("scratch", "claude", "idle", 2 * HOUR + 10 * MINUTE, { last_line: "> " }, now), + session({ id: "shell-aurora", title: "~/src/aurora", kind: "shell", profile: "shell", profile_name: "zsh", cwd: `${HOME}/src/aurora`, start_cwd: `${HOME}/src/aurora`, active_at: now - 3 * HOUR, last_line: "andy@pi:~/src/aurora$" }, now), + session( + { + id: "build", + title: "make release", + kind: "shell", + profile: "shell", + profile_name: "zsh", + cwd: `${HOME}/src/redshell`, + start_cwd: `${HOME}/src/redshell`, + active_at: now - 5 * HOUR, + last_line: "Finished release [optimized] target(s) in 4m 12s", + exit: { code: 0, at: now - 5 * HOUR }, + }, + now, + ), + session( + { + id: "prod-api", + title: "prod-api", + kind: "ssh", + profile: "ssh:prod-api", + profile_name: "prod-api", + active_at: now - 4 * DAY, + last_line: "Connection closed by 10.0.4.12 port 22", + exit: { code: 255, at: now - 4 * DAY }, + }, + now, + ), + ]; +} + +function seedScreens(): Map { + const prodApi = shellScreen("deploy", "prod-api", "~", [["sudo systemctl restart api", []]]); + return new Map([ + [ + "aurora", + claudeScreen([ + asked("Run the tests and fix anything that fails"), + "", + said("I'll run the test suite first."), + "", + tool("Bash", "npm run test -- --watch=false"), + ...result(pass("src/lib/feed.test.ts", 14), pass("src/routes/api.test.ts", 9), fail("src/lib/install.test.ts")), + "", + said("The lockfile no longer matches package.json. I'll reinstall from scratch."), + "", + tool("Bash", "rm -rf node_modules && npm ci"), + ...result(dim("Waiting for permission…")), + ]), + ], + [ + "api-gateway", + codexScreen([ + asked("Add a health check endpoint to the gateway"), + "", + "• Added GET /healthz in src/server.ts", + "• Wired it into the readiness probe.", + "", + "• Which port should the gateway listen on?", + " 8080 is taken by the dashboard.", + ]), + ], + [ + "aurora-web", + opencodeScreen([ + asked("Move the release list to the new feed API"), + "", + `${dim("│")} Read src/lib/api.ts`, + `${dim("│")} Read src/routes/+page.ts`, + `${dim("│")} Reading src/routes/+page.svelte`, + ]), + ], + [ + "docs", + claudeScreen([ + asked("Document the new endpoints in REMOTE.md"), + "", + tool("Update", "docs/REMOTE.md"), + ...result(`Updated docs/REMOTE.md with ${dim("42 additions")}`), + "", + said("Updated REMOTE.md and the endpoint table."), + ]), + ], + ["scratch", claudeScreen([])], + [ + "shell-aurora", + shellScreen("andy", "pi", "~/src/aurora", [ + ["git status", ["On branch main", "Your branch is up to date with 'origin/main'.", "", "nothing to commit, working tree clean"]], + ]), + ], + [ + "build", + shellScreen("andy", "pi", "~/src/redshell", [ + ["make release", [" Compiling redshell-server v0.0.3", " Finished release [optimized] target(s) in 4m 12s"]], + ]), + ], + [ + "prod-api", + { ...prodApi, text: `${prodApi.text}client_loop: send disconnect: Broken pipe\r\nConnection closed by 10.0.4.12 port 22\r\n` }, + ], + ]); +} + +/** The sessions, screens and approvals a scenario starts with. */ +export function seed(scenario: string, now: number): Seed { + if (scenario === "empty") return { sessions: [], screens: new Map(), approvals: [] }; + + const approvalTimeout = scenario === "expiring" ? 2 * MINUTE + 45_000 : 10 * MINUTE; + const queue: Record = { + diff: [editApproval(now)], + other: [fetchApproval(now)], + }; + const approvals = queue[scenario] ?? [bashApproval(now, approvalTimeout), editApproval(now)]; + return { sessions: seedSessions(now, approvals.length), screens: seedScreens(), approvals }; +} + +export const profiles: Profile[] = [ + { id: "agent:claude", name: "Claude Code", kind: "agent", description: "claude", available: true, group: null }, + { id: "agent:codex", name: "Codex", kind: "agent", description: "codex", available: true, group: null }, + { id: "agent:opencode", name: "OpenCode", kind: "agent", description: "opencode", available: false, group: null }, + { id: "shell", name: "zsh", kind: "shell", description: "/usr/bin/zsh", available: true, group: null }, + { id: "shell:bash", name: "bash", kind: "shell", description: "/bin/bash", available: true, group: null }, + { id: "ssh:prod-api", name: "prod-api", kind: "ssh", description: "deploy@10.0.4.12", available: true, group: "Production" }, + { id: "ssh:staging", name: "staging", kind: "ssh", description: "andy@staging.internal", available: true, group: "Production" }, + { id: "ssh:nas", name: "nas", kind: "ssh", description: "andy@nas.local", available: true, group: null }, + { id: "ssh:gpu-box", name: "gpu-box", kind: "ssh", description: "andy@192.168.1.40", available: true, group: "From ~/.ssh/config" }, +]; + +export const hosts: SshHost[] = [ + host("prod-api", "10.0.4.12", "deploy", "Production"), + host("staging", "staging.internal", "andy", "Production"), + host("nas", "nas.local", "andy", null), + { ...host("gpu-box", "192.168.1.40", "andy", null), identity_file: "~/.ssh/id_ed25519", origin: "ssh_config" }, +]; + +function host(name: string, address: string, user: string, group: string | null): SshHost { + return { name, host: address, user, port: null, identity_file: null, jump_host: null, group, origin: "redshell" }; +} + +/** A small folder tree for "Other folder…" completion (`GET /api/fs/folders`). */ +export const folderTree: Record = { + "/": ["bin", "etc", "home", "opt", "srv", "usr", "var"], + "/home": ["andy"], + [HOME]: [".config", "Downloads", "notes", "src"], + [`${HOME}/src`]: ["api-gateway", "aurora", "aurora-web", "docs", "redshell", "scratch"], + [`${HOME}/src/aurora`]: ["scripts", "src", "tests"], +}; + +export function passkeys(now: number, scenario: string): Passkey[] { + if (scenario === "no-passkeys") return []; + return [ + { id: 1, name: "iPhone", created_at: Date.parse("2026-03-03T10:00:00Z"), last_used_at: now - HOUR }, + { id: 2, name: "MacBook Pro", created_at: Date.parse("2026-03-12T10:00:00Z"), last_used_at: now - 2 * DAY }, + ]; +} + +export function devices(now: number): Device[] { + return [ + { id: 1, name: "MacBook Pro", created_at: now - 30 * DAY, last_seen_at: now - 5 * MINUTE, last_ip: "100.64.0.2", current: false }, + { id: 2, name: "Workstation", created_at: now - 60 * DAY, last_seen_at: now - 3 * DAY, last_ip: "100.64.0.7", current: false }, + ]; +} + +export function browsers(now: number): BrowserSession[] { + return [ + { + id: 10, + created_at: now - 3 * DAY, + last_seen_at: now, + expires_at: now + 27 * DAY, + last_ip: "100.64.0.9", + user_agent: "Mozilla/5.0 (iPhone; CPU iPhone OS 18_2 like Mac OS X) AppleWebKit/605.1.15 Version/18.2 Mobile/15E148 Safari/604.1", + current: true, + }, + { + id: 11, + created_at: now - 9 * DAY, + last_seen_at: now - 6 * HOUR, + expires_at: now + 21 * DAY, + last_ip: "100.64.0.2", + user_agent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 Chrome/131.0 Safari/537.36", + current: false, + }, + ]; +} diff --git a/web/src/api/mock/index.ts b/web/src/api/mock/index.ts new file mode 100644 index 0000000..0f2e7ae --- /dev/null +++ b/web/src/api/mock/index.ts @@ -0,0 +1,648 @@ +// An in-browser fake of redshell-server, for developing and screenshotting every screen +// without one. It speaks the same REST and WebSocket protocol as the real server, so the +// whole client layer (HTTP, framing, reconnects) runs for real against it. +// +// Scenarios (`?mock=`): default, empty, loading, error, signed-out, rate-limited, +// unreachable, setup, setup-expired, reconnecting, diff, other, expiring, answer-fails, +// remote-answer, arrival, no-passkeys, passkey-only. + +import type { AuthenticationResponseJSON, RegistrationResponseJSON } from "@simplewebauthn/browser"; +import type { Transport } from "../client"; +import { MockSocket, type SocketHost } from "./socket"; +import type { + Approval, + ApprovalAnswer, + ApprovalDecision, + ApiError, + ClientMessage, + Modes, + ServerMessage, + SessionInfo, + SshHost, + User, +} from "../types"; +import * as data from "./data"; +import { asked, claudeScreen, dim, render, result, said, type Screen, shellScreen, tool } from "./screens"; + +const LATENCY_MS = 140; +const delay = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms)); + +const USER: User = { id: 1, username: "andy", created_at: Date.parse("2026-03-03T10:00:00Z") }; + +const MODES: Modes = { + alt_screen: false, + app_cursor: false, + app_keypad: false, + bracketed_paste: true, + mouse_tracking: null, + mouse_encoding: "normal", + focus_reporting: false, + cursor_visible: true, + cursor_shape: "block", + cursor_blinking: false, + title: null, +}; + +const WORK = [ + "Read src/lib/feed.ts", + "Edit src/routes/+page.svelte", + "Bash npm run check", + "Read src/lib/components/ReleaseList.svelte", + "Edit src/lib/components/ReleaseList.svelte", + "Bash npm run test -- --run", +]; + +type Reply = { status: number; body?: unknown } | "hang"; + +const ok = (body?: unknown): Reply => ({ status: body === undefined ? 204 : 200, body }); +const fail = (status: number, code: ApiError["code"], message: string, extra: Partial = {}): Reply => ({ + status, + body: { code, message, ...extra } satisfies ApiError, +}); + +function field(body: unknown, key: string): unknown { + return typeof body === "object" && body !== null && key in body ? (body as Record)[key] : undefined; +} +const text = (body: unknown, key: string) => { + const value = field(body, key); + return typeof value === "string" ? value : ""; +}; + +class MockBackend implements SocketHost { + private readonly scenario: string; + private signedIn: boolean; + private passkeyOnly: boolean; + private readonly sessions: Map; + private readonly screens: Map; + private approvals: Approval[]; + private passkeys; + private devices; + private browsers; + private hosts: SshHost[] = [...data.hosts]; + private readonly sockets = new Set(); + private nextChannel = 1; + private nextId = 1; + private socketsOpened = 0; + /** `loading` and `error` show the REST states, so the socket must not deliver the list. */ + private refuseSockets: boolean; + private workStep = 0; + + constructor(scenario: string) { + const now = Date.now(); + const seed = data.seed(scenario, now); + this.scenario = scenario; + this.signedIn = !["signed-out", "rate-limited", "unreachable", "setup", "setup-expired"].includes(scenario); + this.passkeyOnly = scenario === "passkey-only"; + this.refuseSockets = scenario === "loading" || scenario === "error"; + this.sessions = new Map(seed.sessions.map((s) => [s.id, s])); + this.screens = seed.screens; + this.approvals = seed.approvals; + this.passkeys = data.passkeys(now, scenario); + this.devices = data.devices(now); + this.browsers = data.browsers(now); + setInterval(() => { + this.work(); + }, 2600); + } + + connect(): MockSocket { + this.socketsOpened += 1; + const socket = new MockSocket(this, this.refuseSockets || !this.signedIn); + this.sockets.add(socket); + return socket; + } + + disconnect(socket: MockSocket): void { + this.sockets.delete(socket); + } + + async fetch(input: string, init: RequestInit): Promise { + if (this.scenario === "unreachable") { + await delay(400); + throw new TypeError("Failed to fetch"); + } + await delay(LATENCY_MS); + const url = new URL(input, location.origin); + const body: unknown = typeof init.body === "string" ? JSON.parse(init.body) : null; + const reply = this.route(init.method ?? "GET", url.pathname, url.searchParams, body); + if (reply === "hang") return new Promise(() => undefined); + const payload = reply.body === undefined ? null : JSON.stringify(reply.body); + return new Response(payload, { status: reply.status, headers: { "Content-Type": "application/json" } }); + } + + // REST + + private route(method: string, path: string, query: URLSearchParams, body: unknown): Reply { + const key = `${method} ${path}`; + const open = this.publicRoute(key, body); + if (open) return open; + if (!this.signedIn) return fail(401, "unauthorized", "Sign in first."); + return this.accountRoute(key, path, method, body) ?? this.sessionRoute(key, path, method, query, body) ?? fail(404, "not_found", `No route for ${key}`); + } + + private publicRoute(key: string, body: unknown): Reply | null { + switch (key) { + case "GET /api/auth/info": + return ok({ + version: "0.0.3", + protocol_version: 1, + setup_required: this.scenario === "setup", + min_password_length: 10, + }); + case "GET /api/auth/me": + return this.signedIn ? ok(USER) : fail(401, "unauthorized", "Sign in first."); + case "POST /api/auth/sign-in": + if (this.scenario === "rate-limited") { + return fail(429, "rate_limited", "Too many attempts.", { retry_after_secs: 42 }); + } + if (text(body, "username") !== USER.username || text(body, "password").length < 10 || this.passkeyOnly) { + return fail(401, "invalid_credentials", "Wrong username or password."); + } + return this.signIn(); + case "POST /api/setup": + if (text(body, "code") === "expired") return fail(403, "forbidden", "This setup link has expired."); + return this.signIn(); + case "POST /api/auth/passkey/begin": + return ok({ + ceremony: "mock-sign-in", + options: { challenge: "bW9jay1jaGFsbGVuZ2U", rpId: location.hostname, allowCredentials: [], timeout: 60_000 }, + }); + case "POST /api/auth/passkey/finish": + return this.signIn(); + default: + return null; + } + } + + private signIn(): Reply { + this.signedIn = true; + return ok({ user: USER, device_token: null }); + } + + private accountRoute(key: string, path: string, method: string, body: unknown): Reply | null { + switch (key) { + case "POST /api/auth/sign-out": + this.signedIn = false; + for (const socket of this.sockets) socket.close(4001); + return ok({}); + case "GET /api/account": + return ok({ passkey_only: this.passkeyOnly }); + case "POST /api/account/password": + return text(body, "current_password") === "wrong-password" + ? fail(401, "invalid_credentials", "Wrong password.") + : ok({}); + case "PUT /api/account/passkey-only": { + const enabled = field(body, "enabled") === true; + if (enabled && this.passkeys.length === 0) return fail(409, "conflict", "Add a passkey first."); + this.passkeyOnly = enabled; + return ok({ passkey_only: enabled }); + } + case "GET /api/account/passkeys": + return ok(this.passkeys); + case "POST /api/account/passkeys/begin": + return ok({ + ceremony: "mock-register", + options: { + challenge: "bW9jay1yZWdpc3Rlcg", + rp: { name: "RedShell", id: location.hostname }, + user: { id: "dXNlci0x", name: USER.username, displayName: USER.username }, + pubKeyCredParams: [{ type: "public-key", alg: -7 }], + authenticatorSelection: { residentKey: "required", userVerification: "preferred" }, + }, + }); + case "POST /api/account/passkeys/finish": { + const passkey = { id: Date.now(), name: text(body, "name") || "Passkey", created_at: Date.now(), last_used_at: null }; + this.passkeys = [...this.passkeys, passkey]; + return ok(passkey); + } + case "GET /api/account/devices": + return ok(this.devices); + case "GET /api/account/sessions": + return ok(this.browsers); + default: + break; + } + + const passkey = /^\/api\/account\/passkeys\/(\d+)$/.exec(path); + if (passkey) { + const id = Number(passkey[1]); + if (method === "DELETE") { + if (this.passkeyOnly && this.passkeys.length === 1) { + return fail(409, "conflict", "Turn off passkey-only sign-in before removing your last passkey."); + } + this.passkeys = this.passkeys.filter((p) => p.id !== id); + return ok(); + } + this.passkeys = this.passkeys.map((p) => (p.id === id ? { ...p, name: text(body, "name") } : p)); + return ok(this.passkeys.find((p) => p.id === id)); + } + const device = /^\/api\/account\/(devices|sessions)\/(\d+)$/.exec(path); + if (device && method === "DELETE") { + const id = Number(device[2]); + if (device[1] === "devices") this.devices = this.devices.filter((d) => d.id !== id); + else this.browsers = this.browsers.filter((b) => b.id !== id); + return ok(); + } + const pairing = /^\/api\/pair\/([^/]+)(\/approve)?$/.exec(path); + if (pairing) { + const code = decodeURIComponent(pairing[1] ?? "").replace("-", "").toUpperCase(); + if (code !== "KX74MP") return fail(404, "not_found", "No such pairing request."); + return pairing[2] + ? ok() + : ok({ code: "KX7-4MP", device_name: "MacBook Pro", platform: "macOS", created_at: Date.now() - 2 * 60_000 }); + } + return null; + } + + private sessionRoute(key: string, path: string, method: string, query: URLSearchParams, body: unknown): Reply | null { + switch (key) { + case "GET /api/sessions": + if (this.scenario === "loading") return "hang"; + if (this.scenario === "error") return fail(500, "internal", "The session store is unavailable."); + return ok([...this.sessions.values()]); + case "POST /api/sessions": + return this.create(text(body, "profile"), text(body, "cwd")); + case "GET /api/approvals": + return ok(this.approvals); + case "GET /api/profiles": + return ok(data.profiles); + case "GET /api/fs/folders": { + const path = query.get("path") ?? ""; + if (!path.startsWith("/")) return fail(400, "bad_request", "The path must be absolute."); + const folders = data.folderTree[path]; + return folders ? ok({ path, folders, truncated: false }) : fail(404, "not_found", "No such folder."); + } + case "GET /api/push/key": + return ok({ vapid_public_key: "BEl62iUYgUivxIkv69yViEuiBIa-Ib9-SkvMeAtA3LFgDzkrxZJjSgSnfckjBJuBkr3qBUYIHBQFLXYp5Nksh8U" }); + case "GET /api/hosts": + return ok(this.hosts); + case "POST /api/hosts": + return this.saveHost(body, null); + case "POST /api/push/subscriptions": + case "PUT /api/push/subscriptions": + case "DELETE /api/push/subscriptions": + case "POST /api/push/test": + return ok(); + default: + break; + } + + const session = /^\/api\/sessions\/([^/]+)$/.exec(path); + if (session) { + const id = decodeURIComponent(session[1] ?? ""); + if (method === "DELETE") { + this.kill(id); + return ok(); + } + const name = field(body, "name"); + this.update(id, { name: typeof name === "string" && name ? name : null }); + return ok(this.sessions.get(id)); + } + const approval = /^\/api\/approvals\/([^/]+)$/.exec(path); + if (approval) { + if (this.scenario === "answer-fails") return fail(502, "internal", "Bad gateway"); + const decision = text(body, "decision"); + if (decision !== "allow" && decision !== "allow_always" && decision !== "deny" && decision !== "terminal") { + return fail(400, "bad_request", "Unknown decision."); + } + this.answer(decodeURIComponent(approval[1] ?? ""), { decision }, "browser"); + return ok({}); + } + const host = /^\/api\/hosts\/([^/]+)$/.exec(path); + if (host) { + const name = decodeURIComponent(host[1] ?? ""); + if (method === "DELETE") { + this.hosts = this.hosts.filter((h) => h.name !== name); + return ok(); + } + return this.saveHost(body, name); + } + return null; + } + + private saveHost(body: unknown, previous: string | null): Reply { + const port = Number(field(body, "port")); + const optional = (key: string) => text(body, key) || null; + const saved: SshHost = { + name: text(body, "name"), + host: text(body, "host"), + user: optional("user"), + port: Number.isInteger(port) && port > 0 ? port : null, + identity_file: optional("identity_file"), + jump_host: optional("jump_host"), + group: optional("group"), + origin: "redshell", + }; + if (!saved.name || !saved.host) return fail(400, "bad_request", "A host needs a name and an address."); + this.hosts = [...this.hosts.filter((h) => h.name !== previous && h.name !== saved.name), saved]; + return ok(saved); + } + + // Sessions + + private create(profileId: string, cwd: string): Reply { + const profile = data.profiles.find((p) => p.id === profileId); + if (!profile) return fail(400, "bad_request", "Unknown profile."); + if (!profile.available) { + return fail(400, "bad_request", `\`${profile.description}\` was not found on the server.`); + } + const id = `s${this.nextId++}`; + const now = Date.now(); + const folder = cwd || data.HOME; + const isAgent = profile.kind === "agent"; + const info: SessionInfo = { + id, + name: null, + title: profile.kind === "ssh" ? profile.name : (folder.split("/").pop() ?? folder), + kind: profile.kind, + profile: profile.id, + profile_name: profile.name, + command: null, + start_cwd: profile.kind === "ssh" ? null : folder, + agent: isAgent ? profile.id.replace("agent:", "") : null, + agent_state: isAgent ? "idle" : null, + last_message: null, + cwd: profile.kind === "ssh" ? null : folder, + cols: 47, + rows: 39, + created_at: now, + active_at: now, + last_line: null, + exit: null, + pending_approvals: 0, + }; + this.sessions.set(id, info); + const [user, address] = profile.kind === "ssh" ? profile.description.split("@") : ["andy", "pi"]; + this.screens.set(id, isAgent ? claudeScreen([]) : shellScreen(user ?? "andy", profile.kind === "ssh" ? profile.name : (address ?? "pi"), profile.kind === "ssh" ? "~" : folder.replace(data.HOME, "~"), [])); + this.broadcast({ type: "session_updated", session: info }); + return ok(info); + } + + private update(id: string, fields: Partial): void { + const current = this.sessions.get(id); + if (!current) return; + const next = { ...current, ...fields }; + this.sessions.set(id, next); + this.broadcast({ type: "session_updated", session: next }); + } + + private kill(id: string): void { + this.sessions.delete(id); + this.approvals = this.approvals.filter((a) => a.session !== id); + for (const socket of this.sockets) { + for (const [channel, session] of socket.channels) { + if (session === id) { + socket.channels.delete(channel); + socket.deliver({ type: "detached", channel }); + } + } + } + this.broadcast({ type: "session_removed", id }); + } + + private answer(id: string, answer: ApprovalAnswer, by: string | null): void { + const approval = this.approvals.find((a) => a.id === id); + if (!approval) return; + this.approvals = this.approvals.filter((a) => a.id !== id); + const outcomes = { allow: "allowed", allow_always: "allowed", deny: "denied", terminal: "terminal" } as const satisfies Record< + ApprovalDecision, + string + >; + this.broadcast({ type: "approval_resolved", id, session: approval.session, outcome: outcomes[answer.decision], answered_by: by }); + const remaining = this.approvals.filter((a) => a.session === approval.session).length; + const screen = this.screens.get(approval.session); + const allowed = answer.decision === "allow" || answer.decision === "allow_always"; + if (screen?.kind === "agent" && answer.decision !== "terminal") { + screen.transcript.splice(-1, 1, ...result(allowed ? "Done" : dim("Denied by user"))); + if (allowed) screen.transcript.push("", said("Running the tests again.")); + this.redraw(approval.session); + } + this.update(approval.session, { + pending_approvals: remaining, + agent_state: remaining > 0 ? "needs_approval" : "working", + active_at: Date.now(), + last_line: allowed ? "Running the tests again." : "Denied by user", + }); + } + + private request(approval: Approval): void { + this.approvals = [...this.approvals, approval]; + this.broadcast({ type: "approval_requested", approval }); + this.broadcast({ + type: "event", + event: { session: approval.session, kind: "approval_requested", title: null, body: approval.summary, at: Date.now() }, + }); + const session = this.sessions.get(approval.session); + if (session) { + this.update(session.id, { + agent_state: "needs_approval", + pending_approvals: session.pending_approvals + 1, + active_at: Date.now(), + }); + } + } + + /** Moves every working agent one step along, like an agent reading and editing files. */ + private work(): void { + for (const session of this.sessions.values()) { + const screen = this.screens.get(session.id); + if (session.agent_state !== "working" || screen?.kind !== "agent") continue; + const step = WORK[this.workStep % WORK.length] ?? ""; + const [verb = "", ...rest] = step.split(" "); + screen.transcript.push(tool(verb, rest.join(" "))); + if (screen.transcript.length > 60) screen.transcript.splice(3, 2); + this.redraw(session.id); + this.update(session.id, { last_line: step, active_at: Date.now() }); + } + this.workStep += 1; + } + + // WebSocket + + receive(socket: MockSocket, message: ClientMessage): void { + switch (message.type) { + case "subscribe": + this.subscribed(socket); + break; + case "attach": { + const session = this.sessions.get(message.session); + const screen = this.screens.get(message.session); + if (!session || !screen) { + socket.deliver({ type: "error", code: "not_found", message: "No such session." }); + return; + } + const channel = this.nextChannel++; + socket.channels.set(channel, session.id); + this.sessions.set(session.id, { ...session, cols: message.cols, rows: message.rows }); + socket.deliver({ + type: "attached", + channel, + session, + snapshot: { cols: message.cols, rows: message.rows, data: render(screen, message.cols, message.rows), modes: MODES }, + }); + if (this.scenario === "remote-answer" && session.id === "aurora") { + setTimeout(() => { + const first = this.approvals.find((a) => a.session === "aurora"); + if (first) this.answer(first.id, { decision: "allow" }, "MacBook Pro"); + }, 4000); + } + break; + } + case "detach": + socket.channels.delete(message.channel); + socket.deliver({ type: "detached", channel: message.channel }); + break; + case "resize": { + const id = socket.channels.get(message.channel); + if (id) { + const session = this.sessions.get(id); + if (session) this.sessions.set(id, { ...session, cols: message.cols, rows: message.rows }); + this.redraw(id); + } + break; + } + case "input": { + const id = socket.channels.get(message.channel); + if (id) this.type(id, message.data); + break; + } + case "rename": + this.update(message.session, { name: message.name }); + break; + case "approve": + this.answer(message.approval, { decision: message.decision }, "browser"); + break; + } + } + + private subscribed(socket: MockSocket): void { + socket.deliver({ type: "hello", protocol_version: 1, user: USER }); + socket.deliver({ type: "sessions", sessions: [...this.sessions.values()] }); + socket.deliver({ type: "approvals", approvals: this.approvals }); + if (this.scenario === "reconnecting" && this.socketsOpened === 1) { + setTimeout(() => { + this.refuseSockets = true; + socket.close(1006); + }, 1500); + } + if (this.scenario === "arrival" && this.socketsOpened === 1) { + setTimeout(() => { + this.request({ + id: "ap-check", + session: "aurora-web", + tool: "Bash", + input: { command: "npm run check" }, + summary: "npm run check", + description: "Type-check the Svelte project", + permission_suggestions: [{ type: "addRules", rules: [{ toolName: "Bash", ruleContent: "npm run check:*" }] }], + created_at: Date.now(), + expires_at: Date.now() + 600_000, + }); + }, 2500); + } + } + + /** Input from a client: a shell echoes and runs lines; an agent edits its input box. */ + private type(id: string, input: string): void { + const screen = this.screens.get(id); + if (!screen) return; + // Escape sequences (arrows, Shift+Tab) move nothing in the fake. + // eslint-disable-next-line no-control-regex -- stripping escape sequences is the point + const keys = input.replace(/\x1b\[[0-9;]*[A-Za-z~]|\x1b./g, ""); + if (screen.kind === "shell") { + this.typeShell(id, screen, keys); + return; + } + for (const key of keys) { + if (key === "\r") { + if (!screen.input) continue; + screen.transcript.push("", asked(screen.input)); + screen.input = ""; + this.update(id, { agent_state: "working", active_at: Date.now() }); + } else if (key === "\x7f") { + screen.input = screen.input.slice(0, -1); + } else if (key >= " ") { + screen.input += key; + } + } + this.redraw(id); + } + + private typeShell(id: string, screen: Extract, keys: string): void { + let echo = ""; + for (const key of keys) { + if (key === "\r") { + const command = screen.input.trim(); + const output = command === "" ? "" : command === "ls" ? "README.md package.json src tests\r\n" : `zsh: command not found: ${command.split(" ")[0] ?? ""}\r\n`; + echo += `\r\n${output}${screen.prompt}`; + screen.text += screen.input + `\r\n${output}${screen.prompt}`; + screen.input = ""; + if (command) this.update(id, { last_line: command, active_at: Date.now() }); + } else if (key === "\x7f") { + if (screen.input) { + screen.input = screen.input.slice(0, -1); + echo += "\b \b"; + } + } else if (key >= " ") { + screen.input += key; + echo += key; + } + } + this.output(id, echo); + } + + private redraw(id: string): void { + const screen = this.screens.get(id); + if (screen?.kind !== "agent") return; + for (const socket of this.sockets) { + for (const [channel, session] of socket.channels) { + if (session !== id) continue; + const info = this.sessions.get(id); + socket.deliverOutput(channel, render(screen, info?.cols ?? 47, info?.rows ?? 39)); + } + } + } + + private output(id: string, output: string): void { + if (!output) return; + for (const socket of this.sockets) { + for (const [channel, session] of socket.channels) if (session === id) socket.deliverOutput(channel, output); + } + } + + private broadcast(message: ServerMessage): void { + for (const socket of this.sockets) socket.deliver(message); + } +} + +const fakeCredential = { + id: "bW9jay1jcmVkZW50aWFs", + rawId: "bW9jay1jcmVkZW50aWFs", + type: "public-key", + clientExtensionResults: {}, +} as const; + +export function createMockTransport(scenario: string): Transport { + const backend = new MockBackend(scenario); + return { + fetch: (input, init) => backend.fetch(input, init), + createSocket: () => backend.connect(), + socketUrl: "mock://pi/api/ws", + host: "pi.tail9c2.ts.net", + webauthn: { + authenticate: async (): Promise => { + await delay(900); + return { + ...fakeCredential, + response: { clientDataJSON: "e30", authenticatorData: "AA", signature: "AA", userHandle: "dXNlci0x" }, + }; + }, + register: async (): Promise => { + await delay(900); + return { ...fakeCredential, response: { clientDataJSON: "e30", attestationObject: "AA", transports: ["internal"] } }; + }, + supportsAutofill: () => Promise.resolve(false), + cancel: () => undefined, + }, + }; +} diff --git a/web/src/api/mock/screens.ts b/web/src/api/mock/screens.ts new file mode 100644 index 0000000..e6539f7 --- /dev/null +++ b/web/src/api/mock/screens.ts @@ -0,0 +1,116 @@ +// Terminal screens of the mock backend, rendered as ANSI for the size a client attaches with. +// Agents redraw the whole screen with their input box at the bottom, like Claude Code; +// shells append, like a shell. + +const ESC = "\x1b["; +export const sgr = (codes: string, text: string) => `${ESC}${codes}m${text}${ESC}0m`; +export const dim = (text: string) => sgr("2", text); +export const bold = (text: string) => sgr("1", text); + +// eslint-disable-next-line no-control-regex -- matching escape sequences is the point +const ANSI = /\x1b\[[0-9;?]*[A-Za-z]/g; +const visibleLength = (line: string) => Array.from(line.replace(ANSI, "")).length; + +export interface AgentScreen { + kind: "agent"; + accent: string; + transcript: string[]; + input: string; + footer: string; +} + +export interface ShellScreen { + kind: "shell"; + /** Everything printed so far, including the prompt of the current line. */ + text: string; + prompt: string; + input: string; +} + +export type Screen = AgentScreen | ShellScreen; + +function rowsOf(line: string, cols: number): number { + return Math.max(1, Math.ceil(visibleLength(line) / cols)); +} + +function clip(text: string, width: number): string { + const chars = Array.from(text); + return chars.length <= width ? text : `${chars.slice(0, Math.max(0, width - 1)).join("")}…`; +} + +/** The whole screen: transcript, padding, then the input box and footer on the last four rows. */ +function renderAgent(screen: AgentScreen, cols: number, rows: number): string { + const inner = Math.max(4, cols - 2); + const field = clip(screen.input, inner - 3); + const box = [ + dim(`╭${"─".repeat(inner)}╮`), + `${dim("│")} ${sgr(screen.accent, ">")} ${field}${" ".repeat(Math.max(0, inner - 3 - visibleLength(field)))}${dim("│")}`, + dim(`╰${"─".repeat(inner)}╯`), + dim(clip(` ${screen.footer}`, cols)), + ]; + const used = screen.transcript.reduce((sum, line) => sum + rowsOf(line, cols), 0); + const padding = Math.max(0, rows - box.length - used); + const lines = [...screen.transcript, ...Array(padding).fill(""), ...box]; + const cursorRow = rows - 2; + const cursorCol = 5 + visibleLength(field); + return `${ESC}H${ESC}2J${lines.join("\r\n")}${ESC}${cursorRow};${cursorCol}H`; +} + +export function render(screen: Screen, cols: number, rows: number): string { + return screen.kind === "agent" ? renderAgent(screen, cols, rows) : screen.text + screen.input; +} + +const CLAUDE = "38;5;209"; +const CODEX = "38;5;250"; +const OPENCODE = "38;5;214"; + +export function claudeScreen(transcript: string[]): AgentScreen { + return { + kind: "agent", + accent: CLAUDE, + input: "", + footer: "⏵⏵ accept edits on (shift+tab to cycle)", + transcript: [ + `${sgr(CLAUDE, "✻")} Welcome to ${bold("Claude Code")}!`, + dim(" /help for help, /status for your setup"), + "", + ...transcript, + ], + }; +} + +export function codexScreen(transcript: string[]): AgentScreen { + return { + kind: "agent", + accent: CODEX, + input: "", + footer: "⏎ send ⌃J newline ⌃C quit", + transcript: [`${bold(">_ OpenAI Codex")} ${dim("(v0.63.0)")}`, dim(" model: gpt-5-codex high"), "", ...transcript], + }; +} + +export function opencodeScreen(transcript: string[]): AgentScreen { + return { + kind: "agent", + accent: OPENCODE, + input: "", + footer: "build claude-sonnet-4 ctrl+p commands", + transcript: [`${sgr(OPENCODE, "opencode")} ${dim("v1.0.12")}`, "", ...transcript], + }; +} + +export const tool = (name: string, arg: string) => `${sgr("38;5;114", "⏺")} ${bold(name)}(${arg})`; +export const said = (text: string) => `${sgr("37", "⏺")} ${text}`; +export const result = (first: string, ...rest: string[]) => [ + ` ${dim("⎿")} ${first}`, + ...rest.map((line) => ` ${line}`), +]; +export const asked = (text: string) => `${dim(">")} ${text}`; +export const pass = (file: string, tests: number) => `${sgr("30;42", " PASS ")} ${file} ${dim(`(${tests} tests)`)}`; +export const fail = (file: string) => `${sgr("30;41", " FAIL ")} ${file}`; + +export function shellScreen(user: string, host: string, cwd: string, history: [string, string[]][]): ShellScreen { + const prompt = `${sgr("1;32", `${user}@${host}`)}:${sgr("1;34", cwd)}$ `; + const text = history.map(([command, output]) => [prompt + command, ...output].join("\r\n")).join("\r\n"); + return { kind: "shell", prompt, input: "", text: (text ? `${text}\r\n` : "") + prompt }; +} diff --git a/web/src/api/mock/socket.ts b/web/src/api/mock/socket.ts new file mode 100644 index 0000000..8513a12 --- /dev/null +++ b/web/src/api/mock/socket.ts @@ -0,0 +1,57 @@ +import { frame } from "../framing"; +import type { SocketLike } from "../socket"; +import type { ClientMessage, ServerMessage } from "../types"; + +/** The mock server's end of a socket. */ +export interface SocketHost { + receive(socket: MockSocket, message: ClientMessage): void; + disconnect(socket: MockSocket): void; +} + +const encoder = new TextEncoder(); + +/** A WebSocket to the mock backend. Messages are delivered on later tasks, in order, like a real one. */ +export class MockSocket implements SocketLike { + binaryType: BinaryType = "blob"; + onopen: ((event: Event) => void) | null = null; + onclose: ((event: CloseEvent) => void) | null = null; + onmessage: ((event: MessageEvent) => void) | null = null; + onerror: ((event: Event) => void) | null = null; + /** channel → session id */ + readonly channels = new Map(); + private closed = false; + private readonly host: SocketHost; + + constructor(host: SocketHost, refuse: boolean) { + this.host = host; + setTimeout(() => { + if (refuse) this.close(1006); + else this.onopen?.(new Event("open")); + }, 80); + } + + send(payload: string | Uint8Array): void { + if (this.closed) return; + if (typeof payload === "string") this.host.receive(this, JSON.parse(payload) as ClientMessage); + } + + close(code = 1000): void { + if (this.closed) return; + this.closed = true; + this.host.disconnect(this); + setTimeout(() => this.onclose?.(new CloseEvent("close", { code })), 0); + } + + deliver(message: ServerMessage): void { + setTimeout(() => { + if (!this.closed) this.onmessage?.(new MessageEvent("message", { data: JSON.stringify(message) })); + }, 0); + } + + deliverOutput(channel: number, output: string): void { + const bytes = frame(channel, encoder.encode(output)); + setTimeout(() => { + if (!this.closed) this.onmessage?.(new MessageEvent("message", { data: bytes.buffer })); + }, 0); + } +} diff --git a/web/src/api/pending/client.ts b/web/src/api/pending/client.ts new file mode 100644 index 0000000..398fe38 --- /dev/null +++ b/web/src/api/pending/client.ts @@ -0,0 +1,66 @@ +// Calls of the next server phase, kept apart from what redshell-server serves today +// (../client.ts) so they can be wired, or adjusted, in one place when the server side lands. +// Until then the mock backend answers them. + +import type { Http } from "../http"; +import type { + AccountSettings, + NotificationEvents, + PairingRequest, + Passkey, + PasskeyRegistrationCeremony, + PasskeyRegistrationRequest, + PasskeySignInCeremony, + PasskeySignInRequest, + PushKey, + PushSubscriptionRequest, + SshHost, +} from "./types"; +import type { SignInResponse } from "../types"; + +const enc = encodeURIComponent; + +export function createPendingApi(http: Http) { + return { + passkeys: { + /** Sign-in with a discoverable passkey: begin, then finish with the browser's answer. */ + signInBegin: () => http.post("/api/auth/passkey/begin"), + signInFinish: (body: PasskeySignInRequest) => http.post("/api/auth/passkey/finish", body), + list: () => http.get("/api/account/passkeys"), + registerBegin: () => http.post("/api/account/passkeys/begin"), + registerFinish: (body: PasskeyRegistrationRequest) => http.post("/api/account/passkeys/finish", body), + rename: (id: number, name: string) => http.patch(`/api/account/passkeys/${id}`, { name }), + remove: (id: number) => http.delete(`/api/account/passkeys/${id}`), + }, + + accountSettings: { + get: () => http.get("/api/account"), + /** Refused (409) when turning it on without a passkey. */ + setPasskeyOnly: (enabled: boolean) => http.put("/api/account/passkey-only", { enabled }), + }, + + pairing: { + /** 404 when the code is unknown or expired. */ + get: (code: string) => http.get(`/api/pair/${enc(code)}`), + approve: (code: string) => http.post(`/api/pair/${enc(code)}/approve`), + }, + + push: { + key: () => http.get("/api/push/key"), + subscribe: (body: PushSubscriptionRequest) => http.post("/api/push/subscriptions", body), + unsubscribe: (endpoint: string) => http.delete("/api/push/subscriptions", { endpoint }), + setEvents: (endpoint: string, events: NotificationEvents) => + http.put("/api/push/subscriptions", { endpoint, events }), + test: (endpoint: string) => http.post("/api/push/test", { endpoint }), + }, + + hosts: { + list: () => http.get("/api/hosts"), + save: (host: SshHost, previousName: string | null) => + previousName === null + ? http.post("/api/hosts", host) + : http.put(`/api/hosts/${enc(previousName)}`, host), + remove: (name: string) => http.delete(`/api/hosts/${enc(name)}`), + }, + }; +} diff --git a/web/src/api/pending/types.ts b/web/src/api/pending/types.ts new file mode 100644 index 0000000..e0d9927 --- /dev/null +++ b/web/src/api/pending/types.ts @@ -0,0 +1,84 @@ +// Types of the API the PWA expects from the next server phase: passkeys, passkey-only sign-in, +// browser pairing, Web Push and SSH hosts. redshell-server does not serve them yet, so these +// screens run against the mock backend; ./client.ts lists the calls. Same conventions as the +// generated protocol: snake_case, Unix-millisecond times. + +import type { + AuthenticationResponseJSON, + PublicKeyCredentialCreationOptionsJSON, + PublicKeyCredentialRequestOptionsJSON, + RegistrationResponseJSON, +} from "@simplewebauthn/browser"; + +/** `GET /api/account`: account settings beyond `User`. */ +export interface AccountSettings { + passkey_only: boolean; +} + +export interface Passkey { + id: number; + name: string; + created_at: number; + last_used_at: number | null; +} + +/** A WebAuthn ceremony in flight: `options` go to the browser, `ceremony` comes back with its answer. */ +export interface Ceremony { + ceremony: string; + options: Options; +} + +export type PasskeySignInCeremony = Ceremony; +export type PasskeyRegistrationCeremony = Ceremony; + +export interface PasskeySignInRequest { + ceremony: string; + credential: AuthenticationResponseJSON; +} + +export interface PasskeyRegistrationRequest { + ceremony: string; + credential: RegistrationResponseJSON; + name: string; +} + +/** A desktop waiting for approval at `/pair`. */ +export interface PairingRequest { + code: string; + device_name: string; + /** "macOS", "Windows", "Linux". */ + platform: string; + created_at: number; +} + +export interface NotificationEvents { + approvals: boolean; + input: boolean; + finished: boolean; + failed: boolean; +} + +/** `GET /api/push/key`. */ +export interface PushKey { + /** VAPID public key, base64url. */ + vapid_public_key: string; +} + +export interface PushSubscriptionRequest { + endpoint: string; + keys: { p256dh: string; auth: string }; + events: NotificationEvents; +} + +export interface SshHost { + /** The `Host` alias; unique. */ + name: string; + host: string; + user: string | null; + port: number | null; + identity_file: string | null; + jump_host: string | null; + group: string | null; + /** Hosts read from `~/.ssh/config` on the server are read-only. */ + origin: "redshell" | "ssh_config"; +} diff --git a/web/src/api/queries.ts b/web/src/api/queries.ts new file mode 100644 index 0000000..3df636b --- /dev/null +++ b/web/src/api/queries.ts @@ -0,0 +1,106 @@ +import { createContext, use } from "react"; +import { useQuery } from "@tanstack/react-query"; +import type { Api } from "./client"; +import { ApiRequestError } from "./http"; + +export const ApiContext = createContext(null); + +export function useApi(): Api { + const api = use(ApiContext); + if (!api) throw new Error("useApi needs an ApiContext provider"); + return api; +} + +export const keys = { + info: ["info"], + me: ["me"], + accountSettings: ["account-settings"], + sessions: ["sessions"], + approvals: ["approvals"], + profiles: ["profiles"], + folders: (path: string) => ["folders", path], + hosts: ["hosts"], + passkeys: ["passkeys"], + devices: ["devices"], + browsers: ["browsers"], + pairing: (code: string) => ["pairing", code], +} as const; + +/** Server info: open to everyone, needed before sign-in. */ +export function useInfo() { + const api = useApi(); + return useQuery({ queryKey: keys.info, queryFn: api.info, staleTime: 5 * 60_000 }); +} + +/** The signed-in user, or `null` when signed out. */ +export function useMe() { + const api = useApi(); + return useQuery({ + queryKey: keys.me, + queryFn: async () => { + try { + return await api.auth.me(); + } catch (error) { + if (error instanceof ApiRequestError && error.status === 401) return null; + throw error; + } + }, + staleTime: Infinity, + }); +} + +/** The session list; the WebSocket keeps it current (src/state/live.ts), so it never goes stale. */ +export function useSessions() { + const api = useApi(); + return useQuery({ queryKey: keys.sessions, queryFn: api.sessions.list, staleTime: Infinity }); +} + +/** Approvals waiting for an answer, kept current by the WebSocket like the sessions. */ +export function useApprovals() { + const api = useApi(); + return useQuery({ queryKey: keys.approvals, queryFn: api.approvals.list, staleTime: Infinity }); +} + +/** Passkey-only sign-in (next server phase). */ +export function useAccountSettings() { + const api = useApi(); + return useQuery({ queryKey: keys.accountSettings, queryFn: api.accountSettings.get }); +} + +/** Passkeys (next server phase). */ +export function usePasskeys() { + const api = useApi(); + return useQuery({ queryKey: keys.passkeys, queryFn: api.passkeys.list }); +} + +export function useDevices() { + const api = useApi(); + return useQuery({ queryKey: keys.devices, queryFn: api.account.devices }); +} + +export function useBrowsers() { + const api = useApi(); + return useQuery({ queryKey: keys.browsers, queryFn: api.account.browsers }); +} + +export function useProfiles() { + const api = useApi(); + return useQuery({ queryKey: keys.profiles, queryFn: api.profiles, staleTime: 60_000 }); +} + +/** The subfolders of an absolute folder on the server. */ +export function useFolders(path: string) { + const api = useApi(); + return useQuery({ + queryKey: keys.folders(path), + queryFn: () => api.folders(path), + enabled: path.startsWith("/"), + staleTime: 30_000, + }); +} + +/** SSH hosts (next server phase). */ +export function useHosts() { + const api = useApi(); + return useQuery({ queryKey: keys.hosts, queryFn: api.hosts.list }); +} diff --git a/web/src/api/socket.test.ts b/web/src/api/socket.test.ts new file mode 100644 index 0000000..25d9046 --- /dev/null +++ b/web/src/api/socket.test.ts @@ -0,0 +1,249 @@ +import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; +import { frame, unframe } from "./framing"; +import { backoffDelay, CLOSE_UNAUTHORIZED, Connection, type SocketLike, type TerminalSink } from "./socket"; +import type { ClientMessage, ServerMessage, SessionInfo, Snapshot } from "./types"; + +/** A socket the test drives: it records what the client sends and plays the server. */ +class FakeSocket implements SocketLike { + binaryType: BinaryType = "blob"; + onopen: ((event: Event) => void) | null = null; + onclose: ((event: CloseEvent) => void) | null = null; + onmessage: ((event: MessageEvent) => void) | null = null; + onerror: ((event: Event) => void) | null = null; + readonly sent: (ClientMessage | Uint8Array)[] = []; + + send(data: string | Uint8Array): void { + this.sent.push(typeof data === "string" ? (JSON.parse(data) as ClientMessage) : data); + } + + close(): void { + this.drop(1000); + } + + open(): void { + this.onopen?.(new Event("open")); + } + + receive(message: ServerMessage): void { + this.onmessage?.(new MessageEvent("message", { data: JSON.stringify(message) })); + } + + receiveBytes(channel: number, text: string): void { + this.onmessage?.(new MessageEvent("message", { data: frame(channel, new TextEncoder().encode(text)).buffer })); + } + + drop(code: number): void { + this.onclose?.(new CloseEvent("close", { code })); + } + + messages(): ClientMessage[] { + return this.sent.filter((m): m is ClientMessage => !(m instanceof Uint8Array)); + } +} + +const SNAPSHOT: Snapshot = { + cols: 80, + rows: 24, + data: "$ ", + modes: { + alt_screen: false, + app_cursor: false, + app_keypad: false, + bracketed_paste: true, + mouse_tracking: null, + mouse_encoding: "normal", + focus_reporting: false, + cursor_visible: true, + cursor_shape: "block", + cursor_blinking: false, + title: null, + }, +}; + +const session = (id: string) => ({ id }) as SessionInfo; + +const hello: ServerMessage = { type: "hello", protocol_version: 1, user: { id: 1, username: "andy", created_at: 0 } }; + +function sink() { + return { + snapshot: vi.fn<(snapshot: Snapshot) => void>(), + output: vi.fn<(bytes: Uint8Array) => void>(), + resized: vi.fn<(cols: number, rows: number) => void>(), + detached: vi.fn<() => void>(), + } satisfies TerminalSink; +} + +describe("framing", () => { + it("puts a big-endian channel before the bytes, like the server", () => { + const framed = frame(0x0102, new TextEncoder().encode("hi")); + expect([...framed]).toEqual([1, 2, 104, 105]); + const decoded = unframe(framed.buffer); + expect(decoded?.channel).toBe(0x0102); + expect(new TextDecoder().decode(decoded?.bytes)).toBe("hi"); + }); + + it("rejects frames too short for a channel", () => { + expect(unframe(new Uint8Array([7]))).toBeNull(); + expect(unframe(new Uint8Array([0, 7]))?.bytes.length).toBe(0); + }); +}); + +describe("backoffDelay", () => { + it("doubles from 500ms up to 10s, with jitter in the upper half", () => { + expect(backoffDelay(0, () => 0)).toBe(250); + expect(backoffDelay(0, () => 1)).toBe(500); + expect(backoffDelay(3, () => 1)).toBe(4000); + expect(backoffDelay(10, () => 1)).toBe(10_000); + }); +}); + +describe("Connection", () => { + let sockets: FakeSocket[]; + let connection: Connection; + const latest = () => sockets[sockets.length - 1] ?? new FakeSocket(); + + beforeEach(() => { + vi.useFakeTimers(); + sockets = []; + connection = new Connection( + "ws://test/api/ws", + () => { + const socket = new FakeSocket(); + sockets.push(socket); + return socket; + }, + () => 1, + ); + }); + + afterEach(() => { + connection.stop(); + vi.useRealTimers(); + }); + + it("subscribes on open and is open once the server says hello", () => { + connection.start(); + expect(connection.status).toBe("connecting"); + latest().open(); + expect(latest().messages()).toEqual([{ type: "subscribe", sessions: true, events: true }]); + latest().receive(hello); + expect(connection.status).toBe("open"); + }); + + it("routes binary frames to the attached session and sends input on its channel", () => { + connection.start(); + latest().open(); + latest().receive(hello); + const terminal = sink(); + const attachment = connection.attach("s1", 47, 39, terminal); + expect(latest().messages()).toContainEqual({ type: "attach", session: "s1", cols: 47, rows: 39 }); + + latest().receive({ type: "attached", channel: 3, session: session("s1"), snapshot: { ...SNAPSHOT, cols: 47, rows: 39 } }); + expect(terminal.snapshot).toHaveBeenCalledOnce(); + latest().receiveBytes(3, "out"); + latest().receiveBytes(9, "someone else's"); + expect(terminal.output).toHaveBeenCalledOnce(); + + attachment.input("ls\r"); + expect(latest().messages()).toContainEqual({ type: "input", channel: 3, data: "ls\r" }); + }); + + it("asks for its own size when the session was another size at attach", () => { + connection.start(); + latest().open(); + latest().receive(hello); + connection.attach("s1", 47, 39, sink()); + latest().receive({ type: "attached", channel: 1, session: session("s1"), snapshot: SNAPSHOT }); + expect(latest().messages()).toContainEqual({ type: "resize", channel: 1, cols: 47, rows: 39 }); + }); + + it("reconnects with backoff, then resubscribes and re-attaches with a fresh snapshot", () => { + connection.start(); + latest().open(); + latest().receive(hello); + const terminal = sink(); + const attachment = connection.attach("s1", 47, 39, terminal); + latest().receive({ type: "attached", channel: 1, session: session("s1"), snapshot: SNAPSHOT }); + + latest().drop(1006); + expect(connection.status).toBe("reconnecting"); + attachment.input("lost"); + expect(sockets).toHaveLength(1); + + vi.advanceTimersByTime(500); + expect(sockets).toHaveLength(2); + latest().open(); + latest().receive(hello); + expect(connection.status).toBe("open"); + expect(latest().messages()).toEqual([ + { type: "subscribe", sessions: true, events: true }, + { type: "attach", session: "s1", cols: 47, rows: 39 }, + ]); + + latest().receive({ type: "attached", channel: 5, session: session("s1"), snapshot: { ...SNAPSHOT, cols: 47, rows: 39 } }); + expect(terminal.snapshot).toHaveBeenCalledTimes(2); + attachment.input("back"); + expect(latest().messages()).toContainEqual({ type: "input", channel: 5, data: "back" }); + }); + + it("backs off longer after each failed attempt and resets after a hello", () => { + connection.start(); + latest().drop(1006); + vi.advanceTimersByTime(500); + expect(sockets).toHaveLength(2); + latest().drop(1006); + vi.advanceTimersByTime(999); + expect(sockets).toHaveLength(2); + vi.advanceTimersByTime(1); + expect(sockets).toHaveLength(3); + latest().open(); + latest().receive(hello); + latest().drop(1006); + vi.advanceTimersByTime(500); + expect(sockets).toHaveLength(4); + }); + + it("retries at once when asked, instead of waiting out the backoff", () => { + connection.start(); + latest().drop(1006); + connection.retryNow(); + expect(sockets).toHaveLength(2); + }); + + it("stops retrying when the server closes for a revoked sign-in", () => { + connection.start(); + latest().open(); + latest().receive(hello); + latest().drop(CLOSE_UNAUTHORIZED); + expect(connection.status).toBe("unauthorized"); + vi.advanceTimersByTime(60_000); + expect(sockets).toHaveLength(1); + }); + + it("tells the terminal when its session is killed, and detaches when asked", () => { + connection.start(); + latest().open(); + latest().receive(hello); + const terminal = sink(); + const attachment = connection.attach("s1", 47, 39, terminal); + latest().receive({ type: "attached", channel: 2, session: session("s1"), snapshot: SNAPSHOT }); + latest().receive({ type: "detached", channel: 2 }); + expect(terminal.detached).toHaveBeenCalledOnce(); + + const other = connection.attach("s2", 47, 39, sink()); + latest().receive({ type: "attached", channel: 4, session: session("s2"), snapshot: SNAPSHOT }); + other.detach(); + expect(latest().messages()).toContainEqual({ type: "detach", channel: 4 }); + attachment.input("nothing"); + expect(latest().messages()).not.toContainEqual({ type: "input", channel: 2, data: "nothing" }); + }); + + it("detaches an attach that was cancelled while in flight", () => { + connection.start(); + latest().open(); + latest().receive(hello); + connection.attach("s1", 47, 39, sink()).detach(); + latest().receive({ type: "attached", channel: 7, session: session("s1"), snapshot: SNAPSHOT }); + expect(latest().messages()).toContainEqual({ type: "detach", channel: 7 }); + }); +}); diff --git a/web/src/api/socket.ts b/web/src/api/socket.ts new file mode 100644 index 0000000..9ad9915 --- /dev/null +++ b/web/src/api/socket.ts @@ -0,0 +1,259 @@ +import { frame, unframe } from "./framing"; +import type { ClientMessage, ServerMessage, Snapshot } from "./types"; + +/** The part of `WebSocket` the connection uses, so the mock backend can stand in for it. */ +export interface SocketLike { + binaryType: BinaryType; + send(data: string | Uint8Array): void; + close(code?: number): void; + onopen: ((event: Event) => void) | null; + onclose: ((event: CloseEvent) => void) | null; + onmessage: ((event: MessageEvent) => void) | null; + onerror: ((event: Event) => void) | null; +} + +export type SocketFactory = (url: string) => SocketLike; + +/** + * `connecting`: the first attempt. `open`: the server said hello. `reconnecting`: the socket + * dropped and a retry is scheduled or running. `unauthorized`: the server closed it with 4001, + * so retrying is pointless until the user signs in again. `closed`: stopped on purpose. + */ +export type ConnectionStatus = "connecting" | "open" | "reconnecting" | "unauthorized" | "closed"; + +/** The close code the server uses when the cookie or token was revoked. */ +export const CLOSE_UNAUTHORIZED = 4001; + +/** Where an attached session's terminal output goes. PTY bytes never pass through React. */ +export interface TerminalSink { + /** Reset the terminal to `cols` × `rows` and redraw it from the snapshot. */ + snapshot(snapshot: Snapshot): void; + output(bytes: Uint8Array): void; + /** The session took another size (another client typed). */ + resized(cols: number, rows: number): void; + /** The server closed the channel: the session was killed. */ + detached(): void; +} + +/** A session attached to this connection. It survives reconnects: the connection re-attaches it. */ +export interface Attachment { + input(data: string): void; + inputBytes(bytes: Uint8Array): void; + resize(cols: number, rows: number): void; + detach(): void; +} + +interface AttachmentState { + session: string; + cols: number; + rows: number; + channel: number | null; + sink: TerminalSink; +} + +const MAX_DELAY_MS = 10_000; +const BASE_DELAY_MS = 500; + +/** Exponential backoff with jitter: 250–500ms, 500–1000ms, … up to 5–10s. */ +export function backoffDelay(attempt: number, random: () => number = Math.random): number { + const ceiling = Math.min(MAX_DELAY_MS, BASE_DELAY_MS * 2 ** attempt); + return Math.round(ceiling / 2 + (random() * ceiling) / 2); +} + +/** + * The one WebSocket of the app (`/api/ws`). It subscribes to the session list and agent events, + * multiplexes attached sessions over binary channels, and reconnects with backoff. After every + * reconnect it subscribes again (the server answers with the full session and approval lists) + * and re-attaches every attached session (each answers with a fresh snapshot). + */ +export class Connection { + status: ConnectionStatus = "closed"; + + private socket: SocketLike | null = null; + private attempt = 0; + private retryTimer: ReturnType | undefined; + private readonly attachments = new Map(); + private readonly channels = new Map(); + private readonly messageListeners = new Set<(message: ServerMessage) => void>(); + private readonly statusListeners = new Set<(status: ConnectionStatus) => void>(); + private readonly url: string; + private readonly createSocket: SocketFactory; + private readonly random: () => number; + + constructor(url: string, createSocket: SocketFactory, random: () => number = Math.random) { + this.url = url; + this.createSocket = createSocket; + this.random = random; + } + + start(): void { + if (this.status !== "closed" && this.status !== "unauthorized") return; + this.attempt = 0; + this.open("connecting"); + } + + stop(): void { + clearTimeout(this.retryTimer); + const socket = this.socket; + this.socket = null; + this.channels.clear(); + socket?.close(1000); + this.setStatus("closed"); + } + + /** Retry at once instead of waiting out the backoff: the network came back, or the app did. */ + retryNow(): void { + if (this.status !== "reconnecting" || this.socket) return; + clearTimeout(this.retryTimer); + this.open("reconnecting"); + } + + onMessage(listener: (message: ServerMessage) => void): () => void { + this.messageListeners.add(listener); + return () => this.messageListeners.delete(listener); + } + + onStatus(listener: (status: ConnectionStatus) => void): () => void { + this.statusListeners.add(listener); + return () => this.statusListeners.delete(listener); + } + + send(message: ClientMessage): boolean { + if (this.status !== "open" || !this.socket) return false; + this.socket.send(JSON.stringify(message)); + return true; + } + + /** Streams `session` into `sink` at `cols` × `rows` until `detach()`. */ + attach(session: string, cols: number, rows: number, sink: TerminalSink): Attachment { + this.attachments.get(session)?.sink.detached(); + const state: AttachmentState = { session, cols, rows, channel: null, sink }; + this.attachments.set(session, state); + this.send({ type: "attach", session, cols, rows }); + + return { + input: (data) => { + if (state.channel !== null) this.send({ type: "input", channel: state.channel, data }); + }, + inputBytes: (bytes) => { + if (state.channel !== null && this.status === "open") this.socket?.send(frame(state.channel, bytes)); + }, + resize: (nextCols, nextRows) => { + if (nextCols === state.cols && nextRows === state.rows) return; + state.cols = nextCols; + state.rows = nextRows; + if (state.channel !== null) { + this.send({ type: "resize", channel: state.channel, cols: nextCols, rows: nextRows }); + } + }, + detach: () => { + if (this.attachments.get(session) !== state) return; + this.attachments.delete(session); + if (state.channel !== null) { + this.channels.delete(state.channel); + this.send({ type: "detach", channel: state.channel }); + state.channel = null; + } + }, + }; + } + + private open(status: "connecting" | "reconnecting"): void { + this.setStatus(status); + const socket = this.createSocket(this.url); + socket.binaryType = "arraybuffer"; + this.socket = socket; + socket.onopen = () => { + socket.send(JSON.stringify({ type: "subscribe", sessions: true, events: true } satisfies ClientMessage)); + }; + socket.onmessage = (event) => { + if (socket === this.socket) this.receive(event.data); + }; + socket.onclose = (event) => { + this.closed(socket, event.code); + }; + } + + private receive(data: unknown): void { + if (data instanceof ArrayBuffer) { + const decoded = unframe(data); + if (decoded) this.channels.get(decoded.channel)?.sink.output(decoded.bytes); + return; + } + if (typeof data !== "string") return; + // Messages come from our own server, generated from the same protocol crate. + const message = JSON.parse(data) as ServerMessage; + this.route(message); + for (const listener of this.messageListeners) listener(message); + } + + private route(message: ServerMessage): void { + switch (message.type) { + case "hello": + this.attempt = 0; + this.setStatus("open"); + for (const state of this.attachments.values()) { + state.channel = null; + this.send({ type: "attach", session: state.session, cols: state.cols, rows: state.rows }); + } + break; + case "attached": { + const state = this.attachments.get(message.session.id); + if (!state) { + // Detached while the attach was in flight. + this.send({ type: "detach", channel: message.channel }); + return; + } + state.channel = message.channel; + this.channels.set(message.channel, state); + state.sink.snapshot(message.snapshot); + // The client's size may have changed while the attach was in flight. + if (state.cols !== message.snapshot.cols || state.rows !== message.snapshot.rows) { + this.send({ type: "resize", channel: message.channel, cols: state.cols, rows: state.rows }); + } + break; + } + case "snapshot": + this.channels.get(message.channel)?.sink.snapshot(message.snapshot); + break; + case "resized": + this.channels.get(message.channel)?.sink.resized(message.cols, message.rows); + break; + case "detached": { + const state = this.channels.get(message.channel); + this.channels.delete(message.channel); + if (state && this.attachments.get(state.session) === state) { + state.channel = null; + this.attachments.delete(state.session); + state.sink.detached(); + } + break; + } + default: + break; + } + } + + private closed(socket: SocketLike, code: number): void { + if (socket !== this.socket) return; + this.socket = null; + this.channels.clear(); + for (const state of this.attachments.values()) state.channel = null; + if (code === CLOSE_UNAUTHORIZED) { + this.setStatus("unauthorized"); + return; + } + this.setStatus("reconnecting"); + const delay = backoffDelay(this.attempt, this.random); + this.attempt += 1; + this.retryTimer = setTimeout(() => { + this.open("reconnecting"); + }, delay); + } + + private setStatus(status: ConnectionStatus): void { + if (status === this.status) return; + this.status = status; + for (const listener of this.statusListeners) listener(status); + } +} diff --git a/web/src/api/types.ts b/web/src/api/types.ts new file mode 100644 index 0000000..369766d --- /dev/null +++ b/web/src/api/types.ts @@ -0,0 +1,7 @@ +// The wire types of redshell-server. Everything the server serves today is generated from +// crates/redshell-protocol into src/protocol/ (never edit those files); what the PWA needs from +// the next server phase (passkeys, pairing, push, SSH hosts) is in ./pending/types.ts. + +export type * from "../protocol"; +export type { JsonValue } from "../protocol/serde_json/JsonValue"; +export type * from "./pending/types"; From 15608a8be8cafe9ca9295d766f072d005af8c2e2 Mon Sep 17 00:00:00 2001 From: ForeverInLaw <44206490+ForeverInLaw@users.noreply.github.com> Date: Fri, 4 Dec 2026 13:35:41 +0000 Subject: [PATCH 023/128] web: add the screens of RedShell Remote Built from docs/design/remote-pwa-visual.md: - the inbox, grouped into Needs you, Working and Recent, live over the WebSocket, with FLIP reordering, a reconnecting and an offline strip, long-press menus and attention banners from other sessions; - the session view: xterm.js (WebGL, fit, web links, Unicode 11) in its own chunk, the composer and the key bar pinned to the visual viewport, a grid that the on-screen keyboard only clips (following the cursor), pinch to zoom, text selection, and Ended, Failed and gone states; - the approval sheet for commands, diffs and other tools, with the "1 of N" queue, Always allow from Claude's suggestions, the 500 ms guard, answers from other devices, timeouts and send failures; - sign-in (passkey first, autofill, rate limits), first-run setup, /pair, new session, SSH hosts and settings (passkeys, devices, notifications, password, passkey-only, appearance); - the 900 px layout with the session list as a sidebar. Session lists and approvals live in the TanStack Query cache, patched from the WebSocket; UI state is in small Zustand stores. PTY bytes go from the socket straight into xterm.js, never through React. --- web/src/app/AppLayout.tsx | 90 +++++ web/src/app/router.tsx | 48 +++ web/src/components/Button.tsx | 46 +++ web/src/components/Dialog.tsx | 74 ++++ web/src/components/Field.tsx | 69 ++++ web/src/components/List.tsx | 118 ++++++ web/src/components/Menu.tsx | 58 +++ web/src/components/Overlays.tsx | 112 ++++++ web/src/components/PasskeyIcon.tsx | 21 + web/src/components/Screen.tsx | 86 +++++ web/src/components/Segmented.tsx | 67 ++++ web/src/components/Sheet.tsx | 147 +++++++ web/src/components/Spinner.tsx | 14 + web/src/components/StateBadge.tsx | 91 +++++ web/src/components/Switch.tsx | 58 +++ web/src/components/styles.ts | 35 ++ web/src/features/auth/Pair.tsx | 95 +++++ web/src/features/auth/Setup.tsx | 211 ++++++++++ web/src/features/auth/SignIn.tsx | 169 +++++++++ web/src/features/auth/Unreachable.tsx | 18 + web/src/features/auth/passkey.ts | 43 +++ web/src/features/hosts/HostDetail.tsx | 187 +++++++++ web/src/features/hosts/Hosts.tsx | 89 +++++ web/src/features/inbox/Inbox.tsx | 88 +++++ web/src/features/inbox/SessionList.tsx | 143 +++++++ web/src/features/inbox/SessionRow.tsx | 120 ++++++ .../features/new-session/NewSessionSheet.tsx | 266 +++++++++++++ web/src/features/session/ApprovalPreview.tsx | 148 ++++++++ web/src/features/session/ApprovalSheet.tsx | 214 +++++++++++ web/src/features/session/Composer.tsx | 104 +++++ web/src/features/session/FontSizeDialog.tsx | 15 + web/src/features/session/KeyBar.tsx | 167 ++++++++ web/src/features/session/SessionView.tsx | 261 +++++++++++++ web/src/features/session/TerminalArea.tsx | 92 +++++ web/src/features/session/controller.ts | 359 ++++++++++++++++++ web/src/features/session/theme.ts | 78 ++++ web/src/features/session/viewport.ts | 33 ++ web/src/features/sessions/RenameDialog.tsx | 46 +++ web/src/features/sessions/SessionActions.tsx | 89 +++++ web/src/features/settings/Devices.tsx | 140 +++++++ web/src/features/settings/FontStepper.tsx | 22 ++ web/src/features/settings/Notifications.tsx | 104 +++++ web/src/features/settings/Passkeys.tsx | 114 ++++++ web/src/features/settings/Password.tsx | 83 ++++ web/src/features/settings/Settings.tsx | 168 ++++++++ web/src/lib/diff.ts | 73 ++++ web/src/lib/dom.ts | 9 + web/src/lib/hooks.ts | 71 ++++ web/src/lib/hosts.ts | 4 + web/src/lib/keys.ts | 38 ++ web/src/lib/links.ts | 11 + web/src/lib/nav.ts | 27 ++ web/src/lib/pairing.ts | 7 + web/src/lib/platform.ts | 73 ++++ web/src/lib/preview.ts | 101 +++++ web/src/lib/sessions.test.ts | 101 +++++ web/src/lib/sessions.ts | 171 +++++++++ web/src/lib/time.ts | 48 +++ web/src/main.tsx | 47 +++ web/src/pwa/push.ts | 106 ++++++ web/src/pwa/register.ts | 26 ++ web/src/state/connection.ts | 56 +++ web/src/state/keys.test.ts | 55 +++ web/src/state/keys.ts | 34 ++ web/src/state/live.ts | 82 ++++ web/src/state/prefs.ts | 89 +++++ web/src/state/ui.ts | 62 +++ web/src/sw.ts | 73 ++++ 68 files changed, 6164 insertions(+) create mode 100644 web/src/app/AppLayout.tsx create mode 100644 web/src/app/router.tsx create mode 100644 web/src/components/Button.tsx create mode 100644 web/src/components/Dialog.tsx create mode 100644 web/src/components/Field.tsx create mode 100644 web/src/components/List.tsx create mode 100644 web/src/components/Menu.tsx create mode 100644 web/src/components/Overlays.tsx create mode 100644 web/src/components/PasskeyIcon.tsx create mode 100644 web/src/components/Screen.tsx create mode 100644 web/src/components/Segmented.tsx create mode 100644 web/src/components/Sheet.tsx create mode 100644 web/src/components/Spinner.tsx create mode 100644 web/src/components/StateBadge.tsx create mode 100644 web/src/components/Switch.tsx create mode 100644 web/src/components/styles.ts create mode 100644 web/src/features/auth/Pair.tsx create mode 100644 web/src/features/auth/Setup.tsx create mode 100644 web/src/features/auth/SignIn.tsx create mode 100644 web/src/features/auth/Unreachable.tsx create mode 100644 web/src/features/auth/passkey.ts create mode 100644 web/src/features/hosts/HostDetail.tsx create mode 100644 web/src/features/hosts/Hosts.tsx create mode 100644 web/src/features/inbox/Inbox.tsx create mode 100644 web/src/features/inbox/SessionList.tsx create mode 100644 web/src/features/inbox/SessionRow.tsx create mode 100644 web/src/features/new-session/NewSessionSheet.tsx create mode 100644 web/src/features/session/ApprovalPreview.tsx create mode 100644 web/src/features/session/ApprovalSheet.tsx create mode 100644 web/src/features/session/Composer.tsx create mode 100644 web/src/features/session/FontSizeDialog.tsx create mode 100644 web/src/features/session/KeyBar.tsx create mode 100644 web/src/features/session/SessionView.tsx create mode 100644 web/src/features/session/TerminalArea.tsx create mode 100644 web/src/features/session/controller.ts create mode 100644 web/src/features/session/theme.ts create mode 100644 web/src/features/session/viewport.ts create mode 100644 web/src/features/sessions/RenameDialog.tsx create mode 100644 web/src/features/sessions/SessionActions.tsx create mode 100644 web/src/features/settings/Devices.tsx create mode 100644 web/src/features/settings/FontStepper.tsx create mode 100644 web/src/features/settings/Notifications.tsx create mode 100644 web/src/features/settings/Passkeys.tsx create mode 100644 web/src/features/settings/Password.tsx create mode 100644 web/src/features/settings/Settings.tsx create mode 100644 web/src/lib/diff.ts create mode 100644 web/src/lib/dom.ts create mode 100644 web/src/lib/hooks.ts create mode 100644 web/src/lib/hosts.ts create mode 100644 web/src/lib/keys.ts create mode 100644 web/src/lib/links.ts create mode 100644 web/src/lib/nav.ts create mode 100644 web/src/lib/pairing.ts create mode 100644 web/src/lib/platform.ts create mode 100644 web/src/lib/preview.ts create mode 100644 web/src/lib/sessions.test.ts create mode 100644 web/src/lib/sessions.ts create mode 100644 web/src/lib/time.ts create mode 100644 web/src/main.tsx create mode 100644 web/src/pwa/push.ts create mode 100644 web/src/pwa/register.ts create mode 100644 web/src/state/connection.ts create mode 100644 web/src/state/keys.test.ts create mode 100644 web/src/state/keys.ts create mode 100644 web/src/state/live.ts create mode 100644 web/src/state/prefs.ts create mode 100644 web/src/state/ui.ts create mode 100644 web/src/sw.ts diff --git a/web/src/app/AppLayout.tsx b/web/src/app/AppLayout.tsx new file mode 100644 index 0000000..d8c4ef0 --- /dev/null +++ b/web/src/app/AppLayout.tsx @@ -0,0 +1,90 @@ +import { useQueryClient } from "@tanstack/react-query"; +import { lazy, Suspense, useEffect, ViewTransition } from "react"; +import { matchPath, Navigate, Outlet, useLocation, useMatch } from "react-router"; +import { keys, useApi, useMe } from "../api/queries"; +import { BannerHost } from "../components/Overlays"; +import { Unreachable } from "../features/auth/Unreachable"; +import { Inbox, Sidebar } from "../features/inbox/Inbox"; +import { useWide } from "../lib/hooks"; +import { NAV_BACK, NAV_FORWARD } from "../lib/nav"; +import { bindConnection } from "../state/connection"; +import { bindLive } from "../state/live"; +import { useUi } from "../state/ui"; + +const NewSessionSheet = lazy(() => import("../features/new-session/NewSessionSheet")); + +const currentSession = () => matchPath("/s/:id", window.location.pathname)?.params.id ?? null; + +/** Starts the WebSocket for a signed-in user and wires it into the stores; the one long-lived effect. */ +function useLiveConnection() { + const api = useApi(); + const client = useQueryClient(); + useEffect(() => { + const offConnection = bindConnection(api.connection); + const offLive = bindLive(api, client, currentSession); + const offStatus = api.connection.onStatus((status) => { + if (status === "unauthorized") client.setQueryData(keys.me, null); + }); + api.connection.start(); + return () => { + offStatus(); + offLive(); + offConnection(); + api.connection.stop(); + }; + }, [api, client]); +} + +function SignedIn() { + useLiveConnection(); + const wide = useWide(); + const session = useMatch("/s/:id")?.params.id; + const newSessionOpen = useUi((state) => state.newSessionOpen); + return ( + <> + {wide ? ( +
+ +
+ +
+
+ ) : ( + // Phone navigation slides by the type useNav gives it; anything else changes in place. + + + + )} + {newSessionOpen && ( + + + + )} + + + ); +} + +/** Everything behind sign-in: redirects to /signin when signed out, keeping where the user was going. */ +export function AppLayout() { + const me = useMe(); + const location = useLocation(); + if (me.isPending) return null; + if (me.isError) return void me.refetch()} />; + if (me.data === null) { + const next = location.pathname === "/" ? "" : `?next=${encodeURIComponent(location.pathname)}`; + return ; + } + return ; +} + +/** `/`: the inbox on phones; in the wide layout the sidebar is the inbox, so the pane stays empty. */ +export function Home() { + const wide = useWide(); + if (!wide) return ; + return ( +
+

No session open

+
+ ); +} diff --git a/web/src/app/router.tsx b/web/src/app/router.tsx new file mode 100644 index 0000000..7d76754 --- /dev/null +++ b/web/src/app/router.tsx @@ -0,0 +1,48 @@ +import { createBrowserRouter, Navigate } from "react-router"; +import { SignIn } from "../features/auth/SignIn"; +import { AppLayout, Home } from "./AppLayout"; + +/** + * Routes. The inbox and sign-in are in the main chunk; everything else loads on first visit, + * the terminal (xterm.js) above all. + */ +export const router = createBrowserRouter([ + { path: "/signin", element: }, + { path: "/setup", lazy: async () => ({ Component: (await import("../features/auth/Setup")).Setup }) }, + { + element: , + children: [ + { index: true, element: }, + { path: "s/:id", lazy: async () => ({ Component: (await import("../features/session/SessionView")).SessionView }) }, + { path: "pair", lazy: async () => ({ Component: (await import("../features/auth/Pair")).Pair }) }, + { + path: "settings", + lazy: async () => ({ Component: (await import("../features/settings/Settings")).Settings }), + }, + { + path: "settings/passkeys", + lazy: async () => ({ Component: (await import("../features/settings/Passkeys")).Passkeys }), + }, + { + path: "settings/password", + lazy: async () => ({ Component: (await import("../features/settings/Password")).Password }), + }, + { + path: "settings/devices", + lazy: async () => ({ Component: (await import("../features/settings/Devices")).Devices }), + }, + { + path: "settings/devices/:kind/:id", + lazy: async () => ({ Component: (await import("../features/settings/Devices")).DeviceDetail }), + }, + { + path: "settings/notifications", + lazy: async () => ({ Component: (await import("../features/settings/Notifications")).Notifications }), + }, + { path: "hosts", lazy: async () => ({ Component: (await import("../features/hosts/Hosts")).Hosts }) }, + { path: "hosts/new", lazy: async () => ({ Component: (await import("../features/hosts/HostDetail")).NewHost }) }, + { path: "hosts/:name", lazy: async () => ({ Component: (await import("../features/hosts/HostDetail")).HostDetail }) }, + ], + }, + { path: "*", element: }, +]); diff --git a/web/src/components/Button.tsx b/web/src/components/Button.tsx new file mode 100644 index 0000000..8c77724 --- /dev/null +++ b/web/src/components/Button.tsx @@ -0,0 +1,46 @@ +import type { ComponentProps, ReactNode } from "react"; +import { cx } from "../lib/platform"; +import { buttonClass, type ButtonSize, type ButtonVariant } from "./styles"; +import { Spinner } from "./Spinner"; + +type ButtonProps = ComponentProps<"button"> & { + variant?: ButtonVariant; + size?: ButtonSize; + /** A request is running: a spinner replaces the label (or the icon, with `keepLabel`), keeping the width. */ + pending?: boolean; + keepLabel?: boolean; + icon?: ReactNode; +}; + +/** Buttons of §3.1. One primary per screen or sheet. */ +export function Button({ + variant = "secondary", + size = "default", + pending = false, + keepLabel = false, + icon, + className, + children, + type = "button", + disabled, + ...props +}: ButtonProps) { + const hideLabel = pending && !keepLabel; + return ( + + ); +} diff --git a/web/src/components/Dialog.tsx b/web/src/components/Dialog.tsx new file mode 100644 index 0000000..679279f --- /dev/null +++ b/web/src/components/Dialog.tsx @@ -0,0 +1,74 @@ +import { type ReactNode, useId } from "react"; +import { cx } from "../lib/platform"; +import { Button } from "./Button"; +import type { ButtonVariant } from "./styles"; + +const showModal = (dialog: HTMLDialogElement | null) => { + if (dialog && !dialog.open) dialog.showModal(); +}; + +interface DialogProps { + title: string; + children?: ReactNode; + onClose: () => void; + className?: string; +} + +/** A centred dialog on the native ``: focus trap, Esc and the top layer come free. */ +export function Dialog({ title, children, onClose, className }: DialogProps) { + const titleId = useId(); + return ( + { + event.preventDefault(); + onClose(); + }} + onClick={(event) => { + if (event.target === event.currentTarget) onClose(); + }} + className={cx( + "m-auto w-[calc(100%-2rem)] max-w-[22rem] animate-[dialog-in_var(--dur-base)_var(--ease-out)_both] rounded-xl border border-border bg-popover p-0 text-foreground shadow-menu", + "backdrop:bg-(--scrim-dialog)", + className, + )} + > +
+

+ {title} +

+ {children} +
+
+ ); +} + +interface ConfirmProps { + title: string; + body?: ReactNode; + confirmLabel: string; + confirmVariant?: Extract; + pending?: boolean; + error?: string | null; + onConfirm: () => void; + onCancel: () => void; +} + +/** "Sign out of pi?" with Cancel and the action. */ +export function Confirm({ title, body, confirmLabel, confirmVariant = "destructive", pending, error, onConfirm, onCancel }: ConfirmProps) { + return ( + + {body &&

{body}

} + {error &&

{error}

} +
+ + +
+
+ ); +} diff --git a/web/src/components/Field.tsx b/web/src/components/Field.tsx new file mode 100644 index 0000000..9dbd2c1 --- /dev/null +++ b/web/src/components/Field.tsx @@ -0,0 +1,69 @@ +import { CircleAlert, Eye, EyeOff } from "lucide-react"; +import { type ComponentProps, type ReactNode, useId, useState } from "react"; +import { cx } from "../lib/platform"; +import { inputClass } from "./styles"; + +type FieldProps = ComponentProps<"input"> & { + label: string; + helper?: ReactNode; + error?: ReactNode; + /** Hostnames and paths: mono, still 16px so iOS never zooms. */ + mono?: boolean; + trailing?: ReactNode; +}; + +/** A labelled input (§3.2): label above, helper or error below, linked by aria-describedby. */ +export function Field({ label, helper, error, mono = false, trailing, className, id, ...props }: FieldProps) { + const fallbackId = useId(); + const inputId = id ?? fallbackId; + const noteId = `${inputId}-note`; + const note = error ?? helper; + return ( +
+ +
+ + {trailing &&
{trailing}
} +
+ {note && ( +

+ {error && } + {note} +

+ )} +
+ ); +} + +/** A password field with the 44px eye toggle inside it. */ +export function PasswordField(props: Omit) { + const [visible, setVisible] = useState(false); + return ( + setVisible((v) => !v)} + > + {visible ? : } + + } + /> + ); +} diff --git a/web/src/components/List.tsx b/web/src/components/List.tsx new file mode 100644 index 0000000..31f39b9 --- /dev/null +++ b/web/src/components/List.tsx @@ -0,0 +1,118 @@ +import { ChevronRight } from "lucide-react"; +import type { ComponentProps, ReactNode } from "react"; +import { Link } from "react-router"; +import { cx } from "../lib/platform"; + +/** A section header: sentence case, footnote 500, muted, with an optional count. */ +export function SectionHeader({ children, count, id }: { children: ReactNode; count?: number; id?: string }) { + return ( +

+ {children} + {count !== undefined && {count}} +

+ ); +} + +/** Explanations live under groups, not in rows. */ +export function Footnote({ children, className }: { children: ReactNode; className?: string }) { + return

{children}

; +} + +/** A list group (§3.4): card, hairline, 14px radius, inset 16px; rows separated by inset hairlines. */ +export function Group({ children, className, ...props }: ComponentProps<"div">) { + return ( +
*+*]:relative [&>*+*]:before:absolute [&>*+*]:before:top-0 [&>*+*]:before:right-0 [&>*+*]:before:left-(--row-inset,1rem) [&>*+*]:before:h-px [&>*+*]:before:bg-border", + className, + )} + {...props} + > + {children} +
+ ); +} + +/** A labelled block of the settings screens: header, group, footnote; groups are 24px apart. */ +export function Section({ title, footnote, children, className }: { title?: ReactNode; footnote?: ReactNode; children: ReactNode; className?: string }) { + return ( +
+ {title && {title}} + {children} + {footnote && {footnote}} +
+ ); +} + +interface RowContent { + icon?: ReactNode; + label: ReactNode; + subtitle?: ReactNode; + /** Mono subtitle for hosts and paths. */ + monoSubtitle?: boolean; + value?: ReactNode; + /** Detail rows end in a chevron; action rows don't. */ + chevron?: boolean; + trailing?: ReactNode; + tone?: "default" | "destructive"; +} + +const rowClass = (interactive: boolean, twoLine: boolean) => + cx( + "flex w-full items-center gap-3 px-4 text-left", + twoLine ? "min-h-15 py-2.5" : "min-h-12 py-2", + interactive && "transition-colors duration-(--dur-press) pressed:bg-accent hover:bg-accent", + ); + +function RowBody({ icon, label, subtitle, monoSubtitle, value, chevron, trailing, tone = "default" }: RowContent) { + return ( + <> + {icon && {icon}} + + {label} + {subtitle && ( + {subtitle} + )} + + {value !== undefined && {value}} + {trailing} + {chevron && } + + ); +} + +/** A row that navigates. */ +export function LinkRow({ to, ...content }: RowContent & { to: string }) { + return ( +
+ + + +
+ ); +} + +/** A row that does something on tap. */ +export function ButtonRow({ onClick, disabled, ...content }: RowContent & { onClick: () => void; disabled?: boolean }) { + return ( +
+ +
+ ); +} + +/** A row that only shows a value, or holds a control (a whole-row `