@principles/core 1.73.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapters/code-review/code-review-pain-adapter.d.ts +13 -0
- package/dist/adapters/code-review/code-review-pain-adapter.d.ts.map +1 -0
- package/dist/adapters/code-review/code-review-pain-adapter.js +139 -0
- package/dist/adapters/code-review/code-review-pain-adapter.js.map +1 -0
- package/dist/adapters/code-review/index.d.ts +6 -0
- package/dist/adapters/code-review/index.d.ts.map +1 -0
- package/dist/adapters/code-review/index.js +2 -0
- package/dist/adapters/code-review/index.js.map +1 -0
- package/dist/adapters/code-review/review-event-types.d.ts +54 -0
- package/dist/adapters/code-review/review-event-types.d.ts.map +1 -0
- package/dist/adapters/code-review/review-event-types.js +8 -0
- package/dist/adapters/code-review/review-event-types.js.map +1 -0
- package/dist/adapters/coding/index.d.ts +6 -0
- package/dist/adapters/coding/index.d.ts.map +1 -0
- package/dist/adapters/coding/index.js +5 -0
- package/dist/adapters/coding/index.js.map +1 -0
- package/dist/adapters/coding/openclaw-event-types.d.ts +26 -0
- package/dist/adapters/coding/openclaw-event-types.d.ts.map +1 -0
- package/dist/adapters/coding/openclaw-event-types.js +9 -0
- package/dist/adapters/coding/openclaw-event-types.js.map +1 -0
- package/dist/adapters/coding/openclaw-pain-adapter.d.ts +27 -0
- package/dist/adapters/coding/openclaw-pain-adapter.d.ts.map +1 -0
- package/dist/adapters/coding/openclaw-pain-adapter.js +102 -0
- package/dist/adapters/coding/openclaw-pain-adapter.js.map +1 -0
- package/dist/adapters/writing/index.d.ts +6 -0
- package/dist/adapters/writing/index.d.ts.map +1 -0
- package/dist/adapters/writing/index.js +5 -0
- package/dist/adapters/writing/index.js.map +1 -0
- package/dist/adapters/writing/writing-pain-adapter.d.ts +22 -0
- package/dist/adapters/writing/writing-pain-adapter.d.ts.map +1 -0
- package/dist/adapters/writing/writing-pain-adapter.js +62 -0
- package/dist/adapters/writing/writing-pain-adapter.js.map +1 -0
- package/dist/adapters/writing/writing-types.d.ts +34 -0
- package/dist/adapters/writing/writing-types.d.ts.map +1 -0
- package/dist/adapters/writing/writing-types.js +9 -0
- package/dist/adapters/writing/writing-types.js.map +1 -0
- package/dist/evolution-hook.d.ts +70 -0
- package/dist/evolution-hook.d.ts.map +1 -0
- package/dist/evolution-hook.js +10 -0
- package/dist/evolution-hook.js.map +1 -0
- package/dist/evolution-store.d.ts +56 -0
- package/dist/evolution-store.d.ts.map +1 -0
- package/dist/evolution-store.js +150 -0
- package/dist/evolution-store.js.map +1 -0
- package/dist/index.d.ts +62 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +64 -0
- package/dist/index.js.map +1 -0
- package/dist/io.d.ts +36 -0
- package/dist/io.d.ts.map +1 -0
- package/dist/io.js +99 -0
- package/dist/io.js.map +1 -0
- package/dist/pain-flag-resolver.d.ts +18 -0
- package/dist/pain-flag-resolver.d.ts.map +1 -0
- package/dist/pain-flag-resolver.js +21 -0
- package/dist/pain-flag-resolver.js.map +1 -0
- package/dist/pain-recorder.d.ts +38 -0
- package/dist/pain-recorder.d.ts.map +1 -0
- package/dist/pain-recorder.js +62 -0
- package/dist/pain-recorder.js.map +1 -0
- package/dist/pain-signal-adapter.d.ts +37 -0
- package/dist/pain-signal-adapter.d.ts.map +1 -0
- package/dist/pain-signal-adapter.js +2 -0
- package/dist/pain-signal-adapter.js.map +1 -0
- package/dist/pain-signal.d.ts +76 -0
- package/dist/pain-signal.d.ts.map +1 -0
- package/dist/pain-signal.js +125 -0
- package/dist/pain-signal.js.map +1 -0
- package/dist/principle-injector.d.ts +67 -0
- package/dist/principle-injector.d.ts.map +1 -0
- package/dist/principle-injector.js +89 -0
- package/dist/principle-injector.js.map +1 -0
- package/dist/principle-tree-ledger.d.ts +106 -0
- package/dist/principle-tree-ledger.d.ts.map +1 -0
- package/dist/principle-tree-ledger.js +254 -0
- package/dist/principle-tree-ledger.js.map +1 -0
- package/dist/prompt-builder/__tests__/empathy-keyword-matching.test.d.ts +2 -0
- package/dist/prompt-builder/__tests__/empathy-keyword-matching.test.d.ts.map +1 -0
- package/dist/prompt-builder/__tests__/empathy-keyword-matching.test.js +380 -0
- package/dist/prompt-builder/__tests__/empathy-keyword-matching.test.js.map +1 -0
- package/dist/prompt-builder/__tests__/focus-compression.test.d.ts +2 -0
- package/dist/prompt-builder/__tests__/focus-compression.test.d.ts.map +1 -0
- package/dist/prompt-builder/__tests__/focus-compression.test.js +265 -0
- package/dist/prompt-builder/__tests__/focus-compression.test.js.map +1 -0
- package/dist/prompt-builder/__tests__/principle-selection.test.d.ts +7 -0
- package/dist/prompt-builder/__tests__/principle-selection.test.d.ts.map +1 -0
- package/dist/prompt-builder/__tests__/principle-selection.test.js +214 -0
- package/dist/prompt-builder/__tests__/principle-selection.test.js.map +1 -0
- package/dist/prompt-builder/__tests__/prompt-builder-core.test.d.ts +7 -0
- package/dist/prompt-builder/__tests__/prompt-builder-core.test.d.ts.map +1 -0
- package/dist/prompt-builder/__tests__/prompt-builder-core.test.js +283 -0
- package/dist/prompt-builder/__tests__/prompt-builder-core.test.js.map +1 -0
- package/dist/prompt-builder/__tests__/routing-guidance.test.d.ts +11 -0
- package/dist/prompt-builder/__tests__/routing-guidance.test.d.ts.map +1 -0
- package/dist/prompt-builder/__tests__/routing-guidance.test.js +305 -0
- package/dist/prompt-builder/__tests__/routing-guidance.test.js.map +1 -0
- package/dist/prompt-builder/attitude-directive.d.ts +7 -0
- package/dist/prompt-builder/attitude-directive.d.ts.map +1 -0
- package/dist/prompt-builder/attitude-directive.js +39 -0
- package/dist/prompt-builder/attitude-directive.js.map +1 -0
- package/dist/prompt-builder/correction-cue.d.ts +15 -0
- package/dist/prompt-builder/correction-cue.d.ts.map +1 -0
- package/dist/prompt-builder/correction-cue.js +39 -0
- package/dist/prompt-builder/correction-cue.js.map +1 -0
- package/dist/prompt-builder/empathy-keyword-matching.d.ts +30 -0
- package/dist/prompt-builder/empathy-keyword-matching.d.ts.map +1 -0
- package/dist/prompt-builder/empathy-keyword-matching.js +142 -0
- package/dist/prompt-builder/empathy-keyword-matching.js.map +1 -0
- package/dist/prompt-builder/empathy-types.d.ts +62 -0
- package/dist/prompt-builder/empathy-types.d.ts.map +1 -0
- package/dist/prompt-builder/empathy-types.js +88 -0
- package/dist/prompt-builder/empathy-types.js.map +1 -0
- package/dist/prompt-builder/focus-compression.d.ts +63 -0
- package/dist/prompt-builder/focus-compression.d.ts.map +1 -0
- package/dist/prompt-builder/focus-compression.js +448 -0
- package/dist/prompt-builder/focus-compression.js.map +1 -0
- package/dist/prompt-builder/index.d.ts +29 -0
- package/dist/prompt-builder/index.d.ts.map +1 -0
- package/dist/prompt-builder/index.js +27 -0
- package/dist/prompt-builder/index.js.map +1 -0
- package/dist/prompt-builder/message-extraction.d.ts +7 -0
- package/dist/prompt-builder/message-extraction.d.ts.map +1 -0
- package/dist/prompt-builder/message-extraction.js +23 -0
- package/dist/prompt-builder/message-extraction.js.map +1 -0
- package/dist/prompt-builder/minimal-trigger.d.ts +7 -0
- package/dist/prompt-builder/minimal-trigger.d.ts.map +1 -0
- package/dist/prompt-builder/minimal-trigger.js +11 -0
- package/dist/prompt-builder/minimal-trigger.js.map +1 -0
- package/dist/prompt-builder/principle-selection.d.ts +68 -0
- package/dist/prompt-builder/principle-selection.d.ts.map +1 -0
- package/dist/prompt-builder/principle-selection.js +140 -0
- package/dist/prompt-builder/principle-selection.js.map +1 -0
- package/dist/prompt-builder/routing-guidance.d.ts +64 -0
- package/dist/prompt-builder/routing-guidance.d.ts.map +1 -0
- package/dist/prompt-builder/routing-guidance.js +227 -0
- package/dist/prompt-builder/routing-guidance.js.map +1 -0
- package/dist/prompt-builder/size-guard.d.ts +35 -0
- package/dist/prompt-builder/size-guard.d.ts.map +1 -0
- package/dist/prompt-builder/size-guard.js +144 -0
- package/dist/prompt-builder/size-guard.js.map +1 -0
- package/dist/prompt-builder/types.d.ts +28 -0
- package/dist/prompt-builder/types.d.ts.map +1 -0
- package/dist/prompt-builder/types.js +7 -0
- package/dist/prompt-builder/types.js.map +1 -0
- package/dist/runtime-v2/__tests__/admission-gate.test.d.ts +2 -0
- package/dist/runtime-v2/__tests__/admission-gate.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/admission-gate.test.js +126 -0
- package/dist/runtime-v2/__tests__/admission-gate.test.js.map +1 -0
- package/dist/runtime-v2/__tests__/architecture-regression.test.d.ts +2 -0
- package/dist/runtime-v2/__tests__/architecture-regression.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/architecture-regression.test.js +2990 -0
- package/dist/runtime-v2/__tests__/architecture-regression.test.js.map +1 -0
- package/dist/runtime-v2/__tests__/artificer-runner-vslice.test.d.ts +2 -0
- package/dist/runtime-v2/__tests__/artificer-runner-vslice.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/artificer-runner-vslice.test.js +608 -0
- package/dist/runtime-v2/__tests__/artificer-runner-vslice.test.js.map +1 -0
- package/dist/runtime-v2/__tests__/attack-e2e-pipeline-smoke.test.d.ts +20 -0
- package/dist/runtime-v2/__tests__/attack-e2e-pipeline-smoke.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/attack-e2e-pipeline-smoke.test.js +473 -0
- package/dist/runtime-v2/__tests__/attack-e2e-pipeline-smoke.test.js.map +1 -0
- package/dist/runtime-v2/__tests__/candidate-audit.test.d.ts +2 -0
- package/dist/runtime-v2/__tests__/candidate-audit.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/candidate-audit.test.js +100 -0
- package/dist/runtime-v2/__tests__/candidate-audit.test.js.map +1 -0
- package/dist/runtime-v2/__tests__/chain-integrity-attack.test.d.ts +2 -0
- package/dist/runtime-v2/__tests__/chain-integrity-attack.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/chain-integrity-attack.test.js +276 -0
- package/dist/runtime-v2/__tests__/chain-integrity-attack.test.js.map +1 -0
- package/dist/runtime-v2/__tests__/chain-integrity-real-path.test.d.ts +2 -0
- package/dist/runtime-v2/__tests__/chain-integrity-real-path.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/chain-integrity-real-path.test.js +561 -0
- package/dist/runtime-v2/__tests__/chain-integrity-real-path.test.js.map +1 -0
- package/dist/runtime-v2/__tests__/control-plane-triage.test.d.ts +2 -0
- package/dist/runtime-v2/__tests__/control-plane-triage.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/control-plane-triage.test.js +107 -0
- package/dist/runtime-v2/__tests__/control-plane-triage.test.js.map +1 -0
- package/dist/runtime-v2/__tests__/correction-proposal.test.d.ts +2 -0
- package/dist/runtime-v2/__tests__/correction-proposal.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/correction-proposal.test.js +486 -0
- package/dist/runtime-v2/__tests__/correction-proposal.test.js.map +1 -0
- package/dist/runtime-v2/__tests__/dreamer-output-validator.test.d.ts +2 -0
- package/dist/runtime-v2/__tests__/dreamer-output-validator.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/dreamer-output-validator.test.js +171 -0
- package/dist/runtime-v2/__tests__/dreamer-output-validator.test.js.map +1 -0
- package/dist/runtime-v2/__tests__/dreamer-runner-real-llm.test.d.ts +2 -0
- package/dist/runtime-v2/__tests__/dreamer-runner-real-llm.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/dreamer-runner-real-llm.test.js +155 -0
- package/dist/runtime-v2/__tests__/dreamer-runner-real-llm.test.js.map +1 -0
- package/dist/runtime-v2/__tests__/dreamer-runner-vslice.test.d.ts +2 -0
- package/dist/runtime-v2/__tests__/dreamer-runner-vslice.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/dreamer-runner-vslice.test.js +515 -0
- package/dist/runtime-v2/__tests__/dreamer-runner-vslice.test.js.map +1 -0
- package/dist/runtime-v2/__tests__/dreamer-runner.test.d.ts +2 -0
- package/dist/runtime-v2/__tests__/dreamer-runner.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/dreamer-runner.test.js +348 -0
- package/dist/runtime-v2/__tests__/dreamer-runner.test.js.map +1 -0
- package/dist/runtime-v2/__tests__/error-categories.test.d.ts +2 -0
- package/dist/runtime-v2/__tests__/error-categories.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/error-categories.test.js +149 -0
- package/dist/runtime-v2/__tests__/error-categories.test.js.map +1 -0
- package/dist/runtime-v2/__tests__/evaluator-runner-vslice.test.d.ts +2 -0
- package/dist/runtime-v2/__tests__/evaluator-runner-vslice.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/evaluator-runner-vslice.test.js +1047 -0
- package/dist/runtime-v2/__tests__/evaluator-runner-vslice.test.js.map +1 -0
- package/dist/runtime-v2/__tests__/fixtures/index.d.ts +4 -0
- package/dist/runtime-v2/__tests__/fixtures/index.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/fixtures/index.js +3 -0
- package/dist/runtime-v2/__tests__/fixtures/index.js.map +1 -0
- package/dist/runtime-v2/__tests__/fixtures/llm-e2e-config.d.ts +20 -0
- package/dist/runtime-v2/__tests__/fixtures/llm-e2e-config.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/fixtures/llm-e2e-config.js +39 -0
- package/dist/runtime-v2/__tests__/fixtures/llm-e2e-config.js.map +1 -0
- package/dist/runtime-v2/__tests__/fixtures/llm-e2e-config.test.d.ts +2 -0
- package/dist/runtime-v2/__tests__/fixtures/llm-e2e-config.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/fixtures/llm-e2e-config.test.js +111 -0
- package/dist/runtime-v2/__tests__/fixtures/llm-e2e-config.test.js.map +1 -0
- package/dist/runtime-v2/__tests__/fixtures/test-helpers.d.ts +20 -0
- package/dist/runtime-v2/__tests__/fixtures/test-helpers.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/fixtures/test-helpers.js +37 -0
- package/dist/runtime-v2/__tests__/fixtures/test-helpers.js.map +1 -0
- package/dist/runtime-v2/__tests__/full-chain-real-llm.test.d.ts +2 -0
- package/dist/runtime-v2/__tests__/full-chain-real-llm.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/full-chain-real-llm.test.js +152 -0
- package/dist/runtime-v2/__tests__/full-chain-real-llm.test.js.map +1 -0
- package/dist/runtime-v2/__tests__/full-trace-contract.test.d.ts +2 -0
- package/dist/runtime-v2/__tests__/full-trace-contract.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/full-trace-contract.test.js +552 -0
- package/dist/runtime-v2/__tests__/full-trace-contract.test.js.map +1 -0
- package/dist/runtime-v2/__tests__/gfi-workspace-health.test.d.ts +2 -0
- package/dist/runtime-v2/__tests__/gfi-workspace-health.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/gfi-workspace-health.test.js +128 -0
- package/dist/runtime-v2/__tests__/gfi-workspace-health.test.js.map +1 -0
- package/dist/runtime-v2/__tests__/golden-trace-candidate-builder.test.d.ts +2 -0
- package/dist/runtime-v2/__tests__/golden-trace-candidate-builder.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/golden-trace-candidate-builder.test.js +759 -0
- package/dist/runtime-v2/__tests__/golden-trace-candidate-builder.test.js.map +1 -0
- package/dist/runtime-v2/__tests__/golden-trace-replay-validator.test.d.ts +2 -0
- package/dist/runtime-v2/__tests__/golden-trace-replay-validator.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/golden-trace-replay-validator.test.js +231 -0
- package/dist/runtime-v2/__tests__/golden-trace-replay-validator.test.js.map +1 -0
- package/dist/runtime-v2/__tests__/golden-trace.test.d.ts +2 -0
- package/dist/runtime-v2/__tests__/golden-trace.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/golden-trace.test.js +335 -0
- package/dist/runtime-v2/__tests__/golden-trace.test.js.map +1 -0
- package/dist/runtime-v2/__tests__/intake-to-internalization-bridge.test.d.ts +2 -0
- package/dist/runtime-v2/__tests__/intake-to-internalization-bridge.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/intake-to-internalization-bridge.test.js +307 -0
- package/dist/runtime-v2/__tests__/intake-to-internalization-bridge.test.js.map +1 -0
- package/dist/runtime-v2/__tests__/internalization-chain-integrity-read-model.test.d.ts +2 -0
- package/dist/runtime-v2/__tests__/internalization-chain-integrity-read-model.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/internalization-chain-integrity-read-model.test.js +268 -0
- package/dist/runtime-v2/__tests__/internalization-chain-integrity-read-model.test.js.map +1 -0
- package/dist/runtime-v2/__tests__/internalization-contracts.test.d.ts +2 -0
- package/dist/runtime-v2/__tests__/internalization-contracts.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/internalization-contracts.test.js +78 -0
- package/dist/runtime-v2/__tests__/internalization-contracts.test.js.map +1 -0
- package/dist/runtime-v2/__tests__/internalization-integrity-remediation.test.d.ts +2 -0
- package/dist/runtime-v2/__tests__/internalization-integrity-remediation.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/internalization-integrity-remediation.test.js +218 -0
- package/dist/runtime-v2/__tests__/internalization-integrity-remediation.test.js.map +1 -0
- package/dist/runtime-v2/__tests__/internalization-orchestrator.test.d.ts +2 -0
- package/dist/runtime-v2/__tests__/internalization-orchestrator.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/internalization-orchestrator.test.js +569 -0
- package/dist/runtime-v2/__tests__/internalization-orchestrator.test.js.map +1 -0
- package/dist/runtime-v2/__tests__/internalization-peer-runner-contracts.test.d.ts +2 -0
- package/dist/runtime-v2/__tests__/internalization-peer-runner-contracts.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/internalization-peer-runner-contracts.test.js +448 -0
- package/dist/runtime-v2/__tests__/internalization-peer-runner-contracts.test.js.map +1 -0
- package/dist/runtime-v2/__tests__/internalization-queue-read-model.test.d.ts +2 -0
- package/dist/runtime-v2/__tests__/internalization-queue-read-model.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/internalization-queue-read-model.test.js +415 -0
- package/dist/runtime-v2/__tests__/internalization-queue-read-model.test.js.map +1 -0
- package/dist/runtime-v2/__tests__/internalization-route.test.d.ts +2 -0
- package/dist/runtime-v2/__tests__/internalization-route.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/internalization-route.test.js +136 -0
- package/dist/runtime-v2/__tests__/internalization-route.test.js.map +1 -0
- package/dist/runtime-v2/__tests__/internalization-state-machine.test.d.ts +2 -0
- package/dist/runtime-v2/__tests__/internalization-state-machine.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/internalization-state-machine.test.js +679 -0
- package/dist/runtime-v2/__tests__/internalization-state-machine.test.js.map +1 -0
- package/dist/runtime-v2/__tests__/l1-hard-cap.test.d.ts +2 -0
- package/dist/runtime-v2/__tests__/l1-hard-cap.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/l1-hard-cap.test.js +157 -0
- package/dist/runtime-v2/__tests__/l1-hard-cap.test.js.map +1 -0
- package/dist/runtime-v2/__tests__/nocturnal-compliance-trust-boundary.test.d.ts +2 -0
- package/dist/runtime-v2/__tests__/nocturnal-compliance-trust-boundary.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/nocturnal-compliance-trust-boundary.test.js +215 -0
- package/dist/runtime-v2/__tests__/nocturnal-compliance-trust-boundary.test.js.map +1 -0
- package/dist/runtime-v2/__tests__/operator-health-cold-start-guard.test.d.ts +2 -0
- package/dist/runtime-v2/__tests__/operator-health-cold-start-guard.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/operator-health-cold-start-guard.test.js +102 -0
- package/dist/runtime-v2/__tests__/operator-health-cold-start-guard.test.js.map +1 -0
- package/dist/runtime-v2/__tests__/operator-health-gfi-degraded.test.d.ts +2 -0
- package/dist/runtime-v2/__tests__/operator-health-gfi-degraded.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/operator-health-gfi-degraded.test.js +148 -0
- package/dist/runtime-v2/__tests__/operator-health-gfi-degraded.test.js.map +1 -0
- package/dist/runtime-v2/__tests__/operator-health-gfi.test.d.ts +2 -0
- package/dist/runtime-v2/__tests__/operator-health-gfi.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/operator-health-gfi.test.js +113 -0
- package/dist/runtime-v2/__tests__/operator-health-gfi.test.js.map +1 -0
- package/dist/runtime-v2/__tests__/operator-health-read-model.test.d.ts +2 -0
- package/dist/runtime-v2/__tests__/operator-health-read-model.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/operator-health-read-model.test.js +136 -0
- package/dist/runtime-v2/__tests__/operator-health-read-model.test.js.map +1 -0
- package/dist/runtime-v2/__tests__/pain-chain-read-model.test.d.ts +2 -0
- package/dist/runtime-v2/__tests__/pain-chain-read-model.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/pain-chain-read-model.test.js +248 -0
- package/dist/runtime-v2/__tests__/pain-chain-read-model.test.js.map +1 -0
- package/dist/runtime-v2/__tests__/pain-evidence-contract.test.d.ts +2 -0
- package/dist/runtime-v2/__tests__/pain-evidence-contract.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/pain-evidence-contract.test.js +328 -0
- package/dist/runtime-v2/__tests__/pain-evidence-contract.test.js.map +1 -0
- package/dist/runtime-v2/__tests__/pain-flood-simulation.test.d.ts +2 -0
- package/dist/runtime-v2/__tests__/pain-flood-simulation.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/pain-flood-simulation.test.js +267 -0
- package/dist/runtime-v2/__tests__/pain-flood-simulation.test.js.map +1 -0
- package/dist/runtime-v2/__tests__/pain-signal-bridge-retried.test.d.ts +2 -0
- package/dist/runtime-v2/__tests__/pain-signal-bridge-retried.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/pain-signal-bridge-retried.test.js +147 -0
- package/dist/runtime-v2/__tests__/pain-signal-bridge-retried.test.js.map +1 -0
- package/dist/runtime-v2/__tests__/pain-signal-observability.test.d.ts +2 -0
- package/dist/runtime-v2/__tests__/pain-signal-observability.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/pain-signal-observability.test.js +151 -0
- package/dist/runtime-v2/__tests__/pain-signal-observability.test.js.map +1 -0
- package/dist/runtime-v2/__tests__/pain-to-principle-service.test.d.ts +2 -0
- package/dist/runtime-v2/__tests__/pain-to-principle-service.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/pain-to-principle-service.test.js +209 -0
- package/dist/runtime-v2/__tests__/pain-to-principle-service.test.js.map +1 -0
- package/dist/runtime-v2/__tests__/philosopher-runner-real-llm.test.d.ts +2 -0
- package/dist/runtime-v2/__tests__/philosopher-runner-real-llm.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/philosopher-runner-real-llm.test.js +167 -0
- package/dist/runtime-v2/__tests__/philosopher-runner-real-llm.test.js.map +1 -0
- package/dist/runtime-v2/__tests__/philosopher-runner-vslice.test.d.ts +2 -0
- package/dist/runtime-v2/__tests__/philosopher-runner-vslice.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/philosopher-runner-vslice.test.js +338 -0
- package/dist/runtime-v2/__tests__/philosopher-runner-vslice.test.js.map +1 -0
- package/dist/runtime-v2/__tests__/pi-artifact-store.test.d.ts +2 -0
- package/dist/runtime-v2/__tests__/pi-artifact-store.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/pi-artifact-store.test.js +247 -0
- package/dist/runtime-v2/__tests__/pi-artifact-store.test.js.map +1 -0
- package/dist/runtime-v2/__tests__/pitask-metadata.test.d.ts +8 -0
- package/dist/runtime-v2/__tests__/pitask-metadata.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/pitask-metadata.test.js +333 -0
- package/dist/runtime-v2/__tests__/pitask-metadata.test.js.map +1 -0
- package/dist/runtime-v2/__tests__/principle-compiler-core.test.d.ts +2 -0
- package/dist/runtime-v2/__tests__/principle-compiler-core.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/principle-compiler-core.test.js +141 -0
- package/dist/runtime-v2/__tests__/principle-compiler-core.test.js.map +1 -0
- package/dist/runtime-v2/__tests__/production-canary-fixture-gate.test.d.ts +2 -0
- package/dist/runtime-v2/__tests__/production-canary-fixture-gate.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/production-canary-fixture-gate.test.js +524 -0
- package/dist/runtime-v2/__tests__/production-canary-fixture-gate.test.js.map +1 -0
- package/dist/runtime-v2/__tests__/proven-channel-baseline.test.d.ts +2 -0
- package/dist/runtime-v2/__tests__/proven-channel-baseline.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/proven-channel-baseline.test.js +428 -0
- package/dist/runtime-v2/__tests__/proven-channel-baseline.test.js.map +1 -0
- package/dist/runtime-v2/__tests__/pruning-read-model.test.d.ts +2 -0
- package/dist/runtime-v2/__tests__/pruning-read-model.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/pruning-read-model.test.js +783 -0
- package/dist/runtime-v2/__tests__/pruning-read-model.test.js.map +1 -0
- package/dist/runtime-v2/__tests__/pruning-review-log.test.d.ts +2 -0
- package/dist/runtime-v2/__tests__/pruning-review-log.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/pruning-review-log.test.js +159 -0
- package/dist/runtime-v2/__tests__/pruning-review-log.test.js.map +1 -0
- package/dist/runtime-v2/__tests__/recovery-sweep-service.test.d.ts +2 -0
- package/dist/runtime-v2/__tests__/recovery-sweep-service.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/recovery-sweep-service.test.js +83 -0
- package/dist/runtime-v2/__tests__/recovery-sweep-service.test.js.map +1 -0
- package/dist/runtime-v2/__tests__/remediation-contract.test.d.ts +2 -0
- package/dist/runtime-v2/__tests__/remediation-contract.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/remediation-contract.test.js +39 -0
- package/dist/runtime-v2/__tests__/remediation-contract.test.js.map +1 -0
- package/dist/runtime-v2/__tests__/rollout-reviewer-runner-vslice.test.d.ts +2 -0
- package/dist/runtime-v2/__tests__/rollout-reviewer-runner-vslice.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/rollout-reviewer-runner-vslice.test.js +658 -0
- package/dist/runtime-v2/__tests__/rollout-reviewer-runner-vslice.test.js.map +1 -0
- package/dist/runtime-v2/__tests__/rule-host-evaluator.test.d.ts +2 -0
- package/dist/runtime-v2/__tests__/rule-host-evaluator.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/rule-host-evaluator.test.js +509 -0
- package/dist/runtime-v2/__tests__/rule-host-evaluator.test.js.map +1 -0
- package/dist/runtime-v2/__tests__/rulehost-oob-defense-simulation.test.d.ts +2 -0
- package/dist/runtime-v2/__tests__/rulehost-oob-defense-simulation.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/rulehost-oob-defense-simulation.test.js +535 -0
- package/dist/runtime-v2/__tests__/rulehost-oob-defense-simulation.test.js.map +1 -0
- package/dist/runtime-v2/__tests__/runtime-config-boundary.test.d.ts +2 -0
- package/dist/runtime-v2/__tests__/runtime-config-boundary.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/runtime-config-boundary.test.js +256 -0
- package/dist/runtime-v2/__tests__/runtime-config-boundary.test.js.map +1 -0
- package/dist/runtime-v2/__tests__/runtime-state-handle.test.d.ts +2 -0
- package/dist/runtime-v2/__tests__/runtime-state-handle.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/runtime-state-handle.test.js +76 -0
- package/dist/runtime-v2/__tests__/runtime-state-handle.test.js.map +1 -0
- package/dist/runtime-v2/__tests__/schema-conformance-read-model.test.d.ts +2 -0
- package/dist/runtime-v2/__tests__/schema-conformance-read-model.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/schema-conformance-read-model.test.js +208 -0
- package/dist/runtime-v2/__tests__/schema-conformance-read-model.test.js.map +1 -0
- package/dist/runtime-v2/__tests__/scribe-runner-real-llm.test.d.ts +2 -0
- package/dist/runtime-v2/__tests__/scribe-runner-real-llm.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/scribe-runner-real-llm.test.js +156 -0
- package/dist/runtime-v2/__tests__/scribe-runner-real-llm.test.js.map +1 -0
- package/dist/runtime-v2/__tests__/scribe-runner-vslice.test.d.ts +2 -0
- package/dist/runtime-v2/__tests__/scribe-runner-vslice.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/scribe-runner-vslice.test.js +430 -0
- package/dist/runtime-v2/__tests__/scribe-runner-vslice.test.js.map +1 -0
- package/dist/runtime-v2/__tests__/sqlite-confirm-first-state-store.test.d.ts +2 -0
- package/dist/runtime-v2/__tests__/sqlite-confirm-first-state-store.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/sqlite-confirm-first-state-store.test.js +148 -0
- package/dist/runtime-v2/__tests__/sqlite-confirm-first-state-store.test.js.map +1 -0
- package/dist/runtime-v2/__tests__/sqlite-connection-readonly.test.d.ts +2 -0
- package/dist/runtime-v2/__tests__/sqlite-connection-readonly.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/sqlite-connection-readonly.test.js +95 -0
- package/dist/runtime-v2/__tests__/sqlite-connection-readonly.test.js.map +1 -0
- package/dist/runtime-v2/__tests__/story-a-demo.test.d.ts +2 -0
- package/dist/runtime-v2/__tests__/story-a-demo.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/story-a-demo.test.js +257 -0
- package/dist/runtime-v2/__tests__/story-a-demo.test.js.map +1 -0
- package/dist/runtime-v2/__tests__/synthetic-baseline.test.d.ts +2 -0
- package/dist/runtime-v2/__tests__/synthetic-baseline.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/synthetic-baseline.test.js +155 -0
- package/dist/runtime-v2/__tests__/synthetic-baseline.test.js.map +1 -0
- package/dist/runtime-v2/__tests__/task-state-semantics.test.d.ts +2 -0
- package/dist/runtime-v2/__tests__/task-state-semantics.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/task-state-semantics.test.js +145 -0
- package/dist/runtime-v2/__tests__/task-state-semantics.test.js.map +1 -0
- package/dist/runtime-v2/__tests__/task-three-strikes.test.d.ts +2 -0
- package/dist/runtime-v2/__tests__/task-three-strikes.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/task-three-strikes.test.js +268 -0
- package/dist/runtime-v2/__tests__/task-three-strikes.test.js.map +1 -0
- package/dist/runtime-v2/__tests__/trace-refiner-agent.test.d.ts +2 -0
- package/dist/runtime-v2/__tests__/trace-refiner-agent.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/trace-refiner-agent.test.js +726 -0
- package/dist/runtime-v2/__tests__/trace-refiner-agent.test.js.map +1 -0
- package/dist/runtime-v2/__tests__/trace-refiner.test.d.ts +2 -0
- package/dist/runtime-v2/__tests__/trace-refiner.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/trace-refiner.test.js +527 -0
- package/dist/runtime-v2/__tests__/trace-refiner.test.js.map +1 -0
- package/dist/runtime-v2/__tests__/trainer-output-validator.test.d.ts +2 -0
- package/dist/runtime-v2/__tests__/trainer-output-validator.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/trainer-output-validator.test.js +257 -0
- package/dist/runtime-v2/__tests__/trainer-output-validator.test.js.map +1 -0
- package/dist/runtime-v2/__tests__/trainer-runner-vslice.test.d.ts +2 -0
- package/dist/runtime-v2/__tests__/trainer-runner-vslice.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/trainer-runner-vslice.test.js +506 -0
- package/dist/runtime-v2/__tests__/trainer-runner-vslice.test.js.map +1 -0
- package/dist/runtime-v2/__tests__/trajectory-store.test.d.ts +2 -0
- package/dist/runtime-v2/__tests__/trajectory-store.test.d.ts.map +1 -0
- package/dist/runtime-v2/__tests__/trajectory-store.test.js +127 -0
- package/dist/runtime-v2/__tests__/trajectory-store.test.js.map +1 -0
- package/dist/runtime-v2/activation/__tests__/activation-dispatcher.test.d.ts +2 -0
- package/dist/runtime-v2/activation/__tests__/activation-dispatcher.test.d.ts.map +1 -0
- package/dist/runtime-v2/activation/__tests__/activation-dispatcher.test.js +510 -0
- package/dist/runtime-v2/activation/__tests__/activation-dispatcher.test.js.map +1 -0
- package/dist/runtime-v2/activation/__tests__/approval-context-types.test.d.ts +2 -0
- package/dist/runtime-v2/activation/__tests__/approval-context-types.test.d.ts.map +1 -0
- package/dist/runtime-v2/activation/__tests__/approval-context-types.test.js +117 -0
- package/dist/runtime-v2/activation/__tests__/approval-context-types.test.js.map +1 -0
- package/dist/runtime-v2/activation/__tests__/approval-queue.test.d.ts +2 -0
- package/dist/runtime-v2/activation/__tests__/approval-queue.test.d.ts.map +1 -0
- package/dist/runtime-v2/activation/__tests__/approval-queue.test.js +179 -0
- package/dist/runtime-v2/activation/__tests__/approval-queue.test.js.map +1 -0
- package/dist/runtime-v2/activation/__tests__/approval-store-extended.test.d.ts +2 -0
- package/dist/runtime-v2/activation/__tests__/approval-store-extended.test.d.ts.map +1 -0
- package/dist/runtime-v2/activation/__tests__/approval-store-extended.test.js +174 -0
- package/dist/runtime-v2/activation/__tests__/approval-store-extended.test.js.map +1 -0
- package/dist/runtime-v2/activation/__tests__/memory-activation-state-store.test.d.ts +2 -0
- package/dist/runtime-v2/activation/__tests__/memory-activation-state-store.test.d.ts.map +1 -0
- package/dist/runtime-v2/activation/__tests__/memory-activation-state-store.test.js +244 -0
- package/dist/runtime-v2/activation/__tests__/memory-activation-state-store.test.js.map +1 -0
- package/dist/runtime-v2/activation/__tests__/sqlite-activation-state-store.test.d.ts +2 -0
- package/dist/runtime-v2/activation/__tests__/sqlite-activation-state-store.test.d.ts.map +1 -0
- package/dist/runtime-v2/activation/__tests__/sqlite-activation-state-store.test.js +109 -0
- package/dist/runtime-v2/activation/__tests__/sqlite-activation-state-store.test.js.map +1 -0
- package/dist/runtime-v2/activation/__tests__/sqlite-approval-store.test.d.ts +2 -0
- package/dist/runtime-v2/activation/__tests__/sqlite-approval-store.test.d.ts.map +1 -0
- package/dist/runtime-v2/activation/__tests__/sqlite-approval-store.test.js +124 -0
- package/dist/runtime-v2/activation/__tests__/sqlite-approval-store.test.js.map +1 -0
- package/dist/runtime-v2/activation/activation-dispatcher.d.ts +18 -0
- package/dist/runtime-v2/activation/activation-dispatcher.d.ts.map +1 -0
- package/dist/runtime-v2/activation/activation-dispatcher.js +231 -0
- package/dist/runtime-v2/activation/activation-dispatcher.js.map +1 -0
- package/dist/runtime-v2/activation/activation-types.d.ts +195 -0
- package/dist/runtime-v2/activation/activation-types.d.ts.map +1 -0
- package/dist/runtime-v2/activation/activation-types.js +29 -0
- package/dist/runtime-v2/activation/activation-types.js.map +1 -0
- package/dist/runtime-v2/activation/approval-queue.d.ts +15 -0
- package/dist/runtime-v2/activation/approval-queue.d.ts.map +1 -0
- package/dist/runtime-v2/activation/approval-queue.js +50 -0
- package/dist/runtime-v2/activation/approval-queue.js.map +1 -0
- package/dist/runtime-v2/activation/index.d.ts +15 -0
- package/dist/runtime-v2/activation/index.d.ts.map +1 -0
- package/dist/runtime-v2/activation/index.js +11 -0
- package/dist/runtime-v2/activation/index.js.map +1 -0
- package/dist/runtime-v2/activation/low-risk-writers.d.ts +14 -0
- package/dist/runtime-v2/activation/low-risk-writers.d.ts.map +1 -0
- package/dist/runtime-v2/activation/low-risk-writers.js +83 -0
- package/dist/runtime-v2/activation/low-risk-writers.js.map +1 -0
- package/dist/runtime-v2/activation/memory-activation-state-store.d.ts +13 -0
- package/dist/runtime-v2/activation/memory-activation-state-store.d.ts.map +1 -0
- package/dist/runtime-v2/activation/memory-activation-state-store.js +28 -0
- package/dist/runtime-v2/activation/memory-activation-state-store.js.map +1 -0
- package/dist/runtime-v2/activation/memory-approval-store.d.ts +12 -0
- package/dist/runtime-v2/activation/memory-approval-store.d.ts.map +1 -0
- package/dist/runtime-v2/activation/memory-approval-store.js +102 -0
- package/dist/runtime-v2/activation/memory-approval-store.js.map +1 -0
- package/dist/runtime-v2/activation/sqlite-activation-state-store.d.ts +10 -0
- package/dist/runtime-v2/activation/sqlite-activation-state-store.d.ts.map +1 -0
- package/dist/runtime-v2/activation/sqlite-activation-state-store.js +87 -0
- package/dist/runtime-v2/activation/sqlite-activation-state-store.js.map +1 -0
- package/dist/runtime-v2/activation/sqlite-approval-store.d.ts +14 -0
- package/dist/runtime-v2/activation/sqlite-approval-store.d.ts.map +1 -0
- package/dist/runtime-v2/activation/sqlite-approval-store.js +138 -0
- package/dist/runtime-v2/activation/sqlite-approval-store.js.map +1 -0
- package/dist/runtime-v2/activation/sqlite-confirm-first-state-store.d.ts +22 -0
- package/dist/runtime-v2/activation/sqlite-confirm-first-state-store.d.ts.map +1 -0
- package/dist/runtime-v2/activation/sqlite-confirm-first-state-store.js +136 -0
- package/dist/runtime-v2/activation/sqlite-confirm-first-state-store.js.map +1 -0
- package/dist/runtime-v2/activation/writers/__tests__/rule-host-writer.test.d.ts +2 -0
- package/dist/runtime-v2/activation/writers/__tests__/rule-host-writer.test.d.ts.map +1 -0
- package/dist/runtime-v2/activation/writers/__tests__/rule-host-writer.test.js +615 -0
- package/dist/runtime-v2/activation/writers/__tests__/rule-host-writer.test.js.map +1 -0
- package/dist/runtime-v2/activation/writers/index.d.ts +3 -0
- package/dist/runtime-v2/activation/writers/index.d.ts.map +1 -0
- package/dist/runtime-v2/activation/writers/index.js +2 -0
- package/dist/runtime-v2/activation/writers/index.js.map +1 -0
- package/dist/runtime-v2/activation/writers/rule-host-writer.d.ts +14 -0
- package/dist/runtime-v2/activation/writers/rule-host-writer.d.ts.map +1 -0
- package/dist/runtime-v2/activation/writers/rule-host-writer.js +135 -0
- package/dist/runtime-v2/activation/writers/rule-host-writer.js.map +1 -0
- package/dist/runtime-v2/adapter/__tests__/chaos-json-repair.test.d.ts +2 -0
- package/dist/runtime-v2/adapter/__tests__/chaos-json-repair.test.d.ts.map +1 -0
- package/dist/runtime-v2/adapter/__tests__/chaos-json-repair.test.js +553 -0
- package/dist/runtime-v2/adapter/__tests__/chaos-json-repair.test.js.map +1 -0
- package/dist/runtime-v2/adapter/__tests__/json-extractor.test.d.ts +2 -0
- package/dist/runtime-v2/adapter/__tests__/json-extractor.test.d.ts.map +1 -0
- package/dist/runtime-v2/adapter/__tests__/json-extractor.test.js +148 -0
- package/dist/runtime-v2/adapter/__tests__/json-extractor.test.js.map +1 -0
- package/dist/runtime-v2/adapter/__tests__/openclaw-cli-runtime-adapter.test.d.ts +2 -0
- package/dist/runtime-v2/adapter/__tests__/openclaw-cli-runtime-adapter.test.d.ts.map +1 -0
- package/dist/runtime-v2/adapter/__tests__/openclaw-cli-runtime-adapter.test.js +565 -0
- package/dist/runtime-v2/adapter/__tests__/openclaw-cli-runtime-adapter.test.js.map +1 -0
- package/dist/runtime-v2/adapter/__tests__/output-repair-contract.test.d.ts +2 -0
- package/dist/runtime-v2/adapter/__tests__/output-repair-contract.test.d.ts.map +1 -0
- package/dist/runtime-v2/adapter/__tests__/output-repair-contract.test.js +305 -0
- package/dist/runtime-v2/adapter/__tests__/output-repair-contract.test.js.map +1 -0
- package/dist/runtime-v2/adapter/__tests__/pi-ai-runtime-adapter.test.d.ts +2 -0
- package/dist/runtime-v2/adapter/__tests__/pi-ai-runtime-adapter.test.d.ts.map +1 -0
- package/dist/runtime-v2/adapter/__tests__/pi-ai-runtime-adapter.test.js +1362 -0
- package/dist/runtime-v2/adapter/__tests__/pi-ai-runtime-adapter.test.js.map +1 -0
- package/dist/runtime-v2/adapter/__tests__/runtime-config-contract.test.d.ts +2 -0
- package/dist/runtime-v2/adapter/__tests__/runtime-config-contract.test.d.ts.map +1 -0
- package/dist/runtime-v2/adapter/__tests__/runtime-config-contract.test.js +245 -0
- package/dist/runtime-v2/adapter/__tests__/runtime-config-contract.test.js.map +1 -0
- package/dist/runtime-v2/adapter/__tests__/structured-output-repair.test.d.ts +2 -0
- package/dist/runtime-v2/adapter/__tests__/structured-output-repair.test.d.ts.map +1 -0
- package/dist/runtime-v2/adapter/__tests__/structured-output-repair.test.js +494 -0
- package/dist/runtime-v2/adapter/__tests__/structured-output-repair.test.js.map +1 -0
- package/dist/runtime-v2/adapter/__tests__/test-double-runtime-adapter.test.d.ts +2 -0
- package/dist/runtime-v2/adapter/__tests__/test-double-runtime-adapter.test.d.ts.map +1 -0
- package/dist/runtime-v2/adapter/__tests__/test-double-runtime-adapter.test.js +123 -0
- package/dist/runtime-v2/adapter/__tests__/test-double-runtime-adapter.test.js.map +1 -0
- package/dist/runtime-v2/adapter/index.d.ts +10 -0
- package/dist/runtime-v2/adapter/index.d.ts.map +1 -0
- package/dist/runtime-v2/adapter/index.js +6 -0
- package/dist/runtime-v2/adapter/index.js.map +1 -0
- package/dist/runtime-v2/adapter/json-extractor.d.ts +14 -0
- package/dist/runtime-v2/adapter/json-extractor.d.ts.map +1 -0
- package/dist/runtime-v2/adapter/json-extractor.js +97 -0
- package/dist/runtime-v2/adapter/json-extractor.js.map +1 -0
- package/dist/runtime-v2/adapter/openclaw-cli-runtime-adapter.d.ts +66 -0
- package/dist/runtime-v2/adapter/openclaw-cli-runtime-adapter.d.ts.map +1 -0
- package/dist/runtime-v2/adapter/openclaw-cli-runtime-adapter.js +705 -0
- package/dist/runtime-v2/adapter/openclaw-cli-runtime-adapter.js.map +1 -0
- package/dist/runtime-v2/adapter/output-repair-contract.d.ts +50 -0
- package/dist/runtime-v2/adapter/output-repair-contract.d.ts.map +1 -0
- package/dist/runtime-v2/adapter/output-repair-contract.js +96 -0
- package/dist/runtime-v2/adapter/output-repair-contract.js.map +1 -0
- package/dist/runtime-v2/adapter/pi-ai-runtime-adapter.d.ts +114 -0
- package/dist/runtime-v2/adapter/pi-ai-runtime-adapter.d.ts.map +1 -0
- package/dist/runtime-v2/adapter/pi-ai-runtime-adapter.js +1109 -0
- package/dist/runtime-v2/adapter/pi-ai-runtime-adapter.js.map +1 -0
- package/dist/runtime-v2/adapter/principle-tree-ledger-adapter.d.ts +22 -0
- package/dist/runtime-v2/adapter/principle-tree-ledger-adapter.d.ts.map +1 -0
- package/dist/runtime-v2/adapter/principle-tree-ledger-adapter.js +84 -0
- package/dist/runtime-v2/adapter/principle-tree-ledger-adapter.js.map +1 -0
- package/dist/runtime-v2/adapter/structured-output-repair.d.ts +95 -0
- package/dist/runtime-v2/adapter/structured-output-repair.d.ts.map +1 -0
- package/dist/runtime-v2/adapter/structured-output-repair.js +259 -0
- package/dist/runtime-v2/adapter/structured-output-repair.js.map +1 -0
- package/dist/runtime-v2/adapter/test-double-runtime-adapter.d.ts +35 -0
- package/dist/runtime-v2/adapter/test-double-runtime-adapter.d.ts.map +1 -0
- package/dist/runtime-v2/adapter/test-double-runtime-adapter.js +94 -0
- package/dist/runtime-v2/adapter/test-double-runtime-adapter.js.map +1 -0
- package/dist/runtime-v2/adapter/tools/diagnostician-tool.d.ts +21 -0
- package/dist/runtime-v2/adapter/tools/diagnostician-tool.d.ts.map +1 -0
- package/dist/runtime-v2/adapter/tools/diagnostician-tool.js +20 -0
- package/dist/runtime-v2/adapter/tools/diagnostician-tool.js.map +1 -0
- package/dist/runtime-v2/admission-gate.d.ts +27 -0
- package/dist/runtime-v2/admission-gate.d.ts.map +1 -0
- package/dist/runtime-v2/admission-gate.js +57 -0
- package/dist/runtime-v2/admission-gate.js.map +1 -0
- package/dist/runtime-v2/agent-spec.d.ts +86 -0
- package/dist/runtime-v2/agent-spec.d.ts.map +1 -0
- package/dist/runtime-v2/agent-spec.js +74 -0
- package/dist/runtime-v2/agent-spec.js.map +1 -0
- package/dist/runtime-v2/candidate-audit.d.ts +8 -0
- package/dist/runtime-v2/candidate-audit.d.ts.map +1 -0
- package/dist/runtime-v2/candidate-audit.js +47 -0
- package/dist/runtime-v2/candidate-audit.js.map +1 -0
- package/dist/runtime-v2/candidate-intake-service.d.ts +43 -0
- package/dist/runtime-v2/candidate-intake-service.d.ts.map +1 -0
- package/dist/runtime-v2/candidate-intake-service.js +117 -0
- package/dist/runtime-v2/candidate-intake-service.js.map +1 -0
- package/dist/runtime-v2/candidate-intake.d.ts +219 -0
- package/dist/runtime-v2/candidate-intake.d.ts.map +1 -0
- package/dist/runtime-v2/candidate-intake.js +178 -0
- package/dist/runtime-v2/candidate-intake.js.map +1 -0
- package/dist/runtime-v2/cli/diagnose.d.ts +127 -0
- package/dist/runtime-v2/cli/diagnose.d.ts.map +1 -0
- package/dist/runtime-v2/cli/diagnose.js +113 -0
- package/dist/runtime-v2/cli/diagnose.js.map +1 -0
- package/dist/runtime-v2/cli/index.d.ts +5 -0
- package/dist/runtime-v2/cli/index.d.ts.map +1 -0
- package/dist/runtime-v2/cli/index.js +3 -0
- package/dist/runtime-v2/cli/index.js.map +1 -0
- package/dist/runtime-v2/cli/probe.d.ts +31 -0
- package/dist/runtime-v2/cli/probe.d.ts.map +1 -0
- package/dist/runtime-v2/cli/probe.js +58 -0
- package/dist/runtime-v2/cli/probe.js.map +1 -0
- package/dist/runtime-v2/context-payload.d.ts +298 -0
- package/dist/runtime-v2/context-payload.d.ts.map +1 -0
- package/dist/runtime-v2/context-payload.js +140 -0
- package/dist/runtime-v2/context-payload.js.map +1 -0
- package/dist/runtime-v2/control-plane-triage.d.ts +32 -0
- package/dist/runtime-v2/control-plane-triage.d.ts.map +1 -0
- package/dist/runtime-v2/control-plane-triage.js +220 -0
- package/dist/runtime-v2/control-plane-triage.js.map +1 -0
- package/dist/runtime-v2/correction/correction-types.d.ts +87 -0
- package/dist/runtime-v2/correction/correction-types.d.ts.map +1 -0
- package/dist/runtime-v2/correction/correction-types.js +66 -0
- package/dist/runtime-v2/correction/correction-types.js.map +1 -0
- package/dist/runtime-v2/correction/index.d.ts +2 -0
- package/dist/runtime-v2/correction/index.d.ts.map +1 -0
- package/dist/runtime-v2/correction/index.js +2 -0
- package/dist/runtime-v2/correction/index.js.map +1 -0
- package/dist/runtime-v2/diagnostician/__tests__/diagnostician-prompt-builder.integration.test.d.ts +2 -0
- package/dist/runtime-v2/diagnostician/__tests__/diagnostician-prompt-builder.integration.test.d.ts.map +1 -0
- package/dist/runtime-v2/diagnostician/__tests__/diagnostician-prompt-builder.integration.test.js +170 -0
- package/dist/runtime-v2/diagnostician/__tests__/diagnostician-prompt-builder.integration.test.js.map +1 -0
- package/dist/runtime-v2/diagnostician/__tests__/diagnostician-prompt-builder.test.d.ts +2 -0
- package/dist/runtime-v2/diagnostician/__tests__/diagnostician-prompt-builder.test.d.ts.map +1 -0
- package/dist/runtime-v2/diagnostician/__tests__/diagnostician-prompt-builder.test.js +314 -0
- package/dist/runtime-v2/diagnostician/__tests__/diagnostician-prompt-builder.test.js.map +1 -0
- package/dist/runtime-v2/diagnostician-output.d.ts +94 -0
- package/dist/runtime-v2/diagnostician-output.d.ts.map +1 -0
- package/dist/runtime-v2/diagnostician-output.js +65 -0
- package/dist/runtime-v2/diagnostician-output.js.map +1 -0
- package/dist/runtime-v2/diagnostician-prompt-builder.d.ts +125 -0
- package/dist/runtime-v2/diagnostician-prompt-builder.d.ts.map +1 -0
- package/dist/runtime-v2/diagnostician-prompt-builder.js +154 -0
- package/dist/runtime-v2/diagnostician-prompt-builder.js.map +1 -0
- package/dist/runtime-v2/error-categories.d.ts +42 -0
- package/dist/runtime-v2/error-categories.d.ts.map +1 -0
- package/dist/runtime-v2/error-categories.js +119 -0
- package/dist/runtime-v2/error-categories.js.map +1 -0
- package/dist/runtime-v2/evolution/evolution-types.d.ts +709 -0
- package/dist/runtime-v2/evolution/evolution-types.d.ts.map +1 -0
- package/dist/runtime-v2/evolution/evolution-types.js +410 -0
- package/dist/runtime-v2/evolution/evolution-types.js.map +1 -0
- package/dist/runtime-v2/evolution/index.d.ts +2 -0
- package/dist/runtime-v2/evolution/index.d.ts.map +1 -0
- package/dist/runtime-v2/evolution/index.js +2 -0
- package/dist/runtime-v2/evolution/index.js.map +1 -0
- package/dist/runtime-v2/feature-flags/__tests__/feature-flag-contract.test.d.ts +2 -0
- package/dist/runtime-v2/feature-flags/__tests__/feature-flag-contract.test.d.ts.map +1 -0
- package/dist/runtime-v2/feature-flags/__tests__/feature-flag-contract.test.js +298 -0
- package/dist/runtime-v2/feature-flags/__tests__/feature-flag-contract.test.js.map +1 -0
- package/dist/runtime-v2/feature-flags/feature-flag-contract.d.ts +35 -0
- package/dist/runtime-v2/feature-flags/feature-flag-contract.d.ts.map +1 -0
- package/dist/runtime-v2/feature-flags/feature-flag-contract.js +124 -0
- package/dist/runtime-v2/feature-flags/feature-flag-contract.js.map +1 -0
- package/dist/runtime-v2/feature-flags/index.d.ts +3 -0
- package/dist/runtime-v2/feature-flags/index.d.ts.map +1 -0
- package/dist/runtime-v2/feature-flags/index.js +2 -0
- package/dist/runtime-v2/feature-flags/index.js.map +1 -0
- package/dist/runtime-v2/full-trace-contract.d.ts +79 -0
- package/dist/runtime-v2/full-trace-contract.d.ts.map +1 -0
- package/dist/runtime-v2/full-trace-contract.js +464 -0
- package/dist/runtime-v2/full-trace-contract.js.map +1 -0
- package/dist/runtime-v2/gfi/__tests__/gfi-kernel.test.d.ts +2 -0
- package/dist/runtime-v2/gfi/__tests__/gfi-kernel.test.d.ts.map +1 -0
- package/dist/runtime-v2/gfi/__tests__/gfi-kernel.test.js +626 -0
- package/dist/runtime-v2/gfi/__tests__/gfi-kernel.test.js.map +1 -0
- package/dist/runtime-v2/gfi/__tests__/gfi-read-model.test.d.ts +2 -0
- package/dist/runtime-v2/gfi/__tests__/gfi-read-model.test.d.ts.map +1 -0
- package/dist/runtime-v2/gfi/__tests__/gfi-read-model.test.js +212 -0
- package/dist/runtime-v2/gfi/__tests__/gfi-read-model.test.js.map +1 -0
- package/dist/runtime-v2/gfi/gfi-kernel.d.ts +12 -0
- package/dist/runtime-v2/gfi/gfi-kernel.d.ts.map +1 -0
- package/dist/runtime-v2/gfi/gfi-kernel.js +148 -0
- package/dist/runtime-v2/gfi/gfi-kernel.js.map +1 -0
- package/dist/runtime-v2/gfi/gfi-policy.d.ts +3 -0
- package/dist/runtime-v2/gfi/gfi-policy.d.ts.map +1 -0
- package/dist/runtime-v2/gfi/gfi-policy.js +23 -0
- package/dist/runtime-v2/gfi/gfi-policy.js.map +1 -0
- package/dist/runtime-v2/gfi/gfi-read-model.d.ts +78 -0
- package/dist/runtime-v2/gfi/gfi-read-model.d.ts.map +1 -0
- package/dist/runtime-v2/gfi/gfi-read-model.js +129 -0
- package/dist/runtime-v2/gfi/gfi-read-model.js.map +1 -0
- package/dist/runtime-v2/gfi/gfi-types.d.ts +70 -0
- package/dist/runtime-v2/gfi/gfi-types.d.ts.map +1 -0
- package/dist/runtime-v2/gfi/gfi-types.js +2 -0
- package/dist/runtime-v2/gfi/gfi-types.js.map +1 -0
- package/dist/runtime-v2/gfi/index.d.ts +6 -0
- package/dist/runtime-v2/gfi/index.d.ts.map +1 -0
- package/dist/runtime-v2/gfi/index.js +4 -0
- package/dist/runtime-v2/gfi/index.js.map +1 -0
- package/dist/runtime-v2/golden-trace-candidate-builder.d.ts +23 -0
- package/dist/runtime-v2/golden-trace-candidate-builder.d.ts.map +1 -0
- package/dist/runtime-v2/golden-trace-candidate-builder.js +193 -0
- package/dist/runtime-v2/golden-trace-candidate-builder.js.map +1 -0
- package/dist/runtime-v2/golden-trace-replay-adapter.d.ts +18 -0
- package/dist/runtime-v2/golden-trace-replay-adapter.d.ts.map +1 -0
- package/dist/runtime-v2/golden-trace-replay-adapter.js +18 -0
- package/dist/runtime-v2/golden-trace-replay-adapter.js.map +1 -0
- package/dist/runtime-v2/golden-trace-replay-validator.d.ts +42 -0
- package/dist/runtime-v2/golden-trace-replay-validator.d.ts.map +1 -0
- package/dist/runtime-v2/golden-trace-replay-validator.js +220 -0
- package/dist/runtime-v2/golden-trace-replay-validator.js.map +1 -0
- package/dist/runtime-v2/golden-trace.d.ts +80 -0
- package/dist/runtime-v2/golden-trace.d.ts.map +1 -0
- package/dist/runtime-v2/golden-trace.js +158 -0
- package/dist/runtime-v2/golden-trace.js.map +1 -0
- package/dist/runtime-v2/idle-trigger/__tests__/idle-trigger-config-resolve.test.d.ts +2 -0
- package/dist/runtime-v2/idle-trigger/__tests__/idle-trigger-config-resolve.test.d.ts.map +1 -0
- package/dist/runtime-v2/idle-trigger/__tests__/idle-trigger-config-resolve.test.js +92 -0
- package/dist/runtime-v2/idle-trigger/__tests__/idle-trigger-config-resolve.test.js.map +1 -0
- package/dist/runtime-v2/idle-trigger/__tests__/idle-trigger-decision.test.d.ts +2 -0
- package/dist/runtime-v2/idle-trigger/__tests__/idle-trigger-decision.test.d.ts.map +1 -0
- package/dist/runtime-v2/idle-trigger/__tests__/idle-trigger-decision.test.js +134 -0
- package/dist/runtime-v2/idle-trigger/__tests__/idle-trigger-decision.test.js.map +1 -0
- package/dist/runtime-v2/idle-trigger/__tests__/idle-trigger-edge-cases.test.d.ts +2 -0
- package/dist/runtime-v2/idle-trigger/__tests__/idle-trigger-edge-cases.test.d.ts.map +1 -0
- package/dist/runtime-v2/idle-trigger/__tests__/idle-trigger-edge-cases.test.js +226 -0
- package/dist/runtime-v2/idle-trigger/__tests__/idle-trigger-edge-cases.test.js.map +1 -0
- package/dist/runtime-v2/idle-trigger/idle-trigger-decision.d.ts +3 -0
- package/dist/runtime-v2/idle-trigger/idle-trigger-decision.d.ts.map +1 -0
- package/dist/runtime-v2/idle-trigger/idle-trigger-decision.js +5 -0
- package/dist/runtime-v2/idle-trigger/idle-trigger-decision.js.map +1 -0
- package/dist/runtime-v2/idle-trigger/idle-trigger-policy.d.ts +4 -0
- package/dist/runtime-v2/idle-trigger/idle-trigger-policy.d.ts.map +1 -0
- package/dist/runtime-v2/idle-trigger/idle-trigger-policy.js +81 -0
- package/dist/runtime-v2/idle-trigger/idle-trigger-policy.js.map +1 -0
- package/dist/runtime-v2/idle-trigger/idle-trigger-types.d.ts +29 -0
- package/dist/runtime-v2/idle-trigger/idle-trigger-types.d.ts.map +1 -0
- package/dist/runtime-v2/idle-trigger/idle-trigger-types.js +15 -0
- package/dist/runtime-v2/idle-trigger/idle-trigger-types.js.map +1 -0
- package/dist/runtime-v2/idle-trigger/index.d.ts +5 -0
- package/dist/runtime-v2/idle-trigger/index.d.ts.map +1 -0
- package/dist/runtime-v2/idle-trigger/index.js +4 -0
- package/dist/runtime-v2/idle-trigger/index.js.map +1 -0
- package/dist/runtime-v2/index.d.ts +281 -0
- package/dist/runtime-v2/index.d.ts.map +1 -0
- package/dist/runtime-v2/index.js +224 -0
- package/dist/runtime-v2/index.js.map +1 -0
- package/dist/runtime-v2/internalization/__tests__/artificer-prompt-builder.test.d.ts +2 -0
- package/dist/runtime-v2/internalization/__tests__/artificer-prompt-builder.test.d.ts.map +1 -0
- package/dist/runtime-v2/internalization/__tests__/artificer-prompt-builder.test.js +57 -0
- package/dist/runtime-v2/internalization/__tests__/artificer-prompt-builder.test.js.map +1 -0
- package/dist/runtime-v2/internalization/__tests__/dreamer-prompt-builder.test.d.ts +2 -0
- package/dist/runtime-v2/internalization/__tests__/dreamer-prompt-builder.test.d.ts.map +1 -0
- package/dist/runtime-v2/internalization/__tests__/dreamer-prompt-builder.test.js +182 -0
- package/dist/runtime-v2/internalization/__tests__/dreamer-prompt-builder.test.js.map +1 -0
- package/dist/runtime-v2/internalization/__tests__/evaluator-prompt-builder.test.d.ts +2 -0
- package/dist/runtime-v2/internalization/__tests__/evaluator-prompt-builder.test.d.ts.map +1 -0
- package/dist/runtime-v2/internalization/__tests__/evaluator-prompt-builder.test.js +112 -0
- package/dist/runtime-v2/internalization/__tests__/evaluator-prompt-builder.test.js.map +1 -0
- package/dist/runtime-v2/internalization/__tests__/internalization-job-graph.test.d.ts +2 -0
- package/dist/runtime-v2/internalization/__tests__/internalization-job-graph.test.d.ts.map +1 -0
- package/dist/runtime-v2/internalization/__tests__/internalization-job-graph.test.js +176 -0
- package/dist/runtime-v2/internalization/__tests__/internalization-job-graph.test.js.map +1 -0
- package/dist/runtime-v2/internalization/__tests__/internalization-task-guards.test.d.ts +2 -0
- package/dist/runtime-v2/internalization/__tests__/internalization-task-guards.test.d.ts.map +1 -0
- package/dist/runtime-v2/internalization/__tests__/internalization-task-guards.test.js +297 -0
- package/dist/runtime-v2/internalization/__tests__/internalization-task-guards.test.js.map +1 -0
- package/dist/runtime-v2/internalization/__tests__/philosopher-prompt-builder.test.d.ts +2 -0
- package/dist/runtime-v2/internalization/__tests__/philosopher-prompt-builder.test.d.ts.map +1 -0
- package/dist/runtime-v2/internalization/__tests__/philosopher-prompt-builder.test.js +149 -0
- package/dist/runtime-v2/internalization/__tests__/philosopher-prompt-builder.test.js.map +1 -0
- package/dist/runtime-v2/internalization/__tests__/queue-actionability.test.d.ts +2 -0
- package/dist/runtime-v2/internalization/__tests__/queue-actionability.test.d.ts.map +1 -0
- package/dist/runtime-v2/internalization/__tests__/queue-actionability.test.js +92 -0
- package/dist/runtime-v2/internalization/__tests__/queue-actionability.test.js.map +1 -0
- package/dist/runtime-v2/internalization/__tests__/refiner-rulehost-gate.test.d.ts +2 -0
- package/dist/runtime-v2/internalization/__tests__/refiner-rulehost-gate.test.d.ts.map +1 -0
- package/dist/runtime-v2/internalization/__tests__/refiner-rulehost-gate.test.js +431 -0
- package/dist/runtime-v2/internalization/__tests__/refiner-rulehost-gate.test.js.map +1 -0
- package/dist/runtime-v2/internalization/__tests__/refiner-sandbox-wrapper.test.d.ts +2 -0
- package/dist/runtime-v2/internalization/__tests__/refiner-sandbox-wrapper.test.d.ts.map +1 -0
- package/dist/runtime-v2/internalization/__tests__/refiner-sandbox-wrapper.test.js +763 -0
- package/dist/runtime-v2/internalization/__tests__/refiner-sandbox-wrapper.test.js.map +1 -0
- package/dist/runtime-v2/internalization/__tests__/rollout-reviewer-prompt-builder.test.d.ts +2 -0
- package/dist/runtime-v2/internalization/__tests__/rollout-reviewer-prompt-builder.test.d.ts.map +1 -0
- package/dist/runtime-v2/internalization/__tests__/rollout-reviewer-prompt-builder.test.js +75 -0
- package/dist/runtime-v2/internalization/__tests__/rollout-reviewer-prompt-builder.test.js.map +1 -0
- package/dist/runtime-v2/internalization/__tests__/scribe-prompt-builder.test.d.ts +2 -0
- package/dist/runtime-v2/internalization/__tests__/scribe-prompt-builder.test.d.ts.map +1 -0
- package/dist/runtime-v2/internalization/__tests__/scribe-prompt-builder.test.js +56 -0
- package/dist/runtime-v2/internalization/__tests__/scribe-prompt-builder.test.js.map +1 -0
- package/dist/runtime-v2/internalization/__tests__/trainer-prompt-builder.test.d.ts +2 -0
- package/dist/runtime-v2/internalization/__tests__/trainer-prompt-builder.test.d.ts.map +1 -0
- package/dist/runtime-v2/internalization/__tests__/trainer-prompt-builder.test.js +141 -0
- package/dist/runtime-v2/internalization/__tests__/trainer-prompt-builder.test.js.map +1 -0
- package/dist/runtime-v2/internalization/artificer-output.d.ts +67 -0
- package/dist/runtime-v2/internalization/artificer-output.d.ts.map +1 -0
- package/dist/runtime-v2/internalization/artificer-output.js +103 -0
- package/dist/runtime-v2/internalization/artificer-output.js.map +1 -0
- package/dist/runtime-v2/internalization/artificer-prompt-builder.d.ts +24 -0
- package/dist/runtime-v2/internalization/artificer-prompt-builder.d.ts.map +1 -0
- package/dist/runtime-v2/internalization/artificer-prompt-builder.js +62 -0
- package/dist/runtime-v2/internalization/artificer-prompt-builder.js.map +1 -0
- package/dist/runtime-v2/internalization/artificer-runner.d.ts +77 -0
- package/dist/runtime-v2/internalization/artificer-runner.d.ts.map +1 -0
- package/dist/runtime-v2/internalization/artificer-runner.js +521 -0
- package/dist/runtime-v2/internalization/artificer-runner.js.map +1 -0
- package/dist/runtime-v2/internalization/compile-result.d.ts +20 -0
- package/dist/runtime-v2/internalization/compile-result.d.ts.map +1 -0
- package/dist/runtime-v2/internalization/compile-result.js +8 -0
- package/dist/runtime-v2/internalization/compile-result.js.map +1 -0
- package/dist/runtime-v2/internalization/correction-proposal.d.ts +38 -0
- package/dist/runtime-v2/internalization/correction-proposal.d.ts.map +1 -0
- package/dist/runtime-v2/internalization/correction-proposal.js +322 -0
- package/dist/runtime-v2/internalization/correction-proposal.js.map +1 -0
- package/dist/runtime-v2/internalization/deprecated-readiness.d.ts +20 -0
- package/dist/runtime-v2/internalization/deprecated-readiness.d.ts.map +1 -0
- package/dist/runtime-v2/internalization/deprecated-readiness.js +75 -0
- package/dist/runtime-v2/internalization/deprecated-readiness.js.map +1 -0
- package/dist/runtime-v2/internalization/deprecated-readiness.test.d.ts +2 -0
- package/dist/runtime-v2/internalization/deprecated-readiness.test.d.ts.map +1 -0
- package/dist/runtime-v2/internalization/deprecated-readiness.test.js +127 -0
- package/dist/runtime-v2/internalization/deprecated-readiness.test.js.map +1 -0
- package/dist/runtime-v2/internalization/dreamer-output.d.ts +120 -0
- package/dist/runtime-v2/internalization/dreamer-output.d.ts.map +1 -0
- package/dist/runtime-v2/internalization/dreamer-output.js +92 -0
- package/dist/runtime-v2/internalization/dreamer-output.js.map +1 -0
- package/dist/runtime-v2/internalization/dreamer-prompt-builder.d.ts +41 -0
- package/dist/runtime-v2/internalization/dreamer-prompt-builder.d.ts.map +1 -0
- package/dist/runtime-v2/internalization/dreamer-prompt-builder.js +43 -0
- package/dist/runtime-v2/internalization/dreamer-prompt-builder.js.map +1 -0
- package/dist/runtime-v2/internalization/dreamer-runner.d.ts +134 -0
- package/dist/runtime-v2/internalization/dreamer-runner.d.ts.map +1 -0
- package/dist/runtime-v2/internalization/dreamer-runner.js +636 -0
- package/dist/runtime-v2/internalization/dreamer-runner.js.map +1 -0
- package/dist/runtime-v2/internalization/evaluator-output.d.ts +71 -0
- package/dist/runtime-v2/internalization/evaluator-output.d.ts.map +1 -0
- package/dist/runtime-v2/internalization/evaluator-output.js +113 -0
- package/dist/runtime-v2/internalization/evaluator-output.js.map +1 -0
- package/dist/runtime-v2/internalization/evaluator-prompt-builder.d.ts +24 -0
- package/dist/runtime-v2/internalization/evaluator-prompt-builder.d.ts.map +1 -0
- package/dist/runtime-v2/internalization/evaluator-prompt-builder.js +49 -0
- package/dist/runtime-v2/internalization/evaluator-prompt-builder.js.map +1 -0
- package/dist/runtime-v2/internalization/evaluator-runner.d.ts +80 -0
- package/dist/runtime-v2/internalization/evaluator-runner.d.ts.map +1 -0
- package/dist/runtime-v2/internalization/evaluator-runner.js +661 -0
- package/dist/runtime-v2/internalization/evaluator-runner.js.map +1 -0
- package/dist/runtime-v2/internalization/index.d.ts +81 -0
- package/dist/runtime-v2/internalization/index.d.ts.map +1 -0
- package/dist/runtime-v2/internalization/index.js +47 -0
- package/dist/runtime-v2/internalization/index.js.map +1 -0
- package/dist/runtime-v2/internalization/intake-to-internalization-bridge.d.ts +57 -0
- package/dist/runtime-v2/internalization/intake-to-internalization-bridge.d.ts.map +1 -0
- package/dist/runtime-v2/internalization/intake-to-internalization-bridge.js +99 -0
- package/dist/runtime-v2/internalization/intake-to-internalization-bridge.js.map +1 -0
- package/dist/runtime-v2/internalization/internalization-job-graph.d.ts +78 -0
- package/dist/runtime-v2/internalization/internalization-job-graph.d.ts.map +1 -0
- package/dist/runtime-v2/internalization/internalization-job-graph.js +153 -0
- package/dist/runtime-v2/internalization/internalization-job-graph.js.map +1 -0
- package/dist/runtime-v2/internalization/internalization-orchestrator.d.ts +182 -0
- package/dist/runtime-v2/internalization/internalization-orchestrator.d.ts.map +1 -0
- package/dist/runtime-v2/internalization/internalization-orchestrator.js +355 -0
- package/dist/runtime-v2/internalization/internalization-orchestrator.js.map +1 -0
- package/dist/runtime-v2/internalization/internalization-route.d.ts +28 -0
- package/dist/runtime-v2/internalization/internalization-route.d.ts.map +1 -0
- package/dist/runtime-v2/internalization/internalization-route.js +112 -0
- package/dist/runtime-v2/internalization/internalization-route.js.map +1 -0
- package/dist/runtime-v2/internalization/internalization-state-machine.d.ts +157 -0
- package/dist/runtime-v2/internalization/internalization-state-machine.d.ts.map +1 -0
- package/dist/runtime-v2/internalization/internalization-state-machine.js +274 -0
- package/dist/runtime-v2/internalization/internalization-state-machine.js.map +1 -0
- package/dist/runtime-v2/internalization/internalization-task-guards.d.ts +92 -0
- package/dist/runtime-v2/internalization/internalization-task-guards.d.ts.map +1 -0
- package/dist/runtime-v2/internalization/internalization-task-guards.js +152 -0
- package/dist/runtime-v2/internalization/internalization-task-guards.js.map +1 -0
- package/dist/runtime-v2/internalization/lifecycle-datasource.d.ts +18 -0
- package/dist/runtime-v2/internalization/lifecycle-datasource.d.ts.map +1 -0
- package/dist/runtime-v2/internalization/lifecycle-datasource.js +2 -0
- package/dist/runtime-v2/internalization/lifecycle-datasource.js.map +1 -0
- package/dist/runtime-v2/internalization/lifecycle-metrics.d.ts +24 -0
- package/dist/runtime-v2/internalization/lifecycle-metrics.d.ts.map +1 -0
- package/dist/runtime-v2/internalization/lifecycle-metrics.js +124 -0
- package/dist/runtime-v2/internalization/lifecycle-metrics.js.map +1 -0
- package/dist/runtime-v2/internalization/lifecycle-metrics.test.d.ts +2 -0
- package/dist/runtime-v2/internalization/lifecycle-metrics.test.d.ts.map +1 -0
- package/dist/runtime-v2/internalization/lifecycle-metrics.test.js +201 -0
- package/dist/runtime-v2/internalization/lifecycle-metrics.test.js.map +1 -0
- package/dist/runtime-v2/internalization/lifecycle-read-model.d.ts +11 -0
- package/dist/runtime-v2/internalization/lifecycle-read-model.d.ts.map +1 -0
- package/dist/runtime-v2/internalization/lifecycle-read-model.js +155 -0
- package/dist/runtime-v2/internalization/lifecycle-read-model.js.map +1 -0
- package/dist/runtime-v2/internalization/lifecycle-read-model.test.d.ts +2 -0
- package/dist/runtime-v2/internalization/lifecycle-read-model.test.d.ts.map +1 -0
- package/dist/runtime-v2/internalization/lifecycle-read-model.test.js +408 -0
- package/dist/runtime-v2/internalization/lifecycle-read-model.test.js.map +1 -0
- package/dist/runtime-v2/internalization/lifecycle-types.d.ts +75 -0
- package/dist/runtime-v2/internalization/lifecycle-types.d.ts.map +1 -0
- package/dist/runtime-v2/internalization/lifecycle-types.js +2 -0
- package/dist/runtime-v2/internalization/lifecycle-types.js.map +1 -0
- package/dist/runtime-v2/internalization/peer-runner-contracts.d.ts +140 -0
- package/dist/runtime-v2/internalization/peer-runner-contracts.d.ts.map +1 -0
- package/dist/runtime-v2/internalization/peer-runner-contracts.js +124 -0
- package/dist/runtime-v2/internalization/peer-runner-contracts.js.map +1 -0
- package/dist/runtime-v2/internalization/philosopher-output.d.ts +56 -0
- package/dist/runtime-v2/internalization/philosopher-output.d.ts.map +1 -0
- package/dist/runtime-v2/internalization/philosopher-output.js +69 -0
- package/dist/runtime-v2/internalization/philosopher-output.js.map +1 -0
- package/dist/runtime-v2/internalization/philosopher-prompt-builder.d.ts +41 -0
- package/dist/runtime-v2/internalization/philosopher-prompt-builder.d.ts.map +1 -0
- package/dist/runtime-v2/internalization/philosopher-prompt-builder.js +50 -0
- package/dist/runtime-v2/internalization/philosopher-prompt-builder.js.map +1 -0
- package/dist/runtime-v2/internalization/philosopher-runner.d.ts +103 -0
- package/dist/runtime-v2/internalization/philosopher-runner.d.ts.map +1 -0
- package/dist/runtime-v2/internalization/philosopher-runner.js +519 -0
- package/dist/runtime-v2/internalization/philosopher-runner.js.map +1 -0
- package/dist/runtime-v2/internalization/pi-artifact-store.d.ts +13 -0
- package/dist/runtime-v2/internalization/pi-artifact-store.d.ts.map +1 -0
- package/dist/runtime-v2/internalization/pi-artifact-store.js +65 -0
- package/dist/runtime-v2/internalization/pi-artifact-store.js.map +1 -0
- package/dist/runtime-v2/internalization/pi-artifact.d.ts +23 -0
- package/dist/runtime-v2/internalization/pi-artifact.d.ts.map +1 -0
- package/dist/runtime-v2/internalization/pi-artifact.js +2 -0
- package/dist/runtime-v2/internalization/pi-artifact.js.map +1 -0
- package/dist/runtime-v2/internalization/pitask-metadata.d.ts +80 -0
- package/dist/runtime-v2/internalization/pitask-metadata.d.ts.map +1 -0
- package/dist/runtime-v2/internalization/pitask-metadata.js +194 -0
- package/dist/runtime-v2/internalization/pitask-metadata.js.map +1 -0
- package/dist/runtime-v2/internalization/queue-actionability.d.ts +37 -0
- package/dist/runtime-v2/internalization/queue-actionability.d.ts.map +1 -0
- package/dist/runtime-v2/internalization/queue-actionability.js +50 -0
- package/dist/runtime-v2/internalization/queue-actionability.js.map +1 -0
- package/dist/runtime-v2/internalization/refiner-rulehost-gate.d.ts +20 -0
- package/dist/runtime-v2/internalization/refiner-rulehost-gate.d.ts.map +1 -0
- package/dist/runtime-v2/internalization/refiner-rulehost-gate.js +151 -0
- package/dist/runtime-v2/internalization/refiner-rulehost-gate.js.map +1 -0
- package/dist/runtime-v2/internalization/refiner-sandbox-wrapper.d.ts +36 -0
- package/dist/runtime-v2/internalization/refiner-sandbox-wrapper.d.ts.map +1 -0
- package/dist/runtime-v2/internalization/refiner-sandbox-wrapper.js +227 -0
- package/dist/runtime-v2/internalization/refiner-sandbox-wrapper.js.map +1 -0
- package/dist/runtime-v2/internalization/rollout-reviewer-output.d.ts +74 -0
- package/dist/runtime-v2/internalization/rollout-reviewer-output.d.ts.map +1 -0
- package/dist/runtime-v2/internalization/rollout-reviewer-output.js +117 -0
- package/dist/runtime-v2/internalization/rollout-reviewer-output.js.map +1 -0
- package/dist/runtime-v2/internalization/rollout-reviewer-prompt-builder.d.ts +24 -0
- package/dist/runtime-v2/internalization/rollout-reviewer-prompt-builder.d.ts.map +1 -0
- package/dist/runtime-v2/internalization/rollout-reviewer-prompt-builder.js +52 -0
- package/dist/runtime-v2/internalization/rollout-reviewer-prompt-builder.js.map +1 -0
- package/dist/runtime-v2/internalization/rollout-reviewer-runner.d.ts +76 -0
- package/dist/runtime-v2/internalization/rollout-reviewer-runner.d.ts.map +1 -0
- package/dist/runtime-v2/internalization/rollout-reviewer-runner.js +538 -0
- package/dist/runtime-v2/internalization/rollout-reviewer-runner.js.map +1 -0
- package/dist/runtime-v2/internalization/routing-policy.d.ts +24 -0
- package/dist/runtime-v2/internalization/routing-policy.d.ts.map +1 -0
- package/dist/runtime-v2/internalization/routing-policy.js +169 -0
- package/dist/runtime-v2/internalization/routing-policy.js.map +1 -0
- package/dist/runtime-v2/internalization/routing-policy.test.d.ts +2 -0
- package/dist/runtime-v2/internalization/routing-policy.test.d.ts.map +1 -0
- package/dist/runtime-v2/internalization/routing-policy.test.js +286 -0
- package/dist/runtime-v2/internalization/routing-policy.test.js.map +1 -0
- package/dist/runtime-v2/internalization/rule-code-validator.d.ts +21 -0
- package/dist/runtime-v2/internalization/rule-code-validator.d.ts.map +1 -0
- package/dist/runtime-v2/internalization/rule-code-validator.js +42 -0
- package/dist/runtime-v2/internalization/rule-code-validator.js.map +1 -0
- package/dist/runtime-v2/internalization/rule-host-adapter.d.ts +16 -0
- package/dist/runtime-v2/internalization/rule-host-adapter.d.ts.map +1 -0
- package/dist/runtime-v2/internalization/rule-host-adapter.js +13 -0
- package/dist/runtime-v2/internalization/rule-host-adapter.js.map +1 -0
- package/dist/runtime-v2/internalization/rule-host-contracts.d.ts +61 -0
- package/dist/runtime-v2/internalization/rule-host-contracts.d.ts.map +1 -0
- package/dist/runtime-v2/internalization/rule-host-contracts.js +14 -0
- package/dist/runtime-v2/internalization/rule-host-contracts.js.map +1 -0
- package/dist/runtime-v2/internalization/rule-host-evaluator.d.ts +36 -0
- package/dist/runtime-v2/internalization/rule-host-evaluator.d.ts.map +1 -0
- package/dist/runtime-v2/internalization/rule-host-evaluator.js +103 -0
- package/dist/runtime-v2/internalization/rule-host-evaluator.js.map +1 -0
- package/dist/runtime-v2/internalization/rule-host-helpers.d.ts +27 -0
- package/dist/runtime-v2/internalization/rule-host-helpers.d.ts.map +1 -0
- package/dist/runtime-v2/internalization/rule-host-helpers.js +27 -0
- package/dist/runtime-v2/internalization/rule-host-helpers.js.map +1 -0
- package/dist/runtime-v2/internalization/scribe-output.d.ts +74 -0
- package/dist/runtime-v2/internalization/scribe-output.d.ts.map +1 -0
- package/dist/runtime-v2/internalization/scribe-output.js +98 -0
- package/dist/runtime-v2/internalization/scribe-output.js.map +1 -0
- package/dist/runtime-v2/internalization/scribe-prompt-builder.d.ts +24 -0
- package/dist/runtime-v2/internalization/scribe-prompt-builder.d.ts.map +1 -0
- package/dist/runtime-v2/internalization/scribe-prompt-builder.js +60 -0
- package/dist/runtime-v2/internalization/scribe-prompt-builder.js.map +1 -0
- package/dist/runtime-v2/internalization/scribe-runner.d.ts +77 -0
- package/dist/runtime-v2/internalization/scribe-runner.d.ts.map +1 -0
- package/dist/runtime-v2/internalization/scribe-runner.js +518 -0
- package/dist/runtime-v2/internalization/scribe-runner.js.map +1 -0
- package/dist/runtime-v2/internalization/template-generator.d.ts +21 -0
- package/dist/runtime-v2/internalization/template-generator.d.ts.map +1 -0
- package/dist/runtime-v2/internalization/template-generator.js +61 -0
- package/dist/runtime-v2/internalization/template-generator.js.map +1 -0
- package/dist/runtime-v2/internalization/trainer-output.d.ts +122 -0
- package/dist/runtime-v2/internalization/trainer-output.d.ts.map +1 -0
- package/dist/runtime-v2/internalization/trainer-output.js +223 -0
- package/dist/runtime-v2/internalization/trainer-output.js.map +1 -0
- package/dist/runtime-v2/internalization/trainer-prompt-builder.d.ts +24 -0
- package/dist/runtime-v2/internalization/trainer-prompt-builder.d.ts.map +1 -0
- package/dist/runtime-v2/internalization/trainer-prompt-builder.js +57 -0
- package/dist/runtime-v2/internalization/trainer-prompt-builder.js.map +1 -0
- package/dist/runtime-v2/internalization/trainer-runner.d.ts +76 -0
- package/dist/runtime-v2/internalization/trainer-runner.d.ts.map +1 -0
- package/dist/runtime-v2/internalization/trainer-runner.js +538 -0
- package/dist/runtime-v2/internalization/trainer-runner.js.map +1 -0
- package/dist/runtime-v2/internalization-chain-integrity-read-model.d.ts +42 -0
- package/dist/runtime-v2/internalization-chain-integrity-read-model.d.ts.map +1 -0
- package/dist/runtime-v2/internalization-chain-integrity-read-model.js +413 -0
- package/dist/runtime-v2/internalization-chain-integrity-read-model.js.map +1 -0
- package/dist/runtime-v2/internalization-integrity-remediation.d.ts +17 -0
- package/dist/runtime-v2/internalization-integrity-remediation.d.ts.map +1 -0
- package/dist/runtime-v2/internalization-integrity-remediation.js +269 -0
- package/dist/runtime-v2/internalization-integrity-remediation.js.map +1 -0
- package/dist/runtime-v2/internalization-queue-read-model.d.ts +93 -0
- package/dist/runtime-v2/internalization-queue-read-model.d.ts.map +1 -0
- package/dist/runtime-v2/internalization-queue-read-model.js +217 -0
- package/dist/runtime-v2/internalization-queue-read-model.js.map +1 -0
- package/dist/runtime-v2/l1-hard-cap.d.ts +21 -0
- package/dist/runtime-v2/l1-hard-cap.d.ts.map +1 -0
- package/dist/runtime-v2/l1-hard-cap.js +51 -0
- package/dist/runtime-v2/l1-hard-cap.js.map +1 -0
- package/dist/runtime-v2/nocturnal/candidate-scoring.d.ts +486 -0
- package/dist/runtime-v2/nocturnal/candidate-scoring.d.ts.map +1 -0
- package/dist/runtime-v2/nocturnal/candidate-scoring.js +493 -0
- package/dist/runtime-v2/nocturnal/candidate-scoring.js.map +1 -0
- package/dist/runtime-v2/nocturnal/index.d.ts +9 -0
- package/dist/runtime-v2/nocturnal/index.d.ts.map +1 -0
- package/dist/runtime-v2/nocturnal/index.js +5 -0
- package/dist/runtime-v2/nocturnal/index.js.map +1 -0
- package/dist/runtime-v2/nocturnal/nocturnal-compliance.d.ts +185 -0
- package/dist/runtime-v2/nocturnal/nocturnal-compliance.d.ts.map +1 -0
- package/dist/runtime-v2/nocturnal/nocturnal-compliance.js +912 -0
- package/dist/runtime-v2/nocturnal/nocturnal-compliance.js.map +1 -0
- package/dist/runtime-v2/nocturnal/snapshot-contract.d.ts +192 -0
- package/dist/runtime-v2/nocturnal/snapshot-contract.d.ts.map +1 -0
- package/dist/runtime-v2/nocturnal/snapshot-contract.js +185 -0
- package/dist/runtime-v2/nocturnal/snapshot-contract.js.map +1 -0
- package/dist/runtime-v2/nocturnal/trinity-types.d.ts +421 -0
- package/dist/runtime-v2/nocturnal/trinity-types.d.ts.map +1 -0
- package/dist/runtime-v2/nocturnal/trinity-types.js +182 -0
- package/dist/runtime-v2/nocturnal/trinity-types.js.map +1 -0
- package/dist/runtime-v2/observer/__tests__/agent-scheduler.test.d.ts +2 -0
- package/dist/runtime-v2/observer/__tests__/agent-scheduler.test.d.ts.map +1 -0
- package/dist/runtime-v2/observer/__tests__/agent-scheduler.test.js +49 -0
- package/dist/runtime-v2/observer/__tests__/agent-scheduler.test.js.map +1 -0
- package/dist/runtime-v2/observer/__tests__/correction-observer.test.d.ts +2 -0
- package/dist/runtime-v2/observer/__tests__/correction-observer.test.d.ts.map +1 -0
- package/dist/runtime-v2/observer/__tests__/correction-observer.test.js +144 -0
- package/dist/runtime-v2/observer/__tests__/correction-observer.test.js.map +1 -0
- package/dist/runtime-v2/observer/__tests__/empathy-observer.real-e2e.test.d.ts +2 -0
- package/dist/runtime-v2/observer/__tests__/empathy-observer.real-e2e.test.d.ts.map +1 -0
- package/dist/runtime-v2/observer/__tests__/empathy-observer.real-e2e.test.js +67 -0
- package/dist/runtime-v2/observer/__tests__/empathy-observer.real-e2e.test.js.map +1 -0
- package/dist/runtime-v2/observer/__tests__/empathy-observer.test.d.ts +2 -0
- package/dist/runtime-v2/observer/__tests__/empathy-observer.test.d.ts.map +1 -0
- package/dist/runtime-v2/observer/__tests__/empathy-observer.test.js +84 -0
- package/dist/runtime-v2/observer/__tests__/empathy-observer.test.js.map +1 -0
- package/dist/runtime-v2/observer/agent-scheduler.d.ts +40 -0
- package/dist/runtime-v2/observer/agent-scheduler.d.ts.map +1 -0
- package/dist/runtime-v2/observer/agent-scheduler.js +30 -0
- package/dist/runtime-v2/observer/agent-scheduler.js.map +1 -0
- package/dist/runtime-v2/observer/correction-observer.d.ts +59 -0
- package/dist/runtime-v2/observer/correction-observer.d.ts.map +1 -0
- package/dist/runtime-v2/observer/correction-observer.js +178 -0
- package/dist/runtime-v2/observer/correction-observer.js.map +1 -0
- package/dist/runtime-v2/observer/empathy-observer.d.ts +35 -0
- package/dist/runtime-v2/observer/empathy-observer.d.ts.map +1 -0
- package/dist/runtime-v2/observer/empathy-observer.js +98 -0
- package/dist/runtime-v2/observer/empathy-observer.js.map +1 -0
- package/dist/runtime-v2/operator-health-read-model.d.ts +45 -0
- package/dist/runtime-v2/operator-health-read-model.d.ts.map +1 -0
- package/dist/runtime-v2/operator-health-read-model.js +189 -0
- package/dist/runtime-v2/operator-health-read-model.js.map +1 -0
- package/dist/runtime-v2/pain-chain-read-model.d.ts +40 -0
- package/dist/runtime-v2/pain-chain-read-model.d.ts.map +1 -0
- package/dist/runtime-v2/pain-chain-read-model.js +293 -0
- package/dist/runtime-v2/pain-chain-read-model.js.map +1 -0
- package/dist/runtime-v2/pain-flood-simulation.d.ts +62 -0
- package/dist/runtime-v2/pain-flood-simulation.d.ts.map +1 -0
- package/dist/runtime-v2/pain-flood-simulation.js +152 -0
- package/dist/runtime-v2/pain-flood-simulation.js.map +1 -0
- package/dist/runtime-v2/pain-signal-bridge.d.ts +72 -0
- package/dist/runtime-v2/pain-signal-bridge.d.ts.map +1 -0
- package/dist/runtime-v2/pain-signal-bridge.js +340 -0
- package/dist/runtime-v2/pain-signal-bridge.js.map +1 -0
- package/dist/runtime-v2/pain-signal-observability.d.ts +19 -0
- package/dist/runtime-v2/pain-signal-observability.d.ts.map +1 -0
- package/dist/runtime-v2/pain-signal-observability.js +161 -0
- package/dist/runtime-v2/pain-signal-observability.js.map +1 -0
- package/dist/runtime-v2/pain-signal-runtime-factory.d.ts +82 -0
- package/dist/runtime-v2/pain-signal-runtime-factory.d.ts.map +1 -0
- package/dist/runtime-v2/pain-signal-runtime-factory.js +279 -0
- package/dist/runtime-v2/pain-signal-runtime-factory.js.map +1 -0
- package/dist/runtime-v2/pain-to-principle-service.d.ts +53 -0
- package/dist/runtime-v2/pain-to-principle-service.d.ts.map +1 -0
- package/dist/runtime-v2/pain-to-principle-service.js +114 -0
- package/dist/runtime-v2/pain-to-principle-service.js.map +1 -0
- package/dist/runtime-v2/proven-channel-baseline.d.ts +56 -0
- package/dist/runtime-v2/proven-channel-baseline.d.ts.map +1 -0
- package/dist/runtime-v2/proven-channel-baseline.js +480 -0
- package/dist/runtime-v2/proven-channel-baseline.js.map +1 -0
- package/dist/runtime-v2/pruning-mask.d.ts +27 -0
- package/dist/runtime-v2/pruning-mask.d.ts.map +1 -0
- package/dist/runtime-v2/pruning-mask.js +59 -0
- package/dist/runtime-v2/pruning-mask.js.map +1 -0
- package/dist/runtime-v2/pruning-read-model.d.ts +76 -0
- package/dist/runtime-v2/pruning-read-model.d.ts.map +1 -0
- package/dist/runtime-v2/pruning-read-model.js +266 -0
- package/dist/runtime-v2/pruning-read-model.js.map +1 -0
- package/dist/runtime-v2/pruning-review-log.d.ts +41 -0
- package/dist/runtime-v2/pruning-review-log.d.ts.map +1 -0
- package/dist/runtime-v2/pruning-review-log.js +106 -0
- package/dist/runtime-v2/pruning-review-log.js.map +1 -0
- package/dist/runtime-v2/recovery-sweep-service.d.ts +14 -0
- package/dist/runtime-v2/recovery-sweep-service.d.ts.map +1 -0
- package/dist/runtime-v2/recovery-sweep-service.js +26 -0
- package/dist/runtime-v2/recovery-sweep-service.js.map +1 -0
- package/dist/runtime-v2/remediation-contract.d.ts +46 -0
- package/dist/runtime-v2/remediation-contract.d.ts.map +1 -0
- package/dist/runtime-v2/remediation-contract.js +29 -0
- package/dist/runtime-v2/remediation-contract.js.map +1 -0
- package/dist/runtime-v2/runner/__tests__/default-validator.test.d.ts +2 -0
- package/dist/runtime-v2/runner/__tests__/default-validator.test.d.ts.map +1 -0
- package/dist/runtime-v2/runner/__tests__/default-validator.test.js +526 -0
- package/dist/runtime-v2/runner/__tests__/default-validator.test.js.map +1 -0
- package/dist/runtime-v2/runner/__tests__/diagnose.test.d.ts +2 -0
- package/dist/runtime-v2/runner/__tests__/diagnose.test.d.ts.map +1 -0
- package/dist/runtime-v2/runner/__tests__/diagnose.test.js +81 -0
- package/dist/runtime-v2/runner/__tests__/diagnose.test.js.map +1 -0
- package/dist/runtime-v2/runner/__tests__/diagnostician-runner.integration.test.d.ts +2 -0
- package/dist/runtime-v2/runner/__tests__/diagnostician-runner.integration.test.d.ts.map +1 -0
- package/dist/runtime-v2/runner/__tests__/diagnostician-runner.integration.test.js +378 -0
- package/dist/runtime-v2/runner/__tests__/diagnostician-runner.integration.test.js.map +1 -0
- package/dist/runtime-v2/runner/__tests__/diagnostician-runner.test.d.ts +2 -0
- package/dist/runtime-v2/runner/__tests__/diagnostician-runner.test.d.ts.map +1 -0
- package/dist/runtime-v2/runner/__tests__/diagnostician-runner.test.js +642 -0
- package/dist/runtime-v2/runner/__tests__/diagnostician-runner.test.js.map +1 -0
- package/dist/runtime-v2/runner/__tests__/diagnostician-telemetry.test.d.ts +2 -0
- package/dist/runtime-v2/runner/__tests__/diagnostician-telemetry.test.d.ts.map +1 -0
- package/dist/runtime-v2/runner/__tests__/diagnostician-telemetry.test.js +286 -0
- package/dist/runtime-v2/runner/__tests__/diagnostician-telemetry.test.js.map +1 -0
- package/dist/runtime-v2/runner/__tests__/dual-track-e2e.test.d.ts +2 -0
- package/dist/runtime-v2/runner/__tests__/dual-track-e2e.test.d.ts.map +1 -0
- package/dist/runtime-v2/runner/__tests__/dual-track-e2e.test.js +320 -0
- package/dist/runtime-v2/runner/__tests__/dual-track-e2e.test.js.map +1 -0
- package/dist/runtime-v2/runner/__tests__/lease-expiration-recovery.integration.test.d.ts +2 -0
- package/dist/runtime-v2/runner/__tests__/lease-expiration-recovery.integration.test.d.ts.map +1 -0
- package/dist/runtime-v2/runner/__tests__/lease-expiration-recovery.integration.test.js +261 -0
- package/dist/runtime-v2/runner/__tests__/lease-expiration-recovery.integration.test.js.map +1 -0
- package/dist/runtime-v2/runner/__tests__/m5-05-e2e.test.d.ts +2 -0
- package/dist/runtime-v2/runner/__tests__/m5-05-e2e.test.d.ts.map +1 -0
- package/dist/runtime-v2/runner/__tests__/m5-05-e2e.test.js +405 -0
- package/dist/runtime-v2/runner/__tests__/m5-05-e2e.test.js.map +1 -0
- package/dist/runtime-v2/runner/__tests__/m6-06-e2e.test.d.ts +2 -0
- package/dist/runtime-v2/runner/__tests__/m6-06-e2e.test.d.ts.map +1 -0
- package/dist/runtime-v2/runner/__tests__/m6-06-e2e.test.js +347 -0
- package/dist/runtime-v2/runner/__tests__/m6-06-e2e.test.js.map +1 -0
- package/dist/runtime-v2/runner/__tests__/m6-06-legacy.test.d.ts +2 -0
- package/dist/runtime-v2/runner/__tests__/m6-06-legacy.test.d.ts.map +1 -0
- package/dist/runtime-v2/runner/__tests__/m6-06-legacy.test.js +186 -0
- package/dist/runtime-v2/runner/__tests__/m6-06-legacy.test.js.map +1 -0
- package/dist/runtime-v2/runner/__tests__/m6-06-real-path.test.d.ts +2 -0
- package/dist/runtime-v2/runner/__tests__/m6-06-real-path.test.d.ts.map +1 -0
- package/dist/runtime-v2/runner/__tests__/m6-06-real-path.test.js +355 -0
- package/dist/runtime-v2/runner/__tests__/m6-06-real-path.test.js.map +1 -0
- package/dist/runtime-v2/runner/__tests__/m8-02-e2e.test.d.ts +2 -0
- package/dist/runtime-v2/runner/__tests__/m8-02-e2e.test.d.ts.map +1 -0
- package/dist/runtime-v2/runner/__tests__/m8-02-e2e.test.js +488 -0
- package/dist/runtime-v2/runner/__tests__/m8-02-e2e.test.js.map +1 -0
- package/dist/runtime-v2/runner/__tests__/m9-adapter-integration.test.d.ts +2 -0
- package/dist/runtime-v2/runner/__tests__/m9-adapter-integration.test.d.ts.map +1 -0
- package/dist/runtime-v2/runner/__tests__/m9-adapter-integration.test.js +171 -0
- package/dist/runtime-v2/runner/__tests__/m9-adapter-integration.test.js.map +1 -0
- package/dist/runtime-v2/runner/__tests__/m9-e2e.test.d.ts +2 -0
- package/dist/runtime-v2/runner/__tests__/m9-e2e.test.d.ts.map +1 -0
- package/dist/runtime-v2/runner/__tests__/m9-e2e.test.js +182 -0
- package/dist/runtime-v2/runner/__tests__/m9-e2e.test.js.map +1 -0
- package/dist/runtime-v2/runner/__tests__/max-attempts-exceeded.integration.test.d.ts +2 -0
- package/dist/runtime-v2/runner/__tests__/max-attempts-exceeded.integration.test.d.ts.map +1 -0
- package/dist/runtime-v2/runner/__tests__/max-attempts-exceeded.integration.test.js +276 -0
- package/dist/runtime-v2/runner/__tests__/max-attempts-exceeded.integration.test.js.map +1 -0
- package/dist/runtime-v2/runner/__tests__/pain-signal-bridge-admission.test.d.ts +2 -0
- package/dist/runtime-v2/runner/__tests__/pain-signal-bridge-admission.test.d.ts.map +1 -0
- package/dist/runtime-v2/runner/__tests__/pain-signal-bridge-admission.test.js +462 -0
- package/dist/runtime-v2/runner/__tests__/pain-signal-bridge-admission.test.js.map +1 -0
- package/dist/runtime-v2/runner/__tests__/pain-signal-bridge.test.d.ts +2 -0
- package/dist/runtime-v2/runner/__tests__/pain-signal-bridge.test.d.ts.map +1 -0
- package/dist/runtime-v2/runner/__tests__/pain-signal-bridge.test.js +160 -0
- package/dist/runtime-v2/runner/__tests__/pain-signal-bridge.test.js.map +1 -0
- package/dist/runtime-v2/runner/__tests__/retry-wait-recovery.integration.test.d.ts +2 -0
- package/dist/runtime-v2/runner/__tests__/retry-wait-recovery.integration.test.d.ts.map +1 -0
- package/dist/runtime-v2/runner/__tests__/retry-wait-recovery.integration.test.js +272 -0
- package/dist/runtime-v2/runner/__tests__/retry-wait-recovery.integration.test.js.map +1 -0
- package/dist/runtime-v2/runner/__tests__/start-run-input.test.d.ts +2 -0
- package/dist/runtime-v2/runner/__tests__/start-run-input.test.d.ts.map +1 -0
- package/dist/runtime-v2/runner/__tests__/start-run-input.test.js +67 -0
- package/dist/runtime-v2/runner/__tests__/start-run-input.test.js.map +1 -0
- package/dist/runtime-v2/runner/default-validator.d.ts +10 -0
- package/dist/runtime-v2/runner/default-validator.d.ts.map +1 -0
- package/dist/runtime-v2/runner/default-validator.js +168 -0
- package/dist/runtime-v2/runner/default-validator.js.map +1 -0
- package/dist/runtime-v2/runner/diagnostician-runner-options.d.ts +37 -0
- package/dist/runtime-v2/runner/diagnostician-runner-options.d.ts.map +1 -0
- package/dist/runtime-v2/runner/diagnostician-runner-options.js +19 -0
- package/dist/runtime-v2/runner/diagnostician-runner-options.js.map +1 -0
- package/dist/runtime-v2/runner/diagnostician-runner.d.ts +87 -0
- package/dist/runtime-v2/runner/diagnostician-runner.d.ts.map +1 -0
- package/dist/runtime-v2/runner/diagnostician-runner.js +417 -0
- package/dist/runtime-v2/runner/diagnostician-runner.js.map +1 -0
- package/dist/runtime-v2/runner/diagnostician-validator.d.ts +56 -0
- package/dist/runtime-v2/runner/diagnostician-validator.d.ts.map +1 -0
- package/dist/runtime-v2/runner/diagnostician-validator.js +11 -0
- package/dist/runtime-v2/runner/diagnostician-validator.js.map +1 -0
- package/dist/runtime-v2/runner/runner-phase.d.ts +21 -0
- package/dist/runtime-v2/runner/runner-phase.d.ts.map +1 -0
- package/dist/runtime-v2/runner/runner-phase.js +22 -0
- package/dist/runtime-v2/runner/runner-phase.js.map +1 -0
- package/dist/runtime-v2/runner/runner-result.d.ts +20 -0
- package/dist/runtime-v2/runner/runner-result.d.ts.map +1 -0
- package/dist/runtime-v2/runner/runner-result.js +2 -0
- package/dist/runtime-v2/runner/runner-result.js.map +1 -0
- package/dist/runtime-v2/runtime-protocol.d.ts +165 -0
- package/dist/runtime-v2/runtime-protocol.d.ts.map +1 -0
- package/dist/runtime-v2/runtime-protocol.js +130 -0
- package/dist/runtime-v2/runtime-protocol.js.map +1 -0
- package/dist/runtime-v2/runtime-selector.d.ts +77 -0
- package/dist/runtime-v2/runtime-selector.d.ts.map +1 -0
- package/dist/runtime-v2/runtime-selector.js +23 -0
- package/dist/runtime-v2/runtime-selector.js.map +1 -0
- package/dist/runtime-v2/runtime-state-handle.d.ts +10 -0
- package/dist/runtime-v2/runtime-state-handle.d.ts.map +1 -0
- package/dist/runtime-v2/runtime-state-handle.js +30 -0
- package/dist/runtime-v2/runtime-state-handle.js.map +1 -0
- package/dist/runtime-v2/schema-conformance-read-model.d.ts +24 -0
- package/dist/runtime-v2/schema-conformance-read-model.d.ts.map +1 -0
- package/dist/runtime-v2/schema-conformance-read-model.js +178 -0
- package/dist/runtime-v2/schema-conformance-read-model.js.map +1 -0
- package/dist/runtime-v2/schema-version.d.ts +20 -0
- package/dist/runtime-v2/schema-version.d.ts.map +1 -0
- package/dist/runtime-v2/schema-version.js +20 -0
- package/dist/runtime-v2/schema-version.js.map +1 -0
- package/dist/runtime-v2/store/artifact/artifact-store.d.ts +28 -0
- package/dist/runtime-v2/store/artifact/artifact-store.d.ts.map +1 -0
- package/dist/runtime-v2/store/artifact/artifact-store.js +2 -0
- package/dist/runtime-v2/store/artifact/artifact-store.js.map +1 -0
- package/dist/runtime-v2/store/artifact/index.d.ts +4 -0
- package/dist/runtime-v2/store/artifact/index.d.ts.map +1 -0
- package/dist/runtime-v2/store/artifact/index.js +3 -0
- package/dist/runtime-v2/store/artifact/index.js.map +1 -0
- package/dist/runtime-v2/store/artifact/memory-artifact-store.d.ts +14 -0
- package/dist/runtime-v2/store/artifact/memory-artifact-store.d.ts.map +1 -0
- package/dist/runtime-v2/store/artifact/memory-artifact-store.js +25 -0
- package/dist/runtime-v2/store/artifact/memory-artifact-store.js.map +1 -0
- package/dist/runtime-v2/store/artifact/sqlite-artifact-store.d.ts +12 -0
- package/dist/runtime-v2/store/artifact/sqlite-artifact-store.d.ts.map +1 -0
- package/dist/runtime-v2/store/artifact/sqlite-artifact-store.js +51 -0
- package/dist/runtime-v2/store/artifact/sqlite-artifact-store.js.map +1 -0
- package/dist/runtime-v2/store/artifact/sqlite-pi-artifact-store.d.ts +13 -0
- package/dist/runtime-v2/store/artifact/sqlite-pi-artifact-store.d.ts.map +1 -0
- package/dist/runtime-v2/store/artifact/sqlite-pi-artifact-store.js +98 -0
- package/dist/runtime-v2/store/artifact/sqlite-pi-artifact-store.js.map +1 -0
- package/dist/runtime-v2/store/candidate/__tests__/recommendation-kind-resolver.test.d.ts +2 -0
- package/dist/runtime-v2/store/candidate/__tests__/recommendation-kind-resolver.test.d.ts.map +1 -0
- package/dist/runtime-v2/store/candidate/__tests__/recommendation-kind-resolver.test.js +34 -0
- package/dist/runtime-v2/store/candidate/__tests__/recommendation-kind-resolver.test.js.map +1 -0
- package/dist/runtime-v2/store/candidate/candidate-store.d.ts +42 -0
- package/dist/runtime-v2/store/candidate/candidate-store.d.ts.map +1 -0
- package/dist/runtime-v2/store/candidate/candidate-store.js +2 -0
- package/dist/runtime-v2/store/candidate/candidate-store.js.map +1 -0
- package/dist/runtime-v2/store/candidate/index.d.ts +4 -0
- package/dist/runtime-v2/store/candidate/index.d.ts.map +1 -0
- package/dist/runtime-v2/store/candidate/index.js +3 -0
- package/dist/runtime-v2/store/candidate/index.js.map +1 -0
- package/dist/runtime-v2/store/candidate/memory-candidate-store.d.ts +22 -0
- package/dist/runtime-v2/store/candidate/memory-candidate-store.d.ts.map +1 -0
- package/dist/runtime-v2/store/candidate/memory-candidate-store.js +36 -0
- package/dist/runtime-v2/store/candidate/memory-candidate-store.js.map +1 -0
- package/dist/runtime-v2/store/candidate/recommendation-kind-resolver.d.ts +4 -0
- package/dist/runtime-v2/store/candidate/recommendation-kind-resolver.d.ts.map +1 -0
- package/dist/runtime-v2/store/candidate/recommendation-kind-resolver.js +14 -0
- package/dist/runtime-v2/store/candidate/recommendation-kind-resolver.js.map +1 -0
- package/dist/runtime-v2/store/candidate/sqlite-candidate-store.d.ts +13 -0
- package/dist/runtime-v2/store/candidate/sqlite-candidate-store.d.ts.map +1 -0
- package/dist/runtime-v2/store/candidate/sqlite-candidate-store.js +61 -0
- package/dist/runtime-v2/store/candidate/sqlite-candidate-store.js.map +1 -0
- package/dist/runtime-v2/store/commit/commit-store.d.ts +19 -0
- package/dist/runtime-v2/store/commit/commit-store.d.ts.map +1 -0
- package/dist/runtime-v2/store/commit/commit-store.js +2 -0
- package/dist/runtime-v2/store/commit/commit-store.js.map +1 -0
- package/dist/runtime-v2/store/commit/diagnostician-committer.d.ts +47 -0
- package/dist/runtime-v2/store/commit/diagnostician-committer.d.ts.map +1 -0
- package/dist/runtime-v2/store/commit/diagnostician-committer.js +140 -0
- package/dist/runtime-v2/store/commit/diagnostician-committer.js.map +1 -0
- package/dist/runtime-v2/store/commit/index.d.ts +7 -0
- package/dist/runtime-v2/store/commit/index.d.ts.map +1 -0
- package/dist/runtime-v2/store/commit/index.js +4 -0
- package/dist/runtime-v2/store/commit/index.js.map +1 -0
- package/dist/runtime-v2/store/commit/memory-commit-store.d.ts +16 -0
- package/dist/runtime-v2/store/commit/memory-commit-store.d.ts.map +1 -0
- package/dist/runtime-v2/store/commit/memory-commit-store.js +18 -0
- package/dist/runtime-v2/store/commit/memory-commit-store.js.map +1 -0
- package/dist/runtime-v2/store/commit/sqlite-commit-store.d.ts +11 -0
- package/dist/runtime-v2/store/commit/sqlite-commit-store.d.ts.map +1 -0
- package/dist/runtime-v2/store/commit/sqlite-commit-store.js +25 -0
- package/dist/runtime-v2/store/commit/sqlite-commit-store.js.map +1 -0
- package/dist/runtime-v2/store/concurrent-lease.test.d.ts +2 -0
- package/dist/runtime-v2/store/concurrent-lease.test.d.ts.map +1 -0
- package/dist/runtime-v2/store/concurrent-lease.test.js +129 -0
- package/dist/runtime-v2/store/concurrent-lease.test.js.map +1 -0
- package/dist/runtime-v2/store/context/context-assembler.d.ts +19 -0
- package/dist/runtime-v2/store/context/context-assembler.d.ts.map +1 -0
- package/dist/runtime-v2/store/context/context-assembler.js +2 -0
- package/dist/runtime-v2/store/context/context-assembler.js.map +1 -0
- package/dist/runtime-v2/store/context/index.d.ts +4 -0
- package/dist/runtime-v2/store/context/index.d.ts.map +1 -0
- package/dist/runtime-v2/store/context/index.js +3 -0
- package/dist/runtime-v2/store/context/index.js.map +1 -0
- package/dist/runtime-v2/store/context/resilient-context-assembler.d.ts +13 -0
- package/dist/runtime-v2/store/context/resilient-context-assembler.d.ts.map +1 -0
- package/dist/runtime-v2/store/context/resilient-context-assembler.js +72 -0
- package/dist/runtime-v2/store/context/resilient-context-assembler.js.map +1 -0
- package/dist/runtime-v2/store/context/resilient-context-assembler.test.d.ts +2 -0
- package/dist/runtime-v2/store/context/resilient-context-assembler.test.d.ts.map +1 -0
- package/dist/runtime-v2/store/context/resilient-context-assembler.test.js +113 -0
- package/dist/runtime-v2/store/context/resilient-context-assembler.test.js.map +1 -0
- package/dist/runtime-v2/store/context/sqlite-context-assembler.d.ts +28 -0
- package/dist/runtime-v2/store/context/sqlite-context-assembler.d.ts.map +1 -0
- package/dist/runtime-v2/store/context/sqlite-context-assembler.js +277 -0
- package/dist/runtime-v2/store/context/sqlite-context-assembler.js.map +1 -0
- package/dist/runtime-v2/store/context/sqlite-context-assembler.test.d.ts +2 -0
- package/dist/runtime-v2/store/context/sqlite-context-assembler.test.d.ts.map +1 -0
- package/dist/runtime-v2/store/context/sqlite-context-assembler.test.js +1181 -0
- package/dist/runtime-v2/store/context/sqlite-context-assembler.test.js.map +1 -0
- package/dist/runtime-v2/store/diagnostician-committer.test.d.ts +2 -0
- package/dist/runtime-v2/store/diagnostician-committer.test.d.ts.map +1 -0
- package/dist/runtime-v2/store/diagnostician-committer.test.js +326 -0
- package/dist/runtime-v2/store/diagnostician-committer.test.js.map +1 -0
- package/dist/runtime-v2/store/event-emitter.d.ts +18 -0
- package/dist/runtime-v2/store/event-emitter.d.ts.map +1 -0
- package/dist/runtime-v2/store/event-emitter.js +78 -0
- package/dist/runtime-v2/store/event-emitter.js.map +1 -0
- package/dist/runtime-v2/store/history/history-query.d.ts +57 -0
- package/dist/runtime-v2/store/history/history-query.d.ts.map +1 -0
- package/dist/runtime-v2/store/history/history-query.js +7 -0
- package/dist/runtime-v2/store/history/history-query.js.map +1 -0
- package/dist/runtime-v2/store/history/index.d.ts +5 -0
- package/dist/runtime-v2/store/history/index.d.ts.map +1 -0
- package/dist/runtime-v2/store/history/index.js +4 -0
- package/dist/runtime-v2/store/history/index.js.map +1 -0
- package/dist/runtime-v2/store/history/resilient-history-query.d.ts +20 -0
- package/dist/runtime-v2/store/history/resilient-history-query.d.ts.map +1 -0
- package/dist/runtime-v2/store/history/resilient-history-query.js +40 -0
- package/dist/runtime-v2/store/history/resilient-history-query.js.map +1 -0
- package/dist/runtime-v2/store/history/resilient-history-query.test.d.ts +2 -0
- package/dist/runtime-v2/store/history/resilient-history-query.test.d.ts.map +1 -0
- package/dist/runtime-v2/store/history/resilient-history-query.test.js +128 -0
- package/dist/runtime-v2/store/history/resilient-history-query.test.js.map +1 -0
- package/dist/runtime-v2/store/history/sqlite-history-query.d.ts +24 -0
- package/dist/runtime-v2/store/history/sqlite-history-query.d.ts.map +1 -0
- package/dist/runtime-v2/store/history/sqlite-history-query.js +166 -0
- package/dist/runtime-v2/store/history/sqlite-history-query.js.map +1 -0
- package/dist/runtime-v2/store/history/sqlite-history-query.test.d.ts +2 -0
- package/dist/runtime-v2/store/history/sqlite-history-query.test.d.ts.map +1 -0
- package/dist/runtime-v2/store/history/sqlite-history-query.test.js +536 -0
- package/dist/runtime-v2/store/history/sqlite-history-query.test.js.map +1 -0
- package/dist/runtime-v2/store/idempotent-transitions.test.d.ts +2 -0
- package/dist/runtime-v2/store/idempotent-transitions.test.d.ts.map +1 -0
- package/dist/runtime-v2/store/idempotent-transitions.test.js +168 -0
- package/dist/runtime-v2/store/idempotent-transitions.test.js.map +1 -0
- package/dist/runtime-v2/store/lifecycle/index.d.ts +7 -0
- package/dist/runtime-v2/store/lifecycle/index.d.ts.map +1 -0
- package/dist/runtime-v2/store/lifecycle/index.js +4 -0
- package/dist/runtime-v2/store/lifecycle/index.js.map +1 -0
- package/dist/runtime-v2/store/lifecycle/lease-manager.d.ts +91 -0
- package/dist/runtime-v2/store/lifecycle/lease-manager.d.ts.map +1 -0
- package/dist/runtime-v2/store/lifecycle/lease-manager.js +154 -0
- package/dist/runtime-v2/store/lifecycle/lease-manager.js.map +1 -0
- package/dist/runtime-v2/store/lifecycle/lease-manager.test.d.ts +2 -0
- package/dist/runtime-v2/store/lifecycle/lease-manager.test.d.ts.map +1 -0
- package/dist/runtime-v2/store/lifecycle/lease-manager.test.js +243 -0
- package/dist/runtime-v2/store/lifecycle/lease-manager.test.js.map +1 -0
- package/dist/runtime-v2/store/lifecycle/recovery-sweep.d.ts +82 -0
- package/dist/runtime-v2/store/lifecycle/recovery-sweep.d.ts.map +1 -0
- package/dist/runtime-v2/store/lifecycle/recovery-sweep.js +145 -0
- package/dist/runtime-v2/store/lifecycle/recovery-sweep.js.map +1 -0
- package/dist/runtime-v2/store/lifecycle/recovery-sweep.test.d.ts +2 -0
- package/dist/runtime-v2/store/lifecycle/recovery-sweep.test.d.ts.map +1 -0
- package/dist/runtime-v2/store/lifecycle/recovery-sweep.test.js +318 -0
- package/dist/runtime-v2/store/lifecycle/recovery-sweep.test.js.map +1 -0
- package/dist/runtime-v2/store/lifecycle/retry-policy.d.ts +105 -0
- package/dist/runtime-v2/store/lifecycle/retry-policy.d.ts.map +1 -0
- package/dist/runtime-v2/store/lifecycle/retry-policy.js +48 -0
- package/dist/runtime-v2/store/lifecycle/retry-policy.js.map +1 -0
- package/dist/runtime-v2/store/lifecycle/retry-policy.test.d.ts +2 -0
- package/dist/runtime-v2/store/lifecycle/retry-policy.test.d.ts.map +1 -0
- package/dist/runtime-v2/store/lifecycle/retry-policy.test.js +86 -0
- package/dist/runtime-v2/store/lifecycle/retry-policy.test.js.map +1 -0
- package/dist/runtime-v2/store/run/index.d.ts +4 -0
- package/dist/runtime-v2/store/run/index.d.ts.map +1 -0
- package/dist/runtime-v2/store/run/index.js +3 -0
- package/dist/runtime-v2/store/run/index.js.map +1 -0
- package/dist/runtime-v2/store/run/memory-run-store.d.ts +15 -0
- package/dist/runtime-v2/store/run/memory-run-store.d.ts.map +1 -0
- package/dist/runtime-v2/store/run/memory-run-store.js +33 -0
- package/dist/runtime-v2/store/run/memory-run-store.js.map +1 -0
- package/dist/runtime-v2/store/run/run-store.d.ts +43 -0
- package/dist/runtime-v2/store/run/run-store.d.ts.map +1 -0
- package/dist/runtime-v2/store/run/run-store.js +2 -0
- package/dist/runtime-v2/store/run/run-store.js.map +1 -0
- package/dist/runtime-v2/store/run/sqlite-run-store.d.ts +14 -0
- package/dist/runtime-v2/store/run/sqlite-run-store.d.ts.map +1 -0
- package/dist/runtime-v2/store/run/sqlite-run-store.js +108 -0
- package/dist/runtime-v2/store/run/sqlite-run-store.js.map +1 -0
- package/dist/runtime-v2/store/runtime-state-manager.d.ts +116 -0
- package/dist/runtime-v2/store/runtime-state-manager.d.ts.map +1 -0
- package/dist/runtime-v2/store/runtime-state-manager.integration.test.d.ts +2 -0
- package/dist/runtime-v2/store/runtime-state-manager.integration.test.d.ts.map +1 -0
- package/dist/runtime-v2/store/runtime-state-manager.integration.test.js +187 -0
- package/dist/runtime-v2/store/runtime-state-manager.integration.test.js.map +1 -0
- package/dist/runtime-v2/store/runtime-state-manager.js +321 -0
- package/dist/runtime-v2/store/runtime-state-manager.js.map +1 -0
- package/dist/runtime-v2/store/schema-conformance.test.d.ts +2 -0
- package/dist/runtime-v2/store/schema-conformance.test.d.ts.map +1 -0
- package/dist/runtime-v2/store/schema-conformance.test.js +607 -0
- package/dist/runtime-v2/store/schema-conformance.test.js.map +1 -0
- package/dist/runtime-v2/store/sqlite-connection-close.test.d.ts +2 -0
- package/dist/runtime-v2/store/sqlite-connection-close.test.d.ts.map +1 -0
- package/dist/runtime-v2/store/sqlite-connection-close.test.js +57 -0
- package/dist/runtime-v2/store/sqlite-connection-close.test.js.map +1 -0
- package/dist/runtime-v2/store/sqlite-connection-pragma.test.d.ts +2 -0
- package/dist/runtime-v2/store/sqlite-connection-pragma.test.d.ts.map +1 -0
- package/dist/runtime-v2/store/sqlite-connection-pragma.test.js +261 -0
- package/dist/runtime-v2/store/sqlite-connection-pragma.test.js.map +1 -0
- package/dist/runtime-v2/store/sqlite-connection.d.ts +39 -0
- package/dist/runtime-v2/store/sqlite-connection.d.ts.map +1 -0
- package/dist/runtime-v2/store/sqlite-connection.js +364 -0
- package/dist/runtime-v2/store/sqlite-connection.js.map +1 -0
- package/dist/runtime-v2/store/sqlite-run-store.test.d.ts +2 -0
- package/dist/runtime-v2/store/sqlite-run-store.test.d.ts.map +1 -0
- package/dist/runtime-v2/store/sqlite-run-store.test.js +152 -0
- package/dist/runtime-v2/store/sqlite-run-store.test.js.map +1 -0
- package/dist/runtime-v2/store/sqlite-task-store.test.d.ts +2 -0
- package/dist/runtime-v2/store/sqlite-task-store.test.d.ts.map +1 -0
- package/dist/runtime-v2/store/sqlite-task-store.test.js +166 -0
- package/dist/runtime-v2/store/sqlite-task-store.test.js.map +1 -0
- package/dist/runtime-v2/store/task/index.d.ts +4 -0
- package/dist/runtime-v2/store/task/index.d.ts.map +1 -0
- package/dist/runtime-v2/store/task/index.js +3 -0
- package/dist/runtime-v2/store/task/index.js.map +1 -0
- package/dist/runtime-v2/store/task/memory-task-store.d.ts +15 -0
- package/dist/runtime-v2/store/task/memory-task-store.d.ts.map +1 -0
- package/dist/runtime-v2/store/task/memory-task-store.js +43 -0
- package/dist/runtime-v2/store/task/memory-task-store.js.map +1 -0
- package/dist/runtime-v2/store/task/sqlite-task-store.d.ts +14 -0
- package/dist/runtime-v2/store/task/sqlite-task-store.d.ts.map +1 -0
- package/dist/runtime-v2/store/task/sqlite-task-store.js +144 -0
- package/dist/runtime-v2/store/task/sqlite-task-store.js.map +1 -0
- package/dist/runtime-v2/store/task/task-store.d.ts +48 -0
- package/dist/runtime-v2/store/task/task-store.d.ts.map +1 -0
- package/dist/runtime-v2/store/task/task-store.js +2 -0
- package/dist/runtime-v2/store/task/task-store.js.map +1 -0
- package/dist/runtime-v2/store/task-migration.d.ts +89 -0
- package/dist/runtime-v2/store/task-migration.d.ts.map +1 -0
- package/dist/runtime-v2/store/task-migration.js +79 -0
- package/dist/runtime-v2/store/task-migration.js.map +1 -0
- package/dist/runtime-v2/store/trajectory/index.d.ts +5 -0
- package/dist/runtime-v2/store/trajectory/index.d.ts.map +1 -0
- package/dist/runtime-v2/store/trajectory/index.js +3 -0
- package/dist/runtime-v2/store/trajectory/index.js.map +1 -0
- package/dist/runtime-v2/store/trajectory/source-trace-locator.d.ts +40 -0
- package/dist/runtime-v2/store/trajectory/source-trace-locator.d.ts.map +1 -0
- package/dist/runtime-v2/store/trajectory/source-trace-locator.js +18 -0
- package/dist/runtime-v2/store/trajectory/source-trace-locator.js.map +1 -0
- package/dist/runtime-v2/store/trajectory/source-trace-locator.test.d.ts +2 -0
- package/dist/runtime-v2/store/trajectory/source-trace-locator.test.d.ts.map +1 -0
- package/dist/runtime-v2/store/trajectory/source-trace-locator.test.js +320 -0
- package/dist/runtime-v2/store/trajectory/source-trace-locator.test.js.map +1 -0
- package/dist/runtime-v2/store/trajectory/sqlite-source-trace-locator.d.ts +23 -0
- package/dist/runtime-v2/store/trajectory/sqlite-source-trace-locator.d.ts.map +1 -0
- package/dist/runtime-v2/store/trajectory/sqlite-source-trace-locator.js +140 -0
- package/dist/runtime-v2/store/trajectory/sqlite-source-trace-locator.js.map +1 -0
- package/dist/runtime-v2/store/trajectory/sqlite-trajectory-locator.d.ts +27 -0
- package/dist/runtime-v2/store/trajectory/sqlite-trajectory-locator.d.ts.map +1 -0
- package/dist/runtime-v2/store/trajectory/sqlite-trajectory-locator.js +183 -0
- package/dist/runtime-v2/store/trajectory/sqlite-trajectory-locator.js.map +1 -0
- package/dist/runtime-v2/store/trajectory/sqlite-trajectory-locator.test.d.ts +2 -0
- package/dist/runtime-v2/store/trajectory/sqlite-trajectory-locator.test.d.ts.map +1 -0
- package/dist/runtime-v2/store/trajectory/sqlite-trajectory-locator.test.js +328 -0
- package/dist/runtime-v2/store/trajectory/sqlite-trajectory-locator.test.js.map +1 -0
- package/dist/runtime-v2/store/trajectory/trajectory-locator.d.ts +30 -0
- package/dist/runtime-v2/store/trajectory/trajectory-locator.d.ts.map +1 -0
- package/dist/runtime-v2/store/trajectory/trajectory-locator.js +2 -0
- package/dist/runtime-v2/store/trajectory/trajectory-locator.js.map +1 -0
- package/dist/runtime-v2/store/workspace-isolation.test.d.ts +2 -0
- package/dist/runtime-v2/store/workspace-isolation.test.d.ts.map +1 -0
- package/dist/runtime-v2/store/workspace-isolation.test.js +139 -0
- package/dist/runtime-v2/store/workspace-isolation.test.js.map +1 -0
- package/dist/runtime-v2/story-a-demo.d.ts +67 -0
- package/dist/runtime-v2/story-a-demo.d.ts.map +1 -0
- package/dist/runtime-v2/story-a-demo.js +188 -0
- package/dist/runtime-v2/story-a-demo.js.map +1 -0
- package/dist/runtime-v2/synthetic-baseline.d.ts +28 -0
- package/dist/runtime-v2/synthetic-baseline.d.ts.map +1 -0
- package/dist/runtime-v2/synthetic-baseline.js +116 -0
- package/dist/runtime-v2/synthetic-baseline.js.map +1 -0
- package/dist/runtime-v2/task-status.d.ts +99 -0
- package/dist/runtime-v2/task-status.d.ts.map +1 -0
- package/dist/runtime-v2/task-status.js +88 -0
- package/dist/runtime-v2/task-status.js.map +1 -0
- package/dist/runtime-v2/trace-refiner-agent.d.ts +71 -0
- package/dist/runtime-v2/trace-refiner-agent.d.ts.map +1 -0
- package/dist/runtime-v2/trace-refiner-agent.js +239 -0
- package/dist/runtime-v2/trace-refiner-agent.js.map +1 -0
- package/dist/runtime-v2/trace-refiner.d.ts +47 -0
- package/dist/runtime-v2/trace-refiner.d.ts.map +1 -0
- package/dist/runtime-v2/trace-refiner.js +261 -0
- package/dist/runtime-v2/trace-refiner.js.map +1 -0
- package/dist/runtime-v2/types/artifact-lineage.d.ts +19 -0
- package/dist/runtime-v2/types/artifact-lineage.d.ts.map +1 -0
- package/dist/runtime-v2/types/artifact-lineage.js +6 -0
- package/dist/runtime-v2/types/artifact-lineage.js.map +1 -0
- package/dist/runtime-v2/types/event-payload.d.ts +232 -0
- package/dist/runtime-v2/types/event-payload.d.ts.map +1 -0
- package/dist/runtime-v2/types/event-payload.js +149 -0
- package/dist/runtime-v2/types/event-payload.js.map +1 -0
- package/dist/runtime-v2/types/event-types.d.ts +843 -0
- package/dist/runtime-v2/types/event-types.d.ts.map +1 -0
- package/dist/runtime-v2/types/event-types.js +486 -0
- package/dist/runtime-v2/types/event-types.js.map +1 -0
- package/dist/runtime-v2/types/hygiene-types.d.ts +40 -0
- package/dist/runtime-v2/types/hygiene-types.d.ts.map +1 -0
- package/dist/runtime-v2/types/hygiene-types.js +30 -0
- package/dist/runtime-v2/types/hygiene-types.js.map +1 -0
- package/dist/runtime-v2/types/index.d.ts +32 -0
- package/dist/runtime-v2/types/index.d.ts.map +1 -0
- package/dist/runtime-v2/types/index.js +17 -0
- package/dist/runtime-v2/types/index.js.map +1 -0
- package/dist/runtime-v2/types/pain-signal.d.ts +63 -0
- package/dist/runtime-v2/types/pain-signal.d.ts.map +1 -0
- package/dist/runtime-v2/types/pain-signal.js +118 -0
- package/dist/runtime-v2/types/pain-signal.js.map +1 -0
- package/dist/runtime-v2/types/pd-task-types.d.ts +139 -0
- package/dist/runtime-v2/types/pd-task-types.d.ts.map +1 -0
- package/dist/runtime-v2/types/pd-task-types.js +99 -0
- package/dist/runtime-v2/types/pd-task-types.js.map +1 -0
- package/dist/runtime-v2/types/principle-dependency.d.ts +15 -0
- package/dist/runtime-v2/types/principle-dependency.d.ts.map +1 -0
- package/dist/runtime-v2/types/principle-dependency.js +8 -0
- package/dist/runtime-v2/types/principle-dependency.js.map +1 -0
- package/dist/runtime-v2/types/principle-enums.d.ts +19 -0
- package/dist/runtime-v2/types/principle-enums.d.ts.map +1 -0
- package/dist/runtime-v2/types/principle-enums.js +59 -0
- package/dist/runtime-v2/types/principle-enums.js.map +1 -0
- package/dist/runtime-v2/types/principle-lifecycle-event.d.ts +28 -0
- package/dist/runtime-v2/types/principle-lifecycle-event.d.ts.map +1 -0
- package/dist/runtime-v2/types/principle-lifecycle-event.js +24 -0
- package/dist/runtime-v2/types/principle-lifecycle-event.js.map +1 -0
- package/dist/runtime-v2/types/principle-schema.d.ts +136 -0
- package/dist/runtime-v2/types/principle-schema.d.ts.map +1 -0
- package/dist/runtime-v2/types/principle-schema.js +71 -0
- package/dist/runtime-v2/types/principle-schema.js.map +1 -0
- package/dist/runtime-v2/types/principle-tree-store.d.ts +89 -0
- package/dist/runtime-v2/types/principle-tree-store.d.ts.map +1 -0
- package/dist/runtime-v2/types/principle-tree-store.js +11 -0
- package/dist/runtime-v2/types/principle-tree-store.js.map +1 -0
- package/dist/runtime-v2/types/principle-value-metrics.d.ts +27 -0
- package/dist/runtime-v2/types/principle-value-metrics.d.ts.map +1 -0
- package/dist/runtime-v2/types/principle-value-metrics.js +14 -0
- package/dist/runtime-v2/types/principle-value-metrics.js.map +1 -0
- package/dist/runtime-v2/types/queue-types.d.ts +51 -0
- package/dist/runtime-v2/types/queue-types.d.ts.map +1 -0
- package/dist/runtime-v2/types/queue-types.js +44 -0
- package/dist/runtime-v2/types/queue-types.js.map +1 -0
- package/dist/runtime-v2/types/replay-types.d.ts +40 -0
- package/dist/runtime-v2/types/replay-types.d.ts.map +1 -0
- package/dist/runtime-v2/types/replay-types.js +2 -0
- package/dist/runtime-v2/types/replay-types.js.map +1 -0
- package/dist/runtime-v2/types/runtime-summary-types.d.ts +93 -0
- package/dist/runtime-v2/types/runtime-summary-types.d.ts.map +1 -0
- package/dist/runtime-v2/types/runtime-summary-types.js +35 -0
- package/dist/runtime-v2/types/runtime-summary-types.js.map +1 -0
- package/dist/runtime-v2/utils/cli-process-runner.d.ts +35 -0
- package/dist/runtime-v2/utils/cli-process-runner.d.ts.map +1 -0
- package/dist/runtime-v2/utils/cli-process-runner.js +259 -0
- package/dist/runtime-v2/utils/cli-process-runner.js.map +1 -0
- package/dist/runtime-v2/utils/cli-process-runner.test.d.ts +2 -0
- package/dist/runtime-v2/utils/cli-process-runner.test.d.ts.map +1 -0
- package/dist/runtime-v2/utils/cli-process-runner.test.js +111 -0
- package/dist/runtime-v2/utils/cli-process-runner.test.js.map +1 -0
- package/dist/storage-adapter.d.ts +59 -0
- package/dist/storage-adapter.d.ts.map +1 -0
- package/dist/storage-adapter.js +2 -0
- package/dist/storage-adapter.js.map +1 -0
- package/dist/telemetry-event.d.ts +102 -0
- package/dist/telemetry-event.d.ts.map +1 -0
- package/dist/telemetry-event.js +186 -0
- package/dist/telemetry-event.js.map +1 -0
- package/dist/trajectory-store.d.ts +45 -0
- package/dist/trajectory-store.d.ts.map +1 -0
- package/dist/trajectory-store.js +139 -0
- package/dist/trajectory-store.js.map +1 -0
- package/dist/types/workspace-resolver.d.ts +25 -0
- package/dist/types/workspace-resolver.d.ts.map +1 -0
- package/dist/types/workspace-resolver.js +10 -0
- package/dist/types/workspace-resolver.js.map +1 -0
- package/dist/types.d.ts +56 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +16 -0
- package/dist/types.js.map +1 -0
- package/dist/workflow-funnel-loader.d.ts +143 -0
- package/dist/workflow-funnel-loader.d.ts.map +1 -0
- package/dist/workflow-funnel-loader.js +174 -0
- package/dist/workflow-funnel-loader.js.map +1 -0
- package/package.json +100 -0
|
@@ -0,0 +1,1109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PiAiRuntimeAdapter — PDRuntimeAdapter implementation for direct LLM completion.
|
|
3
|
+
*
|
|
4
|
+
* Uses @mariozechner/pi-ai to call LLM providers directly, bypassing the OpenClaw CLI.
|
|
5
|
+
* Solves the m8-03 UAT blocker where the main agent takes >300s.
|
|
6
|
+
*
|
|
7
|
+
* One-shot run: startRun() calls pi-ai complete(), blocks until LLM responds,
|
|
8
|
+
* stores output in memory. pollRun()/fetchOutput() operate on stored state.
|
|
9
|
+
*
|
|
10
|
+
* Error mapping:
|
|
11
|
+
* AbortError (signal.timeout) → timeout
|
|
12
|
+
* JSON extraction failure → output_invalid
|
|
13
|
+
* DiagnosticianOutputV1Schema validation failure → output_invalid
|
|
14
|
+
* Missing apiKeyEnv → runtime_unavailable
|
|
15
|
+
* Retries exhausted → execution_failed
|
|
16
|
+
*/
|
|
17
|
+
import { getModel, getProviders, completeSimple } from '@mariozechner/pi-ai';
|
|
18
|
+
import { Value } from '@sinclair/typebox/value';
|
|
19
|
+
import { PDRuntimeError } from '../error-categories.js';
|
|
20
|
+
import { extractJsonObject } from './json-extractor.js';
|
|
21
|
+
import { DiagnosticianOutputV1Schema } from '../diagnostician-output.js';
|
|
22
|
+
import { DreamerOutputV1Schema } from '../internalization/dreamer-output.js';
|
|
23
|
+
import { PhilosopherOutputV1Schema } from '../internalization/philosopher-output.js';
|
|
24
|
+
import { ScribeOutputV1Schema } from '../internalization/scribe-output.js';
|
|
25
|
+
import { ArtificerOutputV1Schema } from '../internalization/artificer-output.js';
|
|
26
|
+
import { EvaluatorOutputV1Schema } from '../internalization/evaluator-output.js';
|
|
27
|
+
import { RolloutReviewerOutputV1Schema } from '../internalization/rollout-reviewer-output.js';
|
|
28
|
+
import { TrainerOutputV1Schema } from '../internalization/trainer-output.js';
|
|
29
|
+
import { EmpathyObserverOutputV1Schema } from '../observer/empathy-observer.js';
|
|
30
|
+
import { CorrectionObserverOutputV1Schema } from '../observer/correction-observer.js';
|
|
31
|
+
import { storeEmitter } from '../store/event-emitter.js';
|
|
32
|
+
import { attemptStructuredOutputRepair, deriveSchemaSummary } from './structured-output-repair.js';
|
|
33
|
+
import { formatValidationErrorEntry, safeStringifyPreview, stripLineageFields } from './output-repair-contract.js';
|
|
34
|
+
import { RECORD_DIAGNOSIS_V1_TOOL } from './tools/diagnostician-tool.js';
|
|
35
|
+
/**
|
|
36
|
+
* Resolve a pi-ai Model from dynamic config values.
|
|
37
|
+
*
|
|
38
|
+
* For built-in providers (openrouter, anthropic, etc.), uses getModel().
|
|
39
|
+
* For custom providers (e.g., xiaomi-coding with custom baseUrl), creates
|
|
40
|
+
* a Model<Api> object directly. This enables pi-ai to call OpenAI-compatible
|
|
41
|
+
* endpoints that aren't in pi-ai's built-in provider registry.
|
|
42
|
+
*/
|
|
43
|
+
function resolveModel(provider, modelId, baseUrl) {
|
|
44
|
+
const knownProviders = getProviders();
|
|
45
|
+
if (knownProviders.includes(provider) && !baseUrl) {
|
|
46
|
+
// Built-in provider — use getModel()
|
|
47
|
+
// @ts-expect-error — getModel requires literal model ID types; runtime strings from config are acceptable
|
|
48
|
+
return getModel(provider, modelId);
|
|
49
|
+
}
|
|
50
|
+
// Custom provider — baseUrl is required
|
|
51
|
+
if (!baseUrl) {
|
|
52
|
+
throw new PDRuntimeError('runtime_unavailable', `Provider '${provider}' is not a built-in pi-ai provider and requires a custom baseUrl. ` +
|
|
53
|
+
`Pass --baseUrl <url> or add 'baseUrl' to your workflows.yaml policy.`);
|
|
54
|
+
}
|
|
55
|
+
// Custom provider with baseUrl — construct Model object directly
|
|
56
|
+
// Default to openai-completions API for custom OpenAI-compatible endpoints
|
|
57
|
+
const model = {
|
|
58
|
+
id: modelId,
|
|
59
|
+
name: modelId,
|
|
60
|
+
api: 'openai-completions',
|
|
61
|
+
provider,
|
|
62
|
+
baseUrl,
|
|
63
|
+
reasoning: false,
|
|
64
|
+
input: ['text'],
|
|
65
|
+
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
|
|
66
|
+
contextWindow: 128000,
|
|
67
|
+
maxTokens: 32000,
|
|
68
|
+
compat: {
|
|
69
|
+
supportsStore: false,
|
|
70
|
+
supportsDeveloperRole: false,
|
|
71
|
+
supportsReasoningEffort: false,
|
|
72
|
+
supportsUsageInStreaming: true,
|
|
73
|
+
maxTokensField: 'max_tokens',
|
|
74
|
+
requiresToolResultName: false,
|
|
75
|
+
requiresAssistantAfterToolResult: false,
|
|
76
|
+
requiresThinkingAsText: false,
|
|
77
|
+
requiresReasoningContentOnAssistantMessages: false,
|
|
78
|
+
thinkingFormat: 'deepseek',
|
|
79
|
+
supportsStrictMode: false,
|
|
80
|
+
},
|
|
81
|
+
};
|
|
82
|
+
return model;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Detection for abort/timeout errors from provider SDKs.
|
|
86
|
+
*
|
|
87
|
+
* Checks:
|
|
88
|
+
* 1. AbortSignal already aborted
|
|
89
|
+
* 2. DOMException AbortError (native fetch/Node abort)
|
|
90
|
+
* 3. Error objects with name === 'AbortError' (some SDKs)
|
|
91
|
+
* 4. Non-PDRuntimeError Error with "timeout" or "abort" in message
|
|
92
|
+
* (provider SDKs that throw plain Error on timeout)
|
|
93
|
+
*
|
|
94
|
+
* Excludes PDRuntimeError to avoid false positives from our own wrapped
|
|
95
|
+
* error messages that may contain "timed out".
|
|
96
|
+
*/
|
|
97
|
+
function isObjectWithKey(obj, key) {
|
|
98
|
+
return typeof obj === 'object' && obj !== null && Object.hasOwn(obj, key);
|
|
99
|
+
}
|
|
100
|
+
function isAbortError(err, signal) {
|
|
101
|
+
if (signal?.aborted)
|
|
102
|
+
return true;
|
|
103
|
+
if (err instanceof DOMException && err.name === 'AbortError')
|
|
104
|
+
return true;
|
|
105
|
+
if (isObjectWithKey(err, 'name')) {
|
|
106
|
+
const rawName = err.name;
|
|
107
|
+
if (typeof rawName === 'string' && rawName === 'AbortError') {
|
|
108
|
+
return true;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
if (err instanceof Error && !(err instanceof PDRuntimeError) && (/abort/i.test(err.message) || /timeout/i.test(err.message)))
|
|
112
|
+
return true;
|
|
113
|
+
return false;
|
|
114
|
+
}
|
|
115
|
+
function classifyFailure(err, signal) {
|
|
116
|
+
if (signal?.aborted) {
|
|
117
|
+
return {
|
|
118
|
+
category: 'timeout',
|
|
119
|
+
classification: 'client_timeout_budget_exhausted',
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
let errorMsg = '';
|
|
123
|
+
let name = '';
|
|
124
|
+
if (err instanceof Error) {
|
|
125
|
+
const { message, name: errName } = err;
|
|
126
|
+
errorMsg = message;
|
|
127
|
+
name = errName;
|
|
128
|
+
}
|
|
129
|
+
else if (typeof err === 'object' && err !== null) {
|
|
130
|
+
if (isObjectWithKey(err, 'message')) {
|
|
131
|
+
const rawMessage = err.message;
|
|
132
|
+
if (typeof rawMessage === 'string') {
|
|
133
|
+
errorMsg = rawMessage;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
if (isObjectWithKey(err, 'name')) {
|
|
137
|
+
const rawName = err.name;
|
|
138
|
+
if (typeof rawName === 'string') {
|
|
139
|
+
name = rawName;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
errorMsg = String(err);
|
|
145
|
+
}
|
|
146
|
+
const isAbort = name === 'AbortError' || (err instanceof DOMException && err.name === 'AbortError');
|
|
147
|
+
const hasTimeoutKeywords = /timeout|timed\s*out/i.test(errorMsg) || /abort/i.test(errorMsg);
|
|
148
|
+
if (isAbort || hasTimeoutKeywords) {
|
|
149
|
+
return {
|
|
150
|
+
category: 'timeout',
|
|
151
|
+
classification: 'provider_transient_timeout',
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
return {
|
|
155
|
+
category: 'execution_failed',
|
|
156
|
+
classification: 'not_applicable',
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Extract text content from an AssistantMessage, or throw PDRuntimeError.
|
|
161
|
+
*
|
|
162
|
+
* pi-ai complete() may RESOLVE (not reject) with stopReason:'error' when
|
|
163
|
+
* the provider returns an error response (e.g., 401, rate limit).
|
|
164
|
+
* This helper normalizes those resolved-error responses into PDRuntimeError
|
|
165
|
+
* so downstream code never sees a "successful" response that is actually broken.
|
|
166
|
+
*
|
|
167
|
+
* Error classification:
|
|
168
|
+
* stopReason:'aborted' → timeout
|
|
169
|
+
* stopReason:'error' + timeout/abort in errorMessage → timeout
|
|
170
|
+
* stopReason:'error' + other → execution_failed
|
|
171
|
+
* no text content block → output_invalid
|
|
172
|
+
*/
|
|
173
|
+
function extractAssistantTextOrThrow(response, signal) {
|
|
174
|
+
// Handle resolved-error responses from pi-ai
|
|
175
|
+
if (response.stopReason === 'error' || response.stopReason === 'aborted') {
|
|
176
|
+
const rawMessage = response.errorMessage ?? 'unknown provider error';
|
|
177
|
+
// Truncate to 300 chars to avoid leaking huge payloads into logs/telemetry
|
|
178
|
+
const boundedMessage = rawMessage.length > 300 ? rawMessage.substring(0, 300) + '...' : rawMessage;
|
|
179
|
+
const isTimeout = response.stopReason === 'aborted'
|
|
180
|
+
|| signal?.aborted
|
|
181
|
+
|| /timeout|timed\s*out/i.test(rawMessage)
|
|
182
|
+
|| /abort/i.test(rawMessage);
|
|
183
|
+
throw new PDRuntimeError(isTimeout ? 'timeout' : 'execution_failed', isTimeout
|
|
184
|
+
? `LLM request timed out: ${boundedMessage}`
|
|
185
|
+
: `LLM execution failed: ${boundedMessage}`);
|
|
186
|
+
}
|
|
187
|
+
// Find text content (may be mixed with thinking content from reasoning-enabled models)
|
|
188
|
+
const textContent = response.content.find(c => c.type === 'text' && c.text && c.text.trim().length > 0);
|
|
189
|
+
if (!textContent || textContent.type !== 'text' || !textContent.text) {
|
|
190
|
+
throw new PDRuntimeError('output_invalid', `No text content in LLM response. Content types: ${response.content.map(c => c.type).join(', ')}`);
|
|
191
|
+
}
|
|
192
|
+
return textContent.text;
|
|
193
|
+
}
|
|
194
|
+
const OUTPUT_SCHEMA_REGISTRY = new Map([
|
|
195
|
+
['diagnostician-output-v1', DiagnosticianOutputV1Schema],
|
|
196
|
+
['dreamer-output-v1', DreamerOutputV1Schema],
|
|
197
|
+
['philosopher-output-v1', PhilosopherOutputV1Schema],
|
|
198
|
+
['scribe-output-v1', ScribeOutputV1Schema],
|
|
199
|
+
['artificer-output-v1', ArtificerOutputV1Schema],
|
|
200
|
+
['evaluator-output-v1', EvaluatorOutputV1Schema],
|
|
201
|
+
['rollout-reviewer-output-v1', RolloutReviewerOutputV1Schema],
|
|
202
|
+
['trainer-output-v1', TrainerOutputV1Schema],
|
|
203
|
+
['empathy-observer-output-v1', EmpathyObserverOutputV1Schema],
|
|
204
|
+
['correction-observer-output-v1', CorrectionObserverOutputV1Schema],
|
|
205
|
+
]);
|
|
206
|
+
export class PiAiRuntimeAdapter {
|
|
207
|
+
config;
|
|
208
|
+
runs = new Map();
|
|
209
|
+
eventEmitter;
|
|
210
|
+
runtimeKind = 'pi-ai';
|
|
211
|
+
defaultCapabilities = {
|
|
212
|
+
supportsStructuredJsonOutput: true,
|
|
213
|
+
supportsToolUse: false,
|
|
214
|
+
supportsWorkingDirectory: false,
|
|
215
|
+
supportsModelSelection: true,
|
|
216
|
+
supportsLongRunningSessions: false,
|
|
217
|
+
supportsCancellation: true,
|
|
218
|
+
supportsArtifactWriteBack: false,
|
|
219
|
+
supportsConcurrentRuns: false,
|
|
220
|
+
supportsStreaming: false,
|
|
221
|
+
};
|
|
222
|
+
constructor(config) {
|
|
223
|
+
this.config = config;
|
|
224
|
+
this.eventEmitter = config.eventEmitter ?? storeEmitter;
|
|
225
|
+
}
|
|
226
|
+
kind() {
|
|
227
|
+
return this.runtimeKind;
|
|
228
|
+
}
|
|
229
|
+
async getCapabilities() {
|
|
230
|
+
return this.defaultCapabilities;
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Three-stage health probe (per M6 lesson: binary/list-only checks are fake probes).
|
|
234
|
+
*
|
|
235
|
+
* 1. apiKey exists in environment
|
|
236
|
+
* 2. getModel validates without throwing
|
|
237
|
+
* 3. Minimal complete probe with {"ok":true} verification
|
|
238
|
+
*/
|
|
239
|
+
async healthCheck() {
|
|
240
|
+
const lastCheckedAt = new Date().toISOString();
|
|
241
|
+
// Stage 1: apiKey exists
|
|
242
|
+
const apiKey = process.env[this.config.apiKeyEnv];
|
|
243
|
+
if (!apiKey) {
|
|
244
|
+
return {
|
|
245
|
+
healthy: false,
|
|
246
|
+
degraded: false,
|
|
247
|
+
warnings: [`API key not found in env: ${this.config.apiKeyEnv}`],
|
|
248
|
+
lastCheckedAt,
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
// Stage 2+3: getModel valid + minimal complete probe
|
|
252
|
+
try {
|
|
253
|
+
const model = resolveModel(this.config.provider, this.config.model, this.config.baseUrl);
|
|
254
|
+
const timeoutMs = this.config.timeoutMs ?? 120_000;
|
|
255
|
+
const signal = AbortSignal.timeout(timeoutMs);
|
|
256
|
+
const probeContext = {
|
|
257
|
+
messages: [{
|
|
258
|
+
role: 'user',
|
|
259
|
+
content: 'Reply with {"ok":true} only.',
|
|
260
|
+
timestamp: Date.now(),
|
|
261
|
+
}],
|
|
262
|
+
};
|
|
263
|
+
const response = await completeSimple(model, probeContext, {
|
|
264
|
+
signal,
|
|
265
|
+
apiKey,
|
|
266
|
+
timeoutMs,
|
|
267
|
+
maxRetries: 0,
|
|
268
|
+
});
|
|
269
|
+
// extractAssistantTextOrThrow normalizes resolved-error responses
|
|
270
|
+
const text = extractAssistantTextOrThrow(response, signal);
|
|
271
|
+
const parsed = extractJsonObject(text);
|
|
272
|
+
if (typeof parsed !== 'object' ||
|
|
273
|
+
parsed === null ||
|
|
274
|
+
!('ok' in parsed) ||
|
|
275
|
+
parsed.ok !== true) {
|
|
276
|
+
return {
|
|
277
|
+
healthy: false,
|
|
278
|
+
degraded: true,
|
|
279
|
+
warnings: [`probe returned unexpected result: ${text.substring(0, 200)}`],
|
|
280
|
+
lastCheckedAt,
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
catch (err) {
|
|
285
|
+
// PDRuntimeError from extractAssistantTextOrThrow (timeout/execution_failed)
|
|
286
|
+
// or thrown errors from complete() (AbortError, network, etc.)
|
|
287
|
+
if (err instanceof PDRuntimeError && err.category === 'timeout') {
|
|
288
|
+
return {
|
|
289
|
+
healthy: false,
|
|
290
|
+
degraded: true,
|
|
291
|
+
warnings: [`probe timed out: ${err.message}`],
|
|
292
|
+
lastCheckedAt,
|
|
293
|
+
};
|
|
294
|
+
}
|
|
295
|
+
if (err instanceof PDRuntimeError) {
|
|
296
|
+
return {
|
|
297
|
+
healthy: false,
|
|
298
|
+
degraded: err.category === 'output_invalid',
|
|
299
|
+
warnings: [`probe failed: ${err.message}`],
|
|
300
|
+
lastCheckedAt,
|
|
301
|
+
};
|
|
302
|
+
}
|
|
303
|
+
if (isAbortError(err)) {
|
|
304
|
+
return {
|
|
305
|
+
healthy: false,
|
|
306
|
+
degraded: true,
|
|
307
|
+
warnings: ['probe timed out'],
|
|
308
|
+
lastCheckedAt,
|
|
309
|
+
};
|
|
310
|
+
}
|
|
311
|
+
return {
|
|
312
|
+
healthy: false,
|
|
313
|
+
degraded: false,
|
|
314
|
+
warnings: [`probe failed: ${err instanceof Error ? err.message : String(err)}`],
|
|
315
|
+
lastCheckedAt,
|
|
316
|
+
};
|
|
317
|
+
}
|
|
318
|
+
return { healthy: true, degraded: false, warnings: [], lastCheckedAt };
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* One-shot run: call LLM via pi-ai complete(), parse and validate output.
|
|
322
|
+
* Blocks until LLM responds (or times out). Run is terminal on return.
|
|
323
|
+
*
|
|
324
|
+
* Timeout priority: input.timeoutMs (from runner) > this.config.timeoutMs (from workflows.yaml) > 300_000 (default)
|
|
325
|
+
* The resolved effectiveTimeoutMs is passed through to completeWithRetry and pi-ai complete()
|
|
326
|
+
* so that the provider request timeout always matches the runner's intent.
|
|
327
|
+
*/
|
|
328
|
+
async startRun(input) {
|
|
329
|
+
const runId = crypto.randomUUID();
|
|
330
|
+
const startedAt = new Date().toISOString();
|
|
331
|
+
// Read API key
|
|
332
|
+
const apiKey = process.env[this.config.apiKeyEnv];
|
|
333
|
+
if (!apiKey) {
|
|
334
|
+
throw new PDRuntimeError('runtime_unavailable', `API key not found in env: ${this.config.apiKeyEnv}`);
|
|
335
|
+
}
|
|
336
|
+
// Create run state immediately — failed runs are always trackable
|
|
337
|
+
const runState = {
|
|
338
|
+
runId,
|
|
339
|
+
startedAt,
|
|
340
|
+
endedAt: startedAt, // will be updated on completion
|
|
341
|
+
status: 'failed', // default until succeeded
|
|
342
|
+
};
|
|
343
|
+
this.runs.set(runId, runState);
|
|
344
|
+
// AbortSignal.timeout for clean timeout control
|
|
345
|
+
// Priority: input.timeoutMs (runner) > config.timeoutMs (workflows.yaml) > 300_000 (default)
|
|
346
|
+
const effectiveTimeoutMs = input.timeoutMs ?? this.config.timeoutMs ?? 300_000;
|
|
347
|
+
const timeoutSource = input.timeoutMs !== undefined ? 'runner_input'
|
|
348
|
+
: this.config.timeoutMs !== undefined ? 'adapter_config'
|
|
349
|
+
: 'default';
|
|
350
|
+
const signal = AbortSignal.timeout(effectiveTimeoutMs);
|
|
351
|
+
// Build pi-ai Context from inputPayload
|
|
352
|
+
const messageContent = typeof input.inputPayload === 'string'
|
|
353
|
+
? input.inputPayload
|
|
354
|
+
: JSON.stringify(input.inputPayload);
|
|
355
|
+
const userMessage = {
|
|
356
|
+
role: 'user',
|
|
357
|
+
content: messageContent,
|
|
358
|
+
timestamp: Date.now(),
|
|
359
|
+
};
|
|
360
|
+
const context = { messages: [userMessage] };
|
|
361
|
+
// Get model
|
|
362
|
+
const model = resolveModel(this.config.provider, this.config.model, this.config.baseUrl);
|
|
363
|
+
// Emit runtime_invocation_started telemetry
|
|
364
|
+
this.eventEmitter.emitTelemetry({
|
|
365
|
+
eventType: 'runtime_invocation_started',
|
|
366
|
+
traceId: input.taskRef?.taskId ?? runId,
|
|
367
|
+
timestamp: startedAt,
|
|
368
|
+
sessionId: 'pi-ai-adapter',
|
|
369
|
+
agentId: 'pi-ai-adapter',
|
|
370
|
+
payload: {
|
|
371
|
+
runId,
|
|
372
|
+
runtimeKind: 'pi-ai',
|
|
373
|
+
runnerKind: input.agentSpec.agentId,
|
|
374
|
+
provider: this.config.provider,
|
|
375
|
+
model: this.config.model,
|
|
376
|
+
timeoutMs: effectiveTimeoutMs,
|
|
377
|
+
timeoutSource,
|
|
378
|
+
outputSchemaRef: input.outputSchemaRef ?? 'unknown',
|
|
379
|
+
},
|
|
380
|
+
});
|
|
381
|
+
try {
|
|
382
|
+
// PRI-271 B3: Three-path fallback chain for structured output
|
|
383
|
+
const schemaRef = input.outputSchemaRef;
|
|
384
|
+
const schema = schemaRef ? OUTPUT_SCHEMA_REGISTRY.get(schemaRef) : undefined;
|
|
385
|
+
const strategy = this.config.outputPathStrategy ?? 'tool_call_first';
|
|
386
|
+
let validatedOutput = undefined;
|
|
387
|
+
const schemaSummary = (schema && schemaRef) ? deriveSchemaSummary(schema) : undefined;
|
|
388
|
+
// ── Path 1: Tool calling (PRI-271 B2) ──
|
|
389
|
+
if (strategy === 'tool_call_first' && schema && schemaRef) {
|
|
390
|
+
const toolResult = await this.tryToolCallPath({ model, baseContext: context, schemaRef, schema, signal, apiKey, effectiveTimeoutMs, input, runId });
|
|
391
|
+
if (toolResult.success && toolResult.output !== undefined) {
|
|
392
|
+
validatedOutput = toolResult.output;
|
|
393
|
+
this.emitOutputPathTelemetry({ runId, input, path: 'tool_call', fallbackReason: null });
|
|
394
|
+
}
|
|
395
|
+
else {
|
|
396
|
+
this.emitOutputPathTelemetry({ runId, input, path: null, fallbackReason: toolResult.fallbackReason ?? 'provider_no_tool_use' });
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
// ── Path 2: JSON mode (PRI-271 B1) ──
|
|
400
|
+
if (!validatedOutput && (strategy === 'tool_call_first' || strategy === 'json_mode_first') && schema && schemaRef) {
|
|
401
|
+
const jsonResult = await this.tryJsonModePath({ model, baseContext: context, schemaRef, schema, signal, apiKey, effectiveTimeoutMs, input, runId });
|
|
402
|
+
if (jsonResult.success && jsonResult.output !== undefined) {
|
|
403
|
+
validatedOutput = jsonResult.output;
|
|
404
|
+
this.emitOutputPathTelemetry({ runId, input, path: 'json_object_mode', fallbackReason: null });
|
|
405
|
+
}
|
|
406
|
+
else {
|
|
407
|
+
this.emitOutputPathTelemetry({ runId, input, path: null, fallbackReason: jsonResult.fallbackReason ?? 'json_parse_failed' });
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
// ── Path 3: Free-form + repair (current behavior, enhanced) ──
|
|
411
|
+
if (!validatedOutput) {
|
|
412
|
+
const response = await this.completeWithRetry(model, context, { signal, apiKey, effectiveTimeoutMs, timeoutSource, input, runId });
|
|
413
|
+
const text = extractAssistantTextOrThrow(response, signal);
|
|
414
|
+
let parsedOutput = extractJsonObject(text);
|
|
415
|
+
if (!parsedOutput) {
|
|
416
|
+
this.eventEmitter.emitTelemetry({
|
|
417
|
+
eventType: 'output_extraction_failed',
|
|
418
|
+
traceId: input.taskRef?.taskId ?? runId,
|
|
419
|
+
timestamp: new Date().toISOString(),
|
|
420
|
+
sessionId: 'pi-ai-adapter',
|
|
421
|
+
agentId: 'pi-ai-adapter',
|
|
422
|
+
payload: {
|
|
423
|
+
runId,
|
|
424
|
+
runtimeKind: 'pi-ai',
|
|
425
|
+
provider: this.config.provider,
|
|
426
|
+
model: this.config.model,
|
|
427
|
+
outputSchemaRef: input.outputSchemaRef ?? 'unknown',
|
|
428
|
+
rawOutputPreview: text.slice(0, 500),
|
|
429
|
+
},
|
|
430
|
+
});
|
|
431
|
+
throw new PDRuntimeError('output_invalid', 'No valid JSON found in LLM response');
|
|
432
|
+
}
|
|
433
|
+
if (schema && !Value.Check(schema, parsedOutput)) {
|
|
434
|
+
// Schema validation failed — attempt repair with enhanced config (PRI-271 A1/A2/A3)
|
|
435
|
+
const schemaErrors = [...Value.Errors(schema, parsedOutput)]
|
|
436
|
+
.map(e => ({ path: e.path, message: e.message, value: e.value }));
|
|
437
|
+
const validationErrorEntries = schemaErrors
|
|
438
|
+
.slice(0, 10)
|
|
439
|
+
.map(e => formatValidationErrorEntry(e.path, e.message, e.value));
|
|
440
|
+
const rawOutputPreview = safeStringifyPreview(parsedOutput);
|
|
441
|
+
this.eventEmitter.emitTelemetry({
|
|
442
|
+
eventType: 'output_schema_invalid',
|
|
443
|
+
traceId: input.taskRef?.taskId ?? runId,
|
|
444
|
+
timestamp: new Date().toISOString(),
|
|
445
|
+
sessionId: 'pi-ai-adapter',
|
|
446
|
+
agentId: 'pi-ai-adapter',
|
|
447
|
+
payload: {
|
|
448
|
+
runId,
|
|
449
|
+
runtimeKind: 'pi-ai',
|
|
450
|
+
outputSchemaRef: schemaRef ?? 'unknown',
|
|
451
|
+
provider: this.config.provider,
|
|
452
|
+
model: this.config.model,
|
|
453
|
+
rawOutputPreview,
|
|
454
|
+
validationErrors: validationErrorEntries,
|
|
455
|
+
},
|
|
456
|
+
});
|
|
457
|
+
const originalOutput = typeof parsedOutput === 'object' && parsedOutput !== null
|
|
458
|
+
? parsedOutput
|
|
459
|
+
: undefined;
|
|
460
|
+
const repairResult = await attemptStructuredOutputRepair(parsedOutput, schemaErrors, {
|
|
461
|
+
llmCaller: (prompt) => this.repairLLMCall(model, prompt, { signal, apiKey }),
|
|
462
|
+
schemaCheck: (value) => Value.Check(schema, value),
|
|
463
|
+
schemaErrors: (value) => [...Value.Errors(schema, value)].map(e => ({ path: e.path, message: e.message, value: e.value })),
|
|
464
|
+
}, {
|
|
465
|
+
schemaRef: schemaRef ?? 'unknown',
|
|
466
|
+
originalOutput,
|
|
467
|
+
schemaSummary,
|
|
468
|
+
maxRepairAttempts: this.config.maxRepairAttempts,
|
|
469
|
+
});
|
|
470
|
+
this.eventEmitter.emitTelemetry({
|
|
471
|
+
eventType: 'output_repair_attempted',
|
|
472
|
+
traceId: input.taskRef?.taskId ?? runId,
|
|
473
|
+
timestamp: new Date().toISOString(),
|
|
474
|
+
sessionId: 'pi-ai-adapter',
|
|
475
|
+
agentId: 'pi-ai-adapter',
|
|
476
|
+
payload: {
|
|
477
|
+
runId,
|
|
478
|
+
runtimeKind: 'pi-ai',
|
|
479
|
+
outputSchemaRef: schemaRef ?? 'unknown',
|
|
480
|
+
repaired: repairResult.repaired,
|
|
481
|
+
attemptsUsed: repairResult.attemptsUsed,
|
|
482
|
+
repairSummary: repairResult.repairSummary,
|
|
483
|
+
repairAttempts: repairResult.repairAttempts,
|
|
484
|
+
outputPath: 'free_form_with_repair',
|
|
485
|
+
},
|
|
486
|
+
});
|
|
487
|
+
if (repairResult.repaired && repairResult.output) {
|
|
488
|
+
parsedOutput = repairResult.output;
|
|
489
|
+
}
|
|
490
|
+
else {
|
|
491
|
+
const evidencePack = {
|
|
492
|
+
schemaRef: schemaRef ?? 'unknown',
|
|
493
|
+
provider: this.config.provider,
|
|
494
|
+
model: this.config.model,
|
|
495
|
+
rawOutputPreview,
|
|
496
|
+
validationErrors: validationErrorEntries,
|
|
497
|
+
repairAttempts: repairResult.repairAttempts,
|
|
498
|
+
finalFailureReason: 'repair_exhausted',
|
|
499
|
+
};
|
|
500
|
+
this.eventEmitter.emitTelemetry({
|
|
501
|
+
eventType: 'output_repair_exhausted',
|
|
502
|
+
traceId: input.taskRef?.taskId ?? runId,
|
|
503
|
+
timestamp: new Date().toISOString(),
|
|
504
|
+
sessionId: 'pi-ai-adapter',
|
|
505
|
+
agentId: 'pi-ai-adapter',
|
|
506
|
+
payload: {
|
|
507
|
+
runId,
|
|
508
|
+
runtimeKind: 'pi-ai',
|
|
509
|
+
outputSchemaRef: schemaRef ?? 'unknown',
|
|
510
|
+
provider: this.config.provider,
|
|
511
|
+
model: this.config.model,
|
|
512
|
+
rawOutputPreview,
|
|
513
|
+
validationErrors: validationErrorEntries,
|
|
514
|
+
repairAttempts: evidencePack.repairAttempts,
|
|
515
|
+
finalFailureReason: evidencePack.finalFailureReason,
|
|
516
|
+
},
|
|
517
|
+
});
|
|
518
|
+
throw new PDRuntimeError('output_invalid', `LLM output does not match ${schemaRef ?? 'unknown'} schema`, { evidencePack });
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
// Lineage fields (taskId/sourcePainId/sourceTaskId/etc.) are
|
|
522
|
+
// intentionally stripped from LLM output. Downstream consumers
|
|
523
|
+
// (DiagnosticianRunner, committer) MUST get these values from
|
|
524
|
+
// RunnerContext / TaskRecord, never from validated output.
|
|
525
|
+
// This prevents LLM-supplied lineage from poisoning downstream
|
|
526
|
+
// commits (ERR-008 family). See PRI-272.
|
|
527
|
+
const protectedFreeForm = typeof parsedOutput === 'object' && parsedOutput !== null
|
|
528
|
+
? stripLineageFields(parsedOutput)
|
|
529
|
+
: parsedOutput;
|
|
530
|
+
validatedOutput = protectedFreeForm;
|
|
531
|
+
this.emitOutputPathTelemetry({ runId, input, path: 'free_form_with_repair', fallbackReason: null });
|
|
532
|
+
}
|
|
533
|
+
// Update run state to succeeded
|
|
534
|
+
const endedAt = new Date().toISOString();
|
|
535
|
+
runState.status = 'succeeded';
|
|
536
|
+
runState.endedAt = endedAt;
|
|
537
|
+
runState.output = { runId, payload: validatedOutput };
|
|
538
|
+
// Emit runtime_invocation_succeeded telemetry
|
|
539
|
+
this.eventEmitter.emitTelemetry({
|
|
540
|
+
eventType: 'runtime_invocation_succeeded',
|
|
541
|
+
traceId: input.taskRef?.taskId ?? runId,
|
|
542
|
+
timestamp: endedAt,
|
|
543
|
+
sessionId: 'pi-ai-adapter',
|
|
544
|
+
agentId: 'pi-ai-adapter',
|
|
545
|
+
payload: {
|
|
546
|
+
runId,
|
|
547
|
+
runtimeKind: 'pi-ai',
|
|
548
|
+
},
|
|
549
|
+
});
|
|
550
|
+
}
|
|
551
|
+
catch (err) {
|
|
552
|
+
// Update run state to failed
|
|
553
|
+
const endedAt = new Date().toISOString();
|
|
554
|
+
runState.endedAt = endedAt;
|
|
555
|
+
const elapsedMs = Date.now() - Date.parse(startedAt);
|
|
556
|
+
const maxRetries = this.config.maxRetries ?? 2;
|
|
557
|
+
let timeoutClassification = 'not_applicable';
|
|
558
|
+
let providerEvidence = '';
|
|
559
|
+
let retryAttempt = 0;
|
|
560
|
+
if (err instanceof PDRuntimeError && err.details) {
|
|
561
|
+
const { details } = err;
|
|
562
|
+
if (isObjectWithKey(details, 'timeoutClassification')) {
|
|
563
|
+
const { timeoutClassification: tc } = details;
|
|
564
|
+
if (typeof tc === 'string')
|
|
565
|
+
timeoutClassification = tc;
|
|
566
|
+
}
|
|
567
|
+
if (isObjectWithKey(details, 'providerEvidence')) {
|
|
568
|
+
const { providerEvidence: pe } = details;
|
|
569
|
+
if (typeof pe === 'string')
|
|
570
|
+
providerEvidence = pe;
|
|
571
|
+
}
|
|
572
|
+
if (isObjectWithKey(details, 'retryAttempt')) {
|
|
573
|
+
const { retryAttempt: ra } = details;
|
|
574
|
+
if (typeof ra === 'number')
|
|
575
|
+
retryAttempt = ra;
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
if (isAbortError(err, signal)) {
|
|
579
|
+
runState.status = 'timed_out';
|
|
580
|
+
runState.reason = `[timeout] LLM request timed out after ${effectiveTimeoutMs}ms (timeoutSource=${timeoutSource})`;
|
|
581
|
+
if (timeoutClassification === 'not_applicable') {
|
|
582
|
+
timeoutClassification = signal?.aborted ? 'client_timeout_budget_exhausted' : 'provider_transient_timeout';
|
|
583
|
+
}
|
|
584
|
+
if (!providerEvidence) {
|
|
585
|
+
providerEvidence = safeStringifyPreview(err, 300);
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
else if (err instanceof PDRuntimeError) {
|
|
589
|
+
runState.status = 'failed';
|
|
590
|
+
runState.reason = err.message;
|
|
591
|
+
if (err.category === 'timeout') {
|
|
592
|
+
runState.status = 'timed_out';
|
|
593
|
+
if (timeoutClassification === 'not_applicable') {
|
|
594
|
+
timeoutClassification = 'provider_transient_timeout';
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
if (!providerEvidence) {
|
|
598
|
+
providerEvidence = safeStringifyPreview(err, 300);
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
else {
|
|
602
|
+
runState.status = 'failed';
|
|
603
|
+
runState.reason = err instanceof Error ? err.message : String(err);
|
|
604
|
+
providerEvidence = safeStringifyPreview(err, 300);
|
|
605
|
+
}
|
|
606
|
+
// Emit runtime_invocation_failed telemetry
|
|
607
|
+
const errorCategory = err instanceof PDRuntimeError ? err.category : 'execution_failed';
|
|
608
|
+
this.eventEmitter.emitTelemetry({
|
|
609
|
+
eventType: 'runtime_invocation_failed',
|
|
610
|
+
traceId: input.taskRef?.taskId ?? runId,
|
|
611
|
+
timestamp: endedAt,
|
|
612
|
+
sessionId: 'pi-ai-adapter',
|
|
613
|
+
agentId: 'pi-ai-adapter',
|
|
614
|
+
payload: {
|
|
615
|
+
runId,
|
|
616
|
+
runtimeKind: 'pi-ai',
|
|
617
|
+
runnerKind: input.agentSpec.agentId,
|
|
618
|
+
provider: this.config.provider,
|
|
619
|
+
model: this.config.model,
|
|
620
|
+
effectiveTimeoutMs,
|
|
621
|
+
timeoutSource,
|
|
622
|
+
elapsedMs,
|
|
623
|
+
timeoutClassification,
|
|
624
|
+
retryAttempt,
|
|
625
|
+
maxRetries,
|
|
626
|
+
providerEvidence,
|
|
627
|
+
errorMessage: runState.reason,
|
|
628
|
+
errorCategory,
|
|
629
|
+
finalFailure: true,
|
|
630
|
+
},
|
|
631
|
+
});
|
|
632
|
+
// Re-throw PDRuntimeError as-is, wrap others
|
|
633
|
+
if (err instanceof PDRuntimeError) {
|
|
634
|
+
throw err;
|
|
635
|
+
}
|
|
636
|
+
throw new PDRuntimeError('execution_failed', `LLM completion failed: ${err instanceof Error ? err.message : String(err)}`, {
|
|
637
|
+
elapsedMs,
|
|
638
|
+
providerEvidence,
|
|
639
|
+
});
|
|
640
|
+
}
|
|
641
|
+
return { runId, runtimeKind: 'pi-ai', startedAt };
|
|
642
|
+
}
|
|
643
|
+
async pollRun(runId) {
|
|
644
|
+
const state = this.runs.get(runId);
|
|
645
|
+
if (!state) {
|
|
646
|
+
throw new PDRuntimeError('input_invalid', `Run ${runId} not found`);
|
|
647
|
+
}
|
|
648
|
+
return {
|
|
649
|
+
runId,
|
|
650
|
+
status: state.status,
|
|
651
|
+
startedAt: state.startedAt,
|
|
652
|
+
endedAt: state.endedAt,
|
|
653
|
+
reason: state.reason,
|
|
654
|
+
};
|
|
655
|
+
}
|
|
656
|
+
async cancelRun(runId) {
|
|
657
|
+
// One-shot mode: startRun() blocks until LLM responds, so cancel is always a no-op.
|
|
658
|
+
// The run is already terminal by the time cancelRun could be called.
|
|
659
|
+
const state = this.runs.get(runId);
|
|
660
|
+
if (state && state.status === 'succeeded') {
|
|
661
|
+
return;
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
async fetchOutput(runId) {
|
|
665
|
+
const state = this.runs.get(runId);
|
|
666
|
+
if (!state || !state.output) {
|
|
667
|
+
return null;
|
|
668
|
+
}
|
|
669
|
+
return state.output;
|
|
670
|
+
}
|
|
671
|
+
async fetchArtifacts(runId) {
|
|
672
|
+
// Artifact refs are not yet exposed by the pi-ai adapter.
|
|
673
|
+
// The DiagnosticianRunner stores artifacts via committer.writeArtifact() directly.
|
|
674
|
+
// Validate runId exists for API consistency with other methods.
|
|
675
|
+
if (!this.runs.has(runId)) {
|
|
676
|
+
throw new PDRuntimeError('input_invalid', `Run '${runId}' not found`);
|
|
677
|
+
}
|
|
678
|
+
return [];
|
|
679
|
+
}
|
|
680
|
+
// ── Private helpers ──
|
|
681
|
+
// ── PRI-271: Three-path output extraction ──
|
|
682
|
+
/**
|
|
683
|
+
* Path 1: Tool calling (PRI-271 B2).
|
|
684
|
+
*
|
|
685
|
+
* Passes `RECORD_DIAGNOSIS_V1_TOOL` via context.tools and injects
|
|
686
|
+
* `tool_choice: 'required'` via onPayload. If the provider supports tool
|
|
687
|
+
* calling, the response contains ToolCall content blocks with pre-parsed
|
|
688
|
+
* arguments that we validate against the schema.
|
|
689
|
+
*/
|
|
690
|
+
// eslint-disable-next-line @typescript-eslint/class-methods-use-this -- stateless helper; kept as private method for cohesion
|
|
691
|
+
async tryToolCallPath(params) {
|
|
692
|
+
try {
|
|
693
|
+
const toolContext = {
|
|
694
|
+
...params.baseContext,
|
|
695
|
+
tools: [RECORD_DIAGNOSIS_V1_TOOL],
|
|
696
|
+
};
|
|
697
|
+
const completeOptions = {
|
|
698
|
+
signal: params.signal,
|
|
699
|
+
apiKey: params.apiKey,
|
|
700
|
+
timeoutMs: params.effectiveTimeoutMs,
|
|
701
|
+
maxRetries: 0,
|
|
702
|
+
onPayload: (payload) => {
|
|
703
|
+
if (typeof payload === 'object' && payload !== null) {
|
|
704
|
+
const p = payload;
|
|
705
|
+
p.tool_choice = 'required';
|
|
706
|
+
}
|
|
707
|
+
return payload;
|
|
708
|
+
},
|
|
709
|
+
};
|
|
710
|
+
const response = await completeSimple(params.model, toolContext, completeOptions);
|
|
711
|
+
if (response.stopReason !== 'toolUse') {
|
|
712
|
+
return { success: false, fallbackReason: 'provider_no_tool_use' };
|
|
713
|
+
}
|
|
714
|
+
const toolCallBlock = response.content.find((block) => typeof block === 'object' && block !== null && 'type' in block && block.type === 'toolCall');
|
|
715
|
+
if (!toolCallBlock) {
|
|
716
|
+
return { success: false, fallbackReason: 'tool_call_extraction_failed' };
|
|
717
|
+
}
|
|
718
|
+
const toolArgs = toolCallBlock.arguments;
|
|
719
|
+
if (!Value.Check(params.schema, toolArgs)) {
|
|
720
|
+
return { success: false, fallbackReason: 'tool_call_schema_invalid' };
|
|
721
|
+
}
|
|
722
|
+
// Lineage fields (taskId/sourcePainId/sourceTaskId/etc.) are
|
|
723
|
+
// intentionally stripped from LLM output. Downstream consumers
|
|
724
|
+
// (DiagnosticianRunner, committer) MUST get these values from
|
|
725
|
+
// RunnerContext / TaskRecord, never from validated output.
|
|
726
|
+
// This prevents LLM-supplied lineage from poisoning downstream
|
|
727
|
+
// commits (ERR-008 family). See PRI-271 D4 in PR description.
|
|
728
|
+
const protectedArgs = typeof toolArgs === 'object' && toolArgs !== null
|
|
729
|
+
? stripLineageFields(toolArgs)
|
|
730
|
+
: toolArgs;
|
|
731
|
+
return { success: true, output: protectedArgs };
|
|
732
|
+
}
|
|
733
|
+
catch (err) {
|
|
734
|
+
if (err instanceof PDRuntimeError && (err.category === 'timeout' || err.category === 'runtime_unavailable')) {
|
|
735
|
+
throw err;
|
|
736
|
+
}
|
|
737
|
+
const reason = err instanceof PDRuntimeError && err.category === 'output_invalid'
|
|
738
|
+
? 'tool_call_extraction_failed'
|
|
739
|
+
: 'provider_no_tool_use';
|
|
740
|
+
return { success: false, fallbackReason: reason };
|
|
741
|
+
}
|
|
742
|
+
}
|
|
743
|
+
/**
|
|
744
|
+
* Path 2: JSON mode (PRI-271 B1).
|
|
745
|
+
*
|
|
746
|
+
* Injects `response_format: { type: 'json_object' }` via onPayload
|
|
747
|
+
* to force the provider to output valid JSON. Then parses and validates.
|
|
748
|
+
*/
|
|
749
|
+
// eslint-disable-next-line @typescript-eslint/class-methods-use-this -- stateless helper; kept as private method for cohesion
|
|
750
|
+
async tryJsonModePath(params) {
|
|
751
|
+
try {
|
|
752
|
+
const completeOptions = {
|
|
753
|
+
signal: params.signal,
|
|
754
|
+
apiKey: params.apiKey,
|
|
755
|
+
timeoutMs: params.effectiveTimeoutMs,
|
|
756
|
+
maxRetries: 0,
|
|
757
|
+
onPayload: (payload) => {
|
|
758
|
+
if (typeof payload === 'object' && payload !== null) {
|
|
759
|
+
const p = payload;
|
|
760
|
+
p.response_format = { type: 'json_object' };
|
|
761
|
+
}
|
|
762
|
+
return payload;
|
|
763
|
+
},
|
|
764
|
+
};
|
|
765
|
+
const response = await completeSimple(params.model, params.baseContext, completeOptions);
|
|
766
|
+
const text = extractAssistantTextOrThrow(response, params.signal);
|
|
767
|
+
const parsed = extractJsonObject(text);
|
|
768
|
+
if (!parsed) {
|
|
769
|
+
return { success: false, fallbackReason: 'json_parse_failed' };
|
|
770
|
+
}
|
|
771
|
+
if (!Value.Check(params.schema, parsed)) {
|
|
772
|
+
return { success: false, fallbackReason: 'json_schema_invalid' };
|
|
773
|
+
}
|
|
774
|
+
// Lineage fields (taskId/sourcePainId/sourceTaskId/etc.) are
|
|
775
|
+
// intentionally stripped from LLM output. Downstream consumers
|
|
776
|
+
// (DiagnosticianRunner, committer) MUST get these values from
|
|
777
|
+
// RunnerContext / TaskRecord, never from validated output.
|
|
778
|
+
// This prevents LLM-supplied lineage from poisoning downstream
|
|
779
|
+
// commits (ERR-008 family). See PRI-271 D4 in PR description.
|
|
780
|
+
const protectedParsed = typeof parsed === 'object' && parsed !== null
|
|
781
|
+
? stripLineageFields(parsed)
|
|
782
|
+
: parsed;
|
|
783
|
+
return { success: true, output: protectedParsed };
|
|
784
|
+
}
|
|
785
|
+
catch (err) {
|
|
786
|
+
if (err instanceof PDRuntimeError && (err.category === 'timeout' || err.category === 'runtime_unavailable')) {
|
|
787
|
+
throw err;
|
|
788
|
+
}
|
|
789
|
+
if (err instanceof PDRuntimeError && err.category === 'output_invalid') {
|
|
790
|
+
return { success: false, fallbackReason: 'json_parse_failed' };
|
|
791
|
+
}
|
|
792
|
+
return { success: false, fallbackReason: 'provider_no_json_mode' };
|
|
793
|
+
}
|
|
794
|
+
}
|
|
795
|
+
/**
|
|
796
|
+
* Emit output_path_chosen telemetry (PRI-271 B3).
|
|
797
|
+
*
|
|
798
|
+
* Every path selection and fallback emits structured telemetry.
|
|
799
|
+
* `path` is set when a path succeeds; null when recording a fallback reason.
|
|
800
|
+
*/
|
|
801
|
+
emitOutputPathTelemetry(params) {
|
|
802
|
+
this.eventEmitter.emitTelemetry({
|
|
803
|
+
eventType: params.path ? 'output_path_chosen' : 'output_path_fallback',
|
|
804
|
+
traceId: params.input.taskRef?.taskId ?? params.runId,
|
|
805
|
+
timestamp: new Date().toISOString(),
|
|
806
|
+
sessionId: 'pi-ai-adapter',
|
|
807
|
+
agentId: 'pi-ai-adapter',
|
|
808
|
+
payload: {
|
|
809
|
+
runId: params.runId,
|
|
810
|
+
runtimeKind: 'pi-ai',
|
|
811
|
+
provider: this.config.provider,
|
|
812
|
+
model: this.config.model,
|
|
813
|
+
outputSchemaRef: params.input.outputSchemaRef ?? 'unknown',
|
|
814
|
+
outputPath: params.path,
|
|
815
|
+
fallbackReason: params.fallbackReason,
|
|
816
|
+
},
|
|
817
|
+
});
|
|
818
|
+
}
|
|
819
|
+
/**
|
|
820
|
+
* Make a single LLM call for output repair (PRI-71).
|
|
821
|
+
* Returns extracted text response or null if no content.
|
|
822
|
+
* Reuses same provider/model/apiKey as the original call.
|
|
823
|
+
*
|
|
824
|
+
* Uses an independent AbortSignal (fixed 60s timeout) to avoid the repair
|
|
825
|
+
* call immediately timing out when the original call consumed most of the
|
|
826
|
+
* original timeout budget (e.g., 5min original → 4m50s elapsed → 10s left).
|
|
827
|
+
*/
|
|
828
|
+
// eslint-disable-next-line @typescript-eslint/class-methods-use-this -- REPAIR_TIMEOUT_MS is a constant; this method is intentionally stateless
|
|
829
|
+
async repairLLMCall(model, prompt, options) {
|
|
830
|
+
const REPAIR_TIMEOUT_MS = 60_000;
|
|
831
|
+
const repairSignal = AbortSignal.timeout(REPAIR_TIMEOUT_MS);
|
|
832
|
+
const repairMessage = {
|
|
833
|
+
role: 'user',
|
|
834
|
+
content: prompt,
|
|
835
|
+
timestamp: Date.now(),
|
|
836
|
+
};
|
|
837
|
+
const repairContext = { messages: [repairMessage] };
|
|
838
|
+
const response = await completeSimple(model, repairContext, {
|
|
839
|
+
signal: repairSignal,
|
|
840
|
+
apiKey: options.apiKey,
|
|
841
|
+
timeoutMs: REPAIR_TIMEOUT_MS,
|
|
842
|
+
maxRetries: 0,
|
|
843
|
+
});
|
|
844
|
+
// extractAssistantTextOrThrow throws:
|
|
845
|
+
// - output_invalid: no text content in response
|
|
846
|
+
// - timeout: aborted/timed out (caller's signal or pi-ai internal)
|
|
847
|
+
// - execution_failed: provider error (non-timeout)
|
|
848
|
+
// We only swallow output_invalid, letting timeout/execution_failed propagate.
|
|
849
|
+
try {
|
|
850
|
+
return extractAssistantTextOrThrow(response, options.signal);
|
|
851
|
+
}
|
|
852
|
+
catch (err) {
|
|
853
|
+
if (err instanceof PDRuntimeError && err.category === 'output_invalid') {
|
|
854
|
+
return null;
|
|
855
|
+
}
|
|
856
|
+
throw err;
|
|
857
|
+
}
|
|
858
|
+
}
|
|
859
|
+
/**
|
|
860
|
+
* Call pi-ai complete() with retry and exponential backoff.
|
|
861
|
+
* Disables pi-ai built-in retry (maxRetries: 0) to avoid double-retry.
|
|
862
|
+
*/
|
|
863
|
+
async completeWithRetry(model, context, options) {
|
|
864
|
+
const maxRetries = this.config.maxRetries ?? 2;
|
|
865
|
+
const { effectiveTimeoutMs = this.config.timeoutMs ?? 300_000, timeoutSource = 'default', input, runId = crypto.randomUUID(), } = options;
|
|
866
|
+
let lastError = undefined;
|
|
867
|
+
const overallStartTime = Date.now();
|
|
868
|
+
const getDelay = (attemptIndex) => {
|
|
869
|
+
return this.config._testBackoffDelayMs !== undefined
|
|
870
|
+
? this.config._testBackoffDelayMs
|
|
871
|
+
: Math.min(1000 * Math.pow(2, attemptIndex), 30_000);
|
|
872
|
+
};
|
|
873
|
+
for (let attempt = 0; attempt <= maxRetries; attempt++) {
|
|
874
|
+
const elapsedMs = Date.now() - overallStartTime;
|
|
875
|
+
const remainingMs = effectiveTimeoutMs - elapsedMs;
|
|
876
|
+
// Fail fast if overall budget signal is aborted, or if we have already run out of budget time
|
|
877
|
+
if (options.signal?.aborted || remainingMs <= 0) {
|
|
878
|
+
const errorDetails = {
|
|
879
|
+
timeoutClassification: 'client_timeout_budget_exhausted',
|
|
880
|
+
effectiveTimeoutMs,
|
|
881
|
+
timeoutSource,
|
|
882
|
+
elapsedMs,
|
|
883
|
+
retryAttempt: attempt,
|
|
884
|
+
maxRetries,
|
|
885
|
+
providerEvidence: options.signal?.aborted
|
|
886
|
+
? 'Client budget signal aborted'
|
|
887
|
+
: `Overall timeout budget exhausted (elapsed ${elapsedMs}ms of ${effectiveTimeoutMs}ms)`,
|
|
888
|
+
};
|
|
889
|
+
throw new PDRuntimeError('timeout', `LLM request timed out after ${effectiveTimeoutMs}ms (timeoutSource=client_budget_exhausted)`, errorDetails);
|
|
890
|
+
}
|
|
891
|
+
// Cap the individual attempt timeout to the remaining budget to honor the timeout budget contract
|
|
892
|
+
const currentTimeoutMs = Math.min(effectiveTimeoutMs, remainingMs);
|
|
893
|
+
try {
|
|
894
|
+
const completeOptions = {
|
|
895
|
+
signal: options.signal,
|
|
896
|
+
apiKey: options.apiKey,
|
|
897
|
+
timeoutMs: currentTimeoutMs,
|
|
898
|
+
maxRetries: 0, // disable pi-ai built-in retry to avoid double-retry
|
|
899
|
+
};
|
|
900
|
+
if (this.config.reasoning !== undefined && this.config.reasoning !== false) {
|
|
901
|
+
completeOptions.reasoning = this.config.reasoning;
|
|
902
|
+
}
|
|
903
|
+
const response = await completeSimple(model, context, completeOptions);
|
|
904
|
+
// If provider resolved with an error response, classify and potentially retry.
|
|
905
|
+
if (response.stopReason === 'error' || response.stopReason === 'aborted') {
|
|
906
|
+
const rawMessage = response.errorMessage ?? 'unknown provider error';
|
|
907
|
+
const elapsedMsAfter = Date.now() - overallStartTime;
|
|
908
|
+
const isTimeout = response.stopReason === 'aborted'
|
|
909
|
+
|| options.signal?.aborted
|
|
910
|
+
|| /timeout|timed\s*out/i.test(rawMessage)
|
|
911
|
+
|| /abort/i.test(rawMessage);
|
|
912
|
+
const classification = (options.signal?.aborted || elapsedMsAfter >= effectiveTimeoutMs)
|
|
913
|
+
? 'client_timeout_budget_exhausted'
|
|
914
|
+
: isTimeout
|
|
915
|
+
? 'provider_transient_timeout'
|
|
916
|
+
: 'not_applicable';
|
|
917
|
+
if (isTimeout) {
|
|
918
|
+
const errorDetails = {
|
|
919
|
+
timeoutClassification: classification,
|
|
920
|
+
effectiveTimeoutMs,
|
|
921
|
+
timeoutSource,
|
|
922
|
+
elapsedMs: elapsedMsAfter,
|
|
923
|
+
retryAttempt: attempt,
|
|
924
|
+
maxRetries,
|
|
925
|
+
providerEvidence: safeStringifyPreview(rawMessage, 300),
|
|
926
|
+
};
|
|
927
|
+
const pdErr = new PDRuntimeError('timeout', `[timeout] LLM request timed out after ${effectiveTimeoutMs}ms (timeoutSource=provider_request)`, errorDetails);
|
|
928
|
+
lastError = pdErr;
|
|
929
|
+
if (classification === 'provider_transient_timeout' && attempt < maxRetries) {
|
|
930
|
+
if (input) {
|
|
931
|
+
this.emitAttemptTelemetry({
|
|
932
|
+
input,
|
|
933
|
+
runId,
|
|
934
|
+
attempt,
|
|
935
|
+
maxRetries,
|
|
936
|
+
err: pdErr,
|
|
937
|
+
elapsedMs: elapsedMsAfter,
|
|
938
|
+
timeoutSource,
|
|
939
|
+
effectiveTimeoutMs,
|
|
940
|
+
});
|
|
941
|
+
}
|
|
942
|
+
const delay = getDelay(attempt);
|
|
943
|
+
await new Promise(r => setTimeout(r, delay));
|
|
944
|
+
continue;
|
|
945
|
+
}
|
|
946
|
+
throw pdErr;
|
|
947
|
+
}
|
|
948
|
+
// execution_failed — retryable if attempts remain
|
|
949
|
+
const pdErr = new PDRuntimeError('execution_failed', `LLM execution failed: ${rawMessage.substring(0, 300)}`, {
|
|
950
|
+
retryAttempt: attempt,
|
|
951
|
+
maxRetries,
|
|
952
|
+
elapsedMs: elapsedMsAfter,
|
|
953
|
+
providerEvidence: safeStringifyPreview(rawMessage, 300),
|
|
954
|
+
});
|
|
955
|
+
lastError = pdErr;
|
|
956
|
+
if (attempt < maxRetries) {
|
|
957
|
+
if (input) {
|
|
958
|
+
this.emitAttemptTelemetry({
|
|
959
|
+
input,
|
|
960
|
+
runId,
|
|
961
|
+
attempt,
|
|
962
|
+
maxRetries,
|
|
963
|
+
err: pdErr,
|
|
964
|
+
elapsedMs: elapsedMsAfter,
|
|
965
|
+
timeoutSource,
|
|
966
|
+
effectiveTimeoutMs,
|
|
967
|
+
});
|
|
968
|
+
}
|
|
969
|
+
const delay = getDelay(attempt);
|
|
970
|
+
await new Promise(r => setTimeout(r, delay));
|
|
971
|
+
continue;
|
|
972
|
+
}
|
|
973
|
+
throw pdErr;
|
|
974
|
+
}
|
|
975
|
+
return response;
|
|
976
|
+
}
|
|
977
|
+
catch (err) {
|
|
978
|
+
const elapsedMsAfter = Date.now() - overallStartTime;
|
|
979
|
+
let classificationResult = classifyFailure(err, options.signal);
|
|
980
|
+
if (options.signal?.aborted || elapsedMsAfter >= effectiveTimeoutMs) {
|
|
981
|
+
classificationResult = {
|
|
982
|
+
category: 'timeout',
|
|
983
|
+
classification: 'client_timeout_budget_exhausted',
|
|
984
|
+
};
|
|
985
|
+
}
|
|
986
|
+
// If it's a client budget exhaustion, throw immediately (no retry)
|
|
987
|
+
if (classificationResult.classification === 'client_timeout_budget_exhausted') {
|
|
988
|
+
const errorDetails = {
|
|
989
|
+
timeoutClassification: 'client_timeout_budget_exhausted',
|
|
990
|
+
effectiveTimeoutMs,
|
|
991
|
+
timeoutSource,
|
|
992
|
+
elapsedMs: elapsedMsAfter,
|
|
993
|
+
retryAttempt: attempt,
|
|
994
|
+
maxRetries,
|
|
995
|
+
providerEvidence: safeStringifyPreview(err, 300),
|
|
996
|
+
};
|
|
997
|
+
throw new PDRuntimeError('timeout', `LLM request timed out after ${effectiveTimeoutMs}ms`, errorDetails);
|
|
998
|
+
}
|
|
999
|
+
if (classificationResult.category === 'timeout') {
|
|
1000
|
+
const errorDetails = {
|
|
1001
|
+
timeoutClassification: 'provider_transient_timeout',
|
|
1002
|
+
effectiveTimeoutMs,
|
|
1003
|
+
timeoutSource,
|
|
1004
|
+
elapsedMs: elapsedMsAfter,
|
|
1005
|
+
retryAttempt: attempt,
|
|
1006
|
+
maxRetries,
|
|
1007
|
+
providerEvidence: safeStringifyPreview(err, 300),
|
|
1008
|
+
};
|
|
1009
|
+
const pdErr = new PDRuntimeError('timeout', `LLM request timed out after ${effectiveTimeoutMs}ms`, errorDetails);
|
|
1010
|
+
lastError = pdErr;
|
|
1011
|
+
if (attempt < maxRetries) {
|
|
1012
|
+
if (input) {
|
|
1013
|
+
this.emitAttemptTelemetry({
|
|
1014
|
+
input,
|
|
1015
|
+
runId,
|
|
1016
|
+
attempt,
|
|
1017
|
+
maxRetries,
|
|
1018
|
+
err: pdErr,
|
|
1019
|
+
elapsedMs: elapsedMsAfter,
|
|
1020
|
+
timeoutSource,
|
|
1021
|
+
effectiveTimeoutMs,
|
|
1022
|
+
});
|
|
1023
|
+
}
|
|
1024
|
+
const delay = getDelay(attempt);
|
|
1025
|
+
await new Promise(r => setTimeout(r, delay));
|
|
1026
|
+
continue;
|
|
1027
|
+
}
|
|
1028
|
+
throw pdErr;
|
|
1029
|
+
}
|
|
1030
|
+
if (err instanceof PDRuntimeError) {
|
|
1031
|
+
throw err; // don't retry standard PDRuntimeError if it is permanent or already handled
|
|
1032
|
+
}
|
|
1033
|
+
// It is an execution_failed (network, etc.)
|
|
1034
|
+
const errorDetails = {
|
|
1035
|
+
retryAttempt: attempt,
|
|
1036
|
+
maxRetries,
|
|
1037
|
+
elapsedMs: elapsedMsAfter,
|
|
1038
|
+
providerEvidence: safeStringifyPreview(err, 300),
|
|
1039
|
+
};
|
|
1040
|
+
const pdErr = new PDRuntimeError('execution_failed', `LLM completion failed: ${err instanceof Error ? err.message : String(err)}`, errorDetails);
|
|
1041
|
+
lastError = pdErr;
|
|
1042
|
+
if (attempt < maxRetries) {
|
|
1043
|
+
if (input) {
|
|
1044
|
+
this.emitAttemptTelemetry({
|
|
1045
|
+
input,
|
|
1046
|
+
runId,
|
|
1047
|
+
attempt,
|
|
1048
|
+
maxRetries,
|
|
1049
|
+
err: pdErr,
|
|
1050
|
+
elapsedMs: elapsedMsAfter,
|
|
1051
|
+
timeoutSource,
|
|
1052
|
+
effectiveTimeoutMs,
|
|
1053
|
+
});
|
|
1054
|
+
}
|
|
1055
|
+
const delay = getDelay(attempt);
|
|
1056
|
+
await new Promise(r => setTimeout(r, delay));
|
|
1057
|
+
}
|
|
1058
|
+
}
|
|
1059
|
+
}
|
|
1060
|
+
// If lastError is already a PDRuntimeError, re-throw it; otherwise wrap it
|
|
1061
|
+
if (lastError instanceof PDRuntimeError) {
|
|
1062
|
+
throw lastError;
|
|
1063
|
+
}
|
|
1064
|
+
throw new PDRuntimeError('execution_failed', `LLM completion failed after ${maxRetries + 1} attempts: ${lastError instanceof Error ? lastError.message : String(lastError)}`);
|
|
1065
|
+
}
|
|
1066
|
+
emitAttemptTelemetry(params) {
|
|
1067
|
+
const { input, runId, attempt, maxRetries, err, elapsedMs, timeoutSource, effectiveTimeoutMs, } = params;
|
|
1068
|
+
const endedAt = new Date().toISOString();
|
|
1069
|
+
const { details } = err;
|
|
1070
|
+
let timeoutClassification = 'not_applicable';
|
|
1071
|
+
let providerEvidence = '';
|
|
1072
|
+
if (details && typeof details === 'object') {
|
|
1073
|
+
if (isObjectWithKey(details, 'timeoutClassification')) {
|
|
1074
|
+
const { timeoutClassification: tc } = details;
|
|
1075
|
+
if (typeof tc === 'string')
|
|
1076
|
+
timeoutClassification = tc;
|
|
1077
|
+
}
|
|
1078
|
+
if (isObjectWithKey(details, 'providerEvidence')) {
|
|
1079
|
+
const { providerEvidence: pe } = details;
|
|
1080
|
+
if (typeof pe === 'string')
|
|
1081
|
+
providerEvidence = pe;
|
|
1082
|
+
}
|
|
1083
|
+
}
|
|
1084
|
+
this.eventEmitter.emitTelemetry({
|
|
1085
|
+
eventType: 'runtime_invocation_failed',
|
|
1086
|
+
traceId: input.taskRef?.taskId ?? runId,
|
|
1087
|
+
timestamp: endedAt,
|
|
1088
|
+
sessionId: 'pi-ai-adapter',
|
|
1089
|
+
agentId: 'pi-ai-adapter',
|
|
1090
|
+
payload: {
|
|
1091
|
+
runId,
|
|
1092
|
+
runtimeKind: 'pi-ai',
|
|
1093
|
+
runnerKind: input.agentSpec.agentId,
|
|
1094
|
+
provider: this.config.provider,
|
|
1095
|
+
model: this.config.model,
|
|
1096
|
+
effectiveTimeoutMs,
|
|
1097
|
+
timeoutSource,
|
|
1098
|
+
elapsedMs,
|
|
1099
|
+
timeoutClassification,
|
|
1100
|
+
retryAttempt: attempt,
|
|
1101
|
+
maxRetries,
|
|
1102
|
+
providerEvidence,
|
|
1103
|
+
errorMessage: err.message,
|
|
1104
|
+
isRetryAttempt: true,
|
|
1105
|
+
},
|
|
1106
|
+
});
|
|
1107
|
+
}
|
|
1108
|
+
}
|
|
1109
|
+
//# sourceMappingURL=pi-ai-runtime-adapter.js.map
|