@phnx-labs/agents-cli 1.23.38 → 1.23.40
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 +22 -0
- package/README.md +7 -20
- package/dist/cli/command-registry.js +0 -2
- package/dist/commands/config.js +0 -4
- package/dist/commands/daemon.js +5 -5
- package/dist/commands/events.js +1 -1
- package/dist/commands/exec.d.ts +4 -0
- package/dist/commands/exec.js +14 -1
- package/dist/commands/lead.js +4 -3
- package/dist/commands/setup.d.ts +1 -1
- package/dist/commands/setup.js +1 -9
- package/dist/commands/ssh.js +4 -5
- package/dist/lib/accounting/account-pool-collect.d.ts +1 -0
- package/dist/lib/accounting/account-pool-collect.js +13 -7
- package/dist/lib/accounting/account-pool.d.ts +1 -0
- package/dist/lib/accounting/account-pool.js +4 -3
- package/dist/lib/accounting/usage.d.ts +1 -1
- package/dist/lib/answer-router.d.ts +1 -1
- package/dist/lib/answer-router.js +16 -6
- package/dist/lib/channels/providers/session.js +13 -0
- package/dist/lib/channels/registry.d.ts +1 -1
- package/dist/lib/config-keys.d.ts +1 -1
- package/dist/lib/config-keys.js +1 -4
- package/dist/lib/daemon/daemon.js +1 -6
- package/dist/lib/daemon/device-probe-service.js +8 -0
- package/dist/lib/daemon-services.d.ts +1 -1
- package/dist/lib/daemon-services.js +1 -6
- package/dist/lib/device-config.js +2 -11
- package/dist/lib/devices/stats-cache.d.ts +24 -1
- package/dist/lib/devices/stats-cache.js +52 -18
- package/dist/lib/devices/worker-pick.d.ts +1 -1
- package/dist/lib/devices/worker-pick.js +8 -1
- package/dist/lib/feed/answer.js +25 -1
- package/dist/lib/feed/attention.d.ts +8 -0
- package/dist/lib/feed/attention.js +39 -0
- package/dist/lib/feed/tab-delivery.d.ts +27 -0
- package/dist/lib/feed/tab-delivery.js +102 -0
- package/dist/lib/feed/watch.d.ts +3 -0
- package/dist/lib/feed/watch.js +63 -13
- package/dist/lib/hosts/passthrough.js +0 -1
- package/dist/lib/hosts/ready.d.ts +3 -0
- package/dist/lib/hosts/ready.js +41 -1
- package/dist/lib/installations/migrate.d.ts +0 -1
- package/dist/lib/installations/migrate.js +0 -17
- package/dist/lib/lead/drafts.d.ts +11 -0
- package/dist/lib/lead/drafts.js +34 -0
- package/dist/lib/lead/host.d.ts +5 -0
- package/dist/lib/lead/host.js +52 -1
- package/dist/lib/lead/paths.js +1 -1
- package/dist/lib/lead/tools.d.ts +1 -0
- package/dist/lib/lead/tools.js +22 -0
- package/dist/lib/menubar/snapshot.d.ts +0 -6
- package/dist/lib/menubar/snapshot.js +0 -18
- package/dist/lib/session/active.d.ts +2 -1
- package/dist/lib/session/active.js +21 -9
- package/dist/lib/session/hook-sessions.d.ts +10 -0
- package/dist/lib/session/hook-sessions.js +22 -10
- package/dist/lib/session/inject-target.d.ts +1 -0
- package/dist/lib/session/inject-target.js +2 -1
- package/dist/lib/session/pid-registry.d.ts +1 -0
- package/dist/lib/session/remote/watch.d.ts +1 -0
- package/dist/lib/smart-launch.d.ts +5 -1
- package/dist/lib/smart-launch.js +41 -20
- package/dist/lib/startup/command-registry.js +2 -1
- package/dist/lib/state.js +0 -1
- package/dist/lib/teams/placement-probe.d.ts +5 -2
- package/dist/lib/teams/placement-probe.js +119 -57
- package/dist/lib/teams/scheduler.d.ts +1 -0
- package/dist/lib/terminal/index.d.ts +1 -1
- package/dist/lib/terminal/index.js +1 -1
- package/dist/lib/terminal/inject.d.ts +0 -15
- package/dist/lib/terminal/inject.js +2 -16
- package/dist/lib/terminal/resolve.d.ts +2 -1
- package/dist/lib/terminal/resolve.js +13 -18
- package/dist/lib/types.d.ts +0 -3
- package/package.json +1 -1
- package/dist/commands/setup-watchdog.d.ts +0 -3
- package/dist/commands/setup-watchdog.js +0 -49
- package/dist/commands/watchdog.d.ts +0 -4
- package/dist/commands/watchdog.js +0 -361
- package/dist/lib/daemon/watchdog-service.d.ts +0 -10
- package/dist/lib/daemon/watchdog-service.js +0 -27
- package/dist/lib/session/presence.d.ts +0 -47
- package/dist/lib/session/presence.js +0 -100
- package/dist/lib/watchdog/history.d.ts +0 -20
- package/dist/lib/watchdog/history.js +0 -43
- package/dist/lib/watchdog/log.d.ts +0 -33
- package/dist/lib/watchdog/log.js +0 -117
- package/dist/lib/watchdog/read.d.ts +0 -8
- package/dist/lib/watchdog/read.js +0 -93
- package/dist/lib/watchdog/rotate.d.ts +0 -55
- package/dist/lib/watchdog/rotate.js +0 -220
- package/dist/lib/watchdog/runner.d.ts +0 -100
- package/dist/lib/watchdog/runner.js +0 -727
- package/dist/lib/watchdog/service.d.ts +0 -15
- package/dist/lib/watchdog/service.js +0 -36
- package/dist/lib/watchdog/watchdog-agent.d.ts +0 -8
- package/dist/lib/watchdog/watchdog-agent.js +0 -32
- package/dist/lib/watchdog/watchdog.d.ts +0 -43
- package/dist/lib/watchdog/watchdog.js +0 -116
- package/dist/lib/watchdog/watchdogTail.d.ts +0 -6
- package/dist/lib/watchdog/watchdogTail.js +0 -116
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.23.40
|
|
4
|
+
|
|
5
|
+
- **The stall watchdog is gone (PHNX-4439).** `agents watchdog`, `agents setup watchdog`, the
|
|
6
|
+
daemon's `watchdog` service, the `watchdog.enabled` device key and the menubar snapshot's
|
|
7
|
+
`watchdog` block are deleted. It was off by default, typed a generic "Continue." into a stalled
|
|
8
|
+
split, and never confirmed that a VSCodium tab received it. Its replacement is the Stop-hook done
|
|
9
|
+
check, which decides whose move it is, and the project Lead's drafted reply, which you send from the
|
|
10
|
+
card. A leftover `watchdog: false` in `~/.agents/daemon/services.yaml` or `watchdogEnabled` in a
|
|
11
|
+
device's `agents.yaml` is left in place and ignored, and `agents watchdog` is an unknown command
|
|
12
|
+
that never autocorrects to a live one.
|
|
13
|
+
Source: `cli/src/lib/daemon/daemon.ts`, `cli/src/lib/device-config.ts`.
|
|
14
|
+
|
|
15
|
+
- **Asks come from the Stop hook's judge, and replies reach editor tabs with a receipt (PHNX-4439).** A Claude session's card now asks when the Stop hook's model judge says the turn handed the owner something (`turnVerdict` on the row, with the agent's own sentence and choices), and says Not done when it stopped waiting on nothing live. Neither expires on a clock; once the judge has judged a session, the last-line question regex no longer applies to it. `agents feed answer` and `agents send --channel session` hand text for a VSCodium tab, or an agent started from an editor on another machine, to the AGI EXT window that binds it (`delivery` on the row) and report delivered only when the agent takes it (and release the answer for another try when nothing reached it); the `codium --open-url` rail, which could not confirm and missed the 31 of 42 sessions running on other machines, is removed. The project Lead drafts a reply for each new ask in its project (shown on the card as `draft`; Send is the ordinary `agents feed answer`), and `agents lead tool roster --session <id>` gives it a session's last two turns. Source: `cli/src/lib/feed/attention.ts`, `cli/src/lib/feed/tab-delivery.ts`, `cli/src/lib/answer-router.ts`, `cli/src/lib/lead/host.ts`, `cli/src/lib/lead/drafts.ts`.
|
|
16
|
+
|
|
17
|
+
## 1.23.39
|
|
18
|
+
|
|
19
|
+
- **`agents run --device auto` places from a snapshot instead of probing the fleet on every launch.** Each placement probe's load stats and readiness answer are now kept in `~/.agents/.cache/.fleet-stats.json`, and the daemon's `device-probe` tick refreshes them every 3 minutes while placement was used in the last day. A launch uses a device's entry when it is at most 5 minutes old and probes live only the devices whose entry is missing or older (stats and readiness now in parallel). The picked device is confirmed with one `ssh … true` that the dispatch then reuses, and `ensureHostReady` reads the same fresh entry instead of its own `agents view` round trip. On yosemite-s1 a headless `--device auto` launch reached its dispatch ssh in 0.6 to 0.9 s instead of 6.1 s. A pick that no longer answers is marked and the next best is taken; when only the snapshot says no device is ready, placement probes live before refusing. Source: cli/src/lib/teams/placement-probe.ts, cli/src/lib/devices/stats-cache.ts, cli/src/lib/hosts/ready.ts, cli/src/lib/smart-launch.ts, cli/src/lib/daemon/device-probe-service.ts
|
|
20
|
+
- **Picking an account no longer checks every stored credential one at a time.** The run checked whether each registry account's secret was present with one synchronous `secrets` process per account, about 70 ms each on Linux and far more through the macOS keychain. It now checks only the accounts that can serve the harness, all at once. Account selection for `agents run claude --local` went from 1.5 s to 0.2 s on yosemite-s1. The banner for a pick without a recent usage reading now says `usage unverified — no recent usage reading`; nothing was being refreshed. Source: cli/src/lib/accounting/account-pool-collect.ts, cli/src/commands/exec.ts
|
|
21
|
+
- **`agents run` names each slow step as it starts.** On a terminal, stderr shows one dim line before placement (`Placing on the fleet…`), account selection (`Picking an account…`), the harness check (`Starting claude@2.1.261…`) and a remote start (`Starting on yosemite-m5…`). Nothing is printed with `--json`, `--quiet`, or when stderr is not a terminal. Source: cli/src/commands/exec.ts
|
|
22
|
+
|
|
23
|
+
- **The daemon no longer floods a busy Mac with `ps`.** Scans that asked for the process table while a read was still running each started their own `ps -A`. On a loaded machine a `ps -A` takes seconds, so they piled up: zion had 74 running at once from one daemon, with a load average near 40, and every editor, panel and terminal on it slowed down. Callers now share the read in flight, so there is at most one `ps -A` at a time. Source: cli/src/lib/session/active.ts
|
|
24
|
+
|
|
3
25
|
## 1.23.38
|
|
4
26
|
|
|
5
27
|
- **The Lead can say what moved today (PHNX-4432).** Its tools now print dates. `agents lead tool linear tasks` lists the most recently updated tickets first, each with its age, cut to `--limit` and with a count of older ones (`linear tasks --json` sorts by priority and returns every match, so a done list started with tickets from August). `prs list` and the roster add when each PR was updated, and when each session started and was last active. The brief now keeps the merged and closed PRs among the 40 most recently updated, with their age, under "Merged or closed lately". Before this, "what happened in the last 24 hours" got "none of my tools show history". Source: cli/src/lib/lead/tools.ts, cli/src/lib/lead/brief.ts, cli/src/lib/lead/roster.ts
|
package/README.md
CHANGED
|
@@ -56,7 +56,7 @@ agents setup tools # install/upgrade the standalone sessions
|
|
|
56
56
|
agents run claude "explain this repo" # run any agent on your existing subscription
|
|
57
57
|
```
|
|
58
58
|
|
|
59
|
-
Everything here — and every other command in this README — is free and needs no account; the optional `agents auth login` unlocks the hosted surfaces — [team spaces](#sign-in) and owner notifications. `agents setup` is interactive and idempotent -- safe to re-run on any machine. Once core setup exists, it opens a status-aware menu for browser, computer, secrets, term, fleet,
|
|
59
|
+
Everything here — and every other command in this README — is free and needs no account; the optional `agents auth login` unlocks the hosted surfaces — [team spaces](#sign-in) and owner notifications. `agents setup` is interactive and idempotent -- safe to re-run on any machine. Once core setup exists, it opens a status-aware menu for browser, computer, secrets, term, fleet, and device preferences; each choice delegates to the same wizard available under `agents setup <capability>`. In CI or another non-TTY, bare setup prints the checklist without prompting. The `agi-cli.sh` one-liner installs this same canonical `@phnx-labs/agents-cli` package. Prefer bun? `bun install -g @phnx-labs/agents-cli` works too.
|
|
60
60
|
|
|
61
61
|
The command surface teaches setup through `agents setup` and group-level `--help`.
|
|
62
62
|
The durable system model starts at [`cli/docs/README.md`](cli/docs/README.md).
|
|
@@ -495,7 +495,7 @@ Both are agent-agnostic -- they route through the same `agents run <agent> --res
|
|
|
495
495
|
Running agents aren't fire-and-forget. Steer them mid-run without opening their terminals.
|
|
496
496
|
|
|
497
497
|
<p align="center">
|
|
498
|
-
<img src="assets/fleet-control.svg" alt="agents ps infers live state (working, waiting, idle);
|
|
498
|
+
<img src="assets/fleet-control.svg" alt="agents ps infers live state (working, waiting, idle); feed answer replies to an open ask; message reaches a running agent at its next tool call" width="100%" />
|
|
499
499
|
</p>
|
|
500
500
|
|
|
501
501
|
### Message a running agent
|
|
@@ -564,19 +564,6 @@ start, send, stop, linear, remember). It cannot edit files, and a stop runs only
|
|
|
564
564
|
follow-up turn skips the harness boot. `--json` streams the NDJSON events the AGI EXT and bubble
|
|
565
565
|
clients render. Reference: [cli/docs/lead.md](cli/docs/lead.md).
|
|
566
566
|
|
|
567
|
-
### Auto-nudge stalls
|
|
568
|
-
|
|
569
|
-
```bash
|
|
570
|
-
agents watchdog # one tick, dry run — reports what it WOULD nudge and why
|
|
571
|
-
agents watchdog --verbose # include healthy/non-actionable session inspections
|
|
572
|
-
agents watchdog --nudge # actually inject "Continue." into the stalled split
|
|
573
|
-
agents watchdog --watch # daemon loop: a tick every --interval
|
|
574
|
-
```
|
|
575
|
-
|
|
576
|
-
`agents watchdog` detects a stalled session, resolves the *exact* terminal split it lives in (tmux, iTerm, VSCodium, or a raw pty), and injects a nudge -- `Continue.` by default, or set `--text`. Its timestamped default output shows attention-worthy sessions with their agent, host app, machine, project, activity, age, path, latest preview, and decision reason; `--verbose` restores healthy/non-actionable inspections. It's dry by default; `--nudge` acts on a single tick. `agents watchdog enable|disable` controls the device-local daemon pass, which runs once every three minutes. Steer a single run with `agents watchdog policy <id> off | keep | handsoff`.
|
|
577
|
-
|
|
578
|
-
A stalled session whose tail shows a hard account limit ("You've hit your weekly limit · resets …") is **rotated in place** instead of nudged: the watchdog gates on the same healthy-account selection `agents run auto` makes (zero healthy → one skip event per cooldown window, terminal untouched), injects the harness's exit sequence, relaunches `agents run auto --interactive --session-id <uuid>` in the *same* tab, then replays the old session's resume once the new TUI is live. Default on; `agents watchdog rotate off` disables it (nudging stays on).
|
|
579
|
-
|
|
580
567
|
---
|
|
581
568
|
|
|
582
569
|
## Sync the fleet
|
|
@@ -1316,7 +1303,7 @@ secrets list # EXPIRING column flags secrets due in the next 30 days
|
|
|
1316
1303
|
|
|
1317
1304
|
## Daemon
|
|
1318
1305
|
|
|
1319
|
-
The
|
|
1306
|
+
The session index, the feed stream, and usage/auth sync all run
|
|
1320
1307
|
inside one always-on daemon per device. `agents daemon` is its runtime surface:
|
|
1321
1308
|
|
|
1322
1309
|
```bash
|
|
@@ -1331,10 +1318,10 @@ agents daemon disable # persist daemon.enabled: false -- nothing auto-sta
|
|
|
1331
1318
|
agents daemon enable # clear the kill switch
|
|
1332
1319
|
|
|
1333
1320
|
agents daemon reload # SIGHUP -- reload service toggles and the log level, no restart
|
|
1334
|
-
agents daemon services # health of every hosted service (
|
|
1321
|
+
agents daemon services # health of every hosted service (session-index, feed-stream, ...)
|
|
1335
1322
|
agents daemon services list # every toggleable service and its current on/off state
|
|
1336
1323
|
agents daemon services enable recordings
|
|
1337
|
-
agents daemon services disable
|
|
1324
|
+
agents daemon services disable device-probe # stop the device probe without stopping the daemon
|
|
1338
1325
|
agents daemon logs -f --level warn --since 1h
|
|
1339
1326
|
agents daemon logs --level error --since 1h # each restart, with what was running when it happened
|
|
1340
1327
|
agents daemon logs level debug # trace every tick and slow section, live; `level info` turns it off
|
|
@@ -1348,7 +1335,7 @@ agents daemon index backfill tools --fleet # one-shot historical parse (also: r
|
|
|
1348
1335
|
`agents daemon index` is foreground maintenance of the index the daemon's
|
|
1349
1336
|
session-index service keeps current; it never starts or restarts the daemon.
|
|
1350
1337
|
|
|
1351
|
-
Each hosted responsibility (
|
|
1338
|
+
Each hosted responsibility (recordings, device probe,
|
|
1352
1339
|
self-heal, self-update, account-state refresh, state-dir checks) is an
|
|
1353
1340
|
independent toggle in `~/.agents/daemon/services.yaml`.
|
|
1354
1341
|
Self-update checks npm on its own schedule, installs + verifies a newer
|
|
@@ -1366,7 +1353,7 @@ the standalone `browser` CLI runs its own (`browser stop --service`).
|
|
|
1366
1353
|
|
|
1367
1354
|
The CLI has no job scheduler: schedule recurring agent work with OS cron, a
|
|
1368
1355
|
systemd timer, or launchd calling `agents run`. `disable` is a device-local kill
|
|
1369
|
-
switch: with it set, `agents feed watch
|
|
1356
|
+
switch: with it set, `agents feed watch` and
|
|
1370
1357
|
`agents recordings` stop auto-starting the daemon, mirroring
|
|
1371
1358
|
`systemctl disable` -- `agents daemon start` still works as the explicit
|
|
1372
1359
|
override.
|
|
@@ -34,7 +34,6 @@ const loadRefreshRules = async () => (await import('../commands/refresh-rules.js
|
|
|
34
34
|
const loadFactory = async () => (await import('../commands/factory.js')).registerFactoryCommands;
|
|
35
35
|
const loadInsights = async () => (await import('../commands/insights.js')).registerInsightsCommand;
|
|
36
36
|
const loadTrace = async () => (await import('../commands/sessions-trace.js')).registerTraceCommand;
|
|
37
|
-
const loadWatchdog = async () => (await import('../commands/watchdog.js')).registerWatchdogCommand;
|
|
38
37
|
const loadEvents = async () => (await import('../commands/events.js')).registerEventsCommand;
|
|
39
38
|
const loadSsh = async () => (await import('../commands/ssh.js')).registerSshCommands;
|
|
40
39
|
const loadRepo = async () => (await import('../commands/repo.js')).registerRepoCommands;
|
|
@@ -94,7 +93,6 @@ export const COMMAND_LOADERS = {
|
|
|
94
93
|
factory: [loadFactory],
|
|
95
94
|
insights: [loadInsights],
|
|
96
95
|
trace: [loadTrace],
|
|
97
|
-
watchdog: [loadWatchdog],
|
|
98
96
|
events: [loadEvents],
|
|
99
97
|
ssh: [loadSsh],
|
|
100
98
|
devices: [loadSsh],
|
package/dist/commands/config.js
CHANGED
|
@@ -78,7 +78,6 @@ function parseValue(key, parsed, raw) {
|
|
|
78
78
|
}
|
|
79
79
|
return Number.parseInt(raw.trim(), 10);
|
|
80
80
|
case 'daemon':
|
|
81
|
-
case 'watchdog':
|
|
82
81
|
case 'tmux':
|
|
83
82
|
case 'browser.remote-control':
|
|
84
83
|
return parseBool(raw, key);
|
|
@@ -380,9 +379,6 @@ function* listDeviceConfigEntries(device) {
|
|
|
380
379
|
case 'daemon.enabled':
|
|
381
380
|
key = `${prefix}daemon`;
|
|
382
381
|
break;
|
|
383
|
-
case 'watchdog.enabled':
|
|
384
|
-
key = `${prefix}watchdog`;
|
|
385
|
-
break;
|
|
386
382
|
case 'tmux.enabled':
|
|
387
383
|
key = `${prefix}tmux`;
|
|
388
384
|
break;
|
package/dist/commands/daemon.js
CHANGED
|
@@ -463,7 +463,7 @@ async function runDoctor(opts) {
|
|
|
463
463
|
export function registerDaemonCommand(program) {
|
|
464
464
|
const cmd = program
|
|
465
465
|
.command('daemon')
|
|
466
|
-
.description('The always-on daemon:
|
|
466
|
+
.description('The always-on daemon: session index, feed stream, session/usage sync, and account health. Bare `agents daemon` shows status.')
|
|
467
467
|
.option('--json', 'Emit as JSON')
|
|
468
468
|
.action(async (opts, command) => {
|
|
469
469
|
await runStatus({ json: command.optsWithGlobals().json === true });
|
|
@@ -493,7 +493,7 @@ export function registerDaemonCommand(program) {
|
|
|
493
493
|
|
|
494
494
|
# Toggle or restart a service live — applies without a daemon restart
|
|
495
495
|
# for supervisor-managed services (account-state, session-index,
|
|
496
|
-
#
|
|
496
|
+
# device-probe, self-heal, state-dir-check)
|
|
497
497
|
agents daemon services disable account-state
|
|
498
498
|
agents daemon services enable account-state
|
|
499
499
|
agents daemon services restart account-state
|
|
@@ -512,8 +512,8 @@ export function registerDaemonCommand(program) {
|
|
|
512
512
|
agents daemon index backfill tools --fleet
|
|
513
513
|
`,
|
|
514
514
|
notes: `
|
|
515
|
-
'disable' is a persisted kill switch: it stops feed watch
|
|
516
|
-
|
|
515
|
+
'disable' is a persisted kill switch: it stops feed watch
|
|
516
|
+
and recordings from auto-starting
|
|
517
517
|
the daemon (daemon.enabled: false in ~/.agents/devices/<host>/agents.yaml).
|
|
518
518
|
'agents daemon start' still starts it explicitly, same as
|
|
519
519
|
'systemctl start' on a disabled unit.
|
|
@@ -601,7 +601,7 @@ export function registerDaemonCommand(program) {
|
|
|
601
601
|
.description('Clear the daemon.enabled kill switch. Does not start the daemon by itself.')
|
|
602
602
|
.action(() => {
|
|
603
603
|
setConfigValue('daemon.enabled', true);
|
|
604
|
-
console.log(chalk.green('daemon.enabled: true') + chalk.gray(' — auto-start surfaces (feed watch,
|
|
604
|
+
console.log(chalk.green('daemon.enabled: true') + chalk.gray(' — auto-start surfaces (feed watch, recordings) may bring the daemon up again'));
|
|
605
605
|
});
|
|
606
606
|
cmd.command('disable')
|
|
607
607
|
.description('Persist daemon.enabled: false — nothing auto-starts the daemon until re-enabled. Does not stop a running daemon.')
|
package/dist/commands/events.js
CHANGED
|
@@ -145,7 +145,7 @@ export function addEventsReadOptions(command) {
|
|
|
145
145
|
command
|
|
146
146
|
.option('--include <families>', `Only these families (comma-sep): ${EVENT_FAMILIES.join(', ')}`)
|
|
147
147
|
.option('--exclude <families>', `Drop these families (comma-sep): ${EVENT_FAMILIES.join(', ')}`)
|
|
148
|
-
.option('--module <name>', 'Only events from this group (e.g. teams, secrets, activity, daemon,
|
|
148
|
+
.option('--module <name>', 'Only events from this group (e.g. teams, secrets, activity, daemon, browser)')
|
|
149
149
|
.option('--command <path>', 'Only this command path — prefix match (e.g. "teams create")')
|
|
150
150
|
.option('--event <type>', 'Only this typed event (repeatable, e.g. secrets.get, run.dispatched, pr.opened)', collect, [])
|
|
151
151
|
.option('--agent <name>', 'Only events tagged with this agent')
|
package/dist/commands/exec.d.ts
CHANGED
|
@@ -129,6 +129,10 @@ export declare function runAutoDefaultsToAffinity(options: {
|
|
|
129
129
|
local?: boolean;
|
|
130
130
|
}, env?: NodeJS.ProcessEnv): boolean;
|
|
131
131
|
export declare function hostInteractiveNeedsCorrelationId(runAgent: string, hostSessionId: string | undefined, resumeId: string | undefined): boolean;
|
|
132
|
+
export declare function runStageLine(text: string, opts: {
|
|
133
|
+
json?: boolean;
|
|
134
|
+
quiet?: boolean;
|
|
135
|
+
}, stderrIsTty?: boolean): string | null;
|
|
132
136
|
export declare function isInsideGitWorkTree(cwd: string): boolean;
|
|
133
137
|
export declare function gitToplevel(cwd: string): string | null;
|
|
134
138
|
export declare function computeNetMode(opts: {
|
package/dist/commands/exec.js
CHANGED
|
@@ -122,11 +122,19 @@ export function hostInteractiveNeedsCorrelationId(runAgent, hostSessionId, resum
|
|
|
122
122
|
return true;
|
|
123
123
|
return !hostSessionId && isSessionTrackedAgent(runAgent);
|
|
124
124
|
}
|
|
125
|
+
export function runStageLine(text, opts, stderrIsTty = Boolean(process.stderr.isTTY)) {
|
|
126
|
+
return stderrIsTty && !opts.json && !opts.quiet ? chalk.dim(`${text}\n`) : null;
|
|
127
|
+
}
|
|
128
|
+
function writeRunStage(text, opts) {
|
|
129
|
+
const line = runStageLine(text, opts);
|
|
130
|
+
if (line)
|
|
131
|
+
process.stderr.write(line);
|
|
132
|
+
}
|
|
125
133
|
function formatRotationBanner(result, verb = 'balanced') {
|
|
126
134
|
const { picked, healthy, excluded } = result;
|
|
127
135
|
const label = picked.email ? `${picked.email} · ${picked.agent}@${picked.version}` : `${picked.agent}@${picked.version}`;
|
|
128
136
|
const ratio = `${healthy.length} of ${healthy.length + excluded.length} healthy`;
|
|
129
|
-
const caveat = result.usageUnverified ? ', usage unverified — no
|
|
137
|
+
const caveat = result.usageUnverified ? ', usage unverified — no recent usage reading' : '';
|
|
130
138
|
return `[agents] ${verb} picked ${label} (${ratio}${caveat})`;
|
|
131
139
|
}
|
|
132
140
|
export function isInsideGitWorkTree(cwd) {
|
|
@@ -944,6 +952,7 @@ ${formatModeSupportTable().split('\n').map((line) => ` ${line}`).join('\n
|
|
|
944
952
|
const { applyDeviceAutoToOptions } = await import('../lib/smart-launch.js');
|
|
945
953
|
const result = await applyDeviceAutoToOptions(options, {
|
|
946
954
|
accountPickerRequested,
|
|
955
|
+
onPlacing: () => writeRunStage('Placing on the fleet…', options),
|
|
947
956
|
agent: normalizedAgentSpec.split('#')[0].split('@')[0] === RUN_AUTO_KEYWORD
|
|
948
957
|
? undefined
|
|
949
958
|
: (resolveAgentName(normalizedAgentSpec.split('#')[0].split('@')[0]) ?? undefined),
|
|
@@ -1350,6 +1359,7 @@ ${formatModeSupportTable().split('\n').map((line) => ` ${line}`).join('\n
|
|
|
1350
1359
|
process.stderr.write(chalk.gray(started));
|
|
1351
1360
|
}
|
|
1352
1361
|
}
|
|
1362
|
+
writeRunStage(`Starting on ${host.name}…`, options);
|
|
1353
1363
|
const exitCode = await runInteractiveOnHost(host, {
|
|
1354
1364
|
agent: runAgent,
|
|
1355
1365
|
version: resumeId ? undefined : runVersion,
|
|
@@ -1432,6 +1442,7 @@ ${formatModeSupportTable().split('\n').map((line) => ` ${line}`).join('\n
|
|
|
1432
1442
|
if (process.env.AGENTS_DISPATCH_DEBUG || options.verbose) {
|
|
1433
1443
|
process.stderr.write(chalk.gray(`[hosts] dispatch headless ${runAgent}${runVersion ? `@${runVersion}` : ''} -> ${host.name}\n`));
|
|
1434
1444
|
}
|
|
1445
|
+
writeRunStage(`Starting on ${host.name}…`, options);
|
|
1435
1446
|
const { task, exitCode } = await dispatchPromptToHost(host, {
|
|
1436
1447
|
agent: runAgent,
|
|
1437
1448
|
version: resumeId ? undefined : runVersion,
|
|
@@ -2041,6 +2052,7 @@ ${formatModeSupportTable().split('\n').map((line) => ` ${line}`).join('\n
|
|
|
2041
2052
|
else {
|
|
2042
2053
|
try {
|
|
2043
2054
|
const { collectRunCandidatesForRun } = await import('../lib/accounting/account-pool-collect.js');
|
|
2055
|
+
writeRunStage('Picking an account…', options);
|
|
2044
2056
|
bootMark('resolve-version:start');
|
|
2045
2057
|
const routingModel = options.model ?? resolvedResumeSource?.model ?? workflowModel
|
|
2046
2058
|
?? (options.fallback ? undefined : resolveRunDefaults(agent, resolveVersion(agent, cwd), cwd).model);
|
|
@@ -2158,6 +2170,7 @@ ${formatModeSupportTable().split('\n').map((line) => ` ${line}`).join('\n
|
|
|
2158
2170
|
{
|
|
2159
2171
|
const launchTarget = version ?? resolveVersion(agent, cwd) ?? undefined;
|
|
2160
2172
|
if (launchTarget) {
|
|
2173
|
+
writeRunStage(`Starting ${agent}@${launchTarget}…`, options);
|
|
2161
2174
|
const healed = await ensureAgentRunnable(agent, launchTarget, options.quiet ? undefined : (m) => process.stderr.write(chalk.yellow(`[agents] ${m}\n`)));
|
|
2162
2175
|
if (healed === null) {
|
|
2163
2176
|
const { isVersionIsolated } = await import('../lib/installations/versions.js');
|
package/dist/commands/lead.js
CHANGED
|
@@ -9,7 +9,7 @@ import { LeadSpeaker } from '../lib/lead/speak.js';
|
|
|
9
9
|
import { statusFromFiles } from '../lib/lead/host.js';
|
|
10
10
|
import { leadPaths, listLeadProjects } from '../lib/lead/paths.js';
|
|
11
11
|
import { readHistory } from '../lib/lead/store.js';
|
|
12
|
-
import { LINEAR_STATUSES, LeadToolError, MAX_TASKS_LIMIT, PR_VERBS, leadToolContext, parseEditorContext, toolAnswer, toolAttention, toolDispatch, toolLinearCreate, toolLinearTasks, toolLinearView, toolPrAct, toolPrsList, toolRemember, toolRoster, toolSend, toolStart, toolStop, } from '../lib/lead/tools.js';
|
|
12
|
+
import { LINEAR_STATUSES, LeadToolError, MAX_TASKS_LIMIT, PR_VERBS, leadToolContext, parseEditorContext, toolAnswer, toolAttention, toolDispatch, toolLinearCreate, toolLinearTasks, toolLinearView, toolPrAct, toolPrsList, toolRemember, toolRoster, toolRosterSession, toolSend, toolStart, toolStop, } from '../lib/lead/tools.js';
|
|
13
13
|
function toolAction(fn) {
|
|
14
14
|
return async (...args) => {
|
|
15
15
|
try {
|
|
@@ -37,9 +37,10 @@ export function registerLeadToolCommands(lead) {
|
|
|
37
37
|
});
|
|
38
38
|
const strict = (c) => c.allowExcessArguments(false).allowUnknownOption(false);
|
|
39
39
|
strict(tool.command('roster'))
|
|
40
|
-
.description('List live sessions for this project (or --project) from the Lead host\'s live feed')
|
|
40
|
+
.description('List live sessions for this project (or --project) from the Lead host\'s live feed; --session shows one session\'s last two turns')
|
|
41
41
|
.option('--project <name>', 'Another project')
|
|
42
|
-
.
|
|
42
|
+
.option('--session <id>', 'Show this session\'s last two turns of conversation (no tool calls)')
|
|
43
|
+
.action(toolAction(async (opts) => opts.session ? toolRosterSession(leadToolContext(), opts.session) : toolRoster(leadToolContext(), opts.project)));
|
|
43
44
|
strict(tool.command('attention'))
|
|
44
45
|
.description('List every open ask across the fleet from the Lead host\'s live feed: key, session, host, project, age, question, choices')
|
|
45
46
|
.action(toolAction(async () => toolAttention(leadToolContext())));
|
package/dist/commands/setup.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ interface RunSetupOptions {
|
|
|
12
12
|
}
|
|
13
13
|
export declare function runSetup(program: Command, options?: RunSetupOptions): Promise<void>;
|
|
14
14
|
export declare function ensureInitialized(program: Command): Promise<void>;
|
|
15
|
-
type SetupPhase = 'browser' | 'computer' | 'secrets' | 'term' | 'accounts' | 'fleet' | '
|
|
15
|
+
type SetupPhase = 'browser' | 'computer' | 'secrets' | 'term' | 'accounts' | 'fleet' | 'preferences';
|
|
16
16
|
type SetupStatusState = 'ready' | 'missing' | 'n/a';
|
|
17
17
|
interface SetupStatusRow {
|
|
18
18
|
phase: 'core' | SetupPhase;
|
package/dist/commands/setup.js
CHANGED
|
@@ -20,7 +20,6 @@ import { registerSetupToolsCommand } from './setup-tools.js';
|
|
|
20
20
|
import { registerSetupTermCommand, runTermWizard, isTermCliInstalled } from './setup-term.js';
|
|
21
21
|
import { registerSetupFleetCommand } from './setup-fleet.js';
|
|
22
22
|
import { registerSetupAccountsCommand, runAccountsSetupWizard } from './setup-accounts.js';
|
|
23
|
-
import { registerSetupWatchdogCommand, runWatchdogSetupWizard } from './setup-watchdog.js';
|
|
24
23
|
import { registerSetupSessionBackupCommand } from './setup-session-backup.js';
|
|
25
24
|
import { hasMintedSetupToken } from '../lib/auth-mint.js';
|
|
26
25
|
import { registerAliasCommand } from './alias.js';
|
|
@@ -235,7 +234,6 @@ export async function getSetupStatus() {
|
|
|
235
234
|
const secretsReady = fs.existsSync(setupSecretsPrefsPath());
|
|
236
235
|
const termReady = isTermCliInstalled();
|
|
237
236
|
const minted = hasMintedSetupToken();
|
|
238
|
-
const watchdogEnabled = getConfigValue('watchdog.enabled').value === true;
|
|
239
237
|
const interactiveHost = getConfigValue('interactive.host').value;
|
|
240
238
|
const defaultBrowser = getConfigValue('browser.profile').value;
|
|
241
239
|
return [
|
|
@@ -246,7 +244,6 @@ export async function getSetupStatus() {
|
|
|
246
244
|
{ phase: 'term', state: termReady ? 'ready' : 'missing', detail: termReady ? 'installed' : 'not installed (accounts add/login spawn it)' },
|
|
247
245
|
{ phase: 'accounts', state: minted.ready ? 'ready' : 'missing', detail: minted.detail },
|
|
248
246
|
{ phase: 'fleet', state: Object.keys(devices).length ? 'ready' : 'missing', detail: Object.keys(devices).length ? `${Object.keys(devices).length} device${Object.keys(devices).length === 1 ? '' : 's'} registered` : 'no devices registered' },
|
|
249
|
-
{ phase: 'watchdog', state: watchdogEnabled ? 'ready' : 'missing', detail: watchdogEnabled ? 'enabled on this device' : 'disabled on this device' },
|
|
250
247
|
{ phase: 'preferences', state: interactiveHost || defaultBrowser ? 'ready' : 'missing', detail: [interactiveHost && `host ${interactiveHost}`, defaultBrowser && `browser ${defaultBrowser}`].filter(Boolean).join(' · ') || 'interactive host and browser unset' },
|
|
251
248
|
];
|
|
252
249
|
}
|
|
@@ -271,8 +268,6 @@ async function runSetupPhase(phase) {
|
|
|
271
268
|
await runAccountsSetupWizard();
|
|
272
269
|
else if (phase === 'fleet')
|
|
273
270
|
await import('./setup-fleet.js').then((m) => m.runFleetSetupWizard());
|
|
274
|
-
else if (phase === 'watchdog')
|
|
275
|
-
await runWatchdogSetupWizard();
|
|
276
271
|
else
|
|
277
272
|
await runPreferencesStep();
|
|
278
273
|
}
|
|
@@ -332,7 +327,6 @@ export function registerSetupCommand(program) {
|
|
|
332
327
|
registerSetupSecretsCommand(setupCmd);
|
|
333
328
|
registerSetupAccountsCommand(setupCmd);
|
|
334
329
|
registerSetupFleetCommand(setupCmd);
|
|
335
|
-
registerSetupWatchdogCommand(setupCmd);
|
|
336
330
|
registerSetupSessionBackupCommand(setupCmd);
|
|
337
331
|
registerAliasCommand(setupCmd);
|
|
338
332
|
registerBetaCommands(setupCmd);
|
|
@@ -353,7 +347,7 @@ export function registerSetupCommand(program) {
|
|
|
353
347
|
`,
|
|
354
348
|
});
|
|
355
349
|
setupCmd.command('status')
|
|
356
|
-
.description('Show setup readiness for core, browser, computer, secrets, term, accounts, fleet,
|
|
350
|
+
.description('Show setup readiness for core, browser, computer, secrets, term, accounts, fleet, and preferences.')
|
|
357
351
|
.option('--json', 'print machine-readable JSON')
|
|
358
352
|
.option('--tool <name>', 'Read cached standalone tool status: browser, computer, secrets, term, or all')
|
|
359
353
|
.option('--refresh', 'Explicitly refresh only the selected standalone tool health checks')
|
|
@@ -396,7 +390,6 @@ export function registerSetupCommand(program) {
|
|
|
396
390
|
agents setup tools
|
|
397
391
|
agents setup accounts
|
|
398
392
|
agents setup fleet
|
|
399
|
-
agents setup watchdog
|
|
400
393
|
agents setup alias add teams
|
|
401
394
|
agents setup beta enable factory
|
|
402
395
|
`,
|
|
@@ -414,7 +407,6 @@ export function registerSetupCommand(program) {
|
|
|
414
407
|
agents setup term # install the standalone term CLI (PTY engine agents accounts add/login spawn)
|
|
415
408
|
agents setup accounts # mint a Claude setup-token for unattended usage/probe
|
|
416
409
|
agents setup fleet # discover Tailscale devices + configure SSH access
|
|
417
|
-
agents setup watchdog # choose which devices run the daemon watchdog pass
|
|
418
410
|
agents setup alias add teams # PATH shorthand: teams runs agents teams
|
|
419
411
|
agents setup beta enable factory # opt into preview features
|
|
420
412
|
|
package/dist/commands/ssh.js
CHANGED
|
@@ -1240,10 +1240,9 @@ function registerDevicesCommands(program) {
|
|
|
1240
1240
|
examples: `
|
|
1241
1241
|
agents devices config mac-mini # settings menu (TTY) / print config (piped)
|
|
1242
1242
|
agents devices config mac-mini agents.max-concurrent 4 # cap concurrent agents on mac-mini
|
|
1243
|
-
agents devices config mac-mini
|
|
1244
|
-
agents devices config mac-mini
|
|
1245
|
-
agents devices config
|
|
1246
|
-
agents devices config --fleet watchdog.enabled on # fleet-wide default (all devices)
|
|
1243
|
+
agents devices config mac-mini auto-launch.enabled # read the effective value back
|
|
1244
|
+
agents devices config mac-mini auto-launch.enabled --unset # inherit the fleet default again
|
|
1245
|
+
agents devices config --fleet auto-launch.enabled off # fleet-wide default (all devices)
|
|
1247
1246
|
agents devices config --fleet agents.max-concurrent 2 # every box caps at 2 unless it overrides
|
|
1248
1247
|
agents devices config --fleet # print the fleet defaults layer
|
|
1249
1248
|
agents devices config mac-mini notes "runs the releases" # append an operator note
|
|
@@ -1261,7 +1260,7 @@ function registerDevicesCommands(program) {
|
|
|
1261
1260
|
description (one line saying what the box is for — see
|
|
1262
1261
|
'agents devices describe'; renders in the devices list tail),
|
|
1263
1262
|
agents.max-concurrent, daemon.enabled,
|
|
1264
|
-
|
|
1263
|
+
tmux.enabled, browser.remote-control,
|
|
1265
1264
|
browser.task-idle-minutes, browser.profile,
|
|
1266
1265
|
notes, ssh.user, ssh.auth (key|password), ssh.bundle, ssh.bundle-key,
|
|
1267
1266
|
ssh.identity-file, platform (windows|linux|macos|unknown),
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { AgentId } from '../types.js';
|
|
2
2
|
import { type RotateCandidate } from './rotate.js';
|
|
3
3
|
import { type RegistryAccountRecord } from './account-pool.js';
|
|
4
|
+
export declare function localRegistryRecords(agent: AgentId, includeKeyed?: boolean): Promise<RegistryAccountRecord[]>;
|
|
4
5
|
export interface RunCandidateInputs {
|
|
5
6
|
native: RotateCandidate[];
|
|
6
7
|
records: RegistryAccountRecord[];
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { readAccountRegistry } from '../account-registry.js';
|
|
2
|
-
import {
|
|
2
|
+
import { hasKeychainToken, isSecretsTransportError } from '../secrets-client.js';
|
|
3
3
|
import { getGlobalDefault, listInstalledVersions } from '../installations/versions.js';
|
|
4
4
|
import { collectRunCandidates } from './rotate.js';
|
|
5
|
-
import { registryPoolCandidates } from './account-pool.js';
|
|
6
|
-
function localRegistryRecords() {
|
|
5
|
+
import { registryAccountServesHarness, registryPoolCandidates } from './account-pool.js';
|
|
6
|
+
export async function localRegistryRecords(agent, includeKeyed = false) {
|
|
7
7
|
try {
|
|
8
|
-
|
|
9
|
-
.filter((a) =>
|
|
8
|
+
const accounts = Object.values(readAccountRegistry().accounts)
|
|
9
|
+
.filter((a) => registryAccountServesHarness(a, agent, includeKeyed));
|
|
10
|
+
const present = await Promise.all(accounts.map((a) => hasKeychainToken(a.secretRef)));
|
|
11
|
+
return accounts
|
|
12
|
+
.filter((_, i) => present[i])
|
|
10
13
|
.map((a) => ({ id: a.id, name: a.name, provider: a.provider, auth: a.auth, secretPresent: true }));
|
|
11
14
|
}
|
|
12
15
|
catch (err) {
|
|
@@ -43,7 +46,10 @@ export function foldRegistryCandidates(agent, inputs, includeKeyed = false) {
|
|
|
43
46
|
return [...native, ...extra];
|
|
44
47
|
}
|
|
45
48
|
export async function collectRunCandidatesForRun(agent, includeKeyed = false) {
|
|
46
|
-
const native = await collectRunCandidates(agent);
|
|
47
49
|
const runVersion = getGlobalDefault(agent) ?? listInstalledVersions(agent)[0];
|
|
48
|
-
|
|
50
|
+
const [native, records] = await Promise.all([
|
|
51
|
+
collectRunCandidates(agent),
|
|
52
|
+
runVersion ? localRegistryRecords(agent, includeKeyed) : Promise.resolve([]),
|
|
53
|
+
]);
|
|
54
|
+
return foldRegistryCandidates(agent, { native, records, runVersion }, includeKeyed);
|
|
49
55
|
}
|
|
@@ -16,5 +16,6 @@ interface RegistryAccountInput {
|
|
|
16
16
|
auth: AccountAuthKind;
|
|
17
17
|
secretPresent: boolean;
|
|
18
18
|
}
|
|
19
|
+
export declare function registryAccountServesHarness(record: Pick<RegistryAccountRecord, 'provider' | 'auth'>, agent: AgentId, includeKeyed?: boolean): boolean;
|
|
19
20
|
export declare function registryPoolCandidates(records: RegistryAccountRecord[], agent: AgentId, includeKeyed?: boolean): RegistryAccountInput[];
|
|
20
21
|
export {};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { providerAuthenticatesHarness } from '../account-provider-registry.js';
|
|
2
|
+
export function registryAccountServesHarness(record, agent, includeKeyed = false) {
|
|
3
|
+
return (record.auth === 'setup-token' || includeKeyed) && providerAuthenticatesHarness(record.provider, record.auth, agent);
|
|
4
|
+
}
|
|
2
5
|
export function registryPoolCandidates(records, agent, includeKeyed = false) {
|
|
3
6
|
const out = [];
|
|
4
7
|
for (const r of records) {
|
|
5
|
-
if (r
|
|
6
|
-
continue;
|
|
7
|
-
if (!providerAuthenticatesHarness(r.provider, r.auth, agent))
|
|
8
|
+
if (!registryAccountServesHarness(r, agent, includeKeyed))
|
|
8
9
|
continue;
|
|
9
10
|
out.push({
|
|
10
11
|
id: r.id,
|
|
@@ -85,7 +85,7 @@ interface UsageOptions {
|
|
|
85
85
|
* `user:profile`, which `/api/oauth/usage` requires). OFF by default and set
|
|
86
86
|
* ONLY by a foreground human `agents view` on a headed device (personal or
|
|
87
87
|
* desktop; see USAGE-READ-2). Every background caller — daemon usage warm, auth-health
|
|
88
|
-
* probe
|
|
88
|
+
* probe — leaves it unset, preserving the RUSH-1822 guarantee that
|
|
89
89
|
* an unattended loop never transmits the interactive login to Anthropic.
|
|
90
90
|
*/
|
|
91
91
|
allowInteractiveLogin?: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type OpenBlock, type BlockOption } from './feed/feed.js';
|
|
2
2
|
import type { ActiveSession } from './session/active.js';
|
|
3
3
|
import type { InjectTarget } from './terminal/index.js';
|
|
4
|
-
export type AnswerRouteKind = 'mailbox' | 'tmux' | 'iterm' | '
|
|
4
|
+
export type AnswerRouteKind = 'mailbox' | 'tmux' | 'iterm' | 'tab' | 'resume' | 'refuse';
|
|
5
5
|
export interface AnswerRoute {
|
|
6
6
|
kind: AnswerRouteKind;
|
|
7
7
|
reason: string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { deriveBlockState } from './feed/feed.js';
|
|
2
|
-
import { addressabilityRecoveryHint, resolveInjectTargetForSession } from './terminal/resolve.js';
|
|
2
|
+
import { addressabilityRecoveryHint, resolveInjectTargetForSession, typedByEditorTab } from './terminal/resolve.js';
|
|
3
3
|
import { injectTargetFromReplyRail } from './session/inject.js';
|
|
4
|
+
import { currentTurnVerdict } from './feed/attention.js';
|
|
4
5
|
const ESCAPE_KEY = '\u001b';
|
|
5
6
|
export function matchOptionIndex(answer, options) {
|
|
6
7
|
if (!options?.length)
|
|
@@ -44,7 +45,8 @@ export function isParkedOnInput(session) {
|
|
|
44
45
|
if (session.awaitingReason === 'question' || session.awaitingReason === 'plan_review' || session.awaitingReason === 'permission') {
|
|
45
46
|
return true;
|
|
46
47
|
}
|
|
47
|
-
|
|
48
|
+
const turn = currentTurnVerdict(session);
|
|
49
|
+
return turn?.kind === 'asks' || turn?.kind === 'not_done';
|
|
48
50
|
}
|
|
49
51
|
export function isOpenQuestionBlock(block) {
|
|
50
52
|
if (!block)
|
|
@@ -72,9 +74,7 @@ export function resolveAnswerRoute(input) {
|
|
|
72
74
|
const inject = injectTargetForSession(session);
|
|
73
75
|
const { payload, matched, enter } = keystrokesForAnswer(answer, options);
|
|
74
76
|
if (inject) {
|
|
75
|
-
const kind = inject.backend === 'iterm' ? 'iterm'
|
|
76
|
-
: inject.backend === 'vscodium' ? 'vscodium'
|
|
77
|
-
: 'tmux';
|
|
77
|
+
const kind = inject.backend === 'iterm' ? 'iterm' : 'tmux';
|
|
78
78
|
return {
|
|
79
79
|
kind,
|
|
80
80
|
reason: `Parked on open question — drive ${inject.backend} selection (${matched}).`,
|
|
@@ -83,6 +83,14 @@ export function resolveAnswerRoute(input) {
|
|
|
83
83
|
...(enter === false ? { enter: false } : {}),
|
|
84
84
|
};
|
|
85
85
|
}
|
|
86
|
+
const tab = {
|
|
87
|
+
kind: 'tab',
|
|
88
|
+
reason: 'Parked in an editor tab (or a terminal this machine cannot address) — the AGI EXT window that binds the session types it.',
|
|
89
|
+
payload,
|
|
90
|
+
...(enter === false ? { enter: false } : {}),
|
|
91
|
+
};
|
|
92
|
+
if (session.host && typedByEditorTab(session))
|
|
93
|
+
return tab;
|
|
86
94
|
if (session.context === 'headless' || session.context === 'teams' || !session.tty) {
|
|
87
95
|
const sid = session.sessionId ?? input.mailboxId;
|
|
88
96
|
if (!sid) {
|
|
@@ -98,9 +106,11 @@ export function resolveAnswerRoute(input) {
|
|
|
98
106
|
resume: { sessionId: sid, agent: session.kind },
|
|
99
107
|
};
|
|
100
108
|
}
|
|
109
|
+
if (typedByEditorTab(session))
|
|
110
|
+
return tab;
|
|
101
111
|
return {
|
|
102
112
|
kind: 'refuse',
|
|
103
|
-
reason: 'Agent is parked on a question but has no addressable terminal (no tmux, iTerm or
|
|
113
|
+
reason: 'Agent is parked on a question but has no addressable terminal (no tmux, iTerm or editor tab). ' +
|
|
104
114
|
addressabilityRecoveryHint(session),
|
|
105
115
|
};
|
|
106
116
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { injectIntoTerminal } from '../../terminal/index.js';
|
|
2
2
|
import { resolveLiveInjectTarget } from '../../session/inject-target.js';
|
|
3
|
+
import { deliverToTab } from '../../feed/tab-delivery.js';
|
|
4
|
+
import { typedByEditorTab } from '../../terminal/resolve.js';
|
|
3
5
|
export const SESSION_CHANNEL = 'session';
|
|
4
6
|
export const sessionProvider = {
|
|
5
7
|
name: SESSION_CHANNEL,
|
|
@@ -19,6 +21,17 @@ export const sessionProvider = {
|
|
|
19
21
|
}
|
|
20
22
|
else {
|
|
21
23
|
const resolved = await resolveLiveInjectTarget(id);
|
|
24
|
+
const sessionId = resolved.session?.sessionId;
|
|
25
|
+
if (sessionId && !resolved.target && resolved.session && typedByEditorTab(resolved.session)) {
|
|
26
|
+
if (opts.dryRun)
|
|
27
|
+
return { ok: true, channel: SESSION_CHANNEL, id, backend: 'tab', writes: 0, confirmed: false };
|
|
28
|
+
const res = await deliverToTab({
|
|
29
|
+
sessionId, text, enter: terminal.enter !== false, transcript: resolved.session?.sessionFile,
|
|
30
|
+
});
|
|
31
|
+
return res.delivered
|
|
32
|
+
? { ok: true, channel: SESSION_CHANNEL, id, backend: 'tab', writes: 1, confirmed: true }
|
|
33
|
+
: { ...fail(res.reason), backend: 'tab', writes: res.touched ? 1 : 0, confirmed: false };
|
|
34
|
+
}
|
|
22
35
|
if (!resolved.target) {
|
|
23
36
|
return fail(resolved.hint ? `${resolved.reason}\n${resolved.hint}` : resolved.reason ?? 'session not addressable');
|
|
24
37
|
}
|
|
@@ -53,7 +53,7 @@ export interface ParsedMenubarConfigKey {
|
|
|
53
53
|
property: string;
|
|
54
54
|
}
|
|
55
55
|
export type ParsedConfigKey = ParsedRunConfigKey | ParsedInteractiveConfigKey | ParsedAutoConfigKey | ParsedBrowserConfigKey | ParsedProjectConfigKey | ParsedDeviceConfigKey | ParsedSummarizerConfigKey | ParsedUpdatesConfigKey | ParsedMenubarConfigKey | ParsedLeadConfigKey;
|
|
56
|
-
export type DeviceConfigProperty = 'role' | 'max-agents' | 'daemon' | '
|
|
56
|
+
export type DeviceConfigProperty = 'role' | 'max-agents' | 'daemon' | 'tmux' | 'browser.remote-control' | 'browser.task-idle-minutes' | 'notes' | 'browser.profile' | 'browser.viewer' | 'formFactor';
|
|
57
57
|
export declare function formatAgentVersion(agent: AgentId, version: string): string;
|
|
58
58
|
export declare function parseConfigKey(key: string): ParsedConfigKey;
|
|
59
59
|
export declare function formatConfigKey(parsed: ParsedConfigKey): string;
|
package/dist/lib/config-keys.js
CHANGED
|
@@ -54,7 +54,6 @@ const DEVICE_CONFIG_PROPERTIES = [
|
|
|
54
54
|
'role',
|
|
55
55
|
'max-agents',
|
|
56
56
|
'daemon',
|
|
57
|
-
'watchdog',
|
|
58
57
|
'tmux',
|
|
59
58
|
'browser.remote-control',
|
|
60
59
|
'browser.task-idle-minutes',
|
|
@@ -139,7 +138,7 @@ export function parseConfigKey(key) {
|
|
|
139
138
|
}
|
|
140
139
|
return { scope: 'updates', agent: agentPart, property: 'auto' };
|
|
141
140
|
}
|
|
142
|
-
const deviceMatch = raw.match(/^devices\.(.+)\.(role|max-agents|daemon|
|
|
141
|
+
const deviceMatch = raw.match(/^devices\.(.+)\.(role|max-agents|daemon|tmux|notes|formFactor|browser\.remote-control|browser\.task-idle-minutes|browser\.profile|browser\.viewer|computer\.host)$/);
|
|
143
142
|
if (deviceMatch) {
|
|
144
143
|
return {
|
|
145
144
|
scope: 'device',
|
|
@@ -229,8 +228,6 @@ export function devicePropertyToConfigName(property) {
|
|
|
229
228
|
return 'agents.max-concurrent';
|
|
230
229
|
case 'daemon':
|
|
231
230
|
return 'daemon.enabled';
|
|
232
|
-
case 'watchdog':
|
|
233
|
-
return 'watchdog.enabled';
|
|
234
231
|
case 'tmux':
|
|
235
232
|
return 'tmux.enabled';
|
|
236
233
|
case 'browser.remote-control':
|