agentfootprint 14.7.3 → 14.9.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 +1 -1
- package/CAPABILITIES.md +2 -0
- package/ai-instructions/claude-code/SKILL.md +1 -1
- package/dist/adapters/observability/auditShapes/events/decisions.js +11 -0
- package/dist/adapters/observability/auditShapes/events/decisions.js.map +1 -1
- package/dist/adapters/observability/auditShapes/events/outcomes.js +2 -0
- package/dist/adapters/observability/auditShapes/events/outcomes.js.map +1 -1
- package/dist/artifacts/sourceEvidence/datasets.js.map +1 -1
- package/dist/core/agent/AgentBuilder.js +31 -36
- package/dist/core/agent/AgentBuilder.js.map +1 -1
- package/dist/core/agent/arguments/dispatch.js +5 -1
- package/dist/core/agent/arguments/dispatch.js.map +1 -1
- package/dist/core/agent/arguments/events.js +42 -0
- package/dist/core/agent/arguments/events.js.map +1 -0
- package/dist/core/agent/arguments/rows.js +13 -3
- package/dist/core/agent/arguments/rows.js.map +1 -1
- package/dist/core/agent/arguments/sourceCorrection.js +85 -0
- package/dist/core/agent/arguments/sourceCorrection.js.map +1 -0
- package/dist/core/agent/arguments/subflow.js +11 -3
- package/dist/core/agent/arguments/subflow.js.map +1 -1
- package/dist/core/agent/assessment/argumentRows.js +50 -0
- package/dist/core/agent/assessment/argumentRows.js.map +1 -0
- package/dist/core/agent/assessment/assess.js +43 -84
- package/dist/core/agent/assessment/assess.js.map +1 -1
- package/dist/core/agent/assessment/recordValues.js +9 -0
- package/dist/core/agent/assessment/recordValues.js.map +1 -0
- package/dist/core/agent/builder/assembly/build.js +13 -4
- package/dist/core/agent/builder/assembly/build.js.map +1 -1
- package/dist/core/agent/builder/honesty/layers.js +4 -0
- package/dist/core/agent/builder/honesty/layers.js.map +1 -1
- package/dist/core/agent/findings/ledger.js +4 -36
- package/dist/core/agent/findings/ledger.js.map +1 -1
- package/dist/core/agent/honesty/armed.js +15 -4
- package/dist/core/agent/honesty/armed.js.map +1 -1
- package/dist/core/agent/honesty/mounts.js +16 -26
- package/dist/core/agent/honesty/mounts.js.map +1 -1
- package/dist/core/agent/honesty/sourceCorpus.js +2 -0
- package/dist/core/agent/honesty/sourceCorpus.js.map +1 -1
- package/dist/core/agent/honesty/sourceInputs.js +29 -0
- package/dist/core/agent/honesty/sourceInputs.js.map +1 -0
- package/dist/core/agent/resultRowsets/catalog.js +55 -0
- package/dist/core/agent/resultRowsets/catalog.js.map +1 -0
- package/dist/core/agent/resultRowsets/finalization.js +116 -0
- package/dist/core/agent/resultRowsets/finalization.js.map +1 -0
- package/dist/core/agent/resultRowsets/inlineRows.js +125 -0
- package/dist/core/agent/resultRowsets/inlineRows.js.map +1 -0
- package/dist/core/agent/resultRowsets/judge.js +104 -0
- package/dist/core/agent/resultRowsets/judge.js.map +1 -0
- package/dist/core/agent/resultRowsets/read.js +91 -0
- package/dist/core/agent/resultRowsets/read.js.map +1 -0
- package/dist/core/agent/resultRowsets/resumed.js +18 -0
- package/dist/core/agent/resultRowsets/resumed.js.map +1 -0
- package/dist/core/agent/runValues.js.map +1 -1
- package/dist/core/agent/runtime/catalog/buildCatalog.js +3 -0
- package/dist/core/agent/runtime/catalog/buildCatalog.js.map +1 -1
- package/dist/core/agent/runtime/chart/chartDependencies.js +3 -0
- package/dist/core/agent/runtime/chart/chartDependencies.js.map +1 -1
- package/dist/core/agent/runtime/chart/owner.js +5 -1
- package/dist/core/agent/runtime/chart/owner.js.map +1 -1
- package/dist/core/agent/runtime/configuration/configure.js +6 -0
- package/dist/core/agent/runtime/configuration/configure.js.map +1 -1
- package/dist/core/agent/runtime/configuration/values.js.map +1 -1
- package/dist/core/agent/runtime/conversation/checkpointParts.js +42 -1
- package/dist/core/agent/runtime/conversation/checkpointParts.js.map +1 -1
- package/dist/core/agent/runtime/conversation/owner.js +11 -0
- package/dist/core/agent/runtime/conversation/owner.js.map +1 -1
- package/dist/core/agent/runtime/conversation/seedHistory.js +51 -1
- package/dist/core/agent/runtime/conversation/seedHistory.js.map +1 -1
- package/dist/core/agent/runtime/integrity/owner.js +1 -1
- package/dist/core/agent/runtime/integrity/owner.js.map +1 -1
- package/dist/core/agent/runtime/request/factory.js +10 -2
- package/dist/core/agent/runtime/request/factory.js.map +1 -1
- package/dist/core/agent/runtime/resume/owner.js +5 -0
- package/dist/core/agent/runtime/resume/owner.js.map +1 -1
- package/dist/core/agent/runtime/seed/factory.js +8 -0
- package/dist/core/agent/runtime/seed/factory.js.map +1 -1
- package/dist/core/agent/runtime/slots/buildSlots.js +16 -1
- package/dist/core/agent/runtime/slots/buildSlots.js.map +1 -1
- package/dist/core/agent/runtime/toolCalls/factory.js +12 -2
- package/dist/core/agent/runtime/toolCalls/factory.js.map +1 -1
- package/dist/core/agent/runtime/turn/owner.js +2 -1
- package/dist/core/agent/runtime/turn/owner.js.map +1 -1
- package/dist/core/agent/sourceEvidence/capture.js +9 -4
- package/dist/core/agent/sourceEvidence/capture.js.map +1 -1
- package/dist/core/agent/sourceEvidence/publications.js +57 -22
- package/dist/core/agent/sourceEvidence/publications.js.map +1 -1
- package/dist/core/agent/stages/argumentAsk.js +20 -1
- package/dist/core/agent/stages/argumentAsk.js.map +1 -1
- package/dist/core/agent/stages/callLLM.js +7 -8
- package/dist/core/agent/stages/callLLM.js.map +1 -1
- package/dist/core/agent/stages/seed.js +7 -50
- package/dist/core/agent/stages/seed.js.map +1 -1
- package/dist/core/agent/stages/toolCalls/batch/assistantTurn.js +21 -0
- package/dist/core/agent/stages/toolCalls/batch/assistantTurn.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/batch/dispatchContext.js +5 -23
- package/dist/core/agent/stages/toolCalls/batch/dispatchContext.js.map +1 -1
- package/dist/core/agent/stages/toolCalls/batch/execute.js +94 -3
- package/dist/core/agent/stages/toolCalls/batch/execute.js.map +1 -1
- package/dist/core/agent/stages/toolCalls/batch/inputResolutions.js +2 -2
- package/dist/core/agent/stages/toolCalls/batch/inputResolutions.js.map +1 -1
- package/dist/core/agent/stages/toolCalls/batch/refusal.js +51 -1
- package/dist/core/agent/stages/toolCalls/batch/refusal.js.map +1 -1
- package/dist/core/agent/stages/toolCalls/execution/contextOperations.js +2 -2
- package/dist/core/agent/stages/toolCalls/execution/contextOperations.js.map +1 -1
- package/dist/core/agent/stages/toolCalls/execution/dispatchCall.js +415 -442
- package/dist/core/agent/stages/toolCalls/execution/dispatchCall.js.map +1 -1
- package/dist/core/agent/stages/toolCalls/execution/finalizeCallResult.js +73 -0
- package/dist/core/agent/stages/toolCalls/execution/finalizeCallResult.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/execution/initialInvocation.js +4 -5
- package/dist/core/agent/stages/toolCalls/execution/initialInvocation.js.map +1 -1
- package/dist/core/agent/stages/toolCalls/execution/resumedInvocation.js +7 -6
- package/dist/core/agent/stages/toolCalls/execution/resumedInvocation.js.map +1 -1
- package/dist/core/agent/stages/toolCalls/resume/ask.js +354 -333
- package/dist/core/agent/stages/toolCalls/resume/ask.js.map +1 -1
- package/dist/core/agent/stages/toolCalls/resume/checkIn.js +159 -136
- package/dist/core/agent/stages/toolCalls/resume/checkIn.js.map +1 -1
- package/dist/core/agent/stages/toolCalls/resume/credential.js +142 -117
- package/dist/core/agent/stages/toolCalls/resume/credential.js.map +1 -1
- package/dist/core/runCheckpoint.js +13 -2
- package/dist/core/runCheckpoint.js.map +1 -1
- package/dist/core/runCheckpointTypes.js +3 -0
- package/dist/core/runCheckpointTypes.js.map +1 -0
- package/dist/core/slots/discoverTools.js +5 -0
- package/dist/core/slots/discoverTools.js.map +1 -1
- package/dist/esm/adapters/observability/auditShapes/events/decisions.d.ts +1 -0
- package/dist/esm/adapters/observability/auditShapes/events/decisions.js +11 -0
- package/dist/esm/adapters/observability/auditShapes/events/decisions.js.map +1 -1
- package/dist/esm/adapters/observability/auditShapes/events/outcomes.js +2 -0
- package/dist/esm/adapters/observability/auditShapes/events/outcomes.js.map +1 -1
- package/dist/esm/artifacts/sourceEvidence/datasets.d.ts +1 -1
- package/dist/esm/artifacts/sourceEvidence/datasets.js.map +1 -1
- package/dist/esm/core/agent/AgentBuilder.d.ts +26 -36
- package/dist/esm/core/agent/AgentBuilder.js +31 -36
- package/dist/esm/core/agent/AgentBuilder.js.map +1 -1
- package/dist/esm/core/agent/arguments/dispatch.d.ts +1 -0
- package/dist/esm/core/agent/arguments/dispatch.js +1 -0
- package/dist/esm/core/agent/arguments/dispatch.js.map +1 -1
- package/dist/esm/core/agent/arguments/events.d.ts +11 -0
- package/dist/esm/core/agent/arguments/events.js +38 -0
- package/dist/esm/core/agent/arguments/events.js.map +1 -0
- package/dist/esm/core/agent/arguments/rows.d.ts +7 -3
- package/dist/esm/core/agent/arguments/rows.js +13 -3
- package/dist/esm/core/agent/arguments/rows.js.map +1 -1
- package/dist/esm/core/agent/arguments/sourceCorrection.d.ts +25 -0
- package/dist/esm/core/agent/arguments/sourceCorrection.js +78 -0
- package/dist/esm/core/agent/arguments/sourceCorrection.js.map +1 -0
- package/dist/esm/core/agent/arguments/sources.d.ts +2 -0
- package/dist/esm/core/agent/arguments/subflow.d.ts +2 -0
- package/dist/esm/core/agent/arguments/subflow.js +11 -3
- package/dist/esm/core/agent/arguments/subflow.js.map +1 -1
- package/dist/esm/core/agent/assessment/argumentRows.d.ts +27 -0
- package/dist/esm/core/agent/assessment/argumentRows.js +46 -0
- package/dist/esm/core/agent/assessment/argumentRows.js.map +1 -0
- package/dist/esm/core/agent/assessment/assess.js +3 -44
- package/dist/esm/core/agent/assessment/assess.js.map +1 -1
- package/dist/esm/core/agent/assessment/recordValues.d.ts +3 -0
- package/dist/esm/core/agent/assessment/recordValues.js +4 -0
- package/dist/esm/core/agent/assessment/recordValues.js.map +1 -0
- package/dist/esm/core/agent/builder/assembly/build.d.ts +1 -0
- package/dist/esm/core/agent/builder/assembly/build.js +13 -4
- package/dist/esm/core/agent/builder/assembly/build.js.map +1 -1
- package/dist/esm/core/agent/builder/honesty/layers.d.ts +3 -3
- package/dist/esm/core/agent/builder/honesty/layers.js +4 -0
- package/dist/esm/core/agent/builder/honesty/layers.js.map +1 -1
- package/dist/esm/core/agent/findings/ledger.js +1 -33
- package/dist/esm/core/agent/findings/ledger.js.map +1 -1
- package/dist/esm/core/agent/honesty/armed.d.ts +6 -2
- package/dist/esm/core/agent/honesty/armed.js +15 -4
- package/dist/esm/core/agent/honesty/armed.js.map +1 -1
- package/dist/esm/core/agent/honesty/inputsMountContract.d.ts +1 -0
- package/dist/esm/core/agent/honesty/mounts.js +15 -25
- package/dist/esm/core/agent/honesty/mounts.js.map +1 -1
- package/dist/esm/core/agent/honesty/sourceCorpus.d.ts +1 -0
- package/dist/esm/core/agent/honesty/sourceCorpus.js +2 -0
- package/dist/esm/core/agent/honesty/sourceCorpus.js.map +1 -1
- package/dist/esm/core/agent/honesty/sourceInputs.d.ts +9 -0
- package/dist/esm/core/agent/honesty/sourceInputs.js +25 -0
- package/dist/esm/core/agent/honesty/sourceInputs.js.map +1 -0
- package/dist/esm/core/agent/resultRowsets/catalog.d.ts +17 -0
- package/dist/esm/core/agent/resultRowsets/catalog.js +47 -0
- package/dist/esm/core/agent/resultRowsets/catalog.js.map +1 -0
- package/dist/esm/core/agent/resultRowsets/finalization.d.ts +25 -0
- package/dist/esm/core/agent/resultRowsets/finalization.js +112 -0
- package/dist/esm/core/agent/resultRowsets/finalization.js.map +1 -0
- package/dist/esm/core/agent/resultRowsets/inlineRows.d.ts +15 -0
- package/dist/esm/core/agent/resultRowsets/inlineRows.js +119 -0
- package/dist/esm/core/agent/resultRowsets/inlineRows.js.map +1 -0
- package/dist/esm/core/agent/resultRowsets/judge.d.ts +18 -0
- package/dist/esm/core/agent/resultRowsets/judge.js +99 -0
- package/dist/esm/core/agent/resultRowsets/judge.js.map +1 -0
- package/dist/esm/core/agent/resultRowsets/read.d.ts +12 -0
- package/dist/esm/core/agent/resultRowsets/read.js +87 -0
- package/dist/esm/core/agent/resultRowsets/read.js.map +1 -0
- package/dist/esm/core/agent/resultRowsets/resumed.d.ts +21 -0
- package/dist/esm/core/agent/resultRowsets/resumed.js +14 -0
- package/dist/esm/core/agent/resultRowsets/resumed.js.map +1 -0
- package/dist/esm/core/agent/runValues.d.ts +2 -1
- package/dist/esm/core/agent/runValues.js.map +1 -1
- package/dist/esm/core/agent/runtime/catalog/buildCatalog.js +3 -0
- package/dist/esm/core/agent/runtime/catalog/buildCatalog.js.map +1 -1
- package/dist/esm/core/agent/runtime/chart/chartDependencies.d.ts +1 -0
- package/dist/esm/core/agent/runtime/chart/chartDependencies.js +3 -0
- package/dist/esm/core/agent/runtime/chart/chartDependencies.js.map +1 -1
- package/dist/esm/core/agent/runtime/chart/owner.js +5 -1
- package/dist/esm/core/agent/runtime/chart/owner.js.map +1 -1
- package/dist/esm/core/agent/runtime/configuration/configure.js +6 -0
- package/dist/esm/core/agent/runtime/configuration/configure.js.map +1 -1
- package/dist/esm/core/agent/runtime/configuration/types.d.ts +1 -0
- package/dist/esm/core/agent/runtime/configuration/values.d.ts +1 -0
- package/dist/esm/core/agent/runtime/configuration/values.js.map +1 -1
- package/dist/esm/core/agent/runtime/conversation/checkpointParts.d.ts +3 -1
- package/dist/esm/core/agent/runtime/conversation/checkpointParts.js +40 -0
- package/dist/esm/core/agent/runtime/conversation/checkpointParts.js.map +1 -1
- package/dist/esm/core/agent/runtime/conversation/owner.js +12 -1
- package/dist/esm/core/agent/runtime/conversation/owner.js.map +1 -1
- package/dist/esm/core/agent/runtime/conversation/seedHistory.d.ts +23 -0
- package/dist/esm/core/agent/runtime/conversation/seedHistory.js +49 -0
- package/dist/esm/core/agent/runtime/conversation/seedHistory.js.map +1 -1
- package/dist/esm/core/agent/runtime/integrity/owner.js +1 -1
- package/dist/esm/core/agent/runtime/integrity/owner.js.map +1 -1
- package/dist/esm/core/agent/runtime/request/factory.d.ts +3 -0
- package/dist/esm/core/agent/runtime/request/factory.js +10 -2
- package/dist/esm/core/agent/runtime/request/factory.js.map +1 -1
- package/dist/esm/core/agent/runtime/resume/owner.js +6 -1
- package/dist/esm/core/agent/runtime/resume/owner.js.map +1 -1
- package/dist/esm/core/agent/runtime/seed/factory.js +8 -0
- package/dist/esm/core/agent/runtime/seed/factory.js.map +1 -1
- package/dist/esm/core/agent/runtime/slots/buildSlots.d.ts +3 -0
- package/dist/esm/core/agent/runtime/slots/buildSlots.js +16 -1
- package/dist/esm/core/agent/runtime/slots/buildSlots.js.map +1 -1
- package/dist/esm/core/agent/runtime/toolCalls/factory.d.ts +3 -0
- package/dist/esm/core/agent/runtime/toolCalls/factory.js +12 -2
- package/dist/esm/core/agent/runtime/toolCalls/factory.js.map +1 -1
- package/dist/esm/core/agent/runtime/turn/owner.js +3 -2
- package/dist/esm/core/agent/runtime/turn/owner.js.map +1 -1
- package/dist/esm/core/agent/sourceEvidence/capture.d.ts +2 -1
- package/dist/esm/core/agent/sourceEvidence/capture.js +10 -5
- package/dist/esm/core/agent/sourceEvidence/capture.js.map +1 -1
- package/dist/esm/core/agent/sourceEvidence/publications.d.ts +3 -1
- package/dist/esm/core/agent/sourceEvidence/publications.js +55 -20
- package/dist/esm/core/agent/sourceEvidence/publications.js.map +1 -1
- package/dist/esm/core/agent/stages/argumentAsk.js +20 -1
- package/dist/esm/core/agent/stages/argumentAsk.js.map +1 -1
- package/dist/esm/core/agent/stages/argumentAskDeps.d.ts +7 -1
- package/dist/esm/core/agent/stages/callLLM/types.d.ts +4 -3
- package/dist/esm/core/agent/stages/callLLM.js +7 -8
- package/dist/esm/core/agent/stages/callLLM.js.map +1 -1
- package/dist/esm/core/agent/stages/seed.d.ts +3 -1
- package/dist/esm/core/agent/stages/seed.js +7 -50
- package/dist/esm/core/agent/stages/seed.js.map +1 -1
- package/dist/esm/core/agent/stages/toolCalls/batch/assistantTurn.d.ts +6 -0
- package/dist/esm/core/agent/stages/toolCalls/batch/assistantTurn.js +17 -0
- package/dist/esm/core/agent/stages/toolCalls/batch/assistantTurn.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/batch/dispatchContext.js +5 -23
- package/dist/esm/core/agent/stages/toolCalls/batch/dispatchContext.js.map +1 -1
- package/dist/esm/core/agent/stages/toolCalls/batch/execute.js +95 -4
- package/dist/esm/core/agent/stages/toolCalls/batch/execute.js.map +1 -1
- package/dist/esm/core/agent/stages/toolCalls/batch/inputResolutions.d.ts +1 -1
- package/dist/esm/core/agent/stages/toolCalls/batch/inputResolutions.js +2 -2
- package/dist/esm/core/agent/stages/toolCalls/batch/inputResolutions.js.map +1 -1
- package/dist/esm/core/agent/stages/toolCalls/batch/refusal.d.ts +3 -0
- package/dist/esm/core/agent/stages/toolCalls/batch/refusal.js +49 -0
- package/dist/esm/core/agent/stages/toolCalls/batch/refusal.js.map +1 -1
- package/dist/esm/core/agent/stages/toolCalls/compose.d.ts +1 -1
- package/dist/esm/core/agent/stages/toolCalls/contracts/callCells.d.ts +2 -2
- package/dist/esm/core/agent/stages/toolCalls/contracts/callFacts.d.ts +2 -2
- package/dist/esm/core/agent/stages/toolCalls/contracts/evidence.d.ts +8 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/operations/context.d.ts +1 -1
- package/dist/esm/core/agent/stages/toolCalls/execution/contextOperations.js +2 -2
- package/dist/esm/core/agent/stages/toolCalls/execution/contextOperations.js.map +1 -1
- package/dist/esm/core/agent/stages/toolCalls/execution/dispatchCall.js +415 -442
- package/dist/esm/core/agent/stages/toolCalls/execution/dispatchCall.js.map +1 -1
- package/dist/esm/core/agent/stages/toolCalls/execution/finalizeCallResult.d.ts +25 -0
- package/dist/esm/core/agent/stages/toolCalls/execution/finalizeCallResult.js +69 -0
- package/dist/esm/core/agent/stages/toolCalls/execution/finalizeCallResult.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/execution/initialInvocation.js +4 -5
- package/dist/esm/core/agent/stages/toolCalls/execution/initialInvocation.js.map +1 -1
- package/dist/esm/core/agent/stages/toolCalls/execution/resumedInvocation.d.ts +1 -1
- package/dist/esm/core/agent/stages/toolCalls/execution/resumedInvocation.js +7 -6
- package/dist/esm/core/agent/stages/toolCalls/execution/resumedInvocation.js.map +1 -1
- package/dist/esm/core/agent/stages/toolCalls/resume/ask.js +354 -333
- package/dist/esm/core/agent/stages/toolCalls/resume/ask.js.map +1 -1
- package/dist/esm/core/agent/stages/toolCalls/resume/checkIn.js +159 -136
- package/dist/esm/core/agent/stages/toolCalls/resume/checkIn.js.map +1 -1
- package/dist/esm/core/agent/stages/toolCalls/resume/credential.js +142 -117
- package/dist/esm/core/agent/stages/toolCalls/resume/credential.js.map +1 -1
- package/dist/esm/core/agent/types/state/honesty.d.ts +4 -0
- package/dist/esm/core/agent/types.d.ts +1 -3
- package/dist/esm/core/runCheckpoint.d.ts +3 -208
- package/dist/esm/core/runCheckpoint.js +14 -3
- package/dist/esm/core/runCheckpoint.js.map +1 -1
- package/dist/esm/core/runCheckpointTypes.d.ts +219 -0
- package/dist/esm/core/runCheckpointTypes.js +2 -0
- package/dist/esm/core/runCheckpointTypes.js.map +1 -0
- package/dist/esm/core/slots/discoverTools.js +5 -0
- package/dist/esm/core/slots/discoverTools.js.map +1 -1
- package/dist/esm/events/payloads/findings.d.ts +2 -0
- package/dist/esm/events/payloads/toolRowsets.d.ts +14 -0
- package/dist/esm/events/payloads/toolRowsets.js +2 -0
- package/dist/esm/events/payloads/toolRowsets.js.map +1 -0
- package/dist/esm/events/payloads.d.ts +1 -0
- package/dist/esm/events/registry/names.d.ts +1 -0
- package/dist/esm/events/registry/names.js +1 -0
- package/dist/esm/events/registry/names.js.map +1 -1
- package/dist/esm/events/registry/toolEvents.d.ts +32 -0
- package/dist/esm/events/registry/toolEvents.js +2 -0
- package/dist/esm/events/registry/toolEvents.js.map +1 -0
- package/dist/esm/events/registry.d.ts +3 -28
- package/dist/esm/events/registry.js +1 -0
- package/dist/esm/events/registry.js.map +1 -1
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +1 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/integrity/column-types/check.d.ts +2 -0
- package/dist/esm/integrity/column-types/check.js +8 -2
- package/dist/esm/integrity/column-types/check.js.map +1 -1
- package/dist/esm/integrity/finding/types.d.ts +2 -0
- package/dist/esm/integrity/finding/types.js +18 -0
- package/dist/esm/integrity/finding/types.js.map +1 -1
- package/dist/esm/mcp/toolExtras.d.ts +8 -4
- package/dist/esm/mcp/toolExtras.js +20 -4
- package/dist/esm/mcp/toolExtras.js.map +1 -1
- package/dist/esm/recorders/core/typedEmit.d.ts +6 -1
- package/dist/esm/recorders/core/typedEmit.js +9 -2
- package/dist/esm/recorders/core/typedEmit.js.map +1 -1
- package/dist/esm/recorders/observability/commentary/commentaryTemplates/dispositions.js +1 -0
- package/dist/esm/recorders/observability/commentary/commentaryTemplates/dispositions.js.map +1 -1
- package/dist/esm/redaction/knownStrings/fields-0.d.ts +1 -1
- package/dist/esm/redaction/knownStrings/fields-0.js +1 -1
- package/dist/esm/redaction/knownStrings/fields-0.js.map +1 -1
- package/dist/esm/redaction/knownStrings/fields-1.d.ts +2 -2
- package/dist/esm/redaction/knownStrings/fields-1.js +2 -2
- package/dist/esm/redaction/knownStrings/fields-1.js.map +1 -1
- package/dist/esm/redaction/knownStrings/fields-2.d.ts +3 -0
- package/dist/esm/redaction/knownStrings/fields-2.js +3 -0
- package/dist/esm/redaction/knownStrings/fields-2.js.map +1 -1
- package/dist/esm/redaction/knownStrings/words-0.d.ts +5 -5
- package/dist/esm/redaction/knownStrings/words-0.js +5 -5
- package/dist/esm/redaction/knownStrings/words-0.js.map +1 -1
- package/dist/esm/redaction/knownStrings/words-1.d.ts +17 -17
- package/dist/esm/redaction/knownStrings/words-1.js +17 -17
- package/dist/esm/redaction/knownStrings/words-1.js.map +1 -1
- package/dist/esm/redaction/knownStrings/words-2.d.ts +20 -0
- package/dist/esm/redaction/knownStrings/words-2.js +20 -0
- package/dist/esm/redaction/knownStrings/words-2.js.map +1 -1
- package/dist/esm/redaction/runRedaction.d.ts +1 -1
- package/dist/esm/redaction/runRedaction.js +2 -2
- package/dist/esm/redaction/runRedaction.js.map +1 -1
- package/dist/esm/tools/resultRowsets.d.ts +22 -0
- package/dist/esm/tools/resultRowsets.js +65 -0
- package/dist/esm/tools/resultRowsets.js.map +1 -0
- package/dist/esm/tools/tools.d.ts +7 -9
- package/dist/esm/tools/tools.js +5 -9
- package/dist/esm/tools/tools.js.map +1 -1
- package/dist/events/payloads/toolRowsets.js +3 -0
- package/dist/events/payloads/toolRowsets.js.map +1 -0
- package/dist/events/registry/names.js +1 -0
- package/dist/events/registry/names.js.map +1 -1
- package/dist/events/registry/toolEvents.js +3 -0
- package/dist/events/registry/toolEvents.js.map +1 -0
- package/dist/events/registry.js +1 -0
- package/dist/events/registry.js.map +1 -1
- package/dist/index.js +1 -2
- package/dist/index.js.map +1 -1
- package/dist/integrity/column-types/check.js +8 -2
- package/dist/integrity/column-types/check.js.map +1 -1
- package/dist/integrity/finding/types.js +18 -0
- package/dist/integrity/finding/types.js.map +1 -1
- package/dist/mcp/toolExtras.js +20 -4
- package/dist/mcp/toolExtras.js.map +1 -1
- package/dist/recorders/core/typedEmit.js +9 -2
- package/dist/recorders/core/typedEmit.js.map +1 -1
- package/dist/recorders/observability/commentary/commentaryTemplates/dispositions.js +1 -0
- package/dist/recorders/observability/commentary/commentaryTemplates/dispositions.js.map +1 -1
- package/dist/redaction/knownStrings/fields-0.js +1 -1
- package/dist/redaction/knownStrings/fields-0.js.map +1 -1
- package/dist/redaction/knownStrings/fields-1.js +2 -2
- package/dist/redaction/knownStrings/fields-1.js.map +1 -1
- package/dist/redaction/knownStrings/fields-2.js +3 -0
- package/dist/redaction/knownStrings/fields-2.js.map +1 -1
- package/dist/redaction/knownStrings/words-0.js +5 -5
- package/dist/redaction/knownStrings/words-0.js.map +1 -1
- package/dist/redaction/knownStrings/words-1.js +17 -17
- package/dist/redaction/knownStrings/words-1.js.map +1 -1
- package/dist/redaction/knownStrings/words-2.js +20 -0
- package/dist/redaction/knownStrings/words-2.js.map +1 -1
- package/dist/redaction/runRedaction.js +2 -2
- package/dist/redaction/runRedaction.js.map +1 -1
- package/dist/tools/resultRowsets.js +70 -0
- package/dist/tools/resultRowsets.js.map +1 -0
- package/dist/tools/tools.js +5 -9
- package/dist/tools/tools.js.map +1 -1
- package/dist/types/adapters/observability/auditShapes/events/decisions.d.ts +1 -0
- package/dist/types/adapters/observability/auditShapes/events/decisions.d.ts.map +1 -1
- package/dist/types/adapters/observability/auditShapes/events/outcomes.d.ts.map +1 -1
- package/dist/types/artifacts/sourceEvidence/datasets.d.ts +1 -1
- package/dist/types/artifacts/sourceEvidence/datasets.d.ts.map +1 -1
- package/dist/types/core/agent/AgentBuilder.d.ts +26 -36
- package/dist/types/core/agent/AgentBuilder.d.ts.map +1 -1
- package/dist/types/core/agent/arguments/dispatch.d.ts +1 -0
- package/dist/types/core/agent/arguments/dispatch.d.ts.map +1 -1
- package/dist/types/core/agent/arguments/events.d.ts +12 -0
- package/dist/types/core/agent/arguments/events.d.ts.map +1 -0
- package/dist/types/core/agent/arguments/rows.d.ts +7 -3
- package/dist/types/core/agent/arguments/rows.d.ts.map +1 -1
- package/dist/types/core/agent/arguments/sourceCorrection.d.ts +26 -0
- package/dist/types/core/agent/arguments/sourceCorrection.d.ts.map +1 -0
- package/dist/types/core/agent/arguments/sources.d.ts +2 -0
- package/dist/types/core/agent/arguments/sources.d.ts.map +1 -1
- package/dist/types/core/agent/arguments/subflow.d.ts +2 -0
- package/dist/types/core/agent/arguments/subflow.d.ts.map +1 -1
- package/dist/types/core/agent/assessment/argumentRows.d.ts +28 -0
- package/dist/types/core/agent/assessment/argumentRows.d.ts.map +1 -0
- package/dist/types/core/agent/assessment/assess.d.ts.map +1 -1
- package/dist/types/core/agent/assessment/recordValues.d.ts +4 -0
- package/dist/types/core/agent/assessment/recordValues.d.ts.map +1 -0
- package/dist/types/core/agent/builder/assembly/build.d.ts +1 -0
- package/dist/types/core/agent/builder/assembly/build.d.ts.map +1 -1
- package/dist/types/core/agent/builder/honesty/layers.d.ts +3 -3
- package/dist/types/core/agent/builder/honesty/layers.d.ts.map +1 -1
- package/dist/types/core/agent/findings/ledger.d.ts.map +1 -1
- package/dist/types/core/agent/honesty/armed.d.ts +6 -2
- package/dist/types/core/agent/honesty/armed.d.ts.map +1 -1
- package/dist/types/core/agent/honesty/inputsMountContract.d.ts +1 -0
- package/dist/types/core/agent/honesty/inputsMountContract.d.ts.map +1 -1
- package/dist/types/core/agent/honesty/mounts.d.ts.map +1 -1
- package/dist/types/core/agent/honesty/sourceCorpus.d.ts +1 -0
- package/dist/types/core/agent/honesty/sourceCorpus.d.ts.map +1 -1
- package/dist/types/core/agent/honesty/sourceInputs.d.ts +10 -0
- package/dist/types/core/agent/honesty/sourceInputs.d.ts.map +1 -0
- package/dist/types/core/agent/resultRowsets/catalog.d.ts +18 -0
- package/dist/types/core/agent/resultRowsets/catalog.d.ts.map +1 -0
- package/dist/types/core/agent/resultRowsets/finalization.d.ts +26 -0
- package/dist/types/core/agent/resultRowsets/finalization.d.ts.map +1 -0
- package/dist/types/core/agent/resultRowsets/inlineRows.d.ts +16 -0
- package/dist/types/core/agent/resultRowsets/inlineRows.d.ts.map +1 -0
- package/dist/types/core/agent/resultRowsets/judge.d.ts +19 -0
- package/dist/types/core/agent/resultRowsets/judge.d.ts.map +1 -0
- package/dist/types/core/agent/resultRowsets/read.d.ts +13 -0
- package/dist/types/core/agent/resultRowsets/read.d.ts.map +1 -0
- package/dist/types/core/agent/resultRowsets/resumed.d.ts +22 -0
- package/dist/types/core/agent/resultRowsets/resumed.d.ts.map +1 -0
- package/dist/types/core/agent/runValues.d.ts +2 -1
- package/dist/types/core/agent/runValues.d.ts.map +1 -1
- package/dist/types/core/agent/runtime/catalog/buildCatalog.d.ts.map +1 -1
- package/dist/types/core/agent/runtime/chart/chartDependencies.d.ts +1 -0
- package/dist/types/core/agent/runtime/chart/chartDependencies.d.ts.map +1 -1
- package/dist/types/core/agent/runtime/chart/owner.d.ts.map +1 -1
- package/dist/types/core/agent/runtime/configuration/configure.d.ts.map +1 -1
- package/dist/types/core/agent/runtime/configuration/types.d.ts +1 -0
- package/dist/types/core/agent/runtime/configuration/types.d.ts.map +1 -1
- package/dist/types/core/agent/runtime/configuration/values.d.ts +1 -0
- package/dist/types/core/agent/runtime/configuration/values.d.ts.map +1 -1
- package/dist/types/core/agent/runtime/conversation/checkpointParts.d.ts +3 -1
- package/dist/types/core/agent/runtime/conversation/checkpointParts.d.ts.map +1 -1
- package/dist/types/core/agent/runtime/conversation/owner.d.ts.map +1 -1
- package/dist/types/core/agent/runtime/conversation/seedHistory.d.ts +23 -0
- package/dist/types/core/agent/runtime/conversation/seedHistory.d.ts.map +1 -1
- package/dist/types/core/agent/runtime/request/factory.d.ts +3 -0
- package/dist/types/core/agent/runtime/request/factory.d.ts.map +1 -1
- package/dist/types/core/agent/runtime/resume/owner.d.ts.map +1 -1
- package/dist/types/core/agent/runtime/seed/factory.d.ts.map +1 -1
- package/dist/types/core/agent/runtime/slots/buildSlots.d.ts +3 -0
- package/dist/types/core/agent/runtime/slots/buildSlots.d.ts.map +1 -1
- package/dist/types/core/agent/runtime/toolCalls/factory.d.ts +3 -0
- package/dist/types/core/agent/runtime/toolCalls/factory.d.ts.map +1 -1
- package/dist/types/core/agent/runtime/turn/owner.d.ts.map +1 -1
- package/dist/types/core/agent/sourceEvidence/capture.d.ts +2 -1
- package/dist/types/core/agent/sourceEvidence/capture.d.ts.map +1 -1
- package/dist/types/core/agent/sourceEvidence/publications.d.ts +3 -1
- package/dist/types/core/agent/sourceEvidence/publications.d.ts.map +1 -1
- package/dist/types/core/agent/stages/argumentAsk.d.ts.map +1 -1
- package/dist/types/core/agent/stages/argumentAskDeps.d.ts +7 -1
- package/dist/types/core/agent/stages/argumentAskDeps.d.ts.map +1 -1
- package/dist/types/core/agent/stages/callLLM/types.d.ts +4 -3
- package/dist/types/core/agent/stages/callLLM/types.d.ts.map +1 -1
- package/dist/types/core/agent/stages/seed.d.ts +3 -1
- package/dist/types/core/agent/stages/seed.d.ts.map +1 -1
- package/dist/types/core/agent/stages/toolCalls/batch/assistantTurn.d.ts +7 -0
- package/dist/types/core/agent/stages/toolCalls/batch/assistantTurn.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/batch/dispatchContext.d.ts.map +1 -1
- package/dist/types/core/agent/stages/toolCalls/batch/execute.d.ts.map +1 -1
- package/dist/types/core/agent/stages/toolCalls/batch/inputResolutions.d.ts +1 -1
- package/dist/types/core/agent/stages/toolCalls/batch/inputResolutions.d.ts.map +1 -1
- package/dist/types/core/agent/stages/toolCalls/batch/refusal.d.ts +3 -0
- package/dist/types/core/agent/stages/toolCalls/batch/refusal.d.ts.map +1 -1
- package/dist/types/core/agent/stages/toolCalls/compose.d.ts +1 -1
- package/dist/types/core/agent/stages/toolCalls/contracts/callCells.d.ts +2 -2
- package/dist/types/core/agent/stages/toolCalls/contracts/callCells.d.ts.map +1 -1
- package/dist/types/core/agent/stages/toolCalls/contracts/callFacts.d.ts +2 -2
- package/dist/types/core/agent/stages/toolCalls/contracts/callFacts.d.ts.map +1 -1
- package/dist/types/core/agent/stages/toolCalls/contracts/evidence.d.ts +8 -0
- package/dist/types/core/agent/stages/toolCalls/contracts/evidence.d.ts.map +1 -1
- package/dist/types/core/agent/stages/toolCalls/contracts/operations/context.d.ts +1 -1
- package/dist/types/core/agent/stages/toolCalls/contracts/operations/context.d.ts.map +1 -1
- package/dist/types/core/agent/stages/toolCalls/execution/dispatchCall.d.ts.map +1 -1
- package/dist/types/core/agent/stages/toolCalls/execution/finalizeCallResult.d.ts +26 -0
- package/dist/types/core/agent/stages/toolCalls/execution/finalizeCallResult.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/execution/initialInvocation.d.ts.map +1 -1
- package/dist/types/core/agent/stages/toolCalls/execution/resumedInvocation.d.ts +1 -1
- package/dist/types/core/agent/stages/toolCalls/execution/resumedInvocation.d.ts.map +1 -1
- package/dist/types/core/agent/stages/toolCalls/resume/ask.d.ts.map +1 -1
- package/dist/types/core/agent/stages/toolCalls/resume/checkIn.d.ts.map +1 -1
- package/dist/types/core/agent/stages/toolCalls/resume/credential.d.ts.map +1 -1
- package/dist/types/core/agent/types/state/honesty.d.ts +4 -0
- package/dist/types/core/agent/types/state/honesty.d.ts.map +1 -1
- package/dist/types/core/agent/types.d.ts +1 -3
- package/dist/types/core/agent/types.d.ts.map +1 -1
- package/dist/types/core/runCheckpoint.d.ts +3 -208
- package/dist/types/core/runCheckpoint.d.ts.map +1 -1
- package/dist/types/core/runCheckpointTypes.d.ts +220 -0
- package/dist/types/core/runCheckpointTypes.d.ts.map +1 -0
- package/dist/types/core/slots/discoverTools.d.ts.map +1 -1
- package/dist/types/events/payloads/findings.d.ts +2 -0
- package/dist/types/events/payloads/findings.d.ts.map +1 -1
- package/dist/types/events/payloads/toolRowsets.d.ts +15 -0
- package/dist/types/events/payloads/toolRowsets.d.ts.map +1 -0
- package/dist/types/events/payloads.d.ts +1 -0
- package/dist/types/events/payloads.d.ts.map +1 -1
- package/dist/types/events/registry/names.d.ts +1 -0
- package/dist/types/events/registry/names.d.ts.map +1 -1
- package/dist/types/events/registry/toolEvents.d.ts +33 -0
- package/dist/types/events/registry/toolEvents.d.ts.map +1 -0
- package/dist/types/events/registry.d.ts +3 -28
- package/dist/types/events/registry.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/integrity/column-types/check.d.ts +2 -0
- package/dist/types/integrity/column-types/check.d.ts.map +1 -1
- package/dist/types/integrity/finding/types.d.ts +2 -0
- package/dist/types/integrity/finding/types.d.ts.map +1 -1
- package/dist/types/mcp/toolExtras.d.ts +8 -4
- package/dist/types/mcp/toolExtras.d.ts.map +1 -1
- package/dist/types/recorders/core/typedEmit.d.ts +6 -1
- package/dist/types/recorders/core/typedEmit.d.ts.map +1 -1
- package/dist/types/recorders/observability/commentary/commentaryTemplates/dispositions.d.ts.map +1 -1
- package/dist/types/redaction/knownStrings/fields-0.d.ts +1 -1
- package/dist/types/redaction/knownStrings/fields-1.d.ts +2 -2
- package/dist/types/redaction/knownStrings/fields-2.d.ts +3 -0
- package/dist/types/redaction/knownStrings/fields-2.d.ts.map +1 -1
- package/dist/types/redaction/knownStrings/words-0.d.ts +5 -5
- package/dist/types/redaction/knownStrings/words-1.d.ts +17 -17
- package/dist/types/redaction/knownStrings/words-2.d.ts +20 -0
- package/dist/types/redaction/knownStrings/words-2.d.ts.map +1 -1
- package/dist/types/redaction/runRedaction.d.ts +1 -1
- package/dist/types/redaction/runRedaction.d.ts.map +1 -1
- package/dist/types/tools/resultRowsets.d.ts +23 -0
- package/dist/types/tools/resultRowsets.d.ts.map +1 -0
- package/dist/types/tools/tools.d.ts +7 -9
- package/dist/types/tools/tools.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -24,6 +24,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.buildResumeAsk = void 0;
|
|
27
|
+
const resumed_js_1 = require("../../../resultRowsets/resumed.js");
|
|
27
28
|
const consentRequest_js_1 = require("../../../../consentRequest.js");
|
|
28
29
|
const bindings_js_1 = require("../access/bindings.js");
|
|
29
30
|
const checkin_js_1 = require("../../../../checkin.js");
|
|
@@ -71,182 +72,129 @@ function buildResumeAsk(deps, links) {
|
|
|
71
72
|
let negativeResultId;
|
|
72
73
|
/** What the approved call's `execute` saw — its script row reads it. */
|
|
73
74
|
const scriptSeen = {};
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
else {
|
|
92
|
-
(0, ledger_js_1.recordDecisions)(scope, [
|
|
93
|
-
{
|
|
94
|
-
middleware: askedBy,
|
|
95
|
-
moment: 'before-tool',
|
|
96
|
-
at: 'tool',
|
|
97
|
-
toolName,
|
|
98
|
-
toolCallId,
|
|
99
|
-
iteration,
|
|
100
|
-
outcome: 'allow',
|
|
101
|
-
changed: false,
|
|
102
|
-
why: `approved by ${decision.by}${decision.note ? `: ${decision.note}` : ''}`,
|
|
103
|
-
...(answeredVia !== undefined && { componentId: answeredVia }),
|
|
104
|
-
},
|
|
105
|
-
]);
|
|
106
|
-
// Continue the chain from the link AFTER the one that asked. Its
|
|
107
|
-
// decision is already on the checkpoint; re-running it would ask the
|
|
108
|
-
// same question twice and file a duplicate row.
|
|
109
|
-
//
|
|
110
|
-
// `askPolicy: 'refuse'` because footprintjs's `PausableHandler.resume`
|
|
111
|
-
// returns void — a resumed dispatch has no second checkpoint to give.
|
|
112
|
-
// A link further down the chain that also wants a person gets a named,
|
|
113
|
-
// model-visible refusal and the tool does NOT run. That is the same
|
|
114
|
-
// rule already applied to a tool that tries to pause during an
|
|
115
|
-
// approved check-in resume: at most one human question per resume.
|
|
116
|
-
// Resolved BEFORE the chain runs, not after, because the links that
|
|
117
|
-
// continue here must see the same `toolSource` the links before the
|
|
118
|
-
// ask saw. A chain that changed its mind about where a tool came from
|
|
119
|
-
// halfway through one dispatch would be worse than not knowing.
|
|
120
|
-
//
|
|
121
|
-
// Resolved against the party the CHECKPOINT carries (9.92.0): a
|
|
122
|
-
// fresh instance has an empty served record and Compose has not
|
|
123
|
-
// re-run, so without it the build-time map's first holder answered.
|
|
124
|
-
const resolved = links.resolveTool(toolName, scope.pausedToolParty);
|
|
125
|
-
const tool = resolved.tool;
|
|
126
|
-
// ── THE INPUTS LAYER'S REFUSALS, re-applied at this door (honesty
|
|
127
|
-
// layer 2). The batch loop decides them BEFORE the chain, so a call
|
|
128
|
-
// it refuses never reaches an ask. This door still asks both
|
|
129
|
-
// questions itself: a checkpoint written before they moved ahead of
|
|
130
|
-
// the chain, or resumed on an agent built without the layer, must
|
|
131
|
-
// not run a ruled tool unruled because a person approved the ask.
|
|
132
|
-
// Refused here, the rest of the chain is not walked and the tool
|
|
133
|
-
// does not run — the argument-refusal shape the loop lands.
|
|
134
|
-
const inputs = deps.inputsLayer === true ? await Promise.resolve().then(() => __importStar(require('../../../arguments/dispatch.js'))) : undefined;
|
|
135
|
-
const unmounted = links.unmountedRules(tool, toolName);
|
|
136
|
-
const rulesRefusal = inputs?.resolutionsFor(scope, iteration).get(toolCallId)?.refused ??
|
|
137
|
-
(unmounted === undefined ? undefined : await unmounted);
|
|
138
|
-
if (rulesRefusal !== undefined) {
|
|
139
|
-
error = true;
|
|
140
|
-
result = rulesRefusal;
|
|
75
|
+
try {
|
|
76
|
+
if (!decision.approved) {
|
|
77
|
+
result = (0, checkin_js_1.declinedResult)(decision.note);
|
|
78
|
+
(0, ledger_js_1.recordDecisions)(scope, [
|
|
79
|
+
{
|
|
80
|
+
middleware: askedBy,
|
|
81
|
+
moment: 'before-tool',
|
|
82
|
+
at: 'tool',
|
|
83
|
+
toolName,
|
|
84
|
+
toolCallId,
|
|
85
|
+
iteration,
|
|
86
|
+
outcome: 'deny',
|
|
87
|
+
changed: false,
|
|
88
|
+
why: `declined by ${decision.by}${decision.note ? `: ${decision.note}` : ''}`,
|
|
89
|
+
...(answeredVia !== undefined && { componentId: answeredVia }),
|
|
90
|
+
},
|
|
91
|
+
]);
|
|
141
92
|
}
|
|
142
93
|
else {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
history: [...scope.history],
|
|
150
|
-
startIndex: askIndex + 1,
|
|
151
|
-
askPolicy: 'refuse',
|
|
152
|
-
});
|
|
153
|
-
(0, ledger_js_1.recordDecisions)(scope, rest.decisions);
|
|
154
|
-
// The approval covers the arguments the person was shown. The ones
|
|
155
|
-
// the rest of the chain hands back must re-derive the paused
|
|
156
|
-
// request's id (`runsAsAsked`) — held to the request itself, never
|
|
157
|
-
// to the copy the links were handed. Any other arguments are not
|
|
158
|
-
// approved: the call does not run, and the record and the model
|
|
159
|
-
// are told why ('call-changed').
|
|
160
|
-
const read = (key) => scope.$getValue(key);
|
|
161
|
-
const rewrittenBy = rest.kind === 'deny' ||
|
|
162
|
-
(0, consentRequest_js_1.runsAsAsked)(read('pausedRequest'), (0, consentRequest_js_1.gatedCallOf)(read, 'ask'), rest.args)
|
|
163
|
-
? undefined
|
|
164
|
-
: (0, bindings_js_1.changedAfterApproval)(rest.decisions);
|
|
165
|
-
// The arguments the call runs with: a fresh copy of the approved
|
|
166
|
-
// ones (equal, by the check above, to what the chain handed back),
|
|
167
|
-
// so nothing a link still holds can reach the tool.
|
|
168
|
-
const runArgs = (0, bindings_js_1.boundArgsOf)(scope, 'pausedAskArgs');
|
|
169
|
-
// Would this tool's OWN consent gate have fired for this call? Asked by
|
|
170
|
-
// EVALUATING the demand, not by noticing that one was declared (8.13.0).
|
|
171
|
-
// Before that, any tool carrying a `checkIn` field was refused here even
|
|
172
|
-
// when its predicate said no — a selective gate (`amount > 1000`) blocked
|
|
173
|
-
// the £5 refunds it was written to let through, and the refusal claimed a
|
|
174
|
-
// consent gate would have run when it provably would not have.
|
|
175
|
-
//
|
|
176
|
-
// Judged on `runArgs` (what the tool would actually run with) and on
|
|
177
|
-
// the same history shape the loop's gate uses, so the answer cannot
|
|
178
|
-
// depend on which door the call arrived through. The predicate is
|
|
179
|
-
// handed its own frozen copy of them (`shouldCheckIn`), never
|
|
180
|
-
// `runArgs` itself: a predicate that wrote into its argument used
|
|
181
|
-
// to change the call the person had approved.
|
|
182
|
-
const demandTrips = rest.kind !== 'deny' &&
|
|
183
|
-
rewrittenBy === undefined &&
|
|
184
|
-
tool?.checkIn !== undefined &&
|
|
185
|
-
(0, checkin_js_1.shouldCheckIn)(tool.checkIn, runArgs, {
|
|
186
|
-
iteration,
|
|
94
|
+
(0, ledger_js_1.recordDecisions)(scope, [
|
|
95
|
+
{
|
|
96
|
+
middleware: askedBy,
|
|
97
|
+
moment: 'before-tool',
|
|
98
|
+
at: 'tool',
|
|
99
|
+
toolName,
|
|
187
100
|
toolCallId,
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
101
|
+
iteration,
|
|
102
|
+
outcome: 'allow',
|
|
103
|
+
changed: false,
|
|
104
|
+
why: `approved by ${decision.by}${decision.note ? `: ${decision.note}` : ''}`,
|
|
105
|
+
...(answeredVia !== undefined && { componentId: answeredVia }),
|
|
106
|
+
},
|
|
107
|
+
]);
|
|
108
|
+
// Continue the chain from the link AFTER the one that asked. Its
|
|
109
|
+
// decision is already on the checkpoint; re-running it would ask the
|
|
110
|
+
// same question twice and file a duplicate row.
|
|
111
|
+
//
|
|
112
|
+
// `askPolicy: 'refuse'` because footprintjs's `PausableHandler.resume`
|
|
113
|
+
// returns void — a resumed dispatch has no second checkpoint to give.
|
|
114
|
+
// A link further down the chain that also wants a person gets a named,
|
|
115
|
+
// model-visible refusal and the tool does NOT run. That is the same
|
|
116
|
+
// rule already applied to a tool that tries to pause during an
|
|
117
|
+
// approved check-in resume: at most one human question per resume.
|
|
118
|
+
// Resolved BEFORE the chain runs, not after, because the links that
|
|
119
|
+
// continue here must see the same `toolSource` the links before the
|
|
120
|
+
// ask saw. A chain that changed its mind about where a tool came from
|
|
121
|
+
// halfway through one dispatch would be worse than not knowing.
|
|
122
|
+
//
|
|
123
|
+
// Resolved against the party the CHECKPOINT carries (9.92.0): a
|
|
124
|
+
// fresh instance has an empty served record and Compose has not
|
|
125
|
+
// re-run, so without it the build-time map's first holder answered.
|
|
126
|
+
const resolved = links.resolveTool(toolName, scope.pausedToolParty);
|
|
127
|
+
const tool = resolved.tool;
|
|
128
|
+
// ── THE INPUTS LAYER'S REFUSALS, re-applied at this door (honesty
|
|
129
|
+
// layer 2). The batch loop decides them BEFORE the chain, so a call
|
|
130
|
+
// it refuses never reaches an ask. This door still asks both
|
|
131
|
+
// questions itself: a checkpoint written before they moved ahead of
|
|
132
|
+
// the chain, or resumed on an agent built without the layer, must
|
|
133
|
+
// not run a ruled tool unruled because a person approved the ask.
|
|
134
|
+
// Refused here, the rest of the chain is not walked and the tool
|
|
135
|
+
// does not run — the argument-refusal shape the loop lands.
|
|
136
|
+
const inputs = deps.inputsLayer === true ? await Promise.resolve().then(() => __importStar(require('../../../arguments/dispatch.js'))) : undefined;
|
|
137
|
+
const unmounted = links.unmountedRules(tool, toolName);
|
|
138
|
+
const rulesRefusal = inputs?.resolutionsFor(scope, iteration).get(toolCallId)?.refused ??
|
|
139
|
+
(unmounted === undefined ? undefined : await unmounted);
|
|
140
|
+
if (rulesRefusal !== undefined) {
|
|
225
141
|
error = true;
|
|
226
|
-
|
|
227
|
-
// turn (9.86.1): "cannot be retried this turn … Answer without it,
|
|
228
|
-
// or finish" was a prediction plus a standing order on a result
|
|
229
|
-
// that is re-read on every later call.
|
|
230
|
-
result =
|
|
231
|
-
`tool '${toolName}' was not executed on that call, and the resumed dispatch had ` +
|
|
232
|
-
`no second checkpoint to retry it on: it declares its own checkIn consent gate, ` +
|
|
233
|
-
`and that gate tripped for those arguments. (To ` +
|
|
234
|
-
`the agent's author: the middleware '${askedBy}' and the tool's checkIn ask ` +
|
|
235
|
-
`different questions — one is the rule's, one is the tool's with the evidence ` +
|
|
236
|
-
`pack attached — so approving one is not answering the other. Keep one gate for ` +
|
|
237
|
-
`this tool: drop the tool's \`checkIn\`, or let \`onToolCall\` return allow() for ` +
|
|
238
|
-
`tools that declare their own.)`;
|
|
142
|
+
result = rulesRefusal;
|
|
239
143
|
}
|
|
240
144
|
else {
|
|
241
|
-
const
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
145
|
+
const rest = await (0, runChain_js_1.runToolChain)(deps.toolMiddleware ?? [], {
|
|
146
|
+
toolName,
|
|
147
|
+
...(tool?.source !== undefined && { toolSource: tool.source }),
|
|
148
|
+
toolCallId,
|
|
149
|
+
iteration,
|
|
150
|
+
args,
|
|
151
|
+
history: [...scope.history],
|
|
152
|
+
startIndex: askIndex + 1,
|
|
153
|
+
askPolicy: 'refuse',
|
|
154
|
+
});
|
|
155
|
+
(0, ledger_js_1.recordDecisions)(scope, rest.decisions);
|
|
156
|
+
// The approval covers the arguments the person was shown. The ones
|
|
157
|
+
// the rest of the chain hands back must re-derive the paused
|
|
158
|
+
// request's id (`runsAsAsked`) — held to the request itself, never
|
|
159
|
+
// to the copy the links were handed. Any other arguments are not
|
|
160
|
+
// approved: the call does not run, and the record and the model
|
|
161
|
+
// are told why ('call-changed').
|
|
162
|
+
const read = (key) => scope.$getValue(key);
|
|
163
|
+
const rewrittenBy = rest.kind === 'deny' ||
|
|
164
|
+
(0, consentRequest_js_1.runsAsAsked)(read('pausedRequest'), (0, consentRequest_js_1.gatedCallOf)(read, 'ask'), rest.args)
|
|
165
|
+
? undefined
|
|
166
|
+
: (0, bindings_js_1.changedAfterApproval)(rest.decisions);
|
|
167
|
+
// The arguments the call runs with: a fresh copy of the approved
|
|
168
|
+
// ones (equal, by the check above, to what the chain handed back),
|
|
169
|
+
// so nothing a link still holds can reach the tool.
|
|
170
|
+
const runArgs = (0, bindings_js_1.boundArgsOf)(scope, 'pausedAskArgs');
|
|
171
|
+
// Would this tool's OWN consent gate have fired for this call? Asked by
|
|
172
|
+
// EVALUATING the demand, not by noticing that one was declared (8.13.0).
|
|
173
|
+
// Before that, any tool carrying a `checkIn` field was refused here even
|
|
174
|
+
// when its predicate said no — a selective gate (`amount > 1000`) blocked
|
|
175
|
+
// the £5 refunds it was written to let through, and the refusal claimed a
|
|
176
|
+
// consent gate would have run when it provably would not have.
|
|
177
|
+
//
|
|
178
|
+
// Judged on `runArgs` (what the tool would actually run with) and on
|
|
179
|
+
// the same history shape the loop's gate uses, so the answer cannot
|
|
180
|
+
// depend on which door the call arrived through. The predicate is
|
|
181
|
+
// handed its own frozen copy of them (`shouldCheckIn`), never
|
|
182
|
+
// `runArgs` itself: a predicate that wrote into its argument used
|
|
183
|
+
// to change the call the person had approved.
|
|
184
|
+
const demandTrips = rest.kind !== 'deny' &&
|
|
185
|
+
rewrittenBy === undefined &&
|
|
186
|
+
tool?.checkIn !== undefined &&
|
|
187
|
+
(0, checkin_js_1.shouldCheckIn)(tool.checkIn, runArgs, {
|
|
188
|
+
iteration,
|
|
189
|
+
toolCallId,
|
|
190
|
+
history: links.historyForCheckIn(scope, scope.history),
|
|
191
|
+
});
|
|
192
|
+
if (rest.kind === 'deny') {
|
|
193
|
+
result = rest.reason;
|
|
194
|
+
}
|
|
195
|
+
else if (rewrittenBy !== undefined) {
|
|
196
|
+
error = true;
|
|
197
|
+
result = (0, bindings_js_1.rewrittenAfterApproval)(toolName, rewrittenBy);
|
|
250
198
|
(0, ledger_js_1.recordDecisions)(scope, [
|
|
251
199
|
{
|
|
252
200
|
middleware: askedBy,
|
|
@@ -257,181 +205,254 @@ function buildResumeAsk(deps, links) {
|
|
|
257
205
|
iteration,
|
|
258
206
|
outcome: 'deny',
|
|
259
207
|
changed: false,
|
|
260
|
-
why:
|
|
261
|
-
|
|
208
|
+
why: `the approval covers the arguments the person was shown; ${rewrittenBy}, ` +
|
|
209
|
+
`so the call was not run (call-changed)`,
|
|
262
210
|
},
|
|
263
211
|
]);
|
|
264
212
|
}
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
213
|
+
else if (demandTrips) {
|
|
214
|
+
// The one-question rule, from the other direction: this tool's own
|
|
215
|
+
// consent gate really does demand a person for THESE arguments, and
|
|
216
|
+
// there is no checkpoint left to ask with.
|
|
217
|
+
//
|
|
218
|
+
// The two gates ask DIFFERENT questions, which is why an approval of
|
|
219
|
+
// one is not an answer to the other. A middleware `ask` carries the
|
|
220
|
+
// rule's own free-text question; a check-in carries the TOOL's demand
|
|
221
|
+
// with the evidence pack attached — `willDo`, what the run read, what
|
|
222
|
+
// drove the choice, the trail — none of which the person who approved
|
|
223
|
+
// the ask ever saw. Letting the approval satisfy both would file a
|
|
224
|
+
// `checkin.decision` for a question nobody was asked. Governance never
|
|
225
|
+
// silently invents a decision, for the same reason it never silently
|
|
226
|
+
// drops one.
|
|
227
|
+
error = true;
|
|
228
|
+
// A past fact about the resumed call, not a forecast about the
|
|
229
|
+
// turn (9.86.1): "cannot be retried this turn … Answer without it,
|
|
230
|
+
// or finish" was a prediction plus a standing order on a result
|
|
231
|
+
// that is re-read on every later call.
|
|
232
|
+
result =
|
|
233
|
+
`tool '${toolName}' was not executed on that call, and the resumed dispatch had ` +
|
|
234
|
+
`no second checkpoint to retry it on: it declares its own checkIn consent gate, ` +
|
|
235
|
+
`and that gate tripped for those arguments. (To ` +
|
|
236
|
+
`the agent's author: the middleware '${askedBy}' and the tool's checkIn ask ` +
|
|
237
|
+
`different questions — one is the rule's, one is the tool's with the evidence ` +
|
|
238
|
+
`pack attached — so approving one is not answering the other. Keep one gate for ` +
|
|
239
|
+
`this tool: drop the tool's \`checkIn\`, or let \`onToolCall\` return allow() for ` +
|
|
240
|
+
`tools that declare their own.)`;
|
|
279
241
|
}
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
242
|
+
else {
|
|
243
|
+
const env = scope.$getEnv();
|
|
244
|
+
const dispatched = await links.resolveCredentialAndExecute(scope, resolved, toolName, runArgs, toolCallId, iteration, env, 'ask', scriptSeen);
|
|
245
|
+
negativeResultId = dispatched.negativeResultId;
|
|
246
|
+
result = dispatched.result;
|
|
247
|
+
error = dispatched.error;
|
|
248
|
+
toolRan = dispatched.executed === true;
|
|
249
|
+
// Held to the request at the last moment and found changed: the
|
|
250
|
+
// record says so, as for a rewrite the chain handed back.
|
|
251
|
+
if (dispatched.callChanged === true) {
|
|
252
|
+
(0, ledger_js_1.recordDecisions)(scope, [
|
|
253
|
+
{
|
|
254
|
+
middleware: askedBy,
|
|
255
|
+
moment: 'before-tool',
|
|
256
|
+
at: 'tool',
|
|
257
|
+
toolName,
|
|
258
|
+
toolCallId,
|
|
259
|
+
iteration,
|
|
260
|
+
outcome: 'deny',
|
|
261
|
+
changed: false,
|
|
262
|
+
why: 'the approval covers the arguments the person was shown; they changed ' +
|
|
263
|
+
'before the call could run, so the call was not run (call-changed)',
|
|
264
|
+
},
|
|
265
|
+
]);
|
|
266
|
+
}
|
|
267
|
+
// A ceiling-refused call RAN but must not advance a step (9.20.0);
|
|
268
|
+
// its envelope — status 'invalid' plus any surviving declared
|
|
269
|
+
// effects — is still picked up and judged below.
|
|
270
|
+
stepToolRan =
|
|
271
|
+
dispatched.executed === true && error !== true && dispatched.ceilingRefused !== true;
|
|
272
|
+
if (dispatched.executed === true && error !== true) {
|
|
273
|
+
resumeEnvelope = dispatched.envelope;
|
|
274
|
+
}
|
|
275
|
+
// skip_step behind a middleware ask, approved (9.18.0): the
|
|
276
|
+
// placeholder just landed — replace it with the authoritative
|
|
277
|
+
// sentence BEFORE the chain's last word, the execute loop's
|
|
278
|
+
// composition kept.
|
|
279
|
+
if (links.frameworkSkipStepAnswered(toolName, tool) && stepToolRan) {
|
|
280
|
+
result = links.applySkipStep(scope, { args: runArgs, toolCallId, iteration });
|
|
281
|
+
}
|
|
282
|
+
// present behind a middleware ask, approved (9.22.0): same
|
|
283
|
+
// overwrite the batch loop applies — the snapshot (or refusal)
|
|
284
|
+
// replaces the placeholder before the chain's last word. A miss
|
|
285
|
+
// is an errored call here too.
|
|
286
|
+
if (deps.artifactStore && toolName === present_js_1.PRESENT_TOOL_NAME && stepToolRan) {
|
|
287
|
+
const presented = await links.applyPresent(scope, {
|
|
288
|
+
args: runArgs,
|
|
289
|
+
toolCallId,
|
|
290
|
+
iteration,
|
|
291
|
+
});
|
|
292
|
+
result = presented.text;
|
|
293
|
+
if (!presented.ok) {
|
|
294
|
+
error = true;
|
|
295
|
+
stepToolRan = false;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
// The tool ran on this side of the pause, so the chain gets its
|
|
299
|
+
// last word here too — a rule about results cannot be skipped by
|
|
300
|
+
// routing a call through a human.
|
|
301
|
+
if (dispatched.executed === true) {
|
|
302
|
+
modelResult = await links.afterMoment(scope, {
|
|
303
|
+
...(tool && { tool }),
|
|
304
|
+
toolName,
|
|
305
|
+
toolCallId,
|
|
306
|
+
iteration,
|
|
307
|
+
args: runArgs,
|
|
308
|
+
result,
|
|
309
|
+
negativeResultId,
|
|
310
|
+
...(scriptSeen.resultFinalizer && {
|
|
311
|
+
onSourceWithheld: scriptSeen.resultFinalizer.withheld,
|
|
312
|
+
}),
|
|
313
|
+
...(error === true && { error: true }),
|
|
314
|
+
history: [...scope.history],
|
|
315
|
+
...(scope.runIdentity && { identity: scope.runIdentity }),
|
|
316
|
+
...(env.signal && { signal: env.signal }),
|
|
317
|
+
});
|
|
294
318
|
}
|
|
295
|
-
}
|
|
296
|
-
// The tool ran on this side of the pause, so the chain gets its
|
|
297
|
-
// last word here too — a rule about results cannot be skipped by
|
|
298
|
-
// routing a call through a human.
|
|
299
|
-
if (dispatched.executed === true) {
|
|
300
|
-
modelResult = await links.afterMoment(scope, {
|
|
301
|
-
...(tool && { tool }),
|
|
302
|
-
toolName,
|
|
303
|
-
toolCallId,
|
|
304
|
-
iteration,
|
|
305
|
-
args: runArgs,
|
|
306
|
-
result,
|
|
307
|
-
negativeResultId,
|
|
308
|
-
...(scriptSeen.sourceCapture && {
|
|
309
|
-
onSourceWithheld: scriptSeen.sourceCapture.withheld,
|
|
310
|
-
}),
|
|
311
|
-
...(error === true && { error: true }),
|
|
312
|
-
history: [...scope.history],
|
|
313
|
-
...(scope.runIdentity && { identity: scope.runIdentity }),
|
|
314
|
-
...(env.signal && { signal: env.signal }),
|
|
315
|
-
});
|
|
316
319
|
}
|
|
317
320
|
}
|
|
318
321
|
}
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
322
|
+
// `modelResult` is only set where the after-tool moment ran; everywhere
|
|
323
|
+
// else the two are the same value.
|
|
324
|
+
if (modelResult === undefined)
|
|
325
|
+
modelResult = result;
|
|
326
|
+
// Placement then the truncation net — the batch loop's precedence,
|
|
327
|
+
// kept on this door (a resumed result is as placeable as an inline
|
|
328
|
+
// one; `stepToolRan` is exactly "ran clean").
|
|
329
|
+
const askPlaced = await links.placeResults(scope, { toolName, toolCallId, iteration }, { result, modelResult }, stepToolRan);
|
|
330
|
+
let askCapped = links.capResults(toolName, askPlaced);
|
|
331
|
+
modelResult = askCapped.modelResult;
|
|
332
|
+
if (scriptSeen.resultFinalizer) {
|
|
333
|
+
const uncapped = modelResult === askPlaced.modelResult;
|
|
334
|
+
const finalized = await (0, resumed_js_1.finalizeResumedResult)(scope, scriptSeen.resultFinalizer, toolName, askCapped, {
|
|
335
|
+
eligible: stepToolRan && uncapped,
|
|
336
|
+
...(resumeEnvelope?.status !== undefined && { status: resumeEnvelope?.status }),
|
|
337
|
+
...(!uncapped && { unavailableReason: 'result-capped' }),
|
|
338
|
+
}, links.capResults, negativeResultId);
|
|
339
|
+
askCapped = finalized.values;
|
|
340
|
+
modelResult = askCapped.modelResult;
|
|
341
|
+
if (finalized.refused) {
|
|
342
|
+
result = askCapped.result;
|
|
343
|
+
stepToolRan = false;
|
|
344
|
+
resumeEnvelope = { content: result, effects: [], status: 'invalid', malformed: [] };
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
scriptSeen.resultFinalizer?.assertFinalized();
|
|
348
|
+
const sourceHalt = (0, permissions_js_1.sourceEvidenceHaltOf)(scope);
|
|
349
|
+
if (sourceHalt)
|
|
350
|
+
scope.$break(`policy-halt: ${sourceHalt.reason}`);
|
|
351
|
+
let askResultStr = typeof modelResult === 'string' ? modelResult : (0, validators_js_1.safeStringify)(modelResult);
|
|
352
|
+
const askToolChars = askResultStr.length;
|
|
353
|
+
if (deps.negativeClaimsArmed === true)
|
|
354
|
+
askResultStr = (0, capture_js_1.serveNegativeHandle)(scope, negativeResultId, askResultStr);
|
|
355
|
+
// Step boundary (9.18.0) — a result finalized HERE is as final as one
|
|
356
|
+
// from the batch loop; the answered call advances the pointer before
|
|
357
|
+
// the push, exactly as it would have inline.
|
|
358
|
+
if (deps.stepPlanFor && stepToolRan) {
|
|
359
|
+
askResultStr += links.applyStepReturn(scope, { toolName, toolCallId, iteration });
|
|
360
|
+
}
|
|
361
|
+
// Typed tool effects (9.19.0) — a resumed call's envelope is judged
|
|
362
|
+
// exactly as an inline one's (fresh single-call batch state).
|
|
363
|
+
if (resumeEnvelope !== undefined) {
|
|
364
|
+
const askTransition = { losers: [] };
|
|
365
|
+
askResultStr += links.applyToolEffects(scope, { toolName, toolCallId, iteration }, resumeEnvelope, askTransition);
|
|
366
|
+
links.emitTransitionConflict(scope, iteration, askTransition);
|
|
367
|
+
}
|
|
368
|
+
// The batch settlement (9.113.0): the answered call's result, then the
|
|
369
|
+
// siblings the pause left un-dispatched, each settled — never run.
|
|
370
|
+
const askSettlement = links.settleBatch([
|
|
371
|
+
...scope.history,
|
|
372
|
+
{
|
|
373
|
+
role: 'tool',
|
|
374
|
+
content: askResultStr,
|
|
375
|
+
...(deps.negativeClaimsArmed === true && { toolChars: askToolChars }),
|
|
376
|
+
toolCallId,
|
|
377
|
+
toolName,
|
|
378
|
+
...(deps.findings === true && !toolRan && { toolResultOrigin: 'not-entered' }),
|
|
379
|
+
},
|
|
380
|
+
], { toolName, toolCallId });
|
|
381
|
+
const askHistory = askSettlement.history;
|
|
382
|
+
scope.history = askHistory;
|
|
383
|
+
scope.lastToolResult = {
|
|
384
|
+
toolName,
|
|
385
|
+
result: askResultStr,
|
|
386
|
+
...(resumeEnvelope?.status !== undefined && { status: resumeEnvelope.status }),
|
|
387
|
+
};
|
|
388
|
+
(0, settle_js_1.appendBatchResult)(scope, {
|
|
389
|
+
toolName,
|
|
390
|
+
result: askResultStr,
|
|
391
|
+
toolCallId,
|
|
333
392
|
...(resumeEnvelope?.status !== undefined && { status: resumeEnvelope.status }),
|
|
334
393
|
});
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
394
|
+
await (0, judgeLanded_js_1.judgeLanded)(scope, deps.findingsJudge, toolRan, { toolName, result: askResultStr, toolCallId }, iteration, links.turnStampOf(scope));
|
|
395
|
+
links.fileResumedScript(scope, {
|
|
396
|
+
toolName,
|
|
397
|
+
toolCallId,
|
|
398
|
+
iteration,
|
|
399
|
+
carried: args,
|
|
400
|
+
entered: toolRan,
|
|
401
|
+
seen: scriptSeen,
|
|
402
|
+
});
|
|
403
|
+
links.emitToolEnd(scope, toolName, {
|
|
404
|
+
toolCallId,
|
|
405
|
+
result: askCapped.result,
|
|
406
|
+
durationMs: Date.now() - startMs,
|
|
407
|
+
...(error === true && { error: true }),
|
|
408
|
+
...(resumeEnvelope?.status !== undefined && { status: resumeEnvelope.status }),
|
|
409
|
+
...(askCapped.modelResult !== askCapped.result && {
|
|
410
|
+
modelResult: askCapped.modelResult,
|
|
411
|
+
}),
|
|
412
|
+
}, toolRan, undefined, negativeResultId, args);
|
|
413
|
+
links.bracketSettled(scope, askSettlement);
|
|
414
|
+
(0, typedEmit_js_1.typedEmit)(scope, 'agentfootprint.agent.iteration_end', {
|
|
415
|
+
turnIndex: 0,
|
|
416
|
+
iterIndex: iteration,
|
|
417
|
+
// The brackets THIS leg closed: the answered call's, plus one per
|
|
418
|
+
// settled sibling. The calls before the paused one closed theirs on
|
|
419
|
+
// the leg that paused, which ended in a checkpoint, not here.
|
|
420
|
+
toolCallCount: 1 + askSettlement.settled.length,
|
|
421
|
+
history: askHistory,
|
|
422
|
+
});
|
|
423
|
+
if (deps.inputsLayer === true)
|
|
424
|
+
scope.argumentAsk = undefined;
|
|
425
|
+
scope.iteration = iteration + 1;
|
|
426
|
+
await links.endCall(scope);
|
|
427
|
+
scope.pausedToolCallId = '';
|
|
428
|
+
scope.pausedToolName = '';
|
|
429
|
+
scope.pausedToolStartMs = 0;
|
|
430
|
+
scope.pausedAsk = false;
|
|
431
|
+
scope.pausedAskArgs = undefined;
|
|
432
|
+
scope.pausedAskIndex = undefined;
|
|
433
|
+
scope.pausedAskMiddleware = undefined;
|
|
434
|
+
scope.pausedAskChain = undefined;
|
|
435
|
+
// The request was answered — and spent — by this resume.
|
|
436
|
+
scope.pausedRequest = undefined;
|
|
437
|
+
// Cleared ONLY when it was set: a later component-less pause in this
|
|
438
|
+
// run must not inherit this ask's surface, and a run that never
|
|
439
|
+
// carried one must not gain the key (byte-identical).
|
|
440
|
+
if (answeredVia !== undefined)
|
|
441
|
+
scope.pausedComponentId = undefined;
|
|
442
|
+
// The served party the checkpoint carried is consumed with it (9.92.0);
|
|
443
|
+
// written back only when it was there, so an older checkpoint's resume
|
|
444
|
+
// commits exactly what it always did.
|
|
445
|
+
if (scope.pausedToolParty !== undefined)
|
|
446
|
+
scope.pausedToolParty = undefined;
|
|
447
|
+
return;
|
|
347
448
|
}
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
449
|
+
catch (error) {
|
|
450
|
+
scriptSeen.resultFinalizer?.withheld();
|
|
451
|
+
throw error;
|
|
452
|
+
}
|
|
453
|
+
finally {
|
|
454
|
+
scriptSeen.resultFinalizer?.close();
|
|
354
455
|
}
|
|
355
|
-
// The batch settlement (9.113.0): the answered call's result, then the
|
|
356
|
-
// siblings the pause left un-dispatched, each settled — never run.
|
|
357
|
-
const askSettlement = links.settleBatch([
|
|
358
|
-
...scope.history,
|
|
359
|
-
{
|
|
360
|
-
role: 'tool',
|
|
361
|
-
content: askResultStr,
|
|
362
|
-
...(deps.negativeClaimsArmed === true && { toolChars: askToolChars }),
|
|
363
|
-
toolCallId,
|
|
364
|
-
toolName,
|
|
365
|
-
...(deps.findings === true && !toolRan && { toolResultOrigin: 'not-entered' }),
|
|
366
|
-
},
|
|
367
|
-
], { toolName, toolCallId });
|
|
368
|
-
const askHistory = askSettlement.history;
|
|
369
|
-
scope.history = askHistory;
|
|
370
|
-
scope.lastToolResult = {
|
|
371
|
-
toolName,
|
|
372
|
-
result: askResultStr,
|
|
373
|
-
...(resumeEnvelope?.status !== undefined && { status: resumeEnvelope.status }),
|
|
374
|
-
};
|
|
375
|
-
(0, settle_js_1.appendBatchResult)(scope, {
|
|
376
|
-
toolName,
|
|
377
|
-
result: askResultStr,
|
|
378
|
-
toolCallId,
|
|
379
|
-
...(resumeEnvelope?.status !== undefined && { status: resumeEnvelope.status }),
|
|
380
|
-
});
|
|
381
|
-
await (0, judgeLanded_js_1.judgeLanded)(scope, deps.findingsJudge, toolRan, { toolName, result: askResultStr, toolCallId }, iteration, links.turnStampOf(scope));
|
|
382
|
-
links.fileResumedScript(scope, {
|
|
383
|
-
toolName,
|
|
384
|
-
toolCallId,
|
|
385
|
-
iteration,
|
|
386
|
-
carried: args,
|
|
387
|
-
entered: toolRan,
|
|
388
|
-
seen: scriptSeen,
|
|
389
|
-
});
|
|
390
|
-
links.emitToolEnd(scope, toolName, {
|
|
391
|
-
toolCallId,
|
|
392
|
-
result: askCapped.result,
|
|
393
|
-
durationMs: Date.now() - startMs,
|
|
394
|
-
...(error === true && { error: true }),
|
|
395
|
-
...(resumeEnvelope?.status !== undefined && { status: resumeEnvelope.status }),
|
|
396
|
-
...(askCapped.modelResult !== askCapped.result && {
|
|
397
|
-
modelResult: askCapped.modelResult,
|
|
398
|
-
}),
|
|
399
|
-
}, toolRan, undefined, negativeResultId, args);
|
|
400
|
-
links.bracketSettled(scope, askSettlement);
|
|
401
|
-
(0, typedEmit_js_1.typedEmit)(scope, 'agentfootprint.agent.iteration_end', {
|
|
402
|
-
turnIndex: 0,
|
|
403
|
-
iterIndex: iteration,
|
|
404
|
-
// The brackets THIS leg closed: the answered call's, plus one per
|
|
405
|
-
// settled sibling. The calls before the paused one closed theirs on
|
|
406
|
-
// the leg that paused, which ended in a checkpoint, not here.
|
|
407
|
-
toolCallCount: 1 + askSettlement.settled.length,
|
|
408
|
-
history: askHistory,
|
|
409
|
-
});
|
|
410
|
-
if (deps.inputsLayer === true)
|
|
411
|
-
scope.argumentAsk = undefined;
|
|
412
|
-
scope.iteration = iteration + 1;
|
|
413
|
-
await links.endCall(scope);
|
|
414
|
-
scope.pausedToolCallId = '';
|
|
415
|
-
scope.pausedToolName = '';
|
|
416
|
-
scope.pausedToolStartMs = 0;
|
|
417
|
-
scope.pausedAsk = false;
|
|
418
|
-
scope.pausedAskArgs = undefined;
|
|
419
|
-
scope.pausedAskIndex = undefined;
|
|
420
|
-
scope.pausedAskMiddleware = undefined;
|
|
421
|
-
scope.pausedAskChain = undefined;
|
|
422
|
-
// The request was answered — and spent — by this resume.
|
|
423
|
-
scope.pausedRequest = undefined;
|
|
424
|
-
// Cleared ONLY when it was set: a later component-less pause in this
|
|
425
|
-
// run must not inherit this ask's surface, and a run that never
|
|
426
|
-
// carried one must not gain the key (byte-identical).
|
|
427
|
-
if (answeredVia !== undefined)
|
|
428
|
-
scope.pausedComponentId = undefined;
|
|
429
|
-
// The served party the checkpoint carried is consumed with it (9.92.0);
|
|
430
|
-
// written back only when it was there, so an older checkpoint's resume
|
|
431
|
-
// commits exactly what it always did.
|
|
432
|
-
if (scope.pausedToolParty !== undefined)
|
|
433
|
-
scope.pausedToolParty = undefined;
|
|
434
|
-
return;
|
|
435
456
|
};
|
|
436
457
|
return { resumeAsk };
|
|
437
458
|
}
|