@phnx-labs/agents-cli 1.22.115 → 1.22.117

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 (91) hide show
  1. package/CHANGELOG.md +161 -14
  2. package/README.md +1 -1
  3. package/dist/commands/browser.js +11 -0
  4. package/dist/commands/exec.d.ts +18 -0
  5. package/dist/commands/exec.js +263 -152
  6. package/dist/commands/feed.js +65 -14
  7. package/dist/commands/sessions-picker.d.ts +11 -0
  8. package/dist/commands/sessions-picker.js +88 -7
  9. package/dist/commands/sessions.d.ts +21 -2
  10. package/dist/commands/sessions.js +157 -3
  11. package/dist/commands/setup-secrets.d.ts +2 -2
  12. package/dist/commands/setup-term.d.ts +25 -0
  13. package/dist/commands/setup-term.js +71 -0
  14. package/dist/commands/setup.d.ts +1 -1
  15. package/dist/commands/setup.js +12 -4
  16. package/dist/commands/ssh.js +1 -69
  17. package/dist/lib/accounting/rotate.d.ts +63 -1
  18. package/dist/lib/accounting/rotate.js +56 -0
  19. package/dist/lib/accounts/add.js +2 -2
  20. package/dist/lib/accounts/slots.js +32 -2
  21. package/dist/lib/answer-router.d.ts +11 -2
  22. package/dist/lib/answer-router.js +26 -2
  23. package/dist/lib/auth-mint.d.ts +5 -4
  24. package/dist/lib/auth-mint.js +4 -3
  25. package/dist/lib/browser/drivers/arc.d.ts +1 -1
  26. package/dist/lib/browser/service.d.ts +10 -0
  27. package/dist/lib/browser/service.js +208 -36
  28. package/dist/lib/browser/types.d.ts +18 -0
  29. package/dist/lib/config-keys.d.ts +1 -1
  30. package/dist/lib/config-keys.js +5 -0
  31. package/dist/lib/device-config.js +61 -0
  32. package/dist/lib/devices/doctor-findings.js +2 -6
  33. package/dist/lib/feed/answer.d.ts +153 -4
  34. package/dist/lib/feed/answer.js +716 -105
  35. package/dist/lib/feed/feed.d.ts +61 -1
  36. package/dist/lib/feed/feed.js +226 -14
  37. package/dist/lib/feed/hub-server.d.ts +58 -3
  38. package/dist/lib/feed/hub-server.js +306 -54
  39. package/dist/lib/feed/pr-status.d.ts +8 -0
  40. package/dist/lib/feed/pr-status.js +9 -1
  41. package/dist/lib/feed-outcome.d.ts +1 -1
  42. package/dist/lib/feed-outcome.js +9 -2
  43. package/dist/lib/feed-policy.js +9 -3
  44. package/dist/lib/fleet/auth-sync.d.ts +2 -55
  45. package/dist/lib/fleet/auth-sync.js +2 -89
  46. package/dist/lib/harness-auth-capabilities.js +7 -2
  47. package/dist/lib/hosts/dispatch.d.ts +20 -1
  48. package/dist/lib/hosts/dispatch.js +52 -30
  49. package/dist/lib/hosts/remote-cmd.d.ts +21 -0
  50. package/dist/lib/hosts/remote-cmd.js +27 -2
  51. package/dist/lib/mailbox.d.ts +12 -0
  52. package/dist/lib/mailbox.js +16 -2
  53. package/dist/lib/menubar/snapshot.d.ts +51 -0
  54. package/dist/lib/menubar/snapshot.js +42 -3
  55. package/dist/lib/open-url.js +2 -2
  56. package/dist/lib/placement.d.ts +2 -0
  57. package/dist/lib/placement.js +5 -0
  58. package/dist/lib/projects.d.ts +23 -0
  59. package/dist/lib/projects.js +78 -0
  60. package/dist/lib/secrets-cli.d.ts +3 -3
  61. package/dist/lib/secrets-cli.js +1 -1
  62. package/dist/lib/session/active.d.ts +1 -0
  63. package/dist/lib/session/active.js +8 -0
  64. package/dist/lib/session/db.d.ts +67 -3
  65. package/dist/lib/session/db.js +381 -126
  66. package/dist/lib/session/prompt.d.ts +23 -7
  67. package/dist/lib/session/prompt.js +46 -8
  68. package/dist/lib/session/remote/remote-list.d.ts +20 -0
  69. package/dist/lib/session/remote/remote-list.js +22 -6
  70. package/dist/lib/session/remote/watch.d.ts +12 -0
  71. package/dist/lib/session/remote/watch.js +9 -0
  72. package/dist/lib/session/remote-preview-cache.d.ts +29 -0
  73. package/dist/lib/session/remote-preview-cache.js +373 -0
  74. package/dist/lib/session/tail.d.ts +50 -0
  75. package/dist/lib/session/tail.js +219 -0
  76. package/dist/lib/setup-tool-install.js +2 -1
  77. package/dist/lib/setup-tool-status.d.ts +1 -1
  78. package/dist/lib/setup-tool-status.js +7 -1
  79. package/dist/lib/signin-badge.d.ts +19 -4
  80. package/dist/lib/signin-badge.js +29 -11
  81. package/dist/lib/term-driver.d.ts +24 -0
  82. package/dist/lib/term-driver.js +36 -0
  83. package/dist/lib/terminal/index.d.ts +1 -1
  84. package/dist/lib/terminal/index.js +1 -1
  85. package/dist/lib/terminal/inject.d.ts +38 -0
  86. package/dist/lib/terminal/inject.js +55 -9
  87. package/dist/lib/terminal/transport.d.ts +15 -5
  88. package/dist/lib/terminal/transport.js +61 -11
  89. package/package.json +1 -1
  90. package/dist/lib/fleet/remote-login.d.ts +0 -170
  91. package/dist/lib/fleet/remote-login.js +0 -568
