@phnx-labs/agents-cli 1.20.86 → 1.20.88

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 (82) hide show
  1. package/CHANGELOG.md +172 -0
  2. package/README.md +3 -3
  3. package/dist/bin/agents +0 -0
  4. package/dist/commands/doctor.d.ts +0 -19
  5. package/dist/commands/doctor.js +219 -305
  6. package/dist/commands/exec.js +7 -19
  7. package/dist/commands/inspect.js +3 -5
  8. package/dist/commands/routines.js +2 -2
  9. package/dist/commands/sessions-browser.d.ts +18 -0
  10. package/dist/commands/sessions-browser.js +126 -24
  11. package/dist/commands/sessions-picker.d.ts +21 -8
  12. package/dist/commands/sessions-picker.js +83 -7
  13. package/dist/commands/sessions.d.ts +19 -0
  14. package/dist/commands/sessions.js +148 -18
  15. package/dist/commands/ssh.js +62 -4
  16. package/dist/commands/teams-picker.d.ts +2 -0
  17. package/dist/commands/teams-picker.js +2 -1
  18. package/dist/commands/teams.d.ts +4 -1
  19. package/dist/commands/teams.js +106 -70
  20. package/dist/commands/usage.d.ts +3 -2
  21. package/dist/commands/usage.js +2 -9
  22. package/dist/commands/view.js +14 -3
  23. package/dist/index.js +31 -1
  24. package/dist/lib/agents.d.ts +31 -1
  25. package/dist/lib/agents.js +55 -0
  26. package/dist/lib/claude-account-token.d.ts +12 -0
  27. package/dist/lib/claude-account-token.js +63 -0
  28. package/dist/lib/command-skills.d.ts +10 -0
  29. package/dist/lib/command-skills.js +14 -0
  30. package/dist/lib/commands.js +19 -1
  31. package/dist/lib/daemon.js +17 -2
  32. package/dist/lib/devices/doctor-findings.d.ts +167 -0
  33. package/dist/lib/devices/doctor-findings.js +893 -0
  34. package/dist/lib/devices/fleet-divergence.d.ts +22 -0
  35. package/dist/lib/devices/fleet-divergence.js +34 -10
  36. package/dist/lib/devices/fleet-inventory.d.ts +17 -6
  37. package/dist/lib/devices/fleet-inventory.js +56 -8
  38. package/dist/lib/devices/registry.d.ts +25 -0
  39. package/dist/lib/devices/registry.js +82 -1
  40. package/dist/lib/events.d.ts +8 -1
  41. package/dist/lib/events.js +13 -0
  42. package/dist/lib/exec.d.ts +14 -3
  43. package/dist/lib/exec.js +51 -9
  44. package/dist/lib/format.d.ts +7 -0
  45. package/dist/lib/format.js +11 -0
  46. package/dist/lib/menubar/MenubarHelper.app/Contents/MacOS/MenubarHelper +0 -0
  47. package/dist/lib/project-resources.js +34 -20
  48. package/dist/lib/runner.d.ts +14 -1
  49. package/dist/lib/runner.js +37 -8
  50. package/dist/lib/sandbox.d.ts +2 -0
  51. package/dist/lib/sandbox.js +38 -0
  52. package/dist/lib/secrets/Agents CLI.app/Contents/CodeResources +0 -0
  53. package/dist/lib/secrets/Agents CLI.app/Contents/MacOS/Agents CLI +0 -0
  54. package/dist/lib/secrets/rc-hygiene.d.ts +0 -6
  55. package/dist/lib/secrets/rc-hygiene.js +0 -24
  56. package/dist/lib/session/active.d.ts +6 -6
  57. package/dist/lib/session/active.js +6 -6
  58. package/dist/lib/session/db.d.ts +21 -0
  59. package/dist/lib/session/db.js +45 -4
  60. package/dist/lib/session/discover.d.ts +5 -0
  61. package/dist/lib/session/discover.js +137 -1
  62. package/dist/lib/session/parse.d.ts +2 -0
  63. package/dist/lib/session/parse.js +76 -37
  64. package/dist/lib/session/remote-list.d.ts +7 -0
  65. package/dist/lib/session/remote-list.js +8 -4
  66. package/dist/lib/session/state.js +69 -2
  67. package/dist/lib/session/sync/agents.js +0 -0
  68. package/dist/lib/session/team-filter.d.ts +22 -3
  69. package/dist/lib/session/team-filter.js +106 -17
  70. package/dist/lib/session/types.d.ts +9 -1
  71. package/dist/lib/session/types.js +1 -1
  72. package/dist/lib/signin-badge.d.ts +17 -0
  73. package/dist/lib/signin-badge.js +19 -0
  74. package/dist/lib/staleness/detectors/commands.js +14 -5
  75. package/dist/lib/staleness/types.d.ts +2 -0
  76. package/dist/lib/staleness/writers/commands.js +13 -7
  77. package/dist/lib/state.d.ts +2 -0
  78. package/dist/lib/state.js +2 -0
  79. package/dist/lib/usage.d.ts +72 -1
  80. package/dist/lib/usage.js +22 -87
  81. package/dist/lib/versions.js +30 -13
  82. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,177 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.20.88
