@phnx-labs/agents-cli 1.22.127 → 1.23.0

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 (77) hide show
  1. package/CHANGELOG.md +72 -0
  2. package/README.md +13 -16
  3. package/dist/bootstrap.js +4 -3
  4. package/dist/commands/browser.js +4 -19
  5. package/dist/commands/computer.d.ts +2 -6
  6. package/dist/commands/computer.js +12 -18
  7. package/dist/commands/logs.js +2 -6
  8. package/dist/commands/menubar.js +28 -1
  9. package/dist/commands/projects.js +103 -40
  10. package/dist/commands/sessions.d.ts +0 -11
  11. package/dist/commands/sessions.js +31 -364
  12. package/dist/index.js +10 -11
  13. package/dist/lib/browser-client.d.ts +0 -21
  14. package/dist/lib/browser-client.js +1 -44
  15. package/dist/lib/computer/record.d.ts +1 -0
  16. package/dist/lib/computer/record.js +2 -16
  17. package/dist/lib/config-keys.d.ts +2 -2
  18. package/dist/lib/config-keys.js +8 -2
  19. package/dist/lib/daemon/daemon.js +1 -8
  20. package/dist/lib/daemon/runner.js +3 -2
  21. package/dist/lib/daemon-services.d.ts +1 -1
  22. package/dist/lib/daemon-services.js +0 -5
  23. package/dist/lib/device-config.d.ts +1 -1
  24. package/dist/lib/device-config.js +48 -7
  25. package/dist/lib/feed/tool-activity.d.ts +22 -10
  26. package/dist/lib/feed/tool-activity.js +161 -32
  27. package/dist/lib/feed/tools.d.ts +55 -2
  28. package/dist/lib/feed/tools.js +22 -28
  29. package/dist/lib/feed/watch.js +4 -3
  30. package/dist/lib/github/open-prs.d.ts +41 -0
  31. package/dist/lib/github/open-prs.js +157 -0
  32. package/dist/lib/github/project-prs.d.ts +20 -1
  33. package/dist/lib/github/project-prs.js +8 -7
  34. package/dist/lib/helper-versions.js +1 -1
  35. package/dist/lib/menubar/install-menubar.d.ts +5 -7
  36. package/dist/lib/menubar/install-menubar.js +120 -29
  37. package/dist/lib/menubar/resolve-version.d.ts +1 -0
  38. package/dist/lib/menubar/resolve-version.js +4 -2
  39. package/dist/lib/menubar/snapshot.d.ts +2 -0
  40. package/dist/lib/menubar/snapshot.js +2 -0
  41. package/dist/lib/menubar/update-state.d.ts +15 -0
  42. package/dist/lib/menubar/update-state.js +36 -0
  43. package/dist/lib/owner-notify.d.ts +0 -12
  44. package/dist/lib/owner-notify.js +1 -10
  45. package/dist/lib/self-heal/checks/menubar-helper.js +1 -0
  46. package/dist/lib/session/cloud.d.ts +0 -1
  47. package/dist/lib/session/cloud.js +0 -5
  48. package/dist/lib/session/db.d.ts +0 -64
  49. package/dist/lib/session/db.js +0 -116
  50. package/dist/lib/session/remote/remote-list.d.ts +2 -36
  51. package/dist/lib/session/remote/remote-list.js +3 -320
  52. package/dist/lib/session/tool-index.d.ts +0 -62
  53. package/dist/lib/session/tool-index.js +1 -537
  54. package/dist/lib/sessions-client.d.ts +1 -0
  55. package/dist/lib/sessions-client.js +17 -1
  56. package/dist/lib/standalone-tools.js +2 -2
  57. package/dist/lib/testdata/owner-notify-api.d.ts +0 -13
  58. package/dist/lib/testdata/owner-notify-api.js +3 -23
  59. package/package.json +1 -1
  60. package/dist/commands/browser-sessions-picker.d.ts +0 -9
  61. package/dist/commands/browser-sessions-picker.js +0 -136
  62. package/dist/commands/computer-sessions-picker.d.ts +0 -11
  63. package/dist/commands/computer-sessions-picker.js +0 -90
  64. package/dist/commands/sessions-tail.d.ts +0 -13
  65. package/dist/commands/sessions-tail.js +0 -222
  66. package/dist/lib/browser/native-history.test-fixture.d.ts +0 -12
  67. package/dist/lib/browser/native-history.test-fixture.js +0 -43
  68. package/dist/lib/browser/paths.d.ts +0 -9
  69. package/dist/lib/browser/paths.js +0 -31
  70. package/dist/lib/browser/record.d.ts +0 -4
  71. package/dist/lib/browser/record.js +0 -19
  72. package/dist/lib/browser/sessions-list.d.ts +0 -79
  73. package/dist/lib/browser/sessions-list.js +0 -415
  74. package/dist/lib/computer/sessions-list.d.ts +0 -78
  75. package/dist/lib/computer/sessions-list.js +0 -372
  76. package/dist/lib/daemon/owner-device-delivery-service.d.ts +0 -10
  77. package/dist/lib/daemon/owner-device-delivery-service.js +0 -28