package/CHANGELOG.md CHANGED
@@ -1,5 +1,154 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.22.117
4
+
5
+ - **`agents run --local`, and `--device <this machine>` no longer SSHes to itself.** A bare
6
+ interactive run places itself like `--device auto` (PHNX-4083), and the documented way to
7
+ stay put was `--device <this machine>` — which took the remote path and probed its own
8
+ login shell over SSH, timing out on a loaded box. `--local` is the explicit local pin
9
+ (the same door as `--where local`, which previously expanded to nothing and was then
10
+ overridden by the default placement); any host flag naming this machine by short id,
11
+ MagicDNS name, loopback, or the `interactive` sentinel now resolves to the same local
12
+ run. The placement-failure hint names `--local`. Source: `cli/src/commands/exec.ts`
13
+ (`pinLocalWhenTargetIsSelf`), `cli/src/lib/placement.ts`, `cli/src/lib/hosts/remote-cmd.ts`.
14
+
15
+ ## 1.22.116
16
+
17
+ - **`agents feed answer` is bounded, exactly-once, and truthful about delivery
18
+ (PHNX-3999).** The AGI Menu abandons a reply at 30s; this path used to blow
19
+ that budget and then report a fabricated receipt.
20
+ - **Bounded.** The requested attention key names its session, so only that
21
+ session is reconciled and the optional `gh pr view` enrichment runs only for
22
+ a key whose generation is a PR review. Previously every active session was
23
+ enriched — one 15s-bounded `gh` call each — *before* the key was compared.
24
+ The whole operation now runs under one deadline, and a forwarded answer is
25
+ raced against it directly rather than trusting the transport's own timer.
26
+ - **Exact tokens across the hop.** A forwarded answer is POSIX-quoted with the
27
+ canonical `shellQuote` and run through the canonical `sshExecAsync`, so a
28
+ multiline answer or one carrying `$`, backticks, quotes or `;` arrives
29
+ byte-identical instead of being re-parsed by the remote shell.
30
+ - **Multiline free text.** A multiline answer is delivered into a tmux rail as
31
+ one bracketed paste (`injectIntoTerminal`'s new `paste` option), so a TUI
32
+ inserts it verbatim instead of submitting one line at a time. A rail that
33
+ cannot carry the framing refuses *before* the claim is taken.
34
+ - **A claim is no longer a resolution.** `recordAnswer` gains a two-phase
35
+ `pending` mode: the claim locks the item but leaves the block `open` and
36
+ writes no resolution tombstone, so an unconfirmed delivery can no longer make
37
+ the request silently vanish from the feed. Only the AGENT's own
38
+ acknowledgement resolves it — a `consumed`/`continued` receipt promotes the
39
+ claim through `confirmAnswerResolution`, bound to the generation and attempt
40
+ it was taken for, so a slow delivery cannot resolve the question the agent
41
+ has since moved on to. A `queued` receipt never does.
42
+ - **Truthful, typed outcomes for the operator UI.** `--json` now emits
43
+ `status` (`delivered` / `already_answered` / `unknown` / `failed`),
44
+ `delivery` (`receipt` / `unconfirmed` / `failed`), `resolved`, `host`,
45
+ `attempt`, and the block's **real** `MessageReceipt` — never a synthesized
46
+ one. `queued` is delivery, never resolution; `dropped`/`expired` read as
47
+ failures rather than as the furthest-along success. A timeout, a truncated
48
+ remote reply, or a partly-written keystroke sequence is `unknown` (the claim
49
+ is kept, so a retry cannot double-send); only a provable non-delivery is
50
+ `failed`.
51
+ - **`agents feed answer <key> --check [--attempt <at>]`** is a new read-only
52
+ reconciliation — the "check delivery" path for an unconfirmed answer. It
53
+ never claims, routes or resends, and it is bound to the requested generation
54
+ and attempt, so a stale card can never be resolved by the next question's
55
+ receipt.
56
+ - **Stranded claims reconcile.** A claim a kill left with no receipt is adopted
57
+ and completed only on the mailbox rail, where the whole spool (inbox,
58
+ processing and consumed) is scanned by block id so the answer is never
59
+ enqueued twice, and only through a compare-and-swap so two retries cannot
60
+ both adopt it.
61
+
62
+ - **AGI Menu: synchronized Headless-runs defaults, Home and device preferences.**
63
+ Five new `agents config` keys, validated at write time and synced fleet-wide like
64
+ the existing `menubar.menu.*` set: `menubar.menu.headlessAgent` and
65
+ `menubar.menu.headlessFallbackAgent` (each a registered agent id — a typo is
66
+ refused, not stored), `menubar.menu.headlessPlacement`
67
+ (`auto` | `local` | `interactive` | a device name),
68
+ `menubar.menu.sessionUpdates`, and `menubar.menu.deviceSort`
69
+ (`name` | `role` | `load` | `memory` | `disk`).
70
+ - **`agents run --fallback <agent>` now reaches the alternate harness when the
71
+ primary's accounts are exhausted before the run starts.** Previously that case
72
+ printed "no healthy account" and exited 1, so a configured alternate never fired
73
+ for the one situation it exists for; the mid-run handoff also no longer stops at
74
+ three accounts when an explicit alternate is configured, so every healthy account
75
+ of the primary is tried before another harness. A signed-out primary still fails
76
+ loud with the login hint — logging in is the fix there, not a different harness.
77
+ - **`agents menubar snapshot --json` reports each device's role and specs.** Every
78
+ `devices[]` row gains `role`, `autoEligible` (whether `--device auto` may pick it)
79
+ and `stats` — cores, total/free memory and disk, load, reachability, and when each
80
+ was observed. Read from the existing fleet-stats cache, so no fleet probe; `null`
81
+ for a device never measured, and every unobserved number is `null` rather than `0`.
82
+ - **Session rows carry `confirmedProject`.** The registered project whose root
83
+ contains the session's working directory, or `null` when the association is not
84
+ confirmed, on `agents feed watch --json`, `agents sessions watch --json`, and
85
+ `agents sessions --active --json`. A directory no project definition names — even
86
+ one that happens to be a git repository — is no longer filed under a project
87
+ invented from its folder name. The existing `project` field is unchanged.
88
+ - **Session titles exclude shell and control scaffolding.** A harness-generated
89
+ title that is a `<bash-input>`/`<command-name>`/`<system-reminder>` wrapper, or a
90
+ bare control command such as `/clear` or `/compact`, is rejected so the row shows
91
+ the generated title or the user's own first prompt instead. A `/rename` title is
92
+ still kept verbatim, and the original prompt stays on the row. Existing indexed
93
+ sessions are re-derived on their next scan.
94
+
95
+ - **Session previews retain details across devices (PHNX-3999).** An exact session
96
+ ID and owning device use one bounded request, with a durable local copy for
97
+ offline reading. Reopening unchanged sessions avoids network requests; activity
98
+ changes invalidate the copy, and failed requests back off without hiding prior
99
+ content. Concurrent requests coalesce, including failed manual refreshes.
100
+ SQLite contention, lock waiting, and transport share a 10-second budget.
101
+ - **Large local transcripts show bounded recent details.** Previews reuse the
102
+ canonical transcript parsers and timeline projection, mark partial history,
103
+ and report missing transcripts explicitly. Cached timeline data is accepted
104
+ only for the exact file modification time and size that produced it.
105
+
106
+ - `agents setup secrets` / `agents clis install secrets` now install Secrets CLI 0.1.5, which accepts the shared Phoenix `--host` address grammar (`ssh://[user@]host`, bare `user@host`/alias; other schemes fail loud) on `secrets` and `secrets hosts pin` (PHNX-4090) — matching the `--host` grammar computer-cli 0.1.5 already ships. Existing installs are unaffected; the canonical pin lives in `cli/src/lib/secrets-cli.ts`.
107
+
108
+ - **`agents setup` now installs the standalone `term` CLI as a first-class onboarding phase (PHNX-4092).** The PTY engine `agents fleet login` and `agents auth mint` spawn on demand lives in `@phnx-labs/term-cli` (extracted PHNX-4091); a fleet device with it missing failed those flows loud. The onboarding hub gains a `term` phase and an `agents setup term` wizard (with `--install-only` / `--terminal`) that installs the pinned `@phnx-labs/term-cli@0.1.0` — via the system `clis/term.yaml` manifest, else a pinned `npm i -g` — the same way `browser`/`computer`/`secrets` install. `agents setup status` and `--tool term` report its readiness: unlike the other tools `term` has no `status --json` health surface, so presence on PATH is the whole readiness signal (no probe, no configure step). Source: `cli/src/commands/setup-term.ts`, `cli/src/commands/setup.ts`, `cli/src/lib/setup-tool-status.ts`, `cli/src/lib/setup-tool-install.ts`.
109
+
110
+ - **`browser status` no longer goes blank when one Arc task is stale (PHNX-3999).** A
111
+ single Arc tab that had been moved to another window or Space — or closed — made
112
+ `agents browser status` throw, and **every** profile vanished from the listing,
113
+ including healthy ones with nothing to do with Arc. The refusal to adopt a moved
114
+ tab is correct and is unchanged: an action still will not drive a tab its task no
115
+ longer owns. What changed is that read-only `status` no longer inherits the blast
116
+ radius. An unreadable task is reported with the tab count it owns on disk plus the
117
+ reason its live tabs could not be read, an unreadable profile is listed with an
118
+ `unavailable` reason instead of disappearing, and the other profiles are reported
119
+ normally. `tabs` is absent rather than empty for such a task, so nothing claims a
120
+ stale tab is live. Source: `cli/src/lib/browser/service.ts`.
121
+ - **`browser status` reads Arc once per pass instead of once per tab (PHNX-3999).** A
122
+ profile with 28 tasks paid one AppleScript round trip per owned tab, plus one
123
+ liveness probe per saved Arc runtime while reconnecting, so a cold `status` spent
124
+ dozens of serialized round trips before printing anything. It now takes a single
125
+ snapshot and a single liveness probe for the entire pass, shared across every Arc
126
+ profile, and never contacts Arc at all when no Arc profile is present. Actions are
127
+ unchanged and still read Arc live per tab. Source: `cli/src/lib/browser/service.ts`.
128
+
129
+ - **grok signs in through its device-code flow.** `agents accounts add grok`, `agents accounts login grok#<name>`, and the logged-out hint all run `grok login --device-auth`. Bare `grok login` defaults to `--oauth`, the loopback browser flow, which opens whatever browser profile the OS defaults to. The device-code screen prints the URL and code instead, so the human finishes the sign-in in the browser profile they choose — which is what makes it usable over an SSH shell on a worker. Source: `cli/src/lib/harness-auth-capabilities.ts`, `cli/src/lib/signin-badge.ts`.
130
+
131
+ - **A feed snapshot larger than the reader budget now reaches the reader whole (PHNX-3999).**
132
+ The daemon's shared feed socket wrote each envelope in one `socket.write` and dropped the
133
+ reader the moment its unflushed bytes passed 4 MiB — so a healthy Menu or `agents feed
134
+ watch --json` client attaching to a fleet whose reset exceeded that got 8 KiB of it, no
135
+ newline, then EOF, and the CLI exited 0 as if the fleet were empty. Each connection now has
136
+ one ordered writer that streams the snapshot before any live event in 64 KiB chunks paced
137
+ by the socket's own `'drain'`. A reader is dropped only when it stays more than 4 MiB of
138
+ live events behind for 2 s, or leaves a chunk unaccepted for 30 s — a burst of peer resets
139
+ to a healthy reader is never a drop. The client rejects any close it did not ask for,
140
+ naming a mid-frame truncation, and a throwing consumer fails that same promise instead of
141
+ escaping as an uncaught exception. Source: `cli/src/lib/feed/hub-server.ts`.
142
+
143
+ - **Browser setup installs Browser CLI 0.1.5 (PHNX-3999).** New installations
144
+ include the status fix that reports unavailable Arc tasks without hiding healthy
145
+ profiles and reads visible Arc tabs once per status request. Existing browser
146
+ installations are preserved; upgrade them explicitly with
147
+ `npm install -g @phnx-labs/browser-cli@0.1.5`. (0.1.5 is a clean re-cut of the
148
+ partially-published 0.1.4; same behavior.)
149
+
150
+ - **Removed `agents devices login` (a.k.a. "fleet login").** The remote device-code login orchestration could not work in the account-slot model — a box may hold several accounts per harness, and a per-box native login has no way to say which account it is signing in. It is gone entirely (not deprecated-and-hidden). Accounts are provisioned from durable worker credentials (`agents accounts add/login <harness>#<name>`); a token-less harness (kimi/antigravity) logs in per box — run the harness on that device and complete its native login. Logged-out hints for per-device harnesses now point at that path instead. Source: `cli/src/commands/ssh.ts`, `cli/src/lib/fleet/auth-sync.ts`, `cli/src/lib/signin-badge.ts`, `cli/src/lib/accounts/add.ts`, `cli/src/lib/auth-mint.ts`.
151
+
3
152
  ## 1.22.115
4
153
 
5
154
  - **Artifact sharing moved out to the standalone `artifacts` CLI (breaking).**
@@ -93,20 +242,18 @@
93
242
 
94
243
  - **AGI Menu 1.5.0 adds tool sessions and Setup.** The menu separates Agents, Browser and Computer activity, shows browser controls and recorded computer captures, and reports installation and readiness for Browser, Computer and Secrets CLI. It consumes the shared daemon feed without periodic tool subprocesses. The helper floor selects the signed and notarized `menubar/v1.5.0` release.
95
244
 
96
- - **Replacing the browser daemon no longer kills a live browser (PHNX-3999).** The
97
- daemon's startup reaper read "the daemon that launched this has exited" as "everything
98
- it recorded is garbage" and SIGTERMed the browser — so activating the menu bar,
99
- upgrading, or a daemon crash-restart closed a browser you were looking at, and the
100
- runtime record was wiped so the survivor could not even be re-attached. But a live
101
- browser outliving its daemon is the normal case: shutdown deliberately closes only
102
- CDP, and on macOS the browser is spawned detached. A live local browser is now
103
- preserved untouched, a dead record is cleared without signalling anything, and a
104
- stale `ssh -L` tunnel — which genuinely cannot outlive its owner — is still reaped,
105
- decided separately from the browser instead of sharing one kill path. Ownership of a
106
- preserved browser transfers only after an identity-checked attach succeeds — including
107
- the restart path that restores your open browser tasks — and that rewrites the
108
- owning-daemon pid alone, keeping the original launch's metadata. Source:
109
- `cli/src/lib/browser/runtime-state.ts`.
245
+ - **Daemon startup preserves surviving local browsers (PHNX-3999).** The startup
246
+ reaper keeps a live local browser's runtime and task records when its previous
247
+ daemon has exited. Dead process records and stale SSH tunnels are handled
248
+ separately. Ownership changes only after an identity-checked reattach succeeds,
249
+ preserving the original launch metadata. Reconnection requires an existing
250
+ debugging port: `--remote-debugging-pipe` handles belong to the original service
251
+ process and cannot transfer to a replacement daemon. Coordinate release of an
252
+ active pipe-connected browser before restarting its daemon.
253
+ - **Browser setup selects standalone Browser CLI 0.1.3.** The default package for
254
+ `agents setup browser --install-only` now includes the browser preservation and
255
+ task-restoration fixes. Existing installations and configured CLI manifests
256
+ retain their current behavior.
110
257
 
111
258
  - **BREAKING — deprecated command shims are deleted; every surface has one spelling.** The hidden and warned aliases that kept "still works this release" paths alive are gone, not tombstoned: a script that still calls one now gets commander's `unknown command` / `unknown option` and exits non-zero. Removed → replacement: `agents notify` → `agents send --to owner` (or `agents feed post --level important` for a milestone that should reach the owner; a `feed.broadcast` sink that spawned `agents notify "{message}"` becomes `channel: owner`); `agents doctor --fix` → `agents sync <agent>@all` (doctor is diagnose-only); `agents accounts connect|name|label|attach|detach|switch|set-default` and the hidden `agents accounts mint` / `agents auth mint` → `agents accounts add <harness> [name]`, `agents accounts login <harness>#<name>`, `agents accounts default <harness> [name]`, `agents accounts rename`, and `agents run <harness>#<name>` (accounts select by name; installation bindings are gone); `agents sessions go` → `agents sessions resume --attach-only`; `agents sessions attach` and `agents reconnect` / `agents sessions reconnect` → `agents sessions resume [id]`; `agents repo refresh` → `agents sync`; `agents mcp register` → `agents sync --mcp`; `agents memory sync` → `agents sync --memory`; `agents plugins sync <name>` → `agents sync --plugin <name>`; `agents skills info` → `agents skills view`; `agents run --smart` → `agents run --device auto`; `agents events --audit` → `agents events audit` or `--include ops`; `agents devices prefer|unprefer <name>` → `agents devices config <name> auto-launch.preferred on|--unset`; `agents devices set-interactive [name]` → `agents config set interactive.host <name>` (or `agents devices config <name> interactive.host <name>`); `agents devices configure|note|set <name>` → `agents devices config <name> <key> <value>`. `agents devices enable|disable <name>` stay as first-class, visible sugar over `auto-launch.enabled` (no deprecation notice). Folding `mcp register` into `agents sync` also closed a gap in the replacement: sync's reconcile stage skipped every HTTP MCP server declared in `agents.yaml` (`refresh.ts` `continue`d on `transport: http`) while the removed command registered it — it now registers HTTP servers through the same `registerMcpToTargets` path (`codex mcp add <name> --url <url>`), and the yaml-resource writer's Codex arm no longer silently no-ops on HTTP either (`installMcpViaCodex`). Source: `cli/src/commands/send.ts`, `doctor.ts`, `accounts.ts`, `auth.ts`, `go.ts`, `sessions.ts`, `repo.ts`, `mcp.ts`, `memory.ts`, `plugins.ts`, `skills.ts`, `exec.ts`, `events.ts`, `ssh.ts`, `cli/src/lib/smart-launch.ts`.
112
259
 
package/README.md CHANGED
@@ -53,7 +53,7 @@ agents setup status # readiness for browser, computer, fleet,
53
53
  agents run claude "explain this repo" # run any agent on your existing subscription
54
54
  ```
55
55
 
56
- Everything here — and every other command in this README — is free and needs no account; the optional `agents auth login` unlocks the hosted surfaces — [team spaces](#sign-in) and managed trace sync (`agents traces sync` with no Cloudflare setup). `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, 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.
56
+ Everything here — and every other command in this README — is free and needs no account; the optional `agents auth login` unlocks the hosted surfaces — [team spaces](#sign-in) and managed trace sync (`agents traces sync` with no Cloudflare setup). `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, term, fleet, 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.
57
57
 
58
58
  The command surface teaches setup through `agents setup` and group-level `--help`.
59
59
  The durable system model starts at [`cli/docs/README.md`](cli/docs/README.md).
@@ -2762,6 +2762,11 @@ function registerTaskCommands(browser) {
2762
2762
  // instead of the raw `comet-local@endpoint-0` key (RUSH-2709).
2763
2763
  const endpointLabel = profile.endpoint ? `endpoint: ${profile.endpoint}, ` : '';
2764
2764
  console.log(`\n${profile.name} (${endpointLabel}${portLabel}, ${pidLabel})`);
2765
+ // A profile whose live state could not be read is still listed, and
2766
+ // says so — it is not silently dropped and not shown as healthy.
2767
+ if (profile.unavailable) {
2768
+ console.log(` Unavailable: ${profile.unavailable}`);
2769
+ }
2765
2770
  if (profile.tasks.length === 0) {
2766
2771
  console.log(' No active tasks');
2767
2772
  }
@@ -2783,6 +2788,12 @@ function registerTaskCommands(browser) {
2783
2788
  String(task.tabCount).padEnd(6) +
2784
2789
  domains.slice(0, 20).padEnd(22) +
2785
2790
  age);
2791
+ // The recorded tab count above is what the task owns on disk; this
2792
+ // says the live tabs behind it could not be read, so the count is
2793
+ // not mistaken for verified-live tabs.
2794
+ if (task.unavailable) {
2795
+ console.log(' '.padEnd(14) + `↳ tabs unreadable: ${task.unavailable}`);
2796
+ }
2786
2797
  }
2787
2798
  }
2788
2799
  }
