From 0f102f857358829ff3bb27dd8b2fa069030df9ff Mon Sep 17 00:00:00 2001 From: VirtualMachinist Date: Sat, 14 Nov 2026 10:15:42 -0500 Subject: [PATCH 01/16] scripts/scratch: seed a four-pane scratch herdr session seed.sh starts a named session with one workspace, four panes in a 2x2 split, a made-up marker line per pane, and four reported agents with one blocked. Each pane re-reports its lifecycle state so the reported agents stay registered while the pane is open. teardown.sh stops and deletes the session. Only fixture content; no live session and no notes. --- scripts/scratch/README.md | 32 +++++++++++++++ scripts/scratch/seed.sh | 77 +++++++++++++++++++++++++++++++++++++ scripts/scratch/teardown.sh | 14 +++++++ 3 files changed, 123 insertions(+) create mode 100644 scripts/scratch/README.md create mode 100755 scripts/scratch/seed.sh create mode 100755 scripts/scratch/teardown.sh diff --git a/scripts/scratch/README.md b/scripts/scratch/README.md new file mode 100644 index 0000000..a0aa0a7 --- /dev/null +++ b/scripts/scratch/README.md @@ -0,0 +1,32 @@ +# Scratch herdr session + +`seed.sh` starts a named herdr session that the bridge can read, with made-up +content only. It exists so the app-shell checks have four agents, one of them +blocked, without touching a live session or real notes. + +```bash +scripts/scratch/seed.sh # session pendant-shell-g1 +scripts/scratch/teardown.sh # stop and delete it +``` + +The session lives at `~/.config/herdr/sessions//herdr.sock`. `seed.sh` +prints the socket path and the agent summary, and refuses to seed a session +that is already running. + +What it creates: + +- one workspace labelled `pendant-scratch`, four panes in a 2x2 split; +- a marker line `PENDANT-SCRATCH-MARKER-` in each pane; +- four reported agents `scratch-1` … `scratch-4`, with `scratch-2` blocked. + +Each pane runs a reporter loop that re-reports its lifecycle state every +couple of seconds. The state is transient by design: without the loop herdr +drops a reported agent once the pane settles back at a plain shell prompt. + +Run the bridge against the session with: + +```bash +PENDANT_HERDR_SOCK=~/.config/herdr/sessions/pendant-shell-g1/herdr.sock \ +PENDANT_SERVE_ORIGIN=https://:8443 \ + cargo run -p pendant +``` diff --git a/scripts/scratch/seed.sh b/scripts/scratch/seed.sh new file mode 100755 index 0000000..5278f08 --- /dev/null +++ b/scripts/scratch/seed.sh @@ -0,0 +1,77 @@ +#!/usr/bin/env bash +# Seed a named scratch herdr session for the app-shell checks. +# +# The session is separate from any live session and holds only made-up content: +# one workspace, four panes, a marker line per pane, and four reported agents +# with one blocked. Each pane runs a small reporter loop that keeps its +# lifecycle state registered while the pane stays open. +# +# Usage: scripts/scratch/seed.sh [session-name] +# Tear down with scripts/scratch/teardown.sh [session-name]. +set -euo pipefail + +SESSION="${1:-${PENDANT_SCRATCH_SESSION:-pendant-shell-g1}}" +LABEL="${PENDANT_SCRATCH_LABEL:-pendant-scratch}" +HERDR="${HERDR_BIN:-$(command -v herdr)}" +BLOCKED_INDEX=2 +REFRESH_SECONDS=2 +SOURCE="custom:pendant-scratch" +SOCK="$HOME/.config/herdr/sessions/$SESSION/herdr.sock" + +h() { "$HERDR" --session "$SESSION" "$@"; } + +if h api snapshot >/dev/null 2>&1; then + echo "session $SESSION is already running; teardown.sh first" >&2 + exit 1 +fi + +nohup "$HERDR" --session "$SESSION" server >/dev/null 2>&1 & +for _ in $(seq 1 100); do + h api snapshot >/dev/null 2>&1 && break + sleep 0.1 +done +if ! h api snapshot >/dev/null 2>&1; then + echo "session $SESSION did not start" >&2 + exit 1 +fi + +workspaces="$(h workspace list | jq '.result.workspaces | length')" +if [ "$workspaces" != "0" ]; then + echo "session $SESSION already has workspaces; teardown.sh first" >&2 + exit 1 +fi + +root="$(h workspace create --label "$LABEL" --cwd /tmp --no-focus | + jq -r '.result.root_pane.pane_id')" +split() { h pane split "$1" --direction "$2" --no-focus | jq -r '.result.pane.pane_id'; } +second="$(split "$root" right)" +third="$(split "$root" down)" +fourth="$(split "$second" down)" +panes=("$root" "$second" "$third" "$fourth") + +for index in "${!panes[@]}"; do + pane="${panes[$index]}" + number=$((index + 1)) + state=idle + [ "$number" -eq "$BLOCKED_INDEX" ] && state=blocked + h pane run "$pane" "echo PENDANT-SCRATCH-MARKER-$number" >/dev/null + h pane run "$pane" \ + "while :; do '$HERDR' --session '$SESSION' pane report-agent '$pane' --source '$SOURCE' --agent 'scratch-$number' --state '$state' >/dev/null 2>&1; sleep $REFRESH_SECONDS; done" \ + >/dev/null +done + +for _ in $(seq 1 100); do + summary="$(h api snapshot | jq -c '{agents: [.result.snapshot.agents[] | + {agent, pane_id, agent_status}]}')" + if printf '%s' "$summary" | + jq -e '.agents | length == 4 and (map(select(.agent_status == "blocked")) | length) == 1' \ + >/dev/null; then + printf 'session=%s\nsocket=%s\n%s\n' "$SESSION" "$SOCK" "$summary" + exit 0 + fi + sleep 0.1 +done + +echo "session $SESSION started but the agent set did not settle" >&2 +h api snapshot | jq -c '{agents: [.result.snapshot.agents[] | {agent, pane_id, agent_status}]}' >&2 +exit 1 diff --git a/scripts/scratch/teardown.sh b/scripts/scratch/teardown.sh new file mode 100755 index 0000000..773a202 --- /dev/null +++ b/scripts/scratch/teardown.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash +# Stop and delete the scratch herdr session created by seed.sh. +# +# Usage: scripts/scratch/teardown.sh [session-name] +set -euo pipefail + +SESSION="${1:-${PENDANT_SCRATCH_SESSION:-pendant-shell-g1}}" +HERDR="${HERDR_BIN:-$(command -v herdr)}" + +if "$HERDR" --session "$SESSION" api snapshot >/dev/null 2>&1; then + "$HERDR" --session "$SESSION" server stop >/dev/null 2>&1 || true +fi +"$HERDR" session delete "$SESSION" >/dev/null 2>&1 || true +echo "session $SESSION stopped and deleted" From 2f19dbbb5eec87243a1eca6517b5ea63e3ddb8ad Mon Sep 17 00:00:00 2001 From: VirtualMachinist Date: Sat, 14 Nov 2026 10:17:36 -0500 Subject: [PATCH 02/16] herdr: read the snapshot inside the live reply envelope herdr 0.9.5 answers `session.snapshot` with `{type, snapshot}`, so the agents and workspaces sat one level below where the parser looked and every snapshot came back empty. Descend when the reply carries a snapshot object; keep the flat fixture shape working. Adds a test for the live envelope. --- crates/pendant-herdr/src/snapshot.rs | 31 +++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/crates/pendant-herdr/src/snapshot.rs b/crates/pendant-herdr/src/snapshot.rs index 7843f52..af3c1d6 100644 --- a/crates/pendant-herdr/src/snapshot.rs +++ b/crates/pendant-herdr/src/snapshot.rs @@ -83,7 +83,12 @@ impl Snapshot { } fn unwrap_snapshot_root(raw: &Value) -> &Value { - raw.get("result").unwrap_or(raw) + let root = raw.get("result").unwrap_or(raw); + // herdr 0.9.x answers `session.snapshot` with `{type, snapshot}`; a fixture + // or an older reply puts the fields at the root. + root.get("snapshot") + .filter(|value| value.is_object()) + .unwrap_or(root) } fn extract_agents(root: &Value) -> Vec { @@ -192,4 +197,28 @@ mod tests { assert_eq!(inbox.len(), 1); assert_eq!(inbox[0].kind, "blocked"); } + + #[test] + fn snapshot_reads_the_live_socket_envelope() { + let raw = json!({ + "type": "session_snapshot", + "snapshot": { + "protocol": 22, + "version": "0.9.5", + "agents": [{ + "agent": "scratch-2", + "pane_id": "w1:p2", + "agent_status": "blocked", + "workspace_id": "w1" + }], + "workspaces": [{ "workspace_id": "w1", "label": "pendant-scratch" }] + } + }); + let snap = Snapshot::from_raw(raw); + assert_eq!(snap.agents.len(), 1); + assert_eq!(snap.agents[0].pane_id, "w1:p2"); + assert_eq!(snap.agents[0].status, "blocked"); + assert_eq!(snap.workspaces[0].label.as_deref(), Some("pendant-scratch")); + assert_eq!(snap.inbox().len(), 1); + } } From 767aae069a4bbb6ba53afc6f5cd18dcd8d769f4c Mon Sep 17 00:00:00 2001 From: VirtualMachinist Date: Sat, 14 Nov 2026 10:19:17 -0500 Subject: [PATCH 03/16] app: nsh shell scaffold with navigation and bridge wire types The app becomes an nsh v0.5.0 Rust app. lib.rs is the library root and holds the navigation stack (agents, agent detail, inbox); nsh.json names App as the root and limits the network to *.ts.net hosts. net/ reads the bridge with nsh's fetch: typed snapshot, agent, workspace, agent detail, inbox and error bodies, and the /v1/ws version 1 envelope (watch, unwatch, resync up; frame, scrollback, refused down) with a seq tracker. The bridge origin is not in the source: it is read from PENDANT_BRIDGE_URL at build time and must be an https origin. agents/mod.rs and theme.rs are placeholders for the screens and colours. The notes store and its Lapis link are built on the host only, so its tests and pendant_app::{Config, Store} are unchanged, and the iOS and Android builds carry no Lapis. On those targets lib.rs mounts the device keystore directly. rust-version rises to 1.97, nsh's minimum. Co-Authored-By: Claude Opus 5.5 --- app/.gitignore | 2 + app/Cargo.lock | 3059 +++++++++++++++++++++++++++++++++++++---- app/Cargo.toml | 15 +- app/nsh.json | 13 + app/src/agents/mod.rs | 36 + app/src/lib.rs | 112 ++ app/src/net/mod.rs | 170 +++ app/src/net/tests.rs | 172 +++ app/src/net/types.rs | 132 ++ app/src/net/ws.rs | 135 ++ app/src/theme.rs | 9 + 11 files changed, 3607 insertions(+), 248 deletions(-) create mode 100644 app/.gitignore create mode 100644 app/nsh.json create mode 100644 app/src/agents/mod.rs create mode 100644 app/src/lib.rs create mode 100644 app/src/net/mod.rs create mode 100644 app/src/net/tests.rs create mode 100644 app/src/net/types.rs create mode 100644 app/src/net/ws.rs create mode 100644 app/src/theme.rs diff --git a/app/.gitignore b/app/.gitignore new file mode 100644 index 0000000..5884f29 --- /dev/null +++ b/app/.gitignore @@ -0,0 +1,2 @@ +.nsh/ +target/ diff --git a/app/Cargo.lock b/app/Cargo.lock index dbb2fae..a9cc38e 100644 --- a/app/Cargo.lock +++ b/app/Cargo.lock @@ -2,6 +2,12 @@ # It is not intended for manual editing. version = 4 +[[package]] +name = "adler2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" + [[package]] name = "aho-corasick" version = "1.1.5" @@ -12,473 +18,2699 @@ dependencies = [ ] [[package]] -name = "bitflags" -version = "2.13.2" +name = "alloc-no-stdlib" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ded4057c258ba199e2d26386d3af3780957ecaee6c4ef4041c6b4b8b97c0b06" +checksum = "c2fb6cfd47bf496ff64095c20eaba0c201404ee38714d4142fcfa1dc334fcc7a" [[package]] -name = "bstr" -version = "1.13.1" +name = "ambient-authority" +version = "0.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bb31b46c14244e20ee9984b11bf5c992b91fb6939fea616e3512c8baecdbe5f" -dependencies = [ - "memchr", - "serde_core", -] +checksum = "e9d4ee0d472d1cd2e28c97dfa124b3d8d992e10eb0a035f33f5d12e3a177ba3b" [[package]] -name = "cc" -version = "1.10.0" +name = "android_system_properties" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86e055fa6e3e40ad6187ba25b6855eeb635d5271f8e0f0e1e9a5826b8d75bea0" +checksum = "ae221649c9976a6f6c56ae1facf410f3ddb33cc661c4b7b61020a912d4237fbc" dependencies = [ - "find-msvc-tools", - "shlex", + "libc", ] [[package]] -name = "crossbeam-deque" -version = "0.8.8" +name = "annotate-snippets" +version = "0.12.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622f3fc73690be383c7214310406f28a90e6edeadc3cea882f9d71e495b9711a" +checksum = "0258346f92c78dbc5b336b9a5b27c64447aa10643bc64e651db2edb145361564" dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", + "anstyle", + "memchr", + "unicode-width", ] [[package]] -name = "crossbeam-epoch" -version = "0.9.21" +name = "anstyle" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc74980687109a3b14c72fd458107bf0baa1da1a1a805e178d15501ba9b86d9d" +checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000" + +[[package]] +name = "arc-swap" +version = "1.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84a22b5d51209f6de83d37a0b33d320acb8da88823e42a94c075140708f032a5" dependencies = [ - "crossbeam-utils", + "rustversion", ] [[package]] -name = "crossbeam-utils" -version = "0.8.23" +name = "arraydeque" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31eee39dddec8330830986fcd7625edb5a24ec90ea038215273bbc3adb08ac6" +checksum = "7d902e3d592a523def97af8f317b08ce16b7ab854c1985a0c671e6f15cebc236" [[package]] -name = "equivalent" -version = "1.0.3" +name = "arrayvec" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00d174d5400e5e8fd687ad1049e2f578285fa914201b1af7e8b112a4546bd826" +checksum = "d3fb67a6e08acf24fdeccbac2cb6ac4305825bd1f117462e0e6f2f193345ad56" [[package]] -name = "fallible-iterator" -version = "0.3.0" +name = "autocfg" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" +checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53" [[package]] -name = "fallible-streaming-iterator" -version = "0.1.9" +name = "base62" +version = "2.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a" +checksum = "a3a647dce9631f152a99ec16cfc09267ae55fe280d5dc288964027d458076323" [[package]] -name = "find-msvc-tools" -version = "0.1.15" +name = "base64" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c66915cc5391097de7a2b0b972e8505aa33c0df401fd3a6811dbdb32881ba48" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] -name = "foldhash" -version = "0.2.0" +name = "base64" +version = "0.23.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" +checksum = "ac07cdecf99051d9a5238b80f35af32cdeba5b336e55d957b318b50137e18da5" [[package]] -name = "globset" -version = "0.4.21" +name = "base64ct" +version = "1.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f98b0d85522dc0a824cfebbc9594ff4a9b289c568bea0370319dfbdf20ccdd2d" +checksum = "2af50177e190e07a26ab74f8b1efbfe2ef87da2116221318cb1c2e82baf7de06" + +[[package]] +name = "bincode" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" dependencies = [ - "aho-corasick", - "bstr", - "log", - "regex-automata", - "regex-syntax", + "serde", ] [[package]] -name = "hashbrown" -version = "0.17.1" +name = "bit-set" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a" +checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" dependencies = [ - "foldhash", + "bit-vec", ] [[package]] -name = "hashlink" -version = "0.12.2" +name = "bit-vec" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a596f1b20ed2cc5ecac41a164aaebc7258057060f06c0cf7a2ba3991ee7990fb" +checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ded4057c258ba199e2d26386d3af3780957ecaee6c4ef4041c6b4b8b97c0b06" + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ - "hashbrown", + "generic-array", ] [[package]] -name = "ignore" -version = "0.4.34" +name = "brotli-decompressor" +version = "6.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "484be5657551d7868d67587df967fb4fcbe9d266a761cc855aaa148fda0b3cc7" +checksum = "75c74c9c51b9140663e196b5fb88bc94c334d7a497c8311cb759d8557874747f" dependencies = [ - "crossbeam-deque", - "globset", - "log", - "memchr", - "regex-automata", - "same-file", - "walkdir", - "winapi-util", + "alloc-no-stdlib", ] [[package]] -name = "indexmap" -version = "2.14.2" +name = "bstr" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc4e190f5d26ca7051642629da2c52fc03bde85a03197c99408dcd291734c855" +checksum = "6bb31b46c14244e20ee9984b11bf5c992b91fb6939fea616e3512c8baecdbe5f" dependencies = [ - "equivalent", - "hashbrown", + "memchr", + "serde_core", ] [[package]] -name = "itoa" -version = "1.0.18" +name = "bumpalo" +version = "3.20.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" +checksum = "87a0cf66fd1eb2fb7b822cb78370d82303750809bc6ba855f3f58e517d3238db" [[package]] -name = "lapis-lattice" -version = "0.5.0" -source = "git+https://github.com/Hedronite/lapis-lattice?rev=42aa3b8dcdac51c684bd3cd4c3c6a5c3c17a9092#42aa3b8dcdac51c684bd3cd4c3c6a5c3c17a9092" +name = "bytes" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04" + +[[package]] +name = "cap-primitives" +version = "4.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b5f74729fd2f44701d1a8eb47e906cdb3ccd9ec0f02baad85a744b791940b18" dependencies = [ - "ignore", - "regex", - "rusqlite", - "serde", - "serde_json", - "sqlite-vec", - "thiserror", + "ambient-authority", + "fs-set-times", + "io-extras", + "io-lifetimes 3.0.1", + "ipnet", + "maybe-owned", + "rustix", + "rustix-linux-procfs", + "windows-sys 0.61.2", + "winx", ] [[package]] -name = "lapis-notes" -version = "0.5.0" -source = "git+https://github.com/Hedronite/lapis-lattice?rev=42aa3b8dcdac51c684bd3cd4c3c6a5c3c17a9092#42aa3b8dcdac51c684bd3cd4c3c6a5c3c17a9092" +name = "cap-std" +version = "4.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1ec78e242cfa2cfe276807ac2ecc00315a6c97786977414bcd1c3963b6c91b8" dependencies = [ - "serde", - "serde_json", - "thiserror", - "yaml_serde", + "cap-primitives", + "io-extras", + "io-lifetimes 3.0.1", + "rustix", ] [[package]] -name = "libsqlite3-sys" -version = "0.40.0" +name = "cc" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b06e69070b7e12262b0cd90832f0a7396f142a2b330181255562decf9f0c6215" +checksum = "86e055fa6e3e40ad6187ba25b6855eeb635d5271f8e0f0e1e9a5826b8d75bea0" dependencies = [ - "cc", - "pkg-config", - "vcpkg", + "find-msvc-tools", + "shlex", ] [[package]] -name = "libyaml-rs" -version = "0.3.0" +name = "cfg-if" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e126dda6f34391ab7b444f9922055facc83c07a910da3eb16f1e4d9c45dc777" +checksum = "4e7648175b45a9a48536d676f68d918270699102aa8dab5496df06904c914600" [[package]] -name = "log" -version = "0.4.34" +name = "cfg_aliases" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9f8bd3e56ce4dfc153cf470fffbfa98c7620958b312ca5c3a4b8d5181fd13c6" +checksum = "f079e83a288787bcd14a6aea84cee5c87a67c5a3e660c30f557a3d24761b3527" [[package]] -name = "memchr" -version = "2.8.3" +name = "chrono" +version = "0.4.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98" +checksum = "1aa79e62e7697b8e29b513a68abacf485adcd1fe8284a4316c5ae868e6633327" +dependencies = [ + "iana-time-zone", + "num-traits", + "windows-link", +] [[package]] -name = "objc2" -version = "0.6.5" +name = "combine" +version = "4.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08849bbd4767dfae9457696856ae1c84fe4e0281bbe4a7abff2d0e06fb7981f8" +checksum = "4356eba6976435498d05a311ee9fc486da3bc81c200d3f0d7dd9703b41913f92" dependencies = [ - "objc2-encode", + "bytes", + "memchr", ] [[package]] -name = "objc2-encode" -version = "4.1.0" +name = "const-oid" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef25abbcd74fb2609453eb695bd2f860d389e457f67dc17cafc8b8cbc89d0c33" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" [[package]] -name = "objc2-foundation" -version = "0.3.2" +name = "constant_time_eq" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3e0adef53c21f888deb4fa59fc59f7eb17404926ee8a6f59f5df0fd7f9f3272" +checksum = "9eb6feb175df65d0a3ccd3e73484e940d0ac664e8034f0519fd49a93db3071d9" dependencies = [ - "bitflags", - "objc2", + "rustversion", ] [[package]] -name = "pendant-app" -version = "0.0.1" +name = "core-foundation" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6" dependencies = [ - "lapis-lattice", - "lapis-notes", - "objc2-foundation", - "rusqlite", + "core-foundation-sys", + "libc", ] [[package]] -name = "pkg-config" -version = "0.3.34" +name = "core-foundation-sys" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6b464fbc74e149a392436b17d523f769e057cb6877f6a5c4618bc6f11800548" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] -name = "proc-macro2" -version = "1.0.107" +name = "core_detect" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9" +checksum = "7f8f80099a98041a3d1622845c271458a2d73e688351bf3cb999266764b81d48" + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" dependencies = [ - "unicode-ident", + "libc", ] [[package]] -name = "quote" -version = "1.0.47" +name = "crc32fast" +version = "1.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001" +checksum = "2b929dd2a135771f40afabd1073f85eed59c800b7c61901e5c254270497dad64" dependencies = [ - "proc-macro2", + "cfg-if", ] [[package]] -name = "regex" -version = "1.13.1" +name = "crossbeam-deque" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f020237b6c8eed93db2e2cb53c00c60a8e1bc73da7d073199a1180401450218d" +checksum = "622f3fc73690be383c7214310406f28a90e6edeadc3cea882f9d71e495b9711a" dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", + "crossbeam-epoch", + "crossbeam-utils", ] [[package]] -name = "regex-automata" -version = "0.4.18" +name = "crossbeam-epoch" +version = "0.9.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad8553b9b26413251cbf30e620595c7a41b3887f03da04579c0e6b0d6a06b4b2" +checksum = "dc74980687109a3b14c72fd458107bf0baa1da1a1a805e178d15501ba9b86d9d" dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", + "crossbeam-utils", ] [[package]] -name = "regex-syntax" -version = "0.8.11" +name = "crossbeam-utils" +version = "0.8.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4" +checksum = "a31eee39dddec8330830986fcd7625edb5a24ec90ea038215273bbc3adb08ac6" [[package]] -name = "rsqlite-vfs" -version = "0.2.0" +name = "crypto-common" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "353b74f9810d5b085b6c42c9d86a5f0fdb795553235cdd48753b32e3809d18a7" +checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" dependencies = [ - "thiserror", + "generic-array", + "typenum", ] [[package]] -name = "rusqlite" -version = "0.42.0" +name = "curve25519-dalek" +version = "4.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4edff0039f148731aee2fd80f76dbfeb12d204ab3d1c544838d34e02151049b" +checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" dependencies = [ - "bitflags", - "fallible-iterator", - "fallible-streaming-iterator", - "hashlink", - "libsqlite3-sys", - "smallvec", - "sqlite-wasm-rs", + "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest", + "fiat-crypto", + "rustc_version", + "subtle", + "zeroize", ] [[package]] -name = "ryu" -version = "1.0.23" +name = "curve25519-dalek-derive" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] [[package]] -name = "same-file" -version = "1.0.6" +name = "data-encoding" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] +checksum = "4583a4551df46e2792f82ceeac45e850d2e2d5debba0b91f102385cda5b11f06" [[package]] -name = "serde" -version = "1.0.229" +name = "der" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba" +checksum = "e7c1832837b905bbfb5101e07cc24c8deddf52f93225eee6ead5f4d63d53ddcb" dependencies = [ - "serde_core", - "serde_derive", + "const-oid", + "zeroize", ] [[package]] -name = "serde_core" -version = "1.0.229" +name = "digest" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "serde_derive", + "block-buffer", + "crypto-common", ] [[package]] -name = "serde_derive" -version = "1.0.229" +name = "displaydoc" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348" +checksum = "c6232dd377dcc64799954cbd3a9bb882e9cdc1308ccd87b1c098f1fb2eaf82a8" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 3.0.9", ] [[package]] -name = "serde_json" -version = "1.0.154" +name = "ed25519" +version = "2.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7e9cc8b1b85264074fbcc02a88680c4096b1e47df8f739dceb03bf482f04bd6" +checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" +dependencies = [ + "pkcs8", + "signature", +] + +[[package]] +name = "ed25519-dalek" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70e796c081cee67dc755e1a36a0a172b897fab85fc3f6bc48307991f64e4eca9" +dependencies = [ + "curve25519-dalek", + "ed25519", + "serde", + "sha2", + "subtle", + "zeroize", +] + +[[package]] +name = "either" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e9c71c2167ca323c882b99918929403426e2373ea17242ff5653e0d5e1058be" + +[[package]] +name = "encoding_rs" +version = "0.8.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89253175e704ab869b04f9db224d38630e0211a53841a79181deae0889e169f5" +dependencies = [ + "cfg-if", + "core_detect", + "multiversion_no_op", + "rustversion", + "scopeguard", + "simdutf8", +] + +[[package]] +name = "encoding_rs_io" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fba3fe847045ecff794b9c138293a80db914678c453ad63fbf0c6a9eb6e00b22" +dependencies = [ + "encoding_rs", +] + +[[package]] +name = "equivalent" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00d174d5400e5e8fd687ad1049e2f578285fa914201b1af7e8b112a4546bd826" + +[[package]] +name = "errno" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e35d6e78f4cebb90e51d543db8fe41528851d6deeef6ef21ebd4bfdc1e784776" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "fallible-iterator" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" + +[[package]] +name = "fallible-streaming-iterator" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a" + +[[package]] +name = "fancy-regex" +version = "0.16.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "998b056554fbe42e03ae0e152895cd1a7e1002aec800fdc6635d20270260c46f" +dependencies = [ + "bit-set", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "fiat-crypto" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" + +[[package]] +name = "filetime" +version = "0.2.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c287a33c7f0a620c38e641e7f60827713987b3c0f26e8ddc9462cc69cf75759" +dependencies = [ + "cfg-if", + "libc", +] + +[[package]] +name = "find-msvc-tools" +version = "0.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c66915cc5391097de7a2b0b972e8505aa33c0df401fd3a6811dbdb32881ba48" + +[[package]] +name = "flate2" +version = "1.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "626d4928326b646e70f65ed36fc7cf9f206bdb68a0019ee7c6b4709da4e084c4" +dependencies = [ + "crc32fast", + "miniz_oxide", + "zlib-rs", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + +[[package]] +name = "foldhash" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" + +[[package]] +name = "form_urlencoded" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "fs-set-times" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94e7099f6313ecacbe1256e8ff9d617b75d1bcb16a6fddef94866d225a01a14a" +dependencies = [ + "io-lifetimes 2.0.4", + "rustix", + "windows-sys 0.59.0", +] + +[[package]] +name = "futf" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df420e2e84819663797d1ec6544b13c5be84629e7bb00dc960d6917db2987843" +dependencies = [ + "mac", + "new_debug_unreachable", +] + +[[package]] +name = "futures-core" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92d699e522242e69e3003b94ecc1f960f3a5e015aa7c5d7486e65ad01dd94f5e" + +[[package]] +name = "futures-macro" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb9654ba8355388abeb8dcb4fc62f511300867002afc858860463bdd9fe0c44" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.9", +] + +[[package]] +name = "futures-sink" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1944426bf7d03f1d14f708785e4b33efd750b36d48a157b836b3efc15ede8e1d" + +[[package]] +name = "futures-task" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd417de3d1d015fc3bfd2b1ea46dfc7bab72ef86f1cc7cc9c78e728b34a6d1fd" + +[[package]] +name = "futures-util" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d50a92467f8ba5dd6e3ee5d4bd04d73ab2e4e1c44474a0674821dfce14b79bc" +dependencies = [ + "futures-core", + "futures-macro", + "futures-sink", + "futures-task", + "pin-project-lite", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "getrandom" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" +dependencies = [ + "cfg-if", + "libc", + "r-efi 5.3.0", + "wasip2", +] + +[[package]] +name = "getrandom" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "300e883d756b2e4ec94e02791f39b04b522276138852cfc41d9fb7e904106099" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "r-efi 6.0.0", + "wasm-bindgen", +] + +[[package]] +name = "glob" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4eba85ea1d0a966a983acd07deee566e67395d2d96b6fb39e62b5a833f1eb0b" + +[[package]] +name = "globset" +version = "0.4.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f98b0d85522dc0a824cfebbc9594ff4a9b289c568bea0370319dfbdf20ccdd2d" +dependencies = [ + "aho-corasick", + "bstr", + "log", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "globwalk" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93e3af942408868f6934a7b85134a3230832b9977cf66125df2f9edcfce4ddcc" +dependencies = [ + "bitflags 1.3.2", + "ignore", + "walkdir", +] + +[[package]] +name = "granit-parser" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e20f99e46474f56bd905c56e817ebddcf377a611f94c53ac4649e4d3fa3c0cd0" +dependencies = [ + "arraydeque", + "smallvec", +] + +[[package]] +name = "hashbrown" +version = "0.15.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" +dependencies = [ + "foldhash 0.1.5", +] + +[[package]] +name = "hashbrown" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a" +dependencies = [ + "foldhash 0.2.0", +] + +[[package]] +name = "hashlink" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a596f1b20ed2cc5ecac41a164aaebc7258057060f06c0cf7a2ba3991ee7990fb" +dependencies = [ + "hashbrown 0.17.1", +] + +[[package]] +name = "html5ever" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c13771afe0e6e846f1e67d038d4cb29998a6779f93c809212e4e9c32efd244d4" +dependencies = [ + "log", + "mac", + "markup5ever", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "http" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "918d3568bebf352712bc2ef3d46a8bcf1a75b373be6539de198e9105cbbf9ce0" +dependencies = [ + "bytes", + "itoa", +] + +[[package]] +name = "httparse" +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 = "iana-time-zone" +version = "0.1.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e31bc9ad994ba00e440a8aa5c9ef0ec67d5cb5e5cb0cc7f8b744a35b389cc470" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "log", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "icu_collections" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe090a42a0d3140fed8c63263ed1fecc02422cb2f4bfe55cd8de2de1b8e105dd" +dependencies = [ + "displaydoc", + "potential_utf", + "utf8_iter", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locale_core" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25d29b57c17c6528d0dc4c2141cfa2d08200465acb537a3909c8b9b8a4a984c0" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_normalizer" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "404a3b8c486f205c87fe7f23ab6894d84a4ad76d6e4671ae1981ba7def87c599" +dependencies = [ + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20f0088bfb7441f7a37fa0c9e20cb1e9cba1cac6b9ce8cd2a6dc44294f8e8cbc" + +[[package]] +name = "icu_properties" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ea83d991c56158f7cf898bf86436c1dfe7c07ee82fe88951f2695c9f37a379f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locale_core", + "icu_properties_data", + "icu_provider", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b98f29af82d02b163fe50161388350e743bb3107cc8e8c2f7314cb505faddfcf" + +[[package]] +name = "icu_provider" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413099315636c588ee8f011190b329b971a09a8fae9d157e01dcae8379468514" +dependencies = [ + "displaydoc", + "icu_locale_core", + "writeable", + "yoke", + "zerofrom", + "zerotrie", + "zerovec", +] + +[[package]] +name = "idna" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb68373c0d6620ef8105e855e7745e18b0d00d3bdb07fb532e434244cdb9a714" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "ignore" +version = "0.4.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "484be5657551d7868d67587df967fb4fcbe9d266a761cc855aaa148fda0b3cc7" +dependencies = [ + "crossbeam-deque", + "globset", + "log", + "memchr", + "regex-automata", + "same-file", + "walkdir", + "winapi-util", +] + +[[package]] +name = "imagesize" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65b27460c2c92b037f3f94c538ed9a3342f3fdf923606781629ccb35f82d042a" + +[[package]] +name = "imara-diff" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f01d462f766df78ab820dd06f5eb700233c51f0f4c2e846520eaf4ba6aa5c5c" +dependencies = [ + "hashbrown 0.15.5", + "memchr", +] + +[[package]] +name = "indexmap" +version = "2.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc4e190f5d26ca7051642629da2c52fc03bde85a03197c99408dcd291734c855" +dependencies = [ + "equivalent", + "hashbrown 0.17.1", +] + +[[package]] +name = "io-extras" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20fd6de4ccfcc187e38bc21cfa543cb5a302cb86a8b114eb7f0bf0dc9f8ac00f" +dependencies = [ + "io-lifetimes 3.0.1", + "windows-sys 0.60.2", +] + +[[package]] +name = "io-lifetimes" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06432fb54d3be7964ecd3649233cddf80db2832f47fec34c01f65b3d9d774983" + +[[package]] +name = "io-lifetimes" +version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f0fb0570afe1fed943c5c3d4102d5358592d8625fda6a0007fdbe65a92fba96" + +[[package]] +name = "ipnet" +version = "2.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "791930b43c0d5973160d90a8f3894509f2b273430f5c5c73b668636d0287c5c0" + +[[package]] +name = "itertools" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" + +[[package]] +name = "jni" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5efd9a482cf3a427f00d6b35f14332adc7902ce91efb778580e180ff90fa3498" +dependencies = [ + "cfg-if", + "combine", + "jni-macros", + "jni-sys", + "log", + "simd_cesu8", + "thiserror", + "walkdir", + "windows-link", +] + +[[package]] +name = "jni-macros" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a00109accc170f0bdb141fed3e393c565b6f5e072365c3bd58f5b062591560a3" +dependencies = [ + "proc-macro2", + "quote", + "rustc_version", + "simd_cesu8", + "syn 2.0.119", +] + +[[package]] +name = "jni-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6377a88cb3910bee9b0fa88d4f42e1d2da8e79915598f65fb0c7ee14c878af2" +dependencies = [ + "jni-sys-macros", +] + +[[package]] +name = "jni-sys-macros" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38c0b942f458fe50cdac086d2f946512305e5631e720728f2a61aabcd47a6264" +dependencies = [ + "quote", + "syn 2.0.119", +] + +[[package]] +name = "js-sys" +version = "0.3.107" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8dc09d2154098bbf4ef54eab6b117a3c24cbbffe94046b16ee6d6d4510584d3a" +dependencies = [ + "cfg-if", + "futures-util", + "wasm-bindgen", +] + +[[package]] +name = "lapis-lattice" +version = "0.5.0" +source = "git+https://github.com/Hedronite/lapis-lattice?rev=42aa3b8dcdac51c684bd3cd4c3c6a5c3c17a9092#42aa3b8dcdac51c684bd3cd4c3c6a5c3c17a9092" +dependencies = [ + "ignore", + "regex", + "rusqlite", + "serde", + "serde_json", + "sqlite-vec", + "thiserror", +] + +[[package]] +name = "lapis-notes" +version = "0.5.0" +source = "git+https://github.com/Hedronite/lapis-lattice?rev=42aa3b8dcdac51c684bd3cd4c3c6a5c3c17a9092#42aa3b8dcdac51c684bd3cd4c3c6a5c3c17a9092" +dependencies = [ + "serde", + "serde_json", + "thiserror", + "yaml_serde", +] + +[[package]] +name = "libc" +version = "0.2.191" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65cd87c9a6d60536580b316ad985726104730a5151c99845f2490428ef91240a" + +[[package]] +name = "libsqlite3-sys" +version = "0.40.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b06e69070b7e12262b0cd90832f0a7396f142a2b330181255562decf9f0c6215" +dependencies = [ + "cc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "libyaml-rs" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e126dda6f34391ab7b444f9922055facc83c07a910da3eb16f1e4d9c45dc777" + +[[package]] +name = "linux-raw-sys" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" + +[[package]] +name = "litemap" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47d9d19d1d6efa0109d2f65ff4c85cddd50bd572e5a00127ab10987290bcefae" + +[[package]] +name = "lock_api" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" +dependencies = [ + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9f8bd3e56ce4dfc153cf470fffbfa98c7620958b312ca5c3a4b8d5181fd13c6" + +[[package]] +name = "mac" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c41e0c4fef86961ac6d6f8a82609f55f31b05e4fce149ac5710e439df7619ba4" + +[[package]] +name = "markdown" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5cab8f2cadc416a82d2e783a1946388b31654d391d1c7d92cc1f03e295b1deb" +dependencies = [ + "unicode-id", +] + +[[package]] +name = "markup5ever" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16ce3abbeba692c8b8441d036ef91aea6df8da2c6b6e21c7e14d3c18e526be45" +dependencies = [ + "log", + "phf", + "phf_codegen", + "string_cache", + "string_cache_codegen", + "tendril", +] + +[[package]] +name = "markup5ever_rcdom" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edaa21ab3701bfee5099ade5f7e1f84553fd19228cf332f13cd6e964bf59be18" +dependencies = [ + "html5ever", + "markup5ever", + "tendril", + "xml5ever", +] + +[[package]] +name = "maybe-owned" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4facc753ae494aeb6e3c22f839b158aebd4f9270f55cd3c79906c45476c47ab4" + +[[package]] +name = "memchr" +version = "2.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98" + +[[package]] +name = "miniz_oxide" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b63fbc4a50860e98e7b2aa7804ded1db5cbc3aff9193adaff57a6931bf7c4b4c" +dependencies = [ + "adler2", + "simd-adler32", +] + +[[package]] +name = "mio" +version = "1.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20521a903f02b0a573cd6840e9d0a5a0cc043d361fe924092cd70f8556cc9c4a" +dependencies = [ + "libc", + "wasi", + "windows-sys 0.61.2", +] + +[[package]] +name = "multiversion_no_op" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "743fb55ba31b18fb1ecef6bdc9aa2743314978ac084044301a7eee33fb99a20d" + +[[package]] +name = "new_debug_unreachable" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" + +[[package]] +name = "nix" +version = "0.31.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf20d2fde8ff38632c426f1165ed7436270b44f199fc55284c38276f9db47c3d" +dependencies = [ + "bitflags 2.13.2", + "cfg-if", + "cfg_aliases", + "libc", +] + +[[package]] +name = "nohash-hasher" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451" + +[[package]] +name = "normpath" +version = "1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b11ce00d2594068e8a27c9146fdc5cf9f3ac38eb42c7cd34d05fea618873ac9f" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "nsh-base" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7bae08ed29b11f2595cf5b4ce406430b14493d24f07f2f4a9f068188fb35079" +dependencies = [ + "chrono", + "html5ever", + "imara-diff", + "log", + "markdown", + "markup5ever_rcdom", + "nsh-core", + "regex", + "ropey", + "rustc-hash", + "serde", + "serde_json", + "syntect", + "two-face", + "unicode-segmentation", + "unicode-width", + "vte", +] + +[[package]] +name = "nsh-core" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f93e2fa3cc4e18b393b7935d5551deba8330968f69f2a1b2ff1928cb125782a" +dependencies = [ + "cap-std", + "crc32fast", + "futures-util", + "httpdate", + "imagesize", + "libc", + "log", + "nsh-macros", + "nsh-updater", + "ordered-float", + "rust-i18n", + "rustc-hash", + "rustls", + "rustls-platform-verifier", + "serde", + "serde_json", + "sha2", + "slab", + "taffy", + "tokio", + "tokio-tungstenite", + "ttf-parser", + "unicode-linebreak", + "unicode-properties", + "url", + "webpki-roots 1.0.12", + "windows-sys 0.61.2", + "wuff", +] + +[[package]] +name = "nsh-macros" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db9d9d6eaf1942d10ccb5e328cbff1aeb7f0e27f945d3d0226c5943714a2e50e" +dependencies = [ + "imagesize", + "proc-macro2", + "quote", + "syn 2.0.119", + "ttf-parser", + "wuff", +] + +[[package]] +name = "nsh-updater" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a3598aa7721a64222c75d6c5948e720595d11916ec28a620e5ccec175221334" +dependencies = [ + "base64 0.22.1", + "ed25519-dalek", + "flate2", + "semver", + "serde", + "serde_json", + "sha2", + "tar", + "thiserror", + "zip", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "objc2" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08849bbd4767dfae9457696856ae1c84fe4e0281bbe4a7abff2d0e06fb7981f8" +dependencies = [ + "objc2-encode", +] + +[[package]] +name = "objc2-encode" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef25abbcd74fb2609453eb695bd2f860d389e457f67dc17cafc8b8cbc89d0c33" + +[[package]] +name = "objc2-foundation" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3e0adef53c21f888deb4fa59fc59f7eb17404926ee8a6f59f5df0fd7f9f3272" +dependencies = [ + "bitflags 2.13.2", + "objc2", +] + +[[package]] +name = "once_cell" +version = "1.21.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" + +[[package]] +name = "onig" +version = "6.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cc3cbf698f9438986c11a880c90a6d04b9de27575afd28bbf45b154b6c709e2" +dependencies = [ + "bitflags 2.13.2", + "libc", + "once_cell", + "onig_sys", +] + +[[package]] +name = "onig_sys" +version = "69.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e68317604e77e53b85896388e1a803c1d21b74c899ec9e5e1112db90735edd7" +dependencies = [ + "cc", + "pkg-config", +] + +[[package]] +name = "openssl-probe" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e036b411754132fd6b74e94b74e9a13c5cf606fa93d1885c35860d3060820b1" + +[[package]] +name = "ordered-float" +version = "5.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f59006ce1e204c30956638535b74d317bca99477b9356dfaec54c37f6f600ab" +dependencies = [ + "num-traits", +] + +[[package]] +name = "parking_lot" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-link", +] + +[[package]] +name = "pendant-app" +version = "0.0.1" +dependencies = [ + "lapis-lattice", + "lapis-notes", + "nsh-base", + "nsh-core", + "objc2-foundation", + "rusqlite", + "serde", + "serde_json", +] + +[[package]] +name = "percent-encoding" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" + +[[package]] +name = "phf" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" +dependencies = [ + "phf_shared", +] + +[[package]] +name = "phf_codegen" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aef8048c789fa5e851558d709946d6d79a8ff88c0440c587967f8e94bfb1216a" +dependencies = [ + "phf_generator", + "phf_shared", +] + +[[package]] +name = "phf_generator" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" +dependencies = [ + "phf_shared", + "rand 0.8.8", +] + +[[package]] +name = "phf_shared" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" +dependencies = [ + "siphasher", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" + +[[package]] +name = "pkcs8" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +dependencies = [ + "der", + "spki", +] + +[[package]] +name = "pkg-config" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6b464fbc74e149a392436b17d523f769e057cb6877f6a5c4618bc6f11800548" + +[[package]] +name = "potential_utf" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d83eb9bc6d8e5cf568e7a1101d60ee05e81ed50ea106026f3d18deeb046d7661" +dependencies = [ + "zerovec", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "precomputed-hash" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" + +[[package]] +name = "proc-macro2" +version = "1.0.107" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + +[[package]] +name = "r-efi" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" + +[[package]] +name = "rand" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e058c7de0b26af77780c769414d6257830bb240f3c38477dbc2c16e5f54d6d4c" +dependencies = [ + "rand_core 0.6.4", +] + +[[package]] +name = "rand" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9ef1d0d795eb7d84685bca4f72f3649f064e6641543d3a8c415898726a57b41" +dependencies = [ + "rand_chacha", + "rand_core 0.9.5", +] + +[[package]] +name = "rand_chacha" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" +dependencies = [ + "ppv-lite86", + "rand_core 0.9.5", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.17", +] + +[[package]] +name = "rand_core" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c" +dependencies = [ + "getrandom 0.3.4", +] + +[[package]] +name = "redox_syscall" +version = "0.5.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" +dependencies = [ + "bitflags 2.13.2", +] + +[[package]] +name = "regex" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f020237b6c8eed93db2e2cb53c00c60a8e1bc73da7d073199a1180401450218d" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad8553b9b26413251cbf30e620595c7a41b3887f03da04579c0e6b0d6a06b4b2" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4" + +[[package]] +name = "ring" +version = "0.17.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" +dependencies = [ + "cc", + "cfg-if", + "getrandom 0.2.17", + "libc", + "untrusted", + "windows-sys 0.52.0", +] + +[[package]] +name = "ropey" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93411e420bcd1a75ddd1dc3caf18c23155eda2c090631a85af21ba19e97093b5" +dependencies = [ + "smallvec", + "str_indices", +] + +[[package]] +name = "rsqlite-vfs" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "353b74f9810d5b085b6c42c9d86a5f0fdb795553235cdd48753b32e3809d18a7" +dependencies = [ + "thiserror", +] + +[[package]] +name = "rusqlite" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4edff0039f148731aee2fd80f76dbfeb12d204ab3d1c544838d34e02151049b" +dependencies = [ + "bitflags 2.13.2", + "fallible-iterator", + "fallible-streaming-iterator", + "hashlink", + "libsqlite3-sys", + "smallvec", + "sqlite-wasm-rs", +] + +[[package]] +name = "rust-i18n" +version = "4.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8502e73e6461c738659455c5d2cf95bc132760a6f203c717e66ee72b78906d7f" +dependencies = [ + "globwalk", + "regex", + "rust-i18n-macro", + "rust-i18n-support", + "smallvec", +] + +[[package]] +name = "rust-i18n-macro" +version = "4.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d54a28dd9d46108d56b9f0c85b220908844233e561c03087890325104f90f2c6" +dependencies = [ + "glob", + "proc-macro2", + "quote", + "rust-i18n-support", + "serde", + "serde_json", + "syn 2.0.119", +] + +[[package]] +name = "rust-i18n-support" +version = "4.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e806c2a9701cbd6043992cd935c30cb1fdb128fa15e7b506f3b46f97045737c0" +dependencies = [ + "arc-swap", + "base62", + "foldhash 0.2.0", + "globwalk", + "itertools", + "normpath", + "serde", + "serde-saphyr", + "serde_json", + "siphasher", + "toml", + "triomphe", +] + +[[package]] +name = "rustc-hash" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b1e7f9a428571be2dc5bc0505c13fb6bf936822b894ec87abf8a08a4e51742d" + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver", +] + +[[package]] +name = "rustix" +version = "1.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5e76742e5294153d4dde1207dbec5bdd81eef6fabdc0d2118babadabfd858aa" +dependencies = [ + "bitflags 2.13.2", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.61.2", +] + +[[package]] +name = "rustix-linux-procfs" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fc84bf7e9aa16c4f2c758f27412dc9841341e16aa682d9c7ac308fe3ee12056" +dependencies = [ + "once_cell", + "rustix", +] + +[[package]] +name = "rustls" +version = "0.23.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48e13bd8c0e9365c43cfa5c9e8f9ad49d3c8444926c9aac819e0e4dc503c8fdf" +dependencies = [ + "once_cell", + "ring", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-native-certs" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a073f5dc7469f984c52ad2752b63b0807745133b6de880b7b64c1ac4c48aec4" +dependencies = [ + "openssl-probe", + "rustls-pki-types", + "schannel", + "security-framework", +] + +[[package]] +name = "rustls-pki-types" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "102f35f7de7b06d8c61f1cff6592f5253e0dea431c74867aad5dfd70f44663fb" +dependencies = [ + "zeroize", +] + +[[package]] +name = "rustls-platform-verifier" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1167586491e2b18b8bfbb293e8180ec17c201c4f076d7cb3070ca964e7598f98" +dependencies = [ + "core-foundation", + "core-foundation-sys", + "jni", + "log", + "once_cell", + "rustls", + "rustls-native-certs", + "rustls-platform-verifier-android", + "rustls-webpki", + "security-framework", + "security-framework-sys", + "webpki-root-certs", + "windows-sys 0.61.2", +] + +[[package]] +name = "rustls-platform-verifier-android" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eec689c0bc40ff2458a5977b6619cb718087084a18e02a131c599b62d05e1a5f" + +[[package]] +name = "rustls-webpki" +version = "0.103.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3a0760a887c14823fca5a1c970b01d47c328c696c0c64829d1df50e8f853fd5" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", +] + +[[package]] +name = "rustversion" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f" + +[[package]] +name = "ryu" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "schannel" +version = "0.1.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cb23c424d8ee841bb4d813677ca237e2a610067d594fec130f87d6093495ab5" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "security-framework" +version = "3.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7f4bc775c73d9a02cde8bf7b2ec4c9d12743edf609006c7facc23998404cd1d" +dependencies = [ + "bitflags 2.13.2", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2691df843ecc5d231c0b14ece2acc3efb62c0a398c7e1d875f3983ce020e3" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "semver" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" + +[[package]] +name = "serde" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba" dependencies = [ - "foldhash", - "indexmap", - "itoa", - "memchr", - "serde", + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde-saphyr" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8050abb251097357e24aff63ba2c52a6309ecb7d23a5474023df960a02694d8" +dependencies = [ + "annotate-snippets", + "base64 0.23.1", + "encoding_rs_io", + "granit-parser", + "nohash-hasher", + "num-traits", + "serde_core", + "smallvec", + "zmij", +] + +[[package]] +name = "serde_core" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.9", +] + +[[package]] +name = "serde_json" +version = "1.0.154" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7e9cc8b1b85264074fbcc02a88680c4096b1e47df8f739dceb03bf482f04bd6" +dependencies = [ + "foldhash 0.2.0", + "indexmap", + "itoa", + "memchr", + "serde", "serde_core", "zmij", ] [[package]] -name = "shlex" -version = "2.0.1" +name = "serde_spanned" +version = "0.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3" +dependencies = [ + "serde", +] + +[[package]] +name = "sha1" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a978451301f4db1d02937a4ab3ccce137717b81826e79b7d49ffe3244a13c3b8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "sha2" +version = "0.10.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "shlex" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba" + +[[package]] +name = "signature" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +dependencies = [ + "rand_core 0.6.4", +] + +[[package]] +name = "simd-adler32" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a219298ac11a56ea9a6d2120044824d6f01aeb034955e7af7bc16858527deea" + +[[package]] +name = "simd_cesu8" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11031e251abf8611c80f460e19dbdeb54a66db918e49c65a7065b46ac7aec520" +dependencies = [ + "rustc_version", + "simdutf8", +] + +[[package]] +name = "simdutf8" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" + +[[package]] +name = "siphasher" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33f4fe9184a62d842c9ef383018f3306d8ba224fd9d836f56d7288308847c256" + +[[package]] +name = "slab" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" + +[[package]] +name = "slotmap" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdd58c3c93c3d278ca835519292445cb4b0d4dc59ccfdf7ceadaab3f8aeb4038" +dependencies = [ + "version_check", +] + +[[package]] +name = "smallvec" +version = "1.16.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0d5d4b1981b8bbbb7aed204cae5726d683d5d6ac7e74ec54122ea28f315e7c8" + +[[package]] +name = "socket2" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3d1e2c7f27f8d4cb10542a02c49005dbd6e93095799d6f3be745fae9f8fedd4" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "spki" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" +dependencies = [ + "base64ct", + "der", +] + +[[package]] +name = "sqlite-vec" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0ba424237a9a5db2f6071f193319e2b6a32f7f3961debb2fbbfe67067abce3f" +dependencies = [ + "cc", +] + +[[package]] +name = "sqlite-wasm-rs" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6cd504cecbfe7eef649988840f9a6cb768d11085efec138f8e99f160632d867" +dependencies = [ + "cc", + "rsqlite-vfs", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" + +[[package]] +name = "str_indices" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d08889ec5408683408db66ad89e0e1f93dff55c73a4ccc71c427d5b277ee47e6" + +[[package]] +name = "string_cache" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf776ba3fa74f83bf4b63c3dcbbf82173db2632ed8452cb2d891d33f459de70f" +dependencies = [ + "new_debug_unreachable", + "parking_lot", + "phf_shared", + "precomputed-hash", + "serde", +] + +[[package]] +name = "string_cache_codegen" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c711928715f1fe0fe509c53b43e993a9a557babc2d0a3567d0a3006f1ac931a0" +dependencies = [ + "phf_generator", + "phf_shared", + "proc-macro2", + "quote", +] + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "syn" +version = "2.0.119" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "872831b642d1a07999a962a351ed35b955ea2cfc8f3862091e2a240a84f17297" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "3.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d78c8dee4c7bf0e14673097256fed6142ce9d3b85a408189d07482442145823b" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "synstructure" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "901704edd0dfe137f1987838ee4f259e4e063c31371bdb423f7ae38ec6f77f02" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.9", +] + +[[package]] +name = "syntect" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "656b45c05d95a5704399aeef6bd0ddec7b2b3531b7c9e900abbf7c4d2190c925" +dependencies = [ + "bincode", + "fancy-regex", + "flate2", + "fnv", + "once_cell", + "onig", + "regex-syntax", + "serde", + "serde_derive", + "thiserror", + "walkdir", +] + +[[package]] +name = "taffy" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31f7bd2d97198df05186f93a3a3c306845f40e8b3c22bf9279cdd7e5cf5fea7d" +dependencies = [ + "serde", + "slotmap", + "smallvec", +] + +[[package]] +name = "tar" +version = "0.4.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f6221d9a6003c78398e3b239969f352578258df48c8eb051caadae0015bc840" +dependencies = [ + "filetime", + "libc", +] + +[[package]] +name = "tendril" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d24a120c5fc464a3458240ee02c299ebcb9d67b5249c8848b09d639dca8d7bb0" +dependencies = [ + "futf", + "mac", + "utf-8", +] + +[[package]] +name = "thiserror" +version = "2.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09e52cb86a36cede5cb101bf8908837b3e4c6e5e59fe7fd85c23fb56200d189e" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe5197923287db20a58125f0bc85c062f7f2c892de97b18c356f9efb14b28524" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.9", +] + +[[package]] +name = "tinystr" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abc840c238154d58f9e86b2792261edfde565a17696e1cda1a449de27979801a" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tokio" +version = "1.54.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b52fd3255258d26fac7264ab5a76b53c13367136dc011d3d6ad4f8ed070396a3" +dependencies = [ + "bytes", + "libc", + "mio", + "pin-project-lite", + "socket2", + "tokio-macros", + "windows-sys 0.61.2", +] + +[[package]] +name = "tokio-macros" +version = "2.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78773a2a397f451582ce068015985c33193cf6dea8b74d2a639fe457b2f07b0e" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.9", +] + +[[package]] +name = "tokio-rustls" +version = "0.26.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9cc2678c2cdd569ef8215e2afd7954ada2ae20b4fdd2c5fe6139a3b02d105db" +dependencies = [ + "rustls", + "tokio", +] + +[[package]] +name = "tokio-tungstenite" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d25a406cddcc431a75d3d9afc6a7c0f7428d4891dd973e4d54c56b46127bf857" +dependencies = [ + "futures-util", + "log", + "rustls", + "rustls-pki-types", + "tokio", + "tokio-rustls", + "tungstenite", + "webpki-roots 0.26.11", +] + +[[package]] +name = "toml" +version = "0.8.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + +[[package]] +name = "toml_datetime" +version = "0.6.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.22.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime", + "toml_write", + "winnow", +] + +[[package]] +name = "toml_write" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801" + +[[package]] +name = "triomphe" +version = "0.1.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d15f4f5898bcfc5d8a8e45ed30b2f108d710c1a2e5489dbf80e078f707181bc" +dependencies = [ + "arc-swap", + "serde", + "stable_deref_trait", +] + +[[package]] +name = "ttf-parser" +version = "0.25.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2df906b07856748fa3f6e0ad0cbaa047052d4a7dd609e231c4f72cee8c36f31" + +[[package]] +name = "tungstenite" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8628dcc84e5a09eb3d8423d6cb682965dea9133204e8fb3efee74c2a0c259442" +dependencies = [ + "bytes", + "data-encoding", + "http", + "httparse", + "log", + "rand 0.9.5", + "rustls", + "rustls-pki-types", + "sha1", + "thiserror", + "utf-8", +] + +[[package]] +name = "two-face" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39e51b6e60e545cfdae5a4639ff423818f52372211a8d9a3e892b4b0761f76b2" +dependencies = [ + "serde", + "serde_derive", + "syntect", +] + +[[package]] +name = "typed-path" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce898823d8cd0f028662d2f349694b1af0a5cc9be83f1d213a00d3147445e1e" + +[[package]] +name = "typenum" +version = "1.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6f5e870be6c3b371b77fe0ee0bafb859fa4964b4404c27de1d380043c4dda20" + +[[package]] +name = "unicode-id" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65dd75ab2d9d379dbe86d4059e91d8b5a6e7054865eaba1ddbfc7a817ff96392" + +[[package]] +name = "unicode-ident" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563" + +[[package]] +name = "unicode-linebreak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" + +[[package]] +name = "unicode-properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "993ad287eb20e8ba755312801cfe1413e0f25d604075863acaddca10b04c1833" + +[[package]] +name = "unicode-segmentation" +version = "1.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6f5d3c3b1bf09027a88a6bc961fc00497d651009560b5463668dc81b0fa87a8" + +[[package]] +name = "unicode-width" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca718471876992059f251e33aafc334346ada08042b7661dd1fe313a9bced557" + +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "url" +version = "2.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", +] + +[[package]] +name = "utf-8" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" + +[[package]] +name = "utf8_iter" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af3bd9d3e571c26fcce9d033b87ea5ab061b8d2ffe9b7a5675d810d68f03edf0" +dependencies = [ + "utf_types", +] + +[[package]] +name = "utf_types" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a3b425286980a367278453f3b6d28cdcb134b574e5a35824a6ff5eebad50bb6" + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "vte" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5924018406ce0063cd67f8e008104968b74b563ee1b85dde3ed1f7cb87d3dbd" +dependencies = [ + "arrayvec", + "memchr", +] + +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "wasi" +version = "0.11.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + +[[package]] +name = "wasip2" +version = "1.0.4+wasi-0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b67efb37e106e55ce722a510d6b5f9c17f083e5fc79afc2badeb12cc313d9487" +dependencies = [ + "wit-bindgen", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.130" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0181c14ddd6c7b8b0b0132a5f1ea2f32be0d893cd3ea97b6e3b28886b8a3d1c" +dependencies = [ + "cfg-if", + "rustversion", + "wasm-bindgen-macro", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.130" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e931a02a39abdbf66966fc35902b5ed58344750a70885bed4ebb3d8eaf28ed9" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.130" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba" +checksum = "2ca4b54280e455bd831e33a6b8e734baf432fe63fbc35c42ac14ce67a043a53a" +dependencies = [ + "bumpalo", + "proc-macro2", + "quote", + "syn 3.0.9", + "wasm-bindgen-shared", +] [[package]] -name = "smallvec" -version = "1.16.4" +name = "wasm-bindgen-shared" +version = "0.2.130" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0d5d4b1981b8bbbb7aed204cae5726d683d5d6ac7e74ec54122ea28f315e7c8" +checksum = "3b1f9c3798725016c6ee5f2f57869ec0831e8bbc0ab0310a86e787e97f41389e" +dependencies = [ + "unicode-ident", +] [[package]] -name = "sqlite-vec" -version = "0.1.9" +name = "webpki-root-certs" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0ba424237a9a5db2f6071f193319e2b6a32f7f3961debb2fbbfe67067abce3f" +checksum = "293198dcebfb821155b5092ab94b5a82ff180eddd7241df3bd6e66a4ffd1a585" dependencies = [ - "cc", + "rustls-pki-types", ] [[package]] -name = "sqlite-wasm-rs" -version = "0.6.3" +name = "webpki-roots" +version = "0.26.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6cd504cecbfe7eef649988840f9a6cb768d11085efec138f8e99f160632d867" +checksum = "521bc38abb08001b01866da9f51eb7c5d647a19260e00054a8c7fd5f9e57f7a9" dependencies = [ - "cc", - "rsqlite-vfs", + "webpki-roots 1.0.12", ] [[package]] -name = "syn" -version = "3.0.9" +name = "webpki-roots" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d78c8dee4c7bf0e14673097256fed6142ce9d3b85a408189d07482442145823b" +checksum = "7265c9301c16a8711c992c2d8da90ee77ef54b1ed51482d6dfeb00dc756b1297" dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", + "rustls-pki-types", ] [[package]] -name = "thiserror" -version = "2.0.21" +name = "winapi-util" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09e52cb86a36cede5cb101bf8908837b3e4c6e5e59fe7fd85c23fb56200d189e" +checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "thiserror-impl", + "windows-sys 0.61.2", ] [[package]] -name = "thiserror-impl" -version = "2.0.21" +name = "windows-core" +version = "0.62.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe5197923287db20a58125f0bc85c062f7f2c892de97b18c356f9efb14b28524" +checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-link", + "windows-result", + "windows-strings", +] + +[[package]] +name = "windows-implement" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.119", ] [[package]] -name = "unicode-ident" -version = "1.0.27" +name = "windows-interface" +version = "0.59.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563" +checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] [[package]] -name = "vcpkg" -version = "0.2.15" +name = "windows-link" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" [[package]] -name = "walkdir" -version = "2.5.0" +name = "windows-result" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" dependencies = [ - "same-file", - "winapi-util", + "windows-link", ] [[package]] -name = "winapi-util" -version = "0.1.11" +name = "windows-strings" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" +checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" dependencies = [ - "windows-sys", + "windows-link", ] [[package]] -name = "windows-link" -version = "0.2.1" +name = "windows-sys" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets 0.53.5", +] [[package]] name = "windows-sys" @@ -489,6 +2721,188 @@ dependencies = [ "windows-link", ] +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm 0.52.6", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.53.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" +dependencies = [ + "windows-link", + "windows_aarch64_gnullvm 0.53.1", + "windows_aarch64_msvc 0.53.1", + "windows_i686_gnu 0.53.1", + "windows_i686_gnullvm 0.53.1", + "windows_i686_msvc 0.53.1", + "windows_x86_64_gnu 0.53.1", + "windows_x86_64_gnullvm 0.53.1", + "windows_x86_64_msvc 0.53.1", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_i686_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" + +[[package]] +name = "winnow" +version = "0.7.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df79d97927682d2fd8adb29682d1140b343be4ac0f08fd68b7765d9c059d3945" +dependencies = [ + "memchr", +] + +[[package]] +name = "winx" +version = "0.36.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f3fd376f71958b862e7afb20cfe5a22830e1963462f3a17f49d82a6c1d1f42d" +dependencies = [ + "bitflags 2.13.2", + "windows-sys 0.59.0", +] + +[[package]] +name = "wit-bindgen" +version = "0.57.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e" + +[[package]] +name = "writeable" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ad82d2a33cdc9674dc7465672f271e096168fcdbe0f799d9e6db8c5892679dc" + +[[package]] +name = "wuff" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6a992b57b3d1ee972b2e3fd9225e44793104d49818836dd812d5459187712dd" +dependencies = [ + "brotli-decompressor", + "bytes", + "flate2", +] + +[[package]] +name = "xml5ever" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bbb26405d8e919bc1547a5aa9abc95cbfa438f04844f5fdd9dc7596b748bf69" +dependencies = [ + "log", + "mac", + "markup5ever", +] + [[package]] name = "yaml_serde" version = "0.10.7" @@ -502,8 +2916,163 @@ dependencies = [ "serde", ] +[[package]] +name = "yoke" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "417ef3fcf6c300b7dbd25c85531a746931c02ad536f3cf4786ed1e88223340b3" +dependencies = [ + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec8ebde2db3681e8c9980cc27822030e68752690ddfa9473e739aeb4dbde6d71" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.9", + "synstructure", +] + +[[package]] +name = "zerocopy" +version = "0.8.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5fe1f8f1b06191a00962174c61aa5005e0bb391a6d80d07e24d115c01a92ed8" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "863ad3ac83293fb4d740aedbfdc9240dd8d1a50c1099acd76ce80ce7c7230c7f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "zerofrom" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ec05a11813ea801ff6d75110ad09cd0824ddba17dfe17128ea0d5f68e6c5272" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f75b4683f6c7f45248d4d64056a24298c6281e0993356d7d1b4a1a962ef10d4a" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.9", + "synstructure", +] + +[[package]] +name = "zeroize" +version = "1.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13084392c5e4bc371903e2935a5eaeed24905a7511356b883835e18a78f6879" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c50655cbb0fe3fc43170059e702f1ce5e19b84cec58dc87b037a09935c2f328" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "zerotrie" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ea269c3bd32f0a32c321907a2ae912ba6f4649bb0fc764a15627e99a7095a3f" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + +[[package]] +name = "zerovec" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f58a2799cfe9a1670c7ea8edbd52ef8edb93cb37a7f83bf31ba9e35d9dae6a40" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.11.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3743ddbf47738d929cd1ae2e199d40d0162979dfe31aef8ae646d2bf00bf97a" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.9", +] + +[[package]] +name = "zip" +version = "9.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3476fd497ac8af5b1ec7b51acab7bef380f7e8dd8e0487595bafd839417a302" +dependencies = [ + "constant_time_eq", + "crc32fast", + "flate2", + "getrandom 0.4.3", + "indexmap", + "libc", + "memchr", + "nix", + "typed-path", + "windows-sys 0.61.2", + "zeroize", + "zopfli", +] + +[[package]] +name = "zlib-rs" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b268e58e7c693d7c271f93ffc4ba3b380412554231c85bf61ca7af91042a4112" + [[package]] name = "zmij" version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b" + +[[package]] +name = "zopfli" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aaf7fc5d30c28483d93805c4a5e12b05bbb52407fa67c5f8bd552374cd01fb11" +dependencies = [ + "bumpalo", + "crc32fast", + "log", + "simd-adler32", +] diff --git a/app/Cargo.toml b/app/Cargo.toml index 2122c89..5cb88e9 100644 --- a/app/Cargo.toml +++ b/app/Cargo.toml @@ -2,17 +2,26 @@ name = "pendant-app" version = "0.0.1" edition = "2021" -rust-version = "1.89" +rust-version = "1.97" license = "MIT" repository = "https://github.com/Hedronite/pendant" description = "Pendant's phone app" publish = false -# Until app/src/lib.rs lands, the notes store is the library root. [lib] -path = "src/notes/store.rs" +path = "src/lib.rs" [dependencies] +# The shell: nsh's Rust UI, its fetch and its runtime. Exact pins, because +# `nsh package` builds the runner against the CLI's own version (0.5.0). +nsh-core = "=0.5.0" +nsh-base = "=0.5.0" +serde = { version = "1", features = ["derive"] } +serde_json = "1" + +# The notes store is host-only until D1: the phone app has no Lapis link +# (SPEC-shell). CI still builds and tests it on the host. +[target.'cfg(not(any(target_os = "ios", target_os = "android")))'.dependencies] # Pinned to the Lapis v0.5.0 release merge (rusqlite 0.42, libsqlite3-sys 0.40; # clears RUSTSEC-2026-0459). It still carries GOAL-mobile G0-G3. lapis-notes is # publish = false, so both stay git deps at this exact rev, never a version. diff --git a/app/nsh.json b/app/nsh.json new file mode 100644 index 0000000..2b22aaf --- /dev/null +++ b/app/nsh.json @@ -0,0 +1,13 @@ +{ + "name": "Pendant", + "id": "com.hedronite.pendant", + "version": "0.0.1", + "build": 1, + "rust": ".", + "root": "App", + "capabilities": { + "network": { + "hosts": ["*.ts.net"] + } + } +} diff --git a/app/src/agents/mod.rs b/app/src/agents/mod.rs new file mode 100644 index 0000000..73bac2e --- /dev/null +++ b/app/src/agents/mod.rs @@ -0,0 +1,36 @@ +//! The agent screens. Frontend owns this file; these are placeholders that +//! keep the shell's navigation contract: +//! +//! - `list(nav)` is the bottom page; `nav.push(Route::Agent(id))` opens one +//! agent and `nav.push(Route::Inbox)` the inbox. +//! - `detail(nav, id)` and `inbox(nav)` are pushed pages. +//! +//! Data comes from [`crate::bridge`] and [`crate::net`]. + +use nsh_base::nav_page; +use nsh_core::prelude::*; + +use crate::{Nav, Route}; + +pub fn list(nav: Nav) -> Screen { + nav_page().title("Agents").child( + view() + .flex_1() + .p_4() + .gap_3() + .child(text("Agents")) + .child(text("Inbox").on_press(move || nav.push(Route::Inbox))), + ) +} + +pub fn detail(_nav: Nav, id: String) -> Screen { + nav_page() + .title(id.clone()) + .child(view().flex_1().p_4().child(text(id))) +} + +pub fn inbox(_nav: Nav) -> Screen { + nav_page() + .title("Inbox") + .child(view().flex_1().p_4().child(text("Inbox"))) +} diff --git a/app/src/lib.rs b/app/src/lib.rs new file mode 100644 index 0000000..6747a12 --- /dev/null +++ b/app/src/lib.rs @@ -0,0 +1,112 @@ +//! Pendant's phone app: an nsh shell over the bridge. +//! +//! - [`App`] is the root `nsh.json` names. It holds the navigation stack. +//! - [`net`] talks to the bridge (nsh `fetch`, and the WebSocket envelope). +//! - [`agents`] holds the screens, and [`theme`] the colours. +//! - On the host only, the notes store (and its Lapis link) stays the +//! library it was, so `pendant_app::{Config, Store}` and its tests are +//! unchanged. The phone builds have no Lapis link until D1. + +pub mod agents; +pub mod net; +pub mod theme; + +#[cfg(not(any(target_os = "ios", target_os = "android")))] +#[path = "notes/store.rs"] +mod store; +#[cfg(not(any(target_os = "ios", target_os = "android")))] +pub use store::*; + +// On the phones the store is not built, so the device key mounts here. +#[cfg(any(target_os = "ios", target_os = "android"))] +#[path = "platform/keystore.rs"] +pub mod keystore; + +use nsh_base::nav_stack; +use nsh_core::prelude::*; + +/// The app's UI set. `nsh package` registers it in the runner. +#[native_module("pendant/native")] +fn native(registry: &mut Registry) { + registry.register::(); +} + +/// A page on the navigation stack. +#[derive(Debug, Clone, PartialEq, Eq)] +pub enum Route { + /// The agent list: the bottom page. + Agents, + /// One agent, by the id the bridge gives it. + Agent(String), + /// Blocked and done events. + Inbox, +} + +impl Route { + /// The page's key on the stack. Unique for each route. + pub fn key(&self) -> String { + match self { + Self::Agents => "agents".to_owned(), + Self::Agent(id) => format!("agent:{id}"), + Self::Inbox => "inbox".to_owned(), + } + } +} + +/// What a screen uses to move: push a page, or go back one. +#[derive(Clone, Copy)] +pub struct Nav { + routes: Signal>, +} + +impl Nav { + pub fn push(&self, route: Route) { + self.routes.update(|routes| { + // A page already on the stack is not stacked twice. + if let Some(at) = routes.iter().position(|open| open == &route) { + routes.truncate(at + 1); + } else { + routes.push(route); + } + }); + } + + /// Back one page; the agent list always stays. + pub fn back(&self) { + self.routes.update(|routes| { + if routes.len() > 1 { + routes.pop(); + } + }); + } + + pub fn depth(&self) -> usize { + self.routes.with(Vec::len) + } +} + +/// The bridge this build talks to (`PENDANT_BRIDGE_URL` at build time). +pub fn bridge() -> Result { + net::Bridge::from_build() +} + +/// The root component. +#[component] +pub fn App() -> impl IntoElement { + let routes = signal(vec![Route::Agents]); + let nav = Nav { routes }; + nav_stack().flex_1().child(each( + move || routes.get(), + |route: &Route| route.key(), + move |route, index| { + let page = match route.get_untracked() { + Route::Agents => agents::list(nav), + Route::Agent(id) => agents::detail(nav, id), + Route::Inbox => agents::inbox(nav), + }; + // The user went back natively (swipe, Android back): drop the + // page and any above it. + page.on_dismiss(move || routes.update(|r| r.truncate(index.get_untracked().max(1)))) + }, + )) +} diff --git a/app/src/net/mod.rs b/app/src/net/mod.rs new file mode 100644 index 0000000..0ed6b88 --- /dev/null +++ b/app/src/net/mod.rs @@ -0,0 +1,170 @@ +//! The app's line to the bridge: HTTP through nsh's `fetch` (the platform's +//! own stack: NSURLSession on iOS, HttpURLConnection on Android) and the +//! WebSocket envelope in [`ws`]. No tokio or reqwest in the app. +//! +//! The bridge's address is not in the source. It comes from +//! `PENDANT_BRIDGE_URL` when the app is built, for example +//! `PENDANT_BRIDGE_URL=https://bridge.example.ts.net:8443 nsh package …`. + +pub mod types; +pub mod ws; + +pub use types::{Agent, AgentDetail, Inbox, InboxItem, Snapshot, Workspace}; + +use nsh_core::prelude::*; +use serde::de::DeserializeOwned; + +/// The variable read at build time. +pub const BRIDGE_URL_VAR: &str = "PENDANT_BRIDGE_URL"; + +/// The bridge's origin, checked: `https://host[:port]`, no path. +#[derive(Debug, Clone, PartialEq, Eq)] +pub struct Bridge { + origin: String, +} + +#[derive(Debug, Clone, PartialEq, Eq)] +pub enum ConfigError { + /// The app was built without `PENDANT_BRIDGE_URL`. + Unset, + /// Not `https://host[:port]`. + Invalid(String), +} + +impl std::fmt::Display for ConfigError { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::Unset => write!(f, "this build has no bridge address ({BRIDGE_URL_VAR})"), + Self::Invalid(why) => write!(f, "the bridge address is not usable: {why}"), + } + } +} + +impl Bridge { + /// The bridge this build was made for. + pub fn from_build() -> Result { + Self::parse(option_env!("PENDANT_BRIDGE_URL").ok_or(ConfigError::Unset)?) + } + + /// Accepts `https://host` or `https://host:port`, with an optional + /// trailing slash. Plain `http`, a path, a query or user info is refused. + pub fn parse(raw: &str) -> Result { + let raw = raw.trim(); + let rest = raw + .strip_prefix("https://") + .ok_or_else(|| ConfigError::Invalid("it must start with https://".into()))?; + let authority = rest.strip_suffix('/').unwrap_or(rest); + if authority.is_empty() { + return Err(ConfigError::Invalid("it has no host".into())); + } + if authority.contains(['/', '?', '#', '@']) || authority.chars().any(char::is_whitespace) { + return Err(ConfigError::Invalid("it must be an origin only".into())); + } + let (host, port) = match authority.rsplit_once(':') { + Some((host, port)) => (host, Some(port)), + None => (authority, None), + }; + if host.is_empty() || host.contains(':') { + return Err(ConfigError::Invalid("it has no usable host".into())); + } + if let Some(port) = port { + if port.parse::().map_or(true, |port| port == 0) { + return Err(ConfigError::Invalid("its port is not a number".into())); + } + } + Ok(Self { + origin: format!("https://{}", authority.to_ascii_lowercase()), + }) + } + + /// `https://host[:port]`, also the `Origin` the bridge's `/v1/ws` wants. + pub fn origin(&self) -> &str { + &self.origin + } + + /// `wss://host[:port]/v1/ws`. + pub fn ws_url(&self) -> String { + format!("wss://{}/v1/ws", &self.origin["https://".len()..]) + } + + fn url(&self, path: &str) -> String { + format!("{}{path}", self.origin) + } + + /// `GET /v1/snapshot`. + pub async fn snapshot(&self) -> Result { + self.get_json("/v1/snapshot").await + } + + /// `GET /v1/agents/{id}`. + pub async fn agent(&self, id: &str) -> Result { + self.get_json(&format!("/v1/agents/{}", encode_segment(id))) + .await + } + + /// `GET /v1/events`: the inbox. + pub async fn inbox(&self) -> Result { + self.get_json("/v1/events").await + } + + async fn get_json(&self, path: &str) -> Result { + let response = fetch(HttpRequest::get(self.url(path)).header("Accept", "application/json")) + .await + .map_err(NetError::Transport)?; + decode(response.status(), &response.text()) + } +} + +/// Why a call to the bridge failed. +#[derive(Debug, Clone, PartialEq, Eq)] +pub enum NetError { + /// No HTTP response: no route, DNS, TLS, or a refused capability. + Transport(String), + /// The bridge answered with an error status, and its code if it gave one. + Status { status: u16, code: Option }, + /// The body was not the JSON this app expects. + Decode(String), +} + +impl std::fmt::Display for NetError { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::Transport(why) => write!(f, "cannot reach the bridge: {why}"), + Self::Status { + status, + code: Some(code), + } => write!(f, "the bridge said {status} ({code})"), + Self::Status { status, code: None } => write!(f, "the bridge said {status}"), + Self::Decode(why) => write!(f, "unexpected reply from the bridge: {why}"), + } + } +} + +/// Turns a status and body into `T`, or the bridge's error code. +pub fn decode(status: u16, body: &str) -> Result { + if !(200..300).contains(&status) { + let code = serde_json::from_str::(body) + .ok() + .map(|body| body.error.code); + return Err(NetError::Status { status, code }); + } + serde_json::from_str(body).map_err(|err| NetError::Decode(err.to_string())) +} + +/// Percent-encodes one path segment (agent ids hold `:`, which is fine, but +/// never `/` or `?` unescaped). +fn encode_segment(segment: &str) -> String { + let mut out = String::with_capacity(segment.len()); + for byte in segment.bytes() { + match byte { + b'A'..=b'Z' | b'a'..=b'z' | b'0'..=b'9' | b'-' | b'_' | b'.' | b'~' | b':' => { + out.push(byte as char) + } + _ => out.push_str(&format!("%{byte:02X}")), + } + } + out +} + +#[cfg(test)] +mod tests; diff --git a/app/src/net/tests.rs b/app/src/net/tests.rs new file mode 100644 index 0000000..d33e7af --- /dev/null +++ b/app/src/net/tests.rs @@ -0,0 +1,172 @@ +//! The wire types against JSON shaped like the bridge's replies. All names +//! are made up; the host is the `example.ts.net` placeholder. + +use super::ws::{Down, Frame, SeqTrack, Up}; +use super::*; + +const SNAPSHOT: &str = r#"{ + "agents": [ + {"id":"w1:p1","name":null,"agent":"claude","status":"working","pane_id":"w1:p1","workspace_id":"w1","tab_id":"w1:t1","title":"alpha"}, + {"id":"w1:p2","name":null,"agent":"claude","status":"blocked","pane_id":"w1:p2","workspace_id":"w1","tab_id":"w1:t1","title":"bravo"}, + {"id":"w1:p3","name":null,"agent":"codex","status":"idle","pane_id":"w1:p3","workspace_id":"w1","tab_id":"w1:t2","title":null}, + {"id":"scout","name":"scout","agent":null,"status":"done","pane_id":"w1:p4","workspace_id":"w1","tab_id":null,"title":""} + ], + "workspaces": [{"workspace_id":"w1","label":"scratch","cwd":"/tmp/scratch","worktree":null}], + "raw": {"via":"socket","result":{"agents":[]}} +}"#; + +#[test] +fn a_snapshot_reads_and_ignores_raw() { + let snap: Snapshot = decode(200, SNAPSHOT).unwrap(); + assert_eq!(snap.agents.len(), 4); + assert_eq!(snap.workspaces[0].label.as_deref(), Some("scratch")); + let blocked: Vec<_> = snap.blocked().map(|agent| agent.id.as_str()).collect(); + assert_eq!(blocked, ["w1:p2"]); + assert_eq!(snap.agent("w1:p4").map(|a| a.id.as_str()), Some("scout")); + assert_eq!( + snap.agent("scout").map(|a| a.pane_id.as_str()), + Some("w1:p4") + ); +} + +#[test] +fn a_label_falls_back_from_title_to_name_to_id() { + let snap: Snapshot = decode(200, SNAPSHOT).unwrap(); + let labels: Vec<_> = snap.agents.iter().map(Agent::label).collect(); + assert_eq!(labels, ["alpha", "bravo", "w1:p3", "scout"]); +} + +#[test] +fn an_agent_detail_finds_the_output_text() { + let body = r#"{"id":"w1:p2","agent":{"id":"w1:p2","name":null,"agent":"claude","status":"blocked","pane_id":"w1:p2","workspace_id":"w1","tab_id":null,"title":"bravo"}, + "get":{"status":"blocked"},"output":{"read":{"text":"MARKER-B line\n"}},"blocked":true}"#; + let detail: AgentDetail = decode(200, body).unwrap(); + assert!(detail.blocked); + assert!(detail.agent.as_ref().unwrap().is_blocked()); + assert_eq!(detail.output_text(), Some("MARKER-B line\n")); + + let gone = r#"{"id":"w9:p9","agent":null,"get":null,"output":null,"blocked":false}"#; + let detail: AgentDetail = decode(200, gone).unwrap(); + assert_eq!(detail.agent, None); + assert_eq!(detail.output_text(), None); +} + +#[test] +fn the_inbox_reads_its_items() { + let body = r#"{"items":[{"id":"w1:p2","agent":"claude","status":"blocked","workspace_id":"w1","title":"bravo","kind":"blocked"}, + {"id":"scout","agent":"scout","status":"done","workspace_id":"w1","title":null,"kind":"done"}]}"#; + let inbox: Inbox = decode(200, body).unwrap(); + assert_eq!(inbox.items.len(), 2); + assert!(inbox.items[0].is_blocked()); + assert!(!inbox.items[1].is_blocked()); +} + +#[test] +fn an_error_status_keeps_the_bridge_code() { + let body = r#"{"error":{"code":"host_refused","message":"host is not allowed"}}"#; + assert_eq!( + decode::(403, body), + Err(NetError::Status { + status: 403, + code: Some("host_refused".into()) + }) + ); + assert_eq!( + decode::(502, "bad gateway"), + Err(NetError::Status { + status: 502, + code: None + }) + ); + assert!(matches!( + decode::(200, "{}"), + Err(NetError::Decode(_)) + )); +} + +#[test] +fn the_bridge_address_is_an_https_origin() { + let bridge = Bridge::parse("https://Bridge.Example.ts.net:8443/").unwrap(); + assert_eq!(bridge.origin(), "https://bridge.example.ts.net:8443"); + assert_eq!(bridge.ws_url(), "wss://bridge.example.ts.net:8443/v1/ws"); + assert_eq!( + bridge.url("/v1/snapshot"), + "https://bridge.example.ts.net:8443/v1/snapshot" + ); + assert!(Bridge::parse("https://bridge.example.ts.net").is_ok()); + + for bad in [ + "http://bridge.example.ts.net:8443", + "https://", + "https://bridge.example.ts.net:8443/v1", + "https://user@bridge.example.ts.net", + "https://bridge.example.ts.net:0", + "https://bridge.example.ts.net:http", + "https://[::1]:8443", + "bridge.example.ts.net", + ] { + assert!( + matches!(Bridge::parse(bad), Err(ConfigError::Invalid(_))), + "{bad}" + ); + } +} + +#[test] +fn agent_ids_are_one_path_segment() { + assert_eq!(encode_segment("w1:p2"), "w1:p2"); + assert_eq!(encode_segment("a/b?c d"), "a%2Fb%3Fc%20d"); +} + +#[test] +fn watch_and_frames_match_the_envelope() { + assert_eq!( + Up::watch("w1:p2", 80, 24).to_json(), + r#"{"v":1,"pane":"w1:p2","type":"watch","cols":80,"rows":24}"# + ); + assert_eq!( + Up::unwatch("w1:p2").to_json(), + r#"{"v":1,"pane":"w1:p2","type":"unwatch"}"# + ); + assert_eq!( + Up::resync("w1:p2").to_json(), + r#"{"v":1,"pane":"w1:p2","type":"resync"}"# + ); + + let frame = r#"{"v":1,"pane":"w1:p2","type":"frame","full":true,"seq":7,"bytes":"G1sySg==","width":80,"height":24}"#; + assert_eq!( + Down::parse(frame), + Some(Down::Frame(Frame { + v: 1, + pane: "w1:p2".into(), + full: true, + seq: 7, + bytes: "G1sySg==".into(), + width: 80, + height: 24, + })) + ); + let scroll = r#"{"v":1,"pane":"w1:p2","type":"scrollback","text":"MARKER-B"}"#; + assert!( + matches!(Down::parse(scroll), Some(Down::Scrollback { text, .. }) if text == "MARKER-B") + ); + let refused = r#"{"v":1,"pane":"w1:p2","type":"refused","op":"input"}"#; + assert!(matches!(Down::parse(refused), Some(Down::Refused { op, .. }) if op == "input")); + assert_eq!( + Down::parse(r#"{"v":1,"pane":"x","type":"later"}"#), + Some(Down::Unknown) + ); + assert_eq!(Down::parse(&frame.replace(r#""v":1"#, r#""v":2"#)), None); + assert_eq!(Down::parse("not json"), None); +} + +#[test] +fn seq_tracking_counts_frames_and_spots_a_step_back() { + let mut track = SeqTrack::default(); + for seq in [3, 4, 9, 9, 10] { + track.observe(seq); + } + assert_eq!(track.frames, 5); + assert_eq!(track.out_of_order, 1); + assert_eq!(track.last(), Some(10)); +} diff --git a/app/src/net/types.rs b/app/src/net/types.rs new file mode 100644 index 0000000..2b60f14 --- /dev/null +++ b/app/src/net/types.rs @@ -0,0 +1,132 @@ +//! The bridge's JSON, as the app reads it. Field names follow the bridge on +//! `main` (`crates/pendant-herdr/src/snapshot.rs` and +//! `crates/pendant-bridge/src/routes.rs`). Unknown fields are ignored, so a +//! bridge that adds a field does not break an older app. + +use serde::Deserialize; +use serde_json::Value; + +/// `GET /v1/snapshot`. The bridge also sends `raw`, herdr's own reply, +/// which the app does not read. +#[derive(Debug, Clone, PartialEq, Deserialize)] +pub struct Snapshot { + pub agents: Vec, + #[serde(default)] + pub workspaces: Vec, +} + +impl Snapshot { + /// The agents whose status is `blocked`. + pub fn blocked(&self) -> impl Iterator { + self.agents.iter().filter(|agent| agent.is_blocked()) + } + + /// The agent the bridge would resolve for `id`: its public id, its + /// pane id or its name. + pub fn agent(&self, id: &str) -> Option<&Agent> { + self.agents.iter().find(|agent| { + agent.id == id || agent.pane_id == id || agent.name.as_deref() == Some(id) + }) + } +} + +/// One agent in a snapshot (`AgentRecord` on the bridge). +#[derive(Debug, Clone, PartialEq, Deserialize)] +pub struct Agent { + /// The public target: the agent's name if it has one, else its pane id. + pub id: String, + pub name: Option, + /// The harness, such as `claude`. + pub agent: Option, + /// herdr's status: `working`, `idle`, `blocked`, `done`, … + pub status: String, + pub pane_id: String, + pub workspace_id: String, + pub tab_id: Option, + pub title: Option, +} + +impl Agent { + pub fn is_blocked(&self) -> bool { + self.status == "blocked" + } + + /// What a list row shows: the title, else the name, else the id. + pub fn label(&self) -> &str { + self.title + .as_deref() + .or(self.name.as_deref()) + .filter(|label| !label.is_empty()) + .unwrap_or(&self.id) + } +} + +/// One workspace in a snapshot (`WorkspaceRecord` on the bridge). +#[derive(Debug, Clone, PartialEq, Deserialize)] +pub struct Workspace { + pub workspace_id: String, + pub label: Option, + pub cwd: Option, + pub worktree: Option, +} + +/// `GET /v1/agents/{id}`. +#[derive(Debug, Clone, PartialEq, Deserialize)] +pub struct AgentDetail { + pub id: String, + /// `null` when the snapshot no longer has the agent. + pub agent: Option, + /// herdr's `agent.get` reply, as is. + pub get: Option, + /// herdr's `agent.read` reply (the recent lines), as is. + pub output: Option, + #[serde(default)] + pub blocked: bool, +} + +impl AgentDetail { + /// The recent pane text in `output`, wherever herdr put it. + pub fn output_text(&self) -> Option<&str> { + let output = self.output.as_ref()?; + ["/read/text", "/text", "/result/read/text", "/result/text"] + .iter() + .find_map(|pointer| output.pointer(pointer).and_then(Value::as_str)) + } +} + +/// `GET /v1/events`. +#[derive(Debug, Clone, PartialEq, Deserialize)] +pub struct Inbox { + pub items: Vec, +} + +/// One inbox event: an agent that is `blocked` or `done`. +#[derive(Debug, Clone, PartialEq, Deserialize)] +pub struct InboxItem { + pub id: String, + pub agent: Option, + pub status: String, + pub workspace_id: String, + pub title: Option, + /// The event kind; today the same as `status`. + pub kind: String, +} + +impl InboxItem { + pub fn is_blocked(&self) -> bool { + self.kind == "blocked" || self.status == "blocked" + } +} + +/// The body of a refusal: `{"error": {"code", "message"}}`. +#[derive(Debug, Clone, PartialEq, Deserialize)] +pub struct ErrorBody { + pub error: ErrorDetail, +} + +#[derive(Debug, Clone, PartialEq, Deserialize)] +pub struct ErrorDetail { + pub code: String, + #[serde(default)] + pub message: String, +} diff --git a/app/src/net/ws.rs b/app/src/net/ws.rs new file mode 100644 index 0000000..ab792e2 --- /dev/null +++ b/app/src/net/ws.rs @@ -0,0 +1,135 @@ +//! The bridge's WebSocket envelope (`/v1/ws`, version 1), as in +//! `crates/pendant-bridge/src/session.rs`. The app sends [`Up`] messages and +//! reads [`Down`] ones. Writes (`input`, `resize`, `scroll`) stay refused by +//! the bridge, and the app never sends them. + +use serde::{Deserialize, Serialize}; + +/// The envelope version the bridge speaks. +pub const VERSION: u32 = 1; + +/// The bridge's ceiling on watched panes per socket. +pub const MAX_WATCHES: usize = 8; + +/// A message from the app to the bridge. +#[derive(Debug, Clone, PartialEq, Serialize)] +pub struct Up { + pub v: u32, + pub pane: String, + #[serde(rename = "type")] + pub kind: UpKind, + #[serde(skip_serializing_if = "Option::is_none")] + pub cols: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub rows: Option, +} + +#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize)] +#[serde(rename_all = "lowercase")] +pub enum UpKind { + Watch, + Unwatch, + Resync, +} + +impl Up { + /// Start frames for `pane`. The bridge first sends its scrollback. + pub fn watch(pane: impl Into, cols: u16, rows: u16) -> Self { + Self { + v: VERSION, + pane: pane.into(), + kind: UpKind::Watch, + cols: Some(cols), + rows: Some(rows), + } + } + + pub fn unwatch(pane: impl Into) -> Self { + Self::bare(pane, UpKind::Unwatch) + } + + /// Ask again for the last full frame of `pane`. + pub fn resync(pane: impl Into) -> Self { + Self::bare(pane, UpKind::Resync) + } + + fn bare(pane: impl Into, kind: UpKind) -> Self { + Self { + v: VERSION, + pane: pane.into(), + kind, + cols: None, + rows: None, + } + } + + pub fn to_json(&self) -> String { + serde_json::to_string(self).expect("an envelope always serializes") + } +} + +/// A message from the bridge. +#[derive(Debug, Clone, PartialEq, Deserialize)] +#[serde(tag = "type", rename_all = "lowercase")] +pub enum Down { + /// A terminal frame. `seq` rises per pane; `bytes` is base64 ANSI. + Frame(Frame), + /// The pane's recent text, sent once on `watch`. + Scrollback { v: u32, pane: String, text: String }, + /// The bridge refused `op` for `pane`. + Refused { v: u32, pane: String, op: String }, + /// A type this app does not know yet. + #[serde(other)] + Unknown, +} + +#[derive(Debug, Clone, PartialEq, Eq, Deserialize)] +pub struct Frame { + pub v: u32, + pub pane: String, + pub full: bool, + pub seq: u64, + pub bytes: String, + pub width: u32, + pub height: u32, +} + +impl Down { + /// Parses one text message. `None` for a message that is not JSON or + /// carries another envelope version. + pub fn parse(text: &str) -> Option { + let down: Self = serde_json::from_str(text).ok()?; + match &down { + Self::Frame(Frame { v, .. }) | Self::Scrollback { v, .. } | Self::Refused { v, .. } + if *v != VERSION => + { + None + } + _ => Some(down), + } + } +} + +/// Tracks `seq` per pane, to show that frames keep coming and to spot a gap. +#[derive(Debug, Default, Clone, PartialEq, Eq)] +pub struct SeqTrack { + last: Option, + /// Frames seen. + pub frames: u64, + /// Frames whose `seq` was not above the one before. + pub out_of_order: u64, +} + +impl SeqTrack { + pub fn observe(&mut self, seq: u64) { + if self.last.is_some_and(|last| seq <= last) { + self.out_of_order += 1; + } + self.last = Some(self.last.map_or(seq, |last| last.max(seq))); + self.frames += 1; + } + + pub fn last(&self) -> Option { + self.last + } +} diff --git a/app/src/theme.rs b/app/src/theme.rs new file mode 100644 index 0000000..c9dc524 --- /dev/null +++ b/app/src/theme.rs @@ -0,0 +1,9 @@ +//! Pendant's colours. Frontend owns this file; the three brand colours from +//! SPEC-shell are here so the screens can start on them. + +/// Graphite, the background. +pub const GRAPHITE: u32 = 0x111513; +/// Teal, the accent. +pub const TEAL: u32 = 0x0F5C56; +/// Gold, for what needs the user: a blocked agent. +pub const GOLD: u32 = 0xC9A227; From 58b46882d6566700f03bf0dad73bb803d62aa106 Mon Sep 17 00:00:00 2001 From: VirtualMachinist Date: Sat, 14 Nov 2026 10:20:32 -0500 Subject: [PATCH 04/16] scripts/scratch: refuse session names outside the scratch prefixes Both scripts now resolve the name through lib.sh, which refuses an empty name and anything not starting with pendant-scratch or pendant-shell, prints the refusal and exits 1 before any herdr call. teardown stops and deletes sessions, so a typo must not be able to reach a live one. --- scripts/scratch/README.md | 6 ++++++ scripts/scratch/lib.sh | 25 +++++++++++++++++++++++++ scripts/scratch/seed.sh | 4 +++- scripts/scratch/teardown.sh | 4 +++- 4 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 scripts/scratch/lib.sh diff --git a/scripts/scratch/README.md b/scripts/scratch/README.md index a0aa0a7..45c106b 100644 --- a/scripts/scratch/README.md +++ b/scripts/scratch/README.md @@ -13,6 +13,12 @@ The session lives at `~/.config/herdr/sessions//herdr.sock`. `seed.sh` prints the socket path and the agent summary, and refuses to seed a session that is already running. +Both scripts take the name from the first argument, else +`PENDANT_SCRATCH_SESSION`, else `pendant-shell-g1`, and then refuse anything +that does not start with `pendant-scratch` or `pendant-shell`, plus an empty +name (`lib.sh`). They stop and delete sessions, so a typo must never reach a +live one. + What it creates: - one workspace labelled `pendant-scratch`, four panes in a 2x2 split; diff --git a/scripts/scratch/lib.sh b/scripts/scratch/lib.sh new file mode 100644 index 0000000..da8af66 --- /dev/null +++ b/scripts/scratch/lib.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +# Shared guard for the scratch-session scripts. Sourced, not executed. +# +# Prints the session name to use, so a caller can capture it: +# SESSION="$(scratch_session_name "$@")" || exit 1 +# +# The name must start with `pendant-scratch` or `pendant-shell`. Anything else, +# including an empty name, is refused: these scripts stop and delete sessions, +# so they must never be able to reach a live one. +scratch_session_name() { + local name="${1-${PENDANT_SCRATCH_SESSION-pendant-shell-g1}}" + case "$name" in + "") + printf 'refusing an empty session name\n' >&2 + return 1 + ;; + pendant-scratch* | pendant-shell*) + printf '%s\n' "$name" + ;; + *) + printf 'refusing session name outside pendant-scratch*/pendant-shell*: %s\n' "$name" >&2 + return 1 + ;; + esac +} diff --git a/scripts/scratch/seed.sh b/scripts/scratch/seed.sh index 5278f08..71f730d 100755 --- a/scripts/scratch/seed.sh +++ b/scripts/scratch/seed.sh @@ -10,7 +10,9 @@ # Tear down with scripts/scratch/teardown.sh [session-name]. set -euo pipefail -SESSION="${1:-${PENDANT_SCRATCH_SESSION:-pendant-shell-g1}}" +# shellcheck source=lib.sh +source "$(dirname "${BASH_SOURCE[0]}")/lib.sh" +SESSION="$(scratch_session_name "$@")" || exit 1 LABEL="${PENDANT_SCRATCH_LABEL:-pendant-scratch}" HERDR="${HERDR_BIN:-$(command -v herdr)}" BLOCKED_INDEX=2 diff --git a/scripts/scratch/teardown.sh b/scripts/scratch/teardown.sh index 773a202..6b2fee6 100755 --- a/scripts/scratch/teardown.sh +++ b/scripts/scratch/teardown.sh @@ -4,7 +4,9 @@ # Usage: scripts/scratch/teardown.sh [session-name] set -euo pipefail -SESSION="${1:-${PENDANT_SCRATCH_SESSION:-pendant-shell-g1}}" +# shellcheck source=lib.sh +source "$(dirname "${BASH_SOURCE[0]}")/lib.sh" +SESSION="$(scratch_session_name "$@")" || exit 1 HERDR="${HERDR_BIN:-$(command -v herdr)}" if "$HERDR" --session "$SESSION" api snapshot >/dev/null 2>&1; then From ba0336d92c5a31f1624bb23c0834dc1f6ec9f97a Mon Sep 17 00:00:00 2001 From: VirtualMachinist Date: Sat, 14 Nov 2026 10:28:38 -0500 Subject: [PATCH 05/16] app: live bridge link with a WebSocket worker; deny allowances for nsh net/live.rs keeps one shared live state for the screens, started by the root and read with net::live::live(): - link: Connecting, Open, Closed(why) or Unconfigured(why) - snapshot and inbox, fetched with nsh's fetch every 3 s; error holds the last HTTP failure - panes: per watched pane, the frames seen, the highest seq and any that did not rise, full frames, the last frame, the scrollback and the last refused operation; watch(pane) and unwatch(pane) drive it nsh 0.5.0 exposes its WebSocket to TSX only, so one worker thread holds wss:///v1/ws with blocking tungstenite 0.28 (the line nsh-core already uses) over rustls with ring and the webpki roots. It sends the Serve origin the bridge requires, re-sends watches after a reconnect, backs off up to 30 s, and hands messages to the engine thread through a channel drained every 100 ms. Frames are logged with their seq. deny.toml allows ISC and CDLA-Permissive-2.0 (ring, untrusted, rustls-webpki, webpki-roots) and ignores two unmaintained notices that come only through nsh 0.5.0: RUSTSEC-2025-0141 (bincode 1.3.3) and RUSTSEC-2026-0192 (ttf-parser), to be reviewed at the next nsh upgrade. Co-Authored-By: Claude Opus 5.5 --- app/Cargo.lock | 5 + app/Cargo.toml | 8 + app/src/lib.rs | 3 + app/src/net/live.rs | 524 +++++++++++++++++++++++++++++++++++++++++++ app/src/net/mod.rs | 18 +- app/src/net/tests.rs | 4 +- deny.toml | 7 + 7 files changed, 566 insertions(+), 3 deletions(-) create mode 100644 app/src/net/live.rs diff --git a/app/Cargo.lock b/app/Cargo.lock index a9cc38e..6ba377e 100644 --- a/app/Cargo.lock +++ b/app/Cargo.lock @@ -1434,12 +1434,16 @@ version = "0.0.1" dependencies = [ "lapis-lattice", "lapis-notes", + "log", "nsh-base", "nsh-core", "objc2-foundation", "rusqlite", + "rustls", "serde", "serde_json", + "tungstenite", + "webpki-roots 0.26.11", ] [[package]] @@ -2399,6 +2403,7 @@ dependencies = [ "sha1", "thiserror", "utf-8", + "webpki-roots 0.26.11", ] [[package]] diff --git a/app/Cargo.toml b/app/Cargo.toml index 5cb88e9..b36753c 100644 --- a/app/Cargo.toml +++ b/app/Cargo.toml @@ -18,6 +18,14 @@ nsh-core = "=0.5.0" nsh-base = "=0.5.0" serde = { version = "1", features = ["derive"] } serde_json = "1" +# The live WebSocket. nsh 0.5.0's own WebSocket is reachable from TSX only, +# so the app runs blocking tungstenite on one worker thread (no tokio), on +# the same 0.28 line nsh-core already uses, over rustls with ring and the +# webpki roots (the versions nsh-core's tree already carries). +tungstenite = { version = "0.28", default-features = false, features = ["handshake", "rustls-tls-webpki-roots"] } +rustls = { version = "0.23", default-features = false, features = ["std", "ring", "tls12"] } +webpki-roots = "0.26" +log = "0.4" # The notes store is host-only until D1: the phone app has no Lapis link # (SPEC-shell). CI still builds and tests it on the host. diff --git a/app/src/lib.rs b/app/src/lib.rs index 6747a12..fcfd7e1 100644 --- a/app/src/lib.rs +++ b/app/src/lib.rs @@ -93,6 +93,9 @@ pub fn bridge() -> Result { /// The root component. #[component] pub fn App() -> impl IntoElement { + // The live link: snapshot and inbox polling, and the WebSocket worker. + // Screens read it with `net::live::live()`. + net::live::start(); let routes = signal(vec![Route::Agents]); let nav = Nav { routes }; nav_stack().flex_1().child(each( diff --git a/app/src/net/live.rs b/app/src/net/live.rs new file mode 100644 index 0000000..2859445 --- /dev/null +++ b/app/src/net/live.rs @@ -0,0 +1,524 @@ +//! The live link to the bridge, shared by every screen. +//! +//! - One worker thread holds the WebSocket (`wss:///v1/ws`) with +//! blocking tungstenite over rustls, and hands what arrives to the engine +//! thread through a channel. nsh 0.5.0's own WebSocket is reachable from +//! TSX only; this path needs no async runtime. +//! - The engine thread drains that channel on a short interval into +//! [`Live`]'s signals, and polls `/v1/snapshot` and `/v1/events` with +//! nsh's `fetch` every [`POLL`]. +//! +//! Screens read [`live()`]: `link`, `snapshot`, `inbox`, `error` and +//! `panes`, and call `watch` / `unwatch` for the panes they show. + +use std::cell::RefCell; +use std::collections::{BTreeMap, BTreeSet}; +use std::io::ErrorKind; +use std::net::{TcpStream, ToSocketAddrs}; +use std::sync::mpsc::{self, Receiver, Sender, TryRecvError}; +use std::sync::Arc; +use std::time::{Duration, Instant}; + +use nsh_core::prelude::*; +use tungstenite::client::IntoClientRequest; +use tungstenite::http::HeaderValue; +use tungstenite::stream::MaybeTlsStream; +use tungstenite::{Connector, Message, WebSocket}; + +use super::ws::{Down, Frame, SeqTrack, Up}; +use super::{Bridge, InboxItem, Snapshot}; + +/// How often the snapshot and the inbox are fetched again. +pub const POLL: Duration = Duration::from_secs(3); +/// How often the engine thread takes what the worker received. +const DRAIN: Duration = Duration::from_millis(100); +/// How long one socket read waits before the worker looks at its commands. +const READ_TICK: Duration = Duration::from_millis(200); +const CONNECT_TIMEOUT: Duration = Duration::from_secs(10); +const BACKOFF_MAX: Duration = Duration::from_secs(30); +/// The terminal size asked for when a screen watches a pane. +const COLS: u16 = 80; +const ROWS: u16 = 24; + +/// The WebSocket's state. +#[derive(Debug, Clone, PartialEq, Eq)] +pub enum Link { + /// This build has no usable bridge address. + Unconfigured(String), + Connecting, + Open, + /// Lost or refused; the worker tries again with a growing pause. + Closed(String), +} + +/// What one watched pane has received. +#[derive(Debug, Clone, Default, PartialEq)] +pub struct PaneFeed { + /// Frames seen, the highest `seq`, and any that did not rise. + pub seq: SeqTrack, + /// How many of the frames were full ones. + pub full_frames: u64, + /// The last frame (base64 ANSI in `bytes`), for the terminal pack. + pub last: Option, + /// The pane's recent text, sent once when it is watched. + pub scrollback: Option, + /// The last operation the bridge refused for this pane. + pub refused: Option, +} + +/// The shared live state. Copy it freely; it is a handle to signals. +#[derive(Clone, Copy)] +pub struct Live { + pub link: Signal, + /// The last snapshot fetched; `None` until the first one arrives. + pub snapshot: Signal>, + /// The inbox (`/v1/events`): agents that are blocked or done. + pub inbox: Signal>, + /// The last HTTP failure, cleared by the next success. + pub error: Signal>, + /// Watched panes by pane id. + pub panes: Signal>, +} + +enum Cmd { + Watch { pane: String, cols: u16, rows: u16 }, + Unwatch(String), +} + +enum Event { + Link(Link), + Down(Down), +} + +thread_local! { + /// The worker's command channel, owned by the engine thread. + static COMMANDS: RefCell>> = const { RefCell::new(None) }; +} + +impl Live { + /// Start frames for `pane` (the agent's `pane_id`). + pub fn watch(&self, pane: &str) { + command(Cmd::Watch { + pane: pane.to_owned(), + cols: COLS, + rows: ROWS, + }); + } + + /// Stop frames for `pane` and forget what it received. + pub fn unwatch(&self, pane: &str) { + command(Cmd::Unwatch(pane.to_owned())); + self.panes.update(|panes| { + panes.remove(pane); + }); + } + + /// Blocked items in the inbox. + pub fn blocked(&self) -> usize { + self.inbox + .with(|items| items.iter().filter(|item| item.is_blocked()).count()) + } +} + +fn command(cmd: Cmd) { + COMMANDS.with(|commands| { + if let Some(tx) = commands.borrow().as_ref() { + let _ = tx.send(cmd); + } + }); +} + +/// The live state the root provided. +/// +/// # Panics +/// Outside the app's root, where [`start`] has not run. +pub fn live() -> Live { + use_context::().expect("net::live::start runs in the app's root") +} + +/// Starts the link and provides [`Live`] to everything the current owner +/// makes. The root calls it once; the worker and the polling stop with it. +pub fn start() -> Live { + let live = Live { + link: signal(Link::Connecting), + snapshot: signal(None), + inbox: signal(Vec::new()), + error: signal(None), + panes: signal(BTreeMap::new()), + }; + provide_context(live); + let bridge = match crate::bridge() { + Ok(bridge) => bridge, + Err(err) => { + live.link.set(Link::Unconfigured(err.to_string())); + return live; + } + }; + + let (cmd_tx, cmd_rx) = mpsc::channel(); + let (event_tx, event_rx) = mpsc::channel(); + let worker_bridge = bridge.clone(); + let spawned = std::thread::Builder::new() + .name("pendant-ws".into()) + .spawn(move || worker(worker_bridge, cmd_rx, event_tx)); + if let Err(err) = spawned { + live.link + .set(Link::Closed(format!("no worker thread: {err}"))); + } + COMMANDS.with(|commands| *commands.borrow_mut() = Some(cmd_tx)); + + let drain = set_interval(DRAIN, move || drain(&event_rx, live)); + let poll = spawn(async move { + loop { + refresh(&bridge, live).await; + timer(POLL).await; + } + }); + // Dropping a task cancels it, so the owner keeps both until it goes; + // dropping the sender then ends the worker. + cleanup(move || { + drop(drain); + drop(poll); + COMMANDS.with(|commands| commands.borrow_mut().take()); + }); + live +} + +async fn refresh(bridge: &Bridge, live: Live) { + let snapshot = bridge.snapshot().await; + let inbox = bridge.inbox().await; + let mut failure = None; + match snapshot { + Ok(snapshot) => live.snapshot.set(Some(snapshot)), + Err(err) => failure = Some(err.to_string()), + } + match inbox { + Ok(inbox) => live.inbox.set(inbox.items), + Err(err) => failure = failure.or(Some(err.to_string())), + } + live.error.set(failure); +} + +fn drain(events: &Receiver, live: Live) { + let mut downs = Vec::new(); + while let Ok(event) = events.try_recv() { + match event { + Event::Link(link) => live.link.set(link), + Event::Down(down) => downs.push(down), + } + } + if !downs.is_empty() { + live.panes.update(|panes| { + for down in downs { + apply(panes, down); + } + }); + } +} + +/// Folds one message into the panes' state. +pub fn apply(panes: &mut BTreeMap, down: Down) { + match down { + Down::Frame(frame) => { + let feed = panes.entry(frame.pane.clone()).or_default(); + feed.seq.observe(frame.seq); + if frame.full { + feed.full_frames += 1; + } + trace(&format!( + "frame pane={} seq={} full={} frames={}", + frame.pane, frame.seq, frame.full, feed.seq.frames + )); + feed.last = Some(frame); + } + Down::Scrollback { pane, text, .. } => { + panes.entry(pane).or_default().scrollback = Some(text); + } + Down::Refused { pane, op, .. } => { + panes.entry(pane).or_default().refused = Some(op); + } + Down::Unknown => {} + } +} + +/// One line to the platform log (logcat on Android) and, on iOS, to the +/// app's stderr, which `simctl launch --console` shows. +fn trace(line: &str) { + log::info!(target: "pendant", "{line}"); + #[cfg(target_os = "ios")] + eprintln!("pendant: {line}"); +} + +// The worker thread. + +enum End { + /// The engine side went away. + Stop, + /// The socket ended or failed; try again. + Lost(String), +} + +fn worker(bridge: Bridge, cmds: Receiver, events: Sender) { + let tls = tls_config(); + let mut watched: BTreeMap = BTreeMap::new(); + let mut backoff = Duration::from_secs(1); + loop { + if events.send(Event::Link(Link::Connecting)).is_err() || !absorb(&cmds, &mut watched) { + return; + } + let lost = match connect(&bridge, tls.clone()) { + Ok(mut socket) => { + backoff = Duration::from_secs(1); + trace(&format!("open {}", bridge.ws_url())); + if events.send(Event::Link(Link::Open)).is_err() { + return; + } + match session(&mut socket, &cmds, &events, &mut watched) { + End::Stop => { + let _ = socket.close(None); + let _ = socket.flush(); + return; + } + End::Lost(why) => why, + } + } + Err(why) => why, + }; + trace(&format!("closed: {lost}")); + if events.send(Event::Link(Link::Closed(lost))).is_err() { + return; + } + let until = Instant::now() + backoff; + while Instant::now() < until { + std::thread::sleep(READ_TICK); + if !absorb(&cmds, &mut watched) { + return; + } + } + backoff = (backoff * 2).min(BACKOFF_MAX); + } +} + +/// Takes queued commands while the socket is down. `false` once the engine +/// side has gone. +fn absorb(cmds: &Receiver, watched: &mut BTreeMap) -> bool { + loop { + match cmds.try_recv() { + Ok(Cmd::Watch { pane, cols, rows }) => { + watched.insert(pane, (cols, rows)); + } + Ok(Cmd::Unwatch(pane)) => { + watched.remove(&pane); + } + Err(TryRecvError::Empty) => return true, + Err(TryRecvError::Disconnected) => return false, + } + } +} + +type Socket = WebSocket>; + +fn session( + socket: &mut Socket, + cmds: &Receiver, + events: &Sender, + watched: &mut BTreeMap, +) -> End { + // Watches made before this socket opened (or before a reconnect). + let panes: BTreeSet<_> = watched.keys().cloned().collect(); + for pane in panes { + let (cols, rows) = watched[&pane]; + if let Err(why) = send(socket, &Up::watch(pane, cols, rows)) { + return End::Lost(why); + } + } + loop { + loop { + let up = match cmds.try_recv() { + Ok(Cmd::Watch { pane, cols, rows }) => { + watched.insert(pane.clone(), (cols, rows)); + Up::watch(pane, cols, rows) + } + Ok(Cmd::Unwatch(pane)) => { + watched.remove(&pane); + Up::unwatch(pane) + } + Err(TryRecvError::Empty) => break, + Err(TryRecvError::Disconnected) => return End::Stop, + }; + if let Err(why) = send(socket, &up) { + return End::Lost(why); + } + } + match socket.read() { + Ok(Message::Text(text)) => { + if let Some(down) = Down::parse(text.as_str()) { + if events.send(Event::Down(down)).is_err() { + return End::Stop; + } + } + } + Ok(Message::Close(_)) => return End::Lost("the bridge closed the socket".into()), + Ok(_) => {} + Err(tungstenite::Error::Io(err)) if is_tick(&err) => { + // Read timeout: a chance to send pongs and take commands. + match socket.flush() { + Ok(()) => {} + Err(tungstenite::Error::Io(err)) if is_tick(&err) => {} + Err(err) => return End::Lost(err.to_string()), + } + } + Err(err) => return End::Lost(err.to_string()), + } + } +} + +fn is_tick(err: &std::io::Error) -> bool { + matches!(err.kind(), ErrorKind::WouldBlock | ErrorKind::TimedOut) +} + +fn send(socket: &mut Socket, up: &Up) -> Result<(), String> { + socket + .send(Message::text(up.to_json())) + .map_err(|err| err.to_string()) +} + +fn connect(bridge: &Bridge, tls: Arc) -> Result { + let (host, port) = bridge.host_port(); + let addrs = (host, port) + .to_socket_addrs() + .map_err(|err| format!("cannot resolve the bridge: {err}"))?; + let mut last = String::from("no address for the bridge"); + let mut tcp = None; + for addr in addrs { + match TcpStream::connect_timeout(&addr, CONNECT_TIMEOUT) { + Ok(stream) => { + tcp = Some(stream); + break; + } + Err(err) => last = format!("cannot connect: {err}"), + } + } + let tcp = tcp.ok_or(last)?; + let setup = |tcp: &TcpStream| -> std::io::Result { + tcp.set_nodelay(true)?; + tcp.set_read_timeout(Some(CONNECT_TIMEOUT))?; + tcp.set_write_timeout(Some(CONNECT_TIMEOUT))?; + tcp.try_clone() + }; + let handle = setup(&tcp).map_err(|err| format!("socket setup: {err}"))?; + + let mut request = bridge + .ws_url() + .into_client_request() + .map_err(|err| format!("bad request: {err}"))?; + // The bridge accepts an upgrade only from its own Serve origin. + let origin = HeaderValue::from_str(bridge.origin()).map_err(|err| err.to_string())?; + request.headers_mut().insert("Origin", origin); + + let (socket, _response) = + tungstenite::client_tls_with_config(request, tcp, None, Some(Connector::Rustls(tls))) + .map_err(|err| format!("handshake: {err}"))?; + // From here a read waits at most one tick, so commands are not stuck + // behind a quiet socket. + handle + .set_read_timeout(Some(READ_TICK)) + .map_err(|err| format!("socket setup: {err}"))?; + Ok(socket) +} + +/// rustls with ring and the webpki roots: no platform TLS, no async runtime. +fn tls_config() -> Arc { + let mut roots = rustls::RootCertStore::empty(); + roots.extend(webpki_roots::TLS_SERVER_ROOTS.iter().cloned()); + let config = rustls::ClientConfig::builder_with_provider(Arc::new( + rustls::crypto::ring::default_provider(), + )) + .with_safe_default_protocol_versions() + .expect("ring supports the default TLS versions") + .with_root_certificates(roots) + .with_no_client_auth(); + Arc::new(config) +} + +#[cfg(test)] +mod tests { + use super::*; + + fn frame(pane: &str, seq: u64, full: bool) -> Down { + Down::Frame(Frame { + v: 1, + pane: pane.into(), + full, + seq, + bytes: String::new(), + width: 80, + height: 24, + }) + } + + #[test] + fn frames_fold_into_their_pane() { + let mut panes = BTreeMap::new(); + for down in [ + Down::Scrollback { + v: 1, + pane: "w1:p2".into(), + text: "MARKER-B".into(), + }, + frame("w1:p2", 1, true), + frame("w1:p2", 2, false), + frame("w1:p3", 5, true), + frame("w1:p2", 2, false), + Down::Refused { + v: 1, + pane: "w1:p2".into(), + op: "input".into(), + }, + Down::Unknown, + ] { + apply(&mut panes, down); + } + let p2 = &panes["w1:p2"]; + assert_eq!(p2.seq.frames, 3); + assert_eq!(p2.seq.last(), Some(2)); + assert_eq!(p2.seq.out_of_order, 1); + assert_eq!(p2.full_frames, 1); + assert_eq!(p2.scrollback.as_deref(), Some("MARKER-B")); + assert_eq!(p2.refused.as_deref(), Some("input")); + assert_eq!(panes["w1:p3"].seq.last(), Some(5)); + assert_eq!(panes.len(), 2); + } + + #[test] + fn queued_commands_survive_until_the_socket_opens() { + let (tx, rx) = mpsc::channel(); + let mut watched = BTreeMap::new(); + tx.send(Cmd::Watch { + pane: "w1:p1".into(), + cols: 80, + rows: 24, + }) + .unwrap(); + tx.send(Cmd::Watch { + pane: "w1:p2".into(), + cols: 100, + rows: 30, + }) + .unwrap(); + tx.send(Cmd::Unwatch("w1:p1".into())).unwrap(); + assert!(absorb(&rx, &mut watched)); + assert_eq!( + watched.into_iter().collect::>(), + [("w1:p2".to_owned(), (100, 30))] + ); + drop(tx); + assert!(!absorb(&rx, &mut BTreeMap::new())); + } + + #[test] + fn the_tls_config_builds_with_roots() { + let config = tls_config(); + assert!(!config.alpn_protocols.iter().any(|p| p == b"h2")); + } +} diff --git a/app/src/net/mod.rs b/app/src/net/mod.rs index 0ed6b88..766d3fc 100644 --- a/app/src/net/mod.rs +++ b/app/src/net/mod.rs @@ -1,11 +1,12 @@ //! The app's line to the bridge: HTTP through nsh's `fetch` (the platform's //! own stack: NSURLSession on iOS, HttpURLConnection on Android) and the -//! WebSocket envelope in [`ws`]. No tokio or reqwest in the app. +//! WebSocket in [`live`] (no async runtime of its own). //! //! The bridge's address is not in the source. It comes from //! `PENDANT_BRIDGE_URL` when the app is built, for example //! `PENDANT_BRIDGE_URL=https://bridge.example.ts.net:8443 nsh package …`. +pub mod live; pub mod types; pub mod ws; @@ -84,7 +85,20 @@ impl Bridge { /// `wss://host[:port]/v1/ws`. pub fn ws_url(&self) -> String { - format!("wss://{}/v1/ws", &self.origin["https://".len()..]) + format!("wss://{}/v1/ws", self.authority()) + } + + /// The host and port to dial (443 when the origin names none). + pub fn host_port(&self) -> (&str, u16) { + let authority = self.authority(); + match authority.rsplit_once(':') { + Some((host, port)) => (host, port.parse().unwrap_or(443)), + None => (authority, 443), + } + } + + fn authority(&self) -> &str { + &self.origin["https://".len()..] } fn url(&self, path: &str) -> String { diff --git a/app/src/net/tests.rs b/app/src/net/tests.rs index d33e7af..0656020 100644 --- a/app/src/net/tests.rs +++ b/app/src/net/tests.rs @@ -93,7 +93,9 @@ fn the_bridge_address_is_an_https_origin() { bridge.url("/v1/snapshot"), "https://bridge.example.ts.net:8443/v1/snapshot" ); - assert!(Bridge::parse("https://bridge.example.ts.net").is_ok()); + assert_eq!(bridge.host_port(), ("bridge.example.ts.net", 8443)); + let plain = Bridge::parse("https://bridge.example.ts.net").unwrap(); + assert_eq!(plain.host_port(), ("bridge.example.ts.net", 443)); for bad in [ "http://bridge.example.ts.net:8443", diff --git a/deny.toml b/deny.toml index 79d20d4..c3d7053 100644 --- a/deny.toml +++ b/deny.toml @@ -2,6 +2,11 @@ [advisories] yanked = "deny" +# Only unmaintained notices are ignored here, never a vulnerability. +ignore = [ + { id = "RUSTSEC-2025-0141", reason = "bincode 1.3.3 is unmaintained; transitive via nsh 0.5.0 (nsh-base highlight, syntect). Review at the next nsh upgrade." }, + { id = "RUSTSEC-2026-0192", reason = "ttf-parser is unmaintained; transitive via nsh 0.5.0 (nsh-core). Review at the next nsh upgrade." }, +] [licenses] allow = [ @@ -9,6 +14,8 @@ allow = [ "Apache-2.0", "Apache-2.0 WITH LLVM-exception", "BSD-3-Clause", + "ISC", + "CDLA-Permissive-2.0", "Unicode-3.0", "Zlib", ] From 7420d497e09e67793e7d55971e255ffe358603af Mon Sep 17 00:00:00 2001 From: VirtualMachinist Date: Sat, 14 Nov 2026 10:31:08 -0500 Subject: [PATCH 06/16] scripts/scratch: tick one pane so herdr emits frames herdr only emits frames when pane output changes, so the seeded session was static after the first full frame. Pane 1 now prints PENDANT-SCRATCH-TICK- every 2 s inside its reporter loop, after the marker line, so the marker stays in scrollback and frames keep rising. Made-up content only; pane 2 stays the blocked one. --- scripts/scratch/seed.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/scripts/scratch/seed.sh b/scripts/scratch/seed.sh index 71f730d..16b94f6 100755 --- a/scripts/scratch/seed.sh +++ b/scripts/scratch/seed.sh @@ -15,6 +15,7 @@ source "$(dirname "${BASH_SOURCE[0]}")/lib.sh" SESSION="$(scratch_session_name "$@")" || exit 1 LABEL="${PENDANT_SCRATCH_LABEL:-pendant-scratch}" HERDR="${HERDR_BIN:-$(command -v herdr)}" +TICKER_INDEX=1 BLOCKED_INDEX=2 REFRESH_SECONDS=2 SOURCE="custom:pendant-scratch" @@ -57,9 +58,13 @@ for index in "${!panes[@]}"; do state=idle [ "$number" -eq "$BLOCKED_INDEX" ] && state=blocked h pane run "$pane" "echo PENDANT-SCRATCH-MARKER-$number" >/dev/null - h pane run "$pane" \ - "while :; do '$HERDR' --session '$SESSION' pane report-agent '$pane' --source '$SOURCE' --agent 'scratch-$number' --state '$state' >/dev/null 2>&1; sleep $REFRESH_SECONDS; done" \ - >/dev/null + loop="while :; do '$HERDR' --session '$SESSION' pane report-agent '$pane' --source '$SOURCE' --agent 'scratch-$number' --state '$state' >/dev/null 2>&1; " + if [ "$number" -eq "$TICKER_INDEX" ]; then + # One pane keeps writing so herdr emits frames; the marker stays in scrollback. + loop+='tick=$((tick+1)); printf "PENDANT-SCRATCH-TICK-%s\n" "$tick"; ' + fi + loop+="sleep $REFRESH_SECONDS; done" + h pane run "$pane" "$loop" >/dev/null done for _ in $(seq 1 100); do From 827be8bef63c74fca7079d0a0b330993d9e297c6 Mon Sep 17 00:00:00 2001 From: VirtualMachinist Date: Sat, 14 Nov 2026 10:32:08 -0500 Subject: [PATCH 07/16] scripts/scratch: note the pane-1 ticker in the README --- scripts/scratch/README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/scratch/README.md b/scripts/scratch/README.md index 45c106b..b633f21 100644 --- a/scripts/scratch/README.md +++ b/scripts/scratch/README.md @@ -23,7 +23,9 @@ What it creates: - one workspace labelled `pendant-scratch`, four panes in a 2x2 split; - a marker line `PENDANT-SCRATCH-MARKER-` in each pane; -- four reported agents `scratch-1` … `scratch-4`, with `scratch-2` blocked. +- four reported agents `scratch-1` … `scratch-4`, with `scratch-2` blocked; +- a `PENDANT-SCRATCH-TICK-` line in pane 1 every couple of seconds, so + herdr keeps emitting frames for the WebSocket link. Each pane runs a reporter loop that re-reports its lifecycle state every couple of seconds. The state is transient by design: without the loop herdr From 5afd865b5ff5b4583b866f9f9abdd56fa1870b86 Mon Sep 17 00:00:00 2001 From: VirtualMachinist Date: Sat, 14 Nov 2026 10:33:01 -0500 Subject: [PATCH 08/16] app: an ignored smoke test of the WebSocket worker against a bridge live_socket_sees_rising_frames drives the worker against a running bridge named by PENDANT_BRIDGE_URL at run time, watches one pane (PENDANT_WATCH_PANE) and passes when the link opens and the pane's frames arrive with a rising seq. It is ignored by default, so CI and plain test runs never dial out. Co-Authored-By: Claude Opus 5.5 --- app/src/net/live.rs | 57 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/app/src/net/live.rs b/app/src/net/live.rs index 2859445..2c6d56e 100644 --- a/app/src/net/live.rs +++ b/app/src/net/live.rs @@ -516,6 +516,63 @@ mod tests { assert!(!absorb(&rx, &mut BTreeMap::new())); } + /// Drives the worker against a running bridge: + /// `PENDANT_BRIDGE_URL=https://… PENDANT_WATCH_PANE=w1:p1 cargo test + /// --manifest-path app/Cargo.toml -- --ignored --nocapture live_socket`. + #[test] + #[ignore = "needs a running bridge (PENDANT_BRIDGE_URL at run time)"] + fn live_socket_sees_rising_frames() { + let url = std::env::var("PENDANT_BRIDGE_URL").expect("PENDANT_BRIDGE_URL"); + let pane = std::env::var("PENDANT_WATCH_PANE").unwrap_or_else(|_| "w1:p1".into()); + let want: u64 = std::env::var("PENDANT_WANT_FRAMES") + .ok() + .and_then(|n| n.parse().ok()) + .unwrap_or(3); + let bridge = Bridge::parse(&url).expect("an https origin"); + let (cmd_tx, cmd_rx) = mpsc::channel(); + let (event_tx, event_rx) = mpsc::channel(); + let worker = std::thread::spawn(move || worker(bridge, cmd_rx, event_tx)); + cmd_tx + .send(Cmd::Watch { + pane: pane.clone(), + cols: COLS, + rows: ROWS, + }) + .unwrap(); + + let mut panes = BTreeMap::new(); + let mut links = Vec::new(); + let deadline = Instant::now() + Duration::from_secs(30); + while Instant::now() < deadline { + match event_rx.recv_timeout(Duration::from_millis(500)) { + Ok(Event::Link(link)) => links.push(link), + Ok(Event::Down(down)) => apply(&mut panes, down), + Err(_) => {} + } + if panes.get(&pane).is_some_and(|feed| feed.seq.frames >= want) { + break; + } + } + drop(cmd_tx); + worker.join().unwrap(); + + let feed = panes.get(&pane).cloned().unwrap_or_default(); + println!( + "links={links:?} pane={pane} frames={} last_seq={:?} out_of_order={} full={} scrollback_chars={}", + feed.seq.frames, + feed.seq.last(), + feed.seq.out_of_order, + feed.full_frames, + feed.scrollback.as_deref().map_or(0, str::len), + ); + assert!( + links.contains(&Link::Open), + "the socket never opened: {links:?}" + ); + assert!(feed.seq.frames >= want, "too few frames"); + assert_eq!(feed.seq.out_of_order, 0, "seq did not rise"); + } + #[test] fn the_tls_config_builds_with_roots() { let config = tls_config(); From a17b0cfba102b068f85bd499c513be8e869f6ba4 Mon Sep 17 00:00:00 2001 From: frontend Date: Sat, 14 Nov 2026 10:29:16 -0500 Subject: [PATCH 09/16] app: agent list, detail and inbox screens on the shell theme --- app/src/agents/detail.rs | 151 +++++++++++++++++++++++++++++++++++++++ app/src/agents/inbox.rs | 116 ++++++++++++++++++++++++++++++ app/src/agents/list.rs | 137 +++++++++++++++++++++++++++++++++++ app/src/agents/mod.rs | 129 +++++++++++++++++++++++++++------ app/src/agents/tests.rs | 30 ++++++++ app/src/theme.rs | 44 +++++++++++- 6 files changed, 582 insertions(+), 25 deletions(-) create mode 100644 app/src/agents/detail.rs create mode 100644 app/src/agents/inbox.rs create mode 100644 app/src/agents/list.rs create mode 100644 app/src/agents/tests.rs diff --git a/app/src/agents/detail.rs b/app/src/agents/detail.rs new file mode 100644 index 0000000..f16c046 --- /dev/null +++ b/app/src/agents/detail.rs @@ -0,0 +1,151 @@ +//! One agent: its status, and herdr's recent output for it. + +use nsh_base::nav_page; +use nsh_core::prelude::*; + +use crate::agents::{error_note, page_header, status_pill}; +use crate::theme; +use crate::Nav; + +/// One agent, pushed with `Route::Agent(id)`. The id the bridge resolves +/// (`w1:p2`, a name) is the page's title and the route's key. +pub fn detail(nav: Nav, id: String) -> Screen { + let load = resource( + move || Some(()), + move |(), _| { + let id = id.clone(); + async move { + let bridge = crate::bridge().map_err(|err| err.to_string())?; + bridge.agent(&id).await.map_err(|err| err.to_string()) + } + }, + ); + + nav_page() + .title(id) + .header(page_header("Agent", nav)) + .child( + view() + .flex_1() + .bg(rgb(theme::GRAPHITE)) + .child( + when( + move || load.error().is_some(), + move || { + error_note( + move || { + load.error() + .map(|err| err.to_owned()) + .unwrap_or_default() + .into() + }, + move || load.refetch(), + ) + }, + ), + ) + .child( + when(move || load.get().is_some(), move || { + view().flex_1().flex_col().child( + // Status and identity. + view() + .flex_col() + .gap_2() + .p_4() + .border_b_1() + .border_color(rgb(theme::LINE)) + .child( + view() + .flex_row() + .items_center() + .gap_3() + .child( + text(move || { + load.get() + .and_then(|detail| detail.agent.as_ref()) + .map(|agent| agent.label().to_owned()) + .unwrap_or_default() + }) + .text_size(px(20.0)) + .font_weight(FontWeight::SEMIBOLD) + .text_color(rgb(theme::TEXT)) + .number_of_lines(1), + ) + .child(status_pill(move || { + load.get() + .and_then(|detail| detail.agent.as_ref()) + .map(|agent| agent.status.clone()) + .unwrap_or_default() + })), + ) + .child( + text(move || { + match load.get() { + Some(detail) => match detail.agent.as_ref() { + Some(agent) => format!( + "{} · workspace {}", + agent.agent.as_deref().unwrap_or("agent"), + agent.workspace_id + ), + None if detail.blocked => { + "Blocked, but no longer in the snapshot.".to_owned() + } + None => "Not in the snapshot.".to_owned(), + }, + None => String::new(), + } + }) + .text_size(px(13.0)) + .text_color(rgb(theme::DIM)), + ), + ) + .child( + // herdr's recent lines for this pane. + view() + .flex_1() + .flex_col() + .gap_2() + .p_4() + .child( + text("Recent output") + .text_size(px(13.0)) + .font_weight(FontWeight::SEMIBOLD) + .text_color(rgb(theme::DIM)), + ) + .child( + scroll() + .flex_1() + .bg(rgb(theme::SURFACE)) + .rounded(px(10.0)) + .p_3() + .child( + text(move || { + load.get() + .and_then(|detail| { + detail.output_text().map(str::to_owned) + }) + .unwrap_or_else(|| { + "(no recent output)".to_owned() + }) + }) + .text_size(px(13.0)) + .text_color(rgb(theme::TEXT)), + ), + ), + ) + }) + .otherwise(|| { + when( + move || load.error().is_none(), + || { + view().flex_1().items_center().justify_center().child( + text("Loading…") + .text_size(px(15.0)) + .text_color(rgb(theme::DIM)), + ) + }, + ) + }), + ), + ) +} diff --git a/app/src/agents/inbox.rs b/app/src/agents/inbox.rs new file mode 100644 index 0000000..41573a0 --- /dev/null +++ b/app/src/agents/inbox.rs @@ -0,0 +1,116 @@ +//! The inbox: agents that are blocked or done, newest first. + +use nsh_base::nav_page; +use nsh_core::prelude::*; + +use crate::agents::{error_note, event_label, page_header, status_pill}; +use crate::theme; +use crate::{Nav, Route}; + +/// The inbox, pushed with `Route::Inbox`. Today it reads `GET /v1/events` +/// once on mount, with pull to refresh; live WebSocket updates wait on a PM +/// ruling (SPEC-shell G1). +pub fn inbox(nav: Nav) -> Screen { + let inbox = resource( + move || Some(()), + move |(), _| async move { + let bridge = crate::bridge().map_err(|err| err.to_string())?; + bridge.inbox().await.map_err(|err| err.to_string()) + }, + ); + + nav_page() + .title("Inbox") + .header(page_header("Inbox", nav)) + .child( + view() + .flex_1() + .bg(rgb(theme::GRAPHITE)) + .child( + when( + move || inbox.error().is_some(), + move || { + error_note( + move || { + inbox + .error() + .map(|err| err.to_owned()) + .unwrap_or_default() + .into() + }, + move || inbox.refetch(), + ) + }, + ), + ) + .child( + virtual_list( + move || inbox.get().map_or(0, |events| events.items.len()), + move |at| { + view() + .min_h(px(56.0)) + .flex_row() + .items_center() + .gap_3() + .px_4() + .py_2() + .on_press(move || { + let id = inbox + .get() + .and_then(|events| events.items.get(at.index()).cloned()) + .map(|item| item.id.clone()); + if let Some(id) = id { + nav.push(Route::Agent(id)); + } + }) + .child( + // The agent the event is about: its + // title, else its name, else its id. + text(move || { + inbox + .get() + .and_then(|events| events.items.get(at.index()).cloned()) + .map(|item| event_label(&item)) + .unwrap_or_default() + }) + .text_size(px(16.0)) + .text_color(rgb(theme::TEXT)) + .number_of_lines(1) + .flex_1(), + ) + .child(status_pill(move || { + inbox + .get() + .and_then(|events| events.items.get(at.index()).cloned()) + .map(|item| item.kind.clone()) + .unwrap_or_default() + })), + }, + ) + .estimated_item_size(px(64.0)) + .keys(move || { + inbox + .get() + .map(|events| { + events + .items + .iter() + .map(|item| item.id.clone()) + .collect::>() + }) + .unwrap_or_default() + }) + .separator(move || view().h(px(1.0)).mx_4().bg(rgb(theme::LINE))) + .on_refresh(move || inbox.refetch()) + .refreshing(move || inbox.loading()) + .empty(|| { + view().p_8().items_center().child( + text("Nothing needs you") + .text_size(px(15.0)) + .text_color(rgb(theme::DIM)), + ) + }) + .flex_1(), + ), + ) +} diff --git a/app/src/agents/list.rs b/app/src/agents/list.rs new file mode 100644 index 0000000..613f4c2 --- /dev/null +++ b/app/src/agents/list.rs @@ -0,0 +1,137 @@ +//! The agent list: the app's bottom page. + +use nsh_base::nav_page; +use nsh_core::prelude::*; + +use crate::agents::{error_note, status_pill}; +use crate::theme; +use crate::{Nav, Route}; + +/// The header link to the inbox, in the page's header slot. +fn open_inbox(nav: Nav) -> impl IntoElement { + text("Inbox") + .text_size(px(15.0)) + .text_color(rgb(theme::TEAL)) + .on_press(move || nav.push(Route::Inbox)) + .role(AccessibilityRole::Button) +} + +/// The agent list, the app's bottom page. +pub fn list(nav: Nav) -> Screen { + let bridge = crate::bridge().map_err(|err| err.to_string()); + let snapshot = resource( + move || Some(()), + move |(), _| { + let bridge = bridge.clone(); + async move { bridge?.snapshot().await.map_err(|err| err.to_string()) } + }, + ); + + nav_page() + .title("Agents") + .header_right(open_inbox(nav)) + .header( + view() + .h(px(48.0)) + .flex_row() + .items_center() + .justify_between() + .border_b_1() + .border_color(rgb(theme::LINE)) + .bg(rgb(theme::SURFACE)) + .px_4() + .child( + text("Agents") + .text_size(px(17.0)) + .font_weight(FontWeight::SEMIBOLD) + .text_color(rgb(theme::TEXT)), + ) + .child(open_inbox(nav)), + ) + .child( + view() + .flex_1() + .bg(rgb(theme::GRAPHITE)) + .child( + when( + move || snapshot.error().is_some(), + move || { + error_note( + move || { + snapshot + .error() + .map(|err| err.to_owned()) + .unwrap_or_default() + .into() + }, + move || snapshot.refetch(), + ) + }, + ), + ) + .child( + virtual_list( + move || snapshot.get().map_or(0, |snap| snap.agents.len()), + move |at| { + view() + .h(px(56.0)) + .flex_row() + .items_center() + .gap_3() + .px_4() + .on_press(move || { + let id = snapshot + .get() + .and_then(|snap| snap.agents.get(at.index()).cloned()) + .map(|agent| agent.id.clone()); + if let Some(id) = id { + nav.push(Route::Agent(id)); + } + }) + .child( + text(move || { + snapshot + .get() + .and_then(|snap| snap.agents.get(at.index()).cloned()) + .map(|agent| agent.label().to_owned()) + .unwrap_or_default() + }) + .text_size(px(16.0)) + .text_color(rgb(theme::TEXT)) + .number_of_lines(1), + ) + .child(status_pill(move || { + snapshot + .get() + .and_then(|snap| snap.agents.get(at.index()).cloned()) + .map(|agent| agent.status.clone()) + .unwrap_or_default() + })), + }, + ) + .estimated_item_size(px(56.0)) + .keys(move || { + snapshot + .get() + .map(|snap| { + snap.agents + .iter() + .map(|agent| agent.id.clone()) + .collect::>() + }) + .unwrap_or_default() + }) + .separator(move || view().h(px(1.0)).mx_4().bg(rgb(theme::LINE))) + .on_refresh(move || snapshot.refetch()) + .refreshing(move || snapshot.loading()) + .empty(|| { + view().p_8().items_center().child( + text("No agents") + .text_size(px(15.0)) + .text_color(rgb(theme::DIM)), + ) + }) + .flex_1(), + ), + ) +} diff --git a/app/src/agents/mod.rs b/app/src/agents/mod.rs index 73bac2e..96f51e2 100644 --- a/app/src/agents/mod.rs +++ b/app/src/agents/mod.rs @@ -1,36 +1,119 @@ -//! The agent screens. Frontend owns this file; these are placeholders that -//! keep the shell's navigation contract: +//! The agent screens. Frontend owns this file; the contract from the +//! scaffold: //! //! - `list(nav)` is the bottom page; `nav.push(Route::Agent(id))` opens one //! agent and `nav.push(Route::Inbox)` the inbox. //! - `detail(nav, id)` and `inbox(nav)` are pushed pages. //! -//! Data comes from [`crate::bridge`] and [`crate::net`]. +//! Data comes from [`crate::bridge`] and [`crate::net`]; the screens hold no +//! client of their own. WebSocket inbox updates wait on a PM ruling; the +//! inbox reads `Bridge::inbox()`. + +mod detail; +mod inbox; +mod list; + +pub use detail::detail; +pub use inbox::inbox; +pub use list::list; + +#[cfg(test)] +mod tests; -use nsh_base::nav_page; use nsh_core::prelude::*; -use crate::{Nav, Route}; - -pub fn list(nav: Nav) -> Screen { - nav_page().title("Agents").child( - view() - .flex_1() - .p_4() - .gap_3() - .child(text("Agents")) - .child(text("Inbox").on_press(move || nav.push(Route::Inbox))), - ) +use crate::theme; + +/// What an inbox row shows for an event: the item's title, else the agent's +/// name, else its id. +pub(crate) fn event_label(item: &crate::net::InboxItem) -> String { + item.title + .clone() + .filter(|title| !title.is_empty()) + .or_else(|| item.agent.clone()) + .unwrap_or_else(|| item.id.clone()) +} + +/// One status pill: a herdr status in a rounded chip, `blocked` in Gold on +/// Graphite — the treatment a row, a detail page and an inbox item share. +/// The status reads through `status` every turn, so a recycled row or a +/// refetch updates the pill in place. +pub(crate) fn status_pill(status: impl Fn() -> SharedString + Copy + 'static) -> impl IntoElement { + view() + .flex_row() + .items_center() + .rounded(px(999.0)) + .px(px(10.0)) + .py(px(3.0)) + .bg(move || { + let (bg, _) = theme::status_pill(&status()); + rgb(bg) + }) + .child( + text(status) + .text_size(px(12.0)) + .font_weight(FontWeight::SEMIBOLD) + .text_color(move || { + let (_, fg) = theme::status_pill(&status()); + rgb(fg) + }), + ) } -pub fn detail(_nav: Nav, id: String) -> Screen { - nav_page() - .title(id.clone()) - .child(view().flex_1().p_4().child(text(id))) +/// What a failed load shows: the error, and Retry, which refetches. +pub(crate) fn error_note( + error: impl Fn() -> SharedString + Copy + 'static, + retry: impl Fn() + Copy + 'static, +) -> impl IntoElement { + view() + .flex_col() + .items_center() + .gap_2() + .p_4() + .child( + text(error) + .text_size(px(13.0)) + .text_color(rgb(theme::DIM)), + ) + .child( + text("Retry") + .text_size(px(15.0)) + .font_weight(FontWeight::SEMIBOLD) + .text_color(rgb(theme::TEAL)) + .on_press(retry) + .role(AccessibilityRole::Button), + ) } -pub fn inbox(_nav: Nav) -> Screen { - nav_page() - .title("Inbox") - .child(view().flex_1().p_4().child(text("Inbox"))) +/// The page's header on the desktops and the web; iOS and Android show the +/// system header from `title`. The back button shows once the stack is more +/// than one page deep. +pub(crate) fn page_header(title: &'static str, nav: Nav) -> impl IntoElement { + view() + .h(px(48.0)) + .flex_row() + .items_center() + .gap_3() + .border_b_1() + .border_color(rgb(theme::LINE)) + .bg(rgb(theme::SURFACE)) + .px_4() + .child( + when( + move || nav.depth() > 1, + move || { + text("Back") + .text_size(px(15.0)) + .text_color(rgb(theme::TEAL)) + .on_press(move || nav.back()) + .role(AccessibilityRole::Button) + }, + ), + ) + .child( + text(title) + .text_size(px(17.0)) + .font_weight(FontWeight::SEMIBOLD) + .text_color(rgb(theme::TEXT)), + ) } diff --git a/app/src/agents/tests.rs b/app/src/agents/tests.rs new file mode 100644 index 0000000..a9768e2 --- /dev/null +++ b/app/src/agents/tests.rs @@ -0,0 +1,30 @@ +//! The screens' own logic, against JSON shaped like the bridge's replies. + +use super::event_label; +use crate::net::InboxItem; + +fn event(id: &str, agent: Option<&str>, title: Option<&str>) -> InboxItem { + InboxItem { + id: id.to_owned(), + agent: agent.map(str::to_owned), + status: "blocked".to_owned(), + workspace_id: "w1".to_owned(), + title: title.map(str::to_owned), + kind: "blocked".to_owned(), + } +} + +#[test] +fn an_event_label_prefers_the_title() { + let item = event("w1:p2", Some("scratch-2"), Some("Needs your OK")); + assert_eq!(event_label(&item), "Needs your OK"); +} + +#[test] +fn an_event_label_falls_back_from_title_to_agent_to_id() { + let item = event("w1:p2", Some("scratch-2"), Some("")); + assert_eq!(event_label(&item), "scratch-2"); + + let bare = event("w1:p2", None, None); + assert_eq!(event_label(&bare), "w1:p2"); +} diff --git a/app/src/theme.rs b/app/src/theme.rs index c9dc524..f763580 100644 --- a/app/src/theme.rs +++ b/app/src/theme.rs @@ -1,5 +1,5 @@ -//! Pendant's colours. Frontend owns this file; the three brand colours from -//! SPEC-shell are here so the screens can start on them. +//! Pendant's colours. Frontend owns this file: the three brand colours from +//! SPEC-shell, plus the supporting shades on Graphite the screens share. /// Graphite, the background. pub const GRAPHITE: u32 = 0x111513; @@ -7,3 +7,43 @@ pub const GRAPHITE: u32 = 0x111513; pub const TEAL: u32 = 0x0F5C56; /// Gold, for what needs the user: a blocked agent. pub const GOLD: u32 = 0xC9A227; + +/// A row or card, one step up from the background. +pub const SURFACE: u32 = 0x1B211E; +/// Separators and borders. +pub const LINE: u32 = 0x272F2B; +/// Primary text. +pub const TEXT: u32 = 0xE9EFEC; +/// Secondary text. +pub const DIM: u32 = 0x8FA098; + +/// The pill a herdr status draws as: `(background, text)`. +/// +/// `blocked` is the one loud state — Gold on Graphite is what a list row, a +/// detail page and an inbox item all share (SPEC-shell G1). `working` and +/// `done` carry the Teal accent; everything else stays quiet. +pub fn status_pill(status: &str) -> (u32, u32) { + match status { + "blocked" => (GOLD, GRAPHITE), + "working" | "done" => (TEAL, TEXT), + _ => (LINE, DIM), + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn blocked_is_the_loud_pill() { + assert_eq!(status_pill("blocked"), (GOLD, GRAPHITE)); + } + + #[test] + fn active_statuses_carry_teal_and_the_rest_stay_quiet() { + assert_eq!(status_pill("working"), (TEAL, TEXT)); + assert_eq!(status_pill("done"), (TEAL, TEXT)); + assert_eq!(status_pill("idle"), (LINE, DIM)); + assert_eq!(status_pill(""), (LINE, DIM)); + } +} From 30cb6b4988d3e3d7bc53bf119077b004da666f20 Mon Sep 17 00:00:00 2001 From: frontend Date: Sat, 14 Nov 2026 10:59:56 -0500 Subject: [PATCH 10/16] app: reach the inbox from the list content on every platform --- app/src/agents/list.rs | 131 +++++++++++++++++++++++++---------------- 1 file changed, 79 insertions(+), 52 deletions(-) diff --git a/app/src/agents/list.rs b/app/src/agents/list.rs index 613f4c2..8a6aafc 100644 --- a/app/src/agents/list.rs +++ b/app/src/agents/list.rs @@ -3,7 +3,8 @@ use nsh_base::nav_page; use nsh_core::prelude::*; -use crate::agents::{error_note, status_pill}; +use crate::agents::{error_line, link_line, status_pill}; +use crate::net::live::live; use crate::theme; use crate::{Nav, Route}; @@ -16,20 +17,14 @@ fn open_inbox(nav: Nav) -> impl IntoElement { .role(AccessibilityRole::Button) } -/// The agent list, the app's bottom page. +/// The agent list, the app's bottom page. The link state and the agent +/// count sit above the list; the snapshot refreshes itself every few +/// seconds, so there is no refresh control to wire. pub fn list(nav: Nav) -> Screen { - let bridge = crate::bridge().map_err(|err| err.to_string()); - let snapshot = resource( - move || Some(()), - move |(), _| { - let bridge = bridge.clone(); - async move { bridge?.snapshot().await.map_err(|err| err.to_string()) } - }, - ); + let live = live(); nav_page() .title("Agents") - .header_right(open_inbox(nav)) .header( view() .h(px(48.0)) @@ -51,27 +46,50 @@ pub fn list(nav: Nav) -> Screen { .child( view() .flex_1() + .flex_col() .bg(rgb(theme::GRAPHITE)) + .child(link_line(move || live.link.get())) + .child( + view() + .flex_row() + .items_center() + .px_4() + .py_2() + .child( + text(move || { + let count = live + .snapshot + .with(|snap| snap.as_ref().map_or(0, |snap| snap.agents.len())); + match count { + 1 => "1 agent".to_owned(), + _ => format!("{count} agents"), + } + }) + .text_size(px(12.0)) + .text_color(rgb(theme::DIM)) + .flex_1(), + ) + .child(open_inbox(nav)), + ) .child( when( - move || snapshot.error().is_some(), + move || live.error.get().is_some(), move || { - error_note( - move || { - snapshot - .error() - .map(|err| err.to_owned()) - .unwrap_or_default() - .into() - }, - move || snapshot.refetch(), - ) + error_line(move || { + live.error + .get() + .unwrap_or_default() + .into() + }) }, ), ) .child( virtual_list( - move || snapshot.get().map_or(0, |snap| snap.agents.len()), + move || { + live.snapshot + .with(|snap| snap.as_ref().map_or(0, |snap| snap.agents.len())) + }, move |at| { view() .h(px(56.0)) @@ -80,20 +98,25 @@ pub fn list(nav: Nav) -> Screen { .gap_3() .px_4() .on_press(move || { - let id = snapshot - .get() - .and_then(|snap| snap.agents.get(at.index()).cloned()) - .map(|agent| agent.id.clone()); + let id = live + .snapshot + .with(|snap| { + snap.as_ref() + .and_then(|snap| snap.agents.get(at.index()).cloned()) + .map(|agent| agent.id.clone()) + }); if let Some(id) = id { nav.push(Route::Agent(id)); } }) .child( text(move || { - snapshot - .get() - .and_then(|snap| snap.agents.get(at.index()).cloned()) - .map(|agent| agent.label().to_owned()) + live.snapshot + .with(|snap| { + snap.as_ref() + .and_then(|snap| snap.agents.get(at.index()).cloned()) + .map(|agent| agent.label().to_owned()) + }) .unwrap_or_default() }) .text_size(px(16.0)) @@ -101,36 +124,40 @@ pub fn list(nav: Nav) -> Screen { .number_of_lines(1), ) .child(status_pill(move || { - snapshot - .get() - .and_then(|snap| snap.agents.get(at.index()).cloned()) - .map(|agent| agent.status.clone()) + live.snapshot + .with(|snap| { + snap.as_ref() + .and_then(|snap| snap.agents.get(at.index()).cloned()) + .map(|agent| agent.status.clone()) + }) .unwrap_or_default() - })), + .into() + })) }, ) .estimated_item_size(px(56.0)) .keys(move || { - snapshot - .get() - .map(|snap| { - snap.agents - .iter() - .map(|agent| agent.id.clone()) - .collect::>() + live.snapshot + .with(|snap| { + snap.as_ref() + .map(|snap| { + snap.agents.iter().map(|agent| agent.id.clone()).collect::>() + }) + .unwrap_or_default() }) - .unwrap_or_default() }) .separator(move || view().h(px(1.0)).mx_4().bg(rgb(theme::LINE))) - .on_refresh(move || snapshot.refetch()) - .refreshing(move || snapshot.loading()) - .empty(|| { + .empty( view().p_8().items_center().child( - text("No agents") - .text_size(px(15.0)) - .text_color(rgb(theme::DIM)), - ) - }) + text(move || match live.link.get() { + crate::net::live::Link::Connecting => "Connecting…".to_owned(), + crate::net::live::Link::Open => "No agents".to_owned(), + _ => String::new(), + }) + .text_size(px(15.0)) + .text_color(rgb(theme::DIM)), + ), + ) .flex_1(), ), ) From 79d40bc9916731c458f3c5eac673a1e24d2d99d5 Mon Sep 17 00:00:00 2001 From: frontend Date: Sat, 14 Nov 2026 11:00:16 -0500 Subject: [PATCH 11/16] app: read the shared live link in the agent screens --- app/src/agents/detail.rs | 371 ++++++++++++++++++++++++++++----------- app/src/agents/inbox.rs | 93 ++++------ app/src/agents/mod.rs | 66 ++++++- 3 files changed, 362 insertions(+), 168 deletions(-) diff --git a/app/src/agents/detail.rs b/app/src/agents/detail.rs index f16c046..2d1c415 100644 --- a/app/src/agents/detail.rs +++ b/app/src/agents/detail.rs @@ -1,19 +1,26 @@ -//! One agent: its status, and herdr's recent output for it. +//! One agent: its status, herdr's recent output, and the pane frames the +//! live link watches for it. use nsh_base::nav_page; use nsh_core::prelude::*; -use crate::agents::{error_note, page_header, status_pill}; +use crate::agents::{error_line, error_note, page_header, status_pill}; +use crate::net::live::{live, Live, PaneFeed}; +use crate::net::types::AgentDetail; use crate::theme; use crate::Nav; /// One agent, pushed with `Route::Agent(id)`. The id the bridge resolves /// (`w1:p2`, a name) is the page's title and the route's key. pub fn detail(nav: Nav, id: String) -> Screen { - let load = resource( + let live = live(); + + // herdr's recent output for the agent, fetched once on mount. + let fetch_id = id.clone(); + let output = resource( move || Some(()), move |(), _| { - let id = id.clone(); + let id = fetch_id.clone(); async move { let bridge = crate::bridge().map_err(|err| err.to_string())?; bridge.agent(&id).await.map_err(|err| err.to_string()) @@ -21,131 +28,289 @@ pub fn detail(nav: Nav, id: String) -> Screen { }, ); + // The agent's pane: watched once the snapshot names it, and left when + // the page does. The guard keeps the 3 s snapshot refresh from + // watch/unwatch churn. + let watch_id = id.clone(); + let watched = signal(None::); + effect(move || { + if watched.get_untracked().is_some() { + return; + } + let pane = live.snapshot.with(|snap| { + snap.as_ref() + .and_then(|snap| snap.agent(&watch_id)) + .map(|agent| agent.pane_id.clone()) + }); + if let Some(pane) = pane { + live.watch(&pane); + watched.set(Some(pane)); + } + }); + cleanup(move || { + if let Some(pane) = watched.get_untracked() { + live.unwatch(&pane); + } + }); + + let body_id = id.clone(); nav_page() .title(id) .header(page_header("Agent", nav)) .child( view() .flex_1() + .flex_col() .bg(rgb(theme::GRAPHITE)) + .child(link_bar(live)) .child( when( - move || load.error().is_some(), + move || live.error.get().is_some(), + move || error_line(move || live.error.get().unwrap_or_default().into()), + ), + ) + .child( + when( + move || output.error().is_some(), move || { error_note( move || { - load.error() + output + .error() .map(|err| err.to_owned()) .unwrap_or_default() .into() }, - move || load.refetch(), + move || output.refetch(), ) }, ), ) .child( - when(move || load.get().is_some(), move || { - view().flex_1().flex_col().child( - // Status and identity. - view() - .flex_col() - .gap_2() - .p_4() - .border_b_1() - .border_color(rgb(theme::LINE)) - .child( - view() - .flex_row() - .items_center() - .gap_3() - .child( - text(move || { - load.get() - .and_then(|detail| detail.agent.as_ref()) - .map(|agent| agent.label().to_owned()) - .unwrap_or_default() - }) - .text_size(px(20.0)) - .font_weight(FontWeight::SEMIBOLD) - .text_color(rgb(theme::TEXT)) - .number_of_lines(1), - ) - .child(status_pill(move || { - load.get() - .and_then(|detail| detail.agent.as_ref()) - .map(|agent| agent.status.clone()) - .unwrap_or_default() - })), - ) - .child( - text(move || { - match load.get() { - Some(detail) => match detail.agent.as_ref() { - Some(agent) => format!( - "{} · workspace {}", - agent.agent.as_deref().unwrap_or("agent"), - agent.workspace_id - ), - None if detail.blocked => { - "Blocked, but no longer in the snapshot.".to_owned() - } - None => "Not in the snapshot.".to_owned(), - }, - None => String::new(), - } - }) - .text_size(px(13.0)) + when( + move || live.snapshot.get().is_some(), + move || detail_body(live, body_id.clone().into(), output), + ), + ) + .child( + when( + move || live.snapshot.get().is_none() && live.error.get().is_none(), + || { + view().flex_1().items_center().justify_center().child( + text("Loading…") + .text_size(px(15.0)) .text_color(rgb(theme::DIM)), - ), - ) + ) + }, + ), + ), + ) +} + +/// The link line, for the top of a pushed page's content. +fn link_bar(live: Live) -> impl IntoElement { + view() + .flex_row() + .items_center() + .gap_2() + .px_4() + .py_2() + .border_b_1() + .border_color(rgb(theme::LINE)) + .child( + view() + .size(px(8.0)) + .rounded(px(4.0)) + .bg(move || match live.link.get() { + crate::net::live::Link::Open => rgb(theme::TEAL), + crate::net::live::Link::Connecting => rgb(theme::DIM), + _ => rgb(theme::GOLD), + }), + ) + .child( + text(move || match live.link.get() { + crate::net::live::Link::Open => "Live".to_owned(), + crate::net::live::Link::Connecting => "Connecting…".to_owned(), + crate::net::live::Link::Closed(why) => format!("Reconnecting: {why}"), + crate::net::live::Link::Unconfigured(why) => format!("No bridge address: {why}"), + }) + .text_size(px(12.0)) + .text_color(move || match live.link.get() { + crate::net::live::Link::Open => rgb(theme::TEXT), + crate::net::live::Link::Connecting => rgb(theme::DIM), + _ => rgb(theme::GOLD), + }) + .number_of_lines(1), + ) +} + +/// Status and identity from the snapshot, then the pane feed and the +/// fetched output. One owned id per reactive closure: `SharedString` is an +/// `Arc`, so the clones are cheap. +fn detail_body(live: Live, id: SharedString, output: Resource) -> impl IntoElement { + let id_label = id.clone(); + let id_status = id.clone(); + let id_meta = id.clone(); + let id_feed = id.clone(); + let id_refused = id.clone(); + let id_refused_text = id.clone(); + let id_output = id.clone(); + + view() + .flex_1() + .flex_col() + .child( + // Status and identity. + view() + .flex_col() + .gap_2() + .p_4() + .border_b_1() + .border_color(rgb(theme::LINE)) + .child( + view() + .flex_row() + .items_center() + .gap_3() .child( - // herdr's recent lines for this pane. - view() - .flex_1() - .flex_col() - .gap_2() - .p_4() - .child( - text("Recent output") - .text_size(px(13.0)) - .font_weight(FontWeight::SEMIBOLD) - .text_color(rgb(theme::DIM)), - ) - .child( - scroll() - .flex_1() - .bg(rgb(theme::SURFACE)) - .rounded(px(10.0)) - .p_3() - .child( - text(move || { - load.get() - .and_then(|detail| { - detail.output_text().map(str::to_owned) - }) - .unwrap_or_else(|| { - "(no recent output)".to_owned() - }) - }) - .text_size(px(13.0)) - .text_color(rgb(theme::TEXT)), - ), - ), + text(move || { + live.snapshot + .with(|snap| { + snap.as_ref() + .and_then(|snap| snap.agent(&id_label).cloned()) + .map(|agent| agent.label().to_owned()) + }) + .unwrap_or_else(|| id_label.to_string()) + }) + .text_size(px(20.0)) + .font_weight(FontWeight::SEMIBOLD) + .text_color(rgb(theme::TEXT)) + .number_of_lines(1), ) + .child(status_pill(move || { + live.snapshot + .with(|snap| { + snap.as_ref() + .and_then(|snap| snap.agent(&id_status).cloned()) + .map(|agent| agent.status.clone()) + }) + .unwrap_or_default() + .into() + })), + ) + .child( + text(move || { + match live.snapshot.with(|snap| { + snap.as_ref() + .and_then(|snap| snap.agent(&id_meta)) + .map(|agent| { + agent + .agent + .clone() + .unwrap_or_else(|| "agent".to_owned()) + }) + }) { + Some(harness) => harness, + None => "Not in the snapshot.".to_owned(), + } }) - .otherwise(|| { - when( - move || load.error().is_none(), - || { - view().flex_1().items_center().justify_center().child( - text("Loading…") - .text_size(px(15.0)) - .text_color(rgb(theme::DIM)), - ) - }, + .text_size(px(13.0)) + .text_color(rgb(theme::DIM)), + ), + ) + .child( + // The watched pane's frames, and what the watch sent first. + view().p_4().pb_2().flex_col().gap_2().child( + text(move || { + match feed(live, &id_feed) { + Some(feed) => format!( + "frames {} · seq {} · out of order {}", + feed.seq.frames, + feed.seq + .last() + .map(|seq| seq.to_string()) + .unwrap_or_else(|| "-".to_owned()), + feed.seq.out_of_order + ), + None => "Not watching the pane yet.".to_owned(), + } + }) + .text_size(px(12.0)) + .text_color(rgb(theme::DIM)), + ), + ) + .child( + when( + move || { + feed(live, &id_refused) + .and_then(|feed| feed.refused.clone()) + .is_some() + }, + move || { + let id = id_refused_text.clone(); + text(move || { + format!( + "The bridge refused: {}", + feed(live, &id) + .and_then(|feed| feed.refused.clone()) + .unwrap_or_default() ) - }), + }) + .text_size(px(12.0)) + .text_color(rgb(theme::GOLD)) + }, + ), + ) + .child( + // herdr's recent lines for this pane: the watch's scrollback + // first, the fetched output behind it. + view() + .flex_1() + .flex_col() + .gap_2() + .px_4() + .pb_4() + .child( + text("Recent output") + .text_size(px(13.0)) + .font_weight(FontWeight::SEMIBOLD) + .text_color(rgb(theme::DIM)), + ) + .child( + scroll() + .flex_1() + .bg(rgb(theme::SURFACE)) + .rounded(px(10.0)) + .p_3() + .child( + text(move || { + let feed = feed(live, &id_output); + if let Some(text) = + feed.as_ref().and_then(|feed| feed.scrollback.clone()) + { + return text; + } + output + .get() + .and_then(|detail| detail.output_text().map(str::to_owned)) + .unwrap_or_else(|| "(no recent output)".to_owned()) + }) + .text_size(px(13.0)) + .text_color(rgb(theme::TEXT)), + ), ), ) } + +/// The pane feed for this agent, if the pane is known and watched. Reads +/// through the signals, so it tracks the caller's reactive scope. +fn feed(live: Live, id: &str) -> Option { + let pane = live + .snapshot + .with(|snap| { + snap.as_ref() + .and_then(|snap| snap.agent(id)) + .map(|agent| agent.pane_id.clone()) + })?; + live.panes.with(|panes| panes.get(&pane).cloned()) +} diff --git a/app/src/agents/inbox.rs b/app/src/agents/inbox.rs index 41573a0..70aa3e7 100644 --- a/app/src/agents/inbox.rs +++ b/app/src/agents/inbox.rs @@ -3,21 +3,16 @@ use nsh_base::nav_page; use nsh_core::prelude::*; -use crate::agents::{error_note, event_label, page_header, status_pill}; +use crate::agents::{error_line, event_label, page_header, status_pill}; +use crate::net::live::live; use crate::theme; use crate::{Nav, Route}; -/// The inbox, pushed with `Route::Inbox`. Today it reads `GET /v1/events` -/// once on mount, with pull to refresh; live WebSocket updates wait on a PM -/// ruling (SPEC-shell G1). +/// The inbox, pushed with `Route::Inbox`. The live link refreshes the +/// events every few seconds; WebSocket-driven updates wait on a PM ruling +/// (SPEC-shell G1). pub fn inbox(nav: Nav) -> Screen { - let inbox = resource( - move || Some(()), - move |(), _| async move { - let bridge = crate::bridge().map_err(|err| err.to_string())?; - bridge.inbox().await.map_err(|err| err.to_string()) - }, - ); + let live = live(); nav_page() .title("Inbox") @@ -25,27 +20,17 @@ pub fn inbox(nav: Nav) -> Screen { .child( view() .flex_1() + .flex_col() .bg(rgb(theme::GRAPHITE)) .child( when( - move || inbox.error().is_some(), - move || { - error_note( - move || { - inbox - .error() - .map(|err| err.to_owned()) - .unwrap_or_default() - .into() - }, - move || inbox.refetch(), - ) - }, + move || live.error.get().is_some(), + move || error_line(move || live.error.get().unwrap_or_default().into()), ), ) .child( virtual_list( - move || inbox.get().map_or(0, |events| events.items.len()), + move || live.inbox.with(Vec::len), move |at| { view() .min_h(px(56.0)) @@ -55,22 +40,20 @@ pub fn inbox(nav: Nav) -> Screen { .px_4() .py_2() .on_press(move || { - let id = inbox - .get() - .and_then(|events| events.items.get(at.index()).cloned()) - .map(|item| item.id.clone()); + let id = live + .inbox + .with(|items| items.get(at.index()).map(|item| item.id.clone())); if let Some(id) = id { nav.push(Route::Agent(id)); } }) .child( - // The agent the event is about: its - // title, else its name, else its id. + // The agent the event is about. text(move || { - inbox - .get() - .and_then(|events| events.items.get(at.index()).cloned()) - .map(|item| event_label(&item)) + live.inbox + .with(|items| { + items.get(at.index()).map(event_label) + }) .unwrap_or_default() }) .text_size(px(16.0)) @@ -79,37 +62,31 @@ pub fn inbox(nav: Nav) -> Screen { .flex_1(), ) .child(status_pill(move || { - inbox - .get() - .and_then(|events| events.items.get(at.index()).cloned()) - .map(|item| item.kind.clone()) + live.inbox + .with(|items| { + items.get(at.index()).map(|item| item.kind.clone()) + }) .unwrap_or_default() - })), + .into() + })) }, ) .estimated_item_size(px(64.0)) .keys(move || { - inbox - .get() - .map(|events| { - events - .items - .iter() - .map(|item| item.id.clone()) - .collect::>() - }) - .unwrap_or_default() + live.inbox + .with(|items| items.iter().map(|item| item.id.clone()).collect::>()) }) .separator(move || view().h(px(1.0)).mx_4().bg(rgb(theme::LINE))) - .on_refresh(move || inbox.refetch()) - .refreshing(move || inbox.loading()) - .empty(|| { + .empty( view().p_8().items_center().child( - text("Nothing needs you") - .text_size(px(15.0)) - .text_color(rgb(theme::DIM)), - ) - }) + text(move || match live.link.get() { + crate::net::live::Link::Connecting => "Connecting…".to_owned(), + _ => "Nothing needs you".to_owned(), + }) + .text_size(px(15.0)) + .text_color(rgb(theme::DIM)), + ), + ) .flex_1(), ), ) diff --git a/app/src/agents/mod.rs b/app/src/agents/mod.rs index 96f51e2..e77e8b4 100644 --- a/app/src/agents/mod.rs +++ b/app/src/agents/mod.rs @@ -5,9 +5,9 @@ //! agent and `nav.push(Route::Inbox)` the inbox. //! - `detail(nav, id)` and `inbox(nav)` are pushed pages. //! -//! Data comes from [`crate::bridge`] and [`crate::net`]; the screens hold no -//! client of their own. WebSocket inbox updates wait on a PM ruling; the -//! inbox reads `Bridge::inbox()`. +//! Data comes from the live link ([`crate::net::live`], the shared +//! snapshot/inbox/pane signals fullstack refreshes) and, for an agent's +//! recent output, [`crate::bridge`]. No screen holds a client of its own. mod detail; mod inbox; @@ -23,6 +23,7 @@ mod tests; use nsh_core::prelude::*; use crate::theme; +use crate::Nav; /// What an inbox row shows for an event: the item's title, else the agent's /// name, else its id. @@ -38,7 +39,10 @@ pub(crate) fn event_label(item: &crate::net::InboxItem) -> String { /// Graphite — the treatment a row, a detail page and an inbox item share. /// The status reads through `status` every turn, so a recycled row or a /// refetch updates the pill in place. -pub(crate) fn status_pill(status: impl Fn() -> SharedString + Copy + 'static) -> impl IntoElement { +pub(crate) fn status_pill(status: impl Fn() -> SharedString + Clone + 'static) -> impl IntoElement { + let status_bg = status.clone(); + let status_text = status.clone(); + let status_fg = status.clone(); view() .flex_row() .items_center() @@ -46,20 +50,30 @@ pub(crate) fn status_pill(status: impl Fn() -> SharedString + Copy + 'static) -> .px(px(10.0)) .py(px(3.0)) .bg(move || { - let (bg, _) = theme::status_pill(&status()); + let (bg, _) = theme::status_pill(&status_bg()); rgb(bg) }) .child( - text(status) + text(move || status_text().to_string()) .text_size(px(12.0)) .font_weight(FontWeight::SEMIBOLD) .text_color(move || { - let (_, fg) = theme::status_pill(&status()); + let (_, fg) = theme::status_pill(&status_fg()); rgb(fg) }), ) } +/// What a failed shared fetch shows. The live link retries itself every +/// [`crate::net::live::POLL`], so this is the error text only. +pub(crate) fn error_line(error: impl Fn() -> SharedString + Copy + 'static) -> impl IntoElement { + view().p_4().child( + text(error) + .text_size(px(13.0)) + .text_color(rgb(theme::DIM)), + ) +} + /// What a failed load shows: the error, and Retry, which refetches. pub(crate) fn error_note( error: impl Fn() -> SharedString + Copy + 'static, @@ -85,6 +99,44 @@ pub(crate) fn error_note( ) } +/// The link state one line, for the bottom of a page's header slot and the +/// top of a page's content: what the WebSocket is doing right now. +pub(crate) fn link_line(link: impl Fn() -> crate::net::live::Link + Copy + 'static) -> impl IntoElement { + view() + .flex_row() + .items_center() + .gap_2() + .px_4() + .py_2() + .border_b_1() + .border_color(rgb(theme::LINE)) + .child( + view() + .size(px(8.0)) + .rounded(px(4.0)) + .bg(move || match link() { + crate::net::live::Link::Open => rgb(theme::TEAL), + crate::net::live::Link::Connecting => rgb(theme::DIM), + _ => rgb(theme::GOLD), + }), + ) + .child( + text(move || match link() { + crate::net::live::Link::Open => "Live".to_owned(), + crate::net::live::Link::Connecting => "Connecting…".to_owned(), + crate::net::live::Link::Closed(why) => format!("Reconnecting: {why}"), + crate::net::live::Link::Unconfigured(why) => format!("No bridge address: {why}"), + }) + .text_size(px(12.0)) + .text_color(move || match link() { + crate::net::live::Link::Open => rgb(theme::TEXT), + crate::net::live::Link::Connecting => rgb(theme::DIM), + _ => rgb(theme::GOLD), + }) + .number_of_lines(1), + ) +} + /// The page's header on the desktops and the web; iOS and Android show the /// system header from `title`. The back button shows once the stack is more /// than one page deep. From b863df30e40fcd1519b77a38472fb0bad47a2115 Mon Sep 17 00:00:00 2001 From: VirtualMachinist Date: Sat, 14 Nov 2026 11:04:24 -0500 Subject: [PATCH 12/16] app: open a page at launch from PENDANT_START PENDANT_START=inbox or agent:, read at run time, opens that page over the agent list. A simulator launch passes it as SIMCTL_CHILD_PENDANT_START, so the shell checks can open detail and the inbox without taps; without it the app opens on the list as before. Co-Authored-By: Claude Opus 5.5 --- app/src/lib.rs | 42 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/app/src/lib.rs b/app/src/lib.rs index fcfd7e1..907bd2e 100644 --- a/app/src/lib.rs +++ b/app/src/lib.rs @@ -90,13 +90,35 @@ pub fn bridge() -> Result { net::Bridge::from_build() } +/// The variable naming a page to open over the list at launch. +pub const START_VAR: &str = "PENDANT_START"; + +/// The stack at launch: the agent list, plus the page `start` names +/// (`inbox` or `agent:`), read from [`START_VAR`] at run time. A +/// simulator launch passes it as `SIMCTL_CHILD_PENDANT_START`, so a check +/// can open a page without taps. Anything else opens the list alone. +pub fn start_routes(start: Option<&str>) -> Vec { + let mut routes = vec![Route::Agents]; + match start.map(str::trim) { + Some("inbox") => routes.push(Route::Inbox), + Some(other) => { + if let Some(id) = other.strip_prefix("agent:").filter(|id| !id.is_empty()) { + routes.push(Route::Agent(id.to_owned())); + } + } + None => {} + } + routes +} + /// The root component. #[component] pub fn App() -> impl IntoElement { // The live link: snapshot and inbox polling, and the WebSocket worker. // Screens read it with `net::live::live()`. net::live::start(); - let routes = signal(vec![Route::Agents]); + let start = std::env::var(START_VAR).ok(); + let routes = signal(start_routes(start.as_deref())); let nav = Nav { routes }; nav_stack().flex_1().child(each( move || routes.get(), @@ -113,3 +135,21 @@ pub fn App() -> impl IntoElement { }, )) } + +#[cfg(test)] +mod start_tests { + use super::{start_routes, Route}; + + #[test] + fn the_start_variable_opens_one_page_over_the_list() { + assert_eq!(start_routes(None), [Route::Agents]); + assert_eq!(start_routes(Some("inbox")), [Route::Agents, Route::Inbox]); + assert_eq!( + start_routes(Some("agent:w1:p2")), + [Route::Agents, Route::Agent("w1:p2".into())] + ); + for ignored in ["", "agent:", "agents", "settings", "agent"] { + assert_eq!(start_routes(Some(ignored)), [Route::Agents], "{ignored}"); + } + } +} From 9d5afdfc9d4006f1afcba543ab97f5221b931442 Mon Sep 17 00:00:00 2001 From: frontend Date: Sat, 14 Nov 2026 11:05:08 -0500 Subject: [PATCH 13/16] app: rustfmt the agent screens --- app/src/agents/detail.rs | 163 ++++++++++++++++++--------------------- app/src/agents/inbox.rs | 25 +++--- app/src/agents/list.rs | 55 ++++++------- app/src/agents/mod.rs | 40 ++++------ 4 files changed, 128 insertions(+), 155 deletions(-) diff --git a/app/src/agents/detail.rs b/app/src/agents/detail.rs index 2d1c415..48d2a0f 100644 --- a/app/src/agents/detail.rs +++ b/app/src/agents/detail.rs @@ -63,47 +63,39 @@ pub fn detail(nav: Nav, id: String) -> Screen { .flex_col() .bg(rgb(theme::GRAPHITE)) .child(link_bar(live)) - .child( - when( - move || live.error.get().is_some(), - move || error_line(move || live.error.get().unwrap_or_default().into()), - ), - ) - .child( - when( - move || output.error().is_some(), - move || { - error_note( - move || { - output - .error() - .map(|err| err.to_owned()) - .unwrap_or_default() - .into() - }, - move || output.refetch(), - ) - }, - ), - ) - .child( - when( - move || live.snapshot.get().is_some(), - move || detail_body(live, body_id.clone().into(), output), - ), - ) - .child( - when( - move || live.snapshot.get().is_none() && live.error.get().is_none(), - || { - view().flex_1().items_center().justify_center().child( - text("Loading…") - .text_size(px(15.0)) - .text_color(rgb(theme::DIM)), - ) - }, - ), - ), + .child(when( + move || live.error.get().is_some(), + move || error_line(move || live.error.get().unwrap_or_default().into()), + )) + .child(when( + move || output.error().is_some(), + move || { + error_note( + move || { + output + .error() + .map(|err| err.to_owned()) + .unwrap_or_default() + .into() + }, + move || output.refetch(), + ) + }, + )) + .child(when( + move || live.snapshot.get().is_some(), + move || detail_body(live, body_id.clone().into(), output), + )) + .child(when( + move || live.snapshot.get().is_none() && live.error.get().is_none(), + || { + view().flex_1().items_center().justify_center().child( + text("Loading…") + .text_size(px(15.0)) + .text_color(rgb(theme::DIM)), + ) + }, + )), ) } @@ -147,7 +139,11 @@ fn link_bar(live: Live) -> impl IntoElement { /// Status and identity from the snapshot, then the pane feed and the /// fetched output. One owned id per reactive closure: `SharedString` is an /// `Arc`, so the clones are cheap. -fn detail_body(live: Live, id: SharedString, output: Resource) -> impl IntoElement { +fn detail_body( + live: Live, + id: SharedString, + output: Resource, +) -> impl IntoElement { let id_label = id.clone(); let id_status = id.clone(); let id_meta = id.clone(); @@ -204,10 +200,7 @@ fn detail_body(live: Live, id: SharedString, output: Resource harness, @@ -221,46 +214,42 @@ fn detail_body(live: Live, id: SharedString, output: Resource format!( - "frames {} · seq {} · out of order {}", - feed.seq.frames, - feed.seq - .last() - .map(|seq| seq.to_string()) - .unwrap_or_else(|| "-".to_owned()), - feed.seq.out_of_order - ), - None => "Not watching the pane yet.".to_owned(), - } + text(move || match feed(live, &id_feed) { + Some(feed) => format!( + "frames {} · seq {} · out of order {}", + feed.seq.frames, + feed.seq + .last() + .map(|seq| seq.to_string()) + .unwrap_or_else(|| "-".to_owned()), + feed.seq.out_of_order + ), + None => "Not watching the pane yet.".to_owned(), }) .text_size(px(12.0)) .text_color(rgb(theme::DIM)), ), ) - .child( - when( - move || { - feed(live, &id_refused) - .and_then(|feed| feed.refused.clone()) - .is_some() - }, - move || { - let id = id_refused_text.clone(); - text(move || { - format!( - "The bridge refused: {}", - feed(live, &id) - .and_then(|feed| feed.refused.clone()) - .unwrap_or_default() - ) - }) - .text_size(px(12.0)) - .text_color(rgb(theme::GOLD)) - }, - ), - ) + .child(when( + move || { + feed(live, &id_refused) + .and_then(|feed| feed.refused.clone()) + .is_some() + }, + move || { + let id = id_refused_text.clone(); + text(move || { + format!( + "The bridge refused: {}", + feed(live, &id) + .and_then(|feed| feed.refused.clone()) + .unwrap_or_default() + ) + }) + .text_size(px(12.0)) + .text_color(rgb(theme::GOLD)) + }, + )) .child( // herdr's recent lines for this pane: the watch's scrollback // first, the fetched output behind it. @@ -305,12 +294,10 @@ fn detail_body(live: Live, id: SharedString, output: Resource Option { - let pane = live - .snapshot - .with(|snap| { - snap.as_ref() - .and_then(|snap| snap.agent(id)) - .map(|agent| agent.pane_id.clone()) - })?; + let pane = live.snapshot.with(|snap| { + snap.as_ref() + .and_then(|snap| snap.agent(id)) + .map(|agent| agent.pane_id.clone()) + })?; live.panes.with(|panes| panes.get(&pane).cloned()) } diff --git a/app/src/agents/inbox.rs b/app/src/agents/inbox.rs index 70aa3e7..17c236c 100644 --- a/app/src/agents/inbox.rs +++ b/app/src/agents/inbox.rs @@ -22,12 +22,10 @@ pub fn inbox(nav: Nav) -> Screen { .flex_1() .flex_col() .bg(rgb(theme::GRAPHITE)) - .child( - when( - move || live.error.get().is_some(), - move || error_line(move || live.error.get().unwrap_or_default().into()), - ), - ) + .child(when( + move || live.error.get().is_some(), + move || error_line(move || live.error.get().unwrap_or_default().into()), + )) .child( virtual_list( move || live.inbox.with(Vec::len), @@ -40,9 +38,9 @@ pub fn inbox(nav: Nav) -> Screen { .px_4() .py_2() .on_press(move || { - let id = live - .inbox - .with(|items| items.get(at.index()).map(|item| item.id.clone())); + let id = live.inbox.with(|items| { + items.get(at.index()).map(|item| item.id.clone()) + }); if let Some(id) = id { nav.push(Route::Agent(id)); } @@ -51,9 +49,7 @@ pub fn inbox(nav: Nav) -> Screen { // The agent the event is about. text(move || { live.inbox - .with(|items| { - items.get(at.index()).map(event_label) - }) + .with(|items| items.get(at.index()).map(event_label)) .unwrap_or_default() }) .text_size(px(16.0)) @@ -73,8 +69,9 @@ pub fn inbox(nav: Nav) -> Screen { ) .estimated_item_size(px(64.0)) .keys(move || { - live.inbox - .with(|items| items.iter().map(|item| item.id.clone()).collect::>()) + live.inbox.with(|items| { + items.iter().map(|item| item.id.clone()).collect::>() + }) }) .separator(move || view().h(px(1.0)).mx_4().bg(rgb(theme::LINE))) .empty( diff --git a/app/src/agents/list.rs b/app/src/agents/list.rs index 8a6aafc..7156fed 100644 --- a/app/src/agents/list.rs +++ b/app/src/agents/list.rs @@ -71,19 +71,10 @@ pub fn list(nav: Nav) -> Screen { ) .child(open_inbox(nav)), ) - .child( - when( - move || live.error.get().is_some(), - move || { - error_line(move || { - live.error - .get() - .unwrap_or_default() - .into() - }) - }, - ), - ) + .child(when( + move || live.error.get().is_some(), + move || error_line(move || live.error.get().unwrap_or_default().into()), + )) .child( virtual_list( move || { @@ -98,13 +89,11 @@ pub fn list(nav: Nav) -> Screen { .gap_3() .px_4() .on_press(move || { - let id = live - .snapshot - .with(|snap| { - snap.as_ref() - .and_then(|snap| snap.agents.get(at.index()).cloned()) - .map(|agent| agent.id.clone()) - }); + let id = live.snapshot.with(|snap| { + snap.as_ref() + .and_then(|snap| snap.agents.get(at.index()).cloned()) + .map(|agent| agent.id.clone()) + }); if let Some(id) = id { nav.push(Route::Agent(id)); } @@ -114,7 +103,9 @@ pub fn list(nav: Nav) -> Screen { live.snapshot .with(|snap| { snap.as_ref() - .and_then(|snap| snap.agents.get(at.index()).cloned()) + .and_then(|snap| { + snap.agents.get(at.index()).cloned() + }) .map(|agent| agent.label().to_owned()) }) .unwrap_or_default() @@ -127,7 +118,9 @@ pub fn list(nav: Nav) -> Screen { live.snapshot .with(|snap| { snap.as_ref() - .and_then(|snap| snap.agents.get(at.index()).cloned()) + .and_then(|snap| { + snap.agents.get(at.index()).cloned() + }) .map(|agent| agent.status.clone()) }) .unwrap_or_default() @@ -137,14 +130,16 @@ pub fn list(nav: Nav) -> Screen { ) .estimated_item_size(px(56.0)) .keys(move || { - live.snapshot - .with(|snap| { - snap.as_ref() - .map(|snap| { - snap.agents.iter().map(|agent| agent.id.clone()).collect::>() - }) - .unwrap_or_default() - }) + live.snapshot.with(|snap| { + snap.as_ref() + .map(|snap| { + snap.agents + .iter() + .map(|agent| agent.id.clone()) + .collect::>() + }) + .unwrap_or_default() + }) }) .separator(move || view().h(px(1.0)).mx_4().bg(rgb(theme::LINE))) .empty( diff --git a/app/src/agents/mod.rs b/app/src/agents/mod.rs index e77e8b4..d53aaa4 100644 --- a/app/src/agents/mod.rs +++ b/app/src/agents/mod.rs @@ -67,11 +67,9 @@ pub(crate) fn status_pill(status: impl Fn() -> SharedString + Clone + 'static) - /// What a failed shared fetch shows. The live link retries itself every /// [`crate::net::live::POLL`], so this is the error text only. pub(crate) fn error_line(error: impl Fn() -> SharedString + Copy + 'static) -> impl IntoElement { - view().p_4().child( - text(error) - .text_size(px(13.0)) - .text_color(rgb(theme::DIM)), - ) + view() + .p_4() + .child(text(error).text_size(px(13.0)).text_color(rgb(theme::DIM))) } /// What a failed load shows: the error, and Retry, which refetches. @@ -84,11 +82,7 @@ pub(crate) fn error_note( .items_center() .gap_2() .p_4() - .child( - text(error) - .text_size(px(13.0)) - .text_color(rgb(theme::DIM)), - ) + .child(text(error).text_size(px(13.0)).text_color(rgb(theme::DIM))) .child( text("Retry") .text_size(px(15.0)) @@ -101,7 +95,9 @@ pub(crate) fn error_note( /// The link state one line, for the bottom of a page's header slot and the /// top of a page's content: what the WebSocket is doing right now. -pub(crate) fn link_line(link: impl Fn() -> crate::net::live::Link + Copy + 'static) -> impl IntoElement { +pub(crate) fn link_line( + link: impl Fn() -> crate::net::live::Link + Copy + 'static, +) -> impl IntoElement { view() .flex_row() .items_center() @@ -150,18 +146,16 @@ pub(crate) fn page_header(title: &'static str, nav: Nav) -> impl IntoElement { .border_color(rgb(theme::LINE)) .bg(rgb(theme::SURFACE)) .px_4() - .child( - when( - move || nav.depth() > 1, - move || { - text("Back") - .text_size(px(15.0)) - .text_color(rgb(theme::TEAL)) - .on_press(move || nav.back()) - .role(AccessibilityRole::Button) - }, - ), - ) + .child(when( + move || nav.depth() > 1, + move || { + text("Back") + .text_size(px(15.0)) + .text_color(rgb(theme::TEAL)) + .on_press(move || nav.back()) + .role(AccessibilityRole::Button) + }, + )) .child( text(title) .text_size(px(17.0)) From 05f104c1bdafbd3a93c1db45a7e87822020e4f59 Mon Sep 17 00:00:00 2001 From: VirtualMachinist Date: Sat, 14 Nov 2026 11:06:23 -0500 Subject: [PATCH 14/16] scripts/scratch: keep operator text out of the scratch panes The panes started the operator's interactive shell, so their scrollback held the login prompt, the typed reporter loop and job-control noise. Each pane now starts pane.sh through env -i and bash --noprofile --norc; it erases the prompt, the command echo and startup noise before printing, and never returns to a shell. Pane text is only PENDANT-SCRATCH-MARKER- plus the pane-1 ticker. Fixture content unchanged; the name guard still applies. --- scripts/scratch/README.md | 6 ++++++ scripts/scratch/pane.sh | 34 ++++++++++++++++++++++++++++++++++ scripts/scratch/seed.sh | 19 ++++++++++--------- 3 files changed, 50 insertions(+), 9 deletions(-) create mode 100755 scripts/scratch/pane.sh diff --git a/scripts/scratch/README.md b/scripts/scratch/README.md index b633f21..5847813 100644 --- a/scripts/scratch/README.md +++ b/scripts/scratch/README.md @@ -31,6 +31,12 @@ Each pane runs a reporter loop that re-reports its lifecycle state every couple of seconds. The state is transient by design: without the loop herdr drops a reported agent once the pane settles back at a plain shell prompt. +The loop lives in `pane.sh`, which each pane starts through `env -i` and a +`bash --noprofile --norc`. Before its first line it erases the operator prompt, +the echo of the command that started it, and any startup noise, and it never +returns to a shell. So a pane's text is only its marker (and the ticker on +pane 1): no username, hostname, home path or binary path. + Run the bridge against the session with: ```bash diff --git a/scripts/scratch/pane.sh b/scripts/scratch/pane.sh new file mode 100755 index 0000000..fff4bf4 --- /dev/null +++ b/scripts/scratch/pane.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +# What each scratch pane runs. Fixture output only: no operator prompt, no +# typed-command echo, no paths. +# +# Usage: pane.sh +# Env: HERDR_BIN, TICK_PANE, REFRESH_SECONDS. +set -u +set +m + +number="$1" +state="$2" +session="$3" +pane="$4" +herdr="${HERDR_BIN:-herdr}" +tick_pane="${TICK_PANE:-0}" +refresh="${REFRESH_SECONDS:-2}" + +# Drop the operator prompt, the echo of the command that started this script, +# and any startup noise before the first line of fixture output. The loop below +# never returns to a shell, so no new prompt is printed. +printf '\033[3J\033[2J\033[H' + +printf 'PENDANT-SCRATCH-MARKER-%s\n' "$number" +tick=0 +while :; do + "$herdr" --session "$session" pane report-agent "$pane" \ + --source custom:pendant-scratch --agent "scratch-$number" --state "$state" \ + >/dev/null 2>&1 || true + if [ "$number" = "$tick_pane" ]; then + tick=$((tick + 1)) + printf 'PENDANT-SCRATCH-TICK-%s\n' "$tick" + fi + sleep "$refresh" +done diff --git a/scripts/scratch/seed.sh b/scripts/scratch/seed.sh index 16b94f6..03455e0 100755 --- a/scripts/scratch/seed.sh +++ b/scripts/scratch/seed.sh @@ -18,7 +18,6 @@ HERDR="${HERDR_BIN:-$(command -v herdr)}" TICKER_INDEX=1 BLOCKED_INDEX=2 REFRESH_SECONDS=2 -SOURCE="custom:pendant-scratch" SOCK="$HOME/.config/herdr/sessions/$SESSION/herdr.sock" h() { "$HERDR" --session "$SESSION" "$@"; } @@ -52,19 +51,21 @@ third="$(split "$root" down)" fourth="$(split "$second" down)" panes=("$root" "$second" "$third" "$fourth") +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +PANE_RUNNER="$SCRIPT_DIR/pane.sh" + for index in "${!panes[@]}"; do pane="${panes[$index]}" number=$((index + 1)) state=idle [ "$number" -eq "$BLOCKED_INDEX" ] && state=blocked - h pane run "$pane" "echo PENDANT-SCRATCH-MARKER-$number" >/dev/null - loop="while :; do '$HERDR' --session '$SESSION' pane report-agent '$pane' --source '$SOURCE' --agent 'scratch-$number' --state '$state' >/dev/null 2>&1; " - if [ "$number" -eq "$TICKER_INDEX" ]; then - # One pane keeps writing so herdr emits frames; the marker stays in scrollback. - loop+='tick=$((tick+1)); printf "PENDANT-SCRATCH-TICK-%s\n" "$tick"; ' - fi - loop+="sleep $REFRESH_SECONDS; done" - h pane run "$pane" "$loop" >/dev/null + # The runner erases this typed line and the prompt before printing anything, + # so the pane holds fixture text only. env -i plus --noprofile --norc keeps + # the operator's shell out of it. + command="$(printf 'exec env -i HOME=%q PATH=%q HERDR_BIN=%q TICK_PANE=%q REFRESH_SECONDS=%q bash --noprofile --norc %q %q %q %q %q' \ + "$HOME" "$PATH" "$HERDR" "$TICKER_INDEX" "$REFRESH_SECONDS" \ + "$PANE_RUNNER" "$number" "$state" "$SESSION" "$pane")" + h pane run "$pane" "$command" >/dev/null done for _ in $(seq 1 100); do From 1e33f3f2325938d91c454c5a6897466dd72da925 Mon Sep 17 00:00:00 2001 From: VirtualMachinist Date: Sat, 14 Nov 2026 11:17:29 -0500 Subject: [PATCH 15/16] app: log watch, unwatch and page dismissals The live link now logs each watch and unwatch it sends, and the root logs a page leaving the stack natively, next to the frame lines, so a device log shows whether a pane is released when its page goes. Co-Authored-By: Claude Opus 5.5 --- app/src/lib.rs | 6 +++++- app/src/net/live.rs | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/src/lib.rs b/app/src/lib.rs index 907bd2e..3369ba7 100644 --- a/app/src/lib.rs +++ b/app/src/lib.rs @@ -131,7 +131,11 @@ pub fn App() -> impl IntoElement { }; // The user went back natively (swipe, Android back): drop the // page and any above it. - page.on_dismiss(move || routes.update(|r| r.truncate(index.get_untracked().max(1)))) + page.on_dismiss(move || { + let at = index.get_untracked().max(1); + net::live::trace(&format!("dismissed page {at}")); + routes.update(|r| r.truncate(at)); + }) }, )) } diff --git a/app/src/net/live.rs b/app/src/net/live.rs index 2c6d56e..b0b0fdb 100644 --- a/app/src/net/live.rs +++ b/app/src/net/live.rs @@ -98,6 +98,7 @@ thread_local! { impl Live { /// Start frames for `pane` (the agent's `pane_id`). pub fn watch(&self, pane: &str) { + trace(&format!("watch pane={pane}")); command(Cmd::Watch { pane: pane.to_owned(), cols: COLS, @@ -107,6 +108,7 @@ impl Live { /// Stop frames for `pane` and forget what it received. pub fn unwatch(&self, pane: &str) { + trace(&format!("unwatch pane={pane}")); command(Cmd::Unwatch(pane.to_owned())); self.panes.update(|panes| { panes.remove(pane); @@ -243,7 +245,7 @@ pub fn apply(panes: &mut BTreeMap, down: Down) { /// One line to the platform log (logcat on Android) and, on iOS, to the /// app's stderr, which `simctl launch --console` shows. -fn trace(line: &str) { +pub(crate) fn trace(line: &str) { log::info!(target: "pendant", "{line}"); #[cfg(target_os = "ios")] eprintln!("pendant: {line}"); From 44bb0fe61c59bcb0f7a7e48ffbf881a2d8db1f00 Mon Sep 17 00:00:00 2001 From: frontend Date: Sat, 14 Nov 2026 11:18:14 -0500 Subject: [PATCH 16/16] app: keep the watched pane id out of page-owner signals --- app/src/agents/detail.rs | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/app/src/agents/detail.rs b/app/src/agents/detail.rs index 48d2a0f..34069fc 100644 --- a/app/src/agents/detail.rs +++ b/app/src/agents/detail.rs @@ -1,6 +1,9 @@ //! One agent: its status, herdr's recent output, and the pane frames the //! live link watches for it. +use std::cell::RefCell; +use std::rc::Rc; + use nsh_base::nav_page; use nsh_core::prelude::*; @@ -31,10 +34,16 @@ pub fn detail(nav: Nav, id: String) -> Screen { // The agent's pane: watched once the snapshot names it, and left when // the page does. The guard keeps the 3 s snapshot refresh from // watch/unwatch churn. + // + // The watched id lives in an Rc slot, not a signal: the page owner's + // signals are disposed before its cleanups run, and a cleanup that + // reads a disposed signal fails without unwatching (a Back then keeps + // the pane's frames flowing). let watch_id = id.clone(); - let watched = signal(None::); + let watched = Rc::new(RefCell::new(None::)); + let effect_watched = Rc::clone(&watched); effect(move || { - if watched.get_untracked().is_some() { + if effect_watched.borrow().is_some() { return; } let pane = live.snapshot.with(|snap| { @@ -44,11 +53,12 @@ pub fn detail(nav: Nav, id: String) -> Screen { }); if let Some(pane) = pane { live.watch(&pane); - watched.set(Some(pane)); + *effect_watched.borrow_mut() = Some(pane); } }); + let cleanup_watched = watched; cleanup(move || { - if let Some(pane) = watched.get_untracked() { + if let Some(pane) = cleanup_watched.borrow_mut().take() { live.unwatch(&pane); } });