4
+
5
+ - **`agents doctor` redesigned into a prioritized, fleet-aware, per-version
6
+ readout (RUSH-2069).** Comprehensive by default (no `--verbose`): a top
7
+ `✗ CRITICAL — needs you now (N)` section lists every critical across the whole
8
+ fleet worst-first (`device · harness@version · account · message → remediation`),
9
+ then a `─── by computer ───` section gives each device its warnings plus a
10
+ compact accounts/versions line showing every installed version and its account
11
+ (provable ✓ / ✗). A single-machine `agents doctor` collapses to the CRITICAL
12
+ section plus one `▸ <machine>` block. Severity: provable logged-out, a missing
13
+ hook/plugin, a broken CLI, and a never-synced version whose declared resources
14
+ are therefore absent are CRITICAL; drift, version-skew, repo-behind/-drift,
15
+ orphans, and an unprovable logout are WARNINGS. Sign-in is
16
+ now probed **per installed version** (each version's own home + the global
17
+ credential via the new `credentialPresence`), so a per-version logged-out claim
18
+ is made only when both are absent, agents with no inspectable identity never
19
+ report logged-out, and the login remediation is
20
+ version-targeted (`agents run <agent>@<version>` for the isolated set;
21
+ gemini/antigravity/droid/cursor say the login is shared). Older fleet boxes that
22
+ can't report per-version sign-in surface an "older agents-cli — upgrade"
23
+ warning. The readout is de-duplicated so one root cause is one line: a version's
24
+ missing hooks/plugins and drifted resources collapse to a count plus two
25
+ examples (`32 hooks missing (incl. 'a', 'b')`), the same problem on several
26
+ versions of one agent reads as `claude (5 versions)` with an agent-wide fix
27
+ (isolated copies stay on their own line, since the sweep skips them), every
28
+ orphan row on a machine folds into one cleanup-only line, and a version that
29
+ already listed its drifted resources no longer also says "sources changed since
30
+ last sync". The two advisories that predate the redesign are findings now, not
31
+ separate blocks: credential-shaped exports in shell rc files (RUSH-1968) and the
32
+ Windows execution policy that blocks `agents.ps1`. The duplicate-version-home
33
+ hook check keeps its text output too — differing copies are critical, identical
34
+ ones a warning, one row per agent rather than one per hook — and so does the
35
+ Host CLIs check, as a `host CLIs` warning naming `agents cli install <name>`.
36
+ Remediations reach every version in their row: a row collapsed across versions
37
+ uses `agents sync <agent>@all --yes` (a bare `agents sync <agent>` would fix only
38
+ the default version), a cross-device resource gap says `agents repo pull` rather
39
+ than the central-to-home `agents doctor --fix`, and a diverged config repo names
40
+ its own alias instead of always saying `user`.
41
+ `agents doctor --json` adds a `findings` array and a per-version
42
+ `fleet.signIn` map; the existing `clis`/`sync`/`orphans`/`fleet`/`signIn`/`repos`
43
+ fields are unchanged. Source: `apps/cli/src/lib/devices/doctor-findings.ts`,
44
+ `apps/cli/src/lib/devices/fleet-inventory.ts`, `apps/cli/src/lib/agents.ts`,
45
+ `apps/cli/src/commands/doctor.ts`.
46
+
47
+ - **Run Cursor routines safely (RUSH-2080).** Routines configured with `agent: cursor` now reuse the same-device login under the default sandbox, trust the configured workspace without `--yolo`, warn when a requested read-only plan is elevated to writable edit mode (including `loop:` jobs), and record successful runs correctly. Source: `apps/cli/src/lib/runner.ts`.
48
+
49
+ - **`agents sessions` now discovers, indexes, and renders Cursor agent transcripts (RUSH-2081).**
50
+ Cursor writes its conversation to `projects/<encoded-cwd>/agent-transcripts/<uuid>/<uuid>.jsonl`
51
+ and metadata to `chats/<workspace-hash>/<uuid>/meta.json`. Discovery starts from the transcript
52
+ and joins metadata by UUID, so abandoned chats with no transcript never become empty rows.
53
+ Cursor is installed outside agents-cli's managed version homes, so users with any managed
54
+ agent version must pass `--unmanaged` to include Cursor rows.
55
+ Source: `apps/cli/src/lib/session/discover.ts`, `apps/cli/src/lib/session/parse.ts`.
56
+
57
+ - **Fix Cursor usage and account inspection (RUSH-2082).** `agents usage` now derives support from the usage library so Cursor, Grok, and future usage sources cannot drift from the command, and `agents run cursor@` can inspect Cursor's active account. Source: `apps/cli/src/commands/usage.ts`, `apps/cli/src/lib/agents.ts`.
58
+
59
+ - **Sync Cursor commands to the IDE and cursor-agent CLI (RUSH-2083).** Shared commands now remain available as typed IDE slash commands and are also generated as Agent Skills for cursor-agent, while preserving user-authored files in `.cursor/commands/`. Source: `apps/cli/src/lib/command-skills.ts`.
60
+
61
+ - **Daemon routines resolve `agents` on `~/.local/bin` installs.** The generated daemon service (systemd + launchd) now puts the `agents` shim's own directory on `PATH`, not only the Node runtime dir. On a box where the shim lives outside the Node bin dir (a `~/.local/bin` global install, a separate npm prefix), the daemon's `PATH` previously carried only the Node dir, so every scheduled `command` routine — the always-on watchdog included — shelled out to a bare `agents` that resolved to nothing and died with `exit 127`. Source: `apps/cli/src/lib/daemon.ts`.
62
+
63
+ ## 1.20.87
64
+
65
+ - **`agents devices enable|disable|prefer|unprefer <name>` control which machines
66
+ Factory auto-launches onto.** A *disabled* device is skipped by
67
+ `New <Agent>` and the balanced launch, but stays available through
68
+ `New <Agent> (Pick Host)`. A *preferred* device wins ties against otherwise
69
+ equivalent machines — worth about two running agents in the ranking, so a
70
+ preference never sends work to a box that is genuinely swamped. Every device
71
+ is enabled and unpreferred by default, and an unregistered name is now
72
+ rejected instead of writing a preference that matches nothing. Preferences
73
+ live in `~/.agents/.history/devices/auto-launch.json`, written by the CLI and
74
+ read by the extension. Source: `apps/cli/src/lib/devices/registry.ts`,
75
+ `apps/cli/src/commands/ssh.ts`, `apps/factory/src/core/deviceAutoLaunch.ts`,
76
+ `apps/factory/src/core/launchHost.ts`.
77
+
78
+ - **Point-of-use friction events for `agents teams` failures.** The CLI's `die()`
79
+ chokepoints in `teams` now emit a structured `friction` event (`surface`,
80
+ `failureId`, `error`) before exiting, so the nightly factory-metrics routine can
81
+ rank recurring failures without re-parsing transcripts. A hidden
82
+ `agents _internal friction` recorder lets shell guard hooks (git-guard, rm-guard,
83
+ large-file-add-guard) self-report blocks into the same stream. Source:
84
+ `apps/cli/src/lib/events.ts`, `apps/cli/src/lib/format.ts`,
85
+ `apps/cli/src/commands/teams.ts`, `apps/cli/src/index.ts`.
86
+
87
+ - **`agents view` no longer reports a working Claude install as "logged out".**
88
+ Claude's `signedIn` is `!!email` read from a version home's `.claude.json`
89
+ (`lib/agents.ts`), so a version that authenticates from an ambient
90
+ `CLAUDE_CODE_OAUTH_TOKEN` — no account ever written to that home — rendered
91
+ "(logged out — log in with: claude, then /login)" while every run against it
92
+ succeeded. On one fleet box five of seven versions read as locked out and all
93
+ of them answered a live prompt. Those now render "(no per-version login —
94
+ using ambient CLAUDE_CODE_OAUTH_TOKEN)", which is both accurate and the more
95
+ useful warning: an ambient token is ONE account, so balanced rotation across
96
+ those versions rotates nothing. Source: `apps/cli/src/lib/signin-badge.ts`,
97
+ `apps/cli/src/commands/view.ts`.
98
+
99
+ - **Claude per-account run tokens.** `agents run` now injects the Claude setup token keyed to the selected version home's own account email, so balanced Claude rotation no longer inherits one ambient shared token across accounts. Source: `src/lib/exec.ts`.
100
+
101
+ - **`agents sessions` now shows which session spawned which team.** The link
102
+ already existed on disk and was discarded twice. `SessionMeta.spawnedTeam` — the
103
+ team name read off the `agents teams create/add` command at scan time — had no
104
+ column in `sessions.db`, so the writer dropped it and no consumer had ever seen
105
+ a non-`undefined` value; a new `spawned_team` column (schema **v21**, which
106
+ forces one full rescan) persists it, and orchestrator rows now carry a green
107
+ `team:<name>` badge. Separately, `classifyTeamSession` was already opening each
108
+ teammate's `meta.json` and throwing away its `task_name` and
109
+ `parent_session_id`, so a teammate row could not name its team or point back at
110
+ its orchestrator; teammate rows now read `[<team>/<handle>]` and the preview
111
+ pane carries a `Team:` line from either end of the lineage. New `--in-team
112
+ <name>` (and a `t` hotkey in the browser) filters to one team's orchestrator
113
+ plus its teammates, `agents teams status --parent-session <id>` lists the
114
+ teammates a given session spawned, and `agents teams list` gains a `by <id>`
115
+ column. Source: `apps/cli/src/lib/session/db.ts`,
116
+ `apps/cli/src/lib/session/team-filter.ts`, `apps/cli/src/commands/sessions.ts`,
117
+ `apps/cli/src/commands/sessions-browser.ts`, `apps/cli/src/commands/teams.ts`.
118
+
119
+ - **`agents sessions --device <box>` no longer opens an empty browser.** The
120
+ interactive one-host listing kept the browser's default this-repo scope, but
121
+ every row it fetches is the peer's and no peer cwd is under the local
122
+ `process.cwd()` — so the filter dropped all of them. A host scope now implies
123
+ all-directories (and the `p` hotkey is a no-op under one). Three more
124
+ scope bugs on the same path: `--device <this machine>` fanned out to the whole
125
+ tailnet, because `gatherRemoteList` reads the resulting empty peer list as "no
126
+ hosts given" and sweeps; `--local --device <box>` rendered a silent empty list
127
+ instead of reporting that the two flags ask for opposite things; and
128
+ `--device <box> --cloud` fell through to the cloud listing, which has no host
129
+ scope and silently ignored the device. An unreachable peer now says so in the
130
+ browser header — the fan-out's stderr note is repainted away by the full-screen
131
+ picker, so "that box is asleep" used to read as "no sessions match". Source:
132
+ `apps/cli/src/commands/sessions.ts`, `apps/cli/src/commands/sessions-browser.ts`,
133
+ `apps/cli/src/lib/session/remote-list.ts`.
134
+
135
+ - **Teammate records are found by the session id they actually produced.** A
136
+ teammate's directory under `teams/agents/` is named for its *agent* id, but the
137
+ harness mints its own session id and the spawn records it separately as
138
+ `remote_session_id`. `classifyTeamSession` looked only under the directory
139
+ name, so most teammates were unreachable — on a live box, 14 of 16 records
140
+ resolved only via `remote_session_id` — and their rows could not name their
141
+ team however complete the record was. Both keys are now registered in one
142
+ index built per process, which also replaces the `existsSync` + `readFileSync`
143
+ the old path paid for every row in the pool. Source:
144
+ `apps/cli/src/lib/session/team-filter.ts`.
145
+
146
+ - **`detectSpawnedTeam` no longer indexes prose or flag values as team names.**
147
+ Rendering the value exposed that it had been wrong for most of the rows that
148
+ had one: on a live index of 4627 sessions, 11 carried a team and 6 of those
149
+ read `2` or `t`. It matched documentation and echoed output rather than only
150
+ executed commands; its flag-skip used `\s` and so ran across a newline to
151
+ capture a word from the next line; and a value-taking flag did not swallow its
152
+ value, so `--device auto` left `auto` looking like the team name — which was
153
+ corrupting real detections, not just adding false ones. After the fix the same
154
+ index resolves ten teams, every one of them a real team name. Source:
155
+ `apps/cli/src/lib/session/state.ts`.
156
+
157
+ - **`--in-team` returns a team's whole lineage, not the slice inside the default
158
+ window.** It filtered in memory after the query, so a team older than the
159
+ default top-50 / 30-day / current-directory scope came back empty with no
160
+ message — and a team's teammates run in their own worktrees, which the
161
+ directory scope hid. The flag now widens its own scope the way `--all` does. It
162
+ is also refused with `--active`, whose live rows carry no lineage to match on,
163
+ rather than being silently ignored. Source: `apps/cli/src/commands/sessions.ts`.
164
+
165
+ - **The session preview pane sanitizes peer-supplied `plan` and directory
166
+ text.** A remote row's metadata is JSON the peer sent and `parseRemoteList`
167
+ hands over verbatim; `sanitizeMeta` covered `topic`/`label`/`cwd`/`todos` but
168
+ not these, so a terminal escape in another machine's plan text reached the TTY.
169
+ The remote preview also renders more of what already rides across the hop: the
170
+ checklist items, the directories the scan recorded, and a one-line plan summary
171
+ (never the full markdown blob). `directoriesTouched` now reads the real
172
+ `recentDirectoriesTouched` field instead of a `dirsTouched` that nothing in the
173
+ repo ever wrote. Source: `apps/cli/src/commands/sessions-picker.ts`.
174
+
3
175
  ## 1.20.86
