@phnx-labs/agents-cli 1.22.113 → 1.22.115
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 +139 -0
- package/README.md +32 -113
- package/dist/browser.js +0 -0
- package/dist/cli/command-registry.d.ts +0 -60
- package/dist/cli/command-registry.js +57 -66
- package/dist/commands/accounts.d.ts +3 -77
- package/dist/commands/accounts.js +13 -366
- package/dist/commands/apply.d.ts +0 -4
- package/dist/commands/apply.js +3 -3
- package/dist/commands/audit.js +1 -1
- package/dist/commands/auth.js +0 -2
- package/dist/commands/browser-picker.d.ts +3 -6
- package/dist/commands/browser-picker.js +2 -2
- package/dist/commands/browser-sessions-picker.d.ts +2 -1
- package/dist/commands/browser.d.ts +53 -0
- package/dist/commands/browser.js +199 -9
- package/dist/commands/computer-sessions-picker.d.ts +2 -1
- package/dist/commands/computer.d.ts +14 -19
- package/dist/commands/computer.js +65 -10
- package/dist/commands/config.js +46 -2
- package/dist/commands/daemon.d.ts +0 -23
- package/dist/commands/daemon.js +1 -1
- package/dist/commands/detach-core.d.ts +2 -1
- package/dist/commands/detach.d.ts +0 -3
- package/dist/commands/detach.js +3 -3
- package/dist/commands/doctor.d.ts +2 -3
- package/dist/commands/doctor.js +0 -11
- package/dist/commands/events.d.ts +1 -3
- package/dist/commands/events.js +4 -7
- package/dist/commands/exec.d.ts +0 -1
- package/dist/commands/exec.js +2 -7
- package/dist/commands/feed-watch.js +52 -8
- package/dist/commands/feed.d.ts +3 -3
- package/dist/commands/feed.js +1 -1
- package/dist/commands/focus.d.ts +4 -4
- package/dist/commands/focus.js +1 -1
- package/dist/commands/go.d.ts +0 -17
- package/dist/commands/go.js +2 -19
- package/dist/commands/harness-hooks.d.ts +0 -7
- package/dist/commands/harness-hooks.js +1 -1
- package/dist/commands/harness-wizard.d.ts +2 -2
- package/dist/commands/harness.d.ts +3 -8
- package/dist/commands/harness.js +1 -1
- package/dist/commands/inspect.d.ts +2 -3
- package/dist/commands/inspect.js +1 -1
- package/dist/commands/logs.js +1 -1
- package/dist/commands/mcp.js +8 -83
- package/dist/commands/memory.js +4 -47
- package/dist/commands/message.d.ts +1 -1
- package/dist/commands/message.js +7 -7
- package/dist/commands/plugins.js +1 -93
- package/dist/commands/projects.d.ts +2 -18
- package/dist/commands/projects.js +89 -3
- package/dist/commands/repo.js +0 -44
- package/dist/commands/resource-view.d.ts +3 -2
- package/dist/commands/resume.d.ts +0 -1
- package/dist/commands/resume.js +5 -2
- package/dist/commands/routines.d.ts +1 -3
- package/dist/commands/routines.js +1 -1
- package/dist/commands/run-account-picker.d.ts +2 -1
- package/dist/commands/run-broadcast.d.ts +2 -1
- package/dist/commands/run-device-picker.d.ts +2 -1
- package/dist/commands/secrets-passthrough.d.ts +14 -0
- package/dist/commands/secrets-passthrough.js +23 -4
- package/dist/commands/send.d.ts +4 -4
- package/dist/commands/send.js +6 -51
- package/dist/commands/sessions-backfill.d.ts +2 -35
- package/dist/commands/sessions-backfill.js +1 -1
- package/dist/commands/sessions-backup-setup.js +1 -1
- package/dist/commands/sessions-bookmark.d.ts +0 -10
- package/dist/commands/sessions-bookmark.js +1 -1
- package/dist/commands/sessions-inject.d.ts +2 -3
- package/dist/commands/sessions-inject.js +8 -17
- package/dist/commands/sessions-picker-factory.d.ts +4 -14
- package/dist/commands/sessions-picker-factory.js +2 -2
- package/dist/commands/sessions-picker.d.ts +3 -9
- package/dist/commands/sessions-picker.js +2 -2
- package/dist/commands/sessions-resume.d.ts +2 -4
- package/dist/commands/sessions-resume.js +0 -6
- package/dist/commands/sessions-share.d.ts +5 -7
- package/dist/commands/sessions-share.js +98 -49
- package/dist/commands/sessions-stats.d.ts +2 -1
- package/dist/commands/sessions-stop.d.ts +0 -3
- package/dist/commands/sessions-stop.js +1 -1
- package/dist/commands/sessions-tail.d.ts +2 -1
- package/dist/commands/sessions-trace.d.ts +4 -6
- package/dist/commands/sessions-trace.js +1 -1
- package/dist/commands/sessions.d.ts +13 -104
- package/dist/commands/sessions.js +11 -18
- package/dist/commands/setup-browser.js +18 -2
- package/dist/commands/setup-computer.js +20 -6
- package/dist/commands/setup-mine.d.ts +0 -6
- package/dist/commands/setup-mine.js +1 -1
- package/dist/commands/setup-secrets.js +24 -4
- package/dist/commands/setup-terminal.d.ts +3 -0
- package/dist/commands/setup-terminal.js +22 -0
- package/dist/commands/setup.d.ts +3 -4
- package/dist/commands/setup.js +21 -11
- package/dist/commands/skills.js +0 -8
- package/dist/commands/ssh.d.ts +6 -0
- package/dist/commands/ssh.js +92 -233
- package/dist/commands/sync.js +14 -5
- package/dist/commands/teams-picker.d.ts +2 -5
- package/dist/commands/teams-picker.js +2 -2
- package/dist/commands/teams.d.ts +1 -7
- package/dist/commands/teams.js +2 -2
- package/dist/commands/tmux.d.ts +1 -1
- package/dist/commands/tmux.js +1 -1
- package/dist/commands/traces.js +1 -1
- package/dist/commands/upgrade.d.ts +2 -1
- package/dist/commands/utils.d.ts +1 -1
- package/dist/commands/utils.js +1 -1
- package/dist/lib/account-capabilities.d.ts +2 -1
- package/dist/lib/account-catalog.d.ts +4 -13
- package/dist/lib/account-catalog.js +1 -1
- package/dist/lib/account-registry.d.ts +3 -4
- package/dist/lib/account-registry.js +1 -1
- package/dist/lib/accounting/account-launch.d.ts +4 -3
- package/dist/lib/accounting/account-pool.d.ts +2 -1
- package/dist/lib/accounting/rotate.d.ts +3 -9
- package/dist/lib/accounting/rotate.js +2 -14
- package/dist/lib/accounting/usage-sync.d.ts +5 -4
- package/dist/lib/accounting/usage.d.ts +7 -31
- package/dist/lib/accounting/usage.js +4 -4
- package/dist/lib/accounts/add.d.ts +0 -5
- package/dist/lib/accounts/add.js +1 -7
- package/dist/lib/accounts/migrate.d.ts +8 -8
- package/dist/lib/accounts/migrate.js +1 -1
- package/dist/lib/acp/client.d.ts +3 -2
- package/dist/lib/acp/harnesses.d.ts +2 -2
- package/dist/lib/acp/harnesses.js +1 -1
- package/dist/lib/acp/run.d.ts +2 -1
- package/dist/lib/actor.d.ts +3 -2
- package/dist/lib/add-dir.d.ts +2 -17
- package/dist/lib/add-dir.js +2 -6
- package/dist/lib/address.d.ts +56 -0
- package/dist/lib/address.js +143 -0
- package/dist/lib/agent-spec/agents.d.ts +12 -28
- package/dist/lib/agent-spec/agents.js +2 -6
- package/dist/lib/agent-spec/primitives.d.ts +0 -7
- package/dist/lib/agent-spec/primitives.js +0 -6
- package/dist/lib/agent-spec/types.d.ts +2 -1
- package/dist/lib/analytics/dashboard.d.ts +1 -5
- package/dist/lib/analytics/dashboard.js +0 -2
- package/dist/lib/analytics/mix-commands.d.ts +0 -7
- package/dist/lib/analytics/mix-commands.js +3 -3
- package/dist/lib/analytics/recipes.d.ts +0 -12
- package/dist/lib/analytics/recipes.js +7 -31
- package/dist/lib/analytics/usage-db.d.ts +5 -32
- package/dist/lib/analytics/usage-db.js +1 -70
- package/dist/lib/answer-router.d.ts +7 -6
- package/dist/lib/answer-router.js +5 -11
- package/dist/lib/artifact-actions.d.ts +0 -4
- package/dist/lib/artifacts-client.d.ts +20 -0
- package/dist/lib/artifacts-client.js +46 -0
- package/dist/lib/ask-classifier.d.ts +3 -4
- package/dist/lib/ask-classifier.js +0 -7
- package/dist/lib/auth-health.d.ts +3 -46
- package/dist/lib/auth-health.js +3 -3
- package/dist/lib/auth-mint.d.ts +6 -6
- package/dist/lib/auth-mint.js +7 -7
- package/dist/lib/bench/runner.d.ts +2 -2
- package/dist/lib/bench/runner.js +1 -1
- package/dist/lib/bench/storage.d.ts +0 -1
- package/dist/lib/bench/storage.js +1 -1
- package/dist/lib/boot-profile.d.ts +0 -2
- package/dist/lib/boot-profile.js +0 -4
- package/dist/lib/brand.d.ts +0 -6
- package/dist/lib/brand.js +1 -1
- package/dist/lib/browser/arc-discovery.d.ts +4 -12
- package/dist/lib/browser/arc-discovery.js +1 -1
- package/dist/lib/browser/cdp.d.ts +1 -1
- package/dist/lib/browser/chrome.d.ts +2 -2
- package/dist/lib/browser/chrome.js +0 -4
- package/dist/lib/browser/chromium-discovery.d.ts +3 -2
- package/dist/lib/browser/drivers/arc.d.ts +3 -20
- package/dist/lib/browser/drivers/arc.js +2 -7
- package/dist/lib/browser/drivers/firefox.d.ts +2 -6
- package/dist/lib/browser/drivers/firefox.js +1 -1
- package/dist/lib/browser/drivers/local.d.ts +2 -1
- package/dist/lib/browser/drivers/ssh.d.ts +2 -3
- package/dist/lib/browser/drivers/ssh.js +0 -7
- package/dist/lib/browser/firefox-discovery.d.ts +4 -3
- package/dist/lib/browser/har.d.ts +8 -7
- package/dist/lib/browser/hygiene.d.ts +2 -3
- package/dist/lib/browser/hygiene.js +1 -1
- package/dist/lib/browser/ipc.d.ts +4 -3
- package/dist/lib/browser/ipc.js +1 -1
- package/dist/lib/browser/login-detection.d.ts +1 -8
- package/dist/lib/browser/registry.d.ts +2 -1
- package/dist/lib/browser/remote-control.d.ts +0 -7
- package/dist/lib/browser/remote-control.js +2 -2
- package/dist/lib/browser/resolve-target.d.ts +2 -6
- package/dist/lib/browser/resolve-target.js +3 -3
- package/dist/lib/browser/runtime-state.d.ts +59 -4
- package/dist/lib/browser/runtime-state.js +99 -18
- package/dist/lib/browser/service.d.ts +4 -4
- package/dist/lib/browser/service.js +21 -1
- package/dist/lib/browser/sessions-list.d.ts +0 -10
- package/dist/lib/browser/sessions-list.js +3 -3
- package/dist/lib/browser/stream.d.ts +2 -1
- package/dist/lib/browser/task-index.d.ts +4 -4
- package/dist/lib/browser/task-index.js +1 -1
- package/dist/lib/browser/types.d.ts +0 -20
- package/dist/lib/browser/types.js +1 -34
- package/dist/lib/browser/upload.d.ts +0 -27
- package/dist/lib/budget/ledger.d.ts +0 -2
- package/dist/lib/budget/ledger.js +1 -1
- package/dist/lib/budget/live-cloud.d.ts +2 -1
- package/dist/lib/budget/preflight.d.ts +3 -5
- package/dist/lib/budget/preflight.js +1 -1
- package/dist/lib/catchup.d.ts +2 -1
- package/dist/lib/channels/owner-forward.d.ts +5 -4
- package/dist/lib/channels/owner-sink.js +2 -2
- package/dist/lib/channels/providers/desktop.js +1 -1
- package/dist/lib/channels/providers/rush.d.ts +2 -1
- package/dist/lib/channels/registry.d.ts +1 -1
- package/dist/lib/channels/registry.js +1 -1
- package/dist/lib/channels/resolve.d.ts +3 -2
- package/dist/lib/channels/send.d.ts +5 -4
- package/dist/lib/cli-resources.d.ts +3 -9
- package/dist/lib/cli-resources.js +4 -2
- package/dist/lib/cloud/cursor.d.ts +1 -2
- package/dist/lib/cloud/cursor.js +1 -1
- package/dist/lib/cloud/dispatch.d.ts +2 -1
- package/dist/lib/cloud/dispatch.js +1 -1
- package/dist/lib/cloud/factory.d.ts +0 -2
- package/dist/lib/cloud/factory.js +1 -1
- package/dist/lib/cloud/rush.d.ts +3 -11
- package/dist/lib/cloud/rush.js +1 -1
- package/dist/lib/cloud/session-index.d.ts +2 -1
- package/dist/lib/cloud/types.d.ts +2 -1
- package/dist/lib/cloudflare/creds.d.ts +10 -0
- package/dist/lib/cloudflare/creds.js +46 -0
- package/dist/lib/cloudflare/provision.d.ts +35 -0
- package/dist/lib/cloudflare/provision.js +144 -0
- package/dist/lib/codex-policy.d.ts +2 -1
- package/dist/lib/commands.d.ts +7 -7
- package/dist/lib/commands.js +1 -1
- package/dist/lib/comms-render.d.ts +1 -1
- package/dist/lib/computer/context.d.ts +11 -3
- package/dist/lib/computer/context.js +2 -2
- package/dist/lib/computer/policy.d.ts +0 -12
- package/dist/lib/computer/policy.js +1 -1
- package/dist/lib/computer/sessions-list.d.ts +55 -0
- package/dist/lib/computer/sessions-list.js +168 -1
- package/dist/lib/computer-client.d.ts +3 -3
- package/dist/lib/computer-client.js +0 -1
- package/dist/lib/concurrency.d.ts +2 -1
- package/dist/lib/config-keys.d.ts +16 -3
- package/dist/lib/config-keys.js +47 -2
- package/dist/lib/convert.d.ts +0 -12
- package/dist/lib/convert.js +1 -12
- package/dist/lib/crabbox/cli.d.ts +6 -24
- package/dist/lib/crabbox/cli.js +2 -28
- package/dist/lib/crabbox/lease.d.ts +5 -6
- package/dist/lib/crabbox/lease.js +1 -1
- package/dist/lib/crabbox/progress.d.ts +2 -1
- package/dist/lib/crabbox/setup-copy.d.ts +2 -3
- package/dist/lib/crabbox/setup-copy.js +1 -1
- package/dist/lib/daemon/account-state-daemon-service.d.ts +1 -1
- package/dist/lib/daemon/attention-notify-service.d.ts +2 -1
- package/dist/lib/daemon/catchup-service.d.ts +2 -1
- package/dist/lib/daemon/daemon.d.ts +4 -4
- package/dist/lib/daemon/daemon.js +9 -2
- package/dist/lib/daemon/feed-stream-service.d.ts +23 -0
- package/dist/lib/daemon/feed-stream-service.js +40 -0
- package/dist/lib/daemon/harness-update-service.d.ts +2 -19
- package/dist/lib/daemon/harness-update-service.js +3 -3
- package/dist/lib/daemon/runner.d.ts +3 -3
- package/dist/lib/daemon/self-update-service.d.ts +1 -16
- package/dist/lib/daemon/self-update-service.js +6 -6
- package/dist/lib/daemon/state-dir-check-service.d.ts +2 -1
- package/dist/lib/daemon/supervisor.d.ts +3 -2
- package/dist/lib/daemon-services.d.ts +3 -2
- package/dist/lib/daemon-services.js +5 -0
- package/dist/lib/daemon-webhooks.d.ts +1 -1
- package/dist/lib/deeplink/register.d.ts +3 -13
- package/dist/lib/deeplink/register.js +3 -3
- package/dist/lib/deeplink/url.d.ts +3 -2
- package/dist/lib/device-config.d.ts +4 -15
- package/dist/lib/device-config.js +164 -8
- package/dist/lib/devices/connect.d.ts +51 -6
- package/dist/lib/devices/connect.js +169 -21
- package/dist/lib/devices/discovery-policy.d.ts +3 -2
- package/dist/lib/devices/doctor-findings.js +1 -1
- package/dist/lib/devices/doctor-overview-cache.d.ts +3 -2
- package/dist/lib/devices/fleet-divergence.d.ts +2 -1
- package/dist/lib/devices/fleet.d.ts +3 -4
- package/dist/lib/devices/fleet.js +1 -1
- package/dist/lib/devices/harness-inventory.d.ts +3 -2
- package/dist/lib/devices/health-report.d.ts +3 -2
- package/dist/lib/devices/health.d.ts +1 -8
- package/dist/lib/devices/health.js +1 -1
- package/dist/lib/devices/interactive-host.d.ts +0 -2
- package/dist/lib/devices/interactive-host.js +1 -1
- package/dist/lib/devices/known-hosts.d.ts +2 -20
- package/dist/lib/devices/known-hosts.js +2 -2
- package/dist/lib/devices/pool.d.ts +2 -1
- package/dist/lib/devices/resolve-target.d.ts +2 -2
- package/dist/lib/devices/rollout-verify.d.ts +3 -2
- package/dist/lib/devices/stats-cache.d.ts +3 -2
- package/dist/lib/devices/sync.d.ts +6 -5
- package/dist/lib/devices/worker-pick.d.ts +3 -12
- package/dist/lib/devices/worker-pick.js +1 -1
- package/dist/lib/diff-text.d.ts +2 -1
- package/dist/lib/doctor-diff.d.ts +2 -1
- package/dist/lib/drift-sync.d.ts +3 -2
- package/dist/lib/drift.d.ts +3 -3
- package/dist/lib/drift.js +1 -1
- package/dist/lib/event-families.d.ts +0 -6
- package/dist/lib/event-families.js +3 -3
- package/dist/lib/event-provenance.d.ts +2 -1
- package/dist/lib/events-ingest.d.ts +4 -3
- package/dist/lib/exec-account-home.d.ts +2 -4
- package/dist/lib/exec-account-home.js +1 -1
- package/dist/lib/exec-bounded.d.ts +3 -4
- package/dist/lib/exec-bounded.js +1 -1
- package/dist/lib/exec.d.ts +6 -18
- package/dist/lib/exec.js +1 -1
- package/dist/lib/factory/snapshot.d.ts +2 -2
- package/dist/lib/factory/snapshot.js +1 -1
- package/dist/lib/feed/activity-stream.d.ts +2 -5
- package/dist/lib/feed/activity-stream.js +2 -2
- package/dist/lib/feed/activity.d.ts +8 -33
- package/dist/lib/feed/activity.js +8 -8
- package/dist/lib/feed/answer.d.ts +3 -2
- package/dist/lib/feed/attention.js +5 -1
- package/dist/lib/feed/envelope.d.ts +79 -0
- package/dist/lib/feed/envelope.js +23 -0
- package/dist/lib/feed/events.d.ts +8 -47
- package/dist/lib/feed/events.js +9 -141
- package/dist/lib/feed/feed.d.ts +9 -42
- package/dist/lib/feed/feed.js +1 -60
- package/dist/lib/feed/hub-server.d.ts +86 -0
- package/dist/lib/feed/hub-server.js +334 -0
- package/dist/lib/feed/hub.d.ts +95 -0
- package/dist/lib/feed/hub.js +255 -0
- package/dist/lib/feed/pr-status.d.ts +0 -2
- package/dist/lib/feed/pr-status.js +1 -5
- package/dist/lib/feed/tool-activity.d.ts +108 -0
- package/dist/lib/feed/tool-activity.js +313 -0
- package/dist/lib/feed/tools.d.ts +198 -0
- package/dist/lib/feed/tools.js +265 -0
- package/dist/lib/feed/watch.d.ts +51 -52
- package/dist/lib/feed/watch.js +147 -17
- package/dist/lib/feed-broadcast.d.ts +5 -47
- package/dist/lib/feed-broadcast.js +9 -9
- package/dist/lib/feed-outcome.d.ts +3 -6
- package/dist/lib/feed-outcome.js +2 -2
- package/dist/lib/feed-policy.d.ts +5 -6
- package/dist/lib/feed-policy.js +2 -2
- package/dist/lib/feed-post.d.ts +3 -4
- package/dist/lib/feed-post.js +1 -1
- package/dist/lib/feed-ranking.d.ts +2 -2
- package/dist/lib/feed-ranking.js +1 -1
- package/dist/lib/fleet/apply.d.ts +5 -6
- package/dist/lib/fleet/apply.js +4 -4
- package/dist/lib/fleet/manifest.d.ts +2 -1
- package/dist/lib/fleet/remote-login.d.ts +18 -36
- package/dist/lib/fleet/remote-login.js +20 -19
- package/dist/lib/fleet/types.d.ts +0 -8
- package/dist/lib/fleet-cache.d.ts +1 -18
- package/dist/lib/fleet-cache.js +0 -5
- package/dist/lib/fleet-shared-repo-sync.d.ts +3 -3
- package/dist/lib/fleet-shared-repo-sync.js +1 -1
- package/dist/lib/fleet-shared-state.d.ts +3 -2
- package/dist/lib/format.d.ts +3 -2
- package/dist/lib/format.js +1 -1
- package/dist/lib/friction-heuristics.d.ts +2 -1
- package/dist/lib/fs-walk.d.ts +2 -1
- package/dist/lib/fuzzy.d.ts +2 -1
- package/dist/lib/gemini-settings.d.ts +0 -1
- package/dist/lib/gemini-settings.js +1 -1
- package/dist/lib/git.d.ts +7 -81
- package/dist/lib/git.js +2 -199
- package/dist/lib/github/gh-overload.d.ts +0 -4
- package/dist/lib/github/gh-overload.js +2 -2
- package/dist/lib/github/project-prs.d.ts +118 -0
- package/dist/lib/github/project-prs.js +173 -0
- package/dist/lib/github/rest.d.ts +2 -1
- package/dist/lib/harness/exec-config-version.d.ts +2 -1
- package/dist/lib/harness-auth-capabilities.d.ts +5 -4
- package/dist/lib/harness-connection-test.d.ts +2 -1
- package/dist/lib/heal.d.ts +3 -20
- package/dist/lib/heal.js +2 -39
- package/dist/lib/help.d.ts +3 -2
- package/dist/lib/helper-download.d.ts +0 -12
- package/dist/lib/helper-download.js +2 -2
- package/dist/lib/helper-versions.d.ts +2 -1
- package/dist/lib/helper-versions.js +1 -1
- package/dist/lib/hooks/install.d.ts +8 -49
- package/dist/lib/hooks/install.js +2 -96
- package/dist/lib/hooks/match.d.ts +2 -1
- package/dist/lib/hosts/credential-transport.d.ts +0 -2
- package/dist/lib/hosts/credential-transport.js +1 -1
- package/dist/lib/hosts/dispatch.d.ts +2 -24
- package/dist/lib/hosts/dispatch.js +2 -2
- package/dist/lib/hosts/logs.d.ts +2 -1
- package/dist/lib/hosts/passthrough.d.ts +1 -1
- package/dist/lib/hosts/passthrough.js +0 -1
- package/dist/lib/hosts/progress.d.ts +0 -5
- package/dist/lib/hosts/progress.js +1 -1
- package/dist/lib/hosts/ready.d.ts +3 -4
- package/dist/lib/hosts/ready.js +0 -8
- package/dist/lib/hosts/reconcile.d.ts +2 -8
- package/dist/lib/hosts/reconcile.js +1 -1
- package/dist/lib/hosts/reconnect.d.ts +4 -11
- package/dist/lib/hosts/reconnect.js +2 -2
- package/dist/lib/hosts/registry.d.ts +1 -1
- package/dist/lib/hosts/remote-cmd.d.ts +55 -4
- package/dist/lib/hosts/remote-cmd.js +125 -8
- package/dist/lib/hosts/remote-cmd.test-fixture.d.ts +2 -0
- package/dist/lib/hosts/remote-cmd.test-fixture.js +22 -0
- package/dist/lib/hosts/session-index.d.ts +3 -2
- package/dist/lib/hosts/ssh-config.d.ts +2 -3
- package/dist/lib/hosts/ssh-config.js +0 -10
- package/dist/lib/humans.d.ts +0 -2
- package/dist/lib/humans.js +2 -2
- package/dist/lib/import.d.ts +4 -3
- package/dist/lib/installations/installation-lock.d.ts +0 -2
- package/dist/lib/installations/installation-lock.js +2 -2
- package/dist/lib/installations/launch-gate.d.ts +0 -9
- package/dist/lib/installations/launch-gate.js +1 -1
- package/dist/lib/installations/migrate.d.ts +0 -11
- package/dist/lib/installations/migrate.js +1 -1
- package/dist/lib/installations/shims.d.ts +1 -1
- package/dist/lib/installations/shims.js +2 -2
- package/dist/lib/installations/update-runtime.js +1 -1
- package/dist/lib/linear-cache.d.ts +2 -1
- package/dist/lib/linux-userns.d.ts +2 -3
- package/dist/lib/linux-userns.js +0 -4
- package/dist/lib/loop.d.ts +2 -1
- package/dist/lib/mailbox-gc.d.ts +2 -1
- package/dist/lib/mailbox-target.d.ts +2 -1
- package/dist/lib/mailbox.d.ts +0 -6
- package/dist/lib/mailbox.js +1 -1
- package/dist/lib/manifest.d.ts +0 -14
- package/dist/lib/manifest.js +2 -2
- package/dist/lib/mcp-registry.d.ts +2 -1
- package/dist/lib/mcp.js +17 -11
- package/dist/lib/memory.d.ts +2 -13
- package/dist/lib/memory.js +4 -4
- package/dist/lib/menubar/download-menubar.d.ts +0 -2
- package/dist/lib/menubar/download-menubar.js +1 -5
- package/dist/lib/menubar/install-menubar.d.ts +3 -14
- package/dist/lib/menubar/install-menubar.js +3 -3
- package/dist/lib/menubar/migrate-prefs.d.ts +53 -0
- package/dist/lib/menubar/migrate-prefs.js +168 -0
- package/dist/lib/menubar/resolve-version.d.ts +1 -9
- package/dist/lib/menubar/resolve-version.js +4 -4
- package/dist/lib/menubar/snapshot.d.ts +24 -2
- package/dist/lib/menubar/snapshot.js +26 -0
- package/dist/lib/model-tier-overrides.d.ts +3 -2
- package/dist/lib/monitors/config.d.ts +0 -2
- package/dist/lib/monitors/config.js +0 -4
- package/dist/lib/monitors/engine.d.ts +1 -1
- package/dist/lib/monitors/remote.d.ts +3 -2
- package/dist/lib/monitors/sources/webhook.d.ts +2 -15
- package/dist/lib/monitors/sources/webhook.js +1 -38
- package/dist/lib/monitors/state.d.ts +4 -7
- package/dist/lib/monitors/state.js +2 -2
- package/dist/lib/notify.d.ts +1 -1
- package/dist/lib/notify.js +1 -1
- package/dist/lib/onepassword.d.ts +5 -14
- package/dist/lib/onepassword.js +0 -64
- package/dist/lib/open-url.d.ts +3 -2
- package/dist/lib/openclaw-keychain.d.ts +4 -17
- package/dist/lib/openclaw-keychain.js +3 -33
- package/dist/lib/operator.d.ts +2 -2
- package/dist/lib/operator.js +1 -1
- package/dist/lib/output/git-output.d.ts +4 -14
- package/dist/lib/output/git-output.js +1 -1
- package/dist/lib/owner-message.d.ts +3 -29
- package/dist/lib/owner-message.js +3 -3
- package/dist/lib/packages/output-home.d.ts +2 -4
- package/dist/lib/packages/output-home.js +2 -2
- package/dist/lib/perf/db.d.ts +0 -2
- package/dist/lib/perf/db.js +2 -7
- package/dist/lib/permissions-registry.d.ts +2 -3
- package/dist/lib/permissions-registry.js +0 -4
- package/dist/lib/permissions.d.ts +6 -16
- package/dist/lib/permissions.js +2 -15
- package/dist/lib/picker.d.ts +6 -5
- package/dist/lib/placement.d.ts +3 -6
- package/dist/lib/placement.js +0 -17
- package/dist/lib/platform/posixpath.d.ts +2 -1
- package/dist/lib/platform/winpath.d.ts +2 -1
- package/dist/lib/plugins/plugin-marketplace.d.ts +2 -2
- package/dist/lib/plugins/plugin-marketplace.js +1 -1
- package/dist/lib/pr-land-detach.d.ts +2 -1
- package/dist/lib/probe.d.ts +4 -1
- package/dist/lib/probe.js +5 -2
- package/dist/lib/profiles-presets.d.ts +2 -1
- package/dist/lib/profiles.d.ts +3 -9
- package/dist/lib/profiles.js +1 -9
- package/dist/lib/project-doctor.d.ts +2 -1
- package/dist/lib/project-launch.d.ts +2 -2
- package/dist/lib/project-probe.d.ts +4 -3
- package/dist/lib/project-pull.d.ts +2 -1
- package/dist/lib/project-resources.d.ts +2 -2
- package/dist/lib/project-resources.js +1 -1
- package/dist/lib/project-root.d.ts +2 -6
- package/dist/lib/project-root.js +1 -1
- package/dist/lib/project-schedule.d.ts +2 -1
- package/dist/lib/project-status.d.ts +2 -16
- package/dist/lib/project-status.js +3 -3
- package/dist/lib/pwsh.d.ts +33 -0
- package/dist/lib/pwsh.js +56 -0
- package/dist/lib/reconcile-and-repair.d.ts +5 -4
- package/dist/lib/redact.d.ts +15 -1
- package/dist/lib/redact.js +105 -3
- package/dist/lib/refresh-coordinator.d.ts +2 -1
- package/dist/lib/refresh.d.ts +9 -4
- package/dist/lib/refresh.js +92 -72
- package/dist/lib/remote-agents-json.d.ts +3 -2
- package/dist/lib/reserved-stores.d.ts +0 -2
- package/dist/lib/reserved-stores.js +3 -5
- package/dist/lib/resource-content-diff.d.ts +0 -2
- package/dist/lib/resource-content-diff.js +1 -1
- package/dist/lib/resource-patterns.d.ts +2 -1
- package/dist/lib/resource-profiles.d.ts +2 -8
- package/dist/lib/resource-profiles.js +3 -27
- package/dist/lib/resources/workflows.d.ts +1 -1
- package/dist/lib/resources.d.ts +4 -9
- package/dist/lib/resources.js +1 -1
- package/dist/lib/routine-context.d.ts +2 -5
- package/dist/lib/routine-context.js +2 -2
- package/dist/lib/routine-notify-owner.d.ts +8 -7
- package/dist/lib/routine-notify-owner.js +5 -5
- package/dist/lib/routine-process-cleanup.d.ts +2 -1
- package/dist/lib/routine-readiness.d.ts +0 -2
- package/dist/lib/routine-readiness.js +0 -7
- package/dist/lib/routines-project.d.ts +3 -4
- package/dist/lib/routines-project.js +1 -1
- package/dist/lib/rules/compile.d.ts +3 -25
- package/dist/lib/rules/compile.js +1 -1
- package/dist/lib/rules/compose.d.ts +3 -9
- package/dist/lib/rules/rules.d.ts +4 -15
- package/dist/lib/rules/rules.js +1 -64
- package/dist/lib/run-defaults.d.ts +1 -1
- package/dist/lib/run-notify.d.ts +2 -1
- package/dist/lib/run-trace-sync.d.ts +1 -1
- package/dist/lib/run-trace-sync.js +1 -1
- package/dist/lib/scheduler.d.ts +2 -1
- package/dist/lib/scheduling/routines.d.ts +9 -21
- package/dist/lib/scheduling/routines.js +3 -46
- package/dist/lib/secrets-cli.d.ts +11 -0
- package/dist/lib/secrets-cli.js +30 -0
- package/dist/lib/secrets-client.d.ts +0 -17
- package/dist/lib/secrets-client.js +7 -28
- package/dist/lib/secrets-policy.d.ts +12 -17
- package/dist/lib/secrets-policy.js +5 -5
- package/dist/lib/secrets-types.d.ts +3 -2
- package/dist/lib/secrets-types.js +2 -1
- package/dist/lib/self-heal/checks/install-staging.js +1 -1
- package/dist/lib/self-heal/registry.d.ts +3 -2
- package/dist/lib/self-heal/types.d.ts +1 -1
- package/dist/lib/self-heal/types.js +1 -1
- package/dist/lib/self-update.d.ts +5 -5
- package/dist/lib/self-update.js +4 -4
- package/dist/lib/session/actor-sidecar.d.ts +3 -2
- package/dist/lib/session/artifacts.d.ts +0 -2
- package/dist/lib/session/artifacts.js +1 -1
- package/dist/lib/session/bash-command.d.ts +2 -7
- package/dist/lib/session/bundle.d.ts +4 -6
- package/dist/lib/session/bundle.js +1 -5
- package/dist/lib/session/cloud.d.ts +0 -4
- package/dist/lib/session/cloud.js +2 -15
- package/dist/lib/session/detached.d.ts +9 -1
- package/dist/lib/session/detached.js +31 -2
- package/dist/lib/session/digest.d.ts +2 -2
- package/dist/lib/session/digest.js +1 -1
- package/dist/lib/session/fork.d.ts +3 -2
- package/dist/lib/session/highlights.d.ts +6 -5
- package/dist/lib/session/hook-sessions.d.ts +2 -1
- package/dist/lib/session/host-link.d.ts +2 -1
- package/dist/lib/session/inject.d.ts +1 -1
- package/dist/lib/session/inject.js +1 -1
- package/dist/lib/session/insights.d.ts +3 -15
- package/dist/lib/session/insights.js +2 -2
- package/dist/lib/session/local-tmux-attach.d.ts +2 -18
- package/dist/lib/session/local-tmux-attach.js +1 -1
- package/dist/lib/session/migrations.d.ts +0 -1
- package/dist/lib/session/migrations.js +1 -1
- package/dist/lib/session/mirror.d.ts +5 -8
- package/dist/lib/session/mirror.js +2 -2
- package/dist/lib/session/parse.d.ts +1 -32
- package/dist/lib/session/parse.js +4 -4
- package/dist/lib/session/presence.d.ts +2 -1
- package/dist/lib/session/prompt.d.ts +3 -2
- package/dist/lib/session/prompt.js +38 -1
- package/dist/lib/session/recovery.d.ts +3 -2
- package/dist/lib/session/remote/peer-stream.d.ts +26 -7
- package/dist/lib/session/remote/peer-stream.js +35 -8
- package/dist/lib/session/remote/remote-bundle.d.ts +2 -1
- package/dist/lib/session/remote/remote-list.d.ts +5 -5
- package/dist/lib/session/remote/remote.d.ts +4 -3
- package/dist/lib/session/remote/watch.d.ts +2 -7
- package/dist/lib/session/remote/watch.js +3 -3
- package/dist/lib/session/remote-active.d.ts +2 -1
- package/dist/lib/session/render.d.ts +2 -2
- package/dist/lib/session/render.js +1 -1
- package/dist/lib/session/resume-owner.d.ts +1 -1
- package/dist/lib/session/resume-owner.js +1 -1
- package/dist/lib/session/run-names.d.ts +2 -1
- package/dist/lib/session/session-cache.d.ts +7 -26
- package/dist/lib/session/session-cache.js +2 -8
- package/dist/lib/session/share-html.d.ts +1 -21
- package/dist/lib/session/share-html.js +1 -1
- package/dist/lib/session/shell-programs.d.ts +2 -1
- package/dist/lib/session/state.d.ts +41 -8
- package/dist/lib/session/state.js +112 -11
- package/dist/lib/session/stream-render.d.ts +2 -1
- package/dist/lib/session/sync/agents.d.ts +0 -4
- package/dist/lib/session/sync/agents.js +0 -0
- package/dist/lib/session/sync/backend.d.ts +8 -8
- package/dist/lib/session/sync/backend.js +3 -3
- package/dist/lib/session/sync/managed-config.d.ts +0 -8
- package/dist/lib/session/sync/managed-key.d.ts +0 -2
- package/dist/lib/session/sync/managed-key.js +1 -1
- package/dist/lib/session/sync/provision.d.ts +1 -1
- package/dist/lib/session/sync/provision.js +2 -2
- package/dist/lib/session/sync/r2.d.ts +4 -1
- package/dist/lib/session/sync/r2.js +4 -7
- package/dist/lib/session/sync/transcript-crypto.d.ts +2 -1
- package/dist/lib/session/tail.d.ts +2 -1
- package/dist/lib/session/team-filter.d.ts +1 -1
- package/dist/lib/session/throughput.d.ts +2 -3
- package/dist/lib/session/throughput.js +1 -1
- package/dist/lib/session/timeline-pass.d.ts +3 -42
- package/dist/lib/session/timeline-pass.js +4 -4
- package/dist/lib/session/timeline.d.ts +3 -13
- package/dist/lib/session/timeline.js +3 -3
- package/dist/lib/session/tool-calls.d.ts +2 -2
- package/dist/lib/session/tool-calls.js +1 -1
- package/dist/lib/session/tool-index.d.ts +0 -8
- package/dist/lib/session/tool-index.js +2 -2
- package/dist/lib/session/tool-store.d.ts +2 -1
- package/dist/lib/session/trajectory-compare.d.ts +2 -1
- package/dist/lib/session/trajectory-lineage.d.ts +2 -1
- package/dist/lib/session/trajectory-text.d.ts +3 -2
- package/dist/lib/session/trajectory.d.ts +2 -1
- package/dist/lib/session/viewing-in.d.ts +2 -1
- package/dist/lib/sessions-client.js +0 -3
- package/dist/lib/settings-manifest.d.ts +2 -1
- package/dist/lib/setup-tool-install.d.ts +3 -0
- package/dist/lib/setup-tool-install.js +26 -0
- package/dist/lib/setup-tool-status.d.ts +22 -0
- package/dist/lib/setup-tool-status.js +215 -0
- package/dist/lib/share-runtime.d.ts +11 -0
- package/dist/lib/share-runtime.js +63 -0
- package/dist/lib/shim-heal.d.ts +1 -5
- package/dist/lib/shim-heal.js +0 -6
- package/dist/lib/smart-launch.d.ts +5 -10
- package/dist/lib/smart-launch.js +4 -12
- package/dist/lib/snapshot.d.ts +3 -2
- package/dist/lib/ssh-exec.d.ts +49 -4
- package/dist/lib/ssh-exec.js +119 -0
- package/dist/lib/ssh-tunnel.d.ts +3 -2
- package/dist/lib/staleness/checkers/permissions.d.ts +0 -2
- package/dist/lib/staleness/checkers/permissions.js +1 -1
- package/dist/lib/staleness/fingerprint.d.ts +0 -7
- package/dist/lib/staleness/fingerprint.js +1 -1
- package/dist/lib/staleness/prune.d.ts +3 -2
- package/dist/lib/staleness/registry.d.ts +1 -1
- package/dist/lib/staleness/writers/sources.d.ts +0 -8
- package/dist/lib/staleness/writers/sources.js +1 -1
- package/dist/lib/startup/command-registry.d.ts +6 -4
- package/dist/lib/startup/command-registry.js +11 -8
- package/dist/lib/state.d.ts +1 -3
- package/dist/lib/state.js +3 -6
- package/dist/lib/storage/selection.d.ts +2 -2
- package/dist/lib/storage/selection.js +2 -2
- package/dist/lib/subagents-registry.d.ts +4 -3
- package/dist/lib/subagents.d.ts +2 -1
- package/dist/lib/subagents.js +3 -2
- package/dist/lib/summarizer/pass.d.ts +3 -6
- package/dist/lib/summarizer/pass.js +2 -2
- package/dist/lib/summarizer/summarize.d.ts +4 -3
- package/dist/lib/sync-passphrase.d.ts +3 -2
- package/dist/lib/sync-status.d.ts +3 -16
- package/dist/lib/sync-status.js +2 -2
- package/dist/lib/sync-umbrella.d.ts +9 -3
- package/dist/lib/sync-umbrella.js +18 -10
- package/dist/lib/system-run-sync.d.ts +2 -1
- package/dist/lib/teams/agents.d.ts +2 -4
- package/dist/lib/teams/agents.js +1 -1
- package/dist/lib/teams/forEach.d.ts +3 -2
- package/dist/lib/teams/pr-watch.d.ts +4 -11
- package/dist/lib/teams/pr-watch.js +4 -4
- package/dist/lib/teams/registry.d.ts +2 -3
- package/dist/lib/teams/registry.js +1 -1
- package/dist/lib/teams/remoteWorktree.d.ts +0 -16
- package/dist/lib/teams/remoteWorktree.js +3 -3
- package/dist/lib/teams/scheduler.d.ts +6 -5
- package/dist/lib/teams/scheduler.js +1 -1
- package/dist/lib/teams/supervisor.d.ts +4 -3
- package/dist/lib/teams/worktree.d.ts +0 -9
- package/dist/lib/teams/worktree.js +0 -32
- package/dist/lib/term-client.d.ts +44 -0
- package/dist/lib/term-client.js +117 -0
- package/dist/lib/terminal/inject.d.ts +3 -16
- package/dist/lib/terminal/inject.js +1 -29
- package/dist/lib/terminal/resolve.d.ts +3 -9
- package/dist/lib/terminal/resolve.js +3 -7
- package/dist/lib/tmux/binary.d.ts +2 -1
- package/dist/lib/tmux/orphan-reap.d.ts +6 -7
- package/dist/lib/tmux/orphan-reap.js +1 -1
- package/dist/lib/tmux/session.d.ts +4 -3
- package/dist/lib/traces/backend.d.ts +1 -2
- package/dist/lib/traces/backend.js +1 -2
- package/dist/lib/traces/classify.d.ts +3 -2
- package/dist/lib/traces/config.d.ts +0 -8
- package/dist/lib/traces/insights.d.ts +2 -1
- package/dist/lib/traces/phenotype.d.ts +3 -3
- package/dist/lib/traces/provision.d.ts +2 -4
- package/dist/lib/traces/provision.js +3 -3
- package/dist/lib/traces/schema2-build.d.ts +1 -1
- package/dist/lib/traces/schema2-danger.d.ts +2 -1
- package/dist/lib/traces/schema2.d.ts +5 -4
- package/dist/lib/traces/segments.d.ts +4 -20
- package/dist/lib/traces/segments.js +3 -3
- package/dist/lib/traces/sync.d.ts +2 -3
- package/dist/lib/traces/sync.js +1 -1
- package/dist/lib/triggers/handlers.d.ts +4 -13
- package/dist/lib/triggers/handlers.js +1 -1
- package/dist/lib/triggers/webhook.d.ts +5 -27
- package/dist/lib/triggers/webhook.js +4 -4
- package/dist/lib/types.d.ts +11 -9
- package/dist/lib/usage-refresh.d.ts +4 -10
- package/dist/lib/usage-refresh.js +3 -8
- package/dist/lib/verbs.d.ts +2 -1
- package/dist/lib/version-duplicates.d.ts +2 -3
- package/dist/lib/version-duplicates.js +3 -33
- package/dist/lib/version.d.ts +2 -1
- package/dist/lib/warn-unpushed.d.ts +2 -1
- package/dist/lib/watchdog/history.d.ts +3 -2
- package/dist/lib/watchdog/log.d.ts +0 -6
- package/dist/lib/watchdog/log.js +1 -1
- package/dist/lib/watchdog/rotate.d.ts +2 -26
- package/dist/lib/watchdog/rotate.js +4 -12
- package/dist/lib/watchdog/runner.d.ts +0 -7
- package/dist/lib/watchdog/runner.js +4 -4
- package/dist/lib/watchdog/service.d.ts +2 -2
- package/dist/lib/watchdog/service.js +1 -1
- package/dist/lib/watchdog/watchdog-agent.d.ts +2 -1
- package/dist/lib/watchdog/watchdog.d.ts +2 -1
- package/dist/lib/watchdog/watchdogTail.d.ts +2 -1
- package/dist/lib/workflows-registry.d.ts +3 -2
- package/dist/lib/workflows.d.ts +4 -7
- package/dist/lib/workflows.js +1 -1
- package/dist/lib/worktree/held.d.ts +4 -28
- package/dist/lib/worktree/held.js +3 -3
- package/package.json +3 -5
- package/scripts/postinstall.js +5 -4
- package/dist/commands/artifacts-setup.d.ts +0 -53
- package/dist/commands/artifacts-setup.js +0 -161
- package/dist/commands/artifacts.d.ts +0 -18
- package/dist/commands/artifacts.js +0 -58
- package/dist/commands/attach.d.ts +0 -12
- package/dist/commands/attach.js +0 -86
- package/dist/commands/auth-mint.d.ts +0 -12
- package/dist/commands/auth-mint.js +0 -108
- package/dist/commands/pty.d.ts +0 -20
- package/dist/commands/pty.js +0 -404
- package/dist/commands/reconnect.d.ts +0 -46
- package/dist/commands/reconnect.js +0 -115
- package/dist/commands/share.d.ts +0 -293
- package/dist/commands/share.js +0 -1424
- package/dist/lib/config-machine-keys.d.ts +0 -14
- package/dist/lib/config-machine-keys.js +0 -21
- package/dist/lib/pty-client.d.ts +0 -49
- package/dist/lib/pty-client.js +0 -315
- package/dist/lib/pty-server.d.ts +0 -59
- package/dist/lib/pty-server.js +0 -653
- package/dist/lib/share/analytics.d.ts +0 -13
- package/dist/lib/share/analytics.js +0 -45
- package/dist/lib/share/backend.d.ts +0 -120
- package/dist/lib/share/backend.js +0 -176
- package/dist/lib/share/capture.d.ts +0 -31
- package/dist/lib/share/capture.js +0 -174
- package/dist/lib/share/config.d.ts +0 -72
- package/dist/lib/share/config.js +0 -211
- package/dist/lib/share/delete.d.ts +0 -122
- package/dist/lib/share/delete.js +0 -173
- package/dist/lib/share/html.d.ts +0 -22
- package/dist/lib/share/html.js +0 -88
- package/dist/lib/share/http-error.d.ts +0 -52
- package/dist/lib/share/http-error.js +0 -65
- package/dist/lib/share/og.d.ts +0 -25
- package/dist/lib/share/og.js +0 -84
- package/dist/lib/share/provision.d.ts +0 -127
- package/dist/lib/share/provision.js +0 -285
- package/dist/lib/share/publish.d.ts +0 -388
- package/dist/lib/share/publish.js +0 -818
- package/dist/lib/share/worker-template.d.ts +0 -27
- package/dist/lib/share/worker-template.js +0 -2424
- package/dist/lib/storage/index.d.ts +0 -14
- package/dist/lib/storage/index.js +0 -14
- package/dist/lib/storage/visibility.d.ts +0 -82
- package/dist/lib/storage/visibility.js +0 -99
|
@@ -41,7 +41,7 @@ import { resolveWatchdogSessionPath } from './read.js';
|
|
|
41
41
|
* two patterns cover the weekly/session variants, including claude's
|
|
42
42
|
* "You've hit your weekly limit · resets <time>" form.
|
|
43
43
|
*/
|
|
44
|
-
|
|
44
|
+
const ROTATE_LIMIT_PATTERNS = [
|
|
45
45
|
/you'?ve hit your [\w-]*\s?limit/i,
|
|
46
46
|
/hit your (weekly|daily|usage|session) limit/i,
|
|
47
47
|
/usage limit (has been )?(reached|exceeded)/i,
|
|
@@ -195,7 +195,7 @@ export const DEFAULT_ROTATE_FAILED_COOLDOWN_MS = 15 * 60_000;
|
|
|
195
195
|
function rotateDir(dir) {
|
|
196
196
|
return path.join(dir, 'rotate');
|
|
197
197
|
}
|
|
198
|
-
|
|
198
|
+
function rotateStatePath(dir, sessionId) {
|
|
199
199
|
return path.join(rotateDir(dir), `${sessionId}.json`);
|
|
200
200
|
}
|
|
201
201
|
export function readRotateState(dir, sessionId) {
|
|
@@ -216,14 +216,6 @@ export function writeRotateState(dir, state) {
|
|
|
216
216
|
/* best-effort: the tray tolerates a missing/partial state file */
|
|
217
217
|
}
|
|
218
218
|
}
|
|
219
|
-
export function clearRotateState(dir, sessionId) {
|
|
220
|
-
try {
|
|
221
|
-
fs.unlinkSync(rotateStatePath(dir, sessionId));
|
|
222
|
-
}
|
|
223
|
-
catch {
|
|
224
|
-
/* already gone */
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
219
|
/** A phase the machine still has work to do in (done/failed are terminal). */
|
|
228
220
|
export function isInflightPhase(phase) {
|
|
229
221
|
return phase !== 'done' && phase !== 'failed';
|
|
@@ -255,7 +247,7 @@ export function listInflightRotates(dir) {
|
|
|
255
247
|
* <watchdog-state>/rotate-skips.json: { [sessionId]: suppressUntilMs }. A skip
|
|
256
248
|
* inside the window logs nothing and touches nothing.
|
|
257
249
|
*/
|
|
258
|
-
|
|
250
|
+
function readRotateSkipLedger(dir) {
|
|
259
251
|
try {
|
|
260
252
|
return JSON.parse(fs.readFileSync(path.join(dir, 'rotate-skips.json'), 'utf8'));
|
|
261
253
|
}
|
|
@@ -330,7 +322,7 @@ const ROTATE_TRANSCRIPT_AGENTS = ['claude', 'codex', 'gemini', 'droid'];
|
|
|
330
322
|
* accepts a fresh active session (started after the rotate began), so a codex
|
|
331
323
|
* pick with an unknown id is still detected.
|
|
332
324
|
*/
|
|
333
|
-
|
|
325
|
+
function defaultRotateTranscriptLive(newSessionId) {
|
|
334
326
|
return ROTATE_TRANSCRIPT_AGENTS.some((agent) => resolveWatchdogSessionPath(newSessionId, agent) !== undefined);
|
|
335
327
|
}
|
|
336
328
|
/** Strip trailing slashes so `/repo` and `/repo/` correlate. */
|
|
@@ -50,8 +50,6 @@ export interface WatchdogThresholds {
|
|
|
50
50
|
dormantMs: number;
|
|
51
51
|
}
|
|
52
52
|
export declare const DEFAULT_THRESHOLDS: WatchdogThresholds;
|
|
53
|
-
/** The default nudge text — a short imperative, configurable via opts.nudgeText. */
|
|
54
|
-
export declare const DEFAULT_NUDGE_TEXT = "Continue.";
|
|
55
53
|
export interface WatchdogTickOptions {
|
|
56
54
|
/** Actually inject when a nudge is decided. Default false (dry status). */
|
|
57
55
|
nudge?: boolean;
|
|
@@ -205,11 +203,6 @@ export interface WatchdogTickResult {
|
|
|
205
203
|
transitions: PresenceTransition[];
|
|
206
204
|
};
|
|
207
205
|
}
|
|
208
|
-
/**
|
|
209
|
-
* On-disk per-session policy sentinel: `<stateDir>/policy/<sessionId>` whose
|
|
210
|
-
* contents are `off` | `keep` | `handsoff`. Absent / unreadable / unknown → keep.
|
|
211
|
-
*/
|
|
212
|
-
export declare function readPolicySentinel(dir: string, sessionId: string): WatchdogPolicy;
|
|
213
206
|
/** Write a per-session policy sentinel (used by the CLI `agents watchdog policy`). */
|
|
214
207
|
export declare function writePolicySentinel(dir: string, sessionId: string, policy: WatchdogPolicy): void;
|
|
215
208
|
/** A decision for one idle session. `text` overrides the default nudge text. */
|
|
@@ -58,7 +58,7 @@ export const DEFAULT_THRESHOLDS = {
|
|
|
58
58
|
dormantMs: WATCHDOG_DORMANT_MS,
|
|
59
59
|
};
|
|
60
60
|
/** The default nudge text — a short imperative, configurable via opts.nudgeText. */
|
|
61
|
-
|
|
61
|
+
const DEFAULT_NUDGE_TEXT = 'Continue.';
|
|
62
62
|
// --- state persistence ------------------------------------------------------
|
|
63
63
|
function watchdogStateDir(opts) {
|
|
64
64
|
return opts.stateDir ?? path.join(getRuntimeStateDir(), 'watchdog');
|
|
@@ -88,7 +88,7 @@ function readNudgeLedger(dir) {
|
|
|
88
88
|
* On-disk per-session policy sentinel: `<stateDir>/policy/<sessionId>` whose
|
|
89
89
|
* contents are `off` | `keep` | `handsoff`. Absent / unreadable / unknown → keep.
|
|
90
90
|
*/
|
|
91
|
-
|
|
91
|
+
function readPolicySentinel(dir, sessionId) {
|
|
92
92
|
if (!sessionId)
|
|
93
93
|
return 'keep';
|
|
94
94
|
let raw;
|
|
@@ -133,7 +133,7 @@ function planDelivery(session, chosenText, block, allowGhosttyFocus) {
|
|
|
133
133
|
const mailboxId = mailboxIdForActiveSession(session) ?? sessionId;
|
|
134
134
|
const resolution = resolveInjectTargetForSession(session, { allowGhosttyFocus });
|
|
135
135
|
const route = resolveAnswerRoute({ mailboxId, answer: chosenText, session, block });
|
|
136
|
-
// A precise split (tmux / iTerm / vscodium
|
|
136
|
+
// A precise split (tmux / iTerm / vscodium) is the authoritative target.
|
|
137
137
|
if (resolution.addressable) {
|
|
138
138
|
return { via: 'inject', rail: resolution.rail, target: resolution.target };
|
|
139
139
|
}
|
|
@@ -821,7 +821,7 @@ export async function runWatchdogTick(opts = {}) {
|
|
|
821
821
|
}
|
|
822
822
|
// Deliver. injectDryRun exercises the path without a real side effect: inject
|
|
823
823
|
// still calls injectFn (which honors dryRun), mailbox/resume are short-circuited.
|
|
824
|
-
// `confirmed` distinguishes a delivery we KNOW reached the agent (tmux/iterm
|
|
824
|
+
// `confirmed` distinguishes a delivery we KNOW reached the agent (tmux/iterm,
|
|
825
825
|
// mailbox, resume) from one merely dispatched (vscodium's fire-and-forget
|
|
826
826
|
// --open-url). Only a CONFIRMED delivery is booked as a landed nudge.
|
|
827
827
|
let delivered;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ActiveSession } from '../session/active.js';
|
|
2
2
|
import { type WatchdogThresholds, type WatchdogTickResult } from './runner.js';
|
|
3
|
-
|
|
3
|
+
interface WatchdogPassOptions {
|
|
4
4
|
nudge: boolean;
|
|
5
5
|
nudgeText?: string;
|
|
6
6
|
smartAgent?: string;
|
|
@@ -11,6 +11,6 @@ export interface WatchdogPassOptions {
|
|
|
11
11
|
mailboxGc?: boolean;
|
|
12
12
|
}
|
|
13
13
|
export declare function loadWatchdogSessions(): Promise<ActiveSession[]>;
|
|
14
|
-
export declare function runWatchdogMailboxGc(sessions: ActiveSession[]): void;
|
|
15
14
|
/** Execute one watchdog pass from the daemon or the explicit CLI command. */
|
|
16
15
|
export declare function runWatchdogPass(opts: WatchdogPassOptions): Promise<WatchdogTickResult>;
|
|
16
|
+
export {};
|
|
@@ -11,7 +11,7 @@ export async function loadWatchdogSessions() {
|
|
|
11
11
|
});
|
|
12
12
|
return loaded.sessions;
|
|
13
13
|
}
|
|
14
|
-
|
|
14
|
+
function runWatchdogMailboxGc(sessions) {
|
|
15
15
|
const activeBoxIds = new Set(sessions.map(mailboxIdForActiveSession).filter((id) => Boolean(id)));
|
|
16
16
|
try {
|
|
17
17
|
gcMailbox(activeBoxIds);
|
|
@@ -24,7 +24,7 @@ export type WatchdogAgentDecider = (candidates: WatchdogCandidate[]) => Promise<
|
|
|
24
24
|
* `runTarget` is the resolved `agents run` target (a `watchdog` workflow or the
|
|
25
25
|
* bare agent id).
|
|
26
26
|
*/
|
|
27
|
-
|
|
27
|
+
type WatchdogAgentRunner = (runTarget: string, prompt: string) => Promise<string>;
|
|
28
28
|
/**
|
|
29
29
|
* The default agent decider. `agent` is the harness the built-in prompt runs as
|
|
30
30
|
* (default 'claude'); `workflowCwd` is where a `watchdog` workflow override is
|
|
@@ -36,3 +36,4 @@ export declare function makeWatchdogAgentDecider(agent: string, opts?: {
|
|
|
36
36
|
workflowCwd?: string;
|
|
37
37
|
run?: WatchdogAgentRunner;
|
|
38
38
|
}): WatchdogAgentDecider;
|
|
39
|
+
export {};
|
|
@@ -33,7 +33,7 @@ export type StallStatus = {
|
|
|
33
33
|
kind: 'stalled';
|
|
34
34
|
stalledForMs: number;
|
|
35
35
|
};
|
|
36
|
-
|
|
36
|
+
interface ClassifyInput {
|
|
37
37
|
lastActivityMs: number;
|
|
38
38
|
nowMs: number;
|
|
39
39
|
lastNudgeMs: number | null;
|
|
@@ -47,3 +47,4 @@ export declare const WATCHDOG_SYSTEM_PROMPT = "You are the watchdog for AI codin
|
|
|
47
47
|
export declare function composePromptWithPlaybook(basePrompt: string, playbook: string): string;
|
|
48
48
|
export declare function renderWatchdogPrompt(candidates: WatchdogCandidate[], playbook?: string): string;
|
|
49
49
|
export declare function parseWatchdogResponse(stdout: string): Decision[];
|
|
50
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AgentId } from './types.js';
|
|
2
2
|
/** A central workflow bundle: its synced name and the source dir holding WORKFLOW.md. */
|
|
3
|
-
|
|
3
|
+
interface WorkflowSource {
|
|
4
4
|
name: string;
|
|
5
5
|
path: string;
|
|
6
6
|
}
|
|
@@ -8,7 +8,7 @@ export interface WorkflowSource {
|
|
|
8
8
|
* The complete on-disk contract for one harness's workflows. Every operation
|
|
9
9
|
* is expressed here so the engine below never branches on the agent id.
|
|
10
10
|
*/
|
|
11
|
-
|
|
11
|
+
interface WorkflowTarget {
|
|
12
12
|
/** Noun used in ownership errors, e.g. "Kimi skill", "Grok workflow". */
|
|
13
13
|
readonly label: string;
|
|
14
14
|
/**
|
|
@@ -69,3 +69,4 @@ export declare function removeWorkflowFromVersion(agent: AgentId, version: strin
|
|
|
69
69
|
* (surfaced as `missing` at the name level, not here).
|
|
70
70
|
*/
|
|
71
71
|
export declare function workflowContentMatches(agent: AgentId, versionHome: string, name: string, sourcePath: string): boolean;
|
|
72
|
+
export {};
|
package/dist/lib/workflows.d.ts
CHANGED
|
@@ -115,7 +115,7 @@ export interface WorkflowFrontmatter {
|
|
|
115
115
|
forEach?: ForEachSpec;
|
|
116
116
|
}
|
|
117
117
|
/** A workflow found during repo discovery. */
|
|
118
|
-
|
|
118
|
+
interface DiscoveredWorkflow {
|
|
119
119
|
name: string;
|
|
120
120
|
path: string;
|
|
121
121
|
frontmatter: WorkflowFrontmatter;
|
|
@@ -184,7 +184,7 @@ export interface ForEachTeammate {
|
|
|
184
184
|
keep_if?: 'majority' | 'all' | 'any';
|
|
185
185
|
}
|
|
186
186
|
/** Result of expanding a `for_each` spec: the teammates plus cap accounting. */
|
|
187
|
-
|
|
187
|
+
interface ForEachExpansion {
|
|
188
188
|
teammates: ForEachTeammate[];
|
|
189
189
|
/** How many items the producer emitted (pre-cap). */
|
|
190
190
|
producedCount: number;
|
|
@@ -240,10 +240,6 @@ export declare function resolveAllowedSubagents(available: string[], allowedAgen
|
|
|
240
240
|
allowedStems: string[];
|
|
241
241
|
missing: string[];
|
|
242
242
|
};
|
|
243
|
-
/** The Claude tool an orchestrator uses to dispatch subagents. Must stay in a
|
|
244
|
-
* workflow's `--tools` allowlist whenever the workflow ships dispatchable
|
|
245
|
-
* subagents, or the orchestrator has no way to reach them. */
|
|
246
|
-
export declare const SUBAGENT_DISPATCH_TOOL = "Task";
|
|
247
243
|
/**
|
|
248
244
|
* Keep the subagent-dispatch tool (`Task`) in a `tools:`-restricted workflow's
|
|
249
245
|
* allowlist when the workflow actually ships subagents to dispatch.
|
|
@@ -329,7 +325,7 @@ export declare function listPluginWorkflowDirs(cwd?: string, pluginName?: string
|
|
|
329
325
|
*/
|
|
330
326
|
export declare function isBareWorkflowName(ref: string): boolean;
|
|
331
327
|
/** Parsed `agents run` workflow reference (docs/07-entrypoints). */
|
|
332
|
-
|
|
328
|
+
interface ParsedWorkflowRef {
|
|
333
329
|
/** Workflow directory name (WORKFLOW.md parent). */
|
|
334
330
|
name: string;
|
|
335
331
|
/**
|
|
@@ -404,3 +400,4 @@ export declare function iterWorkflowsCapableVersions(filter?: {
|
|
|
404
400
|
agent: AgentId;
|
|
405
401
|
version: string;
|
|
406
402
|
}>;
|
|
403
|
+
export {};
|
package/dist/lib/workflows.js
CHANGED
|
@@ -281,7 +281,7 @@ export function resolveAllowedSubagents(available, allowedAgents) {
|
|
|
281
281
|
/** The Claude tool an orchestrator uses to dispatch subagents. Must stay in a
|
|
282
282
|
* workflow's `--tools` allowlist whenever the workflow ships dispatchable
|
|
283
283
|
* subagents, or the orchestrator has no way to reach them. */
|
|
284
|
-
|
|
284
|
+
const SUBAGENT_DISPATCH_TOOL = 'Task';
|
|
285
285
|
/**
|
|
286
286
|
* Keep the subagent-dispatch tool (`Task`) in a `tools:`-restricted workflow's
|
|
287
287
|
* allowlist when the workflow actually ships subagents to dispatch.
|
|
@@ -52,24 +52,6 @@ export interface HeldWorktree {
|
|
|
52
52
|
* silently comparing against nothing.
|
|
53
53
|
*/
|
|
54
54
|
export declare function resolveDefaultRef(repoRoot: string): Promise<string | null>;
|
|
55
|
-
/**
|
|
56
|
-
* Count commits with no patch-equivalent upstream. Returns -1 when the answer
|
|
57
|
-
* cannot be established, which the classifier treats as `merge-state-unknown`.
|
|
58
|
-
*
|
|
59
|
-
* Patch-id (`git cherry`), NOT ancestry, is load-bearing: this fleet
|
|
60
|
-
* rebase-merges, so a landed branch's SHAs are rewritten and
|
|
61
|
-
* `merge-base --is-ancestor` reports *not merged* for work that fully landed.
|
|
62
|
-
* It also subsumes the unpushed check — an unpushed commit has no upstream
|
|
63
|
-
* equivalent, so it surfaces as unmerged rather than needing a separate probe.
|
|
64
|
-
*/
|
|
65
|
-
export declare function countUnmergedCommits(worktreePath: string, defaultRef: string | null): Promise<number>;
|
|
66
|
-
/** One `git worktree list --porcelain` record. */
|
|
67
|
-
interface PorcelainEntry {
|
|
68
|
-
path: string;
|
|
69
|
-
branch: string | null;
|
|
70
|
-
detached: boolean;
|
|
71
|
-
}
|
|
72
|
-
export declare function parseWorktreePorcelain(out: string): PorcelainEntry[];
|
|
73
55
|
/**
|
|
74
56
|
* True when `child` is `parent` or sits beneath it, compared on path
|
|
75
57
|
* boundaries. A raw `startsWith` makes `.../fix-1103` look like it is inside
|
|
@@ -77,7 +59,7 @@ export declare function parseWorktreePorcelain(out: string): PorcelainEntry[];
|
|
|
77
59
|
*/
|
|
78
60
|
export declare function isInside(child: string, parent: string): boolean;
|
|
79
61
|
/** Everything the bucket decision depends on, gathered once. */
|
|
80
|
-
|
|
62
|
+
interface HeldFacts {
|
|
81
63
|
/** null for detached HEAD. */
|
|
82
64
|
branch: string | null;
|
|
83
65
|
/** `git status --porcelain` line count; -1 = could not read. */
|
|
@@ -107,16 +89,10 @@ export declare function classifyHeld(facts: HeldFacts): {
|
|
|
107
89
|
* a `.agents/worktrees` slug, so it is skipped implicitly.
|
|
108
90
|
*/
|
|
109
91
|
export declare function collectHeldWorktrees(repoRoot: string): Promise<HeldWorktree[]>;
|
|
110
|
-
/**
|
|
111
|
-
* Discover repo roots that own a `.agents/worktrees` container beneath
|
|
112
|
-
* `searchHome`. Mirrors the sweep's discovery: match directory SHAPE, prune the
|
|
113
|
-
* heavy dirs so a large home stays fast. Read-only.
|
|
114
|
-
*/
|
|
115
|
-
export declare function discoverWorktreeRepos(searchHome: string, maxDepth?: number): Promise<string[]>;
|
|
116
92
|
/** Discover + classify every held worktree beneath `searchHome`. Read-only. */
|
|
117
93
|
export declare function collectHeldWorktreesUnder(searchHome: string): Promise<HeldWorktree[]>;
|
|
118
94
|
/** A held set grouped by bucket, with the itemised entries kept. */
|
|
119
|
-
|
|
95
|
+
interface HeldSummary {
|
|
120
96
|
total: number;
|
|
121
97
|
buckets: Record<HeldBucket, HeldWorktree[]>;
|
|
122
98
|
}
|
|
@@ -128,7 +104,7 @@ export interface DeviceHeld {
|
|
|
128
104
|
held: HeldWorktree[];
|
|
129
105
|
}
|
|
130
106
|
/** A fleet-wide roll-up: every device's held worktrees, still bucketed. Pure. */
|
|
131
|
-
|
|
107
|
+
interface FleetHeldSummary extends HeldSummary {
|
|
132
108
|
devices: {
|
|
133
109
|
device: string;
|
|
134
110
|
total: number;
|
|
@@ -142,7 +118,7 @@ export interface FleetHeldSummary extends HeldSummary {
|
|
|
142
118
|
*/
|
|
143
119
|
export declare function aggregateHeld(perDevice: DeviceHeld[]): FleetHeldSummary;
|
|
144
120
|
/** Outcome of the safe recovery action on one stranded worktree. */
|
|
145
|
-
|
|
121
|
+
interface PushResult {
|
|
146
122
|
name: string;
|
|
147
123
|
branch: string | null;
|
|
148
124
|
pushed: boolean;
|
|
@@ -66,7 +66,7 @@ export async function resolveDefaultRef(repoRoot) {
|
|
|
66
66
|
* It also subsumes the unpushed check — an unpushed commit has no upstream
|
|
67
67
|
* equivalent, so it surfaces as unmerged rather than needing a separate probe.
|
|
68
68
|
*/
|
|
69
|
-
|
|
69
|
+
async function countUnmergedCommits(worktreePath, defaultRef) {
|
|
70
70
|
if (!defaultRef)
|
|
71
71
|
return -1;
|
|
72
72
|
try {
|
|
@@ -79,7 +79,7 @@ export async function countUnmergedCommits(worktreePath, defaultRef) {
|
|
|
79
79
|
return -1;
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
|
-
|
|
82
|
+
function parseWorktreePorcelain(out) {
|
|
83
83
|
const entries = [];
|
|
84
84
|
let cur = null;
|
|
85
85
|
for (const line of out.split('\n')) {
|
|
@@ -244,7 +244,7 @@ export async function collectHeldWorktrees(repoRoot) {
|
|
|
244
244
|
* `searchHome`. Mirrors the sweep's discovery: match directory SHAPE, prune the
|
|
245
245
|
* heavy dirs so a large home stays fast. Read-only.
|
|
246
246
|
*/
|
|
247
|
-
|
|
247
|
+
async function discoverWorktreeRepos(searchHome, maxDepth = 7) {
|
|
248
248
|
const PRUNE = new Set([
|
|
249
249
|
'node_modules', '.cache', '.npm', '.bun', 'Library', '.venv', 'dist', 'target', '.git',
|
|
250
250
|
]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@phnx-labs/agents-cli",
|
|
3
|
-
"version": "1.22.
|
|
3
|
+
"version": "1.22.115",
|
|
4
4
|
"description": "One CLI for all your AI coding agents - versions, config, cloud dispatch, sessions, and teams (now with first-class Grok Build CLI support)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -16,8 +16,7 @@
|
|
|
16
16
|
},
|
|
17
17
|
"bin": {
|
|
18
18
|
"agents": "dist/index.js",
|
|
19
|
-
"ag": "dist/index.js"
|
|
20
|
-
"browser": "dist/browser.js"
|
|
19
|
+
"ag": "dist/index.js"
|
|
21
20
|
},
|
|
22
21
|
"files": [
|
|
23
22
|
"dist/**/*.js",
|
|
@@ -87,11 +86,9 @@
|
|
|
87
86
|
"dependencies": {
|
|
88
87
|
"@fontsource/inter": "^5.3.0",
|
|
89
88
|
"@fontsource/jetbrains-mono": "^5.3.0",
|
|
90
|
-
"@homebridge/node-pty-prebuilt-multiarch": "0.14.1",
|
|
91
89
|
"@inquirer/prompts": "8.5.2",
|
|
92
90
|
"@resvg/resvg-wasm": "^2.6.2",
|
|
93
91
|
"@types/proper-lockfile": "4.1.4",
|
|
94
|
-
"@xterm/headless": "6.0.0",
|
|
95
92
|
"@zed-industries/agent-client-protocol": "0.4.5",
|
|
96
93
|
"acorn": "8.18.0",
|
|
97
94
|
"aws4fetch": "1.0.20",
|
|
@@ -115,6 +112,7 @@
|
|
|
115
112
|
"yoga-wasm-web": "^0.3.3"
|
|
116
113
|
},
|
|
117
114
|
"devDependencies": {
|
|
115
|
+
"@homebridge/node-pty-prebuilt-multiarch": "0.14.1",
|
|
118
116
|
"@types/diff": "8.0.0",
|
|
119
117
|
"@types/marked-terminal": "6.1.1",
|
|
120
118
|
"@types/node": "26.1.0",
|
package/scripts/postinstall.js
CHANGED
|
@@ -50,15 +50,16 @@ function shellQuote(value) {
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
// Shorthands that delegate to the installed agents-cli entrypoint.
|
|
53
|
-
const ALIASES = ['browser', '
|
|
53
|
+
const ALIASES = ['browser', 'teams'];
|
|
54
54
|
|
|
55
55
|
// Aliases this script USED to write and must now remove on every install.
|
|
56
|
-
// `secrets` (PHNX-3989)
|
|
57
|
-
//
|
|
56
|
+
// `secrets` (PHNX-3989), `sessions` (PHNX-4012), and `pty` (PHNX-4091): those
|
|
57
|
+
// names belong to standalone CLIs now (`pty` -> `@phnx-labs/term-cli`'s
|
|
58
|
+
// `term`). An alias shim that `exec`s `agents <name>` re-enters the
|
|
58
59
|
// passthrough and shadows the real binary because the shims dir sits first on
|
|
59
60
|
// PATH — the 1.22.85 fork bomb. Postinstall is the upgrade path that actually
|
|
60
61
|
// runs, so it prunes here.
|
|
61
|
-
const RETIRED_ALIASES = ['secrets', 'sessions'];
|
|
62
|
+
const RETIRED_ALIASES = ['secrets', 'sessions', 'pty'];
|
|
62
63
|
|
|
63
64
|
function removeRetiredAliasShims() {
|
|
64
65
|
for (const name of RETIRED_ALIASES) {
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `agents artifacts setup` — configure the artifact share endpoint (Cloudflare
|
|
3
|
-
* R2 + Worker) that backs `agents artifacts share`.
|
|
4
|
-
*
|
|
5
|
-
* One door, two modes, because it replaces two commands that used to be
|
|
6
|
-
* separate (RUSH-2580): the interactive wizard formerly at `agents setup share`
|
|
7
|
-
* and the flag-driven provisioner formerly at `agents share setup`. On a TTY
|
|
8
|
-
* with no provisioning flags TYPED it runs the wizard (provision or join, and
|
|
9
|
-
* offers a Worker update when an endpoint already exists); with any provisioning
|
|
10
|
-
* flag typed, or on a non-TTY, it provisions directly. Both modes call the same
|
|
11
|
-
* `runShareProvision` / `runShareJoin` in commands/share.ts, so there is a
|
|
12
|
-
* single source of truth for provisioning.
|
|
13
|
-
*
|
|
14
|
-
* "Typed", not "present", is load-bearing — see {@link isDirectProvisionRequest}.
|
|
15
|
-
*
|
|
16
|
-
* Idempotent: re-running shows the current endpoint and offers to reconfigure.
|
|
17
|
-
*/
|
|
18
|
-
import type { Command } from 'commander';
|
|
19
|
-
/**
|
|
20
|
-
* Interactive share setup. Returns true if the user configured (or already had)
|
|
21
|
-
* an endpoint, false if they skipped. Never throws on user cancel — callers
|
|
22
|
-
* (the `agents setup` hub) rely on that to keep the fresh-machine flow going.
|
|
23
|
-
*/
|
|
24
|
-
export declare function runShareWizard(): Promise<boolean>;
|
|
25
|
-
/** Parsed `agents artifacts setup` options — the retired `agents share setup` flag set. */
|
|
26
|
-
interface ArtifactsSetupOpts {
|
|
27
|
-
bundle: string;
|
|
28
|
-
worker: string;
|
|
29
|
-
bucket: string;
|
|
30
|
-
account?: string;
|
|
31
|
-
token?: string;
|
|
32
|
-
domain?: string;
|
|
33
|
-
analyticsToken?: string;
|
|
34
|
-
}
|
|
35
|
-
/** The provisioning flags, by their commander option-value keys. */
|
|
36
|
-
declare const PROVISION_FLAGS: readonly ["bundle", "worker", "bucket", "account", "token", "domain", "analyticsToken"];
|
|
37
|
-
/**
|
|
38
|
-
* True when the invocation named a Cloudflare endpoint detail, i.e. the caller
|
|
39
|
-
* is driving the old `agents share setup` provisioning path rather than asking
|
|
40
|
-
* for the wizard.
|
|
41
|
-
*
|
|
42
|
-
* `--bundle`/`--worker`/`--bucket` carry commander defaults, so their mere
|
|
43
|
-
* PRESENCE proves nothing — the question is whether the user typed them, which
|
|
44
|
-
* only `wasTyped` (backed by commander's `getOptionValueSource`) can answer.
|
|
45
|
-
* Reading presence alone would classify `agents artifacts setup --bundle
|
|
46
|
-
* cloudflare-work` as a wizard run and then silently provision against the
|
|
47
|
-
* DEFAULT bundle, i.e. someone else's Cloudflare account. The other four flags
|
|
48
|
-
* have no default, so presence is proof for them.
|
|
49
|
-
*/
|
|
50
|
-
export declare function isDirectProvisionRequest(opts: ArtifactsSetupOpts, wasTyped?: (flag: (typeof PROVISION_FLAGS)[number]) => boolean): boolean;
|
|
51
|
-
/** Register `agents artifacts setup` under the parent `artifacts` command. */
|
|
52
|
-
export declare function registerArtifactsSetupCommand(artifactsCmd: Command): void;
|
|
53
|
-
export {};
|
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `agents artifacts setup` — configure the artifact share endpoint (Cloudflare
|
|
3
|
-
* R2 + Worker) that backs `agents artifacts share`.
|
|
4
|
-
*
|
|
5
|
-
* One door, two modes, because it replaces two commands that used to be
|
|
6
|
-
* separate (RUSH-2580): the interactive wizard formerly at `agents setup share`
|
|
7
|
-
* and the flag-driven provisioner formerly at `agents share setup`. On a TTY
|
|
8
|
-
* with no provisioning flags TYPED it runs the wizard (provision or join, and
|
|
9
|
-
* offers a Worker update when an endpoint already exists); with any provisioning
|
|
10
|
-
* flag typed, or on a non-TTY, it provisions directly. Both modes call the same
|
|
11
|
-
* `runShareProvision` / `runShareJoin` in commands/share.ts, so there is a
|
|
12
|
-
* single source of truth for provisioning.
|
|
13
|
-
*
|
|
14
|
-
* "Typed", not "present", is load-bearing — see {@link isDirectProvisionRequest}.
|
|
15
|
-
*
|
|
16
|
-
* Idempotent: re-running shows the current endpoint and offers to reconfigure.
|
|
17
|
-
*/
|
|
18
|
-
import chalk from 'chalk';
|
|
19
|
-
import { DEFAULT_BUCKET_NAME, DEFAULT_CF_BUNDLE, DEFAULT_SHARE_DOMAIN, DEFAULT_WORKER_NAME, readShareConfig, } from '../lib/share/config.js';
|
|
20
|
-
import { runShareProvision, runShareJoin, runShareUpdate, shareTemplateStatus } from './share.js';
|
|
21
|
-
import { isInteractiveTerminal, isPromptCancelled } from './utils.js';
|
|
22
|
-
/**
|
|
23
|
-
* Interactive share setup. Returns true if the user configured (or already had)
|
|
24
|
-
* an endpoint, false if they skipped. Never throws on user cancel — callers
|
|
25
|
-
* (the `agents setup` hub) rely on that to keep the fresh-machine flow going.
|
|
26
|
-
*/
|
|
27
|
-
export async function runShareWizard() {
|
|
28
|
-
if (!isInteractiveTerminal()) {
|
|
29
|
-
console.error(chalk.red('The artifact share wizard needs an interactive terminal. ' +
|
|
30
|
-
'Non-interactively, use `agents artifacts setup --account <id> --token <t>` (provision) ' +
|
|
31
|
-
'or `agents artifacts share join <baseUrl> --token <t>`.'));
|
|
32
|
-
return false;
|
|
33
|
-
}
|
|
34
|
-
const existing = readShareConfig();
|
|
35
|
-
if (existing) {
|
|
36
|
-
console.log(chalk.dim(`Share is already configured → ${chalk.green(existing.baseUrl)}`));
|
|
37
|
-
console.log(chalk.dim(` worker ${existing.workerName} · bucket ${existing.bucketName} · account ${existing.accountId}`));
|
|
38
|
-
const templateStatus = shareTemplateStatus(existing);
|
|
39
|
-
console.log(chalk.dim(` template ${templateStatus}`));
|
|
40
|
-
const { select } = await import('@inquirer/prompts');
|
|
41
|
-
const action = await select({
|
|
42
|
-
message: 'Share is already configured. What do you want to do?',
|
|
43
|
-
choices: [
|
|
44
|
-
{ name: 'Keep as is', value: 'keep' },
|
|
45
|
-
{
|
|
46
|
-
name: 'Update the deployed Worker to the latest template',
|
|
47
|
-
value: 'update',
|
|
48
|
-
description: templateStatus === 'current'
|
|
49
|
-
? 'Already current — this re-deploys anyway and refreshes the token in place.'
|
|
50
|
-
: 'Re-deploys the Worker script on your existing endpoint (same account/worker/bucket, same write token).',
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
name: 'Reconfigure from scratch (provision or join again)',
|
|
54
|
-
value: 'reconfigure',
|
|
55
|
-
},
|
|
56
|
-
],
|
|
57
|
-
default: templateStatus === 'outdated' || templateStatus === 'unknown' ? 'update' : 'keep',
|
|
58
|
-
});
|
|
59
|
-
if (action === 'keep') {
|
|
60
|
-
console.log(chalk.dim('Keeping the current endpoint.'));
|
|
61
|
-
return true;
|
|
62
|
-
}
|
|
63
|
-
if (action === 'update') {
|
|
64
|
-
// When the template is already current, the description below promises a
|
|
65
|
-
// re-deploy anyway — force it, or runShareUpdate's own no-op would silently
|
|
66
|
-
// contradict what was just said.
|
|
67
|
-
const result = await runShareUpdate({ force: templateStatus === 'current' });
|
|
68
|
-
console.log(result.updated
|
|
69
|
-
? chalk.green(`Worker '${result.workerName}' updated → template ${result.templateHash.slice(0, 12)}…`)
|
|
70
|
-
: chalk.dim(`Worker '${result.workerName}' already matches the current template — no-op.`));
|
|
71
|
-
return true;
|
|
72
|
-
}
|
|
73
|
-
// action === 'reconfigure' — fall through to the provision/join flow below.
|
|
74
|
-
}
|
|
75
|
-
const { select } = await import('@inquirer/prompts');
|
|
76
|
-
const mode = await select({
|
|
77
|
-
message: 'How do you want to publish shared links?',
|
|
78
|
-
choices: [
|
|
79
|
-
{
|
|
80
|
-
name: 'Provision my own (Cloudflare R2 + Worker)',
|
|
81
|
-
value: 'provision',
|
|
82
|
-
description: 'One-time: creates a bucket + Worker on your Cloudflare account (~$0). Needs a Cloudflare API token.',
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
name: 'Join an existing endpoint (a teammate already provisioned one)',
|
|
86
|
-
value: 'join',
|
|
87
|
-
description: 'Use synced config when present, or paste the base URL + write token from the endpoint owner.',
|
|
88
|
-
},
|
|
89
|
-
],
|
|
90
|
-
});
|
|
91
|
-
if (mode === 'provision') {
|
|
92
|
-
await runShareProvision({
|
|
93
|
-
bundle: DEFAULT_CF_BUNDLE,
|
|
94
|
-
worker: DEFAULT_WORKER_NAME,
|
|
95
|
-
bucket: DEFAULT_BUCKET_NAME,
|
|
96
|
-
});
|
|
97
|
-
return true;
|
|
98
|
-
}
|
|
99
|
-
const { input } = await import('@inquirer/prompts');
|
|
100
|
-
const baseUrl = await input({
|
|
101
|
-
message: 'Endpoint base URL (e.g. https://share.getrush.ai)',
|
|
102
|
-
validate: (v) => (v.trim().startsWith('http') ? true : 'Enter the full https:// URL of the endpoint.'),
|
|
103
|
-
});
|
|
104
|
-
await runShareJoin(baseUrl.trim());
|
|
105
|
-
return true;
|
|
106
|
-
}
|
|
107
|
-
/** The provisioning flags, by their commander option-value keys. */
|
|
108
|
-
const PROVISION_FLAGS = ['bundle', 'worker', 'bucket', 'account', 'token', 'domain', 'analyticsToken'];
|
|
109
|
-
/**
|
|
110
|
-
* True when the invocation named a Cloudflare endpoint detail, i.e. the caller
|
|
111
|
-
* is driving the old `agents share setup` provisioning path rather than asking
|
|
112
|
-
* for the wizard.
|
|
113
|
-
*
|
|
114
|
-
* `--bundle`/`--worker`/`--bucket` carry commander defaults, so their mere
|
|
115
|
-
* PRESENCE proves nothing — the question is whether the user typed them, which
|
|
116
|
-
* only `wasTyped` (backed by commander's `getOptionValueSource`) can answer.
|
|
117
|
-
* Reading presence alone would classify `agents artifacts setup --bundle
|
|
118
|
-
* cloudflare-work` as a wizard run and then silently provision against the
|
|
119
|
-
* DEFAULT bundle, i.e. someone else's Cloudflare account. The other four flags
|
|
120
|
-
* have no default, so presence is proof for them.
|
|
121
|
-
*/
|
|
122
|
-
export function isDirectProvisionRequest(opts, wasTyped = () => false) {
|
|
123
|
-
if (opts.account || opts.token || opts.domain || opts.analyticsToken)
|
|
124
|
-
return true;
|
|
125
|
-
return PROVISION_FLAGS.some((flag) => wasTyped(flag));
|
|
126
|
-
}
|
|
127
|
-
/** Register `agents artifacts setup` under the parent `artifacts` command. */
|
|
128
|
-
export function registerArtifactsSetupCommand(artifactsCmd) {
|
|
129
|
-
artifactsCmd
|
|
130
|
-
.command('setup')
|
|
131
|
-
.description('Provision (or join) the Cloudflare R2 + Worker endpoint that backs `agents artifacts share`.')
|
|
132
|
-
.option('--bundle <name>', 'secrets bundle holding the Cloudflare API token', DEFAULT_CF_BUNDLE)
|
|
133
|
-
.option('--worker <name>', 'Worker name', DEFAULT_WORKER_NAME)
|
|
134
|
-
.option('--bucket <name>', 'R2 bucket name', DEFAULT_BUCKET_NAME)
|
|
135
|
-
.option('--account <id>', 'Cloudflare account id (else read from the bundle / prompt)')
|
|
136
|
-
.option('--token <t>', 'Cloudflare API token (else read from the --bundle)')
|
|
137
|
-
.option('--domain <host>', `custom domain to map (default: ${DEFAULT_SHARE_DOMAIN}; workers.dev if zone is not visible)`)
|
|
138
|
-
.option('--analytics-token <token>', 'Cloudflare Web Analytics token to inject into published HTML pages')
|
|
139
|
-
.action(async (opts, cmd) => {
|
|
140
|
-
try {
|
|
141
|
-
// Named endpoint details, or no terminal to prompt on, means provision
|
|
142
|
-
// directly — the wizard has nothing to ask that was not already given,
|
|
143
|
-
// and it would provision against its own hardcoded defaults, dropping
|
|
144
|
-
// whatever the caller named.
|
|
145
|
-
const wasTyped = (flag) => cmd.getOptionValueSource(flag) === 'cli';
|
|
146
|
-
if (isDirectProvisionRequest(opts, wasTyped) || !isInteractiveTerminal()) {
|
|
147
|
-
await runShareProvision(opts);
|
|
148
|
-
return;
|
|
149
|
-
}
|
|
150
|
-
await runShareWizard();
|
|
151
|
-
}
|
|
152
|
-
catch (err) {
|
|
153
|
-
if (isPromptCancelled(err)) {
|
|
154
|
-
console.log(chalk.yellow('\nCancelled'));
|
|
155
|
-
return;
|
|
156
|
-
}
|
|
157
|
-
console.error(chalk.red(err.message));
|
|
158
|
-
process.exitCode = 1;
|
|
159
|
-
}
|
|
160
|
-
});
|
|
161
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `agents artifacts` — the group that owns everything an agent publishes for a
|
|
3
|
-
* human to open: HTML plans, reports, rendered visuals, screenshots.
|
|
4
|
-
*
|
|
5
|
-
* RUSH-2580 nested the former top-level `agents share` here. `artifacts` is the
|
|
6
|
-
* noun, `share` is the action on it, so the surface reads noun-then-action like
|
|
7
|
-
* the rest of the CLI:
|
|
8
|
-
*
|
|
9
|
-
* agents artifacts share <file> publish
|
|
10
|
-
* agents artifacts share list|delete|analytics|join|status|update
|
|
11
|
-
* agents artifacts setup provision (or join) the endpoint
|
|
12
|
-
*
|
|
13
|
-
* The subtree itself lives in commands/share.ts (publish + its subcommands) and
|
|
14
|
-
* commands/artifacts-setup.ts (the provisioning door); this module only assembles
|
|
15
|
-
* the group, so there is one place that says what `agents artifacts` contains.
|
|
16
|
-
*/
|
|
17
|
-
import type { Command } from 'commander';
|
|
18
|
-
export declare function registerArtifactsCommands(program: Command): void;
|