@phnx-labs/agents-cli 1.22.39 → 1.22.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +316 -0
- package/README.md +116 -70
- package/dist/bin/agents +0 -0
- package/dist/bootstrap.js +45 -27
- package/dist/browser.js +2 -2
- package/dist/cli/command-registry.d.ts +135 -0
- package/dist/cli/command-registry.js +259 -0
- package/dist/commands/accounts.d.ts +20 -0
- package/dist/commands/accounts.js +186 -25
- package/dist/commands/apply.d.ts +3 -3
- package/dist/commands/apply.js +20 -63
- package/dist/commands/browser.d.ts +15 -0
- package/dist/commands/browser.js +318 -131
- package/dist/commands/budget.d.ts +7 -6
- package/dist/commands/budget.js +8 -7
- package/dist/commands/cloud.js +17 -20
- package/dist/commands/commands.js +1 -1
- package/dist/commands/computer-actions.d.ts +1 -35
- package/dist/commands/computer-actions.js +13 -181
- package/dist/commands/computer.d.ts +28 -3
- package/dist/commands/computer.js +93 -65
- package/dist/commands/config.js +16 -3
- package/dist/commands/cost.d.ts +2 -1
- package/dist/commands/cost.js +7 -6
- package/dist/commands/daemon.js +151 -4
- package/dist/commands/detach.js +1 -1
- package/dist/commands/doctor.js +19 -11
- package/dist/commands/events.js +1 -1
- package/dist/commands/exec.d.ts +2 -50
- package/dist/commands/exec.js +160 -215
- package/dist/commands/factory.js +1 -1
- package/dist/commands/feed.d.ts +2 -2
- package/dist/commands/feed.js +12 -23
- package/dist/commands/fleet-capture.js +25 -27
- package/dist/commands/focus.d.ts +2 -3
- package/dist/commands/focus.js +34 -9
- package/dist/commands/go.js +15 -5
- package/dist/commands/harness.d.ts +3 -3
- package/dist/commands/harness.js +53 -5
- package/dist/commands/hooks.js +1 -1
- package/dist/commands/import.js +2 -2
- package/dist/commands/insights.d.ts +5 -5
- package/dist/commands/insights.js +15 -9
- package/dist/commands/inspect.d.ts +2 -3
- package/dist/commands/inspect.js +4 -16
- package/dist/commands/logs.d.ts +2 -2
- package/dist/commands/logs.js +9 -9
- package/dist/commands/mcp.js +2 -2
- package/dist/commands/memory.js +1 -1
- package/dist/commands/message.d.ts +1 -1
- package/dist/commands/message.js +7 -7
- package/dist/commands/mine.d.ts +11 -8
- package/dist/commands/mine.js +11 -10
- package/dist/commands/models.js +1 -1
- package/dist/commands/modes.js +1 -1
- package/dist/commands/monitors.js +23 -6
- package/dist/commands/output.d.ts +7 -6
- package/dist/commands/output.js +11 -10
- package/dist/commands/packages.js +4 -4
- package/dist/commands/perf.js +1 -1
- package/dist/commands/permissions.js +49 -32
- package/dist/commands/plugins.d.ts +1 -1
- package/dist/commands/plugins.js +3 -3
- package/dist/commands/profiles.d.ts +6 -9
- package/dist/commands/profiles.js +8 -321
- package/dist/commands/projects.d.ts +9 -0
- package/dist/commands/projects.js +140 -8
- package/dist/commands/prune.js +5 -13
- package/dist/commands/refresh-rules.js +1 -1
- package/dist/commands/repo.d.ts +5 -7
- package/dist/commands/repo.js +34 -18
- package/dist/commands/resource-view.js +4 -0
- package/dist/commands/resume.d.ts +11 -7
- package/dist/commands/resume.js +82 -98
- package/dist/commands/route.d.ts +12 -0
- package/dist/commands/route.js +261 -0
- package/dist/commands/routines.d.ts +2 -3
- package/dist/commands/routines.js +120 -145
- package/dist/commands/rules.js +1 -1
- package/dist/commands/run-account-picker.d.ts +1 -1
- package/dist/commands/run-account-picker.js +2 -2
- package/dist/commands/run-broadcast.d.ts +21 -0
- package/dist/commands/run-broadcast.js +89 -0
- package/dist/commands/run-cloud.js +1 -1
- package/dist/commands/secrets-vault.d.ts +10 -0
- package/dist/commands/{login.js → secrets-vault.js} +34 -14
- package/dist/commands/secrets.d.ts +4 -4
- package/dist/commands/secrets.js +158 -159
- package/dist/commands/sessions-backfill.js +1 -1
- package/dist/commands/sessions-browser.d.ts +1 -1
- package/dist/commands/sessions-browser.js +9 -5
- package/dist/commands/sessions-export.js +2 -2
- package/dist/commands/sessions-inject.js +4 -5
- package/dist/commands/sessions-migrate.js +16 -27
- package/dist/commands/sessions-picker.d.ts +14 -0
- package/dist/commands/sessions-picker.js +209 -13
- package/dist/commands/sessions-resume.d.ts +7 -3
- package/dist/commands/sessions-resume.js +81 -33
- package/dist/commands/sessions-share.d.ts +25 -0
- package/dist/commands/sessions-share.js +166 -0
- package/dist/commands/sessions-stats.js +2 -2
- package/dist/commands/sessions.d.ts +75 -68
- package/dist/commands/sessions.js +144 -180
- package/dist/commands/setup-browser.js +1 -1
- package/dist/commands/setup-computer.js +1 -1
- package/dist/commands/setup-fleet.js +3 -0
- package/dist/commands/setup-mine.d.ts +7 -3
- package/dist/commands/setup-mine.js +13 -8
- package/dist/commands/setup-preferences.js +2 -2
- package/dist/commands/setup-secrets.js +2 -2
- package/dist/commands/setup-watchdog.js +2 -2
- package/dist/commands/setup.js +7 -2
- package/dist/commands/share.d.ts +65 -0
- package/dist/commands/share.js +253 -20
- package/dist/commands/skills.js +3 -3
- package/dist/commands/snapshot.d.ts +2 -2
- package/dist/commands/snapshot.js +9 -9
- package/dist/commands/ssh.d.ts +1 -1
- package/dist/commands/ssh.js +186 -64
- package/dist/commands/subagents.js +1 -1
- package/dist/commands/sync.js +24 -9
- package/dist/commands/teams.d.ts +2 -2
- package/dist/commands/teams.js +9 -18
- package/dist/commands/tmux.js +5 -1
- package/dist/commands/trash.js +1 -1
- package/dist/commands/usage.d.ts +1 -1
- package/dist/commands/usage.js +2 -2
- package/dist/commands/utils.d.ts +4 -14
- package/dist/commands/utils.js +6 -27
- package/dist/commands/versions.js +2 -2
- package/dist/commands/view.d.ts +9 -77
- package/dist/commands/view.js +23 -8
- package/dist/commands/watchdog.js +1 -1
- package/dist/commands/webhook.js +25 -34
- package/dist/commands/workflows.js +1 -1
- package/dist/index.js +1 -1
- package/dist/lib/account-capabilities.d.ts +39 -0
- package/dist/lib/account-capabilities.js +59 -0
- package/dist/lib/account-catalog.js +1 -1
- package/dist/lib/account-registry.d.ts +66 -0
- package/dist/lib/account-registry.js +151 -5
- package/dist/lib/{rotate.d.ts → accounting/rotate.d.ts} +4 -4
- package/dist/lib/{rotate.js → accounting/rotate.js} +8 -8
- package/dist/lib/{usage.d.ts → accounting/usage.d.ts} +4 -4
- package/dist/lib/{usage.js → accounting/usage.js} +11 -11
- package/dist/lib/agent-spec/provider.js +1 -1
- package/dist/lib/agents.d.ts +72 -4
- package/dist/lib/agents.js +231 -199
- package/dist/lib/answer-router.d.ts +2 -2
- package/dist/lib/ask-classifier.d.ts +1 -1
- package/dist/lib/ask-classifier.js +1 -1
- package/dist/lib/audit/log.js +1 -1
- package/dist/lib/auth-health.d.ts +1 -1
- package/dist/lib/auth-health.js +2 -2
- package/dist/lib/brand.js +1 -1
- package/dist/lib/browser/caller-identity.d.ts +28 -0
- package/dist/lib/browser/caller-identity.js +156 -0
- package/dist/lib/browser/cdp.js +5 -1
- package/dist/lib/browser/chrome.js +12 -1
- package/dist/lib/browser/drivers/ssh.d.ts +1 -1
- package/dist/lib/browser/drivers/ssh.js +3 -2
- package/dist/lib/browser/hygiene.d.ts +10 -2
- package/dist/lib/browser/hygiene.js +7 -4
- package/dist/lib/browser/ipc.d.ts +22 -2
- package/dist/lib/browser/ipc.js +185 -21
- package/dist/lib/browser/profiles.d.ts +69 -5
- package/dist/lib/browser/profiles.js +135 -13
- package/dist/lib/browser/remote-control.d.ts +2 -2
- package/dist/lib/browser/remote-control.js +3 -3
- package/dist/lib/browser/runtime-state.d.ts +79 -0
- package/dist/lib/browser/runtime-state.js +119 -1
- package/dist/lib/browser/service.d.ts +137 -2
- package/dist/lib/browser/service.js +492 -54
- package/dist/lib/browser/sessions-list.d.ts +2 -1
- package/dist/lib/browser/sessions-list.js +4 -13
- package/dist/lib/browser/types.d.ts +19 -1
- package/dist/lib/budget/config.js +1 -1
- package/dist/lib/budget/ledger.js +1 -1
- package/dist/lib/byok-usage.js +1 -1
- package/dist/lib/capabilities.js +3 -15
- package/dist/lib/catchup.d.ts +1 -1
- package/dist/lib/catchup.js +1 -1
- package/dist/lib/cloud/dispatch.js +1 -1
- package/dist/lib/cloud/host.d.ts +3 -3
- package/dist/lib/cloud/host.js +5 -5
- package/dist/lib/cloud/rush.d.ts +9 -21
- package/dist/lib/cloud/rush.js +33 -120
- package/dist/lib/cloud/types.d.ts +2 -2
- package/dist/lib/commands.js +3 -13
- package/dist/lib/computer/actions.d.ts +36 -0
- package/dist/lib/computer/actions.js +162 -0
- package/dist/lib/computer/dispatch.d.ts +2 -2
- package/dist/lib/computer/dispatch.js +2 -2
- package/dist/lib/computer/sessions-list.d.ts +3 -3
- package/dist/lib/computer/sessions-list.js +2 -2
- package/dist/lib/config-keys.d.ts +2 -1
- package/dist/lib/config-keys.js +8 -4
- package/dist/lib/config-machine-keys.d.ts +4 -2
- package/dist/lib/config-machine-keys.js +5 -2
- package/dist/lib/crabbox/lease.js +9 -1
- package/dist/lib/crabbox/runtimes.d.ts +32 -7
- package/dist/lib/crabbox/runtimes.js +72 -30
- package/dist/lib/{daemon.d.ts → daemon/daemon.d.ts} +59 -1
- package/dist/lib/{daemon.js → daemon/daemon.js} +237 -49
- package/dist/lib/daemon-services.d.ts +1 -1
- package/dist/lib/daemon-services.js +5 -0
- package/dist/lib/daemon-ticks.d.ts +25 -0
- package/dist/lib/daemon-ticks.js +31 -1
- package/dist/lib/daemon-webhooks.d.ts +104 -0
- package/dist/lib/daemon-webhooks.js +215 -0
- package/dist/lib/device-config.d.ts +85 -75
- package/dist/lib/device-config.js +280 -142
- package/dist/lib/devices/config-migration.d.ts +29 -34
- package/dist/lib/devices/config-migration.js +209 -130
- package/dist/lib/devices/connect.d.ts +2 -2
- package/dist/lib/devices/connect.js +2 -2
- package/dist/lib/devices/discovery-policy.d.ts +30 -0
- package/dist/lib/devices/discovery-policy.js +101 -0
- package/dist/lib/devices/fleet-inventory.js +8 -3
- package/dist/lib/devices/harness-inventory.d.ts +1 -1
- package/dist/lib/devices/harness-inventory.js +12 -3
- package/dist/lib/devices/known-hosts.js +1 -1
- package/dist/lib/devices/pool.d.ts +10 -5
- package/dist/lib/devices/pool.js +5 -7
- package/dist/lib/devices/registry.d.ts +1 -1
- package/dist/lib/devices/registry.js +1 -1
- package/dist/lib/devices/resolve-profile.d.ts +2 -2
- package/dist/lib/devices/resolve-profile.js +2 -2
- package/dist/lib/devices/resolve-target.d.ts +1 -1
- package/dist/lib/devices/resolve-target.js +4 -4
- package/dist/lib/devices/self-host.d.ts +1 -1
- package/dist/lib/devices/self-host.js +3 -3
- package/dist/lib/devices/ssh-config.d.ts +1 -1
- package/dist/lib/devices/stats-cache.js +1 -1
- package/dist/lib/devices/sync.d.ts +3 -1
- package/dist/lib/devices/sync.js +3 -3
- package/dist/lib/doctor-diff.js +4 -4
- package/dist/lib/drift-sync.js +2 -2
- package/dist/lib/drift.js +2 -2
- package/dist/lib/event-families.d.ts +1 -1
- package/dist/lib/event-stream.d.ts +1 -1
- package/dist/lib/event-stream.js +2 -2
- package/dist/lib/events-ingest.js +2 -2
- package/dist/lib/exec.d.ts +4 -4
- package/dist/lib/exec.js +11 -11
- package/dist/lib/factory/snapshot.d.ts +1 -1
- package/dist/lib/factory/snapshot.js +1 -1
- package/dist/lib/{activity.d.ts → feed/activity.d.ts} +1 -1
- package/dist/lib/{activity.js → feed/activity.js} +7 -7
- package/dist/lib/{events.d.ts → feed/events.d.ts} +2 -2
- package/dist/lib/{events.js → feed/events.js} +5 -5
- package/dist/lib/{feed.js → feed/feed.js} +4 -4
- package/dist/lib/feed-outcome.d.ts +1 -1
- package/dist/lib/feed-policy.d.ts +1 -1
- package/dist/lib/feed-policy.js +1 -1
- package/dist/lib/feed-post.d.ts +1 -1
- package/dist/lib/feed-post.js +1 -1
- package/dist/lib/feed-ranking.d.ts +1 -1
- package/dist/lib/fleet/apply.d.ts +0 -6
- package/dist/lib/fleet/apply.js +18 -45
- package/dist/lib/fleet/auth-sync.d.ts +16 -35
- package/dist/lib/fleet/auth-sync.js +16 -75
- package/dist/lib/fleet/capture.js +8 -6
- package/dist/lib/fleet/manifest.js +23 -11
- package/dist/lib/fleet/types.d.ts +19 -7
- package/dist/lib/fleet-cache.d.ts +1 -1
- package/dist/lib/fleet-cache.js +1 -1
- package/dist/lib/format.d.ts +19 -0
- package/dist/lib/format.js +44 -1
- package/dist/lib/friction-heuristics.d.ts +1 -1
- package/dist/lib/git.d.ts +24 -1
- package/dist/lib/git.js +82 -38
- package/dist/lib/heal.js +3 -3
- package/dist/lib/hooks.d.ts +18 -0
- package/dist/lib/hooks.js +113 -1
- package/dist/lib/hosts/credentials.d.ts +30 -10
- package/dist/lib/hosts/credentials.js +38 -26
- package/dist/lib/hosts/dispatch.d.ts +3 -3
- package/dist/lib/hosts/dispatch.js +3 -3
- package/dist/lib/hosts/option.d.ts +3 -3
- package/dist/lib/hosts/option.js +7 -8
- package/dist/lib/hosts/passthrough.d.ts +17 -17
- package/dist/lib/hosts/passthrough.js +67 -50
- package/dist/lib/hosts/providers/devices.d.ts +1 -1
- package/dist/lib/hosts/providers/devices.js +1 -1
- package/dist/lib/hosts/reconcile.d.ts +1 -1
- package/dist/lib/hosts/reconcile.js +1 -1
- package/dist/lib/hosts/reconnect.d.ts +1 -1
- package/dist/lib/hosts/reconnect.js +2 -2
- package/dist/lib/hosts/registry.d.ts +5 -5
- package/dist/lib/hosts/registry.js +5 -5
- package/dist/lib/hosts/remote-cmd.d.ts +10 -10
- package/dist/lib/hosts/remote-cmd.js +25 -18
- package/dist/lib/hosts/remote-os.d.ts +4 -4
- package/dist/lib/hosts/remote-os.js +4 -4
- package/dist/lib/hosts/remote-session-id.d.ts +2 -2
- package/dist/lib/hosts/remote-session-id.js +2 -2
- package/dist/lib/hosts/routing-flag.d.ts +3 -3
- package/dist/lib/hosts/routing-flag.js +4 -5
- package/dist/lib/hosts/run-target.d.ts +4 -4
- package/dist/lib/hosts/run-target.js +4 -4
- package/dist/lib/hosts/session-index.d.ts +2 -2
- package/dist/lib/hosts/session-index.js +1 -1
- package/dist/lib/hosts/session-marker.d.ts +1 -1
- package/dist/lib/hosts/session-marker.js +1 -1
- package/dist/lib/hosts/types.d.ts +2 -2
- package/dist/lib/hosts/types.js +2 -2
- package/dist/lib/import.js +1 -1
- package/dist/lib/{migrate.d.ts → installations/migrate.d.ts} +13 -1
- package/dist/lib/{migrate.js → installations/migrate.js} +160 -40
- package/dist/lib/installations/resolve.js +1 -1
- package/dist/lib/installations/strategies.js +1 -1
- package/dist/lib/installations/update.js +2 -2
- package/dist/lib/{versions.d.ts → installations/versions.d.ts} +12 -3
- package/dist/lib/{versions.js → installations/versions.js} +51 -31
- package/dist/lib/isolation-boundary-report.js +1 -1
- package/dist/lib/linear-projects.d.ts +28 -0
- package/dist/lib/linear-projects.js +30 -0
- package/dist/lib/loop.js +1 -1
- package/dist/lib/mailbox-gc.js +1 -1
- package/dist/lib/mailbox.js +1 -1
- package/dist/lib/mcp-registry.d.ts +62 -0
- package/dist/lib/mcp-registry.js +177 -0
- package/dist/lib/mcp.d.ts +5 -0
- package/dist/lib/mcp.js +124 -307
- package/dist/lib/menubar/MenubarHelper.app/Contents/CodeResources +0 -0
- package/dist/lib/menubar/MenubarHelper.app/Contents/MacOS/MenubarHelper +0 -0
- package/dist/lib/menubar/install-menubar.d.ts +7 -0
- package/dist/lib/menubar/install-menubar.js +24 -6
- package/dist/lib/menubar/snapshot.d.ts +7 -0
- package/dist/lib/menubar/snapshot.js +8 -6
- package/dist/lib/models.js +1 -1
- package/dist/lib/monitors/config.d.ts +12 -0
- package/dist/lib/monitors/config.js +3 -0
- package/dist/lib/monitors/dispatch.js +26 -5
- package/dist/lib/monitors/engine.js +10 -0
- package/dist/lib/monitors/sources/webhook.d.ts +1 -1
- package/dist/lib/monitors/state.d.ts +42 -0
- package/dist/lib/monitors/state.js +30 -0
- package/dist/lib/notify.d.ts +1 -1
- package/dist/lib/observe-aliases.d.ts +3 -3
- package/dist/lib/observe-aliases.js +3 -21
- package/dist/lib/output/git-output.js +2 -2
- package/dist/lib/overdue.d.ts +1 -1
- package/dist/lib/overdue.js +1 -1
- package/dist/lib/permissions-registry.d.ts +65 -0
- package/dist/lib/permissions-registry.js +599 -0
- package/dist/lib/permissions.d.ts +24 -13
- package/dist/lib/permissions.js +52 -271
- package/dist/lib/picker.d.ts +16 -0
- package/dist/lib/picker.js +33 -3
- package/dist/lib/placement.d.ts +1 -1
- package/dist/lib/placement.js +4 -4
- package/dist/lib/platform/paths.d.ts +8 -0
- package/dist/lib/platform/paths.js +11 -0
- package/dist/lib/platform/posixpath.js +3 -3
- package/dist/lib/{plugin-marketplace.d.ts → plugins/plugin-marketplace.d.ts} +1 -1
- package/dist/lib/{plugin-marketplace.js → plugins/plugin-marketplace.js} +2 -2
- package/dist/lib/{plugins.d.ts → plugins/plugins.d.ts} +1 -1
- package/dist/lib/{plugins.js → plugins/plugins.js} +7 -7
- package/dist/lib/{skills.d.ts → plugins/skills.d.ts} +1 -1
- package/dist/lib/{skills.js → plugins/skills.js} +7 -7
- package/dist/lib/pricing/cost.d.ts +1 -1
- package/dist/lib/pricing/cost.js +1 -1
- package/dist/lib/profiles-presets.d.ts +1 -1
- package/dist/lib/profiles-presets.js +1 -1
- package/dist/lib/profiles.js +2 -2
- package/dist/lib/project-import.js +4 -1
- package/dist/lib/project-key.js +7 -0
- package/dist/lib/project-launch.d.ts +1 -1
- package/dist/lib/project-launch.js +3 -3
- package/dist/lib/project-pull.d.ts +128 -0
- package/dist/lib/project-pull.js +384 -0
- package/dist/lib/project-root.d.ts +2 -2
- package/dist/lib/project-root.js +2 -2
- package/dist/lib/project-status.js +1 -1
- package/dist/lib/projects.d.ts +23 -0
- package/dist/lib/projects.js +29 -6
- package/dist/lib/refresh.d.ts +12 -1
- package/dist/lib/refresh.js +16 -9
- package/dist/lib/registry.d.ts +9 -2
- package/dist/lib/registry.js +11 -4
- package/dist/lib/resources.d.ts +2 -2
- package/dist/lib/resources.js +2 -2
- package/dist/lib/routers.d.ts +81 -0
- package/dist/lib/routers.js +153 -0
- package/dist/lib/routine-context.d.ts +1 -0
- package/dist/lib/routine-context.js +7 -2
- package/dist/lib/routine-notify-owner.d.ts +1 -1
- package/dist/lib/routine-notify.d.ts +1 -1
- package/dist/lib/routine-notify.js +1 -1
- package/dist/lib/routine-process-cleanup.d.ts +1 -1
- package/dist/lib/routine-readiness.d.ts +1 -1
- package/dist/lib/routine-readiness.js +11 -4
- package/dist/lib/routines-placement.d.ts +12 -2
- package/dist/lib/routines-placement.js +20 -3
- package/dist/lib/routines-project.d.ts +1 -1
- package/dist/lib/routines-project.js +1 -1
- package/dist/lib/rules/compile.d.ts +1 -0
- package/dist/lib/rules/compile.js +10 -2
- package/dist/lib/rules/rules.js +1 -1
- package/dist/lib/run-notify.js +1 -1
- package/dist/lib/runner.d.ts +80 -2
- package/dist/lib/runner.js +261 -67
- package/dist/lib/sandbox.d.ts +1 -1
- package/dist/lib/scheduler.d.ts +1 -1
- package/dist/lib/scheduler.js +1 -1
- package/dist/lib/{routines.d.ts → scheduling/routines.d.ts} +54 -9
- package/dist/lib/{routines.js → scheduling/routines.js} +173 -14
- package/dist/lib/secrets/Agents CLI.app/Contents/CodeResources +0 -0
- package/dist/lib/secrets/Agents CLI.app/Contents/MacOS/Agents CLI +0 -0
- package/dist/lib/secrets/agent.js +2 -2
- package/dist/lib/secrets/audit.js +1 -1
- package/dist/lib/secrets/bundles.d.ts +4 -4
- package/dist/lib/secrets/bundles.js +8 -8
- package/dist/lib/secrets/headless.d.ts +16 -0
- package/dist/lib/secrets/headless.js +21 -0
- package/dist/lib/secrets/index.js +1 -1
- package/dist/lib/secrets/list-filter.d.ts +1 -1
- package/dist/lib/secrets/list-filter.js +2 -2
- package/dist/lib/secrets/push.d.ts +1 -1
- package/dist/lib/secrets/push.js +10 -12
- package/dist/lib/secrets/remote.d.ts +21 -17
- package/dist/lib/secrets/remote.js +39 -23
- package/dist/lib/secrets/vault.js +2 -2
- package/dist/lib/self-heal/checks/shadowing.js +1 -1
- package/dist/lib/self-heal/checks/shims.js +1 -1
- package/dist/lib/self-update.d.ts +39 -4
- package/dist/lib/self-update.js +78 -25
- package/dist/lib/serve/control.d.ts +1 -1
- package/dist/lib/serve/control.js +4 -4
- package/dist/lib/serve/data.d.ts +1 -1
- package/dist/lib/serve/data.js +1 -1
- package/dist/lib/serve/stream.js +1 -1
- package/dist/lib/service-manifest.d.ts +29 -0
- package/dist/lib/service-manifest.js +80 -0
- package/dist/lib/session/active.d.ts +59 -7
- package/dist/lib/session/active.js +158 -17
- package/dist/lib/session/bash-command.js +1 -1
- package/dist/lib/session/claude-accounts.d.ts +1 -1
- package/dist/lib/session/claude-accounts.js +1 -1
- package/dist/lib/session/db.d.ts +10 -2
- package/dist/lib/session/db.js +25 -6
- package/dist/lib/session/discover.d.ts +77 -0
- package/dist/lib/session/discover.js +130 -25
- package/dist/lib/session/fork.js +1 -1
- package/dist/lib/session/inject.d.ts +1 -1
- package/dist/lib/session/insights.d.ts +1 -1
- package/dist/lib/session/insights.js +1 -1
- package/dist/lib/session/live-metadata.d.ts +15 -0
- package/dist/lib/session/live-metadata.js +76 -0
- package/dist/lib/session/migrate-targets.d.ts +1 -1
- package/dist/lib/session/recovery.d.ts +1 -1
- package/dist/lib/session/recovery.js +2 -2
- package/dist/lib/session/remote-active.d.ts +10 -1
- package/dist/lib/session/remote-active.js +8 -3
- package/dist/lib/session/remote-bundle.d.ts +1 -1
- package/dist/lib/session/remote-bundle.js +2 -2
- package/dist/lib/session/remote-list.d.ts +15 -4
- package/dist/lib/session/remote-list.js +40 -3
- package/dist/lib/session/remote.d.ts +5 -5
- package/dist/lib/session/remote.js +13 -17
- package/dist/lib/session/resume-command.d.ts +3 -2
- package/dist/lib/session/resume-command.js +4 -3
- package/dist/lib/session/resume-owner.d.ts +3 -3
- package/dist/lib/session/resume-owner.js +3 -3
- package/dist/lib/session/session-cache.d.ts +12 -0
- package/dist/lib/session/session-cache.js +2 -0
- package/dist/lib/session/share-html.d.ts +55 -0
- package/dist/lib/session/share-html.js +319 -0
- package/dist/lib/session/shell-programs.js +1 -1
- package/dist/lib/session/state.js +5 -5
- package/dist/lib/session/team-filter.d.ts +1 -1
- package/dist/lib/session/team-filter.js +1 -1
- package/dist/lib/session/types.d.ts +3 -3
- package/dist/lib/session/width.d.ts +2 -2
- package/dist/lib/session/width.js +2 -2
- package/dist/lib/settings-manifest.d.ts +2 -0
- package/dist/lib/settings-manifest.js +81 -3
- package/dist/lib/share/delete.d.ts +21 -0
- package/dist/lib/share/delete.js +42 -0
- package/dist/lib/share/publish.d.ts +120 -0
- package/dist/lib/share/publish.js +243 -18
- package/dist/lib/share/worker-template.js +172 -9
- package/dist/lib/shims.js +35 -7
- package/dist/lib/smart-launch.d.ts +4 -4
- package/dist/lib/smart-launch.js +6 -4
- package/dist/lib/snapshot.d.ts +4 -4
- package/dist/lib/snapshot.js +2 -2
- package/dist/lib/ssh-exec.d.ts +1 -1
- package/dist/lib/ssh-exec.js +2 -2
- package/dist/lib/ssh-tunnel.d.ts +10 -10
- package/dist/lib/ssh-tunnel.js +12 -12
- package/dist/lib/staleness/checkers/hooks.d.ts +1 -1
- package/dist/lib/staleness/checkers/hooks.js +1 -1
- package/dist/lib/staleness/detectors/permissions.js +0 -23
- package/dist/lib/staleness/detectors/plugins.js +1 -1
- package/dist/lib/staleness/fingerprint.js +1 -1
- package/dist/lib/staleness/layers.d.ts +1 -1
- package/dist/lib/staleness/layers.js +1 -1
- package/dist/lib/staleness/writers/mcp.js +3 -1
- package/dist/lib/staleness/writers/plugins.js +1 -1
- package/dist/lib/staleness/writers/types.d.ts +8 -0
- package/dist/lib/startup/command-registry.d.ts +6 -147
- package/dist/lib/startup/command-registry.js +40 -303
- package/dist/lib/startup/dev-build.d.ts +0 -21
- package/dist/lib/startup/dev-build.js +29 -8
- package/dist/lib/state.d.ts +19 -1
- package/dist/lib/state.js +120 -51
- package/dist/lib/subagents.js +1 -1
- package/dist/lib/sync-status.js +1 -1
- package/dist/lib/sync-umbrella.d.ts +6 -1
- package/dist/lib/sync-umbrella.js +9 -4
- package/dist/lib/teams/agents.js +2 -2
- package/dist/lib/teams/registry.js +1 -1
- package/dist/lib/terminal/backends/vscodium-agent.js +1 -1
- package/dist/lib/terminal/engine.js +1 -1
- package/dist/lib/terminal/index.d.ts +4 -0
- package/dist/lib/terminal/index.js +3 -0
- package/dist/lib/terminal/inject.d.ts +2 -2
- package/dist/lib/terminal/inject.js +2 -2
- package/dist/lib/terminal/transport.js +1 -1
- package/dist/lib/tmux/index.d.ts +1 -1
- package/dist/lib/tmux/index.js +1 -1
- package/dist/lib/tmux/session.d.ts +21 -5
- package/dist/lib/tmux/session.js +76 -22
- package/dist/lib/triggers/handlers.d.ts +38 -3
- package/dist/lib/triggers/handlers.js +58 -7
- package/dist/lib/triggers/webhook.d.ts +113 -5
- package/dist/lib/triggers/webhook.js +223 -44
- package/dist/lib/types.d.ts +19 -7
- package/dist/lib/usage-fleet.d.ts +1 -1
- package/dist/lib/usage-fleet.js +1 -1
- package/dist/lib/usage-refresh.d.ts +1 -1
- package/dist/lib/usage-refresh.js +3 -3
- package/dist/lib/version-duplicates.js +2 -2
- package/dist/lib/view-types.d.ts +56 -0
- package/dist/lib/view-types.js +1 -0
- package/dist/lib/watchdog/rotate.d.ts +2 -2
- package/dist/lib/watchdog/rotate.js +3 -3
- package/dist/lib/watchdog/runner.d.ts +2 -3
- package/dist/lib/watchdog/runner.js +3 -4
- package/dist/lib/workflows.js +1 -1
- package/dist/lib/wrap.d.ts +33 -0
- package/dist/lib/wrap.js +70 -0
- package/package.json +2 -1
- package/scripts/postinstall.js +2 -2
- package/dist/commands/bench.d.ts +0 -2
- package/dist/commands/bench.js +0 -101
- package/dist/commands/cp.d.ts +0 -84
- package/dist/commands/cp.js +0 -231
- package/dist/commands/login.d.ts +0 -2
- package/dist/lib/resources/commands.d.ts +0 -46
- package/dist/lib/resources/commands.js +0 -211
- package/dist/lib/resources/hooks.d.ts +0 -16
- package/dist/lib/resources/hooks.js +0 -153
- package/dist/lib/resources/mcp.d.ts +0 -34
- package/dist/lib/resources/mcp.js +0 -250
- package/dist/lib/resources/memory.d.ts +0 -15
- package/dist/lib/resources/memory.js +0 -46
- package/dist/lib/resources/permissions.d.ts +0 -13
- package/dist/lib/resources/permissions.js +0 -202
- package/dist/lib/resources/rules.d.ts +0 -46
- package/dist/lib/resources/rules.js +0 -179
- package/dist/lib/resources/skills.d.ts +0 -37
- package/dist/lib/resources/skills.js +0 -247
- package/dist/lib/resources/subagents.d.ts +0 -46
- package/dist/lib/resources/subagents.js +0 -202
- /package/dist/lib/{feed.d.ts → feed/feed.d.ts} +0 -0
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
|
-
import { findBrowserPath, getPortOccupant, isLauncherScript } from '../lib/browser/chrome.js';
|
|
10
|
-
import { listProfileCacheDirs, removeProfileCache, listAllProfileSnapshots, } from '../lib/browser/runtime-state.js';
|
|
9
|
+
import { findBrowserPath, getPortOccupant, isLauncherScript, listInstalledBrowsers } from '../lib/browser/chrome.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: ['use', '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,27 +97,112 @@ 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.
|
|
102
106
|
The skill wraps profile selection, snapshotting, and tunneling.
|
|
103
107
|
|
|
104
|
-
Browser support: Chromium-family only (Chrome, Comet, Chromium, Brave, Edge).
|
|
108
|
+
Browser support: Chromium-family only (Chrome, Comet, Chromium, Brave, Edge, Arc).
|
|
105
109
|
Safari and Firefox are not supported — they don't speak the Chrome DevTools
|
|
106
110
|
Protocol the way agents browser expects. On Windows, Edge is the default
|
|
107
111
|
because it's preinstalled. On macOS and Linux, Chrome is preferred when
|
|
108
112
|
installed; otherwise the first Chromium-family binary on disk wins.
|
|
109
113
|
`,
|
|
110
114
|
});
|
|
115
|
+
registerBrowserUseCommand(browser);
|
|
111
116
|
registerProfilesCommands(browser);
|
|
112
117
|
registerTaskCommands(browser);
|
|
113
118
|
registerCommandGroups(browser, BROWSER_HELP_GROUPS);
|
|
114
119
|
}
|
|
115
120
|
export function registerBrowserSubcommands(program) {
|
|
121
|
+
registerBrowserUseCommand(program);
|
|
116
122
|
registerProfilesCommands(program);
|
|
117
123
|
registerTaskCommands(program);
|
|
118
124
|
registerCommandGroups(program, BROWSER_HELP_GROUPS);
|
|
119
125
|
}
|
|
126
|
+
export function buildBrowserUseChoices(profiles, installed, current) {
|
|
127
|
+
const choices = profiles.map((profile) => ({
|
|
128
|
+
name: `${profile.name}${profile.name === current ? ' (current)' : ''}`,
|
|
129
|
+
value: { name: profile.name },
|
|
130
|
+
}));
|
|
131
|
+
const known = new Set(profiles.map((profile) => profile.name));
|
|
132
|
+
for (const browser of installed) {
|
|
133
|
+
const name = `${browser.browserType}-local`;
|
|
134
|
+
if (!known.has(name)) {
|
|
135
|
+
choices.push({ name: `${name} (installed ${browser.browserType})`, value: { name, installed: browser } });
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
return choices;
|
|
139
|
+
}
|
|
140
|
+
export async function runBrowserUse(name, opts, interactive = isInteractiveTerminal()) {
|
|
141
|
+
if (opts.unset || name === 'auto') {
|
|
142
|
+
unsetConfigValue('browser.profile');
|
|
143
|
+
console.log('Default browser profile cleared. `agents browser start` will auto-detect an installed Chromium-family browser.');
|
|
144
|
+
return true;
|
|
145
|
+
}
|
|
146
|
+
let selectedName = name;
|
|
147
|
+
if (!selectedName) {
|
|
148
|
+
const current = getConfiguredDefaultProfileName();
|
|
149
|
+
if (!interactive) {
|
|
150
|
+
console.log(current
|
|
151
|
+
? `Default browser profile (this machine): ${current}`
|
|
152
|
+
: 'Default browser profile (this machine): auto-detect');
|
|
153
|
+
console.log('Usage: agents browser use <name> (or --unset)');
|
|
154
|
+
return true;
|
|
155
|
+
}
|
|
156
|
+
const choices = buildBrowserUseChoices(await listProfiles(), listInstalledBrowsers(), current);
|
|
157
|
+
if (choices.length === 0) {
|
|
158
|
+
console.error('No configured profiles or supported installed browsers found.');
|
|
159
|
+
console.error('Create one with: agents browser profiles create <name> --browser chrome');
|
|
160
|
+
return false;
|
|
161
|
+
}
|
|
162
|
+
const { select } = await import('@inquirer/prompts');
|
|
163
|
+
const selected = await select({ message: 'Select default browser profile:', choices });
|
|
164
|
+
selectedName = selected.name;
|
|
165
|
+
if (selected.installed) {
|
|
166
|
+
const freePort = await findFreeProfilePort();
|
|
167
|
+
await createProfile({
|
|
168
|
+
name: selected.name,
|
|
169
|
+
description: `Seeded ${selected.installed.browserType} profile`,
|
|
170
|
+
browser: selected.installed.browserType,
|
|
171
|
+
binary: selected.installed.binary,
|
|
172
|
+
endpoints: [`cdp://127.0.0.1:${freePort}`],
|
|
173
|
+
viewport: { width: DEFAULT_VIEWPORT.width, height: DEFAULT_VIEWPORT.height },
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
const target = await getProfile(selectedName);
|
|
178
|
+
if (!target) {
|
|
179
|
+
console.error(`Profile "${selectedName}" not found.`);
|
|
180
|
+
const all = await listProfiles();
|
|
181
|
+
if (all.length > 0)
|
|
182
|
+
console.error(`Available profiles: ${all.map((profile) => profile.name).join(', ')}`);
|
|
183
|
+
return false;
|
|
184
|
+
}
|
|
185
|
+
setConfigValue('browser.profile', selectedName);
|
|
186
|
+
const endpoint = Object.values(getEndpointPresets(target))[0]?.target ?? '';
|
|
187
|
+
console.log(`Default browser profile (this machine) is now "${selectedName}" (${target.browser}${endpoint ? `, ${endpoint}` : ''}).`);
|
|
188
|
+
console.log('Bare `agents browser start` and `--profile default` will use it.');
|
|
189
|
+
return true;
|
|
190
|
+
}
|
|
191
|
+
function configureBrowserUseCommand(command, deprecated = false) {
|
|
192
|
+
command
|
|
193
|
+
.description('Pick the profile `agents browser start` uses when no --profile is passed. No name opens a picker on a TTY or prints the current default headlessly.')
|
|
194
|
+
.option('--unset', 'Clear the configured default (revert to auto-detecting an installed browser)')
|
|
195
|
+
.action(async (name, opts) => {
|
|
196
|
+
if (deprecated) {
|
|
197
|
+
console.warn(chalk.yellow('Deprecation: `agents browser profiles set-default` is replaced by `agents browser use`.'));
|
|
198
|
+
}
|
|
199
|
+
if (!await runBrowserUse(name, opts))
|
|
200
|
+
process.exitCode = 1;
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
function registerBrowserUseCommand(browser) {
|
|
204
|
+
configureBrowserUseCommand(browser.command('use [name]'));
|
|
205
|
+
}
|
|
120
206
|
/**
|
|
121
207
|
* Whether a profile's secrets bundle holds login creds for `service`
|
|
122
208
|
* (`<PREFIX>_USERNAME` + `<PREFIX>_PASSWORD`). Reads bundle METADATA only (key
|
|
@@ -147,84 +233,59 @@ function registerProfilesCommands(browser) {
|
|
|
147
233
|
profiles
|
|
148
234
|
.command('list')
|
|
149
235
|
.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.
|
|
236
|
+
.description('List all browser profiles, with the store each lives in (local / fleet)')
|
|
237
|
+
.option('--json', 'Output machine-readable JSON')
|
|
238
|
+
.action(async (opts) => {
|
|
239
|
+
const scoped = await listProfilesWithScope();
|
|
160
240
|
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
|
-
}
|
|
241
|
+
if (opts.json) {
|
|
242
|
+
console.log(JSON.stringify(scoped.map(({ profile, scope }) => ({
|
|
243
|
+
...profile,
|
|
244
|
+
scope,
|
|
245
|
+
isConfiguredDefault: profile.name === configuredDefault,
|
|
246
|
+
})), null, 2));
|
|
247
|
+
return;
|
|
185
248
|
}
|
|
186
|
-
if (
|
|
187
|
-
console.log('');
|
|
188
|
-
console.log(
|
|
249
|
+
if (scoped.length === 0) {
|
|
250
|
+
console.log('No browser profiles configured.');
|
|
251
|
+
console.log('Create one with: agents browser profiles create <name> --browser chrome');
|
|
252
|
+
return;
|
|
189
253
|
}
|
|
254
|
+
// Rendering lives in lib/browser/profiles.ts so the column widths and the
|
|
255
|
+
// default-marking rules are unit-tested rather than eyeballed (RUSH-2710).
|
|
256
|
+
for (const line of formatProfilesTable(scoped, configuredDefault))
|
|
257
|
+
console.log(line);
|
|
190
258
|
});
|
|
191
|
-
const browserProfileDeprecation = chalk.yellow('Deprecation: `agents browser profiles set-default` is replaced by `agents config set browser.profile <name>`.');
|
|
192
259
|
profiles
|
|
193
|
-
.command('
|
|
194
|
-
.description('
|
|
195
|
-
.
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
console.log('Default browser profile cleared. `agents browser start` will auto-detect an installed Chromium-family browser.');
|
|
201
|
-
return;
|
|
260
|
+
.command('seed')
|
|
261
|
+
.description('Create a machine-local profile for each installed browser (named <browser>-local), so you can pick or use one instead of hand-crafting each. Idempotent — existing profiles are left untouched.')
|
|
262
|
+
.action(async () => {
|
|
263
|
+
const installed = listInstalledBrowsers();
|
|
264
|
+
if (installed.length === 0) {
|
|
265
|
+
console.error('No supported browser found to seed a profile for.');
|
|
266
|
+
process.exit(1);
|
|
202
267
|
}
|
|
203
|
-
|
|
204
|
-
const
|
|
205
|
-
if (
|
|
206
|
-
console.log(
|
|
207
|
-
|
|
208
|
-
else {
|
|
209
|
-
console.log('No default browser profile set. `agents browser start` auto-detects an installed Chromium-family browser.');
|
|
210
|
-
console.log('Set one with: agents config set browser.profile <name>');
|
|
268
|
+
for (const { browserType, binary } of installed) {
|
|
269
|
+
const name = `${browserType}-local`;
|
|
270
|
+
if (await getProfile(name)) {
|
|
271
|
+
console.log(`= ${name} (already exists)`);
|
|
272
|
+
continue;
|
|
211
273
|
}
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
274
|
+
const freePort = await findFreeProfilePort();
|
|
275
|
+
await createProfile({
|
|
276
|
+
name,
|
|
277
|
+
description: `Seeded ${browserType} profile`,
|
|
278
|
+
browser: browserType,
|
|
279
|
+
binary,
|
|
280
|
+
endpoints: [`cdp://127.0.0.1:${freePort}`],
|
|
281
|
+
viewport: { width: DEFAULT_VIEWPORT.width, height: DEFAULT_VIEWPORT.height },
|
|
282
|
+
});
|
|
283
|
+
console.log(`+ ${name} (${browserType})`);
|
|
221
284
|
}
|
|
222
|
-
|
|
223
|
-
const eps = getEndpointPresets(target);
|
|
224
|
-
const epStr = Object.values(eps)[0]?.target ?? '';
|
|
225
|
-
console.log(`Default browser profile (this machine) is now "${name}" (${target.browser}${epStr ? `, ${epStr}` : ''}).`);
|
|
226
|
-
console.log('Bare `agents browser start` and `--profile default` will use it.');
|
|
285
|
+
console.log('Pick your default with: agents browser use <name>');
|
|
227
286
|
});
|
|
287
|
+
configureBrowserUseCommand(profiles.command('use [name]'));
|
|
288
|
+
configureBrowserUseCommand(profiles.command('set-default [name]', { hidden: true }), true);
|
|
228
289
|
profiles
|
|
229
290
|
.command('logins')
|
|
230
291
|
.description('Show which login-gated services each profile has a live session for, the account signed in, and whether login creds are available in the profile\'s secrets bundle (reads cookie/username presence only, never decrypts).')
|
|
@@ -253,11 +314,12 @@ function registerProfilesCommands(browser) {
|
|
|
253
314
|
}
|
|
254
315
|
}
|
|
255
316
|
});
|
|
256
|
-
const VALID_BROWSERS = ['chrome', 'comet', 'chromium', 'brave', 'edge', 'custom'];
|
|
317
|
+
const VALID_BROWSERS = ['chrome', 'comet', 'chromium', 'brave', 'edge', 'arc', 'custom'];
|
|
257
318
|
profiles
|
|
258
319
|
.command('create <name>')
|
|
259
|
-
.description('Create a new browser profile')
|
|
320
|
+
.description('Create a new browser profile (machine-local unless --fleet)')
|
|
260
321
|
.requiredOption('-b, --browser <type>', `Browser type: ${VALID_BROWSERS.join(', ')}`)
|
|
322
|
+
.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
323
|
.option('-e, --endpoint <url>', 'CDP endpoint URL (repeatable; auto-assigned if omitted)', collect, [])
|
|
262
324
|
.option('-s, --secrets <bundle>', 'Secrets bundle to inject')
|
|
263
325
|
.option('-d, --description <text>', 'Profile description')
|
|
@@ -337,8 +399,8 @@ function registerProfilesCommands(browser) {
|
|
|
337
399
|
chrome: opts.headless ? { headless: true } : undefined,
|
|
338
400
|
viewport,
|
|
339
401
|
};
|
|
340
|
-
await createProfile(profile);
|
|
341
|
-
console.log(`Created profile: ${name}`);
|
|
402
|
+
await createProfile(profile, { fleet: !!opts.fleet });
|
|
403
|
+
console.log(`Created profile: ${name} (${opts.fleet ? 'fleet-synced — visible on every machine' : 'machine-local'})`);
|
|
342
404
|
// Warn (don't fail) if the declared secrets bundle doesn't exist yet — it
|
|
343
405
|
// may be created later, but a typo should surface now.
|
|
344
406
|
if (opts.secrets && !bundleExists(opts.secrets)) {
|
|
@@ -452,9 +514,76 @@ function registerProfilesCommands(browser) {
|
|
|
452
514
|
(removed > 0 ? ` (and ${removed} cache dir${removed === 1 ? '' : 's'})` : ''));
|
|
453
515
|
if (getConfiguredDefaultProfileName() === name) {
|
|
454
516
|
console.error(`warning: "${name}" was this machine's default browser profile; ` +
|
|
455
|
-
`\`agents browser start\` will auto-detect until you run: agents
|
|
517
|
+
`\`agents browser start\` will auto-detect until you run: agents browser use <name>`);
|
|
456
518
|
}
|
|
457
519
|
});
|
|
520
|
+
profiles
|
|
521
|
+
.command('prune')
|
|
522
|
+
.description('Remove dead machine-local profiles: browser not installed here, or never started')
|
|
523
|
+
.option('-n, --dry-run', 'Print what would be removed and exit without changing anything')
|
|
524
|
+
.option('--fleet', 'Also consider fleet-synced profiles (removing one removes it from EVERY machine)')
|
|
525
|
+
.option('--json', 'Output machine-readable JSON')
|
|
526
|
+
.action(async (opts) => {
|
|
527
|
+
const plan = await buildProfilePrunePlan({ includeFleet: opts.fleet });
|
|
528
|
+
if (!opts.dryRun)
|
|
529
|
+
await pruneProfiles(plan);
|
|
530
|
+
if (opts.json) {
|
|
531
|
+
console.log(JSON.stringify({ dryRun: !!opts.dryRun, ...plan }, null, 2));
|
|
532
|
+
return;
|
|
533
|
+
}
|
|
534
|
+
if (plan.candidates.length === 0) {
|
|
535
|
+
console.log('Nothing to prune — every profile is in use, healthy, or protected.');
|
|
536
|
+
if (plan.kept.length > 0) {
|
|
537
|
+
for (const k of plan.kept)
|
|
538
|
+
console.log(` kept ${k.name} (${k.scope}) — ${k.why}`);
|
|
539
|
+
}
|
|
540
|
+
return;
|
|
541
|
+
}
|
|
542
|
+
const verb = opts.dryRun ? 'Would remove' : 'Removed';
|
|
543
|
+
console.log(`${verb} ${plan.candidates.length} profile${plan.candidates.length === 1 ? '' : 's'}:`);
|
|
544
|
+
for (const c of plan.candidates) {
|
|
545
|
+
const cache = c.cacheDirs.length > 0
|
|
546
|
+
? ` + ${c.cacheDirs.length} cache dir${c.cacheDirs.length === 1 ? '' : 's'}`
|
|
547
|
+
: '';
|
|
548
|
+
console.log(` ${c.name} (${c.scope}) — ${PRUNE_REASON_TEXT[c.reason]}${cache}`);
|
|
549
|
+
}
|
|
550
|
+
if (opts.dryRun) {
|
|
551
|
+
console.log('');
|
|
552
|
+
console.log('Nothing was changed. Re-run without --dry-run to apply.');
|
|
553
|
+
}
|
|
554
|
+
});
|
|
555
|
+
setHelpSections(profiles, {
|
|
556
|
+
examples: `
|
|
557
|
+
# What exists here, and whether each is this machine's or the whole fleet's
|
|
558
|
+
agents browser profiles list
|
|
559
|
+
|
|
560
|
+
# Create one — machine-local by default
|
|
561
|
+
agents browser profiles create work --browser chrome
|
|
562
|
+
|
|
563
|
+
# Create one every machine should see (e.g. a remote ssh:// endpoint)
|
|
564
|
+
agents browser profiles create shared-remote --browser chrome --fleet
|
|
565
|
+
|
|
566
|
+
# Clean up dead ones: check first, then apply
|
|
567
|
+
agents browser profiles prune --dry-run
|
|
568
|
+
agents browser profiles prune
|
|
569
|
+
|
|
570
|
+
# Make one the machine's default for a bare \`agents browser start\`
|
|
571
|
+
agents browser use work
|
|
572
|
+
`,
|
|
573
|
+
notes: `
|
|
574
|
+
Profiles are machine-local by default. A profile pins an OS-specific binary
|
|
575
|
+
path and a locally chosen CDP port, so a fleet-synced copy is wrong on every
|
|
576
|
+
other machine — pass --fleet only when the profile really is fleet config.
|
|
577
|
+
|
|
578
|
+
In \`list\`, the \`*\` marker means "this machine's configured default"
|
|
579
|
+
(\`agents browser start\` with no --profile). It is NOT the same thing as the
|
|
580
|
+
profile NAMED \`default\`, which is the auto-detected one; they are often
|
|
581
|
+
different profiles.
|
|
582
|
+
|
|
583
|
+
\`prune\` never removes a profile that is in use, the configured default, the
|
|
584
|
+
auto \`default\`, or (without --fleet) a fleet-synced one.
|
|
585
|
+
`,
|
|
586
|
+
});
|
|
458
587
|
profiles
|
|
459
588
|
.command('doctor <name>')
|
|
460
589
|
.description('Diagnose a browser profile: binary, port, user-data-dir, onboarding state')
|
|
@@ -627,7 +756,7 @@ function registerProfilesCommands(browser) {
|
|
|
627
756
|
function registerTaskCommands(browser) {
|
|
628
757
|
browser
|
|
629
758
|
.command('remote-control [state]')
|
|
630
|
-
.description("Allow or deny other fleet machines driving THIS machine's browser over `browser --
|
|
759
|
+
.description("Allow or deny other fleet machines driving THIS machine's browser over `browser --device`. " +
|
|
631
760
|
'`on`/`off` to set (device-local, never synced); no argument prints the current value. Default off.')
|
|
632
761
|
.option('--json', 'Output as JSON')
|
|
633
762
|
.action((state, opts) => {
|
|
@@ -658,8 +787,8 @@ function registerTaskCommands(browser) {
|
|
|
658
787
|
}
|
|
659
788
|
console.log(`Remote browser control (this machine) is now ${value ? 'on' : 'off'}.`);
|
|
660
789
|
console.log(value
|
|
661
|
-
? 'Other fleet machines can now drive this browser via `browser --
|
|
662
|
-
: 'Cross-machine `browser --
|
|
790
|
+
? 'Other fleet machines can now drive this browser via `browser --device <this-device>`.'
|
|
791
|
+
: 'Cross-machine `browser --device` drives to this machine are refused.');
|
|
663
792
|
});
|
|
664
793
|
const stream = browser
|
|
665
794
|
.command('stream')
|
|
@@ -694,9 +823,10 @@ function registerTaskCommands(browser) {
|
|
|
694
823
|
});
|
|
695
824
|
browser
|
|
696
825
|
.command('start')
|
|
697
|
-
.description('Start a browser task. Pass --profile <name>; omit to use your configured default (`agents
|
|
826
|
+
.description('Start a browser task. Pass --profile <name>; omit to use your configured default (`agents browser use <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
827
|
.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)')
|
|
828
|
+
.option(TASK_OPTION_FLAG, 'Task name (auto-generated short id if omitted)')
|
|
829
|
+
.option('--title <label>', 'Human label shown in `browser status` (defaults to first navigated host)')
|
|
700
830
|
.option('-e, --endpoint <name>', 'Endpoint preset (defaults to the profile\'s default)')
|
|
701
831
|
.option('-u, --url <url>', 'Open URL in first tab')
|
|
702
832
|
.option('--fresh', 'Always open a new tab, skipping the reclaim of a tab an abandoned task is holding on that URL')
|
|
@@ -706,7 +836,7 @@ function registerTaskCommands(browser) {
|
|
|
706
836
|
.option('--duration <sec>', 'Recording duration cap in seconds (with --record; default 60)', (v) => parseInt(v, 10))
|
|
707
837
|
.option('--max-mb <mb>', 'Recording size cap in MB (with --record; default 25)', (v) => parseInt(v, 10))
|
|
708
838
|
.action(async (opts) => {
|
|
709
|
-
// Consent gate: a fleet-remote `browser --
|
|
839
|
+
// Consent gate: a fleet-remote `browser --device <this-machine> start` may
|
|
710
840
|
// only open a browser here if the owner opted in. Refuse before we resolve
|
|
711
841
|
// or auto-create any profile. Local starts are never gated.
|
|
712
842
|
try {
|
|
@@ -753,7 +883,7 @@ function registerTaskCommands(browser) {
|
|
|
753
883
|
if (all.length > 0) {
|
|
754
884
|
console.error(`Available profiles: ${all.map((p) => p.name).join(', ')}`);
|
|
755
885
|
}
|
|
756
|
-
console.error(`Create one with: agents browser profiles create ${profileName} --browser <chrome|comet|chromium|brave|edge|custom>`);
|
|
886
|
+
console.error(`Create one with: agents browser profiles create ${profileName} --browser <chrome|comet|chromium|brave|edge|arc|custom>`);
|
|
757
887
|
process.exit(1);
|
|
758
888
|
}
|
|
759
889
|
// Pre-check the endpoint name too — same fail-fast rationale.
|
|
@@ -785,6 +915,7 @@ function registerTaskCommands(browser) {
|
|
|
785
915
|
}
|
|
786
916
|
catch { /* login detection is best-effort; never block start */ }
|
|
787
917
|
}
|
|
918
|
+
// Identity is stamped inside sendIPCRequest; no need to pass it here.
|
|
788
919
|
const response = await sendIPCRequest({
|
|
789
920
|
action: 'start',
|
|
790
921
|
profile: profileName,
|
|
@@ -793,17 +924,7 @@ function registerTaskCommands(browser) {
|
|
|
793
924
|
endpoint: opts.endpoint,
|
|
794
925
|
skipDomainSkill: opts.skills === false,
|
|
795
926
|
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,
|
|
927
|
+
title: opts.title,
|
|
807
928
|
});
|
|
808
929
|
if (!response.ok) {
|
|
809
930
|
console.error(response.error);
|
|
@@ -820,7 +941,7 @@ function registerTaskCommands(browser) {
|
|
|
820
941
|
else {
|
|
821
942
|
console.error(`Started task "${response.task}"`);
|
|
822
943
|
}
|
|
823
|
-
console.error(
|
|
944
|
+
console.error('Tip: page verbs resolve this task from your session — --task only when running two at once.');
|
|
824
945
|
console.error('Try: agents browser screenshot | agents browser console --level error');
|
|
825
946
|
// Surface the matched domain-skill (if any) so an agent driving the
|
|
826
947
|
// task picks up site-specific selectors and gotchas before it starts
|
|
@@ -855,7 +976,7 @@ function registerTaskCommands(browser) {
|
|
|
855
976
|
});
|
|
856
977
|
browser
|
|
857
978
|
.command('done')
|
|
858
|
-
.description('Complete a task and close its tabs')
|
|
979
|
+
.description('Complete a task and close its tabs (resolves from caller identity when --task is omitted)')
|
|
859
980
|
.option(TASK_OPTION_FLAG, TASK_OPTION_DESC)
|
|
860
981
|
.action(async (opts) => {
|
|
861
982
|
const task = resolveTaskName(opts);
|
|
@@ -867,7 +988,11 @@ function registerTaskCommands(browser) {
|
|
|
867
988
|
console.error(response.error);
|
|
868
989
|
process.exit(1);
|
|
869
990
|
}
|
|
870
|
-
|
|
991
|
+
if (response.message === 'nothing to close' || !response.task) {
|
|
992
|
+
console.log('nothing to close');
|
|
993
|
+
return;
|
|
994
|
+
}
|
|
995
|
+
console.log(`Completed task: ${response.task}`);
|
|
871
996
|
});
|
|
872
997
|
browser
|
|
873
998
|
.command('stop')
|
|
@@ -896,27 +1021,78 @@ function registerTaskCommands(browser) {
|
|
|
896
1021
|
console.error(response.error);
|
|
897
1022
|
process.exit(1);
|
|
898
1023
|
}
|
|
899
|
-
|
|
1024
|
+
if (response.message === 'nothing to close' || !response.task) {
|
|
1025
|
+
console.log('nothing to close');
|
|
1026
|
+
return;
|
|
1027
|
+
}
|
|
1028
|
+
console.log(`Stopped task: ${response.task}`);
|
|
900
1029
|
});
|
|
901
1030
|
browser
|
|
902
|
-
.command('
|
|
903
|
-
.description('
|
|
1031
|
+
.command('gc')
|
|
1032
|
+
.description('Close tabs for abandoned tasks — owning agent session exited, or idle past the window — and mark them done. ' +
|
|
1033
|
+
'The same reaper the daemon already runs every 5 minutes; use this to run it now.')
|
|
1034
|
+
.option('--dry-run', 'List what would be closed without closing anything')
|
|
1035
|
+
.option('--idle-minutes <n>', 'Override the idle window in minutes (default: this device\'s browser.task-idle-minutes, or 30). ' +
|
|
1036
|
+
'0 disables idle-only closing for this run; session-dead tasks are still closed.', (v) => parseInt(v, 10))
|
|
1037
|
+
.option('--json', 'Output machine-readable JSON')
|
|
1038
|
+
.action(async (opts) => {
|
|
1039
|
+
const response = await sendIPCRequest({
|
|
1040
|
+
action: 'gc',
|
|
1041
|
+
dryRun: opts.dryRun,
|
|
1042
|
+
idleMinutes: opts.idleMinutes,
|
|
1043
|
+
});
|
|
1044
|
+
if (!response.ok) {
|
|
1045
|
+
if (opts.json) {
|
|
1046
|
+
console.log(JSON.stringify({ ok: false, error: response.error }));
|
|
1047
|
+
}
|
|
1048
|
+
else {
|
|
1049
|
+
console.error(response.error);
|
|
1050
|
+
}
|
|
1051
|
+
process.exit(1);
|
|
1052
|
+
}
|
|
1053
|
+
const reaped = response.reaped ?? { closed: [], skipped: 0 };
|
|
1054
|
+
if (opts.json) {
|
|
1055
|
+
console.log(JSON.stringify(reaped, null, 2));
|
|
1056
|
+
return;
|
|
1057
|
+
}
|
|
1058
|
+
if (reaped.closed.length === 0) {
|
|
1059
|
+
console.log(`No abandoned tasks${opts.dryRun ? ' (dry run)' : ''}; ${reaped.skipped} task(s) still active.`);
|
|
1060
|
+
return;
|
|
1061
|
+
}
|
|
1062
|
+
const verb = opts.dryRun ? 'Would close' : 'Closed';
|
|
1063
|
+
console.log(`${verb} ${reaped.closed.length} task(s), left ${reaped.skipped} alone:`);
|
|
1064
|
+
for (const c of reaped.closed) {
|
|
1065
|
+
console.log(` ${c.task} (${c.profile}, ${c.reason})`);
|
|
1066
|
+
}
|
|
1067
|
+
});
|
|
1068
|
+
browser
|
|
1069
|
+
.command('navigate [url]')
|
|
1070
|
+
.alias('goto')
|
|
1071
|
+
.description('Navigate current tab to URL (creates a task and tab when none exist)')
|
|
904
1072
|
.option(TASK_OPTION_FLAG, TASK_OPTION_DESC)
|
|
905
|
-
.
|
|
1073
|
+
.option('-u, --url <url>', 'URL to navigate to (or pass it positionally)')
|
|
906
1074
|
.option('-p, --profile <name>', 'Browser profile (optional if task is unique)')
|
|
907
|
-
.action(async (opts) => {
|
|
1075
|
+
.action(async (urlPos, opts) => {
|
|
1076
|
+
const url = urlPos || opts.url;
|
|
1077
|
+
if (!url) {
|
|
1078
|
+
console.error('URL required. Usage: agents browser navigate <url>');
|
|
1079
|
+
process.exit(1);
|
|
1080
|
+
}
|
|
908
1081
|
const task = resolveTaskName(opts);
|
|
909
1082
|
const response = await sendIPCRequest({
|
|
910
1083
|
action: 'navigate',
|
|
911
1084
|
task,
|
|
912
|
-
url
|
|
1085
|
+
url,
|
|
913
1086
|
profile: opts.profile,
|
|
914
1087
|
});
|
|
915
1088
|
if (!response.ok) {
|
|
916
1089
|
console.error(response.error);
|
|
917
1090
|
process.exit(1);
|
|
918
1091
|
}
|
|
919
|
-
|
|
1092
|
+
if (response.task) {
|
|
1093
|
+
console.error(`task ${response.task}`);
|
|
1094
|
+
}
|
|
1095
|
+
console.log(`Navigated ${response.tabId} to ${url}`);
|
|
920
1096
|
});
|
|
921
1097
|
// Tab subcommand group
|
|
922
1098
|
const tab = browser.command('tab').description('Manage tabs');
|
|
@@ -1073,16 +1249,18 @@ function registerTaskCommands(browser) {
|
|
|
1073
1249
|
}
|
|
1074
1250
|
});
|
|
1075
1251
|
browser
|
|
1076
|
-
.command('evaluate')
|
|
1252
|
+
.command('evaluate [expression]')
|
|
1253
|
+
.alias('eval')
|
|
1077
1254
|
.description('Evaluate JavaScript in current tab')
|
|
1078
1255
|
.option(TASK_OPTION_FLAG, TASK_OPTION_DESC)
|
|
1079
1256
|
.option('-t, --tab <tabId>', 'Tab ID (defaults to current)')
|
|
1080
|
-
.option('-e, --expression <js>', 'JavaScript expression to evaluate')
|
|
1257
|
+
.option('-e, --expression <js>', 'JavaScript expression to evaluate (or pass it positionally)')
|
|
1081
1258
|
.option('-f, --file <path>', 'Path to a .js file whose contents will be evaluated')
|
|
1082
|
-
.action(async (opts) => {
|
|
1259
|
+
.action(async (exprPos, opts) => {
|
|
1083
1260
|
const task = resolveTaskName(opts);
|
|
1084
|
-
|
|
1085
|
-
|
|
1261
|
+
const flagExpr = opts.expression || exprPos;
|
|
1262
|
+
if (flagExpr && opts.file) {
|
|
1263
|
+
console.error('Pass exactly one of an expression or --file');
|
|
1086
1264
|
process.exit(1);
|
|
1087
1265
|
}
|
|
1088
1266
|
let expression;
|
|
@@ -1095,11 +1273,11 @@ function registerTaskCommands(browser) {
|
|
|
1095
1273
|
process.exit(1);
|
|
1096
1274
|
}
|
|
1097
1275
|
}
|
|
1098
|
-
else if (
|
|
1099
|
-
expression =
|
|
1276
|
+
else if (flagExpr) {
|
|
1277
|
+
expression = flagExpr;
|
|
1100
1278
|
}
|
|
1101
1279
|
else {
|
|
1102
|
-
console.error('Pass
|
|
1280
|
+
console.error('Pass an expression positionally, -e <js>, or --file <path>');
|
|
1103
1281
|
process.exit(1);
|
|
1104
1282
|
}
|
|
1105
1283
|
const response = await sendIPCRequest({
|
|
@@ -1285,15 +1463,22 @@ function registerTaskCommands(browser) {
|
|
|
1285
1463
|
console.log(' No active tasks');
|
|
1286
1464
|
}
|
|
1287
1465
|
else {
|
|
1288
|
-
console.log('
|
|
1466
|
+
console.log(' ' +
|
|
1467
|
+
'ID'.padEnd(12) +
|
|
1468
|
+
'LABEL'.padEnd(20) +
|
|
1469
|
+
'TABS'.padEnd(6) +
|
|
1470
|
+
'DOMAINS'.padEnd(22) +
|
|
1471
|
+
'CREATED');
|
|
1289
1472
|
for (const task of profile.tasks) {
|
|
1290
1473
|
const age = formatAge(task.createdAt);
|
|
1291
|
-
const
|
|
1474
|
+
const id = (task.name || task.id).slice(0, 10);
|
|
1475
|
+
const label = (task.label || task.name || task.id).slice(0, 18);
|
|
1292
1476
|
const domains = task.domains?.slice(0, 2).join(', ') || '-';
|
|
1293
1477
|
console.log(' ' +
|
|
1294
|
-
|
|
1478
|
+
id.padEnd(12) +
|
|
1479
|
+
label.padEnd(20) +
|
|
1295
1480
|
String(task.tabCount).padEnd(6) +
|
|
1296
|
-
domains.slice(0,
|
|
1481
|
+
domains.slice(0, 20).padEnd(22) +
|
|
1297
1482
|
age);
|
|
1298
1483
|
}
|
|
1299
1484
|
}
|
|
@@ -1842,8 +2027,9 @@ function registerTaskCommands(browser) {
|
|
|
1842
2027
|
}
|
|
1843
2028
|
});
|
|
1844
2029
|
browser
|
|
1845
|
-
.command('logs
|
|
2030
|
+
.command('logs')
|
|
1846
2031
|
.description('Read merged rush-app + rush-cli JSONL logs for a task')
|
|
2032
|
+
.option(TASK_OPTION_FLAG, TASK_OPTION_DESC)
|
|
1847
2033
|
.option('--source <name>', 'Source to scope to: rush-app or rush-cli (default both)')
|
|
1848
2034
|
.option('--lines <n>', 'Tail N entries (default 200; ignored when --since)', (v) => parseInt(v, 10))
|
|
1849
2035
|
.option('--since <when>', 'Absolute timestamp or relative offset (e.g. 5m, 2h, 1d)')
|
|
@@ -1852,11 +2038,12 @@ function registerTaskCommands(browser) {
|
|
|
1852
2038
|
.option('--message <name>', 'Filter entries by exact message field')
|
|
1853
2039
|
.option('--filter <text>', 'Filter entries whose JSON contains this substring')
|
|
1854
2040
|
.option('-f, --follow', 'Follow mode (not yet implemented)')
|
|
1855
|
-
.action(async (
|
|
2041
|
+
.action(async (opts) => {
|
|
1856
2042
|
if (opts.follow) {
|
|
1857
2043
|
process.stderr.write('follow mode not yet implemented; coming next pass\n');
|
|
1858
2044
|
process.exit(1);
|
|
1859
2045
|
}
|
|
2046
|
+
const task = resolveTaskName(opts);
|
|
1860
2047
|
const response = await sendIPCRequest({
|
|
1861
2048
|
action: 'getAppLogs',
|
|
1862
2049
|
task,
|