@phnx-labs/agents-cli 1.22.39 → 1.22.41
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 +316 -0
- package/README.md +116 -70
- package/dist/bin/agents +0 -0
- package/dist/bootstrap.js +45 -27
- package/dist/browser.js +2 -2
- package/dist/cli/command-registry.d.ts +135 -0
- package/dist/cli/command-registry.js +259 -0
- package/dist/commands/accounts.d.ts +20 -0
- package/dist/commands/accounts.js +186 -25
- package/dist/commands/apply.d.ts +3 -3
- package/dist/commands/apply.js +20 -63
- package/dist/commands/browser.d.ts +15 -0
- package/dist/commands/browser.js +318 -131
- package/dist/commands/budget.d.ts +7 -6
- package/dist/commands/budget.js +8 -7
- package/dist/commands/cloud.js +17 -20
- package/dist/commands/commands.js +1 -1
- package/dist/commands/computer-actions.d.ts +1 -35
- package/dist/commands/computer-actions.js +13 -181
- package/dist/commands/computer.d.ts +28 -3
- package/dist/commands/computer.js +93 -65
- package/dist/commands/config.js +16 -3
- package/dist/commands/cost.d.ts +2 -1
- package/dist/commands/cost.js +7 -6
- package/dist/commands/daemon.js +151 -4
- package/dist/commands/detach.js +1 -1
- package/dist/commands/doctor.js +19 -11
- package/dist/commands/events.js +1 -1
- package/dist/commands/exec.d.ts +2 -50
- package/dist/commands/exec.js +160 -215
- package/dist/commands/factory.js +1 -1
- package/dist/commands/feed.d.ts +2 -2
- package/dist/commands/feed.js +12 -23
- package/dist/commands/fleet-capture.js +25 -27
- package/dist/commands/focus.d.ts +2 -3
- package/dist/commands/focus.js +34 -9
- package/dist/commands/go.js +15 -5
- package/dist/commands/harness.d.ts +3 -3
- package/dist/commands/harness.js +53 -5
- package/dist/commands/hooks.js +1 -1
- package/dist/commands/import.js +2 -2
- package/dist/commands/insights.d.ts +5 -5
- package/dist/commands/insights.js +15 -9
- package/dist/commands/inspect.d.ts +2 -3
- package/dist/commands/inspect.js +4 -16
- package/dist/commands/logs.d.ts +2 -2
- package/dist/commands/logs.js +9 -9
- package/dist/commands/mcp.js +2 -2
- package/dist/commands/memory.js +1 -1
- package/dist/commands/message.d.ts +1 -1
- package/dist/commands/message.js +7 -7
- package/dist/commands/mine.d.ts +11 -8
- package/dist/commands/mine.js +11 -10
- package/dist/commands/models.js +1 -1
- package/dist/commands/modes.js +1 -1
- package/dist/commands/monitors.js +23 -6
- package/dist/commands/output.d.ts +7 -6
- package/dist/commands/output.js +11 -10
- package/dist/commands/packages.js +4 -4
- package/dist/commands/perf.js +1 -1
- package/dist/commands/permissions.js +49 -32
- package/dist/commands/plugins.d.ts +1 -1
- package/dist/commands/plugins.js +3 -3
- package/dist/commands/profiles.d.ts +6 -9
- package/dist/commands/profiles.js +8 -321
- package/dist/commands/projects.d.ts +9 -0
- package/dist/commands/projects.js +140 -8
- package/dist/commands/prune.js +5 -13
- package/dist/commands/refresh-rules.js +1 -1
- package/dist/commands/repo.d.ts +5 -7
- package/dist/commands/repo.js +34 -18
- package/dist/commands/resource-view.js +4 -0
- package/dist/commands/resume.d.ts +11 -7
- package/dist/commands/resume.js +82 -98
- package/dist/commands/route.d.ts +12 -0
- package/dist/commands/route.js +261 -0
- package/dist/commands/routines.d.ts +2 -3
- package/dist/commands/routines.js +120 -145
- package/dist/commands/rules.js +1 -1
- package/dist/commands/run-account-picker.d.ts +1 -1
- package/dist/commands/run-account-picker.js +2 -2
- package/dist/commands/run-broadcast.d.ts +21 -0
- package/dist/commands/run-broadcast.js +89 -0
- package/dist/commands/run-cloud.js +1 -1
- package/dist/commands/secrets-vault.d.ts +10 -0
- package/dist/commands/{login.js → secrets-vault.js} +34 -14
- package/dist/commands/secrets.d.ts +4 -4
- package/dist/commands/secrets.js +158 -159
- package/dist/commands/sessions-backfill.js +1 -1
- package/dist/commands/sessions-browser.d.ts +1 -1
- package/dist/commands/sessions-browser.js +9 -5
- package/dist/commands/sessions-export.js +2 -2
- package/dist/commands/sessions-inject.js +4 -5
- package/dist/commands/sessions-migrate.js +16 -27
- package/dist/commands/sessions-picker.d.ts +14 -0
- package/dist/commands/sessions-picker.js +209 -13
- package/dist/commands/sessions-resume.d.ts +7 -3
- package/dist/commands/sessions-resume.js +81 -33
- package/dist/commands/sessions-share.d.ts +25 -0
- package/dist/commands/sessions-share.js +166 -0
- package/dist/commands/sessions-stats.js +2 -2
- package/dist/commands/sessions.d.ts +75 -68
- package/dist/commands/sessions.js +144 -180
- package/dist/commands/setup-browser.js +1 -1
- package/dist/commands/setup-computer.js +1 -1
- package/dist/commands/setup-fleet.js +3 -0
- package/dist/commands/setup-mine.d.ts +7 -3
- package/dist/commands/setup-mine.js +13 -8
- package/dist/commands/setup-preferences.js +2 -2
- package/dist/commands/setup-secrets.js +2 -2
- package/dist/commands/setup-watchdog.js +2 -2
- package/dist/commands/setup.js +7 -2
- package/dist/commands/share.d.ts +65 -0
- package/dist/commands/share.js +253 -20
- package/dist/commands/skills.js +3 -3
- package/dist/commands/snapshot.d.ts +2 -2
- package/dist/commands/snapshot.js +9 -9
- package/dist/commands/ssh.d.ts +1 -1
- package/dist/commands/ssh.js +186 -64
- package/dist/commands/subagents.js +1 -1
- package/dist/commands/sync.js +24 -9
- package/dist/commands/teams.d.ts +2 -2
- package/dist/commands/teams.js +9 -18
- package/dist/commands/tmux.js +5 -1
- package/dist/commands/trash.js +1 -1
- package/dist/commands/usage.d.ts +1 -1
- package/dist/commands/usage.js +2 -2
- package/dist/commands/utils.d.ts +4 -14
- package/dist/commands/utils.js +6 -27
- package/dist/commands/versions.js +2 -2
- package/dist/commands/view.d.ts +9 -77
- package/dist/commands/view.js +23 -8
- package/dist/commands/watchdog.js +1 -1
- package/dist/commands/webhook.js +25 -34
- package/dist/commands/workflows.js +1 -1
- package/dist/index.js +1 -1
- package/dist/lib/account-capabilities.d.ts +39 -0
- package/dist/lib/account-capabilities.js +59 -0
- package/dist/lib/account-catalog.js +1 -1
- package/dist/lib/account-registry.d.ts +66 -0
- package/dist/lib/account-registry.js +151 -5
- package/dist/lib/{rotate.d.ts → accounting/rotate.d.ts} +4 -4
- package/dist/lib/{rotate.js → accounting/rotate.js} +8 -8
- package/dist/lib/{usage.d.ts → accounting/usage.d.ts} +4 -4
- package/dist/lib/{usage.js → accounting/usage.js} +11 -11
- package/dist/lib/agent-spec/provider.js +1 -1
- package/dist/lib/agents.d.ts +72 -4
- package/dist/lib/agents.js +231 -199
- package/dist/lib/answer-router.d.ts +2 -2
- package/dist/lib/ask-classifier.d.ts +1 -1
- package/dist/lib/ask-classifier.js +1 -1
- package/dist/lib/audit/log.js +1 -1
- package/dist/lib/auth-health.d.ts +1 -1
- package/dist/lib/auth-health.js +2 -2
- package/dist/lib/brand.js +1 -1
- package/dist/lib/browser/caller-identity.d.ts +28 -0
- package/dist/lib/browser/caller-identity.js +156 -0
- package/dist/lib/browser/cdp.js +5 -1
- package/dist/lib/browser/chrome.js +12 -1
- package/dist/lib/browser/drivers/ssh.d.ts +1 -1
- package/dist/lib/browser/drivers/ssh.js +3 -2
- package/dist/lib/browser/hygiene.d.ts +10 -2
- package/dist/lib/browser/hygiene.js +7 -4
- package/dist/lib/browser/ipc.d.ts +22 -2
- package/dist/lib/browser/ipc.js +185 -21
- package/dist/lib/browser/profiles.d.ts +69 -5
- package/dist/lib/browser/profiles.js +135 -13
- package/dist/lib/browser/remote-control.d.ts +2 -2
- package/dist/lib/browser/remote-control.js +3 -3
- package/dist/lib/browser/runtime-state.d.ts +79 -0
- package/dist/lib/browser/runtime-state.js +119 -1
- package/dist/lib/browser/service.d.ts +137 -2
- package/dist/lib/browser/service.js +492 -54
- package/dist/lib/browser/sessions-list.d.ts +2 -1
- package/dist/lib/browser/sessions-list.js +4 -13
- package/dist/lib/browser/types.d.ts +19 -1
- package/dist/lib/budget/config.js +1 -1
- package/dist/lib/budget/ledger.js +1 -1
- package/dist/lib/byok-usage.js +1 -1
- package/dist/lib/capabilities.js +3 -15
- package/dist/lib/catchup.d.ts +1 -1
- package/dist/lib/catchup.js +1 -1
- package/dist/lib/cloud/dispatch.js +1 -1
- package/dist/lib/cloud/host.d.ts +3 -3
- package/dist/lib/cloud/host.js +5 -5
- package/dist/lib/cloud/rush.d.ts +9 -21
- package/dist/lib/cloud/rush.js +33 -120
- package/dist/lib/cloud/types.d.ts +2 -2
- package/dist/lib/commands.js +3 -13
- package/dist/lib/computer/actions.d.ts +36 -0
- package/dist/lib/computer/actions.js +162 -0
- package/dist/lib/computer/dispatch.d.ts +2 -2
- package/dist/lib/computer/dispatch.js +2 -2
- package/dist/lib/computer/sessions-list.d.ts +3 -3
- package/dist/lib/computer/sessions-list.js +2 -2
- package/dist/lib/config-keys.d.ts +2 -1
- package/dist/lib/config-keys.js +8 -4
- package/dist/lib/config-machine-keys.d.ts +4 -2
- package/dist/lib/config-machine-keys.js +5 -2
- package/dist/lib/crabbox/lease.js +9 -1
- package/dist/lib/crabbox/runtimes.d.ts +32 -7
- package/dist/lib/crabbox/runtimes.js +72 -30
- package/dist/lib/{daemon.d.ts → daemon/daemon.d.ts} +59 -1
- package/dist/lib/{daemon.js → daemon/daemon.js} +237 -49
- package/dist/lib/daemon-services.d.ts +1 -1
- package/dist/lib/daemon-services.js +5 -0
- package/dist/lib/daemon-ticks.d.ts +25 -0
- package/dist/lib/daemon-ticks.js +31 -1
- package/dist/lib/daemon-webhooks.d.ts +104 -0
- package/dist/lib/daemon-webhooks.js +215 -0
- package/dist/lib/device-config.d.ts +85 -75
- package/dist/lib/device-config.js +280 -142
- package/dist/lib/devices/config-migration.d.ts +29 -34
- package/dist/lib/devices/config-migration.js +209 -130
- package/dist/lib/devices/connect.d.ts +2 -2
- package/dist/lib/devices/connect.js +2 -2
- package/dist/lib/devices/discovery-policy.d.ts +30 -0
- package/dist/lib/devices/discovery-policy.js +101 -0
- package/dist/lib/devices/fleet-inventory.js +8 -3
- package/dist/lib/devices/harness-inventory.d.ts +1 -1
- package/dist/lib/devices/harness-inventory.js +12 -3
- package/dist/lib/devices/known-hosts.js +1 -1
- package/dist/lib/devices/pool.d.ts +10 -5
- package/dist/lib/devices/pool.js +5 -7
- package/dist/lib/devices/registry.d.ts +1 -1
- package/dist/lib/devices/registry.js +1 -1
- package/dist/lib/devices/resolve-profile.d.ts +2 -2
- package/dist/lib/devices/resolve-profile.js +2 -2
- package/dist/lib/devices/resolve-target.d.ts +1 -1
- package/dist/lib/devices/resolve-target.js +4 -4
- package/dist/lib/devices/self-host.d.ts +1 -1
- package/dist/lib/devices/self-host.js +3 -3
- package/dist/lib/devices/ssh-config.d.ts +1 -1
- package/dist/lib/devices/stats-cache.js +1 -1
- package/dist/lib/devices/sync.d.ts +3 -1
- package/dist/lib/devices/sync.js +3 -3
- package/dist/lib/doctor-diff.js +4 -4
- package/dist/lib/drift-sync.js +2 -2
- package/dist/lib/drift.js +2 -2
- package/dist/lib/event-families.d.ts +1 -1
- package/dist/lib/event-stream.d.ts +1 -1
- package/dist/lib/event-stream.js +2 -2
- package/dist/lib/events-ingest.js +2 -2
- package/dist/lib/exec.d.ts +4 -4
- package/dist/lib/exec.js +11 -11
- package/dist/lib/factory/snapshot.d.ts +1 -1
- package/dist/lib/factory/snapshot.js +1 -1
- package/dist/lib/{activity.d.ts → feed/activity.d.ts} +1 -1
- package/dist/lib/{activity.js → feed/activity.js} +7 -7
- package/dist/lib/{events.d.ts → feed/events.d.ts} +2 -2
- package/dist/lib/{events.js → feed/events.js} +5 -5
- package/dist/lib/{feed.js → feed/feed.js} +4 -4
- package/dist/lib/feed-outcome.d.ts +1 -1
- package/dist/lib/feed-policy.d.ts +1 -1
- package/dist/lib/feed-policy.js +1 -1
- package/dist/lib/feed-post.d.ts +1 -1
- package/dist/lib/feed-post.js +1 -1
- package/dist/lib/feed-ranking.d.ts +1 -1
- package/dist/lib/fleet/apply.d.ts +0 -6
- package/dist/lib/fleet/apply.js +18 -45
- package/dist/lib/fleet/auth-sync.d.ts +16 -35
- package/dist/lib/fleet/auth-sync.js +16 -75
- package/dist/lib/fleet/capture.js +8 -6
- package/dist/lib/fleet/manifest.js +23 -11
- package/dist/lib/fleet/types.d.ts +19 -7
- package/dist/lib/fleet-cache.d.ts +1 -1
- package/dist/lib/fleet-cache.js +1 -1
- package/dist/lib/format.d.ts +19 -0
- package/dist/lib/format.js +44 -1
- package/dist/lib/friction-heuristics.d.ts +1 -1
- package/dist/lib/git.d.ts +24 -1
- package/dist/lib/git.js +82 -38
- package/dist/lib/heal.js +3 -3
- package/dist/lib/hooks.d.ts +18 -0
- package/dist/lib/hooks.js +113 -1
- package/dist/lib/hosts/credentials.d.ts +30 -10
- package/dist/lib/hosts/credentials.js +38 -26
- package/dist/lib/hosts/dispatch.d.ts +3 -3
- package/dist/lib/hosts/dispatch.js +3 -3
- package/dist/lib/hosts/option.d.ts +3 -3
- package/dist/lib/hosts/option.js +7 -8
- package/dist/lib/hosts/passthrough.d.ts +17 -17
- package/dist/lib/hosts/passthrough.js +67 -50
- package/dist/lib/hosts/providers/devices.d.ts +1 -1
- package/dist/lib/hosts/providers/devices.js +1 -1
- package/dist/lib/hosts/reconcile.d.ts +1 -1
- package/dist/lib/hosts/reconcile.js +1 -1
- package/dist/lib/hosts/reconnect.d.ts +1 -1
- package/dist/lib/hosts/reconnect.js +2 -2
- package/dist/lib/hosts/registry.d.ts +5 -5
- package/dist/lib/hosts/registry.js +5 -5
- package/dist/lib/hosts/remote-cmd.d.ts +10 -10
- package/dist/lib/hosts/remote-cmd.js +25 -18
- package/dist/lib/hosts/remote-os.d.ts +4 -4
- package/dist/lib/hosts/remote-os.js +4 -4
- package/dist/lib/hosts/remote-session-id.d.ts +2 -2
- package/dist/lib/hosts/remote-session-id.js +2 -2
- package/dist/lib/hosts/routing-flag.d.ts +3 -3
- package/dist/lib/hosts/routing-flag.js +4 -5
- package/dist/lib/hosts/run-target.d.ts +4 -4
- package/dist/lib/hosts/run-target.js +4 -4
- package/dist/lib/hosts/session-index.d.ts +2 -2
- package/dist/lib/hosts/session-index.js +1 -1
- package/dist/lib/hosts/session-marker.d.ts +1 -1
- package/dist/lib/hosts/session-marker.js +1 -1
- package/dist/lib/hosts/types.d.ts +2 -2
- package/dist/lib/hosts/types.js +2 -2
- package/dist/lib/import.js +1 -1
- package/dist/lib/{migrate.d.ts → installations/migrate.d.ts} +13 -1
- package/dist/lib/{migrate.js → installations/migrate.js} +160 -40
- package/dist/lib/installations/resolve.js +1 -1
- package/dist/lib/installations/strategies.js +1 -1
- package/dist/lib/installations/update.js +2 -2
- package/dist/lib/{versions.d.ts → installations/versions.d.ts} +12 -3
- package/dist/lib/{versions.js → installations/versions.js} +51 -31
- package/dist/lib/isolation-boundary-report.js +1 -1
- package/dist/lib/linear-projects.d.ts +28 -0
- package/dist/lib/linear-projects.js +30 -0
- package/dist/lib/loop.js +1 -1
- package/dist/lib/mailbox-gc.js +1 -1
- package/dist/lib/mailbox.js +1 -1
- package/dist/lib/mcp-registry.d.ts +62 -0
- package/dist/lib/mcp-registry.js +177 -0
- package/dist/lib/mcp.d.ts +5 -0
- package/dist/lib/mcp.js +124 -307
- package/dist/lib/menubar/MenubarHelper.app/Contents/CodeResources +0 -0
- package/dist/lib/menubar/MenubarHelper.app/Contents/MacOS/MenubarHelper +0 -0
- package/dist/lib/menubar/install-menubar.d.ts +7 -0
- package/dist/lib/menubar/install-menubar.js +24 -6
- package/dist/lib/menubar/snapshot.d.ts +7 -0
- package/dist/lib/menubar/snapshot.js +8 -6
- package/dist/lib/models.js +1 -1
- package/dist/lib/monitors/config.d.ts +12 -0
- package/dist/lib/monitors/config.js +3 -0
- package/dist/lib/monitors/dispatch.js +26 -5
- package/dist/lib/monitors/engine.js +10 -0
- package/dist/lib/monitors/sources/webhook.d.ts +1 -1
- package/dist/lib/monitors/state.d.ts +42 -0
- package/dist/lib/monitors/state.js +30 -0
- package/dist/lib/notify.d.ts +1 -1
- package/dist/lib/observe-aliases.d.ts +3 -3
- package/dist/lib/observe-aliases.js +3 -21
- package/dist/lib/output/git-output.js +2 -2
- package/dist/lib/overdue.d.ts +1 -1
- package/dist/lib/overdue.js +1 -1
- package/dist/lib/permissions-registry.d.ts +65 -0
- package/dist/lib/permissions-registry.js +599 -0
- package/dist/lib/permissions.d.ts +24 -13
- package/dist/lib/permissions.js +52 -271
- package/dist/lib/picker.d.ts +16 -0
- package/dist/lib/picker.js +33 -3
- package/dist/lib/placement.d.ts +1 -1
- package/dist/lib/placement.js +4 -4
- package/dist/lib/platform/paths.d.ts +8 -0
- package/dist/lib/platform/paths.js +11 -0
- package/dist/lib/platform/posixpath.js +3 -3
- package/dist/lib/{plugin-marketplace.d.ts → plugins/plugin-marketplace.d.ts} +1 -1
- package/dist/lib/{plugin-marketplace.js → plugins/plugin-marketplace.js} +2 -2
- package/dist/lib/{plugins.d.ts → plugins/plugins.d.ts} +1 -1
- package/dist/lib/{plugins.js → plugins/plugins.js} +7 -7
- package/dist/lib/{skills.d.ts → plugins/skills.d.ts} +1 -1
- package/dist/lib/{skills.js → plugins/skills.js} +7 -7
- package/dist/lib/pricing/cost.d.ts +1 -1
- package/dist/lib/pricing/cost.js +1 -1
- package/dist/lib/profiles-presets.d.ts +1 -1
- package/dist/lib/profiles-presets.js +1 -1
- package/dist/lib/profiles.js +2 -2
- package/dist/lib/project-import.js +4 -1
- package/dist/lib/project-key.js +7 -0
- package/dist/lib/project-launch.d.ts +1 -1
- package/dist/lib/project-launch.js +3 -3
- package/dist/lib/project-pull.d.ts +128 -0
- package/dist/lib/project-pull.js +384 -0
- package/dist/lib/project-root.d.ts +2 -2
- package/dist/lib/project-root.js +2 -2
- package/dist/lib/project-status.js +1 -1
- package/dist/lib/projects.d.ts +23 -0
- package/dist/lib/projects.js +29 -6
- package/dist/lib/refresh.d.ts +12 -1
- package/dist/lib/refresh.js +16 -9
- package/dist/lib/registry.d.ts +9 -2
- package/dist/lib/registry.js +11 -4
- package/dist/lib/resources.d.ts +2 -2
- package/dist/lib/resources.js +2 -2
- package/dist/lib/routers.d.ts +81 -0
- package/dist/lib/routers.js +153 -0
- package/dist/lib/routine-context.d.ts +1 -0
- package/dist/lib/routine-context.js +7 -2
- package/dist/lib/routine-notify-owner.d.ts +1 -1
- package/dist/lib/routine-notify.d.ts +1 -1
- package/dist/lib/routine-notify.js +1 -1
- package/dist/lib/routine-process-cleanup.d.ts +1 -1
- package/dist/lib/routine-readiness.d.ts +1 -1
- package/dist/lib/routine-readiness.js +11 -4
- package/dist/lib/routines-placement.d.ts +12 -2
- package/dist/lib/routines-placement.js +20 -3
- package/dist/lib/routines-project.d.ts +1 -1
- package/dist/lib/routines-project.js +1 -1
- package/dist/lib/rules/compile.d.ts +1 -0
- package/dist/lib/rules/compile.js +10 -2
- package/dist/lib/rules/rules.js +1 -1
- package/dist/lib/run-notify.js +1 -1
- package/dist/lib/runner.d.ts +80 -2
- package/dist/lib/runner.js +261 -67
- package/dist/lib/sandbox.d.ts +1 -1
- package/dist/lib/scheduler.d.ts +1 -1
- package/dist/lib/scheduler.js +1 -1
- package/dist/lib/{routines.d.ts → scheduling/routines.d.ts} +54 -9
- package/dist/lib/{routines.js → scheduling/routines.js} +173 -14
- package/dist/lib/secrets/Agents CLI.app/Contents/CodeResources +0 -0
- package/dist/lib/secrets/Agents CLI.app/Contents/MacOS/Agents CLI +0 -0
- package/dist/lib/secrets/agent.js +2 -2
- package/dist/lib/secrets/audit.js +1 -1
- package/dist/lib/secrets/bundles.d.ts +4 -4
- package/dist/lib/secrets/bundles.js +8 -8
- package/dist/lib/secrets/headless.d.ts +16 -0
- package/dist/lib/secrets/headless.js +21 -0
- package/dist/lib/secrets/index.js +1 -1
- package/dist/lib/secrets/list-filter.d.ts +1 -1
- package/dist/lib/secrets/list-filter.js +2 -2
- package/dist/lib/secrets/push.d.ts +1 -1
- package/dist/lib/secrets/push.js +10 -12
- package/dist/lib/secrets/remote.d.ts +21 -17
- package/dist/lib/secrets/remote.js +39 -23
- package/dist/lib/secrets/vault.js +2 -2
- package/dist/lib/self-heal/checks/shadowing.js +1 -1
- package/dist/lib/self-heal/checks/shims.js +1 -1
- package/dist/lib/self-update.d.ts +39 -4
- package/dist/lib/self-update.js +78 -25
- package/dist/lib/serve/control.d.ts +1 -1
- package/dist/lib/serve/control.js +4 -4
- package/dist/lib/serve/data.d.ts +1 -1
- package/dist/lib/serve/data.js +1 -1
- package/dist/lib/serve/stream.js +1 -1
- package/dist/lib/service-manifest.d.ts +29 -0
- package/dist/lib/service-manifest.js +80 -0
- package/dist/lib/session/active.d.ts +59 -7
- package/dist/lib/session/active.js +158 -17
- package/dist/lib/session/bash-command.js +1 -1
- package/dist/lib/session/claude-accounts.d.ts +1 -1
- package/dist/lib/session/claude-accounts.js +1 -1
- package/dist/lib/session/db.d.ts +10 -2
- package/dist/lib/session/db.js +25 -6
- package/dist/lib/session/discover.d.ts +77 -0
- package/dist/lib/session/discover.js +130 -25
- package/dist/lib/session/fork.js +1 -1
- package/dist/lib/session/inject.d.ts +1 -1
- package/dist/lib/session/insights.d.ts +1 -1
- package/dist/lib/session/insights.js +1 -1
- package/dist/lib/session/live-metadata.d.ts +15 -0
- package/dist/lib/session/live-metadata.js +76 -0
- package/dist/lib/session/migrate-targets.d.ts +1 -1
- package/dist/lib/session/recovery.d.ts +1 -1
- package/dist/lib/session/recovery.js +2 -2
- package/dist/lib/session/remote-active.d.ts +10 -1
- package/dist/lib/session/remote-active.js +8 -3
- package/dist/lib/session/remote-bundle.d.ts +1 -1
- package/dist/lib/session/remote-bundle.js +2 -2
- package/dist/lib/session/remote-list.d.ts +15 -4
- package/dist/lib/session/remote-list.js +40 -3
- package/dist/lib/session/remote.d.ts +5 -5
- package/dist/lib/session/remote.js +13 -17
- package/dist/lib/session/resume-command.d.ts +3 -2
- package/dist/lib/session/resume-command.js +4 -3
- package/dist/lib/session/resume-owner.d.ts +3 -3
- package/dist/lib/session/resume-owner.js +3 -3
- package/dist/lib/session/session-cache.d.ts +12 -0
- package/dist/lib/session/session-cache.js +2 -0
- package/dist/lib/session/share-html.d.ts +55 -0
- package/dist/lib/session/share-html.js +319 -0
- package/dist/lib/session/shell-programs.js +1 -1
- package/dist/lib/session/state.js +5 -5
- package/dist/lib/session/team-filter.d.ts +1 -1
- package/dist/lib/session/team-filter.js +1 -1
- package/dist/lib/session/types.d.ts +3 -3
- package/dist/lib/session/width.d.ts +2 -2
- package/dist/lib/session/width.js +2 -2
- package/dist/lib/settings-manifest.d.ts +2 -0
- package/dist/lib/settings-manifest.js +81 -3
- package/dist/lib/share/delete.d.ts +21 -0
- package/dist/lib/share/delete.js +42 -0
- package/dist/lib/share/publish.d.ts +120 -0
- package/dist/lib/share/publish.js +243 -18
- package/dist/lib/share/worker-template.js +172 -9
- package/dist/lib/shims.js +35 -7
- package/dist/lib/smart-launch.d.ts +4 -4
- package/dist/lib/smart-launch.js +6 -4
- package/dist/lib/snapshot.d.ts +4 -4
- package/dist/lib/snapshot.js +2 -2
- package/dist/lib/ssh-exec.d.ts +1 -1
- package/dist/lib/ssh-exec.js +2 -2
- package/dist/lib/ssh-tunnel.d.ts +10 -10
- package/dist/lib/ssh-tunnel.js +12 -12
- package/dist/lib/staleness/checkers/hooks.d.ts +1 -1
- package/dist/lib/staleness/checkers/hooks.js +1 -1
- package/dist/lib/staleness/detectors/permissions.js +0 -23
- package/dist/lib/staleness/detectors/plugins.js +1 -1
- package/dist/lib/staleness/fingerprint.js +1 -1
- package/dist/lib/staleness/layers.d.ts +1 -1
- package/dist/lib/staleness/layers.js +1 -1
- package/dist/lib/staleness/writers/mcp.js +3 -1
- package/dist/lib/staleness/writers/plugins.js +1 -1
- package/dist/lib/staleness/writers/types.d.ts +8 -0
- package/dist/lib/startup/command-registry.d.ts +6 -147
- package/dist/lib/startup/command-registry.js +40 -303
- package/dist/lib/startup/dev-build.d.ts +0 -21
- package/dist/lib/startup/dev-build.js +29 -8
- package/dist/lib/state.d.ts +19 -1
- package/dist/lib/state.js +120 -51
- package/dist/lib/subagents.js +1 -1
- package/dist/lib/sync-status.js +1 -1
- package/dist/lib/sync-umbrella.d.ts +6 -1
- package/dist/lib/sync-umbrella.js +9 -4
- package/dist/lib/teams/agents.js +2 -2
- package/dist/lib/teams/registry.js +1 -1
- package/dist/lib/terminal/backends/vscodium-agent.js +1 -1
- package/dist/lib/terminal/engine.js +1 -1
- package/dist/lib/terminal/index.d.ts +4 -0
- package/dist/lib/terminal/index.js +3 -0
- package/dist/lib/terminal/inject.d.ts +2 -2
- package/dist/lib/terminal/inject.js +2 -2
- package/dist/lib/terminal/transport.js +1 -1
- package/dist/lib/tmux/index.d.ts +1 -1
- package/dist/lib/tmux/index.js +1 -1
- package/dist/lib/tmux/session.d.ts +21 -5
- package/dist/lib/tmux/session.js +76 -22
- package/dist/lib/triggers/handlers.d.ts +38 -3
- package/dist/lib/triggers/handlers.js +58 -7
- package/dist/lib/triggers/webhook.d.ts +113 -5
- package/dist/lib/triggers/webhook.js +223 -44
- package/dist/lib/types.d.ts +19 -7
- package/dist/lib/usage-fleet.d.ts +1 -1
- package/dist/lib/usage-fleet.js +1 -1
- package/dist/lib/usage-refresh.d.ts +1 -1
- package/dist/lib/usage-refresh.js +3 -3
- package/dist/lib/version-duplicates.js +2 -2
- package/dist/lib/view-types.d.ts +56 -0
- package/dist/lib/view-types.js +1 -0
- package/dist/lib/watchdog/rotate.d.ts +2 -2
- package/dist/lib/watchdog/rotate.js +3 -3
- package/dist/lib/watchdog/runner.d.ts +2 -3
- package/dist/lib/watchdog/runner.js +3 -4
- package/dist/lib/workflows.js +1 -1
- package/dist/lib/wrap.d.ts +33 -0
- package/dist/lib/wrap.js +70 -0
- package/package.json +2 -1
- package/scripts/postinstall.js +2 -2
- package/dist/commands/bench.d.ts +0 -2
- package/dist/commands/bench.js +0 -101
- package/dist/commands/cp.d.ts +0 -84
- package/dist/commands/cp.js +0 -231
- package/dist/commands/login.d.ts +0 -2
- package/dist/lib/resources/commands.d.ts +0 -46
- package/dist/lib/resources/commands.js +0 -211
- package/dist/lib/resources/hooks.d.ts +0 -16
- package/dist/lib/resources/hooks.js +0 -153
- package/dist/lib/resources/mcp.d.ts +0 -34
- package/dist/lib/resources/mcp.js +0 -250
- package/dist/lib/resources/memory.d.ts +0 -15
- package/dist/lib/resources/memory.js +0 -46
- package/dist/lib/resources/permissions.d.ts +0 -13
- package/dist/lib/resources/permissions.js +0 -202
- package/dist/lib/resources/rules.d.ts +0 -46
- package/dist/lib/resources/rules.js +0 -179
- package/dist/lib/resources/skills.d.ts +0 -37
- package/dist/lib/resources/skills.js +0 -247
- package/dist/lib/resources/subagents.d.ts +0 -46
- package/dist/lib/resources/subagents.js +0 -202
- /package/dist/lib/{feed.d.ts → feed/feed.d.ts} +0 -0
|
@@ -10,11 +10,13 @@ import ora from 'ora';
|
|
|
10
10
|
import * as fs from 'fs';
|
|
11
11
|
import * as path from 'path';
|
|
12
12
|
import * as yaml from 'yaml';
|
|
13
|
-
import { isDaemonRunning, signalDaemonReload, startDaemon, stopDaemon, readDaemonLog, getDaemonStatus, getDaemonLogPath, } from '../lib/daemon.js';
|
|
13
|
+
import { isDaemonRunning, signalDaemonReload, startDaemon, stopDaemon, readDaemonLog, getDaemonStatus, getDaemonLogPath, } from '../lib/daemon/daemon.js';
|
|
14
14
|
import { assertSchedulerEnabled, assertDaemonEnabled, isDaemonEnabled } from '../lib/device-config.js';
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
15
|
+
import { parseAgentVersionSpec, isAgentHardDeprecated, hardDeprecationError, ROUTINE_AGENT_IDS } from '../lib/agents.js';
|
|
16
|
+
import { RUN_STRATEGIES, normalizeRunStrategy } from '../lib/accounting/rotate.js';
|
|
17
|
+
import { formatRepoLink, REPO_DISPLAY_MAX } from '../lib/routines-format.js';
|
|
18
|
+
import { listJobs as listAllJobs, deleteJob, readJob, validateJob, writeJob, setJobEnabled, listRuns, routineStats, getLatestRun, getRunDir, getJobPath, isCanonicalRoutineSource, parseAtTime, hasCompletedOneShotRun, isOneShotLikeSchedule, isOneShotRoutine, jobRunsOnThisDevice, checkJobDeviceEligibility, normalizeTriggerEvent, parseHostStrategy, resolveHostStrategy, HOST_STRATEGIES, computeProjectGroupKind, projectGroupKey, projectGroupTitle, projectGroupOrder, normalizeProjects, buildRoutineListJson, fireConditionLabel, nextRunForDisplay, nextRunLabel, localLatestRun, listJobsForDisplay, } from '../lib/scheduling/routines.js';
|
|
19
|
+
export { buildRoutineListJson } from '../lib/scheduling/routines.js';
|
|
18
20
|
import { listProjectDefs, isSafeProjectName } from '../lib/projects.js';
|
|
19
21
|
import { evaluateActivationReadinessLive } from '../lib/routine-readiness.js';
|
|
20
22
|
import { discoverProjectRoutines, findProjectRoutine, materialiseProjectRoutine, syncProjectRoutines, syncAllProjectRoutines, displayProjectPath, } from '../lib/routines-project.js';
|
|
@@ -61,31 +63,6 @@ export function formatRunDuration(startedAt, completedAt) {
|
|
|
61
63
|
* Human label for what fires a job: its cron schedule, or its event trigger
|
|
62
64
|
* for schedule-less (trigger-only) routines.
|
|
63
65
|
*/
|
|
64
|
-
function fireConditionLabel(job) {
|
|
65
|
-
if (job.schedule)
|
|
66
|
-
return humanizeCron(job.schedule, job.timezone);
|
|
67
|
-
if (job.trigger) {
|
|
68
|
-
if (job.trigger.type === 'github_event') {
|
|
69
|
-
const scope = job.trigger.repo
|
|
70
|
-
? ` (${job.trigger.repo}${job.trigger.branch ? `@${job.trigger.branch}` : ''})`
|
|
71
|
-
: '';
|
|
72
|
-
const filters = [
|
|
73
|
-
job.trigger.action ? `action=${job.trigger.action}` : null,
|
|
74
|
-
job.trigger.label ? `label=${job.trigger.label}` : null,
|
|
75
|
-
].filter(Boolean).join(', ');
|
|
76
|
-
return `on github:${job.trigger.event}${scope}${filters ? ` (${filters})` : ''}`;
|
|
77
|
-
}
|
|
78
|
-
const filters = [
|
|
79
|
-
job.trigger.action ? `action=${job.trigger.action}` : null,
|
|
80
|
-
job.trigger.teamKey ? `team=${job.trigger.teamKey}` : null,
|
|
81
|
-
job.trigger.label ? `label=${job.trigger.label}` : null,
|
|
82
|
-
job.trigger.stateTo ? `stateTo=${job.trigger.stateTo}` : null,
|
|
83
|
-
job.trigger.stateFrom ? `stateFrom=${job.trigger.stateFrom}` : null,
|
|
84
|
-
].filter(Boolean).join(', ');
|
|
85
|
-
return `on linear:${job.trigger.event}${filters ? ` (${filters})` : ''}`;
|
|
86
|
-
}
|
|
87
|
-
return '-';
|
|
88
|
-
}
|
|
89
66
|
function scheduleLabel(job) {
|
|
90
67
|
let label = fireConditionLabel(job);
|
|
91
68
|
if (isOneShotRoutine(job))
|
|
@@ -99,16 +76,6 @@ function scheduleLabel(job) {
|
|
|
99
76
|
}
|
|
100
77
|
return label;
|
|
101
78
|
}
|
|
102
|
-
function nextRunForDisplay(job, scheduler) {
|
|
103
|
-
if (isPastOneShotRoutine(job))
|
|
104
|
-
return null;
|
|
105
|
-
return scheduler.getNextRun(job.name);
|
|
106
|
-
}
|
|
107
|
-
function nextRunLabel(job, scheduler, now) {
|
|
108
|
-
if (isPastOneShotRoutine(job))
|
|
109
|
-
return 'expired';
|
|
110
|
-
return humanizeNextRun(scheduler.getNextRun(job.name) ?? null, now, job.timezone);
|
|
111
|
-
}
|
|
112
79
|
function deviceStateLabel(name, registry) {
|
|
113
80
|
const profile = registry[normalizeHost(name)] ?? registry[name];
|
|
114
81
|
if (!profile)
|
|
@@ -147,21 +114,6 @@ function deviceLabel(job, width) {
|
|
|
147
114
|
: raw;
|
|
148
115
|
return { raw, display, dim: full.length === 0 || !jobRunsOnThisDevice(job) };
|
|
149
116
|
}
|
|
150
|
-
/**
|
|
151
|
-
* The last run THIS device can speak for.
|
|
152
|
-
*
|
|
153
|
-
* A run record is written by whichever daemon fired the routine, into that
|
|
154
|
-
* machine's own runs dir — records carry no device attribution, so a record
|
|
155
|
-
* found here only ever describes this device's history. When a routine is
|
|
156
|
-
* pinned away from this machine (`devices:` excludes it) any local record is a
|
|
157
|
-
* leftover from before the pin, and reporting it as the routine's status paints
|
|
158
|
-
* another device's healthy routine red. Report nothing instead; the local
|
|
159
|
-
* history stays readable via `agents routines runs <name>`, and the owning
|
|
160
|
-
* device's status via `agents routines list --device <name>`.
|
|
161
|
-
*/
|
|
162
|
-
export function localLatestRun(job) {
|
|
163
|
-
return jobRunsOnThisDevice(job) ? getLatestRun(job.name) : null;
|
|
164
|
-
}
|
|
165
117
|
export function groupRoutineJobsByDevice(jobs, registry, self = machineId()) {
|
|
166
118
|
const groups = new Map();
|
|
167
119
|
const add = (key, title, job) => {
|
|
@@ -418,81 +370,6 @@ export function buildRunsJson(runs) {
|
|
|
418
370
|
* enabled/disabled picture. Execution paths (`run`/`catchup`/`webhook`) keep
|
|
419
371
|
* using `listAllJobs` so an un-materialised project routine can never fire.
|
|
420
372
|
*/
|
|
421
|
-
function listJobsForDisplay(cwd) {
|
|
422
|
-
const jobs = listAllJobs(cwd);
|
|
423
|
-
const seen = new Set(jobs.map((j) => j.name));
|
|
424
|
-
for (const discovered of discoverProjectRoutines()) {
|
|
425
|
-
if (seen.has(discovered.name))
|
|
426
|
-
continue;
|
|
427
|
-
seen.add(discovered.name);
|
|
428
|
-
jobs.push(discovered.config);
|
|
429
|
-
}
|
|
430
|
-
return jobs;
|
|
431
|
-
}
|
|
432
|
-
export function buildRoutineListJson() {
|
|
433
|
-
try {
|
|
434
|
-
monitorRunningJobs();
|
|
435
|
-
}
|
|
436
|
-
catch { /* best-effort orphan reap */ }
|
|
437
|
-
const jobs = listJobsForDisplay(process.cwd());
|
|
438
|
-
if (jobs.length === 0)
|
|
439
|
-
return [];
|
|
440
|
-
const scheduler = new JobScheduler(async () => { });
|
|
441
|
-
scheduler.loadAll();
|
|
442
|
-
try {
|
|
443
|
-
const overdueSet = new Set();
|
|
444
|
-
try {
|
|
445
|
-
for (const job of detectOverdueJobs())
|
|
446
|
-
overdueSet.add(job.name);
|
|
447
|
-
}
|
|
448
|
-
catch {
|
|
449
|
-
// Best-effort indicator; never block the list on detection errors.
|
|
450
|
-
}
|
|
451
|
-
const now = new Date();
|
|
452
|
-
const knownProjectNames = new Set(listProjectDefs().map((project) => project.name));
|
|
453
|
-
return jobs.map((job) => {
|
|
454
|
-
const latestRun = localLatestRun(job);
|
|
455
|
-
const enabledDevices = devicesWithRoutineEnabled(job.name);
|
|
456
|
-
return {
|
|
457
|
-
name: job.name,
|
|
458
|
-
agent: job.agent ?? null,
|
|
459
|
-
workflow: job.workflow ?? null,
|
|
460
|
-
command: job.command ?? null,
|
|
461
|
-
repo: job.repo ?? null,
|
|
462
|
-
schedule: job.schedule ?? null,
|
|
463
|
-
scheduleHuman: fireConditionLabel(job),
|
|
464
|
-
trigger: job.trigger ?? null,
|
|
465
|
-
timezone: job.timezone ?? null,
|
|
466
|
-
devices: enabledDevices,
|
|
467
|
-
enabledDevices,
|
|
468
|
-
host: job.host ?? null,
|
|
469
|
-
hostStrategy: resolveHostStrategy(job),
|
|
470
|
-
source: job.source ?? null,
|
|
471
|
-
sourceRepo: job.source?.repo ?? job.repo ?? null,
|
|
472
|
-
sourceBranch: job.source?.branch ?? null,
|
|
473
|
-
runOnce: Boolean(job.runOnce),
|
|
474
|
-
catchup: job.catchup !== false,
|
|
475
|
-
oneShot: isOneShotRoutine(job),
|
|
476
|
-
expired: isPastOneShotRoutine(job, now),
|
|
477
|
-
runsHere: jobRunsOnThisDevice(job),
|
|
478
|
-
enabled: job.enabled,
|
|
479
|
-
overdue: overdueSet.has(job.name),
|
|
480
|
-
nextRun: nextRunForDisplay(job, scheduler)?.toISOString() ?? null,
|
|
481
|
-
nextRunHuman: nextRunLabel(job, scheduler, now),
|
|
482
|
-
lastStatus: latestRun?.status ?? null,
|
|
483
|
-
exitCode: latestRun?.exitCode ?? null,
|
|
484
|
-
failureReason: latestRun?.errorMessage ?? null,
|
|
485
|
-
lastRunStartedAt: latestRun?.startedAt ?? null,
|
|
486
|
-
lastRunCompletedAt: latestRun?.completedAt ?? null,
|
|
487
|
-
projects: job.projects ?? [],
|
|
488
|
-
projectGroup: computeProjectGroup(job.projects, knownProjectNames),
|
|
489
|
-
};
|
|
490
|
-
});
|
|
491
|
-
}
|
|
492
|
-
finally {
|
|
493
|
-
scheduler.stopAll();
|
|
494
|
-
}
|
|
495
|
-
}
|
|
496
373
|
/** Detect Ctrl+C or premature stream close during an interactive prompt. */
|
|
497
374
|
function isPromptCancelled(err) {
|
|
498
375
|
return (err instanceof Error &&
|
|
@@ -926,6 +803,12 @@ export function registerRoutinesCommands(program) {
|
|
|
926
803
|
agents routines add drain --schedule "0 3 * * *" --agent claude --placement fleet --prompt "Drain queue"
|
|
927
804
|
agents routines add review --schedule "0 9 * * 1" --agent claude --placement cloud --prompt "Review open PRs"
|
|
928
805
|
|
|
806
|
+
# Pin an exact installed version (same agent@version syntax as agents run)
|
|
807
|
+
agents routines add version-pin --schedule "*/5 * * * *" --agent claude@2.1.207 --cwd /path/to/repo --prompt "Reply OK"
|
|
808
|
+
|
|
809
|
+
# Per-routine selection strategy + health-aware fleet placement at each fire
|
|
810
|
+
agents routines add release-shepherd --schedule "*/5 * * * *" --agent claude --strategy balanced --run-on auto --cwd /path/to/repo --prompt "Own the release through verification"
|
|
811
|
+
|
|
929
812
|
# Enable a routine (materialises a project routine on first enable)
|
|
930
813
|
agents routines enable security-sweep
|
|
931
814
|
agents routines disable security-sweep
|
|
@@ -934,7 +817,7 @@ export function registerRoutinesCommands(program) {
|
|
|
934
817
|
agents routines list
|
|
935
818
|
|
|
936
819
|
# List routines on a specific device
|
|
937
|
-
agents routines list --
|
|
820
|
+
agents routines list --device yosemite-s0
|
|
938
821
|
|
|
939
822
|
# Create a routine restricted to specific devices
|
|
940
823
|
agents routines add nightly --schedule "0 2 * * *" --agent claude --prompt "Summarize today's commits" --devices yosemite-s0,mac-mini
|
|
@@ -962,7 +845,15 @@ export function registerRoutinesCommands(program) {
|
|
|
962
845
|
Version / credit failover (same semantics as 'agents run'):
|
|
963
846
|
- Omit 'version:' to let the configured run strategy (default: balanced)
|
|
964
847
|
pick a healthy install and skip accounts that are out of credits or
|
|
965
|
-
rate-limited. Pin with '
|
|
848
|
+
rate-limited. Pin with '--agent claude@2.1.x' (or 'version:' in YAML)
|
|
849
|
+
when you want one install only; '--strategy pinned|available|balanced'
|
|
850
|
+
persists a per-routine selection policy that beats the firing box's
|
|
851
|
+
run.<agent>.strategy config.
|
|
852
|
+
- Three distinct device flags: '--devices a,b' is the scheduler FIRING
|
|
853
|
+
allowlist (which daemons may fire this routine); '--run-on <name|auto>'
|
|
854
|
+
is BODY placement (where the fired job executes — 'auto' re-picks a
|
|
855
|
+
healthy device at each fire); the parent '--device' manages the
|
|
856
|
+
routine DEFINITION on another machine.
|
|
966
857
|
- Foreground 'agents routines run' re-dispatches to the next healthy
|
|
967
858
|
same-agent account when a mid-run rate/usage limit is detected.
|
|
968
859
|
- Detached/daemon fires use the pre-flight pick only (next tick re-selects).
|
|
@@ -1006,7 +897,9 @@ export function registerRoutinesCommands(program) {
|
|
|
1006
897
|
.command('add [nameOrPath]')
|
|
1007
898
|
.description('Create a new routine from a YAML file or inline flags. Starts the scheduler automatically if it is not already running.')
|
|
1008
899
|
.option('-s, --schedule <cron>', 'Cron schedule in standard format (5 fields: minute hour day month weekday)')
|
|
1009
|
-
.option('-a, --agent <agent>', `Which agent runs this routine: ${ROUTINE_AGENT_IDS.join(', ')}
|
|
900
|
+
.option('-a, --agent <agent[@version]>', `Which agent runs this routine: ${ROUTINE_AGENT_IDS.join(', ')}. An @version pins that exact installed version (same syntax as agents run), persisted as separate agent + version fields.`)
|
|
901
|
+
.option('--strategy <strategy>', `Version/account selection strategy for this routine: ${RUN_STRATEGIES.join(' | ')}. Overrides run.<agent>.strategy from the firing device's config. Conflicts with an @version pin.`)
|
|
902
|
+
.option('--balanced', 'Shortcut for --strategy balanced.')
|
|
1010
903
|
.option('--workflow <name>', 'Run an installed workflow (~/.agents/workflows/<name>) via `agents run`. Mutually exclusive with --agent.')
|
|
1011
904
|
.option('--command <sh>', 'Run a plain shell command directly (no agent, no auth, no sandbox) — for deterministic housekeeping routines. Mutually exclusive with --agent and --workflow; --prompt is not used.')
|
|
1012
905
|
.option('-p, --prompt <prompt>', 'Task instruction for the agent')
|
|
@@ -1015,8 +908,8 @@ export function registerRoutinesCommands(program) {
|
|
|
1015
908
|
.option('-t, --timeout <timeout>', 'Kill the agent if it runs longer than this (e.g., 10m, 2h, 3d, 1w; max 1w)', '10m')
|
|
1016
909
|
.option('--timezone <tz>', 'Interpret schedule in this timezone (e.g., America/Los_Angeles)')
|
|
1017
910
|
.option('--devices <names>', 'Fleet allowlist (comma-separated): only listed devices schedule and fire this routine. Omit for unrestricted.')
|
|
1018
|
-
.option('--run-on <name>',
|
|
1019
|
-
.option('--placement <strategy>', `BODY placement strategy: ${HOST_STRATEGIES.join('|')} (default: local, or host when --run-on is set). Maps to the shared Placement model (local|device|fleet|cloud). Not the same as --
|
|
911
|
+
.option('--run-on <name|auto>', "BODY placement: execute the job body on this machine over SSH (registered host, device, capability tag, or user@host), or 'auto' to pick a healthy, signed-in, unloaded fleet device AT EACH FIRE — the same picker as agents run --device auto. Sets hostStrategy=host ('auto' sets fleet). Distinct from the parent --device (which manages this DEFINITION on another machine) and from --devices (the scheduler firing allowlist).")
|
|
912
|
+
.option('--placement <strategy>', `BODY placement strategy: ${HOST_STRATEGIES.join('|')} (default: local, or host when --run-on is set). Maps to the shared Placement model (local|device|fleet|cloud). Not the same as --device (which manages routines on a remote machine).`)
|
|
1020
913
|
.option('--run-cwd <dir>', 'Working directory on the --run-on host (--remote-cwd is taken by the remote-management passthrough)')
|
|
1021
914
|
.option('--at <time>', 'One-shot mode: run once at this time (e.g., "14:30" or "2026-02-24 09:00"), then disable')
|
|
1022
915
|
.option('--on <source:event>', 'Webhook trigger instead of/in addition to a schedule: github:pull_request or linear:Issue')
|
|
@@ -1084,12 +977,53 @@ export function registerRoutinesCommands(program) {
|
|
|
1084
977
|
console.error(chalk.red('An agent, workflow, or command is required (use --agent, --workflow, or --command)'));
|
|
1085
978
|
process.exit(1);
|
|
1086
979
|
}
|
|
1087
|
-
//
|
|
1088
|
-
//
|
|
980
|
+
// Normalize `--agent <agent[@version]>` into separate bare agent +
|
|
981
|
+
// version fields, the same split `agents run` performs. Storing the raw
|
|
982
|
+
// compound string is the RUSH-2719 bug: validateJob compared
|
|
983
|
+
// 'claude@2.1.207' against bare AgentIds, and the deprecation gate below
|
|
984
|
+
// silently missed a hard-deprecated harness pinned with @version.
|
|
985
|
+
let parsedAgent;
|
|
1089
986
|
if (options.agent) {
|
|
1090
|
-
const
|
|
1091
|
-
if (
|
|
1092
|
-
console.error(chalk.red(
|
|
987
|
+
const parsed = parseAgentVersionSpec(options.agent);
|
|
988
|
+
if ('error' in parsed) {
|
|
989
|
+
console.error(chalk.red(parsed.error));
|
|
990
|
+
process.exit(1);
|
|
991
|
+
}
|
|
992
|
+
parsedAgent = parsed;
|
|
993
|
+
// Hard-deprecated harnesses cannot be scheduled — refuse at create time
|
|
994
|
+
// so no new recurring job silently fails against a retired backend.
|
|
995
|
+
if (isAgentHardDeprecated(parsed.agent)) {
|
|
996
|
+
console.error(chalk.red(hardDeprecationError(parsed.agent)));
|
|
997
|
+
process.exit(1);
|
|
998
|
+
}
|
|
999
|
+
}
|
|
1000
|
+
// --strategy / --balanced: per-routine selection policy, same vocabulary
|
|
1001
|
+
// as agents run. Rejected (not warned) against an @version pin: a warning
|
|
1002
|
+
// printed once at add time is easy to miss and the routine then silently
|
|
1003
|
+
// runs pinned forever.
|
|
1004
|
+
let strategy;
|
|
1005
|
+
if (options.strategy !== undefined || options.balanced) {
|
|
1006
|
+
if (options.strategy !== undefined && options.balanced) {
|
|
1007
|
+
console.error(chalk.red('--balanced conflicts with --strategy. Use one strategy override.'));
|
|
1008
|
+
process.exit(1);
|
|
1009
|
+
}
|
|
1010
|
+
if (!options.agent) {
|
|
1011
|
+
console.error(chalk.red('--strategy only applies to agent routines (set --agent)'));
|
|
1012
|
+
process.exit(1);
|
|
1013
|
+
}
|
|
1014
|
+
if (options.strategy !== undefined) {
|
|
1015
|
+
const normalized = normalizeRunStrategy(options.strategy);
|
|
1016
|
+
if (!normalized) {
|
|
1017
|
+
console.error(chalk.red(`Invalid strategy: ${options.strategy}. Use ${RUN_STRATEGIES.join(', ')}.`));
|
|
1018
|
+
process.exit(1);
|
|
1019
|
+
}
|
|
1020
|
+
strategy = normalized;
|
|
1021
|
+
}
|
|
1022
|
+
else {
|
|
1023
|
+
strategy = 'balanced';
|
|
1024
|
+
}
|
|
1025
|
+
if (parsedAgent?.version) {
|
|
1026
|
+
console.error(chalk.red(`--strategy ${strategy} conflicts with the @${parsedAgent.version} pin — an exact pin leaves nothing to select; drop --strategy or the @version pin`));
|
|
1093
1027
|
process.exit(1);
|
|
1094
1028
|
}
|
|
1095
1029
|
}
|
|
@@ -1139,18 +1073,31 @@ export function registerRoutinesCommands(program) {
|
|
|
1139
1073
|
console.error(chalk.red(err.message));
|
|
1140
1074
|
process.exit(1);
|
|
1141
1075
|
}
|
|
1142
|
-
// --run-on implies host strategy when the user didn't pick one
|
|
1076
|
+
// --run-on implies host strategy when the user didn't pick one;
|
|
1077
|
+
// 'auto' means fleet placement re-picked at each fire, never a literal
|
|
1078
|
+
// SSH target named "auto".
|
|
1143
1079
|
if (options.runOn && !hostStrategy)
|
|
1144
|
-
hostStrategy = 'host';
|
|
1080
|
+
hostStrategy = options.runOn === 'auto' ? 'fleet' : 'host';
|
|
1081
|
+
if (options.runOn === 'auto' && hostStrategy !== 'fleet') {
|
|
1082
|
+
console.error(chalk.red("--run-on auto is fleet placement — drop --placement, or use --placement fleet with it"));
|
|
1083
|
+
process.exit(1);
|
|
1084
|
+
}
|
|
1145
1085
|
if (hostStrategy === 'host' && !options.runOn) {
|
|
1146
1086
|
console.error(chalk.red('--placement host requires --run-on <name>'));
|
|
1147
1087
|
process.exit(1);
|
|
1148
1088
|
}
|
|
1089
|
+
// No devices auto-pin is needed for off-box placement: under the
|
|
1090
|
+
// per-device activation model (§8), a new routine is activated only on
|
|
1091
|
+
// the creating machine's device manifest (setJobEnabled below), so
|
|
1092
|
+
// exactly one daemon fires it unless it is deliberately enabled
|
|
1093
|
+
// elsewhere — the double-fire guard is structural now.
|
|
1149
1094
|
const config = {
|
|
1150
1095
|
name: nameOrPath,
|
|
1151
1096
|
...(schedule ? { schedule } : {}),
|
|
1152
1097
|
...(trigger ? { trigger } : {}),
|
|
1153
|
-
...(
|
|
1098
|
+
...(parsedAgent ? { agent: parsedAgent.agent } : {}),
|
|
1099
|
+
...(parsedAgent?.version ? { version: parsedAgent.version } : {}),
|
|
1100
|
+
...(strategy ? { strategy } : {}),
|
|
1154
1101
|
...(options.workflow ? { workflow: options.workflow } : {}),
|
|
1155
1102
|
...(options.command ? { command: options.command } : {}),
|
|
1156
1103
|
mode: options.mode,
|
|
@@ -1405,6 +1352,8 @@ export function registerRoutinesCommands(program) {
|
|
|
1405
1352
|
.option('--state-from <name>', 'Update the Linear previous-state filter before opening the editor')
|
|
1406
1353
|
.option('--cwd <path>', 'Set the execution directory and save, without opening an editor')
|
|
1407
1354
|
.option('--project-anchor <name>', 'Set the execution project anchor and save, without opening an editor')
|
|
1355
|
+
.option('--agent <agent[@version]>', 'Set the agent (and optional exact version pin) and save, without opening an editor — same syntax as agents run')
|
|
1356
|
+
.option('--strategy <strategy>', `Set the per-routine version/account selection strategy (${RUN_STRATEGIES.join(' | ')}) and save. Conflicts with an @version pin.`)
|
|
1408
1357
|
.action(async (name, options) => {
|
|
1409
1358
|
if (!name) {
|
|
1410
1359
|
name = await pickJob('Select job to edit', undefined, ['agents routines edit <name>']) ?? undefined;
|
|
@@ -1418,7 +1367,7 @@ export function registerRoutinesCommands(program) {
|
|
|
1418
1367
|
// and the only edit surface opened $EDITOR — so an agent could never
|
|
1419
1368
|
// follow its own repair hint (RUSH-2517). Applying and saving directly is
|
|
1420
1369
|
// what makes that hint true.
|
|
1421
|
-
if (options.cwd !== undefined || options.projectAnchor !== undefined) {
|
|
1370
|
+
if (options.cwd !== undefined || options.projectAnchor !== undefined || options.agent !== undefined || options.strategy !== undefined) {
|
|
1422
1371
|
if (!existing) {
|
|
1423
1372
|
console.error(chalk.red(`Routine '${name}' not found. Create it first: agents routines add ${name} --schedule "..." --agent claude --prompt "..."`));
|
|
1424
1373
|
process.exit(1);
|
|
@@ -1427,6 +1376,32 @@ export function registerRoutinesCommands(program) {
|
|
|
1427
1376
|
existing.cwd = options.cwd;
|
|
1428
1377
|
if (options.projectAnchor !== undefined)
|
|
1429
1378
|
existing.project = options.projectAnchor;
|
|
1379
|
+
if (options.agent !== undefined) {
|
|
1380
|
+
const parsed = parseAgentVersionSpec(options.agent);
|
|
1381
|
+
if ('error' in parsed) {
|
|
1382
|
+
console.error(chalk.red(parsed.error));
|
|
1383
|
+
process.exit(1);
|
|
1384
|
+
}
|
|
1385
|
+
if (isAgentHardDeprecated(parsed.agent)) {
|
|
1386
|
+
console.error(chalk.red(hardDeprecationError(parsed.agent)));
|
|
1387
|
+
process.exit(1);
|
|
1388
|
+
}
|
|
1389
|
+
existing.agent = parsed.agent;
|
|
1390
|
+
// An @version pin replaces any previous pin; a bare agent clears it so
|
|
1391
|
+
// the routine returns to strategy/balanced selection.
|
|
1392
|
+
if (parsed.version)
|
|
1393
|
+
existing.version = parsed.version;
|
|
1394
|
+
else
|
|
1395
|
+
delete existing.version;
|
|
1396
|
+
}
|
|
1397
|
+
if (options.strategy !== undefined) {
|
|
1398
|
+
const normalized = normalizeRunStrategy(options.strategy);
|
|
1399
|
+
if (!normalized) {
|
|
1400
|
+
console.error(chalk.red(`Invalid strategy: ${options.strategy}. Use ${RUN_STRATEGIES.join(', ')}.`));
|
|
1401
|
+
process.exit(1);
|
|
1402
|
+
}
|
|
1403
|
+
existing.strategy = normalized;
|
|
1404
|
+
}
|
|
1430
1405
|
const errors = validateJob(existing);
|
|
1431
1406
|
if (errors.length > 0) {
|
|
1432
1407
|
console.error(chalk.red('Validation errors:'));
|
|
@@ -2042,7 +2017,7 @@ export function registerRoutinesCommands(program) {
|
|
|
2042
2017
|
signalDaemonReload();
|
|
2043
2018
|
continue;
|
|
2044
2019
|
}
|
|
2045
|
-
const launch = getCliLaunch(['routines', action, name, '--
|
|
2020
|
+
const launch = getCliLaunch(['routines', action, name, '--device', device]);
|
|
2046
2021
|
const result = spawnSync(launch.command, launch.args, { stdio: 'inherit', env: process.env });
|
|
2047
2022
|
if ((result.status ?? 1) !== 0) {
|
|
2048
2023
|
if (isTarget) {
|
|
@@ -2261,7 +2236,7 @@ export function registerRoutinesCommands(program) {
|
|
|
2261
2236
|
console.log(chalk.gray('No scheduler logs'));
|
|
2262
2237
|
}
|
|
2263
2238
|
});
|
|
2264
|
-
// Every direct routines subcommand accepts the shared --
|
|
2239
|
+
// Every direct routines subcommand accepts the shared --device family so remote
|
|
2265
2240
|
// fall-through works and each subcommand's --help documents the flags.
|
|
2266
2241
|
for (const sub of routinesCmd.commands) {
|
|
2267
2242
|
addHostOption(sub);
|
package/dist/commands/rules.js
CHANGED
|
@@ -8,7 +8,7 @@ import { AGENTS, agentConfigDirName, MANAGED_AGENT_IDS, resolveAgentName, format
|
|
|
8
8
|
import { capableAgents } from '../lib/capabilities.js';
|
|
9
9
|
import { cloneRepo } from '../lib/git.js';
|
|
10
10
|
import { discoverInstructionsFromRepo, discoverRuleFilesFromRepo, installInstructionsCentrally, uninstallInstructions, listInstalledInstructionsWithScope, instructionsExists, getInstructionsContent, listCentralRules, } from '../lib/rules/rules.js';
|
|
11
|
-
import { listInstalledVersions, getGlobalDefault, resolveVersionAlias, syncResourcesToVersion, promptAgentVersionSelection, getVersionHomePath, } from '../lib/versions.js';
|
|
11
|
+
import { listInstalledVersions, getGlobalDefault, resolveVersionAlias, syncResourcesToVersion, promptAgentVersionSelection, getVersionHomePath, } from '../lib/installations/versions.js';
|
|
12
12
|
import { recordVersionResources, getActiveRulesPreset, setActiveRulesPreset } from '../lib/state.js';
|
|
13
13
|
import { discoverRulesLayers } from '../lib/rules/compose.js';
|
|
14
14
|
import * as yaml from 'yaml';
|
|
@@ -2,8 +2,8 @@ import { select } from '@inquirer/prompts';
|
|
|
2
2
|
import chalk from 'chalk';
|
|
3
3
|
import { agentLabel } from '../lib/agents.js';
|
|
4
4
|
import { loginHint } from '../lib/signin-badge.js';
|
|
5
|
-
import { collectRunCandidates, readinessFromCandidate, isSignInRecoverable, } from '../lib/rotate.js';
|
|
6
|
-
import { compareVersions, getGlobalDefault } from '../lib/versions.js';
|
|
5
|
+
import { collectRunCandidates, readinessFromCandidate, isSignInRecoverable, } from '../lib/accounting/rotate.js';
|
|
6
|
+
import { compareVersions, getGlobalDefault } from '../lib/installations/versions.js';
|
|
7
7
|
import { isInteractiveTerminal, isPromptCancelled, requireInteractiveSelection } from './utils.js';
|
|
8
8
|
const CANCEL_SELECTION = '__agents_cancel_account_selection__';
|
|
9
9
|
const WINDOW_ORDER = ['session', 'week', 'sonnet_week', 'month'];
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `agents run --broadcast` — run the same task/prompt across an agent × model
|
|
3
|
+
* matrix (formerly `agents bench`).
|
|
4
|
+
*
|
|
5
|
+
* Task definitions live under apps/cli/bench/tasks/<id>/task.json.
|
|
6
|
+
*/
|
|
7
|
+
export interface BroadcastOpts {
|
|
8
|
+
listTasks?: boolean;
|
|
9
|
+
results?: string | true;
|
|
10
|
+
task?: string;
|
|
11
|
+
model?: string;
|
|
12
|
+
concurrency?: string;
|
|
13
|
+
json?: boolean;
|
|
14
|
+
/** Comma-separated agents from the run [agent] positional when broadcasting. */
|
|
15
|
+
agentsCsv?: string;
|
|
16
|
+
prompt?: string;
|
|
17
|
+
/** When true, run the matrix (not just list/results). */
|
|
18
|
+
requireRun?: boolean;
|
|
19
|
+
}
|
|
20
|
+
/** Handle --broadcast / --list-tasks / --results on `agents run`. Always completes the path. */
|
|
21
|
+
export declare function handleBroadcast(opts: BroadcastOpts): Promise<void>;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `agents run --broadcast` — run the same task/prompt across an agent × model
|
|
3
|
+
* matrix (formerly `agents bench`).
|
|
4
|
+
*
|
|
5
|
+
* Task definitions live under apps/cli/bench/tasks/<id>/task.json.
|
|
6
|
+
*/
|
|
7
|
+
import * as fs from 'fs';
|
|
8
|
+
import * as path from 'path';
|
|
9
|
+
import { fileURLToPath } from 'url';
|
|
10
|
+
import { detectSignedInRuntimes } from '../lib/crabbox/runtimes.js';
|
|
11
|
+
import { listRuns, loadRun, loadTask, runCells, saveRun, } from '../lib/bench/index.js';
|
|
12
|
+
const TASKS_ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../../bench/tasks');
|
|
13
|
+
function csv(value) {
|
|
14
|
+
return (value
|
|
15
|
+
?.split(',')
|
|
16
|
+
.map((item) => item.trim())
|
|
17
|
+
.filter(Boolean) ?? []);
|
|
18
|
+
}
|
|
19
|
+
function taskIds(root = TASKS_ROOT) {
|
|
20
|
+
if (!fs.existsSync(root))
|
|
21
|
+
return [];
|
|
22
|
+
return fs
|
|
23
|
+
.readdirSync(root, { withFileTypes: true })
|
|
24
|
+
.filter((entry) => entry.isDirectory() &&
|
|
25
|
+
fs.existsSync(path.join(root, entry.name, 'task.json')))
|
|
26
|
+
.map((entry) => entry.name)
|
|
27
|
+
.sort();
|
|
28
|
+
}
|
|
29
|
+
function renderResult(result) {
|
|
30
|
+
console.log(`Run ${result.run_id}${result.task_id ? ` · ${result.task_id}` : ''}`);
|
|
31
|
+
for (const cell of result.cells)
|
|
32
|
+
console.log(`${cell.status === 'passed' ? 'PASS' : 'FAIL'} ${cell.agent}${cell.model ? `/${cell.model}` : ''} ${cell.wall_ms} ms exit ${cell.exit ?? 'spawn-error'}`);
|
|
33
|
+
}
|
|
34
|
+
/** Handle --broadcast / --list-tasks / --results on `agents run`. Always completes the path. */
|
|
35
|
+
export async function handleBroadcast(opts) {
|
|
36
|
+
if (opts.listTasks) {
|
|
37
|
+
const tasks = taskIds();
|
|
38
|
+
if (opts.json)
|
|
39
|
+
console.log(JSON.stringify(tasks, null, 2));
|
|
40
|
+
else if (tasks.length === 0)
|
|
41
|
+
console.log('No broadcast tasks installed.');
|
|
42
|
+
else
|
|
43
|
+
tasks.forEach((id) => console.log(id));
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
if (opts.results !== undefined) {
|
|
47
|
+
const runId = opts.results === true ? undefined : opts.results;
|
|
48
|
+
const value = runId ? loadRun(runId) : listRuns();
|
|
49
|
+
if (opts.json)
|
|
50
|
+
console.log(JSON.stringify(value, null, 2));
|
|
51
|
+
else if (Array.isArray(value)) {
|
|
52
|
+
if (value.length === 0)
|
|
53
|
+
console.log('No broadcast results yet.');
|
|
54
|
+
else
|
|
55
|
+
value.forEach(renderResult);
|
|
56
|
+
}
|
|
57
|
+
else
|
|
58
|
+
renderResult(value);
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
if (!opts.requireRun) {
|
|
62
|
+
throw new Error('Pass --broadcast with a prompt or --task <id>, or use --list-tasks / --results.');
|
|
63
|
+
}
|
|
64
|
+
if (!!opts.task === !!opts.prompt) {
|
|
65
|
+
throw new Error('Pass exactly one of --task <id> or a prompt with --broadcast.');
|
|
66
|
+
}
|
|
67
|
+
const task = opts.task ? loadTask(opts.task, TASKS_ROOT) : undefined;
|
|
68
|
+
const prompt = opts.prompt ?? task.prompt;
|
|
69
|
+
let agents = csv(opts.agentsCsv);
|
|
70
|
+
if (agents.length === 0) {
|
|
71
|
+
agents = (await detectSignedInRuntimes())
|
|
72
|
+
.filter((runtime) => runtime.signedIn)
|
|
73
|
+
.map((runtime) => runtime.id);
|
|
74
|
+
}
|
|
75
|
+
if (agents.length === 0) {
|
|
76
|
+
throw new Error('No signed-in native agents found. Pass comma-separated agents: agents run --broadcast claude,codex "…"');
|
|
77
|
+
}
|
|
78
|
+
const models = csv(opts.model);
|
|
79
|
+
const cells = agents.flatMap((agent) => models.length > 0 ? models.map((model) => ({ agent, model })) : [{ agent }]);
|
|
80
|
+
const concurrency = Number(opts.concurrency ?? '3');
|
|
81
|
+
const result = await runCells({ task, prompt, cells, concurrency });
|
|
82
|
+
saveRun(result);
|
|
83
|
+
if (opts.json)
|
|
84
|
+
console.log(JSON.stringify(result, null, 2));
|
|
85
|
+
else
|
|
86
|
+
renderResult(result);
|
|
87
|
+
if (result.cells.some((cell) => cell.status === 'failed'))
|
|
88
|
+
process.exitCode = 1;
|
|
89
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `agents run <agent> [prompt] --cloud` — the vendor-cloud placement for a run.
|
|
3
3
|
*
|
|
4
|
-
* One of three run placements: local (default), machine (--
|
|
4
|
+
* One of three run placements: local (default), machine (--device,
|
|
5
5
|
* --lease), cloud (--cloud). Routing goes through the cloud provider registry
|
|
6
6
|
* exactly like `agents cloud run --agent <agent>`: the agent's native
|
|
7
7
|
* `cloudProvider` wins, `--provider` overrides. The dispatch itself is the
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `agents secrets vault` — unlock/lock the age-encrypted synced-secrets file
|
|
3
|
+
* at ~/.agents/vault.age (distinct from `agents secrets unlock|lock`, which
|
|
4
|
+
* holds keychain bundles in the secrets-agent).
|
|
5
|
+
*
|
|
6
|
+
* Formerly top-level `agents login` / `agents logout`.
|
|
7
|
+
*/
|
|
8
|
+
import type { Command } from 'commander';
|
|
9
|
+
/** Register `agents secrets vault unlock|lock` under the secrets parent. */
|
|
10
|
+
export declare function registerSecretsVaultCommands(secretsCmd: Command): void;
|