@phnx-labs/agents-cli 1.22.121 → 1.22.123

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 (247) hide show
  1. package/CHANGELOG.md +316 -0
  2. package/README.md +53 -53
  3. package/dist/bootstrap.js +22 -17
  4. package/dist/cli/command-registry.d.ts +0 -1
  5. package/dist/cli/command-registry.js +2 -12
  6. package/dist/commands/auth.js +13 -4
  7. package/dist/commands/browser.js +3 -4
  8. package/dist/commands/cloud-transcripts.d.ts +7 -0
  9. package/dist/commands/cloud-transcripts.js +100 -0
  10. package/dist/commands/cloud.js +5 -0
  11. package/dist/commands/computer.d.ts +0 -12
  12. package/dist/commands/computer.js +14 -124
  13. package/dist/commands/config.js +5 -4
  14. package/dist/commands/daemon-index.d.ts +2 -0
  15. package/dist/commands/daemon-index.js +44 -0
  16. package/dist/commands/daemon.js +13 -8
  17. package/dist/commands/doctor.js +3 -4
  18. package/dist/commands/exec.d.ts +5 -0
  19. package/dist/commands/exec.js +35 -7
  20. package/dist/commands/feed-watch.js +12 -0
  21. package/dist/commands/feed.d.ts +1 -1
  22. package/dist/commands/feed.js +7 -4
  23. package/dist/commands/insights.js +3 -1
  24. package/dist/commands/inspect.js +1 -1
  25. package/dist/commands/logs.js +2 -1
  26. package/dist/commands/mailboxes.js +1 -1
  27. package/dist/commands/models.js +1 -1
  28. package/dist/commands/projects.js +3 -3
  29. package/dist/commands/prune.js +6 -28
  30. package/dist/commands/ps-roster.d.ts +0 -1
  31. package/dist/commands/ps-roster.js +2 -21
  32. package/dist/commands/ps.js +13 -1
  33. package/dist/commands/recordings.d.ts +2 -0
  34. package/dist/commands/recordings.js +117 -0
  35. package/dist/commands/routines.js +1 -1
  36. package/dist/commands/secrets-passthrough.js +3 -3
  37. package/dist/commands/send.js +33 -20
  38. package/dist/commands/sessions-backfill.d.ts +1 -0
  39. package/dist/commands/sessions-backfill.js +48 -13
  40. package/dist/commands/sessions-migrate.d.ts +1 -1
  41. package/dist/commands/sessions-migrate.js +11 -10
  42. package/dist/commands/sessions-optimize.d.ts +1 -0
  43. package/dist/commands/sessions-optimize.js +7 -4
  44. package/dist/commands/sessions-resume.js +8 -1
  45. package/dist/commands/sessions-stats.d.ts +2 -0
  46. package/dist/commands/sessions-stats.js +24 -7
  47. package/dist/commands/sessions.d.ts +5 -11
  48. package/dist/commands/sessions.js +8 -236
  49. package/dist/commands/setup-computer.js +1 -2
  50. package/dist/commands/setup-mine.js +0 -1
  51. package/dist/commands/setup.js +1 -1
  52. package/dist/commands/sync.js +101 -1
  53. package/dist/commands/teams.js +2 -2
  54. package/dist/commands/testdata/feed-hub.js +11 -0
  55. package/dist/commands/trash.d.ts +0 -1
  56. package/dist/commands/trash.js +74 -10
  57. package/dist/lib/accounting/usage-sync.js +7 -0
  58. package/dist/lib/agent-modes.d.ts +1 -1
  59. package/dist/lib/agent-modes.js +11 -5
  60. package/dist/lib/auth-mint.d.ts +4 -0
  61. package/dist/lib/auth-mint.js +6 -4
  62. package/dist/lib/browser/native-history.test-fixture.d.ts +12 -0
  63. package/dist/lib/browser/native-history.test-fixture.js +43 -0
  64. package/dist/lib/browser/paths.d.ts +5 -0
  65. package/dist/lib/browser/paths.js +7 -1
  66. package/dist/lib/browser/sessions-list.d.ts +28 -1
  67. package/dist/lib/browser/sessions-list.js +137 -25
  68. package/dist/lib/channels/providers/rush.d.ts +2 -1
  69. package/dist/lib/channels/providers/rush.js +2 -2
  70. package/dist/lib/channels/providers/session.d.ts +1 -0
  71. package/dist/lib/channels/providers/session.js +23 -12
  72. package/dist/lib/channels/registry.d.ts +9 -2
  73. package/dist/lib/channels/send.d.ts +5 -10
  74. package/dist/lib/channels/send.js +88 -50
  75. package/dist/lib/cloud/rush.d.ts +6 -0
  76. package/dist/lib/cloud/rush.js +18 -3
  77. package/dist/lib/computer-client.d.ts +19 -0
  78. package/dist/lib/computer-client.js +104 -0
  79. package/dist/lib/config-keys.d.ts +5 -1
  80. package/dist/lib/config-keys.js +14 -11
  81. package/dist/lib/daemon/auth-sync-service.js +13 -0
  82. package/dist/lib/daemon/daemon.js +20 -23
  83. package/dist/lib/daemon/owner-device-delivery-service.d.ts +10 -0
  84. package/dist/lib/daemon/owner-device-delivery-service.js +28 -0
  85. package/dist/lib/daemon-services.d.ts +2 -1
  86. package/dist/lib/daemon-services.js +17 -10
  87. package/dist/lib/daemon-webhooks.d.ts +1 -1
  88. package/dist/lib/daemon-webhooks.js +1 -1
  89. package/dist/lib/device-config.d.ts +4 -1
  90. package/dist/lib/device-config.js +58 -8
  91. package/dist/lib/devices/doctor-findings.d.ts +2 -3
  92. package/dist/lib/devices/doctor-findings.js +10 -19
  93. package/dist/lib/event-provenance.d.ts +1 -0
  94. package/dist/lib/event-provenance.js +2 -0
  95. package/dist/lib/exec.d.ts +1 -0
  96. package/dist/lib/exec.js +20 -15
  97. package/dist/lib/feed/pr-status.d.ts +5 -1
  98. package/dist/lib/feed/pr-status.js +44 -3
  99. package/dist/lib/feed/tool-activity.js +9 -6
  100. package/dist/lib/feed/tools.d.ts +4 -1
  101. package/dist/lib/feed/tools.js +8 -11
  102. package/dist/lib/feed-broadcast.d.ts +5 -3
  103. package/dist/lib/feed-broadcast.js +47 -36
  104. package/dist/lib/fleet-shared-state.d.ts +5 -0
  105. package/dist/lib/fleet-shared-state.js +8 -0
  106. package/dist/lib/github/project-prs.d.ts +4 -1
  107. package/dist/lib/github/project-prs.js +20 -7
  108. package/dist/lib/help.d.ts +1 -0
  109. package/dist/lib/help.js +8 -0
  110. package/dist/lib/helper-versions.js +1 -1
  111. package/dist/lib/hosts/passthrough.js +5 -9
  112. package/dist/lib/hosts/remote-cmd.d.ts +2 -7
  113. package/dist/lib/hosts/remote-cmd.js +14 -22
  114. package/dist/lib/hosts/routing-flag.d.ts +22 -0
  115. package/dist/lib/hosts/routing-flag.js +127 -14
  116. package/dist/lib/identity/index.d.ts +22 -0
  117. package/dist/lib/identity/index.js +3 -0
  118. package/dist/lib/installations/migrate.d.ts +7 -0
  119. package/dist/lib/installations/migrate.js +99 -88
  120. package/dist/lib/installations/versions.js +2 -2
  121. package/dist/lib/launch-identity.d.ts +6 -1
  122. package/dist/lib/launch-identity.js +12 -2
  123. package/dist/lib/menubar/install-menubar.d.ts +1 -0
  124. package/dist/lib/menubar/install-menubar.js +8 -5
  125. package/dist/lib/menubar/snapshot.js +2 -3
  126. package/dist/lib/notify.d.ts +7 -14
  127. package/dist/lib/notify.js +29 -75
  128. package/dist/lib/owner-message.d.ts +4 -6
  129. package/dist/lib/owner-message.js +12 -11
  130. package/dist/lib/owner-notify-tokens.d.ts +49 -0
  131. package/dist/lib/owner-notify-tokens.js +214 -0
  132. package/dist/lib/owner-notify.d.ts +75 -0
  133. package/dist/lib/owner-notify.js +144 -0
  134. package/dist/lib/plugins/plugins.d.ts +7 -1
  135. package/dist/lib/plugins/plugins.js +26 -5
  136. package/dist/lib/pr-land-detach.js +2 -2
  137. package/dist/lib/recordings/config.d.ts +11 -0
  138. package/dist/lib/recordings/config.js +54 -0
  139. package/dist/lib/recordings/identity.d.ts +12 -0
  140. package/dist/lib/recordings/identity.js +57 -0
  141. package/dist/lib/recordings/ledger.d.ts +16 -0
  142. package/dist/lib/recordings/ledger.js +141 -0
  143. package/dist/lib/recordings/model.d.ts +29 -0
  144. package/dist/lib/recordings/model.js +28 -0
  145. package/dist/lib/recordings/pipeline.d.ts +44 -0
  146. package/dist/lib/recordings/pipeline.js +272 -0
  147. package/dist/lib/recordings/process.d.ts +17 -0
  148. package/dist/lib/recordings/process.js +94 -0
  149. package/dist/lib/recordings/service.d.ts +15 -0
  150. package/dist/lib/recordings/service.js +45 -0
  151. package/dist/lib/recordings/settle.d.ts +21 -0
  152. package/dist/lib/recordings/settle.js +92 -0
  153. package/dist/lib/recordings/transcode.d.ts +13 -0
  154. package/dist/lib/recordings/transcode.js +44 -0
  155. package/dist/lib/refresh.js +4 -1
  156. package/dist/lib/reminders.d.ts +0 -1
  157. package/dist/lib/reminders.js +1 -1
  158. package/dist/lib/reserved-stores.d.ts +3 -0
  159. package/dist/lib/reserved-stores.js +13 -0
  160. package/dist/lib/routine-notify-owner.d.ts +3 -23
  161. package/dist/lib/routine-notify-owner.js +26 -107
  162. package/dist/lib/rush-api.d.ts +1 -0
  163. package/dist/lib/rush-api.js +1 -0
  164. package/dist/lib/scheduling/routines.d.ts +1 -1
  165. package/dist/lib/scheduling/routines.js +1 -1
  166. package/dist/lib/session/active.d.ts +18 -2
  167. package/dist/lib/session/active.js +47 -37
  168. package/dist/lib/session/cloud.js +18 -45
  169. package/dist/lib/session/db.d.ts +3 -1
  170. package/dist/lib/session/db.js +64 -32
  171. package/dist/lib/session/glance-files.d.ts +4 -3
  172. package/dist/lib/session/glance-files.js +31 -0
  173. package/dist/lib/session/inject-target.js +12 -2
  174. package/dist/lib/session/pid-registry.d.ts +2 -0
  175. package/dist/lib/session/pid-registry.js +6 -2
  176. package/dist/lib/session/presentation.d.ts +21 -0
  177. package/dist/lib/session/presentation.js +198 -0
  178. package/dist/lib/session/projection.js +9 -2
  179. package/dist/lib/sqlite.d.ts +3 -1
  180. package/dist/lib/sqlite.js +7 -3
  181. package/dist/lib/staleness/index.js +12 -0
  182. package/dist/lib/staleness/types.d.ts +5 -0
  183. package/dist/lib/standalone-tools.js +1 -1
  184. package/dist/lib/startup/command-registry.js +10 -5
  185. package/dist/lib/state.d.ts +2 -5
  186. package/dist/lib/state.js +3 -11
  187. package/dist/lib/sync-delete.d.ts +21 -0
  188. package/dist/lib/sync-delete.js +113 -0
  189. package/dist/lib/terminal/inject.js +1 -1
  190. package/dist/lib/testdata/owner-notify-api.d.ts +36 -0
  191. package/dist/lib/testdata/owner-notify-api.js +102 -0
  192. package/dist/lib/trash.d.ts +14 -0
  193. package/dist/lib/trash.js +75 -0
  194. package/dist/lib/types.d.ts +0 -34
  195. package/package.json +1 -3
  196. package/dist/commands/feedback.d.ts +0 -2
  197. package/dist/commands/feedback.js +0 -68
  198. package/dist/commands/humans.d.ts +0 -2
  199. package/dist/commands/humans.js +0 -83
  200. package/dist/commands/modes.d.ts +0 -2
  201. package/dist/commands/modes.js +0 -134
  202. package/dist/commands/monitors.d.ts +0 -2
  203. package/dist/commands/monitors.js +0 -1070
  204. package/dist/commands/reminders.d.ts +0 -2
  205. package/dist/commands/reminders.js +0 -49
  206. package/dist/lib/channels/owner-forward.d.ts +0 -25
  207. package/dist/lib/channels/owner-forward.js +0 -78
  208. package/dist/lib/channels/owner-sink.d.ts +0 -10
  209. package/dist/lib/channels/owner-sink.js +0 -26
  210. package/dist/lib/daemon/monitor-engine-service.d.ts +0 -13
  211. package/dist/lib/daemon/monitor-engine-service.js +0 -25
  212. package/dist/lib/humans.d.ts +0 -12
  213. package/dist/lib/humans.js +0 -64
  214. package/dist/lib/monitors/config.d.ts +0 -77
  215. package/dist/lib/monitors/config.js +0 -405
  216. package/dist/lib/monitors/dispatch.d.ts +0 -10
  217. package/dist/lib/monitors/dispatch.js +0 -72
  218. package/dist/lib/monitors/engine.d.ts +0 -45
  219. package/dist/lib/monitors/engine.js +0 -243
  220. package/dist/lib/monitors/fingerprint.d.ts +0 -3
  221. package/dist/lib/monitors/fingerprint.js +0 -43
  222. package/dist/lib/monitors/pid-watch.d.ts +0 -4
  223. package/dist/lib/monitors/pid-watch.js +0 -14
  224. package/dist/lib/monitors/remote.d.ts +0 -31
  225. package/dist/lib/monitors/remote.js +0 -63
  226. package/dist/lib/monitors/sources/command.d.ts +0 -4
  227. package/dist/lib/monitors/sources/command.js +0 -20
  228. package/dist/lib/monitors/sources/device.d.ts +0 -3
  229. package/dist/lib/monitors/sources/device.js +0 -31
  230. package/dist/lib/monitors/sources/failure.d.ts +0 -5
  231. package/dist/lib/monitors/sources/failure.js +0 -25
  232. package/dist/lib/monitors/sources/file.d.ts +0 -4
  233. package/dist/lib/monitors/sources/file.js +0 -46
  234. package/dist/lib/monitors/sources/http.d.ts +0 -3
  235. package/dist/lib/monitors/sources/http.js +0 -25
  236. package/dist/lib/monitors/sources/index.d.ts +0 -5
  237. package/dist/lib/monitors/sources/index.js +0 -22
  238. package/dist/lib/monitors/sources/poll.d.ts +0 -1
  239. package/dist/lib/monitors/sources/poll.js +0 -1
  240. package/dist/lib/monitors/sources/types.d.ts +0 -9
  241. package/dist/lib/monitors/sources/webhook.d.ts +0 -3
  242. package/dist/lib/monitors/sources/webhook.js +0 -3
  243. package/dist/lib/monitors/sources/ws.d.ts +0 -4
  244. package/dist/lib/monitors/sources/ws.js +0 -35
  245. package/dist/lib/monitors/state.d.ts +0 -51
  246. package/dist/lib/monitors/state.js +0 -221
  247. /package/dist/{lib/monitors/sources/types.js → commands/testdata/feed-hub.d.ts} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,321 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.22.123
