feat(cli): docker-style agent verbs + daemon-connect helper#38
Open
Codename-11 wants to merge 1 commit into
Open
feat(cli): docker-style agent verbs + daemon-connect helper#38Codename-11 wants to merge 1 commit into
Codename-11 wants to merge 1 commit into
Conversation
Adds `arc ls`, `arc attach`, `arc send`, `arc stop` top-level verbs that
talk to the v3 daemon via the `@axiom-labs/arc-client` SDK, plus a shared
`connectDaemon()` helper that auto-starts the daemon and reads the root
token from `~/.arc/auth.json`. The write-path verbs (attach/send/stop)
print a friendly hint when the daemon returns `unimplemented`, since
Unit 2 owns the corresponding lifecycle wiring.
- `packages/cli/src/daemon-client.ts` — `connectDaemon`, `withDaemonClient`,
`hasErrorCode` helpers; auto-start forwards `process.execArgv` so the
TS loader survives into the detached child during dev.
- `packages/cli/src/commands/{ls,attach,send,stop-agent}.ts` — new verbs.
- `packages/cli/src/cli.ts` — register the four verbs; drop `ls` as an
alias for `list` so the new command reaches `handleLs`.
- `tests/cli-daemon-verbs.test.ts` — in-process daemon + handlers,
asserts empty `ls`, `ls --json`, and friendly errors on bogus ids.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds four top-level verbs that talk to the v3 daemon through the
@axiom-labs/arc-clientSDK, plus a shared connect helper:arc ls/arc ls --all/arc ls --json— list agents known to the daemonarc attach <id>— stream terminal bytes (producer lands in Unit 2)arc send <id> <text>— forward a message to a running agentarc stop <id>— stop a running agentpackages/cli/src/daemon-client.tsexposesconnectDaemon(),withDaemonClient(), and a tinyhasErrorCode()helper. The helper reads the shared root token from~/.arc/auth.json, probes/health, and auto-starts the daemon (daemon start --foregrounddetached) if it's not already running, forwardingprocess.execArgvso the TS loader survives into dev-mode children.The write-path verbs (
attach/send/stop) currently getcode: "unimplemented"from the daemon — Unit 2 ownsagent.run/stop/send/attachwiring. Each verb detects that and prints a friendly hint + exits 1, so this PR is mergeable ahead of Unit 2.Test plan
npx tsc --noEmitpassesnpx vitest run tests/cli-daemon-verbs.test.ts— 5 tests pass (ls empty, ls --json empty, attach/send/stop on bogus id each print an error and exit 1)daemon stopat the endarc attach/send/stopstart exercising real lifecycle paths