agentfootprint 9.40.0 → 9.43.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/AGENTS.md +30 -1
- package/CLAUDE.md +4 -1
- package/ai-instructions/claude-code/SKILL.md +31 -1
- package/dist/adapters/hosting/agentcore.js +71 -10
- package/dist/adapters/hosting/agentcore.js.map +1 -1
- package/dist/adapters/hosting/firestoreSessions.js +184 -14
- package/dist/adapters/hosting/firestoreSessions.js.map +1 -1
- package/dist/adapters/hosting/googleAgentEngine.js +29 -0
- package/dist/adapters/hosting/googleAgentEngine.js.map +1 -1
- package/dist/adapters/memory/agentcore.js +3 -1
- package/dist/adapters/memory/agentcore.js.map +1 -1
- package/dist/artifacts/conformance/cases.js +840 -0
- package/dist/artifacts/conformance/cases.js.map +1 -0
- package/dist/artifacts/conformance/index.js +18 -0
- package/dist/artifacts/conformance/index.js.map +1 -0
- package/dist/artifacts/conformance/run.js +223 -0
- package/dist/artifacts/conformance/run.js.map +1 -0
- package/dist/artifacts/conformance/types.js +11 -0
- package/dist/artifacts/conformance/types.js.map +1 -0
- package/dist/artifacts/index.js +10 -1
- package/dist/artifacts/index.js.map +1 -1
- package/dist/core/Agent.js +100 -1
- package/dist/core/Agent.js.map +1 -1
- package/dist/core/agent/AgentBuilder.js +56 -1
- package/dist/core/agent/AgentBuilder.js.map +1 -1
- package/dist/core/agent/buildAgentChart.js +5 -1
- package/dist/core/agent/buildAgentChart.js.map +1 -1
- package/dist/core/agent/buildDynamicAgentChart.js +5 -1
- package/dist/core/agent/buildDynamicAgentChart.js.map +1 -1
- package/dist/core/agent/coverage/absent.js +163 -0
- package/dist/core/agent/coverage/absent.js.map +1 -0
- package/dist/core/agent/coverage/answer.js +90 -0
- package/dist/core/agent/coverage/answer.js.map +1 -0
- package/dist/core/agent/coverage/evidence.js +90 -0
- package/dist/core/agent/coverage/evidence.js.map +1 -0
- package/dist/core/agent/coverage/index.js +37 -0
- package/dist/core/agent/coverage/index.js.map +1 -0
- package/dist/core/agent/coverage/items.js +91 -0
- package/dist/core/agent/coverage/items.js.map +1 -0
- package/dist/core/agent/coverage/ledger.js +131 -0
- package/dist/core/agent/coverage/ledger.js.map +1 -0
- package/dist/core/agent/coverage/read.js +56 -0
- package/dist/core/agent/coverage/read.js.map +1 -0
- package/dist/core/agent/coverage/types.js +15 -0
- package/dist/core/agent/coverage/types.js.map +1 -0
- package/dist/core/agent/evidence/evidenceIndex.js +18 -1
- package/dist/core/agent/evidence/evidenceIndex.js.map +1 -1
- package/dist/core/agent/runManifest.js +102 -0
- package/dist/core/agent/runManifest.js.map +1 -0
- package/dist/core/agent/stages/prepareFinal.js +44 -3
- package/dist/core/agent/stages/prepareFinal.js.map +1 -1
- package/dist/core/agent/stages/toolCalls.js +109 -3
- package/dist/core/agent/stages/toolCalls.js.map +1 -1
- package/dist/core/agent/toolEffects.js +1 -1
- package/dist/debug.js +49 -25
- package/dist/debug.js.map +1 -1
- package/dist/esm/adapters/hosting/agentcore.d.ts +8 -0
- package/dist/esm/adapters/hosting/agentcore.js +71 -10
- package/dist/esm/adapters/hosting/agentcore.js.map +1 -1
- package/dist/esm/adapters/hosting/firestoreSessions.d.ts +162 -14
- package/dist/esm/adapters/hosting/firestoreSessions.js +182 -13
- package/dist/esm/adapters/hosting/firestoreSessions.js.map +1 -1
- package/dist/esm/adapters/hosting/googleAgentEngine.d.ts +16 -1
- package/dist/esm/adapters/hosting/googleAgentEngine.js +29 -0
- package/dist/esm/adapters/hosting/googleAgentEngine.js.map +1 -1
- package/dist/esm/adapters/memory/agentcore.js +3 -1
- package/dist/esm/adapters/memory/agentcore.js.map +1 -1
- package/dist/esm/artifacts/conformance/cases.d.ts +23 -0
- package/dist/esm/artifacts/conformance/cases.js +837 -0
- package/dist/esm/artifacts/conformance/cases.js.map +1 -0
- package/dist/esm/artifacts/conformance/index.d.ts +11 -0
- package/dist/esm/artifacts/conformance/index.js +11 -0
- package/dist/esm/artifacts/conformance/index.js.map +1 -0
- package/dist/esm/artifacts/conformance/run.d.ts +47 -0
- package/dist/esm/artifacts/conformance/run.js +217 -0
- package/dist/esm/artifacts/conformance/run.js.map +1 -0
- package/dist/esm/artifacts/conformance/types.d.ts +197 -0
- package/dist/esm/artifacts/conformance/types.js +10 -0
- package/dist/esm/artifacts/conformance/types.js.map +1 -0
- package/dist/esm/artifacts/index.d.ts +1 -0
- package/dist/esm/artifacts/index.js +5 -0
- package/dist/esm/artifacts/index.js.map +1 -1
- package/dist/esm/core/Agent.d.ts +34 -1
- package/dist/esm/core/Agent.js +100 -1
- package/dist/esm/core/Agent.js.map +1 -1
- package/dist/esm/core/agent/AgentBuilder.d.ts +43 -0
- package/dist/esm/core/agent/AgentBuilder.js +56 -1
- package/dist/esm/core/agent/AgentBuilder.js.map +1 -1
- package/dist/esm/core/agent/buildAgentChart.d.ts +9 -0
- package/dist/esm/core/agent/buildAgentChart.js +6 -2
- package/dist/esm/core/agent/buildAgentChart.js.map +1 -1
- package/dist/esm/core/agent/buildDynamicAgentChart.js +6 -2
- package/dist/esm/core/agent/buildDynamicAgentChart.js.map +1 -1
- package/dist/esm/core/agent/coverage/absent.d.ts +104 -0
- package/dist/esm/core/agent/coverage/absent.js +157 -0
- package/dist/esm/core/agent/coverage/absent.js.map +1 -0
- package/dist/esm/core/agent/coverage/answer.d.ts +46 -0
- package/dist/esm/core/agent/coverage/answer.js +86 -0
- package/dist/esm/core/agent/coverage/answer.js.map +1 -0
- package/dist/esm/core/agent/coverage/evidence.d.ts +68 -0
- package/dist/esm/core/agent/coverage/evidence.js +86 -0
- package/dist/esm/core/agent/coverage/evidence.js.map +1 -0
- package/dist/esm/core/agent/coverage/index.d.ts +17 -0
- package/dist/esm/core/agent/coverage/index.js +17 -0
- package/dist/esm/core/agent/coverage/index.js.map +1 -0
- package/dist/esm/core/agent/coverage/items.d.ts +35 -0
- package/dist/esm/core/agent/coverage/items.js +85 -0
- package/dist/esm/core/agent/coverage/items.js.map +1 -0
- package/dist/esm/core/agent/coverage/ledger.d.ts +80 -0
- package/dist/esm/core/agent/coverage/ledger.js +125 -0
- package/dist/esm/core/agent/coverage/ledger.js.map +1 -0
- package/dist/esm/core/agent/coverage/read.d.ts +51 -0
- package/dist/esm/core/agent/coverage/read.js +52 -0
- package/dist/esm/core/agent/coverage/read.js.map +1 -0
- package/dist/esm/core/agent/coverage/types.d.ts +142 -0
- package/dist/esm/core/agent/coverage/types.js +14 -0
- package/dist/esm/core/agent/coverage/types.js.map +1 -0
- package/dist/esm/core/agent/evidence/evidenceIndex.d.ts +7 -0
- package/dist/esm/core/agent/evidence/evidenceIndex.js +18 -1
- package/dist/esm/core/agent/evidence/evidenceIndex.js.map +1 -1
- package/dist/esm/core/agent/runManifest.d.ts +80 -0
- package/dist/esm/core/agent/runManifest.js +98 -0
- package/dist/esm/core/agent/runManifest.js.map +1 -0
- package/dist/esm/core/agent/stages/prepareFinal.d.ts +18 -0
- package/dist/esm/core/agent/stages/prepareFinal.js +42 -2
- package/dist/esm/core/agent/stages/prepareFinal.js.map +1 -1
- package/dist/esm/core/agent/stages/toolCalls.js +109 -3
- package/dist/esm/core/agent/stages/toolCalls.js.map +1 -1
- package/dist/esm/core/agent/toolEffects.d.ts +2 -2
- package/dist/esm/core/agent/toolEffects.js +1 -1
- package/dist/esm/core/agent/types.d.ts +14 -0
- package/dist/esm/debug.d.ts +1 -0
- package/dist/esm/debug.js +7 -0
- package/dist/esm/debug.js.map +1 -1
- package/dist/esm/events/payloads.d.ts +205 -0
- package/dist/esm/events/registry.d.ts +7 -1
- package/dist/esm/events/registry.js +6 -0
- package/dist/esm/events/registry.js.map +1 -1
- package/dist/esm/hosting/conformance/cases.d.ts +2 -1
- package/dist/esm/hosting/conformance/cases.js +88 -2
- package/dist/esm/hosting/conformance/cases.js.map +1 -1
- package/dist/esm/hosting/conformance/types.d.ts +7 -7
- package/dist/esm/hosting/errors.d.ts +28 -0
- package/dist/esm/hosting/errors.js +40 -0
- package/dist/esm/hosting/errors.js.map +1 -1
- package/dist/esm/hosting/index.d.ts +11 -3
- package/dist/esm/hosting/index.js +15 -2
- package/dist/esm/hosting/index.js.map +1 -1
- package/dist/esm/hosting/memorySessions.js +39 -0
- package/dist/esm/hosting/memorySessions.js.map +1 -1
- package/dist/esm/hosting/sessionRetention.d.ts +56 -0
- package/dist/esm/hosting/sessionRetention.js +69 -0
- package/dist/esm/hosting/sessionRetention.js.map +1 -0
- package/dist/esm/hosting/sqliteSessions.d.ts +11 -1
- package/dist/esm/hosting/sqliteSessions.js +51 -0
- package/dist/esm/hosting/sqliteSessions.js.map +1 -1
- package/dist/esm/hosting/types.d.ts +184 -0
- package/dist/esm/hosting/types.js +9 -0
- package/dist/esm/hosting/types.js.map +1 -1
- package/dist/esm/hosting-providers.d.ts +15 -11
- package/dist/esm/hosting-providers.js +21 -11
- package/dist/esm/hosting-providers.js.map +1 -1
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.js +25 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/lib/context-bisect/arms/apply.d.ts +54 -0
- package/dist/esm/lib/context-bisect/arms/apply.js +41 -0
- package/dist/esm/lib/context-bisect/arms/apply.js.map +1 -0
- package/dist/esm/lib/context-bisect/arms/compare.d.ts +27 -0
- package/dist/esm/lib/context-bisect/arms/compare.js +112 -0
- package/dist/esm/lib/context-bisect/arms/compare.js.map +1 -0
- package/dist/esm/lib/context-bisect/arms/index.d.ts +16 -0
- package/dist/esm/lib/context-bisect/arms/index.js +16 -0
- package/dist/esm/lib/context-bisect/arms/index.js.map +1 -0
- package/dist/esm/lib/context-bisect/arms/manifest.d.ts +79 -0
- package/dist/esm/lib/context-bisect/arms/manifest.js +199 -0
- package/dist/esm/lib/context-bisect/arms/manifest.js.map +1 -0
- package/dist/esm/lib/context-bisect/arms/probe.d.ts +54 -0
- package/dist/esm/lib/context-bisect/arms/probe.js +125 -0
- package/dist/esm/lib/context-bisect/arms/probe.js.map +1 -0
- package/dist/esm/lib/context-bisect/arms/types.d.ts +319 -0
- package/dist/esm/lib/context-bisect/arms/types.js +67 -0
- package/dist/esm/lib/context-bisect/arms/types.js.map +1 -0
- package/dist/esm/lib/context-bisect/arms/validate.d.ts +26 -0
- package/dist/esm/lib/context-bisect/arms/validate.js +122 -0
- package/dist/esm/lib/context-bisect/arms/validate.js.map +1 -0
- package/dist/esm/lib/context-bisect/arms/verdict.d.ts +53 -0
- package/dist/esm/lib/context-bisect/arms/verdict.js +103 -0
- package/dist/esm/lib/context-bisect/arms/verdict.js.map +1 -0
- package/dist/esm/lib/context-bisect/index.d.ts +1 -0
- package/dist/esm/lib/context-bisect/index.js +5 -0
- package/dist/esm/lib/context-bisect/index.js.map +1 -1
- package/dist/esm/lib/injection-engine/index.d.ts +1 -1
- package/dist/esm/lib/injection-engine/index.js +3 -1
- package/dist/esm/lib/injection-engine/index.js.map +1 -1
- package/dist/esm/lib/injection-engine/skillExamples.d.ts +16 -13
- package/dist/esm/lib/injection-engine/skillExamples.js +16 -60
- package/dist/esm/lib/injection-engine/skillExamples.js.map +1 -1
- package/dist/esm/lib/injection-engine/skillGraph.d.ts +50 -0
- package/dist/esm/lib/injection-engine/skillGraph.js +52 -1
- package/dist/esm/lib/injection-engine/skillGraph.js.map +1 -1
- package/dist/esm/lib/injection-engine/skillGraphCheckup.d.ts +6 -5
- package/dist/esm/lib/injection-engine/skillGraphCheckup.js.map +1 -1
- package/dist/esm/lib/injection-engine/skillNeverRoutes.d.ts +131 -0
- package/dist/esm/lib/injection-engine/skillNeverRoutes.js +228 -0
- package/dist/esm/lib/injection-engine/skillNeverRoutes.js.map +1 -0
- package/dist/esm/lib/injection-engine/skillPartition.d.ts +69 -0
- package/dist/esm/lib/injection-engine/skillPartition.js +273 -0
- package/dist/esm/lib/injection-engine/skillPartition.js.map +1 -0
- package/dist/esm/lib/injection-engine/skillsFromDir.d.ts +83 -3
- package/dist/esm/lib/injection-engine/skillsFromDir.js +118 -7
- package/dist/esm/lib/injection-engine/skillsFromDir.js.map +1 -1
- package/dist/esm/lib/injection-engine/skillsFromDirRoutes.d.ts +105 -0
- package/dist/esm/lib/injection-engine/skillsFromDirRoutes.js +169 -0
- package/dist/esm/lib/injection-engine/skillsFromDirRoutes.js.map +1 -0
- package/dist/esm/lib/injection-engine/startRuleClaim.d.ts +91 -0
- package/dist/esm/lib/injection-engine/startRuleClaim.js +78 -0
- package/dist/esm/lib/injection-engine/startRuleClaim.js.map +1 -0
- package/dist/esm/lib/injection-engine/toolOutcome.d.ts +12 -3
- package/dist/esm/lib/injection-engine/toolOutcome.js +2 -1
- package/dist/esm/lib/injection-engine/toolOutcome.js.map +1 -1
- package/dist/esm/memory/define.js +12 -0
- package/dist/esm/memory/define.js.map +1 -1
- package/dist/esm/memory/define.types.d.ts +27 -0
- package/dist/esm/memory/define.types.js.map +1 -1
- package/dist/esm/strategies/attach.js.map +1 -1
- package/dist/events/registry.js +6 -0
- package/dist/events/registry.js.map +1 -1
- package/dist/hosting/conformance/cases.js +88 -2
- package/dist/hosting/conformance/cases.js.map +1 -1
- package/dist/hosting/errors.js +42 -1
- package/dist/hosting/errors.js.map +1 -1
- package/dist/hosting/index.js +18 -2
- package/dist/hosting/index.js.map +1 -1
- package/dist/hosting/memorySessions.js +39 -0
- package/dist/hosting/memorySessions.js.map +1 -1
- package/dist/hosting/sessionRetention.js +73 -0
- package/dist/hosting/sessionRetention.js.map +1 -0
- package/dist/hosting/sqliteSessions.js +51 -0
- package/dist/hosting/sqliteSessions.js.map +1 -1
- package/dist/hosting/types.js +10 -1
- package/dist/hosting/types.js.map +1 -1
- package/dist/hosting-providers.js +21 -11
- package/dist/hosting-providers.js.map +1 -1
- package/dist/index.js +78 -38
- package/dist/index.js.map +1 -1
- package/dist/lib/context-bisect/arms/apply.js +45 -0
- package/dist/lib/context-bisect/arms/apply.js.map +1 -0
- package/dist/lib/context-bisect/arms/compare.js +116 -0
- package/dist/lib/context-bisect/arms/compare.js.map +1 -0
- package/dist/lib/context-bisect/arms/index.js +35 -0
- package/dist/lib/context-bisect/arms/index.js.map +1 -0
- package/dist/lib/context-bisect/arms/manifest.js +207 -0
- package/dist/lib/context-bisect/arms/manifest.js.map +1 -0
- package/dist/lib/context-bisect/arms/probe.js +132 -0
- package/dist/lib/context-bisect/arms/probe.js.map +1 -0
- package/dist/lib/context-bisect/arms/types.js +68 -0
- package/dist/lib/context-bisect/arms/types.js.map +1 -0
- package/dist/lib/context-bisect/arms/validate.js +128 -0
- package/dist/lib/context-bisect/arms/validate.js.map +1 -0
- package/dist/lib/context-bisect/arms/verdict.js +107 -0
- package/dist/lib/context-bisect/arms/verdict.js.map +1 -0
- package/dist/lib/context-bisect/index.js +23 -1
- package/dist/lib/context-bisect/index.js.map +1 -1
- package/dist/lib/injection-engine/index.js +4 -1
- package/dist/lib/injection-engine/index.js.map +1 -1
- package/dist/lib/injection-engine/skillExamples.js +24 -68
- package/dist/lib/injection-engine/skillExamples.js.map +1 -1
- package/dist/lib/injection-engine/skillGraph.js +52 -1
- package/dist/lib/injection-engine/skillGraph.js.map +1 -1
- package/dist/lib/injection-engine/skillGraphCheckup.js.map +1 -1
- package/dist/lib/injection-engine/skillNeverRoutes.js +234 -0
- package/dist/lib/injection-engine/skillNeverRoutes.js.map +1 -0
- package/dist/lib/injection-engine/skillPartition.js +277 -0
- package/dist/lib/injection-engine/skillPartition.js.map +1 -0
- package/dist/lib/injection-engine/skillsFromDir.js +121 -9
- package/dist/lib/injection-engine/skillsFromDir.js.map +1 -1
- package/dist/lib/injection-engine/skillsFromDirRoutes.js +174 -0
- package/dist/lib/injection-engine/skillsFromDirRoutes.js.map +1 -0
- package/dist/lib/injection-engine/startRuleClaim.js +85 -0
- package/dist/lib/injection-engine/startRuleClaim.js.map +1 -0
- package/dist/lib/injection-engine/toolOutcome.js +2 -1
- package/dist/lib/injection-engine/toolOutcome.js.map +1 -1
- package/dist/memory/define.js +12 -0
- package/dist/memory/define.js.map +1 -1
- package/dist/memory/define.types.js.map +1 -1
- package/dist/strategies/attach.js.map +1 -1
- package/dist/types/adapters/hosting/agentcore.d.ts +8 -0
- package/dist/types/adapters/hosting/agentcore.d.ts.map +1 -1
- package/dist/types/adapters/hosting/firestoreSessions.d.ts +162 -14
- package/dist/types/adapters/hosting/firestoreSessions.d.ts.map +1 -1
- package/dist/types/adapters/hosting/googleAgentEngine.d.ts +16 -1
- package/dist/types/adapters/hosting/googleAgentEngine.d.ts.map +1 -1
- package/dist/types/adapters/memory/agentcore.d.ts.map +1 -1
- package/dist/types/artifacts/conformance/cases.d.ts +24 -0
- package/dist/types/artifacts/conformance/cases.d.ts.map +1 -0
- package/dist/types/artifacts/conformance/index.d.ts +12 -0
- package/dist/types/artifacts/conformance/index.d.ts.map +1 -0
- package/dist/types/artifacts/conformance/run.d.ts +48 -0
- package/dist/types/artifacts/conformance/run.d.ts.map +1 -0
- package/dist/types/artifacts/conformance/types.d.ts +198 -0
- package/dist/types/artifacts/conformance/types.d.ts.map +1 -0
- package/dist/types/artifacts/index.d.ts +1 -0
- package/dist/types/artifacts/index.d.ts.map +1 -1
- package/dist/types/core/Agent.d.ts +34 -1
- package/dist/types/core/Agent.d.ts.map +1 -1
- package/dist/types/core/agent/AgentBuilder.d.ts +43 -0
- package/dist/types/core/agent/AgentBuilder.d.ts.map +1 -1
- package/dist/types/core/agent/buildAgentChart.d.ts +9 -0
- package/dist/types/core/agent/buildAgentChart.d.ts.map +1 -1
- package/dist/types/core/agent/buildDynamicAgentChart.d.ts.map +1 -1
- package/dist/types/core/agent/coverage/absent.d.ts +105 -0
- package/dist/types/core/agent/coverage/absent.d.ts.map +1 -0
- package/dist/types/core/agent/coverage/answer.d.ts +47 -0
- package/dist/types/core/agent/coverage/answer.d.ts.map +1 -0
- package/dist/types/core/agent/coverage/evidence.d.ts +69 -0
- package/dist/types/core/agent/coverage/evidence.d.ts.map +1 -0
- package/dist/types/core/agent/coverage/index.d.ts +18 -0
- package/dist/types/core/agent/coverage/index.d.ts.map +1 -0
- package/dist/types/core/agent/coverage/items.d.ts +36 -0
- package/dist/types/core/agent/coverage/items.d.ts.map +1 -0
- package/dist/types/core/agent/coverage/ledger.d.ts +81 -0
- package/dist/types/core/agent/coverage/ledger.d.ts.map +1 -0
- package/dist/types/core/agent/coverage/read.d.ts +52 -0
- package/dist/types/core/agent/coverage/read.d.ts.map +1 -0
- package/dist/types/core/agent/coverage/types.d.ts +143 -0
- package/dist/types/core/agent/coverage/types.d.ts.map +1 -0
- package/dist/types/core/agent/evidence/evidenceIndex.d.ts +7 -0
- package/dist/types/core/agent/evidence/evidenceIndex.d.ts.map +1 -1
- package/dist/types/core/agent/runManifest.d.ts +81 -0
- package/dist/types/core/agent/runManifest.d.ts.map +1 -0
- package/dist/types/core/agent/stages/prepareFinal.d.ts +18 -0
- package/dist/types/core/agent/stages/prepareFinal.d.ts.map +1 -1
- package/dist/types/core/agent/stages/toolCalls.d.ts.map +1 -1
- package/dist/types/core/agent/toolEffects.d.ts +2 -2
- package/dist/types/core/agent/types.d.ts +14 -0
- package/dist/types/core/agent/types.d.ts.map +1 -1
- package/dist/types/debug.d.ts +1 -0
- package/dist/types/debug.d.ts.map +1 -1
- package/dist/types/events/payloads.d.ts +205 -0
- package/dist/types/events/payloads.d.ts.map +1 -1
- package/dist/types/events/registry.d.ts +7 -1
- package/dist/types/events/registry.d.ts.map +1 -1
- package/dist/types/hosting/conformance/cases.d.ts +2 -1
- package/dist/types/hosting/conformance/cases.d.ts.map +1 -1
- package/dist/types/hosting/conformance/types.d.ts +7 -7
- package/dist/types/hosting/conformance/types.d.ts.map +1 -1
- package/dist/types/hosting/errors.d.ts +28 -0
- package/dist/types/hosting/errors.d.ts.map +1 -1
- package/dist/types/hosting/index.d.ts +11 -3
- package/dist/types/hosting/index.d.ts.map +1 -1
- package/dist/types/hosting/memorySessions.d.ts.map +1 -1
- package/dist/types/hosting/sessionRetention.d.ts +57 -0
- package/dist/types/hosting/sessionRetention.d.ts.map +1 -0
- package/dist/types/hosting/sqliteSessions.d.ts +11 -1
- package/dist/types/hosting/sqliteSessions.d.ts.map +1 -1
- package/dist/types/hosting/types.d.ts +184 -0
- package/dist/types/hosting/types.d.ts.map +1 -1
- package/dist/types/hosting-providers.d.ts +15 -11
- package/dist/types/hosting-providers.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/lib/context-bisect/arms/apply.d.ts +55 -0
- package/dist/types/lib/context-bisect/arms/apply.d.ts.map +1 -0
- package/dist/types/lib/context-bisect/arms/compare.d.ts +28 -0
- package/dist/types/lib/context-bisect/arms/compare.d.ts.map +1 -0
- package/dist/types/lib/context-bisect/arms/index.d.ts +17 -0
- package/dist/types/lib/context-bisect/arms/index.d.ts.map +1 -0
- package/dist/types/lib/context-bisect/arms/manifest.d.ts +80 -0
- package/dist/types/lib/context-bisect/arms/manifest.d.ts.map +1 -0
- package/dist/types/lib/context-bisect/arms/probe.d.ts +55 -0
- package/dist/types/lib/context-bisect/arms/probe.d.ts.map +1 -0
- package/dist/types/lib/context-bisect/arms/types.d.ts +320 -0
- package/dist/types/lib/context-bisect/arms/types.d.ts.map +1 -0
- package/dist/types/lib/context-bisect/arms/validate.d.ts +27 -0
- package/dist/types/lib/context-bisect/arms/validate.d.ts.map +1 -0
- package/dist/types/lib/context-bisect/arms/verdict.d.ts +54 -0
- package/dist/types/lib/context-bisect/arms/verdict.d.ts.map +1 -0
- package/dist/types/lib/context-bisect/index.d.ts +1 -0
- package/dist/types/lib/context-bisect/index.d.ts.map +1 -1
- package/dist/types/lib/injection-engine/index.d.ts +1 -1
- package/dist/types/lib/injection-engine/index.d.ts.map +1 -1
- package/dist/types/lib/injection-engine/skillExamples.d.ts +16 -13
- package/dist/types/lib/injection-engine/skillExamples.d.ts.map +1 -1
- package/dist/types/lib/injection-engine/skillGraph.d.ts +50 -0
- package/dist/types/lib/injection-engine/skillGraph.d.ts.map +1 -1
- package/dist/types/lib/injection-engine/skillGraphCheckup.d.ts +6 -5
- package/dist/types/lib/injection-engine/skillGraphCheckup.d.ts.map +1 -1
- package/dist/types/lib/injection-engine/skillNeverRoutes.d.ts +132 -0
- package/dist/types/lib/injection-engine/skillNeverRoutes.d.ts.map +1 -0
- package/dist/types/lib/injection-engine/skillPartition.d.ts +70 -0
- package/dist/types/lib/injection-engine/skillPartition.d.ts.map +1 -0
- package/dist/types/lib/injection-engine/skillsFromDir.d.ts +83 -3
- package/dist/types/lib/injection-engine/skillsFromDir.d.ts.map +1 -1
- package/dist/types/lib/injection-engine/skillsFromDirRoutes.d.ts +106 -0
- package/dist/types/lib/injection-engine/skillsFromDirRoutes.d.ts.map +1 -0
- package/dist/types/lib/injection-engine/startRuleClaim.d.ts +92 -0
- package/dist/types/lib/injection-engine/startRuleClaim.d.ts.map +1 -0
- package/dist/types/lib/injection-engine/toolOutcome.d.ts +12 -3
- package/dist/types/lib/injection-engine/toolOutcome.d.ts.map +1 -1
- package/dist/types/memory/define.d.ts.map +1 -1
- package/dist/types/memory/define.types.d.ts +27 -0
- package/dist/types/memory/define.types.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* ledger — what a clean result does NOT rule out.
|
|
4
|
+
*
|
|
5
|
+
* Pattern: a wrapper the framework recognizes, minted by a helper (the
|
|
6
|
+
* `absent()` shape one level up: same vocabulary, different claim).
|
|
7
|
+
* Role: core/ layer, pure. `coverage()` is what a tool author writes;
|
|
8
|
+
* `readCoverageLedger` is what the dispatch loop calls.
|
|
9
|
+
* Emits: N/A (the caller emits `agentfootprint.tools.coverage_declared`).
|
|
10
|
+
*
|
|
11
|
+
* ## The problem, stated as narrowly as it deserves
|
|
12
|
+
*
|
|
13
|
+
* An agent answers confidently from partial coverage. "Everything looks fine"
|
|
14
|
+
* is produced from four checks that passed, and arrives with no way to tell
|
|
15
|
+
* whether *fine* means **verified** or **unexamined** — whether the fifth
|
|
16
|
+
* thing was healthy or was never looked at. The evidence gate (9.35.0) is the
|
|
17
|
+
* sibling of this: the gate catches invented VALUES, this catches unstated
|
|
18
|
+
* LIMITS. Both are ways an answer can be false while every token in it is
|
|
19
|
+
* real.
|
|
20
|
+
*
|
|
21
|
+
* A ledger is not a caveat and not a disclaimer. It is three lists the TOOL
|
|
22
|
+
* knows and the model does not: what it checked, what it did not check, and
|
|
23
|
+
* what it can never cover. Only the tool knows the third one, which is why
|
|
24
|
+
* this cannot be prompt engineering.
|
|
25
|
+
*
|
|
26
|
+
* ## Why the wrapper, and not a field on the result
|
|
27
|
+
*
|
|
28
|
+
* The alternative — teaching the framework to read a `coverage` key off any
|
|
29
|
+
* returned object — would make every domain object that happens to have one
|
|
30
|
+
* change behavior. The wrapper is opt-in by construction: `coverage(x, …)`
|
|
31
|
+
* produces a shape that did not exist before, so nothing that ever ran can
|
|
32
|
+
* become a ledger by accident. Same argument as the effects envelope's strict
|
|
33
|
+
* recognizer, same guarantee.
|
|
34
|
+
*/
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.coverageOfLedger = exports.readCoverageLedger = exports.coverage = exports.COVERAGE_NOTE = exports.COVERAGE_MARKER = void 0;
|
|
37
|
+
const items_js_1 = require("./items.js");
|
|
38
|
+
/** The reserved key that makes a ledger recognizable. */
|
|
39
|
+
exports.COVERAGE_MARKER = 'af_coverage';
|
|
40
|
+
/**
|
|
41
|
+
* The static sentence every ledger carries. The last clause is the OFFER half
|
|
42
|
+
* of survival — the model is told to carry the limits into its answer. The
|
|
43
|
+
* ENFORCEMENT half (`.limitsTravelWithTheAnswer()`) does not depend on the
|
|
44
|
+
* model obeying it; see `answer.ts` for why both exist.
|
|
45
|
+
*/
|
|
46
|
+
exports.COVERAGE_NOTE = 'This result covers only what `checked` lists. `not_checked` is ground this call did not ' +
|
|
47
|
+
'look at, and `cannot_cover` is ground this tool can never see — a clean result here is ' +
|
|
48
|
+
'NOT evidence about either, and no retry changes `cannot_cover`. Carry these limits into ' +
|
|
49
|
+
'any answer you build on this result.';
|
|
50
|
+
/**
|
|
51
|
+
* Return a verdict with its own boundary attached.
|
|
52
|
+
*
|
|
53
|
+
* The model reads `{ af_coverage: {…}, result: <your value> }` — boundary
|
|
54
|
+
* first, deliberately: a limit placed after a long result is a limit that gets
|
|
55
|
+
* skimmed past. The framework records the ledger and, with
|
|
56
|
+
* `.limitsTravelWithTheAnswer()` configured, appends it to the run's final
|
|
57
|
+
* answer where the model cannot drop it.
|
|
58
|
+
*
|
|
59
|
+
* @example the highest-stakes tool in a triage agent
|
|
60
|
+
* defineTool({
|
|
61
|
+
* name: 'replication_health',
|
|
62
|
+
* description: 'Replication health across the estate',
|
|
63
|
+
* inputSchema: { type: 'object', properties: {} },
|
|
64
|
+
* execute: async () => {
|
|
65
|
+
* const { verdict, ndmTimedOut } = await checkReplication();
|
|
66
|
+
* return coverage(verdict, {
|
|
67
|
+
* checked: ['SRDF pair state on all 4 arrays (live query)'],
|
|
68
|
+
* notChecked: ndmTimedOut
|
|
69
|
+
* ? [{ what: 'NDM migration sessions', why: 'the API timed out — ask again' }]
|
|
70
|
+
* : [],
|
|
71
|
+
* cannotCover: [
|
|
72
|
+
* { what: 'host-side multipathing', why: 'no collector runs on the ESX hosts' },
|
|
73
|
+
* ],
|
|
74
|
+
* });
|
|
75
|
+
* },
|
|
76
|
+
* });
|
|
77
|
+
*/
|
|
78
|
+
function coverage(content, decl) {
|
|
79
|
+
const fn = 'coverage';
|
|
80
|
+
if (typeof decl !== 'object' || decl === null) {
|
|
81
|
+
throw new Error(`${fn}: takes the result and its boundary — coverage(result, { checked?, notChecked?, ` +
|
|
82
|
+
`cannotCover? }). To return a result with no declared boundary, return it bare.`);
|
|
83
|
+
}
|
|
84
|
+
const checked = (0, items_js_1.normalizeCoverageList)(fn, 'checked', decl.checked, false);
|
|
85
|
+
const notChecked = (0, items_js_1.normalizeCoverageList)(fn, 'notChecked', decl.notChecked, false);
|
|
86
|
+
const cannotCover = (0, items_js_1.normalizeCoverageList)(fn, 'cannotCover', decl.cannotCover, true);
|
|
87
|
+
if (checked.length === 0 && notChecked.length === 0 && cannotCover.length === 0) {
|
|
88
|
+
throw new Error(`${fn}: all three lists are empty, so this ledger declares no boundary at all — it ` +
|
|
89
|
+
`would tell a reader nothing while looking like it did, which is worse than saying ` +
|
|
90
|
+
`nothing. Name what you checked, what you skipped, or what you can never see; or ` +
|
|
91
|
+
`return the result bare.`);
|
|
92
|
+
}
|
|
93
|
+
return {
|
|
94
|
+
af_coverage: {
|
|
95
|
+
...(checked.length > 0 && { checked }),
|
|
96
|
+
...(notChecked.length > 0 && { not_checked: notChecked }),
|
|
97
|
+
...(cannotCover.length > 0 && { cannot_cover: cannotCover }),
|
|
98
|
+
note: exports.COVERAGE_NOTE,
|
|
99
|
+
},
|
|
100
|
+
result: content,
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
exports.coverage = coverage;
|
|
104
|
+
/**
|
|
105
|
+
* Recognize (or decline to recognize) a value as a covered result. STRICT for
|
|
106
|
+
* the same reason `readAbsence` is: only a plain object carrying a plain
|
|
107
|
+
* `af_coverage` object AND a `result` key qualifies.
|
|
108
|
+
*/
|
|
109
|
+
function readCoverageLedger(value) {
|
|
110
|
+
if (typeof value !== 'object' || value === null || Array.isArray(value))
|
|
111
|
+
return undefined;
|
|
112
|
+
const rec = value;
|
|
113
|
+
const marker = rec[exports.COVERAGE_MARKER];
|
|
114
|
+
if (typeof marker !== 'object' || marker === null || Array.isArray(marker))
|
|
115
|
+
return undefined;
|
|
116
|
+
if (!('result' in rec))
|
|
117
|
+
return undefined;
|
|
118
|
+
return value;
|
|
119
|
+
}
|
|
120
|
+
exports.readCoverageLedger = readCoverageLedger;
|
|
121
|
+
/** The ledger's coverage, in the normalized three-list shape. */
|
|
122
|
+
function coverageOfLedger(covered) {
|
|
123
|
+
const m = covered.af_coverage;
|
|
124
|
+
return {
|
|
125
|
+
checked: m.checked ?? [],
|
|
126
|
+
notChecked: m.not_checked ?? [],
|
|
127
|
+
cannotCover: m.cannot_cover ?? [],
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
exports.coverageOfLedger = coverageOfLedger;
|
|
131
|
+
//# sourceMappingURL=ledger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ledger.js","sourceRoot":"","sources":["../../../../src/core/agent/coverage/ledger.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;;;AAEH,yCAAmD;AAGnD,yDAAyD;AAC5C,QAAA,eAAe,GAAG,aAAa,CAAC;AAE7C;;;;;GAKG;AACU,QAAA,aAAa,GACxB,0FAA0F;IAC1F,yFAAyF;IACzF,0FAA0F;IAC1F,sCAAsC,CAAC;AAEzC;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,SAAgB,QAAQ,CAAI,OAAU,EAAE,IAAyB;IAC/D,MAAM,EAAE,GAAG,UAAU,CAAC;IACtB,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;QAC9C,MAAM,IAAI,KAAK,CACb,GAAG,EAAE,kFAAkF;YACrF,gFAAgF,CACnF,CAAC;IACJ,CAAC;IACD,MAAM,OAAO,GAAG,IAAA,gCAAqB,EAAC,EAAE,EAAE,SAAS,EAAE,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAC1E,MAAM,UAAU,GAAG,IAAA,gCAAqB,EAAC,EAAE,EAAE,YAAY,EAAE,IAAI,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;IACnF,MAAM,WAAW,GAAG,IAAA,gCAAqB,EAAC,EAAE,EAAE,aAAa,EAAE,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;IACrF,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAChF,MAAM,IAAI,KAAK,CACb,G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,IAAI,EAAE;KAClC,CAAC;AACJ,CAAC;AAPD,4CAOC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* read — the ONE recognizer the tool-dispatch loop calls.
|
|
4
|
+
*
|
|
5
|
+
* Pattern: one reader, every dispatch door (the `applyResultCeiling`
|
|
6
|
+
* precedent). The batch loop and the credential/resume execute
|
|
7
|
+
* boundary both call this at the moment a handler's return lands, so
|
|
8
|
+
* a resumed call declares its coverage exactly as an inline one.
|
|
9
|
+
* Role: core/ layer, pure. Recognition and normalization only — the caller
|
|
10
|
+
* owns the events, the scope write and the delivered status.
|
|
11
|
+
* Emits: N/A.
|
|
12
|
+
*
|
|
13
|
+
* Zero-cost when unused: two `typeof` checks and a key lookup for every
|
|
14
|
+
* result that is neither shape, and `undefined` back. Nothing is emitted,
|
|
15
|
+
* nothing is written, and the value the model reads is the value the tool
|
|
16
|
+
* returned — byte for byte.
|
|
17
|
+
*/
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
exports.readCoverageResult = void 0;
|
|
20
|
+
const absent_js_1 = require("./absent.js");
|
|
21
|
+
const ledger_js_1 = require("./ledger.js");
|
|
22
|
+
const ABSENT_STATUS = 'absent';
|
|
23
|
+
/**
|
|
24
|
+
* Read one finalized tool result for coverage declarations.
|
|
25
|
+
*
|
|
26
|
+
* The two shapes compose: `coverage(absent({…}), {…})` is a search that found
|
|
27
|
+
* nothing AND a boundary around the search, so both are declared and the
|
|
28
|
+
* delivered status is still `'absent'` — the ledger bounds the answer, it
|
|
29
|
+
* does not change what the answer was.
|
|
30
|
+
*/
|
|
31
|
+
function readCoverageResult(value) {
|
|
32
|
+
const absence = (0, absent_js_1.readAbsence)(value);
|
|
33
|
+
if (absence !== undefined) {
|
|
34
|
+
return {
|
|
35
|
+
status: ABSENT_STATUS,
|
|
36
|
+
declared: [
|
|
37
|
+
{ kind: 'absence', coverage: (0, absent_js_1.coverageOfAbsence)(absence), lookedFor: absence.looked_for },
|
|
38
|
+
],
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
const covered = (0, ledger_js_1.readCoverageLedger)(value);
|
|
42
|
+
if (covered === undefined)
|
|
43
|
+
return undefined;
|
|
44
|
+
const declared = [{ kind: 'ledger', coverage: (0, ledger_js_1.coverageOfLedger)(covered) }];
|
|
45
|
+
const inner = (0, absent_js_1.readAbsence)(covered.result);
|
|
46
|
+
if (inner === undefined)
|
|
47
|
+
return { declared };
|
|
48
|
+
declared.push({
|
|
49
|
+
kind: 'absence',
|
|
50
|
+
coverage: (0, absent_js_1.coverageOfAbsence)(inner),
|
|
51
|
+
lookedFor: inner.looked_for,
|
|
52
|
+
});
|
|
53
|
+
return { status: ABSENT_STATUS, declared };
|
|
54
|
+
}
|
|
55
|
+
exports.readCoverageResult = readCoverageResult;
|
|
56
|
+
//# sourceMappingURL=read.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read.js","sourceRoot":"","sources":["../../../../src/core/agent/coverage/read.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;AAGH,2CAA6D;AAC7D,2CAAmE;AA6BnE,MAAM,aAAa,GAAqB,QAAQ,CAAC;AAEjD;;;;;;;GAOG;AACH,SAAgB,kBAAkB,CAAC,KAAc;IAC/C,MAAM,OAAO,GAAG,IAAA,uBAAW,EAAC,KAAK,CAAC,CAAC;IACnC,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC1B,OAAO;YACL,MAAM,EAAE,aAAa;YACrB,QAAQ,EAAE;gBACR,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAA,6BAAiB,EAAC,OAAO,CAAC,EAAE,SAAS,EAAE,OAAO,CAAC,UAAU,EAAE;aACzF;SACF,CAAC;IACJ,CAAC;IACD,MAAM,OAAO,GAAG,IAAA,8BAAkB,EAAC,KAAK,CAAC,CAAC;IAC1C,IAAI,OAAO,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC5C,MAAM,QAAQ,GAAoB,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAA,4BAAgB,EAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAC5F,MAAM,KAAK,GAAG,IAAA,uBAAW,EAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAC1C,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;IAC7C,QAAQ,CAAC,IAAI,CAAC;QACZ,IAAI,EAAE,SAAS;QACf,QAAQ,EAAE,IAAA,6BAAiB,EAAC,KAAK,CAAC;QAClC,SAAS,EAAE,KAAK,CAAC,UAAU;KAC5B,CAAC,CAAC;IACH,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,CAAC;AAC7C,CAAC;AArBD,gDAqBC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* coverage/types — the shared vocabulary of the two coverage primitives.
|
|
4
|
+
*
|
|
5
|
+
* Pattern: one value type, two consumers — `absent()` says "I looked HERE and
|
|
6
|
+
* found nothing", `coverage()` says "my answer covers THIS and not
|
|
7
|
+
* THAT". Both are statements about the same thing: the ground a
|
|
8
|
+
* result stands on. Spelling them with one vocabulary is what lets
|
|
9
|
+
* the answer-level block merge an absence's boundary with a
|
|
10
|
+
* verdict's without translating between two grammars.
|
|
11
|
+
* Role: core/ layer, pure data. No imports, no behavior.
|
|
12
|
+
* Emits: N/A.
|
|
13
|
+
*/
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/core/agent/coverage/types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG"}
|
|
@@ -27,6 +27,13 @@
|
|
|
27
27
|
* value because the model passed it to a tool would let any invention
|
|
28
28
|
* launder itself through one failed lookup.
|
|
29
29
|
* • **The model's own earlier answers do not count**, for the same reason.
|
|
30
|
+
* • **An `absent(…)` result grounds its COVERAGE only.** An absence names
|
|
31
|
+
* what was looked FOR, which in practice quotes the arguments the model
|
|
32
|
+
* passed — so indexing the whole frame would ground an invented
|
|
33
|
+
* identifier through the one operation that proves nothing about it: a
|
|
34
|
+
* lookup that found nothing. `checked` / `not_checked` / `cannot_cover`
|
|
35
|
+
* are the tool's own words about the world and do count. See
|
|
36
|
+
* `../coverage/evidence.ts`.
|
|
30
37
|
*
|
|
31
38
|
* The EXEMPT index is built from a different corpus with the same machinery:
|
|
32
39
|
* the user's own message, the conversation's user/system turns, and the
|
|
@@ -36,6 +43,7 @@
|
|
|
36
43
|
*/
|
|
37
44
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
45
|
exports.exemptFromRun = exports.evidenceFromHistory = void 0;
|
|
46
|
+
const index_js_1 = require("../coverage/index.js");
|
|
39
47
|
const frames_js_1 = require("./frames.js");
|
|
40
48
|
const normalize_js_1 = require("./normalize.js");
|
|
41
49
|
/**
|
|
@@ -96,7 +104,16 @@ function indexResult(content, sink) {
|
|
|
96
104
|
const trimmed = content.trim();
|
|
97
105
|
if (trimmed.startsWith('{') || trimmed.startsWith('[')) {
|
|
98
106
|
try {
|
|
99
|
-
|
|
107
|
+
const parsed = JSON.parse(trimmed);
|
|
108
|
+
// An `absent(…)` frame grounds its COVERAGE and nothing else: the rest
|
|
109
|
+
// of it is prose about the REQUEST, which usually quotes the model's own
|
|
110
|
+
// arguments, and indexing that would ground every identifier a model
|
|
111
|
+
// invented as long as it handed the invention to one tool that found
|
|
112
|
+
// nothing. See `../coverage/evidence.ts` — it is the frames.ts argument
|
|
113
|
+
// on the tool side of the conversation. `undefined` (every other result
|
|
114
|
+
// ever returned) keeps the walk it always had.
|
|
115
|
+
const projection = (0, index_js_1.absenceEvidenceProjection)(parsed);
|
|
116
|
+
walk(projection ?? parsed, sink);
|
|
100
117
|
return;
|
|
101
118
|
}
|
|
102
119
|
catch {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evidenceIndex.js","sourceRoot":"","sources":["../../../../src/core/agent/evidence/evidenceIndex.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"evidenceIndex.js","sourceRoot":"","sources":["../../../../src/core/agent/evidence/evidenceIndex.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;;;AAIH,mDAAiE;AACjE,2CAAoD;AACpD,iDAAuE;AAEvE;;;;GAIG;AACH,MAAM,gBAAgB,GAAG,OAAO,CAAC;AAoBjC,SAAS,GAAG,CAAC,IAAU,EAAE,GAAW;IAClC,MAAM,IAAI,GAAG,IAAA,6BAAc,EAAC,GAAG,CAAC,CAAC;IACjC,IAAI,IAAI,KAAK,EAAE;QAAE,OAAO;IACxB,KAAK,MAAM,IAAI,IAAI,IAAA,0BAAW,EAAC,IAAI,CAAC,EAAE,CAAC;QACrC,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC;YAAE,OAAO;QAC7B,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC;YAAE,SAAS;QACpC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACtB,IAAI,CAAC,MAAM,IAAI,CAAC,CAAC;IACnB,CAAC;AACH,CAAC;AAED,SAAS,OAAO,CAAC,IAAU,EAAE,IAAY;IACvC,KAAK,MAAM,KAAK,IAAI,IAAA,uBAAQ,EAAC,IAAI,CAAC,EAAE,CAAC;QACnC,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC;YAAE,OAAO;QAC7B,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACnB,CAAC;AACH,CAAC;AAED,0DAA0D;AAC1D,SAAS,IAAI,CAAC,IAAa,EAAE,IAAU;IACrC,IAAI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IAAI,KAAK,QAAQ;YAAE,SAAS;QAC3D,sEAAsE;QACtE,yEAAyE;QACzE,wEAAwE;QACxE,6BAA6B;QAC7B,IAAI,IAAA,iCAAqB,EAAC,GAAG,CAAC,OAAO,CAAC;YAAE,SAAS;QACjD,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;IAC7B,CAAC;IACD,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,sBAAsB,IAAI,EAAE,EAAE,CAAC;QACpD,IAAI,GAAG,CAAC,UAAU;YAAE,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,UAAU,CAAC,CAAC;QAClD,wEAAwE;QACxE,wEAAwE;QACxE,iCAAiC;aAC5B,IAAI,GAAG,CAAC,cAAc;YAAE,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;IACjE,CAAC;IACD,OAAO,IAAI,CAAC,MAAM,CAAC;AACrB,CAAC;AAxBD,sCAwBC"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* runManifest — the run-configuration manifest, composed.
|
|
4
|
+
*
|
|
5
|
+
* Pattern: Pure builder over already-resolved configuration.
|
|
6
|
+
* Role: Turn what an Agent HOLDS into what `agentfootprint.agent.run_configured`
|
|
7
|
+
* SAYS. Kept out of Agent.ts so the rule that governs it — names only,
|
|
8
|
+
* absence never guessed — is testable without building an agent, and
|
|
9
|
+
* so the one place that decides what may leave the process is one
|
|
10
|
+
* small file rather than a paragraph inside a 3,000-line class.
|
|
11
|
+
* Emits: N/A — the Agent dispatches what this returns.
|
|
12
|
+
*
|
|
13
|
+
* ## The rule this file exists to keep
|
|
14
|
+
*
|
|
15
|
+
* The manifest carries NAMES AND IDS ONLY. Not endpoints, not directories, not
|
|
16
|
+
* connection strings, not keys, not tenants, not principals — and not a config
|
|
17
|
+
* VALUE that could be any of those. It rides into every recording, every vendor
|
|
18
|
+
* sink and every shared trace, which is exactly where a secret must not go.
|
|
19
|
+
*
|
|
20
|
+
* That rule is why this file takes an already-narrowed input rather than the
|
|
21
|
+
* Agent: nothing here can reach a store's options bag even by accident, because
|
|
22
|
+
* a store is never passed in. Where the only handle on a component is a value
|
|
23
|
+
* (a directory, a URL, a table name), the component is reported as PRESENT and
|
|
24
|
+
* left unnamed — {@link RunManifestSources.artifacts} is the shape of that
|
|
25
|
+
* answer. A field the configuration did not declare is ABSENT: "the strategy
|
|
26
|
+
* did not say" and "the default" are different facts, and only the first one is
|
|
27
|
+
* true here.
|
|
28
|
+
*/
|
|
29
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
+
exports.buildRunManifest = void 0;
|
|
31
|
+
/**
|
|
32
|
+
* Compose the manifest. Pure: same input, same payload, no clock, no ids
|
|
33
|
+
* minted here (the runId the arms are grouped by is already on `meta`).
|
|
34
|
+
*/
|
|
35
|
+
function buildRunManifest(sources) {
|
|
36
|
+
// Who may replace the model mid-run. Built as a list of NAMES rather than a
|
|
37
|
+
// boolean so a reader knows which mechanism to go look at, and left absent
|
|
38
|
+
// when nobody can — that absence is the strong statement: `model` is then
|
|
39
|
+
// what every call of this run used, and an arm can be grouped on it alone.
|
|
40
|
+
const modelOverrides = [];
|
|
41
|
+
if (sources.hasRunConfig)
|
|
42
|
+
modelOverrides.push('configure');
|
|
43
|
+
if (sources.hasSkillBrains)
|
|
44
|
+
modelOverrides.push('skill-brains');
|
|
45
|
+
const artifacts = sources.artifacts;
|
|
46
|
+
return {
|
|
47
|
+
agentId: sources.agentId,
|
|
48
|
+
llm: {
|
|
49
|
+
provider: sources.providerName,
|
|
50
|
+
model: sources.model,
|
|
51
|
+
...(modelOverrides.length > 0 && { modelOverrides }),
|
|
52
|
+
},
|
|
53
|
+
reactMode: sources.reactMode,
|
|
54
|
+
// `[]` rather than an omitted field: "no memory is mounted" is an arm, and
|
|
55
|
+
// a consumer grouping on retrieval strategy must be able to tell it from a
|
|
56
|
+
// manifest that forgot to look.
|
|
57
|
+
memories: sources.memories.map(describeMemory),
|
|
58
|
+
...(sources.windowStrategyName !== undefined && { window: sources.windowStrategyName }),
|
|
59
|
+
...(sources.skillGraph !== undefined && {
|
|
60
|
+
skillGraph: {
|
|
61
|
+
...(sources.skillGraph.routing !== undefined && { routing: sources.skillGraph.routing }),
|
|
62
|
+
...(sources.skillGraph.continuity !== undefined && {
|
|
63
|
+
continuity: sources.skillGraph.continuity,
|
|
64
|
+
}),
|
|
65
|
+
...(sources.skillGraph.scorerName !== undefined && {
|
|
66
|
+
scorer: sources.skillGraph.scorerName,
|
|
67
|
+
}),
|
|
68
|
+
},
|
|
69
|
+
}),
|
|
70
|
+
...(sources.evidenceGatePosture !== undefined && {
|
|
71
|
+
evidenceGate: sources.evidenceGatePosture,
|
|
72
|
+
}),
|
|
73
|
+
// Only the TRUE dials are written. `placement: false` would be noise on
|
|
74
|
+
// every artifact-configured agent; the object's presence already says a
|
|
75
|
+
// store is wired.
|
|
76
|
+
...(artifacts !== undefined && {
|
|
77
|
+
artifacts: {
|
|
78
|
+
...(artifacts.placement && { placement: true }),
|
|
79
|
+
...(artifacts.recordings && { recordings: true }),
|
|
80
|
+
},
|
|
81
|
+
}),
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
exports.buildRunManifest = buildRunManifest;
|
|
85
|
+
/**
|
|
86
|
+
* One memory row — only the names the definition DECLARED.
|
|
87
|
+
*
|
|
88
|
+
* `store` is never described: `MemoryStore` has no id and no kind, and a class
|
|
89
|
+
* name is a label no bundler promises to keep. An arm grouped on an invented
|
|
90
|
+
* label is an arm that silently regroups itself on the next build.
|
|
91
|
+
*/
|
|
92
|
+
function describeMemory(def) {
|
|
93
|
+
return {
|
|
94
|
+
id: def.id,
|
|
95
|
+
type: def.type,
|
|
96
|
+
...(def.strategy !== undefined && { strategy: def.strategy }),
|
|
97
|
+
...(def.retrieval !== undefined && { retrieval: def.retrieval }),
|
|
98
|
+
...(def.embedderId !== undefined && { embedderId: def.embedderId }),
|
|
99
|
+
...(def.flavor !== undefined && { flavor: def.flavor }),
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=runManifest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runManifest.js","sourceRoot":"","sources":["../../../src/core/agent/runManifest.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;;;AAuDH;;;GAGG;AACH,SAAgB,gBAAgB,CAAC,OAA2B;IAC1D,4EAA4E;IAC5E,2EAA2E;IAC3E,0EAA0E;IAC1E,2EAA2E;IAC3E,MAAM,cAAc,GAAqC,EAAE,CAAC;IAC5D,IAAI,OAAO,CAAC,YAAY;QAAE,cAAc,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAC3D,IAAI,OAAO,CAAC,cAAc;QAAE,cAAc,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IAEhE,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;IAEpC,OAAO;QACL,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,GAAG,EAAE;YACH,QAAQ,EAAE,OAAO,CAAC,YAAY;YAC9B,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,GAAG,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,cAAc,EAAE,CAAC;SACrD;QACD,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,2EAA2E;QAC3E,2EAA2E;QAC3E,gCAAgC;QAChC,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,cAAc,CAAC;QAC9C,GAAG,CAAC,OAAO,CAAC,kBAAkB,KAAK,SAAS,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,kBAAkB,EAAE,CAAC;QACvF,GAAG,CAAC,OAAO,CAAC,UAAU,KAAK,SAAS,IAAI;YACtC,UAAU,EAAE;gBACV,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,KAAK,SA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AG,CAAC,MAAM,KAAK,SAAS,IAAI,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC;KACxD,CAAC;AACJ,CAAC"}
|
|
@@ -26,11 +26,24 @@
|
|
|
26
26
|
* `stages/route.ts`.
|
|
27
27
|
*/
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.prepareFinalStage = void 0;
|
|
29
|
+
exports.prepareFinalWithLimitsStage = exports.prepareFinalStage = void 0;
|
|
30
30
|
const typedEmit_js_1 = require("../../../recorders/core/typedEmit.js");
|
|
31
|
-
const
|
|
31
|
+
const index_js_1 = require("../coverage/index.js");
|
|
32
|
+
/**
|
|
33
|
+
* The stage body, with the answer passed IN.
|
|
34
|
+
*
|
|
35
|
+
* One body, two entry points. The answer is a parameter rather than a read of
|
|
36
|
+
* `scope.llmLatestContent` because `.limitsTravelWithTheAnswer()` composes a
|
|
37
|
+
* different one — and everything filed here (`finalContent`, `newMessages`,
|
|
38
|
+
* which memory persists, and `turn_end.finalContent`) must agree about what
|
|
39
|
+
* the answer WAS. Note that `llmLatestContent` itself is a READ-ONLY input to
|
|
40
|
+
* this branch subflow, so there is no version of this where the composed
|
|
41
|
+
* answer is written back over it: the capture is the only place all four
|
|
42
|
+
* readers meet.
|
|
43
|
+
*/
|
|
44
|
+
const captureTurnPayload = (scope, answer) => {
|
|
32
45
|
const iteration = scope.iteration;
|
|
33
|
-
scope.finalContent =
|
|
46
|
+
scope.finalContent = answer;
|
|
34
47
|
// v2.14 — attach thinking blocks to the assistant final message
|
|
35
48
|
// (if any). For non-Anthropic providers this is informational; for
|
|
36
49
|
// Anthropic + extended-thinking-with-tool-use, signature round-trip
|
|
@@ -62,5 +75,33 @@ const prepareFinalStage = (scope) => {
|
|
|
62
75
|
durationMs: Date.now() - scope.turnStartMs,
|
|
63
76
|
});
|
|
64
77
|
};
|
|
78
|
+
const prepareFinalStage = (scope) => {
|
|
79
|
+
captureTurnPayload(scope, scope.llmLatestContent);
|
|
80
|
+
};
|
|
65
81
|
exports.prepareFinalStage = prepareFinalStage;
|
|
82
|
+
/**
|
|
83
|
+
* `.limitsTravelWithTheAnswer()`'s half of prepare-final — the SAME stage,
|
|
84
|
+
* with the run's declared coverage folded into the answer first.
|
|
85
|
+
*
|
|
86
|
+
* Mounted in place of `prepareFinalStage` by both chart builders when the
|
|
87
|
+
* option is configured, and nowhere else: an agent that did not ask for it
|
|
88
|
+
* runs the function above, byte for byte. Written as one stage rather than a
|
|
89
|
+
* second one because everything the capture files must agree about what the
|
|
90
|
+
* answer WAS — a second stage afterwards would leave `turn_end` reporting an
|
|
91
|
+
* answer the caller never saw.
|
|
92
|
+
*
|
|
93
|
+
* It runs AFTER the evidence gate has judged (the gate is in the Route
|
|
94
|
+
* decider, one stage earlier). That ordering is deliberate: the block is
|
|
95
|
+
* composed by the framework out of what the TOOLS declared, so subjecting it
|
|
96
|
+
* to a check for values the MODEL could not support would be asking whether
|
|
97
|
+
* the library grounded itself.
|
|
98
|
+
*/
|
|
99
|
+
const prepareFinalWithLimitsStage = (scope) => {
|
|
100
|
+
const declared = scope.coverageDeclared;
|
|
101
|
+
const answer = declared !== undefined && declared.length > 0
|
|
102
|
+
? (0, index_js_1.composeAnswerWithCoverage)(scope.llmLatestContent, declared)
|
|
103
|
+
: scope.llmLatestContent;
|
|
104
|
+
captureTurnPayload(scope, answer);
|
|
105
|
+
};
|
|
106
|
+
exports.prepareFinalWithLimitsStage = prepareFinalWithLimitsStage;
|
|
66
107
|
//# sourceMappingURL=prepareFinal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prepareFinal.js","sourceRoot":"","sources":["../../../../src/core/agent/stages/prepareFinal.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;;;AAGH,uEAAiE;
|
|
1
|
+
{"version":3,"file":"prepareFinal.js","sourceRoot":"","sources":["../../../../src/core/agent/stages/prepareFinal.ts"],"names":[],"mappings":";AA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EAAQ,EAAE;IACvE,kBAAkB,CAAC,KAAK,EAAE,KAAK,CAAC,gBAAgB,CAAC,CAAC;AACpD,CAAC,CAAC;AAFW,QAAA,iBAAiB,qBAE5B;AAEF;;;;;;;;;;;;;;;;GAgBG;AACI,MAAM,2BAA2B,GAAG,CAAC,KAA6B,EAAQ,EAAE;IACjF,MAAM,QAAQ,GAAG,KAAK,CAAC,gBAAgB,CAAC;IACxC,MAAM,MAAM,GACV,QAAQ,KAAK,SAAS,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC;QAC3C,CAAC,CAAC,IAAA,oCAAyB,EAAC,KAAK,CAAC,gBAAgB,EAAE,QAAQ,CAAC;QAC7D,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC;IAC7B,kBAAkB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AACpC,CAAC,CAAC;AAPW,QAAA,2BAA2B,+BAOtC"}
|
|
@@ -68,6 +68,7 @@ const validators_js_1 = require("../validators.js");
|
|
|
68
68
|
const toolResultCap_js_1 = require("../toolResultCap.js");
|
|
69
69
|
const resultCeiling_js_1 = require("../resultCeiling.js");
|
|
70
70
|
const skillSteps_js_1 = require("../../../lib/injection-engine/skillSteps.js");
|
|
71
|
+
const index_js_1 = require("../coverage/index.js");
|
|
71
72
|
const toolEffects_js_1 = require("../toolEffects.js");
|
|
72
73
|
/** Declaration order preserved, ids de-duplicated — the shape the gate's re-prompt
|
|
73
74
|
* and the `skill.rejected` payload both report as "what this gate accepts". */
|
|
@@ -309,6 +310,76 @@ function buildToolCallsHandler(deps) {
|
|
|
309
310
|
});
|
|
310
311
|
return verdict.refusal;
|
|
311
312
|
};
|
|
313
|
+
/**
|
|
314
|
+
* Coverage declarations — `absent(…)` and `coverage(…)`, recognized at the
|
|
315
|
+
* SAME execute boundaries the ceiling is measured at (one implementation,
|
|
316
|
+
* every door: a resumed call declares its coverage exactly as an inline
|
|
317
|
+
* one).
|
|
318
|
+
*
|
|
319
|
+
* Returns the DELIVERED status: `'absent'` when an absence is in play,
|
|
320
|
+
* `undefined` otherwise. That single line is the whole downstream
|
|
321
|
+
* behavioural change, and it is deliberately narrow — an absence is not an
|
|
322
|
+
* error, so nothing here sets `error: true`, nothing refuses, nothing
|
|
323
|
+
* retries, and the value the model reads is the value the tool minted. The
|
|
324
|
+
* direction-of-error argument (see `../coverage/absent.ts`) is that a
|
|
325
|
+
* *nothing-found* routed as a *failure* sends someone to investigate a
|
|
326
|
+
* healthy collector, while a *failure* routed as *nothing-found* declares a
|
|
327
|
+
* system fine that was never checked; giving the outcome its own word is
|
|
328
|
+
* how `onToolStatus` edges stop having to guess.
|
|
329
|
+
*
|
|
330
|
+
* The RECORD keeps the coverage twice over: on the emit channel (per-call
|
|
331
|
+
* facts belong there) and, because a limit is a fact about the ANSWER
|
|
332
|
+
* rather than about an attempt, in tracked state — where the final-answer
|
|
333
|
+
* block reads it. Written only when a tool declares one, so an agent that
|
|
334
|
+
* returns neither shape commits exactly what it always did.
|
|
335
|
+
*/
|
|
336
|
+
const declareCoverage = (scope, call, value) => {
|
|
337
|
+
const reading = (0, index_js_1.readCoverageResult)(value);
|
|
338
|
+
if (reading === undefined)
|
|
339
|
+
return undefined;
|
|
340
|
+
const rows = [];
|
|
341
|
+
for (const facts of reading.declared) {
|
|
342
|
+
// Copied item by item — event payloads are detached plain data, never
|
|
343
|
+
// a shared reference into a value the tool still holds.
|
|
344
|
+
const copy = (list) => list.map((i) => ({ what: i.what, ...(i.why !== undefined && { why: i.why }) }));
|
|
345
|
+
const checked = copy(facts.coverage.checked);
|
|
346
|
+
const notChecked = copy(facts.coverage.notChecked);
|
|
347
|
+
const cannotCover = copy(facts.coverage.cannotCover);
|
|
348
|
+
if (facts.kind === 'absence') {
|
|
349
|
+
(0, typedEmit_js_1.typedEmit)(scope, 'agentfootprint.tools.absent', {
|
|
350
|
+
toolName: call.toolName,
|
|
351
|
+
toolCallId: call.toolCallId,
|
|
352
|
+
iteration: call.iteration,
|
|
353
|
+
...(facts.lookedFor !== undefined && { lookedFor: facts.lookedFor }),
|
|
354
|
+
checked,
|
|
355
|
+
...(notChecked.length > 0 && { notChecked }),
|
|
356
|
+
...(cannotCover.length > 0 && { cannotCover }),
|
|
357
|
+
});
|
|
358
|
+
}
|
|
359
|
+
else {
|
|
360
|
+
(0, typedEmit_js_1.typedEmit)(scope, 'agentfootprint.tools.coverage_declared', {
|
|
361
|
+
toolName: call.toolName,
|
|
362
|
+
toolCallId: call.toolCallId,
|
|
363
|
+
iteration: call.iteration,
|
|
364
|
+
...(checked.length > 0 && { checked }),
|
|
365
|
+
...(notChecked.length > 0 && { notChecked }),
|
|
366
|
+
...(cannotCover.length > 0 && { cannotCover }),
|
|
367
|
+
});
|
|
368
|
+
}
|
|
369
|
+
rows.push({
|
|
370
|
+
kind: facts.kind,
|
|
371
|
+
toolName: call.toolName,
|
|
372
|
+
toolCallId: call.toolCallId,
|
|
373
|
+
iteration: call.iteration,
|
|
374
|
+
...(facts.lookedFor !== undefined && { lookedFor: facts.lookedFor }),
|
|
375
|
+
checked,
|
|
376
|
+
notChecked,
|
|
377
|
+
cannotCover,
|
|
378
|
+
});
|
|
379
|
+
}
|
|
380
|
+
scope.coverageDeclared = [...(scope.coverageDeclared ?? []), ...rows];
|
|
381
|
+
return reading.status;
|
|
382
|
+
};
|
|
312
383
|
// ── Step-procedure boundary (9.18.0) — ONE implementation, five sites ──
|
|
313
384
|
// The batch loop and the four resume paths all finalize results; each
|
|
314
385
|
// calls these where its result becomes final, so a pointer can never miss
|
|
@@ -1185,6 +1256,14 @@ function buildToolCallsHandler(deps) {
|
|
|
1185
1256
|
// judged exactly as an inline one's.
|
|
1186
1257
|
const envelope = (0, toolEffects_js_1.readToolResultEnvelope)(result);
|
|
1187
1258
|
if (envelope !== undefined) {
|
|
1259
|
+
// Coverage (this release) before the ceiling, for the same reason the
|
|
1260
|
+
// effects are judged even when the payload is refused: the boundary a
|
|
1261
|
+
// tool declared is not the channel that can overflow, and a limit
|
|
1262
|
+
// that died with an oversized result would be the silence this
|
|
1263
|
+
// primitive exists to break. An absence's status is the tool's own
|
|
1264
|
+
// and wins over the envelope's only when the envelope declared none.
|
|
1265
|
+
const coverageStatus = declareCoverage(scope, { toolName, toolCallId, iteration }, envelope.content);
|
|
1266
|
+
const declaredStatus = envelope.status ?? coverageStatus;
|
|
1188
1267
|
// The tool's own ceiling (9.20.0) measures the CONTENT — the channel
|
|
1189
1268
|
// that can overflow a context window. The DECLARED effects are small
|
|
1190
1269
|
// validated data and are still judged by the caller: a tool that
|
|
@@ -1192,7 +1271,7 @@ function buildToolCallsHandler(deps) {
|
|
|
1192
1271
|
// transition. The delivered status becomes 'invalid' (the declared
|
|
1193
1272
|
// status described a result the model never received — the
|
|
1194
1273
|
// `result_refused` event keeps what was declared).
|
|
1195
|
-
const refusal = refuseOverCeiling(scope, { toolName, toolCallId, iteration }, tool, envelope.content,
|
|
1274
|
+
const refusal = refuseOverCeiling(scope, { toolName, toolCallId, iteration }, tool, envelope.content, declaredStatus);
|
|
1196
1275
|
if (refusal !== undefined) {
|
|
1197
1276
|
return {
|
|
1198
1277
|
result: refusal,
|
|
@@ -1201,9 +1280,14 @@ function buildToolCallsHandler(deps) {
|
|
|
1201
1280
|
envelope: { ...envelope, content: refusal, status: 'invalid' },
|
|
1202
1281
|
};
|
|
1203
1282
|
}
|
|
1204
|
-
return {
|
|
1283
|
+
return {
|
|
1284
|
+
result: envelope.content,
|
|
1285
|
+
executed: true,
|
|
1286
|
+
envelope: declaredStatus === envelope.status ? envelope : { ...envelope, status: declaredStatus },
|
|
1287
|
+
};
|
|
1205
1288
|
}
|
|
1206
|
-
const
|
|
1289
|
+
const coverageStatus = declareCoverage(scope, { toolName, toolCallId, iteration }, result);
|
|
1290
|
+
const refusal = refuseOverCeiling(scope, { toolName, toolCallId, iteration }, tool, result, coverageStatus);
|
|
1207
1291
|
if (refusal !== undefined) {
|
|
1208
1292
|
// Synthesized empty-effects envelope: the resume paths read the
|
|
1209
1293
|
// routing status off `envelope.status`, and this is how a refused
|
|
@@ -1221,6 +1305,19 @@ function buildToolCallsHandler(deps) {
|
|
|
1221
1305
|
const nearMiss = (0, toolEffects_js_1.explainStatusOnlyNearMiss)(result);
|
|
1222
1306
|
if (nearMiss !== undefined)
|
|
1223
1307
|
warnEffect(toolName, nearMiss);
|
|
1308
|
+
if (coverageStatus !== undefined) {
|
|
1309
|
+
// The ceiling path's synthesized envelope, for the same reason: the
|
|
1310
|
+
// resume paths read the routing status off `envelope.status`, and an
|
|
1311
|
+
// absence that lost its status here would route down whichever edge a
|
|
1312
|
+
// statusless result routes down — the confusion the word exists to
|
|
1313
|
+
// end. Empty effects/malformed judge to nothing, so the only thing
|
|
1314
|
+
// this carries is the status.
|
|
1315
|
+
return {
|
|
1316
|
+
result,
|
|
1317
|
+
executed: true,
|
|
1318
|
+
envelope: { content: result, effects: [], status: coverageStatus, malformed: [] },
|
|
1319
|
+
};
|
|
1320
|
+
}
|
|
1224
1321
|
return { result, executed: true };
|
|
1225
1322
|
}
|
|
1226
1323
|
catch (err) {
|
|
@@ -1879,6 +1976,15 @@ function buildToolCallsHandler(deps) {
|
|
|
1879
1976
|
if (nearMiss !== undefined)
|
|
1880
1977
|
warnEffect(tc.name, nearMiss);
|
|
1881
1978
|
}
|
|
1979
|
+
// Coverage (this release), on the UNWRAPPED content and before
|
|
1980
|
+
// the ceiling — the boundary a tool declared is not the channel
|
|
1981
|
+
// that can overflow. A tool that spelled its own status keeps
|
|
1982
|
+
// it; otherwise an absence names the delivered outcome, so an
|
|
1983
|
+
// `onToolStatus` edge can route "we looked and there was
|
|
1984
|
+
// nothing" somewhere other than "the call broke".
|
|
1985
|
+
const coverageStatus = declareCoverage(scope, { toolName: tc.name, toolCallId: tc.id, iteration }, result);
|
|
1986
|
+
if (toolStatus === undefined)
|
|
1987
|
+
toolStatus = coverageStatus;
|
|
1882
1988
|
// The tool's own refusing ceiling (9.20.0) — at the execute
|
|
1883
1989
|
// boundary, BEFORE the gates and the after-tool chain, so
|
|
1884
1990
|
// governance and the agent-level cap compose over what the
|