@phnx-labs/agents-cli 1.22.47 → 1.22.49

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (249) hide show
  1. package/CHANGELOG.md +401 -17
  2. package/README.md +66 -32
  3. package/dist/bootstrap.js +4 -2
  4. package/dist/cli/command-registry.d.ts +1 -0
  5. package/dist/cli/command-registry.js +2 -0
  6. package/dist/commands/accounts.d.ts +58 -0
  7. package/dist/commands/accounts.js +206 -32
  8. package/dist/commands/artifacts.js +7 -6
  9. package/dist/commands/attach.js +1 -1
  10. package/dist/commands/browser.js +501 -103
  11. package/dist/commands/config.d.ts +0 -1
  12. package/dist/commands/config.js +0 -20
  13. package/dist/commands/daemon.d.ts +21 -0
  14. package/dist/commands/daemon.js +147 -12
  15. package/dist/commands/exec.js +52 -15
  16. package/dist/commands/focus.d.ts +14 -0
  17. package/dist/commands/focus.js +48 -5
  18. package/dist/commands/go.d.ts +3 -0
  19. package/dist/commands/go.js +16 -3
  20. package/dist/commands/inspect.js +2 -2
  21. package/dist/commands/lease.d.ts +1 -1
  22. package/dist/commands/lease.js +4 -3
  23. package/dist/commands/mailboxes.js +4 -3
  24. package/dist/commands/menubar.js +11 -4
  25. package/dist/commands/projects.d.ts +16 -1
  26. package/dist/commands/projects.js +58 -64
  27. package/dist/commands/resume.js +1 -1
  28. package/dist/commands/route.js +4 -4
  29. package/dist/commands/routines.js +3 -2
  30. package/dist/commands/run-broadcast.d.ts +1 -1
  31. package/dist/commands/run-broadcast.js +1 -1
  32. package/dist/commands/sessions-picker.d.ts +22 -0
  33. package/dist/commands/sessions-picker.js +48 -9
  34. package/dist/commands/sessions-trace.js +1 -1
  35. package/dist/commands/sessions.js +1 -0
  36. package/dist/commands/setup-secrets.js +23 -0
  37. package/dist/commands/share.d.ts +20 -5
  38. package/dist/commands/share.js +152 -52
  39. package/dist/commands/ssh.js +54 -7
  40. package/dist/commands/traces.d.ts +2 -0
  41. package/dist/commands/traces.js +184 -0
  42. package/dist/commands/view.d.ts +1 -1
  43. package/dist/commands/view.js +17 -34
  44. package/dist/index.d.ts +1 -0
  45. package/dist/index.js +5 -0
  46. package/dist/lib/accounting/usage.d.ts +14 -3
  47. package/dist/lib/accounting/usage.js +64 -18
  48. package/dist/lib/agent-spec/agents.js +11 -9
  49. package/dist/lib/browser/drivers/ssh.d.ts +16 -2
  50. package/dist/lib/browser/drivers/ssh.js +36 -9
  51. package/dist/lib/browser/ipc.js +8 -3
  52. package/dist/lib/browser/profiles.d.ts +35 -101
  53. package/dist/lib/browser/profiles.js +130 -301
  54. package/dist/lib/browser/registry.d.ts +39 -0
  55. package/dist/lib/browser/registry.js +149 -0
  56. package/dist/lib/browser/remote-control.d.ts +8 -6
  57. package/dist/lib/browser/remote-control.js +8 -6
  58. package/dist/lib/browser/resolve-target.d.ts +68 -0
  59. package/dist/lib/browser/resolve-target.js +250 -0
  60. package/dist/lib/browser/runtime-state.d.ts +40 -16
  61. package/dist/lib/browser/runtime-state.js +92 -25
  62. package/dist/lib/browser/service.d.ts +28 -9
  63. package/dist/lib/browser/service.js +139 -62
  64. package/dist/lib/browser/task-index.d.ts +70 -0
  65. package/dist/lib/browser/task-index.js +180 -0
  66. package/dist/lib/byok-usage.js +2 -2
  67. package/dist/lib/claude-statusline.d.ts +29 -0
  68. package/dist/lib/claude-statusline.js +139 -0
  69. package/dist/lib/cloud/host.d.ts +1 -1
  70. package/dist/lib/cloud/host.js +1 -1
  71. package/dist/lib/cloud/rush.js +1 -1
  72. package/dist/lib/computer/computer-rpc.js +2 -2
  73. package/dist/lib/computer/download.d.ts +15 -15
  74. package/dist/lib/computer/download.js +35 -98
  75. package/dist/lib/computer/ssh-tunnel.d.ts +0 -3
  76. package/dist/lib/computer/ssh-tunnel.js +12 -22
  77. package/dist/lib/config-keys.d.ts +2 -8
  78. package/dist/lib/config-keys.js +2 -13
  79. package/dist/lib/crabbox/cli.d.ts +1 -1
  80. package/dist/lib/crabbox/cli.js +2 -2
  81. package/dist/lib/crabbox/lease.d.ts +9 -0
  82. package/dist/lib/crabbox/lease.js +70 -15
  83. package/dist/lib/crabbox/runtimes.js +1 -1
  84. package/dist/lib/daemon/account-state-daemon-service.d.ts +16 -0
  85. package/dist/lib/daemon/account-state-daemon-service.js +26 -0
  86. package/dist/lib/daemon/browser-ipc-service.d.ts +20 -0
  87. package/dist/lib/daemon/browser-ipc-service.js +46 -0
  88. package/dist/lib/daemon/daemon.d.ts +3 -0
  89. package/dist/lib/daemon/daemon.js +212 -444
  90. package/dist/lib/daemon/device-probe-service.d.ts +26 -0
  91. package/dist/lib/daemon/device-probe-service.js +47 -0
  92. package/dist/lib/daemon/keychain-reap-service.d.ts +17 -0
  93. package/dist/lib/daemon/keychain-reap-service.js +32 -0
  94. package/dist/lib/daemon/monitor-engine-service.d.ts +22 -0
  95. package/dist/lib/daemon/monitor-engine-service.js +29 -0
  96. package/dist/lib/daemon/secrets-broker-service.d.ts +20 -0
  97. package/dist/lib/daemon/secrets-broker-service.js +66 -0
  98. package/dist/lib/daemon/self-heal-service.d.ts +27 -0
  99. package/dist/lib/daemon/self-heal-service.js +48 -0
  100. package/dist/lib/daemon/service.d.ts +102 -0
  101. package/dist/lib/daemon/service.js +98 -0
  102. package/dist/lib/daemon/session-index-service.d.ts +22 -0
  103. package/dist/lib/daemon/session-index-service.js +40 -0
  104. package/dist/lib/daemon/state-dir-check-service.d.ts +43 -0
  105. package/dist/lib/daemon/state-dir-check-service.js +63 -0
  106. package/dist/lib/daemon/supervisor.d.ts +87 -0
  107. package/dist/lib/daemon/supervisor.js +298 -0
  108. package/dist/lib/daemon/watchdog-service.d.ts +19 -0
  109. package/dist/lib/daemon/watchdog-service.js +40 -0
  110. package/dist/lib/daemon-health.d.ts +15 -0
  111. package/dist/lib/daemon-health.js +29 -5
  112. package/dist/lib/daemon-services.d.ts +8 -1
  113. package/dist/lib/daemon-services.js +55 -0
  114. package/dist/lib/daemon-ticks.d.ts +13 -2
  115. package/dist/lib/daemon-ticks.js +20 -18
  116. package/dist/lib/device-config.d.ts +0 -2
  117. package/dist/lib/device-config.js +1 -23
  118. package/dist/lib/devices/registry.d.ts +1 -1
  119. package/dist/lib/devices/registry.js +1 -1
  120. package/dist/lib/devices/stats-cache.d.ts +20 -0
  121. package/dist/lib/devices/stats-cache.js +49 -5
  122. package/dist/lib/devices/worker-pick.d.ts +48 -0
  123. package/dist/lib/devices/worker-pick.js +113 -0
  124. package/dist/lib/exec.d.ts +67 -13
  125. package/dist/lib/exec.js +85 -29
  126. package/dist/lib/harness/adapters/cursor.js +8 -11
  127. package/dist/lib/helper-download.d.ts +108 -0
  128. package/dist/lib/helper-download.js +194 -0
  129. package/dist/lib/helper-versions.d.ts +52 -0
  130. package/dist/lib/helper-versions.js +58 -0
  131. package/dist/lib/hooks/cache.js +11 -0
  132. package/dist/lib/hooks/install.js +2 -2
  133. package/dist/lib/hosts/credentials.d.ts +1 -1
  134. package/dist/lib/hosts/credentials.js +1 -1
  135. package/dist/lib/hosts/dispatch.d.ts +7 -1
  136. package/dist/lib/hosts/dispatch.js +24 -5
  137. package/dist/lib/hosts/passthrough.d.ts +8 -15
  138. package/dist/lib/hosts/passthrough.js +19 -16
  139. package/dist/lib/hosts/providers/devices.d.ts +1 -1
  140. package/dist/lib/hosts/providers/devices.js +1 -1
  141. package/dist/lib/hosts/reconnect.d.ts +179 -21
  142. package/dist/lib/hosts/reconnect.js +266 -45
  143. package/dist/lib/installations/migrate.d.ts +4 -5
  144. package/dist/lib/installations/migrate.js +6 -7
  145. package/dist/lib/installations/shims.d.ts +1 -1
  146. package/dist/lib/installations/shims.js +23 -13
  147. package/dist/lib/installations/versions.js +25 -2
  148. package/dist/lib/linear-autoclose.d.ts +1 -1
  149. package/dist/lib/linear-autoclose.js +1 -1
  150. package/dist/lib/loop.d.ts +2 -2
  151. package/dist/lib/loop.js +1 -1
  152. package/dist/lib/menubar/download-menubar.d.ts +47 -0
  153. package/dist/lib/menubar/download-menubar.js +60 -0
  154. package/dist/lib/menubar/install-menubar.d.ts +31 -7
  155. package/dist/lib/menubar/install-menubar.js +79 -21
  156. package/dist/lib/menubar/notify-desktop.d.ts +3 -3
  157. package/dist/lib/menubar/notify-desktop.js +6 -6
  158. package/dist/lib/model-tiers.d.ts +1 -1
  159. package/dist/lib/project-probe.d.ts +1 -1
  160. package/dist/lib/project-probe.js +1 -1
  161. package/dist/lib/project-pull.d.ts +1 -1
  162. package/dist/lib/project-pull.js +2 -2
  163. package/dist/lib/projects.d.ts +1 -1
  164. package/dist/lib/projects.js +1 -1
  165. package/dist/lib/sandbox.js +6 -7
  166. package/dist/lib/secrets/download-keychain.d.ts +47 -0
  167. package/dist/lib/secrets/download-keychain.js +70 -0
  168. package/dist/lib/secrets/install-helper.d.ts +20 -1
  169. package/dist/lib/secrets/install-helper.js +44 -3
  170. package/dist/lib/session/active.js +17 -1
  171. package/dist/lib/session/db.d.ts +11 -1
  172. package/dist/lib/session/db.js +138 -6
  173. package/dist/lib/session/discover.d.ts +21 -1
  174. package/dist/lib/session/discover.js +33 -5
  175. package/dist/lib/session/highlights.d.ts +49 -1
  176. package/dist/lib/session/highlights.js +95 -0
  177. package/dist/lib/session/host-link.d.ts +16 -2
  178. package/dist/lib/session/host-link.js +7 -1
  179. package/dist/lib/session/parse.js +33 -1
  180. package/dist/lib/session/remote/remote-list.d.ts +9 -0
  181. package/dist/lib/session/remote/remote-list.js +19 -2
  182. package/dist/lib/session/remote/watch.js +11 -2
  183. package/dist/lib/session/session-cache.d.ts +53 -0
  184. package/dist/lib/session/session-cache.js +88 -0
  185. package/dist/lib/session/state.js +1 -1
  186. package/dist/lib/session/tool-calls.d.ts +2 -0
  187. package/dist/lib/session/tool-calls.js +1 -1
  188. package/dist/lib/session/trajectory-html.d.ts +5 -1
  189. package/dist/lib/session/trajectory-html.js +42 -22
  190. package/dist/lib/session/trajectory-text.js +9 -2
  191. package/dist/lib/session/trajectory.js +53 -4
  192. package/dist/lib/session/types.d.ts +15 -0
  193. package/dist/lib/sha256-asset.d.ts +26 -0
  194. package/dist/lib/sha256-asset.js +41 -0
  195. package/dist/lib/share/backend.d.ts +95 -0
  196. package/dist/lib/share/backend.js +139 -0
  197. package/dist/lib/share/delete.d.ts +6 -2
  198. package/dist/lib/share/delete.js +8 -9
  199. package/dist/lib/share/html.d.ts +22 -0
  200. package/dist/lib/share/html.js +88 -0
  201. package/dist/lib/share/provision.d.ts +18 -4
  202. package/dist/lib/share/provision.js +38 -4
  203. package/dist/lib/share/publish.d.ts +39 -15
  204. package/dist/lib/share/publish.js +55 -26
  205. package/dist/lib/share/worker-template.js +171 -11
  206. package/dist/lib/sqlite.js +16 -3
  207. package/dist/lib/ssh-exec.d.ts +65 -0
  208. package/dist/lib/ssh-exec.js +120 -4
  209. package/dist/lib/startup/command-registry.js +1 -1
  210. package/dist/lib/startup/dev-build.js +3 -3
  211. package/dist/lib/state.d.ts +1 -1
  212. package/dist/lib/state.js +7 -3
  213. package/dist/lib/subagents-registry.js +1 -1
  214. package/dist/lib/terminal/index.d.ts +1 -1
  215. package/dist/lib/terminal/types.d.ts +1 -1
  216. package/dist/lib/terminal/types.js +1 -1
  217. package/dist/lib/tmux/orphan-reap.js +1 -1
  218. package/dist/lib/tmux/session.js +31 -0
  219. package/dist/lib/traces/backend.d.ts +29 -0
  220. package/dist/lib/traces/backend.js +46 -0
  221. package/dist/lib/traces/classify.d.ts +52 -0
  222. package/dist/lib/traces/classify.js +72 -0
  223. package/dist/lib/traces/config.d.ts +10 -0
  224. package/dist/lib/traces/config.js +2 -0
  225. package/dist/lib/traces/provision.d.ts +19 -0
  226. package/dist/lib/traces/provision.js +30 -0
  227. package/dist/lib/traces/sync.d.ts +150 -0
  228. package/dist/lib/traces/sync.js +447 -0
  229. package/dist/lib/traces/worker-template.d.ts +4 -0
  230. package/dist/lib/traces/worker-template.js +159 -0
  231. package/dist/lib/types.d.ts +18 -19
  232. package/dist/lib/types.js +14 -0
  233. package/dist/lib/usage-refresh.d.ts +1 -1
  234. package/dist/lib/usage-refresh.js +11 -8
  235. package/dist/lib/workflows.d.ts +1 -1
  236. package/package.json +4 -6
  237. package/dist/lib/menubar/MenubarHelper.app/Contents/CodeResources +0 -0
  238. package/dist/lib/menubar/MenubarHelper.app/Contents/Info.plist +0 -24
  239. package/dist/lib/menubar/MenubarHelper.app/Contents/MacOS/MenubarHelper +0 -0
  240. package/dist/lib/menubar/MenubarHelper.app/Contents/Resources/AppIcon.icns +0 -0
  241. package/dist/lib/menubar/MenubarHelper.app/Contents/_CodeSignature/CodeResources +0 -128
  242. package/dist/lib/secrets/Agents CLI.app/Contents/CodeResources +0 -0
  243. package/dist/lib/secrets/Agents CLI.app/Contents/Info.plist +0 -26
  244. package/dist/lib/secrets/Agents CLI.app/Contents/MacOS/Agents CLI +0 -0
  245. package/dist/lib/secrets/Agents CLI.app/Contents/Resources/AppIcon.icns +0 -0
  246. package/dist/lib/secrets/Agents CLI.app/Contents/_CodeSignature/CodeResources +0 -135
  247. package/dist/lib/secrets/Agents CLI.app/Contents/embedded.provisionprofile +0 -0
  248. package/dist/lib/usage-fleet.d.ts +0 -32
  249. package/dist/lib/usage-fleet.js +0 -125