package/CHANGELOG.md CHANGED
@@ -1,5 +1,77 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.23.0
4
+
5
+ ### Removed
6
+
7
+ - `agents sessions tail` is gone; use `sessions tail <id>` from the standalone
8
+ sessions CLI. `agents logs -f <id>` runs it for a session.
9
+ - Tool-call search moved to the standalone CLI: `sessions --include tools
10
+ --query <clause> [--count] [--host <target>] --json`. It reads the same index
11
+ agents writes (`agents sessions backfill tools` still fills it).
12
+ A tool search through `agents sessions --include tools` (no session id, or a
13
+ `--query` clause) now exits 2 and names that command; reading one session's
14
+ tool calls, `agents sessions <id> --include tools [--json|--markdown]`, is
15
+ unchanged. `--fleet` / `--count` are no longer `agents sessions` flags. `--query` is a
16
+ single search-text flag.
17
+
18
+ ### Changed
19
+
20
+ - A read query (`agents sessions <query> [--json]`) no longer falls back to an
21
+ in-process read when the `sessions` bin cannot be resolved. It exits 1 with an
22
+ error naming the install.
23
+
24
+ - **Browser and computer history come from the standalone tools (PHNX-4227).**
25
+ `agents sessions --browser` and `agents sessions --computer` are removed: run
26
+ `browser sessions` / `computer sessions` (or `agents browser sessions` /
27
+ `agents computer sessions`) instead. `agents browser sessions` and
28
+ `agents computer sessions` now run the standalone tool's own picker, so their
29
+ flags are the engine's (`--since`, `--until`, `--search`, `--tasks`, `--open`, …).
30
+ The fleet-wide `--device` listing of computer runs went with the alias; run
31
+ `computer sessions` on that box (`agents ssh <box> computer sessions`). The
32
+ browser and computer rows on `agents feed watch --json` are read from
33
+ `browser sessions --tasks --json` and `computer sessions --json`; agents-cli adds
34
+ only the agent-session link, and a missing tool, a failed run, or unreadable
35
+ output keeps the rows already on the stream instead of removing them. The
36
+ `computer` floor in `agents setup tools` is now 0.1.7, the first release whose
37
+ `computer sessions --json` honors `--limit`. A computer row's `agent` now comes
38
+ from the linked session only, since the engine records no harness name.
39
+ agents-cli no longer writes `browser_sessions` / `computer_sessions` rows (the
40
+ engines keep their own history and adopted those tables once) and no longer
41
+ opens the browser events pipe; the tables and migrations stay. `agents computer
42
+ sessions` also runs off macOS, since listing history drives nothing. Source:
43
+ `cli/src/lib/feed/tool-activity.ts`, `cli/src/lib/feed/tools.ts`,
44
+ `cli/src/commands/browser.ts`, `cli/src/commands/computer.ts`,
45
+ `cli/src/commands/sessions.ts`, `cli/src/lib/standalone-tools.ts`,
46
+ `cli/src/lib/browser-client.ts`, `cli/src/lib/computer/record.ts`, `cli/src/lib/session/db.ts`.
47
+
48
+ - **`agents projects prs` with no project lists every open PR across your GitHub account and orgs, needs-me first (PHNX-4269).** One REST search per owner (you plus every org you belong to; `--org` narrows it) and one for review requests from you, then each PR's REST detail and checks, cached like the project read; never GraphQL. Each PR carries `needsMe`: `review` (a review is requested from you), `failing` (your PR, CI red) or `conflicts` (your PR, conflicts with its base), and each repository names the projects that attach it. Every `prs` verb (`comment`, `review`, `merge` including `--admin`, `ready`, `automerge`, `failure`, `rerun`) now takes the project name optionally, so they act on any repo. This is the read behind AGI Menu's new GitHub tab, which joins `menubar.menu.tabOrder`/`hiddenTabs` as `github` (shown by default) and scopes itself with `menubar.menu.githubHidden`, `githubDrafts` and `githubBots`. Repositories are ordered by their most urgent PR. A free-plan private repo's branch-protection read (HTTP 403 "Upgrade to GitHub Pro") now reads as unprotected instead of failing the repo's `merge` facts. Source: `cli/src/lib/github/open-prs.ts`, `cli/src/commands/projects.ts`, `cli/src/lib/device-config.ts`.
49
+
50
+ - **Ship AGI Menu update settings (PHNX-4323).** Raise the signed menu helper floor to 1.15.19, which shows the app version and update status, manual check/update controls, and the synced automatic-update switch. Source: `cli/src/lib/helper-versions.ts`; helper release: `menubar/v1.15.19`.
51
+
52
+ - **Control AGI Menu updates separately (PHNX-4323).** Add `agents menubar update --check --json` and `agents menubar update --json`, an app-specific snapshot status, and the synced `menubar.autoUpdate` preference. Automatic updates default on and check about every 12 hours; turning them off suppresses all automatic update paths while preserving manual installation. Checks expose network errors, and self-updates finish their response before restarting the menu. Source: `cli/src/lib/menubar/install-menubar.ts`.
53
+
54
+ - **`menubar.menu.tabOrder` and `menubar.menu.hiddenTabs` know AGI Menu's Secrets tab (PHNX-4269).**
55
+ AGI Menu 1.15.13 adds a Secrets tab that lists this Mac's secrets bundles with their lock
56
+ state and unlocks or locks them with Touch ID. The menu only offers the tab once the CLI
57
+ accepts its id, so `secrets` joins the tab list. It starts hidden (`hiddenTabs` defaults to
58
+ `secrets`), and an order saved before it existed reads back with `secrets` appended.
59
+ Source: `cli/src/lib/device-config.ts`.
60
+
61
+ - **Owner iMessages come from Rush's number, with no Mac required (PHNX-4267).** rush/api now
62
+ sends owner iMessages itself from Rush's SendBlue number to the phone number you confirm in the
63
+ console Settings page, so the macOS-only `owner-device-delivery` daemon service and its
64
+ `/me/device-deliveries` client are gone. A notification that reaches your account now reads
65
+ "Rush is sending slack, imessage" instead of "delivered ... / queued imessage". A leftover
66
+ `owner-device-delivery` key in `services.yaml` is ignored. `agents send --channel imessage --to
67
+ <number>` still sends from this Mac's Messages app. Source: `cli/src/lib/owner-notify.ts`.
68
+
69
+ - **Claude routines run on worker devices again.** Before launching, a routine checked
70
+ each candidate account with `claude auth status` in an environment that left out the
71
+ setup-token a worker launch injects. Every account on a worker read as signed out, so
72
+ every Claude routine there failed with "found no authenticated Claude account". The
73
+ check now uses the same environment as the launch. Source: `cli/src/lib/daemon/runner.ts`.
74
+
3
75
  ## 1.22.127
