@phnx-labs/agents-cli 1.22.39 → 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 +294 -0
- package/README.md +111 -70
- package/dist/bin/agents +0 -0
- package/dist/bootstrap.js +45 -26
- 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 +16 -3
- package/dist/commands/cost.d.ts +2 -1
- package/dist/commands/cost.js +7 -6
- package/dist/commands/daemon.js +151 -4
- package/dist/commands/detach.js +1 -1
- package/dist/commands/doctor.js +19 -11
- package/dist/commands/events.js +1 -1
- package/dist/commands/exec.d.ts +2 -50
- package/dist/commands/exec.js +160 -215
- package/dist/commands/factory.js +1 -1
- package/dist/commands/feed.d.ts +2 -2
- package/dist/commands/feed.js +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 +186 -64
- package/dist/commands/subagents.js +1 -1
- package/dist/commands/sync.js +24 -9
- package/dist/commands/teams.d.ts +2 -2
- package/dist/commands/teams.js +9 -18
- package/dist/commands/tmux.js +5 -1
- package/dist/commands/trash.js +1 -1
- package/dist/commands/usage.d.ts +1 -1
- package/dist/commands/usage.js +2 -2
- package/dist/commands/utils.d.ts +4 -14
- package/dist/commands/utils.js +6 -27
- package/dist/commands/versions.js +2 -2
- package/dist/commands/view.d.ts +9 -77
- package/dist/commands/view.js +23 -8
- package/dist/commands/watchdog.js +1 -1
- package/dist/commands/webhook.js +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 +2 -1
- package/dist/lib/config-keys.js +8 -4
- package/dist/lib/config-machine-keys.d.ts +4 -2
- package/dist/lib/config-machine-keys.js +5 -2
- package/dist/lib/crabbox/lease.js +9 -1
- package/dist/lib/crabbox/runtimes.d.ts +32 -7
- package/dist/lib/crabbox/runtimes.js +72 -30
- package/dist/lib/{daemon.d.ts → daemon/daemon.d.ts} +59 -1
- package/dist/lib/{daemon.js → daemon/daemon.js} +237 -49
- package/dist/lib/daemon-services.d.ts +1 -1
- package/dist/lib/daemon-services.js +5 -0
- package/dist/lib/daemon-ticks.d.ts +25 -0
- package/dist/lib/daemon-ticks.js +31 -1
- package/dist/lib/daemon-webhooks.d.ts +102 -0
- package/dist/lib/daemon-webhooks.js +210 -0
- package/dist/lib/device-config.d.ts +85 -75
- package/dist/lib/device-config.js +279 -141
- package/dist/lib/devices/config-migration.d.ts +29 -34
- package/dist/lib/devices/config-migration.js +209 -130
- package/dist/lib/devices/connect.d.ts +2 -2
- package/dist/lib/devices/connect.js +2 -2
- package/dist/lib/devices/discovery-policy.d.ts +30 -0
- package/dist/lib/devices/discovery-policy.js +101 -0
- package/dist/lib/devices/fleet-inventory.js +8 -3
- package/dist/lib/devices/harness-inventory.d.ts +1 -1
- package/dist/lib/devices/harness-inventory.js +12 -3
- package/dist/lib/devices/known-hosts.js +1 -1
- package/dist/lib/devices/pool.d.ts +10 -5
- package/dist/lib/devices/pool.js +5 -7
- package/dist/lib/devices/registry.d.ts +1 -1
- package/dist/lib/devices/registry.js +1 -1
- package/dist/lib/devices/resolve-profile.d.ts +2 -2
- package/dist/lib/devices/resolve-profile.js +2 -2
- package/dist/lib/devices/resolve-target.d.ts +1 -1
- package/dist/lib/devices/resolve-target.js +4 -4
- package/dist/lib/devices/self-host.d.ts +1 -1
- package/dist/lib/devices/self-host.js +3 -3
- package/dist/lib/devices/ssh-config.d.ts +1 -1
- package/dist/lib/devices/stats-cache.js +1 -1
- package/dist/lib/devices/sync.d.ts +3 -1
- package/dist/lib/devices/sync.js +3 -3
- package/dist/lib/doctor-diff.js +4 -4
- package/dist/lib/drift-sync.js +2 -2
- package/dist/lib/drift.js +2 -2
- package/dist/lib/event-families.d.ts +1 -1
- package/dist/lib/event-stream.d.ts +1 -1
- package/dist/lib/event-stream.js +2 -2
- package/dist/lib/events-ingest.js +2 -2
- package/dist/lib/exec.d.ts +4 -4
- package/dist/lib/exec.js +11 -11
- package/dist/lib/factory/snapshot.d.ts +1 -1
- package/dist/lib/factory/snapshot.js +1 -1
- package/dist/lib/{activity.d.ts → feed/activity.d.ts} +1 -1
- package/dist/lib/{activity.js → feed/activity.js} +7 -7
- package/dist/lib/{events.d.ts → feed/events.d.ts} +2 -2
- package/dist/lib/{events.js → feed/events.js} +5 -5
- package/dist/lib/{feed.js → feed/feed.js} +4 -4
- package/dist/lib/feed-outcome.d.ts +1 -1
- package/dist/lib/feed-policy.d.ts +1 -1
- package/dist/lib/feed-policy.js +1 -1
- package/dist/lib/feed-post.d.ts +1 -1
- package/dist/lib/feed-post.js +1 -1
- package/dist/lib/feed-ranking.d.ts +1 -1
- package/dist/lib/fleet/apply.d.ts +0 -6
- package/dist/lib/fleet/apply.js +18 -45
- package/dist/lib/fleet/auth-sync.d.ts +16 -35
- package/dist/lib/fleet/auth-sync.js +16 -75
- package/dist/lib/fleet/capture.js +8 -6
- package/dist/lib/fleet/manifest.js +23 -11
- package/dist/lib/fleet/types.d.ts +19 -7
- package/dist/lib/fleet-cache.d.ts +1 -1
- package/dist/lib/fleet-cache.js +1 -1
- package/dist/lib/format.d.ts +19 -0
- package/dist/lib/format.js +44 -1
- package/dist/lib/friction-heuristics.d.ts +1 -1
- package/dist/lib/git.d.ts +24 -1
- package/dist/lib/git.js +82 -38
- package/dist/lib/heal.js +3 -3
- package/dist/lib/hooks.d.ts +18 -0
- package/dist/lib/hooks.js +113 -1
- package/dist/lib/hosts/credentials.d.ts +30 -10
- package/dist/lib/hosts/credentials.js +38 -26
- package/dist/lib/hosts/dispatch.d.ts +3 -3
- package/dist/lib/hosts/dispatch.js +3 -3
- package/dist/lib/hosts/option.d.ts +3 -3
- package/dist/lib/hosts/option.js +7 -8
- package/dist/lib/hosts/passthrough.d.ts +17 -17
- package/dist/lib/hosts/passthrough.js +67 -50
- package/dist/lib/hosts/providers/devices.d.ts +1 -1
- package/dist/lib/hosts/providers/devices.js +1 -1
- package/dist/lib/hosts/reconcile.d.ts +1 -1
- package/dist/lib/hosts/reconcile.js +1 -1
- package/dist/lib/hosts/reconnect.d.ts +1 -1
- package/dist/lib/hosts/reconnect.js +2 -2
- package/dist/lib/hosts/registry.d.ts +5 -5
- package/dist/lib/hosts/registry.js +5 -5
- package/dist/lib/hosts/remote-cmd.d.ts +10 -10
- package/dist/lib/hosts/remote-cmd.js +25 -18
- package/dist/lib/hosts/remote-os.d.ts +4 -4
- package/dist/lib/hosts/remote-os.js +4 -4
- package/dist/lib/hosts/remote-session-id.d.ts +2 -2
- package/dist/lib/hosts/remote-session-id.js +2 -2
- package/dist/lib/hosts/routing-flag.d.ts +3 -3
- package/dist/lib/hosts/routing-flag.js +4 -5
- package/dist/lib/hosts/run-target.d.ts +4 -4
- package/dist/lib/hosts/run-target.js +4 -4
- package/dist/lib/hosts/session-index.d.ts +2 -2
- package/dist/lib/hosts/session-index.js +1 -1
- package/dist/lib/hosts/session-marker.d.ts +1 -1
- package/dist/lib/hosts/session-marker.js +1 -1
- package/dist/lib/hosts/types.d.ts +2 -2
- package/dist/lib/hosts/types.js +2 -2
- package/dist/lib/import.js +1 -1
- package/dist/lib/{migrate.d.ts → installations/migrate.d.ts} +13 -1
- package/dist/lib/{migrate.js → installations/migrate.js} +160 -40
- package/dist/lib/installations/resolve.js +1 -1
- package/dist/lib/installations/strategies.js +1 -1
- package/dist/lib/installations/update.js +2 -2
- package/dist/lib/{versions.d.ts → installations/versions.d.ts} +12 -3
- package/dist/lib/{versions.js → installations/versions.js} +51 -31
- package/dist/lib/isolation-boundary-report.js +1 -1
- package/dist/lib/linear-projects.d.ts +28 -0
- package/dist/lib/linear-projects.js +30 -0
- package/dist/lib/loop.js +1 -1
- package/dist/lib/mailbox-gc.js +1 -1
- package/dist/lib/mailbox.js +1 -1
- package/dist/lib/mcp-registry.d.ts +62 -0
- package/dist/lib/mcp-registry.js +177 -0
- package/dist/lib/mcp.d.ts +5 -0
- package/dist/lib/mcp.js +124 -307
- package/dist/lib/menubar/MenubarHelper.app/Contents/CodeResources +0 -0
- package/dist/lib/menubar/MenubarHelper.app/Contents/MacOS/MenubarHelper +0 -0
- package/dist/lib/menubar/install-menubar.d.ts +7 -0
- package/dist/lib/menubar/install-menubar.js +24 -6
- package/dist/lib/menubar/snapshot.d.ts +7 -0
- package/dist/lib/menubar/snapshot.js +8 -6
- package/dist/lib/models.js +1 -1
- package/dist/lib/monitors/config.d.ts +12 -0
- package/dist/lib/monitors/config.js +3 -0
- package/dist/lib/monitors/dispatch.js +26 -5
- package/dist/lib/monitors/engine.js +10 -0
- package/dist/lib/monitors/sources/webhook.d.ts +1 -1
- package/dist/lib/monitors/state.d.ts +42 -0
- package/dist/lib/monitors/state.js +30 -0
- package/dist/lib/notify.d.ts +1 -1
- package/dist/lib/observe-aliases.d.ts +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 +4 -4
- package/dist/lib/smart-launch.js +6 -4
- package/dist/lib/snapshot.d.ts +4 -4
- package/dist/lib/snapshot.js +2 -2
- package/dist/lib/ssh-exec.d.ts +1 -1
- package/dist/lib/ssh-exec.js +2 -2
- package/dist/lib/ssh-tunnel.d.ts +10 -10
- package/dist/lib/ssh-tunnel.js +12 -12
- package/dist/lib/staleness/checkers/hooks.d.ts +1 -1
- package/dist/lib/staleness/checkers/hooks.js +1 -1
- package/dist/lib/staleness/detectors/permissions.js +0 -23
- package/dist/lib/staleness/detectors/plugins.js +1 -1
- package/dist/lib/staleness/fingerprint.js +1 -1
- package/dist/lib/staleness/layers.d.ts +1 -1
- package/dist/lib/staleness/layers.js +1 -1
- package/dist/lib/staleness/writers/mcp.js +3 -1
- package/dist/lib/staleness/writers/plugins.js +1 -1
- package/dist/lib/staleness/writers/types.d.ts +8 -0
- package/dist/lib/startup/command-registry.d.ts +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
|
@@ -21,10 +21,11 @@ import { getActiveSessions } from '../lib/session/active.js';
|
|
|
21
21
|
import { gatherRemoteActive } from '../lib/session/remote-active.js';
|
|
22
22
|
import { gatherRemoteAgentsJson } from '../lib/remote-agents-json.js';
|
|
23
23
|
import { formatFleetSummary, formatFleetWorkspaces, parseRemoteProbe, probeProjectWorkspaces, workspaceTargetsForDef, workspaceWarnings, } from '../lib/project-probe.js';
|
|
24
|
-
import { listProjectDefs, loadProjectDef, writeProjectDef, removeProjectDef, projectDefPath, isSafeProjectName, validateProjectDef, projectNameForCwd, } from '../lib/projects.js';
|
|
24
|
+
import { listProjectDefs, loadProjectDef, writeProjectDef, removeProjectDef, projectDefPath, isSafeProjectName, validateProjectDef, projectNameForCwd, projectRepoTargetsForDef, } from '../lib/projects.js';
|
|
25
|
+
import { buildPullEnvelope, decodePullTargets, fingerprintTargets, pullLocalArgs, parseProjectPullEnvelope, printProjectPullSummary, projectPullComplete, pullProjectTargets, } from '../lib/project-pull.js';
|
|
25
26
|
import { rollupSessionsByProject, withDefaultMachine, isDeadStatus, formatDeadSummary, liveDeadSplit, enrichProjectSignals, formatProjectMembersByHost, formatProjectWarnings, } from '../lib/project-status.js';
|
|
26
27
|
import { fetchLinearProjectCounts } from '../lib/linear-project-counts.js';
|
|
27
|
-
import { listLinearProjects, pickLinearProject } from '../lib/linear-projects.js';
|
|
28
|
+
import { listLinearProjects, nextLinearLink, pickLinearProject } from '../lib/linear-projects.js';
|
|
28
29
|
import { checkRepoSlug } from '../lib/project-doctor.js';
|
|
29
30
|
import { formatFocusAreas, readFocusAreas } from '../lib/project-focus.js';
|
|
30
31
|
import { formatVerdict, scheduleVerdict } from '../lib/project-schedule.js';
|
|
@@ -61,6 +62,23 @@ export function formatFleetSkippedNote(skipped) {
|
|
|
61
62
|
const noun = skipped.length === 1 ? 'device' : 'devices';
|
|
62
63
|
return chalk.gray(` · ${skipped.length} ${noun} didn't answer (unreachable, older agents-cli, or timed out): ${list}\n`);
|
|
63
64
|
}
|
|
65
|
+
/**
|
|
66
|
+
* One compact trailing note for peers that DID answer a fan-out but whose
|
|
67
|
+
* payload failed verification — a wrong machine id, a fingerprint that doesn't
|
|
68
|
+
* match the targets we sent, or a malformed row. Deliberately separate from
|
|
69
|
+
* {@link formatFleetSkippedNote}: silence means a peer never ran, while this
|
|
70
|
+
* means it ran and we cannot trust what it reports, which is the worse state.
|
|
71
|
+
* Empty string when every answer verified.
|
|
72
|
+
*/
|
|
73
|
+
export function formatFleetUnverifiedNote(unverified) {
|
|
74
|
+
if (unverified.length === 0)
|
|
75
|
+
return '';
|
|
76
|
+
const named = unverified.slice(0, SKIPPED_NAME_LIMIT);
|
|
77
|
+
const rest = unverified.length - named.length;
|
|
78
|
+
const list = rest > 0 ? `${named.join(', ')} +${rest}` : named.join(', ');
|
|
79
|
+
const noun = unverified.length === 1 ? 'device' : 'devices';
|
|
80
|
+
return chalk.red(` · ${unverified.length} ${noun} answered with a result that could not be verified: ${list}\n`);
|
|
81
|
+
}
|
|
64
82
|
/** `path:purpose` → a context anchor. Purpose may contain colons. */
|
|
65
83
|
function parseContextFlag(raw) {
|
|
66
84
|
const i = raw.indexOf(':');
|
|
@@ -616,8 +634,13 @@ export function registerProjectsCommands(program) {
|
|
|
616
634
|
for (const ig of def.integrations ?? []) {
|
|
617
635
|
console.log(` ${chalk.dim(ig.kind.padEnd(8))} ${ig.url}${ig.label ? chalk.dim(` (${ig.label})`) : ''}`);
|
|
618
636
|
}
|
|
619
|
-
if (def.linear?.url || def.linear?.projectId)
|
|
620
|
-
|
|
637
|
+
if (def.linear?.url || def.linear?.projectId || def.linear?.name) {
|
|
638
|
+
// Lead with the board's own name — the id/url answers "which project",
|
|
639
|
+
// but the name is what a reader (or an agent) calls the work.
|
|
640
|
+
const ref = def.linear.url ?? def.linear.projectId;
|
|
641
|
+
const label = def.linear.name ? chalk.cyan(def.linear.name) : '';
|
|
642
|
+
console.log(` ${chalk.dim('linear')} ${[label, ref && chalk.dim(ref)].filter(Boolean).join(' ')}`);
|
|
643
|
+
}
|
|
621
644
|
for (const d of def.docs ?? [])
|
|
622
645
|
console.log(` ${chalk.dim('doc')} ${d}`);
|
|
623
646
|
console.log(chalk.gray(` ${projectDefPath(name)}`));
|
|
@@ -789,6 +812,112 @@ export function registerProjectsCommands(program) {
|
|
|
789
812
|
// and this command has no remote code path either way.
|
|
790
813
|
console.log(JSON.stringify(probeProjectWorkspaces(paths ?? []), null, 2));
|
|
791
814
|
});
|
|
815
|
+
// ---- pull-local (hidden; the peer half of `pull`) ----
|
|
816
|
+
projects
|
|
817
|
+
.command('pull-local', { hidden: true })
|
|
818
|
+
.description('Fast-forward workspace repos (default-branch only) and print JSON. Answers for this machine only.')
|
|
819
|
+
.requiredOption('--targets <json>', 'JSON array of {path, expectedSlug} targets, from the orchestrating `pull`')
|
|
820
|
+
.option('--json', 'Machine-readable output (the only output format)')
|
|
821
|
+
.action(async (opts) => {
|
|
822
|
+
// Never fans out — this is the peer half of the fleet fan-out.
|
|
823
|
+
//
|
|
824
|
+
// Targets arrive as {path, expectedSlug} PAIRS, not bare paths: the slug
|
|
825
|
+
// is what lets this machine refuse to fast-forward a directory hosting a
|
|
826
|
+
// different repo, and it is hashed into the fingerprint the caller
|
|
827
|
+
// verifies. Decoding failures exit non-zero so the caller records this
|
|
828
|
+
// peer as skipped instead of reading a missing answer as "nothing to do".
|
|
829
|
+
let targets;
|
|
830
|
+
try {
|
|
831
|
+
targets = decodePullTargets(opts.targets);
|
|
832
|
+
}
|
|
833
|
+
catch (err) {
|
|
834
|
+
console.error(chalk.red(`Invalid --targets: ${err.message}`));
|
|
835
|
+
process.exit(1);
|
|
836
|
+
}
|
|
837
|
+
const results = await pullProjectTargets(targets);
|
|
838
|
+
const envelope = buildPullEnvelope(results, targets);
|
|
839
|
+
console.log(JSON.stringify(envelope, null, 2));
|
|
840
|
+
});
|
|
841
|
+
// ---- pull ----
|
|
842
|
+
const pullCmd = projects
|
|
843
|
+
.command('pull <name>')
|
|
844
|
+
.description('Fast-forward every fleet checkout of a named project to its remote default branch.')
|
|
845
|
+
.option('--device <name...>', 'Scope fleet pull to one or more devices (repeatable)')
|
|
846
|
+
.option('--devices <names>', 'Scope fleet pull to a comma-separated list of devices')
|
|
847
|
+
.option('--json', 'Machine-readable output')
|
|
848
|
+
.action(async (name, rawOpts) => {
|
|
849
|
+
const def = loadProjectDef(name);
|
|
850
|
+
if (!def) {
|
|
851
|
+
console.error(chalk.red(`No project named "${name}". Create it: agents projects add ${name}`));
|
|
852
|
+
process.exit(1);
|
|
853
|
+
}
|
|
854
|
+
const targets = projectRepoTargetsForDef(def);
|
|
855
|
+
if (targets.length === 0) {
|
|
856
|
+
console.error(chalk.yellow(`Project "${name}" has no configured repositories.`));
|
|
857
|
+
process.exit(0);
|
|
858
|
+
}
|
|
859
|
+
const deviceFilter = resolveDeviceFilter(rawOpts.device, rawOpts.devices);
|
|
860
|
+
// Pull locally first.
|
|
861
|
+
const self = machineId();
|
|
862
|
+
const localResults = await pullProjectTargets(targets, self);
|
|
863
|
+
// Fan out to fleet peers. Send the full {path, expectedSlug} targets —
|
|
864
|
+
// bare paths would disable slug verification on every peer AND make the
|
|
865
|
+
// peer's fingerprint (which hashes the slug) unmatchable, so its whole
|
|
866
|
+
// answer would be discarded. Compute the fingerprint once so every peer
|
|
867
|
+
// envelope can be verified against the exact target set we sent.
|
|
868
|
+
const expectedFingerprint = fingerprintTargets(targets);
|
|
869
|
+
const remoteRes = await gatherRemoteAgentsJson({
|
|
870
|
+
args: pullLocalArgs(targets),
|
|
871
|
+
noFanoutEnv: PROJECTS_NO_FANOUT_ENV,
|
|
872
|
+
hosts: deviceFilter,
|
|
873
|
+
parse: (stdout, machine) => parseProjectPullEnvelope(stdout, machine, { expectedFingerprint }),
|
|
874
|
+
quiet: true,
|
|
875
|
+
timeoutMs: 120_000,
|
|
876
|
+
});
|
|
877
|
+
const allResults = [...localResults, ...remoteRes.items];
|
|
878
|
+
if (rawOpts.json) {
|
|
879
|
+
// Mirror `status --json`: peers that didn't answer, or answered
|
|
880
|
+
// unverifiably, go to stderr so a machine caller can still tell them
|
|
881
|
+
// apart from a device with nothing to report (the JSON array itself
|
|
882
|
+
// stays a clean result list).
|
|
883
|
+
if (remoteRes.skipped.length > 0)
|
|
884
|
+
process.stderr.write(formatFleetSkippedNote(remoteRes.skipped));
|
|
885
|
+
if (remoteRes.parseFailed.length > 0)
|
|
886
|
+
process.stderr.write(formatFleetUnverifiedNote(remoteRes.parseFailed));
|
|
887
|
+
console.log(JSON.stringify(allResults, null, 2));
|
|
888
|
+
}
|
|
889
|
+
else {
|
|
890
|
+
printProjectPullSummary(name, allResults, remoteRes.skipped, remoteRes.parseFailed);
|
|
891
|
+
}
|
|
892
|
+
// A peer whose answer could not be verified already ran a real pull whose
|
|
893
|
+
// outcome we cannot see — that is a failed pull, not a quiet success.
|
|
894
|
+
if (!projectPullComplete(allResults) || remoteRes.parseFailed.length > 0) {
|
|
895
|
+
process.exit(1);
|
|
896
|
+
}
|
|
897
|
+
});
|
|
898
|
+
setHelpSections(pullCmd, {
|
|
899
|
+
examples: `
|
|
900
|
+
agents projects pull rush # pull every checkout in the project
|
|
901
|
+
agents projects pull rush --device yosemite-s0 # scope to one device
|
|
902
|
+
agents projects pull rush --devices s0,s1 # scope to multiple devices
|
|
903
|
+
agents projects pull rush --json # machine-readable results
|
|
904
|
+
`,
|
|
905
|
+
notes: `
|
|
906
|
+
Only checkouts on their remote's default branch are fast-forwarded. Dirty
|
|
907
|
+
trees, local commits ahead of upstream, or a wrong branch are blocked and
|
|
908
|
+
reported — never overwritten.
|
|
909
|
+
|
|
910
|
+
Each checkout is verified against the project's declared repo slug before
|
|
911
|
+
anything is fast-forwarded — on every device, not just this one. A path
|
|
912
|
+
hosting a different repo is blocked.
|
|
913
|
+
|
|
914
|
+
Checkouts absent on a device are skipped (never cloned). Blocked or failed
|
|
915
|
+
checkouts drive a non-zero exit; missing paths do not. A device that
|
|
916
|
+
answers with a result that cannot be verified is reported as unverified
|
|
917
|
+
and also drives a non-zero exit; a device that never answers is reported
|
|
918
|
+
as unavailable and does not.
|
|
919
|
+
`,
|
|
920
|
+
});
|
|
792
921
|
// ---- import ----
|
|
793
922
|
projects
|
|
794
923
|
.command('import')
|
|
@@ -914,7 +1043,7 @@ export function registerProjectsCommands(program) {
|
|
|
914
1043
|
// ---- link ----
|
|
915
1044
|
projects
|
|
916
1045
|
.command('link <name>')
|
|
917
|
-
.description('Attach an external tracker to a project definition (writes linear.projectId into the YAML).')
|
|
1046
|
+
.description('Attach an external tracker to a project definition (writes linear.projectId + name into the YAML; re-run to pick up a Linear rename).')
|
|
918
1047
|
.option('--linear [query]', 'Bind a Linear project by exact name or id; no value auto-suggests from the def name + repo')
|
|
919
1048
|
.action((name, opts) => {
|
|
920
1049
|
const def = loadProjectDef(name);
|
|
@@ -976,9 +1105,12 @@ export function registerProjectsCommands(program) {
|
|
|
976
1105
|
if (def.linear?.projectId && def.linear.projectId !== p.id) {
|
|
977
1106
|
console.log(chalk.gray(` replacing previous Linear link (${def.linear.projectId})`));
|
|
978
1107
|
}
|
|
979
|
-
def.linear
|
|
980
|
-
|
|
981
|
-
|
|
1108
|
+
if (def.linear?.name && def.linear.name !== p.name) {
|
|
1109
|
+
console.log(chalk.gray(` renaming "${def.linear.name}" → "${p.name}" (Linear is authoritative)`));
|
|
1110
|
+
}
|
|
1111
|
+
// Assigned, not spread over `def.linear`: a spread would resurrect a url
|
|
1112
|
+
// that nextLinearLink deliberately dropped. The block has no other fields.
|
|
1113
|
+
def.linear = nextLinearLink(def.linear, p);
|
|
982
1114
|
writeProjectDef(def);
|
|
983
1115
|
console.log(chalk.green(`${def.name} → Linear project "${p.name}" (${p.id})${p.url ? ` ${p.url}` : ''}`));
|
|
984
1116
|
});
|
package/dist/commands/prune.js
CHANGED
|
@@ -23,18 +23,19 @@
|
|
|
23
23
|
*/
|
|
24
24
|
import * as fs from 'fs';
|
|
25
25
|
import chalk from 'chalk';
|
|
26
|
+
import { formatBytes } from '../lib/format.js';
|
|
26
27
|
import { confirm } from '@inquirer/prompts';
|
|
27
28
|
import { diffVersionCommands, iterCommandsCapableVersions, removeCommandFromVersion, } from '../lib/commands.js';
|
|
28
|
-
import { diffVersionSkills, iterSkillsCapableVersions, removeSkillFromVersion, } from '../lib/skills.js';
|
|
29
|
+
import { diffVersionSkills, iterSkillsCapableVersions, removeSkillFromVersion, } from '../lib/plugins/skills.js';
|
|
29
30
|
import { listUnmanagedHooksInVersionHome, iterHooksCapableVersions, removeHookFromVersion, } from '../lib/hooks.js';
|
|
30
|
-
import { diffVersionPlugins, iterPluginsCapableVersions, removePluginSkillFromVersion, } from '../lib/plugins.js';
|
|
31
|
+
import { diffVersionPlugins, iterPluginsCapableVersions, removePluginSkillFromVersion, } from '../lib/plugins/plugins.js';
|
|
31
32
|
import { diffVersionSubagents, iterSubagentsCapableVersions, removeSubagentFromVersion, } from '../lib/subagents.js';
|
|
32
|
-
import { getGlobalDefault } from '../lib/versions.js';
|
|
33
|
+
import { getGlobalDefault } from '../lib/installations/versions.js';
|
|
33
34
|
import { resolveAgentName, formatAgentError } from '../lib/agents.js';
|
|
34
35
|
import { pruneDuplicates } from './view.js';
|
|
35
36
|
import { isInteractiveTerminal, isPromptCancelled } from './utils.js';
|
|
36
37
|
import { getTrashDir } from '../lib/state.js';
|
|
37
|
-
import { previewRunsPrune, pruneRuns, countAllRuns } from '../lib/routines.js';
|
|
38
|
+
import { previewRunsPrune, pruneRuns, countAllRuns } from '../lib/scheduling/routines.js';
|
|
38
39
|
const RESOURCE_TYPES = ['commands', 'skills', 'hooks', 'plugins', 'subagents'];
|
|
39
40
|
const STATE_TYPES = ['trash', 'sessions', 'runs'];
|
|
40
41
|
const ALL_TYPES = [...RESOURCE_TYPES, 'versions', ...STATE_TYPES];
|
|
@@ -128,15 +129,6 @@ function parseTarget(arg) {
|
|
|
128
129
|
console.log(chalk.gray(formatAgentError(arg)));
|
|
129
130
|
process.exit(1);
|
|
130
131
|
}
|
|
131
|
-
function formatBytes(bytes) {
|
|
132
|
-
if (bytes < 1024)
|
|
133
|
-
return `${bytes} B`;
|
|
134
|
-
if (bytes < 1024 * 1024)
|
|
135
|
-
return `${(bytes / 1024).toFixed(1)} KB`;
|
|
136
|
-
if (bytes < 1024 * 1024 * 1024)
|
|
137
|
-
return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
|
|
138
|
-
return `${(bytes / (1024 * 1024 * 1024)).toFixed(2)} GB`;
|
|
139
|
-
}
|
|
140
132
|
async function runTrashPrune(options) {
|
|
141
133
|
const trashDir = getTrashDir();
|
|
142
134
|
if (!fs.existsSync(trashDir)) {
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import chalk from 'chalk';
|
|
9
9
|
import { AGENTS, resolveAgentName } from '../lib/agents.js';
|
|
10
|
-
import { isVersionInstalled } from '../lib/versions.js';
|
|
10
|
+
import { isVersionInstalled } from '../lib/installations/versions.js';
|
|
11
11
|
import { ensureRulesFresh, supportsRulesImports } from '../lib/rules/compile.js';
|
|
12
12
|
/**
|
|
13
13
|
* Hidden command invoked by shims for agents that don't natively resolve
|
package/dist/commands/repo.d.ts
CHANGED
|
@@ -99,12 +99,10 @@ export declare function wrapPhrases(parts: string[], width: number): string[];
|
|
|
99
99
|
export interface RepoStatusOptions {
|
|
100
100
|
verbose?: boolean;
|
|
101
101
|
json?: boolean;
|
|
102
|
-
/** Fan out across every reachable fleet device (`--devices-all
|
|
102
|
+
/** Fan out across every reachable fleet device (`--devices-all`). */
|
|
103
103
|
devicesAll?: boolean;
|
|
104
|
-
|
|
105
|
-
/** `all`, or a comma-separated device list (`--devices`/`--hosts`). */
|
|
104
|
+
/** `all`, or a comma-separated device list (`--devices`). */
|
|
106
105
|
devices?: string;
|
|
107
|
-
hosts?: string;
|
|
108
106
|
}
|
|
109
107
|
/**
|
|
110
108
|
* Per-device repo status — the unit of the `--devices-all` fleet fan-out. One
|
|
@@ -146,9 +144,9 @@ type DeviceIntent = {
|
|
|
146
144
|
};
|
|
147
145
|
/**
|
|
148
146
|
* Read the device-scope flags into an intent, or null for the default local-only
|
|
149
|
-
* run. `--devices-all
|
|
150
|
-
*
|
|
151
|
-
*
|
|
147
|
+
* run. `--devices-all` (and `--devices all`) sweeps every reachable peer;
|
|
148
|
+
* `--devices box1,box2` targets an explicit list. A peer carrying
|
|
149
|
+
* {@link NO_REPO_FANOUT_ENV} never fans out again (recursion guard).
|
|
152
150
|
*/
|
|
153
151
|
export declare function resolveDeviceIntent(opts: RepoStatusOptions): DeviceIntent | null;
|
|
154
152
|
/** Register the `agents repos` command tree (`repo` is a convenience alias). */
|
package/dist/commands/repo.js
CHANGED
|
@@ -34,8 +34,8 @@ import { DEFAULT_SYSTEM_REPO } from '../lib/types.js';
|
|
|
34
34
|
import { ALL_AGENT_IDS, isAgentName, resolveAgentName } from '../lib/agents.js';
|
|
35
35
|
import { refresh } from '../lib/refresh.js';
|
|
36
36
|
import { capableAgents } from '../lib/capabilities.js';
|
|
37
|
-
import { getGlobalDefault, getVersionHomePath, listInstalledVersions } from '../lib/versions.js';
|
|
38
|
-
import { syncAllMarketplaces } from '../lib/plugin-marketplace.js';
|
|
37
|
+
import { getGlobalDefault, getVersionHomePath, listInstalledVersions } from '../lib/installations/versions.js';
|
|
38
|
+
import { syncAllMarketplaces } from '../lib/plugins/plugin-marketplace.js';
|
|
39
39
|
import { gatherRemoteAgentsJson } from '../lib/remote-agents-json.js';
|
|
40
40
|
import { machineId, normalizeHost } from '../lib/machine-id.js';
|
|
41
41
|
/**
|
|
@@ -522,16 +522,16 @@ export function renderDeviceStatusRows(results) {
|
|
|
522
522
|
}
|
|
523
523
|
/**
|
|
524
524
|
* Read the device-scope flags into an intent, or null for the default local-only
|
|
525
|
-
* run. `--devices-all
|
|
526
|
-
*
|
|
527
|
-
*
|
|
525
|
+
* run. `--devices-all` (and `--devices all`) sweeps every reachable peer;
|
|
526
|
+
* `--devices box1,box2` targets an explicit list. A peer carrying
|
|
527
|
+
* {@link NO_REPO_FANOUT_ENV} never fans out again (recursion guard).
|
|
528
528
|
*/
|
|
529
529
|
export function resolveDeviceIntent(opts) {
|
|
530
530
|
if (process.env[NO_REPO_FANOUT_ENV] === '1')
|
|
531
531
|
return null;
|
|
532
|
-
if (opts.devicesAll
|
|
532
|
+
if (opts.devicesAll)
|
|
533
533
|
return { all: true };
|
|
534
|
-
const val = opts.devices
|
|
534
|
+
const val = opts.devices;
|
|
535
535
|
if (val === undefined)
|
|
536
536
|
return null;
|
|
537
537
|
const v = val.trim();
|
|
@@ -639,21 +639,19 @@ function formatRepoTarget(alias, dir, branch) {
|
|
|
639
639
|
}
|
|
640
640
|
/**
|
|
641
641
|
* Register the fleet device-scope flags shared by `repo list` / `repo status`.
|
|
642
|
-
* `--devices-all`
|
|
643
|
-
*
|
|
644
|
-
*
|
|
645
|
-
*
|
|
642
|
+
* `--devices-all` sweeps every reachable device; `--devices <who>` takes `all`
|
|
643
|
+
* or a comma-separated list. A single `--device` is handled upstream by
|
|
644
|
+
* maybeRunOnHost, which streams that one box's `agents repo status` — these are
|
|
645
|
+
* the aggregating forms.
|
|
646
646
|
*/
|
|
647
647
|
function addDeviceStatusOptions(cmd) {
|
|
648
648
|
return cmd
|
|
649
|
-
.option('--devices-all', 'Report repo sync state across ALL reachable fleet devices
|
|
650
|
-
.option('--
|
|
651
|
-
.option('--devices <who>', 'Fleet devices to report on: "all", or a comma-separated device list (alias: --hosts).')
|
|
652
|
-
.option('--hosts <who>', 'Alias of --devices.');
|
|
649
|
+
.option('--devices-all', 'Report repo sync state across ALL reachable fleet devices.')
|
|
650
|
+
.option('--devices <who>', 'Fleet devices to report on: "all", or a comma-separated device list.');
|
|
653
651
|
}
|
|
654
652
|
/** Register the `agents repos` command tree (`repo` is a convenience alias). */
|
|
655
653
|
export function registerRepoCommands(program) {
|
|
656
|
-
// addHostOption on the group so --help documents --
|
|
654
|
+
// addHostOption on the group so --help documents --device; remote
|
|
657
655
|
// routing is handled pre-parse by maybeRunOnHost (passthrough.ts).
|
|
658
656
|
const repoCmd = addHostOption(program
|
|
659
657
|
.command('repos')
|
|
@@ -968,7 +966,7 @@ export function registerRepoCommands(program) {
|
|
|
968
966
|
});
|
|
969
967
|
repoCmd
|
|
970
968
|
.command('pull [alias] [url]')
|
|
971
|
-
.description('Pull updates. Aliases: "system" (~/.agents/.system/), "user" (~/.agents/), or any registered extra. No arg pulls all. Pass a git URL to git-back a not-yet-cloned user repo: "agents repo pull user <url>".')
|
|
969
|
+
.description('Pull updates and reconcile synced device decisions. Aliases: "system" (~/.agents/.system/), "user" (~/.agents/), or any registered extra. No arg pulls all. Pass a git URL to git-back a not-yet-cloned user repo: "agents repo pull user <url>".')
|
|
972
970
|
.action(async (alias, url) => {
|
|
973
971
|
const targets = collectRepoTargets(alias);
|
|
974
972
|
if (!targets) {
|
|
@@ -980,6 +978,7 @@ export function registerRepoCommands(program) {
|
|
|
980
978
|
return;
|
|
981
979
|
}
|
|
982
980
|
let anyPulled = false;
|
|
981
|
+
let userPulled = false;
|
|
983
982
|
for (const t of targets) {
|
|
984
983
|
if (!fs.existsSync(t.dir) || !isGitRepo(t.dir)) {
|
|
985
984
|
// A plain (never-cloned) user repo — setup makes ~/.agents a bare dir and
|
|
@@ -1020,6 +1019,8 @@ export function registerRepoCommands(program) {
|
|
|
1020
1019
|
if (result.success) {
|
|
1021
1020
|
spinner.succeed(`${formatRepoTarget(t.alias, t.dir, result.branch)}: ${result.commit}`);
|
|
1022
1021
|
anyPulled = true;
|
|
1022
|
+
if (t.alias === 'user')
|
|
1023
|
+
userPulled = true;
|
|
1023
1024
|
}
|
|
1024
1025
|
else {
|
|
1025
1026
|
spinner.fail(`${formatRepoTarget(t.alias, t.dir)}: ${result.error}`);
|
|
@@ -1036,11 +1037,22 @@ export function registerRepoCommands(program) {
|
|
|
1036
1037
|
// so scheduler.reloadAll() re-reads the synced YAML and device pins refresh.
|
|
1037
1038
|
// No-op when the daemon isn't running (or on Windows, which has no SIGHUP).
|
|
1038
1039
|
if (anyPulled) {
|
|
1039
|
-
const { isDaemonRunning, signalDaemonReload } = await import('../lib/daemon.js');
|
|
1040
|
+
const { isDaemonRunning, signalDaemonReload } = await import('../lib/daemon/daemon.js');
|
|
1040
1041
|
if (isDaemonRunning() && signalDaemonReload()) {
|
|
1041
1042
|
console.log(chalk.gray('Reloaded the routines daemon (device pins refreshed).'));
|
|
1042
1043
|
}
|
|
1043
1044
|
}
|
|
1045
|
+
if (userPulled) {
|
|
1046
|
+
const { reconcileDeviceDiscoveryPolicies } = await import('../lib/devices/discovery-policy.js');
|
|
1047
|
+
const result = await reconcileDeviceDiscoveryPolicies();
|
|
1048
|
+
const parts = [
|
|
1049
|
+
result.registered.length ? `${result.registered.length} registered` : null,
|
|
1050
|
+
result.ignored.length ? `${result.ignored.length} ignored` : null,
|
|
1051
|
+
result.unresolved.length ? `${result.unresolved.length} approved but unavailable` : null,
|
|
1052
|
+
].filter(Boolean);
|
|
1053
|
+
if (parts.length > 0)
|
|
1054
|
+
console.log(chalk.gray(`Device policy: ${parts.join(' · ')}`));
|
|
1055
|
+
}
|
|
1044
1056
|
});
|
|
1045
1057
|
repoCmd
|
|
1046
1058
|
.command('push [alias]')
|
|
@@ -1123,6 +1135,10 @@ Examples:
|
|
|
1123
1135
|
if (result.success) {
|
|
1124
1136
|
const pushed = result.pushed ? ' (pushed)' : '';
|
|
1125
1137
|
spinner.succeed(`${formatRepoTarget(t.alias, t.dir)}: ${result.commit}${pushed}`);
|
|
1138
|
+
if (t.alias === 'user') {
|
|
1139
|
+
const { reconcileDeviceDiscoveryPolicies } = await import('../lib/devices/discovery-policy.js');
|
|
1140
|
+
await reconcileDeviceDiscoveryPolicies();
|
|
1141
|
+
}
|
|
1126
1142
|
}
|
|
1127
1143
|
else {
|
|
1128
1144
|
spinner.fail(`${formatRepoTarget(t.alias, t.dir)}: ${result.error}`);
|
|
@@ -42,6 +42,10 @@ export async function showResourceList(opts) {
|
|
|
42
42
|
filter: (query) => filterRows(opts.rows, query),
|
|
43
43
|
labelFor: (row) => formatPickerRow(row, opts),
|
|
44
44
|
buildPreview: (row) => row.buildDetail(),
|
|
45
|
+
// Row numbers say where each entry sits in the list while scrolling —
|
|
46
|
+
// and read against the total when the caller prints one, as
|
|
47
|
+
// `agents inspect` does with its "commands (12)" header.
|
|
48
|
+
numbered: true,
|
|
45
49
|
pageSize: 12,
|
|
46
50
|
emptyMessage: `No matching ${opts.resourcePlural}.`,
|
|
47
51
|
enterHint: 'view',
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
interface ResumeOptions {
|
|
1
|
+
export interface StrictResumeOptions {
|
|
3
2
|
mode?: string;
|
|
4
3
|
interactive?: boolean;
|
|
5
4
|
headless?: boolean;
|
|
@@ -16,13 +15,18 @@ interface ResumeOptions {
|
|
|
16
15
|
* on an older CLI (see the constant's docs). Every argv token here exists in the
|
|
17
16
|
* released surface.
|
|
18
17
|
*/
|
|
19
|
-
export declare function buildResumeRemoteArgs(sessionId: string, prompt: string | undefined, options:
|
|
20
|
-
/** Translate `agents resume <id>` to the canonical `agents run` surface after
|
|
18
|
+
export declare function buildResumeRemoteArgs(sessionId: string, prompt: string | undefined, options: StrictResumeOptions): string[];
|
|
19
|
+
/** Translate `agents sessions resume <id>` to the canonical `agents run` surface after
|
|
21
20
|
* resolving the source identity. The run command remains the only executor. */
|
|
22
21
|
export declare function buildResumeRunArgs(session: {
|
|
23
22
|
id: string;
|
|
24
23
|
agent: string;
|
|
25
24
|
version?: string;
|
|
26
|
-
}, prompt: string | undefined, options:
|
|
27
|
-
|
|
28
|
-
export
|
|
25
|
+
}, prompt: string | undefined, options: StrictResumeOptions): string[];
|
|
26
|
+
/** True when the caller asked for the strict resume path (prompt and/or flags). */
|
|
27
|
+
export declare function wantsStrictResume(prompt: string | undefined, options: StrictResumeOptions): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Strict single-session resume: resolve id/label across the fleet, hop to the
|
|
30
|
+
* owning device when needed, then delegate to `agents run --resume`.
|
|
31
|
+
*/
|
|
32
|
+
export declare function runStrictResume(sessionId: string, prompt: string | undefined, options: StrictResumeOptions): Promise<void>;
|