Commit Graph
97 Commits
Author SHA1 Message Date
Michael Neale 51c89d4e64 fix(serverless): standard multi-relay Nostr — fix split-brain reads, query flood, single-relay live subscription
The serverless transport was behaving like it talked to the bespoke Sprout
server instead of a standard multi-relay Nostr client. Three real bugs:

1. Split-brain: messages were sent over the multi-relay pool (landing on
   whichever relay accepts, e.g. nos.lol when damus rate-limits) but READ over
   a single-relay live WS (damus only) — so your own message was invisible.
   Fix: in serverless, send + history + LIVE SUBSCRIPTION all go through the
   Rust multi-relay pool. New persistent pool subscribe()/unsubscribe() keeps a
   REQ open on ALL relays at once and merges+dedups (standard Nostr, like damus
   SimplePool). New commands: query_channel_messages, subscribe/unsubscribe_
   channel_messages; events streamed to the UI via serverless-event:<channel>.

2. Query flood: get_channels ran {kinds:[39000],limit:5000} (discover ALL
   network channels) + a 500-id member-count batch on a public relay. Fix:
   serverless skips network-wide discovery; only your member channels are
   listed (4 scoped queries).

3. Diagnostics: added [serverless]/[pool] backend logging and [relay] webview
   console logging so failures are visible, not silent.

Proven with live tests against damus+nos.lol: multi-relay publish survives
per-relay rate-limit, and the live subscription delivers a message published
to a different relay than the naive primary (the split-brain fix).
2026-06-02 15:35:28 +10:00
Michael Neale 8e8f93a85b fix(serverless): local-only agents, rate-limit retry, channel delete
- list_relay_agents returns empty in serverless: managed agents are local
  desktop subprocesses, not a relay registry. Fixes 'agent parse failed:
  missing field name' from foreign kind-10100 events on public relays.
- submit_event_ws retries once on all-relays-rate-limited (public relays
  throttle the write burst when adding an agent). Succeeds if any relay
  accepts. Fixes 'Failed to add goose: rate-limited'.
- delete_channel publishes NIP-09 (kind 5) deletion over the 39000/39002
  addressable coordinates in serverless mode (the kind-9008 command is a
  no-op on a generic relay). Owner-only.
- Tests + file-size exception.
2026-06-02 14:37:02 +10:00
Michael Neale 6b756dae1e fix(serverless): record member roles in kind:39002 (creator=owner)
The serverless membership event only stored bare ['p', pubkey] tags with
no role, so every member — including the channel creator — read back as
'member'. This hid the member-invite card on private channels (it requires
owner/admin) and diverged from server mode, where the relay assigns the
creator 'owner'.

Store roles as the 4th p-tag element (['p', pubkey, '', role]) — the NIP-29
convention channel_members_from_event already reads. Creator = owner; new
members default to 'member'; role changes remove+re-add; existing members
keep their role across read-modify-write. Matches server-mode data shape.
2026-06-02 14:23:57 +10:00
Michael Neale 74deb9cf77 feat(serverless): NIP-17 encrypted DMs + private channels (desktop)
Serverless private channels and DMs are made private by encryption (no
server to enforce access). Messages are NIP-17 gift-wrapped (kind 1059)
to every member; the relay only sees opaque blobs addressed by #p.

- crate::encrypted: build_gift_wraps (one per member) + unwrap_gift
- send_channel_message: routes serverless DM/private channels through
  encryption (rumor=kind9 with h tag -> seal -> wrap per member)
