Commit Graph

147 Commits

Author SHA1 Message Date
tlongwell-block
2d818b6efd iroh-relay: review fixups from Mari + Max
Mari (trust):
- Add 64 KiB pre-decode length cap on the bearer token. NIP-98 events are
  well under a kilobyte; rejecting oversized inputs before allocating the
  base64 decode buffer prevents an admission request from coercing the
  relay into multi-megabyte allocations. New const MAX_BEARER_LEN.
- New verify_bearer_rejects_oversized_token test.
- New verify_bearer_rejects_internal_whitespace test: pins the fact that
  base64 0.22's general_purpose engines reject mid-token whitespace
  (no MIME mode), which is what we want.

Max (review):
- Soften the module-level 'patched-fork hooks' docs so they don't imply
  the per-client max-lifetime hook is already wired, and add an explicit
  TODO(patched-iroh-relay) marker at the future insertion site in spawn.
- Add SPROUT_IROH_RELAY_BIND_ADDR to Config (iroh_relay_bind_addr:
  Option<SocketAddr>) now, so the main.rs wiring follow-up can read it
  without a separate config churn. Server::spawn owns its own listener,
  so this is independent of the Sprout HTTP bind_addr.

sprout-relay --lib: 206 -> 208 tests pass (+2).
workspace clippy -D warnings: clean.
workspace cargo fmt --check: clean.

Signed-off-by: Tyler Longwell <109685178+tlongwell-block@users.noreply.github.com>
Co-authored-by: Dawn (sprout agent) <c6237ef84fa537c78dcee78efd2d4e59f728859c7f194da42ac51ededfa0be05@sprout-oss.stage.blox.sqprod.co>
2026-05-19 15:46:31 -04:00
tlongwell-block
3ca6918078 mesh-llm plan v6.1: Step 3 — embedded iroh-relay with NIP-98 admission
- New module crates/sprout-relay/src/iroh_relay.rs (~290 lines incl. tests).
- pub fn spawn(state, bind_addr) constructs an iroh_relay::server::Server
  with AccessConfig::Restricted set to a closure that:
    1. Pulls the Bearer token from ClientRequest::auth_token().
    2. base64-decodes (accepts STANDARD + URL_SAFE, padded or not).
    3. Calls sprout_auth::verify_nip98_event against canonical URL
       (= sprout_auth::nip98_canonical_url(public_url, '/relay')).
    4. Runs check_relay_membership against the NIP-98 pubkey.
       Anything other than Member/ViaOwner/OpenRelay -> Deny.
  Per Max's review notes: fail-closed on missing/invalid token, run
  membership only after NIP-98 verifies the pubkey, no caching.
