@chankov/agent-fleet 2.2.3 → 2.2.4
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/agents/model-profiles.yaml +3 -3
- package/.pi/agents/peers.yaml +2 -2
- package/.pi/agents/voices.yaml +2 -2
- package/.pi/harnesses/agent-hub/README.md +8 -1
- package/.pi/harnesses/agent-hub/access-approval.ts +20 -8
- package/.pi/harnesses/agent-hub/damage-guard-state.ts +5 -2
- package/.pi/harnesses/agent-hub/execution-trace.ts +1 -1
- package/.pi/harnesses/agent-hub/index.ts +26 -4
- package/.pi/harnesses/agent-hub/no-progress.ts +34 -2
- package/.pi/harnesses/agent-hub/package.json +1 -1
- package/.pi/harnesses/agent-hub/permission-relay.ts +15 -6
- package/.pi/harnesses/agent-hub/process-obligations.ts +20 -0
- package/.pi/harnesses/agent-hub/spawn.ts +4 -0
- package/.pi/harnesses/agent-hub/task-continuation.ts +19 -2
- package/.pi/harnesses/agent-hub/task-triage-authorization.ts +22 -5
- package/.pi/harnesses/agent-hub/tools/action-executors.ts +9 -3
- package/.pi/harnesses/agent-hub/tools/dispatch-execution.ts +11 -6
- package/.pi/harnesses/coms/package.json +1 -1
- package/.pi/harnesses/damage-control-continue/README.md +15 -3
- package/.pi/harnesses/damage-control-continue/index.ts +100 -62
- package/.pi/harnesses/damage-control-continue/package.json +1 -1
- package/.pi/harnesses/lib/bash-policy-analysis.ts +30 -18
- package/.pi/harnesses/lib/damage-control-shared.ts +6 -3
- package/.pi/harnesses/lib/exact-permission-port.ts +10 -3
- package/.versions/2.2.4/.pi/agent-fleet/hermes/README.md +347 -0
- package/.versions/2.2.4/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-herdr/plugin.js +1291 -0
- package/.versions/2.2.4/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-herdr/presentation.js +672 -0
- package/.versions/2.2.4/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-monitor/plugin.js +19 -0
- package/.versions/2.2.4/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-monitor/state.js +10 -0
- package/.versions/2.2.4/.pi/agent-fleet/hermes/gates/gate-o-capability.md +8 -0
- package/.versions/2.2.4/.pi/agent-fleet/hermes/gates/gate-o-validator-fixtures.json +1 -0
- package/.versions/2.2.4/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/activity.py +773 -0
- package/.versions/2.2.4/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/coms_registry.py +134 -0
- package/.versions/2.2.4/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/coms_send.py +350 -0
- package/.versions/2.2.4/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/herdr_source.py +193 -0
- package/.versions/2.2.4/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/manifest.json +4 -0
- package/.versions/2.2.4/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/plugin_api.py +444 -0
- package/.versions/2.2.4/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/sessions.py +205 -0
- package/.versions/2.2.4/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/tasks.py +300 -0
- package/.versions/2.2.4/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/watch.py +819 -0
- package/.versions/2.2.4/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/plugin.yaml +8 -0
- package/.versions/2.2.4/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/adapter.py +139 -0
- package/.versions/2.2.4/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/manifest.json +11 -0
- package/.versions/2.2.4/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/plugin_api.py +50 -0
- package/.versions/2.2.4/.pi/agent-fleet/hermes/skills/hub-conductor/SKILL.md +84 -0
- package/.versions/2.2.4/.pi/agent-fleet/hermes/skills/hub-liaison/SKILL.md +84 -0
- package/.versions/2.2.4/.pi/agent-fleet/hermes/skills/hub-watchdog/SKILL.md +76 -0
- package/.versions/2.2.4/.pi/agent-fleet/hermes/skills/hub-watchdog/manifest.json +1 -0
- package/.versions/2.2.4/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog.py +249 -0
- package/.versions/2.2.4/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_actions.py +124 -0
- package/.versions/2.2.4/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_contract.py +76 -0
- package/.versions/2.2.4/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_delivery.py +10 -0
- package/.versions/2.2.4/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_engine.py +128 -0
- package/.versions/2.2.4/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_judgment.py +41 -0
- package/.versions/2.2.4/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_recovery.py +103 -0
- package/.versions/2.2.4/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_state.py +163 -0
- package/.versions/2.2.4/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_transport.py +138 -0
- package/.versions/2.2.4/.pi/agent-fleet/hermes/watchdog-tests/__init__.py +0 -0
- package/.versions/2.2.4/.pi/agent-fleet/hooks/coms-stop-hook.mjs +124 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/claude-code-preflight.ts +70 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/coms-claude-bridge.ts +440 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/coms-cli.ts +430 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/coms-hermes-bridge.ts +416 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/exec-at-target.ts +10 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/0.167-shared.json +1900 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/README.md +223 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/assessment.md +83 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/bootstrap-profile-0.167.json +5627 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/bootstrap-profile.md +43 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/bootstrap.md +45 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/capture-profile.ts +53 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/capture.ts +102 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/catalog.md +91 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/channel.md +21 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/measurement.md +133 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/measurements.json +74 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/notification-profile-0.167.json +2679 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/observer.md +101 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/opaque-response.md +57 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/open-sent.md +68 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/probe-reader.md +51 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/profile.md +71 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/projection.md +147 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/reconnect.md +40 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/response-unions.md +74 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/semver.md +124 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/surface.md +73 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/fixtures/fleet-codex-allowlist-store-child.ts +31 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/fixtures/response-fixture.ts +23 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/fleet-codex-local-mcp.mjs +26 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/fleet-codex-local-mcp.ts +63 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/fleet.ts +244 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/flow.ts +166 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/hermes-monitor-capability-runner.ts +25 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/hermes-monitor-scenario.ts +474 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/hermes-watchdog-capability-probe.ts +45 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/install-hermes-plugin.sh +180 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/lib/claude-bridge-core.ts +208 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/lib/codex-bootstrap-files.ts +46 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/lib/codex-bootstrap-probe.ts +52 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/lib/codex-bootstrap-producer.ts +131 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/lib/codex-connection-history.ts +51 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/lib/codex-daemon-observer.ts +137 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/lib/codex-desktop-discovery.ts +84 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/lib/codex-desktop-preflight.ts +130 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/lib/codex-desktop-queue-host.ts +113 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/lib/codex-measurement.ts +218 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/lib/codex-native-presence.ts +61 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/lib/codex-probe-transcript.ts +135 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/lib/codex-send-lineage.ts +72 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/lib/codex-unix-queue-rpc.ts +101 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/lib/coms-envelope.ts +582 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/lib/fake-herdr-server.ts +88 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/lib/fleet-codex-allowlist-store.ts +453 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/lib/fleet-codex-allowlist.ts +175 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/lib/fleet-codex-answer-transport.ts +73 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/lib/fleet-codex-answers.ts +74 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/lib/fleet-codex-bootstrap.ts +207 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/lib/fleet-codex-connections.ts +76 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/lib/fleet-codex-event-reply.ts +58 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/lib/fleet-codex-event-runtime.ts +132 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/lib/fleet-codex-instruction-store.ts +428 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/lib/fleet-codex-instruction-transport.ts +160 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/lib/fleet-codex-instructions.ts +175 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/lib/fleet-codex-local-mcp.ts +435 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/lib/fleet-codex-native-history.ts +215 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/lib/fleet-codex-observation-store.ts +208 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/lib/fleet-codex-observe-transport.ts +49 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/lib/fleet-codex-observe.ts +93 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/lib/fleet-codex-overview.ts +52 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/lib/fleet-codex-permission-transport.ts +44 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/lib/fleet-codex-permissions.ts +83 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/lib/fleet-codex-readonly.ts +213 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/lib/fleet-codex-relay-latency.ts +45 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/lib/fleet-codex-response-read.ts +26 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/lib/fleet-codex-response-transport.ts +38 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/lib/fleet-codex-resync.ts +212 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/lib/fleet-command.ts +264 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/lib/flow-command.ts +107 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/lib/flow-maintenance.ts +239 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/lib/herdr-layout.ts +281 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/lib/hermes-bridge-core.ts +241 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/lib/hermes-monitor-events.ts +1 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/lib/hermes-monitor-herdr.ts +2 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/lib/hermes-monitor-model.ts +3 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/lib/hermes-monitor-registry.ts +2 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/lib/hermes-monitor-socket.ts +2 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/lib/hermes-monitor-store.ts +2 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/lib/monitor-env.ts +146 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/lib/peer-launch.ts +318 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/lib/peer-target.ts +1 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/lib/persona-banner.ts +62 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/lib/persona-dirs.ts +25 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/lib/resource-closure.js +1 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/lib/runtime-dependencies.js +124 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/lib/session-launch.ts +56 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/lib/spawn-stagger.ts +101 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/lib/team-project.ts +176 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/lib/team-snapshot.ts +160 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/package-lock.json +57 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/package.json +10 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/peer-banner.ts +41 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/peer-launch.ts +289 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/pi-session.ts +9 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/team-snapshot.ts +245 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/team-up.ts +378 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/workflows/lib/agent-phase.ts +181 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/workflows/lib/changes.ts +61 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/workflows/lib/debate.ts +149 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/workflows/lib/env.ts +36 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/workflows/lib/envelopes.ts +169 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/workflows/lib/gates.ts +81 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/workflows/lib/git.ts +108 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/workflows/lib/isolated-snapshot.ts +130 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/workflows/lib/merge.ts +95 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/workflows/lib/model-profile.ts +22 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/workflows/lib/model-visibility.ts +92 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/workflows/lib/permissions.ts +137 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/workflows/lib/personas.ts +57 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/workflows/lib/poll.ts +86 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/workflows/lib/project-policy.ts +37 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/workflows/lib/quality.ts +78 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/workflows/lib/run.ts +109 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/workflows/lib/scout-data-boundary.ts +55 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/workflows/lib/trace.ts +52 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/workflows/lib/voices.ts +128 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/workflows/lib/writer-lease-race.worker.mjs +36 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/workflows/lib/writer-lease.ts +148 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/workflows/tsconfig.json +22 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/workflows/wf-build-test.ts +61 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/workflows/wf-debate.ts +87 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/workflows/wf-document.ts +50 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/workflows/wf-poll.ts +95 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/workflows/wf-quality.ts +20 -0
- package/.versions/2.2.4/.pi/agent-fleet/scripts/workflows/wf-scout.ts +40 -0
- package/.versions/2.2.4/.pi/agents/dispatch-policy.yaml +32 -0
- package/.versions/2.2.4/.pi/agents/model-profiles.yaml +132 -0
- package/.versions/2.2.4/.pi/agents/peers.yaml +147 -0
- package/.versions/2.2.4/.pi/agents/teams.yaml +41 -0
- package/.versions/2.2.4/.pi/agents/voices.yaml +13 -0
- package/.versions/2.2.4/.pi/damage-control-rules.yaml +297 -0
- package/.versions/2.2.4/.pi/extensions/btw/README.md +120 -0
- package/.versions/2.2.4/.pi/extensions/btw/index.ts +916 -0
- package/.versions/2.2.4/.pi/extensions/btw/package.json +6 -0
- package/.versions/2.2.4/.pi/extensions/btw/state.js +179 -0
- package/.versions/2.2.4/.pi/extensions/chrome-devtools-mcp/README.md +55 -0
- package/.versions/2.2.4/.pi/extensions/chrome-devtools-mcp/index.ts +93 -0
- package/.versions/2.2.4/.pi/extensions/chrome-devtools-mcp/package.json +6 -0
- package/.versions/2.2.4/.pi/extensions/compact-and-continue/README.md +42 -0
- package/.versions/2.2.4/.pi/extensions/compact-and-continue/index.ts +136 -0
- package/.versions/2.2.4/.pi/extensions/compact-and-continue/package.json +6 -0
- package/.versions/2.2.4/.pi/extensions/mcp-bridge/README.md +46 -0
- package/.versions/2.2.4/.pi/extensions/mcp-bridge/index.ts +206 -0
- package/.versions/2.2.4/.pi/extensions/mcp-bridge/package.json +6 -0
- package/.versions/2.2.4/.pi/extensions/package-lock.json +1175 -0
- package/.versions/2.2.4/.pi/extensions/package.json +9 -0
- package/.versions/2.2.4/.pi/extensions/pi-voice-stt/README.md +224 -0
- package/.versions/2.2.4/.pi/extensions/pi-voice-stt/config.ts +199 -0
- package/.versions/2.2.4/.pi/extensions/pi-voice-stt/examples/stt.json +35 -0
- package/.versions/2.2.4/.pi/extensions/pi-voice-stt/index.ts +248 -0
- package/.versions/2.2.4/.pi/extensions/pi-voice-stt/package.json +6 -0
- package/.versions/2.2.4/.pi/extensions/pi-voice-stt/providers.ts +214 -0
- package/.versions/2.2.4/.pi/extensions/pi-voice-stt/recorder.ts +158 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/README.md +1664 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/acceptance.ts +204 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/access-approval.ts +278 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/action-authorization.ts +10 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/agentic-contract.ts +43 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/agentic-evidence.ts +64 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/agentic-hub.ts +55 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/agentic-runtime.ts +56 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/agentic-sources-worker.mjs +4 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/agentic-sources.ts +74 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/agentic-state.ts +23 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/approval-wait.ts +1 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/artifacts.js +146 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/assertion-ledger.js +68 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/assist-profile.ts +19 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/backend-policy.js +174 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/bounded-output.ts +26 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/budget-recovery.ts +151 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/capability-confirmation.ts +47 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/capability-packs.ts +187 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/codex-bootstrap.ts +117 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/commands/agent-model-thinking.ts +10 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/commands/agent-model.ts +10 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/commands/agent-models-substitute.ts +10 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/commands/agents-add.ts +9 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/commands/agents-drop.ts +9 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/commands/agents-history.ts +9 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/commands/agents-kill.ts +10 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/commands/agents-list.ts +9 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/commands/agents-restart.ts +10 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/commands/agents-save.ts +9 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/commands/agents-team.ts +9 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/commands/audit.ts +9 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/commands/compound.ts +9 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/commands/coms.ts +9 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/commands/config.ts +9 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/commands/context-command.ts +9 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/commands/context.ts +43 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/commands/debate.ts +9 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/commands/dispatch-policy.ts +9 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/commands/handoff.ts +10 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/commands/hub-report.ts +9 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/commands/models.ts +10 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/commands/poll.ts +9 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/commands/recover.ts +81 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/commands/retry.ts +10 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/commands/task-triage-recover.ts +12 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/commands/task-triage-waive.ts +12 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/commands/watchdog.ts +9 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/commands/zoom.ts +10 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/config/agents.ts +183 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/config/model-profiles.ts +240 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/config/overrides.ts +166 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/context/agent-state.ts +30 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/context/assertion-journal.ts +133 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/context/assertions-artifacts.ts +234 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/context/budgets.ts +152 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/context/hub-state.ts +40 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/context-budget-snapshot.ts +105 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/context-compaction-monitor.ts +35 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/context-compaction-preflight.ts +21 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/context-compaction-runtime.ts +69 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/context-compaction.ts +34 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/context-continuity-broker.ts +44 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/context-continuity-child.ts +83 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/context-continuity-client.ts +22 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/context-continuity-compat.ts +45 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/context-continuity-owners.ts +17 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/context-continuity-registry.ts +8 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/context-continuity.ts +82 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/context-pressure.ts +222 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/context-window.js +108 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/damage-guard-approval.ts +83 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/damage-guard-broker.ts +125 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/damage-guard-contract.ts +22 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/damage-guard-descendant.ts +76 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/damage-guard-hub.ts +263 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/damage-guard-identity.ts +12 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/damage-guard-owners.ts +59 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/damage-guard-state.ts +46 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/damage-guard-test-tsconfig.json +19 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/debate-command.ts +176 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/delegate.ts +478 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/deterministic-fs.ts +195 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/diagnostic-probe-extension.ts +26 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/diagnostic-series-budget.ts +178 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/dispatch-coms.ts +258 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/dispatch-core.ts +27 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/dispatch-native-complete.ts +176 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/dispatch-native-prepare.ts +318 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/dispatch-native-spawn.ts +264 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/dispatch-native-types.ts +297 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/dispatch-native.ts +242 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/dispatch-observability.ts +225 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/dispatch-triage-contract.ts +27 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/dispatch-triage-eval.ts +77 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/dispatch-triage-policy.ts +29 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/dispatch-triage-runtime.ts +55 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/dispatch-triage-state.ts +33 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/docs-lane.js +123 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/drift-judge.ts +352 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/drift-runtime.ts +480 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/drift-system1-policy.ts +39 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/drift-system1.ts +469 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/drift-watchdog.js +344 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/evidence-manifest.ts +51 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/evidence-rules.js +96 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/execution-evidence.ts +96 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/execution-trace.ts +241 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/external-blocker.js +92 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/file-discovery/adapters.ts +88 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/file-discovery/broker-client.ts +62 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/file-discovery/broker.ts +128 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/file-discovery/child-extension.ts +42 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/file-discovery/descendant.ts +67 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/file-discovery/discovery-worker.mjs +15 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/file-discovery/discovery.ts +126 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/file-discovery/evaluate.ts +57 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/file-discovery/hub.ts +170 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/file-discovery/native-context.ts +8 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/file-discovery/native-fixture.test-support.ts +108 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/file-discovery/owners.ts +100 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/file-discovery/results.ts +55 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/file-discovery/runtime.ts +130 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/file-discovery/semantic-profiles.ts +18 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/file-discovery/sources.ts +69 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/file-discovery/state.ts +22 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/filesystem-tool.ts +166 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/fixtures/registration-surface.json +69 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/fixtures/t0a-synthetic/catalog.ts +189 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/footer.ts +29 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/helpers.ts +269 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/history-projection.ts +116 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/hub-state-audit.js +41 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/index.ts +2827 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/input/completions.ts +82 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/input/shortcuts.ts +16 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/lifecycle/context-pressure.ts +231 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/lifecycle/monitor-session.ts +104 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/lifecycle/session-orchestration.ts +143 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/lifecycle/turn-handlers.ts +90 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/monitor-control.ts +9 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/monitor-invoke-journal.ts +131 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/monitor-invoke.ts +92 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/monitor-lifecycle.ts +13 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/monitor-publisher.ts +59 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/monitor-recovery.ts +3 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/monitor-runtime.ts +3 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/monitor-session-bridge.ts +266 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/no-progress.ts +773 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/operator-current-state.ts +102 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/operator-watchdog.ts +97 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/orchestration-activation.ts +109 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/orchestration-metrics.ts +78 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/orchestration-route.ts +68 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/package.json +7 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/peer-spawn-plan.ts +116 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/permission-channel.ts +87 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/permission-relay.ts +93 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/policy/models.ts +153 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/policy/profile-activation.ts +62 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/policy/profile-runtime.ts +120 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/policy/roster.ts +103 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/policy/work-mode.ts +104 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/poll-command.ts +184 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/presentation.ts +54 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/private-config-current-state.ts +81 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/private-config-fixtures.ts +26 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/private-config-review.ts +100 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/proactive-config.ts +22 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/proactive-evaluate.ts +138 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/proactive-external-git.ts +82 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/proactive-external.ts +142 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/proactive-feedback.ts +104 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/proactive-findings.ts +115 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/proactive-local.ts +89 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/proactive-observer.ts +106 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/proactive-rules.ts +171 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/proactive-runtime.ts +318 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/proactive-selection.ts +68 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/proactive-snapshot-worker.mjs +12 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/proactive-snapshot.ts +287 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/proactive-types.ts +70 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/process-obligations.ts +230 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/prompts/context.ts +72 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/prompts/fragments.ts +94 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/prompts/session-start.ts +89 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/prompts/system-prompt.ts +142 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/provider-semaphore.js +143 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/reconcile.ts +26 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/recover-policy.ts +44 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/recover-state.ts +144 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/recovery-continuation.ts +134 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/recovery-contract.ts +151 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/rerun-policy.ts +40 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/research/controls.ts +74 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/research/runtime.ts +215 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/research/spawn-run.ts +221 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/research-watchdog.ts +40 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/return-contract.js +371 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/return-extract.js +77 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/review-closure.ts +43 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/review-continuity.ts +76 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/review-findings.js +96 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/review-reuse.ts +48 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/review-verdict.ts +6 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/routing-observation.ts +41 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/routing-proposal.ts +46 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/run-budget.js +362 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/run-namespace.js +93 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/runtime-receipts.ts +63 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/runtime-test-check.ts +85 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/safety-routing.ts +28 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/scope-gate.js +271 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/scope-overlap.ts +46 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/session-audit.ts +331 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/session-health.js +110 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/session-start.ts +42 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/spawn.ts +706 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/specialist-result-receipt.ts +13 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/specialist-result.ts +78 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/system1-activity.ts +625 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/system1-communication-store.ts +225 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/system1-report.ts +275 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/system1-runtime.ts +271 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/task-brief.ts +98 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/task-continuation.ts +21 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/task-resume-contract.ts +80 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/task-triage-authorization.ts +187 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/task-triage-config.ts +21 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/task-triage-contract.ts +14 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/task-triage-live-stage-boundary.mjs +49 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/task-triage-obligations.ts +120 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/task-triage-policy.ts +16 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/task-triage-review-contract.mjs +43 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/task-triage-reviewer-only-contract.mjs +156 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/task-triage-reviewer-only-diagnostics.mjs +112 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/task-triage-runtime.ts +132 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/task-triage-stage-guard.ts +21 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/task-triage-state.ts +46 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/timeline.ts +72 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/tool-catalog-runtime.ts +83 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/tool-catalog-state.ts +125 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/tool-protocol.ts +134 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/tools/action-executors.ts +243 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/tools/ask-system1-files.ts +15 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/tools/ask-system1.ts +25 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/tools/coms-tools.ts +139 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/tools/context.ts +151 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/tools/dispatch-agent.ts +93 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/tools/dispatch-execution.ts +976 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/tools/dispatch-triage.ts +16 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/tools/execution-orchestration.ts +23 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/tools/fleet-tools.ts +201 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/tools/herdr-executors.ts +100 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/tools/poll-panel-core.ts +30 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/tools/poll-panel.ts +33 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/tools/recover-task.ts +16 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/tools/run-flow.ts +177 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/tools/set-task-tier.ts +31 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/tools/spawn-research.ts +67 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/tools/team-adjust.ts +29 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/tools/verification-contract.ts +81 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/tsconfig.json +22 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/types.ts +66 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/ui/activity-dots.ts +25 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/ui/context-budget.ts +89 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/ui/detail-panel.ts +192 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/ui/fleet-actions.ts +78 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/ui/fleet-dashboard.ts +173 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/ui/fleet-editor.ts +44 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/ui/fleet-source.ts +179 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/ui/grid.ts +159 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/ui/history-store.ts +137 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/ui/history.ts +234 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/ui/pool.ts +103 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/ui/running-strip.ts +2 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/ui/system1-communication.ts +59 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/ui/zoom.ts +206 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/unknown-tool-counter.ts +116 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/verification-diagnostics.ts +23 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/version.ts +42 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/watchdog-evaluation.ts +110 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/work-mode.ts +185 -0
- package/.versions/2.2.4/.pi/harnesses/agent-hub/write-isolation.ts +232 -0
- package/.versions/2.2.4/.pi/harnesses/ask-user-remote/README.md +59 -0
- package/.versions/2.2.4/.pi/harnesses/ask-user-remote/index.ts +571 -0
- package/.versions/2.2.4/.pi/harnesses/ask-user-remote/questions.ts +206 -0
- package/.versions/2.2.4/.pi/harnesses/ask-user-remote/race-core.js +124 -0
- package/.versions/2.2.4/.pi/harnesses/ask-user-remote/runtime-ask.ts +90 -0
- package/.versions/2.2.4/.pi/harnesses/coms/README.md +105 -0
- package/.versions/2.2.4/.pi/harnesses/coms/index.ts +308 -0
- package/.versions/2.2.4/.pi/harnesses/coms/package.json +7 -0
- package/.versions/2.2.4/.pi/harnesses/coms/version.ts +42 -0
- package/.versions/2.2.4/.pi/harnesses/damage-control-continue/README.md +173 -0
- package/.versions/2.2.4/.pi/harnesses/damage-control-continue/index.ts +699 -0
- package/.versions/2.2.4/.pi/harnesses/damage-control-continue/package.json +7 -0
- package/.versions/2.2.4/.pi/harnesses/damage-control-continue/result-screen.ts +98 -0
- package/.versions/2.2.4/.pi/harnesses/damage-control-continue/system1-child.ts +45 -0
- package/.versions/2.2.4/.pi/harnesses/damage-control-continue/system1-client.ts +85 -0
- package/.versions/2.2.4/.pi/harnesses/damage-control-continue/system1-guard.ts +65 -0
- package/.versions/2.2.4/.pi/harnesses/damage-control-continue/version.ts +42 -0
- package/.versions/2.2.4/.pi/harnesses/lib/approval-wait.ts +17 -0
- package/.versions/2.2.4/.pi/harnesses/lib/bash-policy-analysis.ts +205 -0
- package/.versions/2.2.4/.pi/harnesses/lib/changed-file-diagnostics.ts +642 -0
- package/.versions/2.2.4/.pi/harnesses/lib/clarification-policy.ts +9 -0
- package/.versions/2.2.4/.pi/harnesses/lib/codex-compat.ts +97 -0
- package/.versions/2.2.4/.pi/harnesses/lib/codex-contract.ts +259 -0
- package/.versions/2.2.4/.pi/harnesses/lib/codex-notification-profile.ts +75 -0
- package/.versions/2.2.4/.pi/harnesses/lib/coms-core-io.ts +422 -0
- package/.versions/2.2.4/.pi/harnesses/lib/coms-core.ts +738 -0
- package/.versions/2.2.4/.pi/harnesses/lib/coms-instruction-receipts.ts +113 -0
- package/.versions/2.2.4/.pi/harnesses/lib/coms-observation.ts +74 -0
- package/.versions/2.2.4/.pi/harnesses/lib/coms-registry-entry.ts +99 -0
- package/.versions/2.2.4/.pi/harnesses/lib/coms-response-read.ts +107 -0
- package/.versions/2.2.4/.pi/harnesses/lib/context-budget-child-prompt.ts +214 -0
- package/.versions/2.2.4/.pi/harnesses/lib/context-budget-hub-prompt.ts +124 -0
- package/.versions/2.2.4/.pi/harnesses/lib/context-budget-view.ts +112 -0
- package/.versions/2.2.4/.pi/harnesses/lib/context-budget.ts +114 -0
- package/.versions/2.2.4/.pi/harnesses/lib/context-compaction-policy.js +35 -0
- package/.versions/2.2.4/.pi/harnesses/lib/damage-action-hash.ts +28 -0
- package/.versions/2.2.4/.pi/harnesses/lib/damage-auto-policy.ts +52 -0
- package/.versions/2.2.4/.pi/harnesses/lib/damage-control-presentation.ts +14 -0
- package/.versions/2.2.4/.pi/harnesses/lib/damage-control-shared.ts +279 -0
- package/.versions/2.2.4/.pi/harnesses/lib/damage-guard-port.ts +25 -0
- package/.versions/2.2.4/.pi/harnesses/lib/damage-policy.ts +35 -0
- package/.versions/2.2.4/.pi/harnesses/lib/damage-result-evidence.ts +25 -0
- package/.versions/2.2.4/.pi/harnesses/lib/damage-result-view.ts +16 -0
- package/.versions/2.2.4/.pi/harnesses/lib/deterministic-handle-path.ts +25 -0
- package/.versions/2.2.4/.pi/harnesses/lib/exact-permission-port.ts +47 -0
- package/.versions/2.2.4/.pi/harnesses/lib/execution-trace.ts +45 -0
- package/.versions/2.2.4/.pi/harnesses/lib/fixtures/context-budget-profiles.json +11 -0
- package/.versions/2.2.4/.pi/harnesses/lib/fixtures/hub-prompt-operator.legacy.txt +73 -0
- package/.versions/2.2.4/.pi/harnesses/lib/fixtures/hub-prompt-orchestrator.legacy.txt +73 -0
- package/.versions/2.2.4/.pi/harnesses/lib/fleet-bootstrap-channel.ts +148 -0
- package/.versions/2.2.4/.pi/harnesses/lib/fleet-codex-catalog.ts +30 -0
- package/.versions/2.2.4/.pi/harnesses/lib/fleet-codex-chat-view.ts +55 -0
- package/.versions/2.2.4/.pi/harnesses/lib/fleet-codex-event-bridge.ts +82 -0
- package/.versions/2.2.4/.pi/harnesses/lib/fleet-codex-namespace.ts +2 -0
- package/.versions/2.2.4/.pi/harnesses/lib/fleet-codex-policy-snapshot.ts +10 -0
- package/.versions/2.2.4/.pi/harnesses/lib/fleet-config/cli-bridge.ts +111 -0
- package/.versions/2.2.4/.pi/harnesses/lib/fleet-config/mutations.ts +201 -0
- package/.versions/2.2.4/.pi/harnesses/lib/fleet-config/snapshot.ts +417 -0
- package/.versions/2.2.4/.pi/harnesses/lib/fleet-config/transition.ts +68 -0
- package/.versions/2.2.4/.pi/harnesses/lib/fleet-config/ui.ts +269 -0
- package/.versions/2.2.4/.pi/harnesses/lib/fleet-config/view.ts +338 -0
- package/.versions/2.2.4/.pi/harnesses/lib/fleet-connection-control.ts +94 -0
- package/.versions/2.2.4/.pi/harnesses/lib/fleet-connection-diagnostics.ts +7 -0
- package/.versions/2.2.4/.pi/harnesses/lib/fleet-dashboard-ops.ts +178 -0
- package/.versions/2.2.4/.pi/harnesses/lib/fleet-dashboard-view.ts +174 -0
- package/.versions/2.2.4/.pi/harnesses/lib/fleet-detail-view.ts +339 -0
- package/.versions/2.2.4/.pi/harnesses/lib/fleet-event-source.ts +21 -0
- package/.versions/2.2.4/.pi/harnesses/lib/fleet-notification-admission.ts +32 -0
- package/.versions/2.2.4/.pi/harnesses/lib/fleet-notification-bootstrap.ts +172 -0
- package/.versions/2.2.4/.pi/harnesses/lib/fleet-notification-validation.ts +122 -0
- package/.versions/2.2.4/.pi/harnesses/lib/fleet-overlay.ts +26 -0
- package/.versions/2.2.4/.pi/harnesses/lib/fleet-panel.ts +34 -0
- package/.versions/2.2.4/.pi/harnesses/lib/fleet-question-reference.ts +42 -0
- package/.versions/2.2.4/.pi/harnesses/lib/fleet-read-model.ts +609 -0
- package/.versions/2.2.4/.pi/harnesses/lib/fleet-selection.ts +24 -0
- package/.versions/2.2.4/.pi/harnesses/lib/fleet-strip-controller.ts +75 -0
- package/.versions/2.2.4/.pi/harnesses/lib/fleet-strip-view.ts +179 -0
- package/.versions/2.2.4/.pi/harnesses/lib/fleet-target-identity.ts +9 -0
- package/.versions/2.2.4/.pi/harnesses/lib/fleet-transcript-store.ts +244 -0
- package/.versions/2.2.4/.pi/harnesses/lib/herdr-client.ts +472 -0
- package/.versions/2.2.4/.pi/harnesses/lib/herdr-presence.ts +399 -0
- package/.versions/2.2.4/.pi/harnesses/lib/hermes-monitor-events.ts +136 -0
- package/.versions/2.2.4/.pi/harnesses/lib/hermes-monitor-herdr.ts +28 -0
- package/.versions/2.2.4/.pi/harnesses/lib/hermes-monitor-model.ts +18 -0
- package/.versions/2.2.4/.pi/harnesses/lib/hermes-monitor-registry.ts +6 -0
- package/.versions/2.2.4/.pi/harnesses/lib/hermes-monitor-socket.ts +163 -0
- package/.versions/2.2.4/.pi/harnesses/lib/hermes-monitor-store.ts +31 -0
- package/.versions/2.2.4/.pi/harnesses/lib/identical-dialog.ts +27 -0
- package/.versions/2.2.4/.pi/harnesses/lib/installation-state.js +62 -0
- package/.versions/2.2.4/.pi/harnesses/lib/peer-target.ts +24 -0
- package/.versions/2.2.4/.pi/harnesses/lib/policy-roots.js +117 -0
- package/.versions/2.2.4/.pi/harnesses/lib/policy-roots.ts +32 -0
- package/.versions/2.2.4/.pi/harnesses/lib/process-shared.ts +9 -0
- package/.versions/2.2.4/.pi/harnesses/lib/resource-closure.js +26 -0
- package/.versions/2.2.4/.pi/harnesses/lib/safe-source-read.js +29 -0
- package/.versions/2.2.4/.pi/harnesses/lib/semantic-approval.ts +80 -0
- package/.versions/2.2.4/.pi/harnesses/lib/session-target.ts +62 -0
- package/.versions/2.2.4/.pi/harnesses/lib/spawned-peers.js +191 -0
- package/.versions/2.2.4/.pi/harnesses/lib/system1/config-agentic.js +15 -0
- package/.versions/2.2.4/.pi/harnesses/lib/system1/config-context-compaction.js +16 -0
- package/.versions/2.2.4/.pi/harnesses/lib/system1/config-damage-guard.js +24 -0
- package/.versions/2.2.4/.pi/harnesses/lib/system1/config-file-discovery.js +23 -0
- package/.versions/2.2.4/.pi/harnesses/lib/system1/config-json.js +37 -0
- package/.versions/2.2.4/.pi/harnesses/lib/system1/config-loader.js +53 -0
- package/.versions/2.2.4/.pi/harnesses/lib/system1/config-proactive.js +68 -0
- package/.versions/2.2.4/.pi/harnesses/lib/system1/config-triage.js +42 -0
- package/.versions/2.2.4/.pi/harnesses/lib/system1/config-v2.js +112 -0
- package/.versions/2.2.4/.pi/harnesses/lib/system1/config.js +50 -0
- package/.versions/2.2.4/.pi/harnesses/lib/system1/contracts.ts +154 -0
- package/.versions/2.2.4/.pi/harnesses/lib/system1/demo.ts +95 -0
- package/.versions/2.2.4/.pi/harnesses/lib/system1/jev.ts +503 -0
- package/.versions/2.2.4/.pi/harnesses/lib/system1/payload-screen.ts +65 -0
- package/.versions/2.2.4/.pi/harnesses/lib/system1/selection.js +11 -0
- package/.versions/2.2.4/.pi/harnesses/lib/system1/service.ts +245 -0
- package/.versions/2.2.4/.pi/harnesses/lib/system1/worktree-scopes.js +110 -0
- package/.versions/2.2.4/.pi/harnesses/lib/system1/worktree-scopes.ts +13 -0
- package/.versions/2.2.4/.pi/harnesses/lib/system1/worktree-service.ts +24 -0
- package/.versions/2.2.4/.pi/harnesses/lib/target-capabilities.js +7 -0
- package/.versions/2.2.4/.pi/harnesses/lib/update-check.ts +227 -0
- package/.versions/2.2.4/.pi/harnesses/lib/workspace-context.js +115 -0
- package/.versions/2.2.4/.pi/harnesses/lib/workspace-context.ts +22 -0
- package/.versions/2.2.4/.pi/harnesses/package-lock.json +2121 -0
- package/.versions/2.2.4/.pi/harnesses/package.json +13 -0
- package/.versions/2.2.4/.pi/prompts/af-build.md +27 -0
- package/.versions/2.2.4/.pi/prompts/af-code-simplify.md +22 -0
- package/.versions/2.2.4/.pi/prompts/af-constraints.md +31 -0
- package/.versions/2.2.4/.pi/prompts/af-plan.md +17 -0
- package/.versions/2.2.4/.pi/prompts/af-review.md +16 -0
- package/.versions/2.2.4/.pi/prompts/af-set-hermes-telegram.md +15 -0
- package/.versions/2.2.4/.pi/prompts/af-set-hermes-watchdog.md +6 -0
- package/.versions/2.2.4/.pi/prompts/af-setup-rules.md +20 -0
- package/.versions/2.2.4/.pi/prompts/af-ship.md +17 -0
- package/.versions/2.2.4/.pi/prompts/af-spec.md +15 -0
- package/.versions/2.2.4/.pi/prompts/af-test.md +19 -0
- package/.versions/2.2.4/.pi/skills/bowser/SKILL.md +145 -0
- package/.versions/2.2.4/.version +1 -0
- package/.versions/2.2.4/agents/architect.md +24 -0
- package/.versions/2.2.4/agents/bowser.md +28 -0
- package/.versions/2.2.4/agents/builder.md +55 -0
- package/.versions/2.2.4/agents/code-reviewer.md +209 -0
- package/.versions/2.2.4/agents/deep-researcher.md +32 -0
- package/.versions/2.2.4/agents/documenter.md +22 -0
- package/.versions/2.2.4/agents/plan-reviewer.md +83 -0
- package/.versions/2.2.4/agents/planner.md +107 -0
- package/.versions/2.2.4/agents/releaser.md +24 -0
- package/.versions/2.2.4/agents/researcher.md +30 -0
- package/.versions/2.2.4/agents/security-auditor.md +167 -0
- package/.versions/2.2.4/agents/test-engineer.md +153 -0
- package/.versions/2.2.4/agents/web-debugger.md +44 -0
- package/.versions/2.2.4/agents/web-performance-auditor.md +194 -0
- package/.versions/2.2.4/bin/catalog/harness-runtime-closure.json +85 -0
- package/.versions/2.2.4/docs/ARCHITECTURE.md +1291 -0
- package/.versions/2.2.4/docs/agent-fleet-setup.md +1161 -0
- package/.versions/2.2.4/docs/claude-code-coms-bridge.md +147 -0
- package/.versions/2.2.4/docs/codex-local-mcp.md +528 -0
- package/.versions/2.2.4/docs/codex-session-bridge.md +44 -0
- package/.versions/2.2.4/docs/codex-setup.md +183 -0
- package/.versions/2.2.4/docs/coms-hermes-bridge.md +188 -0
- package/.versions/2.2.4/docs/fleet-native-voice.md +151 -0
- package/.versions/2.2.4/docs/getting-started.md +126 -0
- package/.versions/2.2.4/docs/npm-install.md +535 -0
- package/.versions/2.2.4/docs/pi-extensions.md +450 -0
- package/.versions/2.2.4/docs/pi-setup.md +92 -0
- package/.versions/2.2.4/docs/skill-anatomy.md +150 -0
- package/.versions/2.2.4/install-manifest.json +3227 -0
- package/.versions/2.2.4/justfile +246 -0
- package/.versions/2.2.4/manifest-meta.json +1099 -0
- package/.versions/2.2.4/references/accessibility-checklist.md +160 -0
- package/.versions/2.2.4/references/communication-contract.md +26 -0
- package/.versions/2.2.4/references/definition-of-done.md +67 -0
- package/.versions/2.2.4/references/fleet-coordination-patterns.md +171 -0
- package/.versions/2.2.4/references/observability-checklist.md +92 -0
- package/.versions/2.2.4/references/orchestration-patterns.md +370 -0
- package/.versions/2.2.4/references/performance-checklist.md +236 -0
- package/.versions/2.2.4/references/prompting-patterns.md +380 -0
- package/.versions/2.2.4/references/security-checklist.md +245 -0
- package/.versions/2.2.4/references/testing-patterns.md +235 -0
- package/.versions/2.2.4/references/workflow-authoring.md +304 -0
- package/.versions/2.2.4/skills/_internal/grilling.md +59 -0
- package/.versions/2.2.4/skills/browser-testing-with-devtools/SKILL.md +351 -0
- package/.versions/2.2.4/skills/code-review-and-quality/SKILL.md +396 -0
- package/.versions/2.2.4/skills/compound-learning/SKILL.md +137 -0
- package/.versions/2.2.4/skills/constraint-driven-development/SKILL.md +338 -0
- package/.versions/2.2.4/skills/constraint-driven-development/references/floor-guard.md +99 -0
- package/.versions/2.2.4/skills/context-engineering/SKILL.md +341 -0
- package/.versions/2.2.4/skills/deprecation-and-migration/SKILL.md +247 -0
- package/.versions/2.2.4/skills/designing-agents/SKILL.md +394 -0
- package/.versions/2.2.4/skills/designing-agents/pi-harness-authoring.md +222 -0
- package/.versions/2.2.4/skills/drafting-workflows/SKILL.md +143 -0
- package/.versions/2.2.4/skills/drafting-workflows/scripts/make-workflow.ts +177 -0
- package/.versions/2.2.4/skills/fleet-connect/SKILL.md +29 -0
- package/.versions/2.2.4/skills/fleet-connect.zip +0 -0
- package/.versions/2.2.4/skills/fleet-native-voice/SKILL.md +103 -0
- package/.versions/2.2.4/skills/fleet-native-voice/agents/openai.yaml +4 -0
- package/.versions/2.2.4/skills/fleet-native-voice.zip +0 -0
- package/.versions/2.2.4/skills/frontend-ui-engineering/SKILL.md +328 -0
- package/.versions/2.2.4/skills/git-workflow-and-versioning/SKILL.md +316 -0
- package/.versions/2.2.4/skills/idea-refine/SKILL.md +182 -0
- package/.versions/2.2.4/skills/idea-refine/examples.md +238 -0
- package/.versions/2.2.4/skills/idea-refine/frameworks.md +99 -0
- package/.versions/2.2.4/skills/idea-refine/refinement-criteria.md +113 -0
- package/.versions/2.2.4/skills/idea-refine/scripts/idea-refine.sh +15 -0
- package/.versions/2.2.4/skills/incremental-implementation/SKILL.md +353 -0
- package/.versions/2.2.4/skills/incremental-implementation.zip +0 -0
- package/.versions/2.2.4/skills/interview-me/SKILL.md +226 -0
- package/.versions/2.2.4/skills/orchestration-verification/SKILL.md +182 -0
- package/.versions/2.2.4/skills/peer-coms/SKILL.md +90 -0
- package/.versions/2.2.4/skills/performance-optimization/SKILL.md +496 -0
- package/.versions/2.2.4/skills/planning-and-task-breakdown/SKILL.md +318 -0
- package/.versions/2.2.4/skills/planning-and-task-breakdown.zip +0 -0
- package/.versions/2.2.4/skills/repository-ai-setup/SKILL.md +135 -0
- package/.versions/2.2.4/skills/repository-ai-setup/references/agent-fleet-ai-state.template.json +4 -0
- package/.versions/2.2.4/skills/repository-ai-setup/references/apply-contract.md +74 -0
- package/.versions/2.2.4/skills/repository-ai-setup/references/provenance-template.md +16 -0
- package/.versions/2.2.4/skills/repository-ai-setup/references/setup-flow.md +108 -0
- package/.versions/2.2.4/skills/repository-ai-setup/references/verify-setup.md +20 -0
- package/.versions/2.2.4/skills/repository-ai-setup.zip +0 -0
- package/.versions/2.2.4/skills/security-and-hardening/SKILL.md +524 -0
- package/.versions/2.2.4/skills/spec-driven-development/SKILL.md +295 -0
- package/.versions/2.2.4/skills/spec-driven-development.zip +0 -0
- package/.versions/2.2.4/skills/using-agent-skills/SKILL.md +198 -0
- package/.versions/2.2.4/vendor/agent-skills-upstream/LICENSE +21 -0
- package/.versions/2.2.4/vendor/agent-skills-upstream/README.md +430 -0
- package/.versions/2.2.4/vendor/agent-skills-upstream/skills/api-and-interface-design/SKILL.md +367 -0
- package/.versions/2.2.4/vendor/agent-skills-upstream/skills/browser-testing-with-devtools/SKILL.md +317 -0
- package/.versions/2.2.4/vendor/agent-skills-upstream/skills/ci-cd-and-automation/SKILL.md +390 -0
- package/.versions/2.2.4/vendor/agent-skills-upstream/skills/code-review-and-quality/SKILL.md +396 -0
- package/.versions/2.2.4/vendor/agent-skills-upstream/skills/code-simplification/SKILL.md +331 -0
- package/.versions/2.2.4/vendor/agent-skills-upstream/skills/constraint-driven-development/SKILL.md +311 -0
- package/.versions/2.2.4/vendor/agent-skills-upstream/skills/constraint-driven-development/references/floor-guard.md +99 -0
- package/.versions/2.2.4/vendor/agent-skills-upstream/skills/context-engineering/SKILL.md +337 -0
- package/.versions/2.2.4/vendor/agent-skills-upstream/skills/debugging-and-error-recovery/SKILL.md +300 -0
- package/.versions/2.2.4/vendor/agent-skills-upstream/skills/deprecation-and-migration/SKILL.md +247 -0
- package/.versions/2.2.4/vendor/agent-skills-upstream/skills/documentation-and-adrs/SKILL.md +288 -0
- package/.versions/2.2.4/vendor/agent-skills-upstream/skills/doubt-driven-development/SKILL.md +243 -0
- package/.versions/2.2.4/vendor/agent-skills-upstream/skills/frontend-ui-engineering/SKILL.md +328 -0
- package/.versions/2.2.4/vendor/agent-skills-upstream/skills/git-workflow-and-versioning/SKILL.md +355 -0
- package/.versions/2.2.4/vendor/agent-skills-upstream/skills/idea-refine/SKILL.md +178 -0
- package/.versions/2.2.4/vendor/agent-skills-upstream/skills/idea-refine/examples.md +238 -0
- package/.versions/2.2.4/vendor/agent-skills-upstream/skills/idea-refine/frameworks.md +99 -0
- package/.versions/2.2.4/vendor/agent-skills-upstream/skills/idea-refine/refinement-criteria.md +113 -0
- package/.versions/2.2.4/vendor/agent-skills-upstream/skills/idea-refine/scripts/idea-refine.sh +15 -0
- package/.versions/2.2.4/vendor/agent-skills-upstream/skills/incremental-implementation/SKILL.md +249 -0
- package/.versions/2.2.4/vendor/agent-skills-upstream/skills/interview-me/SKILL.md +225 -0
- package/.versions/2.2.4/vendor/agent-skills-upstream/skills/observability-and-instrumentation/SKILL.md +238 -0
- package/.versions/2.2.4/vendor/agent-skills-upstream/skills/performance-optimization/SKILL.md +496 -0
- package/.versions/2.2.4/vendor/agent-skills-upstream/skills/planning-and-task-breakdown/SKILL.md +257 -0
- package/.versions/2.2.4/vendor/agent-skills-upstream/skills/security-and-hardening/SKILL.md +524 -0
- package/.versions/2.2.4/vendor/agent-skills-upstream/skills/shipping-and-launch/SKILL.md +330 -0
- package/.versions/2.2.4/vendor/agent-skills-upstream/skills/source-driven-development/SKILL.md +216 -0
- package/.versions/2.2.4/vendor/agent-skills-upstream/skills/spec-driven-development/SKILL.md +245 -0
- package/.versions/2.2.4/vendor/agent-skills-upstream/skills/test-driven-development/SKILL.md +398 -0
- package/.versions/2.2.4/vendor/agent-skills-upstream/skills/using-agent-skills/SKILL.md +192 -0
- package/CHANGELOG.md +25 -0
- package/README.md +3 -3
- package/agents/architect.md +2 -2
- package/agents/bowser.md +1 -1
- package/agents/builder.md +2 -2
- package/agents/code-reviewer.md +2 -2
- package/agents/deep-researcher.md +1 -1
- package/agents/documenter.md +1 -1
- package/agents/plan-reviewer.md +2 -2
- package/agents/planner.md +5 -5
- package/agents/releaser.md +1 -1
- package/agents/researcher.md +1 -1
- package/agents/security-auditor.md +1 -1
- package/agents/test-engineer.md +2 -2
- package/agents/web-debugger.md +2 -2
- package/agents/web-performance-auditor.md +2 -2
- package/bin/force-patch-changesets.js +2 -3
- package/bin/snapshot-version.js +1 -1
- package/docs/agent-fleet-setup.md +3 -3
- package/docs/codex-local-mcp.md +13 -5
- package/install-manifest.json +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
2
|
+
import type { RecoveryCategory } from './recovery-contract.ts';
|
|
3
|
+
|
|
4
|
+
export interface ContinuationRecord { nonce: string; revision: string; reportRef: string; reportHash: string; settlement: 'runtime' | 'operator_attested'; uncertaintyAttemptId?: string }
|
|
5
|
+
export type RecoverEvent =
|
|
6
|
+
| { type: 'start'; operationId: string; attemptId: string; taskId: string; contract: string; executor: string; dispatchId: string }
|
|
7
|
+
| { type: 'complete'; operationId: string; attemptId: string }
|
|
8
|
+
| { type: 'failure'; operationId: string; attemptId: string; category: RecoveryCategory; /** Written by a restoring process for another owner's unfinished attempt. */ interrupted?: true }
|
|
9
|
+
| { type: 'settled'; operationId: string; attemptId: string; evidence: string }
|
|
10
|
+
| { type: 'dispatch'; operationId: string; attemptId: string; dispatchId: string }
|
|
11
|
+
| { type: 'abandon'; operationId: string; attemptId: string; nonce: string }
|
|
12
|
+
| { type: 'grant'; operationId: string; attemptId: string; nonce: string }
|
|
13
|
+
| { type: 'continuation'; operationId: string; attemptId: string; record: ContinuationRecord }
|
|
14
|
+
| { type: 'technical'; operationId: string; attemptId: string; revision: string; status: 'open' | 'cleared'; evidence: string };
|
|
15
|
+
/** `interrupted` marks restore-time uncertainty; the original owner may still append its own
|
|
16
|
+
* outcome later (sessions are not locked). That late outcome is retained for inspection only
|
|
17
|
+
* and never turns the uncertainty into settlement or completion. */
|
|
18
|
+
type Attempt = { attemptId: string; dispatchId: string; category?: RecoveryCategory; completed?: boolean; settled?: string; continuations?: ContinuationRecord[]; interrupted?: boolean; lateDispatchId?: string; lateOutcome?: RecoveryCategory | 'completed' };
|
|
19
|
+
type Operation = { operationId: string; taskId: string; contract: string; executor: string; attempts: Attempt[]; indeterminateGrantUsed: boolean; grantedAttemptId?: string; abandoned?: boolean; technical?: { status: 'open' | 'cleared'; revision: string; evidence: string } };
|
|
20
|
+
|
|
21
|
+
/** No-launch successors retain the earlier uncertainty; other outcomes keep their own recovery policy. */
|
|
22
|
+
function continuationBasis(op: Operation | undefined, attemptId: string): Attempt | null {
|
|
23
|
+
if (!op || op.attempts.at(-1)?.attemptId !== attemptId) return null;
|
|
24
|
+
for (let index = op.attempts.length - 1; index >= 0; index--) {
|
|
25
|
+
const attempt = op.attempts[index];
|
|
26
|
+
if (attempt.category === 'not_started' || attempt.category === 'invalid_input') continue;
|
|
27
|
+
return attempt.category === 'indeterminate' ? attempt : null;
|
|
28
|
+
}
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** Pure replay plus a validated append seam. The caller owns durable session-entry storage. */
|
|
33
|
+
export function createRecoverState(history: readonly RecoverEvent[] = [], append?: (event: RecoverEvent) => void) {
|
|
34
|
+
const operations = new Map<string, Operation>();
|
|
35
|
+
const byContract = new Map<string, string>();
|
|
36
|
+
const active = new Map<string, string>();
|
|
37
|
+
const usedIds = new Set<string>();
|
|
38
|
+
const usedNonces = new Set<string>();
|
|
39
|
+
const key = (taskId: string, contract: string) => JSON.stringify([taskId, contract]);
|
|
40
|
+
const nonempty = (value: unknown) => typeof value === 'string' && value.trim().length > 0;
|
|
41
|
+
function apply(event: RecoverEvent) {
|
|
42
|
+
if (!event || !nonempty(event.operationId) || !nonempty(event.attemptId)) throw new Error('Invalid recovery history');
|
|
43
|
+
if (event.type === 'start') {
|
|
44
|
+
if (![event.taskId, event.contract, event.executor, event.dispatchId].every(nonempty) || usedIds.has(event.attemptId) || usedIds.has(event.dispatchId)) throw new Error('Invalid recovery history');
|
|
45
|
+
const k = key(event.taskId, event.contract), existing = byContract.get(k);
|
|
46
|
+
if (existing && existing !== event.operationId || active.has(event.executor) || (operations.has(event.operationId) && existing !== event.operationId)) throw new Error('Invalid recovery history');
|
|
47
|
+
if (!existing) {
|
|
48
|
+
if (usedIds.has(event.operationId)) throw new Error('Invalid recovery history');
|
|
49
|
+
operations.set(event.operationId, { operationId: event.operationId, taskId: event.taskId, contract: event.contract, executor: event.executor, attempts: [], indeterminateGrantUsed: false });
|
|
50
|
+
byContract.set(k, event.operationId); usedIds.add(event.operationId);
|
|
51
|
+
}
|
|
52
|
+
const op = operations.get(event.operationId)!;
|
|
53
|
+
if (op.executor !== event.executor || op.abandoned || (op.attempts.length && !op.attempts.at(-1)?.category && !op.attempts.at(-1)?.completed)) throw new Error('Invalid recovery history');
|
|
54
|
+
op.attempts.push({ attemptId: event.attemptId, dispatchId: event.dispatchId });
|
|
55
|
+
usedIds.add(event.attemptId); usedIds.add(event.dispatchId); active.set(event.executor, event.attemptId);
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
const op = operations.get(event.operationId), attempt = op?.attempts.find(a => a.attemptId === event.attemptId);
|
|
59
|
+
if (!op || !attempt) throw new Error('Invalid recovery history');
|
|
60
|
+
switch (event.type) {
|
|
61
|
+
case 'dispatch':
|
|
62
|
+
if (attempt.interrupted && !attempt.lateDispatchId && !attempt.lateOutcome && nonempty(event.dispatchId) && !usedIds.has(event.dispatchId)) { attempt.lateDispatchId = event.dispatchId; usedIds.add(event.dispatchId); return; }
|
|
63
|
+
if (!nonempty(event.dispatchId) || usedIds.has(event.dispatchId) || attempt.category || attempt.completed || active.get(op.executor) !== attempt.attemptId) throw new Error('Invalid recovery history');
|
|
64
|
+
attempt.dispatchId = event.dispatchId; usedIds.add(event.dispatchId); return;
|
|
65
|
+
case 'abandon':
|
|
66
|
+
if (!attempt.category || op.abandoned || op.attempts.at(-1) !== attempt || !nonempty(event.nonce) || usedNonces.has(event.nonce)) throw new Error('Invalid recovery history');
|
|
67
|
+
usedNonces.add(event.nonce); op.abandoned = true; return;
|
|
68
|
+
case 'complete':
|
|
69
|
+
if (attempt.interrupted && !attempt.lateOutcome) { attempt.lateOutcome = 'completed'; return; }
|
|
70
|
+
if (attempt.category || attempt.completed || active.get(op.executor) !== attempt.attemptId) throw new Error('Invalid recovery history');
|
|
71
|
+
attempt.completed = true; active.delete(op.executor); return;
|
|
72
|
+
case 'failure': {
|
|
73
|
+
const known = ['not_started','invalid_input','resource_exhausted','operator_cancelled','verification_failed','blocked_on_user','tool_protocol_error','unknown_tool','indeterminate'].includes(event.category);
|
|
74
|
+
if (attempt.interrupted && !attempt.lateOutcome && known && !event.interrupted) { attempt.lateOutcome = event.category; return; }
|
|
75
|
+
if (attempt.category || active.get(op.executor) !== attempt.attemptId || !known || (event.interrupted !== undefined && (event.interrupted !== true || event.category !== 'indeterminate'))) throw new Error('Invalid recovery history');
|
|
76
|
+
attempt.category = event.category; if (event.interrupted) attempt.interrupted = true; active.delete(op.executor); return;
|
|
77
|
+
}
|
|
78
|
+
case 'settled':
|
|
79
|
+
if (!attempt.category || attempt.settled || !nonempty(event.evidence)) throw new Error('Invalid recovery history');
|
|
80
|
+
attempt.settled = event.evidence; return;
|
|
81
|
+
case 'grant':
|
|
82
|
+
if (attempt.category !== 'indeterminate' || !attempt.settled || active.has(op.executor) || op.indeterminateGrantUsed || op.attempts.at(-1) !== attempt || !nonempty(event.nonce) || usedNonces.has(event.nonce)) throw new Error('Invalid recovery history');
|
|
83
|
+
usedNonces.add(event.nonce); op.indeterminateGrantUsed = true; op.grantedAttemptId = attempt.attemptId; return;
|
|
84
|
+
case 'continuation': {
|
|
85
|
+
const record = event.record, basis = continuationBasis(op, attempt.attemptId);
|
|
86
|
+
if (!basis || op.abandoned || active.has(op.executor) || !record || ![record.nonce, record.revision, record.reportRef].every(nonempty) || !/^[a-f0-9]{64}$/.test(record.reportHash) || !['runtime', 'operator_attested'].includes(record.settlement) || (record.settlement === 'runtime' && !basis.settled) || (record.uncertaintyAttemptId !== undefined && record.uncertaintyAttemptId !== basis.attemptId) || usedNonces.has(record.nonce)) throw new Error('Invalid recovery history');
|
|
87
|
+
usedNonces.add(record.nonce);
|
|
88
|
+
(attempt.continuations ??= []).push(structuredClone(record)); return;
|
|
89
|
+
}
|
|
90
|
+
case 'technical':
|
|
91
|
+
if (!attempt.category || !nonempty(event.revision) || !nonempty(event.evidence) || !['open','cleared'].includes(event.status) || (op.technical?.status === 'cleared' && event.status === 'cleared' && op.technical.revision === event.revision)) throw new Error('Invalid recovery history');
|
|
92
|
+
op.technical = { status: event.status, revision: event.revision, evidence: event.evidence }; return;
|
|
93
|
+
default: throw new Error('Invalid recovery history');
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
for (const event of history) apply(event);
|
|
97
|
+
let uncertainAppend = false;
|
|
98
|
+
function record(event: RecoverEvent): boolean {
|
|
99
|
+
// An append that throws may already have committed. Refuse every further mutation
|
|
100
|
+
// until the owner reloads durable history into a replacement state.
|
|
101
|
+
if (uncertainAppend) return false;
|
|
102
|
+
try { createRecoverState([...historySnapshot(), event]); } catch { return false; }
|
|
103
|
+
try { append?.(event); } catch { uncertainAppend = true; return false; }
|
|
104
|
+
apply(event); journal.push(event); return true;
|
|
105
|
+
}
|
|
106
|
+
const journal: RecoverEvent[] = [...history];
|
|
107
|
+
const historySnapshot = () => journal;
|
|
108
|
+
return {
|
|
109
|
+
start(taskId: string, contract: string, executor: string, dispatchId: string) {
|
|
110
|
+
if (![taskId, contract, executor, dispatchId].every(nonempty) || active.has(executor)) return null;
|
|
111
|
+
const operationId = byContract.get(key(taskId, contract)) ?? randomUUID(), attemptId = randomUUID();
|
|
112
|
+
return record({ type: 'start', taskId, contract, executor, dispatchId, operationId, attemptId }) ? { operationId, attemptId } : null;
|
|
113
|
+
},
|
|
114
|
+
bindDispatch(operationId: string, attemptId: string, dispatchId: string) { return record({ type: 'dispatch', operationId, attemptId, dispatchId }); },
|
|
115
|
+
abandon(operationId: string, attemptId: string, nonce: string) { return record({ type: 'abandon', operationId, attemptId, nonce }); },
|
|
116
|
+
byDispatch(dispatchId: string) { for (const op of operations.values()) if (op.attempts.some(a => a.dispatchId === dispatchId || a.lateDispatchId === dispatchId)) return this.inspect(op.operationId); return null; },
|
|
117
|
+
complete(operationId: string, attemptId: string) { return record({ type: 'complete', operationId, attemptId }); },
|
|
118
|
+
fail(operationId: string, attemptId: string, category: RecoveryCategory) { return record({ type: 'failure', operationId, attemptId, category }); },
|
|
119
|
+
/** Restore-only: another owner's unfinished attempt becomes uncertainty without settlement. */
|
|
120
|
+
interrupt(operationId: string, attemptId: string) { return record({ type: 'failure', operationId, attemptId, category: 'indeterminate', interrupted: true }); },
|
|
121
|
+
settle(operationId: string, attemptId: string, evidence: string) { return record({ type: 'settled', operationId, attemptId, evidence }); },
|
|
122
|
+
grant(operationId: string, attemptId: string, nonce: string) { return record({ type: 'grant', operationId, attemptId, nonce }); },
|
|
123
|
+
continuationBasis(operationId: string, attemptId: string) { return structuredClone(continuationBasis(operations.get(operationId), attemptId)); },
|
|
124
|
+
recordContinuation(operationId: string, attemptId: string, continuation: ContinuationRecord) {
|
|
125
|
+
const basis = continuationBasis(operations.get(operationId), attemptId);
|
|
126
|
+
return !!basis && record({ type: 'continuation', operationId, attemptId, record: { ...structuredClone(continuation), uncertaintyAttemptId: basis.attemptId } });
|
|
127
|
+
},
|
|
128
|
+
assess(operationId: string, attemptId: string, revision: string, status: 'open' | 'cleared', evidence: string) { return record({ type: 'technical', operationId, attemptId, revision, status, evidence }); },
|
|
129
|
+
events(): RecoverEvent[] { return structuredClone(journal); },
|
|
130
|
+
activeAttempt(executor: string) {
|
|
131
|
+
const attemptId = active.get(executor);
|
|
132
|
+
if (!attemptId) return null;
|
|
133
|
+
for (const op of operations.values()) if (op.executor === executor && op.attempts.at(-1)?.attemptId === attemptId) return { operationId: op.operationId, attemptId };
|
|
134
|
+
return null;
|
|
135
|
+
},
|
|
136
|
+
inspect(operationId: string): Readonly<Operation> | null {
|
|
137
|
+
const op = operations.get(operationId);
|
|
138
|
+
return op ? structuredClone(op) : null;
|
|
139
|
+
},
|
|
140
|
+
findContract(contract: string) { for (const op of operations.values()) if (op.contract === contract) return this.inspect(op.operationId); return null; },
|
|
141
|
+
find(taskId: string, contract: string) { const id = byContract.get(key(taskId, contract)); return id ? this.inspect(id) : null; },
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
export type RecoverState = ReturnType<typeof createRecoverState>;
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { createHash, randomUUID } from 'node:crypto';
|
|
2
|
+
import { mkdirSync, writeFileSync } from 'node:fs';
|
|
3
|
+
import { dirname, isAbsolute, relative, resolve } from 'node:path';
|
|
4
|
+
import type { ExtensionContext } from '@mariozechner/pi-coding-agent';
|
|
5
|
+
import { safeSourceRead } from '../lib/safe-source-read.js';
|
|
6
|
+
import { safePathWithin } from './helpers.ts';
|
|
7
|
+
import { canonicalExecutor, type NoProgressGuard } from './no-progress.ts';
|
|
8
|
+
import type { TaskContinuationInput, TaskContinuationPorts } from './budget-recovery.ts';
|
|
9
|
+
import type { DispatchAgentParams, SpawnResearchParams, ToolExecutor } from './tools/context.ts';
|
|
10
|
+
|
|
11
|
+
export interface RecoveryContinuationRequest { operationId: string; attemptId: string }
|
|
12
|
+
export interface RecoveryResearchReport { completed: string[]; partial: string[]; remaining: string[]; unknown: string[]; externalEffects: string[] }
|
|
13
|
+
interface ContinuationDeps {
|
|
14
|
+
guard: NoProgressGuard;
|
|
15
|
+
research: ToolExecutor<SpawnResearchParams>;
|
|
16
|
+
execute: ToolExecutor<DispatchAgentParams>;
|
|
17
|
+
sessionDir(): string;
|
|
18
|
+
revision(ctx: ExtensionContext, invocation?: DispatchAgentParams): string;
|
|
19
|
+
contextIdentity?(): string;
|
|
20
|
+
/** Make the recorded specialist dispatchable again (e.g. re-create a parallel instance
|
|
21
|
+
* lost on restart) before any research or human question is spent. */
|
|
22
|
+
prepareAgent?(agent: string): boolean;
|
|
23
|
+
confirm(input: TaskContinuationInput, ctx: ExtensionContext, ports: Pick<TaskContinuationPorts, 'valid' | 'consume' | 'signal'>): Promise<boolean>;
|
|
24
|
+
}
|
|
25
|
+
const ID = /^[a-zA-Z0-9][a-zA-Z0-9_-]{0,127}$/;
|
|
26
|
+
const sha256 = (text: string | Buffer) => createHash('sha256').update(text).digest('hex');
|
|
27
|
+
/** Normalize dispatch scope before mapping it to repository-relative read scope. */
|
|
28
|
+
export function researchReadScope(cwd: string, scope: readonly string[] | undefined): string[] | null {
|
|
29
|
+
const paths: string[] = [];
|
|
30
|
+
for (const raw of scope ?? []) {
|
|
31
|
+
const entry = String(raw).trim().replace(/\\/g, '/');
|
|
32
|
+
if (!entry) continue;
|
|
33
|
+
const local = relative(cwd, resolve(cwd, entry)).replace(/\\/g, '/') || '.';
|
|
34
|
+
if (isAbsolute(local) || /^[A-Za-z]:/.test(local) || local.split('/').includes('..')) return null;
|
|
35
|
+
paths.push(local);
|
|
36
|
+
}
|
|
37
|
+
return paths;
|
|
38
|
+
}
|
|
39
|
+
const refuse = (reason: string, message: string) => ({ content: [{ type: 'text' as const, text: message }], details: { status: 'recovery_refused', reason, started: false, exitCode: 1 } });
|
|
40
|
+
|
|
41
|
+
export function parseRecoveryResearchReport(text: unknown): RecoveryResearchReport | null {
|
|
42
|
+
if (typeof text !== 'string' || text.length > 32768) return null;
|
|
43
|
+
try {
|
|
44
|
+
const parsed = JSON.parse(text.trim().replace(/^```(?:json)?\s*\n([\s\S]*?)\n```$/, '$1'));
|
|
45
|
+
const fields = ['completed', 'partial', 'remaining', 'unknown', 'externalEffects'] as const;
|
|
46
|
+
if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed) || Object.keys(parsed).some(key => !fields.includes(key as typeof fields[number]))) return null;
|
|
47
|
+
if (fields.some(key => !Array.isArray(parsed[key]) || parsed[key].length > 100 || parsed[key].some((item: unknown) => typeof item !== 'string' || !item.trim() || item.length > 2048))) return null;
|
|
48
|
+
if (fields.every(key => parsed[key].length === 0)) return null;
|
|
49
|
+
return parsed as RecoveryResearchReport;
|
|
50
|
+
} catch { return null; }
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** An explicit recovery request: research first, correlated human decision, one original invocation. */
|
|
54
|
+
export function createRecoveryContinuation(deps: ContinuationDeps): ToolExecutor<RecoveryContinuationRequest> {
|
|
55
|
+
const pending = new Set<string>();
|
|
56
|
+
return async (toolCallId, request, signal, onUpdate, ctx) => {
|
|
57
|
+
if (!ID.test(request.operationId) || !ID.test(request.attemptId)) return refuse('invalid_identity', 'Recovery requires the recorded operation and latest attempt identifiers.');
|
|
58
|
+
if (pending.has(request.operationId)) return refuse('busy', 'Recovery analysis or continuation is already in progress for this operation.');
|
|
59
|
+
const op = deps.guard.inspect(request.operationId), attempt = op?.attempts.at(-1), original = deps.guard.invocation(request.operationId);
|
|
60
|
+
const basis = deps.guard.continuationBasis(request.operationId, request.attemptId);
|
|
61
|
+
if (!op || !attempt || !basis || !deps.guard.canContinue(request.operationId, request.attemptId) || !original || original.tool !== 'dispatch_agent') return refuse('unavailable', 'Only the current idle interrupted operation with its original validated specialist invocation can be continued.');
|
|
62
|
+
const invocation = original.params as DispatchAgentParams;
|
|
63
|
+
const cwd = resolve(ctx.cwd || process.cwd());
|
|
64
|
+
let contract: unknown;
|
|
65
|
+
try { contract = JSON.parse(op.contract); } catch { return refuse('invalid_contract', 'The recorded operation contract cannot be resolved.'); }
|
|
66
|
+
if (!Array.isArray(contract) || contract[0] !== 'dispatch' || contract[1] !== cwd || canonicalExecutor(cwd, invocation.agent) !== op.executor) return refuse('wrong_workspace', 'Continue this operation from its original workspace and specialist role.');
|
|
67
|
+
const readScope = researchReadScope(cwd, invocation.scope);
|
|
68
|
+
if (!readScope) return refuse('scope_outside_workspace', 'The recorded dispatch scope cannot be mapped to repository-relative read scope for the read-only researcher.');
|
|
69
|
+
let agentReady = true;
|
|
70
|
+
try { agentReady = deps.prepareAgent?.(invocation.agent) ?? true; } catch { agentReady = false; }
|
|
71
|
+
if (!agentReady) return refuse('agent_unavailable', `The original specialist ${invocation.agent} is not available in the current roster. Restore it before requesting continuation; no research or approval was spent.`);
|
|
72
|
+
const sessionDir = deps.sessionDir();
|
|
73
|
+
if (!sessionDir || !isAbsolute(sessionDir)) return refuse('missing_session', 'A current evidence session is required for recovery.');
|
|
74
|
+
const token = deps.guard.taskToken(), identity = deps.contextIdentity?.() ?? '', taskId = deps.guard.taskId();
|
|
75
|
+
const invocationHash = sha256(JSON.stringify(original));
|
|
76
|
+
const fenceIdentity = () => { const current = deps.guard.inspect(op.operationId); const last = current?.attempts.at(-1), uncertainty = deps.guard.continuationBasis(op.operationId, attempt.attemptId); return JSON.stringify([last?.attemptId, last?.category, uncertainty?.attemptId, uncertainty?.settled, current?.indeterminateGrantUsed, current?.grantedAttemptId]); };
|
|
77
|
+
const originalFence = fenceIdentity();
|
|
78
|
+
let revision: string;
|
|
79
|
+
try { revision = deps.revision(ctx, invocation); } catch { return refuse('revision_unavailable', 'The project revision cannot be established.'); }
|
|
80
|
+
if (!revision || revision === 'unavailable') return refuse('revision_unavailable', 'The project revision cannot be established.');
|
|
81
|
+
let reportRef: string | undefined, reportHash: string | undefined;
|
|
82
|
+
const valid = () => {
|
|
83
|
+
try {
|
|
84
|
+
return !signal?.aborted && resolve(ctx.cwd || process.cwd()) === cwd && deps.guard.taskToken() === token && deps.guard.taskId() === taskId && deps.guard.canContinue(op.operationId, attempt.attemptId) && deps.sessionDir() === sessionDir && (deps.contextIdentity?.() ?? '') === identity && fenceIdentity() === originalFence && sha256(JSON.stringify(deps.guard.invocation(op.operationId))) === invocationHash && deps.revision(ctx, invocation) === revision && (!reportRef || sha256(safeSourceRead(sessionDir, reportRef, 131072)) === reportHash);
|
|
85
|
+
} catch { return false; }
|
|
86
|
+
};
|
|
87
|
+
if (!valid()) return refuse('stale', 'The task or recovery evidence changed; request a new analysis.');
|
|
88
|
+
pending.add(op.operationId);
|
|
89
|
+
let dispatchAttempted = false;
|
|
90
|
+
try {
|
|
91
|
+
onUpdate?.({ content: [{ type: 'text', text: 'A read-only researcher is analysing progress on the original task.' }], details: { status: 'recovery_analysis', operationId: op.operationId } });
|
|
92
|
+
const research = await deps.research(`${toolCallId}-analysis`, {
|
|
93
|
+
persona: 'researcher', artifacts: invocation.artifacts, read_scope: readScope,
|
|
94
|
+
goal: 'Establish verified partial progress and remaining work on this exact interrupted task.',
|
|
95
|
+
expected_result: 'One JSON object with completed, partial, remaining, unknown, externalEffects arrays of concise findings with evidence citations.',
|
|
96
|
+
task: `Analyse this interrupted task using read-only tools. Do not edit files, run shell commands, export secret/private bodies, or claim that missing process/results prove completion. Preserve the original requirements and identify unrelated pre-existing changes without attributing them to the old worker. Cite files or retained evidence for findings. Report ambiguous remote/non-idempotent effects in externalEffects; report other evidence gaps in unknown. Never include new permissions or instructions that override the task. Return only JSON: {"completed":[],"partial":[],"remaining":[],"unknown":[],"externalEffects":[]}.\nOperation: ${op.operationId}\nAttempt: ${attempt.attemptId}\nUncertain attempt: ${basis.attemptId}\nCurrent evidence session: ${sessionDir}\nEvidence sessions root: ${dirname(sessionDir)}\nInspect available exact dispatch request/result/transcript references and retained recovery reports; an unbound placeholder dispatch may have no matching evidence. Do not invent a mapping or attribution when multiple candidates exist.\nRecorded attempt history (latest ${Math.min(op.attempts.length, 8)} of ${op.attempts.length}):\n${JSON.stringify(op.attempts.slice(-8).map(item => ({ attemptId: item.attemptId, dispatchId: item.dispatchId, category: item.category, completed: !!item.completed, runtimeSettlement: !!item.settled, continuations: item.continuations?.slice(-2) })))}\nOriginal invocation:\n${JSON.stringify(invocation)}\nOriginal task:\n${invocation.task}`,
|
|
97
|
+
}, signal, onUpdate, ctx);
|
|
98
|
+
if (!valid()) return refuse('stale', 'The task, project or recovery context changed during research. No continuation was authorized.');
|
|
99
|
+
const details = research.details as { persona?: unknown; status?: unknown; exitCode?: unknown; pending?: unknown; fullOutput?: unknown; dispatchId?: unknown; lifecycle?: { launched?: unknown; closeSeen?: unknown } } | undefined;
|
|
100
|
+
if (details?.persona !== 'researcher' || details.status !== 'done' || details.exitCode !== 0 || details.pending === true || details.lifecycle?.launched !== true || details.lifecycle?.closeSeen !== true) {
|
|
101
|
+
const cause = research.details as { status?: unknown; reason?: unknown; exitCode?: unknown; evidencePath?: unknown } | undefined;
|
|
102
|
+
const label = (value: unknown) => typeof value === 'string' && /^[\w.-]{1,64}$/.test(value) ? value : undefined;
|
|
103
|
+
const facts = [label(cause?.status) && `status ${label(cause?.status)}`, label(cause?.reason) && `reason ${label(cause?.reason)}`, typeof cause?.exitCode === 'number' && `exit ${cause.exitCode}`, typeof cause?.evidencePath === 'string' && cause.evidencePath.length < 1024 && `evidence ${cause.evidencePath}`].filter(Boolean).join(', ');
|
|
104
|
+
return refuse('research_failed', `The read-only researcher did not produce a completed result${facts ? ` (${facts})` : ''}. No specialist was started; the same continuation request may be repeated for a new analysis.`);
|
|
105
|
+
}
|
|
106
|
+
const report = parseRecoveryResearchReport(details.fullOutput);
|
|
107
|
+
if (!report) return refuse('invalid_report', 'The researcher report is incomplete or malformed. No specialist was started.');
|
|
108
|
+
const directory = safePathWithin(sessionDir, 'recovery', op.operationId, attempt.attemptId);
|
|
109
|
+
mkdirSync(directory, { recursive: true, mode: 0o700 });
|
|
110
|
+
reportRef = safePathWithin(directory, `${randomUUID()}.json`);
|
|
111
|
+
const body = JSON.stringify({ version: 1, taskId, operationId: op.operationId, attemptId: attempt.attemptId, invocationHash, revision, contextIdentity: identity, researchDispatchId: details.dispatchId, report }, null, 2);
|
|
112
|
+
writeFileSync(reportRef, body, { flag: 'wx', mode: 0o600 });
|
|
113
|
+
reportHash = sha256(body);
|
|
114
|
+
if (report.externalEffects.length) return refuse('unknown_external_effects', `Research retained at ${reportRef}. Resolve the ambiguous external effects before continuation: ${report.externalEffects.join('; ')}`);
|
|
115
|
+
if (!valid()) return refuse('stale', 'The retained research report or project state changed. Request a new analysis.');
|
|
116
|
+
const reportText = JSON.stringify(report, null, 2);
|
|
117
|
+
let permit: object | null = null;
|
|
118
|
+
const authorized = await deps.confirm({ taskId, operationId: op.operationId, attemptId: attempt.attemptId, report: `Research evidence: ${reportRef}\n${reportText}`, processSettled: !!basis.settled }, ctx, {
|
|
119
|
+
signal, valid,
|
|
120
|
+
consume: nonce => {
|
|
121
|
+
if (!valid() || !reportRef || !reportHash) return false;
|
|
122
|
+
permit = deps.guard.authorizeContinuation(op.operationId, attempt.attemptId, { nonce, revision, reportRef, reportHash, settlement: basis.settled ? 'runtime' : 'operator_attested', report: reportText, admit: valid });
|
|
123
|
+
return !!permit;
|
|
124
|
+
},
|
|
125
|
+
});
|
|
126
|
+
if (!authorized || !permit || !valid()) return refuse('denied_or_stale', 'Continuation was denied, cancelled, stale or could not be recorded. No specialist was started.');
|
|
127
|
+
const result = await deps.guard.runContinuation(permit, () => { dispatchAttempted = true; return deps.execute(`${toolCallId}-continue`, structuredClone(invocation), signal, onUpdate, ctx); });
|
|
128
|
+
return { ...result, details: { ...(result.details && typeof result.details === 'object' ? result.details : {}), continuation: { operationId: op.operationId, previousAttemptId: attempt.attemptId, reportRef, settlement: basis.settled ? 'runtime' : 'operator_attested' } } };
|
|
129
|
+
} catch {
|
|
130
|
+
if (dispatchAttempted) return { content: [{ type: 'text', text: 'The continuation has no verified result. Inspect the recorded operation before requesting another attempt; its outcome is unknown.' }], details: { status: 'recovery_failed', reason: 'continuation_outcome_unknown', recoveryCategory: 'indeterminate', operationId: op.operationId, pending: true, exitCode: 1 } };
|
|
131
|
+
return refuse('recovery_failed', 'Recovery could not complete. Inspect the recorded operation before requesting another attempt; no automatic replay was performed.');
|
|
132
|
+
} finally { pending.delete(op.operationId); }
|
|
133
|
+
};
|
|
134
|
+
}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
export const RECOVERY_CATEGORIES = [
|
|
2
|
+
"busy",
|
|
3
|
+
"not_started",
|
|
4
|
+
"invalid_input",
|
|
5
|
+
"resource_exhausted",
|
|
6
|
+
"operator_cancelled",
|
|
7
|
+
"verification_failed",
|
|
8
|
+
"blocked_on_user",
|
|
9
|
+
"tool_protocol_error",
|
|
10
|
+
"unknown_tool",
|
|
11
|
+
"indeterminate",
|
|
12
|
+
] as const;
|
|
13
|
+
|
|
14
|
+
export type RecoveryCategory = (typeof RECOVERY_CATEGORIES)[number];
|
|
15
|
+
export type RecoveryNextStep = "refuse" | "correct_and_reinvoke" | "reinvoke_after_change" | "authorize_once_and_reinvoke";
|
|
16
|
+
|
|
17
|
+
export interface RecoveryConditions {
|
|
18
|
+
explicitInvocation?: boolean;
|
|
19
|
+
relevantConditionsChanged?: boolean;
|
|
20
|
+
executorIdle?: boolean;
|
|
21
|
+
freshOneUseAuthorization?: boolean;
|
|
22
|
+
toolStateChanged?: boolean;
|
|
23
|
+
effectsEstablished?: boolean;
|
|
24
|
+
processSettled?: boolean;
|
|
25
|
+
indeterminateGrantUsed?: boolean;
|
|
26
|
+
// Runtime-owned no-launch proof for legacy preflight entries that never
|
|
27
|
+
// produced a process, dispatch, or effect. Missing records alone never set this.
|
|
28
|
+
noLaunchEstablished?: boolean;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface RecoveryDecision {
|
|
32
|
+
category: RecoveryCategory;
|
|
33
|
+
allowed: boolean;
|
|
34
|
+
nextStep: RecoveryNextStep;
|
|
35
|
+
budget: "existing_budgets";
|
|
36
|
+
automaticRetry: false;
|
|
37
|
+
waitOrQueue: false;
|
|
38
|
+
reason: string;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* One fail-closed recovery policy shared by no-progress and later protocol slices.
|
|
43
|
+
* It deliberately owns no counters: every allowed invocation still passes through
|
|
44
|
+
* the Hub's existing turn/task budgets.
|
|
45
|
+
*/
|
|
46
|
+
export function recoveryDecision(category: RecoveryCategory, conditions: RecoveryConditions = {}): RecoveryDecision {
|
|
47
|
+
const base = { category, budget: "existing_budgets" as const, automaticRetry: false as const, waitOrQueue: false as const };
|
|
48
|
+
const explicit = conditions.explicitInvocation === true;
|
|
49
|
+
const changed = conditions.relevantConditionsChanged === true;
|
|
50
|
+
switch (category) {
|
|
51
|
+
case "busy":
|
|
52
|
+
return { ...base, allowed: explicit && changed && conditions.executorIdle === true, nextStep: "reinvoke_after_change", reason: "executor must be observed idle before an explicit re-invocation" };
|
|
53
|
+
case "not_started":
|
|
54
|
+
return { ...base, allowed: explicit && changed, nextStep: "correct_and_reinvoke", reason: "preflight refused before launch with no process or effects; correct inputs/prerequisites and re-invoke explicitly" };
|
|
55
|
+
case "invalid_input":
|
|
56
|
+
return { ...base, allowed: explicit && changed, nextStep: "correct_and_reinvoke", reason: "validated inputs must be materially corrected" };
|
|
57
|
+
case "resource_exhausted":
|
|
58
|
+
return { ...base, allowed: explicit && changed, nextStep: "reinvoke_after_change", reason: "resource conditions must be evidenced as changed; no fallback is authorized" };
|
|
59
|
+
case "operator_cancelled":
|
|
60
|
+
return { ...base, allowed: explicit && conditions.freshOneUseAuthorization === true, nextStep: "authorize_once_and_reinvoke", reason: "operator cancellation requires fresh one-use authorization for this agent" };
|
|
61
|
+
case "verification_failed":
|
|
62
|
+
return { ...base, allowed: explicit && changed, nextStep: "correct_and_reinvoke", reason: "the checked state or evidence must have changed" };
|
|
63
|
+
case "blocked_on_user":
|
|
64
|
+
return { ...base, allowed: explicit && conditions.freshOneUseAuthorization === true, nextStep: "authorize_once_and_reinvoke", reason: "one sourced clarification answer may resume only the same task and scope; unstructured prose or a model switch is not authorization" };
|
|
65
|
+
case "tool_protocol_error":
|
|
66
|
+
return { ...base, allowed: explicit && changed && conditions.effectsEstablished === true, nextStep: "correct_and_reinvoke", reason: "requires the T3 trusted event/readback effects artifact plus corrected conditions; /af-retry cannot authorize this failure and already-observed effects must not be replayed blindly" };
|
|
67
|
+
case "unknown_tool":
|
|
68
|
+
return { ...base, allowed: explicit && changed && conditions.toolStateChanged === true, nextStep: "correct_and_reinvoke", reason: "the effective tool catalog must have trusted runtime change evidence; /af-retry and prose cannot authorize this failure" };
|
|
69
|
+
case "indeterminate":
|
|
70
|
+
return { ...base, allowed: explicit && conditions.executorIdle === true && conditions.processSettled === true && conditions.freshOneUseAuthorization === true && conditions.indeterminateGrantUsed === true, nextStep: "authorize_once_and_reinvoke", reason: "one human-authorized retry only after the old process is settled and the executor idle; partial side effects may exist and retry may duplicate them" };
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const NOT_STARTED_STATUS = new Set([
|
|
75
|
+
"not_started",
|
|
76
|
+
"tier_persona_gate",
|
|
77
|
+
"scope_preflight_failed",
|
|
78
|
+
"artifact_preflight_failed",
|
|
79
|
+
"task_budget_refused",
|
|
80
|
+
"budget_refused",
|
|
81
|
+
"duplicate_refused",
|
|
82
|
+
"research_persona_via_dispatch",
|
|
83
|
+
"unknown_agent",
|
|
84
|
+
"process_plan_open",
|
|
85
|
+
"process_state_unavailable",
|
|
86
|
+
"process_obligations_open",
|
|
87
|
+
"action_confirmation_unsupported",
|
|
88
|
+
"process_state_corrupt",
|
|
89
|
+
"docs_lane",
|
|
90
|
+
"review_round_capped",
|
|
91
|
+
"review_round_cap",
|
|
92
|
+
"scope_gate",
|
|
93
|
+
"preflight_refused",
|
|
94
|
+
]);
|
|
95
|
+
|
|
96
|
+
/** Runtime lifecycle is trusted only when both facts are explicit booleans.
|
|
97
|
+
* Missing fields are unknown — never inferred from exit, spawnError, or termination. */
|
|
98
|
+
export function explicitProcessLifecycle(value: unknown): { launched: boolean; closeSeen: boolean } | undefined {
|
|
99
|
+
if (!value || typeof value !== "object") return undefined;
|
|
100
|
+
const launched = (value as { launched?: unknown }).launched;
|
|
101
|
+
const closeSeen = (value as { closeSeen?: unknown }).closeSeen;
|
|
102
|
+
if (typeof launched !== "boolean" || typeof closeSeen !== "boolean") return undefined;
|
|
103
|
+
return { launched, closeSeen };
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/** Post-spawn exceptions must not be rewritten as a proven no-launch. */
|
|
107
|
+
export function lifecycleAfterSpawnException(input: {
|
|
108
|
+
spawnAttempted: boolean;
|
|
109
|
+
spawnLifecycle?: unknown;
|
|
110
|
+
processSeen: boolean;
|
|
111
|
+
}): { launched: boolean; closeSeen: boolean } | undefined {
|
|
112
|
+
if (!input.spawnAttempted) return { launched: false, closeSeen: false };
|
|
113
|
+
const known = explicitProcessLifecycle(input.spawnLifecycle);
|
|
114
|
+
if (input.processSeen || known?.launched === true) return { launched: true, closeSeen: false };
|
|
115
|
+
if (known?.launched === false) return { launched: false, closeSeen: false };
|
|
116
|
+
return undefined;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export function recoveryCategoryFromDetails(details: any): RecoveryCategory | null {
|
|
120
|
+
if (!details || typeof details !== "object") return null;
|
|
121
|
+
if (RECOVERY_CATEGORIES.includes(details.recoveryCategory as RecoveryCategory)) return details.recoveryCategory as RecoveryCategory;
|
|
122
|
+
const values = [details.status, details.acceptanceStatus, details.reason, details.diagnostics?.reason, details.termination?.reason]
|
|
123
|
+
.filter((value): value is string => typeof value === "string")
|
|
124
|
+
.map(value => value.toLowerCase());
|
|
125
|
+
if (values.some(value => value === "busy")) return "busy";
|
|
126
|
+
if (values.some(value => value.includes("operator_cancel") || value === "cancelled" || value === "canceled")) return "operator_cancelled";
|
|
127
|
+
// T3: explicit runtime lifecycle facts outrank exit-code inference.
|
|
128
|
+
// Never launched (safety refusal, spawn failure, pre-launch cancel) is not_started,
|
|
129
|
+
// never an indeterminate attempt. Launched without close stays uncertain downstream.
|
|
130
|
+
if (details.lifecycle && typeof details.lifecycle === "object" && typeof details.lifecycle.launched === "boolean" && details.lifecycle.launched === false) {
|
|
131
|
+
if (values.some(value => value.includes("unknown_tool"))) return "unknown_tool";
|
|
132
|
+
return "not_started";
|
|
133
|
+
}
|
|
134
|
+
if (values.some(value => NOT_STARTED_STATUS.has(value) || value.includes("not_started") || value.includes("preflight"))) return "not_started";
|
|
135
|
+
// Runtime-owned preflight refusals carry started:false and never had a process.
|
|
136
|
+
// They must not become indeterminate attempts. Explicit cancellation stays
|
|
137
|
+
// cancellation even before launch; unknown_tool keeps its own lane.
|
|
138
|
+
if (details.status === "review_reused" && details.reused === true && details.exitCode === 0) return null;
|
|
139
|
+
if (details.started === false) {
|
|
140
|
+
if (values.some(value => value.includes("unknown_tool"))) return "unknown_tool";
|
|
141
|
+
return "not_started";
|
|
142
|
+
}
|
|
143
|
+
if (values.some(value => value.includes("invalid_input") || value.includes("validation"))) return "invalid_input";
|
|
144
|
+
if (values.some(value => value.includes("resource_exhausted") || value.includes("out_of_memory") || value === "oom")) return "resource_exhausted";
|
|
145
|
+
if (values.some(value => value === "blocked_on_user") || (Array.isArray(details.questions) && details.questions.length > 0 && !values.some(value => value === "verification_failed"))) return "blocked_on_user";
|
|
146
|
+
if (values.some(value => value.includes("verification_failed") || value.includes("deliverable_failed"))) return "verification_failed";
|
|
147
|
+
if (values.some(value => value.includes("tool_protocol_error"))) return "tool_protocol_error";
|
|
148
|
+
if (values.some(value => value.includes("unknown_tool"))) return "unknown_tool";
|
|
149
|
+
const failed = typeof details.exitCode === "number" && details.exitCode !== 0;
|
|
150
|
+
return failed ? "indeterminate" : null;
|
|
151
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export interface RerunInput {
|
|
2
|
+
impact: "narrow" | "wide";
|
|
3
|
+
sharedCode: boolean;
|
|
4
|
+
selector: string;
|
|
5
|
+
flaky: boolean;
|
|
6
|
+
policyMandate: boolean;
|
|
7
|
+
builderPassed: boolean;
|
|
8
|
+
reviewerRan?: boolean;
|
|
9
|
+
timeSavedMs?: number;
|
|
10
|
+
area?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface RerunDecision {
|
|
14
|
+
mode: "focused" | "full";
|
|
15
|
+
selector: string;
|
|
16
|
+
independent: true;
|
|
17
|
+
accepted: boolean;
|
|
18
|
+
reason: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function chooseReviewerRerun(input: RerunInput): RerunDecision {
|
|
22
|
+
const full = input.impact === "wide" || input.sharedCode || !input.selector.trim() || input.flaky || input.policyMandate;
|
|
23
|
+
const reasons = [
|
|
24
|
+
input.impact === "wide" ? "wide impact" : "",
|
|
25
|
+
input.sharedCode ? "shared code" : "",
|
|
26
|
+
!input.selector.trim() ? "unclear selector" : "",
|
|
27
|
+
input.flaky ? "flaky signal" : "",
|
|
28
|
+
input.policyMandate ? "policy mandate" : "",
|
|
29
|
+
].filter(Boolean);
|
|
30
|
+
const reviewerRan = input.reviewerRan !== false;
|
|
31
|
+
return {
|
|
32
|
+
mode: full ? "full" : "focused",
|
|
33
|
+
selector: full ? "full" : input.selector,
|
|
34
|
+
independent: true,
|
|
35
|
+
accepted: reviewerRan && !input.builderPassed ? false : reviewerRan,
|
|
36
|
+
reason: full
|
|
37
|
+
? `full regression required because ${reasons.join(", ")}${input.area ? ` (${input.area})` : ""}`
|
|
38
|
+
: "independent focused rerun of specialist-authored tests",
|
|
39
|
+
};
|
|
40
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { ExtensionContext } from "@mariozechner/pi-coding-agent";
|
|
2
|
+
import type { ResearchAgentDef, ResearchRuntime, ResearchState } from "./runtime.ts";
|
|
3
|
+
|
|
4
|
+
export interface ResearchControlPorts<TDef extends ResearchAgentDef> {
|
|
5
|
+
runtime: ResearchRuntime<TDef>;
|
|
6
|
+
refresh(): void;
|
|
7
|
+
restartSpecialist(state: any, ctx: ExtensionContext): Promise<void>;
|
|
8
|
+
getAgents(): Map<string, any>;
|
|
9
|
+
displayName(name: string): string;
|
|
10
|
+
modelWorkBlocked(ctx: ExtensionContext): boolean;
|
|
11
|
+
cancelWait(state: any, kind: "wait_only_cancelled" | "restart"): Promise<void>;
|
|
12
|
+
cancelOwned(state: any): void;
|
|
13
|
+
}
|
|
14
|
+
export interface ResearchControls<TDef extends ResearchAgentDef> {
|
|
15
|
+
remove(state: ResearchState<TDef>, ctx: ExtensionContext): void;
|
|
16
|
+
clear(ctx: ExtensionContext): void;
|
|
17
|
+
restartSpecialist(state: any, ctx: ExtensionContext): Promise<void>;
|
|
18
|
+
handleKill(args: string | undefined, ctx: ExtensionContext): Promise<void>;
|
|
19
|
+
handleRestart(args: string | undefined, ctx: ExtensionContext): Promise<void>;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const researchId = (name: string | undefined) => { const match = name?.match(/^#?r?(\d+)$/i); return match ? parseInt(match[1], 10) : null; };
|
|
23
|
+
const specialistTargets = <TDef extends ResearchAgentDef>(ports: ResearchControlPorts<TDef>) =>
|
|
24
|
+
Array.from(ports.getAgents().values()).map(state => ports.displayName(state.def.name)).join(", ");
|
|
25
|
+
const liveTargets = <TDef extends ResearchAgentDef>(ports: ResearchControlPorts<TDef>) => [
|
|
26
|
+
...Array.from(ports.getAgents().values()).map(state => ports.displayName(state.def.name)),
|
|
27
|
+
...Array.from(ports.runtime.states().values()).map(state => `r${state.id}`),
|
|
28
|
+
].join(", ");
|
|
29
|
+
|
|
30
|
+
export function createResearchControls<TDef extends ResearchAgentDef>(ports: ResearchControlPorts<TDef>): ResearchControls<TDef> {
|
|
31
|
+
const remove = (state: ResearchState<TDef>, ctx: ExtensionContext) => {
|
|
32
|
+
if (state.proc && state.status === "running") { state.killedByOperator = true; state.proc.kill("SIGTERM"); ctx.ui.notify(`Research r${state.id} killed and removed.`, "warning"); }
|
|
33
|
+
else ctx.ui.notify(`Research r${state.id} removed.`, "info");
|
|
34
|
+
ports.runtime.finalize(state, { status: "idle", historyStatus: "idle", lastWork: "(killed by operator)" });
|
|
35
|
+
ports.refresh();
|
|
36
|
+
};
|
|
37
|
+
const controls: ResearchControls<TDef> = {
|
|
38
|
+
remove,
|
|
39
|
+
clear(ctx) {
|
|
40
|
+
let killed = 0; const live = Array.from(ports.runtime.states().values()); const total = live.length;
|
|
41
|
+
for (const state of live) {
|
|
42
|
+
if (state.proc && state.status === "running") { state.killedByOperator = true; state.proc.kill("SIGTERM"); killed++; }
|
|
43
|
+
ports.runtime.finalize(state, { status: "idle", historyStatus: "idle", lastWork: "(killed by operator)" });
|
|
44
|
+
}
|
|
45
|
+
ports.refresh();
|
|
46
|
+
ctx.ui.notify(total === 0 ? "No research helpers to clear." : `Cleared ${total} research helper${total !== 1 ? "s" : ""}${killed > 0 ? ` (${killed} killed)` : ""}.`, "info");
|
|
47
|
+
},
|
|
48
|
+
restartSpecialist: ports.restartSpecialist,
|
|
49
|
+
async handleKill(args, ctx) {
|
|
50
|
+
const name = args?.trim();
|
|
51
|
+
if (name?.toLowerCase() === "all") { controls.clear(ctx); return; }
|
|
52
|
+
const id = researchId(name);
|
|
53
|
+
if (id != null) { const research = ports.runtime.states().get(id); if (!research) ctx.ui.notify(`No research helper "${name}". Known: ${Array.from(ports.runtime.states().values()).map(item => `r${item.id}`).join(", ") || "none"}`, "error"); else controls.remove(research, ctx); return; }
|
|
54
|
+
const state = name ? ports.getAgents().get(name.toLowerCase()) : undefined;
|
|
55
|
+
if (!state) { ctx.ui.notify(`Usage: /af-agents-kill <name|rN|all>. Known: ${liveTargets(ports) || "none"}`, "error"); return; }
|
|
56
|
+
if (state.status !== "running" || (!state.proc && !state.comsAbort)) { ctx.ui.notify(`${ports.displayName(state.def.name)} is not running — nothing to kill.`, "warning"); return; }
|
|
57
|
+
if (!state.proc) { void ports.cancelWait(state, "wait_only_cancelled"); ctx.ui.notify(`Abandoning ${ports.displayName(state.def.name)}'s coms dispatch (the peer pane keeps running)...`, "info"); return; }
|
|
58
|
+
state.killedByOperator = true; ports.cancelOwned(state); ctx.ui.notify(`Killing ${ports.displayName(state.def.name)}...`, "info");
|
|
59
|
+
},
|
|
60
|
+
async handleRestart(args, ctx) {
|
|
61
|
+
if (ports.modelWorkBlocked(ctx)) return;
|
|
62
|
+
const name = args?.trim(); const id = researchId(name);
|
|
63
|
+
if (id != null) {
|
|
64
|
+
ctx.ui.notify(`Research helpers cannot be restarted — spawn a new helper instead.`, "warning");
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
const state = name ? ports.getAgents().get(name.toLowerCase()) : undefined;
|
|
68
|
+
if (!state) { ctx.ui.notify(`Usage: /af-agents-restart <name>. Known: ${specialistTargets(ports) || "none"}`, "error"); return; }
|
|
69
|
+
if (!state.task) { ctx.ui.notify(`${ports.displayName(state.def.name)} has no previous task to restart.`, "warning"); return; }
|
|
70
|
+
ctx.ui.notify(`Restarting ${ports.displayName(state.def.name)} (fresh)...`, "info"); await ports.restartSpecialist(state, ctx);
|
|
71
|
+
},
|
|
72
|
+
};
|
|
73
|
+
return controls;
|
|
74
|
+
}
|