4
76
 
5
77
  - **A peer's fleet-state reply now arrives whole over ssh.** `agents __usage-ingest --reply`
package/README.md CHANGED
@@ -327,17 +327,9 @@ agents sessions trace a1b2c3d4 --json # the versioned sessions-trace envelope
327
327
  # Just the last 3 turns, user messages only
328
328
  agents sessions a1b2c3d4 --last 3 --include user
329
329
 
330
- # Calls in recent Codex sessions on one device
331
- agents sessions --include tools --agent codex --device mac-mini --since 7d
332
-
333
- # One session where two different calls match; query every online device
334
- agents sessions --include tools \
335
- --query 'program:git input:merge' \
336
- --query 'program:gh output:CONFLICT' \
337
- --fleet --json
338
-
339
- # Count pre-indexed static git sites, containing calls, and sessions
340
- agents sessions --include tools --query 'program:git' --count --fleet --json
330
+ # Search indexed tool calls with the standalone sessions CLI (same index)
331
+ sessions --include tools --query 'program:git input:merge' --query 'program:gh output:CONFLICT' --json
332
+ sessions --include tools --query 'program:git' --count --host box1,box2 --json
341
333
 
342
334
  # Populate historical tool rows once on each device (same as `agents daemon index backfill tools --fleet`)