4
176
 
5
177
  - **`agents sessions` now shows a Kimi session's todo list and its file-touching
package/README.md CHANGED
@@ -165,7 +165,7 @@ agents run codex@ "review this branch"
165
165
 
166
166
  A trailing `@` opens an account picker before either an interactive or prompt-based run. Each installed version shows its account identity, exact version, login state, plan, and every available session, weekly, or monthly limit. Logged-out, rate-limited, and out-of-credit accounts remain visible with the reason they cannot be selected; signed-in accounts whose provider does not expose quota data stay selectable and say `limits unavailable`. The choice pins only that run and does not change your default version.
167
167
 
168
- Account selection is available for Claude, Codex, Antigravity, Grok, Kimi, Droid, and OpenCode. It requires a terminal and cannot be combined with `--resume`, `--strategy`/`--balanced`, `--lease`, or `--host`/`--device`; profiles and workflows must use their concrete host agent instead.
168
+ Account selection is available for Claude, Codex, Gemini, Cursor, Antigravity, Grok, Kimi, Droid, and OpenCode. It requires a terminal and cannot be combined with `--resume`, `--strategy`/`--balanced`, `--lease`, or `--host`/`--device`; profiles and workflows must use their concrete host agent instead.
169
169
 
170
170
  ### Chain agents
