Files
buzz/desktop
ss-dev-00 86617f5f5f broker: add agents.* capability handlers behind an async service seam
The three capabilities dispatch to an AgentService trait rather than to
the Tauri commands directly. Those commands need an AppHandle and a
State, so depending on them here would make every handler untestable
without booting an app and would entangle the capability layer with the
desktop runtime. Behind the seam, handlers are pure and the tests below
drive the real pipeline against a fake.

The seams are async because the mutations they will call are: minting a
key, writing the agent store, and publishing to the relay all await.
That forces ExecutionLog to be a trait instead of a borrowed
rusqlite::Connection, which is !Sync and must not be held across an
.await. The production adapter confines each connection to one blocking
task; the test double serializes behind a Mutex. Cross-call exclusion is
SQLite's either way, since claim() does its read and insert inside a
single IMMEDIATE transaction.

ServiceError distinguishes Failed from Unknown. Failed promises no side
effects persisted; Unknown promises nothing and becomes indeterminate. A
service that mutated and then lost track must say Unknown, because
reporting a clean failure would invite a retry of something that may
already have happened.

Nothing in AgentService returns secret material: a create reports the new
agent's pubkey, never its nsec. A test serializes a create response and
asserts the absence of nsec, privateKey, private_key, and secret, so the
guarantee is checked rather than asserted in a comment.

Co-authored-by: Bradley Axen <baxen@squareup.com>
Signed-off-by: Bradley Axen <baxen@squareup.com>
2026-08-21 19:55:23 -07:00
..
…

Buzz

Desktop chat shell with:

  • Tauri + React + TypeScript + Vite
  • Tailwind CSS
  • shadcn/ui-ready shared components
  • Biome (lint/format/check)
  • Feature-driven frontend structure

Scripts

  • pnpm dev - run the web frontend
  • pnpm tauri dev - run the desktop app
  • pnpm build - typecheck and build frontend
  • pnpm typecheck - TypeScript checks
  • pnpm lint - Biome lint
  • pnpm format - Biome format (write)
  • pnpm check - Biome check

Structure

  • src/shared - reusable app-wide code (ui, lib, styles)
  • src/features - feature modules (vertical slices)
  • src/app - top-level app composition