@phnx-labs/agents-cli 1.22.35 → 1.22.38
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 +708 -2
- package/README.md +83 -43
- package/dist/bin/agents +0 -0
- package/dist/bootstrap.d.ts +15 -0
- package/dist/bootstrap.js +1212 -0
- package/dist/commands/accounts.d.ts +4 -11
- package/dist/commands/accounts.js +159 -27
- package/dist/commands/artifacts-setup.d.ts +53 -0
- package/dist/commands/artifacts-setup.js +161 -0
- package/dist/commands/artifacts.d.ts +18 -0
- package/dist/commands/artifacts.js +58 -0
- package/dist/commands/attach.js +17 -4
- package/dist/commands/audit.d.ts +8 -8
- package/dist/commands/audit.js +57 -47
- package/dist/commands/browser.js +17 -11
- package/dist/commands/cloud.js +1 -1
- package/dist/commands/commands.js +0 -11
- package/dist/commands/computer-actions.js +33 -0
- package/dist/commands/computer-sessions-picker.d.ts +21 -0
- package/dist/commands/computer-sessions-picker.js +141 -0
- package/dist/commands/computer.d.ts +16 -0
- package/dist/commands/computer.js +37 -0
- package/dist/commands/config.d.ts +17 -0
- package/dist/commands/config.js +401 -0
- package/dist/commands/cp.d.ts +84 -0
- package/dist/commands/cp.js +231 -0
- package/dist/commands/daemon.js +243 -14
- package/dist/commands/detach-core.d.ts +1 -1
- package/dist/commands/detach-core.js +12 -2
- package/dist/commands/detach.js +1 -1
- package/dist/commands/doctor.js +64 -5
- package/dist/commands/events.d.ts +24 -12
- package/dist/commands/events.js +144 -28
- package/dist/commands/exec.js +86 -42
- package/dist/commands/feed.d.ts +1 -1
- package/dist/commands/feed.js +16 -8
- package/dist/commands/focus.d.ts +33 -1
- package/dist/commands/focus.js +177 -17
- package/dist/commands/funnel.d.ts +1 -1
- package/dist/commands/go.js +9 -8
- package/dist/commands/harness-wizard.d.ts +1 -0
- package/dist/commands/harness-wizard.js +18 -20
- package/dist/commands/harness.d.ts +2 -0
- package/dist/commands/harness.js +59 -26
- package/dist/commands/hooks.js +0 -11
- package/dist/commands/inspect.d.ts +94 -1
- package/dist/commands/inspect.js +866 -40
- package/dist/commands/lease.d.ts +4 -4
- package/dist/commands/lease.js +6 -6
- package/dist/commands/login.js +0 -13
- package/dist/commands/logs.d.ts +2 -2
- package/dist/commands/logs.js +2 -2
- package/dist/commands/mcp.js +7 -2
- package/dist/commands/memory.js +7 -2
- package/dist/commands/message.d.ts +1 -1
- package/dist/commands/message.js +37 -6
- package/dist/commands/models.js +71 -0
- package/dist/commands/monitors.d.ts +0 -1
- package/dist/commands/monitors.js +199 -16
- package/dist/commands/open.d.ts +18 -0
- package/dist/commands/open.js +57 -0
- package/dist/commands/packages.js +2 -107
- package/dist/commands/plugins.js +6 -3
- package/dist/commands/profiles.d.ts +1 -0
- package/dist/commands/profiles.js +16 -160
- package/dist/commands/projects.d.ts +28 -0
- package/dist/commands/projects.js +125 -5
- package/dist/commands/reconnect.js +9 -3
- package/dist/commands/repo.js +42 -1
- package/dist/commands/resource-view.d.ts +17 -0
- package/dist/commands/resource-view.js +36 -14
- package/dist/commands/resume.js +9 -2
- package/dist/commands/routines.d.ts +0 -2
- package/dist/commands/routines.js +473 -289
- package/dist/commands/secrets.js +52 -9
- package/dist/commands/sessions-export.d.ts +47 -0
- package/dist/commands/sessions-export.js +116 -6
- package/dist/commands/sessions-import.d.ts +17 -0
- package/dist/commands/sessions-import.js +114 -6
- package/dist/commands/sessions-migrate.d.ts +27 -0
- package/dist/commands/sessions-migrate.js +50 -9
- package/dist/commands/sessions-picker.js +23 -4
- package/dist/commands/sessions-resume.d.ts +5 -3
- package/dist/commands/sessions-resume.js +30 -8
- package/dist/commands/sessions-watch.d.ts +2 -0
- package/dist/commands/sessions-watch.js +53 -0
- package/dist/commands/sessions.d.ts +66 -3
- package/dist/commands/sessions.js +298 -47
- package/dist/commands/setup-browser.js +2 -2
- package/dist/commands/setup-mine.js +0 -1
- package/dist/commands/setup-preferences.js +1 -1
- package/dist/commands/setup.d.ts +5 -0
- package/dist/commands/setup.js +31 -5
- package/dist/commands/share.d.ts +87 -7
- package/dist/commands/share.js +320 -58
- package/dist/commands/skills.js +0 -11
- package/dist/commands/snapshot.js +1 -1
- package/dist/commands/ssh.d.ts +18 -0
- package/dist/commands/ssh.js +549 -210
- package/dist/commands/sync.d.ts +5 -0
- package/dist/commands/sync.js +212 -32
- package/dist/commands/teams.d.ts +13 -0
- package/dist/commands/teams.js +187 -30
- package/dist/commands/tickets.d.ts +2 -0
- package/dist/commands/tickets.js +43 -0
- package/dist/commands/update.js +2 -4
- package/dist/commands/usage.js +5 -3
- package/dist/commands/versions.js +11 -5
- package/dist/commands/view.js +15 -7
- package/dist/commands/webhook.d.ts +2 -2
- package/dist/commands/webhook.js +7 -7
- package/dist/index.d.ts +18 -2
- package/dist/index.js +53 -1264
- package/dist/lib/account-catalog.d.ts +18 -0
- package/dist/lib/account-catalog.js +38 -0
- package/dist/lib/account-provider-registry.d.ts +18 -0
- package/dist/lib/account-provider-registry.js +59 -0
- package/dist/lib/account-registry.d.ts +40 -0
- package/dist/lib/account-registry.js +239 -0
- package/dist/lib/account-schema.d.ts +44 -0
- package/dist/lib/account-schema.js +91 -0
- package/dist/lib/account-state-service.d.ts +21 -0
- package/dist/lib/account-state-service.js +60 -0
- package/dist/lib/activity.d.ts +1 -1
- package/dist/lib/activity.js +8 -1
- package/dist/lib/add-dir.d.ts +80 -0
- package/dist/lib/add-dir.js +241 -0
- package/dist/lib/agent-cli-commands.d.ts +11 -0
- package/dist/lib/agent-cli-commands.js +30 -0
- package/dist/lib/agents.js +44 -36
- package/dist/lib/answer-router.js +1 -1
- package/dist/lib/audit/log.d.ts +10 -27
- package/dist/lib/audit/log.js +20 -33
- package/dist/lib/auth-health.d.ts +9 -2
- package/dist/lib/auth-health.js +42 -9
- package/dist/lib/auto-pull-worker.js +7 -3
- package/dist/lib/auto-pull.d.ts +44 -3
- package/dist/lib/auto-pull.js +88 -5
- package/dist/lib/binary-shadow.d.ts +28 -0
- package/dist/lib/binary-shadow.js +121 -0
- package/dist/lib/brand.js +9 -3
- package/dist/lib/browser/hygiene.d.ts +90 -0
- package/dist/lib/browser/hygiene.js +146 -0
- package/dist/lib/browser/ipc.d.ts +30 -0
- package/dist/lib/browser/ipc.js +93 -4
- package/dist/lib/browser/profiles.d.ts +3 -2
- package/dist/lib/browser/profiles.js +65 -22
- package/dist/lib/browser/service.d.ts +79 -1
- package/dist/lib/browser/service.js +231 -14
- package/dist/lib/browser/sessions-list.d.ts +22 -2
- package/dist/lib/browser/sessions-list.js +54 -6
- package/dist/lib/browser/stream.d.ts +2 -0
- package/dist/lib/browser/stream.js +1 -0
- package/dist/lib/browser/types.d.ts +63 -1
- package/dist/lib/byok-usage.d.ts +9 -2
- package/dist/lib/byok-usage.js +133 -31
- package/dist/lib/cli-entry.d.ts +11 -0
- package/dist/lib/cli-entry.js +46 -0
- package/dist/lib/cloud/host.d.ts +1 -1
- package/dist/lib/cloud/host.js +2 -2
- package/dist/lib/cloud/registry.js +1 -1
- package/dist/lib/cloud/types.d.ts +1 -1
- package/dist/lib/commands.d.ts +2 -0
- package/dist/lib/commands.js +2 -0
- package/dist/lib/computer/sessions-list.d.ts +150 -0
- package/dist/lib/computer/sessions-list.js +363 -0
- package/dist/lib/config-keys.d.ts +86 -0
- package/dist/lib/config-keys.js +193 -0
- package/dist/lib/config-machine-keys.d.ts +12 -0
- package/dist/lib/config-machine-keys.js +17 -0
- package/dist/lib/config-transfer.js +3 -4
- package/dist/lib/crabbox/cli.d.ts +2 -2
- package/dist/lib/crabbox/cli.js +3 -3
- package/dist/lib/daemon-health.d.ts +22 -0
- package/dist/lib/daemon-health.js +33 -3
- package/dist/lib/daemon-services.d.ts +50 -0
- package/dist/lib/daemon-services.js +147 -0
- package/dist/lib/daemon-ticks.d.ts +35 -66
- package/dist/lib/daemon-ticks.js +77 -159
- package/dist/lib/daemon.d.ts +72 -4
- package/dist/lib/daemon.js +792 -202
- package/dist/lib/deeplink/register.d.ts +49 -0
- package/dist/lib/deeplink/register.js +253 -0
- package/dist/lib/deeplink/url.d.ts +34 -0
- package/dist/lib/deeplink/url.js +78 -0
- package/dist/lib/device-config.d.ts +124 -29
- package/dist/lib/device-config.js +346 -141
- package/dist/lib/devices/config-migration.d.ts +42 -0
- package/dist/lib/devices/config-migration.js +203 -0
- package/dist/lib/devices/connect.js +14 -7
- package/dist/lib/devices/doctor-findings.d.ts +4 -1
- package/dist/lib/devices/doctor-findings.js +20 -1
- package/dist/lib/devices/harness-inventory.d.ts +11 -2
- package/dist/lib/devices/harness-inventory.js +0 -0
- package/dist/lib/devices/health.d.ts +1 -1
- package/dist/lib/devices/health.js +1 -1
- package/dist/lib/devices/pending.d.ts +22 -1
- package/dist/lib/devices/pending.js +67 -2
- package/dist/lib/devices/registry.d.ts +0 -25
- package/dist/lib/devices/registry.js +2 -83
- package/dist/lib/devices/resolve-profile.d.ts +20 -0
- package/dist/lib/devices/resolve-profile.js +44 -0
- package/dist/lib/devices/rollout-verify.d.ts +101 -0
- package/dist/lib/devices/rollout-verify.js +193 -0
- package/dist/lib/devices/ssh-config.js +10 -6
- package/dist/lib/event-families.d.ts +28 -0
- package/dist/lib/event-families.js +159 -0
- package/dist/lib/event-stream.d.ts +9 -1
- package/dist/lib/event-stream.js +26 -9
- package/dist/lib/events.d.ts +9 -1
- package/dist/lib/events.js +21 -6
- package/dist/lib/exec.d.ts +30 -0
- package/dist/lib/exec.js +219 -121
- package/dist/lib/feed-broadcast.d.ts +25 -0
- package/dist/lib/feed-broadcast.js +33 -0
- package/dist/lib/feed.d.ts +1 -1
- package/dist/lib/feed.js +12 -2
- package/dist/lib/fleet/capture.js +15 -0
- package/dist/lib/fleet/manifest.js +9 -0
- package/dist/lib/fleet/types.d.ts +9 -0
- package/dist/lib/fleet-status.js +10 -8
- package/dist/lib/git.d.ts +21 -7
- package/dist/lib/git.js +122 -18
- package/dist/lib/hosts/dispatch.d.ts +8 -3
- package/dist/lib/hosts/dispatch.js +29 -3
- package/dist/lib/hosts/logs.d.ts +2 -2
- package/dist/lib/hosts/logs.js +2 -2
- package/dist/lib/hosts/option.js +1 -1
- package/dist/lib/hosts/passthrough.d.ts +2 -3
- package/dist/lib/hosts/passthrough.js +10 -24
- package/dist/lib/hosts/progress.js +2 -2
- package/dist/lib/hosts/providers/devices.d.ts +3 -3
- package/dist/lib/hosts/providers/devices.js +18 -12
- package/dist/lib/hosts/ready.d.ts +5 -1
- package/dist/lib/hosts/ready.js +9 -3
- package/dist/lib/hosts/reconcile.d.ts +2 -2
- package/dist/lib/hosts/reconcile.js +2 -2
- package/dist/lib/hosts/registry.js +14 -9
- package/dist/lib/hosts/remote-cmd.js +1 -1
- package/dist/lib/hosts/remote-os.d.ts +9 -6
- package/dist/lib/hosts/remote-os.js +13 -6
- package/dist/lib/hosts/routing-flag.d.ts +23 -0
- package/dist/lib/hosts/routing-flag.js +41 -0
- package/dist/lib/hosts/run-target.js +1 -1
- package/dist/lib/hosts/session-index.js +1 -1
- package/dist/lib/hosts/tasks.d.ts +6 -6
- package/dist/lib/hosts/tasks.js +4 -4
- package/dist/lib/hosts/types.js +1 -2
- package/dist/lib/installations/resolve.js +2 -8
- package/dist/lib/isolation-boundary-report.js +0 -1
- package/dist/lib/linear-cache.d.ts +7 -0
- package/dist/lib/linear-cache.js +31 -4
- package/dist/lib/linear-project-counts.d.ts +1 -1
- package/dist/lib/linear-project-counts.js +2 -3
- package/dist/lib/linear-projects.js +1 -1
- package/dist/lib/loop.d.ts +2 -2
- package/dist/lib/loop.js +1 -1
- package/dist/lib/mailbox-target.d.ts +1 -1
- package/dist/lib/mailbox-target.js +1 -1
- package/dist/lib/manifest.js +7 -4
- 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/snapshot.d.ts +3 -2
- package/dist/lib/menubar/snapshot.js +6 -2
- package/dist/lib/migrate-fold.d.ts +33 -0
- package/dist/lib/migrate-fold.js +130 -0
- package/dist/lib/migrate.d.ts +34 -34
- package/dist/lib/migrate.js +106 -128
- package/dist/lib/model-tier-overrides.d.ts +1 -1
- package/dist/lib/model-tier-overrides.js +15 -2
- package/dist/lib/monitors/config.d.ts +17 -3
- package/dist/lib/monitors/config.js +52 -18
- package/dist/lib/monitors/engine.d.ts +32 -1
- package/dist/lib/monitors/engine.js +94 -11
- package/dist/lib/monitors/fingerprint.d.ts +46 -0
- package/dist/lib/monitors/fingerprint.js +100 -0
- package/dist/lib/monitors/remote.d.ts +47 -0
- package/dist/lib/monitors/remote.js +81 -0
- package/dist/lib/monitors/state.d.ts +39 -0
- package/dist/lib/monitors/state.js +56 -0
- package/dist/lib/onepassword.d.ts +17 -0
- package/dist/lib/onepassword.js +52 -22
- package/dist/lib/open-url.js +1 -1
- package/dist/lib/picker.d.ts +14 -2
- package/dist/lib/picker.js +35 -13
- package/dist/lib/placement.d.ts +1 -1
- package/dist/lib/placement.js +1 -1
- package/dist/lib/pr-land-detach.d.ts +32 -0
- package/dist/lib/pr-land-detach.js +79 -0
- package/dist/lib/profiles-presets.js +13 -0
- package/dist/lib/profiles.d.ts +2 -0
- package/dist/lib/profiles.js +44 -1
- package/dist/lib/project-focus.d.ts +1 -1
- package/dist/lib/project-focus.js +1 -1
- package/dist/lib/project-probe.d.ts +4 -1
- package/dist/lib/project-probe.js +5 -4
- package/dist/lib/project-resources.js +2 -18
- package/dist/lib/project-root.d.ts +16 -0
- package/dist/lib/project-root.js +20 -2
- package/dist/lib/projects.d.ts +20 -1
- package/dist/lib/projects.js +78 -1
- package/dist/lib/refresh-coordinator.d.ts +24 -0
- package/dist/lib/refresh-coordinator.js +52 -0
- package/dist/lib/registry.d.ts +2 -2
- package/dist/lib/registry.js +1 -1
- package/dist/lib/resource-aliases.d.ts +13 -0
- package/dist/lib/resource-aliases.js +26 -0
- package/dist/lib/resources/types.d.ts +1 -1
- package/dist/lib/resources.d.ts +16 -0
- package/dist/lib/resources.js +66 -10
- package/dist/lib/rotate.d.ts +3 -4
- package/dist/lib/rotate.js +4 -5
- package/dist/lib/routine-activation.d.ts +22 -2
- package/dist/lib/routine-activation.js +63 -16
- package/dist/lib/routine-context.d.ts +9 -2
- package/dist/lib/routine-context.js +21 -6
- package/dist/lib/routines-project.d.ts +58 -48
- package/dist/lib/routines-project.js +190 -159
- package/dist/lib/routines.d.ts +44 -7
- package/dist/lib/routines.js +92 -34
- package/dist/lib/run-defaults.d.ts +5 -0
- package/dist/lib/run-defaults.js +11 -1
- package/dist/lib/runner.d.ts +10 -8
- package/dist/lib/runner.js +122 -39
- 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.d.ts +10 -3
- package/dist/lib/secrets/agent.js +43 -8
- package/dist/lib/secrets/bundles.d.ts +1 -0
- package/dist/lib/secrets/bundles.js +92 -80
- package/dist/lib/secrets/index.js +32 -9
- package/dist/lib/secrets/install-helper.d.ts +4 -4
- package/dist/lib/secrets/install-helper.js +4 -4
- package/dist/lib/secrets/push.d.ts +40 -6
- package/dist/lib/secrets/push.js +58 -11
- package/dist/lib/secrets/read-backoff.d.ts +1 -1
- package/dist/lib/secrets/read-backoff.js +1 -1
- package/dist/lib/secrets/remote.d.ts +24 -0
- package/dist/lib/secrets/remote.js +54 -4
- package/dist/lib/self-update.d.ts +108 -0
- package/dist/lib/self-update.js +276 -1
- package/dist/lib/session/active.d.ts +89 -5
- package/dist/lib/session/active.js +165 -10
- package/dist/lib/session/actor-sidecar.d.ts +1 -1
- package/dist/lib/session/actor-sidecar.js +2 -1
- package/dist/lib/session/db.d.ts +176 -2
- package/dist/lib/session/db.js +484 -17
- package/dist/lib/session/discover.js +27 -4
- package/dist/lib/session/hook-sessions.js +2 -2
- package/dist/lib/session/host-link.d.ts +2 -2
- package/dist/lib/session/host-link.js +2 -2
- package/dist/lib/session/pid-registry.d.ts +21 -0
- package/dist/lib/session/pid-registry.js +57 -0
- package/dist/lib/session/remote-active.js +15 -1
- package/dist/lib/session/remote.js +2 -2
- package/dist/lib/session/session-cache.d.ts +14 -7
- package/dist/lib/session/session-cache.js +51 -9
- package/dist/lib/session/state.d.ts +2 -2
- package/dist/lib/session/state.js +1 -1
- package/dist/lib/session/sync/config.d.ts +10 -10
- package/dist/lib/session/sync/config.js +10 -10
- package/dist/lib/session/sync/r2.d.ts +34 -0
- package/dist/lib/session/sync/r2.js +123 -0
- package/dist/lib/session/throughput.d.ts +1 -1
- package/dist/lib/session/throughput.js +1 -1
- package/dist/lib/session/types.d.ts +23 -1
- package/dist/lib/session/types.js +15 -0
- package/dist/lib/session/viewing-in.d.ts +1 -1
- package/dist/lib/session/viewing-in.js +1 -1
- package/dist/lib/session/watch.d.ts +101 -0
- package/dist/lib/session/watch.js +242 -0
- package/dist/lib/share/analytics.js +1 -1
- package/dist/lib/share/capture.d.ts +1 -1
- package/dist/lib/share/capture.js +3 -3
- package/dist/lib/share/config.d.ts +6 -2
- package/dist/lib/share/config.js +6 -5
- package/dist/lib/share/delete.js +3 -3
- package/dist/lib/share/provision.d.ts +38 -0
- package/dist/lib/share/provision.js +51 -1
- package/dist/lib/share/publish.d.ts +40 -1
- package/dist/lib/share/publish.js +119 -6
- package/dist/lib/share/worker-template.d.ts +12 -1
- package/dist/lib/share/worker-template.js +83 -7
- package/dist/lib/shims.d.ts +17 -3
- package/dist/lib/shims.js +98 -26
- package/dist/lib/signin-badge.js +3 -2
- package/dist/lib/skills.js +2 -0
- package/dist/lib/smart-launch.d.ts +8 -8
- package/dist/lib/smart-launch.js +80 -59
- package/dist/lib/ssh-exec.d.ts +1 -1
- package/dist/lib/ssh-exec.js +1 -1
- package/dist/lib/staleness/prune.d.ts +88 -0
- package/dist/lib/staleness/prune.js +69 -0
- package/dist/lib/staleness/registry.d.ts +1 -1
- package/dist/lib/staleness/writers/commands.js +34 -2
- package/dist/lib/staleness/writers/hooks.js +16 -0
- package/dist/lib/staleness/writers/kinds.d.ts +6 -0
- package/dist/lib/staleness/writers/skills.js +19 -0
- package/dist/lib/staleness/writers/subagents.d.ts +2 -3
- package/dist/lib/staleness/writers/subagents.js +0 -4
- package/dist/lib/staleness/writers/types.d.ts +32 -0
- package/dist/lib/startup/command-registry.d.ts +16 -14
- package/dist/lib/startup/command-registry.js +26 -37
- package/dist/lib/startup/dev-build.d.ts +10 -0
- package/dist/lib/startup/dev-build.js +13 -1
- package/dist/lib/startup/spellcheck.d.ts +18 -0
- package/dist/lib/startup/spellcheck.js +45 -0
- package/dist/lib/state.d.ts +36 -9
- package/dist/lib/state.js +96 -46
- package/dist/lib/subagents-registry.d.ts +0 -7
- package/dist/lib/subagents-registry.js +38 -65
- package/dist/lib/subagents.d.ts +0 -33
- package/dist/lib/subagents.js +0 -75
- package/dist/lib/sync-umbrella.js +1 -1
- package/dist/lib/teams/agents.d.ts +41 -1
- package/dist/lib/teams/agents.js +187 -9
- package/dist/lib/teams/api.d.ts +11 -1
- package/dist/lib/teams/api.js +11 -2
- package/dist/lib/teams/delivery.d.ts +41 -0
- package/dist/lib/teams/delivery.js +60 -0
- package/dist/lib/teams/registry.d.ts +14 -0
- package/dist/lib/teams/registry.js +51 -1
- package/dist/lib/teams/remoteWorktree.d.ts +19 -0
- package/dist/lib/teams/remoteWorktree.js +29 -0
- package/dist/lib/teams/scheduler.d.ts +1 -1
- package/dist/lib/teams/scheduler.js +1 -1
- package/dist/lib/teams/worktree.d.ts +24 -0
- package/dist/lib/teams/worktree.js +42 -0
- package/dist/lib/terminal/backends/vscodium-agent.d.ts +10 -1
- package/dist/lib/terminal/backends/vscodium-agent.js +16 -5
- package/dist/lib/terminal/engine.d.ts +4 -0
- package/dist/lib/terminal/engine.js +8 -2
- package/dist/lib/terminal/types.d.ts +21 -2
- package/dist/lib/testdata/refresh-coordinator-worker.d.ts +1 -0
- package/dist/lib/testdata/refresh-coordinator-worker.js +23 -0
- package/dist/lib/tickets/list.d.ts +53 -0
- package/dist/lib/tickets/list.js +153 -0
- package/dist/lib/tmux/orphan-reap.d.ts +316 -0
- package/dist/lib/tmux/orphan-reap.js +638 -0
- package/dist/lib/tmux/session.d.ts +68 -3
- package/dist/lib/tmux/session.js +96 -5
- package/dist/lib/triggers/handlers.d.ts +20 -0
- package/dist/lib/triggers/handlers.js +16 -1
- package/dist/lib/triggers/webhook.js +10 -0
- package/dist/lib/types.d.ts +47 -35
- package/dist/lib/usage-fleet.d.ts +32 -0
- package/dist/lib/usage-fleet.js +125 -0
- package/dist/lib/usage-refresh.d.ts +3 -3
- package/dist/lib/usage-refresh.js +19 -16
- package/dist/lib/usage.d.ts +51 -47
- package/dist/lib/usage.js +145 -153
- package/dist/lib/version-duplicates.js +2 -2
- package/dist/lib/versions.d.ts +56 -13
- package/dist/lib/versions.js +195 -45
- package/dist/lib/watchdog/log.d.ts +1 -1
- package/dist/lib/watchdog/log.js +3 -3
- package/dist/lib/watchdog/rotate.d.ts +6 -6
- package/dist/lib/watchdog/rotate.js +6 -6
- package/dist/lib/workflows.d.ts +1 -1
- package/dist/lib/yaml-io.d.ts +47 -0
- package/dist/lib/yaml-io.js +55 -0
- package/package.json +2 -1
- package/scripts/install-helper.js +2 -2
- package/scripts/postinstall.js +23 -20
- package/dist/commands/defaults.d.ts +0 -7
- package/dist/commands/defaults.js +0 -107
- package/dist/commands/export.d.ts +0 -11
- package/dist/commands/export.js +0 -215
- package/dist/commands/helper.d.ts +0 -12
- package/dist/commands/helper.js +0 -87
- package/dist/commands/hosts.d.ts +0 -11
- package/dist/commands/hosts.js +0 -330
- package/dist/commands/lock.d.ts +0 -12
- package/dist/commands/lock.js +0 -70
- package/dist/commands/pull.d.ts +0 -17
- package/dist/commands/pull.js +0 -39
- package/dist/commands/push.d.ts +0 -14
- package/dist/commands/push.js +0 -30
- package/dist/commands/set.d.ts +0 -15
- package/dist/commands/set.js +0 -79
- package/dist/commands/setup-share.d.ts +0 -17
- package/dist/commands/setup-share.js +0 -85
- package/dist/commands/wallet.d.ts +0 -20
- package/dist/commands/wallet.js +0 -216
- package/dist/commands/worktree.d.ts +0 -19
- package/dist/commands/worktree.js +0 -272
- package/dist/lib/account-labels.d.ts +0 -24
- package/dist/lib/account-labels.js +0 -72
- package/dist/lib/auto-dispatch-linear.d.ts +0 -18
- package/dist/lib/auto-dispatch-linear.js +0 -107
- package/dist/lib/auto-dispatch-provider.d.ts +0 -10
- package/dist/lib/auto-dispatch-provider.js +0 -30
- package/dist/lib/auto-dispatch.d.ts +0 -93
- package/dist/lib/auto-dispatch.js +0 -128
- package/dist/lib/export.d.ts +0 -72
- package/dist/lib/export.js +0 -269
- package/dist/lib/lock.d.ts +0 -93
- package/dist/lib/lock.js +0 -207
- package/dist/lib/wallet/index.d.ts +0 -78
- package/dist/lib/wallet/index.js +0 -253
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
* Bridges the devices registry (`agents devices`, ~/.agents/.history/devices/
|
|
5
5
|
* registry.json) into the host pool behind the same `HostProvider` seam as
|
|
6
6
|
* `local` — the "tailscale provider" fast-follow named in docs/hosts.md. With
|
|
7
|
-
* it, a machine registered once via `agents devices sync`
|
|
8
|
-
* `
|
|
9
|
-
* by target pickers — not just resolvable by exact name.
|
|
7
|
+
* it, a machine registered once via `agents devices sync` becomes a resolvable
|
|
8
|
+
* `--host`/`--device` dispatch target, participates in capability routing, and
|
|
9
|
+
* is enumerable by target pickers — not just resolvable by exact name.
|
|
10
10
|
*
|
|
11
11
|
* Password-auth devices are listed (the pool stays honest about what exists)
|
|
12
12
|
* but marked `dispatchable: false`; resolving one for dispatch throws the same
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
* order, exactly like the old tier-2 devices fall-through in resolveHost.
|
|
19
19
|
*/
|
|
20
20
|
import { loadDevices, getDevice, isControlDevice } from '../../devices/registry.js';
|
|
21
|
+
import { resolveDeviceProfile } from '../../devices/resolve-profile.js';
|
|
21
22
|
import { DeviceOffloadUnsupportedError } from '../types.js';
|
|
22
23
|
/** Tailscale's own presence bit, when the sync captured one. */
|
|
23
24
|
function statusOf(device) {
|
|
@@ -28,17 +29,19 @@ function statusOf(device) {
|
|
|
28
29
|
/**
|
|
29
30
|
* Bridge a device profile into a `Host`. dnsName (stable across IP churn) is
|
|
30
31
|
* preferred over ip; `source: 'inline'` makes `sshTargetFor` emit `user@address`.
|
|
31
|
-
* Capability tags
|
|
32
|
-
*
|
|
33
|
-
*
|
|
32
|
+
* Capability tags come from an enrolled overlay entry for the device in
|
|
33
|
+
* agents.yaml (`Meta.hosts`) — that entry shadows this row by provider
|
|
34
|
+
* precedence, carrying the caps.
|
|
34
35
|
*/
|
|
35
|
-
function deviceToPoolHost(
|
|
36
|
+
function deviceToPoolHost(rawDevice) {
|
|
36
37
|
// A control device (a cockpit, e.g. a paired iPhone) drives the fleet but
|
|
37
38
|
// never runs agents — it must never enter the host pool or be resolvable as a
|
|
38
39
|
// dispatch target, whatever platform it reports (an iPhone syncs as `unknown`,
|
|
39
40
|
// which remoteShellFor would otherwise default to POSIX and try to SSH).
|
|
40
|
-
if (isControlDevice(
|
|
41
|
+
if (isControlDevice(rawDevice))
|
|
41
42
|
return null;
|
|
43
|
+
// Effective profile: central config (ssh.*/platform) overlays discovery.
|
|
44
|
+
const device = resolveDeviceProfile(rawDevice);
|
|
42
45
|
const address = device.address.dnsName ?? device.address.ip;
|
|
43
46
|
if (!address)
|
|
44
47
|
return null; // unreachable profile — nothing to dispatch to
|
|
@@ -72,15 +75,18 @@ export class DevicesHostProvider {
|
|
|
72
75
|
return out.sort((a, b) => a.name.localeCompare(b.name));
|
|
73
76
|
}
|
|
74
77
|
async resolve(name) {
|
|
75
|
-
const
|
|
76
|
-
if (!
|
|
78
|
+
const raw = await getDevice(name);
|
|
79
|
+
if (!raw)
|
|
77
80
|
return null;
|
|
78
81
|
// Resolving is asking to dispatch. A control device can't run agents — fail
|
|
79
82
|
// loud with a clear message instead of attempting an SSH dispatch onto a
|
|
80
83
|
// phone (which remoteShellFor would treat as a POSIX host).
|
|
81
|
-
if (isControlDevice(
|
|
82
|
-
throw new Error(`Device "${
|
|
84
|
+
if (isControlDevice(raw)) {
|
|
85
|
+
throw new Error(`Device "${raw.name}" is a control device (a cockpit), not an executor — it can't run agents. Dispatch to a worker device instead.`);
|
|
83
86
|
}
|
|
87
|
+
// Effective profile: central config (ssh.*/platform) overlays discovery —
|
|
88
|
+
// the password-auth refusal and the dial shape both follow the config.
|
|
89
|
+
const device = resolveDeviceProfile(raw);
|
|
84
90
|
// Keep the long-standing typed refusal for password auth (BatchMode=yes
|
|
85
91
|
// can't answer a prompt).
|
|
86
92
|
if (device.auth.method === 'password') {
|
|
@@ -88,7 +88,11 @@ export declare function viewAgentVersions(view: string, agent: string): string[]
|
|
|
88
88
|
export declare function viewHasAgentVersion(view: string, agent: string, version: string): boolean | undefined;
|
|
89
89
|
/** Actionable fail-loud message for a missing remote pin (RUSH-2313). */
|
|
90
90
|
export declare function missingPinnedVersionMessage(hostName: string, agent: string, version: string, installed?: string[]): string;
|
|
91
|
-
/**
|
|
91
|
+
/**
|
|
92
|
+
* Read whether the requested harness has at least one launch-eligible account
|
|
93
|
+
* from `agents view --json`. Signed-in accounts that are rate-limited or out of
|
|
94
|
+
* credits are deliberately false so automatic placement cannot select them.
|
|
95
|
+
*/
|
|
92
96
|
export declare function viewAgentSignedIn(view: string, agent: string): boolean | undefined;
|
|
93
97
|
export interface EnsureReadyOptions {
|
|
94
98
|
agent: string;
|
package/dist/lib/hosts/ready.js
CHANGED
|
@@ -207,7 +207,11 @@ export function missingPinnedVersionMessage(hostName, agent, version, installed)
|
|
|
207
207
|
return (`Pinned ${agent}@${version} is not installed on "${hostName}".${installedHint} ` +
|
|
208
208
|
`Install it on that box: agents ssh ${hostName} -- agents add ${agent}@${version}`);
|
|
209
209
|
}
|
|
210
|
-
/**
|
|
210
|
+
/**
|
|
211
|
+
* Read whether the requested harness has at least one launch-eligible account
|
|
212
|
+
* from `agents view --json`. Signed-in accounts that are rate-limited or out of
|
|
213
|
+
* credits are deliberately false so automatic placement cannot select them.
|
|
214
|
+
*/
|
|
211
215
|
export function viewAgentSignedIn(view, agent) {
|
|
212
216
|
try {
|
|
213
217
|
const rows = JSON.parse(view);
|
|
@@ -215,7 +219,9 @@ export function viewAgentSignedIn(view, agent) {
|
|
|
215
219
|
if (!row)
|
|
216
220
|
return undefined;
|
|
217
221
|
const verdicts = (row.versions ?? [])
|
|
218
|
-
.map((version) => version.signedIn
|
|
222
|
+
.map((version) => typeof version.signedIn === 'boolean'
|
|
223
|
+
? version.signedIn && version.usageStatus !== 'rate_limited' && version.usageStatus !== 'out_of_credits'
|
|
224
|
+
: undefined)
|
|
219
225
|
.filter((value) => typeof value === 'boolean');
|
|
220
226
|
return verdicts.length === 0 ? undefined : verdicts.some(Boolean);
|
|
221
227
|
}
|
|
@@ -270,7 +276,7 @@ export function ensureHostReady(host, opts) {
|
|
|
270
276
|
throw new Error(`Host "${host.name}" (${target}) is not reachable over SSH. Check it's online and key auth works.`);
|
|
271
277
|
}
|
|
272
278
|
if (!probe.version) {
|
|
273
|
-
throw new Error(`agents-cli is not installed on "${host.name}".
|
|
279
|
+
throw new Error(`agents-cli is not installed on "${host.name}". Install it there first — e.g. \`agents devices update\` to roll it out to registered devices.`);
|
|
274
280
|
}
|
|
275
281
|
return evaluateHostAgentInstall(probe.view, opts, host.name);
|
|
276
282
|
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* the SSH connection drops mid-follow. When that happens the local record is
|
|
7
7
|
* left at `status:'running'` forever, because the only path that finalizes it
|
|
8
8
|
* (dispatch's post-follow `updateTask`) never runs. This module re-reads the
|
|
9
|
-
* remote `.exit` on demand — from `agents
|
|
9
|
+
* remote `.exit` on demand — from `agents devices ps` / `agents logs` — and heals the
|
|
10
10
|
* record. We only ever CONFIRM completion; an unreachable host or an absent
|
|
11
11
|
* `.exit` leaves the record `running` (we never guess failure).
|
|
12
12
|
*/
|
|
@@ -43,7 +43,7 @@ export declare function readRemoteExit(target: string, remoteExit: string, timeo
|
|
|
43
43
|
*/
|
|
44
44
|
export declare function reconcileTask(task: HostTask): HostTask;
|
|
45
45
|
/**
|
|
46
|
-
* Heal a list of records for a listing (`agents
|
|
46
|
+
* Heal a list of records for a listing (`agents devices ps`). Only `running` tasks
|
|
47
47
|
* are probed; each host is reachability-checked ONCE (deduped by target) so a
|
|
48
48
|
* down host costs a single short timeout instead of one per task, and its tasks
|
|
49
49
|
* are left `running` rather than falsely failed. Sequential by design — with the
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* the SSH connection drops mid-follow. When that happens the local record is
|
|
7
7
|
* left at `status:'running'` forever, because the only path that finalizes it
|
|
8
8
|
* (dispatch's post-follow `updateTask`) never runs. This module re-reads the
|
|
9
|
-
* remote `.exit` on demand — from `agents
|
|
9
|
+
* remote `.exit` on demand — from `agents devices ps` / `agents logs` — and heals the
|
|
10
10
|
* record. We only ever CONFIRM completion; an unreachable host or an absent
|
|
11
11
|
* `.exit` leaves the record `running` (we never guess failure).
|
|
12
12
|
*/
|
|
@@ -60,7 +60,7 @@ export function reconcileTask(task) {
|
|
|
60
60
|
return updateTask(task.id, terminalPatch(st.code)) ?? task;
|
|
61
61
|
}
|
|
62
62
|
/**
|
|
63
|
-
* Heal a list of records for a listing (`agents
|
|
63
|
+
* Heal a list of records for a listing (`agents devices ps`). Only `running` tasks
|
|
64
64
|
* are probed; each host is reachability-checked ONCE (deduped by target) so a
|
|
65
65
|
* down host costs a single short timeout instead of one per task, and its tasks
|
|
66
66
|
* are left `running` rather than falsely failed. Sequential by design — with the
|
|
@@ -25,6 +25,7 @@ import { readMeta } from '../state.js';
|
|
|
25
25
|
import { isSshConfigHost } from './ssh-config.js';
|
|
26
26
|
import { resolveRemoteOsSync } from './remote-os.js';
|
|
27
27
|
import { loadDevices, isControlDevice } from '../devices/registry.js';
|
|
28
|
+
import { resolveDeviceProfile } from '../devices/resolve-profile.js';
|
|
28
29
|
import { isDeviceAuto, resolveDeviceAffinity } from '../smart-launch.js';
|
|
29
30
|
import { localMachineId } from '../session/origin-machine.js';
|
|
30
31
|
// Re-export so existing importers (tests, commands) keep their path; the class
|
|
@@ -87,20 +88,24 @@ function deviceStatus(device) {
|
|
|
87
88
|
* device can never be made dispatchable by shadowing it with an inline entry.
|
|
88
89
|
*/
|
|
89
90
|
function deviceHost(device, user, overlay) {
|
|
90
|
-
|
|
91
|
+
// Effective profile: the central config's ssh.*/platform keys overlay the
|
|
92
|
+
// discovery record, so an operator edit via `agents devices config` is
|
|
93
|
+
// honored at dispatch time.
|
|
94
|
+
const resolved = resolveDeviceProfile(device);
|
|
95
|
+
const address = resolved.address.dnsName ?? resolved.address.ip;
|
|
91
96
|
return {
|
|
92
|
-
name:
|
|
97
|
+
name: resolved.name,
|
|
93
98
|
provider: 'devices',
|
|
94
99
|
source: 'inline',
|
|
95
100
|
...(address ? { address } : {}),
|
|
96
|
-
user: user ??
|
|
97
|
-
identityFile:
|
|
98
|
-
os:
|
|
101
|
+
user: user ?? resolved.user,
|
|
102
|
+
identityFile: resolved.auth.identityFile,
|
|
103
|
+
os: resolved.platform !== 'unknown' ? resolved.platform : overlay?.os,
|
|
99
104
|
...(overlay?.caps?.length ? { caps: overlay.caps } : {}),
|
|
100
105
|
enrolled: true,
|
|
101
|
-
status: deviceStatus(
|
|
102
|
-
dispatchable:
|
|
103
|
-
device,
|
|
106
|
+
status: deviceStatus(resolved),
|
|
107
|
+
dispatchable: resolved.auth.method !== 'password',
|
|
108
|
+
device: resolved,
|
|
104
109
|
};
|
|
105
110
|
}
|
|
106
111
|
/** Build a Host from a bare overlay entry (inline or ssh-config), applying any
|
|
@@ -270,7 +275,7 @@ export async function resolveHostByCap(cap, any = false) {
|
|
|
270
275
|
// must never be picked as a run target.
|
|
271
276
|
const matches = (await listAllHosts()).filter((h) => h.caps?.includes(cap) && h.dispatchable !== false);
|
|
272
277
|
if (matches.length === 0)
|
|
273
|
-
throw new Error(`No host tagged "${cap}".
|
|
278
|
+
throw new Error(`No host tagged "${cap}". See registered devices: agents devices list`);
|
|
274
279
|
if (matches.length > 1 && !any) {
|
|
275
280
|
throw new Error(`Multiple hosts tagged "${cap}": ${matches.map((h) => h.name).join(', ')}. Name one, or pass --any.`);
|
|
276
281
|
}
|
|
@@ -140,7 +140,7 @@ export const RUN_OPTION_FORWARDING = {
|
|
|
140
140
|
export const RUN_OPTION_REJECT_MESSAGES = {
|
|
141
141
|
terminal: '--terminal opens a tab on THIS machine; it cannot be combined with --host. ' +
|
|
142
142
|
'Drop --terminal to dispatch to the host, or drop --host to open the tab here. ' +
|
|
143
|
-
'To watch a remote run in a terminal, dispatch it and follow with `agents sessions
|
|
143
|
+
'To watch a remote run in a terminal, dispatch it and follow with `agents sessions resume <id>`.',
|
|
144
144
|
secrets: '--secrets cannot cross the SSH boundary — Keychain values are never sent to a host implicitly. ' +
|
|
145
145
|
'Provision the bundle on the host first (agents secrets export --host <name>), then run without --secrets; ' +
|
|
146
146
|
'workflow frontmatter secrets resolve from the HOST\'s own keychain.',
|
|
@@ -3,15 +3,18 @@
|
|
|
3
3
|
* shell dialect (POSIX `bash -lc` vs Windows PowerShell). See `remoteShellFor`
|
|
4
4
|
* in `remote-cmd.ts` for how the string is consumed.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
* 1. The
|
|
6
|
+
* Three sources, in priority order:
|
|
7
|
+
* 1. The central config `platform` key (`fleet.devices.<name>.config.platform`
|
|
8
|
+
* in agents.yaml) — the operator's explicit override, set with
|
|
9
|
+
* `agents devices config <name> platform <os>`.
|
|
10
|
+
* 2. The device registry `platform` (`windows`/`linux`/`macos`), which is
|
|
8
11
|
* populated fleet-wide by Tailscale sync — the reliable answer for a box
|
|
9
12
|
* like `win-mini` that was discovered, not hand-enrolled.
|
|
10
|
-
*
|
|
11
|
-
*
|
|
13
|
+
* 3. The enrolled `HostEntry.os` overlay in agents.yaml (the `uname` captured
|
|
14
|
+
* when the overlay entry was written), for hosts that live only in that overlay.
|
|
12
15
|
*
|
|
13
|
-
* Missing/unknown from
|
|
14
|
-
* Kept synchronous so the sync `agents sessions --host` fan-out can use it.
|
|
16
|
+
* Missing/unknown from all three → `undefined`, which `remoteShellFor` maps to
|
|
17
|
+
* POSIX. Kept synchronous so the sync `agents sessions --host` fan-out can use it.
|
|
15
18
|
*/
|
|
16
19
|
/** Resolve the OS/platform string for a host name, or undefined if unknown. */
|
|
17
20
|
export declare function resolveRemoteOsSync(name: string): string | undefined;
|
|
@@ -3,21 +3,28 @@
|
|
|
3
3
|
* shell dialect (POSIX `bash -lc` vs Windows PowerShell). See `remoteShellFor`
|
|
4
4
|
* in `remote-cmd.ts` for how the string is consumed.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
* 1. The
|
|
6
|
+
* Three sources, in priority order:
|
|
7
|
+
* 1. The central config `platform` key (`fleet.devices.<name>.config.platform`
|
|
8
|
+
* in agents.yaml) — the operator's explicit override, set with
|
|
9
|
+
* `agents devices config <name> platform <os>`.
|
|
10
|
+
* 2. The device registry `platform` (`windows`/`linux`/`macos`), which is
|
|
8
11
|
* populated fleet-wide by Tailscale sync — the reliable answer for a box
|
|
9
12
|
* like `win-mini` that was discovered, not hand-enrolled.
|
|
10
|
-
*
|
|
11
|
-
*
|
|
13
|
+
* 3. The enrolled `HostEntry.os` overlay in agents.yaml (the `uname` captured
|
|
14
|
+
* when the overlay entry was written), for hosts that live only in that overlay.
|
|
12
15
|
*
|
|
13
|
-
* Missing/unknown from
|
|
14
|
-
* Kept synchronous so the sync `agents sessions --host` fan-out can use it.
|
|
16
|
+
* Missing/unknown from all three → `undefined`, which `remoteShellFor` maps to
|
|
17
|
+
* POSIX. Kept synchronous so the sync `agents sessions --host` fan-out can use it.
|
|
15
18
|
*/
|
|
16
19
|
import { loadDevicesSync } from '../devices/registry.js';
|
|
20
|
+
import { readDeviceConfigValues } from '../device-config.js';
|
|
17
21
|
import { readMeta } from '../state.js';
|
|
18
22
|
/** Resolve the OS/platform string for a host name, or undefined if unknown. */
|
|
19
23
|
export function resolveRemoteOsSync(name) {
|
|
20
24
|
try {
|
|
25
|
+
const configured = readDeviceConfigValues(name).platform;
|
|
26
|
+
if (typeof configured === 'string' && configured !== 'unknown')
|
|
27
|
+
return configured;
|
|
21
28
|
const platform = loadDevicesSync()[name]?.platform;
|
|
22
29
|
if (platform && platform !== 'unknown')
|
|
23
30
|
return platform;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Leaf argv helpers for host/device routing flags.
|
|
3
|
+
*
|
|
4
|
+
* Zero imports on purpose. `bootstrap.ts` gates the dynamic
|
|
5
|
+
* `import('./lib/hosts/passthrough.js')` on {@link hasHostRoutingFlag} so the
|
|
6
|
+
* ~187 ms passthrough module graph is never loaded when no routing flag is
|
|
7
|
+
* present (the majority of CLI invocations). That gate must not itself drag
|
|
8
|
+
* in passthrough, remote-cmd, ssh-exec, or the device registry (RUSH-2374).
|
|
9
|
+
*
|
|
10
|
+
* `flagValue` lives here (not in passthrough.ts) for the same reason: the gate
|
|
11
|
+
* and the function body that later reads flag values share one implementation.
|
|
12
|
+
*/
|
|
13
|
+
/** Pull the value of `--host`/`-H`/`--remote-cwd` (any form) out of an argv. */
|
|
14
|
+
export declare function flagValue(args: string[], long: string, short?: string): string | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* True when argv carries any host/device routing flag that {@link maybeRunOnHost}
|
|
17
|
+
* inspects: `--host`/`-H`, `--device`, `--hosts`, `--devices` (space, `=`, or
|
|
18
|
+
* glued short form).
|
|
19
|
+
*
|
|
20
|
+
* Presence-only — does not validate values. Used by bootstrap before loading
|
|
21
|
+
* passthrough, and by `maybeRunStandaloneOnHost` before strip/route work.
|
|
22
|
+
*/
|
|
23
|
+
export declare function hasHostRoutingFlag(args: string[]): boolean;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Leaf argv helpers for host/device routing flags.
|
|
3
|
+
*
|
|
4
|
+
* Zero imports on purpose. `bootstrap.ts` gates the dynamic
|
|
5
|
+
* `import('./lib/hosts/passthrough.js')` on {@link hasHostRoutingFlag} so the
|
|
6
|
+
* ~187 ms passthrough module graph is never loaded when no routing flag is
|
|
7
|
+
* present (the majority of CLI invocations). That gate must not itself drag
|
|
8
|
+
* in passthrough, remote-cmd, ssh-exec, or the device registry (RUSH-2374).
|
|
9
|
+
*
|
|
10
|
+
* `flagValue` lives here (not in passthrough.ts) for the same reason: the gate
|
|
11
|
+
* and the function body that later reads flag values share one implementation.
|
|
12
|
+
*/
|
|
13
|
+
/** Pull the value of `--host`/`-H`/`--remote-cwd` (any form) out of an argv. */
|
|
14
|
+
export function flagValue(args, long, short) {
|
|
15
|
+
for (let i = 0; i < args.length; i++) {
|
|
16
|
+
const a = args[i];
|
|
17
|
+
if (a === `--${long}` || (short && a === `-${short}`))
|
|
18
|
+
return args[i + 1];
|
|
19
|
+
if (a.startsWith(`--${long}=`))
|
|
20
|
+
return a.slice(long.length + 3);
|
|
21
|
+
if (short && a.startsWith(`-${short}=`))
|
|
22
|
+
return a.slice(short.length + 2);
|
|
23
|
+
if (short && new RegExp(`^-${short}(.+)`).test(a))
|
|
24
|
+
return a.slice(2);
|
|
25
|
+
}
|
|
26
|
+
return undefined;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* True when argv carries any host/device routing flag that {@link maybeRunOnHost}
|
|
30
|
+
* inspects: `--host`/`-H`, `--device`, `--hosts`, `--devices` (space, `=`, or
|
|
31
|
+
* glued short form).
|
|
32
|
+
*
|
|
33
|
+
* Presence-only — does not validate values. Used by bootstrap before loading
|
|
34
|
+
* passthrough, and by `maybeRunStandaloneOnHost` before strip/route work.
|
|
35
|
+
*/
|
|
36
|
+
export function hasHostRoutingFlag(args) {
|
|
37
|
+
return (flagValue(args, 'host', 'H') !== undefined ||
|
|
38
|
+
flagValue(args, 'device') !== undefined ||
|
|
39
|
+
flagValue(args, 'hosts') !== undefined ||
|
|
40
|
+
flagValue(args, 'devices') !== undefined);
|
|
41
|
+
}
|
|
@@ -50,7 +50,7 @@ export async function resolveHostRunTarget(name, opts = {}) {
|
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
if (!host)
|
|
53
|
-
throw new HostResolutionError(`Unknown host "${name}". List
|
|
53
|
+
throw new HostResolutionError(`Unknown host "${name}". List devices: agents devices list`);
|
|
54
54
|
return host;
|
|
55
55
|
}
|
|
56
56
|
/** Resolve the id the remote host will adopt for a fresh Claude session. */
|
|
@@ -46,7 +46,7 @@ export function hostSessionMeta(task, ctx) {
|
|
|
46
46
|
machine: normalizeHost(task.host),
|
|
47
47
|
topic: ctx.prompt.split('\n')[0]?.slice(0, 120) || undefined,
|
|
48
48
|
// The run's `--name` seeds the label (resolves `agents sessions <name>` and
|
|
49
|
-
// `agents
|
|
49
|
+
// `agents logs <name>`); an unnamed host run falls back to the
|
|
50
50
|
// `[host/<name>]` indicator, mirroring the cloud path's `[cloud/<status>]`.
|
|
51
51
|
label: task.name || `[host/${task.host}]`,
|
|
52
52
|
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Local record of dispatched host tasks.
|
|
3
3
|
*
|
|
4
4
|
* Each dispatch writes a `<id>.json` sidecar next to its `<id>.log` (and the
|
|
5
|
-
* remote's `<id>.exit`) under ~/.agents/.cache/hosts/, so `agents
|
|
5
|
+
* remote's `<id>.exit`) under ~/.agents/.cache/hosts/, so `agents devices ps` / `agents logs`
|
|
6
6
|
* can list runs and follow output across CLI invocations. (Folding these into
|
|
7
7
|
* the cloud SQLite store so `agents cloud ps` sees them is a fast-follow — it
|
|
8
8
|
* needs care around the cloud status-refresh path.)
|
|
@@ -20,8 +20,8 @@ export interface HostTask {
|
|
|
20
20
|
pid?: number;
|
|
21
21
|
/**
|
|
22
22
|
* The durable `agents run --name <slug>` handle for this dispatch, if given.
|
|
23
|
-
* Chosen at launch and agent-agnostic (unlike sessionId), so `agents
|
|
24
|
-
* ps/logs <name>` and the dispatch tip can reference the run by a stable name
|
|
23
|
+
* Chosen at launch and agent-agnostic (unlike sessionId), so `agents devices
|
|
24
|
+
* ps` / `agents logs <name>` and the dispatch tip can reference the run by a stable name
|
|
25
25
|
* even for agents that never expose a session id up front. Absent when the
|
|
26
26
|
* run was launched without `--name`.
|
|
27
27
|
*/
|
|
@@ -68,14 +68,14 @@ export declare function listTasks(): HostTask[];
|
|
|
68
68
|
*/
|
|
69
69
|
export declare function findTaskBySessionId(sessionId: string): HostTask | null;
|
|
70
70
|
/**
|
|
71
|
-
* Find the newest host task launched with `--name <name>`, so `agents
|
|
72
|
-
*
|
|
71
|
+
* Find the newest host task launched with `--name <name>`, so `agents logs
|
|
72
|
+
* <name>` / `agents devices ps` and resolve-by-handle can address a run by its durable name.
|
|
73
73
|
* Case-insensitive; newest wins (listTasks is createdAt-desc) when a name was
|
|
74
74
|
* reused across dispatches.
|
|
75
75
|
*/
|
|
76
76
|
export declare function findTaskByName(name: string): HostTask | null;
|
|
77
77
|
/**
|
|
78
|
-
* Resolve a host-task reference the way `agents
|
|
78
|
+
* Resolve a host-task reference the way `agents devices ps`, `agents logs`, and `agents devices stop` do: a raw
|
|
79
79
|
* dispatch id first, then a `--name` handle, then the remote agent/session id.
|
|
80
80
|
* Shared so any other caller resolving "does this ref name a detached --device
|
|
81
81
|
* dispatch?" (e.g. `agents message`) uses the identical three-way lookup.
|
package/dist/lib/hosts/tasks.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Local record of dispatched host tasks.
|
|
3
3
|
*
|
|
4
4
|
* Each dispatch writes a `<id>.json` sidecar next to its `<id>.log` (and the
|
|
5
|
-
* remote's `<id>.exit`) under ~/.agents/.cache/hosts/, so `agents
|
|
5
|
+
* remote's `<id>.exit`) under ~/.agents/.cache/hosts/, so `agents devices ps` / `agents logs`
|
|
6
6
|
* can list runs and follow output across CLI invocations. (Folding these into
|
|
7
7
|
* the cloud SQLite store so `agents cloud ps` sees them is a fast-follow — it
|
|
8
8
|
* needs care around the cloud status-refresh path.)
|
|
@@ -86,8 +86,8 @@ export function findTaskBySessionId(sessionId) {
|
|
|
86
86
|
return null;
|
|
87
87
|
}
|
|
88
88
|
/**
|
|
89
|
-
* Find the newest host task launched with `--name <name>`, so `agents
|
|
90
|
-
*
|
|
89
|
+
* Find the newest host task launched with `--name <name>`, so `agents logs
|
|
90
|
+
* <name>` / `agents devices ps` and resolve-by-handle can address a run by its durable name.
|
|
91
91
|
* Case-insensitive; newest wins (listTasks is createdAt-desc) when a name was
|
|
92
92
|
* reused across dispatches.
|
|
93
93
|
*/
|
|
@@ -102,7 +102,7 @@ export function findTaskByName(name) {
|
|
|
102
102
|
return null;
|
|
103
103
|
}
|
|
104
104
|
/**
|
|
105
|
-
* Resolve a host-task reference the way `agents
|
|
105
|
+
* Resolve a host-task reference the way `agents devices ps`, `agents logs`, and `agents devices stop` do: a raw
|
|
106
106
|
* dispatch id first, then a `--name` handle, then the remote agent/session id.
|
|
107
107
|
* Shared so any other caller resolving "does this ref name a detached --device
|
|
108
108
|
* dispatch?" (e.g. `agents message`) uses the identical three-way lookup.
|
package/dist/lib/hosts/types.js
CHANGED
|
@@ -20,8 +20,7 @@ export class DeviceOffloadUnsupportedError extends Error {
|
|
|
20
20
|
constructor(name) {
|
|
21
21
|
super(`Device "${name}" uses password auth, which --host offload can't use yet ` +
|
|
22
22
|
`(runs go over ssh with BatchMode=yes). Switch it to key auth with ` +
|
|
23
|
-
`\`agents devices
|
|
24
|
-
`\`agents hosts add ${name}\`.`);
|
|
23
|
+
`\`agents devices config ${name} ssh.auth key\`.`);
|
|
25
24
|
this.name = 'DeviceOffloadUnsupportedError';
|
|
26
25
|
}
|
|
27
26
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { resolveAccountLabel } from '../account-labels.js';
|
|
2
1
|
import { AGENTS } from '../agents.js';
|
|
3
2
|
import { getGlobalDefault } from '../versions.js';
|
|
4
3
|
import { listInstallations } from './store.js';
|
|
@@ -37,7 +36,7 @@ export class InstallationAmbiguousError extends Error {
|
|
|
37
36
|
constructor(agent, selector, candidates) {
|
|
38
37
|
super(`'${selector ?? agent}' matches ${candidates.length} ${AGENTS[agent].name} installations `
|
|
39
38
|
+ `(${candidates.map((i) => describeInstallation(i)).join(', ')}). `
|
|
40
|
-
+ `
|
|
39
|
+
+ `Select one by its installation label.`);
|
|
41
40
|
this.agent = agent;
|
|
42
41
|
this.selector = selector;
|
|
43
42
|
this.candidates = candidates;
|
|
@@ -63,12 +62,7 @@ export async function resolveInstallation(agent, selector, options = {}) {
|
|
|
63
62
|
throw new InstallationNotFoundError(agent, selector, all);
|
|
64
63
|
let candidates = all;
|
|
65
64
|
if (options.account) {
|
|
66
|
-
|
|
67
|
-
// is signed into that account — i.e. an installation label.
|
|
68
|
-
const label = await resolveAccountLabel(agent, options.account);
|
|
69
|
-
candidates = candidates.filter((i) => i.label === label);
|
|
70
|
-
if (candidates.length === 0)
|
|
71
|
-
throw new InstallationNotFoundError(agent, selector, all);
|
|
65
|
+
throw new Error("--account no longer selects an installation. Account names are durable credentials used by 'agents run --account'; select the installation by its label instead.");
|
|
72
66
|
}
|
|
73
67
|
if (selector) {
|
|
74
68
|
const byLabel = candidates.filter((i) => i.label === selector);
|
|
@@ -14,7 +14,6 @@ export function explainIsolationBoundary(err) {
|
|
|
14
14
|
console.error(chalk.gray('\n To keep the sandbox and act inside it:'));
|
|
15
15
|
console.error(chalk.gray(` agents add ${err.agent}@<version> --isolated # another isolated copy`));
|
|
16
16
|
console.error(chalk.gray(` agents use ${err.agent}@<version> # pick which one 'agents run ${err.agent}' uses`));
|
|
17
|
-
console.error(chalk.gray(` agents export ${err.agent} # copy its config out to your real config dir`));
|
|
18
17
|
console.error(chalk.gray('\n To manage this agent normally instead, remove the isolated copies first:'));
|
|
19
18
|
for (const v of versions) {
|
|
20
19
|
console.error(chalk.gray(` agents remove ${err.agent}@${v} --isolated`));
|
|
@@ -34,6 +34,13 @@
|
|
|
34
34
|
*/
|
|
35
35
|
/** Matches `SKILL_INDEX_TTL_MS` (`lib/registry.ts`) — the repo's TTL convention. */
|
|
36
36
|
export declare const LINEAR_CACHE_TTL_MS: number;
|
|
37
|
+
/**
|
|
38
|
+
* Resolve the Linear API key from the `LINEAR_API_KEY` env var, falling back to
|
|
39
|
+
* the macOS keychain generic-password `linear-api-key` (how the rest of the
|
|
40
|
+
* stack stores it). Null if none is resolvable. The shared resolver for every
|
|
41
|
+
* Linear-touching surface (project counts, session discovery).
|
|
42
|
+
*/
|
|
43
|
+
export declare function resolveLinearApiKey(): string | null;
|
|
37
44
|
/** What a lookup found, and how much to trust it. */
|
|
38
45
|
export interface CacheHit<T> {
|
|
39
46
|
value: T;
|
package/dist/lib/linear-cache.js
CHANGED
|
@@ -32,19 +32,46 @@
|
|
|
32
32
|
* populated chip to empty — and it is the fix for the card silently losing its
|
|
33
33
|
* Linear line mid-session when the request budget ran out.
|
|
34
34
|
*/
|
|
35
|
+
import { execFileSync } from 'child_process';
|
|
35
36
|
import * as fs from 'fs';
|
|
36
37
|
import * as path from 'path';
|
|
37
38
|
import { getCacheDir } from './state.js';
|
|
38
39
|
/** Matches `SKILL_INDEX_TTL_MS` (`lib/registry.ts`) — the repo's TTL convention. */
|
|
39
40
|
export const LINEAR_CACHE_TTL_MS = 10 * 60_000;
|
|
41
|
+
/**
|
|
42
|
+
* Resolve the Linear API key from the `LINEAR_API_KEY` env var, falling back to
|
|
43
|
+
* the macOS keychain generic-password `linear-api-key` (how the rest of the
|
|
44
|
+
* stack stores it). Null if none is resolvable. The shared resolver for every
|
|
45
|
+
* Linear-touching surface (project counts, session discovery).
|
|
46
|
+
*/
|
|
47
|
+
export function resolveLinearApiKey() {
|
|
48
|
+
const fromEnv = process.env.LINEAR_API_KEY?.trim();
|
|
49
|
+
if (fromEnv)
|
|
50
|
+
return fromEnv;
|
|
51
|
+
if (process.platform === 'darwin') {
|
|
52
|
+
try {
|
|
53
|
+
const out = execFileSync('security', ['find-generic-password', '-s', 'linear-api-key', '-w'], {
|
|
54
|
+
encoding: 'utf-8',
|
|
55
|
+
stdio: ['ignore', 'pipe', 'ignore'],
|
|
56
|
+
});
|
|
57
|
+
const key = out.trim();
|
|
58
|
+
if (key)
|
|
59
|
+
return key;
|
|
60
|
+
}
|
|
61
|
+
catch {
|
|
62
|
+
// not in keychain — fall through
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
40
67
|
const CACHE_SUBDIR = 'linear-projects';
|
|
41
68
|
/** Sits beside the per-project files; its own file, so it cannot be clobbered by them. */
|
|
42
69
|
const RATE_LIMIT_FILE = 'rate-limit.json';
|
|
43
70
|
/**
|
|
44
|
-
* Where the snapshot lives. `AGENTS_LINEAR_CACHE_PATH` overrides the directory
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
71
|
+
* Where the snapshot lives. `AGENTS_LINEAR_CACHE_PATH` overrides the directory.
|
|
72
|
+
* `getCacheDir()` resolves `HOME` once at module load, so a test that swaps
|
|
73
|
+
* `process.env.HOME` afterwards would otherwise read and WRITE the developer's
|
|
74
|
+
* real cache.
|
|
48
75
|
*/
|
|
49
76
|
function cacheDir() {
|
|
50
77
|
return process.env.AGENTS_LINEAR_CACHE_PATH ?? path.join(getCacheDir(), CACHE_SUBDIR);
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* `agents projects link <name> --linear`), the card shows one outcome line —
|
|
6
6
|
* `12/30 done · 5 in progress` — counted from the Linear GraphQL API by state
|
|
7
7
|
* TYPE (triage / backlog / unstarted / started / completed / canceled), never
|
|
8
|
-
* hardcoded state names
|
|
8
|
+
* hardcoded state names.
|
|
9
9
|
*
|
|
10
10
|
* The same fetch also yields the **next milestone** — the earliest-dated
|
|
11
11
|
* milestone with unfinished issues — because each issue node carries its
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* `agents projects link <name> --linear`), the card shows one outcome line —
|
|
6
6
|
* `12/30 done · 5 in progress` — counted from the Linear GraphQL API by state
|
|
7
7
|
* TYPE (triage / backlog / unstarted / started / completed / canceled), never
|
|
8
|
-
* hardcoded state names
|
|
8
|
+
* hardcoded state names.
|
|
9
9
|
*
|
|
10
10
|
* The same fetch also yields the **next milestone** — the earliest-dated
|
|
11
11
|
* milestone with unfinished issues — because each issue node carries its
|
|
@@ -27,8 +27,7 @@
|
|
|
27
27
|
import * as fs from 'fs';
|
|
28
28
|
import * as os from 'os';
|
|
29
29
|
import * as path from 'path';
|
|
30
|
-
import { resolveLinearApiKey } from './
|
|
31
|
-
import { isRateLimited, noteRateLimited, parseRateLimitReset, readCached, writeCached } from './linear-cache.js';
|
|
30
|
+
import { isRateLimited, noteRateLimited, parseRateLimitReset, readCached, writeCached, resolveLinearApiKey } from './linear-cache.js';
|
|
32
31
|
const LINEAR_API = 'https://api.linear.app/graphql';
|
|
33
32
|
/** Overall budget across all pages — the card must never hang on Linear. */
|
|
34
33
|
const TIMEOUT_MS = 8_000;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
// key so they compare equal, and matchLinearProject() binds a repo/folder to the
|
|
7
7
|
// Linear project the user most likely means.
|
|
8
8
|
//
|
|
9
|
-
// Ported from apps/
|
|
9
|
+
// Ported from apps/ext/src/core/linearProjects.ts (no cross-package imports —
|
|
10
10
|
// repo rule); keep the two in sync. The matcher half is PURE so it unit-tests
|
|
11
11
|
// without a live `linear` binary; the `linear projects --json` shell-out lives at
|
|
12
12
|
// the bottom (listLinearProjects) and fails LOUD — it's behind an explicit user
|
package/dist/lib/loop.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* can spawn subagents freely). Every guard — `max_iterations`, `budget`, the
|
|
7
7
|
* `until: signal` condition, SIGINT/SIGTERM — lives OUTSIDE the agent, so the
|
|
8
8
|
* agent cannot vote past a kill-switch (the standard answer to runaway-loop and
|
|
9
|
-
* runaway-cost failure modes; see docs/
|
|
9
|
+
* runaway-cost failure modes; see docs/entrypoints-and-loops.md).
|
|
10
10
|
*
|
|
11
11
|
* Structure mirrors the teams supervisor (`runSupervisor` in teams/supervisor.ts):
|
|
12
12
|
* a bounded for-loop with a hard cap, a SIGINT/SIGTERM trap that flips a stop
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
import type { AgentId } from './types.js';
|
|
22
22
|
import type { ExecOptions } from './exec.js';
|
|
23
23
|
import { type Checkpoint } from './checkpoint.js';
|
|
24
|
-
/** Loop block config (docs/
|
|
24
|
+
/** Loop block config (docs/entrypoints-and-loops.md → "The loop block"). */
|
|
25
25
|
export interface LoopConfig {
|
|
26
26
|
/** Stop condition. `signal` reads loop-signal.json; absence is fail-closed. */
|
|
27
27
|
until?: 'signal';
|
package/dist/lib/loop.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* can spawn subagents freely). Every guard — `max_iterations`, `budget`, the
|
|
7
7
|
* `until: signal` condition, SIGINT/SIGTERM — lives OUTSIDE the agent, so the
|
|
8
8
|
* agent cannot vote past a kill-switch (the standard answer to runaway-loop and
|
|
9
|
-
* runaway-cost failure modes; see docs/
|
|
9
|
+
* runaway-cost failure modes; see docs/entrypoints-and-loops.md).
|
|
10
10
|
*
|
|
11
11
|
* Structure mirrors the teams supervisor (`runSupervisor` in teams/supervisor.ts):
|
|
12
12
|
* a bounded for-loop with a hard cap, a SIGINT/SIGTERM trap that flips a stop
|
|
@@ -52,7 +52,7 @@ export type HostTaskRoute = {
|
|
|
52
52
|
* local/cloud session (RUSH-2366 follow-up): `getActiveSessions()` has no
|
|
53
53
|
* visibility into a detached `agents run --device <host> --no-follow`
|
|
54
54
|
* dispatch, whose only local record is the `~/.agents/.cache/hosts/<id>.json`
|
|
55
|
-
* sidecar `agents
|
|
55
|
+
* sidecar `agents devices ps` reads. Pure — the caller does the actual lookup
|
|
56
56
|
* (`resolveTaskRef`) and I/O (the ssh reroute).
|
|
57
57
|
*
|
|
58
58
|
* `remoteRef` prefers the remote agent's OWN identity (its captured session id
|