171
171
 
@@ -1116,7 +1116,7 @@ Which DotAgents resources each agent CLI can load. Source of truth: [src/lib/age
1116
1116
  | Antigravity | yes | yes | yes | yes | yes | yes | yes | no | `AGENTS.md` | no |
1117
1117
  | Grok Build | yes | yes | yes | yes | yes | skills ($name) | yes | no | `AGENTS.md` | no |
1118
1118
  | OpenClaw | yes | yes | yes | no | yes | gateway | yes | yes | `workspace/AGENTS.md` | no |
1119
- | Cursor | yes | no | yes | no | yes | yes | no | no | `.cursorrules` | no |
1119
+ | Cursor | yes | yes | yes | yes | yes | IDE + skills ($name) | yes | >= 2026.1.22 | `.cursorrules` | no |
1120
1120
  | OpenCode | yes | no | yes | >= 1.1.1 | yes | yes | no | no | `AGENTS.md` | no |
1121
1121
  | Copilot | yes | no | yes | no | yes | yes | no | no | `AGENTS.md` | no |
1122
1122
  | Amp | yes | no | yes | no | yes | yes | no | no | `AGENTS.md` | no |
@@ -1125,7 +1125,7 @@ Which DotAgents resources each agent CLI can load. Source of truth: [src/lib/age
1125
1125
  | Roo Code | yes | no | yes | no | yes | yes | no | no | `AGENTS.md` | no |
1126
1126
  | Droid | yes | yes | yes | >= 0.57.5 | >= 0.26.0 | yes | yes | yes | `AGENTS.md` | no |
1127
1127
 
1128
- **Legend:** `yes` / `no` = synced or skipped at install time. `skills ($name)` = no file-based slash-command dir; behavior ships as a generated skill invoked with `$command`. `gateway` = OpenClaw resolves slash commands at runtime, not from synced files. Version suffixes are enforced at sync time — out-of-range versions are skipped with a clear message.
1128
+ **Legend:** `yes` / `no` = synced or skipped at install time. `skills ($name)` = no file-based slash-command dir; behavior ships as a generated skill invoked with `$command`. `IDE + skills ($name)` = an IDE command file plus a generated skill for the CLI. `gateway` = OpenClaw resolves slash commands at runtime, not from synced files. Version suffixes are enforced at sync time — out-of-range versions are skipped with a clear message.
1129
1129
 
1130
1130
  **Host CLIs** (`agents cli`) are separate: YAML manifests under `~/.agents/cli/` install binaries onto your PATH (`gh`, `higgsfield`, etc.). They are not copied into per-agent version homes.
1131
1131
 
package/dist/bin/agents CHANGED
Binary file
@@ -22,30 +22,11 @@
22
22
  * apply pending sync.
23
23
  */
24
24
  import type { Command } from 'commander';
25
- import { type FleetDivergenceReport } from '../lib/devices/fleet-divergence.js';
26
25
  import { type VersionResourceReport } from '../lib/doctor-diff.js';
27
26
  import { type DuplicateVersionHook } from '../lib/hooks.js';
28
27
  import { type SyncStatusRow, type OrphanRow } from '../lib/drift.js';
29
28
  import { type FetchStatusMarker } from '../lib/auto-pull.js';
30
29
  export declare function wrapLine(prefix: string, text: string, width?: number): string[];
31
- /**
32
- * Windows-only advisory lines. When the effective PowerShell execution policy
33
- * blocks unsigned local `.ps1` scripts (`Restricted`/`AllSigned`), the generated
34
- * `agents.ps1` launcher fails in PowerShell even when it is on PATH. Surface the
35
- * remediation; the `.cmd` companion still works, so this is a warning, not an
36
- * error, and doctor never auto-changes the policy. Pure — returns `[]` on
37
- * non-Windows or a permissive policy, so it is testable without invoking
38
- * PowerShell.
39
- */
40
- export declare function execPolicyWarningLines(platform: NodeJS.Platform, policy: string | null): string[];
41
- /**
42
- * Render the cross-device divergence section for `agents doctor --devices`
43
- * (RUSH-2027): a clean all-clear when the fleet agrees, otherwise the specific
44
- * gaps — a resource/version present here but missing on a box, or a diverged
45
- * config repo — grouped by device, each a plain-language line. Devices that
46
- * couldn't be compared (offline / older CLI) are named so the readout is honest.
47
- */
48
- export declare function renderFleetDivergence(report: FleetDivergenceReport): string[];
49
30
  export type IssueSeverity = 'critical' | 'warning' | 'info';
50
31
  /**
51
32
  * One triaged health finding. `severity`/`category`/`subject`/`impact`/`fix` are