Commit Graph

766 Commits

Author SHA1 Message Date
Michael Neale
037b973793 fix(serverless): resolve replaceable events to latest copy; publish agent profile
Membership/metadata reads used limit:1 + first(), picking an arbitrary
kind:39002/39000 copy when relays disagreed. A stale copy on one relay
(e.g. a dropped write) could be read and then clobber members on the next
read-modify-write. Add latest_event/latest_by_d_tag (max created_at, id
tie-break) and apply at all four read sites; drop the limit truncation in
get_channels.

Agents only published presence (kind:20001), never a kind:0 profile, so
clients showed a raw hex pubkey. Add publish_profile (name/display_name/
about/picture) at startup, sourced from the persona display_name with a
title-cased fallback from the agent command (goose -> Goose).

Tests: membership latest-wins resolution + profile metadata/name fallback.
2026-06-06 13:39:38 +10:00
Michael Neale
2873d2f161 fix(serverless): drop nostr.band relay, bound read tail-latency
- Replace relay.nostr.band (indexer relay that never completes a plain
  client WS handshake — observed 0/10 connects, only ever cost connect
  timeouts) with relay.primal.net (fast, free, anon read/write).
- query_relay_ws no longer uses join_all (which waited for the slowest
  relay). It now returns on the first relay's response plus an 800ms
  grace window for stragglers, so a slow-but-alive relay can't drag every
  read out to the full 6s per-relay QUERY_TIMEOUT. Dead relays were
  already skipped via the pool's failure cooldown; this fixes the
  slow-but-connected case.