@@ -62,6 +62,7 @@ interface ExecCommandActionOptions {
62
62
  until?: string;
63
63
  interval?: string;
64
64
  where?: string;
65
+ local?: boolean;
65
66
  host?: string;
66
67
  device?: string;
67
68
  on?: string;
@@ -130,6 +131,20 @@ export declare function hostTargetGiven(options: {
130
131
  on?: string;
131
132
  computer?: string;
132
133
  }): string[];
134
+ /**
135
+ * Turn a host target that names THIS machine into an explicit local pin: the
136
+ * host-family flags are cleared and `local` is set, so no dispatch path
137
+ * self-SSHes and the bare-interactive default (`bareInteractiveRunDefaultsToDeviceAuto`)
138
+ * sees a decided placement. Returns true when the pin was applied. Pure over
139
+ * the `isSelf` predicate so the rule is testable without a device registry.
140
+ */
141
+ export declare function pinLocalWhenTargetIsSelf(options: {
142
+ host?: string;
143
+ device?: string;
144
+ on?: string;
145
+ computer?: string;
146
+ local?: boolean;
147
+ }, isSelf: (name: string) => boolean): boolean;
133
148
  /**
134
149
  * Return every option whose selection semantics conflict with an account
135
150
  * choice (`agent#`). Device routing is deliberately absent: the marker rides
@@ -159,6 +174,7 @@ export declare function runDevicePickerConflicts(options: {
159
174
  device?: string;
160
175
  on?: string;
161
176
  computer?: string;
177
+ local?: boolean;
162
178
  }): string[];
163
179
  export { RUN_AUTO_KEYWORD };
164
180
  /**
@@ -179,6 +195,7 @@ export declare function runAutoDefaultsToAffinity(options: {
179
195
  device?: string;
180
196
  on?: string;
181
197
  computer?: string;
198
+ local?: boolean;
182
199
  }, env?: NodeJS.ProcessEnv): boolean;
183
200
  /**
184
201
  * Whether a bare human-facing `agents run <harness>` — no prompt, so an
@@ -210,6 +227,7 @@ export declare function bareInteractiveRunDefaultsToDeviceAuto(options: {
210
227
  lease?: string | boolean;
211
228
  box?: string;
212
229
  cloud?: boolean;
230
+ local?: boolean;
213
231
  }, run: {
214
232
  prompt?: string;
215
233
  devicePickerRequested?: boolean;