- decrypt_gift_wrap command + relayClient encrypted fetch/subscribe
  (query kind1059 #p=me, decrypt, route by inner h tag)
- proven end-to-end over wss://relay.damus.io (group A->{A,B,C}, B reads)

Agent-side gift-wrap support (sprout-acp) follows separately.
2026-06-02 10:10:10 +10:00
Michael Neale 858cb3b02a fix(serverless): allow self-tagging on channel membership events
The 'join to participate, nothing happens' bug: when a user creates or
joins a serverless channel they p-tag themselves (the signer). nostr 0.44
strips self-referencing p tags at sign time unless .allow_self_tagging()
is set, so kind:39002 membership events were published with an EMPTY
member list. get_channels then queries 39002 by #p:[me], finds nothing,
and the UI stays stuck on 'join to participate' forever.

(This worked in the old TS/slackest codebase because nostr-tools does not
perform that scrub.)

Fix: add .allow_self_tagging() to the serverless 39000 + 39002 builders
in both desktop events.rs and the shared sprout-sdk builders (CLI/agents).

Reproduced and verified end-to-end against wss://relay.damus.io via a new
#[ignore] integration test (serverless_create_join_roundtrip): create ->
join -> both members visible. Added no-network unit regression guards
(serverless_{members,metadata}_keeps_self_p_tag) in both crates.

clippy clean (desktop+sdk+cli); desktop + sdk tests pass; file-size gate ok.
2026-06-02 08:43:09 +10:00
Michael Neale fc832f4d5d fix(serverless): membership via direct kind:39002 (join/leave/add/remove) + CLI channel ops
In serverless mode there's no relay to process membership command kinds
(9021 join, 9022 leave, 9000/9001 add/remove member). The client now mutates
the replaceable kind:39002 member-list event directly (read-modify-write).

- desktop: join/leave/add/remove_channel_member publish 39002 directly
- sprout-sdk: build_channel_metadata_serverless (39000) +
  build_channel_members_serverless (39002), shared builders
- sprout-cli: channels create/join/leave/add-member/remove-member serverless
  branches (fixes agent replies + CLI parity with desktop)

Verified end-to-end against wss://relay.damus.io: create -> list -> send ->
read all round-trip with zero Sprout infrastructure.
2026-06-02 08:33:06 +10:00
Michael Neale 84f84931f1 feat(serverless): run channels, DMs, messages, and agents against a generic Nostr relay
Adds a 'serverless' workspace mode that points the desktop app at any generic
public Nostr relay (e.g. wss://relay.damus.io) with zero Sprout server
infrastructure — no Postgres, no HTTP /query|/events bridge, no NIP-98 auth.
Reuses Sprout's native event kinds (39000 channel metadata, 39002 membership,
kind 9 messages, h-tag scoping); 'serverless' is purely a transport + auth
concern, so the server-mode path is untouched.

Transport: reads/writes go over plain WebSocket (REQ/EOSE, EVENT/OK) instead
of the HTTP bridge; NIP-42 AUTH is answered only if the relay challenges.

Desktop backend:
- AppState.serverless flag + is_serverless(); apply_workspace gains a flag
- ws_relay.rs: query_relay_ws / submit_event_ws / publish_signed_event_ws
- relay.rs: query_relay/submit_event + agent profile sync branch to WS
- events.rs: build_channel_metadata_serverless (39000) + members (39002)
- create_channel/open_dm publish those events directly (DM ids = UUIDv5 over
  sorted participants so both sides converge without a server)
- managed agents inherit SPROUT_SERVERLESS into the ACP subprocess env

Agents (full support, not a follow-up):
- sprout-acp: RestClient + HarnessRelay gain serverless mode; query/submit use
  plain WS, NIP-42 handshake skipped on (re)connect; SPROUT_SERVERLESS env/arg
- sprout-cli: SproutClient serverless WS query/submit; --serverless flag,
  to_ws_url helper, NetworkMsg error variant
- npub respond-to permissions are in-process and work unchanged

Frontend:
- Workspace.mode + workspaceMode()/isServerlessWorkspace() helpers
- relayClient.setServerless() skips the AUTH-wait on connect; late challenges
  still answered so writes succeed on relays that require auth
- ServerlessContext/useIsServerless() hides search, pulse, projects, workflows
- Serverless toggle in the Add Workspace dialog and Welcome screen

Docs: docs/SPROUT_LITE_MODE.md updated with the implementation + testing steps.
2026-06-01 20:42:29 +10:00
Will PflegerandGitHub 7beb0f8e68 fix(desktop): reap orphaned agent processes on shutdown and restart (#787) 2026-05-29 18:18:55 +00:00
Will PflegerandGitHub fa7febe40f fix(desktop): sync persona pack directory across worktree instances (#782) 2026-05-28 20:41:23 -04:00
Will PflegerandGitHub 3f3ec64791 feat(desktop): thread-aware notifications with mutable follow/mute controls (#761) 2026-05-28 18:43:41 -04:00
Will PflegerandGitHub f42839c740 feat(desktop): worktree agent data sync, retired persona cleanup, mcp_command reconciliation (#728)
Signed-off-by: Will Pfleger <wpfleger@block.xyz>
2026-05-27 16:46:16 -04:00
WesandGitHub 8946653af8 fix(desktop): add support for deeplinking to channel/messages (#759)
Signed-off-by: Wes <wesbillman@users.noreply.github.com>
2026-05-27 12:27:34 -07:00
f1e25b21da feat(desktop): editable attachments + data-loss fix on message edit (#755)
Signed-off-by: Wes <wesbillman@users.noreply.github.com>
Co-authored-by: summer <summer@sprout>
2026-05-26 19:59:06 -07:00
Will PflegerandGitHub 7df4681fee feat(desktop): dock bounce, mark-as-read toggle, and bulk mark-all-read (#753) 2026-05-26 17:38:29 -07:00
Will PflegerandGitHub b13db17faf feat(desktop): two-layer agent prompts + dynamic AGENTS.md + MCP gating + harness-agnostic skill path (#584)
Signed-off-by: Will Pfleger <wpfleger@block.xyz>
2026-05-26 17:46:30 -04:00
tlongwell-blockandGitHub 79399d9b8e feat: NIP-IA identity archival (relay backend + desktop) (#733)
Signed-off-by: tlongwell-block <109685178+tlongwell-block@users.noreply.github.com>
2026-05-23 12:03:38 -04:00
Will PflegerandGitHub 4269fd2720 Show all ACP runtimes with install status and one-click install (#724) 2026-05-22 20:33:35 -04:00
a96cb487f4 fix(desktop): project home read-state from the shared NIP-RS marker (#631)
Signed-off-by: tlongwell-block <109685178+tlongwell-block@users.noreply.github.com>
Co-authored-by: Dawn (sprout agent) <c6237ef84fa537c78dcee78efd2d4e59f728859c7f194da42ac51ededfa0be05@sprout-oss.stage.blox.sqprod.co>
2026-05-20 17:13:59 -04:00
Taylor HoandGitHub af08b0f0e8 fix: prevent agent proliferation when adding bots to channels (#621) 2026-05-20 12:08:34 -07:00
Mat BalezandGitHub 2da3402f10 [codex] Add copy button for rendered code blocks (#619)
Signed-off-by: Mat Balez <60949391+matbalez@users.noreply.github.com>
2026-05-20 14:25:03 +00:00
5370a75ca4 feat(relay): surface connection loss in the workspace header (#623)
Signed-off-by: Tyler Longwell <109685178+tlongwell-block@users.noreply.github.com>
Co-authored-by: Dawn <c6237ef84fa537c78dcee78efd2d4e59f728859c7f194da42ac51ededfa0be05@sprout-oss.stage.blox.sqprod.co>
2026-05-20 09:36:52 -04:00
c0eb5affcf refactor(huddle): switch local TTS to Pocket TTS (Kyutai/sherpa-onnx) (#607)
Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
Signed-off-by: npub1cc3ha7z055mu0rwwu7806t2wt8mj3pvu0uv5mfp2c50dahaqhczshdalg6 <c6237ef84fa537c78dcee78efd2d4e59f728859c7f194da42ac51ededfa0be05@sprout-oss.stage.blox.sqprod.co>
Co-authored-by: npub1cc3ha7z055mu0rwwu7806t2wt8mj3pvu0uv5mfp2c50dahaqhczshdalg6 <c6237ef84fa537c78dcee78efd2d4e59f728859c7f194da42ac51ededfa0be05@sprout-oss.stage.blox.sqprod.co>
2026-05-18 14:28:27 -04:00
tlongwell-blockandGitHub 3daf8d6ae1 feat(huddle): swap STT default to Parakeet TDT-CTC 110M (EN, int8) (#562)
Signed-off-by: Tyler Longwell <109685178+tlongwell-block@users.noreply.github.com>
Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
2026-05-15 22:22:05 -04:00
tlongwell-blockandGitHub 32347d117c feat(desktop): per-persona and per-agent env var overrides (#594) 2026-05-15 10:43:00 -04:00
tlongwell-blockandGitHub 3a3501c77b fix(desktop): autofocus message composer on channel/thread open (#572)
Signed-off-by: Tyler Longwell <109685178+tlongwell-block@users.noreply.github.com>
2026-05-14 20:35:44 -04:00
efbdc7bfd5 feat(desktop): persona-first agent UX + bug fixes (#570)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-13 15:13:41 -07:00
tlongwell-blockandGitHub 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
8716aefa3c fix(desktop): use resolve_command for ffmpeg discovery in sandboxed app (#568)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-13 11:00:00 -07:00
tlongwell-blockandGitHub 9c258e4beb feat(desktop): GUI for agent respond-to gate (owner-only / anyone / allowlist) (#557) 2026-05-13 12:48:42 -04:00
ef5fdca792 feat(desktop): add Projects as first-class top-level view (#546)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-12 10:51:09 -07:00
1b9f6169ee feat(desktop): channel templates — reusable project settings (#538)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-11 12:31:25 -07:00
tlongwell-blockandGitHub 22f1e0b724 Launch sprout-agent from the desktop GUI (#529) 2026-05-11 12:36:53 -04:00
5fff9239fa feat(desktop): notification sound + sender names in titles (#501)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-07 17:25:29 -07:00
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
27bcd45cc9 Refresh built-in personas: Solo, Kit, Scout + Kit & Scout team (#499)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-07 18:22:26 +00:00
f309446f22 Polish reply timeline interactions (#477)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-07 09:43:47 -07:00
ec489c5b1a feat(desktop): add keep awake while agents are active setting (#484)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-05 13:14:00 -07:00
tlongwell-blockandGitHub 454781caae Sprout speaks Nostr. Nothing else. (#475) 2026-05-05 12:03:06 -04:00
Luis PadronandGitHub f08d4f4034 ci(release): sign and notarize macOS build via apple-codesign-action (#472) 2026-05-04 12:06:47 -04:00
tlongwell-blockandGitHub 8916825c45 feat(pairing): auto-detect NIP-43 relay and route target to /pair sidecar (#470) 2026-05-03 22:12:14 -04:00
35d0c2da5e fix(ci): add ad-hoc code signing to OSS release build (#466)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-03 12:15:19 -07:00
31e23cfc3b fix(ci): add verbose output and fix release config double-merge (#464)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-03 18:05:57 +00:00
WesandGitHub 22cb8129e5 feat(desktop): add OSS release workflow and auto-updater support (#461) 2026-05-03 16:21:58 +00:00
f946e9b68a feat: user profile panel with hover popover and click-to-expand (#456)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-02 15:21:26 -07:00
e105c9ea5e feat(desktop): add relay membership admin UI in settings (#454)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-02 16:56:41 +00:00
tlongwell-blockandGitHub c9f287958d feat(desktop): wire git-credential-nostr into agent spawn path (#451) 2026-05-02 11:46:49 -04:00
56f5062b74 feat: add NIP-38 user status for desktop and mobile (#449)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-01 17:02:59 -07:00
Bradley AxenandGitHub 7c2c556d72 feat: Add local ACP session observer (#412) 2026-04-29 04:21:58 +00:00
2a01ca590d Implement NIP-RS unread state sync (#420)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-28 20:54:09 -07:00
00a4aaba3d fix(desktop): key-based React remount for workspace switching (#415)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-28 18:13:12 +00:00