2026-06-05 14:21:56 +10:00
Michael Neale
21532f6a14 Merge remote-tracking branch 'origin/main' into micn/serverless-mode
* origin/main:
  chore(release): release version 0.3.11 (#865)
  fix(mobile+desktop): cross-device read state sync + diagnostic logging (#843)
  feat(mobile): star channels (Slack-style favorites) (#863)
  feat: desktop-screenshot skill to stop agents uploading relay media to PRs (#862)
  feat(desktop): star channels (Slack-style favorites) (#860)
  fix(desktop): handle symlinked persona pack directories (#859)
  feat: channel muting for desktop and mobile (#838)
  feat(acp): default SPROUT_ACP_MEMORY to on (#854)
  fix(desktop): eliminate image-hover layout jump in messages (#813)
  chore(release): release version 0.3.10 (#849)
  fix(desktop): harden relay mesh connect p-tag (#834)
  fix(desktop): scroll activity panel to bottom on open (#848)
  Polish desktop profile menu interactions (#836)
  fix(desktop): outline thread hover targets (#845)
  fix(desktop): keep message actions hover-only (#844)
  fix(desktop): let inbox composer fill available width (#841)

# Conflicts:
#	desktop/src/app/AppShell.tsx
#	desktop/src/features/workspaces/useWorkspaceInit.ts
2026-06-05 12:52:08 +10:00
Wes
baf1f7705f chore(release): release version 0.3.11 (#865) v0.3.11 2026-06-04 17:34:15 -07:00
Will Pfleger
269b35e8de fix(mobile+desktop): cross-device read state sync + diagnostic logging (#843) 2026-06-04 18:55:40 -04:00
Wes
3ddfe5fcc2 feat(mobile): star channels (Slack-style favorites) (#863)
Signed-off-by: Wes <wesbillman@users.noreply.github.com>
Co-authored-by: Brain <21994759fc7a6fa6b965551d35cfd7897d262f2495467f2d78694ddcfa6a5c7e@sprout-oss.stage.blox.sqprod.co>
2026-06-04 15:48:59 -07:00
Will Pfleger
36d7dbd7ca feat: desktop-screenshot skill to stop agents uploading relay media to PRs (#862) 2026-06-04 18:35:10 -04:00
Wes
c10b4f8f5c feat(desktop): star channels (Slack-style favorites) (#860)
Signed-off-by: Wes <wesbillman@users.noreply.github.com>
Co-authored-by: Brain <21994759fc7a6fa6b965551d35cfd7897d262f2495467f2d78694ddcfa6a5c7e@sprout-oss.stage.blox.sqprod.co>
2026-06-04 15:32:28 -07:00
Will Pfleger
f748f71268 fix(desktop): handle symlinked persona pack directories (#859) 2026-06-04 17:52:36 -04:00
Will Pfleger
1fe7bf2872 feat: channel muting for desktop and mobile (#838) 2026-06-04 15:53:53 -04:00
tlongwell-block
4ead7de463 feat(acp): default SPROUT_ACP_MEMORY to on (#854)
Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
2026-06-04 15:17:28 -04:00
thomaspblock
759e5cd923 fix(desktop): eliminate image-hover layout jump in messages (#813)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 09:55:02 -07:00
Wes
249bec86cf chore(release): release version 0.3.10 (#849) v0.3.10 2026-06-04 09:04:52 -07:00
tlongwell-block
34ac3ba1d1 fix(desktop): harden relay mesh connect p-tag (#834) 2026-06-04 11:50:49 -04:00
Wes
b3aefae152 fix(desktop): scroll activity panel to bottom on open (#848)
Signed-off-by: Wes <wesbillman@users.noreply.github.com>
Co-authored-by: Brain <21994759fc7a6fa6b965551d35cfd7897d262f2495467f2d78694ddcfa6a5c7e@sprout-oss.stage.blox.sqprod.co>
2026-06-04 08:49:15 -07:00
thomaspblock
a13691b620 Polish desktop profile menu interactions (#836)
Signed-off-by: Wes <wesbillman@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Wes <wesbillman@users.noreply.github.com>
Co-authored-by: Brain <21994759fc7a6fa6b965551d35cfd7897d262f2495467f2d78694ddcfa6a5c7e@sprout-oss.stage.blox.sqprod.co>
2026-06-04 08:48:57 -07:00
thomaspblock
0d9b8148f8 fix(desktop): outline thread hover targets (#845)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 08:39:56 -07:00
thomaspblock
b3be9ecba7 fix(desktop): keep message actions hover-only (#844)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 08:07:36 -07:00
thomaspblock
db46c42546 fix(desktop): let inbox composer fill available width (#841)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 08:00:03 -07:00
Michael Neale
ea77a0bcfe fix(merge): reconcile build_message custom_emoji_tags arg + dedup tauri allow attr
Post-merge fixes for desktop-tauri compile (clippy compiles tests):
- build_message gained custom_emoji_tags param from main; pass &[] in the
  three serverless test/helper call sites (channels_tests, encrypted)
- remove duplicate #[allow(too_many_arguments)] left by the merge
2026-06-04 15:18:46 +10:00
Michael Neale
4c49c8f521 Merge remote-tracking branch 'origin/main' into micn/serverless-mode
* origin/main: (36 commits)
  fix: use immutable commit-SHA URLs in screenshot PR comments (#842)
  feat(mobile+desktop): two-tier Slack-style app icon badge (#802)
  chore: simplify file-size check to a flat 1000-line limit (#839)
  fix(desktop): robust emoji picker — unify picker + fix custom emoji in editing, status, reactions (#837)
  feat(desktop): reusable screenshot workflow for agents (#826)
  desktop(mesh-llm): let a serving node route a different model (#833)
  chore(release): release version 0.3.9 (#832)
  fix: native arbitrary-file download + image context-menu flash (#830)
  fix(desktop): custom emoji reaction rendering + picker autofocus (#831)
  Mesh-LLM v1: relay-gated direct-iroh inference between users (WAN) (#822)
  chore(release): release version 0.3.8 (#829)
  chore(release): release version 0.3.7 (#825)
  feat: code block rendering, syntax highlighting, and compose fixes (#803)
  feat: custom emoji — user-owned NIP-30 sets with a client-side union (#816)
  Install sprout-cli skill at repo root + fix desktop clippy (#818)
  fix(desktop): use public re-export path for ensure_client_node_for_model (#824)
  refactor(desktop): feature-gate mesh-llm-sdk behind optional Cargo feature (#823)
  fix(desktop): align workflow read/save commands to the frontend contract (#820)
  fix(desktop): disable mesh-llm auto-build to prevent git config corruption (#819)
  fix(desktop): clear clippy lints in agents/mesh_llm commands (#817)
  ...

# Conflicts:
#	Cargo.lock
#	desktop/scripts/check-file-sizes.mjs
#	desktop/src-tauri/Cargo.toml
#	desktop/src/app/AppShell.tsx
#	desktop/src/app/AppTopChrome.tsx
#	desktop/src/features/messages/hooks.ts
#	desktop/src/features/workspaces/useWorkspaceInit.ts
#	desktop/src/shared/api/tauri.ts
2026-06-04 15:08:56 +10:00
Will Pfleger
2a0572c0d8 fix: use immutable commit-SHA URLs in screenshot PR comments (#842) 2026-06-03 22:28:11 -04:00
Will Pfleger
3b78dc5690 feat(mobile+desktop): two-tier Slack-style app icon badge (#802) 2026-06-03 18:16:49 -07:00
Michael Neale
fcb62472f1 fix(serverless): clippy cloned_ref_to_slice_refs in sdk tests 2026-06-04 09:56:49 +10:00
Michael Neale
a9b627c4b6 fix(serverless): log encrypted-recipient resolution on send (diagnostic) 2026-06-04 09:53:26 +10:00
Wes
0c225f4d7d chore: simplify file-size check to a flat 1000-line limit (#839)
Signed-off-by: Wes <wesbillman@users.noreply.github.com>
Co-authored-by: Brain <21994759fc7a6fa6b965551d35cfd7897d262f2495467f2d78694ddcfa6a5c7e@sprout-oss.stage.blox.sqprod.co>
2026-06-03 16:40:33 -07:00
Michael Neale
6c7dc2753e fix(serverless): encrypted send picks newest 39002 across relays, fails loudly if members unresolved
The desktop encrypted_recipients() lookup used .first() on a multi-relay
merge of the addressable kind:39002 membership event and silently fell
back to encrypting to only self when the lookup came back empty. With the
membership event present on only some relays (split-brain / propagation
lag), a private-channel message could be gift-wrapped to just the sender —
so the agent (and other members) never received it, with no visible error.

Now: pick the NEWEST 39002 by created_at, and if an encrypted channel
resolves to no other members, return an error so the send fails loudly and
can be retried, instead of silently dropping every other recipient.
2026-06-04 09:05:11 +10:00
Wes
d8b602a359 fix(desktop): robust emoji picker — unify picker + fix custom emoji in editing, status, reactions (#837)
Signed-off-by: Wes <wesbillman@users.noreply.github.com>
Co-authored-by: Brain <21994759fc7a6fa6b965551d35cfd7897d262f2495467f2d78694ddcfa6a5c7e@sprout-oss.stage.blox.sqprod.co>
2026-06-03 15:13:25 -07:00
Michael Neale
a4183e263c test(serverless): prove agent replies in DM (gift-wrapped, deterministic channel id)
Adds agent_responds_in_dm_e2e — completes the functional trio (public
channel, private channel, DM). A DM in serverless is a private channel
with a deterministic UUIDv5 id derived from the participants (matching
desktop/src-tauri/src/commands/dms.rs). The message is gift-wrapped to
the agent; the test asserts the agent decrypts it and replies.

All three pass against live public relays (3 passed; 0 failed).
2026-06-04 06:45:00 +10:00
Will Pfleger
06bc67fd34 feat(desktop): reusable screenshot workflow for agents (#826)
Signed-off-by: Will Pfleger <wpfleger@block.xyz>
2026-06-03 19:33:56 +00:00
tlongwell-block
9f0c22a43a desktop(mesh-llm): let a serving node route a different model (#833)
Signed-off-by: npub1qyvc0c5kl4gqv2fd97fsk46tu378sqgy35vc83rvgfwne90sel7s0ed67d <011987e296fd5006292d2f930b574be47c7801048d1983c46c425d3c95f0cffd@sprout-oss.stage.blox.sqprod.co>
Signed-off-by: npub1mprnacetjua2xx3p5eddmhxyk6wv929ymm5py8kd2xfxurxahspqqlgyta <d8473ee32b973aa31a21a65adddcc4b69cc2a8a4dee8121ecd51926e0cddbc02@sprout-oss.stage.blox.sqprod.co>
Co-authored-by: npub1qyvc0c5kl4gqv2fd97fsk46tu378sqgy35vc83rvgfwne90sel7s0ed67d <011987e296fd5006292d2f930b574be47c7801048d1983c46c425d3c95f0cffd@sprout-oss.stage.blox.sqprod.co>
Co-authored-by: npub1mprnacetjua2xx3p5eddmhxyk6wv929ymm5py8kd2xfxurxahspqqlgyta <d8473ee32b973aa31a21a65adddcc4b69cc2a8a4dee8121ecd51926e0cddbc02@sprout-oss.stage.blox.sqprod.co>
2026-06-03 14:30:46 -04:00
Wes
b4f8f40333 chore(release): release version 0.3.9 (#832) v0.3.9 2026-06-03 10:45:22 -07:00
Wes
82ae85f79a fix: native arbitrary-file download + image context-menu flash (#830)
Signed-off-by: Wes <wesbillman@users.noreply.github.com>
Co-authored-by: Brain <21994759fc7a6fa6b965551d35cfd7897d262f2495467f2d78694ddcfa6a5c7e@sprout-oss.stage.blox.sqprod.co>
2026-06-03 09:59:57 -07:00
Wes
7797ae77f6 fix(desktop): custom emoji reaction rendering + picker autofocus (#831)
Signed-off-by: Wes <wesbillman@users.noreply.github.com>
Co-authored-by: Brain <21994759fc7a6fa6b965551d35cfd7897d262f2495467f2d78694ddcfa6a5c7e@sprout-oss.stage.blox.sqprod.co>
2026-06-03 08:53:43 -07:00
tlongwell-block
33cfc85293 Mesh-LLM v1: relay-gated direct-iroh inference between users (WAN) (#822)
Signed-off-by: Eva <011987e296fd5006292d2f930b574be47c7801048d1983c46c425d3c95f0cffd@sprout-oss.stage.blox.sqprod.co>
Co-authored-by: npub1qyvc0c5kl4gqv2fd97fsk46tu378sqgy35vc83rvgfwne90sel7s0ed67d <011987e296fd5006292d2f930b574be47c7801048d1983c46c425d3c95f0cffd@sprout-oss.stage.blox.sqprod.co>
Co-authored-by: npub1t2tgm7d8f995uqvmnm8h88sg3wnpp9a5xysjf6dg3tjmgt3ltulqdp8ehr <5a968df9a7494b4e019b9ecf739e088ba61097b4312124e9a88ae5b42e3f5f3e@sprout-oss.stage.blox.sqprod.co>
Co-authored-by: Max <d8473ee32b973aa31a21a65adddcc4b69cc2a8a4dee8121ecd51926e0cddbc02@sprout-oss.stage.blox.sqprod.co>
2026-06-03 10:49:09 -04:00
Michael Neale
b601a92861 docs(serverless): add design report (architecture, decisions, verification) 2026-06-03 16:36:41 +10:00
Michael Neale
8846ef3c12 test(serverless): prove agent receives + replies in private (encrypted) channel
Adds an e2e test that sends a NIP-59 gift-wrap (kind 1059) to the agent —
exactly what the desktop publishes for an encrypted channel — and asserts the
agent decrypts it, extracts the channel from the inner rumor's h tag, passes the
gate, and replies. Proves the private-channel path end-to-end against live
relays; the earlier 'goose didn't reply in private' was the agent being offline,
not a code bug.
2026-06-03 16:13:39 +10:00
Michael Neale
9745e9940d docs(serverless): explain why desktop ws_pool is hand-rolled vs agent's nostr-relay-pool 2026-06-03 15:02:38 +10:00
Michael Neale
604f5f3b2e fix(serverless): encrypt threaded replies in private channels (close plaintext leak)
Replies in encrypted serverless channels (DM/private) were falling through
to the plaintext path — a privacy leak: the reply content went to public
relays as a cleartext kind-9. The encrypt branch was gated on
parent_event_id.is_none(), so only top-level messages were gift-wrapped.

Fix: encrypt replies too. The NIP-10 thread tags now live INSIDE the rumor
(the encrypted inner event), so threading is preserved without leaking the
reply. The thread root is resolved locally from decrypted messages (the
parent rumor isn't queryable in plaintext on the relay) and passed via a new
root_event_id command arg.

Proven by encrypted_threaded_reply_is_wrapped_and_preserves_thread: asserts
the wire event is kind-1059 (not plaintext kind-9), content never leaks, and
the decrypted rumor carries the NIP-10 root + reply e-tags.
2026-06-03 15:00:06 +10:00
Michael Neale
2d76bec1a0 test(serverless): prove agent reply + typing cue + cancel/redispatch e2e
Extend e2e_agent_responds to exercise the paths the live GUI hits:
- second @mention proves the OwnerInterrupt cancel/redispatch path (a
  follow-up message gets a fresh reply) — previously untested
- live listener asserts the typing indicator (kind 20002) fires during a
  turn so the 'agent is typing…' cue reaches relays in serverless
- stub now replies per-prompt (-1, -2) instead of once

Fixes found by the test:
- reaction working-cue timeout 500ms -> 4s: the pool does a real
  WebSocket publish + OK round-trip across public relays, too slow for
  500ms, so the 💬 cue never landed
- typing listener now watches ALL relays (agent publishes to whichever
  accepts; one relay may be 503-ing)
2026-06-03 11:47:24 +10:00
Wes
7c896d339d chore(release): release version 0.3.8 (#829) v0.3.8 2026-06-02 16:57:08 -07:00
Wes
dc6821667d chore(release): release version 0.3.7 (#825)
Signed-off-by: Mesh-LLM CI <ci@mesh-llm.local>
Co-authored-by: Mesh-LLM CI <ci@mesh-llm.local>
v0.3.7
2026-06-02 14:56:23 -07:00
Will Pfleger
56c504a4c7 feat: code block rendering, syntax highlighting, and compose fixes (#803) 2026-06-02 14:43:08 -07:00
Wes
2349421304 feat: custom emoji — user-owned NIP-30 sets with a client-side union (#816)
Signed-off-by: Wes <wesbillman@users.noreply.github.com>
Signed-off-by: tlongwell-block <109685178+tlongwell-block@users.noreply.github.com>
Co-authored-by: Brain <21994759fc7a6fa6b965551d35cfd7897d262f2495467f2d78694ddcfa6a5c7e@sprout-oss.stage.blox.sqprod.co>
Co-authored-by: Pinky <44b8e82baa6e0e254e0208d68f335c283c94e7b78dd1fa10d5a49d3f13dd0435@sprout-oss.stage.blox.sqprod.co>
Co-authored-by: tlongwell-block <109685178+tlongwell-block@users.noreply.github.com>
2026-06-02 14:19:07 -07:00
Michael Neale
cc9b0b22c4 refactor(serverless): back agent relay layer with nostr-relay-pool
The serverless agent path hand-rolled multi-relay subscribe/reconnect/
resubscribe/dedup in relay.rs — reimplementing what nostr-relay-pool
(rust-nostr) already does, with gaps that caused the agent to miss
messages when a single relay 502'd mid-session.

Replace the serverless backend with nostr-relay-pool's RelayPool, which
provides the standard Nostr client model used by damus/0xchat/nostr-tools:
- persistent REQ per relay, fanned out across all relays
- auto-reconnect (default) with jittered backoff
- auto-resubscribe on reconnect (relays replay stored events on REQ)
- merge + dedup across relays (Event notification = first-seen only)

HarnessRelay now dispatches to ServerlessRelay when serverless; server
mode (NIP-42 AUTH + HTTP bridge) is unchanged. RestClient and the typing/
presence publisher share the pool. Subscription IDs match the server-mode
scheme so event routing is identical.

Proven: e2e_agent_responds passes 3x consecutively (~3s each) against live
public relays, surviving damus 503s via nos.lol.

- 272 unit tests pass, clippy clean
2026-06-03 07:16:12 +10:00
Will Pfleger
7a12e50518 Install sprout-cli skill at repo root + fix desktop clippy (#818) 2026-06-02 17:11:30 -04:00
Will Pfleger
2ea3fd88d2 fix(desktop): use public re-export path for ensure_client_node_for_model (#824) 2026-06-02 16:59:05 -04:00
Michael Neale
e56c5f31c4 feat(serverless): typing indicators + cold-start history retry
- Route agent typing indicators (kind 20002) through the serverless pool
  subscription so the 'agent is typing…' signal shows in serverless mode
  (previously dropped — CHANNEL_EVENT_KINDS excluded 20002). useChannelTyping
  now listens on serverless-event:<channel> when serverless; appendMessage
  skips ephemeral typing events so they never enter the timeline.
- Retry serverless history fetch with short backoff on cold start: public
  relays return 0/partial while pooled connections warm up, causing the
  'blank for a minute after launch' feeling. Retry until events arrive.
2026-06-03 06:48:40 +10:00
Michael Neale
12241a5fda fix(serverless): launch agents with current workspace relays + real dev sidecars
Agent restore at startup raced ahead of the frontend applying the active
workspace, so serverless agents launched with the stale relay list frozen
into their record at creation time (including paid relays that 403) and one
even ran in server mode. When the only healthy relay rate-limited a reply,
there was no failover and the reply silently vanished.

- AppState.workspace_applied: agent restore now waits (bounded 15s) for the
  frontend to call apply_workspace before launching, so agents inherit the
  CURRENT workspace relays + serverless mode instead of record defaults.
- apply_workspace sets the flag once config is live.
- justfile _ensure-sidecar-stubs builds REAL sprout-acp + sprout sidecars
  (serverless agents need them) instead of 0-byte stubs that silently fail
  to launch/reply under just dev.
2026-06-03 06:40:57 +10:00
Will Pfleger
fb514c8918 refactor(desktop): feature-gate mesh-llm-sdk behind optional Cargo feature (#823) 2026-06-02 20:25:01 +00:00