- Returns Ok(None) gracefully when SPROUT_IROH_RELAY_PUBLIC_URL is unset
  (the canonical URL can't be built without it).
- patched-iroh-relay feature flag reserved for upstream PR C's per-client
  max-lifetime hook (kept behind cfg so unpatched rc.0 still compiles).

- MSRV bumped from 1.88.0 -> 1.91.0 (iroh-relay rc.0's MSRV). Repo's
  rust-toolchain.toml already pins 1.95.0 so builds are unaffected; the
  bump just keeps Cargo.toml honest with the actual transitive floor.
- README updated: 'Rust 1.88+' -> 'Rust 1.91+'.
- crates/sprout-relay/Cargo.toml: added
  iroh-relay = { version = "=1.0.0-rc.0", features = ["server"] }
  plus the patched-iroh-relay feature.

Tests (rustc 1.95, via rust-toolchain.toml; also verified independently
on 1.91.1):
- sprout-relay --lib: 195 -> 206 (+11 iroh_relay tests covering valid
  admission, missing/empty/non-base64/wrong-method/wrong-URL/wrong-kind/
  stale-timestamp denials, and bearer-encoding round-trips).
- cargo clippy --workspace --all-targets -- -D warnings: clean.
- cargo fmt --all -- --check: clean.

Signed-off-by: Tyler Longwell <109685178+tlongwell-block@users.noreply.github.com>
Co-authored-by: Dawn (sprout agent) <c6237ef84fa537c78dcee78efd2d4e59f728859c7f194da42ac51ededfa0be05@sprout-oss.stage.blox.sqprod.co>
2026-05-19 15:39:35 -04:00
tlongwell-block
f4ca099b1c mesh-llm plan v6.1: Steps 1, 2, 4, 5
- Step 1: KIND_MESH_LLM_DISCOVERY = 31990 (parameterized replaceable,
  global-only, MessagesWrite scope) — relay members announce compute offers
  through the same NIP-43-gated fan-out path as messages.

- Step 2: extract transport-neutral check_relay_membership returning
  MembershipDecision. HTTP enforce_relay_membership becomes a thin
  wrapper that maps Denied -> 403 JSON. Same behavior for all 6 existing
  HTTP callers; non-HTTP gates (iroh-relay AccessConfig) can call the
  core directly without a StatusCode in their return type.

- Step 4: NIP-11 iroh_relay_url field, fed from new
  SPROUT_IROH_RELAY_PUBLIC_URL config. Absent unless configured (older
  clients unaffected). This is what mesh-llm sidecars read to wire their
  iroh endpoints to Sprout's own relay -- no out-of-band config required.

- Step 5: sprout-auth::nip98_canonical_url helper. Single source of truth
  for the NIP-98 'u'-tag value, used by both signer and verifier. Suffix-
  aware path join (preserves /iroh prefix when joining /relay), localhost/
  IPv6 loopback collapse, query+fragment stripping. Round-trip test signs
  with the helper and verifies through verify_nip98_event to prevent drift.

sprout-core: 165 tests pass
sprout-auth: 36 -> 48 tests pass (+12 nip98_url)
sprout-relay: 190 -> 195 tests pass (+3 mesh-llm, +2 iroh_relay_url)
workspace clippy -D warnings: clean
workspace cargo fmt --check: clean

Signed-off-by: Tyler Longwell <109685178+tlongwell-block@users.noreply.github.com>
Co-authored-by: Dawn (sprout agent) <c6237ef84fa537c78dcee78efd2d4e59f728859c7f194da42ac51ededfa0be05@sprout-oss.stage.blox.sqprod.co>
2026-05-19 15:33:13 -04:00
tlongwell-block
24520aa2b1 NIP-AE: agent engrams (kind:30174) — core memory injection + sprout mem CLI (#593)
Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
Signed-off-by: Tyler Longwell <109685178+tlongwell-block@users.noreply.github.com>
2026-05-19 13:16:37 -04:00
tlongwell-block
6e1418e571 feat(huddle): fix concurrent-speaker mixing + jitter buffer + protocol v2 (up to 10 peers) (#609)
Signed-off-by: tlongwell-block <109685178+tlongwell-block@users.noreply.github.com>
2026-05-18 16:34:52 -04:00
tlongwell-block
70cb53e2c7 Add Sprig all-in-one agent binary (#605)
Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
2026-05-17 13:31:58 -04:00
tlongwell-block
e4e9923799 feat(agent): add OpenAI Responses API with auto endpoint detection (#604)
Signed-off-by: Tyler Longwell <109685178+tlongwell-block@users.noreply.github.com>
2026-05-16 21:23:33 -04:00
tlongwell-block
92c859043c dev-mcp: add view_image tool (#602)
Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
2026-05-15 16:21:16 -04:00
tlongwell-block
7171d4954d fix(relay,desktop): only advertise NIP-43 when enforced; probe pairing by supported_nips (#601)
Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
2026-05-15 15:11:37 -04:00
tlongwell-block
9e94a7c475 fix(agent): fix OpenAI-compat request body serialization and max_tokens (#595) 2026-05-15 11:07:14 -04:00
Will Pfleger
1d8a130b32 refactor(cli): restructure flat commands into 12 subcommand groups (#585) 2026-05-14 19:13:49 -04:00
Will Pfleger
01a3df7f1f feat(sdk): add builder functions for workflows, DMs, and presence (#589) 2026-05-14 18:49:57 -04:00
tlongwell-block
1b87a0905f refactor: extract shared @mention resolver into sprout-sdk (#580)
Signed-off-by: Tyler Longwell <109685178+tlongwell-block@users.noreply.github.com>
Co-authored-by: npub1cc3ha7z055mu0rwwu7806t2wt8mj3pvu0uv5mfp2c50dahaqhczshdalg6 <c6237ef84fa537c78dcee78efd2d4e59f728859c7f194da42ac51ededfa0be05@sprout-oss.stage.blox.sqprod.co>
Co-authored-by: Dawn <dawn@sprout.local>
2026-05-14 11:38:52 -04:00
Matt Toohey
2ee7356424 fix: add default-run to sprout-relay so cargo run -p sprout-relay works (#577)
Signed-off-by: Matt Toohey <contact@matttoohey.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-14 08:34:23 -07:00
tlongwell-block
9a403d3e8a fix: channel member search via NIP-50 + Typesense indexer fix for kind:0 (#569)
Signed-off-by: Tyler Longwell <109685178+tlongwell-block@users.noreply.github.com>
2026-05-13 15:03:35 -04:00
tlongwell-block
8d5abb7a09 chore(acp): raise default idle timeout from 320s to 620s (#566)
Signed-off-by: Tyler Longwell <109685178+tlongwell-block@users.noreply.github.com>
2026-05-13 11:04:53 -04:00
tlongwell-block
e427581ca3 fix(cli): derive thread root from parent event tags (#564)
Signed-off-by: tlongwell-block <109685178+tlongwell-block@users.noreply.github.com>
2026-05-13 09:54:43 -04:00
tlongwell-block
90063cf5f0 fix: skip empty assistant turns instead of placeholder space (#560) 2026-05-13 09:40:41 -04:00
tlongwell-block
80b79c4f75 agent: raise default SPROUT_AGENT_MAX_OUTPUT_TOKENS to 32768 (#565)
Co-authored-by: Tyler Longwell <tlongwell-block@users.noreply.github.com>
2026-05-13 13:03:56 +00:00
tlongwell-block
cacfe6b84e fix(nip11): advertise auth_required: true to match actual enforcement (#556)
Signed-off-by: Tyler Longwell <109685178+tlongwell-block@users.noreply.github.com>
2026-05-12 20:08:53 -04:00
tlongwell-block
69734bff00 fix: Anthropic rejects empty text blocks in assistant history (#559) 2026-05-12 19:41:50 -04:00
tlongwell-block
a33d73bf6d agent: make max_sessions default unlimited (#547) 2026-05-12 17:32:19 -04:00
tlongwell-block
08e00a6f0a fix(relay): auto-create git_repo_path so kind:30617 init can't silently fail (#545) 2026-05-12 16:40:38 -04:00
tlongwell-block
385e1716b7 agent+acp: preserve session on retriable agent errors (#544) 2026-05-12 13:57:02 -04:00
tlongwell-block
6b4f9f05d4 cli: add display name lookup to get-users (#543) 2026-05-11 20:41:02 -04:00
tlongwell-block
23f1637728 fix: classify agent JSON-RPC errors as application errors, not transport (#539) 2026-05-11 17:44:34 -04:00
tlongwell-block
d953d0ecb4 fix: default max_rounds to 0 (unlimited) (#540) 2026-05-11 20:09:25 +00:00
Wes
1d604e8b2e Update Rust dependencies for pair relay (#534) 2026-05-11 10:47:22 -07:00
tlongwell-block
98030c526a feat: Git repository management commands (#533) 2026-05-11 13:40:51 -04:00
tlongwell-block
120b1b0c06 Add sprout-agent avatar image (#530) 2026-05-11 17:05:35 +00:00
tlongwell-block
22f1e0b724 Launch sprout-agent from the desktop GUI (#529) 2026-05-11 12:36:53 -04:00
tlongwell-block
70a691517b feat: automatic git auth and signing for sprout agents (#528) 2026-05-11 10:38:45 -04:00
tlongwell-block
91f16e326f feat: embed sprout CLI in dev-mcp, add NIP-OA auth tag support (#525) 2026-05-11 06:57:34 -04:00
tlongwell-block
082414bf3f feat: sprout-agent + sprout-dev-mcp — minimal ACP coding agent (#493) 2026-05-10 22:33:58 -04:00
tlongwell-block
32c3fd1340 fix: extract NIP-OA owner on open relays for observer frame auth (#513) 2026-05-08 16:00:23 -04:00
Wes
0f10861850 feat(desktop): expand default agent toolsets with canvas, forums, dms, and member list (#510)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-08 10:10:06 -07:00
Wes
0dcfa86f84 chore: remove dead API token references from GUI, docs, and config (#498)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-07 19:07:44 +00:00
tlongwell-block
1f1f8740e7 feat: materialize agent_owner_pubkey on NIP-OA auth (#491) 2026-05-06 16:08:21 +00:00
tlongwell-block
2357c3ddb3 fix: unify NIP-OA relay membership enforcement across all ingress paths (#490) 2026-05-06 11:01:39 -04:00
tlongwell-block
ceb5afd2d4 fix(relay): raise MAX_HISTORICAL_LIMIT from 500 to 10,000 (#486) 2026-05-05 20:44:29 +00:00
Wes
3a12369491 feat: serve web UI from relay + repos page redesign (#479)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-05 19:20:13 +00:00
tlongwell-block
4701bd6f32 fix(relay): include p tags in kind:39000 for DM channels (#482) 2026-05-05 19:10:52 +00:00
tlongwell-block
ea62664759 post-475 fixes (#481)
Co-authored-by: Wes <wesb@block.xyz>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-05 14:41:18 -04:00
tlongwell-block
454781caae Sprout speaks Nostr. Nothing else. (#475) 2026-05-05 12:03:06 -04:00
tlongwell-block
df33818b5b feat(relay): NIP-OA agent authentication for NIP-43 membership (WS + REST + git) (#471) 2026-05-04 12:12:22 -04:00
tlongwell-block
15bd9ba2ac feat: sprout-pair-relay — ephemeral sidecar for NIP-AB device pairing (#467) 2026-05-03 21:07:36 -04:00
tlongwell-block
1feb18e2e0 feat(git-sign-nostr): implement NIP-GS git object signing with Nostr keys (#459) 2026-05-03 10:05:30 -04:00
tlongwell-block
3cabe94c2b feat: relay membership with NIP-43 compliance (#448) 2026-05-01 19:11:32 -04:00
Wes
d84f8c605c feat(relay): add NIP-38 user status support (kind:30315) (#446)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-01 17:48:21 +00:00
tlongwell-block
3899ca566d feat(git): Role-based push permissions with service-bound auth (#441)
Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
Co-authored-by: Tyler Longwell <tlongwell@block.xyz>
2026-05-01 00:25:33 -04:00