@phnx-labs/agents-cli 1.23.27 → 1.23.29
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 +8 -0
- package/README.md +33 -82
- package/dist/bootstrap.js +0 -17
- package/dist/cli/command-registry.js +0 -2
- package/dist/commands/cloud.js +0 -58
- package/dist/commands/config.js +0 -4
- package/dist/commands/daemon-index.js +1 -1
- package/dist/commands/daemon.js +14 -63
- package/dist/commands/doctor.js +0 -12
- package/dist/commands/events.js +1 -1
- package/dist/commands/feed.d.ts +1 -3
- package/dist/commands/feed.js +1 -6
- package/dist/commands/fleet-capture.js +2 -4
- package/dist/commands/focus.d.ts +0 -1
- package/dist/commands/focus.js +2 -4
- package/dist/commands/inspect.d.ts +1 -19
- package/dist/commands/inspect.js +8 -474
- package/dist/commands/mine.js +1 -1
- package/dist/commands/prune.js +2 -64
- package/dist/commands/ps-roster.d.ts +0 -4
- package/dist/commands/ps-roster.js +2 -30
- package/dist/commands/ps.js +1 -4
- package/dist/commands/repo.d.ts +1 -1
- package/dist/commands/repo.js +4 -4
- package/dist/commands/sessions-browser.d.ts +0 -2
- package/dist/commands/sessions-browser.js +2 -32
- package/dist/commands/sessions-optimize.js +3 -4
- package/dist/commands/setup-mine.js +0 -1
- package/dist/commands/ssh.js +8 -9
- package/dist/commands/sync.js +1 -1
- package/dist/commands/update.js +2 -2
- package/dist/commands/watchdog.js +3 -4
- package/dist/lib/accounting/rotate.d.ts +0 -2
- package/dist/lib/accounting/rotate.js +1 -4
- package/dist/lib/agent-spec/agents.d.ts +0 -1
- package/dist/lib/agent-spec/agents.js +0 -8
- package/dist/lib/auth-health.d.ts +0 -1
- package/dist/lib/auth-health.js +0 -3
- package/dist/lib/cli-entry.d.ts +0 -1
- package/dist/lib/cli-entry.js +0 -36
- package/dist/lib/cloud/types.d.ts +0 -2
- package/dist/lib/config-keys.d.ts +1 -1
- package/dist/lib/config-keys.js +1 -4
- package/dist/lib/daemon/daemon.d.ts +0 -4
- package/dist/lib/daemon/daemon.js +6 -202
- package/dist/lib/daemon/heartbeat-service.d.ts +1 -1
- package/dist/lib/daemon/heartbeat-service.js +1 -8
- package/dist/lib/daemon-services.d.ts +1 -1
- package/dist/lib/daemon-services.js +1 -11
- package/dist/lib/device-config.d.ts +0 -2
- package/dist/lib/device-config.js +4 -22
- package/dist/lib/devices/config-migration.js +1 -3
- package/dist/lib/exec.d.ts +2 -5
- package/dist/lib/exec.js +18 -18
- package/dist/lib/factory/snapshot.d.ts +0 -5
- package/dist/lib/factory/snapshot.js +1 -28
- package/dist/lib/feed/events.d.ts +1 -11
- package/dist/lib/feed/events.js +0 -20
- package/dist/lib/feed/feed.d.ts +0 -2
- package/dist/lib/feed-outcome.d.ts +0 -2
- package/dist/lib/feed-outcome.js +0 -5
- package/dist/lib/fleet/capture.d.ts +0 -1
- package/dist/lib/fleet/capture.js +0 -3
- package/dist/lib/fleet/manifest.js +0 -6
- package/dist/lib/fleet/types.d.ts +0 -1
- package/dist/lib/harness/adapter.d.ts +0 -7
- package/dist/lib/harness/adapters/claude.js +0 -18
- package/dist/lib/harness/adapters/codex.js +0 -10
- package/dist/lib/harness/adapters/cursor.js +0 -11
- package/dist/lib/harness/adapters/kimi.js +0 -3
- package/dist/lib/harness/adapters/muse.js +0 -11
- package/dist/lib/harness/index.d.ts +1 -1
- package/dist/lib/harness/index.js +0 -2
- package/dist/lib/hosts/passthrough.js +2 -10
- package/dist/lib/hosts/ready.d.ts +0 -4
- package/dist/lib/hosts/ready.js +0 -9
- package/dist/lib/hosts/reconcile.d.ts +0 -1
- package/dist/lib/hosts/reconcile.js +0 -8
- package/dist/lib/installations/migrate.d.ts +0 -2
- package/dist/lib/installations/migrate.js +0 -145
- package/dist/lib/loop.js +1 -2
- package/dist/lib/menubar/snapshot.d.ts +0 -1
- package/dist/lib/menubar/snapshot.js +1 -4
- package/dist/lib/placement.d.ts +1 -2
- package/dist/lib/placement.js +4 -24
- package/dist/lib/profiles.d.ts +0 -1
- package/dist/lib/profiles.js +0 -6
- package/dist/lib/projects.js +15 -17
- package/dist/lib/session/active.d.ts +1 -3
- package/dist/lib/session/active.js +0 -4
- package/dist/lib/session/db.d.ts +0 -1
- package/dist/lib/session/db.js +4 -8
- package/dist/lib/session/discover.d.ts +0 -1
- package/dist/lib/session/discover.js +3 -128
- package/dist/lib/session/live-metadata.js +0 -2
- package/dist/lib/session/presentation.d.ts +0 -1
- package/dist/lib/session/presentation.js +3 -8
- package/dist/lib/session/selection.d.ts +0 -2
- package/dist/lib/session/selection.js +2 -12
- package/dist/lib/staleness/detectors/commands.d.ts +1 -1
- package/dist/lib/staleness/detectors/hooks.d.ts +1 -1
- package/dist/lib/staleness/detectors/mcp.d.ts +1 -1
- package/dist/lib/staleness/detectors/permissions.d.ts +1 -1
- package/dist/lib/staleness/detectors/plugins.d.ts +1 -1
- package/dist/lib/staleness/detectors/rules.d.ts +1 -1
- package/dist/lib/staleness/detectors/skills.d.ts +1 -1
- package/dist/lib/staleness/detectors/subagents.d.ts +1 -1
- package/dist/lib/staleness/detectors/workflows.d.ts +1 -1
- package/dist/lib/staleness/writers/commands.d.ts +1 -1
- package/dist/lib/staleness/writers/hooks.d.ts +1 -1
- package/dist/lib/staleness/writers/mcp.d.ts +1 -1
- package/dist/lib/staleness/writers/permissions.d.ts +1 -1
- package/dist/lib/staleness/writers/plugins.d.ts +1 -1
- package/dist/lib/staleness/writers/rules.d.ts +1 -1
- package/dist/lib/staleness/writers/skills.d.ts +1 -1
- package/dist/lib/staleness/writers/subagents.d.ts +1 -1
- package/dist/lib/staleness/writers/workflows.d.ts +1 -1
- package/dist/lib/startup/command-registry.js +5 -2
- package/dist/lib/state.d.ts +0 -3
- package/dist/lib/state.js +2 -25
- package/dist/lib/types.d.ts +0 -1
- package/dist/lib/watchdog/runner.d.ts +0 -2
- package/dist/lib/watchdog/runner.js +0 -2
- package/package.json +1 -1
- package/scripts/postinstall.js +2 -2
- package/dist/commands/routines.d.ts +0 -14
- package/dist/commands/routines.js +0 -2149
- package/dist/commands/routines.test-fixture.d.ts +0 -52
- package/dist/commands/routines.test-fixture.js +0 -254
- package/dist/lib/catchup.d.ts +0 -19
- package/dist/lib/catchup.js +0 -83
- package/dist/lib/daemon/catchup-service.d.ts +0 -18
- package/dist/lib/daemon/catchup-service.js +0 -21
- package/dist/lib/daemon/runner.d.ts +0 -91
- package/dist/lib/daemon/runner.js +0 -1927
- package/dist/lib/harness/adapters/droid.d.ts +0 -2
- package/dist/lib/harness/adapters/droid.js +0 -14
- package/dist/lib/overdue.d.ts +0 -9
- package/dist/lib/overdue.js +0 -74
- package/dist/lib/routine-activation.d.ts +0 -13
- package/dist/lib/routine-activation.js +0 -117
- package/dist/lib/routine-context.d.ts +0 -59
- package/dist/lib/routine-context.js +0 -181
- package/dist/lib/routine-notify-owner.d.ts +0 -4
- package/dist/lib/routine-notify-owner.js +0 -49
- package/dist/lib/routine-notify.d.ts +0 -17
- package/dist/lib/routine-notify.js +0 -138
- package/dist/lib/routine-process-cleanup.d.ts +0 -9
- package/dist/lib/routine-process-cleanup.js +0 -81
- package/dist/lib/routine-readiness.d.ts +0 -31
- package/dist/lib/routine-readiness.js +0 -256
- package/dist/lib/routines-format.d.ts +0 -7
- package/dist/lib/routines-format.js +0 -127
- package/dist/lib/routines-placement.d.ts +0 -16
- package/dist/lib/routines-placement.js +0 -60
- package/dist/lib/routines-project.d.ts +0 -49
- package/dist/lib/routines-project.js +0 -306
- package/dist/lib/sandbox.d.ts +0 -15
- package/dist/lib/sandbox.js +0 -309
- package/dist/lib/scheduler.d.ts +0 -23
- package/dist/lib/scheduler.js +0 -106
- package/dist/lib/scheduling/routines.d.ts +0 -264
- package/dist/lib/scheduling/routines.js +0 -1292
- package/dist/lib/triggers/webhook.d.ts +0 -26
- package/dist/lib/triggers/webhook.js +0 -181
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.23.29
|
|
4
|
+
|
|
5
|
+
- **Removed: routines (`agents routines`, the scheduler and catch-up services, routine sync).** Routines never worked reliably, so they are deprecated and gone as of this version. `agents routines` and its old `agents jobs`/`agents cron` aliases are now unknown commands. Also removed with them: the daemon's `scheduler` and `catchup` services, the `scheduler.enabled` device config key, project routine sync and routine device activation, `agents cloud run --on` event triggers, `agents prune cleanup runs`, the `routines:` list in the `fleet:` manifest, the `--routine` filters on `agents ps` and `agents ps focus`, the `agents inspect --routines` drill-down, the `fleet` placement kind (`--where fleet`), session lookup by routine run id, the `routine.start`/`routine.end` events, and the routine fields in JSON output (`jobCount` in `agents daemon status`, `detachedChildren` in `agents daemon stop`, `routines` in `agents menubar snapshot`, `recentRuns` in the factory snapshot, `origin`/`routineName` on `agents ps --json` rows). For scheduled agent work, use OS cron, a systemd timer or launchd and call `agents run` from it, for example `0 9 * * 1-5 agents run claude "triage the open PRs"`. Existing `~/.agents/routines/*.yml` files and leftover `scheduler`/`catchup`/`schedulerEnabled`/`routines:` config keys are ignored rather than rejected, so nothing breaks on upgrade. Source: cli/src/lib/daemon/daemon.ts, cli/src/lib/daemon-services.ts, cli/src/lib/state.ts
|
|
6
|
+
|
|
7
|
+
## 1.23.28
|
|
8
|
+
|
|
9
|
+
- **A folder two projects claim equally belongs to neither.** When two projects share the deepest root that holds a folder (rush and prix both rooted at one monorepo), `agents projects view`/`status --path` and session attribution now answer no project there instead of whichever project file sorts first, so the AGI EXT Project panel asks you to pick rather than quietly showing the wrong one. Each project's own `defaultPath` still resolves to it. Source: cli/src/lib/projects.ts
|
|
10
|
+
|
|
3
11
|
## 1.23.27
|
|
4
12
|
|
|
5
13
|
- **A Claude session started in a symlinked folder shows its real state (PHNX-4387).** `agents ps` and the session feed looked for the transcript under the folder's path as typed, while Claude stores it under the folder's real path, so such a session showed "Running · no transcript" forever. They now look under both and take the newest; `agents run` and project memory sync use the real path too. Source: `cli/src/lib/session/active.ts`, `cli/src/lib/project-key.ts`, `cli/src/lib/exec.ts`, `cli/src/lib/memory.ts`.
|
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
<a href="https://github.com/phnx-labs/agi-cli"><img src="https://img.shields.io/badge/github-phnx--labs%2Fagi--cli-blue?style=flat-square" alt="github" /></a>
|
|
12
12
|
</p>
|
|
13
13
|
|
|
14
|
-
**A framework for running a distributed agent factory.** Dispatch Claude, Codex, Antigravity, Grok, and more across your own machines, in parallel, on your existing subscriptions. Measure every run with `agents insights` (latency lives at `agents insights perf`), fold what you learn back into `AGENTS.md` and skills, then put the loop on a schedule with
|
|
14
|
+
**A framework for running a distributed agent factory.** Dispatch Claude, Codex, Antigravity, Grok, and more across your own machines, in parallel, on your existing subscriptions. Measure every run with `agents insights` (latency lives at `agents insights perf`), fold what you learn back into `AGENTS.md` and skills, then put the loop on a schedule with cron. Spawn parallel teams in isolated terminals or dispatch to the cloud for a PR. Watch live state across the fleet, nudge stalled runs, and message agents mid-flight. Store secrets behind Touch ID, drive real browsers and Electron apps, and steer the whole fleet from a menu bar — all from one CLI.
|
|
15
15
|
|
|
16
16
|
<p align="center">
|
|
17
17
|
<a href="https://github.com/anthropics/claude-code" title="Claude Code"><img src="assets/harnesses/anthropic.svg" height="32" alt="Claude Code" /></a>
|
|
@@ -101,7 +101,7 @@ Also available as `ag` -- all commands work with both `agents` and `ag`.
|
|
|
101
101
|
- [Sign in](#sign-in)
|
|
102
102
|
- [Accounts](#accounts)
|
|
103
103
|
- [Secrets](#secrets)
|
|
104
|
-
- [
|
|
104
|
+
- [Daemon](#daemon)
|
|
105
105
|
- [Share](#share)
|
|
106
106
|
- [PTY](#pty)
|
|
107
107
|
- [Portable setup](#portable-setup)
|
|
@@ -132,15 +132,14 @@ agents insights --since 30d # friction, harness comparison, ranked action
|
|
|
132
132
|
agents rules add ~/lessons/payments-review.md --agents claude
|
|
133
133
|
agents skills add ~/skills/payments-review --agents claude
|
|
134
134
|
|
|
135
|
-
# Put it on a schedule so it runs itself
|
|
136
|
-
agents
|
|
137
|
-
--schedule "0 2 * * *" --agent claude --prompt "Audit payments/* for regressions"
|
|
135
|
+
# Put it on a schedule so it runs itself (crontab -e)
|
|
136
|
+
# 0 2 * * * agents run claude "Audit payments/* for regressions" --mode auto
|
|
138
137
|
|
|
139
138
|
# Check the fleet this loop runs on, AGI Menu included
|
|
140
139
|
agents doctor
|
|
141
140
|
```
|
|
142
141
|
|
|
143
|
-
`agents insights perf` reads a disposable warehouse at `~/.agents/.cache/perf/perf.db` -- hook, command, and run timing rollups, deletable any time. `agents insights` is deterministic and offline: it caches per-session facets, compares harnesses, and ranks actions by evidence count -- no model call unless you pass `--narrative`.
|
|
142
|
+
`agents insights perf` reads a disposable warehouse at `~/.agents/.cache/perf/perf.db` -- hook, command, and run timing rollups, deletable any time. `agents insights` is deterministic and offline: it caches per-session facets, compares harnesses, and ranks actions by evidence count -- no model call unless you pass `--narrative`. Schedule any of this with OS cron, a systemd timer, or launchd calling `agents run`; the menu bar is the always-on control surface for the fleet these commands drive ([Menu bar](#menu-bar)).
|
|
144
143
|
|
|
145
144
|
---
|
|
146
145
|
|
|
@@ -358,7 +357,6 @@ agents ps --json --local # this machine only, machine-readable
|
|
|
358
357
|
agents ps --json -D box-a # one peer, over SSH
|
|
359
358
|
agents ps --status waiting # only agents waiting on you (exit 1 if any)
|
|
360
359
|
agents ps --bookmarks # only bookmarked sessions
|
|
361
|
-
agents ps --routine nightly-review # only one routine's runs (omit the name for all routines)
|
|
362
360
|
agents ps stop|focus|detach|migrate <id> # act on one running agent
|
|
363
361
|
agents ps migrations # where migrated sessions went
|
|
364
362
|
agents ps --status working # actively producing work (fleet-wide)
|
|
@@ -751,8 +749,7 @@ agents devices list --no-stats # instant: names/addresses only, skip th
|
|
|
751
749
|
agents devices describe mac-mini "signing + notarize box" # one-line purpose, synced + shown in the list
|
|
752
750
|
agents devices ignored # dismissed nodes — when, and which machine dismissed them
|
|
753
751
|
agents devices config zion interactive.host zion # the device agents show YOU artifacts on (★ in the list)
|
|
754
|
-
agents devices config mac-mini agents.max-concurrent 4 # per-device settings
|
|
755
|
-
agents devices config mac-mini scheduler.enabled off # bare `devices config <name>` opens a settings menu (TTY)
|
|
752
|
+
agents devices config mac-mini agents.max-concurrent 4 # per-device settings; bare `devices config <name>` opens a menu (TTY)
|
|
756
753
|
agents devices config --fleet agents.max-concurrent 2 # fleet-wide default every device inherits
|
|
757
754
|
agents devices config mac-mini notes "runs the releases — don't reboot" # operator notes, repeat to append
|
|
758
755
|
agents ssh mac-mini # hardened SSH: fails fast if offline,
|
|
@@ -762,9 +759,8 @@ agents ssh mac-mini # hardened SSH: fails fast if offline,
|
|
|
762
759
|
scp mac-mini:/abs/log.json /tmp/ # fleet file transfer; host:path or abs local
|
|
763
760
|
scp -r /tmp/src/ yosemite-s0:~/dst/ # ~ and $HOME expand on the REMOTE, never locally
|
|
764
761
|
|
|
765
|
-
# Devices as a task backend
|
|
762
|
+
# Devices as a task backend
|
|
766
763
|
agents cloud run "nightly benchmark" --device gpu-box --agent claude # task in cloud list AND devices ps
|
|
767
|
-
agents routines add nightly -s "0 2 * * *" -a claude -p "run the sweep" --run-on gpu-box
|
|
768
764
|
```
|
|
769
765
|
|
|
770
766
|
`agents devices list` shows normalized load, memory pressure, and an
|
|
@@ -876,7 +872,7 @@ Five managed backends behind one interface (`agents cloud providers`):
|
|
|
876
872
|
| `antigravity` | Gemini managed agents | Antigravity harness in a remote sandbox. |
|
|
877
873
|
| `cursor` | Cursor Cloud Agents | v1 REST API with repo, status, SSE, cancel, and follow-up runs. |
|
|
878
874
|
|
|
879
|
-
Auto-routes each `--agent` to its native cloud, or pin the backend with `--provider`.
|
|
875
|
+
Auto-routes each `--agent` to its native cloud, or pin the backend with `--provider`. `--json` on every subcommand for scripting.
|
|
880
876
|
|
|
881
877
|
The same dispatch is a placement on `agents run`: `agents run claude "fix the flaky e2e" --cloud --repo acme/api` routes through the identical provider registry and tracks in `agents cloud list/status/logs` alike. `--cloud` sits alongside `--device`/`--lease` as one of three placements (local, machine, cloud) and is mutually exclusive with them; `--where cloud[:provider]` is the one-door spelling. Agents without a native cloud fail loud unless `--provider` is given.
|
|
882
878
|
|
|
@@ -1318,53 +1314,10 @@ secrets list # EXPIRING column flags secrets due in the next 30 days
|
|
|
1318
1314
|
|
|
1319
1315
|
---
|
|
1320
1316
|
|
|
1321
|
-
##
|
|
1317
|
+
## Daemon
|
|
1322
1318
|
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
agents routines add daily-digest \
|
|
1326
|
-
--schedule "0 9 * * 1-5" \
|
|
1327
|
-
--agent claude \
|
|
1328
|
-
--project-anchor agents-cli \
|
|
1329
|
-
--cwd cli \
|
|
1330
|
-
--prompt "Review yesterday's PRs and summarize key changes"
|
|
1331
|
-
|
|
1332
|
-
agents routines list # All jobs + next run times
|
|
1333
|
-
agents routines status # Scheduler health + next fires (add --json for owner device, last fire, last error, in-flight run per routine)
|
|
1334
|
-
agents routines run daily-digest # Test it now, ignore the schedule
|
|
1335
|
-
agents routines logs daily-digest # Last execution — status + report (add --full for raw stdout)
|
|
1336
|
-
agents routines runs daily-digest # Every attempt, including blocked/skipped pre-session runs
|
|
1337
|
-
agents routines doctor daily-digest # Project/CWD/trust/write/auth readiness
|
|
1338
|
-
agents routines stats # Run count, failed, missed, avg/p50/p95 duration — per job or all
|
|
1339
|
-
|
|
1340
|
-
# Definitions sync to every device; activation is stored per hostname
|
|
1341
|
-
agents routines add nightly-drain --schedule "0 3 * * *" --agent claude \
|
|
1342
|
-
--cwd '~' \
|
|
1343
|
-
--prompt "Drain the local work queue"
|
|
1344
|
-
|
|
1345
|
-
agents routines devices nightly-drain --set yosemite-s0 # one schedule owner
|
|
1346
|
-
agents routines list --device yosemite-s0 # query another device
|
|
1347
|
-
|
|
1348
|
-
# Event trigger: a Linear issue labeled "agent" fires a routine
|
|
1349
|
-
agents routines add agent-labeled-issue --on linear:Issue --action update \
|
|
1350
|
-
--team-key RUSH --label agent --agent claude \
|
|
1351
|
-
--cwd '~' \
|
|
1352
|
-
--prompt "Work the Linear issue that was just labeled agent"
|
|
1353
|
-
agents routines webhook --source linear --event Issue --file payload.json # fire matches for one payload
|
|
1354
|
-
```
|
|
1355
|
-
|
|
1356
|
-
Jobs run sandboxed -- agents only see directories and tools you explicitly allow.
|
|
1357
|
-
`--project` tags a routine into a project **group** for listings only -- it never
|
|
1358
|
-
decides where the body runs. The reliability contract (execution anchor + `--cwd`,
|
|
1359
|
-
readiness that saves a blocked routine paused, and the `blocked`/`skipped` run
|
|
1360
|
-
statuses) is specified in
|
|
1361
|
-
[docs/specifications.md §Routine execution & readiness](cli/docs/specifications.md#routine-execution--readiness);
|
|
1362
|
-
some of it is planned (RUSH-2290), and the section marks what is landed vs intended.
|
|
1363
|
-
|
|
1364
|
-
### Daemon
|
|
1365
|
-
|
|
1366
|
-
Routines, the watchdog pass, and the session index all run inside one always-on
|
|
1367
|
-
daemon per device. `agents daemon` is its runtime surface:
|
|
1319
|
+
The watchdog pass, the session index, the feed stream, and usage/auth sync all run
|
|
1320
|
+
inside one always-on daemon per device. `agents daemon` is its runtime surface:
|
|
1368
1321
|
|
|
1369
1322
|
```bash
|
|
1370
1323
|
agents daemon # identity + duplicates + per-service health (same as status)
|
|
@@ -1377,12 +1330,11 @@ agents daemon restart # stop then start
|
|
|
1377
1330
|
agents daemon disable # persist daemon.enabled: false -- nothing auto-starts it
|
|
1378
1331
|
agents daemon enable # clear the kill switch
|
|
1379
1332
|
|
|
1380
|
-
agents daemon reload # SIGHUP -- reload
|
|
1381
|
-
agents daemon services # health of every hosted service (
|
|
1333
|
+
agents daemon reload # SIGHUP -- reload service toggles and the log level, no restart
|
|
1334
|
+
agents daemon services # health of every hosted service (watchdog, session-index, ...)
|
|
1382
1335
|
agents daemon services list # every toggleable service and its current on/off state
|
|
1383
|
-
agents daemon services enable
|
|
1336
|
+
agents daemon services enable recordings
|
|
1384
1337
|
agents daemon services disable watchdog # stop the watchdog pass without stopping the daemon
|
|
1385
|
-
agents routines stop # disable/reload only the scheduler service
|
|
1386
1338
|
agents daemon logs -f --level warn --since 1h
|
|
1387
1339
|
agents daemon logs --level error --since 1h # each restart, with what was running when it happened
|
|
1388
1340
|
agents daemon logs level debug # trace every tick and slow section, live; `level info` turns it off
|
|
@@ -1396,7 +1348,7 @@ agents daemon index backfill tools --fleet # one-shot historical parse (also: r
|
|
|
1396
1348
|
`agents daemon index` is foreground maintenance of the index the daemon's
|
|
1397
1349
|
session-index service keeps current; it never starts or restarts the daemon.
|
|
1398
1350
|
|
|
1399
|
-
Each hosted responsibility (
|
|
1351
|
+
Each hosted responsibility (watchdog, recordings, device probe,
|
|
1400
1352
|
self-heal, self-update, account-state refresh, state-dir checks) is an
|
|
1401
1353
|
independent toggle in `~/.agents/daemon/services.yaml`.
|
|
1402
1354
|
Self-update checks npm on its own schedule, installs + verifies a newer
|
|
@@ -1407,16 +1359,15 @@ with auto-update forced off and only picked up new code on a manual
|
|
|
1407
1359
|
`agents daemon services list` shows every service; `enable|disable <id>` flips
|
|
1408
1360
|
one. Missing keys default to enabled except the opt-in `recordings` service. Most services take
|
|
1409
1361
|
effect on the next daemon start; recordings is registered while disabled
|
|
1410
|
-
so `agents recordings watch` can enable it live
|
|
1411
|
-
|
|
1412
|
-
whole process lifecycle. The routines and recordings commands change their own
|
|
1362
|
+
so `agents recordings watch` can enable it live. Only `agents daemon start|stop|restart` owns the
|
|
1363
|
+
whole process lifecycle. The recordings commands change their own
|
|
1413
1364
|
service state without evicting sibling work. Browser IPC is not a daemon service:
|
|
1414
1365
|
the standalone `browser` CLI runs its own (`browser stop --service`).
|
|
1415
1366
|
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
`
|
|
1367
|
+
The CLI has no job scheduler: schedule recurring agent work with OS cron, a
|
|
1368
|
+
systemd timer, or launchd calling `agents run`. `disable` is a device-local kill
|
|
1369
|
+
switch: with it set, `agents feed watch`, `agents watchdog`, and
|
|
1370
|
+
`agents recordings` stop auto-starting the daemon, mirroring
|
|
1420
1371
|
`systemctl disable` -- `agents daemon start` still works as the explicit
|
|
1421
1372
|
override.
|
|
1422
1373
|
|
|
@@ -1513,7 +1464,7 @@ The helper itself is AGI Menu, developed in
|
|
|
1513
1464
|
signed, notarized build on this repo's `menubar/v<x.y.z>` releases; the CLI
|
|
1514
1465
|
downloads and verifies it on demand, so nothing is built on your machine.
|
|
1515
1466
|
|
|
1516
|
-
The dropdown surfaces a **NEEDS YOU** queue (agents waiting on a question, a plan review, or a permission prompt), the running roster
|
|
1467
|
+
The dropdown surfaces a **NEEDS YOU** queue (agents waiting on a question, a plan review, or a permission prompt), and the running roster -- the same live state as `agents ps`, one click away.
|
|
1517
1468
|
|
|
1518
1469
|
### Quick-issue bar (⌘⇧O)
|
|
1519
1470
|
|
|
@@ -1550,7 +1501,7 @@ Extras clone into `~/.agents-<alias>/` and ship the same layout as the primary (
|
|
|
1550
1501
|
|
|
1551
1502
|
## Security & Privacy
|
|
1552
1503
|
|
|
1553
|
-
**The CLI binary has no built-in telemetry or phone-home path.**
|
|
1504
|
+
**The CLI binary has no built-in telemetry or phone-home path.** Everyday commands run locally; explicit features such as cloud dispatch and secrets push/pull send only the data needed for the action you invoke. Here's exactly what `agi-cli` stores locally and why.
|
|
1554
1505
|
|
|
1555
1506
|
### Event log
|
|
1556
1507
|
|
|
@@ -1643,16 +1594,16 @@ Which DotAgents resources each agent CLI can load. Source of truth: [src/lib/age
|
|
|
1643
1594
|
|
|
1644
1595
|
### agi-cli features (not agent-native resources)
|
|
1645
1596
|
|
|
1646
|
-
| Agent |
|
|
1647
|
-
|
|
1648
|
-
| Claude Code | yes | yes |
|
|
1649
|
-
| Codex CLI | yes | yes |
|
|
1650
|
-
| Cursor |
|
|
1651
|
-
| OpenCode |
|
|
1652
|
-
| Grok Build |
|
|
1653
|
-
| Antigravity |
|
|
1654
|
-
| Copilot | -- |
|
|
1655
|
-
| OpenClaw, Amp, Goose | -- | -- |
|
|
1597
|
+
| Agent | Teams | Session index |
|
|
1598
|
+
|-------|-------|---------------|
|
|
1599
|
+
| Claude Code | yes | yes |
|
|
1600
|
+
| Codex CLI | yes | yes |
|
|
1601
|
+
| Cursor | yes | -- |
|
|
1602
|
+
| OpenCode | yes | -- |
|
|
1603
|
+
| Grok Build | yes | yes |
|
|
1604
|
+
| Antigravity | yes | -- |
|
|
1605
|
+
| Copilot | -- | yes |
|
|
1606
|
+
| OpenClaw, Amp, Goose | -- | -- |
|
|
1656
1607
|
|
|
1657
1608
|
### Version-gated sync
|
|
1658
1609
|
|
package/dist/bootstrap.js
CHANGED
|
@@ -403,17 +403,6 @@ function registerExecAliasCommand(p) {
|
|
|
403
403
|
await program.parseAsync(['node', 'agents', ...args]);
|
|
404
404
|
});
|
|
405
405
|
}
|
|
406
|
-
function registerJobsCronAliasCommand(p, alias) {
|
|
407
|
-
p.command(alias, { hidden: true })
|
|
408
|
-
.allowUnknownOption()
|
|
409
|
-
.allowExcessArguments()
|
|
410
|
-
.action(async () => {
|
|
411
|
-
console.log(chalk.yellow(`Deprecated: Use "agents routines" instead of "agents ${alias}"\n`));
|
|
412
|
-
const args = process.argv.slice(2);
|
|
413
|
-
args[0] = 'routines';
|
|
414
|
-
await program.parseAsync(['node', 'agents', ...args]);
|
|
415
|
-
});
|
|
416
|
-
}
|
|
417
406
|
function registerCheckTombstoneCommand(p) {
|
|
418
407
|
p.command('check', { hidden: true })
|
|
419
408
|
.allowUnknownOption()
|
|
@@ -559,12 +548,6 @@ async function registerEagerForRequest(name) {
|
|
|
559
548
|
for (const loader of COMMAND_LOADERS['run'] ?? [])
|
|
560
549
|
await reg(loader);
|
|
561
550
|
return true;
|
|
562
|
-
case 'jobs':
|
|
563
|
-
case 'cron':
|
|
564
|
-
registerJobsCronAliasCommand(program, name);
|
|
565
|
-
for (const loader of COMMAND_LOADERS['routines'] ?? [])
|
|
566
|
-
await reg(loader);
|
|
567
|
-
return true;
|
|
568
551
|
case 'check':
|
|
569
552
|
registerCheckTombstoneCommand(program);
|
|
570
553
|
for (const loader of COMMAND_LOADERS['doctor'] ?? [])
|
|
@@ -19,7 +19,6 @@ const loadWorkflows = async () => (await import('../commands/workflows.js')).reg
|
|
|
19
19
|
export const loadVersions = async () => (await import('../commands/versions.js')).registerVersionsCommands;
|
|
20
20
|
export const loadUpdate = async () => (await import('../commands/update.js')).registerUpdateCommand;
|
|
21
21
|
const loadImport = async () => (await import('../commands/import.js')).registerImportCommand;
|
|
22
|
-
const loadRoutines = async () => (await import('../commands/routines.js')).registerRoutinesCommands;
|
|
23
22
|
const loadProjects = async () => (await import('../commands/projects.js')).registerProjectsCommands;
|
|
24
23
|
export const loadRun = async () => (await import('../commands/exec.js')).registerRunCommand;
|
|
25
24
|
const loadOpen = async () => (await import('../commands/open.js')).registerOpenCommand;
|
|
@@ -79,7 +78,6 @@ export const COMMAND_LOADERS = {
|
|
|
79
78
|
update: [loadUpdate],
|
|
80
79
|
prune: [loadVersions, loadPrune],
|
|
81
80
|
import: [loadImport],
|
|
82
|
-
routines: [loadRoutines],
|
|
83
81
|
projects: [loadProjects],
|
|
84
82
|
run: [loadRun],
|
|
85
83
|
_callback: [loadOpen],
|
package/dist/commands/cloud.js
CHANGED
|
@@ -5,7 +5,6 @@ import { insertTask, updateTaskStatus, getTaskById, listTasks as listStoredTasks
|
|
|
5
5
|
import { renderStream } from '../lib/cloud/stream.js';
|
|
6
6
|
import { MAX_IMAGES_PER_DISPATCH } from '../lib/cloud/types.js';
|
|
7
7
|
import { resolveCloudPrompt, executeCloudDispatch } from '../lib/cloud/dispatch.js';
|
|
8
|
-
import { normalizeTriggerEvent, validateTrigger, writeJob, setJobEnabled, jobExists, GITHUB_TRIGGER_EVENTS } from '../lib/scheduling/routines.js';
|
|
9
8
|
import { emit } from '../lib/feed/events.js';
|
|
10
9
|
import { registerCloudTranscriptsCommand } from './cloud-transcripts.js';
|
|
11
10
|
export function statusColor(status) {
|
|
@@ -87,10 +86,6 @@ Examples:
|
|
|
87
86
|
return acc;
|
|
88
87
|
})
|
|
89
88
|
.option('--branch <name>', 'Target git branch')
|
|
90
|
-
.option('--on <event>', 'Register this run as an event trigger instead of dispatching now: pull_request (pr), push, issue_comment, workflow_run. Persists a trigger-bound routine.')
|
|
91
|
-
.option('--action <name>', 'GitHub webhook action filter for --on triggers (e.g. labeled)')
|
|
92
|
-
.option('--label <name>', 'GitHub label filter for --on triggers')
|
|
93
|
-
.option('--name <name>', 'Routine name to register under (with --on). Defaults to a generated name.')
|
|
94
89
|
.option('-p, --prompt <text>', 'Inline prompt (alternative to positional argument)')
|
|
95
90
|
.option('--timeout <duration>', 'Kill after duration (e.g., 30m, 2h)')
|
|
96
91
|
.option('--model <model>', 'Model override')
|
|
@@ -179,59 +174,6 @@ Examples:
|
|
|
179
174
|
if (options.balanced || options.strategy === 'balanced') {
|
|
180
175
|
dispatchOptions.providerOptions.strategy = 'balanced';
|
|
181
176
|
}
|
|
182
|
-
if (options.on) {
|
|
183
|
-
const event = normalizeTriggerEvent(options.on);
|
|
184
|
-
if (!event) {
|
|
185
|
-
die(`Unknown --on event "${options.on}". Use one of: ${GITHUB_TRIGGER_EVENTS.join(', ')} (aliases: pr, comment, workflow).`, 1, { json });
|
|
186
|
-
}
|
|
187
|
-
const trigger = { type: 'github_event', event: event };
|
|
188
|
-
if (repoValues[0])
|
|
189
|
-
trigger.repo = repoValues[0];
|
|
190
|
-
if (options.branch)
|
|
191
|
-
trigger.branch = options.branch;
|
|
192
|
-
if (options.action)
|
|
193
|
-
trigger.action = options.action;
|
|
194
|
-
if (options.label)
|
|
195
|
-
trigger.label = options.label;
|
|
196
|
-
const triggerErrors = validateTrigger(trigger);
|
|
197
|
-
if (triggerErrors.length > 0)
|
|
198
|
-
die(`Invalid trigger: ${triggerErrors.join(', ')}`, 1, { json });
|
|
199
|
-
dispatchOptions.trigger = trigger;
|
|
200
|
-
const routineName = options.name
|
|
201
|
-
|| `cloud-${event}-${(repoValues[0] || 'any').replace(/[^a-z0-9]+/gi, '-')}`.toLowerCase();
|
|
202
|
-
if (jobExists(routineName)) {
|
|
203
|
-
die(`A routine named "${routineName}" already exists. Pass --name to register under a different name.`, 1, { json });
|
|
204
|
-
}
|
|
205
|
-
const routine = {
|
|
206
|
-
name: routineName,
|
|
207
|
-
trigger,
|
|
208
|
-
agent: options.agent || 'claude',
|
|
209
|
-
mode: 'plan',
|
|
210
|
-
effort: 'auto',
|
|
211
|
-
timeout: options.timeout || '10m',
|
|
212
|
-
enabled: true,
|
|
213
|
-
prompt,
|
|
214
|
-
};
|
|
215
|
-
if (repoValues[0])
|
|
216
|
-
routine.repo = repoValues[0];
|
|
217
|
-
if (options.device) {
|
|
218
|
-
routine.host = options.device;
|
|
219
|
-
if (options.remoteCwd)
|
|
220
|
-
routine.remoteCwd = options.remoteCwd;
|
|
221
|
-
}
|
|
222
|
-
writeJob(routine);
|
|
223
|
-
setJobEnabled(routine.name, true);
|
|
224
|
-
if (json) {
|
|
225
|
-
console.log(JSON.stringify({ ok: true, registered: routineName, trigger }, null, 2));
|
|
226
|
-
}
|
|
227
|
-
else {
|
|
228
|
-
console.log(chalk.green(`Registered trigger routine "${routineName}"`));
|
|
229
|
-
console.log(` ${chalk.dim('on:')} ${event}${trigger.repo ? ` (${trigger.repo}${trigger.branch ? `@${trigger.branch}` : ''})` : ''}`);
|
|
230
|
-
console.log(` ${chalk.dim('agent:')} ${routine.agent}`);
|
|
231
|
-
console.log(chalk.dim(`\nFires when a matching GitHub webhook is delivered to the local receiver. Remote firing is a follow-up.`));
|
|
232
|
-
}
|
|
233
|
-
return;
|
|
234
|
-
}
|
|
235
177
|
await executeCloudDispatch({
|
|
236
178
|
provider,
|
|
237
179
|
dispatchOptions,
|
package/dist/commands/config.js
CHANGED
|
@@ -77,7 +77,6 @@ function parseValue(key, parsed, raw) {
|
|
|
77
77
|
throw new Error(`Config key '${key}' expects an integer, got '${raw}'.`);
|
|
78
78
|
}
|
|
79
79
|
return Number.parseInt(raw.trim(), 10);
|
|
80
|
-
case 'scheduler':
|
|
81
80
|
case 'daemon':
|
|
82
81
|
case 'watchdog':
|
|
83
82
|
case 'tmux':
|
|
@@ -376,9 +375,6 @@ function* listDeviceConfigEntries(device) {
|
|
|
376
375
|
case 'agents.max-concurrent':
|
|
377
376
|
key = `${prefix}max-agents`;
|
|
378
377
|
break;
|
|
379
|
-
case 'scheduler.enabled':
|
|
380
|
-
key = `${prefix}scheduler`;
|
|
381
|
-
break;
|
|
382
378
|
case 'daemon.enabled':
|
|
383
379
|
key = `${prefix}daemon`;
|
|
384
380
|
break;
|
|
@@ -31,7 +31,7 @@ export function registerDaemonIndexCommand(daemonCmd) {
|
|
|
31
31
|
});
|
|
32
32
|
setHelpSections(roots, {
|
|
33
33
|
examples: `
|
|
34
|
-
# Every existing transcript directory
|
|
34
|
+
# Every existing transcript directory
|
|
35
35
|
agents daemon index roots
|
|
36
36
|
`,
|
|
37
37
|
notes: `
|
package/dist/commands/daemon.js
CHANGED
|
@@ -5,12 +5,10 @@ import * as path from 'path';
|
|
|
5
5
|
import { setHelpSections } from '../lib/help.js';
|
|
6
6
|
import { getDaemonStatus, isDaemonRunning, readDaemonLog, startDaemon, stopDaemon, signalDaemonReload, findSurvivingStateDirDaemons, getDaemonLogPath, isDaemonAutostartCircuitOpen, RedirectedHomeDaemonError, } from '../lib/daemon/daemon.js';
|
|
7
7
|
import { listDaemonRunProcesses } from '../lib/daemon/leaked-daemons.js';
|
|
8
|
-
import {
|
|
8
|
+
import { setConfigValue, isDaemonEnabled } from '../lib/device-config.js';
|
|
9
9
|
import { readSubsystemHealth, readAllSubsystemHealth, SUBSYSTEM_DAEMON_START, } from '../lib/daemon-health.js';
|
|
10
10
|
import { DAEMON_SERVICE_IDS, listDaemonServiceStates, setDaemonServiceEnabled, getDaemonServicesConfigPath, queueDaemonServiceRestart, readDaemonLogLevel, writeDaemonLogLevel, } from '../lib/daemon-services.js';
|
|
11
11
|
import { LOG_LEVELS, levelRank, parseLogLevel } from '../lib/daemon/diagnostics.js';
|
|
12
|
-
import { listJobs, getLatestRun } from '../lib/scheduling/routines.js';
|
|
13
|
-
import { JobScheduler } from '../lib/scheduler.js';
|
|
14
12
|
import { followFile } from '../lib/log-follow.js';
|
|
15
13
|
import { parseSince } from '../lib/hooks/cache.js';
|
|
16
14
|
import { registerDaemonIndexCommand } from './daemon-index.js';
|
|
@@ -151,26 +149,6 @@ async function probeSecretsBroker() {
|
|
|
151
149
|
catch { }
|
|
152
150
|
return { reachable: false, fileBacked, socketPath: null, heldBundles: null, record: null };
|
|
153
151
|
}
|
|
154
|
-
function schedulerSummary() {
|
|
155
|
-
const jobs = listJobs();
|
|
156
|
-
const enabled = jobs.filter((j) => j.enabled);
|
|
157
|
-
let nextFire = null;
|
|
158
|
-
try {
|
|
159
|
-
const scheduler = new JobScheduler(async () => { });
|
|
160
|
-
scheduler.loadAll();
|
|
161
|
-
for (const job of scheduler.listScheduled()) {
|
|
162
|
-
if (job.nextRun && (!nextFire || job.nextRun < nextFire))
|
|
163
|
-
nextFire = job.nextRun;
|
|
164
|
-
}
|
|
165
|
-
scheduler.stopAll();
|
|
166
|
-
}
|
|
167
|
-
catch { }
|
|
168
|
-
const failingCount = enabled.filter((j) => {
|
|
169
|
-
const last = getLatestRun(j.name);
|
|
170
|
-
return last?.status === 'failed' || last?.status === 'timeout';
|
|
171
|
-
}).length;
|
|
172
|
-
return { routineCount: jobs.length, enabledCount: enabled.length, nextFire, failingCount };
|
|
173
|
-
}
|
|
174
152
|
function healthLine(label, live, record) {
|
|
175
153
|
if (live) {
|
|
176
154
|
const ok = record?.lastOkAt ? chalk.gray(`(last ok ${record.lastOkAt})`) : '';
|
|
@@ -207,7 +185,6 @@ async function runStatus(opts) {
|
|
|
207
185
|
const stale = staleTiers.visible;
|
|
208
186
|
const ownerEntryGone = owner ? entryIsGone(owner) : false;
|
|
209
187
|
const secrets = await probeSecretsBroker();
|
|
210
|
-
const scheduler = schedulerSummary();
|
|
211
188
|
if (opts.json) {
|
|
212
189
|
console.log(JSON.stringify({
|
|
213
190
|
state,
|
|
@@ -237,13 +214,6 @@ async function runStatus(opts) {
|
|
|
237
214
|
health: secrets.record,
|
|
238
215
|
},
|
|
239
216
|
},
|
|
240
|
-
scheduler: {
|
|
241
|
-
enabled: getConfigValue('scheduler.enabled').value !== false,
|
|
242
|
-
routineCount: scheduler.routineCount,
|
|
243
|
-
enabledCount: scheduler.enabledCount,
|
|
244
|
-
nextFire: scheduler.nextFire ? scheduler.nextFire.toISOString() : null,
|
|
245
|
-
failingCount: scheduler.failingCount,
|
|
246
|
-
},
|
|
247
217
|
}, null, 2));
|
|
248
218
|
return;
|
|
249
219
|
}
|
|
@@ -299,12 +269,6 @@ async function runStatus(opts) {
|
|
|
299
269
|
}
|
|
300
270
|
console.log(chalk.bold('\nHealth\n'));
|
|
301
271
|
console.log(secretsBrokerHealthLine(secrets));
|
|
302
|
-
const schedulerEnabled = getConfigValue('scheduler.enabled').value !== false;
|
|
303
|
-
console.log(` ${schedulerEnabled ? chalk.green('enabled') : chalk.yellow('disabled')} scheduler — ${scheduler.enabledCount}/${scheduler.routineCount} routine(s) enabled` +
|
|
304
|
-
(scheduler.nextFire ? `, next ${scheduler.nextFire.toLocaleString()}` : ''));
|
|
305
|
-
if (scheduler.failingCount > 0) {
|
|
306
|
-
console.log(chalk.red(` ${scheduler.failingCount} routine(s) failing their last run — see: agents routines stats`));
|
|
307
|
-
}
|
|
308
272
|
}
|
|
309
273
|
function buildServiceRows(daemonRunning) {
|
|
310
274
|
const states = listDaemonServiceStates();
|
|
@@ -357,8 +321,7 @@ async function runServices(opts) {
|
|
|
357
321
|
}
|
|
358
322
|
console.log(chalk.bold('\nHosted sockets\n'));
|
|
359
323
|
console.log(secretsBrokerHealthLine(secrets));
|
|
360
|
-
console.log(chalk.gray('\
|
|
361
|
-
console.log(chalk.gray('agents daemon services enable|disable|restart <id> apply live for supervised services.'));
|
|
324
|
+
console.log(chalk.gray('\nagents daemon services enable|disable|restart <id> apply live for supervised services.'));
|
|
362
325
|
}
|
|
363
326
|
function parseLogLines(raw) {
|
|
364
327
|
const out = [];
|
|
@@ -482,10 +445,6 @@ async function runDoctor(opts) {
|
|
|
482
445
|
if (secrets.record && secrets.record.consecutiveFailures > 0) {
|
|
483
446
|
problems.push(`Secrets broker has ${secrets.record.consecutiveFailures} consecutive failure(s): ${secrets.record.lastError}`);
|
|
484
447
|
}
|
|
485
|
-
const scheduler = schedulerSummary();
|
|
486
|
-
if (scheduler.failingCount > 0) {
|
|
487
|
-
problems.push(`${scheduler.failingCount} routine(s) failing their last run. See: agents routines stats`);
|
|
488
|
-
}
|
|
489
448
|
if (opts.json) {
|
|
490
449
|
console.log(JSON.stringify({ healthy: problems.length === 0, problems }));
|
|
491
450
|
if (problems.length > 0)
|
|
@@ -504,7 +463,7 @@ async function runDoctor(opts) {
|
|
|
504
463
|
export function registerDaemonCommand(program) {
|
|
505
464
|
const cmd = program
|
|
506
465
|
.command('daemon')
|
|
507
|
-
.description('The always-on daemon: watchdog, session/usage sync, and
|
|
466
|
+
.description('The always-on daemon: watchdog, session/usage sync, and account health. Bare `agents daemon` shows status.')
|
|
508
467
|
.option('--json', 'Emit as JSON')
|
|
509
468
|
.action(async (opts, command) => {
|
|
510
469
|
await runStatus({ json: command.optsWithGlobals().json === true });
|
|
@@ -526,7 +485,7 @@ export function registerDaemonCommand(program) {
|
|
|
526
485
|
agents daemon disable
|
|
527
486
|
agents daemon enable
|
|
528
487
|
|
|
529
|
-
# Reload config (SIGHUP) without restarting — picks up
|
|
488
|
+
# Reload config (SIGHUP) without restarting — picks up service toggles
|
|
530
489
|
agents daemon reload
|
|
531
490
|
|
|
532
491
|
# Every registered service — state, enabled, failures, last error
|
|
@@ -553,11 +512,8 @@ export function registerDaemonCommand(program) {
|
|
|
553
512
|
agents daemon index backfill tools --fleet
|
|
554
513
|
`,
|
|
555
514
|
notes: `
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
'disable' is a persisted kill switch: it stops routines/add,
|
|
560
|
-
routines/start, and routines/catchup from auto-starting
|
|
515
|
+
'disable' is a persisted kill switch: it stops feed watch,
|
|
516
|
+
watchdog, and recordings from auto-starting
|
|
561
517
|
the daemon (daemon.enabled: false in ~/.agents/devices/<host>/agents.yaml).
|
|
562
518
|
'agents daemon start' still starts it explicitly, same as
|
|
563
519
|
'systemctl start' on a disabled unit.
|
|
@@ -573,8 +529,7 @@ export function registerDaemonCommand(program) {
|
|
|
573
529
|
|
|
574
530
|
'agents daemon services enable|disable|restart <id>' applies live (no
|
|
575
531
|
daemon restart) for supervisor-managed services that were registered at
|
|
576
|
-
boot.
|
|
577
|
-
well. Any other boot-disabled service still needs an operator
|
|
532
|
+
boot. Any other boot-disabled service still needs an operator
|
|
578
533
|
'agents daemon restart'. 'agents
|
|
579
534
|
daemon services' names which case you're in per row.
|
|
580
535
|
`,
|
|
@@ -601,12 +556,12 @@ export function registerDaemonCommand(program) {
|
|
|
601
556
|
});
|
|
602
557
|
cmd.command('stop')
|
|
603
558
|
.description('Stop the daemon.')
|
|
604
|
-
.option('--json', 'Emit the structured stop result (released/surviving resources
|
|
559
|
+
.option('--json', 'Emit the structured stop result (released/surviving resources).')
|
|
605
560
|
.action((_opts, command) => {
|
|
606
561
|
const asJson = command.optsWithGlobals().json === true;
|
|
607
562
|
if (!isDaemonRunning()) {
|
|
608
563
|
if (asJson) {
|
|
609
|
-
console.log(JSON.stringify({ ok: true, stoppedPid: null, escalated: false, released: [], surviving: []
|
|
564
|
+
console.log(JSON.stringify({ ok: true, stoppedPid: null, escalated: false, released: [], surviving: [] }, null, 2));
|
|
610
565
|
}
|
|
611
566
|
else {
|
|
612
567
|
console.log(chalk.yellow('Daemon is not running'));
|
|
@@ -623,9 +578,6 @@ export function registerDaemonCommand(program) {
|
|
|
623
578
|
console.log(chalk.gray(` released: ${r}`));
|
|
624
579
|
for (const s of result.surviving)
|
|
625
580
|
console.log(chalk.red(` surviving: ${s}`));
|
|
626
|
-
if (result.detachedChildren.length > 0) {
|
|
627
|
-
console.log(chalk.gray(` detached routine children left running (adopted on next daemon start): ${result.detachedChildren.join(', ')}`));
|
|
628
|
-
}
|
|
629
581
|
}
|
|
630
582
|
if (!result.ok)
|
|
631
583
|
process.exitCode = 1;
|
|
@@ -649,7 +601,7 @@ export function registerDaemonCommand(program) {
|
|
|
649
601
|
.description('Clear the daemon.enabled kill switch. Does not start the daemon by itself.')
|
|
650
602
|
.action(() => {
|
|
651
603
|
setConfigValue('daemon.enabled', true);
|
|
652
|
-
console.log(chalk.green('daemon.enabled: true') + chalk.gray(' — auto-start surfaces (
|
|
604
|
+
console.log(chalk.green('daemon.enabled: true') + chalk.gray(' — auto-start surfaces (feed watch, watchdog, recordings) may bring the daemon up again'));
|
|
653
605
|
});
|
|
654
606
|
cmd.command('disable')
|
|
655
607
|
.description('Persist daemon.enabled: false — nothing auto-starts the daemon until re-enabled. Does not stop a running daemon.')
|
|
@@ -660,7 +612,7 @@ export function registerDaemonCommand(program) {
|
|
|
660
612
|
console.log(chalk.gray('(the daemon is still running — stop it explicitly if you want it down: agents daemon stop)'));
|
|
661
613
|
});
|
|
662
614
|
cmd.command('reload')
|
|
663
|
-
.description('Send SIGHUP to reload
|
|
615
|
+
.description('Send SIGHUP to reload service toggles and the log level, without a restart.')
|
|
664
616
|
.action(() => {
|
|
665
617
|
if (!isDaemonRunning()) {
|
|
666
618
|
console.log(chalk.yellow('Daemon is not running — nothing to reload. Start it: agents daemon start'));
|
|
@@ -697,8 +649,7 @@ export function registerDaemonCommand(program) {
|
|
|
697
649
|
`,
|
|
698
650
|
notes: `
|
|
699
651
|
A service disabled at daemon boot is normally not registered on the
|
|
700
|
-
supervisor, so enabling it needs an operator restart.
|
|
701
|
-
scheduler applies enable/disable on reload. Each row in
|
|
652
|
+
supervisor, so enabling it needs an operator restart. Each row in
|
|
702
653
|
the plain-text view names which case it is; 'supervised: true/false' does
|
|
703
654
|
the same in --json.
|
|
704
655
|
`,
|
|
@@ -780,7 +731,7 @@ export function registerDaemonCommand(program) {
|
|
|
780
731
|
});
|
|
781
732
|
registerDaemonIndexCommand(cmd);
|
|
782
733
|
const logsCmd = cmd.command('logs')
|
|
783
|
-
.description('Read the daemon\'s own log: lifecycle, every service tick, slow sections, event-loop stalls, and per-minute vitals
|
|
734
|
+
.description('Read the daemon\'s own log: lifecycle, every service tick, slow sections, event-loop stalls, and per-minute vitals.')
|
|
784
735
|
.option('-n, --lines <number>', 'Show this many recent lines', '50')
|
|
785
736
|
.option('-f, --follow', 'Stream new lines as they are written (like tail -f)')
|
|
786
737
|
.option('--level <level>', 'Minimum level to show: debug | info | warn | error')
|
|
@@ -821,7 +772,7 @@ export function registerDaemonCommand(program) {
|
|
|
821
772
|
`,
|
|
822
773
|
});
|
|
823
774
|
cmd.command('doctor')
|
|
824
|
-
.description('One-shot health check: identity, duplicates, hosted services
|
|
775
|
+
.description('One-shot health check: identity, duplicates, hosted services. Non-zero exit on problems.')
|
|
825
776
|
.option('--json', 'Emit as JSON')
|
|
826
777
|
.action(async (opts, command) => {
|
|
827
778
|
await runDoctor({ json: command.optsWithGlobals().json === true });
|
package/dist/commands/doctor.js
CHANGED
|
@@ -16,7 +16,6 @@ import { hostIdentityArgs, sshTargetFor } from '../lib/hosts/types.js';
|
|
|
16
16
|
import { deviceIdentityArgs } from '../lib/devices/connect.js';
|
|
17
17
|
import { resolveDeviceProfile } from '../lib/devices/resolve-profile.js';
|
|
18
18
|
import { machineId, normalizeHost } from '../lib/session/sync/config.js';
|
|
19
|
-
import { findAmbiguousDevicePins } from '../lib/scheduling/routines.js';
|
|
20
19
|
import { findLeakedDaemons } from '../lib/daemon/leaked-daemons.js';
|
|
21
20
|
import chalk from 'chalk';
|
|
22
21
|
import { checkAllClis, collectTeamsDoctorData } from '../lib/teams/agents.js';
|
|
@@ -1186,7 +1185,6 @@ export function registerDoctorCommand(program) {
|
|
|
1186
1185
|
const inventory = await collectLocalFleetInventory(cwd);
|
|
1187
1186
|
const localName = machineId();
|
|
1188
1187
|
const duplicateHooks = inspectDuplicateVersionHooks(cwd);
|
|
1189
|
-
const ambiguousPins = findAmbiguousDevicePins(cwd);
|
|
1190
1188
|
const menubar = process.platform === 'darwin'
|
|
1191
1189
|
? await import('../lib/menubar/install-menubar.js').then((m) => ({
|
|
1192
1190
|
status: m.getMenubarStatus(),
|
|
@@ -1243,7 +1241,6 @@ export function registerDoctorCommand(program) {
|
|
|
1243
1241
|
orphans: orphanRows,
|
|
1244
1242
|
health: computeOverviewHealth(syncRows, orphanRows, repoBehindMarkers, duplicateHooks),
|
|
1245
1243
|
duplicateHooks,
|
|
1246
|
-
ambiguousDevicePins: ambiguousPins,
|
|
1247
1244
|
findings,
|
|
1248
1245
|
fleet: inventory,
|
|
1249
1246
|
hostClis: {
|
|
@@ -1278,15 +1275,6 @@ export function registerDoctorCommand(program) {
|
|
|
1278
1275
|
if (syncRows.some((r) => r.status !== 'fresh' || (r.unwiredHooks ?? 0) > 0) || repoBehindMarkers.some((m) => m.behind > 0)) {
|
|
1279
1276
|
console.log(chalk.gray('\nRun `agents sync status` to review and sync what has drifted.'));
|
|
1280
1277
|
}
|
|
1281
|
-
if (ambiguousPins.length > 0) {
|
|
1282
|
-
console.log();
|
|
1283
|
-
console.log(chalk.yellow(`${ambiguousPins.length} routine(s) pin more than one device — a routine runs on exactly one:`));
|
|
1284
|
-
for (const pin of ambiguousPins) {
|
|
1285
|
-
console.log(` ${chalk.cyan(pin.name)} ${chalk.gray(`[${pin.devices.join(', ')}]`)} ` +
|
|
1286
|
-
`${chalk.gray('→ fires only on')} ${pin.owner}`);
|
|
1287
|
-
console.log(chalk.gray(` fix: agents routines devices ${pin.name} --set <${pin.devices.join('|')}>`));
|
|
1288
|
-
}
|
|
1289
|
-
}
|
|
1290
1278
|
return;
|
|
1291
1279
|
}
|
|
1292
1280
|
const parsed = parseTargetArg(target);
|