@phnx-labs/agents-cli 1.22.119 → 1.22.121
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 +236 -0
- package/README.md +19 -2
- package/dist/bootstrap.d.ts +0 -15
- package/dist/bootstrap.js +10 -409
- package/dist/cli/command-registry.d.ts +0 -58
- package/dist/cli/command-registry.js +2 -74
- package/dist/commands/accounts.d.ts +0 -17
- package/dist/commands/accounts.js +1 -52
- package/dist/commands/alias.d.ts +0 -12
- package/dist/commands/alias.js +0 -6
- package/dist/commands/apply.d.ts +0 -15
- package/dist/commands/apply.js +0 -63
- package/dist/commands/audit.d.ts +0 -12
- package/dist/commands/audit.js +0 -13
- package/dist/commands/auth.js +4 -12
- package/dist/commands/beta.d.ts +0 -6
- package/dist/commands/beta.js +2 -6
- package/dist/commands/browser-sessions-picker.d.ts +0 -8
- package/dist/commands/browser-sessions-picker.js +0 -26
- package/dist/commands/browser.d.ts +0 -57
- package/dist/commands/browser.js +0 -80
- package/dist/commands/budget.d.ts +0 -13
- package/dist/commands/budget.js +0 -2
- package/dist/commands/cli.d.ts +0 -12
- package/dist/commands/cli.js +0 -4
- package/dist/commands/cloud.d.ts +0 -9
- package/dist/commands/cloud.js +0 -43
- package/dist/commands/commands.d.ts +0 -9
- package/dist/commands/commands.js +0 -18
- package/dist/commands/computer-sessions-picker.d.ts +0 -11
- package/dist/commands/computer-sessions-picker.js +0 -29
- package/dist/commands/computer.d.ts +0 -62
- package/dist/commands/computer.js +3 -114
- package/dist/commands/config.d.ts +0 -14
- package/dist/commands/config.js +21 -60
- package/dist/commands/cost.d.ts +0 -11
- package/dist/commands/cost.js +1 -17
- package/dist/commands/daemon-test-harness.d.ts +0 -32
- package/dist/commands/daemon-test-harness.js +1 -36
- package/dist/commands/daemon.d.ts +0 -46
- package/dist/commands/daemon.js +8 -255
- package/dist/commands/detach-core.d.ts +0 -28
- package/dist/commands/detach-core.js +0 -30
- package/dist/commands/detach.d.ts +1 -12
- package/dist/commands/detach.js +16 -52
- package/dist/commands/device-config-test-harness.js +0 -12
- package/dist/commands/doctor.d.ts +0 -103
- package/dist/commands/doctor.js +3 -279
- package/dist/commands/events.d.ts +0 -29
- package/dist/commands/events.js +1 -55
- package/dist/commands/exec.d.ts +0 -163
- package/dist/commands/exec.js +15 -964
- package/dist/commands/factory.d.ts +0 -6
- package/dist/commands/factory.js +0 -2
- package/dist/commands/feed-watch.js +0 -20
- package/dist/commands/feed.d.ts +0 -38
- package/dist/commands/feed.js +1 -151
- package/dist/commands/feedback.d.ts +0 -5
- package/dist/commands/feedback.js +0 -5
- package/dist/commands/fleet-capture.d.ts +0 -12
- package/dist/commands/fleet-capture.js +1 -39
- package/dist/commands/focus.d.ts +6 -94
- package/dist/commands/focus.js +13 -183
- package/dist/commands/fork.d.ts +0 -21
- package/dist/commands/fork.js +0 -45
- package/dist/commands/funnel.d.ts +0 -3
- package/dist/commands/go.d.ts +2 -71
- package/dist/commands/go.js +5 -99
- package/dist/commands/harness-hooks.d.ts +0 -41
- package/dist/commands/harness-hooks.js +0 -48
- package/dist/commands/harness-wizard.d.ts +0 -137
- package/dist/commands/harness-wizard.js +0 -109
- package/dist/commands/harness.d.ts +0 -63
- package/dist/commands/harness.js +0 -103
- package/dist/commands/hooks.d.ts +0 -9
- package/dist/commands/hooks.js +0 -26
- package/dist/commands/humans.d.ts +0 -8
- package/dist/commands/humans.js +0 -8
- package/dist/commands/import.d.ts +0 -22
- package/dist/commands/import.js +0 -79
- package/dist/commands/insights.d.ts +0 -37
- package/dist/commands/insights.js +3 -115
- package/dist/commands/inspect.d.ts +0 -117
- package/dist/commands/inspect.js +2 -448
- package/dist/commands/lease.d.ts +0 -28
- package/dist/commands/lease.js +0 -43
- package/dist/commands/logs.d.ts +0 -23
- package/dist/commands/logs.js +0 -30
- package/dist/commands/mailboxes.d.ts +0 -18
- package/dist/commands/mailboxes.js +0 -29
- package/dist/commands/mcp.d.ts +0 -9
- package/dist/commands/mcp.js +0 -53
- package/dist/commands/memory.d.ts +0 -7
- package/dist/commands/memory.js +0 -7
- package/dist/commands/menubar.d.ts +0 -8
- package/dist/commands/menubar.js +0 -24
- package/dist/commands/message.d.ts +0 -23
- package/dist/commands/message.js +0 -50
- package/dist/commands/mine.d.ts +0 -22
- package/dist/commands/mine.js +0 -21
- package/dist/commands/models.d.ts +0 -8
- package/dist/commands/models.js +0 -33
- package/dist/commands/modes.d.ts +0 -10
- package/dist/commands/modes.js +0 -13
- package/dist/commands/monitors.d.ts +0 -9
- package/dist/commands/monitors.js +3 -160
- package/dist/commands/open.d.ts +0 -26
- package/dist/commands/open.js +0 -10
- package/dist/commands/output.d.ts +0 -18
- package/dist/commands/output.js +1 -34
- package/dist/commands/packages-materialize.d.ts +0 -11
- package/dist/commands/packages-materialize.js +0 -3
- package/dist/commands/packages.d.ts +0 -10
- package/dist/commands/packages.js +0 -50
- package/dist/commands/perf.d.ts +0 -41
- package/dist/commands/perf.js +0 -55
- package/dist/commands/permissions.d.ts +0 -9
- package/dist/commands/permissions.js +0 -43
- package/dist/commands/plugins.d.ts +0 -14
- package/dist/commands/plugins.js +2 -55
- package/dist/commands/profiles.d.ts +0 -25
- package/dist/commands/profiles.js +0 -27
- package/dist/commands/projects-todo.d.ts +2 -0
- package/dist/commands/projects-todo.js +132 -0
- package/dist/commands/projects.d.ts +0 -85
- package/dist/commands/projects.js +344 -291
- package/dist/commands/prune.js +0 -30
- package/dist/commands/ps-roster.d.ts +92 -0
- package/dist/commands/ps-roster.js +744 -0
- package/dist/commands/ps.d.ts +6 -0
- package/dist/commands/ps.js +98 -0
- package/dist/commands/refresh-rules.d.ts +0 -13
- package/dist/commands/refresh-rules.js +0 -14
- package/dist/commands/reminders.d.ts +0 -7
- package/dist/commands/repo.d.ts +0 -89
- package/dist/commands/repo.js +7 -205
- package/dist/commands/resource-view.d.ts +0 -33
- package/dist/commands/resource-view.js +0 -49
- package/dist/commands/resume.d.ts +1 -19
- package/dist/commands/resume.js +0 -50
- package/dist/commands/route.d.ts +0 -10
- package/dist/commands/route.js +0 -19
- package/dist/commands/routines.d.ts +0 -42
- package/dist/commands/routines.js +5 -290
- package/dist/commands/routines.test-fixture.d.ts +0 -34
- package/dist/commands/routines.test-fixture.js +4 -100
- package/dist/commands/rules.d.ts +0 -9
- package/dist/commands/rules.js +1 -6
- package/dist/commands/run-account-picker.d.ts +0 -59
- package/dist/commands/run-account-picker.js +0 -71
- package/dist/commands/run-broadcast.d.ts +0 -9
- package/dist/commands/run-broadcast.js +0 -7
- package/dist/commands/run-cloud.d.ts +0 -15
- package/dist/commands/run-cloud.js +0 -37
- package/dist/commands/run-device-picker.d.ts +0 -25
- package/dist/commands/run-device-picker.js +1 -53
- package/dist/commands/secrets-passthrough.d.ts +0 -31
- package/dist/commands/secrets-passthrough.js +0 -10
- package/dist/commands/send.d.ts +0 -20
- package/dist/commands/send.js +14 -18
- package/dist/commands/sessions-backfill.d.ts +0 -7
- package/dist/commands/sessions-backfill.js +1 -16
- package/dist/commands/sessions-backup-setup.js +0 -11
- package/dist/commands/sessions-bookmark.d.ts +0 -8
- package/dist/commands/sessions-bookmark.js +0 -28
- package/dist/commands/sessions-browser.d.ts +2 -117
- package/dist/commands/sessions-browser.js +5 -243
- package/dist/commands/sessions-export.d.ts +1 -26
- package/dist/commands/sessions-export.js +3 -81
- package/dist/commands/sessions-import.d.ts +0 -14
- package/dist/commands/sessions-import.js +0 -59
- package/dist/commands/sessions-inject.d.ts +0 -60
- package/dist/commands/sessions-inject.js +3 -96
- package/dist/commands/sessions-migrate.d.ts +2 -37
- package/dist/commands/sessions-migrate.js +7 -159
- package/dist/commands/sessions-optimize.d.ts +0 -12
- package/dist/commands/sessions-picker-factory.d.ts +0 -7
- package/dist/commands/sessions-picker-factory.js +0 -8
- package/dist/commands/sessions-picker.d.ts +4 -103
- package/dist/commands/sessions-picker.js +13 -352
- package/dist/commands/sessions-render.d.ts +1 -2
- package/dist/commands/sessions-render.js +3 -7
- package/dist/commands/sessions-resume.d.ts +1 -24
- package/dist/commands/sessions-resume.js +2 -65
- package/dist/commands/sessions-share.d.ts +1 -9
- package/dist/commands/sessions-share.js +1 -45
- package/dist/commands/sessions-stats.d.ts +0 -24
- package/dist/commands/sessions-stats.js +0 -49
- package/dist/commands/sessions-stop.d.ts +1 -20
- package/dist/commands/sessions-stop.js +4 -9
- package/dist/commands/sessions-tail.d.ts +1 -19
- package/dist/commands/sessions-tail.js +3 -36
- package/dist/commands/sessions-trace.d.ts +5 -36
- package/dist/commands/sessions-trace.js +7 -82
- package/dist/commands/sessions.d.ts +1 -666
- package/dist/commands/sessions.js +30 -2279
- package/dist/commands/sessions.test-fixture.d.ts +0 -9
- package/dist/commands/sessions.test-fixture.js +8 -23
- package/dist/commands/setup-accounts.d.ts +0 -6
- package/dist/commands/setup-browser.d.ts +0 -23
- package/dist/commands/setup-browser.js +0 -28
- package/dist/commands/setup-computer.d.ts +0 -16
- package/dist/commands/setup-computer.js +0 -28
- package/dist/commands/setup-fleet.d.ts +0 -8
- package/dist/commands/setup-fleet.js +0 -11
- package/dist/commands/setup-mine.d.ts +0 -14
- package/dist/commands/setup-mine.js +0 -25
- package/dist/commands/setup-preferences.d.ts +0 -47
- package/dist/commands/setup-preferences.js +0 -53
- package/dist/commands/setup-secrets.d.ts +2 -24
- package/dist/commands/setup-secrets.js +0 -24
- package/dist/commands/setup-term.d.ts +0 -21
- package/dist/commands/setup-term.js +0 -21
- package/dist/commands/setup-terminal.d.ts +0 -1
- package/dist/commands/setup-terminal.js +0 -1
- package/dist/commands/setup-tools.d.ts +2 -0
- package/dist/commands/setup-tools.js +73 -0
- package/dist/commands/setup.d.ts +0 -20
- package/dist/commands/setup.js +4 -57
- package/dist/commands/skills.d.ts +0 -9
- package/dist/commands/skills.js +1 -22
- package/dist/commands/snapshot.d.ts +0 -9
- package/dist/commands/snapshot.js +0 -10
- package/dist/commands/ssh.d.ts +0 -64
- package/dist/commands/ssh.js +9 -420
- package/dist/commands/status.d.ts +0 -12
- package/dist/commands/status.js +0 -26
- package/dist/commands/subagents.d.ts +0 -8
- package/dist/commands/subagents.js +0 -31
- package/dist/commands/sync.d.ts +0 -37
- package/dist/commands/sync.js +0 -256
- package/dist/commands/teams-picker.d.ts +0 -3
- package/dist/commands/teams-picker.js +0 -34
- package/dist/commands/teams.d.ts +1 -76
- package/dist/commands/teams.js +9 -477
- package/dist/commands/tmux.d.ts +0 -25
- package/dist/commands/tmux.js +0 -46
- package/dist/commands/traces.js +0 -19
- package/dist/commands/trash.d.ts +0 -17
- package/dist/commands/trash.js +1 -11
- package/dist/commands/uninstall.d.ts +0 -9
- package/dist/commands/uninstall.js +0 -6
- package/dist/commands/update.d.ts +0 -22
- package/dist/commands/update.js +0 -44
- package/dist/commands/upgrade.d.ts +0 -1
- package/dist/commands/upgrade.js +0 -1
- package/dist/commands/utils.d.ts +0 -85
- package/dist/commands/utils.js +1 -95
- package/dist/commands/versions.d.ts +0 -16
- package/dist/commands/versions.js +0 -134
- package/dist/commands/view.d.ts +0 -90
- package/dist/commands/view.js +4 -343
- package/dist/commands/watchdog.d.ts +0 -19
- package/dist/commands/watchdog.js +3 -43
- package/dist/commands/webhook.d.ts +0 -8
- package/dist/commands/webhook.js +0 -14
- package/dist/commands/workflows.d.ts +0 -8
- package/dist/commands/workflows.js +0 -6
- package/dist/index.d.ts +0 -25
- package/dist/index.js +5 -119
- package/dist/lib/account-capabilities.d.ts +0 -34
- package/dist/lib/account-capabilities.js +0 -32
- package/dist/lib/account-catalog.d.ts +0 -128
- package/dist/lib/account-catalog.js +8 -154
- package/dist/lib/account-provider-registry.d.ts +0 -14
- package/dist/lib/account-provider-registry.js +0 -8
- package/dist/lib/account-registry.d.ts +0 -74
- package/dist/lib/account-registry.js +14 -189
- package/dist/lib/account-schema.d.ts +0 -19
- package/dist/lib/account-schema.js +0 -43
- package/dist/lib/accounting/account-launch.d.ts +0 -15
- package/dist/lib/accounting/account-launch.js +1 -3
- package/dist/lib/accounting/account-pool-collect.d.ts +0 -26
- package/dist/lib/accounting/account-pool-collect.js +0 -42
- package/dist/lib/accounting/account-pool.d.ts +0 -41
- package/dist/lib/accounting/account-pool.js +0 -17
- package/dist/lib/accounting/capacity.d.ts +0 -32
- package/dist/lib/accounting/capacity.js +0 -32
- package/dist/lib/accounting/rotate.d.ts +0 -518
- package/dist/lib/accounting/rotate.js +4 -598
- package/dist/lib/accounting/usage-ingest.d.ts +0 -1
- package/dist/lib/accounting/usage-ingest.js +0 -44
- package/dist/lib/accounting/usage-sync.d.ts +0 -60
- package/dist/lib/accounting/usage-sync.js +4 -51
- package/dist/lib/accounting/usage.d.ts +0 -632
- package/dist/lib/accounting/usage.js +14 -1055
- package/dist/lib/accounts/add.d.ts +0 -60
- package/dist/lib/accounts/add.js +0 -127
- package/dist/lib/accounts/auth-operation-lock.d.ts +0 -1
- package/dist/lib/accounts/auth-operation-lock.js +0 -4
- package/dist/lib/accounts/migrate.d.ts +0 -9
- package/dist/lib/accounts/migrate.js +3 -42
- package/dist/lib/accounts/slots.d.ts +0 -25
- package/dist/lib/accounts/slots.js +1 -49
- package/dist/lib/acp/client.d.ts +0 -16
- package/dist/lib/acp/client.js +0 -29
- package/dist/lib/acp/harnesses.d.ts +0 -15
- package/dist/lib/acp/harnesses.js +0 -16
- package/dist/lib/acp/run.d.ts +0 -8
- package/dist/lib/acp/run.js +0 -8
- package/dist/lib/actor.d.ts +1 -71
- package/dist/lib/actor.js +1 -99
- package/dist/lib/add-dir.d.ts +0 -46
- package/dist/lib/add-dir.js +1 -70
- package/dist/lib/address.d.ts +0 -17
- package/dist/lib/address.js +0 -15
- package/dist/lib/agent-cli-commands.d.ts +0 -10
- package/dist/lib/agent-cli-commands.js +0 -10
- package/dist/lib/agent-modes.d.ts +0 -29
- package/dist/lib/agent-modes.js +0 -31
- package/dist/lib/agent-spec/agents.d.ts +0 -426
- package/dist/lib/agent-spec/agents.js +37 -924
- package/dist/lib/agent-spec/index.d.ts +0 -5
- package/dist/lib/agent-spec/index.js +0 -14
- package/dist/lib/agent-spec/materialize.d.ts +0 -10
- package/dist/lib/agent-spec/materialize.js +2 -139
- package/dist/lib/agent-spec/package-resolve.d.ts +0 -8
- package/dist/lib/agent-spec/package-resolve.js +1 -44
- package/dist/lib/agent-spec/package-schema.d.ts +0 -2
- package/dist/lib/agent-spec/package-schema.js +0 -11
- package/dist/lib/agent-spec/package-types.d.ts +0 -27
- package/dist/lib/agent-spec/package-types.js +0 -1
- package/dist/lib/agent-spec/primitives.d.ts +0 -18
- package/dist/lib/agent-spec/primitives.js +0 -27
- package/dist/lib/agent-spec/provider.js +0 -2
- package/dist/lib/agent-spec/resolve.d.ts +0 -23
- package/dist/lib/agent-spec/resolve.js +0 -41
- package/dist/lib/agent-spec/types.d.ts +0 -34
- package/dist/lib/agent-spec/types.js +0 -6
- package/dist/lib/agents.d.ts +0 -1
- package/dist/lib/agents.js +0 -1
- package/dist/lib/analytics/mix-commands.d.ts +0 -23
- package/dist/lib/analytics/mix-commands.js +0 -26
- package/dist/lib/analytics/recipes.d.ts +0 -1
- package/dist/lib/analytics/recipes.js +5 -10
- package/dist/lib/analytics/usage-db.js +4 -6
- package/dist/lib/answer-router.d.ts +0 -61
- package/dist/lib/answer-router.js +0 -57
- package/dist/lib/app-bundle-install.d.ts +0 -13
- package/dist/lib/app-bundle-install.js +0 -50
- package/dist/lib/artifact-actions.d.ts +0 -15
- package/dist/lib/artifact-actions.js +0 -18
- package/dist/lib/artifacts-client.d.ts +0 -10
- package/dist/lib/artifacts-client.js +0 -17
- package/dist/lib/ask-classifier.d.ts +0 -38
- package/dist/lib/ask-classifier.js +0 -27
- package/dist/lib/audit/log.d.ts +0 -47
- package/dist/lib/audit/log.js +1 -59
- package/dist/lib/auth-health.d.ts +0 -213
- package/dist/lib/auth-health.js +16 -266
- package/dist/lib/auth-mint.d.ts +0 -83
- package/dist/lib/auth-mint.js +8 -85
- package/dist/lib/auto-pull-worker.d.ts +0 -10
- package/dist/lib/auto-pull-worker.js +3 -48
- package/dist/lib/auto-pull.d.ts +0 -64
- package/dist/lib/auto-pull.js +0 -79
- package/dist/lib/beta.d.ts +0 -9
- package/dist/lib/beta.js +0 -9
- package/dist/lib/binary-shadow.d.ts +0 -22
- package/dist/lib/binary-shadow.js +4 -34
- package/dist/lib/boot-profile.d.ts +0 -10
- package/dist/lib/boot-profile.js +1 -31
- package/dist/lib/brand.d.ts +0 -20
- package/dist/lib/brand.js +0 -50
- package/dist/lib/browser/context.d.ts +0 -54
- package/dist/lib/browser/context.js +0 -49
- package/dist/lib/browser/paths.d.ts +0 -21
- package/dist/lib/browser/paths.js +0 -26
- package/dist/lib/browser/record.d.ts +0 -34
- package/dist/lib/browser/record.js +0 -38
- package/dist/lib/browser/sessions-list.d.ts +1 -79
- package/dist/lib/browser/sessions-list.js +2 -98
- package/dist/lib/browser-client.d.ts +0 -112
- package/dist/lib/browser-client.js +1 -90
- package/dist/lib/budget/config.d.ts +0 -6
- package/dist/lib/budget/config.js +0 -29
- package/dist/lib/budget/enforce.d.ts +0 -50
- package/dist/lib/budget/enforce.js +0 -27
- package/dist/lib/budget/ledger.d.ts +0 -23
- package/dist/lib/budget/ledger.js +0 -28
- package/dist/lib/budget/live-cloud.d.ts +0 -26
- package/dist/lib/budget/live-cloud.js +0 -12
- package/dist/lib/budget/live-team.d.ts +0 -17
- package/dist/lib/budget/live-team.js +1 -35
- package/dist/lib/budget/preflight.d.ts +0 -51
- package/dist/lib/budget/preflight.js +0 -36
- package/dist/lib/byok-usage.d.ts +0 -20
- package/dist/lib/byok-usage.js +1 -24
- package/dist/lib/capabilities.d.ts +0 -24
- package/dist/lib/capabilities.js +0 -29
- package/dist/lib/catchup.d.ts +0 -87
- package/dist/lib/catchup.js +1 -81
- package/dist/lib/channels/owner-forward.d.ts +0 -70
- package/dist/lib/channels/owner-forward.js +1 -43
- package/dist/lib/channels/owner-sink.js +0 -21
- package/dist/lib/channels/providers/desktop.d.ts +0 -37
- package/dist/lib/channels/providers/desktop.js +0 -72
- package/dist/lib/channels/providers/index.d.ts +0 -1
- package/dist/lib/channels/providers/index.js +2 -6
- package/dist/lib/channels/providers/mailbox.js +0 -7
- package/dist/lib/channels/providers/openclaw-telegram.js +0 -8
- package/dist/lib/channels/providers/rush.d.ts +0 -2
- package/dist/lib/channels/providers/rush.js +0 -26
- package/dist/lib/channels/providers/session.d.ts +2 -0
- package/dist/lib/channels/providers/session.js +26 -0
- package/dist/lib/channels/registry.d.ts +0 -27
- package/dist/lib/channels/registry.js +0 -10
- package/dist/lib/channels/resolve.d.ts +0 -19
- package/dist/lib/channels/resolve.js +0 -2
- package/dist/lib/channels/send.d.ts +0 -50
- package/dist/lib/channels/send.js +0 -25
- package/dist/lib/checkpoint.d.ts +0 -36
- package/dist/lib/checkpoint.js +0 -28
- package/dist/lib/claude-account-token.d.ts +0 -98
- package/dist/lib/claude-account-token.js +7 -169
- package/dist/lib/claude-statusline.d.ts +0 -41
- package/dist/lib/claude-statusline.js +0 -68
- package/dist/lib/cli-entry.d.ts +0 -26
- package/dist/lib/cli-entry.js +1 -61
- package/dist/lib/cli-resources.d.ts +31 -89
- package/dist/lib/cli-resources.js +116 -152
- package/dist/lib/cloud/antigravity.d.ts +0 -29
- package/dist/lib/cloud/antigravity.js +0 -36
- package/dist/lib/cloud/codex.d.ts +0 -8
- package/dist/lib/cloud/codex.js +0 -41
- package/dist/lib/cloud/cursor.d.ts +0 -5
- package/dist/lib/cloud/cursor.js +2 -7
- package/dist/lib/cloud/dispatch.d.ts +0 -13
- package/dist/lib/cloud/dispatch.js +1 -48
- package/dist/lib/cloud/factory.d.ts +0 -52
- package/dist/lib/cloud/factory.js +3 -67
- package/dist/lib/cloud/host.d.ts +0 -39
- package/dist/lib/cloud/host.js +5 -48
- package/dist/lib/cloud/registry.d.ts +0 -25
- package/dist/lib/cloud/registry.js +0 -29
- package/dist/lib/cloud/rush.d.ts +0 -47
- package/dist/lib/cloud/rush.js +1 -82
- package/dist/lib/cloud/session-index.d.ts +0 -27
- package/dist/lib/cloud/session-index.js +1 -32
- package/dist/lib/cloud/store.d.ts +0 -18
- package/dist/lib/cloud/store.js +0 -28
- package/dist/lib/cloud/stream.d.ts +0 -14
- package/dist/lib/cloud/stream.js +0 -25
- package/dist/lib/cloud/types.d.ts +0 -168
- package/dist/lib/cloud/types.js +0 -46
- package/dist/lib/cloudflare/creds.d.ts +0 -2
- package/dist/lib/cloudflare/creds.js +0 -14
- package/dist/lib/cloudflare/provision.d.ts +0 -8
- package/dist/lib/cloudflare/provision.js +1 -19
- package/dist/lib/codex-home.d.ts +0 -60
- package/dist/lib/codex-home.js +2 -72
- package/dist/lib/codex-policy.d.ts +0 -10
- package/dist/lib/codex-policy.js +0 -13
- package/dist/lib/command-skills.d.ts +0 -10
- package/dist/lib/command-skills.js +0 -10
- package/dist/lib/commands.d.ts +0 -74
- package/dist/lib/commands.js +0 -112
- package/dist/lib/comms-render.d.ts +0 -5
- package/dist/lib/comms-render.js +0 -5
- package/dist/lib/computer/context.d.ts +0 -23
- package/dist/lib/computer/context.js +0 -14
- package/dist/lib/computer/policy.d.ts +0 -20
- package/dist/lib/computer/policy.js +0 -53
- package/dist/lib/computer/record.d.ts +0 -33
- package/dist/lib/computer/record.js +1 -48
- package/dist/lib/computer/sessions-list.d.ts +1 -128
- package/dist/lib/computer/sessions-list.js +6 -165
- package/dist/lib/computer-client.d.ts +0 -106
- package/dist/lib/computer-client.js +5 -86
- package/dist/lib/concurrency.d.ts +0 -14
- package/dist/lib/concurrency.js +0 -3
- package/dist/lib/config-drift.d.ts +0 -31
- package/dist/lib/config-drift.js +0 -32
- package/dist/lib/config-keys.d.ts +1 -65
- package/dist/lib/config-keys.js +6 -52
- package/dist/lib/config-transfer.d.ts +0 -14
- package/dist/lib/config-transfer.js +0 -26
- package/dist/lib/convert.d.ts +0 -17
- package/dist/lib/convert.js +0 -18
- package/dist/lib/crabbox/cli.d.ts +0 -156
- package/dist/lib/crabbox/cli.js +1 -188
- package/dist/lib/crabbox/config.d.ts +0 -18
- package/dist/lib/crabbox/config.js +1 -19
- package/dist/lib/crabbox/lease.d.ts +0 -93
- package/dist/lib/crabbox/lease.js +4 -148
- package/dist/lib/crabbox/progress.d.ts +0 -56
- package/dist/lib/crabbox/progress.js +2 -49
- package/dist/lib/crabbox/runtimes.d.ts +0 -94
- package/dist/lib/crabbox/runtimes.js +1 -111
- package/dist/lib/crabbox/setup-copy.d.ts +0 -64
- package/dist/lib/crabbox/setup-copy.js +1 -53
- package/dist/lib/daemon/account-state-daemon-service.d.ts +0 -48
- package/dist/lib/daemon/account-state-daemon-service.js +2 -63
- package/dist/lib/daemon/attention-notify-service.d.ts +0 -12
- package/dist/lib/daemon/attention-notify-service.js +1 -24
- package/dist/lib/daemon/auth-sync-service.d.ts +0 -28
- package/dist/lib/daemon/auth-sync-service.js +0 -56
- package/dist/lib/daemon/catchup-service.d.ts +0 -34
- package/dist/lib/daemon/catchup-service.js +0 -30
- package/dist/lib/daemon/daemon.d.ts +0 -374
- package/dist/lib/daemon/daemon.js +44 -1049
- package/dist/lib/daemon/daemon.test-fixture.d.ts +0 -19
- package/dist/lib/daemon/daemon.test-fixture.js +1 -24
- package/dist/lib/daemon/device-probe-service.d.ts +0 -16
- package/dist/lib/daemon/device-probe-service.js +0 -20
- package/dist/lib/daemon/feed-stream-service.d.ts +0 -15
- package/dist/lib/daemon/feed-stream-service.js +0 -20
- package/dist/lib/daemon/harness-update-service.d.ts +2 -61
- package/dist/lib/daemon/harness-update-service.js +6 -86
- package/dist/lib/daemon/heartbeat-service.d.ts +0 -1
- package/dist/lib/daemon/heartbeat-service.js +0 -1
- package/dist/lib/daemon/leaked-daemons.d.ts +0 -46
- package/dist/lib/daemon/leaked-daemons.js +2 -78
- package/dist/lib/daemon/monitor-engine-service.d.ts +0 -13
- package/dist/lib/daemon/monitor-engine-service.js +3 -15
- package/dist/lib/daemon/runner.d.ts +0 -194
- package/dist/lib/daemon/runner.js +39 -760
- package/dist/lib/daemon/self-heal-service.d.ts +18 -17
- package/dist/lib/daemon/self-heal-service.js +83 -37
- package/dist/lib/daemon/self-update-service.d.ts +1 -131
- package/dist/lib/daemon/self-update-service.js +26 -189
- package/dist/lib/daemon/service.d.ts +0 -73
- package/dist/lib/daemon/service.js +0 -34
- package/dist/lib/daemon/session-index-service.d.ts +0 -12
- package/dist/lib/daemon/session-index-service.js +0 -23
- package/dist/lib/daemon/session-state-service.d.ts +0 -8
- package/dist/lib/daemon/session-state-service.js +0 -8
- package/dist/lib/daemon/session-summarizer-service.d.ts +0 -14
- package/dist/lib/daemon/session-summarizer-service.js +1 -19
- package/dist/lib/daemon/session-title-service.d.ts +0 -25
- package/dist/lib/daemon/session-title-service.js +0 -32
- package/dist/lib/daemon/state-dir-check-service.d.ts +0 -24
- package/dist/lib/daemon/state-dir-check-service.js +0 -29
- package/dist/lib/daemon/supervisor.d.ts +0 -112
- package/dist/lib/daemon/supervisor.js +4 -147
- package/dist/lib/daemon/testdata/process-view-daemon.js +0 -2
- package/dist/lib/daemon/testdata/process-view-start.js +0 -5
- package/dist/lib/daemon/tmux-reap-service.d.ts +0 -1
- package/dist/lib/daemon/tmux-reap-service.js +0 -1
- package/dist/lib/daemon/usage-sync-service.d.ts +0 -23
- package/dist/lib/daemon/usage-sync-service.js +0 -26
- package/dist/lib/daemon/watchdog-service.d.ts +0 -9
- package/dist/lib/daemon/watchdog-service.js +0 -13
- package/dist/lib/daemon/webhook-receiver-service.d.ts +0 -1
- package/dist/lib/daemon/webhook-receiver-service.js +0 -1
- package/dist/lib/daemon-health.d.ts +0 -55
- package/dist/lib/daemon-health.js +4 -77
- package/dist/lib/daemon-services.d.ts +0 -36
- package/dist/lib/daemon-services.js +0 -45
- package/dist/lib/daemon-ticks.d.ts +0 -126
- package/dist/lib/daemon-ticks.js +1 -156
- package/dist/lib/daemon-webhooks.d.ts +0 -57
- package/dist/lib/daemon-webhooks.js +2 -54
- package/dist/lib/deeplink/register.d.ts +0 -15
- package/dist/lib/deeplink/register.js +0 -60
- package/dist/lib/deeplink/url.d.ts +0 -24
- package/dist/lib/deeplink/url.js +1 -33
- package/dist/lib/device-config.d.ts +1 -192
- package/dist/lib/device-config.js +86 -240
- package/dist/lib/devices/config-migration.d.ts +0 -43
- package/dist/lib/devices/config-migration.js +7 -127
- package/dist/lib/devices/connect.d.ts +0 -168
- package/dist/lib/devices/connect.js +6 -254
- package/dist/lib/devices/device-docs.d.ts +0 -24
- package/dist/lib/devices/device-docs.js +0 -46
- package/dist/lib/devices/discovery-policy.d.ts +0 -30
- package/dist/lib/devices/discovery-policy.js +3 -34
- package/dist/lib/devices/doctor-findings.d.ts +0 -109
- package/dist/lib/devices/doctor-findings.js +30 -326
- package/dist/lib/devices/doctor-overview-cache.d.ts +0 -33
- package/dist/lib/devices/doctor-overview-cache.js +0 -81
- package/dist/lib/devices/fleet-divergence.d.ts +0 -89
- package/dist/lib/devices/fleet-divergence.js +1 -60
- package/dist/lib/devices/fleet-inventory.d.ts +0 -27
- package/dist/lib/devices/fleet-inventory.js +0 -38
- package/dist/lib/devices/fleet.d.ts +0 -95
- package/dist/lib/devices/fleet.js +0 -79
- package/dist/lib/devices/harness-inventory.d.ts +0 -75
- package/dist/lib/devices/harness-inventory.js +0 -101
- package/dist/lib/devices/health-report.d.ts +0 -37
- package/dist/lib/devices/health-report.js +0 -73
- package/dist/lib/devices/health.d.ts +0 -71
- package/dist/lib/devices/health.js +2 -82
- package/dist/lib/devices/interactive-host.d.ts +0 -10
- package/dist/lib/devices/interactive-host.js +0 -34
- package/dist/lib/devices/known-hosts.d.ts +0 -45
- package/dist/lib/devices/known-hosts.js +0 -77
- package/dist/lib/devices/pending.d.ts +0 -31
- package/dist/lib/devices/pending.js +7 -67
- package/dist/lib/devices/pool.d.ts +0 -36
- package/dist/lib/devices/pool.js +0 -30
- package/dist/lib/devices/reachability.d.ts +0 -25
- package/dist/lib/devices/reachability.js +0 -14
- package/dist/lib/devices/registry.d.ts +0 -141
- package/dist/lib/devices/registry.js +4 -151
- package/dist/lib/devices/resolve-profile.d.ts +0 -18
- package/dist/lib/devices/resolve-profile.js +0 -18
- package/dist/lib/devices/resolve-target.d.ts +0 -20
- package/dist/lib/devices/resolve-target.js +1 -51
- package/dist/lib/devices/rollout-verify.d.ts +1 -81
- package/dist/lib/devices/rollout-verify.js +0 -77
- package/dist/lib/devices/self-host.d.ts +0 -7
- package/dist/lib/devices/self-host.js +1 -29
- package/dist/lib/devices/ssh-config.d.ts +0 -18
- package/dist/lib/devices/ssh-config.js +0 -9
- package/dist/lib/devices/stats-cache.d.ts +0 -48
- package/dist/lib/devices/stats-cache.js +0 -80
- package/dist/lib/devices/sync.d.ts +0 -97
- package/dist/lib/devices/sync.js +0 -88
- package/dist/lib/devices/tailscale.d.ts +0 -18
- package/dist/lib/devices/tailscale.js +1 -38
- package/dist/lib/devices/terminfo.d.ts +0 -27
- package/dist/lib/devices/terminfo.js +2 -64
- package/dist/lib/devices/worker-pick.d.ts +0 -15
- package/dist/lib/devices/worker-pick.js +0 -48
- package/dist/lib/diff-text.d.ts +0 -18
- package/dist/lib/diff-text.js +0 -15
- package/dist/lib/doctor-diff.d.ts +0 -79
- package/dist/lib/doctor-diff.js +2 -181
- package/dist/lib/drift-sync.d.ts +0 -29
- package/dist/lib/drift-sync.js +0 -40
- package/dist/lib/drift.d.ts +0 -43
- package/dist/lib/drift.js +0 -31
- package/dist/lib/event-families.d.ts +0 -17
- package/dist/lib/event-families.js +0 -33
- package/dist/lib/event-provenance.d.ts +0 -4
- package/dist/lib/event-provenance.js +0 -5
- package/dist/lib/event-stream.d.ts +0 -29
- package/dist/lib/event-stream.js +0 -36
- package/dist/lib/events-ingest.d.ts +0 -27
- package/dist/lib/events-ingest.js +0 -54
- package/dist/lib/exec-account-home.d.ts +0 -24
- package/dist/lib/exec-account-home.js +0 -41
- package/dist/lib/exec-bounded.d.ts +1 -37
- package/dist/lib/exec-bounded.js +10 -46
- package/dist/lib/exec.d.ts +3 -583
- package/dist/lib/exec.js +18 -1025
- package/dist/lib/factory/snapshot.js +1 -15
- package/dist/lib/feed/activity-stream.d.ts +0 -27
- package/dist/lib/feed/activity-stream.js +4 -80
- package/dist/lib/feed/activity.d.ts +1 -243
- package/dist/lib/feed/activity.js +8 -273
- package/dist/lib/feed/answer.d.ts +0 -103
- package/dist/lib/feed/answer.js +0 -267
- package/dist/lib/feed/attention.d.ts +0 -56
- package/dist/lib/feed/attention.js +0 -161
- package/dist/lib/feed/envelope.d.ts +2 -17
- package/dist/lib/feed/envelope.js +0 -14
- package/dist/lib/feed/events.d.ts +0 -118
- package/dist/lib/feed/events.js +13 -213
- package/dist/lib/feed/feed.d.ts +1 -250
- package/dist/lib/feed/feed.js +24 -334
- package/dist/lib/feed/hub-server.d.ts +0 -100
- package/dist/lib/feed/hub-server.js +1 -191
- package/dist/lib/feed/hub.d.ts +0 -53
- package/dist/lib/feed/hub.js +0 -89
- package/dist/lib/feed/pr-status.d.ts +1 -19
- package/dist/lib/feed/pr-status.js +0 -18
- package/dist/lib/feed/tool-activity.d.ts +0 -59
- package/dist/lib/feed/tool-activity.js +1 -119
- package/dist/lib/feed/tools.d.ts +0 -100
- package/dist/lib/feed/tools.js +0 -89
- package/dist/lib/feed/watch.d.ts +0 -33
- package/dist/lib/feed/watch.js +2 -94
- package/dist/lib/feed-broadcast.d.ts +0 -148
- package/dist/lib/feed-broadcast.js +1 -283
- package/dist/lib/feed-outcome.d.ts +0 -50
- package/dist/lib/feed-outcome.js +1 -67
- package/dist/lib/feed-policy.d.ts +0 -6
- package/dist/lib/feed-policy.js +1 -27
- package/dist/lib/feed-post.d.ts +0 -61
- package/dist/lib/feed-post.js +4 -61
- package/dist/lib/feed-ranking.d.ts +1 -1
- package/dist/lib/fleet/apply.d.ts +0 -64
- package/dist/lib/fleet/apply.js +0 -125
- package/dist/lib/fleet/auth-sync.d.ts +0 -48
- package/dist/lib/fleet/auth-sync.js +4 -49
- package/dist/lib/fleet/capture.d.ts +0 -26
- package/dist/lib/fleet/capture.js +1 -36
- package/dist/lib/fleet/manifest.d.ts +0 -38
- package/dist/lib/fleet/manifest.js +0 -40
- package/dist/lib/fleet/types.d.ts +1 -138
- package/dist/lib/fleet/types.js +0 -12
- package/dist/lib/fleet-cache.d.ts +0 -12
- package/dist/lib/fleet-cache.js +0 -24
- package/dist/lib/fleet-shared-state.d.ts +6 -59
- package/dist/lib/fleet-shared-state.js +5 -51
- package/dist/lib/fleet-status.d.ts +0 -27
- package/dist/lib/fleet-status.js +0 -48
- package/dist/lib/format.d.ts +0 -74
- package/dist/lib/format.js +3 -77
- package/dist/lib/friction-heuristics.d.ts +0 -20
- package/dist/lib/friction-heuristics.js +0 -8
- package/dist/lib/fs-atomic.d.ts +0 -51
- package/dist/lib/fs-atomic.js +8 -66
- package/dist/lib/fs-walk.d.ts +0 -13
- package/dist/lib/fs-walk.js +0 -22
- package/dist/lib/fuzzy.d.ts +0 -29
- package/dist/lib/fuzzy.js +0 -31
- package/dist/lib/gemini-settings.js +0 -12
- package/dist/lib/git.d.ts +0 -366
- package/dist/lib/git.js +7 -574
- package/dist/lib/github/ci-failure.d.ts +30 -0
- package/dist/lib/github/ci-failure.js +95 -0
- package/dist/lib/github/gh-overload.d.ts +0 -38
- package/dist/lib/github/gh-overload.js +3 -55
- package/dist/lib/github/pr-mergeable.d.ts +3 -34
- package/dist/lib/github/pr-mergeable.js +2 -42
- package/dist/lib/github/pr-verdict.d.ts +0 -44
- package/dist/lib/github/pr-verdict.js +0 -36
- package/dist/lib/github/project-prs.d.ts +135 -105
- package/dist/lib/github/project-prs.js +530 -170
- package/dist/lib/github/release-drift.d.ts +45 -0
- package/dist/lib/github/release-drift.js +91 -0
- package/dist/lib/github/rest.d.ts +0 -50
- package/dist/lib/github/rest.js +0 -49
- package/dist/lib/github/viewer.d.ts +27 -0
- package/dist/lib/github/viewer.js +101 -0
- package/dist/lib/goose-commands.d.ts +0 -29
- package/dist/lib/goose-commands.js +3 -48
- package/dist/lib/harness/adapter.d.ts +0 -151
- package/dist/lib/harness/adapter.js +0 -41
- package/dist/lib/harness/adapters/claude.d.ts +0 -8
- package/dist/lib/harness/adapters/claude.js +0 -89
- package/dist/lib/harness/adapters/codex.js +0 -18
- package/dist/lib/harness/adapters/copilot.js +0 -3
- package/dist/lib/harness/adapters/cursor.js +0 -16
- package/dist/lib/harness/adapters/droid.js +0 -3
- package/dist/lib/harness/adapters/kimi.js +0 -19
- package/dist/lib/harness/adapters/muse.js +0 -9
- package/dist/lib/harness/adapters/opencode.js +0 -2
- package/dist/lib/harness/exec-config-version.d.ts +0 -2
- package/dist/lib/harness/exec-config-version.js +0 -13
- package/dist/lib/harness/index.js +0 -10
- package/dist/lib/harness-auth-capabilities.d.ts +0 -26
- package/dist/lib/harness-auth-capabilities.js +0 -18
- package/dist/lib/harness-connection-test.d.ts +0 -27
- package/dist/lib/harness-connection-test.js +2 -20
- package/dist/lib/heal.d.ts +0 -45
- package/dist/lib/heal.js +2 -82
- package/dist/lib/help.d.ts +0 -32
- package/dist/lib/help.js +0 -41
- package/dist/lib/helper-download.d.ts +0 -85
- package/dist/lib/helper-download.js +0 -95
- package/dist/lib/helper-versions.d.ts +0 -51
- package/dist/lib/helper-versions.js +1 -45
- package/dist/lib/hooks/cache.d.ts +0 -40
- package/dist/lib/hooks/cache.js +8 -122
- package/dist/lib/hooks/install.d.ts +0 -253
- package/dist/lib/hooks/install.js +49 -822
- package/dist/lib/hooks/match.d.ts +0 -24
- package/dist/lib/hooks/match.js +0 -31
- package/dist/lib/hooks/profile.d.ts +0 -21
- package/dist/lib/hooks/profile.js +0 -28
- package/dist/lib/hosts/credential-transport.d.ts +0 -6
- package/dist/lib/hosts/credential-transport.js +0 -17
- package/dist/lib/hosts/credentials.d.ts +0 -35
- package/dist/lib/hosts/credentials.js +0 -38
- package/dist/lib/hosts/dispatch.d.ts +0 -140
- package/dist/lib/hosts/dispatch.js +0 -176
- package/dist/lib/hosts/logs.d.ts +0 -25
- package/dist/lib/hosts/logs.js +1 -51
- package/dist/lib/hosts/option.d.ts +0 -12
- package/dist/lib/hosts/option.js +0 -12
- package/dist/lib/hosts/passthrough.d.ts +0 -129
- package/dist/lib/hosts/passthrough.js +12 -249
- package/dist/lib/hosts/progress.d.ts +0 -90
- package/dist/lib/hosts/progress.js +5 -115
- package/dist/lib/hosts/providers/devices.d.ts +0 -19
- package/dist/lib/hosts/providers/devices.js +1 -34
- package/dist/lib/hosts/providers/local.d.ts +0 -14
- package/dist/lib/hosts/providers/local.js +0 -22
- package/dist/lib/hosts/ready.d.ts +0 -99
- package/dist/lib/hosts/ready.js +0 -101
- package/dist/lib/hosts/reconcile.d.ts +0 -38
- package/dist/lib/hosts/reconcile.js +1 -50
- package/dist/lib/hosts/reconnect.d.ts +0 -75
- package/dist/lib/hosts/reconnect.js +0 -98
- package/dist/lib/hosts/registry.d.ts +0 -74
- package/dist/lib/hosts/registry.js +0 -110
- package/dist/lib/hosts/remote-cmd.d.ts +1 -228
- package/dist/lib/hosts/remote-cmd.js +19 -294
- package/dist/lib/hosts/remote-cmd.test-fixture.d.ts +0 -1
- package/dist/lib/hosts/remote-cmd.test-fixture.js +0 -12
- package/dist/lib/hosts/remote-os.d.ts +0 -19
- package/dist/lib/hosts/remote-os.js +0 -22
- package/dist/lib/hosts/remote-session-id.d.ts +0 -22
- package/dist/lib/hosts/remote-session-id.js +0 -24
- package/dist/lib/hosts/routing-flag.d.ts +0 -21
- package/dist/lib/hosts/routing-flag.js +0 -21
- package/dist/lib/hosts/run-target.d.ts +0 -53
- package/dist/lib/hosts/run-target.js +0 -56
- package/dist/lib/hosts/session-index.d.ts +1 -53
- package/dist/lib/hosts/session-index.js +2 -59
- package/dist/lib/hosts/session-marker.d.ts +0 -31
- package/dist/lib/hosts/session-marker.js +0 -32
- package/dist/lib/hosts/ssh-config.d.ts +0 -25
- package/dist/lib/hosts/ssh-config.js +1 -32
- package/dist/lib/hosts/tasks.d.ts +0 -54
- package/dist/lib/hosts/tasks.js +0 -35
- package/dist/lib/hosts/types.d.ts +0 -39
- package/dist/lib/hosts/types.js +0 -22
- package/dist/lib/humans.d.ts +0 -21
- package/dist/lib/humans.js +0 -30
- package/dist/lib/identity/client.d.ts +1 -35
- package/dist/lib/identity/client.js +3 -29
- package/dist/lib/identity/index.d.ts +3 -27
- package/dist/lib/identity/index.js +8 -24
- package/dist/lib/import.d.ts +0 -104
- package/dist/lib/import.js +1 -137
- package/dist/lib/installations/active-check.d.ts +0 -53
- package/dist/lib/installations/active-check.js +0 -49
- package/dist/lib/installations/index.d.ts +0 -9
- package/dist/lib/installations/index.js +0 -9
- package/dist/lib/installations/installation-lock.js +0 -8
- package/dist/lib/installations/launch-gate.d.ts +0 -56
- package/dist/lib/installations/launch-gate.js +0 -83
- package/dist/lib/installations/migrate.d.ts +0 -100
- package/dist/lib/installations/migrate.js +105 -572
- package/dist/lib/installations/native-command.d.ts +0 -1
- package/dist/lib/installations/native-command.js +0 -6
- package/dist/lib/installations/resolve.d.ts +0 -24
- package/dist/lib/installations/resolve.js +0 -24
- package/dist/lib/installations/shims.d.ts +0 -395
- package/dist/lib/installations/shims.js +30 -957
- package/dist/lib/installations/store.d.ts +0 -199
- package/dist/lib/installations/store.js +1 -297
- package/dist/lib/installations/strategies.d.ts +0 -44
- package/dist/lib/installations/strategies.js +0 -87
- package/dist/lib/installations/types.d.ts +1 -67
- package/dist/lib/installations/types.js +0 -6
- package/dist/lib/installations/update-cancellation.d.ts +0 -74
- package/dist/lib/installations/update-cancellation.js +0 -74
- package/dist/lib/installations/update-policy.d.ts +0 -57
- package/dist/lib/installations/update-policy.js +0 -62
- package/dist/lib/installations/update-runtime.d.ts +0 -88
- package/dist/lib/installations/update-runtime.js +1 -127
- package/dist/lib/installations/update.d.ts +0 -53
- package/dist/lib/installations/update.js +0 -95
- package/dist/lib/installations/versions.d.ts +0 -310
- package/dist/lib/installations/versions.js +14 -837
- package/dist/lib/isolation-boundary-report.d.ts +0 -7
- package/dist/lib/isolation-boundary-report.js +0 -7
- package/dist/lib/launch-identity.d.ts +0 -8
- package/dist/lib/launch-identity.js +0 -8
- package/dist/lib/linear-autoclose.d.ts +0 -25
- package/dist/lib/linear-autoclose.js +0 -19
- package/dist/lib/linear-cache.d.ts +0 -57
- package/dist/lib/linear-cache.js +1 -81
- package/dist/lib/linear-project-counts.d.ts +0 -83
- package/dist/lib/linear-project-counts.js +2 -64
- package/dist/lib/linear-projects.d.ts +0 -62
- package/dist/lib/linear-projects.js +0 -85
- package/dist/lib/linear-rate-limit.d.ts +0 -21
- package/dist/lib/linear-rate-limit.js +1 -93
- package/dist/lib/linux-userns.d.ts +1 -42
- package/dist/lib/linux-userns.js +0 -47
- package/dist/lib/lock-compromise.d.ts +0 -7
- package/dist/lib/lock-compromise.js +0 -7
- package/dist/lib/log-follow.d.ts +0 -2
- package/dist/lib/log-follow.js +5 -15
- package/dist/lib/loop.d.ts +0 -106
- package/dist/lib/loop.js +0 -135
- package/dist/lib/machine-id.d.ts +0 -19
- package/dist/lib/machine-id.js +0 -19
- package/dist/lib/mailbox-gc.d.ts +0 -7
- package/dist/lib/mailbox-gc.js +0 -25
- package/dist/lib/mailbox-target.d.ts +0 -31
- package/dist/lib/mailbox-target.js +0 -27
- package/dist/lib/mailbox.d.ts +0 -77
- package/dist/lib/mailbox.js +5 -105
- package/dist/lib/manifest.d.ts +0 -4
- package/dist/lib/manifest.js +0 -36
- package/dist/lib/markdown.d.ts +0 -3
- package/dist/lib/markdown.js +0 -9
- package/dist/lib/mcp-registry.d.ts +1 -50
- package/dist/lib/mcp-registry.js +0 -64
- package/dist/lib/mcp.d.ts +0 -115
- package/dist/lib/mcp.js +3 -199
- package/dist/lib/memory-cache.d.ts +0 -11
- package/dist/lib/memory-cache.js +0 -9
- package/dist/lib/memory.d.ts +0 -52
- package/dist/lib/memory.js +12 -74
- package/dist/lib/menubar/download-menubar.d.ts +0 -35
- package/dist/lib/menubar/download-menubar.js +0 -38
- package/dist/lib/menubar/install-menubar.d.ts +0 -405
- package/dist/lib/menubar/install-menubar.js +25 -667
- package/dist/lib/menubar/migrate-prefs.d.ts +0 -47
- package/dist/lib/menubar/migrate-prefs.js +1 -70
- package/dist/lib/menubar/notify-desktop.d.ts +0 -82
- package/dist/lib/menubar/notify-desktop.js +0 -68
- package/dist/lib/menubar/resolve-version.d.ts +0 -41
- package/dist/lib/menubar/resolve-version.js +2 -44
- package/dist/lib/menubar/snapshot.d.ts +13 -66
- package/dist/lib/menubar/snapshot.js +45 -39
- package/dist/lib/merged-resources.d.ts +0 -10
- package/dist/lib/merged-resources.js +0 -10
- package/dist/lib/migrate-fold.d.ts +0 -31
- package/dist/lib/migrate-fold.js +6 -38
- package/dist/lib/model-tier-overrides.d.ts +0 -30
- package/dist/lib/model-tier-overrides.js +0 -14
- package/dist/lib/model-tiers.d.ts +0 -43
- package/dist/lib/model-tiers.js +5 -78
- package/dist/lib/models.d.ts +0 -145
- package/dist/lib/models.js +3 -333
- package/dist/lib/monitors/config.d.ts +0 -187
- package/dist/lib/monitors/config.js +4 -101
- package/dist/lib/monitors/dispatch.d.ts +0 -22
- package/dist/lib/monitors/dispatch.js +0 -35
- package/dist/lib/monitors/engine.d.ts +1 -53
- package/dist/lib/monitors/engine.js +17 -106
- package/dist/lib/monitors/fingerprint.d.ts +0 -43
- package/dist/lib/monitors/fingerprint.js +0 -57
- package/dist/lib/monitors/pid-watch.d.ts +0 -31
- package/dist/lib/monitors/pid-watch.js +0 -31
- package/dist/lib/monitors/remote.d.ts +0 -52
- package/dist/lib/monitors/remote.js +0 -42
- package/dist/lib/monitors/sources/command.d.ts +2 -9
- package/dist/lib/monitors/sources/command.js +13 -34
- package/dist/lib/monitors/sources/device.d.ts +0 -10
- package/dist/lib/monitors/sources/device.js +0 -14
- package/dist/lib/monitors/sources/failure.d.ts +0 -27
- package/dist/lib/monitors/sources/failure.js +0 -27
- package/dist/lib/monitors/sources/file.d.ts +0 -10
- package/dist/lib/monitors/sources/file.js +0 -11
- package/dist/lib/monitors/sources/http.d.ts +0 -7
- package/dist/lib/monitors/sources/http.js +0 -9
- package/dist/lib/monitors/sources/index.d.ts +0 -9
- package/dist/lib/monitors/sources/index.js +0 -9
- package/dist/lib/monitors/sources/poll.d.ts +0 -8
- package/dist/lib/monitors/sources/poll.js +0 -8
- package/dist/lib/monitors/sources/types.d.ts +0 -18
- package/dist/lib/monitors/sources/types.js +0 -8
- package/dist/lib/monitors/sources/webhook.d.ts +0 -7
- package/dist/lib/monitors/sources/webhook.js +0 -7
- package/dist/lib/monitors/sources/ws.d.ts +0 -10
- package/dist/lib/monitors/sources/ws.js +3 -13
- package/dist/lib/monitors/state.d.ts +0 -132
- package/dist/lib/monitors/state.js +2 -86
- package/dist/lib/native-accounts.d.ts +0 -32
- package/dist/lib/native-accounts.js +0 -17
- package/dist/lib/net-close.d.ts +0 -9
- package/dist/lib/net-close.js +0 -5
- package/dist/lib/notify.d.ts +0 -47
- package/dist/lib/notify.js +0 -30
- package/dist/lib/onepassword.d.ts +0 -14
- package/dist/lib/onepassword.js +0 -12
- package/dist/lib/open-url.d.ts +0 -38
- package/dist/lib/open-url.js +1 -69
- package/dist/lib/openclaw-keychain.js +2 -7
- package/dist/lib/operator.d.ts +0 -9
- package/dist/lib/operator.js +0 -34
- package/dist/lib/origin-machine.d.ts +0 -16
- package/dist/lib/origin-machine.js +0 -16
- package/dist/lib/output/git-output.d.ts +0 -31
- package/dist/lib/output/git-output.js +4 -43
- package/dist/lib/overdue.d.ts +0 -35
- package/dist/lib/overdue.js +0 -60
- package/dist/lib/owner-message.d.ts +0 -20
- package/dist/lib/owner-message.js +1 -40
- package/dist/lib/packages/output-home.d.ts +0 -28
- package/dist/lib/packages/output-home.js +0 -114
- package/dist/lib/paths.d.ts +0 -26
- package/dist/lib/paths.js +1 -27
- package/dist/lib/percentile.d.ts +0 -11
- package/dist/lib/percentile.js +0 -11
- package/dist/lib/perf/db.d.ts +0 -16
- package/dist/lib/perf/db.js +3 -32
- package/dist/lib/perf/spool.d.ts +0 -12
- package/dist/lib/perf/spool.js +0 -13
- package/dist/lib/perf/types.d.ts +0 -26
- package/dist/lib/perf/types.js +0 -1
- package/dist/lib/permissions-registry.d.ts +0 -48
- package/dist/lib/permissions-registry.js +0 -108
- package/dist/lib/permissions.d.ts +0 -215
- package/dist/lib/permissions.js +4 -407
- package/dist/lib/picker.d.ts +0 -124
- package/dist/lib/picker.js +0 -140
- package/dist/lib/placement.d.ts +0 -57
- package/dist/lib/placement.js +0 -47
- package/dist/lib/platform/exec.d.ts +0 -73
- package/dist/lib/platform/exec.js +0 -80
- package/dist/lib/platform/index.d.ts +0 -14
- package/dist/lib/platform/index.js +0 -14
- package/dist/lib/platform/ipc.d.ts +0 -10
- package/dist/lib/platform/ipc.js +0 -13
- package/dist/lib/platform/links.d.ts +0 -14
- package/dist/lib/platform/links.js +0 -25
- package/dist/lib/platform/paths.d.ts +0 -48
- package/dist/lib/platform/paths.js +0 -52
- package/dist/lib/platform/posixpath.d.ts +0 -18
- package/dist/lib/platform/posixpath.js +0 -62
- package/dist/lib/platform/process.d.ts +0 -67
- package/dist/lib/platform/process.js +5 -99
- package/dist/lib/platform/winpath.d.ts +0 -50
- package/dist/lib/platform/winpath.js +0 -81
- package/dist/lib/plugins/plugin-marketplace.d.ts +0 -165
- package/dist/lib/plugins/plugin-marketplace.js +10 -238
- package/dist/lib/plugins/plugins.d.ts +0 -238
- package/dist/lib/plugins/plugins.js +20 -454
- package/dist/lib/plugins/skills.d.ts +0 -86
- package/dist/lib/plugins/skills.js +1 -139
- package/dist/lib/pr-land-detach.d.ts +0 -17
- package/dist/lib/pr-land-detach.js +0 -30
- package/dist/lib/pricing/cost.d.ts +0 -29
- package/dist/lib/pricing/cost.js +0 -38
- package/dist/lib/pricing/index.d.ts +0 -6
- package/dist/lib/pricing/index.js +0 -6
- package/dist/lib/pricing/table.d.ts +0 -8
- package/dist/lib/pricing/table.js +3 -56
- package/dist/lib/probe.d.ts +0 -5
- package/dist/lib/probe.js +0 -40
- package/dist/lib/profiles-presets.d.ts +0 -20
- package/dist/lib/profiles-presets.js +1 -36
- package/dist/lib/profiles.d.ts +0 -185
- package/dist/lib/profiles.js +1 -158
- package/dist/lib/project-doctor.d.ts +0 -29
- package/dist/lib/project-doctor.js +0 -26
- package/dist/lib/project-focus.d.ts +0 -41
- package/dist/lib/project-focus.js +0 -49
- package/dist/lib/project-import.d.ts +0 -41
- package/dist/lib/project-import.js +0 -36
- package/dist/lib/project-key.d.ts +0 -65
- package/dist/lib/project-key.js +0 -70
- package/dist/lib/project-launch.d.ts +0 -49
- package/dist/lib/project-launch.js +2 -91
- package/dist/lib/project-probe.d.ts +0 -86
- package/dist/lib/project-probe.js +1 -88
- package/dist/lib/project-pull.d.ts +0 -96
- package/dist/lib/project-pull.js +0 -122
- package/dist/lib/project-resources.d.ts +0 -44
- package/dist/lib/project-resources.js +7 -171
- package/dist/lib/project-root.d.ts +0 -95
- package/dist/lib/project-root.js +0 -101
- package/dist/lib/project-schedule.d.ts +0 -43
- package/dist/lib/project-schedule.js +0 -52
- package/dist/lib/project-status.d.ts +0 -108
- package/dist/lib/project-status.js +0 -117
- package/dist/lib/projects.d.ts +0 -197
- package/dist/lib/projects.js +1 -213
- package/dist/lib/pwsh.d.ts +0 -41
- package/dist/lib/pwsh.js +0 -51
- package/dist/lib/quick-todo.d.ts +84 -0
- package/dist/lib/quick-todo.js +243 -0
- package/dist/lib/reconcile-and-repair.d.ts +0 -78
- package/dist/lib/reconcile-and-repair.js +3 -66
- package/dist/lib/redact.d.ts +0 -29
- package/dist/lib/redact.js +0 -54
- package/dist/lib/refresh-coordinator.d.ts +0 -15
- package/dist/lib/refresh-coordinator.js +0 -10
- package/dist/lib/refresh.d.ts +0 -39
- package/dist/lib/refresh.js +0 -45
- package/dist/lib/registry.d.ts +0 -65
- package/dist/lib/registry.js +0 -127
- package/dist/lib/reminders.d.ts +0 -21
- package/dist/lib/reminders.js +0 -30
- package/dist/lib/remote-agents-json.d.ts +0 -44
- package/dist/lib/remote-agents-json.js +1 -44
- package/dist/lib/reserved-stores.d.ts +0 -28
- package/dist/lib/reserved-stores.js +2 -28
- package/dist/lib/resource-aliases.d.ts +0 -12
- package/dist/lib/resource-aliases.js +0 -12
- package/dist/lib/resource-content-diff.d.ts +0 -28
- package/dist/lib/resource-content-diff.js +7 -34
- package/dist/lib/resource-inventory.d.ts +0 -51
- package/dist/lib/resource-inventory.js +0 -45
- package/dist/lib/resource-patterns.d.ts +0 -32
- package/dist/lib/resource-patterns.js +0 -34
- package/dist/lib/resource-profiles.d.ts +0 -7
- package/dist/lib/resource-profiles.js +0 -11
- package/dist/lib/resources/types.d.ts +0 -50
- package/dist/lib/resources/types.js +0 -7
- package/dist/lib/resources/workflows.d.ts +0 -7
- package/dist/lib/resources/workflows.js +0 -13
- package/dist/lib/resources.d.ts +0 -65
- package/dist/lib/resources.js +0 -78
- package/dist/lib/routers.d.ts +0 -67
- package/dist/lib/routers.js +0 -60
- package/dist/lib/routine-activation.d.ts +0 -23
- package/dist/lib/routine-activation.js +0 -24
- package/dist/lib/routine-context.d.ts +1 -91
- package/dist/lib/routine-context.js +0 -107
- package/dist/lib/routine-notify-owner.d.ts +0 -79
- package/dist/lib/routine-notify-owner.js +1 -103
- package/dist/lib/routine-notify.d.ts +0 -70
- package/dist/lib/routine-notify.js +1 -75
- package/dist/lib/routine-process-cleanup.d.ts +0 -1
- package/dist/lib/routine-process-cleanup.js +1 -4
- package/dist/lib/routine-readiness.d.ts +0 -63
- package/dist/lib/routine-readiness.js +4 -86
- package/dist/lib/routines-format.d.ts +0 -40
- package/dist/lib/routines-format.js +0 -67
- package/dist/lib/routines-placement.d.ts +0 -33
- package/dist/lib/routines-placement.js +0 -40
- package/dist/lib/routines-project.d.ts +0 -57
- package/dist/lib/routines-project.js +6 -80
- package/dist/lib/rules/compile.d.ts +0 -66
- package/dist/lib/rules/compile.js +6 -118
- package/dist/lib/rules/compose.d.ts +0 -56
- package/dist/lib/rules/compose.js +2 -83
- package/dist/lib/rules/rules.d.ts +0 -23
- package/dist/lib/rules/rules.js +0 -35
- package/dist/lib/rules/run-sync.d.ts +0 -16
- package/dist/lib/rules/run-sync.js +1 -44
- package/dist/lib/run-config.d.ts +0 -7
- package/dist/lib/run-config.js +0 -8
- package/dist/lib/run-defaults.d.ts +0 -14
- package/dist/lib/run-defaults.js +0 -14
- package/dist/lib/run-notify.d.ts +0 -18
- package/dist/lib/run-notify.js +0 -36
- package/dist/lib/run-trace-sync.d.ts +0 -21
- package/dist/lib/run-trace-sync.js +2 -66
- package/dist/lib/rush-session.d.ts +0 -26
- package/dist/lib/rush-session.js +0 -28
- package/dist/lib/sandbox.d.ts +0 -45
- package/dist/lib/sandbox.js +5 -93
- package/dist/lib/scheduler.d.ts +0 -28
- package/dist/lib/scheduler.js +0 -45
- package/dist/lib/scheduling/routines.d.ts +0 -652
- package/dist/lib/scheduling/routines.js +8 -475
- package/dist/lib/secrets-cli.d.ts +3 -8
- package/dist/lib/secrets-cli.js +1 -19
- package/dist/lib/secrets-client.d.ts +0 -117
- package/dist/lib/secrets-client.js +4 -275
- package/dist/lib/secrets-policy.d.ts +0 -142
- package/dist/lib/secrets-policy.js +4 -237
- package/dist/lib/secrets-types.d.ts +0 -87
- package/dist/lib/secrets-types.js +0 -13
- package/dist/lib/self-heal/checks/hook-manifest.js +0 -25
- package/dist/lib/self-heal/checks/hook-runtime.js +0 -5
- package/dist/lib/self-heal/checks/install-staging.d.ts +0 -1
- package/dist/lib/self-heal/checks/install-staging.js +1 -28
- package/dist/lib/self-heal/checks/menubar-helper.js +0 -5
- package/dist/lib/self-heal/checks/path.js +0 -9
- package/dist/lib/self-heal/checks/resources.js +0 -5
- package/dist/lib/self-heal/checks/shadowing.js +2 -16
- package/dist/lib/self-heal/checks/shims.js +0 -14
- package/dist/lib/self-heal/child.d.ts +12 -0
- package/dist/lib/self-heal/child.js +23 -0
- package/dist/lib/self-heal/registry.d.ts +0 -9
- package/dist/lib/self-heal/registry.js +0 -16
- package/dist/lib/self-heal/types.d.ts +0 -12
- package/dist/lib/self-heal/types.js +0 -15
- package/dist/lib/self-update.d.ts +0 -312
- package/dist/lib/self-update.js +9 -360
- package/dist/lib/service-manifest.d.ts +0 -39
- package/dist/lib/service-manifest.js +0 -72
- package/dist/lib/session/active.d.ts +13 -869
- package/dist/lib/session/active.js +20 -976
- package/dist/lib/session/actor-sidecar.d.ts +1 -32
- package/dist/lib/session/actor-sidecar.js +1 -41
- package/dist/lib/session/bookmarks.d.ts +0 -33
- package/dist/lib/session/bookmarks.js +0 -37
- package/dist/lib/session/bundle.d.ts +0 -86
- package/dist/lib/session/bundle.js +0 -54
- package/dist/lib/session/claude-accounts.d.ts +0 -40
- package/dist/lib/session/claude-accounts.js +0 -49
- package/dist/lib/session/cloud.d.ts +1 -23
- package/dist/lib/session/cloud.js +0 -26
- package/dist/lib/session/db.d.ts +5 -658
- package/dist/lib/session/db.js +22 -1443
- package/dist/lib/session/detached.d.ts +0 -21
- package/dist/lib/session/detached.js +0 -29
- package/dist/lib/session/discover.d.ts +3 -420
- package/dist/lib/session/discover.js +30 -1123
- package/dist/lib/session/fork.d.ts +1 -41
- package/dist/lib/session/fork.js +0 -19
- package/dist/lib/session/ghostty-tabs.d.ts +0 -24
- package/dist/lib/session/ghostty-tabs.js +0 -37
- package/dist/lib/session/glance-files.d.ts +19 -0
- package/dist/lib/session/glance-files.js +258 -0
- package/dist/lib/session/hook-sessions.d.ts +0 -33
- package/dist/lib/session/hook-sessions.js +4 -99
- package/dist/lib/session/host-link.d.ts +1 -94
- package/dist/lib/session/host-link.js +1 -81
- package/dist/lib/session/inject-target.d.ts +8 -0
- package/dist/lib/session/inject-target.js +32 -0
- package/dist/lib/session/inject.d.ts +0 -15
- package/dist/lib/session/inject.js +0 -15
- package/dist/lib/session/live-metadata.d.ts +1 -34
- package/dist/lib/session/live-metadata.js +1 -73
- package/dist/lib/session/local-tmux-attach.d.ts +0 -37
- package/dist/lib/session/local-tmux-attach.js +1 -76
- package/dist/lib/session/migrate-targets.d.ts +0 -46
- package/dist/lib/session/migrate-targets.js +0 -24
- package/dist/lib/session/migrations.d.ts +0 -12
- package/dist/lib/session/migrations.js +1 -20
- package/dist/lib/session/mirror.d.ts +0 -32
- package/dist/lib/session/mirror.js +0 -77
- package/dist/lib/session/origin-machine.js +0 -3
- package/dist/lib/session/pid-registry.d.ts +0 -80
- package/dist/lib/session/pid-registry.js +2 -81
- package/dist/lib/session/presence.d.ts +0 -39
- package/dist/lib/session/presence.js +2 -52
- package/dist/lib/session/process-view.d.ts +0 -11
- package/dist/lib/session/process-view.js +0 -25
- package/dist/lib/session/projection.d.ts +0 -3
- package/dist/lib/session/projection.js +0 -10
- package/dist/lib/session/provenance.d.ts +1 -37
- package/dist/lib/session/provenance.js +0 -69
- package/dist/lib/session/recovery.d.ts +1 -40
- package/dist/lib/session/recovery.js +2 -80
- package/dist/lib/session/relative-time.js +0 -3
- package/dist/lib/session/remote/peer-stream.d.ts +0 -42
- package/dist/lib/session/remote/peer-stream.js +0 -64
- package/dist/lib/session/remote/remote-bundle.d.ts +0 -6
- package/dist/lib/session/remote/remote-bundle.js +0 -21
- package/dist/lib/session/remote/remote-list.d.ts +1 -110
- package/dist/lib/session/remote/remote-list.js +5 -139
- package/dist/lib/session/remote/remote.d.ts +0 -98
- package/dist/lib/session/remote/remote.js +3 -119
- package/dist/lib/session/remote/watch.d.ts +1 -34
- package/dist/lib/session/remote/watch.js +12 -72
- package/dist/lib/session/remote-active.d.ts +0 -35
- package/dist/lib/session/remote-active.js +0 -48
- package/dist/lib/session/remote-bundle.js +0 -2
- package/dist/lib/session/remote-list.js +0 -2
- package/dist/lib/session/remote-preview-cache.d.ts +0 -7
- package/dist/lib/session/remote-preview-cache.js +1 -76
- package/dist/lib/session/remote.js +0 -2
- package/dist/lib/session/resume-command.d.ts +0 -6
- package/dist/lib/session/resume-command.js +0 -6
- package/dist/lib/session/resume-owner.d.ts +1 -52
- package/dist/lib/session/resume-owner.js +0 -56
- package/dist/lib/session/run-names.d.ts +0 -24
- package/dist/lib/session/run-names.js +0 -26
- package/dist/lib/session/session-cache.d.ts +2 -146
- package/dist/lib/session/session-cache.js +26 -203
- package/dist/lib/session/short-id.js +0 -3
- package/dist/lib/session/sync/agents.d.ts +0 -68
- package/dist/lib/session/sync/agents.js +0 -0
- package/dist/lib/session/sync/backend.d.ts +0 -39
- package/dist/lib/session/sync/backend.js +0 -45
- package/dist/lib/session/sync/config.d.ts +0 -27
- package/dist/lib/session/sync/config.js +0 -56
- package/dist/lib/session/sync/managed-config.d.ts +0 -17
- package/dist/lib/session/sync/managed-config.js +0 -17
- package/dist/lib/session/sync/managed-key.d.ts +0 -38
- package/dist/lib/session/sync/managed-key.js +1 -42
- package/dist/lib/session/sync/net-client.d.ts +0 -36
- package/dist/lib/session/sync/net-client.js +0 -30
- package/dist/lib/session/sync/provision.d.ts +0 -2
- package/dist/lib/session/sync/provision.js +0 -13
- package/dist/lib/session/sync/r2.d.ts +0 -20
- package/dist/lib/session/sync/r2.js +0 -20
- package/dist/lib/session/sync/transcript-crypto.d.ts +0 -37
- package/dist/lib/session/sync/transcript-crypto.js +5 -37
- package/dist/lib/session/sync/worker-template.d.ts +0 -5
- package/dist/lib/session/sync/worker-template.js +0 -40
- package/dist/lib/session/testdata/pid-registry-namespace.js +0 -2
- package/dist/lib/session/testdata/process-view-private.js +0 -1
- package/dist/lib/session/throughput.d.ts +0 -24
- package/dist/lib/session/throughput.js +1 -25
- package/dist/lib/session/timeline-pass.d.ts +1 -63
- package/dist/lib/session/timeline-pass.js +161 -148
- package/dist/lib/session/title.d.ts +0 -182
- package/dist/lib/session/title.js +0 -139
- package/dist/lib/session/tool-index.d.ts +2 -21
- package/dist/lib/session/tool-index.js +3 -75
- package/dist/lib/session/tool-store.d.ts +2 -48
- package/dist/lib/session/tool-store.js +1 -33
- package/dist/lib/session/viewing-in.d.ts +0 -67
- package/dist/lib/session/viewing-in.js +1 -71
- package/dist/lib/session/watch.js +0 -2
- package/dist/lib/session/width.js +0 -3
- package/dist/lib/sessions-client.d.ts +0 -46
- package/dist/lib/sessions-client.js +36 -113
- package/dist/lib/settings-manifest.d.ts +1 -17
- package/dist/lib/settings-manifest.js +4 -57
- package/dist/lib/setup-tool-install.d.ts +0 -1
- package/dist/lib/setup-tool-install.js +2 -7
- package/dist/lib/setup-tool-status.d.ts +0 -3
- package/dist/lib/setup-tool-status.js +4 -14
- package/dist/lib/sha256-asset.d.ts +0 -20
- package/dist/lib/sha256-asset.js +0 -20
- package/dist/lib/share-runtime.d.ts +0 -10
- package/dist/lib/share-runtime.js +1 -27
- package/dist/lib/shim-heal.d.ts +0 -15
- package/dist/lib/shim-heal.js +3 -29
- package/dist/lib/signin-badge.d.ts +0 -72
- package/dist/lib/signin-badge.js +0 -86
- package/dist/lib/sink-format.d.ts +0 -32
- package/dist/lib/sink-format.js +0 -14
- package/dist/lib/smart-launch.d.ts +0 -75
- package/dist/lib/smart-launch.js +1 -83
- package/dist/lib/snapshot.d.ts +0 -46
- package/dist/lib/snapshot.js +5 -31
- package/dist/lib/spinner.d.ts +0 -37
- package/dist/lib/spinner.js +0 -37
- package/dist/lib/sqlite.d.ts +0 -13
- package/dist/lib/sqlite.js +3 -71
- package/dist/lib/ssh-exec.d.ts +0 -209
- package/dist/lib/ssh-exec.js +11 -248
- package/dist/lib/ssh-tunnel.d.ts +0 -43
- package/dist/lib/ssh-tunnel.js +2 -48
- package/dist/lib/staleness/checkers/commands.d.ts +0 -4
- package/dist/lib/staleness/checkers/commands.js +0 -4
- package/dist/lib/staleness/checkers/hooks.d.ts +0 -10
- package/dist/lib/staleness/checkers/hooks.js +0 -15
- package/dist/lib/staleness/checkers/mcp.d.ts +0 -9
- package/dist/lib/staleness/checkers/mcp.js +0 -9
- package/dist/lib/staleness/checkers/permissions.d.ts +0 -12
- package/dist/lib/staleness/checkers/permissions.js +0 -13
- package/dist/lib/staleness/checkers/plugins.d.ts +0 -8
- package/dist/lib/staleness/checkers/plugins.js +0 -8
- package/dist/lib/staleness/checkers/rules.d.ts +0 -15
- package/dist/lib/staleness/checkers/rules.js +0 -26
- package/dist/lib/staleness/checkers/skills.d.ts +0 -4
- package/dist/lib/staleness/checkers/skills.js +0 -4
- package/dist/lib/staleness/checkers/subagents.d.ts +0 -9
- package/dist/lib/staleness/checkers/subagents.js +0 -9
- package/dist/lib/staleness/checkers/types.d.ts +0 -34
- package/dist/lib/staleness/checkers/types.js +0 -19
- package/dist/lib/staleness/checkers/workflows.d.ts +0 -7
- package/dist/lib/staleness/checkers/workflows.js +0 -7
- package/dist/lib/staleness/detectors/commands.js +0 -17
- package/dist/lib/staleness/detectors/hooks.js +1 -6
- package/dist/lib/staleness/detectors/mcp.js +0 -4
- package/dist/lib/staleness/detectors/permissions.js +10 -23
- package/dist/lib/staleness/detectors/rules.js +0 -6
- package/dist/lib/staleness/detectors/skills.d.ts +0 -1
- package/dist/lib/staleness/detectors/skills.js +1 -12
- package/dist/lib/staleness/detectors/types.d.ts +0 -10
- package/dist/lib/staleness/fingerprint.d.ts +0 -19
- package/dist/lib/staleness/fingerprint.js +0 -35
- package/dist/lib/staleness/index.d.ts +0 -28
- package/dist/lib/staleness/index.js +1 -45
- package/dist/lib/staleness/layers.d.ts +0 -23
- package/dist/lib/staleness/layers.js +0 -34
- package/dist/lib/staleness/prune.d.ts +0 -71
- package/dist/lib/staleness/prune.js +2 -27
- package/dist/lib/staleness/registry.d.ts +0 -10
- package/dist/lib/staleness/registry.js +3 -33
- package/dist/lib/staleness/types.d.ts +0 -36
- package/dist/lib/staleness/types.js +0 -5
- package/dist/lib/staleness/writers/commands.js +1 -48
- package/dist/lib/staleness/writers/hooks.js +1 -18
- package/dist/lib/staleness/writers/kinds.d.ts +0 -12
- package/dist/lib/staleness/writers/kinds.js +0 -1
- package/dist/lib/staleness/writers/lazy-map.d.ts +0 -11
- package/dist/lib/staleness/writers/mcp.js +0 -13
- package/dist/lib/staleness/writers/plugins.js +0 -4
- package/dist/lib/staleness/writers/rules.d.ts +0 -1
- package/dist/lib/staleness/writers/rules.js +1 -19
- package/dist/lib/staleness/writers/skills.js +3 -14
- package/dist/lib/staleness/writers/sources.d.ts +0 -11
- package/dist/lib/staleness/writers/sources.js +0 -32
- package/dist/lib/staleness/writers/subagents.js +0 -16
- package/dist/lib/staleness/writers/types.d.ts +0 -58
- package/dist/lib/staleness/writers/workflows.js +1 -1
- package/dist/lib/standalone-tools.d.ts +24 -0
- package/dist/lib/standalone-tools.js +58 -0
- package/dist/lib/star-nudge.d.ts +0 -32
- package/dist/lib/star-nudge.js +2 -36
- package/dist/lib/startup/command-registry.d.ts +0 -45
- package/dist/lib/startup/command-registry.js +1 -46
- package/dist/lib/startup/dev-build.d.ts +0 -9
- package/dist/lib/startup/dev-build.js +1 -42
- package/dist/lib/startup/root-command.d.ts +0 -19
- package/dist/lib/startup/root-command.js +0 -19
- package/dist/lib/startup/spellcheck.d.ts +0 -13
- package/dist/lib/startup/spellcheck.js +0 -13
- package/dist/lib/state.d.ts +0 -376
- package/dist/lib/state.js +19 -737
- package/dist/lib/storage/selection.d.ts +0 -40
- package/dist/lib/storage/selection.js +0 -29
- package/dist/lib/subagents-registry.d.ts +0 -56
- package/dist/lib/subagents-registry.js +0 -99
- package/dist/lib/subagents.d.ts +0 -128
- package/dist/lib/subagents.js +1 -158
- package/dist/lib/summarizer/config.d.ts +0 -37
- package/dist/lib/summarizer/config.js +0 -37
- package/dist/lib/summarizer/pass.d.ts +0 -20
- package/dist/lib/summarizer/pass.js +1 -34
- package/dist/lib/summarizer/summarize.d.ts +1 -49
- package/dist/lib/summarizer/summarize.js +0 -35
- package/dist/lib/sync-passphrase.d.ts +0 -16
- package/dist/lib/sync-passphrase.js +1 -18
- package/dist/lib/sync-status.d.ts +0 -72
- package/dist/lib/sync-status.js +0 -55
- package/dist/lib/sync-umbrella.d.ts +0 -54
- package/dist/lib/sync-umbrella.js +0 -48
- package/dist/lib/system-run-sync.d.ts +0 -5
- package/dist/lib/system-run-sync.js +1 -31
- package/dist/lib/teams/agents.d.ts +1 -444
- package/dist/lib/teams/agents.js +11 -871
- package/dist/lib/teams/api.d.ts +2 -52
- package/dist/lib/teams/api.js +4 -63
- package/dist/lib/teams/debug.d.ts +0 -6
- package/dist/lib/teams/debug.js +0 -6
- package/dist/lib/teams/delivery.d.ts +0 -41
- package/dist/lib/teams/delivery.js +0 -32
- package/dist/lib/teams/file_ops.d.ts +0 -11
- package/dist/lib/teams/file_ops.js +0 -11
- package/dist/lib/teams/forEach.d.ts +0 -76
- package/dist/lib/teams/forEach.js +1 -77
- package/dist/lib/teams/index.d.ts +1 -7
- package/dist/lib/teams/index.js +1 -7
- package/dist/lib/teams/parsers.d.ts +0 -4
- package/dist/lib/teams/parsers.js +0 -81
- package/dist/lib/teams/persistence.d.ts +0 -2
- package/dist/lib/teams/persistence.js +0 -12
- package/dist/lib/teams/placement-probe.d.ts +0 -12
- package/dist/lib/teams/placement-probe.js +1 -51
- package/dist/lib/teams/pr-watch.d.ts +0 -107
- package/dist/lib/teams/pr-watch.js +1 -107
- package/dist/lib/teams/registry.d.ts +0 -36
- package/dist/lib/teams/registry.js +0 -47
- package/dist/lib/teams/remoteWorktree.d.ts +0 -50
- package/dist/lib/teams/remoteWorktree.js +1 -96
- package/dist/lib/teams/scheduler.d.ts +0 -111
- package/dist/lib/teams/scheduler.js +2 -125
- package/dist/lib/teams/summarizer.d.ts +0 -22
- package/dist/lib/teams/summarizer.js +6 -50
- package/dist/lib/teams/supervisor.d.ts +0 -38
- package/dist/lib/teams/supervisor.js +0 -21
- package/dist/lib/teams/worktree.d.ts +0 -95
- package/dist/lib/teams/worktree.js +3 -110
- package/dist/lib/template.d.ts +0 -21
- package/dist/lib/template.js +0 -23
- package/dist/lib/term-client.d.ts +0 -26
- package/dist/lib/term-client.js +0 -48
- package/dist/lib/term-driver.d.ts +0 -5
- package/dist/lib/term-driver.js +0 -8
- package/dist/lib/terminal/backends/ghostty.d.ts +0 -2
- package/dist/lib/terminal/backends/ghostty.js +0 -12
- package/dist/lib/terminal/backends/index.d.ts +0 -17
- package/dist/lib/terminal/backends/index.js +0 -15
- package/dist/lib/terminal/backends/iterm.d.ts +0 -2
- package/dist/lib/terminal/backends/iterm.js +0 -10
- package/dist/lib/terminal/backends/terminal-app.d.ts +0 -10
- package/dist/lib/terminal/backends/terminal-app.js +0 -30
- package/dist/lib/terminal/backends/tmux.d.ts +0 -10
- package/dist/lib/terminal/backends/tmux.js +0 -2
- package/dist/lib/terminal/backends/vscodium-agent.d.ts +0 -25
- package/dist/lib/terminal/backends/vscodium-agent.js +0 -36
- package/dist/lib/terminal/engine.d.ts +0 -17
- package/dist/lib/terminal/engine.js +0 -10
- package/dist/lib/terminal/index.d.ts +0 -8
- package/dist/lib/terminal/inject.d.ts +1 -173
- package/dist/lib/terminal/inject.js +0 -146
- package/dist/lib/terminal/policy.d.ts +0 -8
- package/dist/lib/terminal/policy.js +0 -1
- package/dist/lib/terminal/preferred.d.ts +0 -66
- package/dist/lib/terminal/preferred.js +0 -30
- package/dist/lib/terminal/quote.d.ts +0 -8
- package/dist/lib/terminal/quote.js +0 -8
- package/dist/lib/terminal/resolve.d.ts +0 -46
- package/dist/lib/terminal/resolve.js +0 -30
- package/dist/lib/terminal/run-surface.d.ts +0 -56
- package/dist/lib/terminal/run-surface.js +0 -46
- package/dist/lib/terminal/shell.d.ts +0 -3
- package/dist/lib/terminal/shell.js +0 -13
- package/dist/lib/terminal/transport.d.ts +0 -14
- package/dist/lib/terminal/transport.js +1 -30
- package/dist/lib/terminal/types.d.ts +0 -40
- package/dist/lib/terminal/types.js +0 -10
- package/dist/lib/text/relative-time.d.ts +0 -36
- package/dist/lib/text/relative-time.js +0 -43
- package/dist/lib/text/short-id.d.ts +0 -16
- package/dist/lib/text/short-id.js +0 -16
- package/dist/lib/text/width.d.ts +0 -24
- package/dist/lib/text/width.js +10 -52
- package/dist/lib/tmux/binary.d.ts +0 -36
- package/dist/lib/tmux/binary.js +0 -28
- package/dist/lib/tmux/index.d.ts +0 -5
- package/dist/lib/tmux/index.js +0 -5
- package/dist/lib/tmux/orphan-reap.d.ts +0 -253
- package/dist/lib/tmux/orphan-reap.js +3 -299
- package/dist/lib/tmux/paths.d.ts +0 -14
- package/dist/lib/tmux/paths.js +0 -14
- package/dist/lib/tmux/session.d.ts +0 -263
- package/dist/lib/tmux/session.js +6 -344
- package/dist/lib/traces/backend.d.ts +0 -20
- package/dist/lib/traces/backend.js +0 -23
- package/dist/lib/traces/classify.d.ts +0 -20
- package/dist/lib/traces/classify.js +0 -7
- package/dist/lib/traces/insights.d.ts +1 -84
- package/dist/lib/traces/insights.js +0 -126
- package/dist/lib/traces/phenotype.d.ts +0 -69
- package/dist/lib/traces/phenotype.js +0 -150
- package/dist/lib/traces/provision.d.ts +0 -1
- package/dist/lib/traces/provision.js +0 -5
- package/dist/lib/traces/schema2-build.d.ts +3 -60
- package/dist/lib/traces/schema2-build.js +8 -149
- package/dist/lib/traces/schema2-danger.d.ts +0 -30
- package/dist/lib/traces/schema2-danger.js +1 -63
- package/dist/lib/traces/schema2.d.ts +0 -11
- package/dist/lib/traces/segments.d.ts +0 -44
- package/dist/lib/traces/segments.js +0 -65
- package/dist/lib/traces/sync.d.ts +2 -239
- package/dist/lib/traces/sync.js +15 -237
- package/dist/lib/traces/worker-template.d.ts +0 -3
- package/dist/lib/traces/worker-template.js +0 -29
- package/dist/lib/triggers/handlers.d.ts +0 -82
- package/dist/lib/triggers/handlers.js +0 -75
- package/dist/lib/triggers/webhook.d.ts +0 -158
- package/dist/lib/triggers/webhook.js +0 -143
- package/dist/lib/types.d.ts +0 -736
- package/dist/lib/types.js +0 -50
- package/dist/lib/uninstall.d.ts +0 -17
- package/dist/lib/uninstall.js +0 -75
- package/dist/lib/usage-backoff.d.ts +0 -20
- package/dist/lib/usage-backoff.js +3 -60
- package/dist/lib/usage-refresh.d.ts +0 -154
- package/dist/lib/usage-refresh.js +8 -212
- package/dist/lib/verbs.d.ts +0 -12
- package/dist/lib/verbs.js +0 -12
- package/dist/lib/version-duplicates.d.ts +0 -6
- package/dist/lib/version-duplicates.js +0 -6
- package/dist/lib/version.d.ts +0 -55
- package/dist/lib/version.js +1 -58
- package/dist/lib/view-types.d.ts +0 -48
- package/dist/lib/warn-unpushed.d.ts +0 -27
- package/dist/lib/warn-unpushed.js +1 -45
- package/dist/lib/watchdog/history.d.ts +0 -1
- package/dist/lib/watchdog/history.js +0 -3
- package/dist/lib/watchdog/index.js +0 -2
- package/dist/lib/watchdog/log.d.ts +0 -19
- package/dist/lib/watchdog/log.js +0 -34
- package/dist/lib/watchdog/read.d.ts +0 -27
- package/dist/lib/watchdog/read.js +3 -58
- package/dist/lib/watchdog/rotate.d.ts +0 -139
- package/dist/lib/watchdog/rotate.js +2 -151
- package/dist/lib/watchdog/runner.d.ts +0 -125
- package/dist/lib/watchdog/runner.js +3 -223
- package/dist/lib/watchdog/service.d.ts +0 -1
- package/dist/lib/watchdog/service.js +0 -2
- package/dist/lib/watchdog/watchdog-agent.d.ts +0 -31
- package/dist/lib/watchdog/watchdog-agent.js +0 -27
- package/dist/lib/watchdog/watchdog.d.ts +0 -7
- package/dist/lib/watchdog/watchdog.js +0 -10
- package/dist/lib/watchdog/watchdogTail.js +0 -7
- package/dist/lib/whats-new.d.ts +0 -10
- package/dist/lib/whats-new.js +0 -21
- package/dist/lib/workflows-registry.d.ts +0 -45
- package/dist/lib/workflows-registry.js +0 -60
- package/dist/lib/workflows.d.ts +0 -282
- package/dist/lib/workflows.js +3 -213
- package/dist/lib/worktree/held.d.ts +0 -89
- package/dist/lib/worktree/held.js +1 -103
- package/dist/lib/wrap.d.ts +0 -32
- package/dist/lib/wrap.js +0 -32
- package/dist/lib/yaml-io.d.ts +0 -45
- package/dist/lib/yaml-io.js +0 -47
- package/dist/session-tracker/dist/adapters/claude.js +0 -2
- package/dist/session-tracker/dist/hook.sh +4 -37
- package/dist/session-tracker/dist/index.d.ts +0 -7
- package/dist/session-tracker/dist/index.js +0 -5
- package/dist/session-tracker/dist/install-hook.d.ts +0 -5
- package/dist/session-tracker/dist/install-hook.js +1 -15
- package/dist/session-tracker/dist/prune-state.js +0 -4
- package/dist/session-tracker/dist/reader.js +0 -4
- package/dist/session-tracker/dist/state-file.d.ts +0 -3
- package/dist/session-tracker/dist/state-file.js +3 -8
- package/package.json +3 -4
- package/scripts/postinstall.js +8 -116
- package/dist/lib/session/artifacts.d.ts +0 -14
- package/dist/lib/session/artifacts.js +0 -101
- package/dist/lib/session/bash-command.d.ts +0 -63
- package/dist/lib/session/bash-command.js +0 -490
- package/dist/lib/session/digest.d.ts +0 -66
- package/dist/lib/session/digest.js +0 -328
- package/dist/lib/session/highlights.d.ts +0 -151
- package/dist/lib/session/highlights.js +0 -391
- package/dist/lib/session/insights.d.ts +0 -165
- package/dist/lib/session/insights.js +0 -563
- package/dist/lib/session/linear.d.ts +0 -19
- package/dist/lib/session/linear.js +0 -99
- package/dist/lib/session/parse.d.ts +0 -224
- package/dist/lib/session/parse.js +0 -2408
- package/dist/lib/session/prompt.d.ts +0 -213
- package/dist/lib/session/prompt.js +0 -601
- package/dist/lib/session/render.d.ts +0 -133
- package/dist/lib/session/render.js +0 -1047
- package/dist/lib/session/share-html.d.ts +0 -35
- package/dist/lib/session/share-html.js +0 -319
- package/dist/lib/session/shell-programs.d.ts +0 -33
- package/dist/lib/session/shell-programs.js +0 -380
- package/dist/lib/session/state.d.ts +0 -269
- package/dist/lib/session/state.js +0 -777
- package/dist/lib/session/stream-render.d.ts +0 -4
- package/dist/lib/session/stream-render.js +0 -131
- package/dist/lib/session/tail.d.ts +0 -88
- package/dist/lib/session/tail.js +0 -294
- package/dist/lib/session/team-filter.d.ts +0 -129
- package/dist/lib/session/team-filter.js +0 -269
- package/dist/lib/session/timeline.d.ts +0 -172
- package/dist/lib/session/timeline.js +0 -636
- package/dist/lib/session/tool-calls.d.ts +0 -132
- package/dist/lib/session/tool-calls.js +0 -674
- package/dist/lib/session/trajectory-compare.d.ts +0 -48
- package/dist/lib/session/trajectory-compare.js +0 -116
- package/dist/lib/session/trajectory-html.d.ts +0 -19
- package/dist/lib/session/trajectory-html.js +0 -771
- package/dist/lib/session/trajectory-lineage.d.ts +0 -93
- package/dist/lib/session/trajectory-lineage.js +0 -195
- package/dist/lib/session/trajectory-text.d.ts +0 -38
- package/dist/lib/session/trajectory-text.js +0 -284
- package/dist/lib/session/trajectory.d.ts +0 -145
- package/dist/lib/session/trajectory.js +0 -394
- package/dist/lib/session/types.d.ts +0 -627
- package/dist/lib/session/types.js +0 -43
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Plugin discovery, validation, and syncing.
|
|
3
|
-
*
|
|
4
|
-
* Plugins are bundles in ~/.agents/plugins/ that package skills, hooks,
|
|
5
|
-
* commands, agents, workflows, bin scripts, MCP servers, and settings under a
|
|
6
|
-
* single manifest (plugin.json). They are user-authored resources, sitting
|
|
7
|
-
* alongside skills/, commands/, hooks/, etc. — git-tracked as source of truth.
|
|
8
|
-
* This module discovers plugins, validates their manifests, and syncs their
|
|
9
|
-
* contents into agent version homes. Workflows under a plugin’s workflows/
|
|
10
|
-
* are resolved at run time by resolveWorkflowRef (Phase 5 packaging).
|
|
11
|
-
*/
|
|
12
1
|
import * as fs from 'fs';
|
|
13
2
|
import * as path from 'path';
|
|
14
3
|
import * as yaml from 'yaml';
|
|
@@ -48,15 +37,6 @@ function isPluginRootEntry(pluginsDir, entry) {
|
|
|
48
37
|
return false;
|
|
49
38
|
}
|
|
50
39
|
}
|
|
51
|
-
/**
|
|
52
|
-
* Discover all plugins in a given plugins directory (e.g. ~/.agents/plugins/,
|
|
53
|
-
* ~/.agents/.system/plugins/, <cwd>/.agents/plugins/, ~/.agents-<alias>/plugins/).
|
|
54
|
-
* A valid plugin has a .claude-plugin/plugin.json manifest.
|
|
55
|
-
*
|
|
56
|
-
* `spec` stamps marketplace provenance onto each discovered plugin. Callers that
|
|
57
|
-
* scan a single source dir without a marketplace identity (e.g. project-launch)
|
|
58
|
-
* may omit it; those plugins default to the user marketplace.
|
|
59
|
-
*/
|
|
60
40
|
export function discoverPluginsInDir(pluginsDir, spec = { kind: 'user' }) {
|
|
61
41
|
if (!fs.existsSync(pluginsDir)) {
|
|
62
42
|
return [];
|
|
@@ -69,14 +49,6 @@ export function discoverPluginsInDir(pluginsDir, spec = { kind: 'user' }) {
|
|
|
69
49
|
const pluginRoot = path.join(pluginsDir, entry.name);
|
|
70
50
|
const manifest = loadPluginManifest(pluginRoot);
|
|
71
51
|
if (!manifest) {
|
|
72
|
-
// A directory that looks like a plugin root but has no valid manifest is
|
|
73
|
-
// silently invisible to every downstream command (list/info/sync, and the
|
|
74
|
-
// materialize-into-version-homes copy) with no other diagnostic anywhere
|
|
75
|
-
// in the chain — it can sit here indefinitely, on the correct git commit,
|
|
76
|
-
// and never surface as broken (RUSH-2270: the `work` plugin shipped
|
|
77
|
-
// without .claude-plugin/plugin.json and nothing noticed for a full merge
|
|
78
|
-
// cycle). Warn once here, at the one place that decides discoverability,
|
|
79
|
-
// so the gap is visible the moment `agents sync` runs.
|
|
80
52
|
const manifestPath = path.join(entry.name, PLUGIN_MANIFEST_DIR, PLUGIN_MANIFEST_FILE);
|
|
81
53
|
process.stderr.write(`agents-cli: '${entry.name}' in ${pluginsDir} has no valid ${manifestPath} ` +
|
|
82
54
|
`(missing, malformed JSON, or missing name/version) — skipped, not discovered as a plugin.\n`);
|
|
@@ -86,15 +58,6 @@ export function discoverPluginsInDir(pluginsDir, spec = { kind: 'user' }) {
|
|
|
86
58
|
}
|
|
87
59
|
return plugins;
|
|
88
60
|
}
|
|
89
|
-
/**
|
|
90
|
-
* Discover every plugin across ALL marketplaces — the user repo (~/.agents/),
|
|
91
|
-
* each enabled extra repo (~/.agents-<alias>/), and the project repo
|
|
92
|
-
* (<cwd>/.agents/) — stamping marketplace provenance onto each.
|
|
93
|
-
*
|
|
94
|
-
* Plugin names are NOT deduplicated across marketplaces: a `code` plugin in both
|
|
95
|
-
* the user repo and an extra repo yields two entries (`code@agents-cli` and
|
|
96
|
-
* `code@agents-<alias>`), each installing into its own marketplace directory.
|
|
97
|
-
*/
|
|
98
61
|
export function discoverPlugins(opts = {}) {
|
|
99
62
|
const out = [];
|
|
100
63
|
for (const dm of discoverMarketplaces(opts)) {
|
|
@@ -103,12 +66,6 @@ export function discoverPlugins(opts = {}) {
|
|
|
103
66
|
return out;
|
|
104
67
|
}
|
|
105
68
|
export function buildDiscoveredPlugin(pluginRoot, manifest, spec = { kind: 'user' }) {
|
|
106
|
-
// Every marketplace kind lays plugins out as `<repo>/plugins/<name>`, so the
|
|
107
|
-
// repo root is always the grandparent of pluginRoot — true for user
|
|
108
|
-
// (~/.agents), system (~/.agents/.system), each extra repo, and the project
|
|
109
|
-
// repo (<cwd>/.agents) alike. Deriving it here means every caller of
|
|
110
|
-
// buildDiscoveredPlugin (discoverPluginsInDir, inspectPluginCapabilities, …)
|
|
111
|
-
// gets provenance for free with no signature change.
|
|
112
69
|
const repoRoot = path.dirname(path.dirname(pluginRoot));
|
|
113
70
|
return {
|
|
114
71
|
name: manifest.name,
|
|
@@ -134,12 +91,6 @@ export function buildDiscoveredPlugin(pluginRoot, manifest, spec = { kind: 'user
|
|
|
134
91
|
},
|
|
135
92
|
};
|
|
136
93
|
}
|
|
137
|
-
/**
|
|
138
|
-
* Ordered, non-empty resource groups a plugin packages. Single source of truth
|
|
139
|
-
* for the breakdown shown by the plugin picker, `agents inspect --plugins`, and
|
|
140
|
-
* its detail view. Empty categories are omitted; `settings` appears only when
|
|
141
|
-
* the plugin merges non-permission settings.
|
|
142
|
-
*/
|
|
143
94
|
export function pluginResourceGroups(plugin) {
|
|
144
95
|
const groups = [
|
|
145
96
|
{ label: 'skills', items: plugin.skills.map((s) => `/${plugin.name}:${s}`) },
|
|
@@ -159,13 +110,6 @@ export function pluginResourceGroups(plugin) {
|
|
|
159
110
|
out.push({ label: 'settings', items: ['settings.json'] });
|
|
160
111
|
return out;
|
|
161
112
|
}
|
|
162
|
-
/**
|
|
163
|
-
* True when a manifest field declares an inline execution surface — a non-empty
|
|
164
|
-
* path string, a non-empty array, or an object with at least one key. The
|
|
165
|
-
* official plugin format lets `hooks`/`mcpServers` live inline in the manifest
|
|
166
|
-
* (a path or an inline map) instead of as a `hooks/` dir or `.mcp.json` file, so
|
|
167
|
-
* filesystem-only detection would miss them and auto-enable a hostile plugin.
|
|
168
|
-
*/
|
|
169
113
|
function manifestDeclaresExecSurface(value) {
|
|
170
114
|
if (typeof value === 'string')
|
|
171
115
|
return value.trim().length > 0;
|
|
@@ -179,9 +123,6 @@ export function inspectPluginCapabilities(pluginRoot) {
|
|
|
179
123
|
const manifest = loadPluginManifest(pluginRoot);
|
|
180
124
|
const plugin = manifest ? buildDiscoveredPlugin(pluginRoot, manifest) : null;
|
|
181
125
|
return {
|
|
182
|
-
// Inline manifest `hooks`/`mcpServers` are execution surfaces too — a cloned
|
|
183
|
-
// repo's project plugin must not be auto-enabled just because it ships the
|
|
184
|
-
// exec config inline in plugin.json rather than as a hooks/ dir or .mcp.json.
|
|
185
126
|
hasHooks: (plugin?.hooks.length || 0) > 0 ||
|
|
186
127
|
pluginHasDirectoryEntries(pluginRoot, 'hooks') ||
|
|
187
128
|
manifestDeclaresExecSurface(manifest?.hooks),
|
|
@@ -201,9 +142,6 @@ export function pluginCapabilityLabels(capabilities) {
|
|
|
201
142
|
.filter((key) => capabilities[key])
|
|
202
143
|
.map((key) => PLUGIN_EXEC_SURFACE_LABELS[key]);
|
|
203
144
|
}
|
|
204
|
-
/**
|
|
205
|
-
* Load a plugin manifest from a plugin directory.
|
|
206
|
-
*/
|
|
207
145
|
export function loadPluginManifest(pluginRoot) {
|
|
208
146
|
const manifestPath = path.join(pluginRoot, PLUGIN_MANIFEST_DIR, PLUGIN_MANIFEST_FILE);
|
|
209
147
|
if (!fs.existsSync(manifestPath)) {
|
|
@@ -247,14 +185,6 @@ export function assertPluginTargetContained(targetRoot, pluginsDir) {
|
|
|
247
185
|
throw new Error(`Plugin install target escapes plugins directory: ${targetRoot}`);
|
|
248
186
|
}
|
|
249
187
|
}
|
|
250
|
-
/**
|
|
251
|
-
* Get a specific plugin by name. On a cross-marketplace name collision the
|
|
252
|
-
* highest-precedence scope wins (project > extra > user > system) — the same
|
|
253
|
-
* resolution the sync writer's Map(last-wins) dedupe and collectPluginScopes()
|
|
254
|
-
* use. discoverPlugins() yields low→high precedence order, so the LAST match is
|
|
255
|
-
* the winner; returning the first match would resolve to the lowest scope (e.g.
|
|
256
|
-
* a system plugin over the user's same-named one), which is exactly backwards.
|
|
257
|
-
*/
|
|
258
188
|
export function getPlugin(name) {
|
|
259
189
|
const plugins = discoverPlugins();
|
|
260
190
|
for (let i = plugins.length - 1; i >= 0; i--) {
|
|
@@ -263,11 +193,6 @@ export function getPlugin(name) {
|
|
|
263
193
|
}
|
|
264
194
|
return null;
|
|
265
195
|
}
|
|
266
|
-
/**
|
|
267
|
-
* Check if an agent supports a specific plugin.
|
|
268
|
-
* If the plugin specifies agents, only those are supported.
|
|
269
|
-
* Otherwise defaults to all plugin-capable agents.
|
|
270
|
-
*/
|
|
271
196
|
export function pluginSupportsAgent(plugin, agent) {
|
|
272
197
|
if (!isCapable(agent, 'plugins'))
|
|
273
198
|
return false;
|
|
@@ -276,8 +201,6 @@ export function pluginSupportsAgent(plugin, agent) {
|
|
|
276
201
|
}
|
|
277
202
|
return true;
|
|
278
203
|
}
|
|
279
|
-
// ─── Discovery helpers ────────────────────────────────────────────────────────
|
|
280
|
-
/** Fact basenames (no .md) from a plugin's memory/ directory. */
|
|
281
204
|
export function discoverPluginMemory(pluginRoot) {
|
|
282
205
|
const dir = path.join(pluginRoot, 'memory');
|
|
283
206
|
if (!fs.existsSync(dir))
|
|
@@ -301,15 +224,6 @@ function discoverPluginSkills(pluginRoot) {
|
|
|
301
224
|
.filter(d => d.isDirectory() && !d.name.startsWith('.'))
|
|
302
225
|
.map(d => d.name);
|
|
303
226
|
}
|
|
304
|
-
/**
|
|
305
|
-
* The lifecycle events a plugin hooks into, read from hooks/hooks.json.
|
|
306
|
-
*
|
|
307
|
-
* The official plugin format wraps the event map under a `hooks` key
|
|
308
|
-
* (`{ description, hooks: { SessionStart: [...], PreToolUse: [...] } }`), so the
|
|
309
|
-
* meaningful keys are the events — NOT the top-level keys (`description`,
|
|
310
|
-
* `hooks`). Older/flat files put the event names at the top level directly; we
|
|
311
|
-
* read whichever object actually holds the event map.
|
|
312
|
-
*/
|
|
313
227
|
export function discoverPluginHooks(pluginRoot) {
|
|
314
228
|
const hooksFile = path.join(pluginRoot, 'hooks', 'hooks.json');
|
|
315
229
|
if (!fs.existsSync(hooksFile))
|
|
@@ -331,7 +245,6 @@ function discoverPluginScripts(pluginRoot) {
|
|
|
331
245
|
return [];
|
|
332
246
|
return fs.readdirSync(scriptsDir).filter(f => !f.startsWith('.'));
|
|
333
247
|
}
|
|
334
|
-
/** Discover command .md files inside a plugin's commands/ directory. */
|
|
335
248
|
export function discoverPluginCommands(pluginRoot) {
|
|
336
249
|
const commandsDir = path.join(pluginRoot, 'commands');
|
|
337
250
|
if (!fs.existsSync(commandsDir))
|
|
@@ -340,7 +253,6 @@ export function discoverPluginCommands(pluginRoot) {
|
|
|
340
253
|
.filter(f => f.endsWith('.md') && !f.startsWith('.'))
|
|
341
254
|
.map(f => f.slice(0, -3));
|
|
342
255
|
}
|
|
343
|
-
/** Discover agent definition .md files inside a plugin's agents/ directory. */
|
|
344
256
|
export function discoverPluginAgentDefs(pluginRoot) {
|
|
345
257
|
const agentsDir = path.join(pluginRoot, 'agents');
|
|
346
258
|
if (!fs.existsSync(agentsDir))
|
|
@@ -349,13 +261,6 @@ export function discoverPluginAgentDefs(pluginRoot) {
|
|
|
349
261
|
.filter(f => f.endsWith('.md') && !f.startsWith('.'))
|
|
350
262
|
.map(f => f.slice(0, -3));
|
|
351
263
|
}
|
|
352
|
-
/**
|
|
353
|
-
* Discover workflow directories inside a plugin's `workflows/` folder.
|
|
354
|
-
* A valid workflow is a directory containing WORKFLOW.md (same contract as
|
|
355
|
-
* project/user/system workflows). Phase 5: plugins package workflows as
|
|
356
|
-
* entrypoints so `agents run <name>` can resolve them without a separate
|
|
357
|
-
* install into ~/.agents/workflows/.
|
|
358
|
-
*/
|
|
359
264
|
export function discoverPluginWorkflows(pluginRoot) {
|
|
360
265
|
const workflowsDir = path.join(pluginRoot, 'workflows');
|
|
361
266
|
if (!fs.existsSync(workflowsDir))
|
|
@@ -370,14 +275,12 @@ export function discoverPluginWorkflows(pluginRoot) {
|
|
|
370
275
|
return [];
|
|
371
276
|
}
|
|
372
277
|
}
|
|
373
|
-
/** Discover executable files in a plugin's bin/ directory. */
|
|
374
278
|
export function discoverPluginBin(pluginRoot) {
|
|
375
279
|
const binDir = path.join(pluginRoot, 'bin');
|
|
376
280
|
if (!fs.existsSync(binDir))
|
|
377
281
|
return [];
|
|
378
282
|
return fs.readdirSync(binDir).filter(f => !f.startsWith('.'));
|
|
379
283
|
}
|
|
380
|
-
/** Discover MCP server names from .mcp.json at the plugin root. */
|
|
381
284
|
export function discoverPluginMcpServers(pluginRoot) {
|
|
382
285
|
const mcpFile = path.join(pluginRoot, '.mcp.json');
|
|
383
286
|
if (!fs.existsSync(mcpFile))
|
|
@@ -390,7 +293,6 @@ export function discoverPluginMcpServers(pluginRoot) {
|
|
|
390
293
|
return [];
|
|
391
294
|
}
|
|
392
295
|
}
|
|
393
|
-
/** Discover LSP server keys from .lsp.json at the plugin root. */
|
|
394
296
|
export function discoverPluginLspServers(pluginRoot) {
|
|
395
297
|
const lspFile = path.join(pluginRoot, '.lsp.json');
|
|
396
298
|
if (!fs.existsSync(lspFile))
|
|
@@ -403,7 +305,6 @@ export function discoverPluginLspServers(pluginRoot) {
|
|
|
403
305
|
return [];
|
|
404
306
|
}
|
|
405
307
|
}
|
|
406
|
-
/** Discover monitor names from monitors/monitors.json. */
|
|
407
308
|
export function discoverPluginMonitors(pluginRoot) {
|
|
408
309
|
const monitorsFile = path.join(pluginRoot, 'monitors', 'monitors.json');
|
|
409
310
|
if (!fs.existsSync(monitorsFile))
|
|
@@ -418,7 +319,6 @@ export function discoverPluginMonitors(pluginRoot) {
|
|
|
418
319
|
return [];
|
|
419
320
|
}
|
|
420
321
|
}
|
|
421
|
-
/** Return true if settings.json contains non-permission keys worth merging. */
|
|
422
322
|
function pluginHasNonPermissionSettings(pluginRoot) {
|
|
423
323
|
const settingsPath = path.join(pluginRoot, 'settings.json');
|
|
424
324
|
if (!fs.existsSync(settingsPath))
|
|
@@ -431,15 +331,6 @@ function pluginHasNonPermissionSettings(pluginRoot) {
|
|
|
431
331
|
return false;
|
|
432
332
|
}
|
|
433
333
|
}
|
|
434
|
-
// ─── Variable expansion ───────────────────────────────────────────────────────
|
|
435
|
-
/**
|
|
436
|
-
* Expand plugin variables in a string.
|
|
437
|
-
*
|
|
438
|
-
* Variables:
|
|
439
|
-
* ${CLAUDE_PLUGIN_ROOT} -> absolute path to plugin directory
|
|
440
|
-
* ${CLAUDE_PLUGIN_DATA} -> per-version data directory for this plugin
|
|
441
|
-
* ${user_config.<key>} -> value from plugin's .user-config.json
|
|
442
|
-
*/
|
|
443
334
|
export function expandPluginVars(str, pluginRoot, pluginName, agentId, versionHome, userConfig) {
|
|
444
335
|
const dataDir = path.join(versionHome, agentConfigDirName(agentId), 'plugin-data', pluginName);
|
|
445
336
|
let result = str
|
|
@@ -452,10 +343,6 @@ export function expandPluginVars(str, pluginRoot, pluginName, agentId, versionHo
|
|
|
452
343
|
}
|
|
453
344
|
return result;
|
|
454
345
|
}
|
|
455
|
-
// ─── userConfig storage ───────────────────────────────────────────────────────
|
|
456
|
-
/**
|
|
457
|
-
* Load persisted user config for a plugin from .user-config.json.
|
|
458
|
-
*/
|
|
459
346
|
export function loadUserConfig(pluginName) {
|
|
460
347
|
const configPath = path.join(getPluginsDir(), pluginName, USER_CONFIG_FILE);
|
|
461
348
|
if (!fs.existsSync(configPath))
|
|
@@ -467,35 +354,17 @@ export function loadUserConfig(pluginName) {
|
|
|
467
354
|
return {};
|
|
468
355
|
}
|
|
469
356
|
}
|
|
470
|
-
/**
|
|
471
|
-
* Persist user config for a plugin to .user-config.json.
|
|
472
|
-
*/
|
|
473
357
|
export function saveUserConfig(pluginName, config) {
|
|
474
358
|
const configPath = path.join(getPluginsDir(), pluginName, USER_CONFIG_FILE);
|
|
475
359
|
fs.mkdirSync(path.dirname(configPath), { recursive: true });
|
|
476
360
|
fs.writeFileSync(configPath, JSON.stringify(config, null, 2), 'utf-8');
|
|
477
361
|
}
|
|
478
|
-
// ─── Dependency checking ──────────────────────────────────────────────────────
|
|
479
|
-
/**
|
|
480
|
-
* Check plugin dependencies against installed plugins.
|
|
481
|
-
* Returns names of missing dependencies (warning only — not a hard error).
|
|
482
|
-
*/
|
|
483
362
|
export function checkPluginDependencies(manifest) {
|
|
484
363
|
if (!manifest.dependencies || manifest.dependencies.length === 0)
|
|
485
364
|
return [];
|
|
486
365
|
const installed = new Set(discoverPlugins().map(p => p.name));
|
|
487
366
|
return manifest.dependencies.filter(dep => !installed.has(dep));
|
|
488
367
|
}
|
|
489
|
-
// ─── Marketplace routing ──────────────────────────────────────────────────────
|
|
490
|
-
/**
|
|
491
|
-
* Reconstruct a MarketplaceSpec from a marketplace name. The inverse of
|
|
492
|
-
* marketplaceNameFor(): "agents-cli" → user, "agents-project" → project,
|
|
493
|
-
* "agents-system" → system, "agents-<alias>" → extra. The per-version
|
|
494
|
-
* marketplace operations only key off the name (never spec.root), but we
|
|
495
|
-
* resolve the real source root anyway so the spec is honest for any caller that
|
|
496
|
-
* inspects it (e.g. descriptionFor, which would otherwise label the system
|
|
497
|
-
* marketplace as an extra repo named "system").
|
|
498
|
-
*/
|
|
499
368
|
export function marketplaceSpecForName(name, cwd = process.cwd()) {
|
|
500
369
|
if (!name || name === MARKETPLACE_NAME)
|
|
501
370
|
return { kind: 'user' };
|
|
@@ -508,12 +377,6 @@ export function marketplaceSpecForName(name, cwd = process.cwd()) {
|
|
|
508
377
|
const alias = name.slice('agents-'.length);
|
|
509
378
|
return { kind: 'extra', alias, root: getExtraPluginsDir(alias) };
|
|
510
379
|
}
|
|
511
|
-
/**
|
|
512
|
-
* List the marketplace names that have been synthesized under a version home
|
|
513
|
-
* (i.e. the directories beneath .{agent}/plugins/marketplaces/). Used by
|
|
514
|
-
* removal/orphan/diff passes that must touch every marketplace a version
|
|
515
|
-
* carries, not just the user one.
|
|
516
|
-
*/
|
|
517
380
|
function listVersionMarketplaceNames(agent, versionHome) {
|
|
518
381
|
const dir = path.join(versionHome, agentConfigDirName(agent), 'plugins', 'marketplaces');
|
|
519
382
|
if (!fs.existsSync(dir))
|
|
@@ -527,28 +390,6 @@ function listVersionMarketplaceNames(agent, versionHome) {
|
|
|
527
390
|
return [];
|
|
528
391
|
}
|
|
529
392
|
}
|
|
530
|
-
// ─── Main sync entry point ────────────────────────────────────────────────────
|
|
531
|
-
/**
|
|
532
|
-
* Sync a plugin to a specific agent version's home directory.
|
|
533
|
-
*
|
|
534
|
-
* For plugins-capable agents (claude, openclaw):
|
|
535
|
-
* 1. Copy plugin source into <versionHome>/.<agent>/plugins/marketplaces/agents-cli/plugins/<name>/
|
|
536
|
-
* 2. Pre-expand ${user_config.*} variables in copied text files (Claude doesn't know this var).
|
|
537
|
-
* 3. (Re-)synthesize the marketplace.json catalog from the installed plugins.
|
|
538
|
-
* 4. Register the synthetic marketplace in known_marketplaces.json.
|
|
539
|
-
* 5. Mark <plugin>@agents-cli enabled in settings.json#enabledPlugins.
|
|
540
|
-
* 6. Migrate (remove) legacy dual-dash skills/commands/agents/bin/hooks/mcp entries.
|
|
541
|
-
*
|
|
542
|
-
* Claude/OpenClaw natively handle the plugin's skills, commands, agents, hooks,
|
|
543
|
-
* MCP servers, bin/, settings.json, and permissions once the plugin lives at the
|
|
544
|
-
* native install path and is marked enabled — see
|
|
545
|
-
* https://code.claude.com/docs/en/plugins.
|
|
546
|
-
*
|
|
547
|
-
* Droid (Factory CLI) reuses this same marketplace layout but additionally
|
|
548
|
-
* requires an installed_plugins.json registry entry and a "local"-source
|
|
549
|
-
* known_marketplaces.json entry before `droid plugin list` will see the plugin
|
|
550
|
-
* (steps handled by registerMarketplace's droid branch + step 5c below).
|
|
551
|
-
*/
|
|
552
393
|
export function syncPluginToVersion(plugin, agent, versionHome, options = {}) {
|
|
553
394
|
const result = {
|
|
554
395
|
success: false,
|
|
@@ -567,13 +408,7 @@ export function syncPluginToVersion(plugin, agent, versionHome, options = {}) {
|
|
|
567
408
|
if (!isCapable(agent, 'plugins')) {
|
|
568
409
|
return result;
|
|
569
410
|
}
|
|
570
|
-
// OpenCode uses TS/JS modules under ~/.config/opencode/plugins/, not the
|
|
571
|
-
// Claude marketplace layout. Install those modules and return early.
|
|
572
411
|
if (agent === 'opencode') {
|
|
573
|
-
// Trust gate (RUSH-1756): OpenCode plugins are raw executable TS/JS modules,
|
|
574
|
-
// so they must clear the same consent check as every other exec surface
|
|
575
|
-
// before install — this branch used to return early, bypassing the gate the
|
|
576
|
-
// Hermes/marketplace branches all apply.
|
|
577
412
|
const enablePlugin = options.allowExecSurfaces === true || !hasPluginExecSurfaces(inspectPluginCapabilities(plugin.root));
|
|
578
413
|
if (!enablePlugin) {
|
|
579
414
|
return result;
|
|
@@ -584,8 +419,6 @@ export function syncPluginToVersion(plugin, agent, versionHome, options = {}) {
|
|
|
584
419
|
result.skills.push(plugin.name);
|
|
585
420
|
return result;
|
|
586
421
|
}
|
|
587
|
-
// Goose loads Open Plugins from $HOME/.agents/plugins/<name>/ (same layout as
|
|
588
|
-
// agents-cli's source tree). Under the shim HOME is the version home.
|
|
589
422
|
if (agent === 'goose') {
|
|
590
423
|
const ok = installGoosePlugin(plugin, versionHome);
|
|
591
424
|
result.success = ok;
|
|
@@ -593,8 +426,6 @@ export function syncPluginToVersion(plugin, agent, versionHome, options = {}) {
|
|
|
593
426
|
result.skills.push(plugin.name);
|
|
594
427
|
return result;
|
|
595
428
|
}
|
|
596
|
-
// Hermes loads plugins from a flat $HOME/.hermes/plugins/<name>/ dir with a
|
|
597
|
-
// plugin.yaml manifest, gated by a plugins.enabled allowlist in config.yaml.
|
|
598
429
|
if (agent === 'hermes') {
|
|
599
430
|
const enablePlugin = options.allowExecSurfaces === true || !hasPluginExecSurfaces(inspectPluginCapabilities(plugin.root));
|
|
600
431
|
const ok = installHermesPlugin(plugin, versionHome, enablePlugin);
|
|
@@ -604,20 +435,12 @@ export function syncPluginToVersion(plugin, agent, versionHome, options = {}) {
|
|
|
604
435
|
return result;
|
|
605
436
|
}
|
|
606
437
|
const userConfig = loadUserConfig(plugin.name);
|
|
607
|
-
// Route every marketplace op through the plugin's own marketplace, so a plugin
|
|
608
|
-
// discovered in an extra/project repo installs under its own
|
|
609
|
-
// marketplaces/<name>/ tree — never the user marketplace.
|
|
610
438
|
const spec = marketplaceSpecForName(plugin.marketplace);
|
|
611
439
|
const marketplaceName = marketplaceNameFor(spec);
|
|
612
|
-
// 1. Copy plugin to native marketplace install dir.
|
|
613
440
|
const installDir = copyPluginToMarketplace(plugin, spec, agent, versionHome);
|
|
614
|
-
// 2. Pre-expand ${user_config.*} in the copy. Leave ${CLAUDE_PLUGIN_ROOT} /
|
|
615
|
-
// ${CLAUDE_PLUGIN_DATA} alone — Claude expands those natively at runtime.
|
|
616
441
|
if (Object.keys(userConfig).length > 0) {
|
|
617
442
|
expandUserConfigInDir(installDir, userConfig);
|
|
618
443
|
}
|
|
619
|
-
// 2b. Write agent-native manifest dir alongside .claude-plugin/ when the agent
|
|
620
|
-
// expects a different directory name (e.g. Codex uses .codex-plugin/).
|
|
621
444
|
const agentManifestDir = AGENTS[agent].pluginManifestDir;
|
|
622
445
|
if (agentManifestDir && agentManifestDir !== PLUGIN_MANIFEST_DIR) {
|
|
623
446
|
const srcManifest = path.join(installDir, PLUGIN_MANIFEST_DIR, PLUGIN_MANIFEST_FILE);
|
|
@@ -627,35 +450,18 @@ export function syncPluginToVersion(plugin, agent, versionHome, options = {}) {
|
|
|
627
450
|
fs.copyFileSync(srcManifest, path.join(destManifestDir, PLUGIN_MANIFEST_FILE));
|
|
628
451
|
}
|
|
629
452
|
}
|
|
630
|
-
// 3-5. Synthesize manifest, register marketplace, enable plugin.
|
|
631
453
|
syncMarketplaceManifest(spec, agent, versionHome);
|
|
632
454
|
registerMarketplace(spec, agent, versionHome);
|
|
633
|
-
// Trust gate: plugins with executable surfaces (hooks/, bin/, scripts/,
|
|
634
|
-
// .mcp.json, settings.json, permissions/) are only auto-enabled when the
|
|
635
|
-
// caller explicitly opts in. addPluginToSettings does no gating — that moved
|
|
636
|
-
// here, where plugin capabilities are inspected.
|
|
637
455
|
const enablePlugin = options.allowExecSurfaces === true || !hasPluginExecSurfaces(inspectPluginCapabilities(plugin.root));
|
|
638
456
|
if (enablePlugin) {
|
|
639
457
|
addPluginToSettings(plugin.name, marketplaceName, agent, versionHome);
|
|
640
458
|
}
|
|
641
|
-
// 5c. Droid diverges from Claude's marketplace+enabledPlugins model: it only
|
|
642
|
-
// "sees" a plugin that also has an entry in installed_plugins.json (with
|
|
643
|
-
// the marketplace registered as source "local"). Register the install so
|
|
644
|
-
// `droid plugin list` shows it — Active when enabled, Inactive otherwise.
|
|
645
459
|
if (agent === 'droid') {
|
|
646
460
|
registerDroidInstalledPlugin(plugin.name, marketplaceName, installDir, plugin.manifest.version, agent, versionHome);
|
|
647
461
|
}
|
|
648
|
-
// 5d. Copilot, like Droid, only "sees" a plugin that also has an entry in its
|
|
649
|
-
// auto-managed config.json#installedPlugins (registerMarketplace already
|
|
650
|
-
// wrote settings.json#extraKnownMarketplaces, and addPluginToSettings the
|
|
651
|
-
// enabledPlugins flag). cache_path points at the marketplace copy; the
|
|
652
|
-
// `enabled` flag mirrors the exec-surface trust gate above.
|
|
653
462
|
if (agent === 'copilot') {
|
|
654
463
|
registerCopilotInstalledPlugin(plugin.name, marketplaceName, installDir, plugin.manifest.version, enablePlugin, agent, versionHome);
|
|
655
464
|
}
|
|
656
|
-
// 5b. Convert plugin commands/ to skills for agents that dropped command support
|
|
657
|
-
// (Codex >= 0.117.0). Skill name is prefixed with plugin name to avoid
|
|
658
|
-
// collision with standalone command skills.
|
|
659
465
|
if (options.version && shouldInstallCommandAsSkill(agent, options.version) && plugin.commands.length > 0) {
|
|
660
466
|
const agentDir = path.join(versionHome, agentConfigDirName(agent));
|
|
661
467
|
const skillSourceDirs = [path.join(agentDir, 'skills')];
|
|
@@ -666,9 +472,7 @@ export function syncPluginToVersion(plugin, agent, versionHome, options = {}) {
|
|
|
666
472
|
}
|
|
667
473
|
}
|
|
668
474
|
}
|
|
669
|
-
// 6. Migrate legacy dual-dash flat layout from previous versions of agents-cli.
|
|
670
475
|
migrateLegacyFlatLayout(plugin, agent, versionHome);
|
|
671
|
-
// Populate the result shape for backward-compatible callers/reporting.
|
|
672
476
|
result.skills = plugin.skills.map(s => `${plugin.name}:${s}`);
|
|
673
477
|
result.commands = plugin.commands.map(c => `${plugin.name}:${c}`);
|
|
674
478
|
result.agentDefs = plugin.agentDefs.map(a => `${plugin.name}:${a}`);
|
|
@@ -709,10 +513,6 @@ function pluginHasDirectoryEntries(pluginRoot, dirName) {
|
|
|
709
513
|
return false;
|
|
710
514
|
}
|
|
711
515
|
}
|
|
712
|
-
/**
|
|
713
|
-
* Walk a directory and replace ${user_config.*} placeholders in text files.
|
|
714
|
-
* Leaves all other variables (${CLAUDE_PLUGIN_ROOT}, ${CLAUDE_PLUGIN_DATA}) alone.
|
|
715
|
-
*/
|
|
716
516
|
function expandUserConfigInDir(dir, userConfig) {
|
|
717
517
|
const textExtensions = new Set(['.md', '.json', '.sh', '.py', '.js', '.ts', '.yaml', '.yml', '.toml', '.txt']);
|
|
718
518
|
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
@@ -732,18 +532,12 @@ function expandUserConfigInDir(dir, userConfig) {
|
|
|
732
532
|
fs.writeFileSync(full, expanded, 'utf-8');
|
|
733
533
|
}
|
|
734
534
|
}
|
|
735
|
-
catch {
|
|
535
|
+
catch { }
|
|
736
536
|
}
|
|
737
537
|
}
|
|
738
|
-
/**
|
|
739
|
-
* Remove legacy <plugin>--* entries from a version home, left by the previous
|
|
740
|
-
* flatten-based sync. Safe to call repeatedly — only deletes paths matching the
|
|
741
|
-
* plugin's prefix.
|
|
742
|
-
*/
|
|
743
538
|
function migrateLegacyFlatLayout(plugin, agent, versionHome) {
|
|
744
539
|
const prefix = `${plugin.name}--`;
|
|
745
540
|
const agentRoot = path.join(versionHome, agentConfigDirName(agent));
|
|
746
|
-
// 1. skills
|
|
747
541
|
const skillsDir = path.join(agentRoot, 'skills');
|
|
748
542
|
if (fs.existsSync(skillsDir)) {
|
|
749
543
|
for (const entry of fs.readdirSync(skillsDir, { withFileTypes: true })) {
|
|
@@ -751,11 +545,10 @@ function migrateLegacyFlatLayout(plugin, agent, versionHome) {
|
|
|
751
545
|
try {
|
|
752
546
|
fs.rmSync(path.join(skillsDir, entry.name), { recursive: true, force: true });
|
|
753
547
|
}
|
|
754
|
-
catch {
|
|
548
|
+
catch { }
|
|
755
549
|
}
|
|
756
550
|
}
|
|
757
551
|
}
|
|
758
|
-
// 2. commands
|
|
759
552
|
if (agent === 'claude' || agent === 'openclaw') {
|
|
760
553
|
const cmdsDir = path.join(agentRoot, AGENTS[agent]?.commandsSubdir ?? 'commands');
|
|
761
554
|
if (fs.existsSync(cmdsDir)) {
|
|
@@ -764,12 +557,11 @@ function migrateLegacyFlatLayout(plugin, agent, versionHome) {
|
|
|
764
557
|
try {
|
|
765
558
|
fs.unlinkSync(path.join(cmdsDir, entry.name));
|
|
766
559
|
}
|
|
767
|
-
catch {
|
|
560
|
+
catch { }
|
|
768
561
|
}
|
|
769
562
|
}
|
|
770
563
|
}
|
|
771
564
|
}
|
|
772
|
-
// 3. agent definitions
|
|
773
565
|
const agentsDir = path.join(agentRoot, 'agents');
|
|
774
566
|
if (fs.existsSync(agentsDir)) {
|
|
775
567
|
for (const entry of fs.readdirSync(agentsDir, { withFileTypes: true })) {
|
|
@@ -777,20 +569,17 @@ function migrateLegacyFlatLayout(plugin, agent, versionHome) {
|
|
|
777
569
|
try {
|
|
778
570
|
fs.unlinkSync(path.join(agentsDir, entry.name));
|
|
779
571
|
}
|
|
780
|
-
catch {
|
|
572
|
+
catch { }
|
|
781
573
|
}
|
|
782
574
|
}
|
|
783
575
|
}
|
|
784
|
-
// 4. plugin-bin
|
|
785
576
|
const binDir = path.join(agentRoot, 'plugin-bin', plugin.name);
|
|
786
577
|
if (fs.existsSync(binDir)) {
|
|
787
578
|
try {
|
|
788
579
|
fs.rmSync(binDir, { recursive: true, force: true });
|
|
789
580
|
}
|
|
790
|
-
catch {
|
|
581
|
+
catch { }
|
|
791
582
|
}
|
|
792
|
-
// 5. settings.json — strip namespaced mcpServers, hooks referencing plugin
|
|
793
|
-
// root, permissions referencing plugin root, and pluginBinPaths entries.
|
|
794
583
|
const settingsPath = path.join(agentRoot, 'settings.json');
|
|
795
584
|
if (!fs.existsSync(settingsPath))
|
|
796
585
|
return;
|
|
@@ -865,41 +654,21 @@ function migrateLegacyFlatLayout(plugin, agent, versionHome) {
|
|
|
865
654
|
try {
|
|
866
655
|
fs.writeFileSync(settingsPath, JSON.stringify(settings, null, 2), 'utf-8');
|
|
867
656
|
}
|
|
868
|
-
catch {
|
|
869
|
-
}
|
|
870
|
-
}
|
|
871
|
-
// ─── OpenCode plugins (TS/JS modules) ─────────────────────────────────────────
|
|
872
|
-
/**
|
|
873
|
-
* OpenCode loads JS/TS modules from `$HOME/.config/opencode/plugins/` (global)
|
|
874
|
-
* and `<project>/.opencode/plugins/` (project). Under agents-cli version
|
|
875
|
-
* isolation HOME is the version home, so we write:
|
|
876
|
-
* {versionHome}/.config/opencode/plugins/
|
|
877
|
-
*
|
|
878
|
-
* Claude-style marketplace plugins are NOT auto-converted; we install modules
|
|
879
|
-
* from (in order):
|
|
880
|
-
* 1. pluginRoot/opencode/*.{ts,js,mjs,cjs}
|
|
881
|
-
* 2. pluginRoot/plugins/*.{ts,js,mjs,cjs}
|
|
882
|
-
* 3. pluginRoot/*.{ts,js,mjs,cjs} (excluding *.test.* / *.spec.*)
|
|
883
|
-
* If none exist, install still succeeds by writing a marker + copying any
|
|
884
|
-
* package.json so empty plugins don't break sync; opencode simply has nothing
|
|
885
|
-
* to load until a real module appears.
|
|
886
|
-
*/
|
|
657
|
+
catch { }
|
|
658
|
+
}
|
|
659
|
+
}
|
|
887
660
|
export function openCodePluginsDir(versionHome) {
|
|
888
661
|
return path.join(versionHome, '.config', 'opencode', 'plugins');
|
|
889
662
|
}
|
|
890
|
-
// OpenCode's local-plugin loader only auto-loads direct *.ts / *.js files under
|
|
891
|
-
// plugins/ — not nested dirs and not .mjs/.cjs (see opencode.ai/docs/plugins).
|
|
892
663
|
const OPENCODE_MODULE_RE = /\.(ts|js)$/i;
|
|
893
664
|
const OPENCODE_TEST_RE = /\.(test|spec)\./i;
|
|
894
665
|
function listOpenCodeModules(dir) {
|
|
895
666
|
if (!fs.existsSync(dir))
|
|
896
667
|
return [];
|
|
897
|
-
// readdir without recursion — only loader-visible direct children.
|
|
898
668
|
return fs.readdirSync(dir, { withFileTypes: true })
|
|
899
669
|
.filter((e) => e.isFile() && OPENCODE_MODULE_RE.test(e.name) && !OPENCODE_TEST_RE.test(e.name) && !e.name.startsWith('.'))
|
|
900
670
|
.map((e) => e.name);
|
|
901
671
|
}
|
|
902
|
-
/** Resolve source module files for an agents-cli plugin to install into OpenCode. */
|
|
903
672
|
export function resolveOpenCodePluginSources(pluginRoot) {
|
|
904
673
|
for (const sub of ['opencode', 'plugins']) {
|
|
905
674
|
const dir = path.join(pluginRoot, sub);
|
|
@@ -914,7 +683,6 @@ export function installOpenCodePlugin(plugin, versionHome) {
|
|
|
914
683
|
fs.mkdirSync(destDir, { recursive: true });
|
|
915
684
|
const sources = resolveOpenCodePluginSources(plugin.root);
|
|
916
685
|
const destPluginDir = path.join(destDir, plugin.name);
|
|
917
|
-
// Clean previous install of this plugin name (file or dir)
|
|
918
686
|
const bareTs = path.join(destDir, `${plugin.name}.ts`);
|
|
919
687
|
const bareJs = path.join(destDir, `${plugin.name}.js`);
|
|
920
688
|
for (const p of [bareTs, bareJs, destPluginDir]) {
|
|
@@ -922,18 +690,13 @@ export function installOpenCodePlugin(plugin, versionHome) {
|
|
|
922
690
|
if (fs.existsSync(p))
|
|
923
691
|
fs.rmSync(p, { recursive: true, force: true });
|
|
924
692
|
}
|
|
925
|
-
catch {
|
|
693
|
+
catch { }
|
|
926
694
|
}
|
|
927
695
|
if (sources.length === 0) {
|
|
928
|
-
// No TS/JS modules — still create a managed marker so isPluginSynced can
|
|
929
|
-
// track that we processed the plugin (and so re-sync is idempotent).
|
|
930
696
|
fs.mkdirSync(destPluginDir, { recursive: true });
|
|
931
697
|
fs.writeFileSync(path.join(destPluginDir, '.agents-cli-managed'), `plugin=${plugin.name}\n# no opencode modules found under ${plugin.root}\n`, 'utf-8');
|
|
932
698
|
return true;
|
|
933
699
|
}
|
|
934
|
-
// Install each module as a direct file under plugins/ so the loader sees it.
|
|
935
|
-
// Multi-module plugins get `<name>` or `<name>-<stem>` basenames (never a
|
|
936
|
-
// nested directory — OpenCode does not scan nested plugin dirs).
|
|
937
700
|
for (let i = 0; i < sources.length; i++) {
|
|
938
701
|
const src = sources[i];
|
|
939
702
|
const ext = path.extname(src);
|
|
@@ -945,7 +708,6 @@ export function installOpenCodePlugin(plugin, versionHome) {
|
|
|
945
708
|
: `${plugin.name}-${stem}${ext}`);
|
|
946
709
|
fs.copyFileSync(src, path.join(destDir, destName));
|
|
947
710
|
}
|
|
948
|
-
// Marker file so isOpenCodePluginInstalled / remove can track multi-file installs.
|
|
949
711
|
fs.mkdirSync(destPluginDir, { recursive: true });
|
|
950
712
|
fs.writeFileSync(path.join(destPluginDir, '.agents-cli-managed'), `plugin=${plugin.name}\nfiles=${sources.map((s) => path.basename(s)).join(',')}\n`, 'utf-8');
|
|
951
713
|
return true;
|
|
@@ -979,7 +741,6 @@ export function removeOpenCodePlugin(pluginName, versionHome) {
|
|
|
979
741
|
removed = true;
|
|
980
742
|
}
|
|
981
743
|
}
|
|
982
|
-
// Flat multi-module installs: <name>-<stem>.ts/js next to the marker dir.
|
|
983
744
|
if (fs.existsSync(destDir)) {
|
|
984
745
|
for (const entry of fs.readdirSync(destDir)) {
|
|
985
746
|
if (entry.startsWith(`${pluginName}-`) && /\.(ts|js)$/i.test(entry)) {
|
|
@@ -987,29 +748,12 @@ export function removeOpenCodePlugin(pluginName, versionHome) {
|
|
|
987
748
|
fs.rmSync(path.join(destDir, entry), { force: true });
|
|
988
749
|
removed = true;
|
|
989
750
|
}
|
|
990
|
-
catch {
|
|
751
|
+
catch { }
|
|
991
752
|
}
|
|
992
753
|
}
|
|
993
754
|
}
|
|
994
755
|
return removed;
|
|
995
756
|
}
|
|
996
|
-
/**
|
|
997
|
-
* Security (RUSH-1755): `fs.cpSync(..., { recursive: true })` copies symlinks
|
|
998
|
-
* verbatim (dereference defaults to false), so a malicious plugin can ship a
|
|
999
|
-
* symlink whose target escapes the install root — e.g.
|
|
1000
|
-
* `.agents-cli-managed -> ~/.bashrc`. The managed-marker / manifest writes that
|
|
1001
|
-
* follow the copy would then write THROUGH the link, clobbering an
|
|
1002
|
-
* attacker-chosen path outside the install root.
|
|
1003
|
-
*
|
|
1004
|
-
* Walk destRoot after the recursive copy, lstat each entry, and remove any
|
|
1005
|
-
* symlink whose resolved target escapes BOTH destRoot and sourceRoot. Both roots
|
|
1006
|
-
* matter because Node's cpSync rewrites a *relative* internal symlink
|
|
1007
|
-
* (`./x`) into an *absolute* link back into the source tree, so a legitimate
|
|
1008
|
-
* internal symlink resolves under sourceRoot (not destRoot) after the copy.
|
|
1009
|
-
* Keeping targets within sourceRoot preserves those internal symlinks — matching
|
|
1010
|
-
* copyPluginToMarketplace's policy — while genuinely external escapes are
|
|
1011
|
-
* dropped, neutralizing the write-through.
|
|
1012
|
-
*/
|
|
1013
757
|
function stripEscapingSymlinks(destRoot, sourceRoot) {
|
|
1014
758
|
const realRoots = [destRoot, sourceRoot].map((r) => {
|
|
1015
759
|
try {
|
|
@@ -1037,7 +781,6 @@ function stripEscapingSymlinks(destRoot, sourceRoot) {
|
|
|
1037
781
|
escapes = !within(fs.realpathSync(full));
|
|
1038
782
|
}
|
|
1039
783
|
catch {
|
|
1040
|
-
// Dangling / unresolvable symlink — treat as escaping and drop it.
|
|
1041
784
|
escapes = true;
|
|
1042
785
|
}
|
|
1043
786
|
if (escapes) {
|
|
@@ -1045,13 +788,10 @@ function stripEscapingSymlinks(destRoot, sourceRoot) {
|
|
|
1045
788
|
fs.rmSync(full, { force: true });
|
|
1046
789
|
removed.push(path.relative(destRoot, full) || entry.name);
|
|
1047
790
|
}
|
|
1048
|
-
catch {
|
|
791
|
+
catch { }
|
|
1049
792
|
}
|
|
1050
793
|
}
|
|
1051
794
|
else if (entry.isDirectory()) {
|
|
1052
|
-
// Do not descend into symlinked dirs — isDirectory() is false for a
|
|
1053
|
-
// symlink even when it points at a directory, so this only recurses
|
|
1054
|
-
// into real subdirectories, keeping the walk inside destRoot.
|
|
1055
795
|
walk(full);
|
|
1056
796
|
}
|
|
1057
797
|
}
|
|
@@ -1059,15 +799,6 @@ function stripEscapingSymlinks(destRoot, sourceRoot) {
|
|
|
1059
799
|
walk(destRoot);
|
|
1060
800
|
return removed;
|
|
1061
801
|
}
|
|
1062
|
-
// ─── Goose plugins (Open Plugins under .agents/plugins/) ─────────────────────
|
|
1063
|
-
/**
|
|
1064
|
-
* Goose auto-discovers Open Plugins at `$HOME/.agents/plugins/<name>/`.
|
|
1065
|
-
* Under agents-cli version isolation HOME is the version home, so we install to:
|
|
1066
|
-
* {versionHome}/.agents/plugins/<name>/
|
|
1067
|
-
*
|
|
1068
|
-
* Full plugin directory copy (not marketplace) — same layout goose and
|
|
1069
|
-
* agents-cli share for source plugins.
|
|
1070
|
-
*/
|
|
1071
802
|
export function goosePluginsDir(versionHome) {
|
|
1072
803
|
return path.join(versionHome, '.agents', 'plugins');
|
|
1073
804
|
}
|
|
@@ -1096,17 +827,6 @@ export function removeGoosePlugin(pluginName, versionHome) {
|
|
|
1096
827
|
fs.rmSync(destRoot, { recursive: true, force: true });
|
|
1097
828
|
return true;
|
|
1098
829
|
}
|
|
1099
|
-
// ─── Hermes plugins (flat ~/.hermes/plugins/ + config.yaml enable toggle) ─────
|
|
1100
|
-
/**
|
|
1101
|
-
* Hermes (Nous Research) loads plugins from a flat `$HOME/.hermes/plugins/<name>/`
|
|
1102
|
-
* directory holding a `plugin.yaml` manifest — NOT the Claude marketplace layout.
|
|
1103
|
-
* Under agents-cli version isolation HOME is the version home, so we install to:
|
|
1104
|
-
* {versionHome}/.hermes/plugins/<name>/
|
|
1105
|
-
* A plugin does not load until its name is added to `plugins.enabled` (a YAML
|
|
1106
|
-
* array) in `{versionHome}/.hermes/config.yaml`; a deny-list `plugins.disabled`
|
|
1107
|
-
* wins on conflict, so agents-cli only manages the `enabled` allowlist and never
|
|
1108
|
-
* touches `disabled` (user-owned).
|
|
1109
|
-
*/
|
|
1110
830
|
export function hermesPluginsDir(versionHome) {
|
|
1111
831
|
return path.join(versionHome, '.hermes', 'plugins');
|
|
1112
832
|
}
|
|
@@ -1121,11 +841,6 @@ function writeHermesPluginManifest(plugin, destRoot) {
|
|
|
1121
841
|
};
|
|
1122
842
|
fs.writeFileSync(path.join(destRoot, HERMES_PLUGIN_MANIFEST_FILE), yaml.stringify(manifest), 'utf-8');
|
|
1123
843
|
}
|
|
1124
|
-
/**
|
|
1125
|
-
* Add or remove a plugin name in `plugins.enabled` within ~/.hermes/config.yaml,
|
|
1126
|
-
* preserving every other key (read → mutate → write). Never touches
|
|
1127
|
-
* `plugins.disabled`. No-op (no rewrite) when the desired state already holds.
|
|
1128
|
-
*/
|
|
1129
844
|
export function setHermesPluginEnabled(pluginName, versionHome, enabled) {
|
|
1130
845
|
const configPath = hermesConfigPath(versionHome);
|
|
1131
846
|
let config = {};
|
|
@@ -1148,7 +863,7 @@ export function setHermesPluginEnabled(pluginName, versionHome, enabled) {
|
|
|
1148
863
|
plugins.enabled = current.filter((n) => n !== pluginName);
|
|
1149
864
|
}
|
|
1150
865
|
else {
|
|
1151
|
-
return;
|
|
866
|
+
return;
|
|
1152
867
|
}
|
|
1153
868
|
fs.mkdirSync(path.dirname(configPath), { recursive: true });
|
|
1154
869
|
fs.writeFileSync(configPath, yaml.stringify(config), 'utf-8');
|
|
@@ -1167,11 +882,6 @@ export function installHermesPlugin(plugin, versionHome, enable) {
|
|
|
1167
882
|
}
|
|
1168
883
|
writeHermesPluginManifest(plugin, destRoot);
|
|
1169
884
|
fs.writeFileSync(path.join(destRoot, '.agents-cli-managed'), `plugin=${plugin.name}\n`, 'utf-8');
|
|
1170
|
-
// Enable only when trusted — never DOWN-toggle here. An un-flagged background
|
|
1171
|
-
// re-sync of an exec-surface plugin passes enable=false; forcing the allowlist
|
|
1172
|
-
// to false then would clobber a plugin the user deliberately enabled with
|
|
1173
|
-
// --allow-exec-surfaces. Mirror addPluginToSettings: add-if-trusted, else leave
|
|
1174
|
-
// the existing enabled state untouched. (Removal still unregisters explicitly.)
|
|
1175
885
|
if (enable) {
|
|
1176
886
|
setHermesPluginEnabled(plugin.name, versionHome, true);
|
|
1177
887
|
}
|
|
@@ -1189,16 +899,9 @@ export function removeHermesPlugin(pluginName, versionHome) {
|
|
|
1189
899
|
const existed = fs.existsSync(destRoot);
|
|
1190
900
|
if (existed)
|
|
1191
901
|
fs.rmSync(destRoot, { recursive: true, force: true });
|
|
1192
|
-
// Always drop it from the enabled allowlist, even if the dir was already gone.
|
|
1193
902
|
setHermesPluginEnabled(pluginName, versionHome, false);
|
|
1194
903
|
return existed;
|
|
1195
904
|
}
|
|
1196
|
-
// ─── Sync status ──────────────────────────────────────────────────────────────
|
|
1197
|
-
/**
|
|
1198
|
-
* Check if a plugin is synced to a version. True when the plugin lives at the
|
|
1199
|
-
* native marketplace install path. Legacy dual-dash entries are not counted —
|
|
1200
|
-
* they're treated as stale and migrated away on the next sync.
|
|
1201
|
-
*/
|
|
1202
905
|
export function isPluginSynced(plugin, agent, versionHome) {
|
|
1203
906
|
if (!isCapable(agent, 'plugins'))
|
|
1204
907
|
return false;
|
|
@@ -1214,20 +917,11 @@ export function isPluginSynced(plugin, agent, versionHome) {
|
|
|
1214
917
|
const spec = marketplaceSpecForName(plugin.marketplace);
|
|
1215
918
|
if (!isInstalledInMarketplace(plugin.name, spec, agent, versionHome))
|
|
1216
919
|
return false;
|
|
1217
|
-
// Droid additionally requires its installed_plugins.json registry entry —
|
|
1218
|
-
// without it the marketplace copy is invisible to `droid plugin list`.
|
|
1219
920
|
if (agent === 'droid') {
|
|
1220
921
|
return isDroidPluginInstalled(plugin.name, marketplaceNameFor(spec), agent, versionHome);
|
|
1221
922
|
}
|
|
1222
923
|
return true;
|
|
1223
924
|
}
|
|
1224
|
-
// ─── Removal ─────────────────────────────────────────────────────────────────
|
|
1225
|
-
/**
|
|
1226
|
-
* Remove a plugin from a specific agent version's home directory.
|
|
1227
|
-
* Inverse of syncPluginToVersion.
|
|
1228
|
-
*
|
|
1229
|
-
* Works whether or not the plugin source still exists on disk.
|
|
1230
|
-
*/
|
|
1231
925
|
export function removePluginFromVersion(pluginName, pluginRoot, agent, versionHome) {
|
|
1232
926
|
const result = {
|
|
1233
927
|
skills: [],
|
|
@@ -1238,29 +932,24 @@ export function removePluginFromVersion(pluginName, pluginRoot, agent, versionHo
|
|
|
1238
932
|
permissions: 0,
|
|
1239
933
|
mcp: 0,
|
|
1240
934
|
};
|
|
1241
|
-
// OpenCode: remove TS/JS modules from ~/.config/opencode/plugins/.
|
|
1242
935
|
if (agent === 'opencode') {
|
|
1243
936
|
if (removeOpenCodePlugin(pluginName, versionHome)) {
|
|
1244
937
|
result.skills.push(pluginName);
|
|
1245
938
|
}
|
|
1246
939
|
return result;
|
|
1247
940
|
}
|
|
1248
|
-
// Goose: remove Open Plugin directory from versionHome/.agents/plugins/.
|
|
1249
941
|
if (agent === 'goose') {
|
|
1250
942
|
if (removeGoosePlugin(pluginName, versionHome)) {
|
|
1251
943
|
result.skills.push(pluginName);
|
|
1252
944
|
}
|
|
1253
945
|
return result;
|
|
1254
946
|
}
|
|
1255
|
-
// Hermes: remove the flat plugin dir and drop it from config.yaml plugins.enabled.
|
|
1256
947
|
if (agent === 'hermes') {
|
|
1257
948
|
if (removeHermesPlugin(pluginName, versionHome)) {
|
|
1258
949
|
result.skills.push(pluginName);
|
|
1259
950
|
}
|
|
1260
951
|
return result;
|
|
1261
952
|
}
|
|
1262
|
-
// 1. Remove the plugin from every marketplace it's installed under. A name can
|
|
1263
|
-
// appear in more than one (collision across repos), so we sweep them all.
|
|
1264
953
|
let removedAny = false;
|
|
1265
954
|
for (const name of listVersionMarketplaceNames(agent, versionHome)) {
|
|
1266
955
|
const spec = marketplaceSpecForName(name);
|
|
@@ -1274,10 +963,7 @@ export function removePluginFromVersion(pluginName, pluginRoot, agent, versionHo
|
|
|
1274
963
|
if (agent === 'copilot') {
|
|
1275
964
|
unregisterCopilotInstalledPlugin(pluginName, name, agent, versionHome);
|
|
1276
965
|
}
|
|
1277
|
-
// Refresh marketplace.json so it reflects what's left under plugins/.
|
|
1278
966
|
syncMarketplaceManifest(spec, agent, versionHome);
|
|
1279
|
-
// If we just removed the last plugin, drop the marketplace dir and the
|
|
1280
|
-
// known_marketplaces.json entry too.
|
|
1281
967
|
if (marketplaceIsEmpty(name, agent, versionHome)) {
|
|
1282
968
|
removeEmptyMarketplaceDir(name, agent, versionHome);
|
|
1283
969
|
unregisterMarketplace(name, agent, versionHome);
|
|
@@ -1286,14 +972,9 @@ export function removePluginFromVersion(pluginName, pluginRoot, agent, versionHo
|
|
|
1286
972
|
if (removedAny) {
|
|
1287
973
|
result.skills.push(pluginName);
|
|
1288
974
|
}
|
|
1289
|
-
// 4. Strip any legacy dual-dash entries from prior agents-cli versions.
|
|
1290
975
|
cleanLegacyFlatLayout(pluginName, pluginRoot, agent, versionHome, result);
|
|
1291
976
|
return result;
|
|
1292
977
|
}
|
|
1293
|
-
/**
|
|
1294
|
-
* Strip dual-dash flat-layout entries left behind by older agents-cli sync runs.
|
|
1295
|
-
* Mutates `result` to record what was removed.
|
|
1296
|
-
*/
|
|
1297
978
|
function cleanLegacyFlatLayout(pluginName, pluginRoot, agent, versionHome, result) {
|
|
1298
979
|
const prefix = `${pluginName}--`;
|
|
1299
980
|
const agentRoot = path.join(versionHome, agentConfigDirName(agent));
|
|
@@ -1306,7 +987,7 @@ function cleanLegacyFlatLayout(pluginName, pluginRoot, agent, versionHome, resul
|
|
|
1306
987
|
fs.rmSync(path.join(skillsDir, entry.name), { recursive: true, force: true });
|
|
1307
988
|
result.skills.push(entry.name);
|
|
1308
989
|
}
|
|
1309
|
-
catch {
|
|
990
|
+
catch { }
|
|
1310
991
|
}
|
|
1311
992
|
}
|
|
1312
993
|
if (agent === 'claude' || agent === 'openclaw') {
|
|
@@ -1319,7 +1000,7 @@ function cleanLegacyFlatLayout(pluginName, pluginRoot, agent, versionHome, resul
|
|
|
1319
1000
|
fs.unlinkSync(path.join(commandsDir, entry.name));
|
|
1320
1001
|
result.commands.push(entry.name);
|
|
1321
1002
|
}
|
|
1322
|
-
catch {
|
|
1003
|
+
catch { }
|
|
1323
1004
|
}
|
|
1324
1005
|
}
|
|
1325
1006
|
}
|
|
@@ -1332,7 +1013,7 @@ function cleanLegacyFlatLayout(pluginName, pluginRoot, agent, versionHome, resul
|
|
|
1332
1013
|
fs.unlinkSync(path.join(agentsDir, entry.name));
|
|
1333
1014
|
result.agentDefs.push(entry.name);
|
|
1334
1015
|
}
|
|
1335
|
-
catch {
|
|
1016
|
+
catch { }
|
|
1336
1017
|
}
|
|
1337
1018
|
}
|
|
1338
1019
|
const binDir = path.join(agentRoot, 'plugin-bin', pluginName);
|
|
@@ -1341,7 +1022,7 @@ function cleanLegacyFlatLayout(pluginName, pluginRoot, agent, versionHome, resul
|
|
|
1341
1022
|
fs.rmSync(binDir, { recursive: true, force: true });
|
|
1342
1023
|
result.bin.push(binDir);
|
|
1343
1024
|
}
|
|
1344
|
-
catch {
|
|
1025
|
+
catch { }
|
|
1345
1026
|
}
|
|
1346
1027
|
const settingsPath = path.join(agentRoot, 'settings.json');
|
|
1347
1028
|
if (!fs.existsSync(settingsPath))
|
|
@@ -1427,7 +1108,7 @@ function cleanLegacyFlatLayout(pluginName, pluginRoot, agent, versionHome, resul
|
|
|
1427
1108
|
try {
|
|
1428
1109
|
fs.writeFileSync(settingsPath, JSON.stringify(settings, null, 2), 'utf-8');
|
|
1429
1110
|
}
|
|
1430
|
-
catch {
|
|
1111
|
+
catch { }
|
|
1431
1112
|
}
|
|
1432
1113
|
}
|
|
1433
1114
|
function pairKey(marketplace, name) {
|
|
@@ -1440,25 +1121,10 @@ function indexActivePlugins(input) {
|
|
|
1440
1121
|
const pairs = new Set();
|
|
1441
1122
|
for (const p of input) {
|
|
1442
1123
|
names.add(p.name);
|
|
1443
|
-
// A discovered plugin always carries provenance; the type allows undefined,
|
|
1444
|
-
// so mirror discovery's own default (a marketplace-less plugin is the user
|
|
1445
|
-
// "agents-cli" marketplace — see discoverPlugins / buildDiscoveredPlugin).
|
|
1446
1124
|
pairs.add(pairKey(p.marketplace ?? MARKETPLACE_NAME, p.name));
|
|
1447
1125
|
}
|
|
1448
1126
|
return { names, pairs };
|
|
1449
1127
|
}
|
|
1450
|
-
/**
|
|
1451
|
-
* Does the SOURCE repo backing a synthesized marketplace exist on disk? A
|
|
1452
|
-
* marketplace's version-home install is only authoritative-cleanable when its
|
|
1453
|
-
* source repo is present: a present repo missing a plugin means that plugin was
|
|
1454
|
-
* genuinely removed, while an absent repo (a project we're not in, a removed
|
|
1455
|
-
* extra repo) is merely unreachable and must not be mistaken for deletion.
|
|
1456
|
-
*
|
|
1457
|
-
* We check the REPO root, not the plugins/ subdir: the user repo (~/.agents/)
|
|
1458
|
-
* always exists but its plugins/ dir may not, and "user repo present, no `code`
|
|
1459
|
-
* plugin in it" is exactly what makes an `agents-cli` `code` shadow a real
|
|
1460
|
-
* orphan (PHNX-2618).
|
|
1461
|
-
*/
|
|
1462
1128
|
function marketplaceSourceRepoExists(marketplaceName, cwd) {
|
|
1463
1129
|
const spec = marketplaceSpecForName(marketplaceName, cwd);
|
|
1464
1130
|
switch (spec.kind) {
|
|
@@ -1471,25 +1137,6 @@ function marketplaceSourceRepoExists(marketplaceName, cwd) {
|
|
|
1471
1137
|
}
|
|
1472
1138
|
}
|
|
1473
1139
|
}
|
|
1474
|
-
/**
|
|
1475
|
-
* Is a version-home marketplace-plugin install an orphan (safe to trash)?
|
|
1476
|
-
*
|
|
1477
|
-
* A version-home plugin is keyed by (marketplace, name), not name alone — the
|
|
1478
|
-
* bug PHNX-2618 exposed. When the same plugin name lives in two marketplaces
|
|
1479
|
-
* (e.g. a legacy `code` under `agents-cli` and the current `code` under
|
|
1480
|
-
* `agents-system`), a name-only test keeps BOTH alive because the name is active
|
|
1481
|
-
* somewhere, so the stale copy never gets cleaned and serves deleted skills.
|
|
1482
|
-
*
|
|
1483
|
-
* - Pair still active → keep.
|
|
1484
|
-
* - Pair gone, but the marketplace's source repo is present (authoritative) →
|
|
1485
|
-
* orphan. Trash it even though another marketplace still ships that name.
|
|
1486
|
-
* - Pair gone AND the source repo is absent (unreachable) → fall back to the
|
|
1487
|
-
* original name-only test so an unrelated sync can't trash a plugin whose
|
|
1488
|
-
* source simply isn't on this box / in this cwd right now.
|
|
1489
|
-
*
|
|
1490
|
-
* When `pairs` is null (a legacy bare-name caller), this reduces to the original
|
|
1491
|
-
* name-only behavior unchanged.
|
|
1492
|
-
*/
|
|
1493
1140
|
function isOrphanMarketplacePlugin(marketplaceName, pluginName, active, cwd) {
|
|
1494
1141
|
if (active.pairs === null)
|
|
1495
1142
|
return !active.names.has(pluginName);
|
|
@@ -1499,21 +1146,10 @@ function isOrphanMarketplacePlugin(marketplaceName, pluginName, active, cwd) {
|
|
|
1499
1146
|
return true;
|
|
1500
1147
|
return !active.names.has(pluginName);
|
|
1501
1148
|
}
|
|
1502
|
-
/**
|
|
1503
|
-
* Remove orphaned plugin entries from a version home. A marketplace-plugin
|
|
1504
|
-
* install is "orphan" when no active source plugin matches its (marketplace,
|
|
1505
|
-
* name) pair (see isOrphanMarketplacePlugin). Soft-deletes the affected
|
|
1506
|
-
* marketplace plugin dir to ~/.agents/.trash/plugins/. Also cleans up any
|
|
1507
|
-
* legacy dual-dash skills/ directories from older agents-cli versions.
|
|
1508
|
-
*
|
|
1509
|
-
* Pass the discovered plugins (`discoverPlugins()`) for marketplace-aware
|
|
1510
|
-
* detection; a bare `Set<string>` of names keeps the original name-only behavior.
|
|
1511
|
-
*/
|
|
1512
1149
|
export function cleanOrphanedPluginSkills(agent, versionHome, activePlugins, version) {
|
|
1513
1150
|
const active = indexActivePlugins(activePlugins);
|
|
1514
1151
|
const cwd = process.cwd();
|
|
1515
1152
|
const removed = [];
|
|
1516
|
-
// 1. Walk every marketplace's install dir and trash entries no longer active.
|
|
1517
1153
|
for (const name of listVersionMarketplaceNames(agent, versionHome)) {
|
|
1518
1154
|
const spec = marketplaceSpecForName(name);
|
|
1519
1155
|
const mktPluginsDir = path.join(marketplaceRoot(name, agent, versionHome), 'plugins');
|
|
@@ -1541,9 +1177,8 @@ export function cleanOrphanedPluginSkills(agent, versionHome, activePlugins, ver
|
|
|
1541
1177
|
removed.push(entry.name);
|
|
1542
1178
|
trashedHere = true;
|
|
1543
1179
|
}
|
|
1544
|
-
catch {
|
|
1180
|
+
catch { }
|
|
1545
1181
|
}
|
|
1546
|
-
// Keep manifest in sync with on-disk state and drop the marketplace if empty.
|
|
1547
1182
|
if (trashedHere) {
|
|
1548
1183
|
syncMarketplaceManifest(spec, agent, versionHome);
|
|
1549
1184
|
if (marketplaceIsEmpty(name, agent, versionHome)) {
|
|
@@ -1552,7 +1187,6 @@ export function cleanOrphanedPluginSkills(agent, versionHome, activePlugins, ver
|
|
|
1552
1187
|
}
|
|
1553
1188
|
}
|
|
1554
1189
|
}
|
|
1555
|
-
// 2. Sweep legacy dual-dash skills directories from older agents-cli versions.
|
|
1556
1190
|
const skillsDir = path.join(versionHome, agentConfigDirName(agent), 'skills');
|
|
1557
1191
|
if (fs.existsSync(skillsDir)) {
|
|
1558
1192
|
for (const entry of fs.readdirSync(skillsDir, { withFileTypes: true })) {
|
|
@@ -1572,7 +1206,7 @@ export function cleanOrphanedPluginSkills(agent, versionHome, activePlugins, ver
|
|
|
1572
1206
|
fs.renameSync(path.join(skillsDir, entry.name), trashDest);
|
|
1573
1207
|
removed.push(entry.name);
|
|
1574
1208
|
}
|
|
1575
|
-
catch {
|
|
1209
|
+
catch { }
|
|
1576
1210
|
}
|
|
1577
1211
|
}
|
|
1578
1212
|
return removed;
|
|
@@ -1594,7 +1228,6 @@ export function diffVersionPlugins(agent, version) {
|
|
|
1594
1228
|
}
|
|
1595
1229
|
}
|
|
1596
1230
|
}
|
|
1597
|
-
// Also surface legacy dual-dash skill dirs as orphans during migration period.
|
|
1598
1231
|
const skillsDir = path.join(versionHome, agentConfigDirName(agent), 'skills');
|
|
1599
1232
|
if (fs.existsSync(skillsDir)) {
|
|
1600
1233
|
for (const entry of fs.readdirSync(skillsDir, { withFileTypes: true })) {
|
|
@@ -1644,13 +1277,7 @@ export function removePluginSkillFromVersion(agent, version, skillName) {
|
|
|
1644
1277
|
}
|
|
1645
1278
|
return { success: true };
|
|
1646
1279
|
}
|
|
1647
|
-
// ─── Install / Update ─────────────────────────────────────────────────────────
|
|
1648
|
-
/**
|
|
1649
|
-
* Parse an install spec of the form `name@source` or just `source`.
|
|
1650
|
-
* Source can be a git URL or an absolute/relative local path.
|
|
1651
|
-
*/
|
|
1652
1280
|
export function parseInstallSpec(spec) {
|
|
1653
|
-
// Check for name@source form
|
|
1654
1281
|
const atIdx = spec.indexOf('@');
|
|
1655
1282
|
if (atIdx > 0) {
|
|
1656
1283
|
const name = spec.slice(0, atIdx);
|
|
@@ -1659,14 +1286,8 @@ export function parseInstallSpec(spec) {
|
|
|
1659
1286
|
}
|
|
1660
1287
|
return { name: null, source: spec };
|
|
1661
1288
|
}
|
|
1662
|
-
/**
|
|
1663
|
-
* Install a plugin from a git URL or local path.
|
|
1664
|
-
* Clones/copies to ~/.agents/plugins/<name>/.
|
|
1665
|
-
* Returns the installed plugin name and root path.
|
|
1666
|
-
*/
|
|
1667
1289
|
export async function installPlugin(spec) {
|
|
1668
1290
|
const { name: specName, source } = parseInstallSpec(spec);
|
|
1669
|
-
// Resolve local path (handle ~)
|
|
1670
1291
|
const isLocalPath = source.startsWith('/') || source.startsWith('./') || source.startsWith('../') || source.startsWith('~')
|
|
1671
1292
|
|| (IS_WINDOWS && isWindowsAbsolutePath(source));
|
|
1672
1293
|
const resolvedSource = isLocalPath
|
|
@@ -1674,7 +1295,6 @@ export async function installPlugin(spec) {
|
|
|
1674
1295
|
: source;
|
|
1675
1296
|
const pluginsDir = getPluginsDir();
|
|
1676
1297
|
fs.mkdirSync(pluginsDir, { recursive: true });
|
|
1677
|
-
// If local path, load manifest to get the name
|
|
1678
1298
|
let targetName = specName;
|
|
1679
1299
|
if (!targetName) {
|
|
1680
1300
|
if (isLocalPath) {
|
|
@@ -1684,7 +1304,6 @@ export async function installPlugin(spec) {
|
|
|
1684
1304
|
targetName = manifest.name;
|
|
1685
1305
|
}
|
|
1686
1306
|
else {
|
|
1687
|
-
// Derive from git URL: last path segment without .git
|
|
1688
1307
|
targetName = path.basename(resolvedSource).replace(/\.git$/, '');
|
|
1689
1308
|
}
|
|
1690
1309
|
}
|
|
@@ -1695,15 +1314,12 @@ export async function installPlugin(spec) {
|
|
|
1695
1314
|
assertPluginTargetContained(targetRoot, pluginsDir);
|
|
1696
1315
|
const isNew = !fs.existsSync(targetRoot);
|
|
1697
1316
|
if (isLocalPath) {
|
|
1698
|
-
// Copy local directory
|
|
1699
1317
|
if (fs.existsSync(targetRoot)) {
|
|
1700
1318
|
fs.rmSync(targetRoot, { recursive: true, force: true });
|
|
1701
1319
|
}
|
|
1702
1320
|
fs.cpSync(resolvedSource, targetRoot, { recursive: true });
|
|
1703
1321
|
}
|
|
1704
1322
|
else {
|
|
1705
|
-
// Git clone. Validate the transport (blocks ext::/file:///http:///leading-"-")
|
|
1706
|
-
// and pass "--" so the source can never be parsed as a git option.
|
|
1707
1323
|
assertSafeGitTransport(resolvedSource);
|
|
1708
1324
|
if (fs.existsSync(targetRoot)) {
|
|
1709
1325
|
fs.rmSync(targetRoot, { recursive: true, force: true });
|
|
@@ -1712,21 +1328,15 @@ export async function installPlugin(spec) {
|
|
|
1712
1328
|
stdio: 'pipe',
|
|
1713
1329
|
});
|
|
1714
1330
|
}
|
|
1715
|
-
// Validate manifest
|
|
1716
1331
|
const manifest = loadPluginManifest(targetRoot);
|
|
1717
1332
|
if (!manifest) {
|
|
1718
1333
|
fs.rmSync(targetRoot, { recursive: true, force: true });
|
|
1719
1334
|
throw new Error(`Installed source has no valid .claude-plugin/plugin.json`);
|
|
1720
1335
|
}
|
|
1721
1336
|
const capabilities = inspectPluginCapabilities(targetRoot);
|
|
1722
|
-
// Persist source for future updates. `version` records the manifest version
|
|
1723
|
-
// at pull time — a baseline that lets the heal path tell "central is an
|
|
1724
|
-
// untouched copy of upstream" (safe to fast-forward) from "the user edited
|
|
1725
|
-
// it" (leave alone) without hashing the whole tree.
|
|
1726
1337
|
fs.writeFileSync(path.join(targetRoot, SOURCE_FILE), JSON.stringify({ source, isGit: !isLocalPath, version: manifest.version }), 'utf-8');
|
|
1727
1338
|
return { name: manifest.name, root: targetRoot, isNew, capabilities };
|
|
1728
1339
|
}
|
|
1729
|
-
/** Read a plugin's `.source` provenance, or null when absent/unreadable. */
|
|
1730
1340
|
export function readPluginSourceInfo(root) {
|
|
1731
1341
|
const f = path.join(root, SOURCE_FILE);
|
|
1732
1342
|
if (!fs.existsSync(f))
|
|
@@ -1738,12 +1348,6 @@ export function readPluginSourceInfo(root) {
|
|
|
1738
1348
|
return null;
|
|
1739
1349
|
}
|
|
1740
1350
|
}
|
|
1741
|
-
/**
|
|
1742
|
-
* Resolve the CURRENT upstream manifest version for a local-sourced plugin
|
|
1743
|
-
* (the `.system`/local-path case). Returns null for git sources — reading their
|
|
1744
|
-
* upstream version would need a network fetch, so git plugins are refreshed only
|
|
1745
|
-
* via the explicit `agents plugins update`.
|
|
1746
|
-
*/
|
|
1747
1351
|
export function getUpstreamManifestVersion(info) {
|
|
1748
1352
|
if (info.isGit)
|
|
1749
1353
|
return null;
|
|
@@ -1751,36 +1355,11 @@ export function getUpstreamManifestVersion(info) {
|
|
|
1751
1355
|
const m = loadPluginManifest(resolved);
|
|
1752
1356
|
return m?.version ?? null;
|
|
1753
1357
|
}
|
|
1754
|
-
/**
|
|
1755
|
-
* Update an installed plugin by re-pulling from its original source.
|
|
1756
|
-
* Returns true if the update succeeded.
|
|
1757
|
-
*/
|
|
1758
|
-
/**
|
|
1759
|
-
* Labels of exec surfaces present in `after` that were NOT present in `before`.
|
|
1760
|
-
* Used by updatePlugin to distinguish a newly-appearing execution surface
|
|
1761
|
-
* (upstream compromise → renewed consent required) from one the user already
|
|
1762
|
-
* trusted (leave enablement alone).
|
|
1763
|
-
*/
|
|
1764
1358
|
export function newExecSurfaceLabels(before, after) {
|
|
1765
1359
|
return Object.keys(PLUGIN_EXEC_SURFACE_LABELS)
|
|
1766
1360
|
.filter((key) => after[key] && !before[key])
|
|
1767
1361
|
.map((key) => PLUGIN_EXEC_SURFACE_LABELS[key]);
|
|
1768
1362
|
}
|
|
1769
|
-
/**
|
|
1770
|
-
* Re-fetch a plugin from its recorded source and apply the update to disk.
|
|
1771
|
-
*
|
|
1772
|
-
* Security (RUSH-1757): a plugin's upstream is mutable. `updatePlugin` never
|
|
1773
|
-
* mutates the live plugin tree before it has inspected the incoming content —
|
|
1774
|
-
* the new revision is fetched into a **quarantine** dir first, its capabilities
|
|
1775
|
-
* are diffed against the current on-disk baseline, and the update is applied to
|
|
1776
|
-
* `plugin.root` only after the trust decision. If the update introduces a NEW
|
|
1777
|
-
* executable surface (hooks/, .mcp.json, bin/, scripts/, settings.json,
|
|
1778
|
-
* permissions/) that the current revision did not carry, the update is refused
|
|
1779
|
-
* unless `options.allowExecSurfaces` is set — the last-good content is kept in
|
|
1780
|
-
* place, so a benign-then-compromised upstream can never execute on the next
|
|
1781
|
-
* update without renewed consent. A surface the user already trusted is not a
|
|
1782
|
-
* "new" surface and does not re-trigger the gate.
|
|
1783
|
-
*/
|
|
1784
1363
|
export async function updatePlugin(name, options = {}) {
|
|
1785
1364
|
const plugin = getPlugin(name);
|
|
1786
1365
|
if (!plugin) {
|
|
@@ -1797,23 +1376,17 @@ export async function updatePlugin(name, options = {}) {
|
|
|
1797
1376
|
catch {
|
|
1798
1377
|
return { success: false, error: `Could not read source info for '${name}'` };
|
|
1799
1378
|
}
|
|
1800
|
-
// Baseline: what the live (already-trusted) revision ships today.
|
|
1801
1379
|
const before = inspectPluginCapabilities(plugin.root);
|
|
1802
|
-
// Quarantine dir lives beside plugin.root (same filesystem) so the final
|
|
1803
|
-
// apply can be a rename. The dot-prefix keeps it out of plugin discovery.
|
|
1804
1380
|
const quarantine = path.join(path.dirname(plugin.root), `.${path.basename(plugin.root)}.update-quarantine`);
|
|
1805
1381
|
const cleanupQuarantine = () => {
|
|
1806
1382
|
try {
|
|
1807
1383
|
fs.rmSync(quarantine, { recursive: true, force: true });
|
|
1808
1384
|
}
|
|
1809
|
-
catch {
|
|
1385
|
+
catch { }
|
|
1810
1386
|
};
|
|
1811
1387
|
cleanupQuarantine();
|
|
1812
1388
|
try {
|
|
1813
|
-
// 1. Fetch the incoming revision into quarantine — never touch plugin.root yet.
|
|
1814
1389
|
if (sourceInfo.isGit) {
|
|
1815
|
-
// Copy the working checkout (with its .git) and fast-forward the copy, so a
|
|
1816
|
-
// hostile upstream diff lands in the quarantine, not the live tree.
|
|
1817
1390
|
fs.cpSync(plugin.root, quarantine, { recursive: true });
|
|
1818
1391
|
execFileSync('git', ['-C', quarantine, 'pull', '--ff-only'], { stdio: 'pipe' });
|
|
1819
1392
|
}
|
|
@@ -1825,11 +1398,8 @@ export async function updatePlugin(name, options = {}) {
|
|
|
1825
1398
|
}
|
|
1826
1399
|
fs.cpSync(resolvedSource, quarantine, { recursive: true });
|
|
1827
1400
|
}
|
|
1828
|
-
// 2. Diff capabilities of the incoming revision against the baseline.
|
|
1829
1401
|
const after = inspectPluginCapabilities(quarantine);
|
|
1830
1402
|
const newSurfaces = newExecSurfaceLabels(before, after);
|
|
1831
|
-
// 3. Refuse a surface-introducing update without renewed consent. The
|
|
1832
|
-
// last-good content stays in place untouched.
|
|
1833
1403
|
if (newSurfaces.length > 0 && options.allowExecSurfaces !== true) {
|
|
1834
1404
|
cleanupQuarantine();
|
|
1835
1405
|
return {
|
|
@@ -1840,8 +1410,6 @@ export async function updatePlugin(name, options = {}) {
|
|
|
1840
1410
|
`Re-run with --allow-exec-surfaces if you trust the source.`,
|
|
1841
1411
|
};
|
|
1842
1412
|
}
|
|
1843
|
-
// 4. Apply: swap the quarantined revision into plugin.root, preserving the
|
|
1844
|
-
// user config and re-stamping .source.
|
|
1845
1413
|
const userConfigPath = path.join(plugin.root, USER_CONFIG_FILE);
|
|
1846
1414
|
const userConfigBackup = fs.existsSync(userConfigPath)
|
|
1847
1415
|
? fs.readFileSync(userConfigPath, 'utf-8')
|
|
@@ -1851,8 +1419,6 @@ export async function updatePlugin(name, options = {}) {
|
|
|
1851
1419
|
if (userConfigBackup !== null) {
|
|
1852
1420
|
fs.writeFileSync(userConfigPath, userConfigBackup, 'utf-8');
|
|
1853
1421
|
}
|
|
1854
|
-
// Re-stamp .source with the freshly pulled manifest version so the baseline
|
|
1855
|
-
// tracks what's now on disk (keeps the heal "unmodified?" check honest).
|
|
1856
1422
|
const freshVersion = loadPluginManifest(plugin.root)?.version;
|
|
1857
1423
|
fs.writeFileSync(path.join(plugin.root, SOURCE_FILE), JSON.stringify({ ...sourceInfo, version: freshVersion }), 'utf-8');
|
|
1858
1424
|
return { success: true, newExecSurfaces: newSurfaces, hasExecSurfaces: hasPluginExecSurfaces(after) };
|