@chankov/agent-fleet 2.2.2 → 2.2.3
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/harnesses/agent-hub/README.md +18 -2
- package/.pi/harnesses/agent-hub/budget-recovery.ts +28 -0
- package/.pi/harnesses/agent-hub/commands/recover.ts +28 -9
- package/.pi/harnesses/agent-hub/context/assertion-journal.ts +133 -0
- package/.pi/harnesses/agent-hub/index.ts +100 -17
- package/.pi/harnesses/agent-hub/no-progress.ts +133 -19
- package/.pi/harnesses/agent-hub/operator-current-state.ts +51 -6
- package/.pi/harnesses/agent-hub/package.json +1 -1
- package/.pi/harnesses/agent-hub/policy/work-mode.ts +2 -1
- package/.pi/harnesses/agent-hub/process-obligations.ts +1 -1
- package/.pi/harnesses/agent-hub/recover-policy.ts +1 -1
- package/.pi/harnesses/agent-hub/recover-state.ts +46 -6
- package/.pi/harnesses/agent-hub/recovery-continuation.ts +134 -0
- package/.pi/harnesses/agent-hub/tools/action-executors.ts +24 -3
- package/.pi/harnesses/agent-hub/tools/context.ts +2 -0
- package/.pi/harnesses/agent-hub/tools/dispatch-execution.ts +60 -17
- package/.pi/harnesses/agent-hub/tools/execution-orchestration.ts +2 -1
- package/.pi/harnesses/agent-hub/tools/recover-task.ts +16 -0
- package/.pi/harnesses/agent-hub/verification-diagnostics.ts +23 -0
- package/.pi/harnesses/agent-hub/work-mode.ts +4 -2
- package/.pi/harnesses/coms/package.json +1 -1
- package/.pi/harnesses/damage-control-continue/index.ts +7 -5
- package/.pi/harnesses/damage-control-continue/package.json +1 -1
- package/.pi/harnesses/lib/bash-policy-analysis.ts +9 -1
- package/.pi/harnesses/lib/exact-permission-port.ts +6 -4
- package/.versions/2.2.3/.pi/agent-fleet/hermes/README.md +347 -0
- package/.versions/2.2.3/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-herdr/plugin.js +1291 -0
- package/.versions/2.2.3/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-herdr/presentation.js +672 -0
- package/.versions/2.2.3/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-monitor/plugin.js +19 -0
- package/.versions/2.2.3/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-monitor/state.js +10 -0
- package/.versions/2.2.3/.pi/agent-fleet/hermes/gates/gate-o-capability.md +8 -0
- package/.versions/2.2.3/.pi/agent-fleet/hermes/gates/gate-o-validator-fixtures.json +1 -0
- package/.versions/2.2.3/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/activity.py +773 -0
- package/.versions/2.2.3/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/coms_registry.py +134 -0
- package/.versions/2.2.3/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/coms_send.py +350 -0
- package/.versions/2.2.3/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/herdr_source.py +193 -0
- package/.versions/2.2.3/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/manifest.json +4 -0
- package/.versions/2.2.3/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/plugin_api.py +444 -0
- package/.versions/2.2.3/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/sessions.py +205 -0
- package/.versions/2.2.3/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/tasks.py +300 -0
- package/.versions/2.2.3/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/watch.py +819 -0
- package/.versions/2.2.3/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/plugin.yaml +8 -0
- package/.versions/2.2.3/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/adapter.py +139 -0
- package/.versions/2.2.3/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/manifest.json +11 -0
- package/.versions/2.2.3/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/plugin_api.py +50 -0
- package/.versions/2.2.3/.pi/agent-fleet/hermes/skills/hub-conductor/SKILL.md +84 -0
- package/.versions/2.2.3/.pi/agent-fleet/hermes/skills/hub-liaison/SKILL.md +84 -0
- package/.versions/2.2.3/.pi/agent-fleet/hermes/skills/hub-watchdog/SKILL.md +76 -0
- package/.versions/2.2.3/.pi/agent-fleet/hermes/skills/hub-watchdog/manifest.json +1 -0
- package/.versions/2.2.3/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog.py +249 -0
- package/.versions/2.2.3/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_actions.py +124 -0
- package/.versions/2.2.3/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_contract.py +76 -0
- package/.versions/2.2.3/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_delivery.py +10 -0
- package/.versions/2.2.3/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_engine.py +128 -0
- package/.versions/2.2.3/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_judgment.py +41 -0
- package/.versions/2.2.3/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_recovery.py +103 -0
- package/.versions/2.2.3/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_state.py +163 -0
- package/.versions/2.2.3/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_transport.py +138 -0
- package/.versions/2.2.3/.pi/agent-fleet/hermes/watchdog-tests/__init__.py +0 -0
- package/.versions/2.2.3/.pi/agent-fleet/hooks/coms-stop-hook.mjs +124 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/claude-code-preflight.ts +70 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/coms-claude-bridge.ts +440 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/coms-cli.ts +430 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/coms-hermes-bridge.ts +416 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/exec-at-target.ts +10 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/0.167-shared.json +1900 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/README.md +223 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/assessment.md +83 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/bootstrap-profile-0.167.json +5627 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/bootstrap-profile.md +43 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/bootstrap.md +45 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/capture-profile.ts +53 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/capture.ts +102 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/catalog.md +91 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/channel.md +21 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/measurement.md +133 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/measurements.json +74 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/notification-profile-0.167.json +2679 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/observer.md +101 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/opaque-response.md +57 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/open-sent.md +68 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/probe-reader.md +51 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/profile.md +71 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/projection.md +147 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/reconnect.md +40 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/response-unions.md +74 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/semver.md +124 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/surface.md +73 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/fixtures/fleet-codex-allowlist-store-child.ts +31 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/fixtures/response-fixture.ts +23 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/fleet-codex-local-mcp.mjs +26 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/fleet-codex-local-mcp.ts +63 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/fleet.ts +244 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/flow.ts +166 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/hermes-monitor-capability-runner.ts +25 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/hermes-monitor-scenario.ts +474 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/hermes-watchdog-capability-probe.ts +45 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/install-hermes-plugin.sh +180 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/claude-bridge-core.ts +208 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/codex-bootstrap-files.ts +46 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/codex-bootstrap-probe.ts +52 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/codex-bootstrap-producer.ts +131 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/codex-connection-history.ts +51 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/codex-daemon-observer.ts +137 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/codex-desktop-discovery.ts +84 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/codex-desktop-preflight.ts +130 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/codex-desktop-queue-host.ts +113 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/codex-measurement.ts +218 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/codex-native-presence.ts +61 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/codex-probe-transcript.ts +135 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/codex-send-lineage.ts +72 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/codex-unix-queue-rpc.ts +101 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/coms-envelope.ts +582 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/fake-herdr-server.ts +88 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/fleet-codex-allowlist-store.ts +453 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/fleet-codex-allowlist.ts +175 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/fleet-codex-answer-transport.ts +73 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/fleet-codex-answers.ts +74 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/fleet-codex-bootstrap.ts +207 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/fleet-codex-connections.ts +76 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/fleet-codex-event-reply.ts +58 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/fleet-codex-event-runtime.ts +132 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/fleet-codex-instruction-store.ts +428 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/fleet-codex-instruction-transport.ts +160 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/fleet-codex-instructions.ts +175 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/fleet-codex-local-mcp.ts +435 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/fleet-codex-native-history.ts +215 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/fleet-codex-observation-store.ts +208 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/fleet-codex-observe-transport.ts +49 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/fleet-codex-observe.ts +93 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/fleet-codex-overview.ts +52 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/fleet-codex-permission-transport.ts +44 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/fleet-codex-permissions.ts +83 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/fleet-codex-readonly.ts +213 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/fleet-codex-relay-latency.ts +45 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/fleet-codex-response-read.ts +26 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/fleet-codex-response-transport.ts +38 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/fleet-codex-resync.ts +212 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/fleet-command.ts +264 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/flow-command.ts +107 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/flow-maintenance.ts +239 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/herdr-layout.ts +281 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/hermes-bridge-core.ts +241 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/hermes-monitor-events.ts +1 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/hermes-monitor-herdr.ts +2 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/hermes-monitor-model.ts +3 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/hermes-monitor-registry.ts +2 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/hermes-monitor-socket.ts +2 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/hermes-monitor-store.ts +2 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/monitor-env.ts +146 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/peer-launch.ts +318 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/peer-target.ts +1 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/persona-banner.ts +62 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/persona-dirs.ts +25 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/resource-closure.js +1 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/runtime-dependencies.js +124 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/session-launch.ts +56 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/spawn-stagger.ts +101 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/team-project.ts +176 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/team-snapshot.ts +160 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/package-lock.json +57 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/package.json +10 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/peer-banner.ts +41 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/peer-launch.ts +289 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/pi-session.ts +9 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/team-snapshot.ts +245 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/team-up.ts +378 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/workflows/lib/agent-phase.ts +181 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/workflows/lib/changes.ts +61 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/workflows/lib/debate.ts +149 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/workflows/lib/env.ts +36 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/workflows/lib/envelopes.ts +169 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/workflows/lib/gates.ts +81 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/workflows/lib/git.ts +108 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/workflows/lib/isolated-snapshot.ts +130 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/workflows/lib/merge.ts +95 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/workflows/lib/model-profile.ts +22 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/workflows/lib/model-visibility.ts +92 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/workflows/lib/permissions.ts +137 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/workflows/lib/personas.ts +57 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/workflows/lib/poll.ts +86 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/workflows/lib/project-policy.ts +37 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/workflows/lib/quality.ts +78 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/workflows/lib/run.ts +109 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/workflows/lib/scout-data-boundary.ts +55 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/workflows/lib/trace.ts +52 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/workflows/lib/voices.ts +128 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/workflows/lib/writer-lease-race.worker.mjs +36 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/workflows/lib/writer-lease.ts +148 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/workflows/tsconfig.json +22 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/workflows/wf-build-test.ts +61 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/workflows/wf-debate.ts +87 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/workflows/wf-document.ts +50 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/workflows/wf-poll.ts +95 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/workflows/wf-quality.ts +20 -0
- package/.versions/2.2.3/.pi/agent-fleet/scripts/workflows/wf-scout.ts +40 -0
- package/.versions/2.2.3/.pi/agents/dispatch-policy.yaml +32 -0
- package/.versions/2.2.3/.pi/agents/model-profiles.yaml +132 -0
- package/.versions/2.2.3/.pi/agents/peers.yaml +147 -0
- package/.versions/2.2.3/.pi/agents/teams.yaml +41 -0
- package/.versions/2.2.3/.pi/agents/voices.yaml +13 -0
- package/.versions/2.2.3/.pi/damage-control-rules.yaml +297 -0
- package/.versions/2.2.3/.pi/extensions/btw/README.md +120 -0
- package/.versions/2.2.3/.pi/extensions/btw/index.ts +916 -0
- package/.versions/2.2.3/.pi/extensions/btw/package.json +6 -0
- package/.versions/2.2.3/.pi/extensions/btw/state.js +179 -0
- package/.versions/2.2.3/.pi/extensions/chrome-devtools-mcp/README.md +55 -0
- package/.versions/2.2.3/.pi/extensions/chrome-devtools-mcp/index.ts +93 -0
- package/.versions/2.2.3/.pi/extensions/chrome-devtools-mcp/package.json +6 -0
- package/.versions/2.2.3/.pi/extensions/compact-and-continue/README.md +42 -0
- package/.versions/2.2.3/.pi/extensions/compact-and-continue/index.ts +136 -0
- package/.versions/2.2.3/.pi/extensions/compact-and-continue/package.json +6 -0
- package/.versions/2.2.3/.pi/extensions/mcp-bridge/README.md +46 -0
- package/.versions/2.2.3/.pi/extensions/mcp-bridge/index.ts +206 -0
- package/.versions/2.2.3/.pi/extensions/mcp-bridge/package.json +6 -0
- package/.versions/2.2.3/.pi/extensions/package-lock.json +1175 -0
- package/.versions/2.2.3/.pi/extensions/package.json +9 -0
- package/.versions/2.2.3/.pi/extensions/pi-voice-stt/README.md +224 -0
- package/.versions/2.2.3/.pi/extensions/pi-voice-stt/config.ts +199 -0
- package/.versions/2.2.3/.pi/extensions/pi-voice-stt/examples/stt.json +35 -0
- package/.versions/2.2.3/.pi/extensions/pi-voice-stt/index.ts +248 -0
- package/.versions/2.2.3/.pi/extensions/pi-voice-stt/package.json +6 -0
- package/.versions/2.2.3/.pi/extensions/pi-voice-stt/providers.ts +214 -0
- package/.versions/2.2.3/.pi/extensions/pi-voice-stt/recorder.ts +158 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/README.md +1657 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/acceptance.ts +204 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/access-approval.ts +266 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/action-authorization.ts +10 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/agentic-contract.ts +43 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/agentic-evidence.ts +64 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/agentic-hub.ts +55 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/agentic-runtime.ts +56 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/agentic-sources-worker.mjs +4 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/agentic-sources.ts +74 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/agentic-state.ts +23 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/approval-wait.ts +1 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/artifacts.js +146 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/assertion-ledger.js +68 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/assist-profile.ts +19 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/backend-policy.js +174 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/bounded-output.ts +26 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/budget-recovery.ts +151 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/capability-confirmation.ts +47 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/capability-packs.ts +187 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/codex-bootstrap.ts +117 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/commands/agent-model-thinking.ts +10 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/commands/agent-model.ts +10 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/commands/agent-models-substitute.ts +10 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/commands/agents-add.ts +9 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/commands/agents-drop.ts +9 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/commands/agents-history.ts +9 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/commands/agents-kill.ts +10 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/commands/agents-list.ts +9 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/commands/agents-restart.ts +10 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/commands/agents-save.ts +9 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/commands/agents-team.ts +9 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/commands/audit.ts +9 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/commands/compound.ts +9 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/commands/coms.ts +9 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/commands/config.ts +9 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/commands/context-command.ts +9 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/commands/context.ts +43 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/commands/debate.ts +9 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/commands/dispatch-policy.ts +9 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/commands/handoff.ts +10 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/commands/hub-report.ts +9 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/commands/models.ts +10 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/commands/poll.ts +9 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/commands/recover.ts +81 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/commands/retry.ts +10 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/commands/task-triage-recover.ts +12 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/commands/task-triage-waive.ts +12 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/commands/watchdog.ts +9 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/commands/zoom.ts +10 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/config/agents.ts +183 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/config/model-profiles.ts +240 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/config/overrides.ts +166 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/context/agent-state.ts +30 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/context/assertion-journal.ts +133 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/context/assertions-artifacts.ts +234 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/context/budgets.ts +152 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/context/hub-state.ts +40 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/context-budget-snapshot.ts +105 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/context-compaction-monitor.ts +35 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/context-compaction-preflight.ts +21 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/context-compaction-runtime.ts +69 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/context-compaction.ts +34 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/context-continuity-broker.ts +44 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/context-continuity-child.ts +83 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/context-continuity-client.ts +22 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/context-continuity-compat.ts +45 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/context-continuity-owners.ts +17 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/context-continuity-registry.ts +8 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/context-continuity.ts +82 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/context-pressure.ts +222 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/context-window.js +108 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/damage-guard-approval.ts +83 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/damage-guard-broker.ts +125 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/damage-guard-contract.ts +22 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/damage-guard-descendant.ts +76 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/damage-guard-hub.ts +263 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/damage-guard-identity.ts +12 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/damage-guard-owners.ts +59 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/damage-guard-state.ts +43 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/damage-guard-test-tsconfig.json +19 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/debate-command.ts +176 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/delegate.ts +478 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/deterministic-fs.ts +195 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/diagnostic-probe-extension.ts +26 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/diagnostic-series-budget.ts +178 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/dispatch-coms.ts +258 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/dispatch-core.ts +27 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/dispatch-native-complete.ts +176 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/dispatch-native-prepare.ts +318 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/dispatch-native-spawn.ts +264 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/dispatch-native-types.ts +297 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/dispatch-native.ts +242 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/dispatch-observability.ts +225 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/dispatch-triage-contract.ts +27 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/dispatch-triage-eval.ts +77 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/dispatch-triage-policy.ts +29 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/dispatch-triage-runtime.ts +55 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/dispatch-triage-state.ts +33 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/docs-lane.js +123 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/drift-judge.ts +352 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/drift-runtime.ts +480 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/drift-system1-policy.ts +39 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/drift-system1.ts +469 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/drift-watchdog.js +344 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/evidence-manifest.ts +51 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/evidence-rules.js +96 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/execution-evidence.ts +96 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/execution-trace.ts +241 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/external-blocker.js +92 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/file-discovery/adapters.ts +88 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/file-discovery/broker-client.ts +62 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/file-discovery/broker.ts +128 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/file-discovery/child-extension.ts +42 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/file-discovery/descendant.ts +67 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/file-discovery/discovery-worker.mjs +15 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/file-discovery/discovery.ts +126 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/file-discovery/evaluate.ts +57 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/file-discovery/hub.ts +170 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/file-discovery/native-context.ts +8 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/file-discovery/native-fixture.test-support.ts +108 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/file-discovery/owners.ts +100 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/file-discovery/results.ts +55 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/file-discovery/runtime.ts +130 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/file-discovery/semantic-profiles.ts +18 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/file-discovery/sources.ts +69 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/file-discovery/state.ts +22 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/filesystem-tool.ts +166 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/fixtures/registration-surface.json +69 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/fixtures/t0a-synthetic/catalog.ts +189 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/footer.ts +29 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/helpers.ts +269 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/history-projection.ts +116 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/hub-state-audit.js +41 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/index.ts +2805 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/input/completions.ts +82 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/input/shortcuts.ts +16 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/lifecycle/context-pressure.ts +231 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/lifecycle/monitor-session.ts +104 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/lifecycle/session-orchestration.ts +143 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/lifecycle/turn-handlers.ts +90 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/monitor-control.ts +9 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/monitor-invoke-journal.ts +131 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/monitor-invoke.ts +92 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/monitor-lifecycle.ts +13 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/monitor-publisher.ts +59 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/monitor-recovery.ts +3 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/monitor-runtime.ts +3 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/monitor-session-bridge.ts +266 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/no-progress.ts +741 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/operator-current-state.ts +102 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/operator-watchdog.ts +97 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/orchestration-activation.ts +109 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/orchestration-metrics.ts +78 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/orchestration-route.ts +68 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/package.json +7 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/peer-spawn-plan.ts +116 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/permission-channel.ts +87 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/permission-relay.ts +84 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/policy/models.ts +153 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/policy/profile-activation.ts +62 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/policy/profile-runtime.ts +120 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/policy/roster.ts +103 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/policy/work-mode.ts +104 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/poll-command.ts +184 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/presentation.ts +54 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/private-config-current-state.ts +81 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/private-config-fixtures.ts +26 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/private-config-review.ts +100 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/proactive-config.ts +22 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/proactive-evaluate.ts +138 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/proactive-external-git.ts +82 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/proactive-external.ts +142 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/proactive-feedback.ts +104 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/proactive-findings.ts +115 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/proactive-local.ts +89 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/proactive-observer.ts +106 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/proactive-rules.ts +171 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/proactive-runtime.ts +318 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/proactive-selection.ts +68 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/proactive-snapshot-worker.mjs +12 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/proactive-snapshot.ts +287 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/proactive-types.ts +70 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/process-obligations.ts +210 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/prompts/context.ts +72 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/prompts/fragments.ts +94 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/prompts/session-start.ts +89 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/prompts/system-prompt.ts +142 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/provider-semaphore.js +143 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/reconcile.ts +26 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/recover-policy.ts +44 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/recover-state.ts +144 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/recovery-continuation.ts +134 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/recovery-contract.ts +151 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/rerun-policy.ts +40 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/research/controls.ts +74 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/research/runtime.ts +215 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/research/spawn-run.ts +221 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/research-watchdog.ts +40 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/return-contract.js +371 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/return-extract.js +77 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/review-closure.ts +43 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/review-continuity.ts +76 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/review-findings.js +96 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/review-reuse.ts +48 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/review-verdict.ts +6 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/routing-observation.ts +41 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/routing-proposal.ts +46 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/run-budget.js +362 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/run-namespace.js +93 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/runtime-receipts.ts +63 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/runtime-test-check.ts +85 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/safety-routing.ts +28 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/scope-gate.js +271 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/scope-overlap.ts +46 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/session-audit.ts +331 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/session-health.js +110 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/session-start.ts +42 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/spawn.ts +702 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/specialist-result-receipt.ts +13 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/specialist-result.ts +78 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/system1-activity.ts +625 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/system1-communication-store.ts +225 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/system1-report.ts +275 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/system1-runtime.ts +271 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/task-brief.ts +98 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/task-continuation.ts +4 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/task-resume-contract.ts +80 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/task-triage-authorization.ts +170 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/task-triage-config.ts +21 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/task-triage-contract.ts +14 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/task-triage-live-stage-boundary.mjs +49 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/task-triage-obligations.ts +120 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/task-triage-policy.ts +16 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/task-triage-review-contract.mjs +43 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/task-triage-reviewer-only-contract.mjs +156 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/task-triage-reviewer-only-diagnostics.mjs +112 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/task-triage-runtime.ts +132 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/task-triage-stage-guard.ts +21 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/task-triage-state.ts +46 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/timeline.ts +72 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/tool-catalog-runtime.ts +83 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/tool-catalog-state.ts +125 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/tool-protocol.ts +134 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/tools/action-executors.ts +237 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/tools/ask-system1-files.ts +15 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/tools/ask-system1.ts +25 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/tools/coms-tools.ts +139 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/tools/context.ts +151 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/tools/dispatch-agent.ts +93 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/tools/dispatch-execution.ts +971 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/tools/dispatch-triage.ts +16 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/tools/execution-orchestration.ts +23 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/tools/fleet-tools.ts +201 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/tools/herdr-executors.ts +100 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/tools/poll-panel-core.ts +30 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/tools/poll-panel.ts +33 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/tools/recover-task.ts +16 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/tools/run-flow.ts +177 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/tools/set-task-tier.ts +31 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/tools/spawn-research.ts +67 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/tools/team-adjust.ts +29 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/tools/verification-contract.ts +81 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/tsconfig.json +22 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/types.ts +66 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/ui/activity-dots.ts +25 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/ui/context-budget.ts +89 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/ui/detail-panel.ts +192 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/ui/fleet-actions.ts +78 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/ui/fleet-dashboard.ts +173 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/ui/fleet-editor.ts +44 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/ui/fleet-source.ts +179 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/ui/grid.ts +159 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/ui/history-store.ts +137 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/ui/history.ts +234 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/ui/pool.ts +103 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/ui/running-strip.ts +2 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/ui/system1-communication.ts +59 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/ui/zoom.ts +206 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/unknown-tool-counter.ts +116 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/verification-diagnostics.ts +23 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/version.ts +42 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/watchdog-evaluation.ts +110 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/work-mode.ts +185 -0
- package/.versions/2.2.3/.pi/harnesses/agent-hub/write-isolation.ts +232 -0
- package/.versions/2.2.3/.pi/harnesses/ask-user-remote/README.md +59 -0
- package/.versions/2.2.3/.pi/harnesses/ask-user-remote/index.ts +571 -0
- package/.versions/2.2.3/.pi/harnesses/ask-user-remote/questions.ts +206 -0
- package/.versions/2.2.3/.pi/harnesses/ask-user-remote/race-core.js +124 -0
- package/.versions/2.2.3/.pi/harnesses/ask-user-remote/runtime-ask.ts +90 -0
- package/.versions/2.2.3/.pi/harnesses/coms/README.md +105 -0
- package/.versions/2.2.3/.pi/harnesses/coms/index.ts +308 -0
- package/.versions/2.2.3/.pi/harnesses/coms/package.json +7 -0
- package/.versions/2.2.3/.pi/harnesses/coms/version.ts +42 -0
- package/.versions/2.2.3/.pi/harnesses/damage-control-continue/README.md +161 -0
- package/.versions/2.2.3/.pi/harnesses/damage-control-continue/index.ts +661 -0
- package/.versions/2.2.3/.pi/harnesses/damage-control-continue/package.json +7 -0
- package/.versions/2.2.3/.pi/harnesses/damage-control-continue/result-screen.ts +98 -0
- package/.versions/2.2.3/.pi/harnesses/damage-control-continue/system1-child.ts +45 -0
- package/.versions/2.2.3/.pi/harnesses/damage-control-continue/system1-client.ts +85 -0
- package/.versions/2.2.3/.pi/harnesses/damage-control-continue/system1-guard.ts +65 -0
- package/.versions/2.2.3/.pi/harnesses/damage-control-continue/version.ts +42 -0
- package/.versions/2.2.3/.pi/harnesses/lib/approval-wait.ts +17 -0
- package/.versions/2.2.3/.pi/harnesses/lib/bash-policy-analysis.ts +193 -0
- package/.versions/2.2.3/.pi/harnesses/lib/changed-file-diagnostics.ts +642 -0
- package/.versions/2.2.3/.pi/harnesses/lib/clarification-policy.ts +9 -0
- package/.versions/2.2.3/.pi/harnesses/lib/codex-compat.ts +97 -0
- package/.versions/2.2.3/.pi/harnesses/lib/codex-contract.ts +259 -0
- package/.versions/2.2.3/.pi/harnesses/lib/codex-notification-profile.ts +75 -0
- package/.versions/2.2.3/.pi/harnesses/lib/coms-core-io.ts +422 -0
- package/.versions/2.2.3/.pi/harnesses/lib/coms-core.ts +738 -0
- package/.versions/2.2.3/.pi/harnesses/lib/coms-instruction-receipts.ts +113 -0
- package/.versions/2.2.3/.pi/harnesses/lib/coms-observation.ts +74 -0
- package/.versions/2.2.3/.pi/harnesses/lib/coms-registry-entry.ts +99 -0
- package/.versions/2.2.3/.pi/harnesses/lib/coms-response-read.ts +107 -0
- package/.versions/2.2.3/.pi/harnesses/lib/context-budget-child-prompt.ts +214 -0
- package/.versions/2.2.3/.pi/harnesses/lib/context-budget-hub-prompt.ts +124 -0
- package/.versions/2.2.3/.pi/harnesses/lib/context-budget-view.ts +112 -0
- package/.versions/2.2.3/.pi/harnesses/lib/context-budget.ts +114 -0
- package/.versions/2.2.3/.pi/harnesses/lib/context-compaction-policy.js +35 -0
- package/.versions/2.2.3/.pi/harnesses/lib/damage-action-hash.ts +28 -0
- package/.versions/2.2.3/.pi/harnesses/lib/damage-auto-policy.ts +52 -0
- package/.versions/2.2.3/.pi/harnesses/lib/damage-control-presentation.ts +14 -0
- package/.versions/2.2.3/.pi/harnesses/lib/damage-control-shared.ts +276 -0
- package/.versions/2.2.3/.pi/harnesses/lib/damage-guard-port.ts +25 -0
- package/.versions/2.2.3/.pi/harnesses/lib/damage-policy.ts +35 -0
- package/.versions/2.2.3/.pi/harnesses/lib/damage-result-evidence.ts +25 -0
- package/.versions/2.2.3/.pi/harnesses/lib/damage-result-view.ts +16 -0
- package/.versions/2.2.3/.pi/harnesses/lib/deterministic-handle-path.ts +25 -0
- package/.versions/2.2.3/.pi/harnesses/lib/exact-permission-port.ts +40 -0
- package/.versions/2.2.3/.pi/harnesses/lib/execution-trace.ts +45 -0
- package/.versions/2.2.3/.pi/harnesses/lib/fixtures/context-budget-profiles.json +11 -0
- package/.versions/2.2.3/.pi/harnesses/lib/fixtures/hub-prompt-operator.legacy.txt +73 -0
- package/.versions/2.2.3/.pi/harnesses/lib/fixtures/hub-prompt-orchestrator.legacy.txt +73 -0
- package/.versions/2.2.3/.pi/harnesses/lib/fleet-bootstrap-channel.ts +148 -0
- package/.versions/2.2.3/.pi/harnesses/lib/fleet-codex-catalog.ts +30 -0
- package/.versions/2.2.3/.pi/harnesses/lib/fleet-codex-chat-view.ts +55 -0
- package/.versions/2.2.3/.pi/harnesses/lib/fleet-codex-event-bridge.ts +82 -0
- package/.versions/2.2.3/.pi/harnesses/lib/fleet-codex-namespace.ts +2 -0
- package/.versions/2.2.3/.pi/harnesses/lib/fleet-codex-policy-snapshot.ts +10 -0
- package/.versions/2.2.3/.pi/harnesses/lib/fleet-config/cli-bridge.ts +111 -0
- package/.versions/2.2.3/.pi/harnesses/lib/fleet-config/mutations.ts +201 -0
- package/.versions/2.2.3/.pi/harnesses/lib/fleet-config/snapshot.ts +417 -0
- package/.versions/2.2.3/.pi/harnesses/lib/fleet-config/transition.ts +68 -0
- package/.versions/2.2.3/.pi/harnesses/lib/fleet-config/ui.ts +269 -0
- package/.versions/2.2.3/.pi/harnesses/lib/fleet-config/view.ts +338 -0
- package/.versions/2.2.3/.pi/harnesses/lib/fleet-connection-control.ts +94 -0
- package/.versions/2.2.3/.pi/harnesses/lib/fleet-connection-diagnostics.ts +7 -0
- package/.versions/2.2.3/.pi/harnesses/lib/fleet-dashboard-ops.ts +178 -0
- package/.versions/2.2.3/.pi/harnesses/lib/fleet-dashboard-view.ts +174 -0
- package/.versions/2.2.3/.pi/harnesses/lib/fleet-detail-view.ts +339 -0
- package/.versions/2.2.3/.pi/harnesses/lib/fleet-event-source.ts +21 -0
- package/.versions/2.2.3/.pi/harnesses/lib/fleet-notification-admission.ts +32 -0
- package/.versions/2.2.3/.pi/harnesses/lib/fleet-notification-bootstrap.ts +172 -0
- package/.versions/2.2.3/.pi/harnesses/lib/fleet-notification-validation.ts +122 -0
- package/.versions/2.2.3/.pi/harnesses/lib/fleet-overlay.ts +26 -0
- package/.versions/2.2.3/.pi/harnesses/lib/fleet-panel.ts +34 -0
- package/.versions/2.2.3/.pi/harnesses/lib/fleet-question-reference.ts +42 -0
- package/.versions/2.2.3/.pi/harnesses/lib/fleet-read-model.ts +609 -0
- package/.versions/2.2.3/.pi/harnesses/lib/fleet-selection.ts +24 -0
- package/.versions/2.2.3/.pi/harnesses/lib/fleet-strip-controller.ts +75 -0
- package/.versions/2.2.3/.pi/harnesses/lib/fleet-strip-view.ts +179 -0
- package/.versions/2.2.3/.pi/harnesses/lib/fleet-target-identity.ts +9 -0
- package/.versions/2.2.3/.pi/harnesses/lib/fleet-transcript-store.ts +244 -0
- package/.versions/2.2.3/.pi/harnesses/lib/herdr-client.ts +472 -0
- package/.versions/2.2.3/.pi/harnesses/lib/herdr-presence.ts +399 -0
- package/.versions/2.2.3/.pi/harnesses/lib/hermes-monitor-events.ts +136 -0
- package/.versions/2.2.3/.pi/harnesses/lib/hermes-monitor-herdr.ts +28 -0
- package/.versions/2.2.3/.pi/harnesses/lib/hermes-monitor-model.ts +18 -0
- package/.versions/2.2.3/.pi/harnesses/lib/hermes-monitor-registry.ts +6 -0
- package/.versions/2.2.3/.pi/harnesses/lib/hermes-monitor-socket.ts +163 -0
- package/.versions/2.2.3/.pi/harnesses/lib/hermes-monitor-store.ts +31 -0
- package/.versions/2.2.3/.pi/harnesses/lib/identical-dialog.ts +27 -0
- package/.versions/2.2.3/.pi/harnesses/lib/installation-state.js +62 -0
- package/.versions/2.2.3/.pi/harnesses/lib/peer-target.ts +24 -0
- package/.versions/2.2.3/.pi/harnesses/lib/policy-roots.js +117 -0
- package/.versions/2.2.3/.pi/harnesses/lib/policy-roots.ts +32 -0
- package/.versions/2.2.3/.pi/harnesses/lib/process-shared.ts +9 -0
- package/.versions/2.2.3/.pi/harnesses/lib/resource-closure.js +26 -0
- package/.versions/2.2.3/.pi/harnesses/lib/safe-source-read.js +29 -0
- package/.versions/2.2.3/.pi/harnesses/lib/semantic-approval.ts +80 -0
- package/.versions/2.2.3/.pi/harnesses/lib/session-target.ts +62 -0
- package/.versions/2.2.3/.pi/harnesses/lib/spawned-peers.js +191 -0
- package/.versions/2.2.3/.pi/harnesses/lib/system1/config-agentic.js +15 -0
- package/.versions/2.2.3/.pi/harnesses/lib/system1/config-context-compaction.js +16 -0
- package/.versions/2.2.3/.pi/harnesses/lib/system1/config-damage-guard.js +24 -0
- package/.versions/2.2.3/.pi/harnesses/lib/system1/config-file-discovery.js +23 -0
- package/.versions/2.2.3/.pi/harnesses/lib/system1/config-json.js +37 -0
- package/.versions/2.2.3/.pi/harnesses/lib/system1/config-loader.js +53 -0
- package/.versions/2.2.3/.pi/harnesses/lib/system1/config-proactive.js +68 -0
- package/.versions/2.2.3/.pi/harnesses/lib/system1/config-triage.js +42 -0
- package/.versions/2.2.3/.pi/harnesses/lib/system1/config-v2.js +112 -0
- package/.versions/2.2.3/.pi/harnesses/lib/system1/config.js +50 -0
- package/.versions/2.2.3/.pi/harnesses/lib/system1/contracts.ts +154 -0
- package/.versions/2.2.3/.pi/harnesses/lib/system1/demo.ts +95 -0
- package/.versions/2.2.3/.pi/harnesses/lib/system1/jev.ts +503 -0
- package/.versions/2.2.3/.pi/harnesses/lib/system1/payload-screen.ts +65 -0
- package/.versions/2.2.3/.pi/harnesses/lib/system1/selection.js +11 -0
- package/.versions/2.2.3/.pi/harnesses/lib/system1/service.ts +245 -0
- package/.versions/2.2.3/.pi/harnesses/lib/system1/worktree-scopes.js +110 -0
- package/.versions/2.2.3/.pi/harnesses/lib/system1/worktree-scopes.ts +13 -0
- package/.versions/2.2.3/.pi/harnesses/lib/system1/worktree-service.ts +24 -0
- package/.versions/2.2.3/.pi/harnesses/lib/target-capabilities.js +7 -0
- package/.versions/2.2.3/.pi/harnesses/lib/update-check.ts +227 -0
- package/.versions/2.2.3/.pi/harnesses/lib/workspace-context.js +115 -0
- package/.versions/2.2.3/.pi/harnesses/lib/workspace-context.ts +22 -0
- package/.versions/2.2.3/.pi/harnesses/package-lock.json +2121 -0
- package/.versions/2.2.3/.pi/harnesses/package.json +13 -0
- package/.versions/2.2.3/.pi/prompts/af-build.md +27 -0
- package/.versions/2.2.3/.pi/prompts/af-code-simplify.md +22 -0
- package/.versions/2.2.3/.pi/prompts/af-constraints.md +31 -0
- package/.versions/2.2.3/.pi/prompts/af-plan.md +17 -0
- package/.versions/2.2.3/.pi/prompts/af-review.md +16 -0
- package/.versions/2.2.3/.pi/prompts/af-set-hermes-telegram.md +15 -0
- package/.versions/2.2.3/.pi/prompts/af-set-hermes-watchdog.md +6 -0
- package/.versions/2.2.3/.pi/prompts/af-setup-rules.md +20 -0
- package/.versions/2.2.3/.pi/prompts/af-ship.md +17 -0
- package/.versions/2.2.3/.pi/prompts/af-spec.md +15 -0
- package/.versions/2.2.3/.pi/prompts/af-test.md +19 -0
- package/.versions/2.2.3/.pi/skills/bowser/SKILL.md +145 -0
- package/.versions/2.2.3/.version +1 -0
- package/.versions/2.2.3/agents/architect.md +24 -0
- package/.versions/2.2.3/agents/bowser.md +28 -0
- package/.versions/2.2.3/agents/builder.md +55 -0
- package/.versions/2.2.3/agents/code-reviewer.md +209 -0
- package/.versions/2.2.3/agents/deep-researcher.md +32 -0
- package/.versions/2.2.3/agents/documenter.md +22 -0
- package/.versions/2.2.3/agents/plan-reviewer.md +83 -0
- package/.versions/2.2.3/agents/planner.md +107 -0
- package/.versions/2.2.3/agents/releaser.md +24 -0
- package/.versions/2.2.3/agents/researcher.md +30 -0
- package/.versions/2.2.3/agents/security-auditor.md +167 -0
- package/.versions/2.2.3/agents/test-engineer.md +153 -0
- package/.versions/2.2.3/agents/web-debugger.md +44 -0
- package/.versions/2.2.3/agents/web-performance-auditor.md +194 -0
- package/.versions/2.2.3/bin/catalog/harness-runtime-closure.json +85 -0
- package/.versions/2.2.3/docs/ARCHITECTURE.md +1291 -0
- package/.versions/2.2.3/docs/agent-fleet-setup.md +1161 -0
- package/.versions/2.2.3/docs/claude-code-coms-bridge.md +147 -0
- package/.versions/2.2.3/docs/codex-local-mcp.md +520 -0
- package/.versions/2.2.3/docs/codex-session-bridge.md +44 -0
- package/.versions/2.2.3/docs/codex-setup.md +183 -0
- package/.versions/2.2.3/docs/coms-hermes-bridge.md +188 -0
- package/.versions/2.2.3/docs/fleet-native-voice.md +151 -0
- package/.versions/2.2.3/docs/getting-started.md +126 -0
- package/.versions/2.2.3/docs/npm-install.md +535 -0
- package/.versions/2.2.3/docs/pi-extensions.md +450 -0
- package/.versions/2.2.3/docs/pi-setup.md +92 -0
- package/.versions/2.2.3/docs/skill-anatomy.md +150 -0
- package/.versions/2.2.3/install-manifest.json +3227 -0
- package/.versions/2.2.3/justfile +246 -0
- package/.versions/2.2.3/manifest-meta.json +1099 -0
- package/.versions/2.2.3/references/accessibility-checklist.md +160 -0
- package/.versions/2.2.3/references/communication-contract.md +26 -0
- package/.versions/2.2.3/references/definition-of-done.md +67 -0
- package/.versions/2.2.3/references/fleet-coordination-patterns.md +171 -0
- package/.versions/2.2.3/references/observability-checklist.md +92 -0
- package/.versions/2.2.3/references/orchestration-patterns.md +370 -0
- package/.versions/2.2.3/references/performance-checklist.md +236 -0
- package/.versions/2.2.3/references/prompting-patterns.md +380 -0
- package/.versions/2.2.3/references/security-checklist.md +245 -0
- package/.versions/2.2.3/references/testing-patterns.md +235 -0
- package/.versions/2.2.3/references/workflow-authoring.md +304 -0
- package/.versions/2.2.3/skills/_internal/grilling.md +59 -0
- package/.versions/2.2.3/skills/browser-testing-with-devtools/SKILL.md +351 -0
- package/.versions/2.2.3/skills/code-review-and-quality/SKILL.md +396 -0
- package/.versions/2.2.3/skills/compound-learning/SKILL.md +137 -0
- package/.versions/2.2.3/skills/constraint-driven-development/SKILL.md +338 -0
- package/.versions/2.2.3/skills/constraint-driven-development/references/floor-guard.md +99 -0
- package/.versions/2.2.3/skills/context-engineering/SKILL.md +341 -0
- package/.versions/2.2.3/skills/deprecation-and-migration/SKILL.md +247 -0
- package/.versions/2.2.3/skills/designing-agents/SKILL.md +394 -0
- package/.versions/2.2.3/skills/designing-agents/pi-harness-authoring.md +222 -0
- package/.versions/2.2.3/skills/drafting-workflows/SKILL.md +143 -0
- package/.versions/2.2.3/skills/drafting-workflows/scripts/make-workflow.ts +177 -0
- package/.versions/2.2.3/skills/fleet-connect/SKILL.md +29 -0
- package/.versions/2.2.3/skills/fleet-connect.zip +0 -0
- package/.versions/2.2.3/skills/fleet-native-voice/SKILL.md +103 -0
- package/.versions/2.2.3/skills/fleet-native-voice/agents/openai.yaml +4 -0
- package/.versions/2.2.3/skills/fleet-native-voice.zip +0 -0
- package/.versions/2.2.3/skills/frontend-ui-engineering/SKILL.md +328 -0
- package/.versions/2.2.3/skills/git-workflow-and-versioning/SKILL.md +316 -0
- package/.versions/2.2.3/skills/idea-refine/SKILL.md +182 -0
- package/.versions/2.2.3/skills/idea-refine/examples.md +238 -0
- package/.versions/2.2.3/skills/idea-refine/frameworks.md +99 -0
- package/.versions/2.2.3/skills/idea-refine/refinement-criteria.md +113 -0
- package/.versions/2.2.3/skills/idea-refine/scripts/idea-refine.sh +15 -0
- package/.versions/2.2.3/skills/incremental-implementation/SKILL.md +353 -0
- package/.versions/2.2.3/skills/incremental-implementation.zip +0 -0
- package/.versions/2.2.3/skills/interview-me/SKILL.md +226 -0
- package/.versions/2.2.3/skills/orchestration-verification/SKILL.md +182 -0
- package/.versions/2.2.3/skills/peer-coms/SKILL.md +90 -0
- package/.versions/2.2.3/skills/performance-optimization/SKILL.md +496 -0
- package/.versions/2.2.3/skills/planning-and-task-breakdown/SKILL.md +318 -0
- package/.versions/2.2.3/skills/planning-and-task-breakdown.zip +0 -0
- package/.versions/2.2.3/skills/repository-ai-setup/SKILL.md +135 -0
- package/.versions/2.2.3/skills/repository-ai-setup/references/agent-fleet-ai-state.template.json +4 -0
- package/.versions/2.2.3/skills/repository-ai-setup/references/apply-contract.md +74 -0
- package/.versions/2.2.3/skills/repository-ai-setup/references/provenance-template.md +16 -0
- package/.versions/2.2.3/skills/repository-ai-setup/references/setup-flow.md +108 -0
- package/.versions/2.2.3/skills/repository-ai-setup/references/verify-setup.md +20 -0
- package/.versions/2.2.3/skills/repository-ai-setup.zip +0 -0
- package/.versions/2.2.3/skills/security-and-hardening/SKILL.md +524 -0
- package/.versions/2.2.3/skills/spec-driven-development/SKILL.md +295 -0
- package/.versions/2.2.3/skills/spec-driven-development.zip +0 -0
- package/.versions/2.2.3/skills/using-agent-skills/SKILL.md +198 -0
- package/.versions/2.2.3/vendor/agent-skills-upstream/LICENSE +21 -0
- package/.versions/2.2.3/vendor/agent-skills-upstream/README.md +430 -0
- package/.versions/2.2.3/vendor/agent-skills-upstream/skills/api-and-interface-design/SKILL.md +367 -0
- package/.versions/2.2.3/vendor/agent-skills-upstream/skills/browser-testing-with-devtools/SKILL.md +317 -0
- package/.versions/2.2.3/vendor/agent-skills-upstream/skills/ci-cd-and-automation/SKILL.md +390 -0
- package/.versions/2.2.3/vendor/agent-skills-upstream/skills/code-review-and-quality/SKILL.md +396 -0
- package/.versions/2.2.3/vendor/agent-skills-upstream/skills/code-simplification/SKILL.md +331 -0
- package/.versions/2.2.3/vendor/agent-skills-upstream/skills/constraint-driven-development/SKILL.md +311 -0
- package/.versions/2.2.3/vendor/agent-skills-upstream/skills/constraint-driven-development/references/floor-guard.md +99 -0
- package/.versions/2.2.3/vendor/agent-skills-upstream/skills/context-engineering/SKILL.md +337 -0
- package/.versions/2.2.3/vendor/agent-skills-upstream/skills/debugging-and-error-recovery/SKILL.md +300 -0
- package/.versions/2.2.3/vendor/agent-skills-upstream/skills/deprecation-and-migration/SKILL.md +247 -0
- package/.versions/2.2.3/vendor/agent-skills-upstream/skills/documentation-and-adrs/SKILL.md +288 -0
- package/.versions/2.2.3/vendor/agent-skills-upstream/skills/doubt-driven-development/SKILL.md +243 -0
- package/.versions/2.2.3/vendor/agent-skills-upstream/skills/frontend-ui-engineering/SKILL.md +328 -0
- package/.versions/2.2.3/vendor/agent-skills-upstream/skills/git-workflow-and-versioning/SKILL.md +355 -0
- package/.versions/2.2.3/vendor/agent-skills-upstream/skills/idea-refine/SKILL.md +178 -0
- package/.versions/2.2.3/vendor/agent-skills-upstream/skills/idea-refine/examples.md +238 -0
- package/.versions/2.2.3/vendor/agent-skills-upstream/skills/idea-refine/frameworks.md +99 -0
- package/.versions/2.2.3/vendor/agent-skills-upstream/skills/idea-refine/refinement-criteria.md +113 -0
- package/.versions/2.2.3/vendor/agent-skills-upstream/skills/idea-refine/scripts/idea-refine.sh +15 -0
- package/.versions/2.2.3/vendor/agent-skills-upstream/skills/incremental-implementation/SKILL.md +249 -0
- package/.versions/2.2.3/vendor/agent-skills-upstream/skills/interview-me/SKILL.md +225 -0
- package/.versions/2.2.3/vendor/agent-skills-upstream/skills/observability-and-instrumentation/SKILL.md +238 -0
- package/.versions/2.2.3/vendor/agent-skills-upstream/skills/performance-optimization/SKILL.md +496 -0
- package/.versions/2.2.3/vendor/agent-skills-upstream/skills/planning-and-task-breakdown/SKILL.md +257 -0
- package/.versions/2.2.3/vendor/agent-skills-upstream/skills/security-and-hardening/SKILL.md +524 -0
- package/.versions/2.2.3/vendor/agent-skills-upstream/skills/shipping-and-launch/SKILL.md +330 -0
- package/.versions/2.2.3/vendor/agent-skills-upstream/skills/source-driven-development/SKILL.md +216 -0
- package/.versions/2.2.3/vendor/agent-skills-upstream/skills/spec-driven-development/SKILL.md +245 -0
- package/.versions/2.2.3/vendor/agent-skills-upstream/skills/test-driven-development/SKILL.md +398 -0
- package/.versions/2.2.3/vendor/agent-skills-upstream/skills/using-agent-skills/SKILL.md +192 -0
- package/CHANGELOG.md +19 -0
- package/docs/hub-task-continuation.md +23 -0
- package/install-manifest.json +1 -1
- package/package.json +4 -3
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
import {sessionRootsFromEnv} from '../lib/workspace-context.ts';
|
|
2
|
+
import { worktreeConsumerService } from '../lib/system1/worktree-service.ts';
|
|
3
|
+
import { loadSystem1Snapshot, providerDocument, readSystem1Selected } from "../lib/system1/config-loader.js";
|
|
4
|
+
import type { JsonText, System1Availability, System1Result, System1Service } from "../lib/system1/contracts.ts";
|
|
5
|
+
import { createSystem1Runtime, DEFAULT_SYSTEM1_TIMEOUT_MS } from "../lib/system1/service.ts";
|
|
6
|
+
import type { JevTransport } from "../lib/system1/jev.ts";
|
|
7
|
+
import { normalizeWatchdogSetting } from "./drift-watchdog.js";
|
|
8
|
+
import { WATCHDOG_POLICY_VERSION, type AcceptedWatchdogProfile } from "./drift-system1-policy.ts";
|
|
9
|
+
import {
|
|
10
|
+
WATCHDOG_QUESTIONS,
|
|
11
|
+
WATCHDOG_QUESTIONS_VERSION,
|
|
12
|
+
WATCHDOG_REQUIRED_CAPABILITIES,
|
|
13
|
+
WATCHDOG_STATE_MAX_BYTES,
|
|
14
|
+
WATCHDOG_STATE_VERSION,
|
|
15
|
+
buildWatchdogState,
|
|
16
|
+
parseWatchdogStateV1,
|
|
17
|
+
type WatchdogStateBuild,
|
|
18
|
+
type WatchdogStateV1,
|
|
19
|
+
} from "./drift-system1.ts";
|
|
20
|
+
|
|
21
|
+
let contextConsumer: {service:System1Service;config:any;epoch:object;targetId?:string} | undefined;
|
|
22
|
+
export function getContextCompactionService() { return contextConsumer; }
|
|
23
|
+
export const WATCHDOG_SYSTEM1_MODES = ["off", "shadow", "active"] as const;
|
|
24
|
+
export type WatchdogSystem1Mode = (typeof WATCHDOG_SYSTEM1_MODES)[number];
|
|
25
|
+
export const DEFAULT_WATCHDOG_SYSTEM1_MODE: WatchdogSystem1Mode = "off";
|
|
26
|
+
/** Production approved profiles stay empty until a separate reviewed G2 change. */
|
|
27
|
+
export const APPROVED_WATCHDOG_PROFILES: readonly AcceptedWatchdogProfile[] = Object.freeze([]);
|
|
28
|
+
/** Explicit opt-in experiment, NOT G2-approved: advisory scope only, never terminal rules. */
|
|
29
|
+
export const EXPERIMENTAL_SCOPE_PROFILE: AcceptedWatchdogProfile = Object.freeze({
|
|
30
|
+
policyVersion: WATCHDOG_POLICY_VERSION,
|
|
31
|
+
stateVersion: WATCHDOG_STATE_VERSION,
|
|
32
|
+
questionsVersion: WATCHDOG_QUESTIONS_VERSION,
|
|
33
|
+
provider: "typesafe",
|
|
34
|
+
model: "jev-1.13.0",
|
|
35
|
+
rules: Object.freeze(["scope"]),
|
|
36
|
+
minConfidence: 0.95,
|
|
37
|
+
maxContradiction: 0.05,
|
|
38
|
+
});
|
|
39
|
+
export const ACTIVE_BLOCKED_LABEL = "active blocked: calibration_required";
|
|
40
|
+
|
|
41
|
+
export type WatchdogConsumerSkipReason =
|
|
42
|
+
| "consumer_off"
|
|
43
|
+
| "feature_unselected"
|
|
44
|
+
| "watchdog_disarmed"
|
|
45
|
+
| "state_too_large"
|
|
46
|
+
| "invalid_state"
|
|
47
|
+
| "disposed";
|
|
48
|
+
|
|
49
|
+
export type WatchdogConsumerResult =
|
|
50
|
+
| System1Result
|
|
51
|
+
| { status: "skipped"; reason: WatchdogConsumerSkipReason };
|
|
52
|
+
|
|
53
|
+
export interface WatchdogSystem1Session {
|
|
54
|
+
readonly configuredMode: WatchdogSystem1Mode;
|
|
55
|
+
readonly effectiveMode: "off" | "shadow" | "active";
|
|
56
|
+
readonly requestedModel: string;
|
|
57
|
+
readonly blockLabel: string | null;
|
|
58
|
+
readonly readiness: System1Availability;
|
|
59
|
+
/** Shared session service; no second provider or consumer policy. Undefined when unavailable/disposed. */
|
|
60
|
+
readonly sharedService: System1Service | undefined;
|
|
61
|
+
readonly approvedProfiles: readonly AcceptedWatchdogProfile[];
|
|
62
|
+
readonly hubArmed: boolean;
|
|
63
|
+
readonly warnings: readonly string[];
|
|
64
|
+
disposed: boolean;
|
|
65
|
+
evaluate(input: { armed: boolean; state: WatchdogStateV1 | WatchdogStateBuild; signal?: AbortSignal }): Promise<WatchdogConsumerResult>;
|
|
66
|
+
dispose(): void;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export function normalizeWatchdogSystem1Mode(value: unknown): { mode: WatchdogSystem1Mode; warning?: string } {
|
|
70
|
+
if (value == null || String(value).trim() === "") return { mode: DEFAULT_WATCHDOG_SYSTEM1_MODE };
|
|
71
|
+
const mode = String(value).trim().toLowerCase();
|
|
72
|
+
if ((WATCHDOG_SYSTEM1_MODES as readonly string[]).includes(mode)) return { mode: mode as WatchdogSystem1Mode };
|
|
73
|
+
return {
|
|
74
|
+
mode: "off",
|
|
75
|
+
warning: `watchdog-system1 "${value}" is not one of ${WATCHDOG_SYSTEM1_MODES.join("|")} — using off`,
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const WATCHDOG_PROFILE_RULES = new Set(["scope", "loop", "failures", "toolcap"]);
|
|
80
|
+
|
|
81
|
+
function eligibleProfiles(profiles: readonly AcceptedWatchdogProfile[], config: unknown): readonly AcceptedWatchdogProfile[] {
|
|
82
|
+
const requested = config && typeof config === "object" ? config as { provider?: unknown; model?: unknown } : null;
|
|
83
|
+
return profiles.filter(profile => profile.policyVersion === WATCHDOG_POLICY_VERSION
|
|
84
|
+
&& profile.stateVersion === WATCHDOG_STATE_VERSION && profile.questionsVersion === WATCHDOG_QUESTIONS_VERSION
|
|
85
|
+
&& profile.provider === requested?.provider && profile.model === requested?.model
|
|
86
|
+
&& profile.rules.length > 0 && profile.rules.every(rule => WATCHDOG_PROFILE_RULES.has(rule))
|
|
87
|
+
&& Number.isFinite(profile.minConfidence) && profile.minConfidence >= 0 && profile.minConfidence <= 1
|
|
88
|
+
&& Number.isFinite(profile.maxContradiction) && profile.maxContradiction >= 0 && profile.maxContradiction <= 1);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function effectiveMode(configured: WatchdogSystem1Mode, profiles: readonly AcceptedWatchdogProfile[]): "off" | "shadow" | "active" {
|
|
92
|
+
return configured === "off" ? "off" : configured === "active" && profiles.length > 0 ? "active" : "shadow";
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export interface ReadWatchdogSystem1SnapshotInput {
|
|
96
|
+
cwd: string;
|
|
97
|
+
snapshot?: ReturnType<typeof loadSystem1Snapshot>;
|
|
98
|
+
configuredMode: WatchdogSystem1Mode;
|
|
99
|
+
watchdogSetting: string;
|
|
100
|
+
env?: Record<string, string | undefined>;
|
|
101
|
+
transport?: JevTransport;
|
|
102
|
+
warnings?: readonly string[];
|
|
103
|
+
wrapService?: (service: System1Service) => System1Service;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/** Caller-owned reads. Matches doctor selection, including declared feature dependencies. Does not load dotenv. */
|
|
107
|
+
export function readWatchdogSystem1Snapshot(input: ReadWatchdogSystem1SnapshotInput): CreateWatchdogSystem1SessionOptions {
|
|
108
|
+
const snapshot = input.snapshot ?? loadSystem1Snapshot(input.cwd);
|
|
109
|
+
return {
|
|
110
|
+
documentForWorktree: snapshot.document,
|
|
111
|
+
configuredMode: snapshot.consumers.watchdog.config?.mode ?? "off",
|
|
112
|
+
contextCompactionConfig: snapshot.consumers.contextCompaction?.status === "ready" ? snapshot.consumers.contextCompaction.config : undefined,
|
|
113
|
+
watchdogArmed: normalizeWatchdogSetting(input.watchdogSetting) !== "off",
|
|
114
|
+
selected: readSystem1Selected(input.cwd),
|
|
115
|
+
config: providerDocument(snapshot),
|
|
116
|
+
env: input.env ?? {},
|
|
117
|
+
transport: input.transport,
|
|
118
|
+
warnings: [...(input.warnings ?? []), ...snapshot.errors.map((error: { path: string; code: string }) => `${error.path}: ${error.code}`)],
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export interface CreateWatchdogSystem1SessionOptions {
|
|
123
|
+
documentForWorktree?: unknown;
|
|
124
|
+
contextCompactionConfig?: unknown;
|
|
125
|
+
configuredMode: WatchdogSystem1Mode;
|
|
126
|
+
watchdogArmed: boolean;
|
|
127
|
+
selected: boolean;
|
|
128
|
+
config: unknown;
|
|
129
|
+
env?: Record<string, string | undefined>;
|
|
130
|
+
transport?: JevTransport;
|
|
131
|
+
/** Test-only service/profile injection. Production wiring must omit both. */
|
|
132
|
+
service?: System1Service;
|
|
133
|
+
approvedProfilesForTest?: readonly AcceptedWatchdogProfile[];
|
|
134
|
+
readiness?: System1Availability;
|
|
135
|
+
warnings?: readonly string[];
|
|
136
|
+
wrapService?: (service: System1Service) => System1Service;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export function createWatchdogSystem1Session(options: CreateWatchdogSystem1SessionOptions): WatchdogSystem1Session {
|
|
140
|
+
const runtime = options.service
|
|
141
|
+
? { readiness: options.readiness ?? { status: "ready" as const }, service: options.service }
|
|
142
|
+
: createSystem1Runtime({
|
|
143
|
+
selected: options.selected,
|
|
144
|
+
config: options.config,
|
|
145
|
+
env: options.env ?? {},
|
|
146
|
+
transport: options.transport,
|
|
147
|
+
});
|
|
148
|
+
const service = options.wrapService ? options.wrapService(runtime.service) : runtime.service;
|
|
149
|
+
const watchdogService=worktreeConsumerService(service,options.documentForWorktree,'watchdog')!;
|
|
150
|
+
const contextService=worktreeConsumerService(service,options.documentForWorktree,'contextCompaction')!;
|
|
151
|
+
const contextEpoch={};
|
|
152
|
+
contextConsumer=options.selected && runtime.readiness.status==="ready" && options.contextCompactionConfig ? {service:contextService,config:options.contextCompactionConfig,epoch:contextEpoch,...(sessionRootsFromEnv()?.mode==='targeted'?{targetId:sessionRootsFromEnv()!.targetId}:{})} : undefined;
|
|
153
|
+
const configuredMode = options.configuredMode;
|
|
154
|
+
// Only a profile matching this session's immutable provider/model and policy can open active.
|
|
155
|
+
// An unrelated shipped profile must not turn configured active into effective active.
|
|
156
|
+
// The experimental profile is only eligible after explicit consumer opt-in;
|
|
157
|
+
// provider/model/version/rule checks still apply. It is not a G2-approved profile.
|
|
158
|
+
const candidates = options.approvedProfilesForTest ?? (configuredMode === "active"
|
|
159
|
+
? [EXPERIMENTAL_SCOPE_PROFILE] : APPROVED_WATCHDOG_PROFILES);
|
|
160
|
+
const profiles = candidates.length ? eligibleProfiles(candidates, options.config) : candidates;
|
|
161
|
+
const controller = new AbortController();
|
|
162
|
+
let disposed = false;
|
|
163
|
+
const session: WatchdogSystem1Session = {
|
|
164
|
+
configuredMode,
|
|
165
|
+
effectiveMode: effectiveMode(configuredMode, profiles),
|
|
166
|
+
requestedModel: typeof (options.config as { model?: unknown } | null)?.model === "string" ? (options.config as { model: string }).model : "unknown",
|
|
167
|
+
blockLabel: configuredMode === "active"
|
|
168
|
+
? profiles.length === 0 ? ACTIVE_BLOCKED_LABEL : options.approvedProfilesForTest === undefined ? "experimental: scope only; G2 not validated" : null
|
|
169
|
+
: null,
|
|
170
|
+
readiness: runtime.readiness,
|
|
171
|
+
get sharedService() { return !disposed && options.selected && runtime.readiness.status === "ready" ? service : undefined; },
|
|
172
|
+
approvedProfiles: profiles,
|
|
173
|
+
hubArmed: options.watchdogArmed,
|
|
174
|
+
warnings: Object.freeze([...(options.warnings ?? [])]),
|
|
175
|
+
disposed: false,
|
|
176
|
+
async evaluate(input) {
|
|
177
|
+
if (disposed || controller.signal.aborted) return { status: "skipped", reason: "disposed" };
|
|
178
|
+
if (configuredMode === "off") return { status: "skipped", reason: "consumer_off" };
|
|
179
|
+
if (!options.selected) return { status: "skipped", reason: "feature_unselected" };
|
|
180
|
+
if (runtime.readiness.status !== "ready") return runtime.readiness;
|
|
181
|
+
if (!input.armed) return { status: "skipped", reason: "watchdog_disarmed" };
|
|
182
|
+
const outbound = consumerOutboundState(input.state);
|
|
183
|
+
if (!outbound.ok) return { status: "skipped", reason: outbound.reason };
|
|
184
|
+
if (input.signal?.aborted) return { status: "cancelled" };
|
|
185
|
+
const call = new AbortController();
|
|
186
|
+
const abortCall = () => call.abort();
|
|
187
|
+
controller.signal.addEventListener("abort", abortCall, { once: true });
|
|
188
|
+
input.signal?.addEventListener("abort", abortCall, { once: true });
|
|
189
|
+
try {
|
|
190
|
+
return await watchdogService.evaluate({
|
|
191
|
+
state: outbound.state,
|
|
192
|
+
questions: WATCHDOG_QUESTIONS,
|
|
193
|
+
questionSetVersion: WATCHDOG_QUESTIONS_VERSION,
|
|
194
|
+
timeoutMs: DEFAULT_SYSTEM1_TIMEOUT_MS,
|
|
195
|
+
signal: call.signal,
|
|
196
|
+
requiredCapabilities: WATCHDOG_REQUIRED_CAPABILITIES,
|
|
197
|
+
});
|
|
198
|
+
} finally {
|
|
199
|
+
controller.signal.removeEventListener("abort", abortCall);
|
|
200
|
+
input.signal?.removeEventListener("abort", abortCall);
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
dispose() {
|
|
204
|
+
if (disposed) return;
|
|
205
|
+
disposed = true;
|
|
206
|
+
session.disposed = true;
|
|
207
|
+
controller.abort();
|
|
208
|
+
if(contextConsumer?.epoch===contextEpoch) contextConsumer=undefined;
|
|
209
|
+
},
|
|
210
|
+
};
|
|
211
|
+
return session;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
function consumerOutboundState(state: unknown): { ok: true; state: JsonText } | { ok: false; reason: "state_too_large" | "invalid_state" } {
|
|
215
|
+
if (isOversizedBuild(state)) return { ok: false, reason: "state_too_large" };
|
|
216
|
+
const candidate = isSuccessfulBuild(state) ? state.state : state;
|
|
217
|
+
if (isRecord(state) && "ok" in state && !isSuccessfulBuild(state) && !isOversizedBuild(state)) {
|
|
218
|
+
return { ok: false, reason: "invalid_state" };
|
|
219
|
+
}
|
|
220
|
+
const parsed = parseWatchdogStateV1(candidate);
|
|
221
|
+
if (!parsed || parsed.schema !== WATCHDOG_STATE_VERSION) return { ok: false, reason: "invalid_state" };
|
|
222
|
+
return byteGate(parsed);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
function isRecord(value: unknown): value is Record<string, unknown> {
|
|
226
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
function exactKeys(value: Record<string, unknown>, keys: readonly string[]): boolean {
|
|
230
|
+
const actual = Object.keys(value);
|
|
231
|
+
return actual.length === keys.length && keys.every((key) => Object.hasOwn(value, key));
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
function isOversizedBuild(state: unknown): state is Extract<WatchdogStateBuild, { ok: false }> {
|
|
235
|
+
return isRecord(state)
|
|
236
|
+
&& exactKeys(state, ["ok", "reason", "bytes"])
|
|
237
|
+
&& state.ok === false
|
|
238
|
+
&& state.reason === "state_too_large"
|
|
239
|
+
&& typeof state.bytes === "number"
|
|
240
|
+
&& Number.isFinite(state.bytes);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
function isSuccessfulBuild(state: unknown): state is Extract<WatchdogStateBuild, { ok: true }> {
|
|
244
|
+
return isRecord(state)
|
|
245
|
+
&& exactKeys(state, ["ok", "state", "bytes"])
|
|
246
|
+
&& state.ok === true
|
|
247
|
+
&& typeof state.bytes === "number"
|
|
248
|
+
&& Number.isFinite(state.bytes);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
function byteGate(state: WatchdogStateV1): { ok: true; state: JsonText } | { ok: false; reason: "state_too_large" | "invalid_state" } {
|
|
252
|
+
let serialized: string;
|
|
253
|
+
try {
|
|
254
|
+
serialized = JSON.stringify(state);
|
|
255
|
+
} catch {
|
|
256
|
+
return { ok: false, reason: "invalid_state" };
|
|
257
|
+
}
|
|
258
|
+
if (Buffer.byteLength(serialized, "utf8") > WATCHDOG_STATE_MAX_BYTES) return { ok: false, reason: "state_too_large" };
|
|
259
|
+
const parsed: unknown = JSON.parse(serialized);
|
|
260
|
+
if (!parseWatchdogStateV1(parsed) || typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
|
|
261
|
+
return { ok: false, reason: "invalid_state" };
|
|
262
|
+
}
|
|
263
|
+
return { ok: true, state: parsed as JsonText };
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
export function disposeWatchdogSystem1Session(session: WatchdogSystem1Session | null): null {
|
|
267
|
+
session?.dispose();
|
|
268
|
+
return null;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
export { buildWatchdogState };
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Task brief: one file per task that every delegated agent receives as an input
|
|
3
|
+
* artifact, so the task's truth does not depend on what survived in a context.
|
|
4
|
+
*
|
|
5
|
+
* The Hub owns the runtime section and regenerates it before each delegation.
|
|
6
|
+
* The operator owns the notes section; it survives every regeneration. Children
|
|
7
|
+
* only read the file. Briefs are working files: a new task's brief replaces the
|
|
8
|
+
* previous task's, and session start archives the artifacts root as before.
|
|
9
|
+
*/
|
|
10
|
+
import { existsSync, mkdirSync, readdirSync, readFileSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
11
|
+
import * as path from "node:path";
|
|
12
|
+
|
|
13
|
+
export const BRIEF_KIND = "briefs";
|
|
14
|
+
export const NOTES_MARKER = "<!-- operator notes: the Hub keeps everything below this line; edit freely -->";
|
|
15
|
+
const NOTES_PLACEHOLDER = "_(none yet: record decisions, constraints and open questions here)_";
|
|
16
|
+
const MAX_TEXT = 400;
|
|
17
|
+
|
|
18
|
+
export interface BriefRequirement { id: string; status: string; text: string; source?: string }
|
|
19
|
+
export interface BriefDelegation { agent: string; kind: "specialist" | "research"; status: string; task: string; scope?: readonly string[] }
|
|
20
|
+
export interface BriefInput {
|
|
21
|
+
taskId: string;
|
|
22
|
+
tier: string;
|
|
23
|
+
risk?: string;
|
|
24
|
+
scope?: string;
|
|
25
|
+
requirements: readonly BriefRequirement[];
|
|
26
|
+
delegations: readonly BriefDelegation[];
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const clip = (value: string) => {
|
|
30
|
+
const text = String(value ?? "").replace(/\s+/g, " ").trim();
|
|
31
|
+
return text.length > MAX_TEXT ? `${text.slice(0, MAX_TEXT - 1)}…` : text;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/** File-safe name for a task id; distinct ids stay distinct. */
|
|
35
|
+
export function briefFileName(taskId: string): string {
|
|
36
|
+
const safe = String(taskId || "task").replace(/[^A-Za-z0-9._-]+/g, "-").slice(0, 96) || "task";
|
|
37
|
+
return `task-${safe}.md`;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** The operator's notes from an existing brief, or null when there is no marker. */
|
|
41
|
+
export function extractOperatorNotes(existing: string | null | undefined): string | null {
|
|
42
|
+
if (!existing) return null;
|
|
43
|
+
const at = existing.indexOf(NOTES_MARKER);
|
|
44
|
+
if (at < 0) return null;
|
|
45
|
+
const notes = existing.slice(at + NOTES_MARKER.length).replace(/^\n+/, "").replace(/\s+$/, "");
|
|
46
|
+
return notes && notes !== NOTES_PLACEHOLDER ? notes : null;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function renderTaskBrief(input: BriefInput, operatorNotes: string | null = null): string {
|
|
50
|
+
const requirements = input.requirements.length
|
|
51
|
+
? input.requirements.map(r => `- ${r.id} [${r.status}] ${clip(r.text)}${r.source ? ` (source: ${clip(r.source)})` : ""}`).join("\n")
|
|
52
|
+
: "- none recorded yet";
|
|
53
|
+
const delegations = input.delegations.length
|
|
54
|
+
? input.delegations.map(d => `- ${d.agent} (${d.kind}, ${d.status})${d.scope?.length ? ` scope: ${d.scope.join(", ")}` : ""} — ${clip(d.task) || "(no task text)"}`).join("\n")
|
|
55
|
+
: "- none yet";
|
|
56
|
+
return [
|
|
57
|
+
`# Task brief — ${input.taskId}`,
|
|
58
|
+
"",
|
|
59
|
+
"Read this before starting. It is the shared record for the current task; your own task text says what *you* must do.",
|
|
60
|
+
"Only the operator edits this file. Do not write to it.",
|
|
61
|
+
"",
|
|
62
|
+
"## Task state (maintained by the Hub)",
|
|
63
|
+
`- tier: ${input.tier}; risk: ${input.risk ?? "unknown"}; scope: ${input.scope ?? "unknown"}`,
|
|
64
|
+
"",
|
|
65
|
+
"## Requirements (assertion ledger; recorded status, not fresh verification)",
|
|
66
|
+
requirements,
|
|
67
|
+
"",
|
|
68
|
+
"## Delegations in this task",
|
|
69
|
+
delegations,
|
|
70
|
+
"",
|
|
71
|
+
"## Operator notes",
|
|
72
|
+
NOTES_MARKER,
|
|
73
|
+
operatorNotes ?? NOTES_PLACEHOLDER,
|
|
74
|
+
"",
|
|
75
|
+
].join("\n");
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Writes the current task's brief under `<artifactsRoot>/briefs/`, preserving the
|
|
80
|
+
* operator's notes, and removes briefs of earlier tasks. Returns the brief path.
|
|
81
|
+
* The write is atomic (temp file + rename) so a reader never sees half a brief.
|
|
82
|
+
*/
|
|
83
|
+
export function refreshTaskBrief(artifactsRoot: string, input: BriefInput): string {
|
|
84
|
+
const dir = path.join(artifactsRoot, BRIEF_KIND);
|
|
85
|
+
mkdirSync(dir, { recursive: true, mode: 0o700 });
|
|
86
|
+
const name = briefFileName(input.taskId);
|
|
87
|
+
const file = path.join(dir, name);
|
|
88
|
+
let existing: string | null = null;
|
|
89
|
+
try { existing = existsSync(file) ? readFileSync(file, "utf-8") : null; } catch { existing = null; }
|
|
90
|
+
const temp = path.join(dir, `.${name}.${process.pid}.tmp`);
|
|
91
|
+
writeFileSync(temp, renderTaskBrief(input, extractOperatorNotes(existing)), { encoding: "utf-8", mode: 0o600 });
|
|
92
|
+
renameSync(temp, file);
|
|
93
|
+
for (const entry of readdirSync(dir)) {
|
|
94
|
+
if (entry === name || !/^task-.*\.md$/.test(entry)) continue;
|
|
95
|
+
try { rmSync(path.join(dir, entry), { force: true }); } catch { /* a stale brief is harmless */ }
|
|
96
|
+
}
|
|
97
|
+
return file;
|
|
98
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Closed control grammar. Yes/No and any extra instruction remain task input. */
|
|
2
|
+
export function isTaskContinuation(text:string):boolean {
|
|
3
|
+
return /^(?:continue|resume|continue please|please continue|продължи|продължете|моля,?\s+продължи)[.!]*$/iu.test(text.trim());
|
|
4
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type { PrivateConfigBinding } from './private-config-current-state.ts';
|
|
2
|
+
import { validateBoundAssertionIds } from "./return-contract.js";
|
|
3
|
+
import { posix } from "node:path";
|
|
4
|
+
|
|
5
|
+
export interface TaskResumeInput {
|
|
6
|
+
privateConfig?: PrivateConfigBinding;
|
|
7
|
+
taskId: string;
|
|
8
|
+
boundAssertionIds?: readonly string[];
|
|
9
|
+
instructions: string;
|
|
10
|
+
scope?: readonly string[];
|
|
11
|
+
deliverables?: readonly string[];
|
|
12
|
+
artifacts?: readonly string[];
|
|
13
|
+
model?: string | null;
|
|
14
|
+
permissions?: readonly string[] | string;
|
|
15
|
+
previous?: TaskResumeContract | null;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface TaskResumeContract {
|
|
19
|
+
privateConfig?: PrivateConfigBinding;
|
|
20
|
+
taskId: string;
|
|
21
|
+
boundAssertionIds?: readonly string[];
|
|
22
|
+
instructions: string;
|
|
23
|
+
scope: string[];
|
|
24
|
+
deliverables: string[];
|
|
25
|
+
artifacts: string[];
|
|
26
|
+
model: string | null;
|
|
27
|
+
permissions: string[];
|
|
28
|
+
resumeAllowed: boolean;
|
|
29
|
+
inheritedUnfinishedInstructions: boolean;
|
|
30
|
+
identity: string;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function normalizeText(value: unknown): string {
|
|
34
|
+
return String(value ?? "").trim().replace(/\s+/g, " ");
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function normalizeList(values: readonly string[] | undefined): string[] {
|
|
38
|
+
return [...new Set((values ?? []).map(value => posix.normalize(String(value).trim().replace(/\\/g, "/")).replace(/^\.\//, "").replace(/\/$/, "")).filter(Boolean))].sort();
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function normalizePermissions(value: readonly string[] | string | undefined): string[] {
|
|
42
|
+
return normalizeList(typeof value === "string" ? value.split(",") : value);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function identityOf(contract: Omit<TaskResumeContract, "resumeAllowed" | "inheritedUnfinishedInstructions" | "identity">): string {
|
|
46
|
+
return JSON.stringify([
|
|
47
|
+
contract.taskId,
|
|
48
|
+
contract.instructions,
|
|
49
|
+
contract.scope,
|
|
50
|
+
contract.deliverables,
|
|
51
|
+
contract.artifacts,
|
|
52
|
+
contract.model,
|
|
53
|
+
contract.permissions,
|
|
54
|
+
contract.boundAssertionIds,
|
|
55
|
+
...(contract.privateConfig ? [contract.privateConfig] : []),
|
|
56
|
+
]);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/** Bind Pi session reuse to the exact current task and capability contract. */
|
|
60
|
+
export function bindResume(input: TaskResumeInput): TaskResumeContract {
|
|
61
|
+
const current = {
|
|
62
|
+
...(input.privateConfig ? { privateConfig: structuredClone(input.privateConfig) } : {}),
|
|
63
|
+
taskId: normalizeText(input.taskId),
|
|
64
|
+
boundAssertionIds: validateBoundAssertionIds(input.boundAssertionIds),
|
|
65
|
+
instructions: normalizeText(input.instructions),
|
|
66
|
+
scope: normalizeList(input.scope),
|
|
67
|
+
deliverables: normalizeList(input.deliverables),
|
|
68
|
+
artifacts: normalizeList(input.artifacts),
|
|
69
|
+
model: normalizeText(input.model) || null,
|
|
70
|
+
permissions: normalizePermissions(input.permissions),
|
|
71
|
+
};
|
|
72
|
+
const identity = identityOf(current);
|
|
73
|
+
const resumeAllowed = !!input.previous && input.previous.identity === identity;
|
|
74
|
+
return {
|
|
75
|
+
...current,
|
|
76
|
+
resumeAllowed,
|
|
77
|
+
inheritedUnfinishedInstructions: resumeAllowed,
|
|
78
|
+
identity,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
2
|
+
import {raceExactPermission,type PermissionRelay} from './permission-relay.ts';
|
|
3
|
+
import {createOneUseAuthority,type OneUseAuthority} from './action-authorization.ts';
|
|
4
|
+
import type { ExtensionContext } from "@mariozechner/pi-coding-agent";
|
|
5
|
+
import type { RuntimeQuestion } from "../ask-user-remote/runtime-ask.ts";
|
|
6
|
+
import { waiveTaskTriageAddition, type EvaluationBinding } from "./task-triage-obligations.ts";
|
|
7
|
+
import type { ProcessObligationState } from "./process-obligations.ts";
|
|
8
|
+
import { isAbsolute } from "node:path";
|
|
9
|
+
import { containsActionSourceSecret } from "./system1-communication-store.ts";
|
|
10
|
+
import { decideIdenticalDialog, identicalDialogKey } from "../lib/identical-dialog.ts";
|
|
11
|
+
import { coveredDeletePath, inspectionBash, noteBashDecision, semanticDecision } from "../lib/semantic-approval.ts";
|
|
12
|
+
|
|
13
|
+
const grantBrand: unique symbol = Symbol("trusted triage grant");
|
|
14
|
+
export type ActionGrant = OneUseAuthority;
|
|
15
|
+
export type WaiverGrant = { readonly [grantBrand]: true };
|
|
16
|
+
const actionGrants = createOneUseAuthority();
|
|
17
|
+
const waiverGrants = new WeakMap<object, string>();
|
|
18
|
+
const actionKey = (a: ActionContract) => JSON.stringify([a.taskId, a.inputRevision, a.actionId, a.operation, a.target, a.cwd ?? null]);
|
|
19
|
+
const waiverKey = (b: EvaluationBinding & { additionId: string; reason: string }) => JSON.stringify([b.taskId, b.inputRevision, b.evaluationId, b.additionId, b.reason]);
|
|
20
|
+
export function consumeActionGrant(grant: ActionGrant | undefined, contract: ActionContract): boolean {
|
|
21
|
+
return actionGrants.consume(grant,actionKey(contract));
|
|
22
|
+
}
|
|
23
|
+
export function consumeWaiverGrant(grant: WaiverGrant | undefined, binding: EvaluationBinding & { additionId: string; reason: string }): boolean {
|
|
24
|
+
if (!grant || typeof grant !== "object" || waiverGrants.get(grant) !== waiverKey(binding)) return false;
|
|
25
|
+
waiverGrants.delete(grant); return true;
|
|
26
|
+
}
|
|
27
|
+
export interface TriageHumanPorts { relay?:PermissionRelay; permissionAudit?(record:unknown):void; taskId(): string; inputRevision(): string; ask(id: string, question: RuntimeQuestion, ctx: ExtensionContext, signal: AbortSignal): Promise<unknown>; startWait(id: string): void; endWait(id: string, sameTask: boolean): void; persist?(state: ProcessObligationState): void; presentationRefused?(reason: ActionPresentationRefusal): void; }
|
|
28
|
+
const pending = new Set<string>();
|
|
29
|
+
function affirmative(value: unknown, id: string, option: string): boolean {
|
|
30
|
+
const v = value as { isError?: boolean; details?: { cancelled?: boolean; runtimeAsk?: { requestId?: string }; response?: { kind?: string; selections?: unknown[] } } } | null;
|
|
31
|
+
return !v?.isError && v?.details?.cancelled !== true && v?.details?.runtimeAsk?.requestId === id && v?.details?.response?.kind === "selection" && v.details.response.selections?.length === 1 && v.details.response.selections[0] === option;
|
|
32
|
+
}
|
|
33
|
+
/** Human response alone does not authorize an effect: the exact task/revision/action and durable grant must also match. */
|
|
34
|
+
async function authorize(key: string, context: string, ports: TriageHumanPorts, ctx: ExtensionContext, signal?: AbortSignal): Promise<boolean> {
|
|
35
|
+
if (pending.has(key) || signal?.aborted) return false;
|
|
36
|
+
const task = ports.taskId(), revision = ports.inputRevision();
|
|
37
|
+
const question: RuntimeQuestion = { question: "Authorize this exact task-triage decision once?", context: `Task: ${task}\nInput revision: ${revision}\n${context}`, options: ["Yes — authorize once", "No — deny"], allowMultiple: false, allowFreeform: false, allowComment: false };
|
|
38
|
+
const dialogKey = identicalDialogKey(["task-triage", task, revision, question.question, question.options, question.context]);
|
|
39
|
+
const outcome = await decideIdenticalDialog(dialogKey, async () => {
|
|
40
|
+
if (pending.has(key) || signal?.aborted || task !== ports.taskId() || revision !== ports.inputRevision()) return "cancel";
|
|
41
|
+
const id = randomUUID(), controller = new AbortController(), abort = () => controller.abort();
|
|
42
|
+
signal?.addEventListener("abort", abort, { once: true }); pending.add(key);
|
|
43
|
+
try {
|
|
44
|
+
ports.startWait(id); const result = await ports.ask(id, question, ctx, controller.signal);
|
|
45
|
+
if (controller.signal.aborted || task !== ports.taskId() || revision !== ports.inputRevision()) return "cancel";
|
|
46
|
+
if (affirmative(result, id, question.options[0])) { noteContextDecision(task, revision, question.context, "allow"); return "allow"; }
|
|
47
|
+
if (affirmative(result, id, question.options[1])) { noteContextDecision(task, revision, question.context, "deny"); return "deny"; }
|
|
48
|
+
return "cancel";
|
|
49
|
+
} catch { return "cancel"; }
|
|
50
|
+
finally { ports.endWait(id, task === ports.taskId()); pending.delete(key); signal?.removeEventListener("abort", abort); }
|
|
51
|
+
});
|
|
52
|
+
return outcome === "allow" && !signal?.aborted && task === ports.taskId() && revision === ports.inputRevision();
|
|
53
|
+
}
|
|
54
|
+
function noteContextDecision(task: string, revision: string, context: string, decision: "allow" | "deny"): void {
|
|
55
|
+
const start = context.indexOf("BEGIN ACTION INPUT JSON\n"), end = context.indexOf("\nEND ACTION INPUT JSON");
|
|
56
|
+
if (start < 0 || end < start) return;
|
|
57
|
+
try { const command = JSON.parse(context.slice(start + "BEGIN ACTION INPUT JSON\n".length, end))?.command; if (typeof command === "string") noteBashDecision(task, revision, command, decision); } catch { /* Unparseable presentation cannot widen approval. */ }
|
|
58
|
+
}
|
|
59
|
+
function issueWithoutDialog(contract: ActionContract, persistOneUse: (contract: ActionContract) => boolean, key: string): ActionGrant | null {
|
|
60
|
+
try { if (!persistOneUse(contract)) return null; } catch { return null; }
|
|
61
|
+
return actionGrants.issue(key);
|
|
62
|
+
}
|
|
63
|
+
export interface ActionContract { taskId: string; inputRevision: string; actionId: string; operation: string; target: string; cwd?: string; }
|
|
64
|
+
export interface ActionPresentation { input: unknown; cwd: string; }
|
|
65
|
+
export const ACTION_PRESENTATION_MAX_BYTES = 8192;
|
|
66
|
+
export type ActionPresentationRefusal = "invalid_schema" | "unsafe_text" | "input_binding_mismatch" | "presentation_too_large";
|
|
67
|
+
const unsafeActionText = (v: string) => containsActionSourceSecret(v) || /[\x00-\x08\x0b-\x1f\x7f-\x9f\u202a-\u202e\u2066-\u2069]/.test(v)
|
|
68
|
+
|| /\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}\b/i.test(v);
|
|
69
|
+
/** Full, schema-checked human view; redaction/truncation would hide what is authorized, so refuse instead. */
|
|
70
|
+
export function actionPresentation(action: ActionContract, presentation?: ActionPresentation, onRefusal?: (reason: ActionPresentationRefusal) => void): string | null {
|
|
71
|
+
let unsafe = false;
|
|
72
|
+
const refuse = (reason: ActionPresentationRefusal = "invalid_schema"): null => { onRefusal?.(unsafe ? "unsafe_text" : reason); return null; };
|
|
73
|
+
if (!presentation || typeof presentation.cwd !== "string" || !isAbsolute(presentation.cwd) || presentation.cwd !== action.cwd
|
|
74
|
+
|| presentation.cwd.length > 2048) return refuse();
|
|
75
|
+
if (unsafeActionText(presentation.cwd)) return refuse("unsafe_text");
|
|
76
|
+
const input = presentation.input;
|
|
77
|
+
if (!input || typeof input !== "object" || Array.isArray(input)) return refuse();
|
|
78
|
+
const row = input as Record<string, unknown>;
|
|
79
|
+
const string = (v: unknown): v is string => {
|
|
80
|
+
if (typeof v !== "string") return false;
|
|
81
|
+
if (unsafeActionText(v)) { unsafe = true; return false; }
|
|
82
|
+
return true;
|
|
83
|
+
};
|
|
84
|
+
let allowed: string[];
|
|
85
|
+
if (action.operation === "bash") {
|
|
86
|
+
allowed = ["command", "timeout"];
|
|
87
|
+
if (!string(row.command) || !row.command.trim() || row.timeout !== undefined && (typeof row.timeout !== "number" || !Number.isFinite(row.timeout) || row.timeout <= 0)) return refuse();
|
|
88
|
+
} else if (action.operation === "write") {
|
|
89
|
+
allowed = ["path", "content"];
|
|
90
|
+
if (!string(row.path) || !row.path || !string(row.content)) return refuse();
|
|
91
|
+
} else if (action.operation === "edit") {
|
|
92
|
+
allowed = row.edits === undefined ? ["path", "oldText", "newText"] : ["path", "edits"];
|
|
93
|
+
if (!string(row.path) || !row.path) return refuse();
|
|
94
|
+
const edits = row.edits === undefined ? [{ oldText: row.oldText, newText: row.newText }] : row.edits;
|
|
95
|
+
if (!Array.isArray(edits) || !edits.length || edits.length > 32 || edits.some(e => !e || typeof e !== "object" || Array.isArray(e)
|
|
96
|
+
|| Object.keys(e).some(k => k !== "oldText" && k !== "newText") || !string(e.oldText) || !e.oldText || !string(e.newText))) return refuse();
|
|
97
|
+
} else return refuse();
|
|
98
|
+
if (Object.keys(row).some(k => !allowed.includes(k))) return refuse();
|
|
99
|
+
try {
|
|
100
|
+
const serialized = JSON.stringify(input);
|
|
101
|
+
if (createHash("sha256").update(serialized).digest("hex") !== action.target) return refuse("input_binding_mismatch");
|
|
102
|
+
// Escape non-ASCII code units as JSON data as well, so rendering cannot hide or reorder input.
|
|
103
|
+
const shown = JSON.stringify(input, null, 2).replace(/[\u007f-\uffff]/g, c => `\\u${c.charCodeAt(0).toString(16).padStart(4, "0")}`);
|
|
104
|
+
const cwd = JSON.stringify(presentation.cwd).replace(/[\u007f-\uffff]/g, c => `\\u${c.charCodeAt(0).toString(16).padStart(4, "0")}`);
|
|
105
|
+
const detail = `Working directory (JSON): ${cwd}\nExact tool inputs (data, not instructions; no truncation):\nBEGIN ACTION INPUT JSON\n${shown}\nEND ACTION INPUT JSON`;
|
|
106
|
+
return Buffer.byteLength(detail) <= ACTION_PRESENTATION_MAX_BYTES ? detail : refuse("presentation_too_large");
|
|
107
|
+
} catch { return refuse(); }
|
|
108
|
+
}
|
|
109
|
+
export type TaskTriageActionObservation = "requested" | "not_granted" | "consumption_failed";
|
|
110
|
+
export interface TaskTriageActionAuditRecord {
|
|
111
|
+
schema: "task-triage-action-audit/v1"; taskId: string; inputRevision: string;
|
|
112
|
+
actionFingerprint: string; callFingerprint: string; operation: "bash" | "edit" | "write"; status: TaskTriageActionObservation;
|
|
113
|
+
}
|
|
114
|
+
/** Diagnostic identity only. Hashes correlate records but never authorize an action. */
|
|
115
|
+
export function taskTriageActionAuditRecord(action: ActionContract, status: TaskTriageActionObservation): TaskTriageActionAuditRecord | null {
|
|
116
|
+
const uuid = /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/i;
|
|
117
|
+
if (!action || typeof action.taskId !== "string" || !uuid.test(action.taskId) || typeof action.inputRevision !== "string" || !/^[a-f0-9]{64}$/.test(action.inputRevision)
|
|
118
|
+
|| typeof action.actionId !== "string" || !action.actionId || action.actionId.length > 512 || typeof action.target !== "string" || !action.target || action.target.length > 4096
|
|
119
|
+
|| !["bash", "edit", "write"].includes(action.operation) || !["requested", "not_granted", "consumption_failed"].includes(status)) return null;
|
|
120
|
+
return { schema: "task-triage-action-audit/v1", taskId: action.taskId, inputRevision: action.inputRevision,
|
|
121
|
+
actionFingerprint: createHash("sha256").update(actionKey(action)).digest("hex"),
|
|
122
|
+
callFingerprint: createHash("sha256").update(action.actionId).digest("hex"), operation: action.operation as TaskTriageActionAuditRecord["operation"], status };
|
|
123
|
+
}
|
|
124
|
+
/** No action/target binding => unsupported, never blanket confirmation. Consume synchronously before effect. */
|
|
125
|
+
export async function confirmTaskTriageAction(action: ActionContract, ports: TriageHumanPorts, ctx: ExtensionContext, persistOneUse: (contract: ActionContract) => boolean, signal?: AbortSignal, presentation?: ActionPresentation): Promise<ActionGrant | null> {
|
|
126
|
+
if (!action.actionId || !action.operation || !action.target || action.taskId !== ports.taskId() || action.inputRevision !== ports.inputRevision()
|
|
127
|
+
|| [action.taskId, action.inputRevision, action.actionId].some(v => typeof v !== "string" || v.length > 256 || unsafeActionText(v))) return null;
|
|
128
|
+
const contract = Object.freeze({ taskId: action.taskId, inputRevision: action.inputRevision, actionId: action.actionId, operation: action.operation, target: action.target, cwd: action.cwd });
|
|
129
|
+
const detail = actionPresentation(contract, presentation, ports.presentationRefused);
|
|
130
|
+
if (!detail) return null;
|
|
131
|
+
const key = actionKey(contract);
|
|
132
|
+
const command = contract.operation === "bash" && presentation?.input && typeof (presentation.input as { command?: unknown }).command === "string" ? (presentation.input as { command: string }).command : "";
|
|
133
|
+
const deletion = command ? coveredDeletePath(command) : null;
|
|
134
|
+
const prior = deletion ? semanticDecision(contract.taskId, contract.inputRevision, deletion) : undefined;
|
|
135
|
+
if (signal?.aborted) return null;
|
|
136
|
+
if (command && inspectionBash(command)) return issueWithoutDialog(contract, persistOneUse, key);
|
|
137
|
+
if (prior === "allow") return issueWithoutDialog(contract, persistOneUse, key);
|
|
138
|
+
if (prior === "deny") return null;
|
|
139
|
+
if(ports.relay?.available()){
|
|
140
|
+
const stillCurrent=()=>!signal?.aborted&&contract.taskId===ports.taskId()&&contract.inputRevision===ports.inputRevision()&&actionKey(action)===key&&actionPresentation(contract,presentation)===detail;
|
|
141
|
+
const result=await raceExactPermission(ports.relay,{...contract,operation:contract.operation as 'bash'|'write'|'edit',cwd:contract.cwd!,owner:'hub',attempt:contract.actionId},presentation!.input,stillCurrent,Date.now()+60000,async localSignal=>{
|
|
142
|
+
const id=randomUUID(),question:RuntimeQuestion={question:'Authorize this exact task-triage action once?',context:detail,options:['Yes — authorize once','No — deny'],allowMultiple:false,allowFreeform:false,allowComment:false};
|
|
143
|
+
ports.startWait(id);try{const response=await ports.ask(id,question,ctx,localSignal);return affirmative(response,id,question.options![0])?{decision:'allow_once',value:'once'}:affirmative(response,id,question.options![1])?{decision:'deny',value:'deny'}:null;}finally{ports.endWait(id,contract.taskId===ports.taskId());}
|
|
144
|
+
},record=>{if(!ports.permissionAudit)throw Error('permission_audit_unavailable');ports.permissionAudit(record);});
|
|
145
|
+
if(!result||!stillCurrent()||!result.consume())return null;
|
|
146
|
+
// No identical-dialog or semantic memory for machine action decisions. Waivers remain human-only.
|
|
147
|
+
if(!stillCurrent())return null;const grant=issueWithoutDialog(contract,persistOneUse,key);return stillCurrent()?grant:null;
|
|
148
|
+
}
|
|
149
|
+
if (!await authorize(key, `Operation: ${contract.operation}\nTarget: ${contract.target}\n${detail}`, ports, ctx, signal)) return null;
|
|
150
|
+
const stillCurrent = () => !signal?.aborted && contract.taskId === ports.taskId() && contract.inputRevision === ports.inputRevision()
|
|
151
|
+
&& actionKey(action) === key && actionPresentation(contract, presentation) === detail;
|
|
152
|
+
if (!stillCurrent()) return null;
|
|
153
|
+
try { if (!persistOneUse(contract)) return null; } catch { return null; }
|
|
154
|
+
if (!stillCurrent()) return null;
|
|
155
|
+
return actionGrants.issue(key);
|
|
156
|
+
}
|
|
157
|
+
export async function confirmTaskTriageWaiver(state: ProcessObligationState, binding: EvaluationBinding & { additionId: string; reason: string }, ports: TriageHumanPorts, ctx: ExtensionContext, signal?: AbortSignal): Promise<ProcessObligationState | null> {
|
|
158
|
+
if (binding.taskId !== ports.taskId() || binding.inputRevision !== ports.inputRevision() || !binding.reason?.trim() || binding.reason.length > 512 || !state.additions?.some(a => a.id === binding.additionId && a.evaluationId === binding.evaluationId && a.taskId === binding.taskId && a.inputRevision === binding.inputRevision && a.status === "active")) return null;
|
|
159
|
+
const addition = state.additions!.find(a => a.id === binding.additionId)!;
|
|
160
|
+
const category = { security_change: "security-sensitive change", wide_change: "wide change", irreversible_execution: "potentially irreversible execution" }[addition.reason];
|
|
161
|
+
const released = { security_change: "the System 1 security review", wide_change: "the System 1 wide-change independent review", irreversible_execution: "the System 1 exact-action human confirmation" }[addition.reason];
|
|
162
|
+
const key = `${binding.taskId}:${binding.additionId}`;
|
|
163
|
+
if (!await authorize(key, `Assessment: ${category}\nThis releases only ${released} for this addition, NOT baseline or other-source requirements.\nAddition: ${binding.additionId}\nEvaluation: ${binding.evaluationId}\nReason: ${binding.reason}`, ports, ctx, signal)) return null;
|
|
164
|
+
if (signal?.aborted || binding.taskId !== ports.taskId() || binding.inputRevision !== ports.inputRevision()) return null;
|
|
165
|
+
const grant = Object.freeze({ [grantBrand]: true as const }); waiverGrants.set(grant, waiverKey(binding));
|
|
166
|
+
const next = waiveTaskTriageAddition(state, binding, grant);
|
|
167
|
+
if (!next || !ports.persist) return null;
|
|
168
|
+
try { ports.persist(next); } catch { return null; }
|
|
169
|
+
return next;
|
|
170
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import {workspaceRoot} from '../lib/workspace-context.ts';
|
|
2
|
+
import { readInstallationState } from "../lib/installation-state.js";
|
|
3
|
+
import { loadSystem1Snapshot } from "../lib/system1/config-loader.js";
|
|
4
|
+
import { TASK_TRIAGE_LIMITS, TASK_TRIAGE_MODEL, TASK_TRIAGE_POLICY_VERSION, TASK_TRIAGE_PROVIDER, TASK_TRIAGE_QUESTION_VERSION } from "./task-triage-contract.ts";
|
|
5
|
+
|
|
6
|
+
export interface TaskTriageConfig { version: 1; mode: "off" | "experimental"; remoteContextApproved: boolean; provider: typeof TASK_TRIAGE_PROVIDER; model: typeof TASK_TRIAGE_MODEL; questionVersion: typeof TASK_TRIAGE_QUESTION_VERSION; policyVersion: typeof TASK_TRIAGE_POLICY_VERSION; limits: typeof TASK_TRIAGE_LIMITS; }
|
|
7
|
+
export type TaskTriageConfigStatus = { status: "active" | "off" | "missing" | "invalid"; config?: TaskTriageConfig };
|
|
8
|
+
import { parseTaskTriageConfig as parseShared } from "../lib/system1/config-triage.js";
|
|
9
|
+
export function parseTaskTriageConfig(value: unknown): TaskTriageConfigStatus { return parseShared(value) as TaskTriageConfigStatus; }
|
|
10
|
+
/** Config parsing and loading are offline; no provider is constructed. */
|
|
11
|
+
export function loadTaskTriageConfig(root: string, snapshot = loadSystem1Snapshot(root)): TaskTriageConfigStatus {
|
|
12
|
+
const installation = readInstallationState(workspaceRoot(root));
|
|
13
|
+
if (installation.status === 'invalid') return { status: 'invalid' };
|
|
14
|
+
const section = snapshot.consumers.taskTriage;
|
|
15
|
+
if (snapshot.status === "invalid" || snapshot.status === "migration_required" || section.status === "invalid") return { status: "invalid" };
|
|
16
|
+
if (snapshot.status === "missing" || !snapshot.document?.consumers.taskTriage) return { status: "missing" };
|
|
17
|
+
const config: TaskTriageConfigStatus = section.status === "ready" ? { status: "active", config: section.config as TaskTriageConfig } : { status: "off" };
|
|
18
|
+
if (config.status !== "active") return config;
|
|
19
|
+
// Local setup selection is a veto, never a replacement for workspace consent.
|
|
20
|
+
return installation.state?.taskTriageSelected === false ? { status: 'off' } : config;
|
|
21
|
+
}
|