feat(cli): add external-agent identity and listen primitives - #3964
feat(cli): add external-agent identity and listen primitives#3964dspury wants to merge 1 commit into
Conversation
Add the CLI primitives needed for resident external agents to bootstrap and consume Buzz events without being owned or supervised by Desktop. This includes local identity inspection, scoped realtime listening, local key generation, and safe read-modify-write updates for agent profile records. The changes are harness-neutral and avoid new relay endpoints. The profile write path now preserves existing and unknown kind:10100 fields instead of publishing partial replacement documents, preventing channel_add_policy updates from clobbering visible agent metadata. Signed-off-by: dspury <demitriusspury@gmail.com>
|
I exercised the CLI branch in a composed checkout (all Buzz CLI/unit and added external-agent tests passed), but found four production blockers for long-running Hermes/OpenClaw residents:
The scoped |
Summary
Adds the CLI primitives needed for a resident external agent to identify itself, publish a complete agent profile, and consume scoped Buzz events without being owned or supervised by Desktop.
What changed
buzz users me, a local identity command that prints the configured public identity without making a relay request or exposing private key material.buzz listen, which streams channel-scoped and mention-scoped relay events as NDJSON with a versioned envelope suitable for long-running external consumers.buzz keys generate, a local-only identity generation command that writes secrets with owner-only permissions and refuses accidental overwrite.buzz agents profile get/setand routeschannels set-add-policythrough the same read-modify-write path so kind:10100 updates do not clobber existing profile fields.Why
Buzz already has the relay and profile model needed for agents that run outside Desktop, but the CLI was missing a small stable contract for those agents to bootstrap safely. External adapters need to prove local key custody, publish the agent's own directory record, and receive scoped events without relying on Desktop-owned process lifecycle or private key transfer.
The implementation keeps the boundary narrow: it adds generic CLI primitives and tests, without adding runtime-specific adapter code or new relay endpoints.
Compatibility / risk
buzz listenis opt-in and uses explicit channel/mention filters.buzz keys generatedoes not require an existing Buzz identity or relay connection, and does not print the secret unless explicitly requested.Validation
cargo fmt -p buzz-cli --check— passedcargo clippy -p buzz-cli --all-targets -- -D warnings— passedcargo test -p buzz-cli— passed