@chankov/agent-fleet 2.0.23 → 2.1.0
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/.pi/agent-fleet/scripts/fleet-codex-local-mcp.mjs +26 -0
- package/.pi/agent-fleet/scripts/fleet-codex-local-mcp.ts +59 -0
- package/.pi/agent-fleet/scripts/fleet.ts +3 -0
- package/.pi/agent-fleet/scripts/lib/codex-desktop-queue-host.ts +122 -0
- package/.pi/agent-fleet/scripts/lib/codex-unix-queue-rpc.ts +91 -0
- package/.pi/agent-fleet/scripts/lib/fleet-codex-allowlist-store.ts +349 -0
- package/.pi/agent-fleet/scripts/lib/fleet-codex-allowlist.ts +175 -0
- package/.pi/agent-fleet/scripts/lib/fleet-codex-answer-transport.ts +72 -0
- package/.pi/agent-fleet/scripts/lib/fleet-codex-answers.ts +74 -0
- package/.pi/agent-fleet/scripts/lib/fleet-codex-event-reply.ts +53 -0
- package/.pi/agent-fleet/scripts/lib/fleet-codex-event-runtime.ts +111 -0
- package/.pi/agent-fleet/scripts/lib/fleet-codex-instruction-store.ts +428 -0
- package/.pi/agent-fleet/scripts/lib/fleet-codex-instruction-transport.ts +160 -0
- package/.pi/agent-fleet/scripts/lib/fleet-codex-instructions.ts +173 -0
- package/.pi/agent-fleet/scripts/lib/fleet-codex-local-mcp.ts +384 -0
- package/.pi/agent-fleet/scripts/lib/fleet-codex-native-history.ts +215 -0
- package/.pi/agent-fleet/scripts/lib/fleet-codex-observation-store.ts +208 -0
- package/.pi/agent-fleet/scripts/lib/fleet-codex-observe-transport.ts +49 -0
- package/.pi/agent-fleet/scripts/lib/fleet-codex-observe.ts +93 -0
- package/.pi/agent-fleet/scripts/lib/fleet-codex-overview.ts +52 -0
- package/.pi/agent-fleet/scripts/lib/fleet-codex-permission-transport.ts +23 -0
- package/.pi/agent-fleet/scripts/lib/fleet-codex-permissions.ts +81 -0
- package/.pi/agent-fleet/scripts/lib/fleet-codex-readonly.ts +213 -0
- package/.pi/agent-fleet/scripts/lib/fleet-codex-relay-latency.ts +45 -0
- package/.pi/agent-fleet/scripts/lib/fleet-codex-resync.ts +212 -0
- package/.pi/agent-fleet/scripts/lib/fleet-command.ts +2 -0
- package/.pi/agent-fleet/scripts/package-lock.json +22 -0
- package/.pi/agent-fleet/scripts/package.json +1 -0
- package/.pi/agents/voices.yaml +1 -1
- package/.pi/harnesses/agent-hub/README.md +61 -4
- package/.pi/harnesses/agent-hub/acceptance.ts +8 -4
- package/.pi/harnesses/agent-hub/access-approval.ts +146 -21
- package/.pi/harnesses/agent-hub/assertion-ledger.js +1 -0
- package/.pi/harnesses/agent-hub/commands/config.ts +9 -0
- package/.pi/harnesses/agent-hub/commands/context.ts +1 -0
- package/.pi/harnesses/agent-hub/context/assertions-artifacts.ts +2 -2
- package/.pi/harnesses/agent-hub/damage-guard-approval.ts +41 -17
- package/.pi/harnesses/agent-hub/damage-guard-hub.ts +16 -9
- package/.pi/harnesses/agent-hub/damage-guard-state.ts +2 -2
- package/.pi/harnesses/agent-hub/dispatch-native-complete.ts +4 -1
- package/.pi/harnesses/agent-hub/dispatch-native-prepare.ts +4 -1
- package/.pi/harnesses/agent-hub/dispatch-native-spawn.ts +5 -0
- package/.pi/harnesses/agent-hub/dispatch-native-types.ts +1 -1
- package/.pi/harnesses/agent-hub/index.ts +73 -8
- package/.pi/harnesses/agent-hub/input/shortcuts.ts +3 -0
- package/.pi/harnesses/agent-hub/no-progress.ts +3 -3
- package/.pi/harnesses/agent-hub/operator-current-state.ts +53 -0
- package/.pi/harnesses/agent-hub/orchestration-activation.ts +1 -1
- package/.pi/harnesses/agent-hub/package.json +1 -1
- package/.pi/harnesses/agent-hub/permission-channel.ts +87 -0
- package/.pi/harnesses/agent-hub/permission-relay.ts +84 -0
- package/.pi/harnesses/agent-hub/process-obligations.ts +8 -3
- package/.pi/harnesses/agent-hub/prompts/fragments.ts +1 -1
- package/.pi/harnesses/agent-hub/prompts/session-start.ts +1 -1
- package/.pi/harnesses/agent-hub/return-contract.js +24 -2
- package/.pi/harnesses/agent-hub/review-reuse.ts +3 -3
- package/.pi/harnesses/agent-hub/review-verdict.ts +6 -0
- package/.pi/harnesses/agent-hub/runtime-receipts.ts +60 -0
- package/.pi/harnesses/agent-hub/runtime-test-check.ts +11 -0
- package/.pi/harnesses/agent-hub/spawn.ts +50 -13
- package/.pi/harnesses/agent-hub/specialist-result.ts +15 -6
- package/.pi/harnesses/agent-hub/system1-communication-store.ts +8 -0
- package/.pi/harnesses/agent-hub/task-resume-contract.ts +5 -0
- package/.pi/harnesses/agent-hub/task-triage-authorization.ts +36 -17
- package/.pi/harnesses/agent-hub/tools/coms-tools.ts +4 -4
- package/.pi/harnesses/agent-hub/tools/context.ts +2 -1
- package/.pi/harnesses/agent-hub/tools/dispatch-agent.ts +2 -0
- package/.pi/harnesses/agent-hub/tools/dispatch-execution.ts +133 -40
- package/.pi/harnesses/agent-hub/tools/verification-contract.ts +1 -0
- package/.pi/harnesses/agent-hub/ui/fleet-dashboard.ts +3 -1
- package/.pi/harnesses/agent-hub/work-mode.ts +3 -1
- package/.pi/harnesses/ask-user-remote/README.md +2 -2
- package/.pi/harnesses/ask-user-remote/questions.ts +49 -2
- package/.pi/harnesses/ask-user-remote/runtime-ask.ts +13 -6
- package/.pi/harnesses/coms/README.md +5 -0
- package/.pi/harnesses/coms/index.ts +25 -2
- package/.pi/harnesses/coms/package.json +1 -1
- package/.pi/harnesses/damage-control-continue/index.ts +69 -31
- package/.pi/harnesses/damage-control-continue/package.json +1 -1
- package/.pi/harnesses/lib/bash-policy-analysis.ts +1 -1
- package/.pi/harnesses/lib/coms-core-io.ts +8 -1
- package/.pi/harnesses/lib/coms-core.ts +42 -8
- package/.pi/harnesses/lib/coms-instruction-receipts.ts +113 -0
- package/.pi/harnesses/lib/coms-observation.ts +74 -0
- package/.pi/harnesses/lib/damage-auto-policy.ts +52 -0
- package/.pi/harnesses/lib/damage-control-presentation.ts +14 -0
- package/.pi/harnesses/lib/damage-control-shared.ts +46 -15
- package/.pi/harnesses/lib/exact-permission-port.ts +38 -0
- package/.pi/harnesses/lib/fleet-codex-event-bridge.ts +81 -0
- package/.pi/harnesses/lib/fleet-config/cli-bridge.ts +111 -0
- package/.pi/harnesses/lib/fleet-config/mutations.ts +201 -0
- package/.pi/harnesses/lib/fleet-config/snapshot.ts +417 -0
- package/.pi/harnesses/lib/fleet-config/transition.ts +68 -0
- package/.pi/harnesses/lib/fleet-config/ui.ts +269 -0
- package/.pi/harnesses/lib/fleet-config/view.ts +338 -0
- package/.pi/harnesses/lib/fleet-dashboard-view.ts +3 -1
- package/.pi/harnesses/lib/fleet-event-source.ts +21 -0
- package/.pi/harnesses/lib/update-check.ts +5 -0
- package/.versions/2.1.0/.pi/agent-fleet/hermes/README.md +347 -0
- package/.versions/2.1.0/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-herdr/plugin.js +1291 -0
- package/.versions/2.1.0/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-herdr/presentation.js +672 -0
- package/.versions/2.1.0/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-monitor/plugin.js +19 -0
- package/.versions/2.1.0/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-monitor/state.js +10 -0
- package/.versions/2.1.0/.pi/agent-fleet/hermes/gates/gate-o-capability.md +8 -0
- package/.versions/2.1.0/.pi/agent-fleet/hermes/gates/gate-o-validator-fixtures.json +1 -0
- package/.versions/2.1.0/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/activity.py +773 -0
- package/.versions/2.1.0/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/coms_registry.py +134 -0
- package/.versions/2.1.0/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/coms_send.py +350 -0
- package/.versions/2.1.0/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/herdr_source.py +193 -0
- package/.versions/2.1.0/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/manifest.json +4 -0
- package/.versions/2.1.0/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/plugin_api.py +444 -0
- package/.versions/2.1.0/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/sessions.py +205 -0
- package/.versions/2.1.0/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/tasks.py +300 -0
- package/.versions/2.1.0/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/watch.py +819 -0
- package/.versions/2.1.0/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/plugin.yaml +8 -0
- package/.versions/2.1.0/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/adapter.py +139 -0
- package/.versions/2.1.0/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/manifest.json +11 -0
- package/.versions/2.1.0/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/plugin_api.py +50 -0
- package/.versions/2.1.0/.pi/agent-fleet/hermes/skills/hub-conductor/SKILL.md +84 -0
- package/.versions/2.1.0/.pi/agent-fleet/hermes/skills/hub-liaison/SKILL.md +84 -0
- package/.versions/2.1.0/.pi/agent-fleet/hermes/skills/hub-watchdog/SKILL.md +76 -0
- package/.versions/2.1.0/.pi/agent-fleet/hermes/skills/hub-watchdog/manifest.json +1 -0
- package/.versions/2.1.0/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog.py +249 -0
- package/.versions/2.1.0/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_actions.py +124 -0
- package/.versions/2.1.0/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_contract.py +76 -0
- package/.versions/2.1.0/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_delivery.py +10 -0
- package/.versions/2.1.0/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_engine.py +128 -0
- package/.versions/2.1.0/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_judgment.py +41 -0
- package/.versions/2.1.0/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_recovery.py +103 -0
- package/.versions/2.1.0/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_state.py +163 -0
- package/.versions/2.1.0/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_transport.py +138 -0
- package/.versions/2.1.0/.pi/agent-fleet/hermes/watchdog-tests/__init__.py +0 -0
- package/.versions/2.1.0/.pi/agent-fleet/hooks/coms-stop-hook.mjs +84 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/claude-code-preflight.ts +70 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/coms-claude-bridge.ts +440 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/coms-cli.ts +430 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/coms-hermes-bridge.ts +416 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/exec-at-target.ts +10 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/fixtures/fleet-codex-allowlist-store-child.ts +31 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/fleet-codex-local-mcp.mjs +26 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/fleet-codex-local-mcp.ts +59 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/fleet.ts +248 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/flow.ts +166 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/hermes-monitor-capability-runner.ts +25 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/hermes-monitor-scenario.ts +474 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/hermes-watchdog-capability-probe.ts +45 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/install-hermes-plugin.sh +180 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/claude-bridge-core.ts +208 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/codex-desktop-queue-host.ts +122 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/codex-unix-queue-rpc.ts +91 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/coms-envelope.ts +582 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/fake-herdr-server.ts +88 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/fleet-codex-allowlist-store.ts +349 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/fleet-codex-allowlist.ts +175 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/fleet-codex-answer-transport.ts +72 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/fleet-codex-answers.ts +74 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/fleet-codex-event-reply.ts +53 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/fleet-codex-event-runtime.ts +111 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/fleet-codex-instruction-store.ts +428 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/fleet-codex-instruction-transport.ts +160 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/fleet-codex-instructions.ts +173 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/fleet-codex-local-mcp.ts +384 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/fleet-codex-native-history.ts +215 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/fleet-codex-observation-store.ts +208 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/fleet-codex-observe-transport.ts +49 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/fleet-codex-observe.ts +93 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/fleet-codex-overview.ts +52 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/fleet-codex-permission-transport.ts +23 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/fleet-codex-permissions.ts +81 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/fleet-codex-readonly.ts +213 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/fleet-codex-relay-latency.ts +45 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/fleet-codex-resync.ts +212 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/fleet-command.ts +268 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/flow-command.ts +107 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/flow-maintenance.ts +238 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/herdr-layout.ts +281 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/hermes-bridge-core.ts +241 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/hermes-monitor-events.ts +1 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/hermes-monitor-herdr.ts +2 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/hermes-monitor-model.ts +3 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/hermes-monitor-registry.ts +2 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/hermes-monitor-socket.ts +2 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/hermes-monitor-store.ts +2 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/monitor-env.ts +146 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/peer-launch.ts +318 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/peer-target.ts +1 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/persona-banner.ts +62 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/persona-dirs.ts +25 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/resource-closure.js +1 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/runtime-dependencies.js +124 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/session-launch.ts +56 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/spawn-stagger.ts +101 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/team-project.ts +178 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/team-snapshot.ts +160 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/package-lock.json +57 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/package.json +10 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/peer-banner.ts +41 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/peer-launch.ts +289 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/pi-session.ts +9 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/team-snapshot.ts +245 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/team-up.ts +385 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/workflows/lib/agent-phase.ts +181 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/workflows/lib/changes.ts +61 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/workflows/lib/debate.ts +149 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/workflows/lib/env.ts +36 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/workflows/lib/envelopes.ts +169 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/workflows/lib/gates.ts +81 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/workflows/lib/git.ts +99 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/workflows/lib/isolated-snapshot.ts +130 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/workflows/lib/merge.ts +95 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/workflows/lib/model-profile.ts +22 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/workflows/lib/model-visibility.ts +92 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/workflows/lib/permissions.ts +137 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/workflows/lib/personas.ts +57 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/workflows/lib/poll.ts +86 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/workflows/lib/project-policy.ts +37 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/workflows/lib/quality.ts +65 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/workflows/lib/run.ts +109 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/workflows/lib/scout-data-boundary.ts +55 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/workflows/lib/trace.ts +52 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/workflows/lib/voices.ts +128 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/workflows/lib/writer-lease-race.worker.mjs +36 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/workflows/lib/writer-lease.ts +148 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/workflows/tsconfig.json +22 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/workflows/wf-build-test.ts +61 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/workflows/wf-debate.ts +87 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/workflows/wf-document.ts +50 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/workflows/wf-poll.ts +95 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/workflows/wf-quality.ts +20 -0
- package/.versions/2.1.0/.pi/agent-fleet/scripts/workflows/wf-scout.ts +40 -0
- package/.versions/2.1.0/.pi/agents/dispatch-policy.yaml +32 -0
- package/.versions/2.1.0/.pi/agents/model-profiles.yaml +134 -0
- package/.versions/2.1.0/.pi/agents/peers.yaml +147 -0
- package/.versions/2.1.0/.pi/agents/teams.yaml +41 -0
- package/.versions/2.1.0/.pi/agents/voices.yaml +13 -0
- package/.versions/2.1.0/.pi/damage-control-rules.yaml +297 -0
- package/.versions/2.1.0/.pi/extensions/btw/README.md +120 -0
- package/.versions/2.1.0/.pi/extensions/btw/index.ts +916 -0
- package/.versions/2.1.0/.pi/extensions/btw/package.json +6 -0
- package/.versions/2.1.0/.pi/extensions/btw/state.js +179 -0
- package/.versions/2.1.0/.pi/extensions/chrome-devtools-mcp/README.md +55 -0
- package/.versions/2.1.0/.pi/extensions/chrome-devtools-mcp/index.ts +93 -0
- package/.versions/2.1.0/.pi/extensions/chrome-devtools-mcp/package.json +6 -0
- package/.versions/2.1.0/.pi/extensions/compact-and-continue/README.md +42 -0
- package/.versions/2.1.0/.pi/extensions/compact-and-continue/index.ts +136 -0
- package/.versions/2.1.0/.pi/extensions/compact-and-continue/package.json +6 -0
- package/.versions/2.1.0/.pi/extensions/mcp-bridge/README.md +46 -0
- package/.versions/2.1.0/.pi/extensions/mcp-bridge/index.ts +206 -0
- package/.versions/2.1.0/.pi/extensions/mcp-bridge/package.json +6 -0
- package/.versions/2.1.0/.pi/extensions/package-lock.json +1175 -0
- package/.versions/2.1.0/.pi/extensions/package.json +9 -0
- package/.versions/2.1.0/.pi/extensions/pi-voice-stt/README.md +224 -0
- package/.versions/2.1.0/.pi/extensions/pi-voice-stt/config.ts +199 -0
- package/.versions/2.1.0/.pi/extensions/pi-voice-stt/examples/stt.json +35 -0
- package/.versions/2.1.0/.pi/extensions/pi-voice-stt/index.ts +248 -0
- package/.versions/2.1.0/.pi/extensions/pi-voice-stt/package.json +6 -0
- package/.versions/2.1.0/.pi/extensions/pi-voice-stt/providers.ts +214 -0
- package/.versions/2.1.0/.pi/extensions/pi-voice-stt/recorder.ts +158 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/README.md +1584 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/acceptance.ts +204 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/access-approval.ts +266 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/action-authorization.ts +10 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/agentic-contract.ts +43 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/agentic-evidence.ts +64 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/agentic-hub.ts +55 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/agentic-runtime.ts +56 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/agentic-sources-worker.mjs +4 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/agentic-sources.ts +74 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/agentic-state.ts +23 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/approval-wait.ts +1 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/artifacts.js +146 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/assertion-ledger.js +68 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/assist-profile.ts +19 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/backend-policy.js +174 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/bounded-output.ts +26 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/budget-recovery.ts +123 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/capability-confirmation.ts +47 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/capability-packs.ts +184 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/commands/agent-model-thinking.ts +10 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/commands/agent-model.ts +10 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/commands/agent-models-substitute.ts +10 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/commands/agents-add.ts +9 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/commands/agents-drop.ts +9 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/commands/agents-history.ts +9 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/commands/agents-kill.ts +10 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/commands/agents-list.ts +9 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/commands/agents-restart.ts +10 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/commands/agents-save.ts +9 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/commands/agents-team.ts +9 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/commands/audit.ts +9 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/commands/compound.ts +9 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/commands/coms.ts +9 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/commands/config.ts +9 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/commands/context-command.ts +9 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/commands/context.ts +47 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/commands/debate.ts +9 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/commands/dispatch-policy.ts +9 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/commands/handoff.ts +10 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/commands/hub-report.ts +9 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/commands/models.ts +10 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/commands/poll.ts +9 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/commands/recover.ts +61 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/commands/retry.ts +10 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/commands/task-triage-recover.ts +12 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/commands/task-triage-waive.ts +12 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/commands/watchdog.ts +9 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/commands/work-mode.ts +29 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/commands/zoom.ts +10 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/config/agents.ts +181 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/config/model-profiles.ts +237 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/config/overrides.ts +166 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/context/agent-state.ts +30 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/context/assertions-artifacts.ts +221 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/context/budgets.ts +152 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/context/hub-state.ts +40 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/context-budget-snapshot.ts +105 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/context-compaction-monitor.ts +35 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/context-compaction-preflight.ts +21 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/context-compaction-runtime.ts +69 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/context-compaction.ts +34 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/context-continuity-broker.ts +44 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/context-continuity-child.ts +83 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/context-continuity-client.ts +22 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/context-continuity-compat.ts +30 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/context-continuity-owners.ts +17 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/context-continuity-registry.ts +8 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/context-continuity.ts +82 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/context-pressure.ts +222 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/context-window.js +108 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/damage-guard-approval.ts +83 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/damage-guard-broker.ts +125 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/damage-guard-contract.ts +22 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/damage-guard-descendant.ts +76 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/damage-guard-hub.ts +263 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/damage-guard-identity.ts +12 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/damage-guard-owners.ts +59 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/damage-guard-state.ts +43 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/damage-guard-test-tsconfig.json +19 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/debate-command.ts +176 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/delegate.ts +478 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/deterministic-fs.ts +195 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/diagnostic-probe-extension.ts +26 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/diagnostic-series-budget.ts +178 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/dispatch-coms.ts +258 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/dispatch-core.ts +27 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/dispatch-native-complete.ts +176 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/dispatch-native-prepare.ts +298 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/dispatch-native-spawn.ts +260 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/dispatch-native-types.ts +293 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/dispatch-native.ts +236 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/dispatch-observability.ts +225 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/dispatch-triage-contract.ts +27 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/dispatch-triage-eval.ts +77 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/dispatch-triage-policy.ts +29 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/dispatch-triage-runtime.ts +55 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/dispatch-triage-state.ts +33 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/docs-lane.js +123 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/drift-judge.ts +352 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/drift-runtime.ts +480 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/drift-system1-policy.ts +39 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/drift-system1.ts +469 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/drift-watchdog.js +349 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/evidence-manifest.ts +51 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/evidence-rules.js +96 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/execution-evidence.ts +96 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/execution-trace.ts +241 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/external-blocker.js +92 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/file-discovery/adapters.ts +88 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/file-discovery/broker-client.ts +62 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/file-discovery/broker.ts +128 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/file-discovery/child-extension.ts +42 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/file-discovery/descendant.ts +67 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/file-discovery/discovery-worker.mjs +15 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/file-discovery/discovery.ts +126 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/file-discovery/evaluate.ts +57 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/file-discovery/hub.ts +170 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/file-discovery/native-context.ts +8 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/file-discovery/native-fixture.test-support.ts +108 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/file-discovery/owners.ts +100 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/file-discovery/results.ts +55 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/file-discovery/runtime.ts +130 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/file-discovery/semantic-profiles.ts +18 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/file-discovery/sources.ts +69 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/file-discovery/state.ts +22 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/filesystem-tool.ts +166 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/fixtures/registration-surface.json +68 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/fixtures/t0a-synthetic/catalog.ts +189 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/footer.ts +30 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/helpers.ts +270 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/history-projection.ts +116 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/hub-state-audit.js +41 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/index.ts +2682 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/input/completions.ts +82 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/input/shortcuts.ts +23 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/lifecycle/context-pressure.ts +231 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/lifecycle/monitor-session.ts +104 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/lifecycle/session-orchestration.ts +145 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/lifecycle/turn-handlers.ts +90 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/monitor-control.ts +9 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/monitor-invoke-journal.ts +131 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/monitor-invoke.ts +92 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/monitor-lifecycle.ts +13 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/monitor-publisher.ts +59 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/monitor-recovery.ts +3 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/monitor-runtime.ts +3 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/monitor-session-bridge.ts +266 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/no-progress.ts +622 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/operator-current-state.ts +53 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/operator-watchdog.ts +97 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/orchestration-activation.ts +109 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/orchestration-metrics.ts +78 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/orchestration-route.ts +68 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/package.json +7 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/peer-spawn-plan.ts +116 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/permission-channel.ts +87 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/permission-relay.ts +84 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/policy/models.ts +153 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/policy/profile-activation.ts +62 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/policy/profile-runtime.ts +120 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/policy/roster.ts +94 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/policy/work-mode.ts +142 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/poll-command.ts +176 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/presentation.ts +54 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/proactive-config.ts +22 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/proactive-evaluate.ts +138 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/proactive-external-git.ts +82 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/proactive-external.ts +142 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/proactive-feedback.ts +104 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/proactive-findings.ts +115 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/proactive-local.ts +89 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/proactive-observer.ts +106 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/proactive-rules.ts +171 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/proactive-runtime.ts +318 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/proactive-selection.ts +68 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/proactive-snapshot-worker.mjs +12 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/proactive-snapshot.ts +279 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/proactive-types.ts +70 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/process-obligations.ts +164 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/prompts/context.ts +55 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/prompts/fragments.ts +86 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/prompts/session-start.ts +90 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/prompts/system-prompt.ts +125 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/provider-semaphore.js +138 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/reconcile.ts +26 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/recover-policy.ts +44 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/recover-state.ts +104 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/recovery-contract.ts +151 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/rerun-policy.ts +40 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/research/controls.ts +74 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/research/runtime.ts +215 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/research/spawn-run.ts +221 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/research-watchdog.ts +40 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/return-contract.js +371 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/return-extract.js +77 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/review-closure.ts +43 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/review-continuity.ts +73 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/review-findings.js +96 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/review-reuse.ts +47 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/review-verdict.ts +6 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/routing-observation.ts +41 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/routing-proposal.ts +46 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/run-budget.js +342 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/run-namespace.js +93 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/runtime-receipts.ts +60 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/runtime-test-check.ts +79 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/safety-routing.ts +28 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/scope-gate.js +233 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/session-audit.ts +331 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/session-health.js +110 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/session-start.ts +42 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/spawn.ts +702 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/specialist-result-receipt.ts +13 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/specialist-result.ts +78 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/system1-activity.ts +625 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/system1-communication-store.ts +225 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/system1-report.ts +275 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/system1-runtime.ts +271 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/task-continuation.ts +4 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/task-resume-contract.ts +75 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/task-triage-authorization.ts +170 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/task-triage-config.ts +21 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/task-triage-contract.ts +14 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/task-triage-live-stage-boundary.mjs +49 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/task-triage-obligations.ts +120 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/task-triage-policy.ts +16 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/task-triage-review-contract.mjs +43 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/task-triage-reviewer-only-contract.mjs +156 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/task-triage-reviewer-only-diagnostics.mjs +112 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/task-triage-runtime.ts +130 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/task-triage-stage-guard.ts +21 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/task-triage-state.ts +46 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/timeline.ts +72 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/tool-catalog-runtime.ts +79 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/tool-catalog-state.ts +123 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/tool-protocol.ts +134 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/tools/action-executors.ts +214 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/tools/ask-system1-files.ts +15 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/tools/ask-system1.ts +25 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/tools/coms-tools.ts +139 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/tools/context.ts +145 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/tools/dispatch-agent.ts +90 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/tools/dispatch-execution.ts +734 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/tools/dispatch-triage.ts +16 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/tools/execution-orchestration.ts +22 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/tools/fleet-tools.ts +201 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/tools/herdr-executors.ts +100 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/tools/run-flow.ts +146 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/tools/set-task-tier.ts +31 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/tools/spawn-research.ts +67 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/tools/team-adjust.ts +29 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/tools/verification-contract.ts +81 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/tsconfig.json +22 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/types.ts +66 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/ui/activity-dots.ts +25 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/ui/context-budget.ts +89 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/ui/detail-panel.ts +192 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/ui/fleet-actions.ts +78 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/ui/fleet-dashboard.ts +157 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/ui/fleet-editor.ts +44 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/ui/fleet-source.ts +179 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/ui/grid.ts +159 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/ui/history-store.ts +137 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/ui/history.ts +234 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/ui/pool.ts +103 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/ui/running-strip.ts +2 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/ui/system1-communication.ts +59 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/ui/zoom.ts +206 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/unknown-tool-counter.ts +116 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/version.ts +42 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/watchdog-evaluation.ts +110 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/work-mode-controls.ts +56 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/work-mode.ts +188 -0
- package/.versions/2.1.0/.pi/harnesses/agent-hub/write-isolation.ts +187 -0
- package/.versions/2.1.0/.pi/harnesses/ask-user-remote/README.md +59 -0
- package/.versions/2.1.0/.pi/harnesses/ask-user-remote/index.ts +571 -0
- package/.versions/2.1.0/.pi/harnesses/ask-user-remote/questions.ts +206 -0
- package/.versions/2.1.0/.pi/harnesses/ask-user-remote/race-core.js +124 -0
- package/.versions/2.1.0/.pi/harnesses/ask-user-remote/runtime-ask.ts +90 -0
- package/.versions/2.1.0/.pi/harnesses/coms/README.md +105 -0
- package/.versions/2.1.0/.pi/harnesses/coms/index.ts +308 -0
- package/.versions/2.1.0/.pi/harnesses/coms/package.json +7 -0
- package/.versions/2.1.0/.pi/harnesses/coms/version.ts +42 -0
- package/.versions/2.1.0/.pi/harnesses/damage-control-continue/README.md +161 -0
- package/.versions/2.1.0/.pi/harnesses/damage-control-continue/index.ts +659 -0
- package/.versions/2.1.0/.pi/harnesses/damage-control-continue/package.json +7 -0
- package/.versions/2.1.0/.pi/harnesses/damage-control-continue/result-screen.ts +98 -0
- package/.versions/2.1.0/.pi/harnesses/damage-control-continue/system1-child.ts +45 -0
- package/.versions/2.1.0/.pi/harnesses/damage-control-continue/system1-client.ts +85 -0
- package/.versions/2.1.0/.pi/harnesses/damage-control-continue/system1-guard.ts +65 -0
- package/.versions/2.1.0/.pi/harnesses/damage-control-continue/version.ts +42 -0
- package/.versions/2.1.0/.pi/harnesses/lib/approval-wait.ts +17 -0
- package/.versions/2.1.0/.pi/harnesses/lib/bash-policy-analysis.ts +185 -0
- package/.versions/2.1.0/.pi/harnesses/lib/changed-file-diagnostics.ts +642 -0
- package/.versions/2.1.0/.pi/harnesses/lib/clarification-policy.ts +9 -0
- package/.versions/2.1.0/.pi/harnesses/lib/coms-core-io.ts +422 -0
- package/.versions/2.1.0/.pi/harnesses/lib/coms-core.ts +720 -0
- package/.versions/2.1.0/.pi/harnesses/lib/coms-instruction-receipts.ts +113 -0
- package/.versions/2.1.0/.pi/harnesses/lib/coms-observation.ts +74 -0
- package/.versions/2.1.0/.pi/harnesses/lib/coms-registry-entry.ts +99 -0
- package/.versions/2.1.0/.pi/harnesses/lib/context-budget-child-prompt.ts +214 -0
- package/.versions/2.1.0/.pi/harnesses/lib/context-budget-hub-prompt.ts +121 -0
- package/.versions/2.1.0/.pi/harnesses/lib/context-budget-view.ts +112 -0
- package/.versions/2.1.0/.pi/harnesses/lib/context-budget.ts +114 -0
- package/.versions/2.1.0/.pi/harnesses/lib/context-compaction-policy.js +35 -0
- package/.versions/2.1.0/.pi/harnesses/lib/damage-action-hash.ts +28 -0
- package/.versions/2.1.0/.pi/harnesses/lib/damage-auto-policy.ts +52 -0
- package/.versions/2.1.0/.pi/harnesses/lib/damage-control-presentation.ts +14 -0
- package/.versions/2.1.0/.pi/harnesses/lib/damage-control-shared.ts +276 -0
- package/.versions/2.1.0/.pi/harnesses/lib/damage-guard-port.ts +25 -0
- package/.versions/2.1.0/.pi/harnesses/lib/damage-policy.ts +35 -0
- package/.versions/2.1.0/.pi/harnesses/lib/damage-result-evidence.ts +25 -0
- package/.versions/2.1.0/.pi/harnesses/lib/damage-result-view.ts +16 -0
- package/.versions/2.1.0/.pi/harnesses/lib/deterministic-handle-path.ts +25 -0
- package/.versions/2.1.0/.pi/harnesses/lib/exact-permission-port.ts +38 -0
- package/.versions/2.1.0/.pi/harnesses/lib/execution-trace.ts +45 -0
- package/.versions/2.1.0/.pi/harnesses/lib/fixtures/context-budget-profiles.json +11 -0
- package/.versions/2.1.0/.pi/harnesses/lib/fixtures/hub-prompt-operator.legacy.txt +73 -0
- package/.versions/2.1.0/.pi/harnesses/lib/fixtures/hub-prompt-orchestrator.legacy.txt +73 -0
- package/.versions/2.1.0/.pi/harnesses/lib/fleet-codex-event-bridge.ts +81 -0
- package/.versions/2.1.0/.pi/harnesses/lib/fleet-config/cli-bridge.ts +111 -0
- package/.versions/2.1.0/.pi/harnesses/lib/fleet-config/mutations.ts +201 -0
- package/.versions/2.1.0/.pi/harnesses/lib/fleet-config/snapshot.ts +417 -0
- package/.versions/2.1.0/.pi/harnesses/lib/fleet-config/transition.ts +68 -0
- package/.versions/2.1.0/.pi/harnesses/lib/fleet-config/ui.ts +269 -0
- package/.versions/2.1.0/.pi/harnesses/lib/fleet-config/view.ts +338 -0
- package/.versions/2.1.0/.pi/harnesses/lib/fleet-dashboard-ops.ts +178 -0
- package/.versions/2.1.0/.pi/harnesses/lib/fleet-dashboard-view.ts +174 -0
- package/.versions/2.1.0/.pi/harnesses/lib/fleet-detail-view.ts +339 -0
- package/.versions/2.1.0/.pi/harnesses/lib/fleet-event-source.ts +21 -0
- package/.versions/2.1.0/.pi/harnesses/lib/fleet-overlay.ts +26 -0
- package/.versions/2.1.0/.pi/harnesses/lib/fleet-panel.ts +34 -0
- package/.versions/2.1.0/.pi/harnesses/lib/fleet-read-model.ts +609 -0
- package/.versions/2.1.0/.pi/harnesses/lib/fleet-selection.ts +24 -0
- package/.versions/2.1.0/.pi/harnesses/lib/fleet-strip-controller.ts +75 -0
- package/.versions/2.1.0/.pi/harnesses/lib/fleet-strip-view.ts +179 -0
- package/.versions/2.1.0/.pi/harnesses/lib/fleet-transcript-store.ts +244 -0
- package/.versions/2.1.0/.pi/harnesses/lib/herdr-client.ts +472 -0
- package/.versions/2.1.0/.pi/harnesses/lib/herdr-presence.ts +399 -0
- package/.versions/2.1.0/.pi/harnesses/lib/hermes-monitor-events.ts +136 -0
- package/.versions/2.1.0/.pi/harnesses/lib/hermes-monitor-herdr.ts +28 -0
- package/.versions/2.1.0/.pi/harnesses/lib/hermes-monitor-model.ts +18 -0
- package/.versions/2.1.0/.pi/harnesses/lib/hermes-monitor-registry.ts +6 -0
- package/.versions/2.1.0/.pi/harnesses/lib/hermes-monitor-socket.ts +163 -0
- package/.versions/2.1.0/.pi/harnesses/lib/hermes-monitor-store.ts +31 -0
- package/.versions/2.1.0/.pi/harnesses/lib/identical-dialog.ts +27 -0
- package/.versions/2.1.0/.pi/harnesses/lib/installation-state.js +62 -0
- package/.versions/2.1.0/.pi/harnesses/lib/peer-target.ts +24 -0
- package/.versions/2.1.0/.pi/harnesses/lib/policy-roots.js +117 -0
- package/.versions/2.1.0/.pi/harnesses/lib/policy-roots.ts +32 -0
- package/.versions/2.1.0/.pi/harnesses/lib/process-shared.ts +9 -0
- package/.versions/2.1.0/.pi/harnesses/lib/resource-closure.js +26 -0
- package/.versions/2.1.0/.pi/harnesses/lib/safe-source-read.js +29 -0
- package/.versions/2.1.0/.pi/harnesses/lib/semantic-approval.ts +80 -0
- package/.versions/2.1.0/.pi/harnesses/lib/session-target.ts +62 -0
- package/.versions/2.1.0/.pi/harnesses/lib/spawned-peers.js +191 -0
- package/.versions/2.1.0/.pi/harnesses/lib/system1/config-agentic.js +15 -0
- package/.versions/2.1.0/.pi/harnesses/lib/system1/config-context-compaction.js +16 -0
- package/.versions/2.1.0/.pi/harnesses/lib/system1/config-damage-guard.js +24 -0
- package/.versions/2.1.0/.pi/harnesses/lib/system1/config-file-discovery.js +23 -0
- package/.versions/2.1.0/.pi/harnesses/lib/system1/config-json.js +37 -0
- package/.versions/2.1.0/.pi/harnesses/lib/system1/config-loader.js +53 -0
- package/.versions/2.1.0/.pi/harnesses/lib/system1/config-proactive.js +68 -0
- package/.versions/2.1.0/.pi/harnesses/lib/system1/config-triage.js +42 -0
- package/.versions/2.1.0/.pi/harnesses/lib/system1/config-v2.js +112 -0
- package/.versions/2.1.0/.pi/harnesses/lib/system1/config.js +50 -0
- package/.versions/2.1.0/.pi/harnesses/lib/system1/contracts.ts +154 -0
- package/.versions/2.1.0/.pi/harnesses/lib/system1/demo.ts +95 -0
- package/.versions/2.1.0/.pi/harnesses/lib/system1/jev.ts +503 -0
- package/.versions/2.1.0/.pi/harnesses/lib/system1/payload-screen.ts +65 -0
- package/.versions/2.1.0/.pi/harnesses/lib/system1/selection.js +11 -0
- package/.versions/2.1.0/.pi/harnesses/lib/system1/service.ts +245 -0
- package/.versions/2.1.0/.pi/harnesses/lib/system1/worktree-scopes.js +110 -0
- package/.versions/2.1.0/.pi/harnesses/lib/system1/worktree-scopes.ts +13 -0
- package/.versions/2.1.0/.pi/harnesses/lib/system1/worktree-service.ts +24 -0
- package/.versions/2.1.0/.pi/harnesses/lib/target-capabilities.js +7 -0
- package/.versions/2.1.0/.pi/harnesses/lib/update-check.ts +227 -0
- package/.versions/2.1.0/.pi/harnesses/lib/workspace-context.js +115 -0
- package/.versions/2.1.0/.pi/harnesses/lib/workspace-context.ts +22 -0
- package/.versions/2.1.0/.pi/harnesses/package-lock.json +2121 -0
- package/.versions/2.1.0/.pi/harnesses/package.json +13 -0
- package/.versions/2.1.0/.pi/prompts/af-build.md +27 -0
- package/.versions/2.1.0/.pi/prompts/af-code-simplify.md +22 -0
- package/.versions/2.1.0/.pi/prompts/af-constraints.md +31 -0
- package/.versions/2.1.0/.pi/prompts/af-plan.md +17 -0
- package/.versions/2.1.0/.pi/prompts/af-review.md +16 -0
- package/.versions/2.1.0/.pi/prompts/af-set-hermes-telegram.md +15 -0
- package/.versions/2.1.0/.pi/prompts/af-set-hermes-watchdog.md +6 -0
- package/.versions/2.1.0/.pi/prompts/af-setup-rules.md +20 -0
- package/.versions/2.1.0/.pi/prompts/af-ship.md +17 -0
- package/.versions/2.1.0/.pi/prompts/af-spec.md +15 -0
- package/.versions/2.1.0/.pi/prompts/af-test.md +19 -0
- package/.versions/2.1.0/.pi/skills/bowser/SKILL.md +145 -0
- package/.versions/2.1.0/.version +1 -0
- package/.versions/2.1.0/agents/architect.md +24 -0
- package/.versions/2.1.0/agents/bowser.md +28 -0
- package/.versions/2.1.0/agents/builder.md +55 -0
- package/.versions/2.1.0/agents/code-reviewer.md +209 -0
- package/.versions/2.1.0/agents/deep-researcher.md +32 -0
- package/.versions/2.1.0/agents/documenter.md +22 -0
- package/.versions/2.1.0/agents/orchestrator.md +22 -0
- package/.versions/2.1.0/agents/plan-reviewer.md +83 -0
- package/.versions/2.1.0/agents/planner.md +107 -0
- package/.versions/2.1.0/agents/releaser.md +24 -0
- package/.versions/2.1.0/agents/researcher.md +30 -0
- package/.versions/2.1.0/agents/security-auditor.md +167 -0
- package/.versions/2.1.0/agents/test-engineer.md +153 -0
- package/.versions/2.1.0/agents/web-debugger.md +44 -0
- package/.versions/2.1.0/agents/web-performance-auditor.md +194 -0
- package/.versions/2.1.0/bin/catalog/harness-runtime-closure.json +85 -0
- package/.versions/2.1.0/docs/ARCHITECTURE.md +1158 -0
- package/.versions/2.1.0/docs/agent-fleet-setup.md +1143 -0
- package/.versions/2.1.0/docs/claude-code-coms-bridge.md +147 -0
- package/.versions/2.1.0/docs/codex-local-mcp.md +434 -0
- package/.versions/2.1.0/docs/codex-session-bridge.md +44 -0
- package/.versions/2.1.0/docs/codex-setup.md +183 -0
- package/.versions/2.1.0/docs/coms-hermes-bridge.md +188 -0
- package/.versions/2.1.0/docs/fleet-native-voice.md +135 -0
- package/.versions/2.1.0/docs/getting-started.md +126 -0
- package/.versions/2.1.0/docs/npm-install.md +535 -0
- package/.versions/2.1.0/docs/pi-extensions.md +455 -0
- package/.versions/2.1.0/docs/pi-setup.md +92 -0
- package/.versions/2.1.0/docs/skill-anatomy.md +150 -0
- package/.versions/2.1.0/install-manifest.json +3216 -0
- package/.versions/2.1.0/justfile +247 -0
- package/.versions/2.1.0/manifest-meta.json +1086 -0
- package/.versions/2.1.0/references/accessibility-checklist.md +160 -0
- package/.versions/2.1.0/references/communication-contract.md +26 -0
- package/.versions/2.1.0/references/definition-of-done.md +67 -0
- package/.versions/2.1.0/references/fleet-coordination-patterns.md +171 -0
- package/.versions/2.1.0/references/observability-checklist.md +92 -0
- package/.versions/2.1.0/references/orchestration-patterns.md +370 -0
- package/.versions/2.1.0/references/performance-checklist.md +236 -0
- package/.versions/2.1.0/references/prompting-patterns.md +380 -0
- package/.versions/2.1.0/references/security-checklist.md +245 -0
- package/.versions/2.1.0/references/testing-patterns.md +235 -0
- package/.versions/2.1.0/references/workflow-authoring.md +304 -0
- package/.versions/2.1.0/skills/_internal/grilling.md +59 -0
- package/.versions/2.1.0/skills/browser-testing-with-devtools/SKILL.md +351 -0
- package/.versions/2.1.0/skills/code-review-and-quality/SKILL.md +396 -0
- package/.versions/2.1.0/skills/compound-learning/SKILL.md +137 -0
- package/.versions/2.1.0/skills/constraint-driven-development/SKILL.md +338 -0
- package/.versions/2.1.0/skills/constraint-driven-development/references/floor-guard.md +99 -0
- package/.versions/2.1.0/skills/context-engineering/SKILL.md +341 -0
- package/.versions/2.1.0/skills/deprecation-and-migration/SKILL.md +247 -0
- package/.versions/2.1.0/skills/designing-agents/SKILL.md +394 -0
- package/.versions/2.1.0/skills/designing-agents/pi-harness-authoring.md +222 -0
- package/.versions/2.1.0/skills/drafting-workflows/SKILL.md +143 -0
- package/.versions/2.1.0/skills/drafting-workflows/scripts/make-workflow.ts +177 -0
- package/.versions/2.1.0/skills/fleet-native-voice/SKILL.md +73 -0
- package/.versions/2.1.0/skills/fleet-native-voice/agents/openai.yaml +4 -0
- package/.versions/2.1.0/skills/fleet-native-voice.zip +0 -0
- package/.versions/2.1.0/skills/frontend-ui-engineering/SKILL.md +328 -0
- package/.versions/2.1.0/skills/git-workflow-and-versioning/SKILL.md +316 -0
- package/.versions/2.1.0/skills/idea-refine/SKILL.md +182 -0
- package/.versions/2.1.0/skills/idea-refine/examples.md +238 -0
- package/.versions/2.1.0/skills/idea-refine/frameworks.md +99 -0
- package/.versions/2.1.0/skills/idea-refine/refinement-criteria.md +113 -0
- package/.versions/2.1.0/skills/idea-refine/scripts/idea-refine.sh +15 -0
- package/.versions/2.1.0/skills/incremental-implementation/SKILL.md +353 -0
- package/.versions/2.1.0/skills/incremental-implementation.zip +0 -0
- package/.versions/2.1.0/skills/interview-me/SKILL.md +226 -0
- package/.versions/2.1.0/skills/orchestration-verification/SKILL.md +182 -0
- package/.versions/2.1.0/skills/peer-coms/SKILL.md +90 -0
- package/.versions/2.1.0/skills/performance-optimization/SKILL.md +496 -0
- package/.versions/2.1.0/skills/planning-and-task-breakdown/SKILL.md +318 -0
- package/.versions/2.1.0/skills/planning-and-task-breakdown.zip +0 -0
- package/.versions/2.1.0/skills/repository-ai-setup/SKILL.md +135 -0
- package/.versions/2.1.0/skills/repository-ai-setup/references/agent-fleet-ai-state.template.json +4 -0
- package/.versions/2.1.0/skills/repository-ai-setup/references/apply-contract.md +74 -0
- package/.versions/2.1.0/skills/repository-ai-setup/references/provenance-template.md +16 -0
- package/.versions/2.1.0/skills/repository-ai-setup/references/setup-flow.md +108 -0
- package/.versions/2.1.0/skills/repository-ai-setup/references/verify-setup.md +20 -0
- package/.versions/2.1.0/skills/repository-ai-setup.zip +0 -0
- package/.versions/2.1.0/skills/security-and-hardening/SKILL.md +524 -0
- package/.versions/2.1.0/skills/spec-driven-development/SKILL.md +295 -0
- package/.versions/2.1.0/skills/spec-driven-development.zip +0 -0
- package/.versions/2.1.0/skills/using-agent-skills/SKILL.md +198 -0
- package/.versions/2.1.0/vendor/agent-skills-upstream/LICENSE +21 -0
- package/.versions/2.1.0/vendor/agent-skills-upstream/README.md +430 -0
- package/.versions/2.1.0/vendor/agent-skills-upstream/skills/api-and-interface-design/SKILL.md +367 -0
- package/.versions/2.1.0/vendor/agent-skills-upstream/skills/browser-testing-with-devtools/SKILL.md +317 -0
- package/.versions/2.1.0/vendor/agent-skills-upstream/skills/ci-cd-and-automation/SKILL.md +390 -0
- package/.versions/2.1.0/vendor/agent-skills-upstream/skills/code-review-and-quality/SKILL.md +396 -0
- package/.versions/2.1.0/vendor/agent-skills-upstream/skills/code-simplification/SKILL.md +331 -0
- package/.versions/2.1.0/vendor/agent-skills-upstream/skills/constraint-driven-development/SKILL.md +311 -0
- package/.versions/2.1.0/vendor/agent-skills-upstream/skills/constraint-driven-development/references/floor-guard.md +99 -0
- package/.versions/2.1.0/vendor/agent-skills-upstream/skills/context-engineering/SKILL.md +337 -0
- package/.versions/2.1.0/vendor/agent-skills-upstream/skills/debugging-and-error-recovery/SKILL.md +300 -0
- package/.versions/2.1.0/vendor/agent-skills-upstream/skills/deprecation-and-migration/SKILL.md +247 -0
- package/.versions/2.1.0/vendor/agent-skills-upstream/skills/documentation-and-adrs/SKILL.md +288 -0
- package/.versions/2.1.0/vendor/agent-skills-upstream/skills/doubt-driven-development/SKILL.md +243 -0
- package/.versions/2.1.0/vendor/agent-skills-upstream/skills/frontend-ui-engineering/SKILL.md +328 -0
- package/.versions/2.1.0/vendor/agent-skills-upstream/skills/git-workflow-and-versioning/SKILL.md +355 -0
- package/.versions/2.1.0/vendor/agent-skills-upstream/skills/idea-refine/SKILL.md +178 -0
- package/.versions/2.1.0/vendor/agent-skills-upstream/skills/idea-refine/examples.md +238 -0
- package/.versions/2.1.0/vendor/agent-skills-upstream/skills/idea-refine/frameworks.md +99 -0
- package/.versions/2.1.0/vendor/agent-skills-upstream/skills/idea-refine/refinement-criteria.md +113 -0
- package/.versions/2.1.0/vendor/agent-skills-upstream/skills/idea-refine/scripts/idea-refine.sh +15 -0
- package/.versions/2.1.0/vendor/agent-skills-upstream/skills/incremental-implementation/SKILL.md +249 -0
- package/.versions/2.1.0/vendor/agent-skills-upstream/skills/interview-me/SKILL.md +225 -0
- package/.versions/2.1.0/vendor/agent-skills-upstream/skills/observability-and-instrumentation/SKILL.md +238 -0
- package/.versions/2.1.0/vendor/agent-skills-upstream/skills/performance-optimization/SKILL.md +496 -0
- package/.versions/2.1.0/vendor/agent-skills-upstream/skills/planning-and-task-breakdown/SKILL.md +257 -0
- package/.versions/2.1.0/vendor/agent-skills-upstream/skills/security-and-hardening/SKILL.md +524 -0
- package/.versions/2.1.0/vendor/agent-skills-upstream/skills/shipping-and-launch/SKILL.md +330 -0
- package/.versions/2.1.0/vendor/agent-skills-upstream/skills/source-driven-development/SKILL.md +216 -0
- package/.versions/2.1.0/vendor/agent-skills-upstream/skills/spec-driven-development/SKILL.md +245 -0
- package/.versions/2.1.0/vendor/agent-skills-upstream/skills/test-driven-development/SKILL.md +398 -0
- package/.versions/2.1.0/vendor/agent-skills-upstream/skills/using-agent-skills/SKILL.md +192 -0
- package/CHANGELOG.md +21 -5
- package/README.md +12 -11
- package/agents/architect.md +1 -1
- package/agents/bowser.md +1 -1
- package/agents/builder.md +1 -1
- package/agents/code-reviewer.md +1 -1
- package/agents/plan-reviewer.md +1 -1
- package/agents/planner.md +1 -1
- package/agents/test-engineer.md +1 -1
- package/agents/web-debugger.md +1 -1
- package/agents/web-performance-auditor.md +1 -1
- package/bin/cli.js +115 -1
- package/bin/lib/apply.js +8 -1
- package/bin/lib/features.js +4 -1
- package/bin/lib/hermes-profile-artifact.js +21 -10
- package/bin/lib/inspect.js +103 -0
- package/bin/lib/mcp-probe.js +104 -0
- package/bin/lib/public-plan.js +2 -0
- package/bin/lib/repair-desired.js +1 -1
- package/bin/lib/set-codex-mcp.js +699 -0
- package/bin/lib/skill-zip.js +222 -0
- package/bin/snapshot-version.js +3 -1
- package/docs/ARCHITECTURE.md +147 -12
- package/docs/MIGRATION-agent-fleet.md +2 -2
- package/docs/agent-fleet-setup.md +39 -2
- package/docs/codex-local-mcp.md +434 -0
- package/docs/codex-session-bridge.md +28 -203
- package/docs/codex-setup.md +183 -0
- package/docs/fleet-native-voice.md +135 -0
- package/docs/npm-install.md +2 -2
- package/docs/session-worktree-targeting.md +79 -79
- package/docs/system1-agentic.md +1 -1
- package/docs/workflows.md +2 -2
- package/install-manifest.json +31 -66
- package/manifest-meta.json +47 -57
- package/package.json +12 -7
- package/skills/fleet-native-voice.zip +0 -0
- package/skills/incremental-implementation/SKILL.md +1 -1
- package/skills/incremental-implementation.zip +0 -0
- package/.pi/agent-fleet/scripts/fleet-codex-client.ts +0 -69
- package/.pi/agent-fleet/scripts/fleet-codex-read.py +0 -148
- package/.pi/agent-fleet/scripts/lib/fleet-codex-catalog.ts +0 -63
- package/.pi/agent-fleet/scripts/lib/fleet-codex-operations.ts +0 -190
- package/.pi/agent-fleet/scripts/lib/fleet-codex-session.ts +0 -166
- package/.pi/agent-fleet/scripts/lib/fleet-codex-transport.ts +0 -124
- package/codex/fleet-session-client/SKILL.md +0 -34
- package/codex/fleet-session-client.zip +0 -0
|
@@ -0,0 +1,699 @@
|
|
|
1
|
+
import { spawnSync } from "node:child_process";
|
|
2
|
+
import { createHash } from "node:crypto";
|
|
3
|
+
import { chmodSync, constants as fsConstants, copyFileSync, cpSync, existsSync, lstatSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, realpathSync, renameSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
4
|
+
import { homedir, tmpdir } from "node:os";
|
|
5
|
+
import { dirname, isAbsolute, join, relative, resolve } from "node:path";
|
|
6
|
+
|
|
7
|
+
import { SAFE_NAME_RE, atomicInstallArtifact, directoryFingerprint, writeReceipt } from "./hermes-profile-artifact.js";
|
|
8
|
+
import { extractSkillZip } from "./skill-zip.js";
|
|
9
|
+
import { probeMcpServer } from "./mcp-probe.js";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* `agent-fleet set-codex-mcp`: user-level registration of the native Codex MCP
|
|
13
|
+
* server (`af-local-read`) plus the `fleet-native-voice` skill. Codex owns its
|
|
14
|
+
* `config.toml`; this module only reads it through `codex mcp list --json` and
|
|
15
|
+
* (in later lifecycle actions) writes through `codex mcp add/remove`. Nothing
|
|
16
|
+
* here touches a workspace, `apply.js`, or the installer manifests.
|
|
17
|
+
*/
|
|
18
|
+
export const SERVER_NAME = "af-local-read";
|
|
19
|
+
export const SKILL_NAME = "fleet-native-voice";
|
|
20
|
+
export const MINIMUM_NODE = "22.18.0";
|
|
21
|
+
export const RUNTIME_RELATIVE = ".pi/agent-fleet/scripts/fleet-codex-local-mcp.mjs";
|
|
22
|
+
|
|
23
|
+
const ACTIONS = ["status", "install", "update", "uninstall"];
|
|
24
|
+
const DEFAULT_HOST_PROFILE = "desktop";
|
|
25
|
+
const DEFAULT_PRINCIPAL = "local-user";
|
|
26
|
+
/** Sibling namespaces the server derives from `--policy-root`; they must stay disjoint from every other root. */
|
|
27
|
+
const STATE_SUFFIXES = [".observations", ".instructions", ".reports", ".permissions"];
|
|
28
|
+
const PROBE_TIMEOUT_MS = 10000;
|
|
29
|
+
|
|
30
|
+
function usage() {
|
|
31
|
+
return new Error(
|
|
32
|
+
"Usage: agent-fleet set-codex-mcp <status|install|update|uninstall> [--node PATH] [--registry-root DIR] [--policy-root DIR] [--host-profile NAME] [--principal NAME] [--legacy-state-root DIR] [--force] [--dry-run]",
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function parseSetCodexMcpArgs(argv) {
|
|
37
|
+
if (argv.length !== 1 || !ACTIONS.includes(argv[0])) throw usage();
|
|
38
|
+
return { action: argv[0] };
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** Run the Codex CLI with an argv array (no shell). Returns stdout; non-zero exit throws. */
|
|
42
|
+
export function runCodexCommand(args, { cwd } = {}) {
|
|
43
|
+
const result = spawnSync("codex", args, { encoding: "utf8", cwd, timeout: 60000 });
|
|
44
|
+
if (result.error) throw new Error(`failed to run codex: ${result.error.message}`);
|
|
45
|
+
if (result.status !== 0) throw new Error((result.stderr || result.stdout).trim() || `codex ${args.join(" ")} failed`);
|
|
46
|
+
return result.stdout;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function isFile(path) {
|
|
50
|
+
try {
|
|
51
|
+
return statSync(path).isFile();
|
|
52
|
+
} catch {
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function isDirectory(path) {
|
|
58
|
+
try {
|
|
59
|
+
return statSync(path).isDirectory();
|
|
60
|
+
} catch {
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** Every path and label the launcher needs, from explicit options or documented defaults. */
|
|
66
|
+
export function resolveCodexMcpLayout({
|
|
67
|
+
packageRoot,
|
|
68
|
+
env = process.env,
|
|
69
|
+
home = homedir(),
|
|
70
|
+
cwd = process.cwd(),
|
|
71
|
+
node,
|
|
72
|
+
registryRoot,
|
|
73
|
+
policyRoot,
|
|
74
|
+
hostProfile,
|
|
75
|
+
principal,
|
|
76
|
+
legacyStateRoot,
|
|
77
|
+
}) {
|
|
78
|
+
const codexHome = env.CODEX_HOME || join(home, ".codex");
|
|
79
|
+
const stateDir = join(codexHome, "agent-fleet");
|
|
80
|
+
const resolvedRegistryRoot = registryRoot ?? env.PI_COMS_DIR ?? join(home, ".pi", "coms");
|
|
81
|
+
const resolvedPolicyRoot = policyRoot ?? join(stateDir, "state", "fleet-native");
|
|
82
|
+
const resolvedHostProfile = hostProfile ?? DEFAULT_HOST_PROFILE;
|
|
83
|
+
const resolvedPrincipal = principal ?? DEFAULT_PRINCIPAL;
|
|
84
|
+
const runtimePath = join(packageRoot, RUNTIME_RELATIVE);
|
|
85
|
+
const args = [
|
|
86
|
+
runtimePath,
|
|
87
|
+
"--registry-root", resolvedRegistryRoot,
|
|
88
|
+
"--policy-root", resolvedPolicyRoot,
|
|
89
|
+
"--host-profile", resolvedHostProfile,
|
|
90
|
+
"--principal", resolvedPrincipal,
|
|
91
|
+
];
|
|
92
|
+
if (legacyStateRoot) args.push("--legacy-state-root", legacyStateRoot);
|
|
93
|
+
return {
|
|
94
|
+
codexHome,
|
|
95
|
+
home,
|
|
96
|
+
stateDir,
|
|
97
|
+
backupsDir: join(stateDir, "backups"),
|
|
98
|
+
configPath: join(codexHome, "config.toml"),
|
|
99
|
+
receipts: {
|
|
100
|
+
mcp: join(stateDir, `${SERVER_NAME}.receipt.json`),
|
|
101
|
+
skill: join(stateDir, `${SKILL_NAME}.receipt.json`),
|
|
102
|
+
},
|
|
103
|
+
skillsDir: join(home, ".agents", "skills"),
|
|
104
|
+
skillDir: join(home, ".agents", "skills", SKILL_NAME),
|
|
105
|
+
skillZip: join(packageRoot, "skills", `${SKILL_NAME}.zip`),
|
|
106
|
+
runtimePath,
|
|
107
|
+
registryRoot: resolvedRegistryRoot,
|
|
108
|
+
policyRoot: resolvedPolicyRoot,
|
|
109
|
+
policyRootIsDefault: policyRoot === undefined,
|
|
110
|
+
hostProfile: resolvedHostProfile,
|
|
111
|
+
principal: resolvedPrincipal,
|
|
112
|
+
legacyStateRoot: legacyStateRoot ?? null,
|
|
113
|
+
launcher: { command: node ?? process.execPath, args },
|
|
114
|
+
operatorCwd: cwd,
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export function compareNodeVersion(version, minimum) {
|
|
119
|
+
const parse = value => {
|
|
120
|
+
const match = String(value).trim().match(/^v?(\d+)\.(\d+)\.(\d+)/);
|
|
121
|
+
if (!match) throw new Error(`unrecognized Node version: ${JSON.stringify(value)}`);
|
|
122
|
+
return match.slice(1, 4).map(Number);
|
|
123
|
+
};
|
|
124
|
+
const actual = parse(version);
|
|
125
|
+
const wanted = parse(minimum);
|
|
126
|
+
for (let index = 0; index < 3; index++) {
|
|
127
|
+
if (actual[index] !== wanted[index]) return actual[index] - wanted[index];
|
|
128
|
+
}
|
|
129
|
+
return 0;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
function detectNodeVersion(command) {
|
|
133
|
+
if (command === process.execPath) return process.version;
|
|
134
|
+
if (!isFile(command)) return null;
|
|
135
|
+
const result = spawnSync(command, ["--version"], { encoding: "utf8", timeout: 10000 });
|
|
136
|
+
if (result.error || result.status !== 0) return null;
|
|
137
|
+
return result.stdout.trim() || null;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/** The deepest existing ancestor of `path` when it is reached through a symlink, else null. */
|
|
141
|
+
function symlinkInPath(path) {
|
|
142
|
+
let current = path;
|
|
143
|
+
while (!existsSync(current)) {
|
|
144
|
+
const parent = dirname(current);
|
|
145
|
+
if (parent === current) return null;
|
|
146
|
+
current = parent;
|
|
147
|
+
}
|
|
148
|
+
try {
|
|
149
|
+
return realpathSync(current) === current ? null : current;
|
|
150
|
+
} catch {
|
|
151
|
+
return current;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/** Same containment rule as the server's own UNSAFE_PATH check. */
|
|
156
|
+
function overlaps(a, b) {
|
|
157
|
+
const rel = relative(a, b);
|
|
158
|
+
return rel === "" || (rel !== ".." && !rel.startsWith("../") && !isAbsolute(rel));
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Pure checks over a resolved layout: refusals go to `errors`, advisories to
|
|
163
|
+
* `warnings`. Nothing is read beyond `stat`/`realpath`, and nothing is written.
|
|
164
|
+
*/
|
|
165
|
+
export function validateLayout(layout, { platform = process.platform, nodeVersion } = {}) {
|
|
166
|
+
const errors = [];
|
|
167
|
+
const warnings = [];
|
|
168
|
+
if (platform === "win32") errors.push(`${SERVER_NAME} runs only on POSIX hosts; Windows is not supported`);
|
|
169
|
+
|
|
170
|
+
if (nodeVersion == null) {
|
|
171
|
+
errors.push(`could not determine the Node version of --node ${layout.launcher.command}`);
|
|
172
|
+
} else {
|
|
173
|
+
try {
|
|
174
|
+
if (compareNodeVersion(nodeVersion, MINIMUM_NODE) < 0) {
|
|
175
|
+
errors.push(`Node ${nodeVersion} is too old for the native server; it needs Node ${MINIMUM_NODE} or newer`);
|
|
176
|
+
}
|
|
177
|
+
} catch (error) {
|
|
178
|
+
errors.push(error.message);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
const { command } = layout.launcher;
|
|
183
|
+
if (!isAbsolute(command) || resolve(command) !== command) errors.push(`--node must be an absolute, normalized path: ${command}`);
|
|
184
|
+
else if (!isFile(command)) errors.push(`--node binary not found: ${command}`);
|
|
185
|
+
if (command.includes("/.nvm/versions/")) {
|
|
186
|
+
warnings.push(`Node at ${command} is managed by nvm; after switching Node versions run \`agent-fleet set-codex-mcp update\` so Codex keeps a working launcher`);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
if (layout.runtimePath.includes("/_npx/")) {
|
|
190
|
+
errors.push(`runtime ${layout.runtimePath} lives in the npx cache, which npm may evict at any time; install the package with \`npm install -g @chankov/agent-fleet\` or run from a checkout`);
|
|
191
|
+
} else if (!isAbsolute(layout.runtimePath) || resolve(layout.runtimePath) !== layout.runtimePath) {
|
|
192
|
+
errors.push(`runtime path must be absolute and normalized: ${layout.runtimePath}`);
|
|
193
|
+
} else if (!isFile(layout.runtimePath)) {
|
|
194
|
+
errors.push(`runtime not found: ${layout.runtimePath}`);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
if (!isAbsolute(layout.codexHome) || resolve(layout.codexHome) !== layout.codexHome) {
|
|
198
|
+
errors.push(`CODEX_HOME must be an absolute, normalized path: ${layout.codexHome}`);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
const roots = [
|
|
202
|
+
["--registry-root", layout.registryRoot],
|
|
203
|
+
["--policy-root", layout.policyRoot],
|
|
204
|
+
];
|
|
205
|
+
if (layout.legacyStateRoot) roots.push(["--legacy-state-root", layout.legacyStateRoot]);
|
|
206
|
+
for (const [flag, path] of roots) {
|
|
207
|
+
if (!isAbsolute(path)) errors.push(`${flag} must be an absolute path: ${path}`);
|
|
208
|
+
else if (resolve(path) !== path) errors.push(`${flag} must be a normalized path (no trailing slash, "." or ".."): ${path}`);
|
|
209
|
+
else {
|
|
210
|
+
const link = symlinkInPath(path);
|
|
211
|
+
if (link) errors.push(`${flag} resolves through a symlink at ${link}; use the real path: ${path}`);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
if (!layout.policyRootIsDefault && isAbsolute(layout.policyRoot)) {
|
|
215
|
+
const parent = dirname(layout.policyRoot);
|
|
216
|
+
if (!isDirectory(parent)) errors.push(`--policy-root parent directory must already exist and be yours: ${parent}`);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
const disjoint = [...roots, ...STATE_SUFFIXES.map(suffix => [`--policy-root${suffix}`, layout.policyRoot + suffix])];
|
|
220
|
+
for (let i = 0; i < disjoint.length; i++) {
|
|
221
|
+
for (let j = i + 1; j < disjoint.length; j++) {
|
|
222
|
+
const [labelA, a] = disjoint[i];
|
|
223
|
+
const [labelB, b] = disjoint[j];
|
|
224
|
+
if (!isAbsolute(a) || !isAbsolute(b)) continue;
|
|
225
|
+
if (overlaps(a, b) || overlaps(b, a)) errors.push(`${labelA} and ${labelB} overlap: ${a} vs ${b}; state roots must be disjoint`);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
for (const [flag, value] of [["--host-profile", layout.hostProfile], ["--principal", layout.principal]]) {
|
|
230
|
+
if (!SAFE_NAME_RE.test(value) || value.includes("..")) errors.push(`${flag} must match ${SAFE_NAME_RE}: ${JSON.stringify(value)}`);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
return { errors, warnings };
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
export function launcherFingerprint({ command, args }) {
|
|
237
|
+
return createHash("sha256").update(JSON.stringify([command, args])).digest("hex");
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* `managed` when a plain receipt names exactly `fingerprint`; `unmanaged` when
|
|
242
|
+
* there is no receipt; anything else (symlink, unreadable, stale) is `drifted`.
|
|
243
|
+
*/
|
|
244
|
+
function readReceiptState(path, fingerprint) {
|
|
245
|
+
if (!existsSync(path)) return "unmanaged";
|
|
246
|
+
const stat = lstatSync(path);
|
|
247
|
+
if (stat.isSymbolicLink() || !stat.isFile()) return "drifted";
|
|
248
|
+
try {
|
|
249
|
+
const parsed = JSON.parse(readFileSync(path, "utf8"));
|
|
250
|
+
return fingerprint !== null && parsed.fingerprint === fingerprint ? "managed" : "drifted";
|
|
251
|
+
} catch {
|
|
252
|
+
return "drifted";
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
function emptyEnv(value) {
|
|
257
|
+
return value == null || (typeof value === "object" && !Array.isArray(value) && Object.keys(value).length === 0);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
function emptyList(value) {
|
|
261
|
+
return value == null || (Array.isArray(value) && value.length === 0);
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
function stableJson(value) {
|
|
265
|
+
if (Array.isArray(value)) return `[${value.map(stableJson).join(",")}]`;
|
|
266
|
+
if (value && typeof value === "object") {
|
|
267
|
+
return `{${Object.keys(value).sort().map(key => `${JSON.stringify(key)}:${stableJson(value[key])}`).join(",")}}`;
|
|
268
|
+
}
|
|
269
|
+
return JSON.stringify(value);
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* Classify the user-level entry Codex reports for `af-local-read`:
|
|
274
|
+
* `missing`, `broken` (command or script no longer on disk), `current`
|
|
275
|
+
* (matches and has a receipt), `adoptable` (matches, no receipt), or `drifted`.
|
|
276
|
+
*/
|
|
277
|
+
export function evaluateMcpEntry(entry, desired, receiptState, fileExists = isFile) {
|
|
278
|
+
if (!entry) return { mcpState: "missing", transport: null, enabled: null };
|
|
279
|
+
const transport = entry.transport ?? null;
|
|
280
|
+
const enabled = entry.enabled !== false;
|
|
281
|
+
if (transport?.type === "stdio") {
|
|
282
|
+
const script = Array.isArray(transport.args) ? transport.args[0] : undefined;
|
|
283
|
+
const commandMissing = typeof transport.command === "string" && isAbsolute(transport.command) && !fileExists(transport.command);
|
|
284
|
+
const scriptMissing = typeof script === "string" && isAbsolute(script) && !fileExists(script);
|
|
285
|
+
if (commandMissing || scriptMissing) return { mcpState: "broken", transport, enabled };
|
|
286
|
+
}
|
|
287
|
+
const matches = transport?.type === "stdio"
|
|
288
|
+
&& transport.command === desired.command
|
|
289
|
+
&& Array.isArray(transport.args)
|
|
290
|
+
&& transport.args.length === desired.args.length
|
|
291
|
+
&& transport.args.every((value, index) => value === desired.args[index])
|
|
292
|
+
&& emptyEnv(transport.env)
|
|
293
|
+
&& emptyList(transport.env_vars)
|
|
294
|
+
&& transport.cwd == null
|
|
295
|
+
&& enabled;
|
|
296
|
+
if (!matches) return { mcpState: "drifted", transport, enabled };
|
|
297
|
+
if (receiptState === "managed") return { mcpState: "current", transport, enabled };
|
|
298
|
+
if (receiptState === "unmanaged") return { mcpState: "adoptable", transport, enabled };
|
|
299
|
+
return { mcpState: "drifted", transport, enabled };
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
async function listServers(codex, cwd) {
|
|
303
|
+
const output = await codex(["mcp", "list", "--json"], { cwd });
|
|
304
|
+
let parsed;
|
|
305
|
+
try {
|
|
306
|
+
parsed = JSON.parse(output);
|
|
307
|
+
} catch {
|
|
308
|
+
parsed = undefined;
|
|
309
|
+
}
|
|
310
|
+
if (!Array.isArray(parsed) || !parsed.every(entry => entry && typeof entry === "object" && typeof entry.name === "string")) {
|
|
311
|
+
let version = "unknown codex version";
|
|
312
|
+
try {
|
|
313
|
+
version = String(await codex(["--version"])).trim() || version;
|
|
314
|
+
} catch {
|
|
315
|
+
// The version is only context for the error below.
|
|
316
|
+
}
|
|
317
|
+
throw new Error(`unexpected output from \`codex mcp list --json\` (${version}); this command understands the JSON array printed by codex-cli 0.166.0`);
|
|
318
|
+
}
|
|
319
|
+
return parsed;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
/** A project `.codex/config.toml` entry visible from the operator cwd that differs from the user-level one. */
|
|
323
|
+
function shadowOf(globalEntry, cwdEntry) {
|
|
324
|
+
if (!cwdEntry) return { shadowed: false, transport: null };
|
|
325
|
+
if (globalEntry && stableJson(globalEntry.transport ?? null) === stableJson(cwdEntry.transport ?? null)) return { shadowed: false, transport: null };
|
|
326
|
+
return { shadowed: true, transport: cwdEntry.transport ?? null };
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
/** Fingerprint of the packaged skill, computed from the shipped zip so checkout and npm share one code path. */
|
|
330
|
+
function packagedSkillFingerprint(zipPath) {
|
|
331
|
+
const temp = mkdtempSync(join(tmpdir(), "agent-fleet-skill-"));
|
|
332
|
+
try {
|
|
333
|
+
const extracted = extractSkillZip(zipPath, join(temp, "zip"));
|
|
334
|
+
if (extracted.name !== SKILL_NAME) throw new Error(`packaged archive ${zipPath} contains ${JSON.stringify(extracted.name)}, expected ${SKILL_NAME}`);
|
|
335
|
+
return directoryFingerprint(extracted.root);
|
|
336
|
+
} finally {
|
|
337
|
+
rmSync(temp, { recursive: true, force: true });
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
function inspectSkill(layout) {
|
|
342
|
+
let state;
|
|
343
|
+
let installedFingerprint = null;
|
|
344
|
+
let stat = null;
|
|
345
|
+
try {
|
|
346
|
+
stat = lstatSync(layout.skillDir);
|
|
347
|
+
} catch {
|
|
348
|
+
stat = null;
|
|
349
|
+
}
|
|
350
|
+
if (!stat) state = "missing";
|
|
351
|
+
else if (stat.isSymbolicLink()) state = "symlink";
|
|
352
|
+
else if (!stat.isDirectory()) state = "drifted";
|
|
353
|
+
else {
|
|
354
|
+
try {
|
|
355
|
+
installedFingerprint = directoryFingerprint(layout.skillDir);
|
|
356
|
+
} catch {
|
|
357
|
+
state = "drifted";
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
const sourceFingerprint = packagedSkillFingerprint(layout.skillZip);
|
|
361
|
+
if (state === undefined) state = installedFingerprint === sourceFingerprint ? "current" : "drifted";
|
|
362
|
+
return {
|
|
363
|
+
state,
|
|
364
|
+
installedFingerprint,
|
|
365
|
+
sourceFingerprint,
|
|
366
|
+
receiptState: readReceiptState(layout.receipts.skill, installedFingerprint),
|
|
367
|
+
};
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
/**
|
|
371
|
+
* Read-only inspection: two `codex mcp list --json` reads (user-level view
|
|
372
|
+
* from CODEX_HOME, operator view from cwd for shadow detection), local stats,
|
|
373
|
+
* and a temporary unpack of the packaged skill for fingerprinting. Nothing
|
|
374
|
+
* under HOME or CODEX_HOME is created or modified.
|
|
375
|
+
*/
|
|
376
|
+
export async function inspectCodexMcp(options) {
|
|
377
|
+
const platform = options.platform ?? process.platform;
|
|
378
|
+
if (platform === "win32") throw new Error(`${SERVER_NAME} runs only on POSIX hosts; Windows is not supported`);
|
|
379
|
+
const layout = resolveCodexMcpLayout(options);
|
|
380
|
+
const nodeVersion = options.nodeVersion ?? detectNodeVersion(layout.launcher.command);
|
|
381
|
+
const { errors, warnings } = validateLayout(layout, { platform, nodeVersion });
|
|
382
|
+
const codex = options.codex ?? runCodexCommand;
|
|
383
|
+
const codexCwd = isDirectory(layout.codexHome) ? layout.codexHome : layout.home;
|
|
384
|
+
const globalEntries = await listServers(codex, codexCwd);
|
|
385
|
+
const cwdEntries = await listServers(codex, layout.operatorCwd);
|
|
386
|
+
const globalEntry = globalEntries.find(entry => entry.name === SERVER_NAME);
|
|
387
|
+
const cwdEntry = cwdEntries.find(entry => entry.name === SERVER_NAME);
|
|
388
|
+
const actualFingerprint = globalEntry?.transport?.type === "stdio"
|
|
389
|
+
? launcherFingerprint({ command: globalEntry.transport.command, args: Array.isArray(globalEntry.transport.args) ? globalEntry.transport.args : [] })
|
|
390
|
+
: null;
|
|
391
|
+
const mcpReceiptState = readReceiptState(layout.receipts.mcp, actualFingerprint);
|
|
392
|
+
const mcp = evaluateMcpEntry(globalEntry, layout.launcher, mcpReceiptState);
|
|
393
|
+
const skill = inspectSkill(layout);
|
|
394
|
+
return {
|
|
395
|
+
action: "status",
|
|
396
|
+
platform,
|
|
397
|
+
nodeVersion,
|
|
398
|
+
codexHome: layout.codexHome,
|
|
399
|
+
stateDir: layout.stateDir,
|
|
400
|
+
configPath: layout.configPath,
|
|
401
|
+
backupsDir: layout.backupsDir,
|
|
402
|
+
operatorCwd: layout.operatorCwd,
|
|
403
|
+
codexCwd,
|
|
404
|
+
launcher: layout.launcher,
|
|
405
|
+
runtimePath: layout.runtimePath,
|
|
406
|
+
registryRoot: layout.registryRoot,
|
|
407
|
+
policyRoot: layout.policyRoot,
|
|
408
|
+
hostProfile: layout.hostProfile,
|
|
409
|
+
principal: layout.principal,
|
|
410
|
+
legacyStateRoot: layout.legacyStateRoot,
|
|
411
|
+
mcpState: mcp.mcpState,
|
|
412
|
+
mcpEntry: mcp.transport,
|
|
413
|
+
mcpEnabled: mcp.enabled,
|
|
414
|
+
mcpReceipt: layout.receipts.mcp,
|
|
415
|
+
mcpReceiptState,
|
|
416
|
+
projectShadow: shadowOf(globalEntry, cwdEntry),
|
|
417
|
+
skillDir: layout.skillDir,
|
|
418
|
+
skillState: skill.state,
|
|
419
|
+
skillFingerprint: skill.installedFingerprint,
|
|
420
|
+
skillSourceFingerprint: skill.sourceFingerprint,
|
|
421
|
+
skillReceipt: layout.receipts.skill,
|
|
422
|
+
skillReceiptState: skill.receiptState,
|
|
423
|
+
warnings,
|
|
424
|
+
errors,
|
|
425
|
+
};
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
/** What an explicit install/update would do to the user-level entry, without touching anything. */
|
|
429
|
+
export function planMcpInstall(before, force) {
|
|
430
|
+
switch (before.mcpState) {
|
|
431
|
+
case "missing":
|
|
432
|
+
return { mode: "add", reason: "no user-level entry" };
|
|
433
|
+
case "adoptable":
|
|
434
|
+
return { mode: "adopt", reason: "the entry matches the launcher but has no receipt" };
|
|
435
|
+
case "current":
|
|
436
|
+
return { mode: "none", reason: "the entry and its receipt already match" };
|
|
437
|
+
default:
|
|
438
|
+
if (!force) throw new Error(`${SERVER_NAME} entry is ${before.mcpState}; re-run with --force to back up config.toml and replace it`);
|
|
439
|
+
return { mode: "add", reason: `${before.mcpState} entry replaced with --force` };
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
/** What an explicit install/update would do to the skill copy under ~/.agents/skills. */
|
|
444
|
+
export function planSkillInstall(before, force) {
|
|
445
|
+
switch (before.skillState) {
|
|
446
|
+
case "missing":
|
|
447
|
+
return { mode: "install", reason: "skill not installed" };
|
|
448
|
+
case "symlink":
|
|
449
|
+
throw new Error(`${before.skillDir} is a symlink; remove it yourself before installing the packaged skill copy`);
|
|
450
|
+
case "current":
|
|
451
|
+
if (before.skillReceiptState === "managed") return { mode: "none", reason: "the skill and its receipt already match" };
|
|
452
|
+
if (before.skillReceiptState === "unmanaged") return { mode: "adopt", reason: "the skill matches the package but has no receipt" };
|
|
453
|
+
if (!force) throw new Error(`${SKILL_NAME} has an unreadable or mismatched receipt; re-run with --force to back up the tree and reinstall it`);
|
|
454
|
+
return { mode: "install", reason: "mismatched receipt replaced with --force" };
|
|
455
|
+
default:
|
|
456
|
+
if (!force) throw new Error(`${SKILL_NAME} at ${before.skillDir} differs from the packaged skill; re-run with --force to back it up and replace it`);
|
|
457
|
+
return { mode: "install", reason: "drifted skill replaced with --force" };
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
export const BINDINGS_HINT = "persisted bindings in --policy-root stay until forget, revoke_send or revoke_approve in a Codex chat; the policy state, any legacy archive and project .codex/config.toml files are untouched";
|
|
462
|
+
|
|
463
|
+
/** What an explicit uninstall would remove: only pieces a receipt proves this command installed, unless forced. */
|
|
464
|
+
export function planUninstall(before, force) {
|
|
465
|
+
let mcp;
|
|
466
|
+
if (before.mcpState === "missing") {
|
|
467
|
+
mcp = before.mcpReceiptState === "unmanaged" ? { mode: "none", reason: "no user-level entry" } : { mode: "receipt", reason: "stale receipt without an entry" };
|
|
468
|
+
} else if (before.mcpReceiptState === "managed") {
|
|
469
|
+
mcp = { mode: "remove", reason: "managed entry" };
|
|
470
|
+
} else if (!force) {
|
|
471
|
+
throw new Error(`${SERVER_NAME} entry is ${before.mcpState} and not managed by a receipt; re-run with --force to back up config.toml and remove it anyway`);
|
|
472
|
+
} else {
|
|
473
|
+
mcp = { mode: "remove", reason: `${before.mcpState} entry removed with --force` };
|
|
474
|
+
}
|
|
475
|
+
let skill;
|
|
476
|
+
if (before.skillState === "missing") {
|
|
477
|
+
skill = before.skillReceiptState === "unmanaged" ? { mode: "none", reason: "skill not installed" } : { mode: "receipt", reason: "stale receipt without a skill tree" };
|
|
478
|
+
} else if (before.skillState === "symlink") {
|
|
479
|
+
throw new Error(`${before.skillDir} is a symlink that this command did not create; remove it yourself`);
|
|
480
|
+
} else if (before.skillState === "current" && before.skillReceiptState === "managed") {
|
|
481
|
+
skill = { mode: "remove", reason: "managed skill copy" };
|
|
482
|
+
} else if (!force) {
|
|
483
|
+
throw new Error(`${SKILL_NAME} at ${before.skillDir} is ${before.skillState}/${before.skillReceiptState}; re-run with --force to back it up and remove only this tree`);
|
|
484
|
+
} else {
|
|
485
|
+
skill = { mode: "remove", reason: `${before.skillState} skill removed with --force` };
|
|
486
|
+
}
|
|
487
|
+
return { mcp, skill };
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
function ensurePrivateDirectory(dir, parent) {
|
|
491
|
+
if (existsSync(dir)) {
|
|
492
|
+
const stat = lstatSync(dir);
|
|
493
|
+
if (stat.isSymbolicLink() || !stat.isDirectory()) throw new Error(`refusing to use ${dir}: not a plain directory`);
|
|
494
|
+
return;
|
|
495
|
+
}
|
|
496
|
+
if (parent) ensurePrivateDirectory(parent);
|
|
497
|
+
mkdirSync(dir, { mode: 0o700 });
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
function stampOf(date) {
|
|
501
|
+
return date.toISOString().replace(/[:.]/g, "-");
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
/** Copy config.toml aside (0600): `codex mcp add`/`remove` rewrite the file and drop inline comments. */
|
|
505
|
+
function backupConfig(configPath, backupsDir, stamp) {
|
|
506
|
+
if (!existsSync(configPath)) return null;
|
|
507
|
+
const stat = lstatSync(configPath);
|
|
508
|
+
if (stat.isSymbolicLink() || !stat.isFile()) throw new Error(`refusing to back up ${configPath}: not a plain file`);
|
|
509
|
+
const target = join(backupsDir, `config.toml-${stamp}`);
|
|
510
|
+
copyFileSync(configPath, target, fsConstants.COPYFILE_EXCL);
|
|
511
|
+
chmodSync(target, 0o600);
|
|
512
|
+
return target;
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
function writeMcpReceipt(path, launcher) {
|
|
516
|
+
const body = JSON.stringify({ schemaVersion: 1, name: SERVER_NAME, fingerprint: launcherFingerprint(launcher), launcher }, null, 2) + "\n";
|
|
517
|
+
rmSync(path, { force: true });
|
|
518
|
+
writeFileSync(path, body, { mode: 0o600 });
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
/** Move a directory into the backups root, copying when the two live on different filesystems. */
|
|
522
|
+
function moveToBackup(source, target) {
|
|
523
|
+
try {
|
|
524
|
+
renameSync(source, target);
|
|
525
|
+
} catch (error) {
|
|
526
|
+
if (error?.code !== "EXDEV") throw error;
|
|
527
|
+
cpSync(source, target, { recursive: true, errorOnExist: true, force: false });
|
|
528
|
+
rmSync(source, { recursive: true, force: true });
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
/** Unpack the packaged skill into a temporary directory; the caller removes it. */
|
|
533
|
+
function stageSkill(layout) {
|
|
534
|
+
const temp = mkdtempSync(join(tmpdir(), "agent-fleet-skill-"));
|
|
535
|
+
try {
|
|
536
|
+
const extracted = extractSkillZip(layout.skillZip, join(temp, "zip"));
|
|
537
|
+
if (extracted.name !== SKILL_NAME) throw new Error(`packaged archive ${layout.skillZip} contains ${JSON.stringify(extracted.name)}, expected ${SKILL_NAME}`);
|
|
538
|
+
return { temp, sourceDir: extracted.root };
|
|
539
|
+
} catch (error) {
|
|
540
|
+
rmSync(temp, { recursive: true, force: true });
|
|
541
|
+
throw error;
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
/** cpSync creates directories with the umask default; keep the private copy 0700/0600 like the rest of our state. */
|
|
546
|
+
function tightenTree(root) {
|
|
547
|
+
const stat = lstatSync(root);
|
|
548
|
+
if (stat.isSymbolicLink()) return;
|
|
549
|
+
if (stat.isDirectory()) {
|
|
550
|
+
chmodSync(root, 0o700);
|
|
551
|
+
for (const entry of readdirSync(root)) tightenTree(join(root, entry));
|
|
552
|
+
} else if (stat.isFile()) {
|
|
553
|
+
chmodSync(root, 0o600);
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
function installSkill(mode, before, layout, at) {
|
|
558
|
+
ensurePrivateDirectory(layout.stateDir, layout.codexHome);
|
|
559
|
+
if (mode === "adopt") {
|
|
560
|
+
const fresh = directoryFingerprint(layout.skillDir);
|
|
561
|
+
if (fresh !== before.skillSourceFingerprint) throw new Error(`${SKILL_NAME} changed while being adopted; re-run status and retry`);
|
|
562
|
+
writeReceipt(layout.receipts.skill, { name: SKILL_NAME, fingerprint: fresh });
|
|
563
|
+
return null;
|
|
564
|
+
}
|
|
565
|
+
const staged = stageSkill(layout);
|
|
566
|
+
try {
|
|
567
|
+
const backupDir = atomicInstallArtifact({
|
|
568
|
+
sourceDir: staged.sourceDir,
|
|
569
|
+
installedDir: layout.skillDir,
|
|
570
|
+
skillsDir: layout.skillsDir,
|
|
571
|
+
backupRoot: layout.backupsDir,
|
|
572
|
+
name: SKILL_NAME,
|
|
573
|
+
receipt: layout.receipts.skill,
|
|
574
|
+
now: () => at,
|
|
575
|
+
label: "Codex skills",
|
|
576
|
+
});
|
|
577
|
+
tightenTree(layout.skillDir);
|
|
578
|
+
return backupDir;
|
|
579
|
+
} finally {
|
|
580
|
+
rmSync(staged.temp, { recursive: true, force: true });
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
/**
|
|
585
|
+
* install/update: refuse on status errors, plan both pieces, prove the
|
|
586
|
+
* launcher starts, back up config.toml, register through `codex mcp add`,
|
|
587
|
+
* re-read, write the receipt, then install the skill copy. A dry run reports
|
|
588
|
+
* the modes, argv and planned backups and neither probes nor writes.
|
|
589
|
+
*/
|
|
590
|
+
async function installAll(action, before, options) {
|
|
591
|
+
if (before.errors.length) throw new Error(`refusing ${action}:\n- ${before.errors.join("\n- ")}`);
|
|
592
|
+
const mcpPlan = planMcpInstall(before, options.force);
|
|
593
|
+
const skillPlan = planSkillInstall(before, options.force);
|
|
594
|
+
const layout = resolveCodexMcpLayout(options);
|
|
595
|
+
const codexArgv = mcpPlan.mode === "add" ? ["mcp", "add", SERVER_NAME, "--", before.launcher.command, ...before.launcher.args] : null;
|
|
596
|
+
const changed = mcpPlan.mode !== "none" || skillPlan.mode !== "none";
|
|
597
|
+
const summary = { action, mode: mcpPlan.mode, reason: mcpPlan.reason, skillMode: skillPlan.mode, skillReason: skillPlan.reason, changed, codexArgv };
|
|
598
|
+
if (!changed) return { ...before, ...summary, probe: null, backupPath: null, skillBackupDir: null };
|
|
599
|
+
const at = (options.now ?? (() => new Date()))();
|
|
600
|
+
const stamp = stampOf(at);
|
|
601
|
+
if (options.dryRun) {
|
|
602
|
+
return {
|
|
603
|
+
...before,
|
|
604
|
+
...summary,
|
|
605
|
+
dryRun: true,
|
|
606
|
+
probe: null,
|
|
607
|
+
backupPath: mcpPlan.mode === "add" && existsSync(layout.configPath) ? join(layout.backupsDir, `config.toml-${stamp}`) : null,
|
|
608
|
+
skillBackupDir: skillPlan.mode === "install" && before.skillState !== "missing" ? join(layout.backupsDir, `${SKILL_NAME}-${stamp}`) : null,
|
|
609
|
+
};
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
let probed = null;
|
|
613
|
+
let backupPath = null;
|
|
614
|
+
if (mcpPlan.mode !== "none") {
|
|
615
|
+
const probe = options.probe ?? probeMcpServer;
|
|
616
|
+
probed = await probe({ command: before.launcher.command, args: before.launcher.args, expectedName: SERVER_NAME, timeoutMs: PROBE_TIMEOUT_MS });
|
|
617
|
+
const codex = options.codex ?? runCodexCommand;
|
|
618
|
+
ensurePrivateDirectory(layout.stateDir, layout.codexHome);
|
|
619
|
+
// The server creates --policy-root itself on first use but requires its parent to exist.
|
|
620
|
+
if (layout.policyRootIsDefault) ensurePrivateDirectory(dirname(layout.policyRoot), layout.stateDir);
|
|
621
|
+
if (mcpPlan.mode === "add") {
|
|
622
|
+
ensurePrivateDirectory(layout.backupsDir, layout.stateDir);
|
|
623
|
+
backupPath = backupConfig(layout.configPath, layout.backupsDir, stamp);
|
|
624
|
+
await codex(codexArgv, { cwd: before.codexCwd });
|
|
625
|
+
}
|
|
626
|
+
const entry = (await listServers(codex, before.codexCwd)).find(candidate => candidate.name === SERVER_NAME);
|
|
627
|
+
const check = evaluateMcpEntry(entry, before.launcher, "unmanaged");
|
|
628
|
+
if (check.mcpState !== "adoptable") {
|
|
629
|
+
const seen = check.mcpState === "missing" ? "no" : `a ${check.mcpState}`;
|
|
630
|
+
throw new Error(`codex reports ${seen} ${SERVER_NAME} entry after ${mcpPlan.mode}; receipt not written${backupPath ? `; config.toml backup: ${backupPath}` : ""}`);
|
|
631
|
+
}
|
|
632
|
+
writeMcpReceipt(layout.receipts.mcp, before.launcher);
|
|
633
|
+
}
|
|
634
|
+
let skillBackupDir = null;
|
|
635
|
+
if (skillPlan.mode !== "none") skillBackupDir = installSkill(skillPlan.mode, before, layout, at);
|
|
636
|
+
const after = await inspectCodexMcp(options);
|
|
637
|
+
return { ...after, ...summary, probe: probed, backupPath, skillBackupDir };
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
/**
|
|
641
|
+
* uninstall: remove only what a receipt proves this command installed (or
|
|
642
|
+
* anything, with --force, after backing it up). Policy state, legacy archives
|
|
643
|
+
* and project config files are never touched, and bindings are not revoked.
|
|
644
|
+
*/
|
|
645
|
+
async function uninstallAll(before, options) {
|
|
646
|
+
const planned = planUninstall(before, options.force);
|
|
647
|
+
const layout = resolveCodexMcpLayout(options);
|
|
648
|
+
const changed = planned.mcp.mode !== "none" || planned.skill.mode !== "none";
|
|
649
|
+
const summary = {
|
|
650
|
+
action: "uninstall",
|
|
651
|
+
mode: planned.mcp.mode,
|
|
652
|
+
reason: planned.mcp.reason,
|
|
653
|
+
skillMode: planned.skill.mode,
|
|
654
|
+
skillReason: planned.skill.reason,
|
|
655
|
+
changed,
|
|
656
|
+
bindingsRetained: true,
|
|
657
|
+
bindingsHint: BINDINGS_HINT,
|
|
658
|
+
};
|
|
659
|
+
if (!changed) return { ...before, ...summary, backupPath: null, skillBackupDir: null };
|
|
660
|
+
const stamp = stampOf((options.now ?? (() => new Date()))());
|
|
661
|
+
const skillBackupDir = planned.skill.mode === "remove" ? join(layout.backupsDir, `${SKILL_NAME}-uninstall-${stamp}`) : null;
|
|
662
|
+
if (options.dryRun) {
|
|
663
|
+
return {
|
|
664
|
+
...before,
|
|
665
|
+
...summary,
|
|
666
|
+
dryRun: true,
|
|
667
|
+
backupPath: planned.mcp.mode === "remove" && existsSync(layout.configPath) ? join(layout.backupsDir, `config.toml-${stamp}`) : null,
|
|
668
|
+
skillBackupDir,
|
|
669
|
+
};
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
const codex = options.codex ?? runCodexCommand;
|
|
673
|
+
let backupPath = null;
|
|
674
|
+
if (planned.mcp.mode === "remove") {
|
|
675
|
+
ensurePrivateDirectory(layout.stateDir, layout.codexHome);
|
|
676
|
+
ensurePrivateDirectory(layout.backupsDir, layout.stateDir);
|
|
677
|
+
backupPath = backupConfig(layout.configPath, layout.backupsDir, stamp);
|
|
678
|
+
await codex(["mcp", "remove", SERVER_NAME], { cwd: before.codexCwd });
|
|
679
|
+
const entry = (await listServers(codex, before.codexCwd)).find(candidate => candidate.name === SERVER_NAME);
|
|
680
|
+
if (entry) throw new Error(`codex still reports an ${SERVER_NAME} entry after remove; receipt kept${backupPath ? `; config.toml backup: ${backupPath}` : ""}`);
|
|
681
|
+
}
|
|
682
|
+
if (planned.mcp.mode !== "none") rmSync(layout.receipts.mcp, { force: true });
|
|
683
|
+
if (planned.skill.mode === "remove") {
|
|
684
|
+
ensurePrivateDirectory(layout.stateDir, layout.codexHome);
|
|
685
|
+
ensurePrivateDirectory(layout.backupsDir, layout.stateDir);
|
|
686
|
+
moveToBackup(layout.skillDir, skillBackupDir);
|
|
687
|
+
}
|
|
688
|
+
if (planned.skill.mode !== "none") rmSync(layout.receipts.skill, { force: true });
|
|
689
|
+
const after = await inspectCodexMcp(options);
|
|
690
|
+
return { ...after, ...summary, backupPath, skillBackupDir };
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
export async function setCodexMcp(options) {
|
|
694
|
+
const { action } = parseSetCodexMcpArgs(options.positionals);
|
|
695
|
+
const before = await inspectCodexMcp(options);
|
|
696
|
+
if (action === "status") return before;
|
|
697
|
+
if (action === "uninstall") return uninstallAll(before, options);
|
|
698
|
+
return installAll(action, before, options);
|
|
699
|
+
}
|