4
+
5
+ - **Feed and session watch rows carry a PR's head SHA, title and per-check items,
6
+ and each subagent's model and prompt (PHNX-3939).** On `agents feed watch --json`
7
+ (and `sessions watch --json` for subagents), a live row's `pr` adds `headSha`,
8
+ `title`, and `checkItems` — one `{ name, state, url? }` per check on the head
9
+ commit, `state` being `passed`, `failed`, `running` or `skipped`, a re-run
10
+ check listed once at its latest run, at most 30. They come from the same
11
+ `gh pr view` the row's `checks` verdict already reads; no new GitHub call is
12
+ made. Each `subagents[]` entry adds `model` (the model id its replies report)
13
+ and `prompt` (its first user turn, whitespace-collapsed, at most 400
14
+ characters), read in the existing incremental fold of the child transcript.
15
+ All fields are absent when unknown, so older clients are unaffected.
16
+ Source: `cli/src/lib/feed/pr-status.ts`, `cli/src/lib/session/glance-files.ts`.
17
+
18
+ - **Browser rows on the feed read the engine's native task history (PHNX-4227).**
19
+ `agents feed watch --json`, `agents browser sessions` and the browser picker now
20
+ include tasks recorded in `~/.agents/.history/browser/history.db`, which
21
+ browser-cli 0.1.16+ writes. Values from native history take precedence over
22
+ agents' own `browser_sessions` row, which fills in whatever native history does
23
+ not record.
24
+ - A finished task that captured nothing still has a row.
25
+ - After its tabs close, a task keeps its session link, start time, recorded
26
+ capture counts, and the machine it ran on.
27
+ - Browser rows carry new optional `machine`, `captureDir`, and `capturesRemote`
28
+ fields.
29
+ - Both stores are read-only, and the feed no longer prunes `sessions.db` on
30
+ every refresh.
31
+ - An unreadable history record keeps the existing rows instead of removing them.
32
+ Source: `cli/src/lib/browser/sessions-list.ts`, `cli/src/lib/feed/tool-activity.ts`,
33
+ `cli/src/lib/feed/tools.ts`, `cli/src/lib/sqlite.ts`.
34
+
35
+ - **`agents cloud transcripts` and `agents sessions --cloud` work against the current Rush API (PHNX-4227).**
36
+ Both failed with `cloud-runs list failed (404)` because Rush retired `/api/v1/cloud-runs`.
37
+ They now list your organization's sessions across every project (`GET /o/{org}/sessions`) and
38
+ fetch a transcript as raw NDJSON from `/o/{org}/p/_/sessions/{id}/trajectory`. The organization
39
+ is the one saved in `~/.rush/user.yaml`, else your personal one, as `rush` resolves it. Each run
40
+ is parsed by its captured harness rather than its agent profile name.
41
+ Source: `cli/src/lib/session/cloud.ts`, `cli/src/lib/cloud/rush.ts`.
42
+
43
+ - **`agents cloud transcripts [selector]` reads captured Rush Cloud run transcripts (PHNX-4227).**
44
+ It lists runs, or renders the one matching an id, short id, or id prefix, with
45
+ the same `--json`, `--markdown`, `--no-redact`, `--include`/`--exclude`,
46
+ `--first`/`--last` and `--limit` (default 50) behavior as `agents sessions --cloud`,
47
+ which now runs the same handler and stays registered. A failed login or an
48
+ unmatched or ambiguous selector exits 1 without falling back to local sessions.
49
+ Source: `cli/src/commands/cloud-transcripts.ts`, `cli/src/commands/cloud.ts`.
50
+
51
+ - **`agents daemon index` owns session-index maintenance (PHNX-4227).**
52
+ `agents daemon index roots`, `agents daemon index optimize`, and
53
+ `agents daemon index backfill tools|resources|titles` run the same engines as
54
+ `agents sessions --roots --json`, `sessions optimize`, and `sessions backfill`, in
55
+ the foreground; none of them starts, stops, or restarts the daemon. The backfill
56
+ verbs declare their own filters (`--agent`, `--project`, `--since`, `--until`,
57
+ `--unmanaged`, `--teams`, `--local`, `--fleet`, `--device`, `--json`), so
58
+ `sessions backfill … --help` now lists them too. `daemon index backfill tools
59
+ --device <box>` reaches the backfill coordinator instead of being refused by the
60
+ global `--device` dispatcher, and still drives peers with
61
+ `agents sessions backfill tools --local`, which every released CLI understands.
62
+ A `--since`/`--until` value that is neither a duration nor a date now fails before
63
+ anything is indexed, in both spellings; before, it silently meant "all time".
64
+ The `sessions` spellings are unchanged otherwise.
65
+ Source: `cli/src/commands/daemon-index.ts`, `cli/src/commands/sessions-backfill.ts`,
66
+ `cli/src/commands/sessions-optimize.ts`, `cli/src/lib/hosts/passthrough.ts`.
67
+
68
+ - **`agents feed watch --json` exits cleanly when its reader goes away (PHNX-4227).**
69
+ When the consumer closed the pipe (`| head -n1`, a client that stops reading),
70
+ the Node CLI crashed with an unhandled `EPIPE` stack trace and exit 1, and under
71
+ Bun it kept running and printed a stack trace on every heartbeat. It now ends
72
+ the stream with exit 0 and nothing on stderr, matching `agents sessions watch
73
+ --json`. Any other stdout write failure, such as `ENOSPC`, still exits 1, and a
74
+ hub failure that reconnecting does not recover still fails.
75
+ Source: `cli/src/commands/feed-watch.ts`.
76
+
77
+ - **Browser rows on the feed now act through the standalone `browser` CLI, and the
78
+ AGI Menu floor is 1.14.6 (PHNX-4227).** In `agents feed watch --json`, a live
79
+ browser row's `showCommand` and `closeCommand` now carry `command: "browser"`
80
+ with the same argv minus the `browser` group word (`browser done --task <name>`,
81
+ `browser tab focus <id> --task <name>`). `runOn`, borrowed-tab handling, and the
82
+ rule that computer rows never get a close control are unchanged. `agents menubar`
83
+ now installs AGI Menu 1.14.6 or newer, the first build that runs either command.
84
+ Source: `cli/src/lib/feed/tools.ts`, `cli/src/lib/helper-versions.ts`.
85
+
86
+ - **`agents ps` gains `--bookmarks`, `--routine [name]` and `ps migrations` (PHNX-4227).**
87
+ `ps --bookmarks` and `ps --routine [name]` (also spelled `--routines`) narrow the
88
+ live roster exactly as `sessions --active --bookmarks` / `--routine` do, and compose
89
+ with `--status waiting`, which still exits 1 when a selected session waits.
90
+ `agents ps migrations [--json] [--session <id>]` reads the same migration ledger as
91
+ `agents sessions migrations`; each spelling's empty-ledger hint and `migrate --help`
92
+ name its own group. `agents sessions migrations --json` now prints JSON: before,
93
+ the parent `sessions --json` consumed the flag and the table printed instead.
94
+ Source: `cli/src/commands/ps.ts`, `cli/src/commands/sessions-migrate.ts`.
95
+
96
+ - **`agents insights resources` reports skill and command usage (PHNX-4227).**
97
+ It runs the same report as `agents sessions stats`, which stays registered for
98
+ now: the same flags, the all-time default window, and the same `--json`
99
+ envelope (`schemaVersion: 2`, `kind: "sessions-stats"`). `--agent` works before
100
+ or after `resources`; two different agents exit 1 instead of being merged.
101
+ Source: `cli/src/commands/sessions-stats.ts`, `cli/src/commands/insights.ts`.
102
+
103
+ - **`--device` routing reads option values the way the command parses them (PHNX-4227).**
104
+ A message such as `--text '--device=other'`, `--text -Dx` or `--text --host=other`
105
+ is now delivered as the message instead of being taken as a routing flag, and
106
+ everything after `--` stays positional. A selector placed before the command
107
+ (`agents --device <peer> send …`, `agents -D<peer> send …`) now finds the command
108
+ instead of failing with `unknown command '<peer>'`. Command discovery, the
109
+ routing-selector read and the flag strip before the SSH hop share one scan
110
+ driven by each command's registered Commander options. Repeated selectors keep
111
+ the first value, as before. Separately, the tmux backend now ends `send-keys`
112
+ options with `--`, so text that starts with `-` reaches the pane instead of
113
+ failing with `tmux exited with code 1`; this also applies to `sessions inject`. Source: `cli/src/lib/hosts/routing-flag.ts`,
114
+ `cli/src/lib/hosts/remote-cmd.ts`, `cli/src/bootstrap.ts`, `cli/src/lib/terminal/inject.ts`.
115
+
116
+ - **`agents run <harness> --resume` takes the session picker's filters (PHNX-4227).**
117
+ A bare `--resume` now accepts `--all`, `--teams`, `--since <time>` and
118
+ `-n/--limit <n>` and passes them to the same picker `agents sessions resume`
119
+ uses, so `agents run claude --resume --all --since 7d` matches
120
+ `agents sessions resume --agent claude --all --since 7d`. The defaults are
121
+ unchanged (this project, last 30 days, 200 rows). The four options are refused
122
+ with `--resume <id>` or without `--resume`, and they are removed from the
123
+ command that resumes the chosen session, so they never reach the harness.
124
+ Anything after `--` is still forwarded verbatim. Source:
125
+ `cli/src/commands/exec.ts`, `cli/src/commands/sessions-resume.ts`.
126
+ - **Routing and picker flags inside a short-option cluster are recognized (PHNX-4227).**
127
+ The option-aware scan behind `--device` routing and the resume picker filters now
128
+ walks a short-option cluster the way Commander does, so `-bn5` and `-bn 5` drop
129
+ only the `-n` limit and keep `-b`, and `-bDpeer` routes to `peer`. A cluster that is
130
+ another option's value, or that follows `--`, is left alone. Source:
131
+ `cli/src/lib/hosts/routing-flag.ts`, `cli/src/lib/hosts/remote-cmd.ts`.
132
+
133
+ - **`agents send --channel session` covers every `sessions inject` mode (PHNX-4227).**
134
+ New session-only options: `--pane <id>` (with `--socket <path>`) types into a known
135
+ tmux pane without session lookup and replaces `--to`; `--no-enter` types without
136
+ submitting; `--combined` sends text and Enter as one write. The session channel now
137
+ delivers the text exactly as given, so surrounding spaces and newlines are kept and
138
+ `--text ""` presses Enter alone; other channels still trim. A `--to` prefix that
139
+ matches several live sessions is refused instead of picking one (this also applies
140
+ to `sessions inject`), and the four options are refused on every other channel and
141
+ on `--to owner`. `--json` adds `backend`, `writes` and `confirmed` to the existing
142
+ result fields. Source: `cli/src/commands/send.ts`, `cli/src/lib/channels/send.ts`,
143
+ `cli/src/lib/channels/providers/session.ts`, `cli/src/lib/session/inject-target.ts`.
144
+
145
+ - **A live session's cwd is never an error string, and a Grok row keeps its session id (PHNX-4263).** On Linux, `agents sessions --active` read each process's cwd through `lsof`, which prints `/proc/<pid>/cwd (readlink: Permission denied)` for a process it cannot inspect (a sandboxed or other-user agent), and the CLI published that text as the row's `cwd`. The cwd is now read from `/proc/<pid>/cwd` directly and is unknown when the link cannot be read. A Grok session whose transcript was matched by cwd showed that transcript's topic and state but `sessionId: null`, because the id was read from the file name and Grok's file is `<id>/summary.json`; the id now comes from the index row for that file, for every harness except Claude. Source: `cli/src/lib/session/active.ts`, `cli/src/lib/session/db.ts`.
146
+
147
+ - **A tab that dispatches an agent to another box binds to its session for every harness (PHNX-4263).**
148
+ `agents run --device` now forwards `AGENTS_ORIGIN_DEVICE` (the dispatching machine id)
149
+ beside `AGENTS_ORIGIN_TERMINAL_ID`. The remote run records both in its pid entry as
150
+ `originTerminal`, and the fleet projection adds `{device, terminalId, launchId}` for
151
+ that desktop to the row's `observerTerminals`. Codex and Grok tabs launched with
152
+ `--device auto` no longer stay on "tracking session": before, only Claude got a
153
+ desktop-side observation, because only Claude has a pre-minted session id. A
154
+ `live-terminals.json` agent entry with a `terminalId` and no (or an empty) `sessionId`
155
+ now produces a terminal row instead of being dropped. It is keyed by `terminalId`,
156
+ and no session id is guessed from its cwd. Shell tabs published by the extension
157
+ produce no session row unless an agent runs under them.
158
+ Source: `cli/src/lib/launch-identity.ts`, `cli/src/lib/session/projection.ts`,
159
+ `cli/src/lib/session/active.ts`.
160
+
161
+ - **Owner notifications go through your account (PHNX-4267).** `agents send --to owner`, an
162
+ important or `--blocked` `feed post`, an urgent feed block and a failed routine now post one
163
+ event to rush/api (`POST /me/notifications`), which applies your preferences, quiet hours and
164
+ dedup and delivers by email, Slack DM or iMessage. Edit them in the console Settings page. A
165
+ block is `needs_you` and bypasses quiet hours; a failed routine is `failed`; everything else is
166
+ `message`. Reaching the owner now requires `agents auth login`: a box with no Phoenix session
167
+ (and, on a worker, no device token) reports the send as failed, and `agents doctor` shows the
168
+ critical `owner-not-signed-in` finding (it replaces `owner-sink-unreachable`). `--to owner`
169
+ takes no `--channel`, `--thread` or `--attach`. Source: `cli/src/lib/owner-notify.ts`.
170
+ - **Workers get a scoped device token automatically (PHNX-4267).** The first signed-in personal or
171
+ desktop box mints one `notify`-scoped Phoenix device token per `role=worker` device and pushes
172
+ it into that worker's own `__notify-<worker>__` reserved store on the `auth-sync` tick. It is
173
+ never pushed to a headed device. A worker whose token was rejected or lost gets a replacement;
174
+ a device that leaves the fleet or stops being a worker has its token revoked, and
175
+ `agents auth logout` revokes the tokens that box minted. Source:
176
+ `cli/src/lib/owner-notify-tokens.ts`.
177
+ - **A signed-in Mac sends the iMessages (PHNX-4267).** The new macOS-only `owner-device-delivery`
178
+ daemon service claims queued iMessage deliveries every 15 seconds, sends them through Messages
179
+ and reports each result. Delivery is at-least-once: a sent message whose result report fails is
180
+ sent again after the 5-minute stale-claim window. Source:
181
+ `cli/src/lib/daemon/owner-device-delivery-service.ts`.
182
+ - **`humans.yaml` moves to your account, once (PHNX-4267).** On the first run with a Phoenix
183
+ session, `~/.agents/humans.yaml` is uploaded to your notification preferences (channels, policy,
184
+ quiet hours, timezone, iMessage handle), moved to trash, and its removal committed. Without a
185
+ session the file stays and the upload retries. Transports with no account equivalent (Telegram,
186
+ desktop) are reported and not migrated. `notify.owner` in `agents.yaml` is no longer read.
187
+ Source: `cli/src/lib/installations/migrate.ts`.
188
+ - **`agents trash restore` and `agents trash empty` (PHNX-4267).** `agents restore` moves to
189
+ `agents trash restore <agent>@<version>`. `agents trash empty [--older-than <duration>] [--yes]`
190
+ permanently deletes trashed items, optionally only those trashed before the cutoff; it asks
191
+ first in a terminal and refuses without `--yes` elsewhere. `agents prune cleanup trash`, which
192
+ never deleted anything, is gone. Source: `cli/src/commands/trash.ts`, `cli/src/lib/trash.ts`.
193
+ - **Removed `agents humans`, `agents reminders`, `agents modes` and `agents feedback`
194
+ (PHNX-4267).** The owner's settings live in the console. Reminders still show in the Claude
195
+ statusline from `~/.agents/reminders/reminders.yaml`. The per-harness mode table now prints in
196
+ `agents run --help`. Explicit `--channel` sends and feed `channel:` sinks no longer forward to a
197
+ Mac peer over SSH when this box cannot deliver. Source: `cli/src/lib/startup/command-registry.ts`.
198
+
199
+ ### Fixed
200
+
201
+ - `agents browser <verb> --help`, `agents computer <verb> --help` and
202
+ `agents secrets --help` now print the standalone CLI's own help with its real
203
+ options. The global help conventions re-added agents-cli's `-h, --help` to these
204
+ forwarding commands, so they printed a page with no options and agents guessed
205
+ flags (PHNX-4283).
206
+ - The pinned browser engine is now `@phnx-labs/browser-cli` 0.1.16, the release
207
+ that reads the config keys agents-cli writes. Before it, `browser.device` and each
208
+ machine's default browser profile were ignored, so a bare `agents browser start`
209
+ ran on whatever profile the calling box guessed instead of the configured browser.
210
+
211
+ - **Publish finished CleanShot recordings as organization artifacts (PHNX-4287).**
212
+ `agents recordings watch [--dir …]` enables a daemon-owned, restart-safe watcher;
213
+ `list [--json]`, `upload <file>`, and `unwatch` expose its ledger and controls.
214
+ Settled MP4/MOV files are transcoded through ffmpeg without changing the original,
215
+ identity-gated to organization accounts, deduplicated across CleanShot re-exports,
216
+ and published through the standalone artifacts CLI with org-only visibility. Enabling
217
+ the watcher baselines existing files so only newly completed exports auto-publish.
218
+ Source: `cli/src/lib/recordings/`, `cli/src/commands/recordings.ts`.
219
+
220
+ - **AGI Menu gains a Goals tab and two goal preferences (PHNX-4291).** `goals` joins
221
+ the tab ids, and the default tab bar becomes home, goals, projects, sessions, inbox.
222
+ A `menubar.menu.tabOrder` saved before Goals existed still validates and reads back
223
+ with `goals` appended, the same way the menu resolves an order that leaves a tab out.
224
+ `menubar.menu.homeGoals` picks the goal levels Home shows (any of `company`, `week`,
225
+ `myWeek`, `myDay`, no duplicates; default `["company"]`) and rides the snapshot's
226
+ `menuListPreferences`. `menubar.statusbar.goalCountdown` (default `false`) turns on
227
+ the goal countdown beside the menu-bar icon and rides `menuPreferences`. All three
228
+ work with `agents config set/get/list/unset`. Source: `cli/src/lib/device-config.ts`,
229
+ `cli/src/lib/config-keys.ts`, `cli/src/lib/menubar/snapshot.ts`.
230
+
231
+ - **CLI releases now publish from a versioned branch through protected GitHub OIDC.** Push `release/x.y.z` or `release/x.y.z-pre.n`; one GitHub-hosted job behind the `npm-publish` environment derives the exact release-tree attestation from the newest compatible tested proof anywhere in the `main` ancestry, or impact-tests changes since the newest retained proof when packaged inputs or policy drifted. It rejects every diff outside the CLI release-input allowlist from that proof through the release head, rejects every release-branch change outside generated CLI release metadata, builds and install-smokes the bound tarball, creates `v<version>` plus its GitHub release, and publishes the same bytes to npm with provenance only while the remote release branch still names the event commit. Pre-releases use the `next` dist-tag. The former home-base/token publisher and its dead `NPM_TOKEN` auth probe are removed, so there is no stored npm credential or second publisher. Source: `.github/workflows/release.yml`, `cli/scripts/release-ci.sh`, `cli/scripts/release.sh`.
232
+
233
+ ### Fixed
234
+
235
+ - Release commits now include the generated HTML command reference alongside the
236
+ JSON and Markdown indexes. CI checks all three on release version bumps, help
237
+ changes, and direct HTML edits. Regenerate with `scripts/generate-reference.sh`,
238
+ use `--check` for a read-only freshness check, or `--out-dir` for a separate preview.
239
+
240
+ ### Fixed
241
+
242
+ - AGI Menu updates itself to a new release again. The periodic update checked
243
+ whether the new release was signed before downloading it, so a release not
244
+ yet on disk always failed the check and was skipped as "another install owns
245
+ the helper". It now downloads and verifies the release first, then decides.
246
+
247
+ ### Fixed
248
+
249
+ - `agents projects prs --repo … --number …` no longer fails when the shared
250
+ GraphQL budget is spent. The review verdict is GraphQL-only, so it reads
251
+ null and `ciError` says the review status is unavailable; the head and checks
252
+ still come from REST. Any other error still fails the read.
253
+
254
+ ### Changed
255
+
256
+ - `agents run` no longer adds a permission flag when you did not choose a mode.
257
+ Without `--mode` or a configured `run.<agent>@*.mode`, the harness's own
258
+ settings decide (for Claude, `permissions.defaultMode` in its settings), the
259
+ same as launching it directly. Set a default for agents-cli runs with
260
+ `agents config set 'run.claude@*.mode' auto`. This also fixes
261
+ `agents run claude#work -- rc`, which Claude refused because
262
+ `--permission-mode plan` came before the `remote-control` verb.
263
+
264
+ ## 1.22.122
265
+
266
+ - **`agents monitors` is removed (PHNX-4241).** The command group, the monitor
267
+ engine, and the daemon's `monitors` service are gone; `agents monitors …` now
268
+ fails as an unknown command. Upgrading stops monitor polling and dispatch: the
269
+ self-updating daemon relaunches onto code with no monitor service, and a stale
270
+ `monitors:` key in `~/.agents/daemon/services.yaml` is ignored. Monitor
271
+ definitions in `~/.agents/monitors/` and fire history in
272
+ `~/.agents/.history/monitors/` are left on disk untouched. Use `agents routines`
273
+ for scheduled work, webhook receivers for push events, and
274
+ `agents projects prs automerge` for merge-on-green. Source: `cli/src/lib/daemon/daemon.ts`,
275
+ `cli/src/lib/daemon-services.ts`, `cli/src/cli/command-registry.ts`.
276
+
277
+ - **`agents sessions stats` ranks a plugin skill under the same name `--zero` lists it.**
278
+ A plugin skill invoked by its bare name (`Skill image` from the `create` plugin) was
279
+ recorded as `image`, while the installed inventory calls it `create:image`, so the
280
+ same skill showed as invoked in the ranked list and as never invoked in `--zero`.
281
+ Usage is now recorded as `<plugin>:<name>` when the plugin is known, and a `/name`
282
+ slash invocation that only resolves to a skill counts as a skill. Existing bare
283
+ rows are renamed when the index opens; run `agents sessions backfill resources` once
284
+ to reclassify older slash-typed skills (the coverage line prompts for it). Source:
285
+ `cli/src/lib/session/db.ts`.
286
+
287
+ - **`agents sync <repo> --delete` removes what a repo deleted.** A plugin, command or
288
+ skill deleted from a DotAgents repo used to stay installed in agent homes, most
289
+ visibly when a non-interactive sync skipped the resource selection. `--delete`
290
+ trashes the ones whose recorded source is in the named repo and is gone from it,
291
+ unregisters removed plugins from `settings.json`, and keeps everything from other
292
+ repos or installed by hand (`kept: N not from <repo>`). It covers plugins, commands and
293
+ skills (not hooks, MCP, subagents, rules or workflows), needs a repo, works
294
+ without a TTY, and previews with `--dry-run`. A sync without `--delete` is
295
+ unchanged. Source: `cli/src/lib/sync-delete.ts`, `cli/src/commands/sync.ts`.
296
+ - **`agents sync` no longer hangs without a terminal.** When new resources were
297
+ pending, a sync with no TTY opened the "Sync new resources?" prompt anyway and
298
+ could wait forever (it never resolved under Bun). It now skips the selection,
299
+ syncs nothing new, and says so: `Skipped resource selection for <agent>@<v> (no
300
+ terminal; rerun with --yes to sync new resources)`.
301
+
302
+ - **Session rows report what an agent made for you to look at.** With
303
+ `@phnx-labs/sessions-cli` 0.6.0, a row's `artifacts` include created images, video,
304
+ PDFs, SVGs and CSVs (the harness scratchpad excluded) and the viewable files of
305
+ folders the agent names in its replies, when they exist under this machine's home
306
+ outside a git checkout. Each carries `editedAtMs`; the list is newest first, at
307
+ most 60. AGI EXT 0.9.381+ shows them as folder thumbnails in the session sidebar.
308
+ It costs about 0.6 ms more per transcript change on a 2,000-event session.
309
+ Source: `cli/package.json`.
310
+
311
+ - **`agents projects prs merge` no longer refuses a PR whose mergeability GitHub
312
+ never computed.** On some repositories `mergeable_state` stays `unknown` for
313
+ hours, so the merge (and AGI Menu's Merge button) was never possible. An
314
+ uncomputed state now goes on to the merge pinned to the reviewed head commit,
315
+ and GitHub's own merge check decides: it merges, or refuses with its reason.
316
+ `blocked`, `behind`, `dirty` and `draft` are still refused before any write.
317
+ Source: `cli/src/lib/github/project-prs.ts`.
318
+
3
319
  ## 1.22.121
4
320
 
5
321
  - **`agents sessions` reads use the `sessions` binary this CLI already depends on.**
package/README.md CHANGED
@@ -11,7 +11,7 @@
11
11
  <a href="https://github.com/phnx-labs/agi-cli"><img src="https://img.shields.io/badge/github-phnx--labs%2Fagi--cli-blue?style=flat-square" alt="github" /></a>
12
12
  </p>
13
13
 
14
- **A framework for running a distributed agent factory.** Dispatch Claude, Codex, Antigravity, Grok, and more across your own machines, in parallel, on your existing subscriptions. Measure every run with `agents insights` (latency lives at `agents insights perf`), fold what you learn back into `AGENTS.md` and skills, then put the loop on a schedule with routines and monitors. Spawn parallel teams in isolated terminals or dispatch to the cloud for a PR. Watch live state across the fleet, nudge stalled runs, and message agents mid-flight. Store secrets behind Touch ID, drive real browsers and Electron apps, and steer the whole fleet from a menu bar — all from one CLI.
14
+ **A framework for running a distributed agent factory.** Dispatch Claude, Codex, Antigravity, Grok, and more across your own machines, in parallel, on your existing subscriptions. Measure every run with `agents insights` (latency lives at `agents insights perf`), fold what you learn back into `AGENTS.md` and skills, then put the loop on a schedule with routines. Spawn parallel teams in isolated terminals or dispatch to the cloud for a PR. Watch live state across the fleet, nudge stalled runs, and message agents mid-flight. Store secrets behind Touch ID, drive real browsers and Electron apps, and steer the whole fleet from a menu bar — all from one CLI.
15
15
 
16
16
  <p align="center">
17
17
  <a href="https://github.com/anthropics/claude-code" title="Claude Code"><img src="assets/harnesses/anthropic.svg" height="32" alt="Claude Code" /></a>
@@ -44,6 +44,8 @@
44
44
 
45
45
  <p align="center"><a href="https://agi-cli.sh/demo.mp4">Watch the full 56-second demo</a></p>
46
46
 
47
+ <p align="center"><b>Command reference:</b> <a href="cli/docs/command-index.md">every <code>agents</code> command</a> · <a href="cli/docs/command-reference.html">searchable HTML page</a></p>
48
+
47
49
  ## Quickstart
48
50
 
49
51
  ```bash
@@ -100,7 +102,6 @@ Also available as `ag` -- all commands work with both `agents` and `ag`.
100
102
  - [Accounts](#accounts)
101
103
  - [Secrets](#secrets)
102
104
  - [Routines](#routines)
103
- - [Monitors](#monitors)
104
105
  - [Share](#share)
105
106
  - [PTY](#pty)
106
107
  - [Portable setup](#portable-setup)
@@ -139,7 +140,7 @@ agents routines add nightly-payments-audit \
139
140
  agents menubar setup
140
141
  ```
141
142
 
142
- `agents insights perf` reads a disposable warehouse at `~/.agents/.cache/perf/perf.db` -- hook, command, and run timing rollups, deletable any time. `agents insights` (alias `agents sessions insights`) is deterministic and offline: it caches per-session facets, compares harnesses, and ranks actions by evidence count -- no model call unless you pass `--narrative`. Routines put any of this on a cron ([Routines](#routines)); monitors fire it on a change instead of a clock ([Monitors](#monitors)); the menu bar is the always-on control surface for the fleet these commands drive ([Menu bar](#menu-bar)).
143
+ `agents insights perf` reads a disposable warehouse at `~/.agents/.cache/perf/perf.db` -- hook, command, and run timing rollups, deletable any time. `agents insights` (alias `agents sessions insights`) is deterministic and offline: it caches per-session facets, compares harnesses, and ranks actions by evidence count -- no model call unless you pass `--narrative`. Routines put any of this on a cron ([Routines](#routines)); the menu bar is the always-on control surface for the fleet these commands drive ([Menu bar](#menu-bar)).
143
144
 
144
145
  ---
145
146
 
@@ -338,7 +339,7 @@ agents sessions --include tools \
338
339
  # Count pre-indexed static git sites, containing calls, and sessions
339
340
  agents sessions --include tools --query 'program:git' --count --fleet --json
340
341
 
341
- # Populate historical tool rows once on each device
342
+ # Populate historical tool rows once on each device (same as `agents daemon index backfill tools --fleet`)
342
343
  agents sessions backfill tools --fleet
343
344
 
344
345
  # Which skills/commands you actually invoke -- and which installed ones are dead weight
@@ -368,7 +369,10 @@ agents ps # the live roster (opens the picker on a TTY
368
369
  agents ps --json --local # this machine only, machine-readable
369
370
  agents ps --json -D box-a # one peer, over SSH
370
371
  agents ps --status waiting # only agents waiting on you (exit 1 if any)
372
+ agents ps --bookmarks # only bookmarked sessions
373
+ agents ps --routine nightly-review # only one routine's runs (omit the name for all routines)
371
374
  agents ps stop|focus|detach|migrate <id> # act on one running agent
375
+ agents ps migrations # where migrated sessions went
372
376
  ```
373
377
 
374
378
  `agents sessions --active` and its status flags still answer with the same roster; `agents ps` is where the live verbs live from here on ([PHNX-4227](https://linear.app/getrush/issue/PHNX-4227)).
@@ -419,6 +423,29 @@ Sharing a session uses `agents sessions render <id> -o session.md`, not the raw
419
423
 
420
424
  `agents sessions share <id>` goes one step further and publishes that document as a self-contained web page on your own share endpoint, printing the link. It is **unlisted** unless you pass `--public` — a transcript carries file paths, command output, and error text that a plan does not, so it stays out of your public gallery by default, and emails are masked on top of the render's own redaction. The slug is `session-<shortId>`, so re-sharing one session updates one URL.
421
425
 
426
+ ### Publish CleanShot recordings
427
+
428
+ The opt-in recordings service turns finished CleanShot exports into organization-only
429
+ artifacts. It watches on the daemon's schedule, waits until the file size has stopped
430
+ changing for 10 seconds, creates a temporary 1080p/30fps H.264 copy, and leaves the
431
+ original untouched. Enabling the watcher establishes a fresh baseline, so existing
432
+ files are not bulk-published; use `upload` to publish an older file explicitly:
433
+
434
+ ```bash
435
+ agents recordings watch # use CleanShot's macOS exportPath
436
+ agents recordings watch --dir ~/Movies/Demos # or choose a folder
437
+ agents recordings list # queued, failed, and published rows
438
+ agents recordings upload ./demo.mov # one file through the same pipeline
439
+ agents recordings unwatch
440
+ ```
441
+
442
+ Install `ffmpeg` and `@phnx-labs/artifacts-cli`, then sign in to `artifacts` with an
443
+ organization email. Every publish uses `--visibility org --expire never`; public inbox
444
+ identities are refused rather than turning a team recording into a personal artifact.
445
+ CleanShot re-exports such as `… AM 3.mp4` replace the earlier artifact at the same slug.
446
+ The restart-safe ledger is `~/.agents/recordings/ledger.json`. See
447
+ [the recordings guide](cli/docs/recordings.md) for the data flow and failure behavior.
448
+
422
449
  ### Back up sessions off-box
423
450
 
424
451
  Signed-in Phoenix users can back sessions up without creating a Cloudflare bucket or
@@ -526,11 +553,12 @@ agents feed answer <key> --choice 0 # first answer wins; route over the recorded
526
553
  agents feed post --title "Halfway done" "CI green, watching merge" # title + body
527
554
  ```
528
555
 
529
- Important posts can reach every owner channel named in
530
- `~/.agents/humans.yaml` under `owner.policy.normal` (for example iMessage and
531
- Slack). Owner delivery attempts every selected channel, reports partial
532
- failures, and safely forwards Rush-backed channels from headless workers to a
533
- capable Mac; ordinary milestone posts remain record-only unless configured.
556
+ Important posts, blocks and `agents send --to owner` reach you through your
557
+ account once you run `agents auth login`: email, Slack and iMessage per the
558
+ preferences in the console Settings page, with quiet hours and dedup applied
559
+ there. Workers get a scoped device token from your signed-in laptop
560
+ automatically, and a signed-in Mac sends the iMessages. Ordinary milestone posts
561
+ remain record-only unless configured.
534
562
 
535
563
  An optional **per-session summarizer** (off by default) adds a daemon-computed
536
564
  `goal`, progress `checkpoints`, and a detailed `summaryChecklist` to each session
@@ -1396,9 +1424,18 @@ agents browser stop --service # browser-scoped alias; next browser
1396
1424
  agents routines stop # disable/reload only the scheduler service
1397
1425
  agents daemon logs -f --level warn --since 1h
1398
1426
  agents daemon doctor # one-shot health check; non-zero exit on problems
1427
+
1428
+ agents daemon index roots # transcript directories the indexer scans (JSON)
1429
+ agents daemon index optimize # compact the FTS search index; no rows lost
1430
+ agents daemon index backfill tools --fleet # one-shot historical parse (also: resources, titles)
1399
1431
  ```
1400
1432
 
1401
- Each hosted responsibility (browser IPC, scheduler, monitors, watchdog, device
1433
+ `agents daemon index` is foreground maintenance of the index the daemon's
1434
+ session-index service keeps current; it never starts or restarts the daemon.
1435
+ Each verb runs the same engine as its `agents sessions` spelling (`--roots`,
1436
+ `optimize`, `backfill`), which keeps working.
1437
+
1438
+ Each hosted responsibility (browser IPC, scheduler, watchdog, recordings, device
1402
1439
  probe, self-heal, self-update, account-state refresh, state-dir checks) is an
1403
1440
  independent toggle in `~/.agents/daemon/services.yaml`.
1404
1441
  Self-update checks npm on its own schedule, installs + verifies a newer
@@ -1407,60 +1444,23 @@ supervisor relaunches the daemon onto the new code — the daemon used to run
1407
1444
  with auto-update forced off and only picked up new code on a manual
1408
1445
  `agents daemon restart`.
1409
1446
  `agents daemon services list` shows every service; `enable|disable <id>` flips
1410
- one. Missing keys default to enabled, so upgrades are no-ops. Most services take
1447
+ one. Missing keys default to enabled except the opt-in `recordings` service. Most services take
1411
1448
  effect on the next daemon start; browser IPC is registered even when boot-disabled
1412
- so browser commands can enable it live, while scheduler and monitor engine also
1413
- re-evaluate on `SIGHUP reload`. Only `agents daemon start|stop|restart` owns the
1449
+ so browser commands can enable it live; recordings is also registered while disabled
1450
+ so `agents recordings watch` can enable it live, while the scheduler
1451
+ re-evaluates on `SIGHUP reload`. Only `agents daemon start|stop|restart` owns the
1414
1452
  whole process lifecycle. Browser and routines clients change their own service
1415
1453
  state without evicting sibling work.
1416
1454
 
1417
1455
  There is no `agents daemon jobs` -- scheduled work is always `agents routines`
1418
1456
  (see `agents routines stats` for per-routine failure detail). `disable` is a
1419
1457
  device-local kill switch: with it set, `routines add`/`routines start`/
1420
- `routines catchup`/`monitors add`/webhook triggers stop auto-starting the daemon, mirroring
1458
+ `routines catchup`/webhook triggers stop auto-starting the daemon, mirroring
1421
1459
  `systemctl disable` -- `agents daemon start` still works as the explicit
1422
1460
  override.
1423
1461
 
1424
1462
  ---
1425
1463
 
1426
- ## Monitors
1427
-
1428
- <p align="center">
1429
- <img src="assets/monitors.svg" alt="agents monitors: a watched source (poll a command, an HTTP endpoint, a file, or a fleet device) flows into a condition (changed? matched? deduped by a native state store) that fires an action — run an agent with the event in its prompt, kick a routine, or notify. Pin the owner device for exactly-once." width="100%" />
1430
- </p>
1431
-
1432
- ```bash
1433
- # Routines fire on a clock. Monitors fire on a change: watch a source, and when
1434
- # it flips, spawn an agent, kick a routine, or notify. The cross-agent layer --
1435
- # agents watching sources (including the fleet and other agents) and reacting.
1436
-
1437
- # CI goes red -> a Claude agent triages it (poll a command, diff, match a pattern)
1438
- agents monitors add ci-red \
1439
- --poll 'gh pr checks 1249 --json name,bucket' 30s --match fail \
1440
- --run claude --prompt 'CI failed: {event}. Diagnose and fix.' \
1441
- --device yosemite-s0
1442
-
1443
- # Merge-on-green: ok only if the PR actually merged, not just because the agent exited 0
1444
- agents monitors add merge-1682 \
1445
- --poll 'gh pr view 1682 --json state --jq .state' 2m --match OPEN \
1446
- --run claude --prompt 'Rebase-merge #1682: {event}' \
1447
- --postcondition 'gh pr view 1682 --json state --jq .state | grep -qx MERGED'
1448
-
1449
- # A fleet box goes unreachable or overloaded -> notify (watch the fleet itself)
1450
- agents monitors add box-down --watch-device mac-mini --on-change --notify telegram
1451
-
1452
- # Poll an endpoint every 8h; fire once when the body flips to "issued"
1453
- agents monitors add cert-issued \
1454
- --poll-http 'https://secure.ssl.com/.../order' 8h --match issued --notify telegram
1455
-
1456
- agents monitors test ci-red # Dry-run: evaluate the source once, show what it would fire -- no action
1457
- agents monitors list # Every monitor: source, owner device, last fired
1458
- ```
1459
-
1460
- Sources: a command's stdout (`--watch` / `--poll`), an HTTP endpoint (`--poll-http`), a file (`--watch-file`), or a fleet device's reachability + load (`--watch-device`). Push sources -- a signed webhook (`--on`) and a WebSocket (`--ws`) -- are accepted today and delivered through a receiver wired in a follow-up. Conditions: fire on any change (`--on-change`), on a regex (`--match`), or `--every` tick -- deduped by a native state store, so a monitor stays silent until something *actually* changes. Actions: `--run <agent>` (the event is injected into the prompt as `{event}`), `--routine`, `--notify`, or `--webhook-out`. A `--run`/`--routine` action can take `--postcondition '<cmd>'` — a shell command that must exit 0 after the agent settles, otherwise `agents monitors runs` records `no effect` rather than `ok`. Pin a monitor to one owner device with `--device` (exactly-once), or offload the action elsewhere with `--run-on`. Runs in the routines daemon; `agents monitors pause` / `resume` any time.
1461
-
1462
- ---
1463
-
1464
1464
  ## Share
1465
1465
 
1466
1466
  Publishing an agent's HTML output to a shareable link now lives in the standalone
@@ -1525,7 +1525,7 @@ Two repos with the same shape, different roles:
1525
1525
 
1526
1526
  See [docs/concepts.md](cli/docs/concepts.md) for the full mental model: DotAgents repos, resource kinds, and how resolution works end-to-end.
1527
1527
 
1528
- 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.
1528
+ 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, restores (`agents trash restore <agent>@<version>`) and empties (`agents trash empty --older-than 30d`) soft-deleted version directories, and `agents subagents` installs reusable subagent definitions for parent-agent workflows.
1529
1529
 
1530
1530
  ---
1531
1531
 
package/dist/bootstrap.js CHANGED
@@ -29,11 +29,12 @@ import { getCliLaunch } from './lib/cli-entry.js';
29
29
  import { emit, emitFriction, redactArgs } from './lib/feed/events.js';
30
30
  import { stampProvenance } from './lib/event-provenance.js';
31
31
  import { die } from './lib/format.js';
32
- import { hasHostRoutingFlag } from './lib/hosts/routing-flag.js';
32
+ import { commandTokenIndex, hasHostRoutingFlag, setArgvCommandTree } from './lib/hosts/routing-flag.js';
33
33
  const BRAND = resolveBrandName();
34
34
  const program = configureRootCommand(new Command(), BRAND, VERSION);
35
35
  registerCommandGroups(program, FRONT_DOOR_COMMAND_GROUPS);
36
36
  program.option('--help-all', 'Show help for all commands');
37
+ setArgvCommandTree(program);
37
38
  function auditCommandPath(cmd) {
38
39
  const parts = [];
39
40
  let c = cmd;
@@ -594,7 +595,7 @@ program.on('command:*', (operands) => {
594
595
  const { closest, minDist } = closestTopLevelCommand(unknown, KNOWN_TOP_LEVEL_COMMANDS);
595
596
  if (minDist === 1 && closest && !RETIRED_TOP_LEVEL_COMMANDS.has(unknown)) {
596
597
  const args = process.argv.slice(2);
597
- args[0] = closest;
598
+ args[commandTokenIndex(args) ?? 0] = closest;
598
599
  void (async () => {
599
600
  if (LAZY_COMMAND_NAMES.has(closest)) {
600
601
  for (const loader of COMMAND_LOADERS[closest] ?? [])
@@ -633,22 +634,14 @@ if (passedArgs[0] === 'sessions') {
633
634
  process.argv[nestedVersionIndex + 2] = '--session-version';
634
635
  }
635
636
  }
636
- const requestedCommand = passedArgs.find((arg) => !arg.startsWith('-'));
637
+ const requestedCommandIndex = commandTokenIndex(passedArgs);
638
+ const requestedCommand = requestedCommandIndex === undefined ? undefined : passedArgs[requestedCommandIndex];
637
639
  const verboseStartup = passedArgs.includes('--verbose');
638
640
  const helpAllRequested = passedArgs.includes('--help-all');
639
641
  const helpOrVersionRequested = passedArgs.some((arg) => arg === '--help' || arg === '-h' || arg === '--version' || arg === '-V');
640
642
  const isDocumentationRequest = helpOrVersionRequested || helpAllRequested;
641
643
  const brandDisabled = disabledCommandsForActiveBrand();
642
644
  const requestedIsDisabled = requestedCommand !== undefined && brandDisabled.has(requestedCommand);
643
- if (requestedCommand !== undefined &&
644
- !isDocumentationRequest &&
645
- !requestedIsDisabled &&
646
- hasHostRoutingFlag(passedArgs)) {
647
- const { maybeRunOnHost } = await import('./lib/hosts/passthrough.js');
648
- if (await maybeRunOnHost(requestedCommand, passedArgs)) {
649
- process.exit(process.exitCode ?? 0);
650
- }
651
- }
652
645
  const isLazyRequest = requestedCommand !== undefined && LAZY_COMMAND_NAMES.has(requestedCommand);
653
646
  const rootHelpRequested = requestedCommand === undefined &&
654
647
  (helpAllRequested || passedArgs.includes('--help') || passedArgs.includes('-h') || passedArgs.length === 0);
@@ -673,17 +666,24 @@ if (isLazyRequest && !requestedIsDisabled) {
673
666
  for (const loader of COMMAND_LOADERS[requestedCommand])
674
667
  await reg(loader);
675
668
  }
676
- else if (requestedIsUnknown && requestedCommand) {
669
+ if (requestedCommand !== undefined &&
670
+ !requestedIsUnknown &&
671
+ !isDocumentationRequest &&
672
+ hasHostRoutingFlag(passedArgs)) {
673
+ const { maybeRunOnHost } = await import('./lib/hosts/passthrough.js');
674
+ if (await maybeRunOnHost(requestedCommand, passedArgs)) {
675
+ process.exit(process.exitCode ?? 0);
676
+ }
677
+ }
678
+ if (requestedIsUnknown && requestedCommand) {
677
679
  const candidates = [...KNOWN_TOP_LEVEL_COMMANDS].filter((name) => !brandDisabled.has(name));
678
680
  const { closest, minDist } = closestTopLevelCommand(requestedCommand, candidates);
679
681
  if (minDist === 1 &&
680
682
  closest &&
681
683
  !requestedIsDisabled &&
682
684
  !RETIRED_TOP_LEVEL_COMMANDS.has(requestedCommand)) {
683
- passedArgs[0] = closest;
684
- const argvCmdIndex = process.argv.findIndex((a, i) => i >= 2 && !a.startsWith('-'));
685
- if (argvCmdIndex >= 0)
686
- process.argv[argvCmdIndex] = closest;
685
+ passedArgs[requestedCommandIndex] = closest;
686
+ process.argv[requestedCommandIndex + 2] = closest;
687
687
  if (LAZY_COMMAND_NAMES.has(closest)) {
688
688
  for (const loader of COMMAND_LOADERS[closest] ?? [])
689
689
  await reg(loader);
@@ -780,6 +780,11 @@ if (process.env.AGENTS_SKIP_MIGRATION !== '1' && !isDocumentationRequest && !isR
780
780
  }
781
781
  catch { }
782
782
  }
783
+ else if (fs.existsSync(path.join(getUserAgentsDir(), 'humans.yaml')) &&
784
+ (await import('./lib/identity/client.js')).readSession()) {
785
+ const { migrateHumansToAccount } = await import('./lib/installations/migrate.js');
786
+ await migrateHumansToAccount();
787
+ }
783
788
  }
784
789
  catch { }
785
790
  }
@@ -9,7 +9,6 @@ export declare const loadPrune: ModuleLoader;
9
9
  export declare const loadDoctor: ModuleLoader;
10
10
  export declare const loadSessions: ModuleLoader;
11
11
  export declare const loadTeams: ModuleLoader;
12
- export declare const loadReminders: ModuleLoader;
13
12
  export declare const LAZY_COMMAND_NAMES: ReadonlySet<string>;
14
13
  export declare const COMMAND_LOADERS: Record<string, ModuleLoader[]>;
15
14
  export declare function buildFullCommandTree(): Promise<Command>;