@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
package/dist/commands/browser.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import chalk from 'chalk';
|
|
2
2
|
import * as fs from 'fs';
|
|
3
3
|
import * as path from 'path';
|
|
4
|
-
import { listProfiles, getProfile, createProfile, deleteProfile, ensureDefaultBrowserProfile, getConfiguredDefaultProfileName, DEFAULT_BROWSER_PROFILE_NAME, getProfileRuntimeDir, extractConfiguredPort, findFreeProfilePort, getEndpointPresets, } from '../lib/browser/profiles.js';
|
|
4
|
+
import { listProfiles, getProfile, createProfile, deleteProfile, ensureDefaultBrowserProfile, getConfiguredDefaultProfileName, DEFAULT_BROWSER_PROFILE_NAME, getProfileRuntimeDir, extractConfiguredPort, findFreeProfilePort, getEndpointPresets, listProfilesWithScope, formatProfilesTable, } from '../lib/browser/profiles.js';
|
|
5
5
|
import { resolveActor } from '../lib/actor.js';
|
|
6
6
|
import { loginsForProfile, profilesLoggedInto, serviceForUrl, loginsWithAccountsForProfile, accountsForProfile, credKeysForService, AUTH_SIGNATURES, } from '../lib/browser/login-detection.js';
|
|
7
7
|
import { parseSecretRef } from '../lib/browser/secret-ref.js';
|
|
8
8
|
import { readAndResolveBundleEnv, bundleExists, readBundle, describeBundle } from '../lib/secrets/bundles.js';
|
|
9
9
|
import { findBrowserPath, getPortOccupant, isLauncherScript } from '../lib/browser/chrome.js';
|
|
10
|
-
import { listProfileCacheDirs, removeProfileCache, listAllProfileSnapshots, } from '../lib/browser/runtime-state.js';
|
|
10
|
+
import { listProfileCacheDirs, removeProfileCache, listAllProfileSnapshots, buildProfilePrunePlan, pruneProfiles, PRUNE_REASON_TEXT, } from '../lib/browser/runtime-state.js';
|
|
11
11
|
import { DEFAULT_VIEWPORT } from '../lib/browser/devices.js';
|
|
12
12
|
import { runBrowserSessionsCommand } from './browser-sessions-picker.js';
|
|
13
13
|
import { discoverBrowserWsUrl, verifyBrowserIdentity } from '../lib/browser/cdp.js';
|
|
@@ -24,10 +24,13 @@ import { runBrowserIPCStream } from '../lib/browser/stream.js';
|
|
|
24
24
|
/**
|
|
25
25
|
* Resolve which browser task a command targets. Order:
|
|
26
26
|
* 1. `--task <name>` flag (explicit per-command override)
|
|
27
|
-
* 2. `$AGENTS_BROWSER_TASK` (
|
|
27
|
+
* 2. `$AGENTS_BROWSER_TASK` (optional shell default)
|
|
28
|
+
* 3. `undefined` — the daemon resolves from the caller's identity
|
|
29
|
+
* (session / launch id stamped in sendIPCRequest)
|
|
28
30
|
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
+
* `undefined` is valid: page verbs create a task when none resolves, and
|
|
32
|
+
* done/stop report "nothing to close". Agents no longer need to type a handle
|
|
33
|
+
* in the common case.
|
|
31
34
|
*/
|
|
32
35
|
function resolveTaskName(opts) {
|
|
33
36
|
if (opts.task)
|
|
@@ -35,20 +38,18 @@ function resolveTaskName(opts) {
|
|
|
35
38
|
const fromEnv = process.env.AGENTS_BROWSER_TASK;
|
|
36
39
|
if (fromEnv)
|
|
37
40
|
return fromEnv;
|
|
38
|
-
|
|
39
|
-
console.error('Tip: T=$(agents browser start --profile <p>) && export AGENTS_BROWSER_TASK=$T');
|
|
40
|
-
process.exit(1);
|
|
41
|
+
return undefined;
|
|
41
42
|
}
|
|
42
43
|
// `-t` is taken by `--tab` on most commands, so `--task` is long-form only.
|
|
43
|
-
//
|
|
44
|
+
// The daemon resolves from caller identity when omitted.
|
|
44
45
|
const TASK_OPTION_FLAG = '--task <name>';
|
|
45
|
-
const TASK_OPTION_DESC = 'Task name (defaults to $AGENTS_BROWSER_TASK)';
|
|
46
|
+
const TASK_OPTION_DESC = 'Task name (defaults to $AGENTS_BROWSER_TASK, else the caller\'s live task)';
|
|
46
47
|
// Help groups — surfaces the actual mental model an agent follows
|
|
47
48
|
// ("open a session / drive the page / capture evidence / rare extras")
|
|
48
49
|
// instead of an alphabetical dump. Everything not listed falls into a
|
|
49
50
|
// trailing "Other commands" section automatically.
|
|
50
51
|
const BROWSER_HELP_GROUPS = [
|
|
51
|
-
{ title: 'Session lifecycle', names: ['start', 'done', 'status'] },
|
|
52
|
+
{ title: 'Session lifecycle', names: ['start', 'done', 'status', 'gc'] },
|
|
52
53
|
{ title: 'Fast action loop', names: ['stream'] },
|
|
53
54
|
{
|
|
54
55
|
title: 'Drive the page',
|
|
@@ -78,7 +79,7 @@ export function registerBrowserCommand(program) {
|
|
|
78
79
|
# Or pin to a specific profile
|
|
79
80
|
agents browser start --profile work
|
|
80
81
|
|
|
81
|
-
# Drive the page
|
|
82
|
+
# Drive the page (no start / --task needed — identity resolves the task)
|
|
82
83
|
agents browser navigate https://example.com
|
|
83
84
|
agents browser screenshot
|
|
84
85
|
|
|
@@ -86,7 +87,7 @@ export function registerBrowserCommand(program) {
|
|
|
86
87
|
agents browser stream --task "$AGENTS_BROWSER_TASK"
|
|
87
88
|
|
|
88
89
|
# Drive another machine's browser (needs its consent — see remote-control)
|
|
89
|
-
agents browser start --
|
|
90
|
+
agents browser start --device zion
|
|
90
91
|
|
|
91
92
|
# Browse a task-heavy profile's captures: one row per task, not per file
|
|
92
93
|
agents browser sessions
|
|
@@ -96,6 +97,9 @@ export function registerBrowserCommand(program) {
|
|
|
96
97
|
|
|
97
98
|
# End the session when done
|
|
98
99
|
agents browser done
|
|
100
|
+
|
|
101
|
+
# Close tabs the daemon's own reaper would have caught on its next 5-min tick
|
|
102
|
+
agents browser gc --dry-run
|
|
99
103
|
`,
|
|
100
104
|
notes: `
|
|
101
105
|
Most agent workflows should use the 'browser' skill instead of raw subcommands.
|
|
@@ -147,46 +151,28 @@ function registerProfilesCommands(browser) {
|
|
|
147
151
|
profiles
|
|
148
152
|
.command('list')
|
|
149
153
|
.alias('ls')
|
|
150
|
-
.description('List all browser profiles')
|
|
151
|
-
.
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
console.log('No browser profiles configured.');
|
|
155
|
-
console.log('Create one with: agents browser profiles create <name> --endpoint <url>');
|
|
156
|
-
return;
|
|
157
|
-
}
|
|
158
|
-
// The configured default is what a bare `agents browser start` (and an
|
|
159
|
-
// explicit `--profile default`) resolves to on THIS machine — mark it.
|
|
154
|
+
.description('List all browser profiles, with the store each lives in (local / fleet)')
|
|
155
|
+
.option('--json', 'Output machine-readable JSON')
|
|
156
|
+
.action(async (opts) => {
|
|
157
|
+
const scoped = await listProfilesWithScope();
|
|
160
158
|
const configuredDefault = getConfiguredDefaultProfileName();
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
const endpoints = Object.entries(presets)
|
|
169
|
-
.map(([name, ep]) => (name.startsWith('endpoint-') ? ep.target : `${name}=${ep.target}`))
|
|
170
|
-
.join(', ');
|
|
171
|
-
const desc = (p.description ?? '').slice(0, 36).padEnd(38);
|
|
172
|
-
console.log(p.name.padEnd(20) + (p.browser || '-').padEnd(12) + desc + endpoints + marker(p.name));
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
else {
|
|
176
|
-
console.log('NAME'.padEnd(20) + 'BROWSER'.padEnd(12) + 'ENDPOINTS');
|
|
177
|
-
console.log('-'.repeat(72));
|
|
178
|
-
for (const p of allProfiles) {
|
|
179
|
-
const presets = getEndpointPresets(p);
|
|
180
|
-
const endpoints = Object.entries(presets)
|
|
181
|
-
.map(([name, ep]) => (name.startsWith('endpoint-') ? ep.target : `${name}=${ep.target}`))
|
|
182
|
-
.join(', ');
|
|
183
|
-
console.log(p.name.padEnd(20) + (p.browser || '-').padEnd(12) + endpoints + marker(p.name));
|
|
184
|
-
}
|
|
159
|
+
if (opts.json) {
|
|
160
|
+
console.log(JSON.stringify(scoped.map(({ profile, scope }) => ({
|
|
161
|
+
...profile,
|
|
162
|
+
scope,
|
|
163
|
+
isConfiguredDefault: profile.name === configuredDefault,
|
|
164
|
+
})), null, 2));
|
|
165
|
+
return;
|
|
185
166
|
}
|
|
186
|
-
if (
|
|
187
|
-
console.log('');
|
|
188
|
-
console.log(
|
|
167
|
+
if (scoped.length === 0) {
|
|
168
|
+
console.log('No browser profiles configured.');
|
|
169
|
+
console.log('Create one with: agents browser profiles create <name> --browser chrome');
|
|
170
|
+
return;
|
|
189
171
|
}
|
|
172
|
+
// Rendering lives in lib/browser/profiles.ts so the column widths and the
|
|
173
|
+
// default-marking rules are unit-tested rather than eyeballed (RUSH-2710).
|
|
174
|
+
for (const line of formatProfilesTable(scoped, configuredDefault))
|
|
175
|
+
console.log(line);
|
|
190
176
|
});
|
|
191
177
|
const browserProfileDeprecation = chalk.yellow('Deprecation: `agents browser profiles set-default` is replaced by `agents config set browser.profile <name>`.');
|
|
192
178
|
profiles
|
|
@@ -256,8 +242,9 @@ function registerProfilesCommands(browser) {
|
|
|
256
242
|
const VALID_BROWSERS = ['chrome', 'comet', 'chromium', 'brave', 'edge', 'custom'];
|
|
257
243
|
profiles
|
|
258
244
|
.command('create <name>')
|
|
259
|
-
.description('Create a new browser profile')
|
|
245
|
+
.description('Create a new browser profile (machine-local unless --fleet)')
|
|
260
246
|
.requiredOption('-b, --browser <type>', `Browser type: ${VALID_BROWSERS.join(', ')}`)
|
|
247
|
+
.option('--fleet', 'Store in the synced agents.yaml so every machine sees it. Default is machine-local: a profile pins an OS-specific binary path and a locally chosen port, so a synced copy is wrong on every other box.')
|
|
261
248
|
.option('-e, --endpoint <url>', 'CDP endpoint URL (repeatable; auto-assigned if omitted)', collect, [])
|
|
262
249
|
.option('-s, --secrets <bundle>', 'Secrets bundle to inject')
|
|
263
250
|
.option('-d, --description <text>', 'Profile description')
|
|
@@ -337,8 +324,8 @@ function registerProfilesCommands(browser) {
|
|
|
337
324
|
chrome: opts.headless ? { headless: true } : undefined,
|
|
338
325
|
viewport,
|
|
339
326
|
};
|
|
340
|
-
await createProfile(profile);
|
|
341
|
-
console.log(`Created profile: ${name}`);
|
|
327
|
+
await createProfile(profile, { fleet: !!opts.fleet });
|
|
328
|
+
console.log(`Created profile: ${name} (${opts.fleet ? 'fleet-synced — visible on every machine' : 'machine-local'})`);
|
|
342
329
|
// Warn (don't fail) if the declared secrets bundle doesn't exist yet — it
|
|
343
330
|
// may be created later, but a typo should surface now.
|
|
344
331
|
if (opts.secrets && !bundleExists(opts.secrets)) {
|
|
@@ -455,6 +442,73 @@ function registerProfilesCommands(browser) {
|
|
|
455
442
|
`\`agents browser start\` will auto-detect until you run: agents config set browser.profile <name>`);
|
|
456
443
|
}
|
|
457
444
|
});
|
|
445
|
+
profiles
|
|
446
|
+
.command('prune')
|
|
447
|
+
.description('Remove dead machine-local profiles: browser not installed here, or never started')
|
|
448
|
+
.option('-n, --dry-run', 'Print what would be removed and exit without changing anything')
|
|
449
|
+
.option('--fleet', 'Also consider fleet-synced profiles (removing one removes it from EVERY machine)')
|
|
450
|
+
.option('--json', 'Output machine-readable JSON')
|
|
451
|
+
.action(async (opts) => {
|
|
452
|
+
const plan = await buildProfilePrunePlan({ includeFleet: opts.fleet });
|
|
453
|
+
if (!opts.dryRun)
|
|
454
|
+
await pruneProfiles(plan);
|
|
455
|
+
if (opts.json) {
|
|
456
|
+
console.log(JSON.stringify({ dryRun: !!opts.dryRun, ...plan }, null, 2));
|
|
457
|
+
return;
|
|
458
|
+
}
|
|
459
|
+
if (plan.candidates.length === 0) {
|
|
460
|
+
console.log('Nothing to prune — every profile is in use, healthy, or protected.');
|
|
461
|
+
if (plan.kept.length > 0) {
|
|
462
|
+
for (const k of plan.kept)
|
|
463
|
+
console.log(` kept ${k.name} (${k.scope}) — ${k.why}`);
|
|
464
|
+
}
|
|
465
|
+
return;
|
|
466
|
+
}
|
|
467
|
+
const verb = opts.dryRun ? 'Would remove' : 'Removed';
|
|
468
|
+
console.log(`${verb} ${plan.candidates.length} profile${plan.candidates.length === 1 ? '' : 's'}:`);
|
|
469
|
+
for (const c of plan.candidates) {
|
|
470
|
+
const cache = c.cacheDirs.length > 0
|
|
471
|
+
? ` + ${c.cacheDirs.length} cache dir${c.cacheDirs.length === 1 ? '' : 's'}`
|
|
472
|
+
: '';
|
|
473
|
+
console.log(` ${c.name} (${c.scope}) — ${PRUNE_REASON_TEXT[c.reason]}${cache}`);
|
|
474
|
+
}
|
|
475
|
+
if (opts.dryRun) {
|
|
476
|
+
console.log('');
|
|
477
|
+
console.log('Nothing was changed. Re-run without --dry-run to apply.');
|
|
478
|
+
}
|
|
479
|
+
});
|
|
480
|
+
setHelpSections(profiles, {
|
|
481
|
+
examples: `
|
|
482
|
+
# What exists here, and whether each is this machine's or the whole fleet's
|
|
483
|
+
agents browser profiles list
|
|
484
|
+
|
|
485
|
+
# Create one — machine-local by default
|
|
486
|
+
agents browser profiles create work --browser chrome
|
|
487
|
+
|
|
488
|
+
# Create one every machine should see (e.g. a remote ssh:// endpoint)
|
|
489
|
+
agents browser profiles create shared-remote --browser chrome --fleet
|
|
490
|
+
|
|
491
|
+
# Clean up dead ones: check first, then apply
|
|
492
|
+
agents browser profiles prune --dry-run
|
|
493
|
+
agents browser profiles prune
|
|
494
|
+
|
|
495
|
+
# Make one the machine's default for a bare \`agents browser start\`
|
|
496
|
+
agents config set browser.profile work
|
|
497
|
+
`,
|
|
498
|
+
notes: `
|
|
499
|
+
Profiles are machine-local by default. A profile pins an OS-specific binary
|
|
500
|
+
path and a locally chosen CDP port, so a fleet-synced copy is wrong on every
|
|
501
|
+
other machine — pass --fleet only when the profile really is fleet config.
|
|
502
|
+
|
|
503
|
+
In \`list\`, the \`*\` marker means "this machine's configured default"
|
|
504
|
+
(\`agents browser start\` with no --profile). It is NOT the same thing as the
|
|
505
|
+
profile NAMED \`default\`, which is the auto-detected one; they are often
|
|
506
|
+
different profiles.
|
|
507
|
+
|
|
508
|
+
\`prune\` never removes a profile that is in use, the configured default, the
|
|
509
|
+
auto \`default\`, or (without --fleet) a fleet-synced one.
|
|
510
|
+
`,
|
|
511
|
+
});
|
|
458
512
|
profiles
|
|
459
513
|
.command('doctor <name>')
|
|
460
514
|
.description('Diagnose a browser profile: binary, port, user-data-dir, onboarding state')
|
|
@@ -627,7 +681,7 @@ function registerProfilesCommands(browser) {
|
|
|
627
681
|
function registerTaskCommands(browser) {
|
|
628
682
|
browser
|
|
629
683
|
.command('remote-control [state]')
|
|
630
|
-
.description("Allow or deny other fleet machines driving THIS machine's browser over `browser --
|
|
684
|
+
.description("Allow or deny other fleet machines driving THIS machine's browser over `browser --device`. " +
|
|
631
685
|
'`on`/`off` to set (device-local, never synced); no argument prints the current value. Default off.')
|
|
632
686
|
.option('--json', 'Output as JSON')
|
|
633
687
|
.action((state, opts) => {
|
|
@@ -658,8 +712,8 @@ function registerTaskCommands(browser) {
|
|
|
658
712
|
}
|
|
659
713
|
console.log(`Remote browser control (this machine) is now ${value ? 'on' : 'off'}.`);
|
|
660
714
|
console.log(value
|
|
661
|
-
? 'Other fleet machines can now drive this browser via `browser --
|
|
662
|
-
: 'Cross-machine `browser --
|
|
715
|
+
? 'Other fleet machines can now drive this browser via `browser --device <this-device>`.'
|
|
716
|
+
: 'Cross-machine `browser --device` drives to this machine are refused.');
|
|
663
717
|
});
|
|
664
718
|
const stream = browser
|
|
665
719
|
.command('stream')
|
|
@@ -694,9 +748,10 @@ function registerTaskCommands(browser) {
|
|
|
694
748
|
});
|
|
695
749
|
browser
|
|
696
750
|
.command('start')
|
|
697
|
-
.description('Start a browser task. Pass --profile <name>; omit to use your configured default (`agents config set browser.profile <name>`), else auto-pick an installed Chromium-family browser.')
|
|
751
|
+
.description('Start a browser task. Pass --profile <name>; omit to use your configured default (`agents config set browser.profile <name>`), else auto-pick an installed Chromium-family browser. Page verbs (navigate/screenshot/…) create a task implicitly when none exists — start is for --profile/--url/--record/--title.')
|
|
698
752
|
.option('-p, --profile <name>', 'Browser profile to use (omit to use the configured default, else auto-pick an installed Chromium-family browser)')
|
|
699
|
-
.option(TASK_OPTION_FLAG, 'Task name (auto-generated if omitted)')
|
|
753
|
+
.option(TASK_OPTION_FLAG, 'Task name (auto-generated short id if omitted)')
|
|
754
|
+
.option('--title <label>', 'Human label shown in `browser status` (defaults to first navigated host)')
|
|
700
755
|
.option('-e, --endpoint <name>', 'Endpoint preset (defaults to the profile\'s default)')
|
|
701
756
|
.option('-u, --url <url>', 'Open URL in first tab')
|
|
702
757
|
.option('--fresh', 'Always open a new tab, skipping the reclaim of a tab an abandoned task is holding on that URL')
|
|
@@ -706,7 +761,7 @@ function registerTaskCommands(browser) {
|
|
|
706
761
|
.option('--duration <sec>', 'Recording duration cap in seconds (with --record; default 60)', (v) => parseInt(v, 10))
|
|
707
762
|
.option('--max-mb <mb>', 'Recording size cap in MB (with --record; default 25)', (v) => parseInt(v, 10))
|
|
708
763
|
.action(async (opts) => {
|
|
709
|
-
// Consent gate: a fleet-remote `browser --
|
|
764
|
+
// Consent gate: a fleet-remote `browser --device <this-machine> start` may
|
|
710
765
|
// only open a browser here if the owner opted in. Refuse before we resolve
|
|
711
766
|
// or auto-create any profile. Local starts are never gated.
|
|
712
767
|
try {
|
|
@@ -785,6 +840,7 @@ function registerTaskCommands(browser) {
|
|
|
785
840
|
}
|
|
786
841
|
catch { /* login detection is best-effort; never block start */ }
|
|
787
842
|
}
|
|
843
|
+
// Identity is stamped inside sendIPCRequest; no need to pass it here.
|
|
788
844
|
const response = await sendIPCRequest({
|
|
789
845
|
action: 'start',
|
|
790
846
|
profile: profileName,
|
|
@@ -793,17 +849,7 @@ function registerTaskCommands(browser) {
|
|
|
793
849
|
endpoint: opts.endpoint,
|
|
794
850
|
skipDomainSkill: opts.skills === false,
|
|
795
851
|
fresh: opts.fresh === true,
|
|
796
|
-
|
|
797
|
-
// cannot resolve who/which-run called `start`. `resolveActor()` runs
|
|
798
|
-
// here in the CLI (the caller's process); `$AGENT_LAUNCH_ID` is the
|
|
799
|
-
// per-run id exec.ts injects for every harness.
|
|
800
|
-
actor: resolveActor().id,
|
|
801
|
-
launchId: process.env.AGENT_LAUNCH_ID,
|
|
802
|
-
// The agent session that drove this task — what makes the capture
|
|
803
|
-
// traceable back to a conversation (RUSH-2549). Sent alongside, not
|
|
804
|
-
// instead of, launchId: a launch id is absent on most agent processes,
|
|
805
|
-
// a session id is not.
|
|
806
|
-
sessionId: process.env.AGENT_SESSION_ID || process.env.AGENTS_SESSION_ID,
|
|
852
|
+
title: opts.title,
|
|
807
853
|
});
|
|
808
854
|
if (!response.ok) {
|
|
809
855
|
console.error(response.error);
|
|
@@ -820,7 +866,7 @@ function registerTaskCommands(browser) {
|
|
|
820
866
|
else {
|
|
821
867
|
console.error(`Started task "${response.task}"`);
|
|
822
868
|
}
|
|
823
|
-
console.error(
|
|
869
|
+
console.error('Tip: page verbs resolve this task from your session — --task only when running two at once.');
|
|
824
870
|
console.error('Try: agents browser screenshot | agents browser console --level error');
|
|
825
871
|
// Surface the matched domain-skill (if any) so an agent driving the
|
|
826
872
|
// task picks up site-specific selectors and gotchas before it starts
|
|
@@ -855,7 +901,7 @@ function registerTaskCommands(browser) {
|
|
|
855
901
|
});
|
|
856
902
|
browser
|
|
857
903
|
.command('done')
|
|
858
|
-
.description('Complete a task and close its tabs')
|
|
904
|
+
.description('Complete a task and close its tabs (resolves from caller identity when --task is omitted)')
|
|
859
905
|
.option(TASK_OPTION_FLAG, TASK_OPTION_DESC)
|
|
860
906
|
.action(async (opts) => {
|
|
861
907
|
const task = resolveTaskName(opts);
|
|
@@ -867,7 +913,11 @@ function registerTaskCommands(browser) {
|
|
|
867
913
|
console.error(response.error);
|
|
868
914
|
process.exit(1);
|
|
869
915
|
}
|
|
870
|
-
|
|
916
|
+
if (response.message === 'nothing to close' || !response.task) {
|
|
917
|
+
console.log('nothing to close');
|
|
918
|
+
return;
|
|
919
|
+
}
|
|
920
|
+
console.log(`Completed task: ${response.task}`);
|
|
871
921
|
});
|
|
872
922
|
browser
|
|
873
923
|
.command('stop')
|
|
@@ -896,27 +946,78 @@ function registerTaskCommands(browser) {
|
|
|
896
946
|
console.error(response.error);
|
|
897
947
|
process.exit(1);
|
|
898
948
|
}
|
|
899
|
-
|
|
949
|
+
if (response.message === 'nothing to close' || !response.task) {
|
|
950
|
+
console.log('nothing to close');
|
|
951
|
+
return;
|
|
952
|
+
}
|
|
953
|
+
console.log(`Stopped task: ${response.task}`);
|
|
954
|
+
});
|
|
955
|
+
browser
|
|
956
|
+
.command('gc')
|
|
957
|
+
.description('Close tabs for abandoned tasks — owning agent session exited, or idle past the window — and mark them done. ' +
|
|
958
|
+
'The same reaper the daemon already runs every 5 minutes; use this to run it now.')
|
|
959
|
+
.option('--dry-run', 'List what would be closed without closing anything')
|
|
960
|
+
.option('--idle-minutes <n>', 'Override the idle window in minutes (default: this device\'s browser.task-idle-minutes, or 30). ' +
|
|
961
|
+
'0 disables idle-only closing for this run; session-dead tasks are still closed.', (v) => parseInt(v, 10))
|
|
962
|
+
.option('--json', 'Output machine-readable JSON')
|
|
963
|
+
.action(async (opts) => {
|
|
964
|
+
const response = await sendIPCRequest({
|
|
965
|
+
action: 'gc',
|
|
966
|
+
dryRun: opts.dryRun,
|
|
967
|
+
idleMinutes: opts.idleMinutes,
|
|
968
|
+
});
|
|
969
|
+
if (!response.ok) {
|
|
970
|
+
if (opts.json) {
|
|
971
|
+
console.log(JSON.stringify({ ok: false, error: response.error }));
|
|
972
|
+
}
|
|
973
|
+
else {
|
|
974
|
+
console.error(response.error);
|
|
975
|
+
}
|
|
976
|
+
process.exit(1);
|
|
977
|
+
}
|
|
978
|
+
const reaped = response.reaped ?? { closed: [], skipped: 0 };
|
|
979
|
+
if (opts.json) {
|
|
980
|
+
console.log(JSON.stringify(reaped, null, 2));
|
|
981
|
+
return;
|
|
982
|
+
}
|
|
983
|
+
if (reaped.closed.length === 0) {
|
|
984
|
+
console.log(`No abandoned tasks${opts.dryRun ? ' (dry run)' : ''}; ${reaped.skipped} task(s) still active.`);
|
|
985
|
+
return;
|
|
986
|
+
}
|
|
987
|
+
const verb = opts.dryRun ? 'Would close' : 'Closed';
|
|
988
|
+
console.log(`${verb} ${reaped.closed.length} task(s), left ${reaped.skipped} alone:`);
|
|
989
|
+
for (const c of reaped.closed) {
|
|
990
|
+
console.log(` ${c.task} (${c.profile}, ${c.reason})`);
|
|
991
|
+
}
|
|
900
992
|
});
|
|
901
993
|
browser
|
|
902
|
-
.command('navigate')
|
|
903
|
-
.
|
|
994
|
+
.command('navigate [url]')
|
|
995
|
+
.alias('goto')
|
|
996
|
+
.description('Navigate current tab to URL (creates a task and tab when none exist)')
|
|
904
997
|
.option(TASK_OPTION_FLAG, TASK_OPTION_DESC)
|
|
905
|
-
.
|
|
998
|
+
.option('-u, --url <url>', 'URL to navigate to (or pass it positionally)')
|
|
906
999
|
.option('-p, --profile <name>', 'Browser profile (optional if task is unique)')
|
|
907
|
-
.action(async (opts) => {
|
|
1000
|
+
.action(async (urlPos, opts) => {
|
|
1001
|
+
const url = urlPos || opts.url;
|
|
1002
|
+
if (!url) {
|
|
1003
|
+
console.error('URL required. Usage: agents browser navigate <url>');
|
|
1004
|
+
process.exit(1);
|
|
1005
|
+
}
|
|
908
1006
|
const task = resolveTaskName(opts);
|
|
909
1007
|
const response = await sendIPCRequest({
|
|
910
1008
|
action: 'navigate',
|
|
911
1009
|
task,
|
|
912
|
-
url
|
|
1010
|
+
url,
|
|
913
1011
|
profile: opts.profile,
|
|
914
1012
|
});
|
|
915
1013
|
if (!response.ok) {
|
|
916
1014
|
console.error(response.error);
|
|
917
1015
|
process.exit(1);
|
|
918
1016
|
}
|
|
919
|
-
|
|
1017
|
+
if (response.task) {
|
|
1018
|
+
console.error(`task ${response.task}`);
|
|
1019
|
+
}
|
|
1020
|
+
console.log(`Navigated ${response.tabId} to ${url}`);
|
|
920
1021
|
});
|
|
921
1022
|
// Tab subcommand group
|
|
922
1023
|
const tab = browser.command('tab').description('Manage tabs');
|
|
@@ -1073,16 +1174,18 @@ function registerTaskCommands(browser) {
|
|
|
1073
1174
|
}
|
|
1074
1175
|
});
|
|
1075
1176
|
browser
|
|
1076
|
-
.command('evaluate')
|
|
1177
|
+
.command('evaluate [expression]')
|
|
1178
|
+
.alias('eval')
|
|
1077
1179
|
.description('Evaluate JavaScript in current tab')
|
|
1078
1180
|
.option(TASK_OPTION_FLAG, TASK_OPTION_DESC)
|
|
1079
1181
|
.option('-t, --tab <tabId>', 'Tab ID (defaults to current)')
|
|
1080
|
-
.option('-e, --expression <js>', 'JavaScript expression to evaluate')
|
|
1182
|
+
.option('-e, --expression <js>', 'JavaScript expression to evaluate (or pass it positionally)')
|
|
1081
1183
|
.option('-f, --file <path>', 'Path to a .js file whose contents will be evaluated')
|
|
1082
|
-
.action(async (opts) => {
|
|
1184
|
+
.action(async (exprPos, opts) => {
|
|
1083
1185
|
const task = resolveTaskName(opts);
|
|
1084
|
-
|
|
1085
|
-
|
|
1186
|
+
const flagExpr = opts.expression || exprPos;
|
|
1187
|
+
if (flagExpr && opts.file) {
|
|
1188
|
+
console.error('Pass exactly one of an expression or --file');
|
|
1086
1189
|
process.exit(1);
|
|
1087
1190
|
}
|
|
1088
1191
|
let expression;
|
|
@@ -1095,11 +1198,11 @@ function registerTaskCommands(browser) {
|
|
|
1095
1198
|
process.exit(1);
|
|
1096
1199
|
}
|
|
1097
1200
|
}
|
|
1098
|
-
else if (
|
|
1099
|
-
expression =
|
|
1201
|
+
else if (flagExpr) {
|
|
1202
|
+
expression = flagExpr;
|
|
1100
1203
|
}
|
|
1101
1204
|
else {
|
|
1102
|
-
console.error('Pass
|
|
1205
|
+
console.error('Pass an expression positionally, -e <js>, or --file <path>');
|
|
1103
1206
|
process.exit(1);
|
|
1104
1207
|
}
|
|
1105
1208
|
const response = await sendIPCRequest({
|
|
@@ -1285,15 +1388,22 @@ function registerTaskCommands(browser) {
|
|
|
1285
1388
|
console.log(' No active tasks');
|
|
1286
1389
|
}
|
|
1287
1390
|
else {
|
|
1288
|
-
console.log('
|
|
1391
|
+
console.log(' ' +
|
|
1392
|
+
'ID'.padEnd(12) +
|
|
1393
|
+
'LABEL'.padEnd(20) +
|
|
1394
|
+
'TABS'.padEnd(6) +
|
|
1395
|
+
'DOMAINS'.padEnd(22) +
|
|
1396
|
+
'CREATED');
|
|
1289
1397
|
for (const task of profile.tasks) {
|
|
1290
1398
|
const age = formatAge(task.createdAt);
|
|
1291
|
-
const
|
|
1399
|
+
const id = (task.name || task.id).slice(0, 10);
|
|
1400
|
+
const label = (task.label || task.name || task.id).slice(0, 18);
|
|
1292
1401
|
const domains = task.domains?.slice(0, 2).join(', ') || '-';
|
|
1293
1402
|
console.log(' ' +
|
|
1294
|
-
|
|
1403
|
+
id.padEnd(12) +
|
|
1404
|
+
label.padEnd(20) +
|
|
1295
1405
|
String(task.tabCount).padEnd(6) +
|
|
1296
|
-
domains.slice(0,
|
|
1406
|
+
domains.slice(0, 20).padEnd(22) +
|
|
1297
1407
|
age);
|
|
1298
1408
|
}
|
|
1299
1409
|
}
|
|
@@ -1842,8 +1952,9 @@ function registerTaskCommands(browser) {
|
|
|
1842
1952
|
}
|
|
1843
1953
|
});
|
|
1844
1954
|
browser
|
|
1845
|
-
.command('logs
|
|
1955
|
+
.command('logs')
|
|
1846
1956
|
.description('Read merged rush-app + rush-cli JSONL logs for a task')
|
|
1957
|
+
.option(TASK_OPTION_FLAG, TASK_OPTION_DESC)
|
|
1847
1958
|
.option('--source <name>', 'Source to scope to: rush-app or rush-cli (default both)')
|
|
1848
1959
|
.option('--lines <n>', 'Tail N entries (default 200; ignored when --since)', (v) => parseInt(v, 10))
|
|
1849
1960
|
.option('--since <when>', 'Absolute timestamp or relative offset (e.g. 5m, 2h, 1d)')
|
|
@@ -1852,11 +1963,12 @@ function registerTaskCommands(browser) {
|
|
|
1852
1963
|
.option('--message <name>', 'Filter entries by exact message field')
|
|
1853
1964
|
.option('--filter <text>', 'Filter entries whose JSON contains this substring')
|
|
1854
1965
|
.option('-f, --follow', 'Follow mode (not yet implemented)')
|
|
1855
|
-
.action(async (
|
|
1966
|
+
.action(async (opts) => {
|
|
1856
1967
|
if (opts.follow) {
|
|
1857
1968
|
process.stderr.write('follow mode not yet implemented; coming next pass\n');
|
|
1858
1969
|
process.exit(1);
|
|
1859
1970
|
}
|
|
1971
|
+
const task = resolveTaskName(opts);
|
|
1860
1972
|
const response = await sendIPCRequest({
|
|
1861
1973
|
action: 'getAppLogs',
|
|
1862
1974
|
task,
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `agents budget` — view and set spend caps (issue #346).
|
|
2
|
+
* `agents config budget` — view and set spend caps (issue #346).
|
|
3
3
|
*
|
|
4
|
-
* agents budget show effective caps + spend-to-cap (today + project)
|
|
5
|
-
* agents budget --json machine-readable snapshot
|
|
6
|
-
* agents budget set <cap> <n> write a cap to the user agents.yaml budget: block
|
|
4
|
+
* agents config budget show effective caps + spend-to-cap (today + project)
|
|
5
|
+
* agents config budget --json machine-readable snapshot
|
|
6
|
+
* agents config budget set <cap> <n> write a cap to the user agents.yaml budget: block
|
|
7
7
|
*
|
|
8
|
-
* Caps resolve project > user (see lib/budget/config.ts); `agents budget`
|
|
8
|
+
* Caps resolve project > user (see lib/budget/config.ts); `agents config budget`
|
|
9
9
|
* reports the EFFECTIVE merged config for the current directory, and `set`
|
|
10
10
|
* writes the user-global layer (the project layer is hand-edited in the repo's
|
|
11
11
|
* agents.yaml, like every other project override).
|
|
12
12
|
*/
|
|
13
13
|
import type { Command } from 'commander';
|
|
14
|
-
|
|
14
|
+
/** Register `agents config budget` under the config parent. */
|
|
15
|
+
export declare function registerBudgetCommand(configCmd: Command): void;
|
package/dist/commands/budget.js
CHANGED
|
@@ -5,8 +5,9 @@ import { resolveBudgetConfig, hasAnyCap } from '../lib/budget/config.js';
|
|
|
5
5
|
import { loadLedger, spendForDay, spendForProject, spendForAgentDay, localDay } from '../lib/budget/ledger.js';
|
|
6
6
|
import { formatUsd } from '../lib/pricing/index.js';
|
|
7
7
|
const TOP_CAPS = ['per_run', 'per_day', 'per_project'];
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
/** Register `agents config budget` under the config parent. */
|
|
9
|
+
export function registerBudgetCommand(configCmd) {
|
|
10
|
+
const budgetCmd = configCmd
|
|
10
11
|
.command('budget')
|
|
11
12
|
.description('Show spend caps and current spend-to-cap (issue #346)')
|
|
12
13
|
.option('--json', 'Emit the budget + spend snapshot as JSON')
|
|
@@ -52,10 +53,10 @@ export function registerBudgetCommand(program) {
|
|
|
52
53
|
.description(`Set a user-global cap. <cap> = ${TOP_CAPS.join(' | ')} | per_agent.<agent> | on_exceed | require_confirm_over`)
|
|
53
54
|
.addHelpText('after', `
|
|
54
55
|
Examples:
|
|
55
|
-
agents budget set per_run 5 Cap any single run at $5
|
|
56
|
-
agents budget set per_day 50 Cap total spend per day at $50
|
|
57
|
-
agents budget set per_agent.claude 30 Cap Claude's daily spend at $30
|
|
58
|
-
agents budget set on_exceed warn Switch to warn-only (do not block)
|
|
56
|
+
agents config budget set per_run 5 Cap any single run at $5
|
|
57
|
+
agents config budget set per_day 50 Cap total spend per day at $50
|
|
58
|
+
agents config budget set per_agent.claude 30 Cap Claude's daily spend at $30
|
|
59
|
+
agents config budget set on_exceed warn Switch to warn-only (do not block)
|
|
59
60
|
`)
|
|
60
61
|
.action((cap, amount) => {
|
|
61
62
|
const meta = readMeta();
|
|
@@ -116,7 +117,7 @@ function renderBudget(cfg, snap) {
|
|
|
116
117
|
lines.push(chalk.dim(` day: ${snap.day}`));
|
|
117
118
|
lines.push('');
|
|
118
119
|
if (!hasAnyCap(cfg)) {
|
|
119
|
-
lines.push(chalk.dim(' No caps configured. Set one with: agents budget set per_run 5'));
|
|
120
|
+
lines.push(chalk.dim(' No caps configured. Set one with: agents config budget set per_run 5'));
|
|
120
121
|
return lines.join('\n');
|
|
121
122
|
}
|
|
122
123
|
lines.push(capLine('per_run', null, cfg.per_run));
|