343
335
  agents sessions backfill tools --fleet
@@ -358,7 +350,7 @@ agents insights --since 7d
358
350
 
359
351
  Interactive picker when you're in a terminal. Structured output (`--json`, `--markdown`, filtered by role or turn count) when piped.
360
352
 
361
- 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.
353
+ 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. agents writes the tool index (`agents sessions backfill tools` performs the one-time historical parse, while normal incremental scans index new and changed sessions); the standalone `sessions --include tools` reads it, including `--count` over the ordered static Bash program sites. 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.
362
354
 
363
355
  ### Live state, and catching up fast
364
356
 
@@ -557,7 +549,8 @@ Important posts, blocks and `agents send --to owner` reach you through your
557
549
  account once you run `agents auth login`: email, Slack and iMessage per the
558
550
  preferences in the console Settings page, with quiet hours and dedup applied
559
551
  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
552
+ automatically. rush/api sends the iMessages from Rush's own number to the phone
553
+ number you confirmed in Settings, so no Mac is involved. Ordinary milestone posts
561
554
  remain record-only unless configured.
562
555
 
563
556
  An optional **per-session summarizer** (off by default) adds a daemon-computed
@@ -1544,6 +1537,11 @@ duplicate icon. `agents menubar setup` is the recovery command when a machine is
1544
1537
  already wrong -- it ends any duplicate, installs the bundle, wires the login
1545
1538
  item, and verifies exactly one helper came back up.
1546
1539
 