package/README.md CHANGED
@@ -56,7 +56,8 @@ agents run claude "explain this repo" # run any agent on your existing subscrip
56
56
 
57
57
  Everything here — and every other command in this README — is free and needs no account; the optional `agents auth login` exists only for [team spaces](#sign-in). `agents setup` is interactive and idempotent -- safe to re-run on any machine. Once core setup exists, it opens a status-aware menu for browser, computer, secrets, fleet, share, watchdog, and device preferences; each choice delegates to the same wizard available under `agents setup <capability>`. In CI or another non-TTY, bare setup prints the checklist without prompting. The `agi-cli.sh` one-liner installs this same canonical `@phnx-labs/agents-cli` package. Prefer bun? `bun install -g @phnx-labs/agents-cli` works too.
58
58
 
59
- Full path -- installing harnesses, logging in, smoke-testing `agents teams`, and setting up your own fleet: [`apps/cli/docs/QUICKSTART.md`](apps/cli/docs/QUICKSTART.md).
59
+ The command surface teaches setup through `agents setup` and group-level `--help`.
60
+ The durable system model starts at [`cli/docs/README.md`](cli/docs/README.md).
60
61
 
61
62
  **Learn (concepts):** [Loop + graph engineering](https://agi-cli.sh/learn/loop-and-graph-engineering) · [Teams as graph engineering](https://agi-cli.sh/learn/teams-graph-engineering) · [Sessions · index + cross-device](https://agi-cli.sh/learn/sessions-index) · [Distributed fleet execution](https://agi-cli.sh/learn/distributed-fleet). Also: [harness engineering](https://agi-cli.sh/learn/harness-engineering) · [visual longform](https://share.agents-cli.sh/muqsitnawaz/agents-loop-and-graph-engineering).
62
63
 
@@ -336,7 +337,7 @@ agents insights --since 7d
336
337
 
337
338
  Interactive picker when you're in a terminal. Structured output (`--json`, `--markdown`, filtered by role or turn count) when piped.
338
339
 
339
- Backed by a SQLite + FTS5 index at `~/.agents/.history/sessions/sessions.db` with incremental scanning -- warm reads in ~100ms. Tool-call evidence is redacted and bounded before it is cached; repeated `--query` clauses must match distinct calls in one session. Tool queries read SQLite only: `agents sessions backfill tools` performs the one-time historical parse, while normal incremental scans index new and changed sessions. The index stores ordered static Bash program sites, so `--count` reports occurrences, containing tool calls, and distinct sessions without reparsing. `--fleet` executes one origin partition per device, so synced mirrors cannot duplicate compact evidence or counts returned over SSH; transcript bodies stay on their origin machine. This uses relational SQLite rows and literal FTS5 only, with no embeddings, vector database, or model calls. External tools can consume `--json` output as a programmatic observability layer; see [docs/sessions.md](apps/cli/docs/sessions.md) for the schemas and [docs/observability.md](apps/cli/docs/observability.md) for the consumption patterns.
340
+ Backed by a SQLite + FTS5 index at `~/.agents/.history/sessions/sessions.db` with incremental scanning -- warm reads in ~100ms. Tool-call evidence is redacted and bounded before it is cached; repeated `--query` clauses must match distinct calls in one session. Tool queries read SQLite only: `agents sessions backfill tools` performs the one-time historical parse, while normal incremental scans index new and changed sessions. The index stores ordered static Bash program sites, so `--count` reports occurrences, containing tool calls, and distinct sessions without reparsing. `--fleet` executes one origin partition per device, so synced mirrors cannot duplicate compact evidence or counts returned over SSH; transcript bodies stay on their origin machine. This uses relational SQLite rows and literal FTS5 only, with no embeddings, vector database, or model calls. External tools can consume `--json` output as a programmatic observability layer; see [docs/sessions.md](cli/docs/sessions.md) for the schemas and [docs/observability.md](cli/docs/observability.md) for the consumption patterns.
340
341
 
341
342
  ### Live state, and catching up fast
342
343
 
@@ -492,7 +493,7 @@ agents fleet apply --no-login # skip login propagation
492
493
 
493
494
  `agents fleet apply` probes every target over the existing SSH transport, then reconciles it to the profile: installs missing agents, upgrades `agi-cli`, syncs the named config scopes, and **propagates logins** so a host signed in once seeds the fleet -- turning "6 hosts x 8 harnesses = 48 OAuth flows" into one. Portable credential files (claude, codex, grok, kimi, opencode, droid, antigravity) stream to each target over encrypted SSH stdin, never shell-interpolated, and land at `0600`. **Honest boundary:** macOS keychain-bound tokens (claude, antigravity on a Mac target) can't be extracted -- those surface as a one-time manual login, never faked. `--plan` / `--dry-run` shows the full matrix without touching anything.
494
495
 
495
- See [docs/fleet.md](apps/cli/docs/fleet.md) for the manifest schema and reconcile semantics.
496
+ See [docs/fleet.md](cli/docs/fleet.md) for the manifest schema and reconcile semantics.
496
497
 
497
498
  ---
498
499
 
@@ -709,9 +710,11 @@ email) and naming which harnesses use it — the fast way to see which accounts
709
710
  and healthy across every machine. Scope either with `--agents <csv>` / `--device <csv>`, and
710
711
  add `--json` for the machine-readable per-host rows.
711
712
 
712
- **Hosts** (`agents hosts`) are git-synced dispatch targets in `agents.yaml`; **devices** (`agents devices`) are your Tailscale machines in a local registry. Both ride SSH and feed one host pool: devices appear in `agents hosts list` and capability routing without a second enrollment. On `--device` runs every `agents run` option is either forwarded (`--effort --env --timeout --loop …`), rejected loud (`--secrets` never crosses SSH implicitly), or consumed locally — nothing silently drops. See [docs/concepts.md](apps/cli/docs/concepts.md#devices--hosts).
713
+ **Hosts** (`agents hosts`) are git-synced dispatch targets in `agents.yaml`; **devices** (`agents devices`) are your Tailscale machines in a local registry. Both ride SSH and feed one host pool: devices appear in `agents hosts list` and capability routing without a second enrollment. On `--device` runs every `agents run` option is either forwarded (`--effort --env --timeout --loop …`), rejected loud (`--secrets` never crosses SSH implicitly), or consumed locally — nothing silently drops. See [docs/concepts.md](cli/docs/concepts.md#devices--hosts).
713
714
 
714
- Every `--device` command rides one multiplexed SSH engine, tuned for driving a fleet from a small laptop: the first call to a machine opens a control socket and every later call reuses it (no repeat TCP+auth handshake), connections carry keepalive so a dropped link dies in ~45 s instead of zombying, and following a remote run polls in a single round-trip per cycle. Measured against a Tailscale-relayed host: repeated calls **~6–7× faster**, dispatch readiness **~2×**, and the follow loop **~21× faster with 50% fewer local ssh spawns**. Design: [docs/ssh-transport.md](apps/cli/docs/ssh-transport.md) · reproduce: `node scripts/bench-ssh.mjs <host>`.
715
+ Every `--device` command rides the shared SSH transport so host resolution,
716
+ identity checks, environment forwarding, reconnect behavior, and multiplexing cannot
717
+ drift between callers. See [fleet architecture](cli/docs/fleet.md).
715
718
 
716
719
  ---
717
720
 
@@ -736,7 +739,7 @@ agents teams status auth-feature # Who's working, what they changed, what the
736
739
 
737
740
  Teammates run detached -- close your terminal, they keep working. Check in with `teams status`, glance at a teammate's summary with `teams logs <name>` (add `--full` for the raw output), clean up with `teams disband`.
738
741
 
739
- Team state is observable via `agents teams list --json` / `agents teams status --json` (compact by default; add `--verbose` for the full per-teammate shape). External tools join it with `sessions --json` (teammates get `isTeamOrigin: true`) and `cloud list --json` (for `--cloud` teammates) to build a unified fleet view. See [docs/observability.md](apps/cli/docs/observability.md).
742
+ Team state is observable via `agents teams list --json` / `agents teams status --json` (compact by default; add `--verbose` for the full per-teammate shape). External tools join it with `sessions --json` (teammates get `isTeamOrigin: true`) and `cloud list --json` (for `--cloud` teammates) to build a unified fleet view. See [docs/observability.md](cli/docs/observability.md).
740
743
 
741
744
  ---
742
745
 
@@ -907,7 +910,9 @@ agents setup mine toggle jack --enable teams
907
910
  agents setup mine remove jack --purge
908
911
  ```
909
912
 
910
- Under the hood, `init` drops a pure pass-through shim in `~/.agents/.cache/shims/<name>` (already on `PATH`) that sets `AGENTS_BRAND` and forwards every argument to the same binary — nothing is copied or forked. The brand's config lives in `~/.agents/agents.yaml` (`brands.<name>`), so it rides `agents repo push/pull` across your fleet. Disabling a command hides it **only** under that brand; plain `agents` / `ag` keep every command. Curated skills/plugins/MCP ride a per-brand [resource profile](apps/cli/docs/profiles.md). Full reference: [Make it yours](apps/cli/docs/mine.md).
913
+ Under the hood, `init` creates a pass-through shim that selects a brand configuration;
914
+ it does not fork the execution engine. Curated resources still resolve through the
915
+ ordinary [resource architecture](cli/docs/resources.md).
911
916
 
912
917
  > Branded builds are free for personal and commercial use alike. New versions ship under FSL-1.1-Apache-2.0: every user and company may use, modify, and redistribute; only offering agents-cli itself as a competing commercial product or service is barred, and each version automatically becomes Apache-2.0 two years after release.
913
918
 
@@ -921,15 +926,21 @@ Under the hood, `init` drops a pure pass-through shim in `~/.agents/.cache/shims
921
926
 
922
927
  Give agents access to a real browser — no relay extension, no cloud service, no Playwright getting blocked.
923
928
 
929
+ Each device declares its own browsers in its own `devices/<machine>/agents.yaml`.
930
+ The fleet registry is the union of those files: a name declared by one device is
931
+ identity-bearing (the daemon tunnels to that device); a name declared by several
932
+ is fungible (use the local one). `--device` is only valid on `agents browser start`;
933
+ later verbs resolve the device from the task.
934
+
924
935
  ```bash
925
936
  # First run: omit --profile and we auto-pick the first installed Chromium-family
926
937
  # browser. macOS prefers Chrome > Brave > Edge > Chromium > Comet; Linux prefers
927
938
  # Chrome > Chromium > Brave > Edge; Windows prefers Edge (always preinstalled) >
928
- # Chrome > Brave > Comet. The auto-picked profile is saved as "default" for later runs.
939
+ # Chrome > Brave > Comet. The auto-picked profile is saved as "auto-chrome".
929
940
  export AGENTS_BROWSER_TASK=$(agents browser start --url https://app.example.com)
930
941
 
931
942
  # Or pin a named profile to a specific browser (chrome, comet, brave, chromium,
932
- # edge, or custom) when you want isolation from "default".
943
+ # edge, or custom) when you want isolation from auto-detect.
933
944
  agents browser profiles create work --browser chrome
934
945
  # `start` writes the resolved name (e.g. `swift-crab-falcon-a3f92b1c`) to stdout
935
946
  # and human-friendly commentary to stderr, so $(...) capture stays clean.
@@ -993,7 +1004,10 @@ agents browser profiles create slack \
993
1004
 
994
1005
  ### Remote browsers
995
1006
 
996
- Connect to browsers running anywhere local, SSH tunnels, or cloud services:
1007
+ Identity-bearing names tunnel automatically: declare `comet-local` only on the
1008
+ machine that holds the logins, and every other box reaches it through the
1009
+ daemon. `--device` on `start` binds a task to a specific box (fungible names,
1010
+ or an explicit pick). Later verbs reject `--device`.
997
1011
 
998
1012
  ```bash
999
1013
  # Local CDP (discovers WebSocket URL automatically)
@@ -1001,7 +1015,11 @@ agents browser profiles create local-debug \
1001
1015
  --browser chrome \
1002
1016
  --endpoint "http://localhost:9222"
1003
1017
 
1004
- # SSH tunnel to a remote machine
1018
+ # Bind a task to a fleet device at start; later verbs resolve it from the task
1019
+ agents browser start --task post --device zion --url https://x.com/
1020
+ agents browser screenshot --task post
1021
+
1022
+ # Explicit SSH endpoint, declared on the machine that owns the browser
1005
1023
  agents browser profiles create staging \
1006
1024
  --browser chrome \
1007
1025
  --endpoint "ssh://deploy@staging.example.com?port=9222"
@@ -1120,7 +1138,7 @@ agents routines add daily-digest \
1120
1138
  --schedule "0 9 * * 1-5" \
1121
1139
  --agent claude \
1122
1140
  --project-anchor agents-cli \
1123
- --cwd apps/cli \
1141
+ --cwd cli \
1124
1142
  --prompt "Review yesterday's PRs and summarize key changes"
1125
1143
 
1126
1144
  agents routines list # All jobs + next run times
@@ -1152,7 +1170,7 @@ Jobs run sandboxed -- agents only see directories and tools you explicitly allow
1152
1170
  decides where the body runs. The reliability contract (execution anchor + `--cwd`,
1153
1171
  readiness that saves a blocked routine paused, and the `blocked`/`skipped` run
1154
1172
  statuses) is specified in
1155
- [docs/specifications.md §Routine execution & readiness](apps/cli/docs/specifications.md#routine-execution--readiness);
1173
+ [docs/specifications.md §Routine execution & readiness](cli/docs/specifications.md#routine-execution--readiness);
1156
1174
  some of it is planned (RUSH-2290), and the section marks what is landed vs intended.
1157
1175
 
1158
1176
  ### Daemon
@@ -1232,8 +1250,13 @@ Sources: a command's stdout (`--watch` / `--poll`), an HTTP endpoint (`--poll-ht
1232
1250
  ## Share
1233
1251
 
1234
1252
  ```bash
1235
- # Publish an HTML artifact to a public link on your own Cloudflare R2 (~$0).
1253
+ # Signed in? Just publish no Cloudflare setup.
1254
+ agents auth login
1255
+ agents artifacts share plan.html --visibility unlisted # → https://share.agents-cli.sh/<handle>/<slug>-<id>
1256
+
1257
+ # Or provision your own Cloudflare R2 (~$0).
1236
1258
  agents artifacts setup # once: provision bucket + Worker on your CF
1259
+ agents traces setup # provision the private traces Worker + R2 bucket
1237
1260
  agents artifacts share plan.html --slug fleet --expire 30d # → https://<base>/fleet
1238
1261
  agents artifacts share plan.html --label "Q3 fleet plan" --meta kind=plan # human title + structured metadata
1239
1262
  agents artifacts share plan.html --json # URL object for plan-render hooks
@@ -1244,18 +1267,26 @@ agents artifacts unshare fleet # take a published l
1244
1267
  ```
1245
1268
 
1246
1269
  `agents artifacts share` closes the loop: an agent makes work (a plan, a viz, a report),
1247
- publishes it, and you open the link to see it. `setup` reads a Cloudflare API token
1248
- from your `cloudflare.com` secrets bundle (or `--token`), creates an R2 bucket, uploads
1249
- a tiny Worker, and enables the free `*.workers.dev` subdomain (or maps `--domain
1250
- share.example.com` when the token owns the zone). Writes are bearer-gated **through**
1251
- the Worker (its R2 binding does the put, so the client needs no S3 keys); reads are
1252
- **public**, so a link outlives the agent. R2 has zero egress + a 10 GB free tier, so
1253
- this is effectively free.
1270
+ publishes it, and you open the link to see it. **Signed-in users** publish to the
1271
+ already-live managed endpoint (`share.agents-cli.sh/<handle>/…`) with the Phoenix session — no
1272
+ Cloudflare account, bucket, or write token and `share status` / `list` / `revisions`
1273
+ / `unshare` talk to that same endpoint. The handle is the local-part of the signed-in
1274
+ email (`muqsitnawaz@gmail.com` `muqsitnawaz`); the page slug is readable plus a
1275
+ short view-id. HTML is stored as one object: local images are inlined, `file://` TOC
1276
+ links become in-page hashes, so the published page is actually viewable. `--visibility unlisted` (hidden aliases
1277
+ `--unlisted` / `--private`) is a capability URL: GET still works, the gallery hides it,
1278
+ and the Worker sends `X-Robots-Tag: noindex`. **BYO Cloudflare** remains: `setup` reads
1279
+ a Cloudflare API token from your `cloudflare.com` secrets bundle (or `--token`), creates
1280
+ an R2 bucket, uploads a tiny Worker, and enables the free `*.workers.dev` subdomain (or
1281
+ maps `--domain share.example.com` when the token owns the zone). Writes are bearer-gated
1282
+ **through** the Worker (Phoenix bearer or static `WRITE_TOKEN`); reads are **public**, so
1283
+ a link outlives the agent. R2 has zero egress + a 10 GB free tier, so BYO is still
1284
+ effectively free.
1254
1285
 
1255
1286
  **Fleet mode:** provision one endpoint, then every fleet / cloud / ephemeral agent
1256
1287
  publishes through it with a shared write token — `agents artifacts share join <baseUrl>` uses an
1257
1288
  existing endpoint with no provisioning. `--expire 30d|12h|<date>` auto-expires a link.
1258
- `--json` emits `{ url, coverUrl, expiresAt, label, labelSource }` so plan-render automation can
1289
+ `--json` emits `{ url, coverUrl, expiresAt, visibility, unlisted?, label, labelSource }` so plan-render automation can
1259
1290
  publish the rendered HTML and post the returned link without scraping terminal text.
1260
1291
 
1261
1292
  **Every share carries provenance and a title.** Agent/session/host/repo/date are
@@ -1274,7 +1305,7 @@ full URL, `<user>/<slug>`, or a bare slug (resolved against your own namespace);
1274
1305
  targets at once are fine. It also deletes the sibling `<slug>.png` OG cover by default
1275
1306
  (`--keep-cover` opts out) and verifies the page actually 404s before reporting success —
1276
1307
  the Worker's delete is idempotent, so `{"ok":true}` alone is never proof.
1277
- See [docs/share.md](apps/cli/docs/share.md).
1308
+ See the publication boundary in [observability](cli/docs/observability.md).
1278
1309
 
1279
1310
  ---
1280
1311
 
@@ -1323,9 +1354,9 @@ Two repos with the same shape, different roles:
1323
1354
 
1324
1355
  **Resource resolution:** When syncing resources (commands, skills, rules, hooks, MCP, permissions), the order is **project > user > system**. A `.agents/` directory at project root wins, then `~/.agents/`, then `~/.agents-system/`. Same-named resources higher in the chain override lower ones; everything else unions in. Run `agents view --merged` to see the effective skills, commands, MCP servers, hooks, rules, plugins, workflows, and subagents, with each row tagged by its winning layer.
1325
1356
 
1326
- See [docs/concepts.md](apps/cli/docs/concepts.md) for the full mental model: DotAgents repos, resource kinds, and how resolution works end-to-end.
1357
+ See [docs/concepts.md](cli/docs/concepts.md) for the full mental model: DotAgents repos, resource kinds, and how resolution works end-to-end.
1327
1358
 
1328
- Other useful commands: `agents doctor` checks CLI availability and resource sync drift, `agents view` shows per-account quota/rate-limit data for installed agents, `agents config budget` shows cross-vendor spend caps and current spend-to-cap (and enforces pre-flight estimates + a hard-cap kill-switch on every run — see [docs/observability.md](apps/cli/docs/observability.md#budget-guardrails-agents-budget)), `agents import` adopts an existing unmanaged install, `agents trash` lists and restores soft-deleted version directories, and `agents subagents` installs reusable subagent definitions for parent-agent workflows.
1359
+ Other useful commands: `agents doctor` checks CLI availability and resource sync drift, `agents view` shows per-account quota/rate-limit data for installed agents, `agents config budget` shows cross-vendor spend caps and current spend-to-cap (and enforces pre-flight estimates + a hard-cap kill-switch on every run — see [docs/observability.md](cli/docs/observability.md#budget-guardrails-agents-budget)), `agents import` adopts an existing unmanaged install, `agents trash` lists and restores soft-deleted version directories, and `agents subagents` installs reusable subagent definitions for parent-agent workflows.
1329
1360
 
1330
1361
  ---
1331
1362
 
@@ -1448,7 +1479,7 @@ By default, secrets sync via iCloud Keychain to your other Macs. With `--no-iclo
1448
1479
 
1449
1480
  ## Compatibility
1450
1481
 
1451
- Which DotAgents resources each agent CLI can load. Source of truth: [src/lib/agents.ts](apps/cli/src/lib/agents.ts) (`capabilities`); gates use `supports(agent, cap, version)` from [src/lib/capabilities.ts](apps/cli/src/lib/capabilities.ts). Full matrix also in [docs/concepts.md](apps/cli/docs/concepts.md).
1482
+ Which DotAgents resources each agent CLI can load. Source of truth: [src/lib/agents.ts](cli/src/lib/agents.ts) (`capabilities`); gates use `supports(agent, cap, version)` from [src/lib/capabilities.ts](cli/src/lib/capabilities.ts). Full matrix also in [docs/concepts.md](cli/docs/concepts.md).
1452
1483
 
1453
1484
  > **Gemini CLI is hard-deprecated.** Google retired it for free, Pro, and Ultra tiers on **June 18, 2026** (announced at Google I/O 2026); the `gemini` command no longer serves requests on those tiers. agi-cli keeps the legacy `gemini` id only so old sessions/config can still be read. `agents add gemini`, `agents import gemini`, and `agents sync gemini` fail and point to **Antigravity CLI** (`antigravity`), Google's official successor — see [the transition notice](https://developers.googleblog.com/an-important-update-transitioning-gemini-cli-to-antigravity-cli/).
1454
1485
 
@@ -1576,7 +1607,7 @@ Profiles (experimental — available by default). Works with LiteLLM Proxy, Olla
1576
1607
 
1577
1608
  ### Can I add support for a new agent?
1578
1609
 
1579
- Agents are defined in [src/lib/agents.ts](apps/cli/src/lib/agents.ts) -- each is a config object declaring commands dir, rules file, and capabilities. PRs welcome.
1610
+ Agents are defined in [src/lib/agents.ts](cli/src/lib/agents.ts) -- each is a config object declaring commands dir, rules file, and capabilities. PRs welcome.
1580
1611
 
1581
1612
  ### What's the relationship to Phoenix Labs / Rush?
1582
1613
 
@@ -1588,20 +1619,23 @@ Agents are defined in [src/lib/agents.ts](apps/cli/src/lib/agents.ts) -- each is
1588
1619
 
1589
1620
  | Path | What |
1590
1621
  |---|---|
1591
- | [`apps/cli`](apps/cli) | **The CLI** (this README) — version management, config sync, sessions, teams, cloud, browser, computer, secrets. |
1592
- | [`apps/ext`](apps/ext) | **AGI EXT** — a VS Code extension that spawns agent terminals as tabs and adds the Fleet dashboard. A separate product with its own publish identity. |
1622
+ | [`cli`](cli) | **The CLI** (this README) — version management, config sync, sessions, teams, cloud, browser, computer, secrets. |
1623
+ | [phnx-labs/agi-ext](https://github.com/phnx-labs/agi-ext) | **AGI EXT** — the VS Code extension (agent terminals as tabs + the Fleet dashboard). Moved to its own repo (RUSH-3189); separate product, own publish identity. |
1593
1624
  | [`native/computer-mac`](native/computer-mac) · [`native/computer-win`](native/computer-win) | Native backends behind `agents computer` — Swift (macOS Accessibility + screen capture) and C#/.NET (Windows UI Automation). |
1594
- | [`packages/session-tracker`](packages/session-tracker) | The `SessionStart` hook that writes live-session state **AGI EXT** reads back (`apps/ext/src/core/liveSession.ts`) — not the CLI, which reads transcripts. |
1625
+ | [`packages/session-tracker`](packages/session-tracker) | The `SessionStart` hook that writes live-session state **AGI EXT** reads back (agi-ext `src/core/liveSession.ts`) — not the CLI, which reads transcripts. |
1595
1626
 
1596
1627
  ## Contributing
1597
1628
 
1598
1629
  ```bash
1599
1630
  git clone https://github.com/phnx-labs/agi-cli
1600
- cd agi-cli/apps/cli
1631
+ cd agi-cli/cli
1601
1632
  bun install && bun run build && bun test
1602
1633
  ```
1603
1634
 
1604
- Commands in [`apps/cli/src/commands/`](apps/cli/src/commands/), libraries in [`apps/cli/src/lib/`](apps/cli/src/lib/), tests as `*.test.ts` under vitest. [CLAUDE.md](CLAUDE.md) has the full style guide. [docs/landscape.md](apps/cli/docs/landscape.md) covers the competitive landscape.
1635
+ Commands live in [`cli/src/commands/`](cli/src/commands/), libraries in
1636
+ [`cli/src/lib/`](cli/src/lib/), and tests sit beside their sources. [AGENTS.md](AGENTS.md)
1637
+ is the canonical engineering guide; [`cli/docs/README.md`](cli/docs/README.md) is the
1638
+ architecture index.
1605
1639
 
1606
1640
  ## License
1607
1641
 
package/dist/bootstrap.js CHANGED
@@ -473,8 +473,10 @@ async function installResolvedPackage(metadata) {
473
473
  // getKeychainHelperPath() still repairs it on the next secret operation).
474
474
  if (process.platform === 'darwin') {
475
475
  try {
476
- const { ensureKeychainHelperInstalled } = await import('./lib/secrets/install-helper.js');
477
- ensureKeychainHelperInstalled({ forceReinstall: true });
476
+ const { ensureKeychainHelperInstalledAsync } = await import('./lib/secrets/install-helper.js');
477
+ // Async + download-capable: an upgrade to a tarball that dropped the
478
+ // bundle fetches the verified release asset instead of no-op'ing.
479
+ await ensureKeychainHelperInstalledAsync({ forceReinstall: true });
478
480
  }
479
481
  catch {
480
482
  // Non-fatal.
@@ -91,6 +91,7 @@ export declare const loadHumans: ModuleLoader;
91
91
  export declare const loadAccounts: ModuleLoader;
92
92
  export declare const loadDaemon: ModuleLoader;
93
93
  export declare const loadAuth: ModuleLoader;
94
+ export declare const loadTraces: ModuleLoader;
94
95
  /**
95
96
  * Commands whose modules pull in the SQLite-backed session/cloud stack. They are
96
97
  * registered AFTER `applyGlobalHelpConventions` (mirroring main's order: help
@@ -94,6 +94,7 @@ export const loadHumans = async () => (await import('../commands/humans.js')).re
94
94
  export const loadAccounts = async () => (await import('../commands/accounts.js')).registerAccountsCommand;
95
95
  export const loadDaemon = async () => (await import('../commands/daemon.js')).registerDaemonCommand;
96
96
  export const loadAuth = async () => (await import('../commands/auth.js')).registerAuthCommand;
97
+ export const loadTraces = async () => (await import('../commands/traces.js')).registerTracesCommands;
97
98
  /**
98
99
  * Commands whose modules pull in the SQLite-backed session/cloud stack. They are
99
100
  * registered AFTER `applyGlobalHelpConventions` (mirroring main's order: help
@@ -211,6 +212,7 @@ export const COMMAND_LOADERS = {
211
212
  humans: [loadHumans],
212
213
  daemon: [loadDaemon],
213
214
  auth: [loadAuth],
215
+ traces: [loadTraces],
214
216
  };
215
217
  /**
216
218
  * Register every module in {@link COMMAND_LOADERS} onto one fresh program and
@@ -1,5 +1,6 @@
1
1
  import type { Command } from 'commander';
2
2
  import type { AgentId } from '../lib/types.js';
3
+ import { collectRunCandidates, type RotateCandidate } from '../lib/accounting/rotate.js';
3
4
  import { type Profile } from '../lib/profiles.js';
4
5
  import { type UnifiedAccount } from '../lib/account-registry.js';
5
6
  export declare function nativeIdentityFromSource(raw: string): Promise<{
@@ -26,10 +27,67 @@ type AttachTarget = {
26
27
  * `agent@version`, or a known harness id.
27
28
  */
28
29
  export declare function classifyAttachTarget(target: string): AttachTarget;
30
+ /**
31
+ * Persist the attached setup-token to a per-version `.oauth_token` file so an
32
+ * INTERACTIVE Claude launch on a keychain-less Linux worker can authenticate from it.
33
+ * Headless runs inject the token via `buildExecEnv`, but an interactive launch defers to
34
+ * the per-version login (`claudeAdapter.applyExecConfigEnv`), and the shim's Linux fallback
35
+ * (`claudeAdapter.shimConfigEnvBash`) reads exactly this file. Without writing it, a
36
+ * freshly-attached setup-token was invisible to interactive runs on a worker. macOS keeps
37
+ * the credential in the keychain, so `resolveClaudeSetupToken` returns null there and this
38
+ * is a no-op off Linux.
39
+ */
40
+ export declare function writeClaudeInteractiveOauthToken(target: AttachTarget, targetAgent: AgentId): void;
29
41
  export declare function parseBundleKey(raw: string): {
30
42
  bundle: string;
31
43
  key: string;
32
44
  };
45
+ /** Pure text renderer for `agents accounts list` — grouped, column-aligned, labels first-class. */
46
+ export declare function renderAccountList(records: {
47
+ name: string;
48
+ provider: string;
49
+ auth: string;
50
+ }[], native: {
51
+ agent: AgentId;
52
+ name?: string;
53
+ display: string;
54
+ versions: string[];
55
+ }[]): string;
56
+ /** One labelable signed-in identity, folded across every version it is signed into. */
57
+ export interface LabelIdentity {
58
+ identityKey: string;
59
+ email: string | null;
60
+ versions: string[];
61
+ isDefault: boolean;
62
+ }
63
+ /**
64
+ * Fold signed-in run candidates into distinct identities — the unit a label
65
+ * binds to. The same account signed into several versions is ONE row, so a
66
+ * multi-version single-account harness never demands a selector. Candidates
67
+ * with no stable identity (no accountKey, no email) are dropped: there is
68
+ * nothing durable for a label to bind to. Default-version identity first.
69
+ */
70
+ export declare function groupLabelIdentities(candidates: Pick<RotateCandidate, 'version' | 'email' | 'accountKey'>[], defaultVersion: string | null): LabelIdentity[];
71
+ export type LabelSelection = {
72
+ kind: 'selected';
73
+ identity: LabelIdentity;
74
+ } | {
75
+ kind: 'ambiguous';
76
+ identities: LabelIdentity[];
77
+ };
78
+ /**
79
+ * Resolve which signed-in login a bare-harness `accounts label` call means.
80
+ * `collect` is injectable (the `resolveRunVersion` pattern) so tests drive the
81
+ * real selection path against fixture candidates.
82
+ */
83
+ export declare function resolveLabelIdentity(agent: AgentId, accountSelector: string | undefined, collect?: typeof collectRunCandidates): Promise<LabelSelection>;
84
+ /**
85
+ * Body of `accounts label`, exported with the injectable candidate collector
86
+ * so tests exercise everything but the TTY prompt itself.
87
+ */
88
+ export declare function runAccountsLabel(source: string, label: string | undefined, opts: {
89
+ account?: string;
90
+ }, collect?: typeof collectRunCandidates): Promise<void>;
33
91
  /** Named accounts that `set-default` / `switch` can pin for this harness. */
34
92
  export declare function listSwitchableAccounts(agent: AgentId): Promise<UnifiedAccount[]>;
35
93
  /**