@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,7 +1,16 @@
|
|
|
1
|
+
import { resultFromToolEvent } from "./specialist-result-receipt.ts";
|
|
2
|
+
import type { SpecialistResult } from "./specialist-result.ts";
|
|
3
|
+
import { createContextContinuityBroker } from './context-continuity-broker.ts';
|
|
4
|
+
import { openContextOwner, revokeContextOwner } from './context-continuity-owners.ts';
|
|
5
|
+
import { CONTEXT_CHANNEL_ENV, parseContextChannel } from './context-continuity-client.ts';
|
|
6
|
+
import { fileURLToPath } from 'node:url';
|
|
7
|
+
let contextBroker: ReturnType<typeof createContextContinuityBroker> | undefined;
|
|
1
8
|
import { runtimeTestFromResult, type RuntimeTestRecord } from "./runtime-test-check.ts";
|
|
2
9
|
import { createToolEventRecorder, type ToolExecutionEvent } from "./tool-protocol.ts";
|
|
3
10
|
import { readActiveProfile, assertProfileModel, profileFallback, withProfileWork, PROFILE_ENV, type ActiveModelProfile } from './policy/profile-runtime.ts';
|
|
4
11
|
import { DISCOVERY_CHILD_ENV_KEYS, openDiscoveryAttempt, type DiscoverySpawnRegistration } from './file-discovery/owners.ts';
|
|
12
|
+
import { realpathSync } from 'node:fs';
|
|
13
|
+
import { damageAssignmentEnv, type DamagePhysicalLease, type DamageSpawnRegistration } from './damage-guard-owners.ts';
|
|
5
14
|
import { SYSTEM1_API_KEY_ENV } from "../lib/system1/config.js";
|
|
6
15
|
import { confineNativeChild, type WriteIsolationRequest, type WriteIsolationResult } from "./write-isolation.ts";
|
|
7
16
|
/**
|
|
@@ -55,8 +64,11 @@ export interface ToolWatchdogOptions {
|
|
|
55
64
|
export interface SpawnPiAgentOptions {
|
|
56
65
|
/** Trusted parent registration; a fresh lease is opened for EVERY physical launch. Never an env override. */
|
|
57
66
|
discoveryRegistration?: DiscoverySpawnRegistration;
|
|
67
|
+
/** Independent trusted D6 factory; never inherited or coupled to D9 readiness. */
|
|
68
|
+
damageRegistration?: DamageSpawnRegistration;
|
|
58
69
|
/** Enabled only by native preparation with the runtime observer extension. */
|
|
59
70
|
runtimeTestObserver?: boolean;
|
|
71
|
+
specialistResultTool?: boolean;
|
|
60
72
|
/** Snapshotted at dispatch start; presence prevents a mid-run profile switch changing this launch. */
|
|
61
73
|
activeProfileSnapshot?: ActiveModelProfile;
|
|
62
74
|
/** Native-only whole-process write boundary. Omission preserves the legacy launch. */
|
|
@@ -121,6 +133,8 @@ export interface SpawnPiAgentCallbacks {
|
|
|
121
133
|
}
|
|
122
134
|
|
|
123
135
|
export interface SpawnPiAgentResult {
|
|
136
|
+
specialistResult?: SpecialistResult;
|
|
137
|
+
specialistResultTool?: boolean;
|
|
124
138
|
runtimeTests?: RuntimeTestRecord[];
|
|
125
139
|
toolEvents?: ToolExecutionEvent[];
|
|
126
140
|
output: string;
|
|
@@ -182,7 +196,7 @@ export function nativeChildEnv(
|
|
|
182
196
|
else merged[key] = value;
|
|
183
197
|
}
|
|
184
198
|
}
|
|
185
|
-
for (const key of Object.keys(merged)) if (key.startsWith('AF_D9_') || (NATIVE_CHILD_STRIPPED_ENV_KEYS as readonly string[]).includes(key)) delete merged[key];
|
|
199
|
+
for (const key of Object.keys(merged)) if (key.startsWith('AF_D6') || key.startsWith('AF_D9_') || key.startsWith('AF_D7_') || (NATIVE_CHILD_STRIPPED_ENV_KEYS as readonly string[]).includes(key)) delete merged[key];
|
|
186
200
|
return merged;
|
|
187
201
|
}
|
|
188
202
|
|
|
@@ -234,15 +248,48 @@ async function spawnPiAgentUnchecked(
|
|
|
234
248
|
const generation = opts.physicalAttempt?.generation ?? 1;
|
|
235
249
|
let attemptSignal: AbortSignal | undefined;
|
|
236
250
|
let discoveryAttempt: ReturnType<typeof openDiscoveryAttempt> | undefined;
|
|
251
|
+
let damageLease: DamagePhysicalLease | undefined;
|
|
252
|
+
let damageEnv: Record<string,string> | undefined;
|
|
253
|
+
let damageRevoked = false;
|
|
254
|
+
const revokeDamage = () => {
|
|
255
|
+
if (damageRevoked || !damageLease) return;
|
|
256
|
+
damageRevoked = true; // Revocation can synchronously abort and re-enter kill.
|
|
257
|
+
damageLease.revoke();
|
|
258
|
+
};
|
|
259
|
+
const damageTools = opts.tools.split(',').map(t=>t.trim()).filter((t,i,all)=>['bash','write','edit','read','filesystem'].includes(t) && opts.damageRegistration?.tools.includes(t) && all.indexOf(t)===i);
|
|
260
|
+
const damageAssigned = damageTools.length > 0;
|
|
261
|
+
const checkDamage = () => {
|
|
262
|
+
if (!damageAssigned) return;
|
|
263
|
+
let valid = false;
|
|
264
|
+
try {
|
|
265
|
+
valid = opts.damageRegistration!.validate() === true && (!damageLease || (!damageRevoked && !damageLease.identity.signal.aborted && damageLease.validate() === true));
|
|
266
|
+
} catch { /* Lost authority is terminal, not optional inference unavailability. */ }
|
|
267
|
+
if (!valid) { revokeDamage(); throw Error('damage_physical_authority_unavailable'); }
|
|
268
|
+
};
|
|
269
|
+
let contextOwner: ReturnType<typeof openContextOwner> | undefined;
|
|
270
|
+
let contextAssignment: string | undefined;
|
|
237
271
|
let attemptEnded = false;
|
|
238
272
|
const endAttempt = () => {
|
|
239
273
|
if (attemptEnded) return;
|
|
240
274
|
attemptEnded = true;
|
|
275
|
+
revokeDamage();
|
|
241
276
|
discoveryAttempt?.revoke();
|
|
277
|
+
if(contextOwner) revokeContextOwner(contextOwner.attempt);
|
|
242
278
|
opts.attemptLifecycle?.afterPhysicalSpawn({ generation });
|
|
243
279
|
};
|
|
244
280
|
try {
|
|
245
281
|
attemptSignal = opts.attemptLifecycle?.beforePhysicalSpawn({ generation })?.signal;
|
|
282
|
+
if (!opts.signal?.aborted && !attemptSignal?.aborted && damageAssigned) {
|
|
283
|
+
checkDamage();
|
|
284
|
+
const cwd = realpathSync(opts.cwd ?? process.cwd());
|
|
285
|
+
try { damageLease = await opts.damageRegistration!.open({tools:damageTools,cwd}); }
|
|
286
|
+
catch { throw Error('damage_physical_registration_unavailable'); }
|
|
287
|
+
try {
|
|
288
|
+
if (!damageLease || typeof damageLease.revoke !== 'function' || typeof damageLease.validate !== 'function' || !damageLease.identity?.signal || !damageLease.identity.attempt || !damageLease.identity.owner || damageLease.identity.cwd !== cwd || damageLease.identity.tools.length !== damageTools.length || damageTools.some(t=>!damageLease!.identity.tools.includes(t))) throw Error();
|
|
289
|
+
damageEnv = damageAssignmentEnv(damageLease.assignment);
|
|
290
|
+
} catch { throw Error('damage_physical_lease_invalid'); }
|
|
291
|
+
checkDamage();
|
|
292
|
+
}
|
|
246
293
|
if (!opts.signal?.aborted && !attemptSignal?.aborted && opts.discoveryRegistration) {
|
|
247
294
|
// Do not let even a parent registration claim tools absent from the physical command.
|
|
248
295
|
const effectiveTools = opts.tools.split(',').map(t=>t.trim()).filter(t=>opts.discoveryRegistration!.owner.effectiveTools.includes(t));
|
|
@@ -255,7 +302,7 @@ async function spawnPiAgentUnchecked(
|
|
|
255
302
|
opts={...opts,prompt:opts.prompt+'\n\nFile discovery physical attempt: unavailable (registration unavailable). Continue ordinary permitted discovery; original task, scope and gates remain authoritative.'};
|
|
256
303
|
}
|
|
257
304
|
}
|
|
258
|
-
if (opts.signal?.aborted || attemptSignal?.aborted || discoveryAttempt?.signal.aborted) {
|
|
305
|
+
if (opts.signal?.aborted || attemptSignal?.aborted || discoveryAttempt?.signal.aborted || damageLease?.identity?.signal?.aborted) {
|
|
259
306
|
endAttempt();
|
|
260
307
|
return Promise.resolve({
|
|
261
308
|
output: "", stderr: "", exitCode: null, modelUsed: opts.model, toolCallsStarted: 0,
|
|
@@ -263,7 +310,20 @@ async function spawnPiAgentUnchecked(
|
|
|
263
310
|
lifecycle: { launched: false, closeSeen: false },
|
|
264
311
|
});
|
|
265
312
|
}
|
|
266
|
-
|
|
313
|
+
checkDamage();
|
|
314
|
+
args.push('-e',fileURLToPath(new URL('./context-continuity-child.ts',import.meta.url)));
|
|
315
|
+
try {
|
|
316
|
+
contextBroker ??= createContextContinuityBroker();
|
|
317
|
+
const broker=await contextBroker;
|
|
318
|
+
const parent=parseContextChannel(process.env[CONTEXT_CHANNEL_ENV]);
|
|
319
|
+
contextOwner=openContextOwner(opts.sessionFile,parent?.owner??null);
|
|
320
|
+
contextAssignment=JSON.stringify(broker.assignment(contextOwner));
|
|
321
|
+
} catch { contextBroker=undefined; } // Local child deterministic recovery does not depend on semantic inference.
|
|
322
|
+
if(opts.signal?.aborted || attemptSignal?.aborted || discoveryAttempt?.signal.aborted || damageLease?.identity?.signal?.aborted) {
|
|
323
|
+
endAttempt();return {output:"",stderr:"",exitCode:null,modelUsed:opts.model,toolCallsStarted:0,termination:{reason:"cancelled",confirmed:false,escalated:false},lifecycle:{launched:false,closeSeen:false}};
|
|
324
|
+
}
|
|
325
|
+
checkDamage();
|
|
326
|
+
const childEnv = {...nativeChildEnv(process.env, opts.env), ...discoveryAttempt?.env,...damageEnv,...(contextAssignment?{[CONTEXT_CHANNEL_ENV]:contextAssignment}:{})};
|
|
267
327
|
const isolation = opts.writeIsolation ? confineNativeChild({ ...opts.writeIsolation, command: "pi", args, env: envRecord(childEnv) }) : undefined;
|
|
268
328
|
const publishedIsolation = isolation ? isolationWithoutEnv(isolation) : undefined;
|
|
269
329
|
if (isolation && !isolation.applied) {
|
|
@@ -281,7 +341,7 @@ async function spawnPiAgentUnchecked(
|
|
|
281
341
|
const turnDeadlineMs = opts.turnDeadlineMs ?? null;
|
|
282
342
|
// A watchdog or deadline must own its group: group signalling remains valid even
|
|
283
343
|
// after the pi leader exits while an inherited-stdio descendant is still alive.
|
|
284
|
-
const ownsGroup = opts.detached === true || watchdog !== undefined || opts.signal !== undefined || attemptSignal !== undefined || discoveryAttempt !== undefined || turnDeadlineMs != null || cbs.onControl !== undefined;
|
|
344
|
+
const ownsGroup = opts.detached === true || watchdog !== undefined || opts.signal !== undefined || attemptSignal !== undefined || discoveryAttempt !== undefined || damageLease !== undefined || turnDeadlineMs != null || cbs.onControl !== undefined;
|
|
285
345
|
const watchedTools = new Set(watchdog?.tools ?? WATCHED_TOOLS);
|
|
286
346
|
const timeoutMs = watchdog?.timeoutMs ?? null;
|
|
287
347
|
const termGraceMs = watchdog?.termGraceMs ?? DEFAULT_TERM_GRACE_MS;
|
|
@@ -292,16 +352,18 @@ async function spawnPiAgentUnchecked(
|
|
|
292
352
|
return await new Promise((resolve) => {
|
|
293
353
|
const stdio: ["pipe", "pipe", "pipe"] = ["pipe", "pipe", "pipe"];
|
|
294
354
|
if (isolation) assertSafeSandboxStdio(stdio);
|
|
355
|
+
checkDamage();
|
|
356
|
+
if (opts.signal?.aborted || attemptSignal?.aborted || discoveryAttempt?.signal.aborted || damageLease?.identity.signal.aborted) throw Error('physical_launch_aborted');
|
|
295
357
|
const proc = spawn(launchCommand, launchArgs, {
|
|
296
358
|
stdio,
|
|
297
359
|
env: childEnv,
|
|
298
360
|
...(opts.cwd ? { cwd: opts.cwd } : {}),
|
|
299
361
|
...(ownsGroup ? { detached: true } : {}),
|
|
300
362
|
});
|
|
301
|
-
discoveryProcessRevocations.set(proc,()=>discoveryAttempt?.revoke());
|
|
363
|
+
discoveryProcessRevocations.set(proc,()=>{revokeDamage();discoveryAttempt?.revoke();if(contextOwner)revokeContextOwner(contextOwner.attempt);});
|
|
302
364
|
const originalKill=proc.kill.bind(proc);
|
|
303
|
-
proc.kill=(signal)=>{if(signal!==0)discoveryAttempt?.revoke();return originalKill(signal);};
|
|
304
|
-
|
|
365
|
+
proc.kill=(signal)=>{if(signal!==0){revokeDamage();discoveryAttempt?.revoke();if(contextOwner)revokeContextOwner(contextOwner.attempt);}return originalKill(signal);};
|
|
366
|
+
|
|
305
367
|
proc.stdin?.on("error", () => {});
|
|
306
368
|
proc.stdin?.end(opts.prompt);
|
|
307
369
|
|
|
@@ -326,11 +388,15 @@ async function spawnPiAgentUnchecked(
|
|
|
326
388
|
opts.signal?.removeEventListener("abort", onAbort);
|
|
327
389
|
attemptSignal?.removeEventListener("abort", onAbort);
|
|
328
390
|
discoveryAttempt?.signal.removeEventListener('abort', onAbort);
|
|
391
|
+
damageLease?.identity?.signal?.removeEventListener('abort', onAbort);
|
|
329
392
|
endAttempt();
|
|
330
393
|
};
|
|
331
394
|
let assistantError: string | undefined;
|
|
395
|
+
let recoveryAbortEpisode: number | undefined;
|
|
332
396
|
let toolCallsStarted = 0;
|
|
333
397
|
const runtimeTests: RuntimeTestRecord[] = [];
|
|
398
|
+
let specialistResult: SpecialistResult | undefined;
|
|
399
|
+
const resultStarts = new Map<string,unknown>();
|
|
334
400
|
const runtimeTestStarts = new Map<string, string>();
|
|
335
401
|
const toolEventRecorder = createToolEventRecorder();
|
|
336
402
|
const toolEvents: ToolExecutionEvent[] = toolEventRecorder.events;
|
|
@@ -352,7 +418,7 @@ async function spawnPiAgentUnchecked(
|
|
|
352
418
|
// never mark a provider/model error as successful.
|
|
353
419
|
exitCode: assistantError && code === 0 ? 1 : code,
|
|
354
420
|
stderr: stderrChunks.join(""),
|
|
355
|
-
toolCallsStarted, runtimeTests, toolEvents,
|
|
421
|
+
toolCallsStarted, runtimeTests, toolEvents, specialistResult, specialistResultTool: opts.specialistResultTool,
|
|
356
422
|
modelUsed: opts.model,
|
|
357
423
|
// T3: explicit lifecycle facts travel with every settlement.
|
|
358
424
|
// Missing close or an unconfirmed process tree stays uncertain downstream.
|
|
@@ -368,6 +434,7 @@ async function spawnPiAgentUnchecked(
|
|
|
368
434
|
// The first classification wins; later cancellation/exit events keep it.
|
|
369
435
|
if (termination) return;
|
|
370
436
|
termination = { reason, confirmed: false, escalated: false, ...(tool ? { tool } : {}) };
|
|
437
|
+
revokeDamage();
|
|
371
438
|
discoveryAttempt?.revoke(); // fence replies immediately, not after kill/pipe settlement
|
|
372
439
|
clearCalls();
|
|
373
440
|
killPiTree(proc, "SIGTERM");
|
|
@@ -387,9 +454,10 @@ async function spawnPiAgentUnchecked(
|
|
|
387
454
|
watchAbort(opts.signal);
|
|
388
455
|
watchAbort(attemptSignal);
|
|
389
456
|
watchAbort(discoveryAttempt?.signal);
|
|
457
|
+
watchAbort(damageLease?.identity.signal);
|
|
390
458
|
// External classified stop (drift watchdog): same first-classification-wins
|
|
391
459
|
// cascade as every other termination path; harmless after settle.
|
|
392
|
-
|
|
460
|
+
|
|
393
461
|
if (turnDeadlineMs != null) {
|
|
394
462
|
deadlineTimer = setTimeout(() => terminate("turn_timeout"), turnDeadlineMs);
|
|
395
463
|
}
|
|
@@ -409,6 +477,7 @@ async function spawnPiAgentUnchecked(
|
|
|
409
477
|
}).filter(Boolean).join("\n");
|
|
410
478
|
};
|
|
411
479
|
const handleEvent = (event: any) => {
|
|
480
|
+
if(event.type==='message_end' && event.message?.role==='assistant' && event.message.stopReason==='stop' && recoveryAbortEpisode!==undefined && contextOwner?.status.phase==='continued' && contextOwner.status.episode===recoveryAbortEpisode+1) {assistantError=undefined;recoveryAbortEpisode=undefined;}
|
|
412
481
|
if (event.type === "message_update") {
|
|
413
482
|
const delta = event.assistantMessageEvent;
|
|
414
483
|
if (delta?.type === "text_delta") { textChunks.push(delta.delta || ""); cbs.onTextDelta?.(delta.delta || ""); }
|
|
@@ -424,7 +493,9 @@ async function spawnPiAgentUnchecked(
|
|
|
424
493
|
? JSON.stringify(Object.fromEntries(["path", "file", "filePath"].filter(key => typeof event.args[key] === "string").map(key => [key, event.args[key]])))
|
|
425
494
|
: "{}";
|
|
426
495
|
toolEventRecorder.start(name, protocolArgs, id || undefined);
|
|
427
|
-
if
|
|
496
|
+
if(opts.specialistResultTool){specialistResult=undefined;resultStarts.clear();} // Further or overlapping tool work invalidates the handoff.
|
|
497
|
+
if(opts.specialistResultTool && event.toolName==="submit_result" && id && toolStarts.size===1)resultStarts.set(id,event.args);
|
|
498
|
+
if (opts.runtimeTestObserver && event.toolName === "bash" && typeof event.args?.command === "string" && toolId(event)) runtimeTestStarts.set(toolId(event), event.args.command);
|
|
428
499
|
cbs.onToolStart?.(name, argStr, id || undefined);
|
|
429
500
|
if (timeoutMs != null && id && watchedTools.has(name) && !calls.has(id)) {
|
|
430
501
|
const startedAt = Date.now();
|
|
@@ -441,6 +512,9 @@ async function spawnPiAgentUnchecked(
|
|
|
441
512
|
toolEventRecorder.end(id || undefined, typeof rawIsError === "boolean" ? rawIsError : undefined);
|
|
442
513
|
const startedCommand = id ? runtimeTestStarts.get(id) : undefined;
|
|
443
514
|
if (id) runtimeTestStarts.delete(id);
|
|
515
|
+
const submitted=resultFromToolEvent(opts.specialistResultTool,resultStarts.get(id),event.toolName,event.result,rawIsError);
|
|
516
|
+
if(submitted)specialistResult=submitted;
|
|
517
|
+
resultStarts.delete(id);
|
|
444
518
|
const check = runtimeTestFromResult(opts.runtimeTestObserver, startedCommand, event.toolName, event.result);
|
|
445
519
|
if (check) runtimeTests.push(check);
|
|
446
520
|
const startedAt = id ? toolStarts.get(id) : undefined;
|
|
@@ -455,6 +529,7 @@ async function spawnPiAgentUnchecked(
|
|
|
455
529
|
} else if (event.type === "message_end") {
|
|
456
530
|
if (event.message?.role === "assistant"
|
|
457
531
|
&& (event.message.stopReason === "error" || event.message.stopReason === "aborted")) {
|
|
532
|
+
recoveryAbortEpisode=(event.message.stopReason==='aborted' || event.message.errorMessage==='This operation was aborted') && contextOwner?.status.phase==='pending' ? contextOwner.status.episode : undefined;
|
|
458
533
|
assistantError = String(event.message.errorMessage
|
|
459
534
|
|| (event.message.stopReason === "aborted" ? "assistant model request aborted" : "assistant model run failed"));
|
|
460
535
|
}
|
|
@@ -474,13 +549,14 @@ async function spawnPiAgentUnchecked(
|
|
|
474
549
|
});
|
|
475
550
|
proc.stderr!.setEncoding("utf-8");
|
|
476
551
|
proc.stderr!.on("data", (chunk: string) => stderrChunks.push(chunk));
|
|
477
|
-
proc.once('exit', () => { discoveryAttempt?.signal.removeEventListener('abort', onAbort); discoveryAttempt?.revoke(); });
|
|
552
|
+
proc.once('exit', () => { discoveryAttempt?.signal.removeEventListener('abort', onAbort); damageLease?.identity.signal.removeEventListener('abort', onAbort); revokeDamage(); discoveryAttempt?.revoke(); });
|
|
478
553
|
proc.on("close", (code) => {
|
|
479
554
|
closeSeen = true;
|
|
480
555
|
if (buffer.trim()) try { handleEvent(JSON.parse(buffer)); } catch {}
|
|
481
556
|
settle(code);
|
|
482
557
|
});
|
|
483
558
|
proc.on("error", (err) => settle(1, err.message));
|
|
559
|
+
try { cbs.onProcess?.(proc); cbs.onControl?.({ terminate: (reason = 'drift_stop') => { if (!settled) terminate(reason); } }); } catch { terminate('cancelled'); }
|
|
484
560
|
});
|
|
485
561
|
} finally { endAttempt(); }
|
|
486
562
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { SpecialistResult } from "./specialist-result.ts";
|
|
2
|
+
|
|
3
|
+
/** Transport receipt, not task acceptance. Requires a matched successful call. */
|
|
4
|
+
export function resultFromToolEvent(enabled:boolean|undefined,input:unknown,tool:string,result:any,isError:unknown):SpecialistResult|null {
|
|
5
|
+
if(!enabled||tool!=="submit_result"||isError!==false||!input)return null;
|
|
6
|
+
const received=result?.details?.specialistResult;
|
|
7
|
+
if(!received||!["completed","partial","blocked"].includes(received.status)||!Array.isArray(received.evidence))return null;
|
|
8
|
+
if(received.evidence.some((r:any)=>!r||typeof r.path!=="string"))return null;
|
|
9
|
+
const plain={...received,evidence:received.evidence.map((r:any)=>({path:r.path}))};
|
|
10
|
+
if(JSON.stringify(plain)!==JSON.stringify(input))return null;
|
|
11
|
+
if(received.evidence.some((r:any)=>typeof r.sha256!=="string"||!/^[a-f0-9]{64}$/.test(r.sha256)||!Number.isSafeInteger(r.bytes)||r.bytes<0))return null;
|
|
12
|
+
return received;
|
|
13
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { Type } from "@sinclair/typebox";
|
|
2
|
+
import { Value } from "@sinclair/typebox/value";
|
|
3
|
+
import { createHash } from "node:crypto";
|
|
4
|
+
import { readFileSync, realpathSync, statSync } from "node:fs";
|
|
5
|
+
import { isAbsolute, relative, resolve, sep } from "node:path";
|
|
6
|
+
|
|
7
|
+
const text=Type.String({minLength:1,maxLength:4000});
|
|
8
|
+
const strings=Type.Array(text,{maxItems:100});
|
|
9
|
+
const assertion=Type.Object({id:Type.String({pattern:"^A[0-9]+$"}),note:Type.Optional(text),evidence:Type.Optional(text),reason:Type.Optional(text)},{additionalProperties:false});
|
|
10
|
+
export const SpecialistResultSchema=Type.Object({
|
|
11
|
+
status:Type.Union([Type.Literal("completed"),Type.Literal("partial"),Type.Literal("blocked")]),
|
|
12
|
+
summary:text,
|
|
13
|
+
changed_files:strings,
|
|
14
|
+
assertions_proven:Type.Array(assertion,{maxItems:100}),
|
|
15
|
+
assertions_unproven:Type.Array(assertion,{maxItems:100}),
|
|
16
|
+
assertions_failed:Type.Array(assertion,{maxItems:100}),
|
|
17
|
+
tests_run:strings,
|
|
18
|
+
open_risks:strings,
|
|
19
|
+
requires_user_decision:strings,
|
|
20
|
+
evidence:Type.Array(Type.Object({path:text},{additionalProperties:false}),{maxItems:50}),
|
|
21
|
+
},{additionalProperties:false});
|
|
22
|
+
|
|
23
|
+
export interface SpecialistResult {
|
|
24
|
+
status:"completed"|"partial"|"blocked"; summary:string;
|
|
25
|
+
changed_files:string[]; assertions_proven:any[]; assertions_unproven:any[]; assertions_failed:any[];
|
|
26
|
+
tests_run:string[]; open_risks:string[]; requires_user_decision:string[];
|
|
27
|
+
evidence:{path:string;sha256:string;bytes:number}[];
|
|
28
|
+
}
|
|
29
|
+
export function validateSpecialistResult(input:unknown,cwd:string):SpecialistResult {
|
|
30
|
+
if(!Value.Check(SpecialistResultSchema,input))throw new Error("Invalid submit_result fields: "+[...Value.Errors(SpecialistResultSchema,input)].slice(0,5).map(e=>e.path+": "+e.message).join("; "));
|
|
31
|
+
if(Buffer.byteLength(JSON.stringify(input))>65536)throw new Error("submit_result exceeds 64 KiB; use evidence references");
|
|
32
|
+
const root=realpathSync(cwd);
|
|
33
|
+
let totalBytes=0;
|
|
34
|
+
const evidence=input.evidence.map(ref=>{
|
|
35
|
+
const path=realpathSync(resolve(root,ref.path));
|
|
36
|
+
const rel=relative(root,path);
|
|
37
|
+
if(rel===".."||rel.startsWith(".."+sep)||isAbsolute(rel))throw new Error("Evidence must stay inside the workspace");
|
|
38
|
+
const stat=statSync(path);
|
|
39
|
+
totalBytes+=stat.size;
|
|
40
|
+
if(totalBytes>16*1024*1024)throw new Error("Evidence exceeds 16 MiB aggregate limit");
|
|
41
|
+
if(!stat.isFile()||stat.size>8*1024*1024)throw new Error("Evidence must be a regular file at most 8 MiB");
|
|
42
|
+
return {path:ref.path,sha256:createHash("sha256").update(readFileSync(path)).digest("hex"),bytes:stat.size};
|
|
43
|
+
});
|
|
44
|
+
const ids=new Set<string>();
|
|
45
|
+
for(const entry of [...input.assertions_proven,...input.assertions_unproven,...input.assertions_failed]){
|
|
46
|
+
if(ids.has(entry.id))throw new Error("Duplicate assertion id: "+entry.id);
|
|
47
|
+
ids.add(entry.id);
|
|
48
|
+
}
|
|
49
|
+
for(const entry of input.assertions_proven){
|
|
50
|
+
if(!entry.evidence||!evidence.some(ref=>ref.path===entry.evidence))throw new Error("Proven assertion must reference an evidence path in this submission: "+entry.id);
|
|
51
|
+
}
|
|
52
|
+
return {...input,evidence} as SpecialistResult;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export { resultFromToolEvent } from "./specialist-result-receipt.ts";
|
|
56
|
+
|
|
57
|
+
export default function specialistResultExtension(pi:any) {
|
|
58
|
+
pi.registerTool({
|
|
59
|
+
name:"submit_result",label:"Submit specialist result",
|
|
60
|
+
description:"Hand off your structured result. Evidence paths must exist inside the workspace. A valid report is not proof that the entire task is accepted. Call after completing work; if blocked/partial, state that honestly.",
|
|
61
|
+
parameters:SpecialistResultSchema,
|
|
62
|
+
async execute(_id:string,input:unknown,_signal:any,_update:any,ctx:any){
|
|
63
|
+
if(_signal?.aborted)throw new Error("Submission cancelled");
|
|
64
|
+
const result=validateSpecialistResult(input,ctx.cwd);
|
|
65
|
+
return {content:[{type:"text",text:"Specialist report received; whole-task acceptance remains with the runtime."}],details:{specialistResult:result}};
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
export const SPECIALIST_RESULT_INSTRUCTION = "Before your final answer, call submit_result with status, summary, changed_files, assertions_proven/unproven/failed, tests_run, open_risks, requires_user_decision and evidence. Use empty arrays where appropriate. Each proven assertion evidence must name a local file path from evidence; listed commands and file presence are not proof of passing. Correct validation errors directly. Report blocked/partial honestly. The parent decides whole-task acceptance. Keep a short final answer with any ASK_USER/NEEDS_RESEARCH markers and review verdict/findings.";
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { randomUUID } from "node:crypto";
|
|
2
|
+
import { DAMAGE_GUARD_VERSION, damageRequestMetadata, damageResponseMetadata } from './damage-guard-contract.ts';
|
|
3
|
+
import { CONTEXT_COMPACTION_QUESTION_VERSION, contextRequestMetadata, contextResponseMetadata } from "./context-compaction.ts";
|
|
2
4
|
import type { EvaluateRequest, System1Result, System1Service } from "../lib/system1/contracts.ts";
|
|
3
5
|
import { TASK_TRIAGE_QUESTIONS, TASK_TRIAGE_QUESTION_VERSION, TASK_TRIAGE_STATE_VERSION } from "./task-triage-contract.ts";
|
|
4
6
|
|
|
@@ -80,6 +82,7 @@ function discoverySummary(value: any) {
|
|
|
80
82
|
const number = (v: unknown) => typeof v === 'number' && Number.isFinite(v) && v >= 0 ? v : null;
|
|
81
83
|
const counts = Object.fromEntries(['discovered','evaluated','cached','failed','unscored'].map(k => [k, number(value?.counts?.[k])]));
|
|
82
84
|
return { status: ['complete','partial','unavailable','cancelled','skipped'].includes(value?.status) ? value.status : 'unavailable',
|
|
85
|
+
reason: (()=>{const reasons=['deadline','cancelled','changed','denied','oversized','unavailable','auth','network','queue_full','question_slots','semantic_off','missing_task','consumer_off','not_approved','timeout','budget_exhausted','channel_unavailable','invalid_response'];const reason=value?.reason??value?.semanticReason??(Array.isArray(value?.rows)?value.rows.find((r:any)=>r.status==='unscored')?.reason:undefined);return reasons.includes(reason)?reason:null;})(),
|
|
83
86
|
counts, discoveryComplete: typeof value?.discoveryComplete === 'boolean' ? value.discoveryComplete : null,
|
|
84
87
|
evaluationComplete: typeof value?.evaluationComplete === 'boolean' ? value.evaluationComplete : null,
|
|
85
88
|
remaining: value?.remaining === 0 ? 0 : 'unknown', elapsedMs: number(value?.elapsedMs),
|
|
@@ -120,7 +123,7 @@ export function createCommunicationStore(limits = COMMUNICATION_LIMITS, now = Da
|
|
|
120
123
|
if (!enabled) return (_summary: unknown) => {};
|
|
121
124
|
const id = randomUUID();
|
|
122
125
|
const metadata = { owner: discoveryIdentity(input.owner, true), attempt: discoveryIdentity(input.attempt),
|
|
123
|
-
trigger: ['filesystem','find','ls','grep','explicit','pre_spawn','native'].includes(input.trigger ?? '') ? input.trigger : 'unknown' };
|
|
126
|
+
trigger: ['filesystem','stat','find','ls','grep','explicit','pre_spawn','native'].includes(input.trigger ?? '') ? input.trigger : 'unknown' };
|
|
124
127
|
// Provider/model are code-owned constants, not transport-controlled labels.
|
|
125
128
|
pairs.set(id, { id, consumer: 'fileDiscovery', owner: metadata.owner, provider: input.provider === 'typesafe' ? 'typesafe' : 'unknown',
|
|
126
129
|
model: input.model === 'jev-1.13.0' ? 'jev-1.13.0' : 'unknown', started: now(), status: 'pending',
|
|
@@ -146,7 +149,31 @@ export function createCommunicationStore(limits = COMMUNICATION_LIMITS, now = Da
|
|
|
146
149
|
wrap(service: System1Service, identity: { provider: string; model: string }): System1Service {
|
|
147
150
|
const ownerEpoch = sessionEpoch;
|
|
148
151
|
return { async evaluate(request) {
|
|
149
|
-
if
|
|
152
|
+
if(request.questionSetVersion===DAMAGE_GUARD_VERSION) {
|
|
153
|
+
const epoch=generation;let id:string|undefined;
|
|
154
|
+
if(enabled && ownerEpoch===sessionEpoch) {
|
|
155
|
+
const metadata=damageRequestMetadata(request);id=randomUUID();
|
|
156
|
+
pairs.set(id,{id,consumer:'damageGuard',owner:metadata.owner,provider:identity.provider==='typesafe'?'typesafe':'unknown',model:identity.model==='jev-1.13.0'?'jev-1.13.0':'unknown',started:now(),status:'pending',request:JSON.stringify(metadata),response:null});trim();emit();
|
|
157
|
+
}
|
|
158
|
+
const finish=(metadata:ReturnType<typeof damageResponseMetadata>)=>{if(id&&enabled&&epoch===generation&&ownerEpoch===sessionEpoch&&pairs.has(id)){Object.assign(pairs.get(id)!,{response:JSON.stringify(metadata),status:metadata.status,ended:now()});trim();emit();}};
|
|
159
|
+
try {const result=await service.evaluate(request);finish(damageResponseMetadata(result,damageRequestMetadata(request).scope));return result;}
|
|
160
|
+
catch(error){finish(damageResponseMetadata({status:'unavailable',reason:'network'}));throw error;}
|
|
161
|
+
}
|
|
162
|
+
if(request.questionSetVersion===CONTEXT_COMPACTION_QUESTION_VERSION) {
|
|
163
|
+
const epoch=generation;let id:string|undefined;
|
|
164
|
+
if(enabled && ownerEpoch===sessionEpoch) {
|
|
165
|
+
id=randomUUID();pairs.set(id,{id,consumer:"contextCompaction",owner:"runtime",provider:identity.provider==="typesafe"?"typesafe":"unknown",model:identity.model==="jev-1.13.0"?"jev-1.13.0":"unknown",started:now(),status:"pending",request:JSON.stringify(contextRequestMetadata(request)),response:null});trim();emit();
|
|
166
|
+
}
|
|
167
|
+
try {
|
|
168
|
+
const result=await service.evaluate(request);
|
|
169
|
+
if(id && enabled && epoch===generation && ownerEpoch===sessionEpoch && pairs.has(id)) {const metadata=contextResponseMetadata(result);Object.assign(pairs.get(id)!,{response:JSON.stringify(metadata),status:metadata.status,ended:now()});trim();emit();}
|
|
170
|
+
return result;
|
|
171
|
+
} catch(error) {
|
|
172
|
+
if(id && enabled && epoch===generation && ownerEpoch===sessionEpoch && pairs.has(id)) {Object.assign(pairs.get(id)!,{status:"unavailable",ended:now(),response:JSON.stringify({version:1,status:"unavailable",decisions:{}})});emit();}
|
|
173
|
+
throw error;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
if (request.questionSetVersion.startsWith('file-discovery/')) return service.evaluate(request);
|
|
150
177
|
const epoch = generation; let id: string | undefined;
|
|
151
178
|
try {
|
|
152
179
|
if (enabled && ownerEpoch === sessionEpoch) {
|
|
@@ -16,6 +16,8 @@ import {
|
|
|
16
16
|
type WatchdogStateV1,
|
|
17
17
|
} from "./drift-system1.ts";
|
|
18
18
|
|
|
19
|
+
let contextConsumer: {service:System1Service;config:any;epoch:object} | undefined;
|
|
20
|
+
export function getContextCompactionService() { return contextConsumer; }
|
|
19
21
|
export const WATCHDOG_SYSTEM1_MODES = ["off", "shadow", "active"] as const;
|
|
20
22
|
export type WatchdogSystem1Mode = (typeof WATCHDOG_SYSTEM1_MODES)[number];
|
|
21
23
|
export const DEFAULT_WATCHDOG_SYSTEM1_MODE: WatchdogSystem1Mode = "off";
|
|
@@ -104,6 +106,7 @@ export function readWatchdogSystem1Snapshot(input: ReadWatchdogSystem1SnapshotIn
|
|
|
104
106
|
const snapshot = input.snapshot ?? loadSystem1Snapshot(input.cwd);
|
|
105
107
|
return {
|
|
106
108
|
configuredMode: snapshot.consumers.watchdog.config?.mode ?? "off",
|
|
109
|
+
contextCompactionConfig: snapshot.consumers.contextCompaction?.status === "ready" ? snapshot.consumers.contextCompaction.config : undefined,
|
|
107
110
|
watchdogArmed: normalizeWatchdogSetting(input.watchdogSetting) !== "off",
|
|
108
111
|
selected: readSystem1Selected(input.cwd),
|
|
109
112
|
config: providerDocument(snapshot),
|
|
@@ -114,6 +117,7 @@ export function readWatchdogSystem1Snapshot(input: ReadWatchdogSystem1SnapshotIn
|
|
|
114
117
|
}
|
|
115
118
|
|
|
116
119
|
export interface CreateWatchdogSystem1SessionOptions {
|
|
120
|
+
contextCompactionConfig?: unknown;
|
|
117
121
|
configuredMode: WatchdogSystem1Mode;
|
|
118
122
|
watchdogArmed: boolean;
|
|
119
123
|
selected: boolean;
|
|
@@ -138,6 +142,8 @@ export function createWatchdogSystem1Session(options: CreateWatchdogSystem1Sessi
|
|
|
138
142
|
transport: options.transport,
|
|
139
143
|
});
|
|
140
144
|
const service = options.wrapService ? options.wrapService(runtime.service) : runtime.service;
|
|
145
|
+
const contextEpoch={};
|
|
146
|
+
contextConsumer=options.selected && runtime.readiness.status==="ready" && options.contextCompactionConfig ? {service,config:options.contextCompactionConfig,epoch:contextEpoch} : undefined;
|
|
141
147
|
const configuredMode = options.configuredMode;
|
|
142
148
|
// Only a profile matching this session's immutable provider/model and policy can open active.
|
|
143
149
|
// An unrelated shipped profile must not turn configured active into effective active.
|
|
@@ -193,6 +199,7 @@ export function createWatchdogSystem1Session(options: CreateWatchdogSystem1Sessi
|
|
|
193
199
|
disposed = true;
|
|
194
200
|
session.disposed = true;
|
|
195
201
|
controller.abort();
|
|
202
|
+
if(contextConsumer?.epoch===contextEpoch) contextConsumer=undefined;
|
|
196
203
|
},
|
|
197
204
|
};
|
|
198
205
|
return session;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Closed control grammar. Yes/No and any extra instruction remain task input. */
|
|
2
|
+
export function isTaskContinuation(text:string):boolean {
|
|
3
|
+
return /^(?:continue|resume|continue please|please continue|продължи|продължете|моля,?\s+продължи)[.!]*$/iu.test(text.trim());
|
|
4
|
+
}
|
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
import { createHash, randomUUID } from "node:crypto";
|
|
2
|
+
import {createOneUseAuthority,type OneUseAuthority} from './action-authorization.ts';
|
|
2
3
|
import type { ExtensionContext } from "@mariozechner/pi-coding-agent";
|
|
3
4
|
import type { RuntimeQuestion } from "../ask-user-remote/runtime-ask.ts";
|
|
4
5
|
import { waiveTaskTriageAddition, type EvaluationBinding } from "./task-triage-obligations.ts";
|
|
5
6
|
import type { ProcessObligationState } from "./process-obligations.ts";
|
|
6
7
|
import { isAbsolute } from "node:path";
|
|
7
8
|
import { containsCommunicationSecret } from "./system1-communication-store.ts";
|
|
9
|
+
import { decideIdenticalDialog, identicalDialogKey } from "../lib/identical-dialog.ts";
|
|
10
|
+
import { coveredDeletePath, inspectionBash, noteBashDecision, semanticDecision } from "../lib/semantic-approval.ts";
|
|
8
11
|
|
|
9
12
|
const grantBrand: unique symbol = Symbol("trusted triage grant");
|
|
10
|
-
export type ActionGrant =
|
|
13
|
+
export type ActionGrant = OneUseAuthority;
|
|
11
14
|
export type WaiverGrant = { readonly [grantBrand]: true };
|
|
12
|
-
const actionGrants =
|
|
15
|
+
const actionGrants = createOneUseAuthority();
|
|
13
16
|
const waiverGrants = new WeakMap<object, string>();
|
|
14
17
|
const actionKey = (a: ActionContract) => JSON.stringify([a.taskId, a.inputRevision, a.actionId, a.operation, a.target, a.cwd ?? null]);
|
|
15
18
|
const waiverKey = (b: EvaluationBinding & { additionId: string; reason: string }) => JSON.stringify([b.taskId, b.inputRevision, b.evaluationId, b.additionId, b.reason]);
|
|
16
19
|
export function consumeActionGrant(grant: ActionGrant | undefined, contract: ActionContract): boolean {
|
|
17
|
-
|
|
18
|
-
actionGrants.delete(grant); return true;
|
|
20
|
+
return actionGrants.consume(grant,actionKey(contract));
|
|
19
21
|
}
|
|
20
22
|
export function consumeWaiverGrant(grant: WaiverGrant | undefined, binding: EvaluationBinding & { additionId: string; reason: string }): boolean {
|
|
21
23
|
if (!grant || typeof grant !== "object" || waiverGrants.get(grant) !== waiverKey(binding)) return false;
|
|
@@ -30,12 +32,32 @@ function affirmative(value: unknown, id: string, option: string): boolean {
|
|
|
30
32
|
/** Human response alone does not authorize an effect: the exact task/revision/action and durable grant must also match. */
|
|
31
33
|
async function authorize(key: string, context: string, ports: TriageHumanPorts, ctx: ExtensionContext, signal?: AbortSignal): Promise<boolean> {
|
|
32
34
|
if (pending.has(key) || signal?.aborted) return false;
|
|
33
|
-
const task = ports.taskId(), revision = ports.inputRevision()
|
|
34
|
-
const
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
const task = ports.taskId(), revision = ports.inputRevision();
|
|
36
|
+
const question: RuntimeQuestion = { question: "Authorize this exact task-triage decision once?", context: `Task: ${task}\nInput revision: ${revision}\n${context}`, options: ["Yes — authorize once", "No — deny"], allowMultiple: false, allowFreeform: false, allowComment: false };
|
|
37
|
+
const dialogKey = identicalDialogKey(["task-triage", task, revision, question.question, question.options, question.context]);
|
|
38
|
+
const outcome = await decideIdenticalDialog(dialogKey, async () => {
|
|
39
|
+
if (pending.has(key) || signal?.aborted || task !== ports.taskId() || revision !== ports.inputRevision()) return "cancel";
|
|
40
|
+
const id = randomUUID(), controller = new AbortController(), abort = () => controller.abort();
|
|
41
|
+
signal?.addEventListener("abort", abort, { once: true }); pending.add(key);
|
|
42
|
+
try {
|
|
43
|
+
ports.startWait(id); const result = await ports.ask(id, question, ctx, controller.signal);
|
|
44
|
+
if (controller.signal.aborted || task !== ports.taskId() || revision !== ports.inputRevision()) return "cancel";
|
|
45
|
+
if (affirmative(result, id, question.options[0])) { noteContextDecision(task, revision, question.context, "allow"); return "allow"; }
|
|
46
|
+
if (affirmative(result, id, question.options[1])) { noteContextDecision(task, revision, question.context, "deny"); return "deny"; }
|
|
47
|
+
return "cancel";
|
|
48
|
+
} catch { return "cancel"; }
|
|
49
|
+
finally { ports.endWait(id, task === ports.taskId()); pending.delete(key); signal?.removeEventListener("abort", abort); }
|
|
50
|
+
});
|
|
51
|
+
return outcome === "allow" && !signal?.aborted && task === ports.taskId() && revision === ports.inputRevision();
|
|
52
|
+
}
|
|
53
|
+
function noteContextDecision(task: string, revision: string, context: string, decision: "allow" | "deny"): void {
|
|
54
|
+
const start = context.indexOf("BEGIN ACTION INPUT JSON\n"), end = context.indexOf("\nEND ACTION INPUT JSON");
|
|
55
|
+
if (start < 0 || end < start) return;
|
|
56
|
+
try { const command = JSON.parse(context.slice(start + "BEGIN ACTION INPUT JSON\n".length, end))?.command; if (typeof command === "string") noteBashDecision(task, revision, command, decision); } catch { /* Unparseable presentation cannot widen approval. */ }
|
|
57
|
+
}
|
|
58
|
+
function issueWithoutDialog(contract: ActionContract, persistOneUse: (contract: ActionContract) => boolean, key: string): ActionGrant | null {
|
|
59
|
+
try { if (!persistOneUse(contract)) return null; } catch { return null; }
|
|
60
|
+
return actionGrants.issue(key);
|
|
39
61
|
}
|
|
40
62
|
export interface ActionContract { taskId: string; inputRevision: string; actionId: string; operation: string; target: string; cwd?: string; }
|
|
41
63
|
export interface ActionPresentation { input: unknown; cwd: string; }
|
|
@@ -43,7 +65,7 @@ export const ACTION_PRESENTATION_MAX_BYTES = 8192;
|
|
|
43
65
|
const unsafeActionText = (v: string) => containsCommunicationSecret(v) || /[\x00-\x08\x0b-\x1f\x7f-\x9f\u202a-\u202e\u2066-\u2069]/.test(v)
|
|
44
66
|
|| /\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}\b/i.test(v);
|
|
45
67
|
/** Full, schema-checked human view; redaction/truncation would hide what is authorized, so refuse instead. */
|
|
46
|
-
function actionPresentation(action: ActionContract, presentation?: ActionPresentation): string | null {
|
|
68
|
+
export function actionPresentation(action: ActionContract, presentation?: ActionPresentation): string | null {
|
|
47
69
|
if (!presentation || typeof presentation.cwd !== "string" || !isAbsolute(presentation.cwd) || presentation.cwd !== action.cwd
|
|
48
70
|
|| unsafeActionText(presentation.cwd) || presentation.cwd.length > 2048) return null;
|
|
49
71
|
const input = presentation.input;
|
|
@@ -98,19 +120,26 @@ export async function confirmTaskTriageAction(action: ActionContract, ports: Tri
|
|
|
98
120
|
const detail = actionPresentation(contract, presentation);
|
|
99
121
|
if (!detail) return null;
|
|
100
122
|
const key = actionKey(contract);
|
|
101
|
-
|
|
123
|
+
const command = contract.operation === "bash" && presentation?.input && typeof (presentation.input as { command?: unknown }).command === "string" ? (presentation.input as { command: string }).command : "";
|
|
124
|
+
const deletion = command ? coveredDeletePath(command) : null;
|
|
125
|
+
const prior = deletion ? semanticDecision(contract.taskId, contract.inputRevision, deletion) : undefined;
|
|
126
|
+
if (signal?.aborted) return null;
|
|
127
|
+
if (command && inspectionBash(command)) return issueWithoutDialog(contract, persistOneUse, key);
|
|
128
|
+
if (prior === "allow") return issueWithoutDialog(contract, persistOneUse, key);
|
|
129
|
+
if (prior === "deny") return null;
|
|
130
|
+
if (!await authorize(key, `Operation: ${contract.operation}\nTarget: ${contract.target}\n${detail}`, ports, ctx, signal)) return null;
|
|
102
131
|
const stillCurrent = () => !signal?.aborted && contract.taskId === ports.taskId() && contract.inputRevision === ports.inputRevision()
|
|
103
132
|
&& actionKey(action) === key && actionPresentation(contract, presentation) === detail;
|
|
104
133
|
if (!stillCurrent()) return null;
|
|
105
134
|
try { if (!persistOneUse(contract)) return null; } catch { return null; }
|
|
106
135
|
if (!stillCurrent()) return null;
|
|
107
|
-
|
|
136
|
+
return actionGrants.issue(key);
|
|
108
137
|
}
|
|
109
138
|
export async function confirmTaskTriageWaiver(state: ProcessObligationState, binding: EvaluationBinding & { additionId: string; reason: string }, ports: TriageHumanPorts, ctx: ExtensionContext, signal?: AbortSignal): Promise<ProcessObligationState | null> {
|
|
110
139
|
if (binding.taskId !== ports.taskId() || binding.inputRevision !== ports.inputRevision() || !binding.reason?.trim() || binding.reason.length > 512 || !state.additions?.some(a => a.id === binding.additionId && a.evaluationId === binding.evaluationId && a.taskId === binding.taskId && a.inputRevision === binding.inputRevision && a.status === "active")) return null;
|
|
111
140
|
const addition = state.additions!.find(a => a.id === binding.additionId)!;
|
|
112
141
|
const category = { security_change: "security-sensitive change", wide_change: "wide change", irreversible_execution: "potentially irreversible execution" }[addition.reason];
|
|
113
|
-
const released = { security_change: "the System 1 security review", wide_change: "the System 1 wide-change
|
|
142
|
+
const released = { security_change: "the System 1 security review", wide_change: "the System 1 wide-change independent review", irreversible_execution: "the System 1 exact-action human confirmation" }[addition.reason];
|
|
114
143
|
const key = `${binding.taskId}:${binding.additionId}`;
|
|
115
144
|
if (!await authorize(key, `Assessment: ${category}\nThis releases only ${released} for this addition, NOT baseline or other-source requirements.\nAddition: ${binding.additionId}\nEvaluation: ${binding.evaluationId}\nReason: ${binding.reason}`, ports, ctx, signal)) return null;
|
|
116
145
|
if (signal?.aborted || binding.taskId !== ports.taskId() || binding.inputRevision !== ports.inputRevision()) return null;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { join } from "node:path";
|
|
1
|
+
import { readInstallationState } from "../lib/installation-state.js";
|
|
3
2
|
import { loadSystem1Snapshot } from "../lib/system1/config-loader.js";
|
|
4
3
|
import { TASK_TRIAGE_LIMITS, TASK_TRIAGE_MODEL, TASK_TRIAGE_POLICY_VERSION, TASK_TRIAGE_PROVIDER, TASK_TRIAGE_QUESTION_VERSION } from "./task-triage-contract.ts";
|
|
5
4
|
|
|
@@ -9,21 +8,13 @@ import { parseTaskTriageConfig as parseShared } from "../lib/system1/config-tria
|
|
|
9
8
|
export function parseTaskTriageConfig(value: unknown): TaskTriageConfigStatus { return parseShared(value) as TaskTriageConfigStatus; }
|
|
10
9
|
/** Config parsing and loading are offline; no provider is constructed. */
|
|
11
10
|
export function loadTaskTriageConfig(root: string, snapshot = loadSystem1Snapshot(root)): TaskTriageConfigStatus {
|
|
11
|
+
const installation = readInstallationState(root);
|
|
12
|
+
if (installation.status === 'invalid') return { status: 'invalid' };
|
|
12
13
|
const section = snapshot.consumers.taskTriage;
|
|
13
14
|
if (snapshot.status === "invalid" || snapshot.status === "migration_required" || section.status === "invalid") return { status: "invalid" };
|
|
14
15
|
if (snapshot.status === "missing" || !snapshot.document?.consumers.taskTriage) return { status: "missing" };
|
|
15
16
|
const config: TaskTriageConfigStatus = section.status === "ready" ? { status: "active", config: section.config as TaskTriageConfig } : { status: "off" };
|
|
16
17
|
if (config.status !== "active") return config;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
// No installer state preserves existing manual configurations. A present but
|
|
20
|
-
// corrupt/linked state cannot authorize remote context. Setup writes an
|
|
21
|
-
// effective selection even when --features was an ephemeral CLI override.
|
|
22
|
-
if (!lstatSync(statePath).isFile()) return { status: "invalid" };
|
|
23
|
-
const state = JSON.parse(readFileSync(statePath, "utf8"));
|
|
24
|
-
if (!state || typeof state !== "object" || ![1, 2].includes(state.schemaVersion)) return { status: "invalid" };
|
|
25
|
-
if (state.taskTriageSelected === false) return { status: "off" };
|
|
26
|
-
if (state.taskTriageSelected === true || state.taskTriageSelected === undefined) return config;
|
|
27
|
-
return { status: "invalid" };
|
|
28
|
-
} catch (e) { return (e as NodeJS.ErrnoException).code === "ENOENT" ? config : { status: "invalid" }; }
|
|
18
|
+
// Local setup selection is a veto, never a replacement for workspace consent.
|
|
19
|
+
return installation.state?.taskTriageSelected === false ? { status: 'off' } : config;
|
|
29
20
|
}
|
|
@@ -42,6 +42,23 @@ export async function adoptTaskTriageState(options: {
|
|
|
42
42
|
}): Promise<ProcessObligationState> {
|
|
43
43
|
const { runtime, taskId, expandedScope, pendingTransition, persist } = options;
|
|
44
44
|
const base = options.newTask ? createProcessState() : options.state;
|
|
45
|
+
if (options.newTask) {
|
|
46
|
+
// Consumed predecessor input is not successor input. Keep its ownership and
|
|
47
|
+
// journal intact until the fresh candidate is durably appended.
|
|
48
|
+
let bound = null;
|
|
49
|
+
if (pendingTransition && runtime) {
|
|
50
|
+
persist(options.state);
|
|
51
|
+
bound = await runtime.bindInput(taskId, true);
|
|
52
|
+
if (!bound) throw new Error("pending input was not evaluated");
|
|
53
|
+
}
|
|
54
|
+
const next = bound ? applyTaskTriageAdditions(base, bound.assessment, { taskId, evaluationId: bound.evaluationId, inputRevision: bound.revision }) : base;
|
|
55
|
+
try { persist(next); } catch (error) {
|
|
56
|
+
if (bound) options.onPostCommitFailure();
|
|
57
|
+
throw error;
|
|
58
|
+
}
|
|
59
|
+
runtime?.retirePredecessor(bound);
|
|
60
|
+
return next;
|
|
61
|
+
}
|
|
45
62
|
// Before binding, persist only the *current* obligations. A refused new-task
|
|
46
63
|
// transition must leave the journal safe to restore even if binding is cancelled.
|
|
47
64
|
const needsBinding = !!(pendingTransition && runtime && !runtime.current);
|
|
@@ -85,7 +102,6 @@ export function applyTaskTriageAdditions(state: ProcessObligationState, assessme
|
|
|
85
102
|
const addition: ProcessAddition = { id, source: "system1", ...binding, policyVersion: TASK_TRIAGE_POLICY_VERSION, questionVersion: TASK_TRIAGE_QUESTION_VERSION, provider: TASK_TRIAGE_PROVIDER, model: TASK_TRIAGE_MODEL, reason: reason as TriageReason, status: "active", waiverReason: null };
|
|
86
103
|
next.additions!.push(addition); existing.add(id);
|
|
87
104
|
// A newly required stage cannot inherit unrelated, uncovered old evidence.
|
|
88
|
-
if (reason === "wide_change") next.plan = { ...next.plan, evidenceRef: null, revision: null };
|
|
89
105
|
if (reason === "wide_change" || reason === "security_change") next.review = { ...next.review, evidenceRef: null, revision: null };
|
|
90
106
|
}
|
|
91
107
|
// Never persist a partial union or silently discard the last active requirement.
|