1540
+ AGI Menu has its own update controls: `agents menubar update --check` checks the
1541
+ app release, `agents menubar update` installs it, and
1542
+ `agents config set menubar.autoUpdate false` disables the default twice-daily
1543
+ automatic checks. See [AGI Menu updates](cli/docs/menubar.md#app-updates).
1544
+
1547
1545
  The helper itself is AGI Menu, developed in
1548
1546
  [phnx-labs/agi-menu](https://github.com/phnx-labs/agi-menu) and published as a
1549
1547
  signed, notarized build on this repo's `menubar/v<x.y.z>` releases; the CLI
@@ -1622,12 +1620,11 @@ Conversations with Claude, Codex, legacy Gemini, and other agents scatter across
1622
1620
  ```bash
1623
1621
  agents sessions "auth middleware" # Full-text search across all agents
1624
1622
  agents sessions --agent claude --since 7d
1625
- agents sessions --include tools --query 'program:git' --fleet --json
1626
- agents sessions --include tools --query 'program:git' --count --fleet --json
1623
+ sessions --include tools --query 'program:git' --json # standalone sessions CLI
1627
1624
  agents sessions backfill tools --fleet
1628
1625
  ```
1629
1626
 
1630
- The index lives at `~/.agents/.history/sessions/sessions.db` (SQLite + FTS5). A local query stays on the machine; an explicit `--fleet` tool query sends only redacted, bounded match evidence or aggregate counts over SSH. Historical tool parsing is explicit via `sessions backfill tools`; queries never parse transcripts. See [Sessions](#sessions-across-agents) for full usage.
1627
+ The index lives at `~/.agents/.history/sessions/sessions.db` (SQLite + FTS5). Tool-call evidence is stored redacted and bounded; the standalone `sessions --include tools` searches it, reading another box over SSH with `--host`. Historical tool parsing is explicit via `agents sessions backfill tools`; searches never parse transcripts. See [Sessions](#sessions-across-agents) for full usage.
1631
1628
 
1632
1629
  ### Secrets
1633
1630
 
package/dist/bootstrap.js CHANGED
@@ -263,7 +263,7 @@ async function installResolvedPackage(metadata) {
263
263
  if (process.platform === 'darwin') {
264
264
  try {
265
265
  const { updateMenubarHelperIfNewer } = await import('./lib/menubar/install-menubar.js');
266
- await updateMenubarHelperIfNewer({ force: true });
266
+ await updateMenubarHelperIfNewer();
267
267
  }
268
268
  catch {
269
269
  }
@@ -717,8 +717,9 @@ if (helpAllRequested) {
717
717
  process.exit(0);
718
718
  }
719
719
  const isReadOnlyUpdatePreview = !isDocumentationRequest &&
720
- passedArgs.find((arg) => !arg.startsWith('-')) === 'update' &&
721
- passedArgs.includes('--check');
720
+ ((passedArgs.find((arg) => !arg.startsWith('-')) === 'update' && passedArgs.includes('--check')) ||
721
+ passedArgs.find((arg) => !arg.startsWith('-')) === 'menubar' ||
722
+ (passedArgs[0] === 'config' && passedArgs.includes('menubar.autoUpdate')));
722
723
  if (!isDocumentationRequest) {
723
724
  bootMark('bootstrap:evaluated');
724
725
  if (!isReadOnlyUpdatePreview) {
@@ -1,8 +1,6 @@
1
1
  import { forwardsHelp, registerCommandGroups, setHelpSections } from '../lib/help.js';
2
2
  import { buildBrowserContext } from '../lib/browser/context.js';
3
- import { recordBrowserAction } from '../lib/browser/record.js';
4
3
  import { isBrowserClientError, resolveBrowserBin, runBrowser, } from '../lib/browser-client.js';
5
- import { runBrowserSessionsCommand } from './browser-sessions-picker.js';
6
4
  const BROWSER_HELP_GROUPS = [
7
5
  { title: 'Session lifecycle', names: ['use', 'start', 'done', 'status', 'prune'] },
8
6
  { title: 'Fast action loop', names: ['stream'] },
@@ -33,6 +31,7 @@ export const BROWSER_PASSTHROUGH_VERBS = [
33
31
  { name: 'record', description: 'Record a video of the page (record start / record stop)' },
34
32
  { name: 'pdf', description: 'Export the current tab as PDF via CDP — auto-saved under sessions/<task>/ when omitted' },
35
33
  { name: 'logs', description: 'Read merged rush-app + rush-cli logs for a task' },
34
+ { name: 'sessions', description: 'Browse captured screenshots, PDFs, recordings and downloads, grouped by task' },
36
35
  { name: 'history', description: 'Show recent browser task history' },
37
36
  { name: 'refs', description: 'Get DOM refs for interactive elements' },
38
37
  { name: 'profiles', description: 'Manage browser profiles (create / list / edit / rename / show / remove / use / …)' },
@@ -76,7 +75,6 @@ async function forwardToBrowser(opts) {
76
75
  argv: opts.argv,
77
76
  context,
78
77
  capture: opts.capture,
79
- onEvent: (event) => recordBrowserAction(event, { device: opts.device }),
80
78
  });
81
79
  }
82
80
  async function forwardAndExit(opts) {
@@ -98,24 +96,11 @@ function registerPassthroughVerbs(program) {
98
96
  }));
99
97
  }
100
98
  }
101
- function registerSessionsCommand(program) {
102
- program
103
- .command('sessions')
104
- .description('Browse a profile\'s captured screenshots, PDFs, recordings, and downloads, grouped by task')
105
- .option('--profile <name>', 'Only this profile (default: all profiles with captures)')
106
- .option('--open [selector]', "Open a capture in the OS default app: 'latest' or a filename")
107
- .option('--json', 'Emit machine-readable JSON')
108
- .option('--no-interactive', 'Print the flat listing instead of opening the interactive task browser')
109
- .action(async (opts) => {
110
- await runBrowserSessionsCommand({ profile: opts.profile, open: opts.open, json: opts.json, interactive: opts.interactive });
111
- });
112
- }
113
99
  export function registerBrowserCommand(program) {
114
100
  const browser = program
115
101
  .command('browser')
116
102
  .description('Drive a real browser (Chrome/Brave/Edge/Firefox/Arc) over CDP/BiDi — navigate, screenshot, click, capture; --device to drive a remote box');
117
103
  registerPassthroughVerbs(browser);
118
- registerSessionsCommand(browser);
119
104
  registerCommandGroups(browser, BROWSER_HELP_GROUPS);
120
105
  setHelpSections(browser, {
121
106
  examples: `
@@ -138,7 +123,7 @@ export function registerBrowserCommand(program) {
138
123
  notes: `
139
124
  The engine is the standalone \`browser\` CLI (npm i -g @phnx-labs/browser-cli);
140
125
  agents-cli supplies --device fleet resolution, remote-control consent, and the
141
- session/feed history. Per-verb flags are the engine's — \`agents browser
126
+ agent-session link on the feed. Per-verb flags are the engine's — \`agents browser
142
127
  screenshot --help\` asks it directly.
143
128
 
144
129
  \`--device\` is bound once at \`start\`; page verbs run against the task's bound
@@ -147,8 +132,8 @@ export function registerBrowserCommand(program) {
147
132
  Another fleet machine may drive this browser only after \`agents browser
148
133
  remote-control on\` here (device-local, never synced; default off).
149
134
 
150
- \`agents browser sessions\` (and \`agents sessions --browser\`) reads the capture
151
- and task history agents-cli records — it never leaves this CLI.
135
+ \`agents browser sessions\` is the engine's own task and capture history
136
+ (\`browser sessions --help\`); the feed stream reads the same rows.
152
137
  `,
153
138
  });
154
139
  }
@@ -11,9 +11,8 @@
11
11
  * 2. the peer allow list, and `--device <name>` resolved against the fleet —
12
12
  * both carried in the fd-3 context (`lib/computer/context.ts`);
13
13
  * 3. the acting actor and agent session, likewise on fd 3;
14
- * 4. a recorder for the action events the engine streams back on fd 4, so
15
- * `agents computer sessions` and `agents sessions --computer` keep their
16
- * history (`lib/computer/record.ts`).
14
+ * 4. a recorder for the action events the engine streams back on fd 4
15
+ * (`lib/computer/record.ts`).
17
16
  *
18
17
  * The remote path is the ENGINE's. `--device <name>` is resolved against the
19
18
  * fleet here — that is what the registry, ssh identity and platform check are
@@ -34,9 +33,6 @@
34
33
  * verb CATALOG — names, one-line descriptions, help groups — because that is
35
34
  * what makes the surface discoverable from `agents computer --help`, and a
36
35
  * verb the engine drops should fail loud here rather than silently vanish.
37
- *
38
- * `sessions` is the one verb that never reaches the engine: it reads agents-cli's
39
- * own event ledger.
40
36
  */
41
37
  import { Command } from 'commander';
42
38
  export declare const COMPUTER_PASSTHROUGH_VERBS: ReadonlyArray<{
@@ -11,9 +11,8 @@
11
11
  * 2. the peer allow list, and `--device <name>` resolved against the fleet —
12
12
  * both carried in the fd-3 context (`lib/computer/context.ts`);
13
13
  * 3. the acting actor and agent session, likewise on fd 3;
14
- * 4. a recorder for the action events the engine streams back on fd 4, so
15
- * `agents computer sessions` and `agents sessions --computer` keep their
16
- * history (`lib/computer/record.ts`).
14
+ * 4. a recorder for the action events the engine streams back on fd 4
15
+ * (`lib/computer/record.ts`).
17
16
  *
18
17
  * The remote path is the ENGINE's. `--device <name>` is resolved against the
19
18
  * fleet here — that is what the registry, ssh identity and platform check are
@@ -34,14 +33,10 @@
34
33
  * verb CATALOG — names, one-line descriptions, help groups — because that is
35
34
  * what makes the surface discoverable from `agents computer --help`, and a
36
35
  * verb the engine drops should fail loud here rather than silently vanish.
37
- *
38
- * `sessions` is the one verb that never reaches the engine: it reads agents-cli's
39
- * own event ledger.
40
36
  */
41
37
  import { forwardsHelp, registerCommandGroups, setHelpSections } from '../lib/help.js';
42
38
  import { loadComputerAllowList, loadDefaultPeers, resolveTcpEndpoint, resolveVncEndpoint, } from '../lib/computer/policy.js';
43
39
  import { forwardToComputer } from '../lib/computer-client.js';
44
- import { runComputerSessionsCommand } from './computer-sessions-picker.js';
45
40
  const COMPUTER_HELP_GROUPS = [
46
41
  { title: 'Installation', names: ['setup'] },
47
42
  { title: 'Daemon lifecycle', names: ['start', 'stop', 'reload', 'status'] },
@@ -99,7 +94,7 @@ export function registerComputerCommand(program) {
99
94
  process.env.COMPUTER_HELPER_VNC_PASSWORD = globals.vncPassword;
100
95
  }
101
96
  const device = globals.device;
102
- if (shouldBlockOffPlatform({
97
+ if (actionCommand.name() !== 'sessions' && shouldBlockOffPlatform({
103
98
  platform: process.platform,
104
99
  tcpConfigured: resolveTcpEndpoint() != null,
105
100
  vncConfigured: resolveVncEndpoint() != null,
@@ -137,15 +132,15 @@ export function registerComputerCommand(program) {
137
132
  notes: `
138
133
  The engine is the standalone \`computer\` CLI (npm i -g @phnx-labs/computer-cli);
139
134
  agents-cli supplies the permission allow list, --device fleet resolution, and
140
- the session/feed history. Per-verb flags are the engine's — \`agents computer
135
+ the agent-session link on the feed. Per-verb flags are the engine's — \`agents computer
141
136
  click --help\` asks it directly.
142
137
 
143
138
  Apps are deny-by-default: a verb only reaches an app named by a
144
139
  Computer(<bundle-id>) rule in ~/.agents/permissions/groups/. Edit a group,
145
140
  then \`agents computer reload\`.
146
141
 
147
- \`agents computer sessions\` (and \`agents sessions --computer\`) reads the
148
- action history agents-cli records — it never leaves this CLI.
142
+ \`agents computer sessions\` is the engine's own run history
143
+ (\`computer sessions --help\`); the feed stream reads the same rows.
149
144
  `,
150
145
  });
151
146
  }
@@ -239,12 +234,11 @@ function registerStatusCommand(program) {
239
234
  function registerSessionsCommand(program) {
240
235
  program
241
236
  .command('sessions')
242
- .description('Browse computer-driving history, grouped by run — one row per `agents computer` invocation')
243
- .option('--machine <name>', 'Only rows invoked from/driving this machine (hostname, machineId, or --device name)')
244
- .option('--limit <n>', 'Cap the flat/--no-interactive table at this many rows (default 50; --json is unbounded)', (v) => parseInt(v, 10))
245
- .option('--json', 'Emit machine-readable JSON')
246
- .option('--no-interactive', 'Print the flat listing instead of opening the interactive run browser')
247
- .action(async (opts) => {
248
- await runComputerSessionsCommand({ machine: opts.machine, limit: opts.limit, json: opts.json, interactive: opts.interactive });
237
+ .description('Browse computer-driving history, grouped by run — the engine\'s own picker')
238
+ .allowUnknownOption(true)
239
+ .allowExcessArguments(true)
240
+ .helpOption(false)
241
+ .action(async (_opts, cmd) => {
242
+ await forwardAndExit({ argv: ['sessions', ...cmd.args], record: false });
249
243
  });
250
244
  }
@@ -2,7 +2,7 @@ import chalk from 'chalk';
2
2
  import { discoverSessions, resolveSessionById } from '../lib/session/discover.js';
3
3
  import { parseAgentFilter } from './sessions.js';
4
4
  import { renderSessionLog, renderSessionLogJson } from '../lib/session/presentation.js';
5
- import { streamSessionTail, isTailable } from './sessions-tail.js';
5
+ import { runSessions } from '../lib/sessions-client.js';
6
6
  import { showHostTaskLog, hostTaskLogJson } from '../lib/hosts/logs.js';
7
7
  import { listTasks } from '../lib/hosts/tasks.js';
8
8
  import { itemPicker } from '../lib/picker.js';
@@ -35,11 +35,7 @@ async function showSession(session, follow, full, json = false) {
35
35
  return;
36
36
  }
37
37
  if (follow) {
38
- if (!isTailable(session.agent)) {
39
- console.error(chalk.red(`Tailing is supported for claude and codex sessions only (got ${session.agent}).`));
40
- process.exit(2);
41
- }
42
- await streamSessionTail(session, { raw: full });
38
+ process.exitCode = await runSessions(['tail', session.id, ...(full ? ['--json'] : [])]);
43
39
  return;
44
40
  }
45
41
  await renderSessionLog(session, full ? 'markdown' : 'summary');
@@ -1,6 +1,6 @@
1
1
  import chalk from 'chalk';
2
2
  import { setHelpSections } from '../lib/help.js';
3
- import { enableMenubarService, disableMenubarService, getMenubarStatus, runMenubarSetup, buildMenubarDoctorReport, } from '../lib/menubar/install-menubar.js';
3
+ import { updateMenubarHelperIfNewer, enableMenubarService, disableMenubarService, getMenubarStatus, runMenubarSetup, buildMenubarDoctorReport, } from '../lib/menubar/install-menubar.js';
4
4
  function notMac() {
5
5
  if (process.platform !== 'darwin') {
6
6
  console.log(chalk.yellow('AGI Menu is macOS only.'));
@@ -92,6 +92,33 @@ export function registerMenubarCommands(program) {
92
92
  const menubar = program
93
93
  .command('menubar')
94
94
  .description('Manage AGI Menu (running sessions, agents awaiting input, routines)');
95
+ const update = menubar.command('update')
96
+ .description('Check for or install the newest AGI Menu release')
97
+ .option('--check', 'Check only; do not download, install, or restart the app')
98
+ .option('--json', 'Emit machine-readable update status')
99
+ .action(async (options) => {
100
+ const status = await updateMenubarHelperIfNewer({ manual: true, dryRun: options.check, deferRestart: true });
101
+ if (options.json)
102
+ process.stdout.write(`${JSON.stringify(status)}\n`);
103
+ else
104
+ console.log(status.detail);
105
+ if (status.outcome === 'failed')
106
+ process.exitCode = 1;
107
+ });
108
+ setHelpSections(update, {
109
+ examples: `
110
+ agents menubar update --check --json
111
+ agents menubar update --json
112
+ agents config set menubar.autoUpdate false
113
+ `,
114
+ notes: `
115
+ Checks and updates only AGI Menu, independently of agents-cli.
116
+ Automatic updates default on and check about every 12 hours while awake.
117
+ Manual updates work with automatic updates off. JSON reports lookup and
118
+ installation errors; a successful install hands off a bounded app restart
119
+ after this command exits. Check-only never installs or restarts the app.
120
+ `,
121
+ });
95
122
  const setup = menubar
96
123
  .command('setup')
97
124
  .description('Configure AGI Menu end-to-end: one instance, started at login')