@phnx-labs/agents-cli 1.22.38 → 1.22.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +302 -0
- package/README.md +111 -70
- package/dist/bin/agents +0 -0
- package/dist/bootstrap.js +46 -27
- package/dist/browser.js +2 -2
- package/dist/cli/command-registry.d.ts +135 -0
- package/dist/cli/command-registry.js +260 -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.js +206 -94
- 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 +47 -4
- 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 +161 -216
- package/dist/commands/factory.js +1 -1
- package/dist/commands/feed.d.ts +2 -2
- package/dist/commands/feed.js +9 -12
- 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 +72 -63
- 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 +13 -0
- package/dist/commands/sessions-picker.js +182 -8
- package/dist/commands/sessions-resume.d.ts +7 -3
- package/dist/commands/sessions-resume.js +81 -33
- package/dist/commands/sessions-stats.js +2 -2
- package/dist/commands/sessions.d.ts +75 -68
- package/dist/commands/sessions.js +142 -180
- 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-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 +318 -48
- 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 +11 -25
- 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 +1 -1
- package/dist/lib/browser/drivers/ssh.d.ts +1 -1
- package/dist/lib/browser/drivers/ssh.js +2 -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 +67 -3
- package/dist/lib/browser/profiles.js +129 -7
- 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 +113 -1
- package/dist/lib/browser/service.js +454 -40
- 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 +18 -0
- 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 +12 -3
- package/dist/lib/config-keys.js +29 -6
- package/dist/lib/config-machine-keys.d.ts +4 -2
- package/dist/lib/config-machine-keys.js +6 -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 +102 -0
- package/dist/lib/daemon-webhooks.js +210 -0
- package/dist/lib/device-config.d.ts +116 -72
- package/dist/lib/device-config.js +366 -132
- 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 +61 -0
- package/dist/lib/devices/pool.js +83 -0
- 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 +8 -5
- package/dist/lib/exec.js +19 -13
- 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} +49 -1
- package/dist/lib/{migrate.js → installations/migrate.js} +265 -38
- 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 +2 -2
- package/dist/lib/observe-aliases.js +2 -11
- 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-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 +241 -62
- 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 +3 -3
- package/dist/lib/secrets/bundles.js +7 -7
- 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 +12 -10
- package/dist/lib/secrets/remote.js +21 -14
- 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/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/share/delete.d.ts +21 -0
- package/dist/lib/share/delete.js +42 -0
- package/dist/lib/share/publish.d.ts +82 -0
- package/dist/lib/share/publish.js +170 -18
- package/dist/lib/share/worker-template.js +172 -9
- package/dist/lib/shims.js +35 -7
- package/dist/lib/smart-launch.d.ts +36 -6
- package/dist/lib/smart-launch.js +65 -8
- 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 +5 -147
- package/dist/lib/startup/command-registry.js +38 -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 +1 -1
- package/dist/lib/triggers/handlers.js +2 -2
- package/dist/lib/triggers/webhook.d.ts +36 -2
- package/dist/lib/triggers/webhook.js +97 -42
- package/dist/lib/types.d.ts +18 -6
- 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/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
package/dist/commands/daemon.js
CHANGED
|
@@ -19,15 +19,17 @@ import { execFileSync } from 'child_process';
|
|
|
19
19
|
import * as fs from 'fs';
|
|
20
20
|
import * as path from 'path';
|
|
21
21
|
import { setHelpSections } from '../lib/help.js';
|
|
22
|
-
import { getDaemonStatus, isDaemonRunning, isDaemonWedged, readDaemonLog, startDaemon, stopDaemon, signalDaemonReload, findSurvivingStateDirDaemons, getDaemonLogPath, isDaemonAutostartCircuitOpen, } from '../lib/daemon.js';
|
|
22
|
+
import { getDaemonStatus, isDaemonRunning, isDaemonWedged, readDaemonLog, startDaemon, stopDaemon, signalDaemonReload, findSurvivingStateDirDaemons, getDaemonLogPath, isDaemonAutostartCircuitOpen, } from '../lib/daemon/daemon.js';
|
|
23
23
|
import { getConfigValue, setConfigValue, isDaemonEnabled } from '../lib/device-config.js';
|
|
24
24
|
import { readSubsystemHealth, SUBSYSTEM_SECRETS_BROKER, SUBSYSTEM_BROWSER_IPC, SUBSYSTEM_DAEMON_START, } from '../lib/daemon-health.js';
|
|
25
25
|
import { DAEMON_SERVICE_IDS, listDaemonServiceStates, setDaemonServiceEnabled, getDaemonServicesConfigPath, } from '../lib/daemon-services.js';
|
|
26
|
-
import { listJobs, getLatestRun } from '../lib/routines.js';
|
|
26
|
+
import { listJobs, getLatestRun } from '../lib/scheduling/routines.js';
|
|
27
27
|
import { JobScheduler } from '../lib/scheduler.js';
|
|
28
28
|
import { followFile } from '../lib/log-follow.js';
|
|
29
29
|
import { parseDuration } from '../lib/hooks/cache.js';
|
|
30
30
|
import { registerFunnelCommand } from './funnel.js';
|
|
31
|
+
import { DEFAULT_WEBHOOK_PORT, DEFAULT_WEBHOOK_RATE_LIMIT, addHostedReceiver, getDaemonWebhooksConfigPath, hostedReceiverPort, readDaemonWebhooksConfig, removeHostedReceiver, } from '../lib/daemon-webhooks.js';
|
|
32
|
+
import { parseFunnelPort } from '../lib/funnel.js';
|
|
31
33
|
/**
|
|
32
34
|
* Provably absent, or null when unknowable.
|
|
33
35
|
*
|
|
@@ -96,7 +98,7 @@ function entryIsGone(p) {
|
|
|
96
98
|
*
|
|
97
99
|
* That split is not academic. The incident this feature exists to catch was
|
|
98
100
|
* neither the tracked pid nor in the registry: it ran under an ephemeral `/tmp`
|
|
99
|
-
* cwd from a deleted worktree, and `lib/daemon.ts` documents that such a process
|
|
101
|
+
* cwd from a deleted worktree, and `lib/daemon/daemon.ts` documents that such a process
|
|
100
102
|
* "registers under its own state dir and is invisible here" BY DESIGN. Gating
|
|
101
103
|
* the display on the registry too would have made this command silent on the
|
|
102
104
|
* exact 4h14m ghost that motivated it.
|
|
@@ -624,6 +626,146 @@ async function runDoctor(opts) {
|
|
|
624
626
|
console.log(` ${chalk.red('✗')} ${p}`);
|
|
625
627
|
process.exitCode = 1;
|
|
626
628
|
}
|
|
629
|
+
// ─── Hosted webhook receivers ────────────────────────────────────────────
|
|
630
|
+
/** Parse a positive-integer option, failing loud rather than silently defaulting. */
|
|
631
|
+
function requirePositiveInt(raw, label) {
|
|
632
|
+
const parsed = Number.parseInt(raw, 10);
|
|
633
|
+
if (!Number.isInteger(parsed) || parsed <= 0) {
|
|
634
|
+
console.error(chalk.red(`${label} must be a positive integer (got '${raw}').`));
|
|
635
|
+
process.exit(1);
|
|
636
|
+
}
|
|
637
|
+
return parsed;
|
|
638
|
+
}
|
|
639
|
+
/**
|
|
640
|
+
* `agents daemon webhooks` — which signed receivers THIS box hosts (RUSH-2548).
|
|
641
|
+
*
|
|
642
|
+
* The entries land in `daemon/webhooks.yaml`, which the daemon's
|
|
643
|
+
* `webhook-receiver` service reads at start; nothing binds until the daemon
|
|
644
|
+
* picks the change up, so every mutation says how to apply it.
|
|
645
|
+
*/
|
|
646
|
+
function registerWebhooksSubcommand(parent) {
|
|
647
|
+
const webhooks = parent
|
|
648
|
+
.command('webhooks')
|
|
649
|
+
.description('Signed webhook receivers this box hosts as a supervised daemon service.')
|
|
650
|
+
.option('--json', 'Emit as JSON')
|
|
651
|
+
.action((opts, command) => {
|
|
652
|
+
runWebhooksList(command.optsWithGlobals().json === true);
|
|
653
|
+
});
|
|
654
|
+
setHelpSections(webhooks, {
|
|
655
|
+
examples: `
|
|
656
|
+
# What this box hosts today
|
|
657
|
+
agents daemon webhooks list
|
|
658
|
+
|
|
659
|
+
# Host a receiver on the default port, signing secrets from a bundle
|
|
660
|
+
agents daemon webhooks add --secrets-bundle linear-webhook
|
|
661
|
+
|
|
662
|
+
# A second receiver on its own port, publicly exposed via Tailscale Funnel
|
|
663
|
+
agents daemon webhooks add --secrets-bundle gh-webhook --port 8788 --funnel-port 443
|
|
664
|
+
|
|
665
|
+
# Apply the change (the running daemon rebinds on restart)
|
|
666
|
+
agents daemon restart
|
|
667
|
+
|
|
668
|
+
# Stop hosting the receiver bound to a port
|
|
669
|
+
agents daemon webhooks remove 8788
|
|
670
|
+
`,
|
|
671
|
+
notes: `
|
|
672
|
+
The bundle must hold GITHUB_WEBHOOK_SECRET and/or LINEAR_WEBHOOK_SECRET
|
|
673
|
+
('agents secrets add <bundle> LINEAR_WEBHOOK_SECRET'). The daemon reads it
|
|
674
|
+
through the secrets broker, so a hosted receiver needs no
|
|
675
|
+
AGENTS_SECRETS_PASSPHRASE and no nohup. A LOCKED bundle fails that receiver
|
|
676
|
+
loud in 'agents daemon logs' rather than binding unverified ingress.
|
|
677
|
+
|
|
678
|
+
Port is the identity: a second 'add' on the same port edits that receiver.
|
|
679
|
+
Funnel ports are limited by Tailscale to 443, 8443, and 10000.
|
|
680
|
+
`,
|
|
681
|
+
});
|
|
682
|
+
webhooks
|
|
683
|
+
.command('list')
|
|
684
|
+
.description('List the receivers declared for this box.')
|
|
685
|
+
.option('--json', 'Emit as JSON')
|
|
686
|
+
.action((opts, command) => {
|
|
687
|
+
runWebhooksList(command.optsWithGlobals().json === true || opts.json === true);
|
|
688
|
+
});
|
|
689
|
+
webhooks
|
|
690
|
+
.command('add')
|
|
691
|
+
.description('Declare a receiver on this box. Replaces any receiver already on the same port.')
|
|
692
|
+
.requiredOption('--secrets-bundle <name>', 'agents secrets bundle holding GITHUB_WEBHOOK_SECRET and/or LINEAR_WEBHOOK_SECRET')
|
|
693
|
+
.option('-p, --port <n>', `Local bind port (default ${DEFAULT_WEBHOOK_PORT})`)
|
|
694
|
+
.option('--rate-limit <n>', `Accepted deliveries per source per minute (default ${DEFAULT_WEBHOOK_RATE_LIMIT})`)
|
|
695
|
+
.option('--funnel-port <n>', 'Expose publicly on this Tailscale Funnel port (443 | 8443 | 10000)')
|
|
696
|
+
.action((opts) => {
|
|
697
|
+
const receiver = { bundle: opts.secretsBundle };
|
|
698
|
+
if (opts.port !== undefined)
|
|
699
|
+
receiver.port = requirePositiveInt(opts.port, '--port');
|
|
700
|
+
if (opts.rateLimit !== undefined)
|
|
701
|
+
receiver.rateLimit = requirePositiveInt(opts.rateLimit, '--rate-limit');
|
|
702
|
+
if (opts.funnelPort !== undefined) {
|
|
703
|
+
try {
|
|
704
|
+
receiver.funnel = { publicPort: parseFunnelPort(opts.funnelPort) };
|
|
705
|
+
}
|
|
706
|
+
catch (err) {
|
|
707
|
+
console.error(chalk.red(err.message));
|
|
708
|
+
process.exit(1);
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
addHostedReceiver(receiver);
|
|
712
|
+
const port = hostedReceiverPort(receiver);
|
|
713
|
+
console.log(chalk.green(`Hosting a webhook receiver on 127.0.0.1:${port}`) + chalk.gray(` (bundle ${receiver.bundle})`));
|
|
714
|
+
if (receiver.funnel)
|
|
715
|
+
console.log(chalk.gray(` public: Tailscale Funnel :${receiver.funnel.publicPort} → localhost:${port}`));
|
|
716
|
+
console.log(chalk.gray(` config: ${getDaemonWebhooksConfigPath()}`));
|
|
717
|
+
console.log(chalk.gray(isDaemonRunning()
|
|
718
|
+
? ' run `agents daemon restart` to bind it'
|
|
719
|
+
: ' run `agents daemon start` to bind it'));
|
|
720
|
+
});
|
|
721
|
+
webhooks
|
|
722
|
+
.command('remove <port>')
|
|
723
|
+
.description('Stop hosting the receiver bound to this port.')
|
|
724
|
+
.action((portArg) => {
|
|
725
|
+
const port = requirePositiveInt(portArg, 'port');
|
|
726
|
+
const removed = removeHostedReceiver(port);
|
|
727
|
+
if (!removed) {
|
|
728
|
+
console.error(chalk.red(`No receiver declared on port ${port}. Run 'agents daemon webhooks list'.`));
|
|
729
|
+
process.exit(1);
|
|
730
|
+
}
|
|
731
|
+
console.log(chalk.green(`Removed the webhook receiver on port ${port}.`));
|
|
732
|
+
if (removed.funnel) {
|
|
733
|
+
// Leaving the Funnel up would keep a public HTTPS route pointed at a port
|
|
734
|
+
// nothing serves, so say what to run — this box may not be the tailnet
|
|
735
|
+
// node, and `funnel down` names the host explicitly.
|
|
736
|
+
console.log(chalk.yellow(` public ingress is still up on :${removed.funnel.publicPort} — take it down:`));
|
|
737
|
+
console.log(chalk.gray(` agents daemon funnel down <host> --port ${removed.funnel.publicPort}`));
|
|
738
|
+
}
|
|
739
|
+
if (isDaemonRunning())
|
|
740
|
+
console.log(chalk.gray(' run `agents daemon restart` to release the port'));
|
|
741
|
+
});
|
|
742
|
+
}
|
|
743
|
+
function runWebhooksList(json) {
|
|
744
|
+
const { receivers } = readDaemonWebhooksConfig();
|
|
745
|
+
if (json) {
|
|
746
|
+
console.log(JSON.stringify(receivers.map((r) => ({
|
|
747
|
+
bundle: r.bundle,
|
|
748
|
+
port: hostedReceiverPort(r),
|
|
749
|
+
rateLimit: r.rateLimit ?? DEFAULT_WEBHOOK_RATE_LIMIT,
|
|
750
|
+
funnelPort: r.funnel?.publicPort ?? null,
|
|
751
|
+
})), null, 2));
|
|
752
|
+
return;
|
|
753
|
+
}
|
|
754
|
+
if (receivers.length === 0) {
|
|
755
|
+
console.log(chalk.gray('No webhook receivers declared on this box — the daemon binds nothing.'));
|
|
756
|
+
console.log(chalk.gray('Add one: agents daemon webhooks add --secrets-bundle <name>'));
|
|
757
|
+
return;
|
|
758
|
+
}
|
|
759
|
+
console.log(chalk.bold('Hosted webhook receivers'));
|
|
760
|
+
for (const r of receivers) {
|
|
761
|
+
const port = hostedReceiverPort(r);
|
|
762
|
+
const funnel = r.funnel ? chalk.cyan(` public :${r.funnel.publicPort}`) : chalk.gray(' localhost only');
|
|
763
|
+
console.log(` 127.0.0.1:${String(port).padEnd(6)} ${chalk.gray(`bundle ${r.bundle}`)}${funnel}`);
|
|
764
|
+
console.log(chalk.gray(` endpoints: /hooks/github, /hooks/linear · ${r.rateLimit ?? DEFAULT_WEBHOOK_RATE_LIMIT}/min per source`));
|
|
765
|
+
}
|
|
766
|
+
console.log(chalk.gray(`\nConfig: ${getDaemonWebhooksConfigPath()}`));
|
|
767
|
+
console.log(chalk.gray('Changes take effect on the next daemon restart.'));
|
|
768
|
+
}
|
|
627
769
|
// ─── Command registration ────────────────────────────────────────────────
|
|
628
770
|
export function registerDaemonCommand(program) {
|
|
629
771
|
const cmd = program
|
|
@@ -653,9 +795,13 @@ export function registerDaemonCommand(program) {
|
|
|
653
795
|
# Reload config (SIGHUP) without restarting — picks up routine/scheduler-gate changes
|
|
654
796
|
agents daemon reload
|
|
655
797
|
|
|
656
|
-
#
|
|
798
|
+
# Every hosted service (secrets broker, browser IPC, webhook receiver, ...)
|
|
657
799
|
agents daemon services
|
|
658
800
|
|
|
801
|
+
# Host a signed webhook receiver here, supervised and restarted on crash
|
|
802
|
+
agents daemon webhooks add --secrets-bundle linear-webhook
|
|
803
|
+
agents daemon webhooks list
|
|
804
|
+
|
|
659
805
|
# Manage public ingress for daemon-world webhook receivers
|
|
660
806
|
agents daemon funnel status yosemite-s0
|
|
661
807
|
agents daemon funnel up yosemite-s0 --local-port 8787 --port 443
|
|
@@ -829,6 +975,7 @@ export function registerDaemonCommand(program) {
|
|
|
829
975
|
console.log(chalk.gray('Run `agents daemon reload` (or restart) to apply.'));
|
|
830
976
|
}
|
|
831
977
|
});
|
|
978
|
+
registerWebhooksSubcommand(cmd);
|
|
832
979
|
registerFunnelCommand(cmd);
|
|
833
980
|
cmd.command('logs')
|
|
834
981
|
.description('Read the daemon\'s own log (lifecycle + subsystem errors — not routine run output).')
|
package/dist/commands/detach.js
CHANGED
|
@@ -17,7 +17,7 @@ import chalk from 'chalk';
|
|
|
17
17
|
import { gatherLiveTargets } from './go.js';
|
|
18
18
|
import { killSession } from '../lib/tmux/index.js';
|
|
19
19
|
import { getDefaultSocketPath } from '../lib/tmux/paths.js';
|
|
20
|
-
import { getAgentsInvocation } from '../lib/daemon.js';
|
|
20
|
+
import { getAgentsInvocation } from '../lib/daemon/daemon.js';
|
|
21
21
|
import { captureProcessStartTime } from '../lib/pty-server.js';
|
|
22
22
|
import { writeDetachRecord } from '../lib/session/detached.js';
|
|
23
23
|
import { getLogsDir } from '../lib/state.js';
|
package/dist/commands/doctor.js
CHANGED
|
@@ -15,16 +15,16 @@ import { sshExecAsync } from '../lib/ssh-exec.js';
|
|
|
15
15
|
import { hostIdentityArgs, sshTargetFor } from '../lib/hosts/types.js';
|
|
16
16
|
import { deviceIdentityArgs } from '../lib/devices/connect.js';
|
|
17
17
|
import { machineId, normalizeHost } from '../lib/session/sync/config.js';
|
|
18
|
-
import { findAmbiguousDevicePins } from '../lib/routines.js';
|
|
18
|
+
import { findAmbiguousDevicePins } from '../lib/scheduling/routines.js';
|
|
19
19
|
import chalk from 'chalk';
|
|
20
20
|
import { checkAllClis, collectTeamsDoctorData } from '../lib/teams/agents.js';
|
|
21
21
|
import { AGENTS, ALL_AGENT_IDS, resolveAgentName, formatAgentError, getAccountInfo } from '../lib/agents.js';
|
|
22
|
-
import { getVersionHomePath, listInstalledVersions, } from '../lib/versions.js';
|
|
22
|
+
import { getVersionHomePath, listInstalledVersions, } from '../lib/installations/versions.js';
|
|
23
23
|
import { resolveAgentTargets, AgentSpecError } from '../lib/agent-spec/index.js';
|
|
24
24
|
import { loadManifest, isStale } from '../lib/staleness/index.js';
|
|
25
25
|
import { diffVersionResources, DOCTOR_ALL_KINDS, } from '../lib/doctor-diff.js';
|
|
26
26
|
import { checkVersionHookWiring, inspectDuplicateVersionHooks, registerHooksToSettings, repairManagedHookRuntimeArtifacts } from '../lib/hooks.js';
|
|
27
|
-
import { isVersionIsolated } from '../lib/versions.js';
|
|
27
|
+
import { isVersionIsolated } from '../lib/installations/versions.js';
|
|
28
28
|
import { computeDrift, checkSyncStatus, countOrphans, computeSourceBehind } from '../lib/drift.js';
|
|
29
29
|
import { readAuthHealthCache, summarizeHostAuth } from '../lib/auth-health.js';
|
|
30
30
|
import { readMeta } from '../lib/state.js';
|
|
@@ -156,9 +156,9 @@ export function asRemoteSecretFindings(raw, device) {
|
|
|
156
156
|
return out;
|
|
157
157
|
}
|
|
158
158
|
async function resolveFleetTargets(opts) {
|
|
159
|
-
const singleName = opts.
|
|
159
|
+
const singleName = opts.device;
|
|
160
160
|
if (singleName) {
|
|
161
|
-
// --device
|
|
161
|
+
// --device as a single-device filter: resolve through the device
|
|
162
162
|
// registry first, then the general host registry, then ad-hoc user@host.
|
|
163
163
|
const registry = await loadDevices();
|
|
164
164
|
const deviceProfile = registry[singleName];
|
|
@@ -358,7 +358,7 @@ export function asFleetInventory(value) {
|
|
|
358
358
|
return v;
|
|
359
359
|
}
|
|
360
360
|
async function runDevicesDoctor(opts) {
|
|
361
|
-
const singleName = opts.
|
|
361
|
+
const singleName = opts.device;
|
|
362
362
|
const targets = await resolveFleetTargets(opts);
|
|
363
363
|
const localName = machineId();
|
|
364
364
|
const results = [];
|
|
@@ -1189,7 +1189,7 @@ function purgeStaleAgentsCliCopies(_opts) {
|
|
|
1189
1189
|
});
|
|
1190
1190
|
}
|
|
1191
1191
|
function renderStaleInstallPurgeText(purge) {
|
|
1192
|
-
if (purge.removed.length === 0 && purge.failed.length === 0)
|
|
1192
|
+
if (purge.removed.length === 0 && purge.failed.length === 0 && purge.unresolved.length === 0)
|
|
1193
1193
|
return;
|
|
1194
1194
|
console.log(chalk.bold('\nStale agents-cli installs'));
|
|
1195
1195
|
for (const r of purge.removed) {
|
|
@@ -1199,6 +1199,15 @@ function renderStaleInstallPurgeText(purge) {
|
|
|
1199
1199
|
for (const f of purge.failed) {
|
|
1200
1200
|
console.log(` ${chalk.red('hold ')} ${chalk.gray(`${f.packageRoot} ${f.version} — ${f.error}`)}`);
|
|
1201
1201
|
}
|
|
1202
|
+
// RUSH-2705/2713: a duplicate --fix cannot auto-purge — either a healthy
|
|
1203
|
+
// >=1.22.30 peer, OR a pre-1.22.30 copy left alone only because no fixed peer
|
|
1204
|
+
// exists to fall back to (that one is NOT healthy). Either way, hand back the
|
|
1205
|
+
// command that removes it instead of ending on a bare "everything in sync".
|
|
1206
|
+
// Don't call it "healthy" — that would understate a genuinely vulnerable copy.
|
|
1207
|
+
for (const u of purge.unresolved) {
|
|
1208
|
+
console.log(` ${chalk.yellow('manual')} ${chalk.gray(`${u.packageRoot} ${u.version} — --fix will not delete this copy; remove it with:`)}`);
|
|
1209
|
+
console.log(` ${chalk.bold(u.manualRemoveCommand)}`);
|
|
1210
|
+
}
|
|
1202
1211
|
}
|
|
1203
1212
|
async function runFix(parsed, opts) {
|
|
1204
1213
|
// Heal targets the global install — project layer is irrelevant, so cwd is
|
|
@@ -1437,8 +1446,7 @@ export function registerDoctorCommand(program) {
|
|
|
1437
1446
|
.option('--cwd <path>', 'Resolution cwd for project layer detection (default: process.cwd())')
|
|
1438
1447
|
.option('--adopt <agent>', "Take over the agent's native launcher that shadows the shim (symlink it to the version-managed shim; reversible with --release)")
|
|
1439
1448
|
.option('--release <agent>', 'Undo --adopt: restore the native launcher agents-cli previously adopted')
|
|
1440
|
-
.option('--devices', 'Check agent readiness AND cross-device harness divergence (missing resources/versions, repo drift) on every registered device
|
|
1441
|
-
.option('--hosts', 'Alias of --devices')
|
|
1449
|
+
.option('--devices', 'Check agent readiness AND cross-device harness divergence (missing resources/versions, repo drift) on every registered device')
|
|
1442
1450
|
.option('--check', 'CI drift gate: exit non-zero when any installed version is out of sync (stale or never-synced), zero when clean. Combine with --devices to gate the whole fleet.')
|
|
1443
1451
|
.option('--refresh', 'Bypass the cached overview snapshot: recompute the bare `doctor --json` overview live and refresh the shared cache that the menu-bar and other pollers read')
|
|
1444
1452
|
.option('-q, --quiet', 'With --check, suppress per-version lines; print only the one-line verdict');
|
|
@@ -1492,7 +1500,7 @@ export function registerDoctorCommand(program) {
|
|
|
1492
1500
|
console.error(chalk.red('Cannot combine --check with a target argument.'));
|
|
1493
1501
|
process.exit(1);
|
|
1494
1502
|
}
|
|
1495
|
-
if (opts.devices
|
|
1503
|
+
if (opts.devices) {
|
|
1496
1504
|
await runDevicesCheck(opts, cwd);
|
|
1497
1505
|
}
|
|
1498
1506
|
else {
|
|
@@ -1500,7 +1508,7 @@ export function registerDoctorCommand(program) {
|
|
|
1500
1508
|
}
|
|
1501
1509
|
return;
|
|
1502
1510
|
}
|
|
1503
|
-
if (opts.devices
|
|
1511
|
+
if (opts.devices) {
|
|
1504
1512
|
if (target) {
|
|
1505
1513
|
console.error(chalk.red('Cannot combine --devices with a target argument.'));
|
|
1506
1514
|
process.exit(1);
|
package/dist/commands/events.js
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
*/
|
|
15
15
|
import chalk from 'chalk';
|
|
16
16
|
import * as fs from 'fs';
|
|
17
|
-
import { getLogsPath, stats, rotate } from '../lib/events.js';
|
|
17
|
+
import { getLogsPath, stats, rotate } from '../lib/feed/events.js';
|
|
18
18
|
import { readUnifiedEvents } from '../lib/event-stream.js';
|
|
19
19
|
import { parseFamilyList, EVENT_FAMILIES } from '../lib/event-families.js';
|
|
20
20
|
import { ingestBatch } from '../lib/events-ingest.js';
|
package/dist/commands/exec.d.ts
CHANGED
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
import { type Command } from 'commander';
|
|
9
9
|
import type { ExecEffort } from '../lib/exec.js';
|
|
10
10
|
import { RUN_AUTO_KEYWORD } from '../lib/types.js';
|
|
11
|
-
import { type SshGResult } from '../lib/hosts/ssh-config.js';
|
|
12
11
|
export interface RunAccountPickerRequest {
|
|
13
12
|
requested: boolean;
|
|
14
13
|
normalizedAgentSpec: string;
|
|
@@ -18,8 +17,8 @@ export interface RunAccountPickerRequest {
|
|
|
18
17
|
export declare function parseRunAccountPickerRequest(agentSpec: string): RunAccountPickerRequest;
|
|
19
18
|
/** Return every option whose routing semantics conflict with a local account choice. */
|
|
20
19
|
/**
|
|
21
|
-
* The `--
|
|
22
|
-
* machine over SSH". `--
|
|
20
|
+
* The `--device` alias family — the flags that mean "dispatch this run to another
|
|
21
|
+
* machine over SSH". `--device` is canonical; `--on`/`--computer` are hidden
|
|
23
22
|
* aliases. Returns the values actually given (so callers can both test presence
|
|
24
23
|
* and read the target). Kept in ONE place because a guard that listed only a
|
|
25
24
|
* subset silently let `--terminal --device` open a local tab and drop the remote
|
|
@@ -68,14 +67,6 @@ export declare function runAutoDefaultsToAffinity(options: {
|
|
|
68
67
|
* decision matrix is unit-testable.
|
|
69
68
|
*/
|
|
70
69
|
export declare function hostInteractiveNeedsCorrelationId(runAgent: string, hostSessionId: string | undefined, resumeId: string | undefined): boolean;
|
|
71
|
-
/** The host descriptor fields the `--copy-creds` security gate reads. */
|
|
72
|
-
export interface CopyCredsGateHost {
|
|
73
|
-
name: string;
|
|
74
|
-
/** Concrete SSH target for inline/provider hosts; unset for ssh-config aliases. */
|
|
75
|
-
address?: string;
|
|
76
|
-
/** `devices` = registered Tailscale fleet host; `local` = ssh-config/inline. */
|
|
77
|
-
provider?: string;
|
|
78
|
-
}
|
|
79
70
|
/**
|
|
80
71
|
* Whether `cwd` is inside a git work tree.
|
|
81
72
|
*
|
|
@@ -109,45 +100,6 @@ export declare function leaseFreshReposPath(): string;
|
|
|
109
100
|
export declare function readAlwaysFreshRepos(): string[];
|
|
110
101
|
/** Persist the always-fresh repo roots. Best-effort — never throws. */
|
|
111
102
|
export declare function writeAlwaysFreshRepos(repos: string[]): void;
|
|
112
|
-
/** Outcome of the `--copy-creds` security gate (RUSH-1767). */
|
|
113
|
-
export interface CopyCredsGateDecision {
|
|
114
|
-
/** Ship credentials? True only when the host key is pinned in the managed store. */
|
|
115
|
-
allowed: boolean;
|
|
116
|
-
/** The address whose key is checked/pinned — an ssh-config alias resolved to its real HostName. */
|
|
117
|
-
pinTarget: string;
|
|
118
|
-
/** True when the non-device self-pin path pinned the target during this call. */
|
|
119
|
-
selfPinned: boolean;
|
|
120
|
-
}
|
|
121
|
-
/** Injectable network seams so the gate decision is testable without ssh/keyscan. */
|
|
122
|
-
export interface CopyCredsGateDeps {
|
|
123
|
-
/** Managed known_hosts store file (defaults to the real cache path). */
|
|
124
|
-
file?: string;
|
|
125
|
-
/** Resolve an ssh-config alias to its effective HostName/Port (defaults to real `ssh -G`). */
|
|
126
|
-
resolve?: (name: string) => SshGResult | undefined;
|
|
127
|
-
/** Self-pin `target` via ssh-keyscan; returns whether it's pinned afterward (defaults to real `pinHostKey`). */
|
|
128
|
-
selfPin?: (target: string, port: number | undefined, file: string) => boolean;
|
|
129
|
-
}
|
|
130
|
-
/**
|
|
131
|
-
* Decide whether `--copy-creds` may ship credentials (and the Claude OAuth
|
|
132
|
-
* token) to `host` (RUSH-1767). Credentials ship only to a host whose SSH host
|
|
133
|
-
* key is pinned in the managed known_hosts store, so the offload never rides an
|
|
134
|
-
* accept-new (TOFU) connection a machine-in-the-middle could intercept.
|
|
135
|
-
*
|
|
136
|
-
* Resolution:
|
|
137
|
-
* - The checked target is the host's concrete `address`, else its ssh-config
|
|
138
|
-
* HostName (`ssh -G`), else its name — so an alias is pinned/verified against
|
|
139
|
-
* the SAME real host the strict dispatch later connects to.
|
|
140
|
-
* - An unpinned NON-device (a bare `~/.ssh/config` `Host` alias or literal,
|
|
141
|
-
* which `agents ssh <name>` can't reach — "Unknown device") is self-pinned in
|
|
142
|
-
* place via ssh-keyscan. A registered device is left unpinned here — it earns
|
|
143
|
-
* its pin through the normal `agents ssh <name>` accept-new connect, so the
|
|
144
|
-
* caller steers there instead.
|
|
145
|
-
*
|
|
146
|
-
* The network seams (`resolve`, `selfPin`) default to the real ssh -G /
|
|
147
|
-
* ssh-keyscan implementations and are injectable so the ship/refuse decision is
|
|
148
|
-
* unit-testable against real known_hosts fixtures with no network.
|
|
149
|
-
*/
|
|
150
|
-
export declare function decideCopyCredsGate(host: CopyCredsGateHost, deps?: CopyCredsGateDeps): CopyCredsGateDecision;
|
|
151
103
|
/**
|
|
152
104
|
* Build the LoopConfig the driver consumes from CLI flags and/or a workflow's
|
|
153
105
|
* `loop:` frontmatter block (issue #332). Returns undefined when neither source
|