@phnx-labs/agents-cli 1.22.112 → 1.22.114
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 +37 -0
- package/README.md +10 -11
- package/dist/cli/command-registry.d.ts +0 -60
- package/dist/cli/command-registry.js +59 -61
- package/dist/commands/apply.d.ts +0 -4
- package/dist/commands/apply.js +3 -3
- 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/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/feed.d.ts +3 -3
- package/dist/commands/feed.js +1 -1
- package/dist/commands/focus.d.ts +4 -4
- 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/message.d.ts +1 -1
- package/dist/commands/message.js +3 -3
- package/dist/commands/projects.d.ts +2 -18
- package/dist/commands/projects.js +89 -3
- package/dist/commands/resource-view.d.ts +3 -2
- package/dist/commands/resume.d.ts +0 -1
- package/dist/commands/resume.js +1 -1
- 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 +21 -2
- package/dist/commands/sessions-backfill.d.ts +2 -35
- package/dist/commands/sessions-backfill.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 -5
- 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 +14 -104
- package/dist/commands/sessions.js +22 -10
- package/dist/commands/setup-mine.d.ts +0 -6
- package/dist/commands/setup-mine.js +1 -1
- package/dist/commands/setup.d.ts +3 -4
- package/dist/commands/setup.js +1 -1
- package/dist/commands/share.d.ts +8 -8
- 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 +1 -1
- package/dist/commands/tmux.d.ts +1 -1
- package/dist/commands/tmux.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/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/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 +5 -5
- 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 +4 -4
- package/dist/lib/browser/service.d.ts +4 -4
- 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 +1 -1
- 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/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/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-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 -12
- package/dist/lib/daemon/daemon.js +42 -23
- 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/testdata/process-view-daemon.d.ts +1 -0
- package/dist/lib/daemon/testdata/process-view-daemon.js +14 -0
- package/dist/lib/daemon/testdata/process-view-start.d.ts +1 -0
- package/dist/lib/daemon/testdata/process-view-start.js +43 -0
- package/dist/lib/daemon-services.d.ts +2 -1
- 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 +2 -1
- 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 +4 -1
- package/dist/lib/event-provenance.js +4 -0
- 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 +28 -8
- 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 +11 -2
- package/dist/lib/feed/activity.d.ts +16 -33
- package/dist/lib/feed/activity.js +69 -26
- package/dist/lib/feed/answer.d.ts +3 -2
- package/dist/lib/feed/attention.js +5 -1
- package/dist/lib/feed/events.d.ts +2 -47
- package/dist/lib/feed/events.js +1 -141
- package/dist/lib/feed/feed.d.ts +9 -42
- package/dist/lib/feed/feed.js +1 -60
- package/dist/lib/feed/pr-status.d.ts +0 -2
- package/dist/lib/feed/pr-status.js +1 -5
- package/dist/lib/feed/watch.d.ts +10 -2
- package/dist/lib/feed/watch.js +91 -4
- 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 +2 -2
- 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 +2 -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 -65
- package/dist/lib/git.js +3 -142
- 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 -34
- package/dist/lib/hosts/dispatch.js +4 -21
- 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 +4 -3
- package/dist/lib/hosts/remote-session-id.d.ts +5 -27
- package/dist/lib/hosts/remote-session-id.js +18 -61
- 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/launch-identity.d.ts +10 -0
- package/dist/lib/launch-identity.js +31 -0
- 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/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/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/reconcile-and-repair.d.ts +5 -4
- package/dist/lib/redact.d.ts +7 -1
- package/dist/lib/redact.js +94 -3
- package/dist/lib/refresh-coordinator.d.ts +2 -1
- package/dist/lib/refresh.d.ts +3 -2
- 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-client.d.ts +0 -17
- package/dist/lib/secrets-client.js +4 -26
- 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/active.js +9 -3
- 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/db.d.ts +2 -1
- package/dist/lib/session/db.js +39 -4
- package/dist/lib/session/detached.d.ts +2 -1
- package/dist/lib/session/detached.js +2 -2
- package/dist/lib/session/digest.d.ts +2 -2
- package/dist/lib/session/digest.js +1 -1
- package/dist/lib/session/discover.js +7 -2
- 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 +12 -1
- package/dist/lib/session/hook-sessions.js +139 -6
- 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/pid-registry.d.ts +18 -5
- package/dist/lib/session/pid-registry.js +164 -17
- package/dist/lib/session/presence.d.ts +2 -1
- package/dist/lib/session/process-view.d.ts +25 -0
- package/dist/lib/session/process-view.js +176 -0
- package/dist/lib/session/projection.d.ts +13 -0
- package/dist/lib/session/projection.js +101 -0
- 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 +2 -5
- package/dist/lib/session/remote/peer-stream.js +2 -2
- 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 +10 -7
- package/dist/lib/session/remote/watch.js +10 -6
- 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 +17 -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 +5 -5
- 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/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/testdata/pid-registry-namespace.d.ts +1 -0
- package/dist/lib/session/testdata/pid-registry-namespace.js +27 -0
- package/dist/lib/session/testdata/process-view-namespace.d.ts +1 -0
- package/dist/lib/session/testdata/process-view-namespace.js +56 -0
- package/dist/lib/session/testdata/process-view-private.d.ts +1 -0
- package/dist/lib/session/testdata/process-view-private.js +12 -0
- 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/settings-manifest.d.ts +2 -1
- package/dist/lib/share/delete.d.ts +5 -4
- package/dist/lib/share/html.d.ts +0 -2
- package/dist/lib/share/html.js +9 -9
- package/dist/lib/share/http-error.d.ts +3 -2
- package/dist/lib/share/og.d.ts +2 -1
- package/dist/lib/share/provision.d.ts +2 -2
- package/dist/lib/share/publish.d.ts +4 -13
- package/dist/lib/share/publish.js +2 -2
- package/dist/lib/shim-heal.d.ts +1 -5
- package/dist/lib/shim-heal.js +0 -6
- package/dist/lib/smart-launch.d.ts +4 -5
- package/dist/lib/smart-launch.js +1 -1
- package/dist/lib/snapshot.d.ts +3 -2
- package/dist/lib/ssh-exec.d.ts +5 -4
- 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.js +1 -1
- package/dist/lib/state.d.ts +1 -3
- package/dist/lib/state.js +1 -4
- 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 +4 -3
- 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/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 +1 -3
- package/dist/lib/traces/provision.js +1 -1
- 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 +3 -3
- 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 +2 -3
- package/scripts/postinstall.js +5 -4
- package/dist/commands/pty.d.ts +0 -20
- package/dist/commands/pty.js +0 -404
- 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/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) {
|
package/dist/commands/pty.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* PTY Commands
|
|
3
|
-
*
|
|
4
|
-
* CLI commands for managing interactive PTY sessions.
|
|
5
|
-
* Auto-starts the sidecar server on first use.
|
|
6
|
-
*
|
|
7
|
-
* Usage:
|
|
8
|
-
* agents pty start [--rows 24 --cols 120 --shell zsh --cwd /path]
|
|
9
|
-
* agents pty exec <id> <command>
|
|
10
|
-
* agents pty read <id> [--ms 200]
|
|
11
|
-
* agents pty write <id> <input>
|
|
12
|
-
* agents pty screen <id>
|
|
13
|
-
* agents pty signal <id> [INT|TERM|KILL]
|
|
14
|
-
* agents pty list
|
|
15
|
-
* agents pty stop <id>
|
|
16
|
-
* agents pty server [start|stop|status]
|
|
17
|
-
*/
|
|
18
|
-
import type { Command } from 'commander';
|
|
19
|
-
/** Register the `agents pty` command tree. */
|
|
20
|
-
export declare function registerPtyCommands(program: Command): void;
|
package/dist/commands/pty.js
DELETED
|
@@ -1,404 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* PTY Commands
|
|
3
|
-
*
|
|
4
|
-
* CLI commands for managing interactive PTY sessions.
|
|
5
|
-
* Auto-starts the sidecar server on first use.
|
|
6
|
-
*
|
|
7
|
-
* Usage:
|
|
8
|
-
* agents pty start [--rows 24 --cols 120 --shell zsh --cwd /path]
|
|
9
|
-
* agents pty exec <id> <command>
|
|
10
|
-
* agents pty read <id> [--ms 200]
|
|
11
|
-
* agents pty write <id> <input>
|
|
12
|
-
* agents pty screen <id>
|
|
13
|
-
* agents pty signal <id> [INT|TERM|KILL]
|
|
14
|
-
* agents pty list
|
|
15
|
-
* agents pty stop <id>
|
|
16
|
-
* agents pty server [start|stop|status]
|
|
17
|
-
*/
|
|
18
|
-
import chalk from 'chalk';
|
|
19
|
-
import { ptyRequest, unescapeInput } from '../lib/pty-client.js';
|
|
20
|
-
import { isPtyServerRunning, runPtyServer, getPtyPidPath, getPtyLogPath } from '../lib/pty-server.js';
|
|
21
|
-
import * as fs from 'fs';
|
|
22
|
-
import { setHelpSections } from '../lib/help.js';
|
|
23
|
-
/** Register the `agents pty` command tree. */
|
|
24
|
-
export function registerPtyCommands(program) {
|
|
25
|
-
const pty = program
|
|
26
|
-
.command('pty')
|
|
27
|
-
.description('Drive interactive terminal programs from AI agents. Use this for REPLs, TUIs, or anything needing a real terminal.');
|
|
28
|
-
setHelpSections(pty, {
|
|
29
|
-
examples: `
|
|
30
|
-
# Start a session (returns a session ID)
|
|
31
|
-
SID=$(agents pty start)
|
|
32
|
-
|
|
33
|
-
# Run a command (non-blocking)
|
|
34
|
-
agents pty exec $SID "python3"
|
|
35
|
-
|
|
36
|
-
# Wait, then see what's on screen (clean text, no ANSI)
|
|
37
|
-
sleep 1 && agents pty screen $SID
|
|
38
|
-
|
|
39
|
-
# Type input (supports escapes: \\n \\t \\e \\xHH)
|
|
40
|
-
agents pty write $SID "print('hello')\\n"
|
|
41
|
-
|
|
42
|
-
# Read again
|
|
43
|
-
agents pty screen $SID
|
|
44
|
-
|
|
45
|
-
# Clean up
|
|
46
|
-
agents pty stop $SID
|
|
47
|
-
`,
|
|
48
|
-
notes: `
|
|
49
|
-
Use cases:
|
|
50
|
-
- Drive REPLs (python, node, irb) from agent code
|
|
51
|
-
- Automate TUI programs (npm init, interactive wizards)
|
|
52
|
-
- Test CLI tools that require a real PTY
|
|
53
|
-
- Run the 'agents' CLI itself from another agent
|
|
54
|
-
|
|
55
|
-
The PTY server auto-starts on first use and runs in the background.
|
|
56
|
-
Health: 'agents pty server status'.
|
|
57
|
-
`,
|
|
58
|
-
});
|
|
59
|
-
// --- Session lifecycle ---
|
|
60
|
-
const startCmd = pty
|
|
61
|
-
.command('start')
|
|
62
|
-
.description('Start a new PTY session and return its ID. The session persists until you stop it.')
|
|
63
|
-
.option('-r, --rows <n>', 'Terminal height in rows', '24')
|
|
64
|
-
.option('-c, --cols <n>', 'Terminal width in columns', '120')
|
|
65
|
-
.option('-s, --shell <shell>', 'Shell to launch (defaults to $SHELL, e.g., zsh, bash)')
|
|
66
|
-
.option('-d, --cwd <dir>', 'Working directory for the shell')
|
|
67
|
-
.option('--json', 'Output full session metadata as JSON');
|
|
68
|
-
setHelpSections(startCmd, {
|
|
69
|
-
examples: `
|
|
70
|
-
# Start a session and capture its ID
|
|
71
|
-
SID=$(agents pty start)
|
|
72
|
-
|
|
73
|
-
# Start a Python REPL in a specific directory
|
|
74
|
-
agents pty start --shell python3 --cwd /tmp
|
|
75
|
-
|
|
76
|
-
# Start a wider terminal for TUI programs
|
|
77
|
-
agents pty start --cols 160 --rows 40
|
|
78
|
-
`,
|
|
79
|
-
});
|
|
80
|
-
startCmd.action(async (opts) => {
|
|
81
|
-
const params = {
|
|
82
|
-
rows: parseInt(opts.rows, 10),
|
|
83
|
-
cols: parseInt(opts.cols, 10),
|
|
84
|
-
};
|
|
85
|
-
if (opts.shell)
|
|
86
|
-
params.shell = opts.shell;
|
|
87
|
-
if (opts.cwd)
|
|
88
|
-
params.cwd = opts.cwd;
|
|
89
|
-
const res = await ptyRequest('start', undefined, params);
|
|
90
|
-
if (!res.ok) {
|
|
91
|
-
console.error(chalk.red(res.error));
|
|
92
|
-
process.exit(1);
|
|
93
|
-
}
|
|
94
|
-
if (opts.json) {
|
|
95
|
-
console.log(JSON.stringify(res));
|
|
96
|
-
}
|
|
97
|
-
else {
|
|
98
|
-
console.log(res.id);
|
|
99
|
-
}
|
|
100
|
-
});
|
|
101
|
-
const execCmd = pty
|
|
102
|
-
.command('exec <id> <command>')
|
|
103
|
-
.description('Send a command to a PTY session. Returns immediately (non-blocking). Use screen or read to see output.')
|
|
104
|
-
.option('--wait <ms>', 'Wait this many milliseconds then return the screen (convenience for quick commands)', '0')
|
|
105
|
-
.option('--json', 'Output as JSON');
|
|
106
|
-
setHelpSections(execCmd, {
|
|
107
|
-
examples: `
|
|
108
|
-
# Run a command and return immediately
|
|
109
|
-
agents pty exec $SID "ls -la"
|
|
110
|
-
|
|
111
|
-
# Run a command and wait 500ms to see output
|
|
112
|
-
agents pty exec $SID "git status" --wait 500
|
|
113
|
-
|
|
114
|
-
# Start a long-running process (returns right away)
|
|
115
|
-
agents pty exec $SID "npm run dev"
|
|
116
|
-
`,
|
|
117
|
-
});
|
|
118
|
-
execCmd.action(async (id, command, opts) => {
|
|
119
|
-
const res = await ptyRequest('exec', id, { command });
|
|
120
|
-
if (!res.ok) {
|
|
121
|
-
console.error(chalk.red(res.error));
|
|
122
|
-
process.exit(1);
|
|
123
|
-
}
|
|
124
|
-
const waitMs = parseInt(opts.wait, 10);
|
|
125
|
-
if (waitMs > 0) {
|
|
126
|
-
// Wait then return screen
|
|
127
|
-
await new Promise(r => setTimeout(r, waitMs));
|
|
128
|
-
const screen = await ptyRequest('screen', id);
|
|
129
|
-
if (opts.json) {
|
|
130
|
-
console.log(JSON.stringify(screen));
|
|
131
|
-
}
|
|
132
|
-
else if (screen.ok) {
|
|
133
|
-
console.log(screen.screen);
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
else if (opts.json) {
|
|
137
|
-
console.log(JSON.stringify(res));
|
|
138
|
-
}
|
|
139
|
-
});
|
|
140
|
-
const readCmd = pty
|
|
141
|
-
.command('read <id>')
|
|
142
|
-
.description('Read raw output from the PTY (includes ANSI codes). Use screen for clean text instead.')
|
|
143
|
-
.option('-m, --ms <ms>', 'Wait up to this many milliseconds for new output (50-5000)', '200')
|
|
144
|
-
.option('--json', 'Output as JSON');
|
|
145
|
-
setHelpSections(readCmd, {
|
|
146
|
-
examples: `
|
|
147
|
-
# Read pending output (wait up to 200ms)
|
|
148
|
-
agents pty read $SID
|
|
149
|
-
|
|
150
|
-
# Read with longer wait for slow commands
|
|
151
|
-
agents pty read $SID --ms 1000
|
|
152
|
-
`,
|
|
153
|
-
});
|
|
154
|
-
readCmd.action(async (id, opts) => {
|
|
155
|
-
const ms = parseInt(opts.ms, 10);
|
|
156
|
-
const res = await ptyRequest('read', id, { ms });
|
|
157
|
-
if (!res.ok) {
|
|
158
|
-
console.error(chalk.red(res.error));
|
|
159
|
-
process.exit(1);
|
|
160
|
-
}
|
|
161
|
-
if (opts.json) {
|
|
162
|
-
console.log(JSON.stringify(res));
|
|
163
|
-
}
|
|
164
|
-
else {
|
|
165
|
-
if (res.output)
|
|
166
|
-
process.stdout.write(res.output);
|
|
167
|
-
}
|
|
168
|
-
});
|
|
169
|
-
const writeCmd = pty
|
|
170
|
-
.command('write <id> <input>')
|
|
171
|
-
.description('Send keystrokes to the PTY (like typing into the terminal). Processes escape sequences by default.')
|
|
172
|
-
.option('--raw', 'Send input literally without processing \\n \\t \\e \\xHH escape codes')
|
|
173
|
-
.option('--json', 'Output as JSON');
|
|
174
|
-
setHelpSections(writeCmd, {
|
|
175
|
-
examples: `
|
|
176
|
-
# Send Enter key
|
|
177
|
-
agents pty write $SID "\\n"
|
|
178
|
-
|
|
179
|
-
# Type a command and press Enter
|
|
180
|
-
agents pty write $SID "ls -la\\n"
|
|
181
|
-
|
|
182
|
-
# Send Ctrl-C (interrupt signal)
|
|
183
|
-
agents pty write $SID "\\x03"
|
|
184
|
-
|
|
185
|
-
# Send Escape key
|
|
186
|
-
agents pty write $SID "\\e"
|
|
187
|
-
|
|
188
|
-
# Send literal backslash-n (not newline)
|
|
189
|
-
agents pty write $SID "\\\\n" --raw
|
|
190
|
-
`,
|
|
191
|
-
});
|
|
192
|
-
writeCmd.action(async (id, input, opts) => {
|
|
193
|
-
const processed = opts.raw ? input : unescapeInput(input);
|
|
194
|
-
const res = await ptyRequest('write', id, { input: processed });
|
|
195
|
-
if (!res.ok) {
|
|
196
|
-
console.error(chalk.red(res.error));
|
|
197
|
-
process.exit(1);
|
|
198
|
-
}
|
|
199
|
-
if (opts.json) {
|
|
200
|
-
console.log(JSON.stringify(res));
|
|
201
|
-
}
|
|
202
|
-
});
|
|
203
|
-
const screenCmd = pty
|
|
204
|
-
.command('screen <id>')
|
|
205
|
-
.description('Render the terminal screen as clean text (no ANSI codes). This is what a human sees looking at the terminal.')
|
|
206
|
-
.option('--json', 'Output as JSON (includes cursor position and dimensions)');
|
|
207
|
-
setHelpSections(screenCmd, {
|
|
208
|
-
examples: `
|
|
209
|
-
# See what's currently on screen
|
|
210
|
-
agents pty screen $SID
|
|
211
|
-
|
|
212
|
-
# Get screen with cursor position as JSON
|
|
213
|
-
agents pty screen $SID --json
|
|
214
|
-
`,
|
|
215
|
-
notes: `
|
|
216
|
-
Use this (not read) when you want clean text for an LLM to parse.
|
|
217
|
-
`,
|
|
218
|
-
});
|
|
219
|
-
screenCmd.action(async (id, opts) => {
|
|
220
|
-
const res = await ptyRequest('screen', id);
|
|
221
|
-
if (!res.ok) {
|
|
222
|
-
console.error(chalk.red(res.error));
|
|
223
|
-
process.exit(1);
|
|
224
|
-
}
|
|
225
|
-
if (opts.json) {
|
|
226
|
-
console.log(JSON.stringify(res));
|
|
227
|
-
}
|
|
228
|
-
else {
|
|
229
|
-
console.log(res.screen);
|
|
230
|
-
}
|
|
231
|
-
});
|
|
232
|
-
const signalCmd = pty
|
|
233
|
-
.command('signal <id> [signal]')
|
|
234
|
-
.description('Send a POSIX signal to the running process. Defaults to INT (Ctrl-C).');
|
|
235
|
-
setHelpSections(signalCmd, {
|
|
236
|
-
examples: `
|
|
237
|
-
# Send Ctrl-C (interrupt)
|
|
238
|
-
agents pty signal $SID INT
|
|
239
|
-
|
|
240
|
-
# Terminate gracefully
|
|
241
|
-
agents pty signal $SID TERM
|
|
242
|
-
|
|
243
|
-
# Force kill
|
|
244
|
-
agents pty signal $SID KILL
|
|
245
|
-
`,
|
|
246
|
-
});
|
|
247
|
-
signalCmd.action(async (id, signal) => {
|
|
248
|
-
const res = await ptyRequest('signal', id, { signal: signal || 'INT' });
|
|
249
|
-
if (!res.ok) {
|
|
250
|
-
console.error(chalk.red(res.error));
|
|
251
|
-
process.exit(1);
|
|
252
|
-
}
|
|
253
|
-
});
|
|
254
|
-
pty
|
|
255
|
-
.command('resize <id>')
|
|
256
|
-
.description('Resize a PTY session')
|
|
257
|
-
.option('-r, --rows <n>', 'Terminal rows')
|
|
258
|
-
.option('-c, --cols <n>', 'Terminal columns')
|
|
259
|
-
.action(async (id, opts) => {
|
|
260
|
-
const params = {};
|
|
261
|
-
if (opts.rows)
|
|
262
|
-
params.rows = parseInt(opts.rows, 10);
|
|
263
|
-
if (opts.cols)
|
|
264
|
-
params.cols = parseInt(opts.cols, 10);
|
|
265
|
-
const res = await ptyRequest('resize', id, params);
|
|
266
|
-
if (!res.ok) {
|
|
267
|
-
console.error(chalk.red(res.error));
|
|
268
|
-
process.exit(1);
|
|
269
|
-
}
|
|
270
|
-
console.log(`${res.cols}x${res.rows}`);
|
|
271
|
-
});
|
|
272
|
-
const stopCmd = pty
|
|
273
|
-
.command('stop <id>')
|
|
274
|
-
.description('Stop a PTY session and clean up. The session ID becomes invalid.');
|
|
275
|
-
setHelpSections(stopCmd, {
|
|
276
|
-
examples: `
|
|
277
|
-
# Stop a session by ID
|
|
278
|
-
agents pty stop $SID
|
|
279
|
-
`,
|
|
280
|
-
});
|
|
281
|
-
stopCmd.action(async (id) => {
|
|
282
|
-
const res = await ptyRequest('stop', id);
|
|
283
|
-
if (!res.ok) {
|
|
284
|
-
console.error(chalk.red(res.error));
|
|
285
|
-
process.exit(1);
|
|
286
|
-
}
|
|
287
|
-
});
|
|
288
|
-
// --- Session listing ---
|
|
289
|
-
const listCmd = pty
|
|
290
|
-
.command('list')
|
|
291
|
-
.description('List all active PTY sessions (running or idle).')
|
|
292
|
-
.option('--json', 'Output as JSON');
|
|
293
|
-
setHelpSections(listCmd, {
|
|
294
|
-
examples: `
|
|
295
|
-
# List all active sessions
|
|
296
|
-
agents pty list
|
|
297
|
-
`,
|
|
298
|
-
});
|
|
299
|
-
listCmd.action(async (opts) => {
|
|
300
|
-
const res = await ptyRequest('list');
|
|
301
|
-
if (!res.ok) {
|
|
302
|
-
console.error(chalk.red(res.error));
|
|
303
|
-
process.exit(1);
|
|
304
|
-
}
|
|
305
|
-
if (opts.json) {
|
|
306
|
-
console.log(JSON.stringify(res.sessions));
|
|
307
|
-
return;
|
|
308
|
-
}
|
|
309
|
-
if (res.sessions.length === 0) {
|
|
310
|
-
console.log(chalk.gray('No active PTY sessions'));
|
|
311
|
-
return;
|
|
312
|
-
}
|
|
313
|
-
for (const s of res.sessions) {
|
|
314
|
-
const age = formatAge(Date.now() - s.started_at);
|
|
315
|
-
const status = s.exited
|
|
316
|
-
? chalk.red(`exited (${s.exit_code})`)
|
|
317
|
-
: s.app_active
|
|
318
|
-
? chalk.yellow(`running: ${s.active_command}`)
|
|
319
|
-
: chalk.green('idle');
|
|
320
|
-
console.log(` ${chalk.bold(s.id)} pid=${s.pid} ${s.shell} ${s.cols}x${s.rows} ${age} ${status}`);
|
|
321
|
-
console.log(` ${chalk.gray(s.cwd)}`);
|
|
322
|
-
}
|
|
323
|
-
});
|
|
324
|
-
// --- Server management ---
|
|
325
|
-
const serverCmd = pty
|
|
326
|
-
.command('server')
|
|
327
|
-
.description('Manage the PTY sidecar server (auto-starts on first use, usually you do not need this).');
|
|
328
|
-
serverCmd
|
|
329
|
-
.command('start')
|
|
330
|
-
.description('Start the PTY server manually (auto-starts on first pty command anyway).')
|
|
331
|
-
.action(async () => {
|
|
332
|
-
if (isPtyServerRunning()) {
|
|
333
|
-
const pidPath = getPtyPidPath();
|
|
334
|
-
const pid = fs.existsSync(pidPath) ? fs.readFileSync(pidPath, 'utf-8').trim() : '?';
|
|
335
|
-
console.log(chalk.yellow(`PTY server already running (PID: ${pid})`));
|
|
336
|
-
return;
|
|
337
|
-
}
|
|
338
|
-
// Use ptyRequest which auto-starts the server
|
|
339
|
-
const res = await ptyRequest('ping');
|
|
340
|
-
if (res.ok) {
|
|
341
|
-
console.log(chalk.green(`PTY server started (PID: ${res.pid})`));
|
|
342
|
-
}
|
|
343
|
-
else {
|
|
344
|
-
console.error(chalk.red('Failed to start PTY server'));
|
|
345
|
-
process.exit(1);
|
|
346
|
-
}
|
|
347
|
-
});
|
|
348
|
-
serverCmd
|
|
349
|
-
.command('stop')
|
|
350
|
-
.description('Stop the PTY server and kill all active sessions.')
|
|
351
|
-
.action(async () => {
|
|
352
|
-
if (!isPtyServerRunning()) {
|
|
353
|
-
console.log(chalk.yellow('PTY server is not running'));
|
|
354
|
-
return;
|
|
355
|
-
}
|
|
356
|
-
const pidPath = getPtyPidPath();
|
|
357
|
-
try {
|
|
358
|
-
const pid = parseInt(fs.readFileSync(pidPath, 'utf-8').trim(), 10);
|
|
359
|
-
process.kill(pid, 'SIGTERM');
|
|
360
|
-
console.log(chalk.green('PTY server stopped'));
|
|
361
|
-
}
|
|
362
|
-
catch {
|
|
363
|
-
console.error(chalk.red('Failed to stop PTY server'));
|
|
364
|
-
process.exit(1);
|
|
365
|
-
}
|
|
366
|
-
});
|
|
367
|
-
serverCmd
|
|
368
|
-
.command('status')
|
|
369
|
-
.description('Check if the PTY server is running and how many sessions are active.')
|
|
370
|
-
.action(async () => {
|
|
371
|
-
const running = isPtyServerRunning();
|
|
372
|
-
console.log(` Status: ${running ? chalk.green('running') : chalk.gray('stopped')}`);
|
|
373
|
-
if (running) {
|
|
374
|
-
try {
|
|
375
|
-
const res = await ptyRequest('ping');
|
|
376
|
-
if (res.ok) {
|
|
377
|
-
console.log(` PID: ${res.pid}`);
|
|
378
|
-
console.log(` Sessions: ${res.sessions}`);
|
|
379
|
-
}
|
|
380
|
-
}
|
|
381
|
-
catch { }
|
|
382
|
-
}
|
|
383
|
-
const logPath = getPtyLogPath();
|
|
384
|
-
console.log(` Log: ${logPath}`);
|
|
385
|
-
});
|
|
386
|
-
// Internal: run server in foreground (spawned by auto-start)
|
|
387
|
-
pty
|
|
388
|
-
.command('_server', { hidden: true })
|
|
389
|
-
.description('Run PTY server (internal)')
|
|
390
|
-
.action(async () => {
|
|
391
|
-
await runPtyServer();
|
|
392
|
-
});
|
|
393
|
-
}
|
|
394
|
-
/** Format a millisecond duration as a compact human-readable string (e.g. "5m", "2h 30m"). */
|
|
395
|
-
function formatAge(ms) {
|
|
396
|
-
const secs = Math.floor(ms / 1000);
|
|
397
|
-
if (secs < 60)
|
|
398
|
-
return `${secs}s`;
|
|
399
|
-
const mins = Math.floor(secs / 60);
|
|
400
|
-
if (mins < 60)
|
|
401
|
-
return `${mins}m`;
|
|
402
|
-
const hours = Math.floor(mins / 60);
|
|
403
|
-
return `${hours}h ${mins % 60}m`;
|
|
404
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The YAML keys of every machine-visibility config key — the ones that live in
|
|
3
|
-
* the owning box's own `devices/<machine>/agents.yaml` and cannot be read or
|
|
4
|
-
* set for a peer. A fleet default may still live under
|
|
5
|
-
* `fleet.defaults.config` (the shared default layer); the peer restriction
|
|
6
|
-
* is about targeting another device, not about fleet policy.
|
|
7
|
-
*
|
|
8
|
-
* This is a ZERO-DEPENDENCY leaf on purpose. The authority is `CONFIG_KEYS` in
|
|
9
|
-
* `lib/device-config.ts`, but that module imports `devices/config-migration.ts`,
|
|
10
|
-
* so the migration cannot import it back without a cycle. Same shape as the
|
|
11
|
-
* `agent-cli-commands` leaf: duplicated here, pinned equal to the registry by a
|
|
12
|
-
* test (`device-config.test.ts`), so the two cannot drift silently.
|
|
13
|
-
*/
|
|
14
|
-
export declare const MACHINE_LOCAL_YAML_KEYS: ReadonlySet<string>;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The YAML keys of every machine-visibility config key — the ones that live in
|
|
3
|
-
* the owning box's own `devices/<machine>/agents.yaml` and cannot be read or
|
|
4
|
-
* set for a peer. A fleet default may still live under
|
|
5
|
-
* `fleet.defaults.config` (the shared default layer); the peer restriction
|
|
6
|
-
* is about targeting another device, not about fleet policy.
|
|
7
|
-
*
|
|
8
|
-
* This is a ZERO-DEPENDENCY leaf on purpose. The authority is `CONFIG_KEYS` in
|
|
9
|
-
* `lib/device-config.ts`, but that module imports `devices/config-migration.ts`,
|
|
10
|
-
* so the migration cannot import it back without a cycle. Same shape as the
|
|
11
|
-
* `agent-cli-commands` leaf: duplicated here, pinned equal to the registry by a
|
|
12
|
-
* test (`device-config.test.ts`), so the two cannot drift silently.
|
|
13
|
-
*/
|
|
14
|
-
export const MACHINE_LOCAL_YAML_KEYS = new Set([
|
|
15
|
-
'defaultBrowserProfile', // browser.profile
|
|
16
|
-
'browserRemoteControl', // browser.remote-control — a consent flag; syncing it is a leak
|
|
17
|
-
'schedulerEnabled', // scheduler.enabled
|
|
18
|
-
'daemonEnabled', // daemon.enabled
|
|
19
|
-
'tmuxEnabled', // tmux.enabled — whether an interactive run is tmux-wrapped on THIS box
|
|
20
|
-
'browserTaskIdleMinutes', // browser.task-idle-minutes — only THIS box's reaper reads it
|
|
21
|
-
]);
|
package/dist/lib/pty-client.d.ts
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* PTY Client
|
|
3
|
-
*
|
|
4
|
-
* Thin client that connects to the PTY sidecar server over unix socket.
|
|
5
|
-
* Each call opens a connection, sends a JSON request, reads the JSON response, and closes.
|
|
6
|
-
*/
|
|
7
|
-
export interface ServerSpawnArgs {
|
|
8
|
-
bin: string;
|
|
9
|
-
args: string[];
|
|
10
|
-
}
|
|
11
|
-
export interface ServerExit {
|
|
12
|
-
code: number | null;
|
|
13
|
-
signal: NodeJS.Signals | null;
|
|
14
|
-
}
|
|
15
|
-
/** JSON response envelope from the PTY server. */
|
|
16
|
-
export interface PtyResponse {
|
|
17
|
-
ok: boolean;
|
|
18
|
-
error?: string;
|
|
19
|
-
[key: string]: any;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Send a request to the PTY server and return the response.
|
|
23
|
-
* Auto-starts the server if not running.
|
|
24
|
-
*/
|
|
25
|
-
export declare function ptyRequest(action: string, id?: string, params?: Record<string, any>): Promise<PtyResponse>;
|
|
26
|
-
export declare function getServerSpawnArgs(options?: {
|
|
27
|
-
isStandaloneExecutable?: boolean;
|
|
28
|
-
/** Physical binary path (test seam). Defaults to `process.execPath`. */
|
|
29
|
-
execPath?: string;
|
|
30
|
-
/** Locate a real `node` (test seam). Defaults to `which/where node`. */
|
|
31
|
-
resolveNode?: () => string | undefined;
|
|
32
|
-
/** File-existence check (test seam). Defaults to `fs.existsSync`. */
|
|
33
|
-
fileExists?: (p: string) => boolean;
|
|
34
|
-
}): ServerSpawnArgs;
|
|
35
|
-
export declare function isBunStandaloneExecutable(moduleUrl?: string): boolean;
|
|
36
|
-
export declare function readRecentLogLines(logPath: string, maxLines?: number): string[];
|
|
37
|
-
export declare function buildPtyStartFailureMessage(details: {
|
|
38
|
-
timeoutMs: number;
|
|
39
|
-
spawn: ServerSpawnArgs;
|
|
40
|
-
exit?: ServerExit;
|
|
41
|
-
spawnError?: Error;
|
|
42
|
-
lastReadinessError?: Error;
|
|
43
|
-
logPath: string;
|
|
44
|
-
}): string;
|
|
45
|
-
/**
|
|
46
|
-
* Parse escape sequences in user input strings.
|
|
47
|
-
* Handles: \n \r \t \e \xHH \\
|
|
48
|
-
*/
|
|
49
|
-
export declare function unescapeInput(input: string): string;
|