@chankov/agent-fleet 2.0.19 → 2.0.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.pi/agent-fleet/scripts/coms-claude-bridge.ts +5 -5
- package/.pi/extensions/compact-and-continue/index.ts +18 -2
- package/.pi/harnesses/agent-hub/README.md +163 -130
- package/.pi/harnesses/agent-hub/access-approval.ts +15 -9
- package/.pi/harnesses/agent-hub/action-authorization.ts +10 -0
- package/.pi/harnesses/agent-hub/agentic-sources.ts +1 -1
- package/.pi/harnesses/agent-hub/approval-wait.ts +1 -0
- package/.pi/harnesses/agent-hub/assist-profile.ts +3 -0
- package/.pi/harnesses/agent-hub/budget-recovery.ts +4 -95
- package/.pi/harnesses/agent-hub/commands/context.ts +0 -1
- package/.pi/harnesses/agent-hub/config/model-profiles.ts +3 -2
- package/.pi/harnesses/agent-hub/config/overrides.ts +2 -2
- package/.pi/harnesses/agent-hub/context/budgets.ts +12 -66
- package/.pi/harnesses/agent-hub/context-compaction-monitor.ts +35 -0
- package/.pi/harnesses/agent-hub/context-compaction-preflight.ts +21 -0
- package/.pi/harnesses/agent-hub/context-compaction-runtime.ts +69 -0
- package/.pi/harnesses/agent-hub/context-compaction.ts +34 -0
- package/.pi/harnesses/agent-hub/context-continuity-broker.ts +42 -0
- package/.pi/harnesses/agent-hub/context-continuity-child.ts +83 -0
- package/.pi/harnesses/agent-hub/context-continuity-client.ts +19 -0
- package/.pi/harnesses/agent-hub/context-continuity-compat.ts +30 -0
- package/.pi/harnesses/agent-hub/context-continuity-owners.ts +15 -0
- package/.pi/harnesses/agent-hub/context-continuity-registry.ts +8 -0
- package/.pi/harnesses/agent-hub/context-continuity.ts +82 -0
- package/.pi/harnesses/agent-hub/context-pressure.ts +37 -6
- package/.pi/harnesses/agent-hub/damage-guard-approval.ts +59 -0
- package/.pi/harnesses/agent-hub/damage-guard-broker.ts +125 -0
- package/.pi/harnesses/agent-hub/damage-guard-contract.ts +22 -0
- package/.pi/harnesses/agent-hub/damage-guard-descendant.ts +76 -0
- package/.pi/harnesses/agent-hub/damage-guard-hub.ts +249 -0
- package/.pi/harnesses/agent-hub/damage-guard-identity.ts +12 -0
- package/.pi/harnesses/agent-hub/damage-guard-owners.ts +54 -0
- package/.pi/harnesses/agent-hub/damage-guard-state.ts +43 -0
- package/.pi/harnesses/agent-hub/delegate.ts +4 -4
- package/.pi/harnesses/agent-hub/deterministic-fs.ts +33 -7
- package/.pi/harnesses/agent-hub/dispatch-coms.ts +3 -2
- package/.pi/harnesses/agent-hub/dispatch-native-complete.ts +1 -1
- package/.pi/harnesses/agent-hub/dispatch-native-prepare.ts +32 -7
- package/.pi/harnesses/agent-hub/dispatch-native-spawn.ts +24 -4
- package/.pi/harnesses/agent-hub/dispatch-native-types.ts +26 -0
- package/.pi/harnesses/agent-hub/dispatch-native.ts +2 -0
- package/.pi/harnesses/agent-hub/execution-trace.ts +241 -0
- package/.pi/harnesses/agent-hub/file-discovery/adapters.ts +9 -3
- package/.pi/harnesses/agent-hub/file-discovery/broker-client.ts +10 -4
- package/.pi/harnesses/agent-hub/file-discovery/broker.ts +8 -5
- package/.pi/harnesses/agent-hub/file-discovery/child-extension.ts +17 -8
- package/.pi/harnesses/agent-hub/file-discovery/descendant.ts +5 -1
- package/.pi/harnesses/agent-hub/file-discovery/discovery-worker.mjs +1 -1
- package/.pi/harnesses/agent-hub/file-discovery/evaluate.ts +14 -5
- package/.pi/harnesses/agent-hub/file-discovery/hub.ts +33 -16
- package/.pi/harnesses/agent-hub/file-discovery/results.ts +7 -6
- package/.pi/harnesses/agent-hub/file-discovery/runtime.ts +21 -11
- package/.pi/harnesses/agent-hub/file-discovery/semantic-profiles.ts +18 -0
- package/.pi/harnesses/agent-hub/file-discovery/sources.ts +2 -2
- package/.pi/harnesses/agent-hub/filesystem-tool.ts +6 -25
- package/.pi/harnesses/agent-hub/history-projection.ts +116 -0
- package/.pi/harnesses/agent-hub/hub-state-audit.js +0 -24
- package/.pi/harnesses/agent-hub/index.ts +102 -113
- package/.pi/harnesses/agent-hub/lifecycle/context-pressure.ts +122 -24
- package/.pi/harnesses/agent-hub/no-progress.ts +42 -15
- package/.pi/harnesses/agent-hub/operator-watchdog.ts +97 -0
- package/.pi/harnesses/agent-hub/orchestration-activation.ts +18 -21
- package/.pi/harnesses/agent-hub/orchestration-route.ts +8 -16
- package/.pi/harnesses/agent-hub/package.json +1 -1
- package/.pi/harnesses/agent-hub/policy/work-mode.ts +8 -3
- package/.pi/harnesses/agent-hub/proactive-runtime.ts +1 -1
- package/.pi/harnesses/agent-hub/process-obligations.ts +23 -22
- package/.pi/harnesses/agent-hub/prompts/context.ts +1 -2
- package/.pi/harnesses/agent-hub/prompts/fragments.ts +21 -30
- package/.pi/harnesses/agent-hub/prompts/session-start.ts +1 -1
- package/.pi/harnesses/agent-hub/recovery-contract.ts +2 -1
- package/.pi/harnesses/agent-hub/research/runtime.ts +14 -0
- package/.pi/harnesses/agent-hub/research/spawn-run.ts +41 -14
- package/.pi/harnesses/agent-hub/review-continuity.ts +73 -0
- package/.pi/harnesses/agent-hub/review-findings.js +2 -10
- package/.pi/harnesses/agent-hub/review-reuse.ts +47 -0
- package/.pi/harnesses/agent-hub/run-budget.js +17 -229
- package/.pi/harnesses/agent-hub/scope-gate.js +99 -15
- package/.pi/harnesses/agent-hub/session-audit.ts +22 -4
- package/.pi/harnesses/agent-hub/spawn.ts +87 -11
- package/.pi/harnesses/agent-hub/specialist-result-receipt.ts +13 -0
- package/.pi/harnesses/agent-hub/specialist-result.ts +69 -0
- package/.pi/harnesses/agent-hub/system1-communication-store.ts +29 -2
- package/.pi/harnesses/agent-hub/system1-runtime.ts +7 -0
- package/.pi/harnesses/agent-hub/task-continuation.ts +4 -0
- package/.pi/harnesses/agent-hub/task-triage-authorization.ts +43 -14
- package/.pi/harnesses/agent-hub/task-triage-config.ts +5 -14
- package/.pi/harnesses/agent-hub/task-triage-obligations.ts +17 -1
- package/.pi/harnesses/agent-hub/task-triage-runtime.ts +15 -10
- package/.pi/harnesses/agent-hub/task-triage-stage-guard.ts +1 -1
- package/.pi/harnesses/agent-hub/tool-catalog-runtime.ts +18 -7
- package/.pi/harnesses/agent-hub/tools/action-executors.ts +11 -10
- package/.pi/harnesses/agent-hub/tools/dispatch-agent.ts +2 -2
- package/.pi/harnesses/agent-hub/tools/dispatch-execution.ts +144 -64
- package/.pi/harnesses/agent-hub/ui/context-budget.ts +5 -3
- package/.pi/harnesses/agent-hub/ui/grid.ts +1 -1
- package/.pi/harnesses/agent-hub/work-mode.ts +3 -4
- package/.pi/harnesses/ask-user-remote/index.ts +13 -2
- package/.pi/harnesses/ask-user-remote/questions.ts +4 -6
- package/.pi/harnesses/ask-user-remote/runtime-ask.ts +16 -1
- package/.pi/harnesses/coms/package.json +1 -1
- package/.pi/harnesses/damage-control-continue/README.md +26 -0
- package/.pi/harnesses/damage-control-continue/index.ts +87 -20
- package/.pi/harnesses/damage-control-continue/package.json +1 -1
- package/.pi/harnesses/damage-control-continue/result-screen.ts +98 -0
- package/.pi/harnesses/damage-control-continue/system1-child.ts +35 -0
- package/.pi/harnesses/damage-control-continue/system1-client.ts +85 -0
- package/.pi/harnesses/damage-control-continue/system1-guard.ts +65 -0
- package/.pi/harnesses/lib/approval-wait.ts +17 -0
- package/.pi/harnesses/lib/bash-policy-analysis.ts +155 -0
- package/.pi/harnesses/lib/clarification-policy.ts +9 -0
- package/.pi/harnesses/lib/coms-core-io.ts +2 -1
- package/.pi/harnesses/lib/coms-core.ts +3 -2
- package/.pi/harnesses/lib/coms-registry-entry.ts +4 -2
- package/.pi/harnesses/lib/context-budget-child-prompt.ts +8 -14
- package/.pi/harnesses/lib/context-budget-view.ts +5 -0
- package/.pi/harnesses/lib/context-compaction-policy.js +35 -0
- package/.pi/harnesses/lib/damage-action-hash.ts +28 -0
- package/.pi/harnesses/lib/damage-control-shared.ts +3 -0
- package/.pi/harnesses/lib/damage-guard-port.ts +25 -0
- package/.pi/harnesses/lib/damage-result-evidence.ts +25 -0
- package/.pi/harnesses/lib/damage-result-view.ts +16 -0
- package/.pi/harnesses/lib/execution-trace.ts +45 -0
- package/.pi/harnesses/lib/herdr-presence.ts +4 -4
- package/.pi/harnesses/lib/identical-dialog.ts +27 -0
- package/.pi/harnesses/lib/installation-state.js +62 -0
- package/.pi/harnesses/lib/process-shared.ts +9 -0
- package/.pi/harnesses/lib/semantic-approval.ts +80 -0
- package/.pi/harnesses/lib/system1/config-context-compaction.js +16 -0
- package/.pi/harnesses/lib/system1/config-damage-guard.js +24 -0
- package/.pi/harnesses/lib/system1/config-file-discovery.js +4 -2
- package/.pi/harnesses/lib/system1/config-v2.js +11 -5
- package/.pi/harnesses/lib/system1/payload-screen.ts +65 -0
- package/.pi/harnesses/lib/system1/service.ts +1 -1
- package/.pi/harnesses/package-lock.json +1041 -959
- package/.pi/harnesses/package.json +3 -0
- package/.versions/2.0.20/.pi/agent-fleet/hermes/README.md +347 -0
- package/.versions/2.0.20/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-herdr/plugin.js +1291 -0
- package/.versions/2.0.20/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-herdr/presentation.js +672 -0
- package/.versions/2.0.20/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-monitor/plugin.js +19 -0
- package/.versions/2.0.20/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-monitor/state.js +10 -0
- package/.versions/2.0.20/.pi/agent-fleet/hermes/gates/gate-o-capability.md +8 -0
- package/.versions/2.0.20/.pi/agent-fleet/hermes/gates/gate-o-validator-fixtures.json +1 -0
- package/.versions/2.0.20/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/activity.py +773 -0
- package/.versions/2.0.20/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/coms_registry.py +134 -0
- package/.versions/2.0.20/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/coms_send.py +350 -0
- package/.versions/2.0.20/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/herdr_source.py +193 -0
- package/.versions/2.0.20/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/manifest.json +4 -0
- package/.versions/2.0.20/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/plugin_api.py +444 -0
- package/.versions/2.0.20/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/sessions.py +205 -0
- package/.versions/2.0.20/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/tasks.py +300 -0
- package/.versions/2.0.20/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/watch.py +819 -0
- package/.versions/2.0.20/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/plugin.yaml +8 -0
- package/.versions/2.0.20/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/adapter.py +139 -0
- package/.versions/2.0.20/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/manifest.json +11 -0
- package/.versions/2.0.20/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/plugin_api.py +50 -0
- package/.versions/2.0.20/.pi/agent-fleet/hermes/skills/hub-conductor/SKILL.md +84 -0
- package/.versions/2.0.20/.pi/agent-fleet/hermes/skills/hub-liaison/SKILL.md +84 -0
- package/.versions/2.0.20/.pi/agent-fleet/hermes/skills/hub-watchdog/SKILL.md +76 -0
- package/.versions/2.0.20/.pi/agent-fleet/hermes/skills/hub-watchdog/manifest.json +1 -0
- package/.versions/2.0.20/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog.py +249 -0
- package/.versions/2.0.20/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_actions.py +124 -0
- package/.versions/2.0.20/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_contract.py +76 -0
- package/.versions/2.0.20/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_delivery.py +10 -0
- package/.versions/2.0.20/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_engine.py +128 -0
- package/.versions/2.0.20/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_judgment.py +41 -0
- package/.versions/2.0.20/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_recovery.py +103 -0
- package/.versions/2.0.20/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_state.py +163 -0
- package/.versions/2.0.20/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_transport.py +138 -0
- package/.versions/2.0.20/.pi/agent-fleet/hermes/watchdog-tests/__init__.py +0 -0
- package/.versions/2.0.20/.pi/agent-fleet/hooks/coms-stop-hook.mjs +84 -0
- package/.versions/2.0.20/.pi/agent-fleet/scripts/claude-code-preflight.ts +70 -0
- package/.versions/2.0.20/.pi/agent-fleet/scripts/coms-claude-bridge.ts +437 -0
- package/.versions/2.0.20/.pi/agent-fleet/scripts/coms-cli.ts +425 -0
- package/.versions/2.0.20/.pi/agent-fleet/scripts/coms-hermes-bridge.ts +413 -0
- package/.versions/2.0.20/.pi/agent-fleet/scripts/fleet-codex-client.ts +69 -0
- package/.versions/2.0.20/.pi/agent-fleet/scripts/fleet-codex-read.py +148 -0
- package/.versions/2.0.20/.pi/agent-fleet/scripts/fleet.ts +217 -0
- package/.versions/2.0.20/.pi/agent-fleet/scripts/flow.ts +157 -0
- package/.versions/2.0.20/.pi/agent-fleet/scripts/hermes-monitor-capability-runner.ts +25 -0
- package/.versions/2.0.20/.pi/agent-fleet/scripts/hermes-monitor-scenario.ts +474 -0
- package/.versions/2.0.20/.pi/agent-fleet/scripts/hermes-watchdog-capability-probe.ts +45 -0
- package/.versions/2.0.20/.pi/agent-fleet/scripts/install-hermes-plugin.sh +180 -0
- package/.versions/2.0.20/.pi/agent-fleet/scripts/lib/claude-bridge-core.ts +208 -0
- package/.versions/2.0.20/.pi/agent-fleet/scripts/lib/coms-envelope.ts +582 -0
- package/.versions/2.0.20/.pi/agent-fleet/scripts/lib/fake-herdr-server.ts +88 -0
- package/.versions/2.0.20/.pi/agent-fleet/scripts/lib/fleet-codex-catalog.ts +63 -0
- package/.versions/2.0.20/.pi/agent-fleet/scripts/lib/fleet-codex-operations.ts +190 -0
- package/.versions/2.0.20/.pi/agent-fleet/scripts/lib/fleet-codex-session.ts +166 -0
- package/.versions/2.0.20/.pi/agent-fleet/scripts/lib/fleet-codex-transport.ts +124 -0
- package/.versions/2.0.20/.pi/agent-fleet/scripts/lib/fleet-command.ts +252 -0
- package/.versions/2.0.20/.pi/agent-fleet/scripts/lib/flow-command.ts +98 -0
- package/.versions/2.0.20/.pi/agent-fleet/scripts/lib/flow-maintenance.ts +230 -0
- package/.versions/2.0.20/.pi/agent-fleet/scripts/lib/herdr-layout.ts +281 -0
- package/.versions/2.0.20/.pi/agent-fleet/scripts/lib/hermes-bridge-core.ts +241 -0
- package/.versions/2.0.20/.pi/agent-fleet/scripts/lib/hermes-monitor-events.ts +1 -0
- package/.versions/2.0.20/.pi/agent-fleet/scripts/lib/hermes-monitor-herdr.ts +2 -0
- package/.versions/2.0.20/.pi/agent-fleet/scripts/lib/hermes-monitor-model.ts +3 -0
- package/.versions/2.0.20/.pi/agent-fleet/scripts/lib/hermes-monitor-registry.ts +2 -0
- package/.versions/2.0.20/.pi/agent-fleet/scripts/lib/hermes-monitor-socket.ts +2 -0
- package/.versions/2.0.20/.pi/agent-fleet/scripts/lib/hermes-monitor-store.ts +2 -0
- package/.versions/2.0.20/.pi/agent-fleet/scripts/lib/monitor-env.ts +146 -0
- package/.versions/2.0.20/.pi/agent-fleet/scripts/lib/peer-launch.ts +318 -0
- package/.versions/2.0.20/.pi/agent-fleet/scripts/lib/persona-banner.ts +62 -0
- package/.versions/2.0.20/.pi/agent-fleet/scripts/lib/persona-dirs.ts +25 -0
- package/.versions/2.0.20/.pi/agent-fleet/scripts/lib/runtime-dependencies.js +124 -0
- package/.versions/2.0.20/.pi/agent-fleet/scripts/lib/spawn-stagger.ts +101 -0
- package/.versions/2.0.20/.pi/agent-fleet/scripts/lib/team-project.ts +178 -0
- package/.versions/2.0.20/.pi/agent-fleet/scripts/lib/team-snapshot.ts +147 -0
- package/.versions/2.0.20/.pi/agent-fleet/scripts/package-lock.json +35 -0
- package/.versions/2.0.20/.pi/agent-fleet/scripts/package.json +9 -0
- package/.versions/2.0.20/.pi/agent-fleet/scripts/peer-banner.ts +41 -0
- package/.versions/2.0.20/.pi/agent-fleet/scripts/peer-launch.ts +283 -0
- package/.versions/2.0.20/.pi/agent-fleet/scripts/team-snapshot.ts +237 -0
- package/.versions/2.0.20/.pi/agent-fleet/scripts/team-up.ts +378 -0
- package/.versions/2.0.20/.pi/agent-fleet/scripts/workflows/lib/agent-phase.ts +179 -0
- package/.versions/2.0.20/.pi/agent-fleet/scripts/workflows/lib/changes.ts +61 -0
- package/.versions/2.0.20/.pi/agent-fleet/scripts/workflows/lib/debate.ts +149 -0
- package/.versions/2.0.20/.pi/agent-fleet/scripts/workflows/lib/env.ts +34 -0
- package/.versions/2.0.20/.pi/agent-fleet/scripts/workflows/lib/envelopes.ts +169 -0
- package/.versions/2.0.20/.pi/agent-fleet/scripts/workflows/lib/gates.ts +81 -0
- package/.versions/2.0.20/.pi/agent-fleet/scripts/workflows/lib/git.ts +96 -0
- package/.versions/2.0.20/.pi/agent-fleet/scripts/workflows/lib/isolated-snapshot.ts +125 -0
- package/.versions/2.0.20/.pi/agent-fleet/scripts/workflows/lib/merge.ts +95 -0
- package/.versions/2.0.20/.pi/agent-fleet/scripts/workflows/lib/model-profile.ts +22 -0
- package/.versions/2.0.20/.pi/agent-fleet/scripts/workflows/lib/model-visibility.ts +92 -0
- package/.versions/2.0.20/.pi/agent-fleet/scripts/workflows/lib/permissions.ts +130 -0
- package/.versions/2.0.20/.pi/agent-fleet/scripts/workflows/lib/personas.ts +57 -0
- package/.versions/2.0.20/.pi/agent-fleet/scripts/workflows/lib/poll.ts +86 -0
- package/.versions/2.0.20/.pi/agent-fleet/scripts/workflows/lib/project-policy.ts +36 -0
- package/.versions/2.0.20/.pi/agent-fleet/scripts/workflows/lib/quality.ts +64 -0
- package/.versions/2.0.20/.pi/agent-fleet/scripts/workflows/lib/run.ts +108 -0
- package/.versions/2.0.20/.pi/agent-fleet/scripts/workflows/lib/scout-data-boundary.ts +55 -0
- package/.versions/2.0.20/.pi/agent-fleet/scripts/workflows/lib/trace.ts +34 -0
- package/.versions/2.0.20/.pi/agent-fleet/scripts/workflows/lib/voices.ts +128 -0
- package/.versions/2.0.20/.pi/agent-fleet/scripts/workflows/lib/writer-lease.ts +112 -0
- package/.versions/2.0.20/.pi/agent-fleet/scripts/workflows/tsconfig.json +22 -0
- package/.versions/2.0.20/.pi/agent-fleet/scripts/workflows/wf-build-test.ts +61 -0
- package/.versions/2.0.20/.pi/agent-fleet/scripts/workflows/wf-debate.ts +87 -0
- package/.versions/2.0.20/.pi/agent-fleet/scripts/workflows/wf-document.ts +50 -0
- package/.versions/2.0.20/.pi/agent-fleet/scripts/workflows/wf-poll.ts +95 -0
- package/.versions/2.0.20/.pi/agent-fleet/scripts/workflows/wf-quality.ts +20 -0
- package/.versions/2.0.20/.pi/agent-fleet/scripts/workflows/wf-scout.ts +40 -0
- package/.versions/2.0.20/.pi/agents/dispatch-policy.yaml +32 -0
- package/.versions/2.0.20/.pi/agents/model-profiles.yaml +134 -0
- package/.versions/2.0.20/.pi/agents/peers.yaml +147 -0
- package/.versions/2.0.20/.pi/agents/teams.yaml +41 -0
- package/.versions/2.0.20/.pi/agents/voices.yaml +13 -0
- package/.versions/2.0.20/.pi/damage-control-rules.yaml +297 -0
- package/.versions/2.0.20/.pi/extensions/btw/README.md +120 -0
- package/.versions/2.0.20/.pi/extensions/btw/index.ts +914 -0
- package/.versions/2.0.20/.pi/extensions/btw/package.json +6 -0
- package/.versions/2.0.20/.pi/extensions/btw/state.js +179 -0
- package/.versions/2.0.20/.pi/extensions/chrome-devtools-mcp/README.md +55 -0
- package/.versions/2.0.20/.pi/extensions/chrome-devtools-mcp/index.ts +93 -0
- package/.versions/2.0.20/.pi/extensions/chrome-devtools-mcp/package.json +6 -0
- package/.versions/2.0.20/.pi/extensions/compact-and-continue/README.md +42 -0
- package/.versions/2.0.20/.pi/extensions/compact-and-continue/index.ts +136 -0
- package/.versions/2.0.20/.pi/extensions/compact-and-continue/package.json +6 -0
- package/.versions/2.0.20/.pi/extensions/mcp-bridge/README.md +46 -0
- package/.versions/2.0.20/.pi/extensions/mcp-bridge/index.ts +206 -0
- package/.versions/2.0.20/.pi/extensions/mcp-bridge/package.json +6 -0
- package/.versions/2.0.20/.pi/extensions/package-lock.json +1175 -0
- package/.versions/2.0.20/.pi/extensions/package.json +9 -0
- package/.versions/2.0.20/.pi/extensions/pi-voice-stt/README.md +224 -0
- package/.versions/2.0.20/.pi/extensions/pi-voice-stt/config.ts +198 -0
- package/.versions/2.0.20/.pi/extensions/pi-voice-stt/examples/stt.json +35 -0
- package/.versions/2.0.20/.pi/extensions/pi-voice-stt/index.ts +248 -0
- package/.versions/2.0.20/.pi/extensions/pi-voice-stt/package.json +6 -0
- package/.versions/2.0.20/.pi/extensions/pi-voice-stt/providers.ts +214 -0
- package/.versions/2.0.20/.pi/extensions/pi-voice-stt/recorder.ts +158 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/README.md +1516 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/acceptance.ts +199 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/access-approval.ts +141 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/action-authorization.ts +10 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/agentic-contract.ts +43 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/agentic-evidence.ts +64 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/agentic-hub.ts +54 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/agentic-runtime.ts +56 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/agentic-sources-worker.mjs +4 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/agentic-sources.ts +74 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/agentic-state.ts +23 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/approval-wait.ts +1 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/artifacts.js +146 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/assertion-ledger.js +67 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/assist-profile.ts +19 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/backend-policy.js +174 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/bounded-output.ts +26 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/budget-recovery.ts +123 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/capability-confirmation.ts +47 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/capability-packs.ts +184 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/commands/agent-model-thinking.ts +10 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/commands/agent-model.ts +10 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/commands/agent-models-substitute.ts +10 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/commands/agents-add.ts +9 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/commands/agents-drop.ts +9 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/commands/agents-history.ts +9 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/commands/agents-kill.ts +10 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/commands/agents-list.ts +9 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/commands/agents-restart.ts +10 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/commands/agents-save.ts +9 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/commands/agents-team.ts +9 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/commands/audit.ts +9 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/commands/compound.ts +9 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/commands/coms.ts +9 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/commands/context-command.ts +9 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/commands/context.ts +46 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/commands/debate.ts +9 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/commands/dispatch-policy.ts +9 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/commands/handoff.ts +10 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/commands/hub-report.ts +9 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/commands/models.ts +10 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/commands/poll.ts +9 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/commands/recover.ts +61 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/commands/retry.ts +10 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/commands/task-triage-recover.ts +12 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/commands/task-triage-waive.ts +12 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/commands/watchdog.ts +9 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/commands/work-mode.ts +29 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/commands/zoom.ts +10 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/config/agents.ts +178 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/config/model-profiles.ts +237 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/config/overrides.ts +165 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/context/agent-state.ts +30 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/context/assertions-artifacts.ts +221 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/context/budgets.ts +152 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/context/hub-state.ts +40 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/context-budget-snapshot.ts +105 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/context-compaction-monitor.ts +35 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/context-compaction-preflight.ts +21 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/context-compaction-runtime.ts +69 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/context-compaction.ts +34 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/context-continuity-broker.ts +42 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/context-continuity-child.ts +83 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/context-continuity-client.ts +19 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/context-continuity-compat.ts +30 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/context-continuity-owners.ts +15 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/context-continuity-registry.ts +8 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/context-continuity.ts +82 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/context-pressure.ts +222 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/context-window.js +108 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/damage-guard-approval.ts +59 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/damage-guard-broker.ts +125 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/damage-guard-contract.ts +22 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/damage-guard-descendant.ts +76 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/damage-guard-hub.ts +249 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/damage-guard-identity.ts +12 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/damage-guard-owners.ts +54 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/damage-guard-state.ts +43 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/damage-guard-test-tsconfig.json +19 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/debate-command.ts +176 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/delegate.ts +478 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/deterministic-fs.ts +195 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/diagnostic-probe-extension.ts +26 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/diagnostic-series-budget.ts +178 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/dispatch-coms.ts +253 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/dispatch-core.ts +27 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/dispatch-native-complete.ts +173 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/dispatch-native-prepare.ts +295 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/dispatch-native-spawn.ts +253 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/dispatch-native-types.ts +293 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/dispatch-native.ts +236 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/dispatch-observability.ts +225 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/dispatch-triage-contract.ts +27 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/dispatch-triage-eval.ts +77 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/dispatch-triage-policy.ts +29 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/dispatch-triage-runtime.ts +55 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/dispatch-triage-state.ts +33 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/docs-lane.js +123 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/drift-judge.ts +352 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/drift-runtime.ts +480 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/drift-system1-policy.ts +39 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/drift-system1.ts +469 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/drift-watchdog.js +349 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/evidence-manifest.ts +51 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/evidence-rules.js +96 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/execution-evidence.ts +80 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/execution-trace.ts +241 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/external-blocker.js +85 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/file-discovery/adapters.ts +88 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/file-discovery/broker-client.ts +62 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/file-discovery/broker.ts +128 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/file-discovery/child-extension.ts +42 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/file-discovery/descendant.ts +67 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/file-discovery/discovery-worker.mjs +15 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/file-discovery/discovery.ts +126 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/file-discovery/evaluate.ts +57 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/file-discovery/hub.ts +169 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/file-discovery/native-context.ts +8 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/file-discovery/native-fixture.test-support.ts +108 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/file-discovery/owners.ts +96 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/file-discovery/results.ts +55 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/file-discovery/runtime.ts +130 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/file-discovery/semantic-profiles.ts +18 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/file-discovery/sources.ts +69 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/file-discovery/state.ts +22 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/filesystem-tool.ts +166 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/fixtures/registration-surface.json +66 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/fixtures/t0a-synthetic/catalog.ts +189 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/footer.ts +30 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/helpers.ts +270 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/history-projection.ts +116 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/hub-state-audit.js +41 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/index.ts +2614 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/input/completions.ts +82 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/input/shortcuts.ts +20 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/lifecycle/context-pressure.ts +231 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/lifecycle/monitor-session.ts +104 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/lifecycle/session-orchestration.ts +144 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/lifecycle/turn-handlers.ts +74 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/monitor-control.ts +9 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/monitor-invoke-journal.ts +131 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/monitor-invoke.ts +92 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/monitor-lifecycle.ts +13 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/monitor-publisher.ts +59 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/monitor-recovery.ts +3 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/monitor-runtime.ts +3 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/monitor-session-bridge.ts +266 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/no-progress.ts +620 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/operator-watchdog.ts +97 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/orchestration-activation.ts +109 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/orchestration-metrics.ts +78 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/orchestration-route.ts +68 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/package.json +7 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/peer-spawn-plan.ts +116 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/policy/models.ts +153 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/policy/profile-activation.ts +62 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/policy/profile-runtime.ts +120 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/policy/roster.ts +94 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/policy/work-mode.ts +142 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/poll-command.ts +176 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/presentation.ts +48 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/proactive-config.ts +21 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/proactive-evaluate.ts +138 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/proactive-external-git.ts +82 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/proactive-external.ts +142 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/proactive-feedback.ts +104 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/proactive-findings.ts +115 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/proactive-local.ts +89 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/proactive-observer.ts +106 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/proactive-rules.ts +171 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/proactive-runtime.ts +318 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/proactive-selection.ts +68 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/proactive-snapshot-worker.mjs +12 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/proactive-snapshot.ts +271 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/proactive-types.ts +67 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/process-obligations.ts +159 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/prompts/context.ts +55 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/prompts/fragments.ts +86 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/prompts/session-start.ts +90 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/prompts/system-prompt.ts +125 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/provider-semaphore.js +138 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/reconcile.ts +26 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/recover-policy.ts +44 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/recover-state.ts +104 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/recovery-contract.ts +151 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/rerun-policy.ts +40 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/research/controls.ts +74 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/research/runtime.ts +215 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/research/spawn-run.ts +221 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/research-watchdog.ts +40 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/return-contract.js +349 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/return-extract.js +77 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/review-closure.ts +43 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/review-continuity.ts +73 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/review-findings.js +96 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/review-reuse.ts +47 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/routing-observation.ts +41 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/routing-proposal.ts +46 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/run-budget.js +342 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/run-namespace.js +93 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/runtime-test-check.ts +54 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/safety-routing.ts +22 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/scope-gate.js +228 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/session-audit.ts +331 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/session-health.js +110 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/session-start.ts +42 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/spawn.ts +639 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/specialist-result-receipt.ts +13 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/specialist-result.ts +69 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/system1-activity.ts +625 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/system1-communication-store.ts +217 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/system1-report.ts +275 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/system1-runtime.ts +265 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/task-continuation.ts +4 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/task-resume-contract.ts +70 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/task-triage-authorization.ts +151 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/task-triage-config.ts +20 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/task-triage-contract.ts +14 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/task-triage-live-stage-boundary.mjs +49 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/task-triage-obligations.ts +120 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/task-triage-policy.ts +16 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/task-triage-review-contract.mjs +43 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/task-triage-reviewer-only-contract.mjs +156 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/task-triage-reviewer-only-diagnostics.mjs +112 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/task-triage-runtime.ts +130 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/task-triage-stage-guard.ts +21 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/task-triage-state.ts +46 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/timeline.ts +72 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/tool-catalog-runtime.ts +79 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/tool-catalog-state.ts +123 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/tool-protocol.ts +134 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/tools/action-executors.ts +214 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/tools/ask-system1-files.ts +15 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/tools/ask-system1.ts +25 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/tools/coms-tools.ts +139 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/tools/context.ts +144 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/tools/dispatch-agent.ts +88 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/tools/dispatch-execution.ts +640 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/tools/dispatch-triage.ts +16 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/tools/execution-orchestration.ts +22 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/tools/fleet-tools.ts +200 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/tools/herdr-executors.ts +95 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/tools/run-flow.ts +136 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/tools/set-task-tier.ts +31 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/tools/spawn-research.ts +67 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/tools/team-adjust.ts +29 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/tools/verification-contract.ts +80 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/tsconfig.json +22 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/types.ts +66 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/ui/activity-dots.ts +25 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/ui/context-budget.ts +89 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/ui/detail-panel.ts +192 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/ui/fleet-actions.ts +78 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/ui/fleet-dashboard.ts +155 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/ui/fleet-editor.ts +44 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/ui/fleet-source.ts +179 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/ui/grid.ts +159 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/ui/history-store.ts +137 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/ui/history.ts +234 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/ui/pool.ts +103 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/ui/running-strip.ts +2 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/ui/system1-communication.ts +59 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/ui/zoom.ts +206 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/unknown-tool-counter.ts +116 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/version.ts +42 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/watchdog-evaluation.ts +110 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/work-mode-controls.ts +56 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/work-mode.ts +186 -0
- package/.versions/2.0.20/.pi/harnesses/agent-hub/write-isolation.ts +187 -0
- package/.versions/2.0.20/.pi/harnesses/ask-user-remote/README.md +59 -0
- package/.versions/2.0.20/.pi/harnesses/ask-user-remote/index.ts +569 -0
- package/.versions/2.0.20/.pi/harnesses/ask-user-remote/questions.ts +159 -0
- package/.versions/2.0.20/.pi/harnesses/ask-user-remote/race-core.js +124 -0
- package/.versions/2.0.20/.pi/harnesses/ask-user-remote/runtime-ask.ts +83 -0
- package/.versions/2.0.20/.pi/harnesses/coms/README.md +100 -0
- package/.versions/2.0.20/.pi/harnesses/coms/index.ts +282 -0
- package/.versions/2.0.20/.pi/harnesses/coms/package.json +7 -0
- package/.versions/2.0.20/.pi/harnesses/coms/version.ts +42 -0
- package/.versions/2.0.20/.pi/harnesses/damage-control-continue/README.md +161 -0
- package/.versions/2.0.20/.pi/harnesses/damage-control-continue/index.ts +600 -0
- package/.versions/2.0.20/.pi/harnesses/damage-control-continue/package.json +7 -0
- package/.versions/2.0.20/.pi/harnesses/damage-control-continue/result-screen.ts +98 -0
- package/.versions/2.0.20/.pi/harnesses/damage-control-continue/system1-child.ts +35 -0
- package/.versions/2.0.20/.pi/harnesses/damage-control-continue/system1-client.ts +85 -0
- package/.versions/2.0.20/.pi/harnesses/damage-control-continue/system1-guard.ts +65 -0
- package/.versions/2.0.20/.pi/harnesses/damage-control-continue/version.ts +42 -0
- package/.versions/2.0.20/.pi/harnesses/lib/approval-wait.ts +17 -0
- package/.versions/2.0.20/.pi/harnesses/lib/bash-policy-analysis.ts +155 -0
- package/.versions/2.0.20/.pi/harnesses/lib/changed-file-diagnostics.ts +642 -0
- package/.versions/2.0.20/.pi/harnesses/lib/clarification-policy.ts +9 -0
- package/.versions/2.0.20/.pi/harnesses/lib/coms-core-io.ts +386 -0
- package/.versions/2.0.20/.pi/harnesses/lib/coms-core.ts +578 -0
- package/.versions/2.0.20/.pi/harnesses/lib/coms-registry-entry.ts +96 -0
- package/.versions/2.0.20/.pi/harnesses/lib/context-budget-child-prompt.ts +214 -0
- package/.versions/2.0.20/.pi/harnesses/lib/context-budget-hub-prompt.ts +121 -0
- package/.versions/2.0.20/.pi/harnesses/lib/context-budget-view.ts +112 -0
- package/.versions/2.0.20/.pi/harnesses/lib/context-budget.ts +114 -0
- package/.versions/2.0.20/.pi/harnesses/lib/context-compaction-policy.js +35 -0
- package/.versions/2.0.20/.pi/harnesses/lib/damage-action-hash.ts +28 -0
- package/.versions/2.0.20/.pi/harnesses/lib/damage-control-shared.ts +229 -0
- package/.versions/2.0.20/.pi/harnesses/lib/damage-guard-port.ts +25 -0
- package/.versions/2.0.20/.pi/harnesses/lib/damage-result-evidence.ts +25 -0
- package/.versions/2.0.20/.pi/harnesses/lib/damage-result-view.ts +16 -0
- package/.versions/2.0.20/.pi/harnesses/lib/deterministic-handle-path.ts +25 -0
- package/.versions/2.0.20/.pi/harnesses/lib/execution-trace.ts +45 -0
- package/.versions/2.0.20/.pi/harnesses/lib/fixtures/context-budget-profiles.json +11 -0
- package/.versions/2.0.20/.pi/harnesses/lib/fixtures/hub-prompt-operator.legacy.txt +73 -0
- package/.versions/2.0.20/.pi/harnesses/lib/fixtures/hub-prompt-orchestrator.legacy.txt +73 -0
- package/.versions/2.0.20/.pi/harnesses/lib/fleet-dashboard-ops.ts +178 -0
- package/.versions/2.0.20/.pi/harnesses/lib/fleet-dashboard-view.ts +172 -0
- package/.versions/2.0.20/.pi/harnesses/lib/fleet-detail-view.ts +339 -0
- package/.versions/2.0.20/.pi/harnesses/lib/fleet-overlay.ts +26 -0
- package/.versions/2.0.20/.pi/harnesses/lib/fleet-panel.ts +34 -0
- package/.versions/2.0.20/.pi/harnesses/lib/fleet-read-model.ts +609 -0
- package/.versions/2.0.20/.pi/harnesses/lib/fleet-selection.ts +24 -0
- package/.versions/2.0.20/.pi/harnesses/lib/fleet-strip-controller.ts +75 -0
- package/.versions/2.0.20/.pi/harnesses/lib/fleet-strip-view.ts +179 -0
- package/.versions/2.0.20/.pi/harnesses/lib/fleet-transcript-store.ts +244 -0
- package/.versions/2.0.20/.pi/harnesses/lib/herdr-client.ts +472 -0
- package/.versions/2.0.20/.pi/harnesses/lib/herdr-presence.ts +399 -0
- package/.versions/2.0.20/.pi/harnesses/lib/hermes-monitor-events.ts +136 -0
- package/.versions/2.0.20/.pi/harnesses/lib/hermes-monitor-herdr.ts +28 -0
- package/.versions/2.0.20/.pi/harnesses/lib/hermes-monitor-model.ts +18 -0
- package/.versions/2.0.20/.pi/harnesses/lib/hermes-monitor-registry.ts +6 -0
- package/.versions/2.0.20/.pi/harnesses/lib/hermes-monitor-socket.ts +163 -0
- package/.versions/2.0.20/.pi/harnesses/lib/hermes-monitor-store.ts +31 -0
- package/.versions/2.0.20/.pi/harnesses/lib/identical-dialog.ts +27 -0
- package/.versions/2.0.20/.pi/harnesses/lib/installation-state.js +62 -0
- package/.versions/2.0.20/.pi/harnesses/lib/policy-roots.js +106 -0
- package/.versions/2.0.20/.pi/harnesses/lib/policy-roots.ts +31 -0
- package/.versions/2.0.20/.pi/harnesses/lib/process-shared.ts +9 -0
- package/.versions/2.0.20/.pi/harnesses/lib/safe-source-read.js +29 -0
- package/.versions/2.0.20/.pi/harnesses/lib/semantic-approval.ts +80 -0
- package/.versions/2.0.20/.pi/harnesses/lib/spawned-peers.js +191 -0
- package/.versions/2.0.20/.pi/harnesses/lib/system1/config-agentic.js +15 -0
- package/.versions/2.0.20/.pi/harnesses/lib/system1/config-context-compaction.js +16 -0
- package/.versions/2.0.20/.pi/harnesses/lib/system1/config-damage-guard.js +24 -0
- package/.versions/2.0.20/.pi/harnesses/lib/system1/config-file-discovery.js +23 -0
- package/.versions/2.0.20/.pi/harnesses/lib/system1/config-json.js +37 -0
- package/.versions/2.0.20/.pi/harnesses/lib/system1/config-loader.js +44 -0
- package/.versions/2.0.20/.pi/harnesses/lib/system1/config-proactive.js +68 -0
- package/.versions/2.0.20/.pi/harnesses/lib/system1/config-triage.js +42 -0
- package/.versions/2.0.20/.pi/harnesses/lib/system1/config-v2.js +112 -0
- package/.versions/2.0.20/.pi/harnesses/lib/system1/config.js +50 -0
- package/.versions/2.0.20/.pi/harnesses/lib/system1/contracts.ts +154 -0
- package/.versions/2.0.20/.pi/harnesses/lib/system1/demo.ts +95 -0
- package/.versions/2.0.20/.pi/harnesses/lib/system1/jev.ts +503 -0
- package/.versions/2.0.20/.pi/harnesses/lib/system1/payload-screen.ts +65 -0
- package/.versions/2.0.20/.pi/harnesses/lib/system1/selection.js +11 -0
- package/.versions/2.0.20/.pi/harnesses/lib/system1/service.ts +245 -0
- package/.versions/2.0.20/.pi/harnesses/lib/update-check.ts +222 -0
- package/.versions/2.0.20/.pi/harnesses/package-lock.json +2121 -0
- package/.versions/2.0.20/.pi/harnesses/package.json +13 -0
- package/.versions/2.0.20/.pi/prompts/af-build.md +27 -0
- package/.versions/2.0.20/.pi/prompts/af-code-simplify.md +22 -0
- package/.versions/2.0.20/.pi/prompts/af-constraints.md +31 -0
- package/.versions/2.0.20/.pi/prompts/af-plan.md +17 -0
- package/.versions/2.0.20/.pi/prompts/af-review.md +16 -0
- package/.versions/2.0.20/.pi/prompts/af-set-hermes-telegram.md +15 -0
- package/.versions/2.0.20/.pi/prompts/af-set-hermes-watchdog.md +6 -0
- package/.versions/2.0.20/.pi/prompts/af-setup-rules.md +20 -0
- package/.versions/2.0.20/.pi/prompts/af-ship.md +17 -0
- package/.versions/2.0.20/.pi/prompts/af-spec.md +15 -0
- package/.versions/2.0.20/.pi/prompts/af-test.md +19 -0
- package/.versions/2.0.20/.pi/skills/bowser/SKILL.md +145 -0
- package/.versions/2.0.20/.version +1 -0
- package/.versions/2.0.20/agents/architect.md +24 -0
- package/.versions/2.0.20/agents/bowser.md +28 -0
- package/.versions/2.0.20/agents/builder.md +55 -0
- package/.versions/2.0.20/agents/code-reviewer.md +209 -0
- package/.versions/2.0.20/agents/deep-researcher.md +32 -0
- package/.versions/2.0.20/agents/documenter.md +22 -0
- package/.versions/2.0.20/agents/orchestrator.md +22 -0
- package/.versions/2.0.20/agents/plan-reviewer.md +83 -0
- package/.versions/2.0.20/agents/planner.md +107 -0
- package/.versions/2.0.20/agents/releaser.md +24 -0
- package/.versions/2.0.20/agents/researcher.md +30 -0
- package/.versions/2.0.20/agents/security-auditor.md +167 -0
- package/.versions/2.0.20/agents/test-engineer.md +153 -0
- package/.versions/2.0.20/agents/web-debugger.md +44 -0
- package/.versions/2.0.20/agents/web-performance-auditor.md +194 -0
- package/.versions/2.0.20/bin/catalog/harness-runtime-closure.json +73 -0
- package/.versions/2.0.20/codex/fleet-session-client/SKILL.md +34 -0
- package/.versions/2.0.20/codex/fleet-session-client.zip +0 -0
- package/.versions/2.0.20/docs/ARCHITECTURE.md +977 -0
- package/.versions/2.0.20/docs/agent-fleet-setup.md +1103 -0
- package/.versions/2.0.20/docs/claude-code-coms-bridge.md +147 -0
- package/.versions/2.0.20/docs/codex-session-bridge.md +219 -0
- package/.versions/2.0.20/docs/coms-hermes-bridge.md +188 -0
- package/.versions/2.0.20/docs/getting-started.md +126 -0
- package/.versions/2.0.20/docs/npm-install.md +535 -0
- package/.versions/2.0.20/docs/pi-extensions.md +455 -0
- package/.versions/2.0.20/docs/pi-setup.md +92 -0
- package/.versions/2.0.20/docs/skill-anatomy.md +150 -0
- package/.versions/2.0.20/install-manifest.json +3210 -0
- package/.versions/2.0.20/justfile +247 -0
- package/.versions/2.0.20/manifest-meta.json +1088 -0
- package/.versions/2.0.20/references/accessibility-checklist.md +160 -0
- package/.versions/2.0.20/references/communication-contract.md +26 -0
- package/.versions/2.0.20/references/definition-of-done.md +67 -0
- package/.versions/2.0.20/references/fleet-coordination-patterns.md +171 -0
- package/.versions/2.0.20/references/observability-checklist.md +92 -0
- package/.versions/2.0.20/references/orchestration-patterns.md +370 -0
- package/.versions/2.0.20/references/performance-checklist.md +236 -0
- package/.versions/2.0.20/references/prompting-patterns.md +380 -0
- package/.versions/2.0.20/references/security-checklist.md +245 -0
- package/.versions/2.0.20/references/testing-patterns.md +235 -0
- package/.versions/2.0.20/references/workflow-authoring.md +304 -0
- package/.versions/2.0.20/skills/_internal/grilling.md +59 -0
- package/.versions/2.0.20/skills/browser-testing-with-devtools/SKILL.md +351 -0
- package/.versions/2.0.20/skills/code-review-and-quality/SKILL.md +396 -0
- package/.versions/2.0.20/skills/compound-learning/SKILL.md +137 -0
- package/.versions/2.0.20/skills/constraint-driven-development/SKILL.md +338 -0
- package/.versions/2.0.20/skills/constraint-driven-development/references/floor-guard.md +99 -0
- package/.versions/2.0.20/skills/context-engineering/SKILL.md +341 -0
- package/.versions/2.0.20/skills/deprecation-and-migration/SKILL.md +247 -0
- package/.versions/2.0.20/skills/designing-agents/SKILL.md +394 -0
- package/.versions/2.0.20/skills/designing-agents/pi-harness-authoring.md +222 -0
- package/.versions/2.0.20/skills/drafting-workflows/SKILL.md +143 -0
- package/.versions/2.0.20/skills/drafting-workflows/scripts/make-workflow.ts +177 -0
- package/.versions/2.0.20/skills/frontend-ui-engineering/SKILL.md +328 -0
- package/.versions/2.0.20/skills/git-workflow-and-versioning/SKILL.md +316 -0
- package/.versions/2.0.20/skills/idea-refine/SKILL.md +182 -0
- package/.versions/2.0.20/skills/idea-refine/examples.md +238 -0
- package/.versions/2.0.20/skills/idea-refine/frameworks.md +99 -0
- package/.versions/2.0.20/skills/idea-refine/refinement-criteria.md +113 -0
- package/.versions/2.0.20/skills/idea-refine/scripts/idea-refine.sh +15 -0
- package/.versions/2.0.20/skills/incremental-implementation/SKILL.md +353 -0
- package/.versions/2.0.20/skills/incremental-implementation.zip +0 -0
- package/.versions/2.0.20/skills/interview-me/SKILL.md +226 -0
- package/.versions/2.0.20/skills/orchestration-verification/SKILL.md +182 -0
- package/.versions/2.0.20/skills/peer-coms/SKILL.md +90 -0
- package/.versions/2.0.20/skills/performance-optimization/SKILL.md +496 -0
- package/.versions/2.0.20/skills/planning-and-task-breakdown/SKILL.md +318 -0
- package/.versions/2.0.20/skills/planning-and-task-breakdown.zip +0 -0
- package/.versions/2.0.20/skills/repository-ai-setup/SKILL.md +135 -0
- package/.versions/2.0.20/skills/repository-ai-setup/references/agent-fleet-ai-state.template.json +4 -0
- package/.versions/2.0.20/skills/repository-ai-setup/references/apply-contract.md +74 -0
- package/.versions/2.0.20/skills/repository-ai-setup/references/provenance-template.md +16 -0
- package/.versions/2.0.20/skills/repository-ai-setup/references/setup-flow.md +108 -0
- package/.versions/2.0.20/skills/repository-ai-setup/references/verify-setup.md +20 -0
- package/.versions/2.0.20/skills/repository-ai-setup.zip +0 -0
- package/.versions/2.0.20/skills/security-and-hardening/SKILL.md +524 -0
- package/.versions/2.0.20/skills/spec-driven-development/SKILL.md +295 -0
- package/.versions/2.0.20/skills/spec-driven-development.zip +0 -0
- package/.versions/2.0.20/skills/using-agent-skills/SKILL.md +198 -0
- package/.versions/2.0.20/vendor/agent-skills-upstream/LICENSE +21 -0
- package/.versions/2.0.20/vendor/agent-skills-upstream/README.md +430 -0
- package/.versions/2.0.20/vendor/agent-skills-upstream/skills/api-and-interface-design/SKILL.md +367 -0
- package/.versions/2.0.20/vendor/agent-skills-upstream/skills/browser-testing-with-devtools/SKILL.md +317 -0
- package/.versions/2.0.20/vendor/agent-skills-upstream/skills/ci-cd-and-automation/SKILL.md +390 -0
- package/.versions/2.0.20/vendor/agent-skills-upstream/skills/code-review-and-quality/SKILL.md +396 -0
- package/.versions/2.0.20/vendor/agent-skills-upstream/skills/code-simplification/SKILL.md +331 -0
- package/.versions/2.0.20/vendor/agent-skills-upstream/skills/constraint-driven-development/SKILL.md +311 -0
- package/.versions/2.0.20/vendor/agent-skills-upstream/skills/constraint-driven-development/references/floor-guard.md +99 -0
- package/.versions/2.0.20/vendor/agent-skills-upstream/skills/context-engineering/SKILL.md +337 -0
- package/.versions/2.0.20/vendor/agent-skills-upstream/skills/debugging-and-error-recovery/SKILL.md +300 -0
- package/.versions/2.0.20/vendor/agent-skills-upstream/skills/deprecation-and-migration/SKILL.md +247 -0
- package/.versions/2.0.20/vendor/agent-skills-upstream/skills/documentation-and-adrs/SKILL.md +288 -0
- package/.versions/2.0.20/vendor/agent-skills-upstream/skills/doubt-driven-development/SKILL.md +243 -0
- package/.versions/2.0.20/vendor/agent-skills-upstream/skills/frontend-ui-engineering/SKILL.md +328 -0
- package/.versions/2.0.20/vendor/agent-skills-upstream/skills/git-workflow-and-versioning/SKILL.md +355 -0
- package/.versions/2.0.20/vendor/agent-skills-upstream/skills/idea-refine/SKILL.md +178 -0
- package/.versions/2.0.20/vendor/agent-skills-upstream/skills/idea-refine/examples.md +238 -0
- package/.versions/2.0.20/vendor/agent-skills-upstream/skills/idea-refine/frameworks.md +99 -0
- package/.versions/2.0.20/vendor/agent-skills-upstream/skills/idea-refine/refinement-criteria.md +113 -0
- package/.versions/2.0.20/vendor/agent-skills-upstream/skills/idea-refine/scripts/idea-refine.sh +15 -0
- package/.versions/2.0.20/vendor/agent-skills-upstream/skills/incremental-implementation/SKILL.md +249 -0
- package/.versions/2.0.20/vendor/agent-skills-upstream/skills/interview-me/SKILL.md +225 -0
- package/.versions/2.0.20/vendor/agent-skills-upstream/skills/observability-and-instrumentation/SKILL.md +238 -0
- package/.versions/2.0.20/vendor/agent-skills-upstream/skills/performance-optimization/SKILL.md +496 -0
- package/.versions/2.0.20/vendor/agent-skills-upstream/skills/planning-and-task-breakdown/SKILL.md +257 -0
- package/.versions/2.0.20/vendor/agent-skills-upstream/skills/security-and-hardening/SKILL.md +524 -0
- package/.versions/2.0.20/vendor/agent-skills-upstream/skills/shipping-and-launch/SKILL.md +330 -0
- package/.versions/2.0.20/vendor/agent-skills-upstream/skills/source-driven-development/SKILL.md +216 -0
- package/.versions/2.0.20/vendor/agent-skills-upstream/skills/spec-driven-development/SKILL.md +245 -0
- package/.versions/2.0.20/vendor/agent-skills-upstream/skills/test-driven-development/SKILL.md +398 -0
- package/.versions/2.0.20/vendor/agent-skills-upstream/skills/using-agent-skills/SKILL.md +192 -0
- package/CHANGELOG.md +32 -0
- package/README.md +3 -2
- package/agents/builder.md +1 -1
- package/agents/planner.md +6 -4
- package/bin/cli.js +9 -2
- package/bin/lib/apply.js +4 -0
- package/bin/lib/desired.js +2 -0
- package/bin/lib/doctor.js +13 -7
- package/bin/lib/state.js +7 -4
- package/bin/lib/transaction.js +6 -1
- package/bin/lib/validate-overrides.js +7 -3
- package/bin/lib/verify.js +9 -2
- package/docs/ARCHITECTURE.md +177 -74
- package/docs/agent-fleet-setup.md +10 -8
- package/docs/external-project-ai-content.md +17 -2
- package/docs/pi-extensions.md +7 -6
- package/docs/system1-agentic.md +4 -4
- package/docs/system1-config.md +144 -1
- package/docs/system1-context-continuity.md +224 -0
- package/docs/system1-damage-guard.md +172 -0
- package/docs/system1-dispatch-triage.md +169 -0
- package/docs/system1-file-discovery.md +16 -4
- package/docs/system1.example.json +102 -0
- package/install-manifest.json +17 -4
- package/manifest-meta.json +14 -1
- package/package.json +21 -9
- package/skills/_internal/grilling.md +54 -54
- package/skills/incremental-implementation/SKILL.md +8 -8
- package/skills/incremental-implementation.zip +0 -0
- package/skills/planning-and-task-breakdown/SKILL.md +7 -7
- package/skills/planning-and-task-breakdown.zip +0 -0
- package/skills/spec-driven-development/SKILL.md +1 -1
- package/skills/spec-driven-development.zip +0 -0
- package/.pi/harnesses/agent-hub/budget-continuation.ts +0 -13
- package/.pi/harnesses/agent-hub/commands/budget-continue.ts +0 -10
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { resetIdenticalDialogs } from "../lib/identical-dialog.ts";
|
|
2
|
+
import { beginRuntimeTrace, traceAskResult, type TraceBus } from "../lib/execution-trace.ts";
|
|
1
3
|
// ask-user-remote harness
|
|
2
4
|
//
|
|
3
5
|
// Captures the stock pi-ask-user `ask_user` tool, then registers a wrapper with
|
|
@@ -13,6 +15,7 @@ import { fileURLToPath, pathToFileURL } from "node:url";
|
|
|
13
15
|
import { raceAskUser } from "./race-core.js";
|
|
14
16
|
import { questionChannel, type QuestionChannel } from "./questions.ts";
|
|
15
17
|
import { registerRuntimeAsk } from "./runtime-ask.ts";
|
|
18
|
+
import { resetSemanticApprovals } from "../lib/semantic-approval.ts";
|
|
16
19
|
|
|
17
20
|
interface ToolRegistration {
|
|
18
21
|
name: string;
|
|
@@ -26,6 +29,7 @@ interface ExtensionLike {
|
|
|
26
29
|
}
|
|
27
30
|
|
|
28
31
|
interface InstallOptions {
|
|
32
|
+
traceBus?: TraceBus;
|
|
29
33
|
stockFactory?: (pi: ExtensionLike) => void;
|
|
30
34
|
startRemote?: (params: any, ctx?: any) => Promise<{ qid: string; result: Promise<any> } | null> | { qid: string; result: Promise<any> } | null;
|
|
31
35
|
cancelRemote?: (qid: string, reason: string) => Promise<void> | void;
|
|
@@ -386,6 +390,9 @@ export function wrapAskUserTool(stockTool: ToolRegistration, options: InstallOpt
|
|
|
386
390
|
parameters: COMPACT_ASK_USER_PARAMETERS,
|
|
387
391
|
async execute(toolCallId: string, params: any, signal?: AbortSignal, onUpdate?: any, ctx?: any) {
|
|
388
392
|
const stockParams = compactAskUserParams(params);
|
|
393
|
+
const finishTrace = beginRuntimeTrace(options.traceBus, { kind: "approval", id: toolCallId, parentId: toolCallId });
|
|
394
|
+
const traceResult = (result: unknown) => finishTrace(traceAskResult(result, Array.isArray(stockParams.options) ? stockParams.options : []));
|
|
395
|
+
try {
|
|
389
396
|
emitAskUserObservation({ params: stockParams, phase: "start" });
|
|
390
397
|
const configuredProject = typeof options.remoteProject === "function" ? options.remoteProject() : options.remoteProject;
|
|
391
398
|
const remoteProject = configuredProject ?? process.env.PI_COMS_PROJECT?.trim() ?? "default";
|
|
@@ -407,6 +414,7 @@ export function wrapAskUserTool(stockTool: ToolRegistration, options: InstallOpt
|
|
|
407
414
|
};
|
|
408
415
|
if (!remoteStart && !addressed) {
|
|
409
416
|
const result = await stockTool.execute?.(toolCallId, stockParams, signal, onUpdate, ctx);
|
|
417
|
+
traceResult(result);
|
|
410
418
|
emitAskUserObservation({ params: stockParams, result, phase: "result" });
|
|
411
419
|
return result;
|
|
412
420
|
}
|
|
@@ -428,12 +436,14 @@ export function wrapAskUserTool(stockTool: ToolRegistration, options: InstallOpt
|
|
|
428
436
|
registerAnswer: addressed?.registerAnswer,
|
|
429
437
|
onSettled: addressed?.onSettled,
|
|
430
438
|
});
|
|
439
|
+
traceResult(result);
|
|
431
440
|
emitAskUserObservation({ params: stockParams, result, phase: "result" });
|
|
432
441
|
return result;
|
|
433
442
|
} finally {
|
|
434
443
|
signal?.removeEventListener("abort", expire);
|
|
435
444
|
expire();
|
|
436
445
|
}
|
|
446
|
+
} catch (error) { finishTrace({ status: signal?.aborted ? "cancelled" : "failed" }); throw error; }
|
|
437
447
|
},
|
|
438
448
|
};
|
|
439
449
|
}
|
|
@@ -453,6 +463,7 @@ export function installAskUserRemote(pi: ExtensionLike, options: InstallOptions
|
|
|
453
463
|
const stockTool = captureAskUserTool(options.stockFactory, pi);
|
|
454
464
|
const wrapped = wrapAskUserTool(stockTool, {
|
|
455
465
|
...options,
|
|
466
|
+
traceBus: options.traceBus ?? pi.events,
|
|
456
467
|
remoteProject: options.remoteProject ?? (() => resolveRemoteProject(pi)),
|
|
457
468
|
});
|
|
458
469
|
try {
|
|
@@ -460,8 +471,8 @@ export function installAskUserRemote(pi: ExtensionLike, options: InstallOptions
|
|
|
460
471
|
if (pi.events?.on && wrapped.execute) registerRuntimeAsk(pi.events, (...args) => wrapped.execute!(...args));
|
|
461
472
|
const channel = options.questionChannel ?? questionChannel;
|
|
462
473
|
channel.enabled = true;
|
|
463
|
-
pi.on?.("session_start", () => { channel.reset(); channel.enabled = true; });
|
|
464
|
-
pi.on?.("session_shutdown", () => { channel.reset(); channel.enabled = false; });
|
|
474
|
+
pi.on?.("session_start", () => { resetSemanticApprovals(); resetIdenticalDialogs(); channel.reset(); channel.enabled = true; });
|
|
475
|
+
pi.on?.("session_shutdown", () => { resetSemanticApprovals(); resetIdenticalDialogs(); channel.reset(); channel.enabled = false; });
|
|
465
476
|
return { registered: true, tool: wrapped };
|
|
466
477
|
} catch (error) {
|
|
467
478
|
const message = error instanceof Error ? error.message : String(error);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createHash, randomUUID } from 'node:crypto';
|
|
2
2
|
import type { Socket } from 'node:net';
|
|
3
|
+
import { processShared } from '../lib/process-shared.ts';
|
|
3
4
|
|
|
4
5
|
export interface QuestionOwner { project:string; peer:string; sessionId:string; startedAt:string; }
|
|
5
6
|
export interface QuestionParams {
|
|
@@ -129,12 +130,9 @@ function validateAnswer(q:Question,input:unknown):Answer|undefined {
|
|
|
129
130
|
return {kind:'selection',selections:a.selections as string[],...(typeof a.comment==='string'&&a.comment.trim()?{comment:a.comment.trim()}:{})};
|
|
130
131
|
}
|
|
131
132
|
|
|
132
|
-
//
|
|
133
|
-
//
|
|
134
|
-
// channel on the process realm; session_shutdown/reset still expires every address.
|
|
135
|
-
const channelKey=Symbol.for('agent-fleet.addressed-questions.v1');
|
|
133
|
+
// Module-local singletons would split the wrapper from its coms owner, so the channel
|
|
134
|
+
// is process-shared; session_shutdown/reset still expires every address.
|
|
136
135
|
interface SharedChannel {peers:Set<() => QuestionOwner|null>;channel:QuestionChannel;}
|
|
137
|
-
const processState=globalThis as typeof globalThis & {[channelKey]?:SharedChannel};
|
|
138
136
|
function createSharedChannel():SharedChannel {
|
|
139
137
|
const peers=new Set<() => QuestionOwner|null>();
|
|
140
138
|
return {peers,channel:new QuestionChannel(()=>{
|
|
@@ -142,7 +140,7 @@ function createSharedChannel():SharedChannel {
|
|
|
142
140
|
return owners.length===1?owners[0]:null;
|
|
143
141
|
})};
|
|
144
142
|
}
|
|
145
|
-
const shared=
|
|
143
|
+
const shared=processShared('agent-fleet.addressed-questions.v1',createSharedChannel);
|
|
146
144
|
export const questionChannel=shared.channel;
|
|
147
145
|
export function registerQuestionPeer(getOwner:() => QuestionOwner|null) { shared.peers.add(getOwner); return () => { shared.peers.delete(getOwner); }; }
|
|
148
146
|
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { ExtensionContext } from "@mariozechner/pi-coding-agent";
|
|
2
|
+
import {sharedApprovalWait} from '../lib/approval-wait.ts';
|
|
3
|
+
import { beginRuntimeTrace, traceAskResult, type TraceStart } from '../lib/execution-trace.ts';
|
|
2
4
|
|
|
3
5
|
export interface RuntimeQuestion {
|
|
4
6
|
question: string;
|
|
@@ -55,7 +57,20 @@ export function registerRuntimeAsk(bus: RuntimeAskBus, execute: ExecuteAsk): ()
|
|
|
55
57
|
}
|
|
56
58
|
|
|
57
59
|
/** Missing wrapper falls back to an explicit local dialog, never to model prose. */
|
|
58
|
-
export async function requestRuntimeAsk(bus: RuntimeAskBus, id: string, params: RuntimeQuestion, ctx: ExtensionContext, signal?: AbortSignal): Promise<unknown> {
|
|
60
|
+
export async function requestRuntimeAsk(bus: RuntimeAskBus, id: string, params: RuntimeQuestion, ctx: ExtensionContext, signal?: AbortSignal, relation?: Pick<TraceStart, 'parentId' | 'parentKind' | 'owner' | 'source' | 'rule'>): Promise<unknown> {
|
|
61
|
+
validateSingleDecision(id,params);
|
|
62
|
+
const finishQueue=beginRuntimeTrace(bus,{kind:'queue',id,...relation,rule:'approval_queue'});
|
|
63
|
+
try{
|
|
64
|
+
const result=await sharedApprovalWait.run(async waitSignal=>{
|
|
65
|
+
finishQueue({status:'completed'});
|
|
66
|
+
const finish=beginRuntimeTrace(bus,{kind:'approval',id,...relation});
|
|
67
|
+
try{const value=await requestRuntimeAskUnqueued(bus,id,params,ctx,waitSignal);finish(traceAskResult(value,params.options));return value;}
|
|
68
|
+
catch(error){finish({status:waitSignal.aborted?'cancelled':'failed'});throw error;}
|
|
69
|
+
},signal);
|
|
70
|
+
return result??correlateResult(id,{details:{cancelled:true}});
|
|
71
|
+
}finally{finishQueue({status:'cancelled'});}
|
|
72
|
+
}
|
|
73
|
+
async function requestRuntimeAskUnqueued(bus: RuntimeAskBus, id: string, params: RuntimeQuestion, ctx: ExtensionContext, signal?: AbortSignal): Promise<unknown> {
|
|
59
74
|
validateSingleDecision(id, params);
|
|
60
75
|
if (signal?.aborted) return correlateResult(id, { details: { cancelled: true } });
|
|
61
76
|
const request: Request = { id, params, ctx, signal };
|
|
@@ -16,6 +16,31 @@ fails closed, but the turn continues so the agent can report the block or take a
|
|
|
16
16
|
safe alternative. Protected-path calls may proceed only through the explicit
|
|
17
17
|
approval/exemption paths below; inherently dangerous command patterns never can.
|
|
18
18
|
|
|
19
|
+
## Optional assigned D6 semantic layer
|
|
20
|
+
|
|
21
|
+
The baseline above is mandatory and independent of optional System 1 D6.
|
|
22
|
+
Parent Hub owns the shared service, durable task/input decisions and approval
|
|
23
|
+
coordinator. Native specialists, read-only research helpers and nested delegates
|
|
24
|
+
receive independent, revocable physical-attempt assignments bounded by effective
|
|
25
|
+
tools, independently of D9. Pre-call D6 checks cover baseline-allowed bash/write/edit;
|
|
26
|
+
research retains read-only authority and supported result screening only.
|
|
27
|
+
Standalone Damage-Control without a trusted assignment retains baseline, not a
|
|
28
|
+
hidden provider. Coms peers are not covered by native D6 registration.
|
|
29
|
+
|
|
30
|
+
D6 defaults off with separate commands/edits/results export scopes. Only valid
|
|
31
|
+
severe AND sufficient yields a hold/warning; unknown/partial is not clearance or
|
|
32
|
+
a speculative hold. Off/outage does not erase durable denial or restore grants.
|
|
33
|
+
`/af-damage-override [actionId]` arms one new dialog for a current matching blocked
|
|
34
|
+
action (latest eligible action if omitted); it does not execute, clear denial,
|
|
35
|
+
retry or grant path access. `/af-allow` changes only baseline path exemptions;
|
|
36
|
+
it cannot waive semantic denial or a hard command deny. A held effect still
|
|
37
|
+
requires matching one-use human consent and post-wait baseline revalidation.
|
|
38
|
+
|
|
39
|
+
See the [D6 guide](../../../docs/system1-damage-guard.md) for fixed deadlines,
|
|
40
|
+
durable recovery, supported result sources and original→D6→D8 visible structured
|
|
41
|
+
API. Production wiring/local SDK 1.1.0 evidence is not independent acceptance:
|
|
42
|
+
D6, A1–A8, packaging and final regression/review remain open.
|
|
43
|
+
|
|
19
44
|
## Version footer and provenance
|
|
20
45
|
|
|
21
46
|
This persistent-UI harness shows `agent fleet v<version>` below the prompt. It shares one common-key
|
|
@@ -86,6 +111,7 @@ refuses guarded child dispatch rather than launching an unprotected process.
|
|
|
86
111
|
- `/af-allow <pattern> [turn|session]` — exempt a protected path pattern
|
|
87
112
|
- `/af-allowed` — list active exemptions
|
|
88
113
|
- `/af-revoke <pattern>` — remove an exemption
|
|
114
|
+
- `/af-damage-override [actionId]` — Hub-owned D6 dialog re-arm only, not execution or a path exemption
|
|
89
115
|
|
|
90
116
|
Blocking itself runs passively on the `tool_call` event.
|
|
91
117
|
|
|
@@ -34,6 +34,8 @@
|
|
|
34
34
|
|
|
35
35
|
import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
|
|
36
36
|
import { isToolCallEventType } from "@mariozechner/pi-coding-agent";
|
|
37
|
+
import { beginRuntimeTrace, policyTraceReason, TRACE_OWNER_ENV } from "../lib/execution-trace.ts";
|
|
38
|
+
import { analyzeBashCommand, bashReferencesProtectedPath } from "../lib/bash-policy-analysis.ts";
|
|
37
39
|
import { parse as yamlParse } from "yaml";
|
|
38
40
|
import * as crypto from "crypto";
|
|
39
41
|
import * as fs from "fs";
|
|
@@ -57,6 +59,10 @@ import {
|
|
|
57
59
|
import { registerVersionStatus } from "./version.ts";
|
|
58
60
|
import { scheduleFleetUpdateCheck } from "../lib/update-check.ts";
|
|
59
61
|
import { deterministicHandlePath } from "../lib/deterministic-handle-path.ts";
|
|
62
|
+
import {sharedApprovalWait} from '../lib/approval-wait.ts';
|
|
63
|
+
import {assessDamageCall,takeSpawnedDamageAssignment} from '../lib/damage-guard-port.ts';
|
|
64
|
+
import type {createDamageChild} from './system1-child.ts';
|
|
65
|
+
import {captureDamageResult} from '../lib/damage-result-evidence.ts';
|
|
60
66
|
|
|
61
67
|
interface Rule {
|
|
62
68
|
pattern: string;
|
|
@@ -98,7 +104,17 @@ function continueFeedback(toolName: string, violationReason: string, invocation:
|
|
|
98
104
|
].join("\n");
|
|
99
105
|
}
|
|
100
106
|
|
|
101
|
-
export default function (pi: ExtensionAPI) {
|
|
107
|
+
export default function (pi: ExtensionAPI, dependencies: {assignment?:unknown} = {}) {
|
|
108
|
+
const assignment=dependencies.assignment!==undefined?dependencies.assignment:takeSpawnedDamageAssignment();
|
|
109
|
+
let baselineEpoch=0;
|
|
110
|
+
let child: ReturnType<typeof createDamageChild> | undefined;
|
|
111
|
+
pi.on('tool_result', event => {
|
|
112
|
+
captureDamageResult(event);
|
|
113
|
+
return child?.result(event);
|
|
114
|
+
});
|
|
115
|
+
const disposeChild = () => { baselineEpoch++; child?.dispose(); child=undefined; };
|
|
116
|
+
// The SDK emits shutdown for committed switch/quit, not cancelled before-switch.
|
|
117
|
+
pi.on("session_shutdown", async () => { disposeChild(); });
|
|
102
118
|
let rules: Rules = {
|
|
103
119
|
bashToolPatterns: [],
|
|
104
120
|
zeroAccessPaths: [],
|
|
@@ -246,12 +262,14 @@ export default function (pi: ExtensionAPI) {
|
|
|
246
262
|
});
|
|
247
263
|
|
|
248
264
|
pi.on("agent_end", async () => {
|
|
265
|
+
baselineEpoch++;
|
|
249
266
|
turnExemptions.length = 0;
|
|
250
267
|
deniedThisTurn.clear();
|
|
251
268
|
escalationsThisTurn = 0;
|
|
252
269
|
});
|
|
253
270
|
|
|
254
271
|
pi.on("session_start", async (_event, ctx) => {
|
|
272
|
+
disposeChild();
|
|
255
273
|
registerVersionStatus(ctx);
|
|
256
274
|
// Non-blocking: never delay rule loading or session start for a registry fetch.
|
|
257
275
|
scheduleFleetUpdateCheck(ctx);
|
|
@@ -279,9 +297,31 @@ export default function (pi: ExtensionAPI) {
|
|
|
279
297
|
}
|
|
280
298
|
|
|
281
299
|
ctx.ui.setStatus("damage-control", statusText());
|
|
300
|
+
if(assignment!==undefined){
|
|
301
|
+
const epoch=baselineEpoch;
|
|
302
|
+
const {createDamageChild}=await import('./system1-child.ts');
|
|
303
|
+
if(epoch===baselineEpoch)child=createDamageChild(assignment);
|
|
304
|
+
}
|
|
282
305
|
});
|
|
283
306
|
|
|
284
307
|
pi.on("tool_call", async (event, ctx) => {
|
|
308
|
+
const finishPolicy=beginRuntimeTrace(pi.events,{kind:'policy',id:`baseline:${event.toolCallId}`,parentId:event.toolCallId,source:'damage-control',tool:event.toolName});
|
|
309
|
+
let policyAnalysis:'static_operands'|'conservative_text'|undefined;
|
|
310
|
+
const evaluate=async()=>{
|
|
311
|
+
// Capture loaded policy before baseline dialogs, not after the user waits.
|
|
312
|
+
const policySnapshot=JSON.stringify(rules),epoch=baselineEpoch;
|
|
313
|
+
const exactCall=JSON.stringify(event),cwd=ctx.cwd;
|
|
314
|
+
const semanticAllow=async()=>{
|
|
315
|
+
const unchanged=()=>epoch===baselineEpoch&&policySnapshot===JSON.stringify(rules)&&exactCall===JSON.stringify(event)&&cwd===ctx.cwd;
|
|
316
|
+
const blocked={block:true,reason:'Damage-Control: baseline authority changed; re-authorize the call.'};
|
|
317
|
+
if(!unchanged())return blocked;
|
|
318
|
+
const snapshot=JSON.stringify([rules,activeExemptions()]);
|
|
319
|
+
const revalidateBaseline=()=>unchanged()&&snapshot===JSON.stringify([rules,activeExemptions()]);
|
|
320
|
+
const result=await assessDamageCall(event,{cwd,revalidateBaseline});
|
|
321
|
+
// Local authority is checked after the asynchronous parent approval, never
|
|
322
|
+
// serialized as evidence and never replaced by the semantic grant.
|
|
323
|
+
return revalidateBaseline()?result:blocked;
|
|
324
|
+
};
|
|
285
325
|
let violationReason: string | null = null;
|
|
286
326
|
let shouldAsk = false;
|
|
287
327
|
// The protected pattern that matched, set only for the path categories —
|
|
@@ -309,7 +349,15 @@ export default function (pi: ExtensionAPI) {
|
|
|
309
349
|
inputPaths.push(event.input.path);
|
|
310
350
|
} else if (isToolCallEventType("grep", event) || isToolCallEventType("find", event) || isToolCallEventType("ls", event)) {
|
|
311
351
|
inputPaths.push(event.input.path || ".");
|
|
312
|
-
} else if (event.toolName === "
|
|
352
|
+
} else if (event.toolName === "submit_result") {
|
|
353
|
+
// Submission hashes evidence files; enforce the same read policy first.
|
|
354
|
+
for (const ref of Array.isArray((event.input as any).evidence) ? (event.input as any).evidence : []) {
|
|
355
|
+
if (typeof ref?.path === "string") {
|
|
356
|
+
inputPaths.push(ref.path);
|
|
357
|
+
try { inputPaths.push(fs.realpathSync(path.resolve(ctx.cwd,ref.path))); } catch { /* submission validates missing files */ }
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
} else if (event.toolName === "filesystem") {
|
|
313
361
|
// Reuse the same path-policy/exemption/approval pipeline as built-in reads.
|
|
314
362
|
// Handle decoding is metadata-only: policy runs before any source bytes are read.
|
|
315
363
|
if (typeof (event.input as any).path === "string") inputPaths.push((event.input as any).path);
|
|
@@ -350,10 +398,12 @@ export default function (pi: ExtensionAPI) {
|
|
|
350
398
|
if (!violationReason) {
|
|
351
399
|
if (isToolCallEventType("bash", event)) {
|
|
352
400
|
const command = event.input.command;
|
|
401
|
+
const analysis = analyzeBashCommand(command);
|
|
402
|
+
policyAnalysis = analysis ? 'static_operands' : 'conservative_text';
|
|
353
403
|
|
|
354
404
|
for (const rule of rules.bashToolPatterns) {
|
|
355
405
|
const regex = new RegExp(rule.pattern);
|
|
356
|
-
if (regex.test(command)) {
|
|
406
|
+
if (regex.test(analysis?.patternText ?? command)) {
|
|
357
407
|
violationReason = rule.reason;
|
|
358
408
|
shouldAsk = !!rule.ask;
|
|
359
409
|
break;
|
|
@@ -362,7 +412,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
362
412
|
|
|
363
413
|
if (!violationReason) {
|
|
364
414
|
for (const zap of rules.zeroAccessPaths) {
|
|
365
|
-
if (command.includes(zap)) {
|
|
415
|
+
if (analysis ? bashReferencesProtectedPath(analysis, "zero_access", zap, ctx.cwd) : command.includes(zap)) {
|
|
366
416
|
violationReason = `Bash command references zero-access path: ${zap}`;
|
|
367
417
|
matchedPattern = zap;
|
|
368
418
|
matchedCategory = "zero_access";
|
|
@@ -373,7 +423,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
373
423
|
|
|
374
424
|
if (!violationReason) {
|
|
375
425
|
for (const rop of rules.readOnlyPaths) {
|
|
376
|
-
if (command.includes(rop) && (/[\s>|]/.test(command) || command.includes("rm") || command.includes("mv") || command.includes("sed"))) {
|
|
426
|
+
if (analysis ? bashReferencesProtectedPath(analysis, "read_only", rop, ctx.cwd) : command.includes(rop) && (/[\s>|]/.test(command) || command.includes("rm") || command.includes("mv") || command.includes("sed"))) {
|
|
377
427
|
violationReason = `Bash command may modify read-only path: ${rop}`;
|
|
378
428
|
matchedPattern = rop;
|
|
379
429
|
matchedCategory = "read_only";
|
|
@@ -383,11 +433,11 @@ export default function (pi: ExtensionAPI) {
|
|
|
383
433
|
}
|
|
384
434
|
|
|
385
435
|
if (!violationReason) {
|
|
386
|
-
const hasDeleteOrMove = /\brm\b/.test(command) || /\bmv\b/.test(command);
|
|
436
|
+
const hasDeleteOrMove = analysis || /\brm\b/.test(command) || /\bmv\b/.test(command);
|
|
387
437
|
if (hasDeleteOrMove) {
|
|
388
438
|
for (const ndp of rules.noDeletePaths) {
|
|
389
439
|
const expanded = expandTilde(ndp);
|
|
390
|
-
const matched = commandReferencesPath(command, ndp) || (expanded !== ndp && commandReferencesPath(command, expanded));
|
|
440
|
+
const matched = analysis ? bashReferencesProtectedPath(analysis, "no_delete", ndp, ctx.cwd) : commandReferencesPath(command, ndp) || (expanded !== ndp && commandReferencesPath(command, expanded));
|
|
391
441
|
if (matched) {
|
|
392
442
|
violationReason = `Bash command attempts to delete/move protected path: ${ndp}`;
|
|
393
443
|
matchedPattern = ndp;
|
|
@@ -413,7 +463,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
413
463
|
}
|
|
414
464
|
|
|
415
465
|
if (!violationReason) {
|
|
416
|
-
return
|
|
466
|
+
return semanticAllow();
|
|
417
467
|
}
|
|
418
468
|
|
|
419
469
|
const command = isToolCallEventType("bash", event) ? event.input.command : null;
|
|
@@ -425,7 +475,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
425
475
|
if (exempted) {
|
|
426
476
|
pi.appendEntry("damage-control-log", { tool: event.toolName, input: event.input, rule: violationReason, action: "exempted", pattern: exempted.pattern, scope: exempted.scope });
|
|
427
477
|
ctx.ui.notify(`🛡️ Damage-Control: ${event.toolName} allowed by exemption ${exempted.pattern} (${exempted.scope})`, "warning");
|
|
428
|
-
return
|
|
478
|
+
return semanticAllow();
|
|
429
479
|
}
|
|
430
480
|
|
|
431
481
|
if (!deniedThisTurn.has(matchedPattern)) {
|
|
@@ -439,19 +489,25 @@ export default function (pi: ExtensionAPI) {
|
|
|
439
489
|
const choices = matchedCategory === "no_delete"
|
|
440
490
|
? [KEEP, ONCE]
|
|
441
491
|
: [KEEP, ONCE, TURN, SESSION];
|
|
442
|
-
const
|
|
492
|
+
const finishQueue=beginRuntimeTrace(pi.events,{kind:'queue',id:`baseline:${event.toolCallId}`,parentId:event.toolCallId,source:'damage-control',reason:'approval_queue'});
|
|
493
|
+
const choice = await sharedApprovalWait.run(async signal=>{
|
|
494
|
+
finishQueue({status:'completed'});
|
|
495
|
+
const finish=beginRuntimeTrace(pi.events,{kind:'approval',id:`baseline:${event.toolCallId}`,parentId:event.toolCallId,source:'damage-control',rule:matchedPattern!});
|
|
496
|
+
try{const selected=await ctx.ui.select(
|
|
443
497
|
`🛡️ Blocked: ${event.toolName} — ${violationReason}`,
|
|
444
498
|
choices,
|
|
445
|
-
{ timeout: PROMPT_TIMEOUT_MS },
|
|
446
|
-
|
|
499
|
+
{ timeout: PROMPT_TIMEOUT_MS, signal },
|
|
500
|
+
);finish({status:selected===KEEP?'denied':selected?'allowed':'cancelled'});return selected;
|
|
501
|
+
}catch(error){finish({status:'failed'});throw error;}
|
|
502
|
+
}).finally(()=>finishQueue({status:'cancelled'}));
|
|
447
503
|
if (choice === ONCE) {
|
|
448
504
|
pi.appendEntry("damage-control-log", { tool: event.toolName, input: event.input, rule: violationReason, action: "allowed_once", pattern: matchedPattern });
|
|
449
|
-
return
|
|
505
|
+
return semanticAllow();
|
|
450
506
|
}
|
|
451
507
|
if (choice === TURN || choice === SESSION) {
|
|
452
508
|
grantExemption(matchedPattern, choice === TURN ? "turn" : "session", "prompt");
|
|
453
509
|
ctx.ui.setStatus("damage-control", statusText());
|
|
454
|
-
return
|
|
510
|
+
return semanticAllow();
|
|
455
511
|
}
|
|
456
512
|
const note = choice === KEEP
|
|
457
513
|
? `The user reviewed this call and kept the block in place.`
|
|
@@ -476,6 +532,8 @@ export default function (pi: ExtensionAPI) {
|
|
|
476
532
|
timestamp: new Date().toISOString(),
|
|
477
533
|
agent: agentId(),
|
|
478
534
|
tool: event.toolName,
|
|
535
|
+
toolCallId: event.toolCallId,
|
|
536
|
+
traceOwner: process.env[TRACE_OWNER_ENV],
|
|
479
537
|
rule: violationReason,
|
|
480
538
|
pattern: matchedPattern,
|
|
481
539
|
category: matchedCategory!,
|
|
@@ -484,14 +542,14 @@ export default function (pi: ExtensionAPI) {
|
|
|
484
542
|
const decision = await requestAccessFromHub(endpoint, req);
|
|
485
543
|
if (decision === "allow_once") {
|
|
486
544
|
pi.appendEntry("damage-control-log", { tool: event.toolName, input: event.input, rule: violationReason, action: "allowed_once", pattern: matchedPattern, via: "escalation" });
|
|
487
|
-
return
|
|
545
|
+
return semanticAllow();
|
|
488
546
|
}
|
|
489
547
|
if (decision === "allow_agent" || decision === "allow_all") {
|
|
490
548
|
// The hub persisted the grant to the shared file; keep a memory
|
|
491
549
|
// copy too so this run doesn't depend on re-reading it.
|
|
492
550
|
sessionExemptions.push({ pattern: matchedPattern, scope: "session", grantedVia: "escalation", grantedAt: new Date().toISOString() });
|
|
493
551
|
pi.appendEntry("damage-control-log", { tool: event.toolName, input: event.input, rule: violationReason, action: decision === "allow_all" ? "allowed_all_agents" : "allowed_this_agent", pattern: matchedPattern, via: "escalation" });
|
|
494
|
-
return
|
|
552
|
+
return semanticAllow();
|
|
495
553
|
}
|
|
496
554
|
deniedThisTurn.add(matchedPattern);
|
|
497
555
|
const note = decision === "deny"
|
|
@@ -506,11 +564,17 @@ export default function (pi: ExtensionAPI) {
|
|
|
506
564
|
}
|
|
507
565
|
|
|
508
566
|
if (shouldAsk) {
|
|
509
|
-
const
|
|
567
|
+
const finishQueue=beginRuntimeTrace(pi.events,{kind:'queue',id:`destructive:${event.toolCallId}`,parentId:event.toolCallId,source:'damage-control',reason:'approval_queue'});
|
|
568
|
+
const confirmed = await sharedApprovalWait.run(async signal=>{
|
|
569
|
+
finishQueue({status:'completed'});
|
|
570
|
+
const finish=beginRuntimeTrace(pi.events,{kind:'approval',id:`destructive:${event.toolCallId}`,parentId:event.toolCallId,source:'damage-control',rule:violationReason!});
|
|
571
|
+
try{const selected=await ctx.ui.confirm(
|
|
510
572
|
"🛡️ Damage-Control Confirmation",
|
|
511
573
|
`Dangerous command detected: ${violationReason}\n\nCommand: ${invocation}\n\nDo you want to proceed?`,
|
|
512
|
-
{ timeout: 30000 },
|
|
513
|
-
|
|
574
|
+
{ timeout: 30000, signal },
|
|
575
|
+
);finish({status:selected?'allowed':'denied'});return selected;
|
|
576
|
+
}catch(error){finish({status:'failed'});throw error;}
|
|
577
|
+
}).finally(()=>finishQueue({status:'cancelled'}));
|
|
514
578
|
|
|
515
579
|
if (!confirmed) {
|
|
516
580
|
ctx.ui.setStatus("damage-control", `⚠️ Last Violation Blocked: ${violationReason.slice(0, 30)}...`);
|
|
@@ -518,7 +582,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
518
582
|
return { block: true, reason: continueFeedback(event.toolName, `${violationReason} (user denied)`, invocation) };
|
|
519
583
|
} else {
|
|
520
584
|
pi.appendEntry("damage-control-log", { tool: event.toolName, input: event.input, rule: violationReason, action: "confirmed_by_user" });
|
|
521
|
-
return
|
|
585
|
+
return semanticAllow();
|
|
522
586
|
}
|
|
523
587
|
} else {
|
|
524
588
|
const note = matchedPattern
|
|
@@ -529,5 +593,8 @@ export default function (pi: ExtensionAPI) {
|
|
|
529
593
|
pi.appendEntry("damage-control-log", { tool: event.toolName, input: event.input, rule: violationReason, action: "blocked" });
|
|
530
594
|
return { block: true, reason: continueFeedback(event.toolName, violationReason, invocation, note) };
|
|
531
595
|
}
|
|
596
|
+
};
|
|
597
|
+
try{const result=await evaluate();finishPolicy({status:result?.block?'blocked':'allowed',analysis:policyAnalysis,...(result?.reason?{rule:result.reason.split('\n',1)[0],reason:policyTraceReason(result.reason)}:{})});return result;}
|
|
598
|
+
catch(error){finishPolicy({status:'failed'});throw error;}
|
|
532
599
|
});
|
|
533
600
|
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import {createHash} from 'node:crypto';
|
|
2
|
+
import {resolve,isAbsolute} from 'node:path';
|
|
3
|
+
import {damageCaptureAvailable} from '../lib/damage-result-evidence.ts';
|
|
4
|
+
import {damageResultView} from '../lib/damage-result-view.ts';
|
|
5
|
+
import {safeSourceRead} from '../lib/safe-source-read.js';
|
|
6
|
+
import {screenDamagePayload} from '../lib/system1/payload-screen.ts';
|
|
7
|
+
import {parseDamageGuardConfig} from '../lib/system1/config-damage-guard.js';
|
|
8
|
+
import {DAMAGE_GUARD_VERSION,DAMAGE_GUARD_QUESTIONS,damageVerdict} from '../agent-hub/damage-guard-contract.ts';
|
|
9
|
+
import type {System1Service,System1Result} from '../lib/system1/contracts.ts';
|
|
10
|
+
export interface DamageResultEvent {toolName:string;toolCallId:string;input:unknown;content:readonly any[];details?:unknown;structuredContent?:unknown;isError?:boolean;usage?:unknown;status?:string;exit_code?:number;exitCode?:number;}
|
|
11
|
+
const record=(v:unknown):v is Record<string,any>=>!!v&&typeof v==='object'&&!Array.isArray(v);
|
|
12
|
+
/** Only complete output with a single verifiable authorized file source is supported. */
|
|
13
|
+
function extract(event:DamageResultEvent,cwd?:string):{path:string;text:string;hash?:string}|undefined {
|
|
14
|
+
if(event.isError||event.status!==undefined&&!['ok','success','done'].includes(event.status)||event.exit_code!==undefined&&event.exit_code!==0||event.exitCode!==undefined&&event.exitCode!==0||!record(event.input)||event.content.length!==1||event.content[0]?.type!=='text'||typeof event.content[0].text!=='string')return;
|
|
15
|
+
const input=event.input,text=event.content[0].text,details=event.details;
|
|
16
|
+
if(event.toolName==='read'){
|
|
17
|
+
if(typeof input.path!=='string'||input.offset!==undefined&&input.offset!==1||input.limit!==undefined)return;
|
|
18
|
+
if(details!==undefined&&(!record(details)||Object.keys(details).some(k=>k!=='truncation')||details.truncation?.truncated!==false))return;
|
|
19
|
+
if(event.structuredContent!==undefined&&event.structuredContent!==text)return;
|
|
20
|
+
return {path:resolve(cwd??'.',input.path),text};
|
|
21
|
+
}
|
|
22
|
+
if(event.toolName==='bash'){
|
|
23
|
+
if(typeof input.command!=='string'||!record(event.structuredContent))return;
|
|
24
|
+
// No expansion, quotes, pipeline, redirection, substitution or unknown shell form.
|
|
25
|
+
const match=/^cat[ \t]+(?:(--)[ \t]+)?([A-Za-z0-9_./-]+)$/.exec(input.command.trim());
|
|
26
|
+
const output=event.structuredContent;
|
|
27
|
+
if(!match||!match[1]&&match[2].startsWith('-')||output.truncated!==false||output.exit_code!==0||typeof output.output!=='string')return;
|
|
28
|
+
return {path:resolve(cwd??'.',match[2]),text:output.output};
|
|
29
|
+
}
|
|
30
|
+
if(event.toolName==='filesystem'&&input.operation==='excerpt'&&typeof input.path==='string'&&record(details)&&record(details.result)){
|
|
31
|
+
const value=details.result;
|
|
32
|
+
if(value.refused||typeof value.path!=='string'||!isAbsolute(value.path)||cwd!==undefined&&value.path!==resolve(cwd,input.path)||value.exactBytesOnDisk!==value.path||value.contentEncoding!=='utf8'||typeof value.content!=='string'||value.offset!==0||value.truncated!==false||value.nextHandle!==null||value.untrusted!==true||value.modelDelegated!==false||typeof value.hash!=='string'||!/^[a-f0-9]{64}$/.test(value.hash)||value.contentBytes!==Buffer.byteLength(value.content)||value.totalBytes!==value.contentBytes)return;
|
|
33
|
+
try{if(JSON.stringify(JSON.parse(text))!==JSON.stringify(value))return;}catch{return;}
|
|
34
|
+
return {path:value.path,text:value.content,hash:value.hash};
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
export const DAMAGE_RESULT_REASONS=['original_capture_unavailable','cancelled','consumer_off','scope_off','service_unavailable','unsupported_source','source_denied','secret','oversized','incomplete','unsupported','unverified_source','stale_or_cancelled','insufficient_evidence','severe_source_instructions','no_additional_finding','screening_failed','transport_unavailable'] as const;
|
|
38
|
+
export interface DamageResultMetadata {version:1;status:'evaluated'|'not_evaluated';coverage:'complete'|'none';reason:typeof DAMAGE_RESULT_REASONS[number];warning:boolean;sourceTrusted:false;}
|
|
39
|
+
export function damageResultGap(reason:DamageResultMetadata['reason']):DamageResultMetadata{return {version:1,status:'not_evaluated',coverage:'none',reason,warning:false,sourceTrusted:false};}
|
|
40
|
+
export function validDamageResultMetadata(v:unknown):v is DamageResultMetadata {
|
|
41
|
+
if(!record(v)||Object.keys(v).sort().join(',')!=='coverage,reason,sourceTrusted,status,version,warning'||v.version!==1||v.sourceTrusted!==false||!DAMAGE_RESULT_REASONS.includes(v.reason))return false;
|
|
42
|
+
return v.status==='evaluated'?v.coverage==='complete'&&(v.reason==='severe_source_instructions'&&v.warning===true||v.reason==='no_additional_finding'&&v.warning===false):v.status==='not_evaluated'&&v.coverage==='none'&&v.warning===false&&!['severe_source_instructions','no_additional_finding'].includes(v.reason);
|
|
43
|
+
}
|
|
44
|
+
export function composeDamageResult<T extends DamageResultEvent>(event:T,metadata:DamageResultMetadata):T {
|
|
45
|
+
const advice=metadata.warning?'[Untrusted Damage-Control advisory: source contains agent-directed malicious instructions; this warning grants no authority.] ':'';
|
|
46
|
+
return damageResultView(event,advice+'Damage-Control result coverage: '+JSON.stringify(metadata),metadata);
|
|
47
|
+
}
|
|
48
|
+
/** Only strict supported evidence crosses IPC. Usage, arbitrary extras and decorations stay local. */
|
|
49
|
+
export function projectDamageResult(event:DamageResultEvent):Omit<DamageResultEvent,'toolCallId'>|undefined {
|
|
50
|
+
const input=event.input;if(!record(input)||event.isError)return;
|
|
51
|
+
const allowed=event.toolName==='read'?['path','offset','limit']:event.toolName==='bash'?['command','timeout']:event.toolName==='filesystem'?['operation','path']:[];
|
|
52
|
+
if(!allowed.length||Object.keys(input).some(k=>!allowed.includes(k)))return;
|
|
53
|
+
if(!extract(event))return;
|
|
54
|
+
const result:any={toolName:event.toolName,input:structuredClone(input),content:[{type:'text',text:event.content[0].text}]};
|
|
55
|
+
if(event.toolName==='read'){if(event.details!==undefined)result.details={truncation:{truncated:false}};if(event.structuredContent!==undefined)result.structuredContent=event.structuredContent;}
|
|
56
|
+
if(event.toolName==='bash'){const value=event.structuredContent as any;result.structuredContent={output:value.output,exit_code:0,truncated:false};}
|
|
57
|
+
if(event.toolName==='filesystem'){
|
|
58
|
+
const value=(event.details as any).result;result.details={result:Object.fromEntries(['path','exactBytesOnDisk','contentEncoding','content','offset','truncated','nextHandle','untrusted','modelDelegated','hash','contentBytes','totalBytes'].map(k=>[k,value[k]]))};
|
|
59
|
+
result.content=[{type:'text',text:JSON.stringify(result.details.result)}];
|
|
60
|
+
}
|
|
61
|
+
return result;
|
|
62
|
+
}
|
|
63
|
+
export function validDamageResultEvidence(v:unknown):boolean {
|
|
64
|
+
try {if(!record(v)||Object.keys(v).some(k=>!['toolName','input','content','details','structuredContent'].includes(k)))return false;const projected=projectDamageResult({...v,toolCallId:''} as DamageResultEvent);return !!projected&&JSON.stringify(projected)===JSON.stringify(v);}catch{return false;}
|
|
65
|
+
}
|
|
66
|
+
export function createDamageResultScreen(deps:{root:string;config:ReturnType<typeof parseDamageGuardConfig>;canRead(path:string):boolean;service?:System1Service;signal?:AbortSignal;context():string}){
|
|
67
|
+
let disposed=false,backoff=0;const lifetime=new AbortController();
|
|
68
|
+
const screen={dispose(){disposed=true;lifetime.abort();},async evaluate(event:DamageResultEvent,cwd:string,options:{owner?:string;signal?:AbortSignal;deadlineAt?:number;current?():boolean}={}):Promise<DamageResultMetadata>{
|
|
69
|
+
const context=deps.context();
|
|
70
|
+
const finish=(reason:DamageResultMetadata['reason'],warning=false,complete=false):DamageResultMetadata=>({version:1,status:complete?'evaluated':'not_evaluated',coverage:complete?'complete':'none',reason,warning,sourceTrusted:false});
|
|
71
|
+
if(!damageCaptureAvailable(event))return finish('original_capture_unavailable');
|
|
72
|
+
if(disposed||deps.signal?.aborted||options.signal?.aborted)return finish('cancelled');
|
|
73
|
+
if(deps.config.mode!=='active')return finish('consumer_off');
|
|
74
|
+
if(!deps.config.remoteScopes.results)return finish('scope_off');
|
|
75
|
+
if(!deps.service||Date.now()<backoff)return finish('service_unavailable');
|
|
76
|
+
const source=extract(event,cwd);if(!source)return finish('unsupported_source');
|
|
77
|
+
const controller=new AbortController(),abort=()=>controller.abort();options.signal?.addEventListener('abort',abort,{once:true});deps.signal?.addEventListener('abort',abort,{once:true});lifetime.signal.addEventListener('abort',abort,{once:true});
|
|
78
|
+
const deadline=Math.min(Date.now()+deps.config.limits.hookTimeoutMs,options.deadlineAt??Infinity);if(deadline<=Date.now()){options.signal?.removeEventListener('abort',abort);deps.signal?.removeEventListener('abort',abort);lifetime.signal.removeEventListener('abort',abort);return finish('cancelled');}const timer=setTimeout(abort,deadline-Date.now());
|
|
79
|
+
try{
|
|
80
|
+
const screened=await screenDamagePayload({kind:'result',path:source.path,text:source.text,complete:true},{root:deps.root,config:deps.config,canRead:deps.canRead,signal:controller.signal});
|
|
81
|
+
if(screened.status!=='ready')return finish(screened.reason);
|
|
82
|
+
// Authorization/include checks precede this bounded local provenance check.
|
|
83
|
+
// Output from an unknown/overridden shell, changed alias or partial read never substitutes for source bytes.
|
|
84
|
+
const body=safeSourceRead(deps.root,source.path,deps.config.limits.maxPayloadBytes,()=>{if(controller.signal.aborted||!deps.canRead(source.path))throw Error('source_denied');});
|
|
85
|
+
if(!body.equals(Buffer.from(source.text,'utf8'))||source.hash&&source.hash!==createHash('sha256').update(body).digest('hex'))return finish('unverified_source');
|
|
86
|
+
if(controller.signal.aborted||options.current?.()===false)return finish('stale_or_cancelled');
|
|
87
|
+
const request={state:{owner:options.owner??'hub',trigger:event.toolName,scope:'results',coverage:screened.coverage,bytes:screened.bytes,payload:screened.payload},questions:DAMAGE_GUARD_QUESTIONS,questionSetVersion:DAMAGE_GUARD_VERSION,timeoutMs:Math.max(1,deadline-Date.now()),signal:controller.signal};
|
|
88
|
+
if(Buffer.byteLength(JSON.stringify({...request,signal:undefined}))>deps.config.limits.maxPayloadBytes)return finish('oversized');
|
|
89
|
+
const result=await Promise.race([deps.service.evaluate(request),new Promise<System1Result>(resolve=>{if(controller.signal.aborted)resolve({status:'cancelled'});else controller.signal.addEventListener('abort',()=>resolve({status:'cancelled'}),{once:true});})]);
|
|
90
|
+
if(disposed||controller.signal.aborted||options.signal?.aborted||options.current?.()===false||context!==deps.context()||!deps.canRead(source.path))return finish('stale_or_cancelled');
|
|
91
|
+
if(result.status!=='ok'){backoff=Date.now()+deps.config.limits.outageBackoffMs;return finish('service_unavailable');}
|
|
92
|
+
const verdict=damageVerdict(result,'result');
|
|
93
|
+
return verdict==='not_evaluated'?finish('insufficient_evidence'):finish(verdict==='warn_result'?'severe_source_instructions':'no_additional_finding',verdict==='warn_result',true);
|
|
94
|
+
}catch{return finish(disposed||deps.signal?.aborted?'cancelled':'screening_failed');}
|
|
95
|
+
finally{clearTimeout(timer);options.signal?.removeEventListener('abort',abort);deps.signal?.removeEventListener('abort',abort);lifetime.signal.removeEventListener('abort',abort);}
|
|
96
|
+
}};
|
|
97
|
+
return {...screen,async result<T extends DamageResultEvent>(event:T,cwd:string):Promise<T>{return composeDamageResult(event,await screen.evaluate(event,cwd));}};
|
|
98
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import {createDamageClient} from './system1-client.ts';
|
|
2
|
+
import {registerDamageGuard} from '../lib/damage-guard-port.ts';
|
|
3
|
+
import {captureDamageResult,damageCaptureState,originalDamageResult} from '../lib/damage-result-evidence.ts';
|
|
4
|
+
import {composeDamageResult,damageResultGap,type DamageResultEvent} from './result-screen.ts';
|
|
5
|
+
|
|
6
|
+
/** Explicit in-process assignment only. Construct during awaited session startup.
|
|
7
|
+
* The parent authenticates capability ownership; no child identity or baseline
|
|
8
|
+
* callback crosses IPC. Missing assignment must leave a parent port untouched.
|
|
9
|
+
*/
|
|
10
|
+
export function createDamageChild(assignment?:unknown){
|
|
11
|
+
const client=createDamageClient(assignment),seen=new Set<string>(),results=new WeakMap<object,Promise<DamageResultEvent>>();
|
|
12
|
+
let disposed=false;
|
|
13
|
+
const unregister=assignment===undefined?()=>{}:registerDamageGuard({async call(event,ctx){
|
|
14
|
+
if(!['bash','write','edit'].includes(event.toolName))return {block:false};
|
|
15
|
+
const blocked=()=>({block:true,reason:'Damage-Control: assigned assessment did not authorize this call; re-authorize before retrying.'});
|
|
16
|
+
if(disposed||seen.has(event.toolCallId))return blocked();
|
|
17
|
+
// Observers/replays never spend the same local admission twice.
|
|
18
|
+
seen.add(event.toolCallId);
|
|
19
|
+
let exact:string;
|
|
20
|
+
try{exact=JSON.stringify([event,ctx.cwd]);}catch{return blocked();}
|
|
21
|
+
const result=await client.assess(event.toolName,event.input);
|
|
22
|
+
try{
|
|
23
|
+
if(disposed||exact!==JSON.stringify([event,ctx.cwd])||!ctx.revalidateBaseline?.())return blocked();
|
|
24
|
+
}catch{return blocked();}
|
|
25
|
+
return ['no_hold','unavailable','granted'].includes(result.outcome)?{block:false}:blocked();
|
|
26
|
+
}});
|
|
27
|
+
return {result<T extends DamageResultEvent>(event:T):Promise<T>{
|
|
28
|
+
const prior=results.get(event);if(prior)return prior as Promise<T>;
|
|
29
|
+
const deadlineAt=performance.timeOrigin+performance.now()+2000;
|
|
30
|
+
captureDamageResult(event);
|
|
31
|
+
const original=originalDamageResult(event);
|
|
32
|
+
const work=(async()=>composeDamageResult(event,damageCaptureState(event)!=='captured'||!original?damageResultGap('original_capture_unavailable'):await client.result(original,{deadlineAt})))();
|
|
33
|
+
results.set(event,work);return work;
|
|
34
|
+
},dispose(){if(disposed)return;disposed=true;client.dispose();unregister();}};
|
|
35
|
+
}
|