@phnx-labs/agents-cli 1.22.42 → 1.22.44
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.
- package/CHANGELOG.md +149 -0
- package/README.md +15 -13
- package/dist/bootstrap.js +33 -13
- package/dist/cli/command-registry.d.ts +0 -8
- package/dist/cli/command-registry.js +1 -25
- package/dist/commands/alias.d.ts +7 -4
- package/dist/commands/alias.js +33 -8
- package/dist/commands/apply.d.ts +7 -10
- package/dist/commands/apply.js +15 -35
- package/dist/commands/artifacts.js +4 -5
- package/dist/commands/audit.d.ts +6 -6
- package/dist/commands/audit.js +12 -12
- package/dist/commands/auth.js +14 -6
- package/dist/commands/beta.d.ts +7 -1
- package/dist/commands/beta.js +16 -9
- package/dist/commands/commands.js +1 -1
- package/dist/commands/computer.js +20 -6
- package/dist/commands/daemon.js +1 -1
- package/dist/commands/doctor.d.ts +4 -2
- package/dist/commands/doctor.js +21 -9
- package/dist/commands/events.d.ts +2 -2
- package/dist/commands/events.js +6 -5
- package/dist/commands/exec.d.ts +1 -1
- package/dist/commands/exec.js +11 -6
- package/dist/commands/factory.d.ts +1 -1
- package/dist/commands/feed.js +1 -30
- package/dist/commands/fleet-capture.d.ts +1 -1
- package/dist/commands/fleet-capture.js +4 -5
- package/dist/commands/harness.js +4 -52
- package/dist/commands/hooks.js +1 -1
- package/dist/commands/insights.d.ts +1 -1
- package/dist/commands/insights.js +3 -2
- package/dist/commands/menubar.js +58 -1
- package/dist/commands/monitors.js +1 -1
- package/dist/commands/org.d.ts +5 -0
- package/dist/commands/org.js +83 -29
- package/dist/commands/output.js +2 -2
- package/dist/commands/profiles.js +2 -2
- package/dist/commands/prune.js +5 -4
- package/dist/commands/routines.js +43 -25
- package/dist/commands/routines.test-fixture.d.ts +86 -0
- package/dist/commands/routines.test-fixture.js +345 -0
- package/dist/commands/sessions-picker.js +124 -122
- package/dist/commands/sessions.test-fixture.d.ts +24 -0
- package/dist/commands/sessions.test-fixture.js +224 -0
- package/dist/commands/setup.js +9 -1
- package/dist/commands/share.d.ts +9 -10
- package/dist/commands/share.js +68 -50
- package/dist/commands/skills.js +1 -1
- package/dist/commands/snapshot.d.ts +1 -1
- package/dist/commands/snapshot.js +4 -4
- package/dist/commands/ssh.js +15 -62
- package/dist/commands/status.d.ts +4 -2
- package/dist/commands/status.js +10 -7
- package/dist/commands/subagents.js +1 -1
- package/dist/commands/sync.d.ts +1 -0
- package/dist/commands/sync.js +29 -2
- package/dist/commands/view.js +11 -2
- package/dist/commands/webhook.js +1 -1
- package/dist/lib/accounting/rotate.d.ts +5 -3
- package/dist/lib/accounting/rotate.js +36 -7
- package/dist/lib/accounting/usage.d.ts +18 -4
- package/dist/lib/accounting/usage.js +138 -27
- package/dist/lib/agent-spec/agents.d.ts +7 -7
- package/dist/lib/agent-spec/agents.js +15 -15
- package/dist/lib/analytics/mix-commands.d.ts +6 -28
- package/dist/lib/analytics/mix-commands.js +14 -40
- package/dist/lib/audit/log.d.ts +2 -2
- package/dist/lib/audit/log.js +2 -2
- package/dist/lib/beta.js +1 -1
- package/dist/lib/browser/domain-skills.d.ts +26 -6
- package/dist/lib/browser/domain-skills.js +81 -43
- package/dist/lib/cloud/rush.d.ts +0 -15
- package/dist/lib/cloud/rush.js +0 -35
- package/dist/lib/crabbox/runtimes.d.ts +6 -2
- package/dist/lib/crabbox/runtimes.js +21 -5
- package/dist/lib/daemon/daemon.js +97 -58
- package/dist/lib/daemon/daemon.test-fixture.d.ts +24 -0
- package/dist/lib/daemon/daemon.test-fixture.js +71 -0
- package/dist/lib/daemon/runner.d.ts +18 -1
- package/dist/lib/daemon/runner.js +105 -11
- package/dist/lib/daemon-ticks.d.ts +38 -1
- package/dist/lib/daemon-ticks.js +52 -5
- package/dist/lib/device-config.js +1 -2
- package/dist/lib/devices/discovery-policy.d.ts +3 -3
- package/dist/lib/devices/discovery-policy.js +3 -3
- package/dist/lib/devices/doctor-findings.js +1 -1
- package/dist/lib/devices/fleet.d.ts +4 -8
- package/dist/lib/devices/fleet.js +3 -15
- package/dist/lib/devices/health-report.js +4 -4
- package/dist/lib/devices/pool.d.ts +0 -6
- package/dist/lib/devices/pool.js +0 -6
- package/dist/lib/devices/registry.d.ts +0 -15
- package/dist/lib/devices/registry.js +0 -9
- package/dist/lib/devices/stats-cache.d.ts +12 -0
- package/dist/lib/devices/stats-cache.js +24 -5
- package/dist/lib/drift-sync.d.ts +1 -1
- package/dist/lib/drift-sync.js +2 -2
- package/dist/lib/drift.d.ts +1 -1
- package/dist/lib/exec.js +13 -3
- package/dist/lib/fleet/capture.d.ts +1 -1
- package/dist/lib/fleet/manifest.js +1 -1
- package/dist/lib/fleet/remote-login.d.ts +2 -2
- package/dist/lib/fleet/remote-login.js +3 -4
- package/dist/lib/format.d.ts +9 -0
- package/dist/lib/format.js +16 -0
- package/dist/lib/github/pr-mergeable.d.ts +49 -0
- package/dist/lib/github/pr-mergeable.js +157 -0
- package/dist/lib/github/pr-verdict.d.ts +67 -0
- package/dist/lib/github/pr-verdict.js +72 -0
- package/dist/lib/harness/adapter.d.ts +6 -5
- package/dist/lib/hosts/dispatch.d.ts +2 -0
- package/dist/lib/hosts/dispatch.js +8 -1
- package/dist/lib/hosts/passthrough.d.ts +10 -0
- package/dist/lib/hosts/passthrough.js +28 -7
- package/dist/lib/hosts/providers/devices.js +1 -13
- package/dist/lib/hosts/ready.d.ts +12 -3
- package/dist/lib/hosts/ready.js +27 -12
- package/dist/lib/hosts/registry.d.ts +4 -5
- package/dist/lib/hosts/registry.js +3 -7
- package/dist/lib/hosts/session-index.js +1 -1
- package/dist/lib/installations/shims.js +1 -1
- package/dist/lib/installations/versions.d.ts +40 -0
- package/dist/lib/installations/versions.js +78 -4
- package/dist/lib/menubar/MenubarHelper.app/Contents/Info.plist +1 -5
- package/dist/lib/menubar/MenubarHelper.app/Contents/MacOS/MenubarHelper +0 -0
- package/dist/lib/menubar/MenubarHelper.app/Contents/_CodeSignature/CodeResources +2 -15
- package/dist/lib/menubar/install-menubar.d.ts +109 -0
- package/dist/lib/menubar/install-menubar.js +218 -12
- package/dist/lib/monitors/config.d.ts +2 -2
- package/dist/lib/monitors/config.js +3 -2
- package/dist/lib/origin-machine.d.ts +18 -0
- package/dist/lib/origin-machine.js +34 -0
- package/dist/lib/perf/db.js +1 -1
- package/dist/lib/perf/spool.js +1 -1
- package/dist/lib/prix-account.d.ts +2 -1
- package/dist/lib/prix-account.js +2 -1
- package/dist/lib/profiles.d.ts +7 -0
- package/dist/lib/profiles.js +26 -1
- package/dist/lib/remote-agents-json.js +1 -7
- package/dist/lib/routines-placement.d.ts +1 -1
- package/dist/lib/routines-placement.js +1 -1
- package/dist/lib/sandbox.d.ts +24 -0
- package/dist/lib/sandbox.js +101 -0
- package/dist/lib/scheduling/routines.d.ts +18 -9
- package/dist/lib/scheduling/routines.js +16 -8
- package/dist/lib/secrets/Agents CLI.app/Contents/CodeResources +0 -0
- package/dist/lib/secrets/Agents CLI.app/Contents/Info.plist +0 -2
- package/dist/lib/secrets/Agents CLI.app/Contents/MacOS/Agents CLI +0 -0
- package/dist/lib/secrets/Agents CLI.app/Contents/_CodeSignature/CodeResources +1 -13
- package/dist/lib/secrets/agent.js +9 -1
- package/dist/lib/secrets/index.js +1 -1
- package/dist/lib/secrets/list-filter.js +1 -1
- package/dist/lib/service-manifest.d.ts +20 -0
- package/dist/lib/service-manifest.js +34 -0
- package/dist/lib/session/active.d.ts +4 -16
- package/dist/lib/session/active.js +2 -6
- package/dist/lib/session/cloud.js +1 -1
- package/dist/lib/session/db.d.ts +13 -98
- package/dist/lib/session/db.js +5 -12
- package/dist/lib/session/discover.d.ts +5 -81
- package/dist/lib/session/discover.js +5 -5
- package/dist/lib/session/fork.js +1 -1
- package/dist/lib/session/live-metadata.js +1 -1
- package/dist/lib/session/origin-machine.d.ts +1 -18
- package/dist/lib/session/origin-machine.js +4 -34
- package/dist/lib/session/relative-time.d.ts +1 -44
- package/dist/lib/session/relative-time.js +4 -120
- package/dist/lib/session/remote/remote-bundle.d.ts +12 -0
- package/dist/lib/session/remote/remote-bundle.js +61 -0
- package/dist/lib/session/remote/remote-list.d.ts +148 -0
- package/dist/lib/session/remote/remote-list.js +607 -0
- package/dist/lib/session/remote/remote.d.ts +132 -0
- package/dist/lib/session/remote/remote.js +314 -0
- package/dist/lib/session/remote/watch.d.ts +101 -0
- package/dist/lib/session/remote/watch.js +241 -0
- package/dist/lib/session/remote-bundle.d.ts +1 -12
- package/dist/lib/session/remote-bundle.js +3 -61
- package/dist/lib/session/remote-list.d.ts +1 -148
- package/dist/lib/session/remote-list.js +3 -607
- package/dist/lib/session/remote.d.ts +1 -132
- package/dist/lib/session/remote.js +3 -314
- package/dist/lib/session/short-id.d.ts +1 -17
- package/dist/lib/session/short-id.js +4 -20
- package/dist/lib/session/watch.d.ts +1 -101
- package/dist/lib/session/watch.js +3 -242
- package/dist/lib/session/width.d.ts +1 -29
- package/dist/lib/session/width.js +4 -101
- package/dist/lib/share/config.d.ts +12 -2
- package/dist/lib/share/config.js +47 -11
- package/dist/lib/share/delete.js +1 -1
- package/dist/lib/share/publish.js +1 -1
- package/dist/lib/share/worker-template.js +2 -2
- package/dist/lib/smart-launch.d.ts +4 -4
- package/dist/lib/smart-launch.js +8 -18
- package/dist/lib/snapshot.d.ts +2 -2
- package/dist/lib/snapshot.js +1 -1
- package/dist/lib/staleness/index.d.ts +3 -1
- package/dist/lib/staleness/index.js +21 -1
- package/dist/lib/staleness/types.d.ts +11 -0
- package/dist/lib/staleness/writers/commands.js +13 -4
- package/dist/lib/staleness/writers/hooks.js +3 -1
- package/dist/lib/staleness/writers/mcp.d.ts +0 -7
- package/dist/lib/staleness/writers/mcp.js +16 -1
- package/dist/lib/staleness/writers/rules.js +1 -1
- package/dist/lib/staleness/writers/skills.js +3 -1
- package/dist/lib/staleness/writers/subagents.d.ts +0 -9
- package/dist/lib/staleness/writers/subagents.js +18 -1
- package/dist/lib/staleness/writers/types.d.ts +10 -0
- package/dist/lib/startup/command-registry.d.ts +10 -1
- package/dist/lib/startup/command-registry.js +26 -7
- package/dist/lib/startup/root-command.d.ts +18 -1
- package/dist/lib/startup/root-command.js +18 -1
- package/dist/lib/state.js +7 -0
- package/dist/lib/teams/placement-probe.js +28 -13
- package/dist/lib/teams/scheduler.d.ts +3 -1
- package/dist/lib/teams/scheduler.js +1 -1
- package/dist/lib/text/relative-time.d.ts +44 -0
- package/dist/lib/text/relative-time.js +120 -0
- package/dist/lib/text/short-id.d.ts +17 -0
- package/dist/lib/text/short-id.js +20 -0
- package/dist/lib/text/width.d.ts +29 -0
- package/dist/lib/text/width.js +101 -0
- package/dist/lib/triggers/handlers.d.ts +7 -0
- package/dist/lib/triggers/handlers.js +8 -0
- package/dist/lib/triggers/webhook.d.ts +1 -0
- package/dist/lib/triggers/webhook.js +2 -1
- package/dist/lib/types.d.ts +1 -1
- package/dist/lib/view-types.d.ts +7 -0
- package/package.json +2 -3
- package/dist/bin/agents +0 -0
- package/dist/commands/serve.d.ts +0 -10
- package/dist/commands/serve.js +0 -68
- package/dist/commands/tickets.d.ts +0 -2
- package/dist/commands/tickets.js +0 -43
- package/dist/commands/trends.d.ts +0 -10
- package/dist/commands/trends.js +0 -12
- package/dist/lib/menubar/MenubarHelper.app/Contents/CodeResources +0 -0
- package/dist/lib/menubar/MenubarHelper.app/Contents/Resources/AppIcon.icns +0 -0
- package/dist/lib/observe-aliases.d.ts +0 -30
- package/dist/lib/observe-aliases.js +0 -38
- package/dist/lib/secrets/Agents CLI.app/Contents/Resources/AppIcon.icns +0 -0
- package/dist/lib/serve/control.d.ts +0 -95
- package/dist/lib/serve/control.js +0 -260
- package/dist/lib/serve/data.d.ts +0 -81
- package/dist/lib/serve/data.js +0 -91
- package/dist/lib/serve/page.d.ts +0 -7
- package/dist/lib/serve/page.js +0 -140
- package/dist/lib/serve/server.d.ts +0 -80
- package/dist/lib/serve/server.js +0 -145
- package/dist/lib/serve/stream.d.ts +0 -43
- package/dist/lib/serve/stream.js +0 -116
- package/dist/lib/serve/token.d.ts +0 -35
- package/dist/lib/serve/token.js +0 -85
- package/dist/lib/tickets/list.d.ts +0 -53
- package/dist/lib/tickets/list.js +0 -153
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,154 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.22.44
|
|
4
|
+
|
|
5
|
+
- **Browser domain-skill discovery is layer-aware (RUSH-2497).** `agents browser start --url <url>` auto-loads a site-specific SKILL.md, but the lookup only ever searched the user layer (`~/.agents/skills/browser/domain-skills`), so a skill shipped in the system layer (`~/.agents/.system/skills/browser/domain-skills`) — or a project's `.agents/` — was silently invisible: the browser just opened without the guide. `resolveDomainSkill` now searches project > user > system > extra repos, first layer with a match wins, mirroring `resolveResource` precedence; `$AGENTS_BROWSER_DOMAIN_SKILLS_DIR` stays a single-root override for tests. The project layer resolves from the calling process's cwd — the shared browser daemon does not yet receive the CLI caller's cwd over IPC, so there the project layer follows the daemon's own cwd until RUSH-2996 threads it through. A miss still never breaks browser start, but now logs the roots searched at debug level (`AGENTS_DEBUG`/`DEBUG`) — the total silence is what hid this. Source: `apps/cli/src/lib/browser/domain-skills.ts`.
|
|
6
|
+
|
|
7
|
+
- **`agents artifacts share list/update/delete` (and the `unshare` alias) had a silently-dropped `--json`/`--github-user` (RUSH-2687).** Commander resolves an option's long name against the WHOLE ancestor chain, not per-command — `share <file>` (the parent) already declares `--json`/`--github-user` for its own publish-time use, so the same-named flag on `list`/`update`/`delete` was swallowed at parse time even when passed alone (`--help` still showed it registered, which made it easy to miss). `agents artifacts share list --json | jq …`, the exact example in `docs/share.md`, never emitted JSON. Fixed by renaming the colliding options — `--list-json`/`--for-user` (list), `--update-json` (update), `--delete-json`/`--for-user` (delete/unshare) — matching the precedent `share revisions` already set (`--revisions-json`/`--for-user`, RUSH-2683). A CLI-wide `enablePositionalOptions()` fix was evaluated and reverted: commander copies that setting onto every command created via `.command()`, so enabling it on the root program broke `sessions backfill tools/resources --since … --json …`, which relies on a parent command's options staying visible to leaf subcommands via `optsWithGlobals()`. Source: `apps/cli/src/commands/share.ts`, `apps/cli/src/lib/startup/root-command.ts`.
|
|
8
|
+
|
|
9
|
+
- **`agents artifacts share` publishes with a partial `share:` config (RUSH-2837).** `status` and publish both used to treat a missing/empty `accountId` as "not set up", even when `baseUrl` and `WRITE_TOKEN` were present — so a fleet rewrite that blanked `accountId` (or a partial `writeMeta` that dropped `share:`) silently killed PR evidence uploads. Publish now requires only `baseUrl` + the write token; `status` reports the endpoint and names an empty account id instead of pretending nothing is configured; `writeShareConfig` will not persist `accountId: ""` over a stored id; `serializeCentral` no longer deletes `share:` just because a write omitted the key. Source: `apps/cli/src/lib/share/config.ts`, `apps/cli/src/lib/state.ts`, `apps/cli/src/commands/share.ts`.
|
|
10
|
+
|
|
11
|
+
- **Pick a device-local account after fleet placement (RUSH-2961).** `agents run <harness>@` now composes with `--device <name|auto>`: the device resolves first, then the interactive picker lists that peer's installed versions/accounts and pins the selection for this run. Automatic picker placement prefers a ready account, retains signed-out/revoked login targets, and excludes devices whose picker would contain only rate-limited or out-of-credit rows. `agents view --json` exposes each version's cached `authVerdict` so remote and local placement apply the same revoked-token gate. Source: `apps/cli/src/commands/{exec,view}.ts`, `apps/cli/src/lib/{smart-launch,hosts/dispatch,hosts/ready}.ts`.
|
|
12
|
+
|
|
13
|
+
- **BREAKING: nest `agents beta` under `agents setup beta`; retire top-level `agents apply`; drop `harness login`/`logout` (RUSH-2981).** Enabling a preview feature is setup, not its own noun — `agents setup beta list/enable/disable` keep the same `~/.agents/agents.yaml` `beta.enabled` write path. Fleet reconcile is already `agents fleet apply` / `agents devices apply`; top-level `apply` is gone (unknown command, retired from distance-1 auto-correct). Harness credentials live on `agents accounts` — `harness login`/`logout` are removed. Does not touch org/auth/trends/audit/unshare (sibling session 01a02234). Source: `apps/cli/src/commands/{beta,setup,apply,harness}.ts`, `apps/cli/src/lib/startup/command-registry.ts`.
|
|
14
|
+
|
|
15
|
+
- **Nest leftover top-level aliases; keep `agents org` as a deprecated spelling (RUSH-2989).**
|
|
16
|
+
`agents unshare` moves under `agents artifacts unshare` (same takedown as
|
|
17
|
+
`artifacts share delete`; the top-level name is retired). `agents audit` moves
|
|
18
|
+
under `agents events audit` (still `events --include runs`, plus `verify` for
|
|
19
|
+
the legacy hash-chain). Former top-level `agents trends` is `agents insights mix`
|
|
20
|
+
(also `agents insights trends`). `agents org` still works and prints a deprecation
|
|
21
|
+
line; the canonical tree is `agents auth space`. Prix login stays off
|
|
22
|
+
`agents accounts` (that noun is harness keys). Source:
|
|
23
|
+
`apps/cli/src/commands/{auth,org,artifacts,share,events,audit,insights}.ts`,
|
|
24
|
+
`apps/cli/src/lib/analytics/mix-commands.ts`.
|
|
25
|
+
|
|
26
|
+
- **`agents view` shows Claude usage again — the daemon auth-health probe no longer hammers `/oauth/usage` into a permanent 429 (RUSH-2998).** The daemon's fleet auth-health probe (`probeLocalFleetAuth` → `probeClaudeStatus`) hit the rate-limited `/api/oauth/usage` endpoint every ~3 minutes on **every** device. Across the fleet that drove one per-account request quota to a persistent `429`; the shared `Retry-After` backoff then parked usage fleet-wide and the usage cache froze (windows stale-zeroed → `agents view` rendered `S: 0% (now) W: 0% (now)` for weeks). The periodic tick now re-probes the endpoint at most every 20 minutes (`AUTH_PROBE_MAX_AGE_MS`) and reuses the last real verdict in between — a ~5x cut in endpoint traffic. Fleet status still publishes every tick (it does not ride that endpoint), and every device keeps a **real** auth verdict, so `agents devices ping --strict` and the run auth-preflight keep detecting revocation on every host. `agents devices ping` forces a genuinely live probe (never the throttled cached verdict). Source: `apps/cli/src/lib/daemon-ticks.ts` (`AUTH_PROBE_MAX_AGE_MS`, `isCachedFleetAuthProbeFresh`, `refreshLocalFleetAuthState` `force`), `apps/cli/src/commands/ssh.ts` (`runFleetPing`).
|
|
27
|
+
|
|
28
|
+
- **BREAKING: remove `agents serve`, its `--control` anchor, and `agents devices pair-ios` (RUSH-3001).**
|
|
29
|
+
The read-only local web companion (`agents serve`) duplicated what `agents sessions`,
|
|
30
|
+
`agents teams status`, and the AGI EXT Fleet panel already show, and its `--control`
|
|
31
|
+
mode existed only to anchor the unshipped iOS Fleet Cockpit prototype (`apps/ios`,
|
|
32
|
+
untouched since 2026-07-16, no Xcode project) — both are gone, and so is the prototype
|
|
33
|
+
itself. `agents devices pair-ios` (the only writer of the device registry's `control`
|
|
34
|
+
role) is removed with it; with no writer left, the `control`-only dial-exclusion
|
|
35
|
+
filters (`isControlDevice`) are removed too, across `doctor`, `apply`, `fleet status`,
|
|
36
|
+
`fleet-capture`, `smart-launch`, the devices host provider, session fan-out, and
|
|
37
|
+
remote login detection. `agents serve` now reports `unknown command` and is retired
|
|
38
|
+
from distance-1 auto-correct; `agents devices pair-ios` is rejected by `devices` as an
|
|
39
|
+
unexpected argument.
|
|
40
|
+
**Migration —** if you previously ran `agents devices pair-ios`, that phone or tablet is
|
|
41
|
+
still in your device registry with `role: control`, and the key is now ignored rather
|
|
42
|
+
than honoured: it becomes an ordinary fleet target. `agents fleet status`,
|
|
43
|
+
`agents fleet update/run`, `agents apply`, `agents doctor --check --devices`,
|
|
44
|
+
`agents insights output --all-hosts`, and any `--device all` passthrough will dial it and
|
|
45
|
+
wait out a ConnectTimeout; `agents hosts list` shows it as dispatchable; `--device auto`
|
|
46
|
+
can place an agent on it when no device is marked `worker`; and routine fleet placement
|
|
47
|
+
can schedule a recurring job onto it, since an `unknown`-platform device sorts ahead of a
|
|
48
|
+
real worker alphabetically. Failures are loud, not silent. Remove it with
|
|
49
|
+
`agents devices rm <name>`; the stale `role` key is dropped anyway on that device's next
|
|
50
|
+
`agents devices sync`. Session fan-out is unaffected — it still gates on a
|
|
51
|
+
`windows`/`linux`/`macos` platform.
|
|
52
|
+
Source: `apps/cli/src/commands/{serve,ssh}.ts`,
|
|
53
|
+
`apps/cli/src/lib/devices/{registry,fleet,pool,discovery-policy}.ts`,
|
|
54
|
+
`apps/cli/src/lib/{smart-launch,remote-agents-json,device-config}.ts`,
|
|
55
|
+
`apps/cli/src/lib/hosts/{registry,providers/devices}.ts`,
|
|
56
|
+
`apps/cli/src/lib/session/{watch,remote-list}.ts`, `apps/cli/src/lib/fleet/remote-login.ts`,
|
|
57
|
+
`apps/cli/src/cli/command-registry.ts`, `apps/cli/src/lib/startup/command-registry.ts`.
|
|
58
|
+
|
|
59
|
+
- **Menu-bar helper restarts after a bundle swap; one-time TCC migration; `agents menubar doctor` (RUSH-3019).** `installMenubarLaunchAgentOnUpgrade()` swapped the installed bundle on an upgrade but never restarted the running helper — verified live: a helper pid started 21:44:16 kept running while the bundle under it was replaced at 21:53:46, so it kept requesting Accessibility under the OLD code identity and the grant never stuck. The heal now kickstarts the launchd job (`launchctl kickstart -k`) after a real content swap (a version bump or the ad-hoc -> Developer ID transition — a plist-only interpreter repoint, RUSH-3005's churn, does not trigger this) and falls back to ending the specific pid(s) still running the old binary when `kickstart -k` can't reach the GUI launchd domain from a non-Aqua shell context, so launchd's `KeepAlive` relaunches from the swapped binary. Separately, a machine that transitioned ad-hoc -> Developer ID (6fa36f73a) now gets a one-time `tccutil reset Accessibility com.phnx-labs.agents-menubar` to clear the dead grant recorded against the old identity, stamped so it never re-runs. The "Paste needs Accessibility" notification now opens System Settings' Accessibility pane on click and names the actual running bundle path. New read-only `agents menubar doctor` reports install path, installed vs CLI version, signing identity stability, and whether a live helper pid predates the on-disk bundle (the stale-process bug this fixes). Source: `apps/cli/src/lib/menubar/install-menubar.ts`, `apps/cli/src/commands/menubar.ts`, `apps/cli/menubar/Sources/MenubarHelper/Clip.swift`.
|
|
60
|
+
|
|
61
|
+
- **Daemon autostart no longer fires under a redirected (sandbox/test) HOME (RUSH-3021).** #2860 gated service-manager registration on `isolatedHomeSuffix()` but left `ensureDaemonStarted()`'s detached spawn ungated, so a test-spawned CLI could fork a daemon into the test's temp HOME; the child outlived the test and raced its recursive teardown `rm` (the `ENOTEMPTY` flake that cost most full-suite attestation rolls on shared boxes). The launch path now refuses under a redirected HOME via the same `serviceManagerRegistrationAllowed()` signal and `AGENTS_SERVICE_MANAGER_ALLOW_REDIRECTED_HOME` test seam; reporting an already-running daemon is untouched, and `agents daemon start` remains the operator override. Source: `apps/cli/src/lib/daemon/daemon.ts` (`ensureDaemonStarted`), regression test in `apps/cli/src/lib/daemon/daemon.registry.test.ts`.
|
|
62
|
+
|
|
63
|
+
- **The npm tarball no longer bundles the version-stamped signed CLI binary — releases publish from any OS (RUSH-3026).** `dist/bin/agents` (the Developer-ID-signed arm64 Mach-O, #315) embedded the release version, so every release forced a fresh Mac build + sign even when nothing native changed — chaining publishing to a single provisioned Mac (`mac-mini`), whose downtime stranded merged fixes unshippable. The binary is dropped from `package.json` `files` and the `prepack` gates; `postinstall`'s existing run-probe falls back to the JS entrypoint when the binary is absent, so macOS installs keep working (it returns as a per-release GitHub asset in a follow-up). `release.sh`'s home-base phase — already promote-only (download attested tarball, verify, install-smoke, `npm publish`) — drops its vestigial macOS gate, and a new `assert_promote_home_base` preflight (npm token + gh auth, via `scripts/promote-home-base-probe.sh`) runs BEFORE the release's first mutation, fixing the tagged-but-unpublished failure shape: the old signing preflight was defined but never invoked. The two `.app` helpers (keychain, menubar) remain bundled and manifest-reused — unchanged helpers are never rebuilt. Source: `apps/cli/package.json`, `apps/cli/scripts/release.sh`, `apps/cli/scripts/promote-home-base-probe.sh`.
|
|
64
|
+
|
|
65
|
+
- **`agents sync` restores a resource deleted from a version home — no `--force` needed (#2398, #2397).** The staleness fast-guard decided sync-ness from source fingerprints alone, so a managed artifact deleted from the version home (a subagent, command, skill, hook, MCP config, or rules file) read as "Already in sync" and only `--force` restored it. The sync manifest now records the artifact paths the last full sync wrote (`writtenTargets`, reported by each resource writer), and `isStale` treats a missing path as stale — one `existsSync` per path, no content reads, so the fast-guard budget holds. A manifest written by an older agents-cli lacks the field and reads as stale once; that full sync establishes the baseline. Relatedly, four commands (`agents commands/skills/hooks/subagents remove`) claimed a removed resource "will re-sync on next agent launch" — the shim's launch hook (`agents sync --launch`) is project-scoped only and deliberately skips version-home reconciliation, so the messages now name the real recovery: `agents sync <agent>@<version> --yes`. `agents doctor --fix` was already immune (it heals from the live-home diff, not the manifest). Source: `apps/cli/src/lib/staleness/{index,types}.ts`, `apps/cli/src/lib/staleness/writers/{types,commands,skills,hooks,mcp,subagents,rules}.ts`, `apps/cli/src/lib/installations/versions.ts`, `apps/cli/src/commands/{commands,skills,hooks,subagents,prune}.ts`.
|
|
66
|
+
|
|
67
|
+
- **`agents devices list` no longer serves fossilized load/mem numbers (#2666).** The
|
|
68
|
+
fleet stats cache (`.fleet-stats.json`) had no age bound and — since RUSH-2061
|
|
69
|
+
removed the daemon's N² fleet warm — no background writer, so the load/mem columns
|
|
70
|
+
froze at the last manual `--refresh` and re-rendered as current fleet state
|
|
71
|
+
indefinitely (observed: a 9-day-old row reporting an idle Mac at 1058% load). Cached
|
|
72
|
+
rows are now bounded by `STATS_STALE_MS` (3 minutes, the same window as the
|
|
73
|
+
agent-count mirror): a row past the bound is treated like a missing one — re-probed
|
|
74
|
+
live this call and rewritten — so the default `devices list` / `devices status` read
|
|
75
|
+
is itself the cache's writer and a stale value can never be presented as current.
|
|
76
|
+
This cache feeds the fleet scheduler, `--device auto` affinity, and the
|
|
77
|
+
session-start fleet banner. Source: `apps/cli/src/lib/devices/stats-cache.ts`,
|
|
78
|
+
`apps/cli/src/commands/ssh.ts`.
|
|
79
|
+
|
|
80
|
+
## 1.22.43
|
|
81
|
+
|
|
82
|
+
- **Rush Cloud no longer has a helper that reads the interactive Claude login (RUSH-2359 / incident #1767).** Dispatch already sends an email-only account manifest (SING-1b) and never uploaded a token; the leftover `readClaudeCredentialsBlob` still read Keychain / `.credentials.json` — the exact shape that captured a `claude setup-token` TTY banner as an Authorization header. That helper is deleted. `--lease` SING-1b detection now reads the wrapped rotating blob itself and ignores anything that is not `{ claudeAiOauth.accessToken }`. Source: `apps/cli/src/lib/cloud/rush.ts`, `apps/cli/src/lib/crabbox/runtimes.ts`.
|
|
83
|
+
|
|
84
|
+
- **fix: `agents sync <agent>` self-heals version pointers left aimed at an uninstalled version (RUSH-2471).** `removeVersion` reassigns the default and clears the `~/.<agent>` config symlink only when it removes the pointed-at version, so a version-home whose launch binary vanished by any other route — grok self-updating its per-version binary out from under the old dir, a manual delete, a half-finished install that seeded the home but never landed the binary — left the global default and/or the symlink resolving to a dead version. Because `agents use <agent>@<v>` sets the default and the symlink together, both dangled in lockstep once `<v>`'s binary went away: `agents sync <agent>` would print `Repointed <agent> config symlink …` and then still fail `<agent>@<v> is not installed`, because the version to sync is resolved from the raw global default. `agents sync <agent>` now repoints the global default, the isolated default, and the config symlink off any not-installed version before resolving — the default to the newest non-isolated installed version (never auto-promoting an isolated install), the symlink to the resolved default else the newest non-isolated installed version (the user's real `~/.<agent>` is never repointed at an isolated install). A pointer already on an installed version (a deliberate `agents use` choice), a real config directory, and isolated-only agents are left untouched. Source: `apps/cli/src/lib/installations/versions.ts`, `apps/cli/src/commands/sync.ts`.
|
|
85
|
+
|
|
86
|
+
- **Session preview groups metadata into verb-led rows (RUSH-2757, part 3).** `agents sessions preview` (and the picker pane) replaces the flat labeled block (`Prompt/Todos/Dirs/Repos/Changes/Artifacts/Skills/Plugins/Hooks/Links/Errors/Meta/Tools/Tests`) with five scannable verb rows in a fixed gutter — `Asked` (the originating prompt, quoted), `Doing` (checklist progress, team lineage, sub-agents), `Made` (file deltas, reads, artifacts, plan, PR), `Health` (errors + last test verdict, absent when clean), `Cost` (msgs, tokens, tool mix) — then `Latest` (the full wrapped last message, formerly `Last response:`) and one width-capped `Details ▸` fold (session id, skills, plugins, hooks, links, dirs, repos) that shows `… +N more` instead of wrapping and swamping the pane. Msgs/tokens/session-id move out of the header's third line into `Cost`/`Details`, so they render once. The metadata-only card (remote/unindexed sessions) uses the same rows. Source: `apps/cli/src/commands/sessions-picker.ts` (`formatCompactPreview`, `formatMetaOnlyBody`, `formatHeader`, `joinWidthCapped` — now ANSI-aware).
|
|
87
|
+
|
|
88
|
+
- **`pr-merge-on-green` can actually select a PR (RUSH-2848).** The built-in's poll ran `gh pr list --author @me` with no `--repo`, so `gh` inferred the repository from cwd; the daemon's cwd is not a git repo and every poll returned empty. The poll now walks registered project slugs (`~/.agents/projects/*.yaml`), canonicalizes renamed repos (`phnx-labs/agents-cli` → `phnx-labs/agi-cli`), and lists with `--repo`. Verdict matches `merge-guard.sh`: a formal GitHub `APPROVED` review **or** an APPROVE comment on THIS PR (carried-from citations do not count). Hidden `agents _internal mergeable-prs` prints `owner/repo#n` (cwd-independent). Source: `apps/cli/src/lib/github/pr-verdict.ts`, `apps/cli/src/lib/github/pr-mergeable.ts`. Companion: phnx-labs/.agents-system#347.
|
|
89
|
+
|
|
90
|
+
- **BREAKING: nest `agents status` under `agents sync status` (RUSH-2864).** `status` was the unified sync-drift report sitting as its own top-level command next to `sync`. It now lives as `agents sync status` (`--json` UnifiedSyncStatus contract and `--yes` reconcile unchanged). Top-level `agents status` is gone, not deprecated: it reports `unknown command`, and `status` is retired from distance-1 auto-correct. `agents sync <agent>` still treats the positional as an agent spec; `status` is reserved as the subcommand. `agents sync status --device` from a non-TTY does not inherit umbrella `--yes` (that flag is reconcile on this command, not "don't prompt"). Source: `apps/cli/src/commands/{status,sync}.ts`, `apps/cli/src/lib/hosts/passthrough.ts`, `apps/cli/src/lib/startup/command-registry.ts`.
|
|
91
|
+
|
|
92
|
+
- **Custom harnesses (deepseek, kimi-chat, glm, …) now work in routines and monitors, and their profiles survive fleet sync (RUSH-2930).** `agents routines add --agent deepseek` and `agents monitors add --run deepseek` used to refuse any name outside the native registry; both now accept a custom harness (`agents harness list`), and the daemon delegates the job to `agents run <name>` — the same path workflow jobs take — so the profile's host binary, model env, and provider auth resolve exactly as an interactive run. The profile pins its own host version and auth, so `@version` pins, balanced rotation, and account-env injection don't apply to these jobs. Separately, `agents harness add/fork/edit` and the legacy-auth migration stored the account's per-device **id** in the profile, while profiles sync fleet-wide via `agents repo push` — every synced custom harness then died on other machines with `Unknown account '<uuid>'`. The portable account **name** is stored now, and a profile with a dangling ref reports which harness is broken and the exact `agents harness edit <name> --account <name>` repair instead of the bare registry error. Source: `apps/cli/src/lib/daemon/runner.ts`, `apps/cli/src/lib/scheduling/routines.ts`, `apps/cli/src/lib/monitors/config.ts`, `apps/cli/src/commands/{routines,harness,profiles}.ts`, `apps/cli/src/lib/profiles.ts`.
|
|
93
|
+
|
|
94
|
+
- **BREAKING: remove the top-level `agents tickets` command (RUSH-2932).** Ticket reads go through `linear` (linear-cli) and `gh issue`. `agents tickets` reports `unknown command`, and `tickets` is retired from distance-1 auto-correct. AGI EXT now calls those CLIs directly. Source: `apps/cli/src/cli/command-registry.ts`, `apps/cli/src/lib/startup/command-registry.ts`, `apps/ext/src/vscode/tasks.vscode.ts`.
|
|
95
|
+
|
|
96
|
+
- **Expired cached usage windows read as unknown, not 0% (RUSH-2936).** A cached Claude usage window whose reset time had passed was zeroed but kept, so a frozen cache (Anthropic has been 429-ing `/api/oauth/usage` per account since ~Aug 5) rendered every account as `S: 0% (now) W: 0% (now)` with `usageStatus: "available"` — and balanced rotation kept dispatching into genuinely rate-limited accounts (RUSH-2858). `deserializeClaudeUsageSnapshot` now drops expired windows (the same rule the Grok collector already applied); an all-expired snapshot deserializes to null, the dead cache entry self-cleans, `agents view` renders `usage unavailable` plus the recorded throttle reason, and rotation falls back to the coarse cached status instead of trusting a fake 0%. Source: `apps/cli/src/lib/accounting/usage.ts`.
|
|
97
|
+
|
|
98
|
+
- **`agents doctor <agent>@<version>` no longer marks every missing resource critical (RUSH-2947).** Target mode's `computeVerdict` hardcoded `severity: 'critical'` for any `status: 'missing'` resource of any kind, while fleet mode's `FINDING_SEVERITY` — whose own docblock calls it "the single source of truth" — rates the same fact `warning` for everything except `missing-hook`/`missing-plugin`. A missing command, skill, permission, subagent, rule, or MCP entry now reads `warning` in target mode too, matching fleet mode; a missing hook or plugin stays `critical` in both. `computeVerdict` reads severity from `FINDING_SEVERITY` via a new `missingResourceSeverity(kind)` helper instead of re-hardcoding it. Source: `apps/cli/src/commands/doctor.ts`.
|
|
99
|
+
|
|
100
|
+
- **BREAKING: nest `agents alias` under `agents setup alias` (RUSH-2965).** Setting up a PATH shorthand is a setup action, not its own noun. `agents setup alias add/list/remove` keep the same shim behavior (`~/.agents/.cache/shims/` + `~/.agents/aliases.json`). Top-level `agents alias` is gone, not deprecated: it reports `unknown command`, and `alias` is retired from distance-1 auto-correct. Source: `apps/cli/src/commands/{alias,setup}.ts`, `apps/cli/src/lib/startup/command-registry.ts`.
|
|
101
|
+
|
|
102
|
+
- **Block service-manager registration under a redirected HOME on macOS/Linux (RUSH-2968).**
|
|
103
|
+
`launchctl` and `systemctl --user` are per-user-session and ignore `$HOME`, so a CLI
|
|
104
|
+
running under a sandbox/redirected HOME (including every vitest fork) still talked to
|
|
105
|
+
the user's real service manager. `service-manifest.ts` already namespaces the job
|
|
106
|
+
label, but that only changes the identifier — the registration still lands in real
|
|
107
|
+
`launchd`/`systemd` (measured: 89 dead `…sandbox-<hash>` services accumulated in one
|
|
108
|
+
user's real launchd from test runs, KeepAlive-retrying torn-down executables). Every
|
|
109
|
+
registration path now consults `serviceManagerRegistrationAllowed()` (false when
|
|
110
|
+
`isolatedHomeSuffix()` is non-null) and skips with a stated reason rather than
|
|
111
|
+
touching the real service manager: daemon `startDaemon`/`stopDaemon`, menubar
|
|
112
|
+
`restartMenubarLaunchAgent`/`disableMenubarService`, secrets
|
|
113
|
+
`retireLegacySecretsAgentService`, and `agents computer start`. A test seam
|
|
114
|
+
`AGENTS_SERVICE_MANAGER_ALLOW_REDIRECTED_HOME=1` lets the existing shim-based tests
|
|
115
|
+
continue to exercise the registration code path. Source:
|
|
116
|
+
`apps/cli/src/lib/service-manifest.ts`, `apps/cli/src/lib/daemon/daemon.ts`,
|
|
117
|
+
`apps/cli/src/lib/menubar/install-menubar.ts`, `apps/cli/src/lib/secrets/agent.ts`,
|
|
118
|
+
`apps/cli/src/commands/computer.ts`.
|
|
119
|
+
|
|
120
|
+
- **BREAKING: the top-level `agents inbox` command is removed — use `agents feed` (RUSH-2984).** `inbox` was a Phase-3 observe alias that re-parsed as `agents feed` (needs-you is already the feed default), the same leftover class as `timeline` (RUSH-2692). It is gone entirely, not deprecated: `agents inbox` now reports `unknown command`, and `inbox` is retired from distance-1 auto-correct. `agents feed` / `feed post` / `feed post --blocked` are unchanged. Source: `apps/cli/src/commands/feed.ts`, `apps/cli/src/lib/startup/command-registry.ts`, `apps/cli/src/bootstrap.ts`.
|
|
121
|
+
|
|
122
|
+
- `agents auth` and `agents org` now print a clean one-line error (and a structured `{"error"}` payload under `--json`) for signed-out, expired-token, and bad-input states, instead of dumping a raw Node stack trace.
|
|
123
|
+
|
|
124
|
+
- Fixed balanced Claude account rotation recording session-limit refusals until their stated reset, skipping those accounts, and surfacing `session-limited` in `agents view` instead of idle usage.
|
|
125
|
+
|
|
126
|
+
- Sandboxed monitor `--run` and routine children now inherit this host's GitHub CLI auth (RUSH-2860). A monitor fire recorded `ok` while the spawned child had no `~/.config/gh`, so `gh auth status` reported "not logged into any GitHub hosts" and the PR it was meant to act on stayed open. The routine sandbox overlay replaces `HOME` with a disposable dir, and `gh` was never linked into it. `prepareJobHome` now links the host's `gh` config dir into the overlay (and only that — `~/.agents` is deliberately not linked, since it holds the secrets master key and the encrypted store), `buildSpawnEnv` pins `GH_CONFIG_DIR` and forwards `GH_TOKEN`/`GITHUB_TOKEN`, and the runner refuses to launch when a routine's own `env:` overrides `GH_CONFIG_DIR` such that this host's gh auth would still be hidden — a regression tripwire rather than a runtime guarantee. Not covered on Windows, where `gh` stores config under `%AppData%\GitHub CLI`.
|
|
127
|
+
|
|
128
|
+
- **`agents webhooks` now advertises `/hooks/slack`.** The receiver has accepted signed
|
|
129
|
+
Slack deliveries since the Slack bridge landed, but `agents webhooks serve` and
|
|
130
|
+
`agents daemon webhooks list` still printed only `/hooks/github, /hooks/linear` — the
|
|
131
|
+
one URL you must paste into the Slack app was missing from the banner. The slash-command
|
|
132
|
+
ack now also says "replying in this channel", matching where the reply actually posts
|
|
133
|
+
(a slash command carries no thread). Source: `apps/cli/src/commands/webhook.ts`,
|
|
134
|
+
`apps/cli/src/commands/daemon.ts`, `apps/cli/src/lib/triggers/webhook.ts`.
|
|
135
|
+
|
|
136
|
+
- **Slack/webhook handlers that run an agent actually dispatch now.** A `run.agent` or
|
|
137
|
+
`run.workflow` webhook handler was gated by the *routine* activation manifest
|
|
138
|
+
(`~/.agents/devices/<machine>/agents.yaml`). A handler is not a routine, so its name
|
|
139
|
+
could never be a member — on any box that had materialized that manifest, every
|
|
140
|
+
delivery was recorded `skipped` with an empty allowlist (`can only run on: `) while the
|
|
141
|
+
receiver logged it as `fired`, and `agents routines enable <handler>` refuses the name,
|
|
142
|
+
so there was no way out. Verified live: a real HMAC-signed `/agents` slash command
|
|
143
|
+
reached the public receiver, acked 200, and started no agent. The job now carries
|
|
144
|
+
`dispatchedBy: 'webhook'`, the same escape RUSH-2681 gave monitors; a handler's
|
|
145
|
+
`routine:` delegate still keeps its gate.
|
|
146
|
+
- **`{{slack.response_url}}` is now available to handler prompts.** It was parsed off the
|
|
147
|
+
wire but never reached the `{{slack.*}}` namespace. Slack accepts a POST there for 30
|
|
148
|
+
minutes with no token and no channel membership, so it is the only reply that works
|
|
149
|
+
before the app has been invited to a channel — the shipped example handler now uses it.
|
|
150
|
+
Source: `apps/cli/src/lib/triggers/handlers.ts`, `apps/cli/src/lib/scheduling/routines.ts`.
|
|
151
|
+
|
|
3
152
|
## 1.22.42
|
|
4
153
|
|
|
5
154
|
- **Plan-tier gates for `agents accounts` and `agents insights` (RUSH-2424).** A new `apps/cli/src/lib/entitlement.ts` reads the live subscription tier from `GET /api/v1/billing/subscription?agent=agi-cli` (the session token in `~/.rush/user.yaml`), caches it on disk for 15 minutes, and stays offline-tolerant: a stale cache is honored over a failed network call, and no session file at all resolves straight to the free tier. `agents accounts add` / `name` / `attach` now cap registered accounts at 3 per harness on free, 10 on paid/admin — a 4th add on free refuses before any write (`free plan is capped at 3 claude accounts (3/3). agents upgrade — up to 10 per harness.`) and the 3rd prints a one-line notice. Downgrading a plan never deletes a credential: over-cap accounts fall out of `accounts switch`/`set-default` (excluded from `listSwitchableAccounts`) and are listed `dormant (upgrade to reactivate)` in `agents accounts`. `agents insights` keeps top-line counts, harness mix, `insights mix`, and `agents perf` free on every tier; the Friction / Friction-thrash / Dissatisfaction-corrections sections, grouping `--by account` (the default), and `--narrative` are paid — a gated section is replaced by the in-voice notice `Friction and account-split analysis are on the paid plan.` in both the text report and `--json` (a new `plan: {tierName, isPaid}` field, `groups: null` when the account breakdown is gated, and the friction/correction facet keys stripped per group otherwise). Source: `apps/cli/src/lib/entitlement.ts`, `apps/cli/src/commands/accounts.ts`, `apps/cli/src/commands/insights.ts`.
|
package/README.md
CHANGED
|
@@ -188,9 +188,11 @@ agents run claude "summarize recent commits" --strategy balanced
|
|
|
188
188
|
# Or choose one account/version interactively for only this run.
|
|
189
189
|
agents run claude@
|
|
190
190
|
agents run codex@ "review this branch"
|
|
191
|
+
agents run claude@ --device auto # pick the device, then choose there
|
|
192
|
+
agents run claude@ --device yosemite-s0 # choose from one device's accounts
|
|
191
193
|
```
|
|
192
194
|
|
|
193
|
-
`--strategy balanced` spreads work across available versions of the same agent -- useful when you have multiple accounts and want to avoid burning through one. When every account is rate-limited, the run exits nonzero naming each excluded account and the earliest window reset (use `--strategy pinned` to force the default) -- it never launches into an exhausted account.
|
|
195
|
+
`--strategy balanced` spreads work across available versions of the same agent -- useful when you have multiple accounts and want to avoid burning through one. When a Claude run reports a session limit, agents-cli records the stated reset time, shows `session-limited` in `agents view`, and excludes that account until the reset. When every account is rate-limited, the run exits nonzero naming each excluded account and the earliest window reset (use `--strategy pinned` to force the default) -- it never launches into an exhausted account.
|
|
194
196
|
|
|
195
197
|
### Don't care which harness? `agents run auto`
|
|
196
198
|
|
|
@@ -205,7 +207,7 @@ agents run auto --device yosemite-s0 "fix the flaky test" # pin the host layer
|
|
|
205
207
|
|
|
206
208
|
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.
|
|
207
209
|
|
|
208
|
-
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
|
|
210
|
+
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 a warm-box lease. Device routing is resolved first, then the picker is populated from the selected device. Profiles and workflows must use their concrete host agent instead.
|
|
209
211
|
|
|
210
212
|
### Chain agents
|
|
211
213
|
|
|
@@ -454,7 +456,7 @@ A stalled session whose tail shows a hard account limit ("You've hit your weekly
|
|
|
454
456
|
## Sync the fleet
|
|
455
457
|
|
|
456
458
|
<p align="center">
|
|
457
|
-
<img src="assets/fleet-sync.svg" alt="agents apply: reconcile every device to one profile from agents.yaml — install missing agents and sync config. Native logins stay on the machine that minted them." width="100%" />
|
|
459
|
+
<img src="assets/fleet-sync.svg" alt="agents fleet apply: reconcile every device to one profile from agents.yaml — install missing agents and sync config. Native logins stay on the machine that minted them." width="100%" />
|
|
458
460
|
</p>
|
|
459
461
|
|
|
460
462
|
|
|
@@ -471,14 +473,14 @@ fleet:
|
|
|
471
473
|
```
|
|
472
474
|
|
|
473
475
|
```bash
|
|
474
|
-
agents apply --plan # device x dimension matrix; changes nothing
|
|
475
|
-
agents apply # reconcile the fleet (confirms first; -y to skip)
|
|
476
|
-
agents apply --device yosemite-s0 # scope to one device
|
|
477
|
-
agents apply --only agents,config # limit dimensions (agents, config, login)
|
|
478
|
-
agents apply --no-login # skip login propagation
|
|
476
|
+
agents fleet apply --plan # device x dimension matrix; changes nothing
|
|
477
|
+
agents fleet apply # reconcile the fleet (confirms first; -y to skip)
|
|
478
|
+
agents fleet apply --device yosemite-s0 # scope to one device
|
|
479
|
+
agents fleet apply --only agents,config # limit dimensions (agents, config, login)
|
|
480
|
+
agents fleet apply --no-login # skip login propagation
|
|
479
481
|
```
|
|
480
482
|
|
|
481
|
-
`agents
|
|
483
|
+
`agents fleet apply` probes every target over the existing SSH transport, then reconciles it to the profile: installs missing agents, upgrades `agi-cli`, syncs the named config scopes, and **propagates logins** so a host signed in once seeds the fleet -- turning "6 hosts x 8 harnesses = 48 OAuth flows" into one. Portable credential files (claude, codex, grok, kimi, opencode, droid, antigravity) stream to each target over encrypted SSH stdin, never shell-interpolated, and land at `0600`. **Honest boundary:** macOS keychain-bound tokens (claude, antigravity on a Mac target) can't be extracted -- those surface as a one-time manual login, never faked. `--plan` / `--dry-run` shows the full matrix without touching anything.
|
|
482
484
|
|
|
483
485
|
See [docs/fleet.md](apps/cli/docs/fleet.md) for the manifest schema and reconcile semantics.
|
|
484
486
|
|
|
@@ -670,7 +672,7 @@ age (`updated 2m ago — pass --refresh (--live) for a live probe`).
|
|
|
670
672
|
`agents fleet status` answers "is my fleet OK?" at a glance: a one-line rollup
|
|
671
673
|
(`● N online · ○ M offline`), a short **NEEDS ATTENTION** list where every item names
|
|
672
674
|
the command that fixes it (offline → `check the box`, config drift or a stark CLI gap →
|
|
673
|
-
`agents apply <box>`, version skew → `agents upgrade --fleet`), then quiet per-device
|
|
675
|
+
`agents fleet apply --device <box>`, version skew → `agents upgrade --fleet`), then quiet per-device
|
|
674
676
|
rows grouped by OS (macOS / Linux / Windows) showing just `name · capacity · load/mem ·
|
|
675
677
|
version`, with this machine flagged `▸ … ← this machine`. A healthy fleet reads in a few
|
|
676
678
|
lines; orphaned versions are demoted to a one-line `agents prune` nudge in the footer.
|
|
@@ -1203,7 +1205,7 @@ agents artifacts share plan.html --json # URL object for pla
|
|
|
1203
1205
|
agents artifacts share list --agent claude # everything published, filterable
|
|
1204
1206
|
agents artifacts share revisions fleet # prior versions kept under a slug
|
|
1205
1207
|
agents artifacts share status # show the endpoint
|
|
1206
|
-
agents unshare fleet
|
|
1208
|
+
agents artifacts unshare fleet # take a published link (+ its OG cover) down
|
|
1207
1209
|
```
|
|
1208
1210
|
|
|
1209
1211
|
`agents artifacts share` closes the loop: an agent makes work (a plan, a viz, a report),
|
|
@@ -1232,7 +1234,7 @@ Republishing an existing slug keeps the prior version as a revision by default
|
|
|
1232
1234
|
(`--no-revision` to skip); `agents artifacts share revisions <slug>` shows the retained
|
|
1233
1235
|
history, newest first.
|
|
1234
1236
|
|
|
1235
|
-
`agents artifacts share delete <targets...>` (alias `agents unshare`) takes a page down — pass a
|
|
1237
|
+
`agents artifacts share delete <targets...>` (alias `agents artifacts unshare`) takes a page down — pass a
|
|
1236
1238
|
full URL, `<user>/<slug>`, or a bare slug (resolved against your own namespace); several
|
|
1237
1239
|
targets at once are fine. It also deletes the sibling `<slug>.png` OG cover by default
|
|
1238
1240
|
(`--keep-cover` opts out) and verifies the page actually 404s before reporting success —
|
|
@@ -1505,7 +1507,7 @@ For full transparency: `agi-cli` keeps a local event log at `~/.agents/.cache/lo
|
|
|
1505
1507
|
|
|
1506
1508
|
macOS and Linux. Windows via WSL works but isn't first-class yet.
|
|
1507
1509
|
|
|
1508
|
-
**macOS-only features:** Keychain-based secrets (`agents secrets`, `agents
|
|
1510
|
+
**macOS-only features:** Keychain-based secrets (`agents secrets`, `agents accounts add`) require macOS. Default iCloud sync for bundles requires macOS + iCloud Keychain enabled; use `--no-icloud-sync` for device-local bundles. On Linux, use environment variables or `.env` files for API keys. Native Linux credential store support is planned.
|
|
1509
1511
|
|
|
1510
1512
|
Interactive tmux-backed runs require tmux 3.2 or newer.
|
|
1511
1513
|
|
package/dist/bootstrap.js
CHANGED
|
@@ -211,7 +211,7 @@ Install, configure, run, and dispatch AI coding agents from one place.
|
|
|
211
211
|
Works with Claude, Codex, Antigravity, Cursor, OpenCode, OpenClaw, and Droid.
|
|
212
212
|
|
|
213
213
|
Quick start:
|
|
214
|
-
agents setup First-time setup (interactive)
|
|
214
|
+
agents setup First-time setup (interactive); setup beta enables preview features
|
|
215
215
|
agents view See what's installed
|
|
216
216
|
agents run <agent> ["prompt"] Run an agent (interactive without prompt, headless with)
|
|
217
217
|
agents sessions Browse past sessions across all agents
|
|
@@ -256,15 +256,20 @@ Run and dispatch:
|
|
|
256
256
|
pty Drive interactive terminal programs (REPLs, TUIs) via a persistent PTY session
|
|
257
257
|
artifacts Publish what an agent made (plans, reports, visuals) to a shareable link
|
|
258
258
|
|
|
259
|
-
Observe (read the fleet — no store merge
|
|
260
|
-
feed
|
|
259
|
+
Observe (read the fleet — no store merge):
|
|
260
|
+
feed Needs-you inbox (open blocks waiting on you); agent posts = feed --filter updates
|
|
261
261
|
sessions --active Live agents (who is running right now)
|
|
262
262
|
events Unified ops + activity event trail
|
|
263
|
-
audit
|
|
264
|
-
status
|
|
263
|
+
events audit Dispatched-run outcomes (alias of events --include runs)
|
|
264
|
+
sync status Sync/drift only (not the live fleet snapshot)
|
|
265
265
|
devices snapshot One-process inventory + active sessions poll
|
|
266
266
|
|
|
267
|
-
|
|
267
|
+
Identity (Prix account — shared with paid tiers):
|
|
268
|
+
auth login Sign in via the device-code flow
|
|
269
|
+
auth whoami Show the signed-in Prix user
|
|
270
|
+
auth space Create and manage a space (invite collaborators)
|
|
271
|
+
|
|
272
|
+
Credentials (harness keys, not your Prix user):
|
|
268
273
|
harness Custom (host CLI + model + auth) harnesses; replaces former profiles command
|
|
269
274
|
secrets Keychain-backed env bundles; synced vault: secrets vault unlock|lock
|
|
270
275
|
accounts Provider credentials + native OAuth logout
|
|
@@ -281,9 +286,6 @@ Config sync:
|
|
|
281
286
|
repo init --path <dir> Scaffold your own editable repo from a template
|
|
282
287
|
repo add <path|gh:user/repo> Merge an extra repo after the system repo
|
|
283
288
|
|
|
284
|
-
Beta features:
|
|
285
|
-
beta Enable preview features (factory and more)
|
|
286
|
-
|
|
287
289
|
Automation tips:
|
|
288
290
|
Pass explicit names/IDs Avoid pickers: agents sessions <id> --markdown
|
|
289
291
|
Use --yes for defaults Auto-accept sync/default prompts on add/use/pull
|
|
@@ -726,10 +728,13 @@ function registerHqTombstoneCommand(p) {
|
|
|
726
728
|
}
|
|
727
729
|
/**
|
|
728
730
|
* Hidden `agents _internal <sub>` namespace for machine-to-machine calls that
|
|
729
|
-
* are not user-facing.
|
|
730
|
-
* hooks (git-guard, rm-guard, …)
|
|
731
|
-
* before they exit 2
|
|
732
|
-
* cannot emit in-process.
|
|
731
|
+
* are not user-facing. Subcommands:
|
|
732
|
+
* - `friction` — shell guard hooks (git-guard, rm-guard, …) self-report a
|
|
733
|
+
* block into the event log before they exit 2; they run before any
|
|
734
|
+
* `agents` process exists, so they cannot emit in-process.
|
|
735
|
+
* - `mergeable-prs` — the `pr-merge-on-green` built-in poll. Prints
|
|
736
|
+
* `owner/repo#n` for this user's CI-green, non-author-approved open PRs
|
|
737
|
+
* (cwd-independent `--repo`). Empty stdout is a silent observation.
|
|
733
738
|
*/
|
|
734
739
|
function registerInternalCommand(p) {
|
|
735
740
|
const internal = p.command('_internal', { hidden: true });
|
|
@@ -749,6 +754,21 @@ function registerInternalCommand(p) {
|
|
|
749
754
|
});
|
|
750
755
|
process.exit(0);
|
|
751
756
|
});
|
|
757
|
+
internal
|
|
758
|
+
.command('mergeable-prs')
|
|
759
|
+
.description('Print owner/repo#n for CI-green, non-author-approved open PRs (pr-merge-on-green poll)')
|
|
760
|
+
.action(async () => {
|
|
761
|
+
try {
|
|
762
|
+
const { listMergeableRefs } = await import('./lib/github/pr-mergeable.js');
|
|
763
|
+
const refs = await listMergeableRefs();
|
|
764
|
+
if (refs)
|
|
765
|
+
process.stdout.write(`${refs}\n`);
|
|
766
|
+
}
|
|
767
|
+
catch {
|
|
768
|
+
// Empty observation — never write stderr (command.ts would treat it
|
|
769
|
+
// as the poll result and fire `mode: every` on the error text).
|
|
770
|
+
}
|
|
771
|
+
});
|
|
752
772
|
}
|
|
753
773
|
/** Runtime action for the shared `agents upgrade [version]` command definition. */
|
|
754
774
|
async function runUpgrade(version, options) {
|
|
@@ -56,21 +56,16 @@ export declare const loadPrune: ModuleLoader;
|
|
|
56
56
|
export declare const loadTrash: ModuleLoader;
|
|
57
57
|
export declare const loadRestore: ModuleLoader;
|
|
58
58
|
export declare const loadDoctor: ModuleLoader;
|
|
59
|
-
export declare const loadApply: ModuleLoader;
|
|
60
|
-
export declare const loadStatus: ModuleLoader;
|
|
61
59
|
export declare const loadRoute: ModuleLoader;
|
|
62
60
|
export declare const loadHarness: ModuleLoader;
|
|
63
61
|
export declare const loadSecrets: ModuleLoader;
|
|
64
62
|
export declare const loadMenubar: ModuleLoader;
|
|
65
|
-
export declare const loadBeta: ModuleLoader;
|
|
66
63
|
export declare const loadSync: ModuleLoader;
|
|
67
64
|
export declare const loadRefreshRules: ModuleLoader;
|
|
68
65
|
export declare const loadFactory: ModuleLoader;
|
|
69
66
|
export declare const loadUsage: ModuleLoader;
|
|
70
67
|
export declare const loadInsights: ModuleLoader;
|
|
71
68
|
export declare const loadPerf: ModuleLoader;
|
|
72
|
-
export declare const loadTrends: ModuleLoader;
|
|
73
|
-
export declare const loadAlias: ModuleLoader;
|
|
74
69
|
export declare const loadPty: ModuleLoader;
|
|
75
70
|
export declare const loadTmux: ModuleLoader;
|
|
76
71
|
export declare const loadWatchdog: ModuleLoader;
|
|
@@ -85,15 +80,12 @@ export declare const loadUninstall: ModuleLoader;
|
|
|
85
80
|
export declare const loadUpgrade: ModuleLoader;
|
|
86
81
|
export declare const loadSessions: ModuleLoader;
|
|
87
82
|
export declare const loadTeams: ModuleLoader;
|
|
88
|
-
export declare const loadTickets: ModuleLoader;
|
|
89
83
|
export declare const loadCloud: ModuleLoader;
|
|
90
84
|
export declare const loadMessage: ModuleLoader;
|
|
91
85
|
export declare const loadSend: ModuleLoader;
|
|
92
86
|
export declare const loadFeed: ModuleLoader;
|
|
93
87
|
export declare const loadMailboxes: ModuleLoader;
|
|
94
|
-
export declare const loadServe: ModuleLoader;
|
|
95
88
|
export declare const loadArtifacts: ModuleLoader;
|
|
96
|
-
export declare const loadAudit: ModuleLoader;
|
|
97
89
|
export declare const loadWebhooks: ModuleLoader;
|
|
98
90
|
export declare const loadHumans: ModuleLoader;
|
|
99
91
|
export declare const loadAccounts: ModuleLoader;
|
|
@@ -58,22 +58,16 @@ export const loadPrune = async () => (await import('../commands/prune.js')).regi
|
|
|
58
58
|
export const loadTrash = async () => (await import('../commands/trash.js')).registerTrashCommands;
|
|
59
59
|
export const loadRestore = async () => (await import('../commands/trash.js')).registerRestoreCommand;
|
|
60
60
|
export const loadDoctor = async () => (await import('../commands/doctor.js')).registerDoctorCommand;
|
|
61
|
-
export const loadApply = async () => (await import('../commands/apply.js')).registerApplyCommand;
|
|
62
|
-
export const loadStatus = async () => (await import('../commands/status.js')).registerStatusCommand;
|
|
63
61
|
export const loadRoute = async () => (await import('../commands/route.js')).registerRouteCommands;
|
|
64
62
|
export const loadHarness = async () => (await import('../commands/harness.js')).registerHarnessCommands;
|
|
65
63
|
export const loadSecrets = async () => (await import('../commands/secrets.js')).registerSecretsCommands;
|
|
66
64
|
export const loadMenubar = async () => (await import('../commands/menubar.js')).registerMenubarCommands;
|
|
67
|
-
export const loadBeta = async () => (await import('../commands/beta.js')).registerBetaCommands;
|
|
68
65
|
export const loadSync = async () => (await import('../commands/sync.js')).registerSyncCommand;
|
|
69
66
|
export const loadRefreshRules = async () => (await import('../commands/refresh-rules.js')).registerRefreshRulesCommand;
|
|
70
67
|
export const loadFactory = async () => (await import('../commands/factory.js')).registerFactoryCommands;
|
|
71
68
|
export const loadUsage = async () => (await import('../commands/usage.js')).registerUsageCommand;
|
|
72
69
|
export const loadInsights = async () => (await import('../commands/insights.js')).registerInsightsCommand;
|
|
73
70
|
export const loadPerf = async () => (await import('../commands/perf.js')).registerPerfCommand;
|
|
74
|
-
// Thin deprecated alias of `agents insights mix` — no second mix implementation.
|
|
75
|
-
export const loadTrends = async () => (await import('../commands/trends.js')).registerTrendsCommand;
|
|
76
|
-
export const loadAlias = async () => (await import('../commands/alias.js')).registerAliasCommand;
|
|
77
71
|
export const loadPty = async () => (await import('../commands/pty.js')).registerPtyCommands;
|
|
78
72
|
export const loadTmux = async () => (await import('../commands/tmux.js')).registerTmuxCommands;
|
|
79
73
|
export const loadWatchdog = async () => (await import('../commands/watchdog.js')).registerWatchdogCommand;
|
|
@@ -88,17 +82,13 @@ export const loadUninstall = async () => (await import('../commands/uninstall.js
|
|
|
88
82
|
export const loadUpgrade = async () => (await import('../commands/upgrade.js')).registerUpgradeCommand;
|
|
89
83
|
export const loadSessions = async () => (await import('../commands/sessions.js')).registerSessionsCommands;
|
|
90
84
|
export const loadTeams = async () => (await import('../commands/teams.js')).registerTeamsCommands;
|
|
91
|
-
export const loadTickets = async () => (await import('../commands/tickets.js')).registerTicketsCommand;
|
|
92
85
|
export const loadCloud = async () => (await import('../commands/cloud.js')).registerCloudCommands;
|
|
93
86
|
export const loadMessage = async () => (await import('../commands/message.js')).registerMessageCommand;
|
|
94
87
|
export const loadSend = async () => (await import('../commands/send.js')).registerSendCommand;
|
|
95
88
|
export const loadFeed = async () => (await import('../commands/feed.js')).registerFeedCommand;
|
|
96
89
|
export const loadMailboxes = async () => (await import('../commands/mailboxes.js')).registerMailboxesCommand;
|
|
97
|
-
|
|
98
|
-
// Registers the `artifacts` group (with `share` + `setup` under it) AND the
|
|
99
|
-
// top-level `unshare` alias — see commands/artifacts.ts.
|
|
90
|
+
// Registers the `artifacts` group (`share` + `setup` + nested `unshare`).
|
|
100
91
|
export const loadArtifacts = async () => (await import('../commands/artifacts.js')).registerArtifactsCommands;
|
|
101
|
-
export const loadAudit = async () => (await import('../commands/audit.js')).registerAuditCommands;
|
|
102
92
|
export const loadWebhooks = async () => (await import('../commands/webhook.js')).registerWebhooksCommand;
|
|
103
93
|
export const loadHumans = async () => (await import('../commands/humans.js')).registerHumansCommands;
|
|
104
94
|
export const loadAccounts = async () => (await import('../commands/accounts.js')).registerAccountsCommand;
|
|
@@ -119,7 +109,6 @@ export const LAZY_COMMAND_NAMES = new Set([
|
|
|
119
109
|
'teams',
|
|
120
110
|
'cloud',
|
|
121
111
|
'message',
|
|
122
|
-
'serve',
|
|
123
112
|
]);
|
|
124
113
|
/**
|
|
125
114
|
* User-typed top-level command name -> ordered list of module loaders to run.
|
|
@@ -178,22 +167,17 @@ export const COMMAND_LOADERS = {
|
|
|
178
167
|
trash: [loadTrash],
|
|
179
168
|
restore: [loadRestore],
|
|
180
169
|
doctor: [loadDoctor],
|
|
181
|
-
apply: [loadApply],
|
|
182
|
-
status: [loadStatus],
|
|
183
170
|
route: [loadRoute],
|
|
184
171
|
harness: [loadHarness],
|
|
185
172
|
harnesses: [loadHarness],
|
|
186
173
|
secrets: [loadSecrets],
|
|
187
174
|
menubar: [loadMenubar],
|
|
188
|
-
beta: [loadBeta],
|
|
189
175
|
sync: [loadSync],
|
|
190
176
|
'refresh-rules': [loadRefreshRules],
|
|
191
177
|
factory: [loadFactory],
|
|
192
178
|
usage: [loadUsage],
|
|
193
179
|
insights: [loadInsights],
|
|
194
180
|
perf: [loadPerf],
|
|
195
|
-
trends: [loadTrends],
|
|
196
|
-
alias: [loadAlias],
|
|
197
181
|
pty: [loadPty],
|
|
198
182
|
tmux: [loadTmux],
|
|
199
183
|
watchdog: [loadWatchdog],
|
|
@@ -216,22 +200,14 @@ export const COMMAND_LOADERS = {
|
|
|
216
200
|
upgrade: [loadUpgrade],
|
|
217
201
|
sessions: [loadSessions],
|
|
218
202
|
teams: [loadTeams],
|
|
219
|
-
tickets: [loadTickets],
|
|
220
203
|
cloud: [loadCloud],
|
|
221
204
|
message: [loadMessage],
|
|
222
205
|
send: [loadSend],
|
|
223
206
|
notify: [loadSend],
|
|
224
207
|
feed: [loadFeed],
|
|
225
|
-
// Observe-umbrella alias of feed (the `timeline` alias was removed in RUSH-2692).
|
|
226
|
-
inbox: [loadFeed],
|
|
227
208
|
mailboxes: [loadMailboxes],
|
|
228
209
|
mailbox: [loadMailboxes],
|
|
229
|
-
serve: [loadServe],
|
|
230
210
|
artifacts: [loadArtifacts],
|
|
231
|
-
// `unshare` is a top-level convenience alias of `artifacts share delete` (see
|
|
232
|
-
// commands/share.ts) — same module, registered as its own program.command().
|
|
233
|
-
unshare: [loadArtifacts],
|
|
234
|
-
audit: [loadAudit],
|
|
235
211
|
webhooks: [loadWebhooks],
|
|
236
212
|
humans: [loadHumans],
|
|
237
213
|
daemon: [loadDaemon],
|
package/dist/commands/alias.d.ts
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* `agents setup alias` -- create top-level shim binaries that expand to
|
|
3
|
+
* `agents <subcommand>`. Nested under setup because the user is configuring
|
|
4
|
+
* this machine's PATH shortcuts, not operating a separate noun (RUSH-2965).
|
|
3
5
|
*
|
|
4
|
-
* Generates executable scripts in ~/.agents/shims/ (already on PATH from
|
|
5
|
-
* standard agents-cli install). Running `teams` becomes equivalent to
|
|
6
|
+
* Generates executable scripts in ~/.agents/.cache/shims/ (already on PATH from
|
|
7
|
+
* the standard agents-cli install). Running `teams` becomes equivalent to
|
|
6
8
|
* `agents teams`. Aliases are tracked in ~/.agents/aliases.json so we can
|
|
7
9
|
* list, regenerate, or remove them without scanning the shims directory
|
|
8
10
|
* (which also holds agent CLI shims like claude/codex/gemini).
|
|
9
11
|
*/
|
|
10
12
|
import type { Command } from 'commander';
|
|
11
|
-
|
|
13
|
+
/** Register `agents setup alias` under the parent `setup` command. */
|
|
14
|
+
export declare function registerAliasCommand(setupCmd: Command): void;
|
package/dist/commands/alias.js
CHANGED
|
@@ -4,7 +4,10 @@ import * as path from 'path';
|
|
|
4
4
|
import { getUserAgentsDir } from '../lib/state.js';
|
|
5
5
|
import { getShimsDir } from '../lib/installations/shims.js';
|
|
6
6
|
import { ALL_AGENT_IDS, AGENTS } from '../lib/agents.js';
|
|
7
|
-
|
|
7
|
+
import { setHelpSections } from '../lib/help.js';
|
|
8
|
+
function aliasesFile() {
|
|
9
|
+
return path.join(getUserAgentsDir(), 'aliases.json');
|
|
10
|
+
}
|
|
8
11
|
/** Names that would clobber an agent CLI shim or the `agents` binary itself. */
|
|
9
12
|
function reservedNames() {
|
|
10
13
|
const reserved = new Set(['agents']);
|
|
@@ -13,10 +16,11 @@ function reservedNames() {
|
|
|
13
16
|
return reserved;
|
|
14
17
|
}
|
|
15
18
|
function readAliases() {
|
|
16
|
-
|
|
19
|
+
const file = aliasesFile();
|
|
20
|
+
if (!fs.existsSync(file))
|
|
17
21
|
return {};
|
|
18
22
|
try {
|
|
19
|
-
const parsed = JSON.parse(fs.readFileSync(
|
|
23
|
+
const parsed = JSON.parse(fs.readFileSync(file, 'utf-8'));
|
|
20
24
|
return parsed && typeof parsed === 'object' ? parsed : {};
|
|
21
25
|
}
|
|
22
26
|
catch {
|
|
@@ -24,8 +28,9 @@ function readAliases() {
|
|
|
24
28
|
}
|
|
25
29
|
}
|
|
26
30
|
function writeAliases(map) {
|
|
27
|
-
|
|
28
|
-
fs.
|
|
31
|
+
const file = aliasesFile();
|
|
32
|
+
fs.mkdirSync(path.dirname(file), { recursive: true });
|
|
33
|
+
fs.writeFileSync(file, JSON.stringify(map, null, 2) + '\n', 'utf-8');
|
|
29
34
|
}
|
|
30
35
|
function shimPath(name) {
|
|
31
36
|
return path.join(getShimsDir(), name);
|
|
@@ -46,10 +51,30 @@ function isAliasShim(filePath) {
|
|
|
46
51
|
return false;
|
|
47
52
|
}
|
|
48
53
|
}
|
|
49
|
-
|
|
50
|
-
|
|
54
|
+
/** Register `agents setup alias` under the parent `setup` command. */
|
|
55
|
+
export function registerAliasCommand(setupCmd) {
|
|
56
|
+
const cmd = setupCmd
|
|
51
57
|
.command('alias')
|
|
52
58
|
.description('Create shorthand binaries that expand to `agents <subcommand>`');
|
|
59
|
+
setHelpSections(cmd, {
|
|
60
|
+
examples: `
|
|
61
|
+
# Make \`teams\` run \`agents teams\`
|
|
62
|
+
agents setup alias add teams
|
|
63
|
+
|
|
64
|
+
# Shorthand for a longer expansion
|
|
65
|
+
agents setup alias add sess sessions preview
|
|
66
|
+
|
|
67
|
+
agents setup alias list
|
|
68
|
+
agents setup alias remove teams
|
|
69
|
+
`,
|
|
70
|
+
notes: `
|
|
71
|
+
Writes an executable shim into ~/.agents/.cache/shims/ (already on PATH after
|
|
72
|
+
\`agents setup\`) and records it in ~/.agents/aliases.json.
|
|
73
|
+
|
|
74
|
+
Names that collide with the agents binary or an agent CLI (claude, codex,
|
|
75
|
+
grok, …) are refused. Top-level \`agents alias\` is gone — use this group.
|
|
76
|
+
`,
|
|
77
|
+
});
|
|
53
78
|
cmd
|
|
54
79
|
.command('add <name> [expansion...]')
|
|
55
80
|
.description('Create an alias shim. If expansion is omitted, defaults to <name>.')
|
|
@@ -106,7 +131,7 @@ export function registerAliasCommand(program) {
|
|
|
106
131
|
const map = readAliases();
|
|
107
132
|
const entries = Object.entries(map);
|
|
108
133
|
if (entries.length === 0) {
|
|
109
|
-
console.log(chalk.gray('No aliases. Try: agents alias add teams'));
|
|
134
|
+
console.log(chalk.gray('No aliases. Try: agents setup alias add teams'));
|
|
110
135
|
return;
|
|
111
136
|
}
|
|
112
137
|
const width = entries.reduce((max, [n]) => Math.max(max, n.length), 0);
|