agentfootprint 14.7.2 → 14.8.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 +1 -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/artifacts/sourceEvidence/datasets.js.map +1 -1
- 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/runtime/chart/owner.js +5 -1
- package/dist/core/agent/runtime/chart/owner.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/slots/buildSlots.js +16 -1
- package/dist/core/agent/runtime/slots/buildSlots.js.map +1 -1
- package/dist/core/agent/runtime/toolCalls/factory.js +9 -2
- package/dist/core/agent/runtime/toolCalls/factory.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 +1 -0
- package/dist/core/agent/stages/argumentAsk.js.map +1 -1
- package/dist/core/agent/stages/argumentAskDeps.js +3 -0
- package/dist/core/agent/stages/argumentAskDeps.js.map +1 -0
- package/dist/core/agent/stages/callLLM.js +7 -8
- package/dist/core/agent/stages/callLLM.js.map +1 -1
- package/dist/core/agent/stages/toolCalls/batch/execute.js +33 -0
- package/dist/core/agent/stages/toolCalls/batch/execute.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/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/artifacts/sourceEvidence/datasets.d.ts +1 -1
- package/dist/esm/artifacts/sourceEvidence/datasets.js.map +1 -1
- 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/runtime/chart/owner.js +5 -1
- package/dist/esm/core/agent/runtime/chart/owner.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/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 +9 -2
- package/dist/esm/core/agent/runtime/toolCalls/factory.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.d.ts +3 -37
- package/dist/esm/core/agent/stages/argumentAsk.js +1 -0
- package/dist/esm/core/agent/stages/argumentAsk.js.map +1 -1
- package/dist/esm/core/agent/stages/argumentAskDeps.d.ts +39 -0
- package/dist/esm/core/agent/stages/argumentAskDeps.js +2 -0
- package/dist/esm/core/agent/stages/argumentAskDeps.js.map +1 -0
- 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/toolCalls/batch/execute.js +33 -0
- package/dist/esm/core/agent/stages/toolCalls/batch/execute.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 +7 -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/slots/discoverTools.js +5 -0
- package/dist/esm/core/slots/discoverTools.js.map +1 -1
- 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/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-1.d.ts +1 -1
- package/dist/esm/redaction/knownStrings/fields-1.js +1 -1
- package/dist/esm/redaction/knownStrings/fields-1.js.map +1 -1
- package/dist/esm/redaction/knownStrings/fields-2.d.ts +1 -0
- package/dist/esm/redaction/knownStrings/fields-2.js +1 -0
- package/dist/esm/redaction/knownStrings/fields-2.js.map +1 -1
- package/dist/esm/redaction/knownStrings/words-0.d.ts +4 -4
- package/dist/esm/redaction/knownStrings/words-0.js +4 -4
- package/dist/esm/redaction/knownStrings/words-0.js.map +1 -1
- package/dist/esm/redaction/knownStrings/words-1.d.ts +15 -15
- package/dist/esm/redaction/knownStrings/words-1.js +15 -15
- package/dist/esm/redaction/knownStrings/words-1.js.map +1 -1
- package/dist/esm/redaction/knownStrings/words-2.d.ts +18 -0
- package/dist/esm/redaction/knownStrings/words-2.js +18 -0
- package/dist/esm/redaction/knownStrings/words-2.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/observability/commentary/commentaryTemplates/dispositions.js +1 -0
- package/dist/recorders/observability/commentary/commentaryTemplates/dispositions.js.map +1 -1
- package/dist/redaction/knownStrings/fields-1.js +1 -1
- package/dist/redaction/knownStrings/fields-1.js.map +1 -1
- package/dist/redaction/knownStrings/fields-2.js +1 -0
- package/dist/redaction/knownStrings/fields-2.js.map +1 -1
- package/dist/redaction/knownStrings/words-0.js +4 -4
- package/dist/redaction/knownStrings/words-0.js.map +1 -1
- package/dist/redaction/knownStrings/words-1.js +15 -15
- package/dist/redaction/knownStrings/words-1.js.map +1 -1
- package/dist/redaction/knownStrings/words-2.js +18 -0
- package/dist/redaction/knownStrings/words-2.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/artifacts/sourceEvidence/datasets.d.ts +1 -1
- package/dist/types/artifacts/sourceEvidence/datasets.d.ts.map +1 -1
- 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/runtime/chart/owner.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/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/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 +3 -37
- package/dist/types/core/agent/stages/argumentAsk.d.ts.map +1 -1
- package/dist/types/core/agent/stages/argumentAskDeps.d.ts +40 -0
- package/dist/types/core/agent/stages/argumentAskDeps.d.ts.map +1 -0
- 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/toolCalls/batch/execute.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 +7 -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/slots/discoverTools.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/observability/commentary/commentaryTemplates/dispositions.d.ts.map +1 -1
- package/dist/types/redaction/knownStrings/fields-1.d.ts +1 -1
- package/dist/types/redaction/knownStrings/fields-2.d.ts +1 -0
- package/dist/types/redaction/knownStrings/fields-2.d.ts.map +1 -1
- package/dist/types/redaction/knownStrings/words-0.d.ts +4 -4
- package/dist/types/redaction/knownStrings/words-1.d.ts +15 -15
- package/dist/types/redaction/knownStrings/words-2.d.ts +18 -0
- package/dist/types/redaction/knownStrings/words-2.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
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { sourceLanding } from '../../../sourceEvidence/landing.js';
|
|
2
1
|
import { prepareCallState } from '../access/callState.js';
|
|
3
2
|
import { checkToolPermission } from '../access/toolPermission.js';
|
|
4
3
|
import { buildCapabilityQuestion } from '../access/capabilityQuestion.js';
|
|
@@ -20,500 +19,474 @@ import { landCallResult } from './deliveredResult.js';
|
|
|
20
19
|
import { judgeLanded } from '../evidence/judgeLanded.js';
|
|
21
20
|
import { activateLandedSkill } from '../routing/skillActivation.js';
|
|
22
21
|
import { haltLandedCall } from '../routing/policyHalt.js';
|
|
23
|
-
import {
|
|
22
|
+
import { finalizeCallResult } from './finalizeCallResult.js';
|
|
23
|
+
import { nativeResultFinalizer } from '../../../resultRowsets/finalization.js';
|
|
24
24
|
/** Execute one original serial-loop call using the native handler's scope and exact batch references. */
|
|
25
25
|
export function buildCallDispatch(deps, operations) {
|
|
26
26
|
const dispatchCall = async (scope, tc, callIndex, batch) => {
|
|
27
27
|
const { emitSecurity, resolved, tool, args, proposedProgram, viewOf, historyForCallbacks, startMs, findingsRefusal, invalidateViews, } = operations.beginDispatchCall(scope, tc, batch.iteration, batch.towers, callIndex, batch.toolCalls, batch.findingsRefusals, batch.frozenTurn, batch.callbackHistory, batch.frozenArgsAt);
|
|
28
28
|
const { outcome, resolution, runArgs, callArguments, execution } = prepareCallState(tc, findingsRefusal, batch.resolutions, batch.inputs, args);
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
execution.resultFinalizer = nativeResultFinalizer(scope, tool, { toolName: tc.name, toolCallId: tc.id, iteration: batch.iteration }, deps, operations.runFactsOf(scope)?.runId, resolved.party);
|
|
30
|
+
try {
|
|
31
|
+
if (!execution.denied && operations.permissionChecker) {
|
|
32
|
+
await checkToolPermission({
|
|
33
|
+
historyForCallbacks,
|
|
34
|
+
iteration: batch.iteration,
|
|
35
|
+
permissionChecker: operations.permissionChecker,
|
|
36
|
+
tc,
|
|
37
|
+
viewOf,
|
|
38
|
+
runArgs,
|
|
39
|
+
runIdentity: batch.runIdentity,
|
|
40
|
+
env: batch.env,
|
|
41
|
+
emitSecurity,
|
|
42
|
+
execution,
|
|
43
|
+
outcome,
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
const askCapability = buildCapabilityQuestion({
|
|
33
47
|
permissionChecker: operations.permissionChecker,
|
|
34
|
-
tc,
|
|
35
48
|
viewOf,
|
|
36
|
-
|
|
49
|
+
historyForCallbacks,
|
|
50
|
+
iteration: batch.iteration,
|
|
37
51
|
runIdentity: batch.runIdentity,
|
|
38
52
|
env: batch.env,
|
|
39
53
|
emitSecurity,
|
|
40
|
-
execution,
|
|
41
|
-
outcome,
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
const askCapability = buildCapabilityQuestion({
|
|
45
|
-
permissionChecker: operations.permissionChecker,
|
|
46
|
-
viewOf,
|
|
47
|
-
historyForCallbacks,
|
|
48
|
-
iteration: batch.iteration,
|
|
49
|
-
runIdentity: batch.runIdentity,
|
|
50
|
-
env: batch.env,
|
|
51
|
-
emitSecurity,
|
|
52
|
-
tc,
|
|
53
|
-
callArguments,
|
|
54
|
-
execution,
|
|
55
|
-
outcome,
|
|
56
|
-
});
|
|
57
|
-
// ── Declared tool capabilities (9.11.0) ──────────────────────────
|
|
58
|
-
// Beside the tool_call gate, at the same layer and before any
|
|
59
|
-
// middleware, so an existing checker still decides first. Asked once
|
|
60
|
-
// per capability the TOOL declared and the CHECKER governs — either
|
|
61
|
-
// side silent and this loop does not run at all, which is why an agent
|
|
62
|
-
// that has not opted in is byte-identical.
|
|
63
|
-
if (!execution.denied && operations.permissionChecker && tool?.capabilities) {
|
|
64
|
-
for (const capability of tool.capabilities) {
|
|
65
|
-
if (execution.denied)
|
|
66
|
-
break;
|
|
67
|
-
if (!checkerGoverns(operations.permissionChecker, capability))
|
|
68
|
-
continue;
|
|
69
|
-
await askCapability(capability, tc.name, `Tool '${tc.name}' is not available in this context.`);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
const { argumentGate, consentGate, unmounted } = prepareArgumentGate(scope, { tc, tool, iteration: batch.iteration, execution, outcome }, {
|
|
73
|
-
unmountedRules: operations.unmountedRules,
|
|
74
|
-
warnUnmountedToolPeriod: operations.warnUnmountedToolPeriod,
|
|
75
|
-
});
|
|
76
|
-
const rulesRefusal = argumentGate.argsRejected
|
|
77
|
-
? undefined
|
|
78
|
-
: resolution?.refused ?? (unmounted === undefined ? undefined : await unmounted);
|
|
79
|
-
if (!execution.denied && rulesRefusal !== undefined) {
|
|
80
|
-
argumentGate.argsRejected = true;
|
|
81
|
-
outcome.error = true;
|
|
82
|
-
outcome.result = rulesRefusal;
|
|
83
|
-
}
|
|
84
|
-
// ── The middleware chain ─────────────────────────────────────────
|
|
85
|
-
// Walked only for a call the permission gate let through, so an
|
|
86
|
-
// existing checker keeps deciding first and a denial there costs
|
|
87
|
-
// nothing. A denial from the chain lands as the tool result, exactly
|
|
88
|
-
// like every other refusal in this loop — the model reads it and
|
|
89
|
-
// adapts. An `ask` commits partial state and pauses, on the same wire
|
|
90
|
-
// the check-in gate uses. Never walked for a call whose arguments the
|
|
91
|
-
// inputs layer refused (above).
|
|
92
|
-
if (!execution.denied &&
|
|
93
|
-
!argumentGate.argsRejected &&
|
|
94
|
-
deps.toolMiddleware &&
|
|
95
|
-
deps.toolMiddleware.length > 0) {
|
|
96
|
-
const pause = await admitMiddlewareCall(scope, deps, {
|
|
97
54
|
tc,
|
|
98
|
-
tool,
|
|
99
|
-
iteration: batch.iteration,
|
|
100
55
|
callArguments,
|
|
101
|
-
historyForCallbacks,
|
|
102
|
-
runIdentity: batch.runIdentity,
|
|
103
|
-
env: batch.env,
|
|
104
|
-
oneQuestionAsked: batch.oneQuestionAsked,
|
|
105
|
-
resolved,
|
|
106
|
-
decisionLedger: operations.decisionLedger,
|
|
107
|
-
inputs: batch.inputs,
|
|
108
|
-
invalidateViews,
|
|
109
56
|
execution,
|
|
110
57
|
outcome,
|
|
111
|
-
askedLayer: batch.askedLayer,
|
|
112
|
-
resolution,
|
|
113
|
-
assertComponentDeliverable: operations.assertComponentDeliverable,
|
|
114
|
-
newHistory: batch.newHistory,
|
|
115
|
-
startMs,
|
|
116
|
-
fileScript: operations.fileScript,
|
|
117
|
-
proposedProgram,
|
|
118
|
-
programOfCall: operations.programOfCall,
|
|
119
58
|
});
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
// layer's refusals land in the same shape, before the chain.)
|
|
139
|
-
if (!execution.denied && !argumentGate.argsRejected && tool) {
|
|
140
|
-
const invalidArgs = operations.argumentRefusal(scope, tool, callArguments.callArgs, {
|
|
141
|
-
toolName: tc.name,
|
|
142
|
-
toolCallId: tc.id,
|
|
143
|
-
iteration: batch.iteration,
|
|
59
|
+
// ── Declared tool capabilities (9.11.0) ──────────────────────────
|
|
60
|
+
// Beside the tool_call gate, at the same layer and before any
|
|
61
|
+
// middleware, so an existing checker still decides first. Asked once
|
|
62
|
+
// per capability the TOOL declared and the CHECKER governs — either
|
|
63
|
+
// side silent and this loop does not run at all, which is why an agent
|
|
64
|
+
// that has not opted in is byte-identical.
|
|
65
|
+
if (!execution.denied && operations.permissionChecker && tool?.capabilities) {
|
|
66
|
+
for (const capability of tool.capabilities) {
|
|
67
|
+
if (execution.denied)
|
|
68
|
+
break;
|
|
69
|
+
if (!checkerGoverns(operations.permissionChecker, capability))
|
|
70
|
+
continue;
|
|
71
|
+
await askCapability(capability, tc.name, `Tool '${tc.name}' is not available in this context.`);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
const { argumentGate, consentGate, unmounted } = prepareArgumentGate(scope, { tc, tool, iteration: batch.iteration, execution, outcome }, {
|
|
75
|
+
unmountedRules: operations.unmountedRules,
|
|
76
|
+
warnUnmountedToolPeriod: operations.warnUnmountedToolPeriod,
|
|
144
77
|
});
|
|
145
|
-
|
|
78
|
+
const rulesRefusal = argumentGate.argsRejected
|
|
79
|
+
? undefined
|
|
80
|
+
: resolution?.refused ?? (unmounted === undefined ? undefined : await unmounted);
|
|
81
|
+
if (!execution.denied && rulesRefusal !== undefined) {
|
|
146
82
|
argumentGate.argsRejected = true;
|
|
147
83
|
outcome.error = true;
|
|
148
|
-
outcome.result =
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
// ── Skill-activation gate (9.11.0) ───────────────────────────────
|
|
152
|
-
// `read_skill` activating a skill the policy hides for this role. The
|
|
153
|
-
// menu the model reads was already filtered (the Tools slot asks the
|
|
154
|
-
// same checker the same question), so this is the second half of one
|
|
155
|
-
// rule rather than a second rule: a model that guessed a hidden id, or
|
|
156
|
-
// remembered one from an earlier turn, reads the policy's own message.
|
|
157
|
-
//
|
|
158
|
-
// Ordered AFTER arg validation so the id judged is the one that will
|
|
159
|
-
// actually run — a middleware may have rewritten it — and BEFORE
|
|
160
|
-
// check-in, credentials and execute, so a refused skill's body is
|
|
161
|
-
// never even computed (`surfaceMode: 'tool-only'` returns it from
|
|
162
|
-
// `execute`). Off entirely unless the checker declares it governs
|
|
163
|
-
// `'skill_read'`.
|
|
164
|
-
if (!execution.denied &&
|
|
165
|
-
!argumentGate.argsRejected &&
|
|
166
|
-
tc.name === 'read_skill' &&
|
|
167
|
-
checkerGoverns(operations.permissionChecker, 'skill_read')) {
|
|
168
|
-
const requestedSkillId = callArguments.callArgs.id;
|
|
169
|
-
if (typeof requestedSkillId === 'string' && requestedSkillId.length > 0) {
|
|
170
|
-
// ── A SELF-CALL AT A MOUNTED CURSOR EXERCISES NO CAPABILITY ───
|
|
171
|
-
// (9.86.0.) A MOUNTED cursor's own skill is already served: its
|
|
172
|
-
// body is in that call's system prompt and its tools are on that
|
|
173
|
-
// call's wire. Asking to read it activates nothing, moves nothing,
|
|
174
|
-
// and reveals nothing the request did not already carry — so there
|
|
175
|
-
// is no capability here for a policy to grant or deny, and denying
|
|
176
|
-
// it told the model its current skill was "not available in this
|
|
177
|
-
// context" while it was standing in it. That is the exact sentence
|
|
178
|
-
// the self-call arm exists to stop the model reading. The gate's
|
|
179
|
-
// self-call arm answers instead.
|
|
180
|
-
//
|
|
181
|
-
// A PARKED cursor is the one case where the same id is not a
|
|
182
|
-
// no-op, and the skip is scoped to exclude it (9.86.0 fix pass):
|
|
183
|
-
// parking suppressed the map's contribution, so the dispatch gate
|
|
184
|
-
// 480 lines below reads that call as a RE-ENGAGEMENT and serves the
|
|
185
|
-
// body and tools again on the next pass. That moves something, so
|
|
186
|
-
// the policy keeps the question. `atMountedCursor` is where that
|
|
187
|
-
// rule lives; the dispatch gate writes the same rule as two ordered
|
|
188
|
-
// arms over the same `parkedNow` set. Every OTHER id still goes
|
|
189
|
-
// through the policy, unchanged — this narrows nothing a role could
|
|
190
|
-
// see.
|
|
191
|
-
const stay = atMountedCursor({
|
|
192
|
-
...(typeof scope.currentSkillId === 'string' && {
|
|
193
|
-
cursor: scope.currentSkillId,
|
|
194
|
-
}),
|
|
195
|
-
target: requestedSkillId,
|
|
196
|
-
parked: operations.parkedNow(scope),
|
|
197
|
-
});
|
|
198
|
-
if (!stay) {
|
|
199
|
-
await askCapability('skill_read', skillTarget(requestedSkillId), `Skill '${requestedSkillId}' is not available in this context.`);
|
|
200
|
-
}
|
|
84
|
+
outcome.result = rulesRefusal;
|
|
201
85
|
}
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
tool.checkIn !== undefined &&
|
|
216
|
-
deps.checkIn) {
|
|
217
|
-
const pause = await admitCheckInCall(scope, deps, {
|
|
218
|
-
historyForCheckIn: operations.historyForCheckIn,
|
|
219
|
-
historyForCallbacks,
|
|
220
|
-
tool,
|
|
221
|
-
viewOf,
|
|
222
|
-
callArguments,
|
|
223
|
-
iteration: batch.iteration,
|
|
224
|
-
tc,
|
|
225
|
-
askedLayer: batch.askedLayer,
|
|
226
|
-
resolved,
|
|
227
|
-
decisionLedger: operations.decisionLedger,
|
|
228
|
-
consentGate,
|
|
229
|
-
outcome,
|
|
230
|
-
resolution,
|
|
231
|
-
assertComponentDeliverable: operations.assertComponentDeliverable,
|
|
232
|
-
env: batch.env,
|
|
233
|
-
newHistory: batch.newHistory,
|
|
234
|
-
startMs,
|
|
235
|
-
fileScript: operations.fileScript,
|
|
236
|
-
proposedProgram,
|
|
237
|
-
programOfCall: operations.programOfCall,
|
|
238
|
-
});
|
|
239
|
-
if (pause !== undefined)
|
|
240
|
-
return { kind: 'paused', pause };
|
|
241
|
-
}
|
|
242
|
-
if (!execution.denied && !argumentGate.argsRejected && !consentGate.checkInRefused) {
|
|
243
|
-
const wanted = {
|
|
244
|
-
// ── Declared artifact arguments (9.22.0) ──────────────────────
|
|
245
|
-
// The `needs` precedent applied to data: resolve the tool's
|
|
246
|
-
// declared `wants` refs BEFORE credential resolution (never
|
|
247
|
-
// acquire credentials for a call that won't run) and BEFORE
|
|
248
|
-
// execute — a stale/unknown/wrong-kind ref never reaches the
|
|
249
|
-
// tool; the model reads a teaching refusal listing the live refs
|
|
250
|
-
// of the wanted kind. On success `callArgs` carries the RESOLVED
|
|
251
|
-
// DATA and `ctx.wanted` the claim tickets. Tools without `wants`
|
|
252
|
-
// take the exact path they always took.
|
|
253
|
-
wantedMeta: undefined,
|
|
254
|
-
wantsBlocked: false,
|
|
255
|
-
};
|
|
256
|
-
if (tool?.wants !== undefined) {
|
|
257
|
-
await admitWantedArguments(scope, {
|
|
258
|
-
resolveWantsAtDispatch: operations.resolveWantsAtDispatch,
|
|
86
|
+
// ── The middleware chain ─────────────────────────────────────────
|
|
87
|
+
// Walked only for a call the permission gate let through, so an
|
|
88
|
+
// existing checker keeps deciding first and a denial there costs
|
|
89
|
+
// nothing. A denial from the chain lands as the tool result, exactly
|
|
90
|
+
// like every other refusal in this loop — the model reads it and
|
|
91
|
+
// adapts. An `ask` commits partial state and pauses, on the same wire
|
|
92
|
+
// the check-in gate uses. Never walked for a call whose arguments the
|
|
93
|
+
// inputs layer refused (above).
|
|
94
|
+
if (!execution.denied &&
|
|
95
|
+
!argumentGate.argsRejected &&
|
|
96
|
+
deps.toolMiddleware &&
|
|
97
|
+
deps.toolMiddleware.length > 0) {
|
|
98
|
+
const pause = await admitMiddlewareCall(scope, deps, {
|
|
259
99
|
tc,
|
|
260
100
|
tool,
|
|
101
|
+
iteration: batch.iteration,
|
|
261
102
|
callArguments,
|
|
262
|
-
|
|
263
|
-
outcome,
|
|
264
|
-
});
|
|
265
|
-
}
|
|
266
|
-
const authorization = {
|
|
267
|
-
// Declare-and-push: resolve the tool's declared credential BEFORE
|
|
268
|
-
// invoking, and inject it as ctx.credential. On consent-required or
|
|
269
|
-
// failure, surface the reason to the LLM (tool result) + emit; the
|
|
270
|
-
// tool does NOT run (fail-closed — never half-authed; a denial that
|
|
271
|
-
// throws is surfaced, not retried).
|
|
272
|
-
resolvedCredential: undefined,
|
|
273
|
-
credentialBlocked: false,
|
|
274
|
-
};
|
|
275
|
-
const need = wanted.wantsBlocked ? undefined : tool?.needs;
|
|
276
|
-
if (need) {
|
|
277
|
-
const pause = await admitToolCredential(scope, deps, {
|
|
278
|
-
emitSecurity,
|
|
279
|
-
need,
|
|
280
|
-
credentialsIn: operations.credentialsIn,
|
|
103
|
+
historyForCallbacks,
|
|
281
104
|
runIdentity: batch.runIdentity,
|
|
282
|
-
|
|
283
|
-
onAuthorizationRequired: operations.onAuthorizationRequired,
|
|
105
|
+
env: batch.env,
|
|
284
106
|
oneQuestionAsked: batch.oneQuestionAsked,
|
|
107
|
+
resolved,
|
|
108
|
+
decisionLedger: operations.decisionLedger,
|
|
109
|
+
inputs: batch.inputs,
|
|
110
|
+
invalidateViews,
|
|
111
|
+
execution,
|
|
112
|
+
outcome,
|
|
113
|
+
askedLayer: batch.askedLayer,
|
|
114
|
+
resolution,
|
|
115
|
+
assertComponentDeliverable: operations.assertComponentDeliverable,
|
|
285
116
|
newHistory: batch.newHistory,
|
|
286
|
-
tc,
|
|
287
117
|
startMs,
|
|
288
|
-
callArguments,
|
|
289
|
-
resolved,
|
|
290
118
|
fileScript: operations.fileScript,
|
|
291
|
-
tool,
|
|
292
|
-
iteration: batch.iteration,
|
|
293
119
|
proposedProgram,
|
|
294
120
|
programOfCall: operations.programOfCall,
|
|
295
|
-
outcome,
|
|
296
|
-
askedLayer: batch.askedLayer,
|
|
297
|
-
resolution,
|
|
298
121
|
});
|
|
299
122
|
if (pause !== undefined)
|
|
300
123
|
return { kind: 'paused', pause };
|
|
301
124
|
}
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
125
|
+
// The keys the tool will run with a different value for than the
|
|
126
|
+
// model proposed — a link's rewrite, or a key the tool's own
|
|
127
|
+
// redaction hides (`../../../../toolShownArgs.ts` · `changedArgKeys`).
|
|
128
|
+
// Taken HERE, before anything executes: names only, so nothing the
|
|
129
|
+
// tool later writes into its arguments can ride `tool_end`.
|
|
130
|
+
const changedKeys = changedArgKeys(args, shownArgsOf(tool, callArguments.chainedArgs));
|
|
131
|
+
// Tool-args validation (#9) — AFTER the permission gate (policy must
|
|
132
|
+
// see every attempted call, valid or not) and BEFORE credential
|
|
133
|
+
// resolution (never acquire credentials for a call that won't run).
|
|
134
|
+
// On 'enforce' mismatch the tool is NOT executed; the model gets a
|
|
135
|
+
// structured retry message as the tool result and corrects its args
|
|
136
|
+
// on the next ReAct iteration. Unknown tools keep the existing
|
|
137
|
+
// "Unknown tool" path below — validation only applies to resolved
|
|
138
|
+
// tools (their inputSchema is the contract the LLM was shown).
|
|
139
|
+
// (`argsRejected` is declared above the middleware chain: the inputs
|
|
140
|
+
// layer's refusals land in the same shape, before the chain.)
|
|
141
|
+
if (!execution.denied && !argumentGate.argsRejected && tool) {
|
|
142
|
+
const invalidArgs = operations.argumentRefusal(scope, tool, callArguments.callArgs, {
|
|
143
|
+
toolName: tc.name,
|
|
144
|
+
toolCallId: tc.id,
|
|
309
145
|
iteration: batch.iteration,
|
|
146
|
+
});
|
|
147
|
+
if (invalidArgs !== undefined) {
|
|
148
|
+
argumentGate.argsRejected = true;
|
|
149
|
+
outcome.error = true;
|
|
150
|
+
outcome.result = invalidArgs;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
// ── Skill-activation gate (9.11.0) ───────────────────────────────
|
|
154
|
+
// `read_skill` activating a skill the policy hides for this role. The
|
|
155
|
+
// menu the model reads was already filtered (the Tools slot asks the
|
|
156
|
+
// same checker the same question), so this is the second half of one
|
|
157
|
+
// rule rather than a second rule: a model that guessed a hidden id, or
|
|
158
|
+
// remembered one from an earlier turn, reads the policy's own message.
|
|
159
|
+
//
|
|
160
|
+
// Ordered AFTER arg validation so the id judged is the one that will
|
|
161
|
+
// actually run — a middleware may have rewritten it — and BEFORE
|
|
162
|
+
// check-in, credentials and execute, so a refused skill's body is
|
|
163
|
+
// never even computed (`surfaceMode: 'tool-only'` returns it from
|
|
164
|
+
// `execute`). Off entirely unless the checker declares it governs
|
|
165
|
+
// `'skill_read'`.
|
|
166
|
+
if (!execution.denied &&
|
|
167
|
+
!argumentGate.argsRejected &&
|
|
168
|
+
tc.name === 'read_skill' &&
|
|
169
|
+
checkerGoverns(operations.permissionChecker, 'skill_read')) {
|
|
170
|
+
const requestedSkillId = callArguments.callArgs.id;
|
|
171
|
+
if (typeof requestedSkillId === 'string' && requestedSkillId.length > 0) {
|
|
172
|
+
// ── A SELF-CALL AT A MOUNTED CURSOR EXERCISES NO CAPABILITY ───
|
|
173
|
+
// (9.86.0.) A MOUNTED cursor's own skill is already served: its
|
|
174
|
+
// body is in that call's system prompt and its tools are on that
|
|
175
|
+
// call's wire. Asking to read it activates nothing, moves nothing,
|
|
176
|
+
// and reveals nothing the request did not already carry — so there
|
|
177
|
+
// is no capability here for a policy to grant or deny, and denying
|
|
178
|
+
// it told the model its current skill was "not available in this
|
|
179
|
+
// context" while it was standing in it. That is the exact sentence
|
|
180
|
+
// the self-call arm exists to stop the model reading. The gate's
|
|
181
|
+
// self-call arm answers instead.
|
|
182
|
+
//
|
|
183
|
+
// A PARKED cursor is the one case where the same id is not a
|
|
184
|
+
// no-op, and the skip is scoped to exclude it (9.86.0 fix pass):
|
|
185
|
+
// parking suppressed the map's contribution, so the dispatch gate
|
|
186
|
+
// 480 lines below reads that call as a RE-ENGAGEMENT and serves the
|
|
187
|
+
// body and tools again on the next pass. That moves something, so
|
|
188
|
+
// the policy keeps the question. `atMountedCursor` is where that
|
|
189
|
+
// rule lives; the dispatch gate writes the same rule as two ordered
|
|
190
|
+
// arms over the same `parkedNow` set. Every OTHER id still goes
|
|
191
|
+
// through the policy, unchanged — this narrows nothing a role could
|
|
192
|
+
// see.
|
|
193
|
+
const stay = atMountedCursor({
|
|
194
|
+
...(typeof scope.currentSkillId === 'string' && {
|
|
195
|
+
cursor: scope.currentSkillId,
|
|
196
|
+
}),
|
|
197
|
+
target: requestedSkillId,
|
|
198
|
+
parked: operations.parkedNow(scope),
|
|
199
|
+
});
|
|
200
|
+
if (!stay) {
|
|
201
|
+
await askCapability('skill_read', skillTarget(requestedSkillId), `Skill '${requestedSkillId}' is not available in this context.`);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
// ── Check-in gate (evidence-carrying human consent) ──────────────
|
|
206
|
+
// Ordered AFTER the permission gate + arg-validation (a call the policy
|
|
207
|
+
// denied or that has invalid args never asks a human) and BEFORE
|
|
208
|
+
// credential resolution + execute (never acquire credentials for a call
|
|
209
|
+
// awaiting consent — that's the whole point of "consent WITH the
|
|
210
|
+
// receipts"). Fires ONLY when the tool declared `checkIn` and it trips,
|
|
211
|
+
// so tools without the field are byte-identical (no gate, no events, no
|
|
212
|
+
// pause). Rides the EXISTING pause machinery: returning a defined value
|
|
213
|
+
// triggers the footprintjs checkpoint, exactly like `pauseHere`.
|
|
214
|
+
if (!execution.denied &&
|
|
215
|
+
!argumentGate.argsRejected &&
|
|
216
|
+
tool &&
|
|
217
|
+
tool.checkIn !== undefined &&
|
|
218
|
+
deps.checkIn) {
|
|
219
|
+
const pause = await admitCheckInCall(scope, deps, {
|
|
220
|
+
historyForCheckIn: operations.historyForCheckIn,
|
|
221
|
+
historyForCallbacks,
|
|
222
|
+
tool,
|
|
223
|
+
viewOf,
|
|
310
224
|
callArguments,
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
wanted,
|
|
318
|
-
toolProgress: operations.toolProgress,
|
|
319
|
-
sessionContext: operations.sessionContext,
|
|
320
|
-
toolDispatchCtx: operations.toolDispatchCtx,
|
|
321
|
-
searchFunnel: operations.searchFunnel,
|
|
322
|
-
execution,
|
|
323
|
-
runFactsOf: operations.runFactsOf,
|
|
324
|
-
programOfCall: operations.programOfCall,
|
|
225
|
+
iteration: batch.iteration,
|
|
226
|
+
tc,
|
|
227
|
+
askedLayer: batch.askedLayer,
|
|
228
|
+
resolved,
|
|
229
|
+
decisionLedger: operations.decisionLedger,
|
|
230
|
+
consentGate,
|
|
325
231
|
outcome,
|
|
326
|
-
|
|
327
|
-
warnEffect: operations.warnEffect,
|
|
328
|
-
declareCoverage: operations.declareCoverage,
|
|
329
|
-
declareSemantics: operations.declareSemantics,
|
|
330
|
-
refuseOverCeiling: operations.refuseOverCeiling,
|
|
331
|
-
judgeColumns: operations.judgeColumns,
|
|
332
|
-
endCall: operations.endCall,
|
|
333
|
-
oneQuestionAsked: batch.oneQuestionAsked,
|
|
232
|
+
resolution,
|
|
334
233
|
assertComponentDeliverable: operations.assertComponentDeliverable,
|
|
234
|
+
env: batch.env,
|
|
335
235
|
newHistory: batch.newHistory,
|
|
336
236
|
startMs,
|
|
337
|
-
declareRaisedAbsence: operations.declareRaisedAbsence,
|
|
338
237
|
fileScript: operations.fileScript,
|
|
339
238
|
proposedProgram,
|
|
340
|
-
|
|
341
|
-
resolution,
|
|
239
|
+
programOfCall: operations.programOfCall,
|
|
342
240
|
});
|
|
343
241
|
if (pause !== undefined)
|
|
344
242
|
return { kind: 'paused', pause };
|
|
345
243
|
}
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
244
|
+
if (!execution.denied && !argumentGate.argsRejected && !consentGate.checkInRefused) {
|
|
245
|
+
const wanted = {
|
|
246
|
+
// ── Declared artifact arguments (9.22.0) ──────────────────────
|
|
247
|
+
// The `needs` precedent applied to data: resolve the tool's
|
|
248
|
+
// declared `wants` refs BEFORE credential resolution (never
|
|
249
|
+
// acquire credentials for a call that won't run) and BEFORE
|
|
250
|
+
// execute — a stale/unknown/wrong-kind ref never reaches the
|
|
251
|
+
// tool; the model reads a teaching refusal listing the live refs
|
|
252
|
+
// of the wanted kind. On success `callArgs` carries the RESOLVED
|
|
253
|
+
// DATA and `ctx.wanted` the claim tickets. Tools without `wants`
|
|
254
|
+
// take the exact path they always took.
|
|
255
|
+
wantedMeta: undefined,
|
|
256
|
+
wantsBlocked: false,
|
|
257
|
+
};
|
|
258
|
+
if (tool?.wants !== undefined) {
|
|
259
|
+
await admitWantedArguments(scope, {
|
|
260
|
+
resolveWantsAtDispatch: operations.resolveWantsAtDispatch,
|
|
261
|
+
tc,
|
|
262
|
+
tool,
|
|
263
|
+
callArguments,
|
|
264
|
+
wanted,
|
|
265
|
+
outcome,
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
const authorization = {
|
|
269
|
+
// Declare-and-push: resolve the tool's declared credential BEFORE
|
|
270
|
+
// invoking, and inject it as ctx.credential. On consent-required or
|
|
271
|
+
// failure, surface the reason to the LLM (tool result) + emit; the
|
|
272
|
+
// tool does NOT run (fail-closed — never half-authed; a denial that
|
|
273
|
+
// throws is surfaced, not retried).
|
|
274
|
+
resolvedCredential: undefined,
|
|
275
|
+
credentialBlocked: false,
|
|
276
|
+
};
|
|
277
|
+
const need = wanted.wantsBlocked ? undefined : tool?.needs;
|
|
278
|
+
if (need) {
|
|
279
|
+
const pause = await admitToolCredential(scope, deps, {
|
|
280
|
+
emitSecurity,
|
|
281
|
+
need,
|
|
282
|
+
credentialsIn: operations.credentialsIn,
|
|
283
|
+
runIdentity: batch.runIdentity,
|
|
284
|
+
authorization,
|
|
285
|
+
onAuthorizationRequired: operations.onAuthorizationRequired,
|
|
286
|
+
oneQuestionAsked: batch.oneQuestionAsked,
|
|
287
|
+
newHistory: batch.newHistory,
|
|
288
|
+
tc,
|
|
289
|
+
startMs,
|
|
290
|
+
callArguments,
|
|
291
|
+
resolved,
|
|
292
|
+
fileScript: operations.fileScript,
|
|
293
|
+
tool,
|
|
294
|
+
iteration: batch.iteration,
|
|
295
|
+
proposedProgram,
|
|
296
|
+
programOfCall: operations.programOfCall,
|
|
297
|
+
outcome,
|
|
298
|
+
askedLayer: batch.askedLayer,
|
|
299
|
+
resolution,
|
|
300
|
+
});
|
|
301
|
+
if (pause !== undefined)
|
|
302
|
+
return { kind: 'paused', pause };
|
|
303
|
+
}
|
|
304
|
+
if (!authorization.credentialBlocked && !wanted.wantsBlocked) {
|
|
305
|
+
const pause = await invokeInitialTool(scope, deps, {
|
|
306
|
+
tool,
|
|
307
|
+
resolved,
|
|
308
|
+
tc,
|
|
309
|
+
dispatchRoster: operations.dispatchRoster,
|
|
310
|
+
noteOffWire: operations.noteOffWire,
|
|
311
|
+
iteration: batch.iteration,
|
|
312
|
+
callArguments,
|
|
313
|
+
env: batch.env,
|
|
314
|
+
credentialsIn: operations.credentialsIn,
|
|
315
|
+
emitSecurity,
|
|
316
|
+
hasCredentials: operations.hasCredentials,
|
|
317
|
+
authorization,
|
|
318
|
+
toolArtifacts: operations.toolArtifacts,
|
|
319
|
+
wanted,
|
|
320
|
+
toolProgress: operations.toolProgress,
|
|
321
|
+
sessionContext: operations.sessionContext,
|
|
322
|
+
toolDispatchCtx: operations.toolDispatchCtx,
|
|
323
|
+
searchFunnel: operations.searchFunnel,
|
|
324
|
+
execution,
|
|
325
|
+
runFactsOf: operations.runFactsOf,
|
|
326
|
+
programOfCall: operations.programOfCall,
|
|
327
|
+
outcome,
|
|
328
|
+
takeCodeRun: operations.takeCodeRun,
|
|
329
|
+
warnEffect: operations.warnEffect,
|
|
330
|
+
declareCoverage: operations.declareCoverage,
|
|
331
|
+
declareSemantics: operations.declareSemantics,
|
|
332
|
+
refuseOverCeiling: operations.refuseOverCeiling,
|
|
333
|
+
judgeColumns: operations.judgeColumns,
|
|
334
|
+
endCall: operations.endCall,
|
|
335
|
+
oneQuestionAsked: batch.oneQuestionAsked,
|
|
336
|
+
assertComponentDeliverable: operations.assertComponentDeliverable,
|
|
337
|
+
newHistory: batch.newHistory,
|
|
338
|
+
startMs,
|
|
339
|
+
declareRaisedAbsence: operations.declareRaisedAbsence,
|
|
340
|
+
fileScript: operations.fileScript,
|
|
341
|
+
proposedProgram,
|
|
342
|
+
askedLayer: batch.askedLayer,
|
|
343
|
+
resolution,
|
|
344
|
+
});
|
|
345
|
+
if (pause !== undefined)
|
|
346
|
+
return { kind: 'paused', pause };
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
const skillRoute = {
|
|
350
|
+
// ── Skill-graph read_skill GATE ────────────────────────
|
|
351
|
+
// Reject a read_skill jump OUTSIDE the reachable set from the current
|
|
352
|
+
// cursor: replace the result with a re-prompt naming the allowed ids (so
|
|
353
|
+
// the model re-picks) and skip the activation below — cursor + activations
|
|
354
|
+
// stay unchanged. Off when no skillGraph (deps.allowedSkillIds undefined),
|
|
355
|
+
// so plain read_skill agents are byte-for-byte unaffected.
|
|
356
|
+
//
|
|
357
|
+
// The allowed set is two kinds of id, and the difference is the whole
|
|
358
|
+
// design (8.4.0): a HOP — a skill the graph routes, reachable from where
|
|
359
|
+
// the cursor stands — and an OPEN skill, one the graph never wires (a
|
|
360
|
+
// `.selfExplain()` debug skill, a `.skill()` registered beside the graph,
|
|
361
|
+
// a skill listed in `skills[]` and wired to nothing). Both activate; only a
|
|
362
|
+
// hop moves the cursor. Before 8.4.0 the open ones were offered in
|
|
363
|
+
// read_skill's own menu and then rejected on every single call — the
|
|
364
|
+
// library refused its own flagship debug feature under its own routing
|
|
365
|
+
// feature, and the model could burn a whole run re-asking.
|
|
366
|
+
skillRejected: false,
|
|
367
|
+
skillHop: false,
|
|
368
|
+
};
|
|
369
|
+
applyReadSkillRoute(scope, deps, {
|
|
370
|
+
tc,
|
|
391
371
|
iteration: batch.iteration,
|
|
372
|
+
parkedNow: operations.parkedNow,
|
|
373
|
+
noteSkillRefusal: operations.noteSkillRefusal,
|
|
374
|
+
outcome,
|
|
375
|
+
execution,
|
|
376
|
+
callArguments,
|
|
377
|
+
skillRoute,
|
|
392
378
|
});
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
379
|
+
// ── skip_step bookkeeping (9.18.0) ─────────────────────────────
|
|
380
|
+
// Same block as the read_skill gate, same mechanism: the stage
|
|
381
|
+
// OVERWRITES the tool's placeholder with the authoritative sentence
|
|
382
|
+
// BEFORE the after-tool moment, so governance rules and the cap
|
|
383
|
+
// compose over what the model will actually read, on both channels.
|
|
384
|
+
// Postures never gate it — skipping is judgment inside a step, not
|
|
385
|
+
// routing. Zero-cost gate: `stepPlanFor` is undefined on every agent
|
|
386
|
+
// without a stepped skill.
|
|
387
|
+
if (operations.frameworkSkipStepAnswered(tc.name, tool) &&
|
|
388
|
+
!outcome.error &&
|
|
389
|
+
!execution.denied) {
|
|
390
|
+
outcome.result = operations.applySkipStep(scope, {
|
|
391
|
+
args: callArguments.callArgs,
|
|
392
|
+
toolCallId: tc.id,
|
|
393
|
+
iteration: batch.iteration,
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
// ── present bookkeeping (9.22.0) ───────────────────────────────
|
|
397
|
+
// Same mechanism as skip_step: the auto-attached placeholder ran;
|
|
398
|
+
// the stage overwrites its result with the description snapshot (or
|
|
399
|
+
// the teaching refusal) BEFORE the after-tool moment, so governance
|
|
400
|
+
// and the caps compose over what the model will actually read. A
|
|
401
|
+
// miss is an errored call: the model holds no presentation, and a
|
|
402
|
+
// procedure step whose tool presented nothing must not advance.
|
|
403
|
+
if (deps.artifactStore &&
|
|
404
|
+
tc.name === PRESENT_TOOL_NAME &&
|
|
405
|
+
execution.executed &&
|
|
406
|
+
!outcome.error &&
|
|
407
|
+
!execution.denied) {
|
|
408
|
+
const presented = await operations.applyPresent(scope, {
|
|
409
|
+
args: callArguments.callArgs,
|
|
410
|
+
toolCallId: tc.id,
|
|
411
|
+
iteration: batch.iteration,
|
|
412
|
+
});
|
|
413
|
+
outcome.result = presented.text;
|
|
414
|
+
if (!presented.ok)
|
|
415
|
+
outcome.error = true;
|
|
416
|
+
}
|
|
417
|
+
const { capped, modelResult } = await finalizeCallResult(scope, operations, {
|
|
418
|
+
tool,
|
|
419
|
+
tc,
|
|
420
|
+
batch,
|
|
421
|
+
callArguments,
|
|
422
|
+
execution,
|
|
423
|
+
outcome,
|
|
424
|
+
sourceEvidenceArmed: deps.sourceEvidenceConfig !== undefined,
|
|
410
425
|
});
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
// ── The after-tool moment ────────────────────────────────────────
|
|
416
|
-
// Last thing before the result becomes history, and only for a call
|
|
417
|
-
// that ran. `modelResult` is what the model reads; `result` stays the
|
|
418
|
-
// truth about the tool and is what `stream.tool_end` reports.
|
|
419
|
-
const rawModelResult = execution.executed
|
|
420
|
-
? await operations.afterMoment(scope, {
|
|
421
|
-
...(tool && { tool }),
|
|
422
|
-
toolName: tc.name,
|
|
423
|
-
toolCallId: tc.id,
|
|
424
|
-
iteration: batch.iteration,
|
|
425
|
-
args: callArguments.callArgs,
|
|
426
|
-
result: outcome.result,
|
|
427
|
-
negativeResultId: execution.negativeDispatch?.resultId,
|
|
428
|
-
...(execution.sourceCapture && { onSourceWithheld: execution.sourceCapture.withheld }),
|
|
429
|
-
...(outcome.error === true && { error: true }),
|
|
430
|
-
history: batch.newHistory,
|
|
431
|
-
...(batch.runIdentity && { identity: batch.runIdentity }),
|
|
432
|
-
...(batch.env.signal && { signal: batch.env.signal }),
|
|
433
|
-
})
|
|
434
|
-
: outcome.result;
|
|
435
|
-
if (deps.sourceEvidenceConfig !== undefined && sourceEvidenceHaltOf(scope) !== undefined) {
|
|
436
|
-
execution.denied = true;
|
|
437
|
-
execution.haltContext = sourceEvidenceHaltOf(scope);
|
|
438
|
-
}
|
|
439
|
-
// Placement next (9.22.0) — the operator's ref-ing, judged on what
|
|
440
|
-
// the chain let through (a rule that already summarized a huge
|
|
441
|
-
// result is measured on what it produced, the same reasoning as the
|
|
442
|
-
// cap). Over the threshold, the payload is checked into the store
|
|
443
|
-
// and BOTH channels carry the ticket; the truncation net below then
|
|
444
|
-
// measures the ticket. A refused/denied/errored call is never
|
|
445
|
-
// placed: a refusal is already short, and 'tool-result/<name>' must
|
|
446
|
-
// never claim an error is the tool's result.
|
|
447
|
-
const placedValues = await operations.placeResults(scope, { toolName: tc.name, toolCallId: tc.id, iteration: batch.iteration }, { result: outcome.result, modelResult: rawModelResult }, execution.executed && !outcome.error && !execution.denied && !execution.ceilingRefused);
|
|
448
|
-
// The write seam (9.77.0) — judged on `result`, the tool's own answer,
|
|
449
|
-
// and on `newHistory`, which at this point holds every earlier tool
|
|
450
|
-
// result and not yet this one. Same guard the placement decision uses:
|
|
451
|
-
// a call that did not run, errored, was denied or had its payload
|
|
452
|
-
// refused has no lookup answer to read.
|
|
453
|
-
operations.noticeEmptyLookup(scope, { toolName: tc.name, toolCallId: tc.id, iteration: batch.iteration }, callArguments.callArgs, outcome.result, batch.newHistory, execution.executed && !outcome.error && !execution.denied && !execution.ceilingRefused);
|
|
454
|
-
// The ceiling, last — after the tool, after the chain. A rule that
|
|
455
|
-
// already summarized a huge result is measured on what it produced, so
|
|
456
|
-
// the cap composes with governance rather than pre-empting it.
|
|
457
|
-
const capped = operations.capResults(tc.name, placedValues);
|
|
458
|
-
const modelResult = capped.modelResult;
|
|
459
|
-
if (execution.sourceCapture)
|
|
460
|
-
await execution.sourceCapture(modelResult, sourceLanding(execution, outcome, capped.modelResult === placedValues.modelResult));
|
|
461
|
-
const durationMs = Date.now() - startMs;
|
|
462
|
-
recordCallSettlement(scope, {
|
|
463
|
-
fileScript: operations.fileScript,
|
|
464
|
-
tool,
|
|
465
|
-
tc,
|
|
466
|
-
iteration: batch.iteration,
|
|
467
|
-
proposedProgram,
|
|
468
|
-
execution,
|
|
469
|
-
programOfCall: operations.programOfCall,
|
|
470
|
-
callArguments,
|
|
471
|
-
emitToolEnd: operations.emitToolEnd,
|
|
472
|
-
capped,
|
|
473
|
-
durationMs,
|
|
474
|
-
outcome,
|
|
475
|
-
modelResult,
|
|
476
|
-
changedKeys,
|
|
477
|
-
});
|
|
478
|
-
const delivery = {
|
|
479
|
-
resultStr: typeof modelResult === 'string' ? modelResult : safeStringify(modelResult),
|
|
480
|
-
};
|
|
481
|
-
landCallResult(scope, deps, {
|
|
482
|
-
delivery,
|
|
483
|
-
execution,
|
|
484
|
-
tc,
|
|
485
|
-
outcome,
|
|
486
|
-
skillRoute,
|
|
487
|
-
callArguments,
|
|
488
|
-
readSkillStepIntroFor: operations.readSkillStepIntroFor,
|
|
489
|
-
applyStepReturn: operations.applyStepReturn,
|
|
490
|
-
iteration: batch.iteration,
|
|
491
|
-
applyToolEffects: operations.applyToolEffects,
|
|
492
|
-
transitionState: batch.transitionState,
|
|
493
|
-
runFactsOf: operations.runFactsOf,
|
|
494
|
-
tool,
|
|
495
|
-
repeatLedgers: operations.repeatLedgers,
|
|
496
|
-
inputs: batch.inputs,
|
|
497
|
-
resolution,
|
|
498
|
-
args,
|
|
499
|
-
noteOptionsFor: operations.noteOptionsFor,
|
|
500
|
-
newHistory: batch.newHistory,
|
|
501
|
-
batchResults: batch.batchResults,
|
|
502
|
-
});
|
|
503
|
-
await judgeLanded(scope, deps.findingsJudge, execution.executed && !execution.denied && !skillRoute.skillRejected, { toolName: tc.name, result: delivery.resultStr, toolCallId: tc.id }, batch.iteration, operations.turnStampOf(scope));
|
|
504
|
-
activateLandedSkill(scope, deps, { tc, outcome, execution, skillRoute, callArguments });
|
|
505
|
-
if (execution.haltContext) {
|
|
506
|
-
haltLandedCall(scope, {
|
|
507
|
-
haltContext: execution.haltContext,
|
|
508
|
-
emitSecurity,
|
|
426
|
+
const durationMs = Date.now() - startMs;
|
|
427
|
+
recordCallSettlement(scope, {
|
|
428
|
+
fileScript: operations.fileScript,
|
|
429
|
+
tool,
|
|
509
430
|
tc,
|
|
510
|
-
newHistory: batch.newHistory,
|
|
511
431
|
iteration: batch.iteration,
|
|
432
|
+
proposedProgram,
|
|
433
|
+
execution,
|
|
434
|
+
programOfCall: operations.programOfCall,
|
|
435
|
+
callArguments,
|
|
436
|
+
emitToolEnd: operations.emitToolEnd,
|
|
437
|
+
capped,
|
|
438
|
+
durationMs,
|
|
439
|
+
outcome,
|
|
440
|
+
modelResult,
|
|
441
|
+
changedKeys,
|
|
442
|
+
});
|
|
443
|
+
const delivery = {
|
|
444
|
+
resultStr: typeof modelResult === 'string' ? modelResult : safeStringify(modelResult),
|
|
445
|
+
};
|
|
446
|
+
landCallResult(scope, deps, {
|
|
447
|
+
delivery,
|
|
448
|
+
execution,
|
|
449
|
+
tc,
|
|
450
|
+
outcome,
|
|
451
|
+
skillRoute,
|
|
512
452
|
callArguments,
|
|
453
|
+
readSkillStepIntroFor: operations.readSkillStepIntroFor,
|
|
454
|
+
applyStepReturn: operations.applyStepReturn,
|
|
455
|
+
iteration: batch.iteration,
|
|
456
|
+
applyToolEffects: operations.applyToolEffects,
|
|
457
|
+
transitionState: batch.transitionState,
|
|
458
|
+
runFactsOf: operations.runFactsOf,
|
|
459
|
+
tool,
|
|
460
|
+
repeatLedgers: operations.repeatLedgers,
|
|
461
|
+
inputs: batch.inputs,
|
|
462
|
+
resolution,
|
|
463
|
+
args,
|
|
464
|
+
noteOptionsFor: operations.noteOptionsFor,
|
|
465
|
+
newHistory: batch.newHistory,
|
|
466
|
+
batchResults: batch.batchResults,
|
|
513
467
|
});
|
|
514
|
-
|
|
468
|
+
await judgeLanded(scope, deps.findingsJudge, execution.executed && !execution.denied && !skillRoute.skillRejected, { toolName: tc.name, result: delivery.resultStr, toolCallId: tc.id }, batch.iteration, operations.turnStampOf(scope));
|
|
469
|
+
activateLandedSkill(scope, deps, { tc, outcome, execution, skillRoute, callArguments });
|
|
470
|
+
if (execution.haltContext) {
|
|
471
|
+
haltLandedCall(scope, {
|
|
472
|
+
haltContext: execution.haltContext,
|
|
473
|
+
emitSecurity,
|
|
474
|
+
tc,
|
|
475
|
+
newHistory: batch.newHistory,
|
|
476
|
+
iteration: batch.iteration,
|
|
477
|
+
callArguments,
|
|
478
|
+
});
|
|
479
|
+
return { kind: 'halted' };
|
|
480
|
+
}
|
|
481
|
+
return { kind: 'landed' };
|
|
482
|
+
}
|
|
483
|
+
catch (error) {
|
|
484
|
+
execution.resultFinalizer?.withheld();
|
|
485
|
+
throw error;
|
|
486
|
+
}
|
|
487
|
+
finally {
|
|
488
|
+
execution.resultFinalizer?.close();
|
|
515
489
|
}
|
|
516
|
-
return { kind: 'landed' };
|
|
517
490
|
};
|
|
518
491
|
return dispatchCall;
|
|
519
492
|
}
|