agentfootprint 10.9.0 → 11.0.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 +14 -4
- package/CAPABILITIES.md +16 -3
- package/README.md +115 -52
- package/ai-instructions/claude-code/SKILL.md +14 -4
- package/dist/adapters/hosting/agentCoreA2A.js +4 -0
- package/dist/adapters/hosting/agentCoreA2A.js.map +1 -1
- package/dist/adapters/hosting/firestoreSessions.js +9 -2
- package/dist/adapters/hosting/firestoreSessions.js.map +1 -1
- package/dist/adapters/hosting/googleAgentEngine.js +4 -6
- package/dist/adapters/hosting/googleAgentEngine.js.map +1 -1
- package/dist/adapters/llm/AnthropicProvider.js +4 -0
- package/dist/adapters/llm/AnthropicProvider.js.map +1 -1
- package/dist/adapters/llm/BrowserAnthropicProvider.js +4 -0
- package/dist/adapters/llm/BrowserAnthropicProvider.js.map +1 -1
- package/dist/adapters/llm/MockProvider.js +2 -0
- package/dist/adapters/llm/MockProvider.js.map +1 -1
- package/dist/ag-ui/request.js +27 -2
- package/dist/ag-ui/request.js.map +1 -1
- package/dist/ag-ui/serializer.js +21 -8
- package/dist/ag-ui/serializer.js.map +1 -1
- package/dist/answer-account/facts/howSure.js +3 -0
- package/dist/answer-account/facts/howSure.js.map +1 -1
- package/dist/answer-account/templates.js +4 -1
- package/dist/answer-account/templates.js.map +1 -1
- package/dist/answer-validation/agentChecks.js +130 -0
- package/dist/answer-validation/agentChecks.js.map +1 -0
- package/dist/answer-validation/index.js +5 -1
- package/dist/answer-validation/index.js.map +1 -1
- package/dist/answer-validation/outputSchema.js +8 -1
- package/dist/answer-validation/outputSchema.js.map +1 -1
- package/dist/answer-validation/types.js +9 -2
- package/dist/answer-validation/types.js.map +1 -1
- package/dist/answer-validation/validate.js +82 -3
- package/dist/answer-validation/validate.js.map +1 -1
- package/dist/core/Agent.js +214 -59
- package/dist/core/Agent.js.map +1 -1
- package/dist/core/RunnerBase.js +4 -0
- package/dist/core/RunnerBase.js.map +1 -1
- package/dist/core/agent/AgentBuilder.js +139 -33
- package/dist/core/agent/AgentBuilder.js.map +1 -1
- package/dist/core/agent/arguments/checks.js +1 -1
- package/dist/core/agent/arguments/subflow.js +1 -0
- package/dist/core/agent/arguments/subflow.js.map +1 -1
- package/dist/core/agent/assessment/assess.js +31 -0
- package/dist/core/agent/assessment/assess.js.map +1 -1
- package/dist/core/agent/assessment/compose.js +3 -0
- package/dist/core/agent/assessment/compose.js.map +1 -1
- package/dist/core/agent/assessment/reasons.js +19 -1
- package/dist/core/agent/assessment/reasons.js.map +1 -1
- package/dist/core/agent/buildAgentChart.js +7 -17
- package/dist/core/agent/buildAgentChart.js.map +1 -1
- package/dist/core/agent/buildDynamicAgentChart.js +18 -15
- package/dist/core/agent/buildDynamicAgentChart.js.map +1 -1
- package/dist/core/agent/buildToolRegistry.js +13 -0
- package/dist/core/agent/buildToolRegistry.js.map +1 -1
- package/dist/core/agent/composeRequest.js +19 -1
- package/dist/core/agent/composeRequest.js.map +1 -1
- package/dist/core/agent/evidence/answerCarriers.js +1 -1
- package/dist/core/agent/evidence/answerCarriers.js.map +1 -1
- package/dist/core/agent/evidence/evidenceIndex.js +1 -1
- package/dist/core/agent/evidence/evidenceIndex.js.map +1 -1
- package/dist/core/agent/evidence/extract.js +139 -32
- package/dist/core/agent/evidence/extract.js.map +1 -1
- package/dist/core/agent/evidence/figures.js +1 -1
- package/dist/core/agent/evidence/figures.js.map +1 -1
- package/dist/core/agent/evidence/frames.js +3 -1
- package/dist/core/agent/evidence/frames.js.map +1 -1
- package/dist/core/agent/evidence/gate.js +10 -2
- package/dist/core/agent/evidence/gate.js.map +1 -1
- package/dist/core/agent/evidence/numericRanges.js +1 -1
- package/dist/core/agent/evidence/numericRanges.js.map +1 -1
- package/dist/core/agent/evidence/recovery.js +3 -1
- package/dist/core/agent/evidence/recovery.js.map +1 -1
- package/dist/core/agent/evidence/resultCarries.js +3 -3
- package/dist/core/agent/evidence/resultCarries.js.map +1 -1
- package/dist/core/agent/findings/context.js +163 -0
- package/dist/core/agent/findings/context.js.map +1 -0
- package/dist/core/agent/findings/contingent.js +1 -1
- package/dist/core/agent/findings/contingent.js.map +1 -1
- package/dist/core/agent/findings/instruction.js +26 -0
- package/dist/core/agent/findings/instruction.js.map +1 -0
- package/dist/core/agent/findings/ledger.js +49 -0
- package/dist/core/agent/findings/ledger.js.map +1 -1
- package/dist/core/agent/findings/negativeProse.js +53 -0
- package/dist/core/agent/findings/negativeProse.js.map +1 -0
- package/dist/core/agent/findings/offer.js +9 -57
- package/dist/core/agent/findings/offer.js.map +1 -1
- package/dist/core/agent/findings/reserved.js +12 -83
- package/dist/core/agent/findings/reserved.js.map +1 -1
- package/dist/core/agent/findings/types.js +3 -2
- package/dist/core/agent/findings/types.js.map +1 -1
- package/dist/core/agent/honesty/mounts.js +6 -0
- package/dist/core/agent/honesty/mounts.js.map +1 -1
- package/dist/core/agent/nativeOutputFormat.js +19 -1
- package/dist/core/agent/nativeOutputFormat.js.map +1 -1
- package/dist/core/agent/negativeClaims/capture.js +522 -0
- package/dist/core/agent/negativeClaims/capture.js.map +1 -0
- package/dist/core/agent/negativeClaims/checkpoint.js +83 -0
- package/dist/core/agent/negativeClaims/checkpoint.js.map +1 -0
- package/dist/core/agent/negativeClaims/config.js +192 -0
- package/dist/core/agent/negativeClaims/config.js.map +1 -0
- package/dist/core/agent/negativeClaims/delivery.js +249 -0
- package/dist/core/agent/negativeClaims/delivery.js.map +1 -0
- package/dist/core/agent/negativeClaims/observe.js +38 -0
- package/dist/core/agent/negativeClaims/observe.js.map +1 -0
- package/dist/core/agent/negativeClaims/prose.js +116 -0
- package/dist/core/agent/negativeClaims/prose.js.map +1 -0
- package/dist/core/agent/negativeClaims/recheck.js +37 -0
- package/dist/core/agent/negativeClaims/recheck.js.map +1 -0
- package/dist/core/agent/outputEnforcement.js.map +1 -1
- package/dist/core/agent/stages/answerEvidence.js +21 -0
- package/dist/core/agent/stages/answerEvidence.js.map +1 -0
- package/dist/core/agent/stages/answerValidation.js +112 -4
- package/dist/core/agent/stages/answerValidation.js.map +1 -1
- package/dist/core/agent/stages/callLLM.js +82 -41
- package/dist/core/agent/stages/callLLM.js.map +1 -1
- package/dist/core/agent/stages/evidenceRecheck.js +16 -2
- package/dist/core/agent/stages/evidenceRecheck.js.map +1 -1
- package/dist/core/agent/stages/outputRetry.js +23 -7
- package/dist/core/agent/stages/outputRetry.js.map +1 -1
- package/dist/core/agent/stages/prepareFinal.js +6 -1
- package/dist/core/agent/stages/prepareFinal.js.map +1 -1
- package/dist/core/agent/stages/reliabilityExecution.js +3 -0
- package/dist/core/agent/stages/reliabilityExecution.js.map +1 -1
- package/dist/core/agent/stages/route.js +81 -33
- package/dist/core/agent/stages/route.js.map +1 -1
- package/dist/core/agent/stages/searchCoverage.js +121 -0
- package/dist/core/agent/stages/searchCoverage.js.map +1 -0
- package/dist/core/agent/stages/seed.js +19 -21
- package/dist/core/agent/stages/seed.js.map +1 -1
- package/dist/core/agent/stages/toolCalls.js +699 -76
- package/dist/core/agent/stages/toolCalls.js.map +1 -1
- package/dist/core/agent/toolChoice/compose.js +1 -0
- package/dist/core/agent/toolChoice/compose.js.map +1 -1
- package/dist/core/agent/toolChoice/pick.js +2 -0
- package/dist/core/agent/toolChoice/pick.js.map +1 -1
- package/dist/core/checkin.js +82 -18
- package/dist/core/checkin.js.map +1 -1
- package/dist/core/consentRequest.js +844 -0
- package/dist/core/consentRequest.js.map +1 -0
- package/dist/core/pause.js +104 -6
- package/dist/core/pause.js.map +1 -1
- package/dist/core/runCheckpoint.js +8 -1
- package/dist/core/runCheckpoint.js.map +1 -1
- package/dist/core/slots/buildToolsSlot.js +4 -24
- package/dist/core/slots/buildToolsSlot.js.map +1 -1
- package/dist/debug.js +2 -0
- package/dist/debug.js.map +1 -1
- package/dist/esm/adapters/hosting/agentCoreA2A.js +4 -0
- package/dist/esm/adapters/hosting/agentCoreA2A.js.map +1 -1
- package/dist/esm/adapters/hosting/firestoreSessions.js +9 -2
- package/dist/esm/adapters/hosting/firestoreSessions.js.map +1 -1
- package/dist/esm/adapters/hosting/googleAgentEngine.js +4 -6
- package/dist/esm/adapters/hosting/googleAgentEngine.js.map +1 -1
- package/dist/esm/adapters/llm/AnthropicProvider.d.ts +1 -0
- package/dist/esm/adapters/llm/AnthropicProvider.js +5 -1
- package/dist/esm/adapters/llm/AnthropicProvider.js.map +1 -1
- package/dist/esm/adapters/llm/BrowserAnthropicProvider.d.ts +1 -0
- package/dist/esm/adapters/llm/BrowserAnthropicProvider.js +5 -1
- package/dist/esm/adapters/llm/BrowserAnthropicProvider.js.map +1 -1
- package/dist/esm/adapters/llm/MockProvider.d.ts +2 -0
- package/dist/esm/adapters/llm/MockProvider.js +2 -0
- package/dist/esm/adapters/llm/MockProvider.js.map +1 -1
- package/dist/esm/ag-ui/request.d.ts +4 -1
- package/dist/esm/ag-ui/request.js +27 -2
- package/dist/esm/ag-ui/request.js.map +1 -1
- package/dist/esm/ag-ui/serializer.d.ts +15 -2
- package/dist/esm/ag-ui/serializer.js +20 -7
- package/dist/esm/ag-ui/serializer.js.map +1 -1
- package/dist/esm/answer-account/facts/howSure.js +3 -0
- package/dist/esm/answer-account/facts/howSure.js.map +1 -1
- package/dist/esm/answer-account/templates.d.ts +4 -1
- package/dist/esm/answer-account/templates.js +4 -1
- package/dist/esm/answer-account/templates.js.map +1 -1
- package/dist/esm/answer-validation/agentChecks.d.ts +75 -0
- package/dist/esm/answer-validation/agentChecks.js +125 -0
- package/dist/esm/answer-validation/agentChecks.js.map +1 -0
- package/dist/esm/answer-validation/index.d.ts +2 -1
- package/dist/esm/answer-validation/index.js +1 -0
- package/dist/esm/answer-validation/index.js.map +1 -1
- package/dist/esm/answer-validation/outputSchema.d.ts +18 -7
- package/dist/esm/answer-validation/outputSchema.js +8 -1
- package/dist/esm/answer-validation/outputSchema.js.map +1 -1
- package/dist/esm/answer-validation/types.d.ts +125 -1
- package/dist/esm/answer-validation/types.js +9 -2
- package/dist/esm/answer-validation/types.js.map +1 -1
- package/dist/esm/answer-validation/validate.d.ts +11 -2
- package/dist/esm/answer-validation/validate.js +82 -3
- package/dist/esm/answer-validation/validate.js.map +1 -1
- package/dist/esm/core/Agent.d.ts +25 -1
- package/dist/esm/core/Agent.js +202 -47
- package/dist/esm/core/Agent.js.map +1 -1
- package/dist/esm/core/RunnerBase.js +4 -0
- package/dist/esm/core/RunnerBase.js.map +1 -1
- package/dist/esm/core/agent/AgentBuilder.d.ts +43 -12
- package/dist/esm/core/agent/AgentBuilder.js +135 -29
- package/dist/esm/core/agent/AgentBuilder.js.map +1 -1
- package/dist/esm/core/agent/arguments/checks.d.ts +1 -1
- package/dist/esm/core/agent/arguments/checks.js +1 -1
- package/dist/esm/core/agent/arguments/subflow.d.ts +6 -0
- package/dist/esm/core/agent/arguments/subflow.js +1 -0
- package/dist/esm/core/agent/arguments/subflow.js.map +1 -1
- package/dist/esm/core/agent/assessment/assess.js +31 -0
- package/dist/esm/core/agent/assessment/assess.js.map +1 -1
- package/dist/esm/core/agent/assessment/compose.js +3 -0
- package/dist/esm/core/agent/assessment/compose.js.map +1 -1
- package/dist/esm/core/agent/assessment/reasons.js +19 -1
- package/dist/esm/core/agent/assessment/reasons.js.map +1 -1
- package/dist/esm/core/agent/assessment/types.d.ts +3 -2
- package/dist/esm/core/agent/buildAgentChart.d.ts +4 -12
- package/dist/esm/core/agent/buildAgentChart.js +7 -17
- package/dist/esm/core/agent/buildAgentChart.js.map +1 -1
- package/dist/esm/core/agent/buildDynamicAgentChart.js +18 -15
- package/dist/esm/core/agent/buildDynamicAgentChart.js.map +1 -1
- package/dist/esm/core/agent/buildToolRegistry.js +13 -0
- package/dist/esm/core/agent/buildToolRegistry.js.map +1 -1
- package/dist/esm/core/agent/composeRequest.d.ts +19 -0
- package/dist/esm/core/agent/composeRequest.js +17 -0
- package/dist/esm/core/agent/composeRequest.js.map +1 -1
- package/dist/esm/core/agent/evidence/answerCarriers.js +1 -1
- package/dist/esm/core/agent/evidence/answerCarriers.js.map +1 -1
- package/dist/esm/core/agent/evidence/evidenceIndex.js +1 -1
- package/dist/esm/core/agent/evidence/evidenceIndex.js.map +1 -1
- package/dist/esm/core/agent/evidence/extract.d.ts +45 -6
- package/dist/esm/core/agent/evidence/extract.js +136 -30
- package/dist/esm/core/agent/evidence/extract.js.map +1 -1
- package/dist/esm/core/agent/evidence/figures.js +1 -1
- package/dist/esm/core/agent/evidence/figures.js.map +1 -1
- package/dist/esm/core/agent/evidence/frames.js +4 -2
- package/dist/esm/core/agent/evidence/frames.js.map +1 -1
- package/dist/esm/core/agent/evidence/gate.d.ts +6 -0
- package/dist/esm/core/agent/evidence/gate.js +11 -3
- package/dist/esm/core/agent/evidence/gate.js.map +1 -1
- package/dist/esm/core/agent/evidence/numericRanges.js +1 -1
- package/dist/esm/core/agent/evidence/numericRanges.js.map +1 -1
- package/dist/esm/core/agent/evidence/recovery.d.ts +2 -0
- package/dist/esm/core/agent/evidence/recovery.js +3 -1
- package/dist/esm/core/agent/evidence/recovery.js.map +1 -1
- package/dist/esm/core/agent/evidence/resultCarries.d.ts +2 -2
- package/dist/esm/core/agent/evidence/resultCarries.js +3 -3
- package/dist/esm/core/agent/evidence/resultCarries.js.map +1 -1
- package/dist/esm/core/agent/evidence/types.d.ts +17 -0
- package/dist/esm/core/agent/findings/context.d.ts +13 -0
- package/dist/esm/core/agent/findings/context.js +158 -0
- package/dist/esm/core/agent/findings/context.js.map +1 -0
- package/dist/esm/core/agent/findings/contingent.js +1 -1
- package/dist/esm/core/agent/findings/contingent.js.map +1 -1
- package/dist/esm/core/agent/findings/instruction.d.ts +12 -0
- package/dist/esm/core/agent/findings/instruction.js +22 -0
- package/dist/esm/core/agent/findings/instruction.js.map +1 -0
- package/dist/esm/core/agent/findings/ledger.d.ts +3 -0
- package/dist/esm/core/agent/findings/ledger.js +49 -0
- package/dist/esm/core/agent/findings/ledger.js.map +1 -1
- package/dist/esm/core/agent/findings/negativeProse.d.ts +1 -0
- package/dist/esm/core/agent/findings/negativeProse.js +49 -0
- package/dist/esm/core/agent/findings/negativeProse.js.map +1 -0
- package/dist/esm/core/agent/findings/offer.d.ts +9 -57
- package/dist/esm/core/agent/findings/offer.js +9 -57
- package/dist/esm/core/agent/findings/offer.js.map +1 -1
- package/dist/esm/core/agent/findings/reserved.d.ts +7 -31
- package/dist/esm/core/agent/findings/reserved.js +12 -83
- package/dist/esm/core/agent/findings/reserved.js.map +1 -1
- package/dist/esm/core/agent/findings/types.d.ts +11 -4
- package/dist/esm/core/agent/findings/types.js +3 -2
- package/dist/esm/core/agent/findings/types.js.map +1 -1
- package/dist/esm/core/agent/honesty/mounts.d.ts +7 -0
- package/dist/esm/core/agent/honesty/mounts.js +6 -0
- package/dist/esm/core/agent/honesty/mounts.js.map +1 -1
- package/dist/esm/core/agent/nativeOutputFormat.d.ts +2 -1
- package/dist/esm/core/agent/nativeOutputFormat.js +19 -1
- package/dist/esm/core/agent/nativeOutputFormat.js.map +1 -1
- package/dist/esm/core/agent/negativeClaims/capture.d.ts +65 -0
- package/dist/esm/core/agent/negativeClaims/capture.js +508 -0
- package/dist/esm/core/agent/negativeClaims/capture.js.map +1 -0
- package/dist/esm/core/agent/negativeClaims/checkpoint.d.ts +7 -0
- package/dist/esm/core/agent/negativeClaims/checkpoint.js +79 -0
- package/dist/esm/core/agent/negativeClaims/checkpoint.js.map +1 -0
- package/dist/esm/core/agent/negativeClaims/config.d.ts +66 -0
- package/dist/esm/core/agent/negativeClaims/config.js +185 -0
- package/dist/esm/core/agent/negativeClaims/config.js.map +1 -0
- package/dist/esm/core/agent/negativeClaims/delivery.d.ts +24 -0
- package/dist/esm/core/agent/negativeClaims/delivery.js +244 -0
- package/dist/esm/core/agent/negativeClaims/delivery.js.map +1 -0
- package/dist/esm/core/agent/negativeClaims/observe.d.ts +14 -0
- package/dist/esm/core/agent/negativeClaims/observe.js +34 -0
- package/dist/esm/core/agent/negativeClaims/observe.js.map +1 -0
- package/dist/esm/core/agent/negativeClaims/prose.d.ts +9 -0
- package/dist/esm/core/agent/negativeClaims/prose.js +112 -0
- package/dist/esm/core/agent/negativeClaims/prose.js.map +1 -0
- package/dist/esm/core/agent/negativeClaims/recheck.d.ts +7 -0
- package/dist/esm/core/agent/negativeClaims/recheck.js +32 -0
- package/dist/esm/core/agent/negativeClaims/recheck.js.map +1 -0
- package/dist/esm/core/agent/outputEnforcement.d.ts +5 -1
- package/dist/esm/core/agent/outputEnforcement.js.map +1 -1
- package/dist/esm/core/agent/receipt/receipt.d.ts +2 -2
- package/dist/esm/core/agent/stages/answerEvidence.d.ts +28 -0
- package/dist/esm/core/agent/stages/answerEvidence.js +16 -0
- package/dist/esm/core/agent/stages/answerEvidence.js.map +1 -0
- package/dist/esm/core/agent/stages/answerValidation.d.ts +15 -3
- package/dist/esm/core/agent/stages/answerValidation.js +113 -5
- package/dist/esm/core/agent/stages/answerValidation.js.map +1 -1
- package/dist/esm/core/agent/stages/callLLM.d.ts +11 -2
- package/dist/esm/core/agent/stages/callLLM.js +85 -44
- package/dist/esm/core/agent/stages/callLLM.js.map +1 -1
- package/dist/esm/core/agent/stages/evidenceRecheck.d.ts +6 -1
- package/dist/esm/core/agent/stages/evidenceRecheck.js +16 -2
- package/dist/esm/core/agent/stages/evidenceRecheck.js.map +1 -1
- package/dist/esm/core/agent/stages/outputRetry.js +23 -7
- package/dist/esm/core/agent/stages/outputRetry.js.map +1 -1
- package/dist/esm/core/agent/stages/prepareFinal.js +6 -1
- package/dist/esm/core/agent/stages/prepareFinal.js.map +1 -1
- package/dist/esm/core/agent/stages/reliabilityExecution.d.ts +3 -0
- package/dist/esm/core/agent/stages/reliabilityExecution.js +3 -0
- package/dist/esm/core/agent/stages/reliabilityExecution.js.map +1 -1
- package/dist/esm/core/agent/stages/route.d.ts +8 -2
- package/dist/esm/core/agent/stages/route.js +81 -33
- package/dist/esm/core/agent/stages/route.js.map +1 -1
- package/dist/esm/core/agent/stages/searchCoverage.d.ts +94 -0
- package/dist/esm/core/agent/stages/searchCoverage.js +117 -0
- package/dist/esm/core/agent/stages/searchCoverage.js.map +1 -0
- package/dist/esm/core/agent/stages/seed.d.ts +10 -0
- package/dist/esm/core/agent/stages/seed.js +19 -21
- package/dist/esm/core/agent/stages/seed.js.map +1 -1
- package/dist/esm/core/agent/stages/toolCalls.d.ts +16 -0
- package/dist/esm/core/agent/stages/toolCalls.js +700 -77
- package/dist/esm/core/agent/stages/toolCalls.js.map +1 -1
- package/dist/esm/core/agent/toolChoice/compose.d.ts +2 -0
- package/dist/esm/core/agent/toolChoice/compose.js +1 -0
- package/dist/esm/core/agent/toolChoice/compose.js.map +1 -1
- package/dist/esm/core/agent/toolChoice/pick.d.ts +2 -0
- package/dist/esm/core/agent/toolChoice/pick.js +2 -0
- package/dist/esm/core/agent/toolChoice/pick.js.map +1 -1
- package/dist/esm/core/agent/toolChoice/types.d.ts +1 -1
- package/dist/esm/core/agent/types.d.ts +86 -5
- package/dist/esm/core/checkin.d.ts +83 -7
- package/dist/esm/core/checkin.js +77 -15
- package/dist/esm/core/checkin.js.map +1 -1
- package/dist/esm/core/consentRequest.d.ts +488 -0
- package/dist/esm/core/consentRequest.js +817 -0
- package/dist/esm/core/consentRequest.js.map +1 -0
- package/dist/esm/core/pause.d.ts +88 -7
- package/dist/esm/core/pause.js +102 -5
- package/dist/esm/core/pause.js.map +1 -1
- package/dist/esm/core/runCheckpoint.d.ts +5 -1
- package/dist/esm/core/runCheckpoint.js +8 -1
- package/dist/esm/core/runCheckpoint.js.map +1 -1
- package/dist/esm/core/slots/buildToolsSlot.d.ts +4 -11
- package/dist/esm/core/slots/buildToolsSlot.js +4 -24
- package/dist/esm/core/slots/buildToolsSlot.js.map +1 -1
- package/dist/esm/debug.d.ts +1 -1
- package/dist/esm/debug.js +2 -0
- package/dist/esm/debug.js.map +1 -1
- package/dist/esm/events/payloads.d.ts +145 -3
- package/dist/esm/events/registry.d.ts +3 -1
- package/dist/esm/events/registry.js +2 -0
- package/dist/esm/events/registry.js.map +1 -1
- package/dist/esm/hosting/answeredPause.d.ts +301 -0
- package/dist/esm/hosting/answeredPause.js +522 -0
- package/dist/esm/hosting/answeredPause.js.map +1 -0
- package/dist/esm/hosting/conformance/cases.js +81 -1
- package/dist/esm/hosting/conformance/cases.js.map +1 -1
- package/dist/esm/hosting/conformance/types.d.ts +1 -1
- package/dist/esm/hosting/envelope.d.ts +6 -0
- package/dist/esm/hosting/envelope.js +14 -0
- package/dist/esm/hosting/envelope.js.map +1 -1
- package/dist/esm/hosting/errors.d.ts +14 -2
- package/dist/esm/hosting/errors.js +13 -6
- package/dist/esm/hosting/errors.js.map +1 -1
- package/dist/esm/hosting/index.d.ts +2 -1
- package/dist/esm/hosting/index.js +3 -0
- package/dist/esm/hosting/index.js.map +1 -1
- package/dist/esm/hosting/memorySessions.js +10 -2
- package/dist/esm/hosting/memorySessions.js.map +1 -1
- package/dist/esm/hosting/processLocalStore.d.ts +20 -0
- package/dist/esm/hosting/processLocalStore.js +26 -0
- package/dist/esm/hosting/processLocalStore.js.map +1 -0
- package/dist/esm/hosting/protocolAdapter.d.ts +13 -0
- package/dist/esm/hosting/refusalStatus.d.ts +6 -0
- package/dist/esm/hosting/refusalStatus.js +13 -0
- package/dist/esm/hosting/refusalStatus.js.map +1 -1
- package/dist/esm/hosting/sessionWire.d.ts +8 -3
- package/dist/esm/hosting/sessionWire.js.map +1 -1
- package/dist/esm/hosting/sqliteSessions.js +27 -3
- package/dist/esm/hosting/sqliteSessions.js.map +1 -1
- package/dist/esm/hosting/standingAgent.js +70 -26
- package/dist/esm/hosting/standingAgent.js.map +1 -1
- package/dist/esm/hosting/streamHandler.d.ts +3 -1
- package/dist/esm/hosting/streamHandler.js +150 -32
- package/dist/esm/hosting/streamHandler.js.map +1 -1
- package/dist/esm/hosting/types.d.ts +28 -6
- package/dist/esm/hosting/types.js.map +1 -1
- package/dist/esm/index.d.ts +7 -3
- package/dist/esm/index.js +21 -17
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/integrity/negative-claim/anchor.d.ts +9 -0
- package/dist/esm/integrity/negative-claim/anchor.js +120 -0
- package/dist/esm/integrity/negative-claim/anchor.js.map +1 -0
- package/dist/esm/integrity/negative-claim/citation.d.ts +34 -0
- package/dist/esm/integrity/negative-claim/citation.js +367 -0
- package/dist/esm/integrity/negative-claim/citation.js.map +1 -0
- package/dist/esm/integrity/negative-claim/containment.d.ts +40 -0
- package/dist/esm/integrity/negative-claim/containment.js +257 -0
- package/dist/esm/integrity/negative-claim/containment.js.map +1 -0
- package/dist/esm/integrity/negative-claim/derive.d.ts +17 -0
- package/dist/esm/integrity/negative-claim/derive.js +122 -0
- package/dist/esm/integrity/negative-claim/derive.js.map +1 -0
- package/dist/esm/integrity/negative-claim/detect.d.ts +44 -0
- package/dist/esm/integrity/negative-claim/detect.js +65 -0
- package/dist/esm/integrity/negative-claim/detect.js.map +1 -0
- package/dist/esm/integrity/negative-claim/judge.d.ts +41 -0
- package/dist/esm/integrity/negative-claim/judge.js +95 -0
- package/dist/esm/integrity/negative-claim/judge.js.map +1 -0
- package/dist/esm/integrity/negative-claim/language.d.ts +14 -0
- package/dist/esm/integrity/negative-claim/language.js +42 -0
- package/dist/esm/integrity/negative-claim/language.js.map +1 -0
- package/dist/esm/integrity/negative-claim/limits.d.ts +2 -0
- package/dist/esm/integrity/negative-claim/limits.js +3 -0
- package/dist/esm/integrity/negative-claim/limits.js.map +1 -0
- package/dist/esm/integrity/negative-claim/matcher.d.ts +51 -0
- package/dist/esm/integrity/negative-claim/matcher.js +164 -0
- package/dist/esm/integrity/negative-claim/matcher.js.map +1 -0
- package/dist/esm/integrity/negative-claim/noRead.d.ts +8 -0
- package/dist/esm/integrity/negative-claim/noRead.js +9 -0
- package/dist/esm/integrity/negative-claim/noRead.js.map +1 -0
- package/dist/esm/integrity/negative-claim/phrases.d.ts +69 -0
- package/dist/esm/integrity/negative-claim/phrases.js +249 -0
- package/dist/esm/integrity/negative-claim/phrases.js.map +1 -0
- package/dist/esm/integrity/negative-claim/prose.d.ts +36 -0
- package/dist/esm/integrity/negative-claim/prose.js +143 -0
- package/dist/esm/integrity/negative-claim/prose.js.map +1 -0
- package/dist/esm/integrity/negative-claim/readings.d.ts +81 -0
- package/dist/esm/integrity/negative-claim/readings.js +322 -0
- package/dist/esm/integrity/negative-claim/readings.js.map +1 -0
- package/dist/esm/integrity/negative-claim/resolve.d.ts +37 -0
- package/dist/esm/integrity/negative-claim/resolve.js +179 -0
- package/dist/esm/integrity/negative-claim/resolve.js.map +1 -0
- package/dist/esm/integrity/negative-claim/statement.d.ts +75 -0
- package/dist/esm/integrity/negative-claim/statement.js +361 -0
- package/dist/esm/integrity/negative-claim/statement.js.map +1 -0
- package/dist/esm/integrity/negative-claim/types.d.ts +144 -0
- package/dist/esm/integrity/negative-claim/types.js +39 -0
- package/dist/esm/integrity/negative-claim/types.js.map +1 -0
- package/dist/esm/integrity/negative-claim/units.d.ts +33 -0
- package/dist/esm/integrity/negative-claim/units.js +185 -0
- package/dist/esm/integrity/negative-claim/units.js.map +1 -0
- package/dist/esm/integrity/negative-claim/work.d.ts +12 -0
- package/dist/esm/integrity/negative-claim/work.js +19 -0
- package/dist/esm/integrity/negative-claim/work.js.map +1 -0
- package/dist/esm/integrity/unsupported-claim/check.d.ts +33 -0
- package/dist/esm/integrity/unsupported-claim/check.js +48 -26
- package/dist/esm/integrity/unsupported-claim/check.js.map +1 -1
- package/dist/esm/integrity/unsupported-claim/delivered.d.ts +72 -0
- package/dist/esm/integrity/unsupported-claim/delivered.js +98 -0
- package/dist/esm/integrity/unsupported-claim/delivered.js.map +1 -0
- package/dist/esm/integrity/unsupported-claim/evaluate.d.ts +103 -1
- package/dist/esm/integrity/unsupported-claim/evaluate.js +373 -0
- package/dist/esm/integrity/unsupported-claim/evaluate.js.map +1 -1
- package/dist/esm/lib/conventions.d.ts +1 -0
- package/dist/esm/lib/conventions.js +3 -0
- package/dist/esm/lib/conventions.js.map +1 -1
- package/dist/esm/lib/frozenCopy.d.ts +75 -0
- package/dist/esm/lib/frozenCopy.js +198 -0
- package/dist/esm/lib/frozenCopy.js.map +1 -0
- package/dist/esm/lib/jsonFaithful.d.ts +34 -0
- package/dist/esm/lib/jsonFaithful.js +111 -0
- package/dist/esm/lib/jsonFaithful.js.map +1 -0
- package/dist/esm/lib/normalize.d.ts +96 -0
- package/dist/esm/{tools → lib}/normalize.js +142 -6
- package/dist/esm/lib/normalize.js.map +1 -0
- package/dist/esm/lib/saidByPerson.d.ts +2 -0
- package/dist/esm/lib/saidByPerson.js +3 -0
- package/dist/esm/lib/saidByPerson.js.map +1 -1
- package/dist/esm/mcp/toolExtras.d.ts +10 -0
- package/dist/esm/mcp/toolExtras.js +11 -0
- package/dist/esm/mcp/toolExtras.js.map +1 -1
- package/dist/esm/provider-contract/nativeOutputSchema.d.ts +6 -2
- package/dist/esm/provider-contract/nativeOutputSchema.js +9 -2
- package/dist/esm/provider-contract/nativeOutputSchema.js.map +1 -1
- package/dist/esm/provider-contract/types.d.ts +12 -1
- package/dist/esm/provider-contract/types.js.map +1 -1
- package/dist/esm/recorders/core/CheckInRecorder.d.ts +6 -1
- package/dist/esm/recorders/core/CheckInRecorder.js +5 -1
- package/dist/esm/recorders/core/CheckInRecorder.js.map +1 -1
- package/dist/esm/redaction/conversation.js +6 -0
- package/dist/esm/redaction/conversation.js.map +1 -1
- package/dist/esm/redaction/knownStrings.d.ts +9 -7
- package/dist/esm/redaction/knownStrings.js +74 -0
- package/dist/esm/redaction/knownStrings.js.map +1 -1
- package/dist/esm/resilience/withCircuitBreaker.js +3 -0
- package/dist/esm/resilience/withCircuitBreaker.js.map +1 -1
- package/dist/esm/resilience/withFallback.js +8 -1
- package/dist/esm/resilience/withFallback.js.map +1 -1
- package/dist/esm/resilience/withRetry.js +3 -0
- package/dist/esm/resilience/withRetry.js.map +1 -1
- package/dist/esm/semantics/check.d.ts +44 -2
- package/dist/esm/semantics/check.js +112 -3
- package/dist/esm/semantics/check.js.map +1 -1
- package/dist/esm/semantics/cli.js +33 -3
- package/dist/esm/semantics/cli.js.map +1 -1
- package/dist/esm/semantics/coverage/absent.d.ts +19 -2
- package/dist/esm/semantics/coverage/absent.js +56 -52
- package/dist/esm/semantics/coverage/absent.js.map +1 -1
- package/dist/esm/semantics/coverage/among.d.ts +73 -0
- package/dist/esm/semantics/coverage/among.js +172 -0
- package/dist/esm/semantics/coverage/among.js.map +1 -0
- package/dist/esm/semantics/coverage/composedCoverage.d.ts +220 -0
- package/dist/esm/semantics/coverage/composedCoverage.js +42 -0
- package/dist/esm/semantics/coverage/composedCoverage.js.map +1 -0
- package/dist/esm/semantics/coverage/evidence.js +27 -2
- package/dist/esm/semantics/coverage/evidence.js.map +1 -1
- package/dist/esm/semantics/coverage/index.d.ts +4 -1
- package/dist/esm/semantics/coverage/index.js +2 -0
- package/dist/esm/semantics/coverage/index.js.map +1 -1
- package/dist/esm/semantics/coverage/ledger.d.ts +2 -1
- package/dist/esm/semantics/coverage/ledger.js +15 -53
- package/dist/esm/semantics/coverage/ledger.js.map +1 -1
- package/dist/esm/semantics/coverage/read.d.ts +19 -0
- package/dist/esm/semantics/coverage/read.js.map +1 -1
- package/dist/esm/semantics/coverage/recognize.d.ts +17 -1
- package/dist/esm/semantics/coverage/recognize.js +40 -0
- package/dist/esm/semantics/coverage/recognize.js.map +1 -1
- package/dist/esm/semantics/coverage/search/binding.d.ts +27 -0
- package/dist/esm/semantics/coverage/search/binding.js +42 -0
- package/dist/esm/semantics/coverage/search/binding.js.map +1 -0
- package/dist/esm/semantics/coverage/search/compose.d.ts +90 -0
- package/dist/esm/semantics/coverage/search/compose.js +120 -0
- package/dist/esm/semantics/coverage/search/compose.js.map +1 -0
- package/dist/esm/semantics/coverage/search/declaration.d.ts +75 -0
- package/dist/esm/semantics/coverage/search/declaration.js +453 -0
- package/dist/esm/semantics/coverage/search/declaration.js.map +1 -0
- package/dist/esm/semantics/coverage/search/door.d.ts +46 -0
- package/dist/esm/semantics/coverage/search/door.js +130 -0
- package/dist/esm/semantics/coverage/search/door.js.map +1 -0
- package/dist/esm/semantics/coverage/search/events.d.ts +42 -0
- package/dist/esm/semantics/coverage/search/events.js +100 -0
- package/dist/esm/semantics/coverage/search/events.js.map +1 -0
- package/dist/esm/semantics/coverage/search/facets.d.ts +52 -0
- package/dist/esm/semantics/coverage/search/facets.js +191 -0
- package/dist/esm/semantics/coverage/search/facets.js.map +1 -0
- package/dist/esm/semantics/coverage/search/gaps.d.ts +63 -0
- package/dist/esm/semantics/coverage/search/gaps.js +221 -0
- package/dist/esm/semantics/coverage/search/gaps.js.map +1 -0
- package/dist/esm/semantics/coverage/search/inEffect.d.ts +65 -0
- package/dist/esm/semantics/coverage/search/inEffect.js +48 -0
- package/dist/esm/semantics/coverage/search/inEffect.js.map +1 -0
- package/dist/esm/semantics/coverage/search/resultFacts.d.ts +42 -0
- package/dist/esm/semantics/coverage/search/resultFacts.js +100 -0
- package/dist/esm/semantics/coverage/search/resultFacts.js.map +1 -0
- package/dist/esm/semantics/coverage/search/review.d.ts +36 -0
- package/dist/esm/semantics/coverage/search/review.js +89 -0
- package/dist/esm/semantics/coverage/search/review.js.map +1 -0
- package/dist/esm/semantics/coverage/search/served.d.ts +51 -0
- package/dist/esm/semantics/coverage/search/served.js +130 -0
- package/dist/esm/semantics/coverage/search/served.js.map +1 -0
- package/dist/esm/semantics/coverage/search/span.d.ts +34 -0
- package/dist/esm/semantics/coverage/search/span.js +61 -0
- package/dist/esm/semantics/coverage/search/span.js.map +1 -0
- package/dist/esm/semantics/coverage/search/statementText.d.ts +46 -0
- package/dist/esm/semantics/coverage/search/statementText.js +102 -0
- package/dist/esm/semantics/coverage/search/statementText.js.map +1 -0
- package/dist/esm/semantics/coverage/search/types.d.ts +120 -0
- package/dist/esm/semantics/coverage/search/types.js +11 -0
- package/dist/esm/semantics/coverage/search/types.js.map +1 -0
- package/dist/esm/semantics/coverage/search/valueWords.d.ts +22 -0
- package/dist/esm/semantics/coverage/search/valueWords.js +32 -0
- package/dist/esm/semantics/coverage/search/valueWords.js.map +1 -0
- package/dist/esm/semantics/coverage/types.d.ts +163 -0
- package/dist/esm/semantics/described.js +3 -1
- package/dist/esm/semantics/described.js.map +1 -1
- package/dist/esm/semantics/envelope.js +26 -2
- package/dist/esm/semantics/envelope.js.map +1 -1
- package/dist/esm/semantics/index.d.ts +2 -1
- package/dist/esm/semantics/index.js.map +1 -1
- package/dist/esm/semantics/overclaim.d.ts +105 -0
- package/dist/esm/semantics/overclaim.js +397 -0
- package/dist/esm/semantics/overclaim.js.map +1 -0
- package/dist/esm/semantics/types.d.ts +13 -0
- package/dist/esm/semantics/types.js.map +1 -1
- package/dist/esm/time/forms.js +1 -1
- package/dist/esm/time/textForms.js +1 -1
- package/dist/esm/time-travel/servedView.d.ts +2 -2
- package/dist/esm/time-travel/servedView.js +52 -160
- package/dist/esm/time-travel/servedView.js.map +1 -1
- package/dist/esm/tools/declare.d.ts +1 -1
- package/dist/esm/tools/declare.js +2 -2
- package/dist/esm/tools/declare.js.map +1 -1
- package/dist/esm/tools/hostFilled.d.ts +20 -1
- package/dist/esm/tools/hostFilled.js +46 -1
- package/dist/esm/tools/hostFilled.js.map +1 -1
- package/dist/esm/tools/searchOf.d.ts +60 -0
- package/dist/esm/tools/searchOf.js +97 -0
- package/dist/esm/tools/searchOf.js.map +1 -0
- package/dist/esm/tools/tools.d.ts +49 -0
- package/dist/esm/tools/tools.js +76 -1
- package/dist/esm/tools/tools.js.map +1 -1
- package/dist/esm/trace-toolpack/causeCapture.d.ts +17 -0
- package/dist/esm/trace-toolpack/causeCapture.js +96 -0
- package/dist/esm/trace-toolpack/causeCapture.js.map +1 -0
- package/dist/esm/trace-toolpack/causeControl.d.ts +6 -0
- package/dist/esm/trace-toolpack/causeControl.js +45 -0
- package/dist/esm/trace-toolpack/causeControl.js.map +1 -0
- package/dist/esm/trace-toolpack/causeReader.js +11 -9
- package/dist/esm/trace-toolpack/causeReader.js.map +1 -1
- package/dist/esm/trace-toolpack/causeResponse.d.ts +3 -2
- package/dist/esm/trace-toolpack/causeResponse.js +27 -7
- package/dist/esm/trace-toolpack/causeResponse.js.map +1 -1
- package/dist/esm/trace-toolpack/causeSnapshot.d.ts +6 -1
- package/dist/esm/trace-toolpack/causeSnapshot.js +26 -15
- package/dist/esm/trace-toolpack/causeSnapshot.js.map +1 -1
- package/dist/esm/trace-toolpack/causeTools.js +1 -1
- package/dist/esm/trace-toolpack/causeTools.js.map +1 -1
- package/dist/events/registry.js +2 -0
- package/dist/events/registry.js.map +1 -1
- package/dist/hosting/answeredPause.js +536 -0
- package/dist/hosting/answeredPause.js.map +1 -0
- package/dist/hosting/conformance/cases.js +80 -0
- package/dist/hosting/conformance/cases.js.map +1 -1
- package/dist/hosting/envelope.js +14 -0
- package/dist/hosting/envelope.js.map +1 -1
- package/dist/hosting/errors.js +13 -6
- package/dist/hosting/errors.js.map +1 -1
- package/dist/hosting/index.js +7 -3
- package/dist/hosting/index.js.map +1 -1
- package/dist/hosting/memorySessions.js +10 -2
- package/dist/hosting/memorySessions.js.map +1 -1
- package/dist/hosting/processLocalStore.js +31 -0
- package/dist/hosting/processLocalStore.js.map +1 -0
- package/dist/hosting/refusalStatus.js +13 -0
- package/dist/hosting/refusalStatus.js.map +1 -1
- package/dist/hosting/sessionWire.js.map +1 -1
- package/dist/hosting/sqliteSessions.js +27 -3
- package/dist/hosting/sqliteSessions.js.map +1 -1
- package/dist/hosting/standingAgent.js +69 -25
- package/dist/hosting/standingAgent.js.map +1 -1
- package/dist/hosting/streamHandler.js +149 -31
- package/dist/hosting/streamHandler.js.map +1 -1
- package/dist/hosting/types.js.map +1 -1
- package/dist/index.js +26 -21
- package/dist/index.js.map +1 -1
- package/dist/integrity/negative-claim/anchor.js +124 -0
- package/dist/integrity/negative-claim/anchor.js.map +1 -0
- package/dist/integrity/negative-claim/citation.js +371 -0
- package/dist/integrity/negative-claim/citation.js.map +1 -0
- package/dist/integrity/negative-claim/containment.js +262 -0
- package/dist/integrity/negative-claim/containment.js.map +1 -0
- package/dist/integrity/negative-claim/derive.js +130 -0
- package/dist/integrity/negative-claim/derive.js.map +1 -0
- package/dist/integrity/negative-claim/detect.js +69 -0
- package/dist/integrity/negative-claim/detect.js.map +1 -0
- package/dist/integrity/negative-claim/judge.js +100 -0
- package/dist/integrity/negative-claim/judge.js.map +1 -0
- package/dist/integrity/negative-claim/language.js +46 -0
- package/dist/integrity/negative-claim/language.js.map +1 -0
- package/dist/integrity/negative-claim/limits.js +6 -0
- package/dist/integrity/negative-claim/limits.js.map +1 -0
- package/dist/integrity/negative-claim/matcher.js +179 -0
- package/dist/integrity/negative-claim/matcher.js.map +1 -0
- package/dist/integrity/negative-claim/noRead.js +13 -0
- package/dist/integrity/negative-claim/noRead.js.map +1 -0
- package/dist/integrity/negative-claim/phrases.js +253 -0
- package/dist/integrity/negative-claim/phrases.js.map +1 -0
- package/dist/integrity/negative-claim/prose.js +147 -0
- package/dist/integrity/negative-claim/prose.js.map +1 -0
- package/dist/integrity/negative-claim/readings.js +338 -0
- package/dist/integrity/negative-claim/readings.js.map +1 -0
- package/dist/integrity/negative-claim/resolve.js +184 -0
- package/dist/integrity/negative-claim/resolve.js.map +1 -0
- package/dist/integrity/negative-claim/statement.js +369 -0
- package/dist/integrity/negative-claim/statement.js.map +1 -0
- package/dist/integrity/negative-claim/types.js +42 -0
- package/dist/integrity/negative-claim/types.js.map +1 -0
- package/dist/integrity/negative-claim/units.js +190 -0
- package/dist/integrity/negative-claim/units.js.map +1 -0
- package/dist/integrity/negative-claim/work.js +24 -0
- package/dist/integrity/negative-claim/work.js.map +1 -0
- package/dist/integrity/unsupported-claim/check.js +50 -27
- package/dist/integrity/unsupported-claim/check.js.map +1 -1
- package/dist/integrity/unsupported-claim/delivered.js +102 -0
- package/dist/integrity/unsupported-claim/delivered.js.map +1 -0
- package/dist/integrity/unsupported-claim/evaluate.js +377 -1
- package/dist/integrity/unsupported-claim/evaluate.js.map +1 -1
- package/dist/lib/conventions.js +3 -0
- package/dist/lib/conventions.js.map +1 -1
- package/dist/lib/frozenCopy.js +207 -0
- package/dist/lib/frozenCopy.js.map +1 -0
- package/dist/lib/jsonFaithful.js +115 -0
- package/dist/lib/jsonFaithful.js.map +1 -0
- package/dist/{tools → lib}/normalize.js +151 -7
- package/dist/lib/normalize.js.map +1 -0
- package/dist/lib/saidByPerson.js +4 -1
- package/dist/lib/saidByPerson.js.map +1 -1
- package/dist/mcp/toolExtras.js +11 -0
- package/dist/mcp/toolExtras.js.map +1 -1
- package/dist/provider-contract/nativeOutputSchema.js +11 -3
- package/dist/provider-contract/nativeOutputSchema.js.map +1 -1
- package/dist/provider-contract/types.js.map +1 -1
- package/dist/recorders/core/CheckInRecorder.js +5 -1
- package/dist/recorders/core/CheckInRecorder.js.map +1 -1
- package/dist/redaction/conversation.js +6 -0
- package/dist/redaction/conversation.js.map +1 -1
- package/dist/redaction/knownStrings.js +74 -0
- package/dist/redaction/knownStrings.js.map +1 -1
- package/dist/resilience/withCircuitBreaker.js +3 -0
- package/dist/resilience/withCircuitBreaker.js.map +1 -1
- package/dist/resilience/withFallback.js +7 -0
- package/dist/resilience/withFallback.js.map +1 -1
- package/dist/resilience/withRetry.js +3 -0
- package/dist/resilience/withRetry.js.map +1 -1
- package/dist/semantics/check.js +112 -3
- package/dist/semantics/check.js.map +1 -1
- package/dist/semantics/cli.js +32 -2
- package/dist/semantics/cli.js.map +1 -1
- package/dist/semantics/coverage/absent.js +56 -52
- package/dist/semantics/coverage/absent.js.map +1 -1
- package/dist/semantics/coverage/among.js +177 -0
- package/dist/semantics/coverage/among.js.map +1 -0
- package/dist/semantics/coverage/composedCoverage.js +46 -0
- package/dist/semantics/coverage/composedCoverage.js.map +1 -0
- package/dist/semantics/coverage/evidence.js +27 -2
- package/dist/semantics/coverage/evidence.js.map +1 -1
- package/dist/semantics/coverage/index.js +5 -1
- package/dist/semantics/coverage/index.js.map +1 -1
- package/dist/semantics/coverage/ledger.js +18 -56
- package/dist/semantics/coverage/ledger.js.map +1 -1
- package/dist/semantics/coverage/read.js.map +1 -1
- package/dist/semantics/coverage/recognize.js +43 -1
- package/dist/semantics/coverage/recognize.js.map +1 -1
- package/dist/semantics/coverage/search/binding.js +46 -0
- package/dist/semantics/coverage/search/binding.js.map +1 -0
- package/dist/semantics/coverage/search/compose.js +124 -0
- package/dist/semantics/coverage/search/compose.js.map +1 -0
- package/dist/semantics/coverage/search/declaration.js +462 -0
- package/dist/semantics/coverage/search/declaration.js.map +1 -0
- package/dist/semantics/coverage/search/door.js +134 -0
- package/dist/semantics/coverage/search/door.js.map +1 -0
- package/dist/semantics/coverage/search/events.js +104 -0
- package/dist/semantics/coverage/search/events.js.map +1 -0
- package/dist/semantics/coverage/search/facets.js +196 -0
- package/dist/semantics/coverage/search/facets.js.map +1 -0
- package/dist/semantics/coverage/search/gaps.js +226 -0
- package/dist/semantics/coverage/search/gaps.js.map +1 -0
- package/dist/semantics/coverage/search/inEffect.js +52 -0
- package/dist/semantics/coverage/search/inEffect.js.map +1 -0
- package/dist/semantics/coverage/search/resultFacts.js +109 -0
- package/dist/semantics/coverage/search/resultFacts.js.map +1 -0
- package/dist/semantics/coverage/search/review.js +93 -0
- package/dist/semantics/coverage/search/review.js.map +1 -0
- package/dist/semantics/coverage/search/served.js +137 -0
- package/dist/semantics/coverage/search/served.js.map +1 -0
- package/dist/semantics/coverage/search/span.js +66 -0
- package/dist/semantics/coverage/search/span.js.map +1 -0
- package/dist/semantics/coverage/search/statementText.js +107 -0
- package/dist/semantics/coverage/search/statementText.js.map +1 -0
- package/dist/semantics/coverage/search/types.js +12 -0
- package/dist/semantics/coverage/search/types.js.map +1 -0
- package/dist/semantics/coverage/search/valueWords.js +36 -0
- package/dist/semantics/coverage/search/valueWords.js.map +1 -0
- package/dist/semantics/described.js +3 -1
- package/dist/semantics/described.js.map +1 -1
- package/dist/semantics/envelope.js +26 -2
- package/dist/semantics/envelope.js.map +1 -1
- package/dist/semantics/index.js.map +1 -1
- package/dist/semantics/overclaim.js +407 -0
- package/dist/semantics/overclaim.js.map +1 -0
- package/dist/semantics/types.js.map +1 -1
- package/dist/time/forms.js +1 -1
- package/dist/time/textForms.js +1 -1
- package/dist/time-travel/servedView.js +51 -159
- package/dist/time-travel/servedView.js.map +1 -1
- package/dist/tools/declare.js +2 -2
- package/dist/tools/declare.js.map +1 -1
- package/dist/tools/hostFilled.js +48 -2
- package/dist/tools/hostFilled.js.map +1 -1
- package/dist/tools/searchOf.js +104 -0
- package/dist/tools/searchOf.js.map +1 -0
- package/dist/tools/tools.js +80 -2
- package/dist/tools/tools.js.map +1 -1
- package/dist/trace-toolpack/causeCapture.js +103 -0
- package/dist/trace-toolpack/causeCapture.js.map +1 -0
- package/dist/trace-toolpack/causeControl.js +49 -0
- package/dist/trace-toolpack/causeControl.js.map +1 -0
- package/dist/trace-toolpack/causeReader.js +11 -9
- package/dist/trace-toolpack/causeReader.js.map +1 -1
- package/dist/trace-toolpack/causeResponse.js +27 -7
- package/dist/trace-toolpack/causeResponse.js.map +1 -1
- package/dist/trace-toolpack/causeSnapshot.js +31 -20
- package/dist/trace-toolpack/causeSnapshot.js.map +1 -1
- package/dist/trace-toolpack/causeTools.js +1 -1
- package/dist/trace-toolpack/causeTools.js.map +1 -1
- package/dist/types/adapters/hosting/agentCoreA2A.d.ts.map +1 -1
- package/dist/types/adapters/hosting/firestoreSessions.d.ts.map +1 -1
- package/dist/types/adapters/hosting/googleAgentEngine.d.ts.map +1 -1
- package/dist/types/adapters/llm/AnthropicProvider.d.ts +1 -0
- package/dist/types/adapters/llm/AnthropicProvider.d.ts.map +1 -1
- package/dist/types/adapters/llm/BrowserAnthropicProvider.d.ts +1 -0
- package/dist/types/adapters/llm/BrowserAnthropicProvider.d.ts.map +1 -1
- package/dist/types/adapters/llm/MockProvider.d.ts +2 -0
- package/dist/types/adapters/llm/MockProvider.d.ts.map +1 -1
- package/dist/types/ag-ui/request.d.ts +4 -1
- package/dist/types/ag-ui/request.d.ts.map +1 -1
- package/dist/types/ag-ui/serializer.d.ts +15 -2
- package/dist/types/ag-ui/serializer.d.ts.map +1 -1
- package/dist/types/answer-account/facts/howSure.d.ts.map +1 -1
- package/dist/types/answer-account/templates.d.ts +4 -1
- package/dist/types/answer-account/templates.d.ts.map +1 -1
- package/dist/types/answer-validation/agentChecks.d.ts +76 -0
- package/dist/types/answer-validation/agentChecks.d.ts.map +1 -0
- package/dist/types/answer-validation/index.d.ts +2 -1
- package/dist/types/answer-validation/index.d.ts.map +1 -1
- package/dist/types/answer-validation/outputSchema.d.ts +18 -7
- package/dist/types/answer-validation/outputSchema.d.ts.map +1 -1
- package/dist/types/answer-validation/types.d.ts +125 -1
- package/dist/types/answer-validation/types.d.ts.map +1 -1
- package/dist/types/answer-validation/validate.d.ts +11 -2
- package/dist/types/answer-validation/validate.d.ts.map +1 -1
- package/dist/types/core/Agent.d.ts +25 -1
- package/dist/types/core/Agent.d.ts.map +1 -1
- package/dist/types/core/RunnerBase.d.ts.map +1 -1
- package/dist/types/core/agent/AgentBuilder.d.ts +43 -12
- package/dist/types/core/agent/AgentBuilder.d.ts.map +1 -1
- package/dist/types/core/agent/arguments/checks.d.ts +1 -1
- package/dist/types/core/agent/arguments/subflow.d.ts +6 -0
- package/dist/types/core/agent/arguments/subflow.d.ts.map +1 -1
- package/dist/types/core/agent/assessment/assess.d.ts.map +1 -1
- package/dist/types/core/agent/assessment/compose.d.ts.map +1 -1
- package/dist/types/core/agent/assessment/reasons.d.ts.map +1 -1
- package/dist/types/core/agent/assessment/types.d.ts +3 -2
- package/dist/types/core/agent/assessment/types.d.ts.map +1 -1
- package/dist/types/core/agent/buildAgentChart.d.ts +4 -12
- 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/buildToolRegistry.d.ts.map +1 -1
- package/dist/types/core/agent/composeRequest.d.ts +19 -0
- package/dist/types/core/agent/composeRequest.d.ts.map +1 -1
- package/dist/types/core/agent/evidence/extract.d.ts +45 -6
- package/dist/types/core/agent/evidence/extract.d.ts.map +1 -1
- package/dist/types/core/agent/evidence/frames.d.ts.map +1 -1
- package/dist/types/core/agent/evidence/gate.d.ts +6 -0
- package/dist/types/core/agent/evidence/gate.d.ts.map +1 -1
- package/dist/types/core/agent/evidence/recovery.d.ts +2 -0
- package/dist/types/core/agent/evidence/recovery.d.ts.map +1 -1
- package/dist/types/core/agent/evidence/resultCarries.d.ts +2 -2
- package/dist/types/core/agent/evidence/types.d.ts +17 -0
- package/dist/types/core/agent/evidence/types.d.ts.map +1 -1
- package/dist/types/core/agent/findings/context.d.ts +14 -0
- package/dist/types/core/agent/findings/context.d.ts.map +1 -0
- package/dist/types/core/agent/findings/instruction.d.ts +13 -0
- package/dist/types/core/agent/findings/instruction.d.ts.map +1 -0
- package/dist/types/core/agent/findings/ledger.d.ts +3 -0
- package/dist/types/core/agent/findings/ledger.d.ts.map +1 -1
- package/dist/types/core/agent/findings/negativeProse.d.ts +2 -0
- package/dist/types/core/agent/findings/negativeProse.d.ts.map +1 -0
- package/dist/types/core/agent/findings/offer.d.ts +9 -57
- package/dist/types/core/agent/findings/offer.d.ts.map +1 -1
- package/dist/types/core/agent/findings/reserved.d.ts +7 -31
- package/dist/types/core/agent/findings/reserved.d.ts.map +1 -1
- package/dist/types/core/agent/findings/types.d.ts +11 -4
- package/dist/types/core/agent/findings/types.d.ts.map +1 -1
- package/dist/types/core/agent/honesty/mounts.d.ts +7 -0
- package/dist/types/core/agent/honesty/mounts.d.ts.map +1 -1
- package/dist/types/core/agent/nativeOutputFormat.d.ts +2 -1
- package/dist/types/core/agent/nativeOutputFormat.d.ts.map +1 -1
- package/dist/types/core/agent/negativeClaims/capture.d.ts +66 -0
- package/dist/types/core/agent/negativeClaims/capture.d.ts.map +1 -0
- package/dist/types/core/agent/negativeClaims/checkpoint.d.ts +8 -0
- package/dist/types/core/agent/negativeClaims/checkpoint.d.ts.map +1 -0
- package/dist/types/core/agent/negativeClaims/config.d.ts +67 -0
- package/dist/types/core/agent/negativeClaims/config.d.ts.map +1 -0
- package/dist/types/core/agent/negativeClaims/delivery.d.ts +25 -0
- package/dist/types/core/agent/negativeClaims/delivery.d.ts.map +1 -0
- package/dist/types/core/agent/negativeClaims/observe.d.ts +15 -0
- package/dist/types/core/agent/negativeClaims/observe.d.ts.map +1 -0
- package/dist/types/core/agent/negativeClaims/prose.d.ts +10 -0
- package/dist/types/core/agent/negativeClaims/prose.d.ts.map +1 -0
- package/dist/types/core/agent/negativeClaims/recheck.d.ts +8 -0
- package/dist/types/core/agent/negativeClaims/recheck.d.ts.map +1 -0
- package/dist/types/core/agent/outputEnforcement.d.ts +5 -1
- package/dist/types/core/agent/outputEnforcement.d.ts.map +1 -1
- package/dist/types/core/agent/receipt/receipt.d.ts +2 -2
- package/dist/types/core/agent/receipt/receipt.d.ts.map +1 -1
- package/dist/types/core/agent/stages/answerEvidence.d.ts +29 -0
- package/dist/types/core/agent/stages/answerEvidence.d.ts.map +1 -0
- package/dist/types/core/agent/stages/answerValidation.d.ts +15 -3
- package/dist/types/core/agent/stages/answerValidation.d.ts.map +1 -1
- package/dist/types/core/agent/stages/callLLM.d.ts +11 -2
- package/dist/types/core/agent/stages/callLLM.d.ts.map +1 -1
- package/dist/types/core/agent/stages/evidenceRecheck.d.ts +6 -1
- package/dist/types/core/agent/stages/evidenceRecheck.d.ts.map +1 -1
- package/dist/types/core/agent/stages/outputRetry.d.ts.map +1 -1
- package/dist/types/core/agent/stages/prepareFinal.d.ts.map +1 -1
- package/dist/types/core/agent/stages/reliabilityExecution.d.ts +3 -0
- package/dist/types/core/agent/stages/reliabilityExecution.d.ts.map +1 -1
- package/dist/types/core/agent/stages/route.d.ts +8 -2
- package/dist/types/core/agent/stages/route.d.ts.map +1 -1
- package/dist/types/core/agent/stages/searchCoverage.d.ts +95 -0
- package/dist/types/core/agent/stages/searchCoverage.d.ts.map +1 -0
- package/dist/types/core/agent/stages/seed.d.ts +10 -0
- package/dist/types/core/agent/stages/seed.d.ts.map +1 -1
- package/dist/types/core/agent/stages/toolCalls.d.ts +16 -0
- package/dist/types/core/agent/stages/toolCalls.d.ts.map +1 -1
- package/dist/types/core/agent/toolChoice/compose.d.ts +2 -0
- package/dist/types/core/agent/toolChoice/compose.d.ts.map +1 -1
- package/dist/types/core/agent/toolChoice/pick.d.ts +2 -0
- package/dist/types/core/agent/toolChoice/pick.d.ts.map +1 -1
- package/dist/types/core/agent/toolChoice/types.d.ts +1 -1
- package/dist/types/core/agent/toolChoice/types.d.ts.map +1 -1
- package/dist/types/core/agent/types.d.ts +86 -5
- package/dist/types/core/agent/types.d.ts.map +1 -1
- package/dist/types/core/checkin.d.ts +83 -7
- package/dist/types/core/checkin.d.ts.map +1 -1
- package/dist/types/core/consentRequest.d.ts +489 -0
- package/dist/types/core/consentRequest.d.ts.map +1 -0
- package/dist/types/core/pause.d.ts +88 -7
- package/dist/types/core/pause.d.ts.map +1 -1
- package/dist/types/core/runCheckpoint.d.ts +5 -1
- package/dist/types/core/runCheckpoint.d.ts.map +1 -1
- package/dist/types/core/slots/buildToolsSlot.d.ts +4 -11
- package/dist/types/core/slots/buildToolsSlot.d.ts.map +1 -1
- package/dist/types/debug.d.ts +1 -1
- package/dist/types/debug.d.ts.map +1 -1
- package/dist/types/events/payloads.d.ts +145 -3
- package/dist/types/events/payloads.d.ts.map +1 -1
- package/dist/types/events/registry.d.ts +3 -1
- package/dist/types/events/registry.d.ts.map +1 -1
- package/dist/types/hosting/answeredPause.d.ts +302 -0
- package/dist/types/hosting/answeredPause.d.ts.map +1 -0
- package/dist/types/hosting/conformance/cases.d.ts.map +1 -1
- package/dist/types/hosting/conformance/types.d.ts +1 -1
- package/dist/types/hosting/conformance/types.d.ts.map +1 -1
- package/dist/types/hosting/envelope.d.ts +6 -0
- package/dist/types/hosting/envelope.d.ts.map +1 -1
- package/dist/types/hosting/errors.d.ts +14 -2
- package/dist/types/hosting/errors.d.ts.map +1 -1
- package/dist/types/hosting/index.d.ts +2 -1
- package/dist/types/hosting/index.d.ts.map +1 -1
- package/dist/types/hosting/memorySessions.d.ts.map +1 -1
- package/dist/types/hosting/processLocalStore.d.ts +21 -0
- package/dist/types/hosting/processLocalStore.d.ts.map +1 -0
- package/dist/types/hosting/protocolAdapter.d.ts +13 -0
- package/dist/types/hosting/protocolAdapter.d.ts.map +1 -1
- package/dist/types/hosting/refusalStatus.d.ts +6 -0
- package/dist/types/hosting/refusalStatus.d.ts.map +1 -1
- package/dist/types/hosting/sessionWire.d.ts +8 -3
- package/dist/types/hosting/sessionWire.d.ts.map +1 -1
- package/dist/types/hosting/sqliteSessions.d.ts.map +1 -1
- package/dist/types/hosting/standingAgent.d.ts.map +1 -1
- package/dist/types/hosting/streamHandler.d.ts +3 -1
- package/dist/types/hosting/streamHandler.d.ts.map +1 -1
- package/dist/types/hosting/types.d.ts +28 -6
- package/dist/types/hosting/types.d.ts.map +1 -1
- package/dist/types/index.d.ts +7 -3
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/integrity/negative-claim/anchor.d.ts +10 -0
- package/dist/types/integrity/negative-claim/anchor.d.ts.map +1 -0
- package/dist/types/integrity/negative-claim/citation.d.ts +35 -0
- package/dist/types/integrity/negative-claim/citation.d.ts.map +1 -0
- package/dist/types/integrity/negative-claim/containment.d.ts +41 -0
- package/dist/types/integrity/negative-claim/containment.d.ts.map +1 -0
- package/dist/types/integrity/negative-claim/derive.d.ts +18 -0
- package/dist/types/integrity/negative-claim/derive.d.ts.map +1 -0
- package/dist/types/integrity/negative-claim/detect.d.ts +45 -0
- package/dist/types/integrity/negative-claim/detect.d.ts.map +1 -0
- package/dist/types/integrity/negative-claim/judge.d.ts +42 -0
- package/dist/types/integrity/negative-claim/judge.d.ts.map +1 -0
- package/dist/types/integrity/negative-claim/language.d.ts +15 -0
- package/dist/types/integrity/negative-claim/language.d.ts.map +1 -0
- package/dist/types/integrity/negative-claim/limits.d.ts +3 -0
- package/dist/types/integrity/negative-claim/limits.d.ts.map +1 -0
- package/dist/types/integrity/negative-claim/matcher.d.ts +52 -0
- package/dist/types/integrity/negative-claim/matcher.d.ts.map +1 -0
- package/dist/types/integrity/negative-claim/noRead.d.ts +9 -0
- package/dist/types/integrity/negative-claim/noRead.d.ts.map +1 -0
- package/dist/types/integrity/negative-claim/phrases.d.ts +70 -0
- package/dist/types/integrity/negative-claim/phrases.d.ts.map +1 -0
- package/dist/types/integrity/negative-claim/prose.d.ts +37 -0
- package/dist/types/integrity/negative-claim/prose.d.ts.map +1 -0
- package/dist/types/integrity/negative-claim/readings.d.ts +82 -0
- package/dist/types/integrity/negative-claim/readings.d.ts.map +1 -0
- package/dist/types/integrity/negative-claim/resolve.d.ts +38 -0
- package/dist/types/integrity/negative-claim/resolve.d.ts.map +1 -0
- package/dist/types/integrity/negative-claim/statement.d.ts +76 -0
- package/dist/types/integrity/negative-claim/statement.d.ts.map +1 -0
- package/dist/types/integrity/negative-claim/types.d.ts +145 -0
- package/dist/types/integrity/negative-claim/types.d.ts.map +1 -0
- package/dist/types/integrity/negative-claim/units.d.ts +34 -0
- package/dist/types/integrity/negative-claim/units.d.ts.map +1 -0
- package/dist/types/integrity/negative-claim/work.d.ts +13 -0
- package/dist/types/integrity/negative-claim/work.d.ts.map +1 -0
- package/dist/types/integrity/unsupported-claim/check.d.ts +33 -0
- package/dist/types/integrity/unsupported-claim/check.d.ts.map +1 -1
- package/dist/types/integrity/unsupported-claim/delivered.d.ts +73 -0
- package/dist/types/integrity/unsupported-claim/delivered.d.ts.map +1 -0
- package/dist/types/integrity/unsupported-claim/evaluate.d.ts +103 -1
- package/dist/types/integrity/unsupported-claim/evaluate.d.ts.map +1 -1
- package/dist/types/lib/conventions.d.ts +1 -0
- package/dist/types/lib/conventions.d.ts.map +1 -1
- package/dist/types/lib/frozenCopy.d.ts +76 -0
- package/dist/types/lib/frozenCopy.d.ts.map +1 -0
- package/dist/types/lib/jsonFaithful.d.ts +35 -0
- package/dist/types/lib/jsonFaithful.d.ts.map +1 -0
- package/dist/types/lib/normalize.d.ts +97 -0
- package/dist/types/lib/normalize.d.ts.map +1 -0
- package/dist/types/lib/saidByPerson.d.ts +2 -0
- package/dist/types/lib/saidByPerson.d.ts.map +1 -1
- package/dist/types/mcp/toolExtras.d.ts +10 -0
- package/dist/types/mcp/toolExtras.d.ts.map +1 -1
- package/dist/types/provider-contract/nativeOutputSchema.d.ts +6 -2
- package/dist/types/provider-contract/nativeOutputSchema.d.ts.map +1 -1
- package/dist/types/provider-contract/types.d.ts +12 -1
- package/dist/types/provider-contract/types.d.ts.map +1 -1
- package/dist/types/recorders/core/CheckInRecorder.d.ts +6 -1
- package/dist/types/recorders/core/CheckInRecorder.d.ts.map +1 -1
- package/dist/types/redaction/conversation.d.ts.map +1 -1
- package/dist/types/redaction/knownStrings.d.ts +9 -7
- package/dist/types/redaction/knownStrings.d.ts.map +1 -1
- package/dist/types/resilience/withCircuitBreaker.d.ts.map +1 -1
- package/dist/types/resilience/withFallback.d.ts.map +1 -1
- package/dist/types/resilience/withRetry.d.ts.map +1 -1
- package/dist/types/semantics/check.d.ts +44 -2
- package/dist/types/semantics/check.d.ts.map +1 -1
- package/dist/types/semantics/cli.d.ts.map +1 -1
- package/dist/types/semantics/coverage/absent.d.ts +19 -2
- package/dist/types/semantics/coverage/absent.d.ts.map +1 -1
- package/dist/types/semantics/coverage/among.d.ts +74 -0
- package/dist/types/semantics/coverage/among.d.ts.map +1 -0
- package/dist/types/semantics/coverage/composedCoverage.d.ts +221 -0
- package/dist/types/semantics/coverage/composedCoverage.d.ts.map +1 -0
- package/dist/types/semantics/coverage/evidence.d.ts.map +1 -1
- package/dist/types/semantics/coverage/index.d.ts +4 -1
- package/dist/types/semantics/coverage/index.d.ts.map +1 -1
- package/dist/types/semantics/coverage/ledger.d.ts +2 -1
- package/dist/types/semantics/coverage/ledger.d.ts.map +1 -1
- package/dist/types/semantics/coverage/read.d.ts +19 -0
- package/dist/types/semantics/coverage/read.d.ts.map +1 -1
- package/dist/types/semantics/coverage/recognize.d.ts +17 -1
- package/dist/types/semantics/coverage/recognize.d.ts.map +1 -1
- package/dist/types/semantics/coverage/search/binding.d.ts +28 -0
- package/dist/types/semantics/coverage/search/binding.d.ts.map +1 -0
- package/dist/types/semantics/coverage/search/compose.d.ts +91 -0
- package/dist/types/semantics/coverage/search/compose.d.ts.map +1 -0
- package/dist/types/semantics/coverage/search/declaration.d.ts +76 -0
- package/dist/types/semantics/coverage/search/declaration.d.ts.map +1 -0
- package/dist/types/semantics/coverage/search/door.d.ts +47 -0
- package/dist/types/semantics/coverage/search/door.d.ts.map +1 -0
- package/dist/types/semantics/coverage/search/events.d.ts +43 -0
- package/dist/types/semantics/coverage/search/events.d.ts.map +1 -0
- package/dist/types/semantics/coverage/search/facets.d.ts +53 -0
- package/dist/types/semantics/coverage/search/facets.d.ts.map +1 -0
- package/dist/types/semantics/coverage/search/gaps.d.ts +64 -0
- package/dist/types/semantics/coverage/search/gaps.d.ts.map +1 -0
- package/dist/types/semantics/coverage/search/inEffect.d.ts +66 -0
- package/dist/types/semantics/coverage/search/inEffect.d.ts.map +1 -0
- package/dist/types/semantics/coverage/search/resultFacts.d.ts +43 -0
- package/dist/types/semantics/coverage/search/resultFacts.d.ts.map +1 -0
- package/dist/types/semantics/coverage/search/review.d.ts +37 -0
- package/dist/types/semantics/coverage/search/review.d.ts.map +1 -0
- package/dist/types/semantics/coverage/search/served.d.ts +52 -0
- package/dist/types/semantics/coverage/search/served.d.ts.map +1 -0
- package/dist/types/semantics/coverage/search/span.d.ts +35 -0
- package/dist/types/semantics/coverage/search/span.d.ts.map +1 -0
- package/dist/types/semantics/coverage/search/statementText.d.ts +47 -0
- package/dist/types/semantics/coverage/search/statementText.d.ts.map +1 -0
- package/dist/types/semantics/coverage/search/types.d.ts +121 -0
- package/dist/types/semantics/coverage/search/types.d.ts.map +1 -0
- package/dist/types/semantics/coverage/search/valueWords.d.ts +23 -0
- package/dist/types/semantics/coverage/search/valueWords.d.ts.map +1 -0
- package/dist/types/semantics/coverage/types.d.ts +163 -0
- package/dist/types/semantics/coverage/types.d.ts.map +1 -1
- package/dist/types/semantics/described.d.ts.map +1 -1
- package/dist/types/semantics/envelope.d.ts.map +1 -1
- package/dist/types/semantics/index.d.ts +2 -1
- package/dist/types/semantics/index.d.ts.map +1 -1
- package/dist/types/semantics/overclaim.d.ts +106 -0
- package/dist/types/semantics/overclaim.d.ts.map +1 -0
- package/dist/types/semantics/types.d.ts +13 -0
- package/dist/types/semantics/types.d.ts.map +1 -1
- package/dist/types/time-travel/servedView.d.ts +2 -2
- package/dist/types/time-travel/servedView.d.ts.map +1 -1
- package/dist/types/tools/declare.d.ts +1 -1
- package/dist/types/tools/hostFilled.d.ts +20 -1
- package/dist/types/tools/hostFilled.d.ts.map +1 -1
- package/dist/types/tools/searchOf.d.ts +61 -0
- package/dist/types/tools/searchOf.d.ts.map +1 -0
- package/dist/types/tools/tools.d.ts +49 -0
- package/dist/types/tools/tools.d.ts.map +1 -1
- package/dist/types/trace-toolpack/causeCapture.d.ts +18 -0
- package/dist/types/trace-toolpack/causeCapture.d.ts.map +1 -0
- package/dist/types/trace-toolpack/causeControl.d.ts +7 -0
- package/dist/types/trace-toolpack/causeControl.d.ts.map +1 -0
- package/dist/types/trace-toolpack/causeReader.d.ts.map +1 -1
- package/dist/types/trace-toolpack/causeResponse.d.ts +3 -2
- package/dist/types/trace-toolpack/causeResponse.d.ts.map +1 -1
- package/dist/types/trace-toolpack/causeSnapshot.d.ts +6 -1
- package/dist/types/trace-toolpack/causeSnapshot.d.ts.map +1 -1
- package/package.json +3 -2
- package/dist/esm/tools/normalize.d.ts +0 -43
- package/dist/esm/tools/normalize.js.map +0 -1
- package/dist/tools/normalize.js.map +0 -1
- package/dist/types/tools/normalize.d.ts +0 -44
- package/dist/types/tools/normalize.d.ts.map +0 -1
|
@@ -0,0 +1,817 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* consentRequest — the request a consent gate puts to a person: how it is
|
|
3
|
+
* named, what it is bound to, and how a decision is held to it, once.
|
|
4
|
+
*
|
|
5
|
+
* Role: the ONE owner of that law. A consent gate (a tool's `checkIn`, a
|
|
6
|
+
* middleware's `ask`) pauses the run; `mintConsentRequest` mints the request
|
|
7
|
+
* at the pause, and `heldDecision` + `spendDecision` hold a resume's
|
|
8
|
+
* decision to it. The dispatch loop (`agent/stages/toolCalls.ts`) is
|
|
9
|
+
* the only writer and the only place a decision is used; `Agent.resume`
|
|
10
|
+
* asks the same pure question earlier, so a mismatch is refused before
|
|
11
|
+
* anything moves.
|
|
12
|
+
* Reads: the call about to pause; at a resume, the paused run's own state
|
|
13
|
+
* (`gatedCallOf`) and the decision.
|
|
14
|
+
* Writes: nothing — the dispatch loop writes what `mintConsentRequest` returns.
|
|
15
|
+
*
|
|
16
|
+
* ── WHY THE ID IS A COMMITMENT, NOT ONLY A NAME ─────────────────────────────
|
|
17
|
+
* `id = sha256(domain ‖ nonce ‖ canonicalJson(call))`, where the call is
|
|
18
|
+
* everything that runs on approval: the gate, the tool, the call id, the
|
|
19
|
+
* served party, the arguments and — for an ask — the middleware, where the
|
|
20
|
+
* chain resumes and the names of the rules from the asking one on (a resume
|
|
21
|
+
* refuses an agent whose chain no longer runs those rules, and a rule after
|
|
22
|
+
* the ask that hands back other arguments than the ones approved — the tool
|
|
23
|
+
* does not run). The nonce is 128 random bits kept in the paused run's state.
|
|
24
|
+
*
|
|
25
|
+
* - A random nonce makes every pause's id unique and unguessable, so a
|
|
26
|
+
* decision for one pause can never answer another — even two pauses of
|
|
27
|
+
* the same tool, with the same model-chosen call id and the same
|
|
28
|
+
* arguments.
|
|
29
|
+
* - Re-deriving the id from the state at resume binds the decision to the
|
|
30
|
+
* exact call: a checkpoint whose arguments, tool, call id, party or chain
|
|
31
|
+
* position changed after the person was asked derives a different id, and
|
|
32
|
+
* no nonce makes it derive the old one (that would be a SHA-256 preimage).
|
|
33
|
+
* The person's decision quotes the id they were shown, so a checkpoint
|
|
34
|
+
* changed after the ask cannot be made to match it.
|
|
35
|
+
* - What it does NOT stop is a hostile writer of the checkpoint store: one
|
|
36
|
+
* who rewrites the call, the nonce and the request shown together BEFORE
|
|
37
|
+
* the person decides (they then approve what they were shown), or who
|
|
38
|
+
* switches the pause into a kind whose resume takes no decision (a
|
|
39
|
+
* credential-consent pause). The binding detects drift and replay, not
|
|
40
|
+
* that writer; a host that does not trust its store signs checkpoints or
|
|
41
|
+
* keeps them server-side.
|
|
42
|
+
* - The id carries no run value. The nonce does unlock it — whoever holds
|
|
43
|
+
* the nonce can confirm a guess of the arguments — so the state key that
|
|
44
|
+
* carries it (`pausedRequest`) is named with the arguments in the
|
|
45
|
+
* conversation redaction vocabulary (`redaction/conversation.ts`).
|
|
46
|
+
*
|
|
47
|
+
* ── THE DOMAIN ─────────────────────────────────────────────────────────────
|
|
48
|
+
* The call is fingerprinted as JSON, because JSON is what a person is shown and
|
|
49
|
+
* what a stored checkpoint holds. A call JSON cannot write down faithfully (a
|
|
50
|
+
* `Date`, a `Map`, `Infinity` — `lib/jsonFaithful.ts`) cannot be bound, and
|
|
51
|
+
* `mintConsentRequest` says so instead of fingerprinting a value two different calls
|
|
52
|
+
* would share. JSON's own equivalences hold: a property whose value is
|
|
53
|
+
* `undefined` is the property absent, and `-0` is `0`.
|
|
54
|
+
*
|
|
55
|
+
* ── ONCE ───────────────────────────────────────────────────────────────────
|
|
56
|
+
* A request is spent the moment a resume uses a decision for it, approved or
|
|
57
|
+
* declined (`DecisionLedger`), and "once" holds PER LEDGER. The default is one
|
|
58
|
+
* ledger in this process's memory, shared by every agent that names none — a
|
|
59
|
+
* pool that rebuilds an evicted instance, a host that builds a runner per
|
|
60
|
+
* request, a composition's nested agents all spend in it. It is gone after a
|
|
61
|
+
* restart and no other process sees it: where more than one process (or a
|
|
62
|
+
* restart) can resume the same paused run, every agent that can resume it is
|
|
63
|
+
* given one ledger in a store they all reach (`Agent.create({ decisionLedger })`).
|
|
64
|
+
* The process's ledger and everything below that is process-wide live on
|
|
65
|
+
* `globalThis` under one versioned key, so an app that loads both builds of
|
|
66
|
+
* this package (CJS and ESM) still has ONE (`processState`).
|
|
67
|
+
*
|
|
68
|
+
* ── WAS IT USED? ───────────────────────────────────────────────────────────
|
|
69
|
+
* A host that keeps the pause asks this after a resume of it failed: the call
|
|
70
|
+
* may have run only if the decision reached a ledger. `spendDecision` is the
|
|
71
|
+
* one place a decision does, so it reports every attempt to whoever watches
|
|
72
|
+
* that request (`watchDecisionUse`), and the ledger it went to is asked when
|
|
73
|
+
* the attempt's own answer was lost. A resume this library took up and never
|
|
74
|
+
* took to a ledger used nothing; one it never took up cannot be told apart
|
|
75
|
+
* from a use (`hosting/answeredPause.ts`).
|
|
76
|
+
*
|
|
77
|
+
* ── DID IT NEVER RUN? ──────────────────────────────────────────────────────
|
|
78
|
+
* A watch sees one resume. A host closing a pause no answer can reach asks a
|
|
79
|
+
* stronger question — can ANY decision for it have been used, by any resume,
|
|
80
|
+
* before this process started included — and says "did not run" only on
|
|
81
|
+
* proof (`proveNeverRan`): the ledger the request was MINTED under (its
|
|
82
|
+
* identity rides the pause, `PendingRequest.ledger`) spends the request
|
|
83
|
+
* itself, atomically. `true` means no decision had reached it, and none ever
|
|
84
|
+
* can now — the spend is a tombstone, not a read that a resume elsewhere
|
|
85
|
+
* could overtake. Anything else is not proof.
|
|
86
|
+
*/
|
|
87
|
+
import { canonicalJson } from '../lib/canonicalJson.js';
|
|
88
|
+
import { isJsonFaithful } from '../lib/jsonFaithful.js';
|
|
89
|
+
import { sha256Hex } from '../lib/sha256.js';
|
|
90
|
+
import { looksLikeDecision } from './checkin.js';
|
|
91
|
+
import { DecisionRequiredError, ResumeDecisionError, } from './pause.js';
|
|
92
|
+
/**
|
|
93
|
+
* A NEW {@link DecisionLedger} in this process's memory. Grows by one id per
|
|
94
|
+
* answered request.
|
|
95
|
+
*
|
|
96
|
+
* Agents that name no ledger already share one of these per process, so this
|
|
97
|
+
* is for a ledger of their own: agents given different ledgers spend
|
|
98
|
+
* separately, and a decision spent in one is not known to the others.
|
|
99
|
+
*/
|
|
100
|
+
export function inMemoryDecisionLedger() {
|
|
101
|
+
const spent = new Set();
|
|
102
|
+
const ledger = {
|
|
103
|
+
spend(requestId) {
|
|
104
|
+
if (spent.has(requestId))
|
|
105
|
+
return false;
|
|
106
|
+
spent.add(requestId);
|
|
107
|
+
return true;
|
|
108
|
+
},
|
|
109
|
+
isSpent(requestId) {
|
|
110
|
+
return spent.has(requestId);
|
|
111
|
+
},
|
|
112
|
+
};
|
|
113
|
+
return ledger;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* The key the process state is kept under on `globalThis`. `Symbol.for`, so
|
|
117
|
+
* every copy of this package in the process — its CJS and ESM builds, loaded
|
|
118
|
+
* side by side — finds the same state; versioned, so a later release that
|
|
119
|
+
* changes its shape keeps its own.
|
|
120
|
+
*/
|
|
121
|
+
const PROCESS_STATE = Symbol.for('agentfootprint.consentRequest.processState.v1');
|
|
122
|
+
/**
|
|
123
|
+
* This process's consent state, made by whichever copy of this package asks
|
|
124
|
+
* first. Two copies with two ledgers would answer one decision twice (a
|
|
125
|
+
* replay across them), and a door watching through one copy would never see
|
|
126
|
+
* a spend made through the other.
|
|
127
|
+
*/
|
|
128
|
+
function processState() {
|
|
129
|
+
const holder = globalThis;
|
|
130
|
+
const existing = holder[PROCESS_STATE];
|
|
131
|
+
if (existing !== undefined)
|
|
132
|
+
return existing;
|
|
133
|
+
const made = {
|
|
134
|
+
ledger: inMemoryDecisionLedger(),
|
|
135
|
+
watches: new Map(),
|
|
136
|
+
rules: new WeakMap(),
|
|
137
|
+
};
|
|
138
|
+
Object.defineProperty(globalThis, PROCESS_STATE, { value: made });
|
|
139
|
+
return made;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Register the rules `agent` holds an ask's approval to — its `toolMiddleware`
|
|
143
|
+
* chain by link name, read each time it is asked — for a host that keeps its
|
|
144
|
+
* pauses ({@link consentRulesOf}). Called by every `Agent` it builds.
|
|
145
|
+
*/
|
|
146
|
+
export function registerConsentRules(agent, rules) {
|
|
147
|
+
processState().rules.set(agent, rules);
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* The rules `runner` holds an ask's approval to, when it is an agent this
|
|
151
|
+
* library built — `undefined` for any other runner (a composition, an app's
|
|
152
|
+
* own), whose nested agents' rules a host cannot see.
|
|
153
|
+
*/
|
|
154
|
+
export function consentRulesOf(runner) {
|
|
155
|
+
if (typeof runner !== 'object' || runner === null)
|
|
156
|
+
return undefined;
|
|
157
|
+
return processState().rules.get(runner)?.();
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* This process's ledger — where an agent that names no `decisionLedger`
|
|
161
|
+
* spends. One per process, so a decision runs once across every agent
|
|
162
|
+
* instance this process builds (and every copy of this package it loaded),
|
|
163
|
+
* not once per instance. It lives as long as the process and grows by one id
|
|
164
|
+
* per answered request; request ids are unique per pause, so sharing it never
|
|
165
|
+
* makes one agent's answer collide with another's.
|
|
166
|
+
*/
|
|
167
|
+
export function processDecisionLedger() {
|
|
168
|
+
return processState().ledger;
|
|
169
|
+
}
|
|
170
|
+
const PROOF_STATE = Symbol.for('agentfootprint.consentRequest.proofState.v2');
|
|
171
|
+
function proofState() {
|
|
172
|
+
const holder = globalThis;
|
|
173
|
+
const existing = holder[PROOF_STATE];
|
|
174
|
+
if (existing !== undefined)
|
|
175
|
+
return existing;
|
|
176
|
+
const made = { processLedger: `process:${randomHex(16)}`, ledgers: new WeakMap() };
|
|
177
|
+
Object.defineProperty(globalThis, PROOF_STATE, { value: made });
|
|
178
|
+
return made;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Register the ledger `agent` spends its decisions in — `undefined` for the
|
|
182
|
+
* process's ({@link processDecisionLedger}) — so a host that closes one of its
|
|
183
|
+
* pauses can ask it for the proof ({@link proveNeverRan}). Called by every
|
|
184
|
+
* `Agent` it builds.
|
|
185
|
+
*/
|
|
186
|
+
export function registerConsentLedger(agent, ledger) {
|
|
187
|
+
proofState().ledgers.set(agent, ledger ?? processDecisionLedger());
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* The ledger `runner` spends decisions in, when it is an agent this library
|
|
191
|
+
* built — `undefined` for any other runner (a composition, an app's own).
|
|
192
|
+
*/
|
|
193
|
+
export function consentLedgerOf(runner) {
|
|
194
|
+
if (typeof runner !== 'object' || runner === null)
|
|
195
|
+
return undefined;
|
|
196
|
+
return proofState().ledgers.get(runner);
|
|
197
|
+
}
|
|
198
|
+
/** The longest `DecisionLedger.storeId` a pause records. */
|
|
199
|
+
const MAX_LEDGER_ID = 200;
|
|
200
|
+
/**
|
|
201
|
+
* The identity a pause records for the ledger its request is minted under
|
|
202
|
+
* ({@link PendingRequest.ledger}), or `undefined` for one that has none:
|
|
203
|
+
*
|
|
204
|
+
* - this process's default ledger: `process:` + an id drawn when the process
|
|
205
|
+
* first asked. A restart draws another, so it never answers for a pause an
|
|
206
|
+
* earlier process stored — that process took its ledger with it;
|
|
207
|
+
* - a ledger naming its store (`DecisionLedger.storeId`): `store:` + that id;
|
|
208
|
+
* - any other — an app's own `inMemoryDecisionLedger()`, a ledger without a
|
|
209
|
+
* `storeId` — none: it may be one agent's alone, and nothing tells it
|
|
210
|
+
* apart from another.
|
|
211
|
+
*/
|
|
212
|
+
export function ledgerIdentityOf(ledger) {
|
|
213
|
+
if (ledger === processState().ledger)
|
|
214
|
+
return proofState().processLedger;
|
|
215
|
+
let storeId;
|
|
216
|
+
try {
|
|
217
|
+
storeId = ledger.storeId;
|
|
218
|
+
}
|
|
219
|
+
catch {
|
|
220
|
+
return undefined;
|
|
221
|
+
}
|
|
222
|
+
return typeof storeId === 'string' && storeId.length > 0 && storeId.length <= MAX_LEDGER_ID
|
|
223
|
+
? `store:${storeId}`
|
|
224
|
+
: undefined;
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* The key a closer spends, after it won a request, to record that IT closed it
|
|
228
|
+
* ({@link proveNeverRan}). Request ids are 64 hex characters, so no request id
|
|
229
|
+
* is ever one of these.
|
|
230
|
+
*/
|
|
231
|
+
export function closedProvenKey(requestId) {
|
|
232
|
+
return `closed-proven:${requestId}`;
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* The ledger that may prove a closed pause's call never ran, or `undefined`
|
|
236
|
+
* when none can: the guards {@link proveNeverRan} and {@link closedByAHost}
|
|
237
|
+
* share.
|
|
238
|
+
*/
|
|
239
|
+
function provingLedger(question) {
|
|
240
|
+
const { requestIds, mintedUnder, runner } = question;
|
|
241
|
+
if (requestIds.length === 0 || mintedUnder === undefined)
|
|
242
|
+
return undefined;
|
|
243
|
+
if (typeof runner !== 'object' || runner === null)
|
|
244
|
+
return undefined;
|
|
245
|
+
const proof = proofState();
|
|
246
|
+
const ledger = proof.ledgers.get(runner);
|
|
247
|
+
if (ledger === undefined || ledgerIdentityOf(ledger) !== mintedUnder)
|
|
248
|
+
return undefined;
|
|
249
|
+
if (mintedUnder === proof.processLedger && !question.storeIsProcessLocal)
|
|
250
|
+
return undefined;
|
|
251
|
+
return ledger;
|
|
252
|
+
}
|
|
253
|
+
/** Whether `ledger` says a host recorded closing `requestId` — `false` when it cannot say. */
|
|
254
|
+
async function closeRecorded(ledger, requestId) {
|
|
255
|
+
if (typeof ledger.isSpent !== 'function')
|
|
256
|
+
return false;
|
|
257
|
+
try {
|
|
258
|
+
return (await ledger.isSpent(closedProvenKey(requestId))) === true;
|
|
259
|
+
}
|
|
260
|
+
catch {
|
|
261
|
+
return false;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* Prove that no decision for a paused request can ever run its call — or say
|
|
266
|
+
* that it cannot be proven. Spending is the one way a decision reaches a call
|
|
267
|
+
* (`spendDecision` runs before the tool, on every door), so the proof is the
|
|
268
|
+
* ledger the request was MINTED under spending the request itself: `true`
|
|
269
|
+
* there means no decision had reached it and — in the same atomic step — that
|
|
270
|
+
* none ever can (a later resume is refused). A read (`isSpent`) of the request
|
|
271
|
+
* would not do: a resume on another replica could spend and run the call
|
|
272
|
+
* between the read and the close, and a ledger may expire what it reads.
|
|
273
|
+
*
|
|
274
|
+
* IDEMPOTENT. Having won the request, the closer spends a second key,
|
|
275
|
+
* {@link closedProvenKey}, to record that it closed it. The closed pause is
|
|
276
|
+
* stored only afterwards, and that can fail (the store's write, the run that
|
|
277
|
+
* goes on from it); a retried close finds the request spent and reads the
|
|
278
|
+
* marker (`isSpent`) — present: the verdict the first close proved; absent
|
|
279
|
+
* (a crash between the two spends, a ledger without `isSpent`): not proven, the
|
|
280
|
+
* safe direction. A request a DECISION spent never has the marker.
|
|
281
|
+
*
|
|
282
|
+
* CONSUMES the request: asked only for a pause being closed.
|
|
283
|
+
*
|
|
284
|
+
* Fails closed — `false` — whenever the proof cannot be had:
|
|
285
|
+
*
|
|
286
|
+
* - the pause names no request, or no minting ledger (one stored before
|
|
287
|
+
* either was recorded, or minted under a ledger with no identity);
|
|
288
|
+
* - `runner` is not an agent this library built (a composition, an app's
|
|
289
|
+
* own), so its ledger is unknown;
|
|
290
|
+
* - its ledger is not the one the request was minted under: a redeploy that
|
|
291
|
+
* switched ledgers, or a restart (this process's ledger is a new one) —
|
|
292
|
+
* that ledger never saw the spends;
|
|
293
|
+
* - the request was minted under this process's default ledger and the
|
|
294
|
+
* door's session store is not this process's memory: another replica, on
|
|
295
|
+
* its own default ledger, may have spent it and run the call;
|
|
296
|
+
* - a spend throws, or answers anything but `true` with no close recorded.
|
|
297
|
+
*/
|
|
298
|
+
export async function proveNeverRan(question) {
|
|
299
|
+
const ledger = provingLedger(question);
|
|
300
|
+
if (ledger === undefined)
|
|
301
|
+
return false;
|
|
302
|
+
for (const id of question.requestIds) {
|
|
303
|
+
let won;
|
|
304
|
+
try {
|
|
305
|
+
won = await ledger.spend(id);
|
|
306
|
+
}
|
|
307
|
+
catch {
|
|
308
|
+
return false;
|
|
309
|
+
}
|
|
310
|
+
if (won === true) {
|
|
311
|
+
// Recorded for a retry and for a late answer; the proof is the win
|
|
312
|
+
// above, so a marker that does not land costs only that.
|
|
313
|
+
try {
|
|
314
|
+
await ledger.spend(closedProvenKey(id));
|
|
315
|
+
}
|
|
316
|
+
catch {
|
|
317
|
+
// a retry will read "not proven" — the safe direction
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
else if (!(await closeRecorded(ledger, id))) {
|
|
321
|
+
return false;
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
return true;
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* Whether a host already closed this paused request with the proof that its
|
|
328
|
+
* call never ran — read, never spent: the ledger it was minted under holds the
|
|
329
|
+
* close marker for every id ({@link closedProvenKey}). Asked by a door whose
|
|
330
|
+
* answer to the pause failed because the request was already spent, so a pause
|
|
331
|
+
* closed elsewhere (whose closed conversation was never stored) is closed as
|
|
332
|
+
* not run rather than marked as possibly run.
|
|
333
|
+
*/
|
|
334
|
+
export async function closedByAHost(question) {
|
|
335
|
+
const ledger = provingLedger(question);
|
|
336
|
+
if (ledger === undefined)
|
|
337
|
+
return false;
|
|
338
|
+
for (const id of question.requestIds) {
|
|
339
|
+
if (!(await closeRecorded(ledger, id)))
|
|
340
|
+
return false;
|
|
341
|
+
}
|
|
342
|
+
return true;
|
|
343
|
+
}
|
|
344
|
+
const DOMAIN = 'agentfootprint/consent-request/v1';
|
|
345
|
+
const HEX_ID = /^[0-9a-f]{64}$/;
|
|
346
|
+
const HEX_NONCE = /^[0-9a-f]{32}$/;
|
|
347
|
+
/**
|
|
348
|
+
* Mint the request for a call about to pause, over a detached copy of its
|
|
349
|
+
* arguments. `undefined` when the call cannot be bound — its arguments cannot
|
|
350
|
+
* be copied, are not an object, or are not values JSON writes down faithfully
|
|
351
|
+
* — and the gate must refuse the call instead of pausing.
|
|
352
|
+
*
|
|
353
|
+
* @param ledger the ledger a decision for it will be spent in — its identity
|
|
354
|
+
* rides the request ({@link PendingRequest.ledger}), so only that ledger can
|
|
355
|
+
* later prove the call never ran.
|
|
356
|
+
*/
|
|
357
|
+
export function mintConsentRequest(call, ledger) {
|
|
358
|
+
let args;
|
|
359
|
+
try {
|
|
360
|
+
args = structuredClone(call.args);
|
|
361
|
+
}
|
|
362
|
+
catch {
|
|
363
|
+
return undefined;
|
|
364
|
+
}
|
|
365
|
+
if (typeof args !== 'object' || args === null || Array.isArray(args))
|
|
366
|
+
return undefined;
|
|
367
|
+
const nonce = randomHex(16);
|
|
368
|
+
const id = requestIdOf(nonce, { ...call, args });
|
|
369
|
+
if (id === undefined)
|
|
370
|
+
return undefined;
|
|
371
|
+
const mintedUnder = ledger === undefined ? undefined : ledgerIdentityOf(ledger);
|
|
372
|
+
return {
|
|
373
|
+
request: { id, nonce, ...(mintedUnder !== undefined && { ledger: mintedUnder }) },
|
|
374
|
+
args: args,
|
|
375
|
+
};
|
|
376
|
+
}
|
|
377
|
+
/**
|
|
378
|
+
* The paused call as the paused run's state records it — the one reading both
|
|
379
|
+
* the resume's early check and the dispatch loop take, so they cannot disagree
|
|
380
|
+
* about what the request was bound to.
|
|
381
|
+
*/
|
|
382
|
+
export function gatedCallOf(read, gate) {
|
|
383
|
+
return gate === 'ask'
|
|
384
|
+
? {
|
|
385
|
+
gate,
|
|
386
|
+
tool: read('pausedToolName'),
|
|
387
|
+
toolCallId: read('pausedToolCallId'),
|
|
388
|
+
party: read('pausedToolParty'),
|
|
389
|
+
args: read('pausedAskArgs'),
|
|
390
|
+
middleware: read('pausedAskMiddleware'),
|
|
391
|
+
askIndex: read('pausedAskIndex'),
|
|
392
|
+
chain: read('pausedAskChain'),
|
|
393
|
+
}
|
|
394
|
+
: {
|
|
395
|
+
gate,
|
|
396
|
+
tool: read('pausedToolName'),
|
|
397
|
+
toolCallId: read('pausedToolCallId'),
|
|
398
|
+
party: read('pausedToolParty'),
|
|
399
|
+
args: read('pausedCheckInArgs'),
|
|
400
|
+
};
|
|
401
|
+
}
|
|
402
|
+
/**
|
|
403
|
+
* Hold a resume's input to the request the run is paused on. Pure: it spends
|
|
404
|
+
* nothing (see {@link spendDecision}).
|
|
405
|
+
*
|
|
406
|
+
* @param recorded the paused run's `pausedRequest`, as read — never trusted.
|
|
407
|
+
* @param call the paused call, as read ({@link gatedCallOf}).
|
|
408
|
+
* @param rules the resuming agent's own `toolMiddleware` chain, by link
|
|
409
|
+
* name — an ask's approval holds only for the rules it was asked under.
|
|
410
|
+
* @param ledger the ledger the resuming agent spends decisions in — a
|
|
411
|
+
* request minted under a ledger that can prove is spent only there.
|
|
412
|
+
* @returns a detached copy of the decision.
|
|
413
|
+
* @throws DecisionRequiredError when the input is not a decision at all.
|
|
414
|
+
* @throws ResumeDecisionError (`'no-request'`, `'request-not-recorded'`,
|
|
415
|
+
* `'other-request'`, `'call-changed'`, `'chain-changed'`,
|
|
416
|
+
* `'ledger-changed'`) when it cannot answer this request.
|
|
417
|
+
*/
|
|
418
|
+
export function heldDecision(input, gate, recorded, call, rules, ledger) {
|
|
419
|
+
const decision = decisionCopyOf(input);
|
|
420
|
+
if (decision === undefined)
|
|
421
|
+
throw new DecisionRequiredError(gate, input);
|
|
422
|
+
const requestId = typeof decision.requestId === 'string' && decision.requestId.length > 0
|
|
423
|
+
? decision.requestId
|
|
424
|
+
: undefined;
|
|
425
|
+
// A pause that recorded no request can be answered by nothing — said first,
|
|
426
|
+
// because no decision, however it is built, would change that. No refusal
|
|
427
|
+
// carries an id (`ResumeDecisionError`): it would hand out the one it
|
|
428
|
+
// requires.
|
|
429
|
+
const pending = readPendingRequest(recorded);
|
|
430
|
+
if (pending === undefined)
|
|
431
|
+
throw new ResumeDecisionError('request-not-recorded', gate.kind);
|
|
432
|
+
if (requestId === undefined)
|
|
433
|
+
throw new ResumeDecisionError('no-request', gate.kind);
|
|
434
|
+
if (requestId !== pending.id)
|
|
435
|
+
throw new ResumeDecisionError('other-request', gate.kind);
|
|
436
|
+
const refused = requestRefusal(recorded, call, rules, ledger);
|
|
437
|
+
if (refused !== undefined)
|
|
438
|
+
throw new ResumeDecisionError(refused, gate.kind);
|
|
439
|
+
return decision;
|
|
440
|
+
}
|
|
441
|
+
/**
|
|
442
|
+
* The refusals about the paused request itself, whatever the decision says —
|
|
443
|
+
* the one rule {@link heldDecision} and {@link unanswerableReason} share.
|
|
444
|
+
*
|
|
445
|
+
* @param rules the resuming agent's chain by link name, or `undefined` when it
|
|
446
|
+
* is not known — an ask's chain is then not checked.
|
|
447
|
+
* @param ledger the resuming agent's ledger, or `undefined` when it is not
|
|
448
|
+
* known — the ledger binding is then not checked.
|
|
449
|
+
*/
|
|
450
|
+
function requestRefusal(recorded, call, rules, ledger) {
|
|
451
|
+
const pending = readPendingRequest(recorded);
|
|
452
|
+
if (pending === undefined)
|
|
453
|
+
return 'request-not-recorded';
|
|
454
|
+
if (requestIdOf(pending.nonce, call) !== pending.id)
|
|
455
|
+
return 'call-changed';
|
|
456
|
+
// The checkpoint is the one the person was asked over; the agent resuming it
|
|
457
|
+
// must still be one that runs the same rules from the asking link on.
|
|
458
|
+
if (call.gate === 'ask' && rules !== undefined && !sameChain(call.chain, rules, call.askIndex)) {
|
|
459
|
+
return 'chain-changed';
|
|
460
|
+
}
|
|
461
|
+
if (ledger !== undefined && spentElsewhere(recorded, ledger))
|
|
462
|
+
return 'ledger-changed';
|
|
463
|
+
return undefined;
|
|
464
|
+
}
|
|
465
|
+
/**
|
|
466
|
+
* Whether a decision for `recorded` would be spent in a ledger other than the
|
|
467
|
+
* one it was minted under, while that one can PROVE — a shared ledger with a
|
|
468
|
+
* `storeId`, or this process's own default ledger. A host closes a pause by
|
|
469
|
+
* spending its request in the minting ledger ({@link proveNeverRan}); a
|
|
470
|
+
* decision spent anywhere else would run the call where that ledger never saw
|
|
471
|
+
* it, and the close would record "did not run" about a call that ran. So such
|
|
472
|
+
* a resume is refused before anything runs, and the person is asked again.
|
|
473
|
+
* A request minted under a ledger that cannot prove — no identity, or an
|
|
474
|
+
* earlier process's default ledger, gone with it — keeps being spent wherever
|
|
475
|
+
* the resuming agent spends: no close can ever prove it either way.
|
|
476
|
+
*/
|
|
477
|
+
function spentElsewhere(recorded, ledger) {
|
|
478
|
+
const mintedUnder = typeof recorded === 'object' && recorded !== null
|
|
479
|
+
? recorded.ledger
|
|
480
|
+
: undefined;
|
|
481
|
+
if (typeof mintedUnder !== 'string' || mintedUnder.length === 0)
|
|
482
|
+
return false;
|
|
483
|
+
if (mintedUnder.startsWith('process:') && mintedUnder !== proofState().processLedger) {
|
|
484
|
+
return false;
|
|
485
|
+
}
|
|
486
|
+
return ledgerIdentityOf(ledger) !== mintedUnder;
|
|
487
|
+
}
|
|
488
|
+
/**
|
|
489
|
+
* Why the request a checkpoint's paused stage records can never be answered —
|
|
490
|
+
* by any decision — or `undefined` when it can, or when that cannot be told
|
|
491
|
+
* from the checkpoint (its paused state is not where it should be).
|
|
492
|
+
*
|
|
493
|
+
* Read by a host that keeps the pause, so a session is not held by a question
|
|
494
|
+
* nobody can answer any more: one paused before requests were named
|
|
495
|
+
* (`'request-not-recorded'`), one whose call changed after the ask
|
|
496
|
+
* (`'call-changed'`), an ask made under rules the resuming agent no longer
|
|
497
|
+
* runs (`'chain-changed'` — told only when `rules` are known), or a request
|
|
498
|
+
* minted under a proving ledger the resuming agent no longer spends in
|
|
499
|
+
* (`'ledger-changed'` — told only when `ledger` is known).
|
|
500
|
+
*/
|
|
501
|
+
export function unanswerableReason(checkpoint, gate, rules, ledger) {
|
|
502
|
+
let state;
|
|
503
|
+
try {
|
|
504
|
+
state = pausedStateOf(checkpoint);
|
|
505
|
+
}
|
|
506
|
+
catch {
|
|
507
|
+
return undefined;
|
|
508
|
+
}
|
|
509
|
+
if (state === undefined)
|
|
510
|
+
return undefined;
|
|
511
|
+
const read = (key) => state?.[key];
|
|
512
|
+
return requestRefusal(read('pausedRequest'), gatedCallOf(read, gate), rules, ledger);
|
|
513
|
+
}
|
|
514
|
+
/**
|
|
515
|
+
* Whether `wouldRun` are the arguments the paused request was minted over —
|
|
516
|
+
* decided by re-deriving the request's id with them in place of the recorded
|
|
517
|
+
* ones: the call that runs must be the call the id the person was shown
|
|
518
|
+
* commits to. Key order and JSON's own equivalences do not count; a value
|
|
519
|
+
* JSON cannot write down faithfully never matches.
|
|
520
|
+
*
|
|
521
|
+
* Held to the REQUEST, never to a copy: an ask's resume hands the rest of the
|
|
522
|
+
* chain a copy of the approved arguments, and a link that edited that copy in
|
|
523
|
+
* place would make any comparison against it agree with itself.
|
|
524
|
+
*
|
|
525
|
+
* @param recorded the paused run's `pausedRequest`, as read.
|
|
526
|
+
* @param call the paused call, as read ({@link gatedCallOf}); its own
|
|
527
|
+
* `args` are replaced by `wouldRun`.
|
|
528
|
+
*/
|
|
529
|
+
export function runsAsAsked(recorded, call, wouldRun) {
|
|
530
|
+
const pending = readPendingRequest(recorded);
|
|
531
|
+
return (pending !== undefined && requestIdOf(pending.nonce, { ...call, args: wouldRun }) === pending.id);
|
|
532
|
+
}
|
|
533
|
+
/**
|
|
534
|
+
* The same question as {@link heldDecision}, asked of a checkpoint before a
|
|
535
|
+
* resume starts — so a mismatch is refused while nothing has moved. Reads the
|
|
536
|
+
* paused stage's own state (the root's, or the innermost subflow's on the
|
|
537
|
+
* pause path). A state it cannot find is left to the dispatch loop, which asks
|
|
538
|
+
* again where the decision is used.
|
|
539
|
+
*/
|
|
540
|
+
export function checkDecisionAgainst(checkpoint, gate, input, rules, ledger) {
|
|
541
|
+
const state = pausedStateOf(checkpoint);
|
|
542
|
+
if (state === undefined) {
|
|
543
|
+
if (decisionCopyOf(input) === undefined)
|
|
544
|
+
throw new DecisionRequiredError(gate, input);
|
|
545
|
+
return;
|
|
546
|
+
}
|
|
547
|
+
const read = (key) => state[key];
|
|
548
|
+
heldDecision(input, gate, read('pausedRequest'), gatedCallOf(read, gate.kind), rules, ledger);
|
|
549
|
+
}
|
|
550
|
+
/**
|
|
551
|
+
* Spend the decision's request in `ledger` — the one place a decision reaches
|
|
552
|
+
* a ledger, so every attempt is reported to whoever watches the request
|
|
553
|
+
* ({@link watchDecisionUse}).
|
|
554
|
+
*
|
|
555
|
+
* @param signal the resumed run's signal. The engine stops waiting on a stage
|
|
556
|
+
* when its run is aborted, but the stage goes on running: a resume whose run
|
|
557
|
+
* was aborted takes nothing to a ledger, and one aborted while its ledger
|
|
558
|
+
* answered is refused after the spend — spent, and its call never run.
|
|
559
|
+
* @throws ResumeDecisionError `'already-answered'` when a resume already spent
|
|
560
|
+
* it, or `'closed-by-host'` when a host closed it and recorded that its call
|
|
561
|
+
* never ran (`closedProvenKey`).
|
|
562
|
+
*/
|
|
563
|
+
export async function spendDecision(ledger, decision, gate, signal) {
|
|
564
|
+
refuseIfAborted(signal);
|
|
565
|
+
const attempts = attemptsOn(decision.requestId, ledger, decision.approved === false);
|
|
566
|
+
let fresh;
|
|
567
|
+
try {
|
|
568
|
+
fresh = await ledger.spend(decision.requestId);
|
|
569
|
+
}
|
|
570
|
+
catch (err) {
|
|
571
|
+
for (const attempt of attempts)
|
|
572
|
+
attempt.outcome = 'failed';
|
|
573
|
+
throw err;
|
|
574
|
+
}
|
|
575
|
+
for (const attempt of attempts)
|
|
576
|
+
attempt.outcome = fresh === true ? 'spent' : 'refused';
|
|
577
|
+
if (fresh !== true) {
|
|
578
|
+
// A host that closed the request recorded it (`proveNeverRan`): the
|
|
579
|
+
// person is told so — the call did not run — not "already answered".
|
|
580
|
+
throw new ResumeDecisionError((await closeRecorded(ledger, decision.requestId)) ? 'closed-by-host' : 'already-answered', gate);
|
|
581
|
+
}
|
|
582
|
+
refuseIfAborted(signal);
|
|
583
|
+
}
|
|
584
|
+
/**
|
|
585
|
+
* What an aborted run ended with — the signal's own reason, as the engine
|
|
586
|
+
* reports it — or `undefined` while the run goes on. Asked before the spend,
|
|
587
|
+
* after it, and by the dispatch loop once more at the last moment before an
|
|
588
|
+
* approved call runs (`toolCalls.ts` · `resolveCredentialAndExecute`): the
|
|
589
|
+
* engine stops waiting on an aborted run's stage, but the stage goes on, and
|
|
590
|
+
* nothing may run for a caller who was already told the run ended.
|
|
591
|
+
*/
|
|
592
|
+
export function runEndedBy(signal) {
|
|
593
|
+
if (signal === undefined || !signal.aborted)
|
|
594
|
+
return undefined;
|
|
595
|
+
const reason = signal.reason;
|
|
596
|
+
return reason instanceof Error ? reason : new Error(String(reason ?? 'Aborted'));
|
|
597
|
+
}
|
|
598
|
+
/** Throw what an aborted run ended with ({@link runEndedBy}). */
|
|
599
|
+
function refuseIfAborted(signal) {
|
|
600
|
+
const ended = runEndedBy(signal);
|
|
601
|
+
if (ended !== undefined)
|
|
602
|
+
throw ended;
|
|
603
|
+
}
|
|
604
|
+
/** Record an attempt to spend `requestId` in `ledger` on every watch open for it. */
|
|
605
|
+
function attemptsOn(requestId, ledger, declined) {
|
|
606
|
+
const attempts = [];
|
|
607
|
+
for (const watch of processState().watches.get(requestId) ?? []) {
|
|
608
|
+
const attempt = { ledger, declined, outcome: 'unanswered' };
|
|
609
|
+
watch.attempts.push(attempt);
|
|
610
|
+
attempts.push(attempt);
|
|
611
|
+
}
|
|
612
|
+
return attempts;
|
|
613
|
+
}
|
|
614
|
+
/**
|
|
615
|
+
* A resume of this library has taken up the request `requestId` names: from
|
|
616
|
+
* here every use of its decision passes through {@link spendDecision}, where a
|
|
617
|
+
* watch sees it. Called by every runner's resume (`RunnerBase` ·
|
|
618
|
+
* `emitPauseResume`, and `Agent.resume` before its first check) and by the
|
|
619
|
+
* dispatch loop where it takes the decision up.
|
|
620
|
+
*/
|
|
621
|
+
export function noteDecisionTakenUp(requestId) {
|
|
622
|
+
if (requestId === undefined)
|
|
623
|
+
return;
|
|
624
|
+
for (const watch of processState().watches.get(requestId) ?? [])
|
|
625
|
+
watch.takenUp = true;
|
|
626
|
+
}
|
|
627
|
+
/**
|
|
628
|
+
* Watch the request `requestId` names for the length of one resume — opened
|
|
629
|
+
* by a door that keeps the pause, before it hands the decision over, and
|
|
630
|
+
* released once it has decided what a failure means for the stored pause.
|
|
631
|
+
* Keyed by the request, never by the decision object a door may copy or wrap.
|
|
632
|
+
*/
|
|
633
|
+
export function watchDecisionUse(requestId) {
|
|
634
|
+
const watches = processState().watches;
|
|
635
|
+
const watched = { takenUp: false, attempts: [] };
|
|
636
|
+
const open = watches.get(requestId) ?? new Set();
|
|
637
|
+
open.add(watched);
|
|
638
|
+
watches.set(requestId, open);
|
|
639
|
+
return {
|
|
640
|
+
async mayHaveBeenUsed() {
|
|
641
|
+
if (watched.attempts.length === 0)
|
|
642
|
+
return !watched.takenUp;
|
|
643
|
+
for (const attempt of [...watched.attempts]) {
|
|
644
|
+
if (attempt.outcome !== 'failed')
|
|
645
|
+
return true;
|
|
646
|
+
if (!(await neverLanded(attempt.ledger, requestId)))
|
|
647
|
+
return true;
|
|
648
|
+
}
|
|
649
|
+
return false;
|
|
650
|
+
},
|
|
651
|
+
spentAsDecline() {
|
|
652
|
+
const { attempts } = watched;
|
|
653
|
+
return (attempts.some((attempt) => attempt.declined && attempt.outcome === 'spent') &&
|
|
654
|
+
attempts.every((attempt) => attempt.declined));
|
|
655
|
+
},
|
|
656
|
+
release() {
|
|
657
|
+
open.delete(watched);
|
|
658
|
+
if (open.size === 0 && watches.get(requestId) === open)
|
|
659
|
+
watches.delete(requestId);
|
|
660
|
+
},
|
|
661
|
+
};
|
|
662
|
+
}
|
|
663
|
+
/** Whether `ledger` says, when asked, that its failed spend of `requestId` never landed. */
|
|
664
|
+
async function neverLanded(ledger, requestId) {
|
|
665
|
+
if (typeof ledger.isSpent !== 'function')
|
|
666
|
+
return false;
|
|
667
|
+
try {
|
|
668
|
+
return (await ledger.isSpent(requestId)) === false;
|
|
669
|
+
}
|
|
670
|
+
catch {
|
|
671
|
+
return false;
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
/** The id of the request a paused run's state records (`pausedRequest`), or `undefined`. */
|
|
675
|
+
export function recordedRequestId(recorded) {
|
|
676
|
+
return readPendingRequest(recorded)?.id;
|
|
677
|
+
}
|
|
678
|
+
/**
|
|
679
|
+
* The id of the call a checkpoint's paused stage records as paused
|
|
680
|
+
* (`pausedToolCallId`), or `undefined` — never a throw, whatever the
|
|
681
|
+
* checkpoint holds.
|
|
682
|
+
*/
|
|
683
|
+
export function pausedCallIdOf(checkpoint) {
|
|
684
|
+
try {
|
|
685
|
+
const id = pausedStateOf(checkpoint)?.pausedToolCallId;
|
|
686
|
+
return typeof id === 'string' ? id : undefined;
|
|
687
|
+
}
|
|
688
|
+
catch {
|
|
689
|
+
return undefined;
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
/**
|
|
693
|
+
* The identity of the ledger the request a checkpoint's paused stage records
|
|
694
|
+
* was minted under ({@link PendingRequest.ledger}), or `undefined` — never a
|
|
695
|
+
* throw, whatever the checkpoint holds.
|
|
696
|
+
*/
|
|
697
|
+
export function pausedRequestLedgerOf(checkpoint) {
|
|
698
|
+
try {
|
|
699
|
+
const recorded = pausedStateOf(checkpoint)?.pausedRequest;
|
|
700
|
+
const ledger = typeof recorded === 'object' && recorded !== null
|
|
701
|
+
? recorded.ledger
|
|
702
|
+
: undefined;
|
|
703
|
+
return typeof ledger === 'string' && ledger.length > 0 ? ledger : undefined;
|
|
704
|
+
}
|
|
705
|
+
catch {
|
|
706
|
+
return undefined;
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
/**
|
|
710
|
+
* The id of the request a checkpoint's paused stage records, or `undefined`
|
|
711
|
+
* — never a throw, whatever the checkpoint holds.
|
|
712
|
+
*/
|
|
713
|
+
export function pausedRequestIdOf(checkpoint) {
|
|
714
|
+
try {
|
|
715
|
+
const state = pausedStateOf(checkpoint);
|
|
716
|
+
return state === undefined ? undefined : recordedRequestId(state.pausedRequest);
|
|
717
|
+
}
|
|
718
|
+
catch {
|
|
719
|
+
return undefined;
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
/** The request's id for `call` under `nonce`, or `undefined` when the call is not faithful JSON. */
|
|
723
|
+
function requestIdOf(nonce, call) {
|
|
724
|
+
const body = {
|
|
725
|
+
gate: call.gate,
|
|
726
|
+
tool: call.tool,
|
|
727
|
+
toolCallId: call.toolCallId,
|
|
728
|
+
party: call.party,
|
|
729
|
+
args: call.args,
|
|
730
|
+
middleware: call.middleware,
|
|
731
|
+
askIndex: call.askIndex,
|
|
732
|
+
chain: call.chain,
|
|
733
|
+
};
|
|
734
|
+
if (!isJsonFaithful(body))
|
|
735
|
+
return undefined;
|
|
736
|
+
return sha256Hex(`${DOMAIN}\u001f${nonce}\u001f${canonicalJson(body)}`);
|
|
737
|
+
}
|
|
738
|
+
/**
|
|
739
|
+
* Whether `rules` (an agent's whole chain, by link name) runs `recorded` (the
|
|
740
|
+
* names an ask bound, from its own link on) from `askIndex` — the same links,
|
|
741
|
+
* by name, in the same order, and no others after them.
|
|
742
|
+
*/
|
|
743
|
+
function sameChain(recorded, rules, askIndex) {
|
|
744
|
+
if (!Array.isArray(recorded) || typeof askIndex !== 'number' || !Number.isInteger(askIndex)) {
|
|
745
|
+
return false;
|
|
746
|
+
}
|
|
747
|
+
if (askIndex < 0)
|
|
748
|
+
return false;
|
|
749
|
+
const live = rules.slice(askIndex);
|
|
750
|
+
return live.length === recorded.length && live.every((name, at) => name === recorded[at]);
|
|
751
|
+
}
|
|
752
|
+
function readPendingRequest(recorded) {
|
|
753
|
+
if (typeof recorded !== 'object' || recorded === null)
|
|
754
|
+
return undefined;
|
|
755
|
+
const { id, nonce } = recorded;
|
|
756
|
+
return typeof id === 'string' &&
|
|
757
|
+
HEX_ID.test(id) &&
|
|
758
|
+
typeof nonce === 'string' &&
|
|
759
|
+
HEX_NONCE.test(nonce)
|
|
760
|
+
? { id, nonce }
|
|
761
|
+
: undefined;
|
|
762
|
+
}
|
|
763
|
+
/**
|
|
764
|
+
* A copy of the input's decision fields, each read ONCE and then judged — the
|
|
765
|
+
* input is caller data, and a getter or a proxy must not answer the check one
|
|
766
|
+
* way and the use another. `undefined` when the copy is not decision-shaped,
|
|
767
|
+
* or the input cannot be read at all.
|
|
768
|
+
*/
|
|
769
|
+
function decisionCopyOf(input) {
|
|
770
|
+
if (typeof input !== 'object' || input === null)
|
|
771
|
+
return undefined;
|
|
772
|
+
let copy;
|
|
773
|
+
try {
|
|
774
|
+
const source = input;
|
|
775
|
+
copy = {
|
|
776
|
+
requestId: source.requestId,
|
|
777
|
+
approved: source.approved,
|
|
778
|
+
by: source.by,
|
|
779
|
+
at: source.at,
|
|
780
|
+
note: source.note,
|
|
781
|
+
value: source.value,
|
|
782
|
+
};
|
|
783
|
+
}
|
|
784
|
+
catch {
|
|
785
|
+
return undefined;
|
|
786
|
+
}
|
|
787
|
+
if (!looksLikeDecision(copy))
|
|
788
|
+
return undefined;
|
|
789
|
+
const { note, value, ...fields } = copy;
|
|
790
|
+
return {
|
|
791
|
+
...fields,
|
|
792
|
+
...(note !== undefined && { note: note }),
|
|
793
|
+
...(value !== undefined && { value: value }),
|
|
794
|
+
};
|
|
795
|
+
}
|
|
796
|
+
function pausedStateOf(checkpoint) {
|
|
797
|
+
const path = checkpoint.subflowPath;
|
|
798
|
+
if (!Array.isArray(path) || path.length === 0)
|
|
799
|
+
return objectOrUndefined(checkpoint.sharedState);
|
|
800
|
+
const innermost = path[path.length - 1];
|
|
801
|
+
return typeof innermost === 'string'
|
|
802
|
+
? objectOrUndefined(checkpoint.subflowStates?.[innermost])
|
|
803
|
+
: undefined;
|
|
804
|
+
}
|
|
805
|
+
function objectOrUndefined(value) {
|
|
806
|
+
return typeof value === 'object' && value !== null
|
|
807
|
+
? value
|
|
808
|
+
: undefined;
|
|
809
|
+
}
|
|
810
|
+
function randomHex(bytes) {
|
|
811
|
+
const buffer = globalThis.crypto.getRandomValues(new Uint8Array(bytes));
|
|
812
|
+
let out = '';
|
|
813
|
+
for (const byte of buffer)
|
|
814
|
+
out += byte.toString(16).padStart(2, '0');
|
|
815
|
+
return out;
|
|
816
|
+
}
|
|
817
|
+
//# sourceMappingURL=consentRequest.js.map
|