agentfootprint 9.41.0 → 9.44.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 +3 -1
- package/ai-instructions/claude-code/SKILL.md +31 -1
- package/dist/adapters/hosting/agentcore.js +163 -23
- 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/artifacts/conformance/cases.js +20 -0
- package/dist/artifacts/conformance/cases.js.map +1 -1
- package/dist/artifacts/scopePath.js +41 -1
- package/dist/artifacts/scopePath.js.map +1 -1
- package/dist/core/Agent.js +17 -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/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/core/outputFallback.js.map +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 +163 -23
- 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/artifacts/conformance/cases.js +20 -0
- package/dist/esm/artifacts/conformance/cases.js.map +1 -1
- package/dist/esm/artifacts/scopePath.d.ts +31 -0
- package/dist/esm/artifacts/scopePath.js +41 -1
- package/dist/esm/artifacts/scopePath.js.map +1 -1
- package/dist/esm/core/Agent.d.ts +8 -1
- package/dist/esm/core/Agent.js +18 -2
- 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/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/core/outputFallback.d.ts +15 -1
- package/dist/esm/core/outputFallback.js.map +1 -1
- 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/dispatcher.d.ts +1 -1
- package/dist/esm/events/dispatcher.js.map +1 -1
- package/dist/esm/events/payloads.d.ts +82 -0
- package/dist/esm/events/registry.d.ts +11 -1
- package/dist/esm/events/registry.js +10 -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 +229 -22
- 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 +1 -0
- package/dist/esm/index.js +18 -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/events/dispatcher.js.map +1 -1
- package/dist/events/registry.js +10 -0
- package/dist/events/registry.js.map +1 -1
- package/dist/hosting/conformance/cases.js +229 -22
- 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 +72 -43
- 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/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/artifacts/conformance/cases.d.ts.map +1 -1
- package/dist/types/artifacts/scopePath.d.ts +31 -0
- package/dist/types/artifacts/scopePath.d.ts.map +1 -1
- package/dist/types/core/Agent.d.ts +8 -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/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/core/outputFallback.d.ts +15 -1
- package/dist/types/core/outputFallback.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/dispatcher.d.ts +1 -1
- package/dist/types/events/dispatcher.d.ts.map +1 -1
- package/dist/types/events/payloads.d.ts +82 -0
- package/dist/types/events/payloads.d.ts.map +1 -1
- package/dist/types/events/registry.d.ts +11 -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 +1 -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/package.json +1 -1
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* evidence — what an absence is allowed to GROUND.
|
|
4
|
+
*
|
|
5
|
+
* Pattern: one projection, one consumer (`evidence/evidenceIndex.ts`). The
|
|
6
|
+
* `evidence/frames.ts` argument applied to the other side of the
|
|
7
|
+
* conversation: there, text the library wrote into a `role: 'user'`
|
|
8
|
+
* turn must not become user-supplied evidence; here, text the MODEL
|
|
9
|
+
* supplied that a tool echoed back must not become tool evidence.
|
|
10
|
+
* Role: core/ layer, pure.
|
|
11
|
+
* Emits: N/A.
|
|
12
|
+
*
|
|
13
|
+
* ## The bug this file exists to prevent
|
|
14
|
+
*
|
|
15
|
+
* The evidence gate's corpus is every `role: 'tool'` result: a value the
|
|
16
|
+
* model read from a tool is grounded. An absence is a tool result — and its
|
|
17
|
+
* whole job is to say what was looked for, which in practice means quoting
|
|
18
|
+
* the arguments the model passed ("no FLOGI entries on fc1/3", where `fc1/3`
|
|
19
|
+
* came from the model, not from the fabric).
|
|
20
|
+
*
|
|
21
|
+
* Index that whole frame and an invented identifier becomes grounded by the
|
|
22
|
+
* one route that proves nothing about it: handing it to a tool that found
|
|
23
|
+
* nothing. The model could then assert "fc1/3 has no FLOGI entries" about a
|
|
24
|
+
* port it invented, and the gate would agree, because it saw the string in a
|
|
25
|
+
* tool result. **A failed lookup is the cheapest possible laundering
|
|
26
|
+
* machine**, and adding a primitive whose purpose is to make failed lookups
|
|
27
|
+
* informative would have made it cheaper still.
|
|
28
|
+
*
|
|
29
|
+
* So an absence grounds its COVERAGE and nothing else. `checked`,
|
|
30
|
+
* `not_checked` and `cannot_cover` are the tool's own words about the world —
|
|
31
|
+
* a fabric name, a collector, a window — and they are exactly what an answer
|
|
32
|
+
* built on an absence should be allowed to cite. `looked_for`, `try_instead`,
|
|
33
|
+
* the note and the marker are not.
|
|
34
|
+
*
|
|
35
|
+
* The consequence is deliberate and worth stating: if the USER named the
|
|
36
|
+
* thing, it is exempt anyway (their message is the exempt corpus), so a real
|
|
37
|
+
* question about a real port is unaffected. Only a value that appears *for
|
|
38
|
+
* the first time* in an absence loses its grounding — which is the only case
|
|
39
|
+
* where it was never evidence to begin with.
|
|
40
|
+
*
|
|
41
|
+
* ## What this does NOT close, said plainly
|
|
42
|
+
*
|
|
43
|
+
* The whitelist rests on "coverage is the tool's own words about the world".
|
|
44
|
+
* An author who interpolates an unvalidated argument into a coverage entry —
|
|
45
|
+
* a `checked` line built by string-interpolating the `switch` argument the
|
|
46
|
+
* model passed — puts a model-supplied token back into the corpus through the
|
|
47
|
+
* one list this file admits. That is narrower than the hole it closes (the
|
|
48
|
+
* author chose to echo, rather than the primitive echoing by design), and it
|
|
49
|
+
* is not detectable from here: this library cannot tell which characters of a
|
|
50
|
+
* sentence a tool composed and which it copied. The guidance is on the door
|
|
51
|
+
* itself — interpolate identifiers you RESOLVED, not identifiers you were
|
|
52
|
+
* handed. It is also the general limit of the evidence corpus, not a new one:
|
|
53
|
+
* any tool that echoes its arguments into its result has always grounded
|
|
54
|
+
* them.
|
|
55
|
+
*/
|
|
56
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
57
|
+
exports.absenceEvidenceProjection = void 0;
|
|
58
|
+
const absent_js_1 = require("./absent.js");
|
|
59
|
+
const ledger_js_1 = require("./ledger.js");
|
|
60
|
+
/** The coverage lists of one absence, as the only thing it grounds. */
|
|
61
|
+
function coverageOnly(absence) {
|
|
62
|
+
return [absence.checked ?? [], absence.not_checked ?? [], absence.cannot_cover ?? []];
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Project a parsed tool result down to what it may ground, or `undefined`
|
|
66
|
+
* when it carries no absence frame — the ordinary case, which the caller
|
|
67
|
+
* indexes exactly as it always did.
|
|
68
|
+
*
|
|
69
|
+
* Two shapes carry one: a bare absence, and an absence bounded by a coverage
|
|
70
|
+
* ledger (`coverage(absent(…), …)`). A ledger's own lists are all tool
|
|
71
|
+
* prose, so they are indexed whole; only the absence inside it is narrowed.
|
|
72
|
+
* An absence buried deeper than that — inside a tool's own domain object —
|
|
73
|
+
* is NOT found, and is left indexed as ordinary data: this projection
|
|
74
|
+
* recognizes the shapes this library mints, and does not go hunting through
|
|
75
|
+
* values it did not write.
|
|
76
|
+
*/
|
|
77
|
+
function absenceEvidenceProjection(parsed) {
|
|
78
|
+
const absence = (0, absent_js_1.readAbsence)(parsed);
|
|
79
|
+
if (absence !== undefined)
|
|
80
|
+
return coverageOnly(absence);
|
|
81
|
+
const covered = (0, ledger_js_1.readCoverageLedger)(parsed);
|
|
82
|
+
if (covered === undefined)
|
|
83
|
+
return undefined;
|
|
84
|
+
const inner = (0, absent_js_1.readAbsence)(covered.result);
|
|
85
|
+
if (inner === undefined)
|
|
86
|
+
return undefined;
|
|
87
|
+
return [covered.af_coverage, ...coverageOnly(inner)];
|
|
88
|
+
}
|
|
89
|
+
exports.absenceEvidenceProjection = absenceEvidenceProjection;
|
|
90
|
+
//# sourceMappingURL=evidence.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"evidence.js","sourceRoot":"","sources":["../../../../src/core/agent/coverage/evidence.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;;;AAEH,2CAA0C;AAC1C,2CAAiD;AAGjD,uEAAuE;AACvE,SAAS,YAAY,CAAC,OAAoB;IACxC,OAAO,CAAC,OAAO,CAAC,OAAO,IAAI,EAAE,EAAE,OAAO,CAAC,WAAW,IAAI,EAAE,EAAE,OAAO,CAAC,YAAY,IAAI,EAAE,CAAC,CAAC;AACxF,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,SAAgB,yBAAyB,CAAC,MAAe;IACvD,MAAM,OAAO,GAAG,IAAA,uBAAW,EAAC,MAAM,CAAC,CAAC;IACpC,IAAI,OAAO,KAAK,SAAS;QAAE,OAAO,YAAY,CAAC,OAAO,CAAC,CAAC;IACxD,MAAM,OAAO,GAAG,IAAA,8BAAkB,EAAC,MAAM,CAAC,CAAC;IAC3C,IAAI,OAAO,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC5C,MAAM,KAAK,GAAG,IAAA,uBAAW,EAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAC1C,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC1C,OAAO,CAAC,OAAO,CAAC,WAAW,EAAE,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;AACvD,CAAC;AARD,8DAQC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* The two coverage primitives — `absent()` and `coverage()`.
|
|
4
|
+
*
|
|
5
|
+
* The door: what the main barrel publishes, and the one import path the
|
|
6
|
+
* dispatch loop, the evidence index and the final-answer stage use. Both
|
|
7
|
+
* primitives came from FIELD USE — a production triage agent that had
|
|
8
|
+
* invented them because the library had no answer for either. See README.md
|
|
9
|
+
* for the arguments; nothing here is new machinery, it is a smaller version
|
|
10
|
+
* of what already worked.
|
|
11
|
+
*/
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.readCoverageResult = exports.readCoverageLedger = exports.coverageOfLedger = exports.COVERAGE_NOTE = exports.COVERAGE_MARKER = exports.coverage = exports.sameItem = exports.normalizeCoverageList = exports.mergeItems = exports.absenceEvidenceProjection = exports.COVERAGE_BLOCK_HEADING = exports.composeAnswerWithCoverage = exports.readAbsence = exports.coverageOfAbsence = exports.absent = exports.ABSENCE_NOTE = exports.ABSENCE_MARKER = void 0;
|
|
14
|
+
var absent_js_1 = require("./absent.js");
|
|
15
|
+
Object.defineProperty(exports, "ABSENCE_MARKER", { enumerable: true, get: function () { return absent_js_1.ABSENCE_MARKER; } });
|
|
16
|
+
Object.defineProperty(exports, "ABSENCE_NOTE", { enumerable: true, get: function () { return absent_js_1.ABSENCE_NOTE; } });
|
|
17
|
+
Object.defineProperty(exports, "absent", { enumerable: true, get: function () { return absent_js_1.absent; } });
|
|
18
|
+
Object.defineProperty(exports, "coverageOfAbsence", { enumerable: true, get: function () { return absent_js_1.coverageOfAbsence; } });
|
|
19
|
+
Object.defineProperty(exports, "readAbsence", { enumerable: true, get: function () { return absent_js_1.readAbsence; } });
|
|
20
|
+
var answer_js_1 = require("./answer.js");
|
|
21
|
+
Object.defineProperty(exports, "composeAnswerWithCoverage", { enumerable: true, get: function () { return answer_js_1.composeAnswerWithCoverage; } });
|
|
22
|
+
Object.defineProperty(exports, "COVERAGE_BLOCK_HEADING", { enumerable: true, get: function () { return answer_js_1.COVERAGE_BLOCK_HEADING; } });
|
|
23
|
+
var evidence_js_1 = require("./evidence.js");
|
|
24
|
+
Object.defineProperty(exports, "absenceEvidenceProjection", { enumerable: true, get: function () { return evidence_js_1.absenceEvidenceProjection; } });
|
|
25
|
+
var items_js_1 = require("./items.js");
|
|
26
|
+
Object.defineProperty(exports, "mergeItems", { enumerable: true, get: function () { return items_js_1.mergeItems; } });
|
|
27
|
+
Object.defineProperty(exports, "normalizeCoverageList", { enumerable: true, get: function () { return items_js_1.normalizeCoverageList; } });
|
|
28
|
+
Object.defineProperty(exports, "sameItem", { enumerable: true, get: function () { return items_js_1.sameItem; } });
|
|
29
|
+
var ledger_js_1 = require("./ledger.js");
|
|
30
|
+
Object.defineProperty(exports, "coverage", { enumerable: true, get: function () { return ledger_js_1.coverage; } });
|
|
31
|
+
Object.defineProperty(exports, "COVERAGE_MARKER", { enumerable: true, get: function () { return ledger_js_1.COVERAGE_MARKER; } });
|
|
32
|
+
Object.defineProperty(exports, "COVERAGE_NOTE", { enumerable: true, get: function () { return ledger_js_1.COVERAGE_NOTE; } });
|
|
33
|
+
Object.defineProperty(exports, "coverageOfLedger", { enumerable: true, get: function () { return ledger_js_1.coverageOfLedger; } });
|
|
34
|
+
Object.defineProperty(exports, "readCoverageLedger", { enumerable: true, get: function () { return ledger_js_1.readCoverageLedger; } });
|
|
35
|
+
var read_js_1 = require("./read.js");
|
|
36
|
+
Object.defineProperty(exports, "readCoverageResult", { enumerable: true, get: function () { return read_js_1.readCoverageResult; } });
|
|
37
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/agent/coverage/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;AAEH,yCAAmG;AAA1F,2GAAA,cAAc,OAAA;AAAE,yGAAA,YAAY,OAAA;AAAE,mGAAA,MAAM,OAAA;AAAE,8GAAA,iBAAiB,OAAA;AAAE,wGAAA,WAAW,OAAA;AAC7E,yCAAgF;AAAvE,sHAAA,yBAAyB,OAAA;AAAE,mHAAA,sBAAsB,OAAA;AAC1D,6CAA0D;AAAjD,wHAAA,yBAAyB,OAAA;AAClC,uCAAyE;AAAhE,sGAAA,UAAU,OAAA;AAAE,iHAAA,qBAAqB,OAAA;AAAE,oGAAA,QAAQ,OAAA;AACpD,yCAMqB;AALnB,qGAAA,QAAQ,OAAA;AACR,4GAAA,eAAe,OAAA;AACf,0GAAA,aAAa,OAAA;AACb,6GAAA,gBAAgB,OAAA;AAChB,+GAAA,kBAAkB,OAAA;AAEpB,qCAAyF;AAAhF,6GAAA,kBAAkB,OAAA"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* coverage/items — normalizing and refusing coverage lists.
|
|
4
|
+
*
|
|
5
|
+
* Pattern: one validator, two doors (`absent()` and `coverage()`), so the two
|
|
6
|
+
* primitives cannot disagree about what a well-formed piece of
|
|
7
|
+
* ground looks like.
|
|
8
|
+
* Role: core/ layer, pure. Throws at the CALL SITE (the
|
|
9
|
+
* `resolveEvidenceGate` precedent): a malformed declaration is a
|
|
10
|
+
* mistake in the line the author just wrote, and the stack should
|
|
11
|
+
* say so — not fail on the first absence of the first incident.
|
|
12
|
+
* Emits: N/A.
|
|
13
|
+
*/
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.mergeItems = exports.sameItem = exports.normalizeCoverageList = void 0;
|
|
16
|
+
const isPlainString = (v) => typeof v === 'string' && v.trim().length > 0;
|
|
17
|
+
/**
|
|
18
|
+
* Normalize one author list into {@link CoverageItem}s, refusing anything a
|
|
19
|
+
* reader could not act on.
|
|
20
|
+
*
|
|
21
|
+
* `requireWhy` is true only for `cannotCover`. The asymmetry is deliberate:
|
|
22
|
+
* "we checked the fcns database" and "we did not check the archive" are
|
|
23
|
+
* complete statements on their own, but "this tool can never see host-side
|
|
24
|
+
* multipathing" is a claim about capability — and a permanent blind spot with
|
|
25
|
+
* no reason attached cannot be acted on, escalated, or disproved. It is also
|
|
26
|
+
* the one an operator is most likely to want to fix, so the reason is the
|
|
27
|
+
* useful half.
|
|
28
|
+
*/
|
|
29
|
+
function normalizeCoverageList(fn, section, list, requireWhy) {
|
|
30
|
+
if (list === undefined)
|
|
31
|
+
return [];
|
|
32
|
+
if (!Array.isArray(list)) {
|
|
33
|
+
throw new Error(`${fn}: \`${section}\` must be an array of strings or { what, why } entries — to say ` +
|
|
34
|
+
`nothing about it, omit the field (absent means "not declared", never "nothing there").`);
|
|
35
|
+
}
|
|
36
|
+
const items = [];
|
|
37
|
+
list.forEach((raw, i) => {
|
|
38
|
+
const at = `${section}[${i}]`;
|
|
39
|
+
if (isPlainString(raw)) {
|
|
40
|
+
if (requireWhy) {
|
|
41
|
+
throw new Error(`${fn}: ${at} is '${raw.trim()}' with no reason. Every \`cannotCover\` entry needs a ` +
|
|
42
|
+
`\`why\` — a blind spot this tool can NEVER see is a claim about what it is, and a ` +
|
|
43
|
+
`reader cannot act on, escalate or disprove a claim with no reason. Write ` +
|
|
44
|
+
`{ what: '${raw.trim()}', why: '…' }, or move it to \`notChecked\` if a wider ` +
|
|
45
|
+
`call could reach it.`);
|
|
46
|
+
}
|
|
47
|
+
items.push({ what: raw.trim() });
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
if (typeof raw !== 'object' || raw === null || !isPlainString(raw.what)) {
|
|
51
|
+
throw new Error(`${fn}: ${at} names no ground. Each entry is either a non-empty string or ` +
|
|
52
|
+
`{ what, why } — what a reader has to know is WHICH source, window or population ` +
|
|
53
|
+
`this is about.`);
|
|
54
|
+
}
|
|
55
|
+
const item = raw;
|
|
56
|
+
const why = item.why;
|
|
57
|
+
if (why !== undefined && !isPlainString(why)) {
|
|
58
|
+
throw new Error(`${fn}: ${at} ('${item.what.trim()}') has a \`why\` that says nothing. Give it a ` +
|
|
59
|
+
`reason or omit the field.`);
|
|
60
|
+
}
|
|
61
|
+
if (requireWhy && why === undefined) {
|
|
62
|
+
throw new Error(`${fn}: ${at} ('${item.what.trim()}') has no \`why\`. Every \`cannotCover\` entry ` +
|
|
63
|
+
`needs one — see the entry above this line in the docs for why a permanent blind ` +
|
|
64
|
+
`spot must say what makes it permanent.`);
|
|
65
|
+
}
|
|
66
|
+
items.push({ what: item.what.trim(), ...(why !== undefined && { why: why.trim() }) });
|
|
67
|
+
});
|
|
68
|
+
return items;
|
|
69
|
+
}
|
|
70
|
+
exports.normalizeCoverageList = normalizeCoverageList;
|
|
71
|
+
/** Two entries are the same ground when they say the same two things. Used to
|
|
72
|
+
* fold the run's declarations into ONE answer-level block: five tools that
|
|
73
|
+
* all name the same missing collector should say it once. */
|
|
74
|
+
function sameItem(a, b) {
|
|
75
|
+
return a.what === b.what && (a.why ?? '') === (b.why ?? '');
|
|
76
|
+
}
|
|
77
|
+
exports.sameItem = sameItem;
|
|
78
|
+
/** Merge lists in declaration order, dropping repeats. Order is the run's own
|
|
79
|
+
* order on purpose — it is the only ordering that means anything here. */
|
|
80
|
+
function mergeItems(lists) {
|
|
81
|
+
const out = [];
|
|
82
|
+
for (const list of lists) {
|
|
83
|
+
for (const item of list) {
|
|
84
|
+
if (!out.some((seen) => sameItem(seen, item)))
|
|
85
|
+
out.push(item);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return out;
|
|
89
|
+
}
|
|
90
|
+
exports.mergeItems = mergeItems;
|
|
91
|
+
//# sourceMappingURL=items.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"items.js","sourceRoot":"","sources":["../../../../src/core/agent/coverage/items.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;;AAOH,MAAM,aAAa,GAAG,CAAC,CAAU,EAAe,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;AAEhG;;;;;;;;;;;GAWG;AACH,SAAgB,qBAAqB,CACnC,EAAU,EACV,OAAwB,EACxB,IAA0C,EAC1C,UAAmB;IAEnB,IAAI,IAAI,KAAK,SAAS;QAAE,OAAO,EAAE,CAA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
"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,E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AM,MAAM,GAAG,GAAG,CAAC,uBAAe,CAAC,CAAC;IACpC,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;QAAE,OAAO,SAAS,CAAC;IAC7F,IAAI,CAAC,CAAC,QAAQ,IAAI,GAAG,CAAC;QAAE,OAAO,SAAS,CAAC;IACzC,OAAO,KAAsB,CAAC;AAChC,CAAC;AAPD,gDAOC;AAED,iEAAiE;AACjE,SAAgB,gBAAgB,CAAC,OAAsB;IACrD,MAAM,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC;IAC9B,OAAO;QACL,OAAO,EAAE,CAAC,CAAC,OAAO,IAAI,EAAE;QACxB,UAAU,EAAE,CAAC,CAAC,WAAW,IAAI,EAAE;QAC/B,WAAW,EAAE,CAAC,CAAC,YAAY,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;;;;;;;;;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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,CAA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.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":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;;;AAGH,uEAAiE;AACjE,mDAAiE;AAGjE;;;;;;;;;;;GAWG;AACH,MAAM,kBAAkB,GAAG,CAAC,KAA6B,EAAE,MAAc,EAAQ,EAAE;IACjF,MAAM,SAAS,GAAG,KAAK,C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