agentfootprint 13.0.0 → 14.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +1 -1
- package/CAPABILITIES.md +2 -2
- package/README.md +7 -3
- package/ai-instructions/claude-code/SKILL.md +1 -1
- package/ai-instructions/setup.sh +0 -0
- package/bin/agentfootprint-index.mjs +0 -0
- package/bin/agentfootprint-lint-tools.mjs +0 -0
- package/dist/adapters/observability/auditShapes.js +9 -31
- package/dist/adapters/observability/auditShapes.js.map +1 -1
- package/dist/bridge/eventMeta.js +1 -1
- package/dist/bridge/eventMeta.js.map +1 -1
- package/dist/context-bisect/ablation.js +1 -1
- package/dist/context-bisect/ablation.js.map +1 -1
- package/dist/context-bisect/arms/probe.js +1 -1
- package/dist/context-bisect/arms/probe.js.map +1 -1
- package/dist/context-bisect/restoration.js +1 -1
- package/dist/context-bisect/restoration.js.map +1 -1
- package/dist/core/Agent.js +799 -1144
- package/dist/core/Agent.js.map +1 -1
- package/dist/core/LLMCall.js +47 -86
- package/dist/core/LLMCall.js.map +1 -1
- package/dist/core/RunnerBase.js +139 -213
- package/dist/core/RunnerBase.js.map +1 -1
- package/dist/core/agent/arguments/answerRows.js +85 -0
- package/dist/core/agent/arguments/answerRows.js.map +1 -0
- package/dist/core/agent/arguments/ask.js +28 -91
- package/dist/core/agent/arguments/ask.js.map +1 -1
- package/dist/core/agent/arguments/dispatch.js +26 -9
- package/dist/core/agent/arguments/dispatch.js.map +1 -1
- package/dist/core/agent/arguments/kept.js +1 -1
- package/dist/core/agent/arguments/partialWindow.js +1 -1
- package/dist/core/agent/arguments/partialWindow.js.map +1 -1
- package/dist/core/agent/arguments/pendingPrivateAsk.js +123 -0
- package/dist/core/agent/arguments/pendingPrivateAsk.js.map +1 -0
- package/dist/core/agent/arguments/privateAnswers.js +213 -0
- package/dist/core/agent/arguments/privateAnswers.js.map +1 -0
- package/dist/core/agent/arguments/resolutionRows.js +175 -0
- package/dist/core/agent/arguments/resolutionRows.js.map +1 -0
- package/dist/core/agent/arguments/resolve.js +8 -144
- package/dist/core/agent/arguments/resolve.js.map +1 -1
- package/dist/core/agent/arguments/serve.js +3 -13
- package/dist/core/agent/arguments/serve.js.map +1 -1
- package/dist/core/agent/arguments/subflow.js +7 -1
- package/dist/core/agent/arguments/subflow.js.map +1 -1
- package/dist/core/agent/buildAgentChart.js.map +1 -1
- package/dist/core/agent/buildToolRegistry.js +1 -1
- package/dist/core/agent/callerIdentity.js +21 -106
- package/dist/core/agent/callerIdentity.js.map +1 -1
- package/dist/core/agent/chartContract.js +4 -0
- package/dist/core/agent/chartContract.js.map +1 -0
- package/dist/core/agent/checkpointDomain.js +59 -0
- package/dist/core/agent/checkpointDomain.js.map +1 -0
- package/dist/core/agent/componentObservers.js +134 -0
- package/dist/core/agent/componentObservers.js.map +1 -0
- package/dist/core/agent/componentResources.js +114 -0
- package/dist/core/agent/componentResources.js.map +1 -0
- package/dist/core/agent/evidence/evidenceIndex.js +1 -1
- package/dist/core/agent/evidence/evidenceIndex.js.map +1 -1
- package/dist/core/agent/evidence/frames.js +2 -1
- package/dist/core/agent/evidence/frames.js.map +1 -1
- package/dist/core/agent/evidence/servedJson.js +1 -1
- package/dist/core/agent/findings/contingent.js +1 -1
- package/dist/core/agent/findings/judge.js +1 -1
- package/dist/core/agent/findings/unsettled.js +3 -3
- package/dist/core/agent/honesty/inputsMountContract.js +3 -0
- package/dist/core/agent/honesty/inputsMountContract.js.map +1 -0
- package/dist/core/agent/honesty/mounts.js +42 -30
- package/dist/core/agent/honesty/mounts.js.map +1 -1
- package/dist/core/agent/hostTurn.js +40 -0
- package/dist/core/agent/hostTurn.js.map +1 -0
- package/dist/core/agent/pauseOwnership.js +105 -0
- package/dist/core/agent/pauseOwnership.js.map +1 -0
- package/dist/core/agent/presentTool.js +1 -1
- package/dist/core/agent/resultCeiling.js +1 -1
- package/dist/core/agent/resumeAnswer.js +49 -0
- package/dist/core/agent/resumeAnswer.js.map +1 -0
- package/dist/core/agent/resumeCheckpoint.js +40 -0
- package/dist/core/agent/resumeCheckpoint.js.map +1 -0
- package/dist/core/agent/resumeError.js +15 -0
- package/dist/core/agent/resumeError.js.map +1 -0
- package/dist/core/agent/run/clocks.js +88 -0
- package/dist/core/agent/run/clocks.js.map +1 -0
- package/dist/core/agent/run/commitRunRedaction.js +16 -0
- package/dist/core/agent/run/commitRunRedaction.js.map +1 -0
- package/dist/core/agent/run/eventStageIds.js +44 -0
- package/dist/core/agent/run/eventStageIds.js.map +1 -0
- package/dist/core/agent/run/injectionDelivery.js +30 -0
- package/dist/core/agent/run/injectionDelivery.js.map +1 -0
- package/dist/core/agent/run/ledgerFacts.js +36 -0
- package/dist/core/agent/run/ledgerFacts.js.map +1 -0
- package/dist/core/agent/run/resumeRedaction.js +41 -0
- package/dist/core/agent/run/resumeRedaction.js.map +1 -0
- package/dist/core/agent/run/withoutTime.js +17 -0
- package/dist/core/agent/run/withoutTime.js.map +1 -0
- package/dist/core/agent/runValues.js +18 -0
- package/dist/core/agent/runValues.js.map +1 -0
- package/dist/core/agent/scripts/rows.js +1 -1
- package/dist/core/agent/selfCallNotice.js +1 -1
- package/dist/core/agent/selfCallNotice.js.map +1 -1
- package/dist/core/agent/stages/argumentAsk.js +39 -10
- package/dist/core/agent/stages/argumentAsk.js.map +1 -1
- package/dist/core/agent/stages/argumentParties.js +54 -0
- package/dist/core/agent/stages/argumentParties.js.map +1 -0
- package/dist/core/agent/stages/batchParties.js +88 -0
- package/dist/core/agent/stages/batchParties.js.map +1 -0
- package/dist/core/agent/stages/callLLM.js +3 -3
- package/dist/core/agent/stages/callLLM.js.map +1 -1
- package/dist/core/agent/stages/finalStageContract.js +4 -0
- package/dist/core/agent/stages/finalStageContract.js.map +1 -0
- package/dist/core/agent/stages/prepareFinal.js +10 -1
- package/dist/core/agent/stages/prepareFinal.js.map +1 -1
- package/dist/core/agent/stages/searchCoverage.js +1 -1
- package/dist/core/agent/stages/seed.js +16 -32
- package/dist/core/agent/stages/seed.js.map +1 -1
- package/dist/core/agent/stages/servedParties.js +220 -0
- package/dist/core/agent/stages/servedParties.js.map +1 -0
- package/dist/core/agent/stages/timeLayer.js +2 -2
- package/dist/core/agent/stages/toolCallShape.js +22 -0
- package/dist/core/agent/stages/toolCallShape.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/access/argumentGate.js +48 -0
- package/dist/core/agent/stages/toolCalls/access/argumentGate.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/access/argumentValidation.js +33 -0
- package/dist/core/agent/stages/toolCalls/access/argumentValidation.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/access/bindings.js +98 -0
- package/dist/core/agent/stages/toolCalls/access/bindings.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/access/callState.js +79 -0
- package/dist/core/agent/stages/toolCalls/access/callState.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/access/capabilityQuestion.js +81 -0
- package/dist/core/agent/stages/toolCalls/access/capabilityQuestion.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/access/checkInAdmission.js +144 -0
- package/dist/core/agent/stages/toolCalls/access/checkInAdmission.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/access/heldAnswer.js +39 -0
- package/dist/core/agent/stages/toolCalls/access/heldAnswer.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/access/middlewareAdmission.js +141 -0
- package/dist/core/agent/stages/toolCalls/access/middlewareAdmission.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/access/toolPermission.js +103 -0
- package/dist/core/agent/stages/toolCalls/access/toolPermission.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/batch/completion.js +28 -0
- package/dist/core/agent/stages/toolCalls/batch/completion.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/batch/dispatchContext.js +137 -0
- package/dist/core/agent/stages/toolCalls/batch/dispatchContext.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/batch/execute.js +181 -0
- package/dist/core/agent/stages/toolCalls/batch/execute.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/batch/findingsAdmission.js +52 -0
- package/dist/core/agent/stages/toolCalls/batch/findingsAdmission.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/batch/inputResolutions.js +22 -0
- package/dist/core/agent/stages/toolCalls/batch/inputResolutions.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/batch/paused.js +93 -0
- package/dist/core/agent/stages/toolCalls/batch/paused.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/batch/refusal.js +36 -0
- package/dist/core/agent/stages/toolCalls/batch/refusal.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/batch/settle.js +69 -0
- package/dist/core/agent/stages/toolCalls/batch/settle.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/batch/settlementOperations.js +107 -0
- package/dist/core/agent/stages/toolCalls/batch/settlementOperations.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/compose.js +353 -0
- package/dist/core/agent/stages/toolCalls/compose.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/contracts/access.js +3 -0
- package/dist/core/agent/stages/toolCalls/contracts/access.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/contracts/artifacts.js +3 -0
- package/dist/core/agent/stages/toolCalls/contracts/artifacts.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/contracts/batchCall.js +3 -0
- package/dist/core/agent/stages/toolCalls/contracts/batchCall.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/contracts/callCells.js +3 -0
- package/dist/core/agent/stages/toolCalls/contracts/callCells.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/contracts/callFacts.js +3 -0
- package/dist/core/agent/stages/toolCalls/contracts/callFacts.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/contracts/catalog.js +3 -0
- package/dist/core/agent/stages/toolCalls/contracts/catalog.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/contracts/dispatchBatch.js +3 -0
- package/dist/core/agent/stages/toolCalls/contracts/dispatchBatch.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/contracts/dispatchCall.js +3 -0
- package/dist/core/agent/stages/toolCalls/contracts/dispatchCall.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/contracts/evidence.js +3 -0
- package/dist/core/agent/stages/toolCalls/contracts/evidence.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/contracts/handlerDeps.js +3 -0
- package/dist/core/agent/stages/toolCalls/contracts/handlerDeps.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/contracts/inputsDispatch.js +10 -0
- package/dist/core/agent/stages/toolCalls/contracts/inputsDispatch.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/contracts/invocationInputs.js +3 -0
- package/dist/core/agent/stages/toolCalls/contracts/invocationInputs.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/contracts/observation.js +3 -0
- package/dist/core/agent/stages/toolCalls/contracts/observation.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/contracts/operations/artifacts.js +3 -0
- package/dist/core/agent/stages/toolCalls/contracts/operations/artifacts.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/contracts/operations/catalog.js +3 -0
- package/dist/core/agent/stages/toolCalls/contracts/operations/catalog.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/contracts/operations/context.js +3 -0
- package/dist/core/agent/stages/toolCalls/contracts/operations/context.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/contracts/operations/coverage.js +3 -0
- package/dist/core/agent/stages/toolCalls/contracts/operations/coverage.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/contracts/operations/credentials.js +3 -0
- package/dist/core/agent/stages/toolCalls/contracts/operations/credentials.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/contracts/operations/effects.js +3 -0
- package/dist/core/agent/stages/toolCalls/contracts/operations/effects.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/contracts/operations/integrity.js +3 -0
- package/dist/core/agent/stages/toolCalls/contracts/operations/integrity.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/contracts/operations/limits.js +3 -0
- package/dist/core/agent/stages/toolCalls/contracts/operations/limits.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/contracts/operations/middleware.js +3 -0
- package/dist/core/agent/stages/toolCalls/contracts/operations/middleware.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/contracts/operations/observations.js +3 -0
- package/dist/core/agent/stages/toolCalls/contracts/operations/observations.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/contracts/operations/progress.js +3 -0
- package/dist/core/agent/stages/toolCalls/contracts/operations/progress.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/contracts/operations/resources.js +3 -0
- package/dist/core/agent/stages/toolCalls/contracts/operations/resources.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/contracts/operations/resumedInvocation.js +3 -0
- package/dist/core/agent/stages/toolCalls/contracts/operations/resumedInvocation.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/contracts/operations/scripts.js +3 -0
- package/dist/core/agent/stages/toolCalls/contracts/operations/scripts.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/contracts/operations/semantics.js +3 -0
- package/dist/core/agent/stages/toolCalls/contracts/operations/semantics.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/contracts/operations/settlement.js +3 -0
- package/dist/core/agent/stages/toolCalls/contracts/operations/settlement.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/contracts/operations/steps.js +3 -0
- package/dist/core/agent/stages/toolCalls/contracts/operations/steps.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/contracts/resources.js +3 -0
- package/dist/core/agent/stages/toolCalls/contracts/resources.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/contracts/results.js +3 -0
- package/dist/core/agent/stages/toolCalls/contracts/results.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/contracts/resumeFrames.js +3 -0
- package/dist/core/agent/stages/toolCalls/contracts/resumeFrames.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/contracts/routing.js +3 -0
- package/dist/core/agent/stages/toolCalls/contracts/routing.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/decorators/limitsOperations.js +84 -0
- package/dist/core/agent/stages/toolCalls/decorators/limitsOperations.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/decorators/middlewareOperations.js +87 -0
- package/dist/core/agent/stages/toolCalls/decorators/middlewareOperations.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/decorators/reportingCredentials.js +53 -0
- package/dist/core/agent/stages/toolCalls/decorators/reportingCredentials.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/evidence/coverageOperations.js +236 -0
- package/dist/core/agent/stages/toolCalls/evidence/coverageOperations.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/evidence/integrityOperations.js +141 -0
- package/dist/core/agent/stages/toolCalls/evidence/integrityOperations.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/evidence/judgeLanded.js +59 -0
- package/dist/core/agent/stages/toolCalls/evidence/judgeLanded.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/evidence/madeInRun.js +7 -0
- package/dist/core/agent/stages/toolCalls/evidence/madeInRun.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/evidence/producerCorpus.js +38 -0
- package/dist/core/agent/stages/toolCalls/evidence/producerCorpus.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/evidence/scriptsOperations.js +160 -0
- package/dist/core/agent/stages/toolCalls/evidence/scriptsOperations.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/evidence/semanticsOperations.js +94 -0
- package/dist/core/agent/stages/toolCalls/evidence/semanticsOperations.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/evidence/sourceClock.js +22 -0
- package/dist/core/agent/stages/toolCalls/evidence/sourceClock.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/evidence/towers.js +42 -0
- package/dist/core/agent/stages/toolCalls/evidence/towers.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/execution/artifactsOperations.js +265 -0
- package/dist/core/agent/stages/toolCalls/execution/artifactsOperations.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/execution/callStart.js +107 -0
- package/dist/core/agent/stages/toolCalls/execution/callStart.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/execution/catalogOperations.js +200 -0
- package/dist/core/agent/stages/toolCalls/execution/catalogOperations.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/execution/contextOperations.js +190 -0
- package/dist/core/agent/stages/toolCalls/execution/contextOperations.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/execution/credentialAdmission.js +128 -0
- package/dist/core/agent/stages/toolCalls/execution/credentialAdmission.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/execution/credentialsOperations.js +15 -0
- package/dist/core/agent/stages/toolCalls/execution/credentialsOperations.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/execution/deliveredResult.js +172 -0
- package/dist/core/agent/stages/toolCalls/execution/deliveredResult.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/execution/dispatchCall.js +515 -0
- package/dist/core/agent/stages/toolCalls/execution/dispatchCall.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/execution/initialInvocation.js +368 -0
- package/dist/core/agent/stages/toolCalls/execution/initialInvocation.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/execution/resourcesOperations.js +90 -0
- package/dist/core/agent/stages/toolCalls/execution/resourcesOperations.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/execution/resumedInvocation.js +429 -0
- package/dist/core/agent/stages/toolCalls/execution/resumedInvocation.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/execution/wantedArguments.js +18 -0
- package/dist/core/agent/stages/toolCalls/execution/wantedArguments.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/helpers/dedupeIds.js +10 -0
- package/dist/core/agent/stages/toolCalls/helpers/dedupeIds.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/helpers/dispatchRefusals.js +83 -0
- package/dist/core/agent/stages/toolCalls/helpers/dispatchRefusals.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/helpers/mountedCursor.js +46 -0
- package/dist/core/agent/stages/toolCalls/helpers/mountedCursor.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/helpers/periodWarnings.js +60 -0
- package/dist/core/agent/stages/toolCalls/helpers/periodWarnings.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/helpers/readSkillRefusal.js +141 -0
- package/dist/core/agent/stages/toolCalls/helpers/readSkillRefusal.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/helpers/sourceNote.js +10 -0
- package/dist/core/agent/stages/toolCalls/helpers/sourceNote.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/helpers/unscopedRun.js +15 -0
- package/dist/core/agent/stages/toolCalls/helpers/unscopedRun.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/index.js +33 -0
- package/dist/core/agent/stages/toolCalls/index.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/observation/callSettlement.js +48 -0
- package/dist/core/agent/stages/toolCalls/observation/callSettlement.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/observation/observationsOperations.js +61 -0
- package/dist/core/agent/stages/toolCalls/observation/observationsOperations.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/observation/progressOperations.js +32 -0
- package/dist/core/agent/stages/toolCalls/observation/progressOperations.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/resume/ask.js +427 -0
- package/dist/core/agent/stages/toolCalls/resume/ask.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/resume/checkIn.js +193 -0
- package/dist/core/agent/stages/toolCalls/resume/checkIn.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/resume/credential.js +139 -0
- package/dist/core/agent/stages/toolCalls/resume/credential.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/resume/handler.js +175 -0
- package/dist/core/agent/stages/toolCalls/resume/handler.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/resume/plain.js +144 -0
- package/dist/core/agent/stages/toolCalls/resume/plain.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/routing/effectsOperations.js +264 -0
- package/dist/core/agent/stages/toolCalls/routing/effectsOperations.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/routing/policyHalt.js +40 -0
- package/dist/core/agent/stages/toolCalls/routing/policyHalt.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/routing/readSkillRoute.js +238 -0
- package/dist/core/agent/stages/toolCalls/routing/readSkillRoute.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/routing/skillActivation.js +52 -0
- package/dist/core/agent/stages/toolCalls/routing/skillActivation.js.map +1 -0
- package/dist/core/agent/stages/toolCalls/routing/stepsOperations.js +149 -0
- package/dist/core/agent/stages/toolCalls/routing/stepsOperations.js.map +1 -0
- package/dist/core/agent/stages/toolResolver.js +84 -38
- package/dist/core/agent/stages/toolResolver.js.map +1 -1
- package/dist/core/agent/toolChoice/pick.js +1 -1
- package/dist/core/agent/toolResultCap.js +0 -0
- package/dist/core/agent/types.js +0 -3
- package/dist/core/agent/types.js.map +1 -1
- package/dist/core/agent/window/toolNames.js +3 -3
- package/dist/core/answerConsumption.js +16 -0
- package/dist/core/answerConsumption.js.map +1 -0
- package/dist/core/checkin.js +1 -1
- package/dist/core/codeRunnerTool.js +1 -1
- package/dist/core/consentLedger.js +124 -0
- package/dist/core/consentLedger.js.map +1 -0
- package/dist/core/consentRequest.js +38 -156
- package/dist/core/consentRequest.js.map +1 -1
- package/dist/core/conversation.js +15 -48
- package/dist/core/conversation.js.map +1 -1
- package/dist/core/memberRun.js +2 -1
- package/dist/core/memberRun.js.map +1 -1
- package/dist/core/pause.js +5 -5
- package/dist/core/pauseRecord.js +23 -0
- package/dist/core/pauseRecord.js.map +1 -0
- package/dist/core/runEntry.js +30 -0
- package/dist/core/runEntry.js.map +1 -0
- package/dist/core/runnerCoreValues.js +3 -0
- package/dist/core/runnerCoreValues.js.map +1 -0
- package/dist/core/runnerExecution.js +175 -0
- package/dist/core/runnerExecution.js.map +1 -0
- package/dist/core/runnerLive.js.map +1 -1
- package/dist/core/slots/buildThinkingSubflow.js +2 -2
- package/dist/core/slots/buildThinkingSubflow.js.map +1 -1
- package/dist/core/slots/buildToolsSlot.js +25 -102
- package/dist/core/slots/buildToolsSlot.js.map +1 -1
- package/dist/core/slots/discoverTools.js +99 -0
- package/dist/core/slots/discoverTools.js.map +1 -0
- package/dist/core-flow/Conditional.js +25 -72
- package/dist/core-flow/Conditional.js.map +1 -1
- package/dist/core-flow/Graph.js +63 -120
- package/dist/core-flow/Graph.js.map +1 -1
- package/dist/core-flow/Loop.js +28 -82
- package/dist/core-flow/Loop.js.map +1 -1
- package/dist/core-flow/Parallel.js +58 -148
- package/dist/core-flow/Parallel.js.map +1 -1
- package/dist/core-flow/Sequence.js +25 -73
- package/dist/core-flow/Sequence.js.map +1 -1
- package/dist/core-flow/Workflow.js +24 -72
- package/dist/core-flow/Workflow.js.map +1 -1
- package/dist/esm/adapters/observability/auditShapes.d.ts +5 -31
- package/dist/esm/adapters/observability/auditShapes.js +9 -31
- package/dist/esm/adapters/observability/auditShapes.js.map +1 -1
- package/dist/esm/adapters/observability/otel.d.ts +1 -1
- package/dist/esm/bridge/eventMeta.d.ts +2 -0
- package/dist/esm/bridge/eventMeta.js +1 -1
- package/dist/esm/bridge/eventMeta.js.map +1 -1
- package/dist/esm/context-bisect/ablation.js +1 -1
- package/dist/esm/context-bisect/ablation.js.map +1 -1
- package/dist/esm/context-bisect/arms/probe.js +1 -1
- package/dist/esm/context-bisect/arms/probe.js.map +1 -1
- package/dist/esm/context-bisect/restoration.js +1 -1
- package/dist/esm/context-bisect/restoration.js.map +1 -1
- package/dist/esm/core/Agent.d.ts +18 -121
- package/dist/esm/core/Agent.js +800 -1145
- package/dist/esm/core/Agent.js.map +1 -1
- package/dist/esm/core/LLMCall.d.ts +1 -4
- package/dist/esm/core/LLMCall.js +49 -88
- package/dist/esm/core/LLMCall.js.map +1 -1
- package/dist/esm/core/RunnerBase.d.ts +42 -114
- package/dist/esm/core/RunnerBase.js +140 -210
- package/dist/esm/core/RunnerBase.js.map +1 -1
- package/dist/esm/core/agent/arguments/answerRows.d.ts +26 -0
- package/dist/esm/core/agent/arguments/answerRows.js +78 -0
- package/dist/esm/core/agent/arguments/answerRows.js.map +1 -0
- package/dist/esm/core/agent/arguments/ask.d.ts +5 -11
- package/dist/esm/core/agent/arguments/ask.js +24 -87
- package/dist/esm/core/agent/arguments/ask.js.map +1 -1
- package/dist/esm/core/agent/arguments/dispatch.d.ts +4 -4
- package/dist/esm/core/agent/arguments/dispatch.js +27 -10
- package/dist/esm/core/agent/arguments/dispatch.js.map +1 -1
- package/dist/esm/core/agent/arguments/kept.d.ts +1 -1
- package/dist/esm/core/agent/arguments/kept.js +1 -1
- package/dist/esm/core/agent/arguments/partialWindow.d.ts +2 -1
- package/dist/esm/core/agent/arguments/partialWindow.js +1 -1
- package/dist/esm/core/agent/arguments/partialWindow.js.map +1 -1
- package/dist/esm/core/agent/arguments/pendingPrivateAsk.d.ts +37 -0
- package/dist/esm/core/agent/arguments/pendingPrivateAsk.js +114 -0
- package/dist/esm/core/agent/arguments/pendingPrivateAsk.js.map +1 -0
- package/dist/esm/core/agent/arguments/privateAnswers.d.ts +46 -0
- package/dist/esm/core/agent/arguments/privateAnswers.js +198 -0
- package/dist/esm/core/agent/arguments/privateAnswers.js.map +1 -0
- package/dist/esm/core/agent/arguments/resolutionRows.d.ts +29 -0
- package/dist/esm/core/agent/arguments/resolutionRows.js +171 -0
- package/dist/esm/core/agent/arguments/resolutionRows.js.map +1 -0
- package/dist/esm/core/agent/arguments/resolve.d.ts +2 -13
- package/dist/esm/core/agent/arguments/resolve.js +8 -144
- package/dist/esm/core/agent/arguments/resolve.js.map +1 -1
- package/dist/esm/core/agent/arguments/serve.d.ts +0 -5
- package/dist/esm/core/agent/arguments/serve.js +3 -12
- package/dist/esm/core/agent/arguments/serve.js.map +1 -1
- package/dist/esm/core/agent/arguments/subflow.js +7 -1
- package/dist/esm/core/agent/arguments/subflow.js.map +1 -1
- package/dist/esm/core/agent/buildAgentChart.d.ts +3 -326
- package/dist/esm/core/agent/buildAgentChart.js.map +1 -1
- package/dist/esm/core/agent/buildToolRegistry.d.ts +1 -1
- package/dist/esm/core/agent/buildToolRegistry.js +1 -1
- package/dist/esm/core/agent/callerIdentity.d.ts +9 -64
- package/dist/esm/core/agent/callerIdentity.js +21 -106
- package/dist/esm/core/agent/callerIdentity.js.map +1 -1
- package/dist/esm/core/agent/chartContract.d.ts +327 -0
- package/dist/esm/core/agent/chartContract.js +3 -0
- package/dist/esm/core/agent/chartContract.js.map +1 -0
- package/dist/esm/core/agent/checkpointDomain.d.ts +11 -0
- package/dist/esm/core/agent/checkpointDomain.js +53 -0
- package/dist/esm/core/agent/checkpointDomain.js.map +1 -0
- package/dist/esm/core/agent/componentObservers.d.ts +14 -0
- package/dist/esm/core/agent/componentObservers.js +129 -0
- package/dist/esm/core/agent/componentObservers.js.map +1 -0
- package/dist/esm/core/agent/componentResources.d.ts +39 -0
- package/dist/esm/core/agent/componentResources.js +110 -0
- package/dist/esm/core/agent/componentResources.js.map +1 -0
- package/dist/esm/core/agent/evidence/evidenceIndex.js +1 -1
- package/dist/esm/core/agent/evidence/evidenceIndex.js.map +1 -1
- package/dist/esm/core/agent/evidence/frames.js +3 -2
- package/dist/esm/core/agent/evidence/frames.js.map +1 -1
- package/dist/esm/core/agent/evidence/servedJson.d.ts +1 -1
- package/dist/esm/core/agent/evidence/servedJson.js +1 -1
- package/dist/esm/core/agent/findings/contingent.d.ts +1 -1
- package/dist/esm/core/agent/findings/contingent.js +1 -1
- package/dist/esm/core/agent/findings/judge.d.ts +1 -1
- package/dist/esm/core/agent/findings/judge.js +1 -1
- package/dist/esm/core/agent/findings/types.d.ts +1 -1
- package/dist/esm/core/agent/findings/unsettled.d.ts +3 -3
- package/dist/esm/core/agent/findings/unsettled.js +3 -3
- package/dist/esm/core/agent/honesty/inputsMountContract.d.ts +66 -0
- package/dist/esm/core/agent/honesty/inputsMountContract.js +2 -0
- package/dist/esm/core/agent/honesty/inputsMountContract.js.map +1 -0
- package/dist/esm/core/agent/honesty/mounts.d.ts +4 -66
- package/dist/esm/core/agent/honesty/mounts.js +42 -30
- package/dist/esm/core/agent/honesty/mounts.js.map +1 -1
- package/dist/esm/core/agent/hostTurn.d.ts +17 -0
- package/dist/esm/core/agent/hostTurn.js +36 -0
- package/dist/esm/core/agent/hostTurn.js.map +1 -0
- package/dist/esm/core/agent/pauseOwnership.d.ts +24 -0
- package/dist/esm/core/agent/pauseOwnership.js +97 -0
- package/dist/esm/core/agent/pauseOwnership.js.map +1 -0
- package/dist/esm/core/agent/presentTool.d.ts +1 -1
- package/dist/esm/core/agent/presentTool.js +1 -1
- package/dist/esm/core/agent/resultCeiling.d.ts +1 -1
- package/dist/esm/core/agent/resultCeiling.js +1 -1
- package/dist/esm/core/agent/resumeAnswer.d.ts +10 -0
- package/dist/esm/core/agent/resumeAnswer.js +43 -0
- package/dist/esm/core/agent/resumeAnswer.js.map +1 -0
- package/dist/esm/core/agent/resumeCheckpoint.d.ts +12 -0
- package/dist/esm/core/agent/resumeCheckpoint.js +34 -0
- package/dist/esm/core/agent/resumeCheckpoint.js.map +1 -0
- package/dist/esm/core/agent/resumeError.d.ts +8 -0
- package/dist/esm/core/agent/resumeError.js +11 -0
- package/dist/esm/core/agent/resumeError.js.map +1 -0
- package/dist/esm/core/agent/run/clocks.d.ts +44 -0
- package/dist/esm/core/agent/run/clocks.js +81 -0
- package/dist/esm/core/agent/run/clocks.js.map +1 -0
- package/dist/esm/core/agent/run/commitRunRedaction.d.ts +4 -0
- package/dist/esm/core/agent/run/commitRunRedaction.js +12 -0
- package/dist/esm/core/agent/run/commitRunRedaction.js.map +1 -0
- package/dist/esm/core/agent/run/eventStageIds.d.ts +40 -0
- package/dist/esm/core/agent/run/eventStageIds.js +41 -0
- package/dist/esm/core/agent/run/eventStageIds.js.map +1 -0
- package/dist/esm/core/agent/run/injectionDelivery.d.ts +4 -0
- package/dist/esm/core/agent/run/injectionDelivery.js +26 -0
- package/dist/esm/core/agent/run/injectionDelivery.js.map +1 -0
- package/dist/esm/core/agent/run/ledgerFacts.d.ts +8 -0
- package/dist/esm/core/agent/run/ledgerFacts.js +31 -0
- package/dist/esm/core/agent/run/ledgerFacts.js.map +1 -0
- package/dist/esm/core/agent/run/resumeRedaction.d.ts +6 -0
- package/dist/esm/core/agent/run/resumeRedaction.js +36 -0
- package/dist/esm/core/agent/run/resumeRedaction.js.map +1 -0
- package/dist/esm/core/agent/run/withoutTime.d.ts +8 -0
- package/dist/esm/core/agent/run/withoutTime.js +13 -0
- package/dist/esm/core/agent/run/withoutTime.js.map +1 -0
- package/dist/esm/core/agent/runValues.d.ts +71 -0
- package/dist/esm/core/agent/runValues.js +14 -0
- package/dist/esm/core/agent/runValues.js.map +1 -0
- package/dist/esm/core/agent/scripts/rows.d.ts +1 -1
- package/dist/esm/core/agent/scripts/rows.js +1 -1
- package/dist/esm/core/agent/scripts/types.d.ts +1 -1
- package/dist/esm/core/agent/selfCallNotice.js +1 -1
- package/dist/esm/core/agent/selfCallNotice.js.map +1 -1
- package/dist/esm/core/agent/stages/argumentAsk.d.ts +7 -1
- package/dist/esm/core/agent/stages/argumentAsk.js +39 -10
- package/dist/esm/core/agent/stages/argumentAsk.js.map +1 -1
- package/dist/esm/core/agent/stages/argumentParties.d.ts +3 -0
- package/dist/esm/core/agent/stages/argumentParties.js +50 -0
- package/dist/esm/core/agent/stages/argumentParties.js.map +1 -0
- package/dist/esm/core/agent/stages/batchParties.d.ts +21 -0
- package/dist/esm/core/agent/stages/batchParties.js +81 -0
- package/dist/esm/core/agent/stages/batchParties.js.map +1 -0
- package/dist/esm/core/agent/stages/callLLM.js +3 -3
- package/dist/esm/core/agent/stages/callLLM.js.map +1 -1
- package/dist/esm/core/agent/stages/finalStageContract.d.ts +45 -0
- package/dist/esm/core/agent/stages/finalStageContract.js +3 -0
- package/dist/esm/core/agent/stages/finalStageContract.js.map +1 -0
- package/dist/esm/core/agent/stages/prepareFinal.d.ts +2 -45
- package/dist/esm/core/agent/stages/prepareFinal.js +9 -0
- package/dist/esm/core/agent/stages/prepareFinal.js.map +1 -1
- package/dist/esm/core/agent/stages/searchCoverage.d.ts +1 -1
- package/dist/esm/core/agent/stages/searchCoverage.js +1 -1
- package/dist/esm/core/agent/stages/seed.js +15 -31
- package/dist/esm/core/agent/stages/seed.js.map +1 -1
- package/dist/esm/core/agent/stages/servedParties.d.ts +39 -0
- package/dist/esm/core/agent/stages/servedParties.js +214 -0
- package/dist/esm/core/agent/stages/servedParties.js.map +1 -0
- package/dist/esm/core/agent/stages/timeLayer.d.ts +3 -3
- package/dist/esm/core/agent/stages/timeLayer.js +2 -2
- package/dist/esm/core/agent/stages/toolCallShape.d.ts +7 -0
- package/dist/esm/core/agent/stages/toolCallShape.js +18 -0
- package/dist/esm/core/agent/stages/toolCallShape.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/access/argumentGate.d.ts +21 -0
- package/dist/esm/core/agent/stages/toolCalls/access/argumentGate.js +44 -0
- package/dist/esm/core/agent/stages/toolCalls/access/argumentGate.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/access/argumentValidation.d.ts +10 -0
- package/dist/esm/core/agent/stages/toolCalls/access/argumentValidation.js +29 -0
- package/dist/esm/core/agent/stages/toolCalls/access/argumentValidation.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/access/bindings.d.ts +61 -0
- package/dist/esm/core/agent/stages/toolCalls/access/bindings.js +88 -0
- package/dist/esm/core/agent/stages/toolCalls/access/bindings.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/access/callState.d.ts +14 -0
- package/dist/esm/core/agent/stages/toolCalls/access/callState.js +75 -0
- package/dist/esm/core/agent/stages/toolCalls/access/callState.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/access/capabilityQuestion.d.ts +28 -0
- package/dist/esm/core/agent/stages/toolCalls/access/capabilityQuestion.js +77 -0
- package/dist/esm/core/agent/stages/toolCalls/access/capabilityQuestion.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/access/checkInAdmission.d.ts +44 -0
- package/dist/esm/core/agent/stages/toolCalls/access/checkInAdmission.js +140 -0
- package/dist/esm/core/agent/stages/toolCalls/access/checkInAdmission.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/access/heldAnswer.d.ts +8 -0
- package/dist/esm/core/agent/stages/toolCalls/access/heldAnswer.js +35 -0
- package/dist/esm/core/agent/stages/toolCalls/access/heldAnswer.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/access/middlewareAdmission.d.ts +50 -0
- package/dist/esm/core/agent/stages/toolCalls/access/middlewareAdmission.js +137 -0
- package/dist/esm/core/agent/stages/toolCalls/access/middlewareAdmission.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/access/toolPermission.d.ts +24 -0
- package/dist/esm/core/agent/stages/toolCalls/access/toolPermission.js +99 -0
- package/dist/esm/core/agent/stages/toolCalls/access/toolPermission.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/batch/completion.d.ts +18 -0
- package/dist/esm/core/agent/stages/toolCalls/batch/completion.js +24 -0
- package/dist/esm/core/agent/stages/toolCalls/batch/completion.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/batch/dispatchContext.d.ts +36 -0
- package/dist/esm/core/agent/stages/toolCalls/batch/dispatchContext.js +133 -0
- package/dist/esm/core/agent/stages/toolCalls/batch/dispatchContext.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/batch/execute.d.ts +7 -0
- package/dist/esm/core/agent/stages/toolCalls/batch/execute.js +154 -0
- package/dist/esm/core/agent/stages/toolCalls/batch/execute.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/batch/findingsAdmission.d.ts +18 -0
- package/dist/esm/core/agent/stages/toolCalls/batch/findingsAdmission.js +48 -0
- package/dist/esm/core/agent/stages/toolCalls/batch/findingsAdmission.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/batch/inputResolutions.d.ts +6 -0
- package/dist/esm/core/agent/stages/toolCalls/batch/inputResolutions.js +18 -0
- package/dist/esm/core/agent/stages/toolCalls/batch/inputResolutions.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/batch/paused.d.ts +65 -0
- package/dist/esm/core/agent/stages/toolCalls/batch/paused.js +88 -0
- package/dist/esm/core/agent/stages/toolCalls/batch/paused.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/batch/refusal.d.ts +5 -0
- package/dist/esm/core/agent/stages/toolCalls/batch/refusal.js +32 -0
- package/dist/esm/core/agent/stages/toolCalls/batch/refusal.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/batch/settle.d.ts +66 -0
- package/dist/esm/core/agent/stages/toolCalls/batch/settle.js +63 -0
- package/dist/esm/core/agent/stages/toolCalls/batch/settle.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/batch/settlementOperations.d.ts +17 -0
- package/dist/esm/core/agent/stages/toolCalls/batch/settlementOperations.js +103 -0
- package/dist/esm/core/agent/stages/toolCalls/batch/settlementOperations.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/compose.d.ts +239 -0
- package/dist/esm/core/agent/stages/toolCalls/compose.js +349 -0
- package/dist/esm/core/agent/stages/toolCalls/compose.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/access.d.ts +110 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/access.js +2 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/access.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/artifacts.d.ts +26 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/artifacts.js +2 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/artifacts.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/batchCall.d.ts +8 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/batchCall.js +2 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/batchCall.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/callCells.d.ts +43 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/callCells.js +2 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/callCells.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/callFacts.d.ts +50 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/callFacts.js +2 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/callFacts.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/catalog.d.ts +56 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/catalog.js +2 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/catalog.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/dispatchBatch.d.ts +17 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/dispatchBatch.js +2 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/dispatchBatch.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/dispatchCall.d.ts +14 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/dispatchCall.js +2 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/dispatchCall.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/evidence.d.ts +211 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/evidence.js +2 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/evidence.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/handlerDeps.d.ts +11 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/handlerDeps.js +2 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/handlerDeps.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/inputsDispatch.d.ts +2 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/inputsDispatch.js +9 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/inputsDispatch.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/invocationInputs.d.ts +11 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/invocationInputs.js +2 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/invocationInputs.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/observation.d.ts +24 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/observation.js +2 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/observation.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/operations/artifacts.d.ts +37 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/operations/artifacts.js +2 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/operations/artifacts.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/operations/catalog.d.ts +31 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/operations/catalog.js +2 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/operations/catalog.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/operations/context.d.ts +14 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/operations/context.js +2 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/operations/context.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/operations/coverage.d.ts +23 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/operations/coverage.js +2 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/operations/coverage.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/operations/credentials.d.ts +5 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/operations/credentials.js +2 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/operations/credentials.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/operations/effects.d.ts +14 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/operations/effects.js +2 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/operations/effects.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/operations/integrity.d.ts +16 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/operations/integrity.js +2 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/operations/integrity.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/operations/limits.d.ts +19 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/operations/limits.js +2 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/operations/limits.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/operations/middleware.d.ts +25 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/operations/middleware.js +2 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/operations/middleware.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/operations/observations.d.ts +8 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/operations/observations.js +2 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/operations/observations.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/operations/progress.d.ts +11 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/operations/progress.js +2 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/operations/progress.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/operations/resources.d.ts +12 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/operations/resources.js +2 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/operations/resources.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/operations/resumedInvocation.d.ts +30 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/operations/resumedInvocation.js +2 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/operations/resumedInvocation.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/operations/scripts.d.ts +40 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/operations/scripts.js +2 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/operations/scripts.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/operations/semantics.d.ts +10 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/operations/semantics.js +2 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/operations/semantics.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/operations/settlement.d.ts +13 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/operations/settlement.js +2 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/operations/settlement.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/operations/steps.d.ts +26 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/operations/steps.js +2 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/operations/steps.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/resources.d.ts +67 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/resources.js +2 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/resources.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/results.d.ts +26 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/results.js +2 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/results.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/resumeFrames.d.ts +14 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/resumeFrames.js +2 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/resumeFrames.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/routing.d.ts +114 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/routing.js +2 -0
- package/dist/esm/core/agent/stages/toolCalls/contracts/routing.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/decorators/limitsOperations.d.ts +4 -0
- package/dist/esm/core/agent/stages/toolCalls/decorators/limitsOperations.js +80 -0
- package/dist/esm/core/agent/stages/toolCalls/decorators/limitsOperations.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/decorators/middlewareOperations.d.ts +4 -0
- package/dist/esm/core/agent/stages/toolCalls/decorators/middlewareOperations.js +83 -0
- package/dist/esm/core/agent/stages/toolCalls/decorators/middlewareOperations.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/decorators/reportingCredentials.d.ts +29 -0
- package/dist/esm/core/agent/stages/toolCalls/decorators/reportingCredentials.js +48 -0
- package/dist/esm/core/agent/stages/toolCalls/decorators/reportingCredentials.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/evidence/coverageOperations.d.ts +9 -0
- package/dist/esm/core/agent/stages/toolCalls/evidence/coverageOperations.js +232 -0
- package/dist/esm/core/agent/stages/toolCalls/evidence/coverageOperations.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/evidence/integrityOperations.d.ts +4 -0
- package/dist/esm/core/agent/stages/toolCalls/evidence/integrityOperations.js +137 -0
- package/dist/esm/core/agent/stages/toolCalls/evidence/integrityOperations.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/evidence/judgeLanded.d.ts +29 -0
- package/dist/esm/core/agent/stages/toolCalls/evidence/judgeLanded.js +32 -0
- package/dist/esm/core/agent/stages/toolCalls/evidence/judgeLanded.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/evidence/madeInRun.d.ts +6 -0
- package/dist/esm/core/agent/stages/toolCalls/evidence/madeInRun.js +3 -0
- package/dist/esm/core/agent/stages/toolCalls/evidence/madeInRun.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/evidence/producerCorpus.d.ts +22 -0
- package/dist/esm/core/agent/stages/toolCalls/evidence/producerCorpus.js +34 -0
- package/dist/esm/core/agent/stages/toolCalls/evidence/producerCorpus.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/evidence/scriptsOperations.d.ts +11 -0
- package/dist/esm/core/agent/stages/toolCalls/evidence/scriptsOperations.js +156 -0
- package/dist/esm/core/agent/stages/toolCalls/evidence/scriptsOperations.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/evidence/semanticsOperations.d.ts +4 -0
- package/dist/esm/core/agent/stages/toolCalls/evidence/semanticsOperations.js +90 -0
- package/dist/esm/core/agent/stages/toolCalls/evidence/semanticsOperations.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/evidence/sourceClock.d.ts +11 -0
- package/dist/esm/core/agent/stages/toolCalls/evidence/sourceClock.js +18 -0
- package/dist/esm/core/agent/stages/toolCalls/evidence/sourceClock.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/evidence/towers.d.ts +18 -0
- package/dist/esm/core/agent/stages/toolCalls/evidence/towers.js +38 -0
- package/dist/esm/core/agent/stages/toolCalls/evidence/towers.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/execution/artifactsOperations.d.ts +12 -0
- package/dist/esm/core/agent/stages/toolCalls/execution/artifactsOperations.js +261 -0
- package/dist/esm/core/agent/stages/toolCalls/execution/artifactsOperations.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/execution/callStart.d.ts +35 -0
- package/dist/esm/core/agent/stages/toolCalls/execution/callStart.js +103 -0
- package/dist/esm/core/agent/stages/toolCalls/execution/callStart.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/execution/catalogOperations.d.ts +17 -0
- package/dist/esm/core/agent/stages/toolCalls/execution/catalogOperations.js +173 -0
- package/dist/esm/core/agent/stages/toolCalls/execution/catalogOperations.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/execution/contextOperations.d.ts +15 -0
- package/dist/esm/core/agent/stages/toolCalls/execution/contextOperations.js +186 -0
- package/dist/esm/core/agent/stages/toolCalls/execution/contextOperations.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/execution/credentialAdmission.d.ts +48 -0
- package/dist/esm/core/agent/stages/toolCalls/execution/credentialAdmission.js +124 -0
- package/dist/esm/core/agent/stages/toolCalls/execution/credentialAdmission.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/execution/credentialsOperations.d.ts +9 -0
- package/dist/esm/core/agent/stages/toolCalls/execution/credentialsOperations.js +11 -0
- package/dist/esm/core/agent/stages/toolCalls/execution/credentialsOperations.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/execution/deliveredResult.d.ts +40 -0
- package/dist/esm/core/agent/stages/toolCalls/execution/deliveredResult.js +168 -0
- package/dist/esm/core/agent/stages/toolCalls/execution/deliveredResult.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/execution/dispatchCall.d.ts +5 -0
- package/dist/esm/core/agent/stages/toolCalls/execution/dispatchCall.js +511 -0
- package/dist/esm/core/agent/stages/toolCalls/execution/dispatchCall.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/execution/initialInvocation.d.ts +70 -0
- package/dist/esm/core/agent/stages/toolCalls/execution/initialInvocation.js +341 -0
- package/dist/esm/core/agent/stages/toolCalls/execution/initialInvocation.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/execution/resourcesOperations.d.ts +9 -0
- package/dist/esm/core/agent/stages/toolCalls/execution/resourcesOperations.js +86 -0
- package/dist/esm/core/agent/stages/toolCalls/execution/resourcesOperations.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/execution/resumedInvocation.d.ts +42 -0
- package/dist/esm/core/agent/stages/toolCalls/execution/resumedInvocation.js +402 -0
- package/dist/esm/core/agent/stages/toolCalls/execution/resumedInvocation.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/execution/wantedArguments.d.ts +19 -0
- package/dist/esm/core/agent/stages/toolCalls/execution/wantedArguments.js +14 -0
- package/dist/esm/core/agent/stages/toolCalls/execution/wantedArguments.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/helpers/dedupeIds.d.ts +3 -0
- package/dist/esm/core/agent/stages/toolCalls/helpers/dedupeIds.js +6 -0
- package/dist/esm/core/agent/stages/toolCalls/helpers/dedupeIds.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/helpers/dispatchRefusals.d.ts +61 -0
- package/dist/esm/core/agent/stages/toolCalls/helpers/dispatchRefusals.js +78 -0
- package/dist/esm/core/agent/stages/toolCalls/helpers/dispatchRefusals.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/helpers/mountedCursor.d.ts +41 -0
- package/dist/esm/core/agent/stages/toolCalls/helpers/mountedCursor.js +42 -0
- package/dist/esm/core/agent/stages/toolCalls/helpers/mountedCursor.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/helpers/periodWarnings.d.ts +23 -0
- package/dist/esm/core/agent/stages/toolCalls/helpers/periodWarnings.js +54 -0
- package/dist/esm/core/agent/stages/toolCalls/helpers/periodWarnings.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/helpers/readSkillRefusal.d.ts +87 -0
- package/dist/esm/core/agent/stages/toolCalls/helpers/readSkillRefusal.js +137 -0
- package/dist/esm/core/agent/stages/toolCalls/helpers/readSkillRefusal.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/helpers/sourceNote.d.ts +8 -0
- package/dist/esm/core/agent/stages/toolCalls/helpers/sourceNote.js +7 -0
- package/dist/esm/core/agent/stages/toolCalls/helpers/sourceNote.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/helpers/unscopedRun.d.ts +11 -0
- package/dist/esm/core/agent/stages/toolCalls/helpers/unscopedRun.js +12 -0
- package/dist/esm/core/agent/stages/toolCalls/helpers/unscopedRun.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/index.d.ts +14 -0
- package/dist/esm/core/agent/stages/toolCalls/index.js +21 -0
- package/dist/esm/core/agent/stages/toolCalls/index.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/observation/callSettlement.d.ts +29 -0
- package/dist/esm/core/agent/stages/toolCalls/observation/callSettlement.js +44 -0
- package/dist/esm/core/agent/stages/toolCalls/observation/callSettlement.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/observation/observationsOperations.d.ts +4 -0
- package/dist/esm/core/agent/stages/toolCalls/observation/observationsOperations.js +57 -0
- package/dist/esm/core/agent/stages/toolCalls/observation/observationsOperations.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/observation/progressOperations.d.ts +7 -0
- package/dist/esm/core/agent/stages/toolCalls/observation/progressOperations.js +28 -0
- package/dist/esm/core/agent/stages/toolCalls/observation/progressOperations.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/resume/ask.d.ts +44 -0
- package/dist/esm/core/agent/stages/toolCalls/resume/ask.js +400 -0
- package/dist/esm/core/agent/stages/toolCalls/resume/ask.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/resume/checkIn.d.ts +39 -0
- package/dist/esm/core/agent/stages/toolCalls/resume/checkIn.js +189 -0
- package/dist/esm/core/agent/stages/toolCalls/resume/checkIn.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/resume/credential.d.ts +37 -0
- package/dist/esm/core/agent/stages/toolCalls/resume/credential.js +135 -0
- package/dist/esm/core/agent/stages/toolCalls/resume/credential.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/resume/handler.d.ts +6 -0
- package/dist/esm/core/agent/stages/toolCalls/resume/handler.js +148 -0
- package/dist/esm/core/agent/stages/toolCalls/resume/handler.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/resume/plain.d.ts +32 -0
- package/dist/esm/core/agent/stages/toolCalls/resume/plain.js +140 -0
- package/dist/esm/core/agent/stages/toolCalls/resume/plain.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/routing/effectsOperations.d.ts +4 -0
- package/dist/esm/core/agent/stages/toolCalls/routing/effectsOperations.js +260 -0
- package/dist/esm/core/agent/stages/toolCalls/routing/effectsOperations.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/routing/policyHalt.d.ts +17 -0
- package/dist/esm/core/agent/stages/toolCalls/routing/policyHalt.js +36 -0
- package/dist/esm/core/agent/stages/toolCalls/routing/policyHalt.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/routing/readSkillRoute.d.ts +20 -0
- package/dist/esm/core/agent/stages/toolCalls/routing/readSkillRoute.js +234 -0
- package/dist/esm/core/agent/stages/toolCalls/routing/readSkillRoute.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/routing/skillActivation.d.ts +15 -0
- package/dist/esm/core/agent/stages/toolCalls/routing/skillActivation.js +48 -0
- package/dist/esm/core/agent/stages/toolCalls/routing/skillActivation.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls/routing/stepsOperations.d.ts +4 -0
- package/dist/esm/core/agent/stages/toolCalls/routing/stepsOperations.js +145 -0
- package/dist/esm/core/agent/stages/toolCalls/routing/stepsOperations.js.map +1 -0
- package/dist/esm/core/agent/stages/toolResolver.d.ts +3 -2
- package/dist/esm/core/agent/stages/toolResolver.js +84 -38
- package/dist/esm/core/agent/stages/toolResolver.js.map +1 -1
- package/dist/esm/core/agent/toolChoice/pick.d.ts +1 -1
- package/dist/esm/core/agent/toolChoice/pick.js +1 -1
- package/dist/esm/core/agent/toolResultCap.d.ts +1 -1
- package/dist/esm/core/agent/toolResultCap.js +0 -0
- package/dist/esm/core/agent/types.d.ts +16 -27
- package/dist/esm/core/agent/types.js +0 -3
- package/dist/esm/core/agent/types.js.map +1 -1
- package/dist/esm/core/agent/window/toolNames.d.ts +3 -3
- package/dist/esm/core/agent/window/toolNames.js +3 -3
- package/dist/esm/core/answerConsumption.d.ts +7 -0
- package/dist/esm/core/answerConsumption.js +12 -0
- package/dist/esm/core/answerConsumption.js.map +1 -0
- package/dist/esm/core/checkin.d.ts +1 -1
- package/dist/esm/core/checkin.js +1 -1
- package/dist/esm/core/codeRunnerTool.d.ts +1 -1
- package/dist/esm/core/codeRunnerTool.js +1 -1
- package/dist/esm/core/consentLedger.d.ts +21 -0
- package/dist/esm/core/consentLedger.js +116 -0
- package/dist/esm/core/consentLedger.js.map +1 -0
- package/dist/esm/core/consentRequest.d.ts +35 -54
- package/dist/esm/core/consentRequest.js +34 -153
- package/dist/esm/core/consentRequest.js.map +1 -1
- package/dist/esm/core/conversation.d.ts +8 -29
- package/dist/esm/core/conversation.js +14 -47
- package/dist/esm/core/conversation.js.map +1 -1
- package/dist/esm/core/memberRun.d.ts +1 -0
- package/dist/esm/core/memberRun.js +1 -1
- package/dist/esm/core/memberRun.js.map +1 -1
- package/dist/esm/core/pause.d.ts +5 -5
- package/dist/esm/core/pause.js +5 -5
- package/dist/esm/core/pauseRecord.d.ts +13 -0
- package/dist/esm/core/pauseRecord.js +19 -0
- package/dist/esm/core/pauseRecord.js.map +1 -0
- package/dist/esm/core/runEntry.d.ts +8 -0
- package/dist/esm/core/runEntry.js +26 -0
- package/dist/esm/core/runEntry.js.map +1 -0
- package/dist/esm/core/runnerCoreValues.d.ts +16 -0
- package/dist/esm/core/runnerCoreValues.js +2 -0
- package/dist/esm/core/runnerCoreValues.js.map +1 -0
- package/dist/esm/core/runnerExecution.d.ts +71 -0
- package/dist/esm/core/runnerExecution.js +170 -0
- package/dist/esm/core/runnerExecution.js.map +1 -0
- package/dist/esm/core/runnerLive.d.ts +32 -1
- package/dist/esm/core/runnerLive.js.map +1 -1
- package/dist/esm/core/slots/buildThinkingSubflow.d.ts +1 -1
- package/dist/esm/core/slots/buildThinkingSubflow.js +2 -2
- package/dist/esm/core/slots/buildThinkingSubflow.js.map +1 -1
- package/dist/esm/core/slots/buildToolsSlot.d.ts +27 -56
- package/dist/esm/core/slots/buildToolsSlot.js +25 -102
- package/dist/esm/core/slots/buildToolsSlot.js.map +1 -1
- package/dist/esm/core/slots/discoverTools.d.ts +21 -0
- package/dist/esm/core/slots/discoverTools.js +94 -0
- package/dist/esm/core/slots/discoverTools.js.map +1 -0
- package/dist/esm/core-flow/Conditional.d.ts +0 -2
- package/dist/esm/core-flow/Conditional.js +28 -75
- package/dist/esm/core-flow/Conditional.js.map +1 -1
- package/dist/esm/core-flow/Graph.d.ts +18 -23
- package/dist/esm/core-flow/Graph.js +66 -123
- package/dist/esm/core-flow/Graph.js.map +1 -1
- package/dist/esm/core-flow/Loop.d.ts +0 -2
- package/dist/esm/core-flow/Loop.js +29 -83
- package/dist/esm/core-flow/Loop.js.map +1 -1
- package/dist/esm/core-flow/Parallel.d.ts +11 -40
- package/dist/esm/core-flow/Parallel.js +61 -151
- package/dist/esm/core-flow/Parallel.js.map +1 -1
- package/dist/esm/core-flow/Sequence.d.ts +0 -2
- package/dist/esm/core-flow/Sequence.js +28 -76
- package/dist/esm/core-flow/Sequence.js.map +1 -1
- package/dist/esm/core-flow/Workflow.d.ts +0 -2
- package/dist/esm/core-flow/Workflow.js +27 -75
- package/dist/esm/core-flow/Workflow.js.map +1 -1
- package/dist/esm/events/dispatcher.d.ts +2 -2
- package/dist/esm/events/dispatcher.js +2 -2
- package/dist/esm/events/payloads/access.d.ts +88 -0
- package/dist/esm/events/payloads/access.js +2 -0
- package/dist/esm/events/payloads/access.js.map +1 -0
- package/dist/esm/events/payloads/agent.d.ts +241 -0
- package/dist/esm/events/payloads/agent.js +2 -0
- package/dist/esm/events/payloads/agent.js.map +1 -0
- package/dist/esm/events/payloads/answer.d.ts +95 -0
- package/dist/esm/events/payloads/answer.js +2 -0
- package/dist/esm/events/payloads/answer.js.map +1 -0
- package/dist/esm/events/payloads/artifacts.d.ts +139 -0
- package/dist/esm/events/payloads/artifacts.js +2 -0
- package/dist/esm/events/payloads/artifacts.js.map +1 -0
- package/dist/esm/events/payloads/consent.d.ts +86 -0
- package/dist/esm/events/payloads/consent.js +2 -0
- package/dist/esm/events/payloads/consent.js.map +1 -0
- package/dist/esm/events/payloads/context.d.ts +276 -0
- package/dist/esm/events/payloads/context.js +2 -0
- package/dist/esm/events/payloads/context.js.map +1 -0
- package/dist/esm/events/payloads/cost.d.ts +40 -0
- package/dist/esm/events/payloads/cost.js +2 -0
- package/dist/esm/events/payloads/cost.js.map +1 -0
- package/dist/esm/events/payloads/dependencyTypes.d.ts +18 -0
- package/dist/esm/events/payloads/dependencyTypes.js +2 -0
- package/dist/esm/events/payloads/dependencyTypes.js.map +1 -0
- package/dist/esm/events/payloads/evaluation.d.ts +297 -0
- package/dist/esm/events/payloads/evaluation.js +2 -0
- package/dist/esm/events/payloads/evaluation.js.map +1 -0
- package/dist/esm/events/payloads/fallback.d.ts +6 -0
- package/dist/esm/events/payloads/fallback.js +2 -0
- package/dist/esm/events/payloads/fallback.js.map +1 -0
- package/dist/esm/events/payloads/findings.d.ts +243 -0
- package/dist/esm/events/payloads/findings.js +2 -0
- package/dist/esm/events/payloads/findings.js.map +1 -0
- package/dist/esm/events/payloads/flow.d.ts +68 -0
- package/dist/esm/events/payloads/flow.js +2 -0
- package/dist/esm/events/payloads/flow.js.map +1 -0
- package/dist/esm/events/payloads/integrity.d.ts +48 -0
- package/dist/esm/events/payloads/integrity.js +3 -0
- package/dist/esm/events/payloads/integrity.js.map +1 -0
- package/dist/esm/events/payloads/maps.d.ts +47 -0
- package/dist/esm/events/payloads/maps.js +3 -0
- package/dist/esm/events/payloads/maps.js.map +1 -0
- package/dist/esm/events/payloads/mcpRequests.d.ts +327 -0
- package/dist/esm/events/payloads/mcpRequests.js +3 -0
- package/dist/esm/events/payloads/mcpRequests.js.map +1 -0
- package/dist/esm/events/payloads/memory.d.ts +117 -0
- package/dist/esm/events/payloads/memory.js +3 -0
- package/dist/esm/events/payloads/memory.js.map +1 -0
- package/dist/esm/events/payloads/reliability.d.ts +149 -0
- package/dist/esm/events/payloads/reliability.js +2 -0
- package/dist/esm/events/payloads/reliability.js.map +1 -0
- package/dist/esm/events/payloads/runConfiguration.d.ts +224 -0
- package/dist/esm/events/payloads/runConfiguration.js +2 -0
- package/dist/esm/events/payloads/runConfiguration.js.map +1 -0
- package/dist/esm/events/payloads/skills.d.ts +359 -0
- package/dist/esm/events/payloads/skills.js +2 -0
- package/dist/esm/events/payloads/skills.js.map +1 -0
- package/dist/esm/events/payloads/stream.d.ts +230 -0
- package/dist/esm/events/payloads/stream.js +2 -0
- package/dist/esm/events/payloads/stream.js.map +1 -0
- package/dist/esm/events/payloads/thinking.d.ts +118 -0
- package/dist/esm/events/payloads/thinking.js +2 -0
- package/dist/esm/events/payloads/thinking.js.map +1 -0
- package/dist/esm/events/payloads/toolCatalog.d.ts +157 -0
- package/dist/esm/events/payloads/toolCatalog.js +2 -0
- package/dist/esm/events/payloads/toolCatalog.js.map +1 -0
- package/dist/esm/events/payloads/toolChoice.d.ts +65 -0
- package/dist/esm/events/payloads/toolChoice.js +2 -0
- package/dist/esm/events/payloads/toolChoice.js.map +1 -0
- package/dist/esm/events/payloads/toolEffects.d.ts +329 -0
- package/dist/esm/events/payloads/toolEffects.js +2 -0
- package/dist/esm/events/payloads/toolEffects.js.map +1 -0
- package/dist/esm/events/payloads/toolSemantics.d.ts +68 -0
- package/dist/esm/events/payloads/toolSemantics.js +2 -0
- package/dist/esm/events/payloads/toolSemantics.js.map +1 -0
- package/dist/esm/events/payloads/toolSessionPayloads.d.ts +50 -0
- package/dist/esm/events/payloads/toolSessionPayloads.js +17 -0
- package/dist/esm/events/payloads/toolSessionPayloads.js.map +1 -0
- package/dist/esm/events/payloads/validation.d.ts +29 -0
- package/dist/esm/events/payloads/validation.js +2 -0
- package/dist/esm/events/payloads/validation.js.map +1 -0
- package/dist/esm/events/payloads.d.ts +26 -3888
- package/dist/esm/events/registry.d.ts +8 -15
- package/dist/esm/events/registry.js +5 -15
- package/dist/esm/events/registry.js.map +1 -1
- package/dist/esm/hosting/answeredPause.d.ts +9 -23
- package/dist/esm/hosting/answeredPause.js +15 -27
- package/dist/esm/hosting/answeredPause.js.map +1 -1
- package/dist/esm/hosting/durability.d.ts +10 -7
- package/dist/esm/hosting/durability.js +10 -8
- package/dist/esm/hosting/durability.js.map +1 -1
- package/dist/esm/hosting/standingAgent.d.ts +4 -14
- package/dist/esm/hosting/standingAgent.js +73 -109
- package/dist/esm/hosting/standingAgent.js.map +1 -1
- package/dist/esm/hosting/stream.d.ts +3 -3
- package/dist/esm/hosting/stream.js +2 -5
- package/dist/esm/hosting/stream.js.map +1 -1
- package/dist/esm/hosting/streamHandler.js +5 -5
- package/dist/esm/hosting/streamHandler.js.map +1 -1
- package/dist/esm/index.d.ts +2 -1
- package/dist/esm/index.js +2 -4
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/influence-core/attribute.js +1 -1
- package/dist/esm/influence-core/attribute.js.map +1 -1
- package/dist/esm/influence-core/contrastive.js +1 -1
- package/dist/esm/influence-core/contrastive.js.map +1 -1
- package/dist/esm/influence-core/margin.js +1 -1
- package/dist/esm/influence-core/margin.js.map +1 -1
- package/dist/esm/influence-core/signals.js +1 -1
- package/dist/esm/influence-core/signals.js.map +1 -1
- package/dist/esm/influence-core/similarity.js +1 -1
- package/dist/esm/influence-core/similarity.js.map +1 -1
- package/dist/esm/injection-engine/buildInjectionEngineSubflow.js +1 -1
- package/dist/esm/injection-engine/buildInjectionEngineSubflow.js.map +1 -1
- package/dist/esm/injection-engine/devWarn.d.ts +3 -2
- package/dist/esm/injection-engine/devWarn.js +3 -2
- package/dist/esm/injection-engine/devWarn.js.map +1 -1
- package/dist/esm/injection-engine/entryScorer.js +1 -1
- package/dist/esm/injection-engine/entryScorer.js.map +1 -1
- package/dist/esm/injection-engine/hostContract.d.ts +3 -3
- package/dist/esm/injection-engine/skillExamples.d.ts +1 -1
- package/dist/esm/injection-engine/skillGraph/cursorEvidence.d.ts +48 -0
- package/dist/esm/injection-engine/skillGraph/cursorEvidence.js +54 -0
- package/dist/esm/injection-engine/skillGraph/cursorEvidence.js.map +1 -0
- package/dist/esm/injection-engine/skillGraph/cursorResolution.d.ts +4 -0
- package/dist/esm/injection-engine/skillGraph/cursorResolution.js +241 -0
- package/dist/esm/injection-engine/skillGraph/cursorResolution.js.map +1 -0
- package/dist/esm/injection-engine/skillGraph/decision.d.ts +21 -0
- package/dist/esm/injection-engine/skillGraph/decision.js +10 -0
- package/dist/esm/injection-engine/skillGraph/decision.js.map +1 -0
- package/dist/esm/injection-engine/skillGraph/entryScores.d.ts +14 -0
- package/dist/esm/injection-engine/skillGraph/entryScores.js +30 -0
- package/dist/esm/injection-engine/skillGraph/entryScores.js.map +1 -0
- package/dist/esm/injection-engine/skillGraph/entrySuppression.d.ts +23 -0
- package/dist/esm/injection-engine/skillGraph/entrySuppression.js +46 -0
- package/dist/esm/injection-engine/skillGraph/entrySuppression.js.map +1 -0
- package/dist/esm/injection-engine/skillGraph/graphConfig.d.ts +39 -0
- package/dist/esm/injection-engine/skillGraph/graphConfig.js +2 -0
- package/dist/esm/injection-engine/skillGraph/graphConfig.js.map +1 -0
- package/dist/esm/injection-engine/skillGraph/graphContracts.d.ts +479 -0
- package/dist/esm/injection-engine/skillGraph/graphContracts.js +14 -0
- package/dist/esm/injection-engine/skillGraph/graphContracts.js.map +1 -0
- package/dist/esm/injection-engine/skillGraph/graphCursor.d.ts +125 -0
- package/dist/esm/injection-engine/skillGraph/graphCursor.js +2 -0
- package/dist/esm/injection-engine/skillGraph/graphCursor.js.map +1 -0
- package/dist/esm/injection-engine/skillGraph/graphDrawing.d.ts +2 -0
- package/dist/esm/injection-engine/skillGraph/graphDrawing.js +31 -0
- package/dist/esm/injection-engine/skillGraph/graphDrawing.js.map +1 -0
- package/dist/esm/injection-engine/skillGraph/graphRoutes.d.ts +269 -0
- package/dist/esm/injection-engine/skillGraph/graphRoutes.js +2 -0
- package/dist/esm/injection-engine/skillGraph/graphRoutes.js.map +1 -0
- package/dist/esm/injection-engine/skillGraph/passMemo.d.ts +24 -0
- package/dist/esm/injection-engine/skillGraph/passMemo.js +37 -0
- package/dist/esm/injection-engine/skillGraph/passMemo.js.map +1 -0
- package/dist/esm/injection-engine/skillGraph/reachability.d.ts +71 -0
- package/dist/esm/injection-engine/skillGraph/reachability.js +62 -0
- package/dist/esm/injection-engine/skillGraph/reachability.js.map +1 -0
- package/dist/esm/injection-engine/skillGraph/routePredicates.d.ts +36 -0
- package/dist/esm/injection-engine/skillGraph/routePredicates.js +57 -0
- package/dist/esm/injection-engine/skillGraph/routePredicates.js.map +1 -0
- package/dist/esm/injection-engine/skillGraph/routingView.d.ts +3 -0
- package/dist/esm/injection-engine/skillGraph/routingView.js +24 -0
- package/dist/esm/injection-engine/skillGraph/routingView.js.map +1 -0
- package/dist/esm/injection-engine/skillGraph/treeCompilation.d.ts +38 -0
- package/dist/esm/injection-engine/skillGraph/treeCompilation.js +153 -0
- package/dist/esm/injection-engine/skillGraph/treeCompilation.js.map +1 -0
- package/dist/esm/injection-engine/skillGraph/triggerCompilation.d.ts +16 -0
- package/dist/esm/injection-engine/skillGraph/triggerCompilation.js +75 -0
- package/dist/esm/injection-engine/skillGraph/triggerCompilation.js.map +1 -0
- package/dist/esm/injection-engine/skillGraph.d.ts +12 -948
- package/dist/esm/injection-engine/skillGraph.js +22 -816
- package/dist/esm/injection-engine/skillGraph.js.map +1 -1
- package/dist/esm/injection-engine/skillIntent.d.ts +1 -1
- package/dist/esm/injection-engine/skillMatch.d.ts +2 -1
- package/dist/esm/injection-engine/skillMatch.js +2 -1
- package/dist/esm/injection-engine/skillMatch.js.map +1 -1
- package/dist/esm/injection-engine/skillToolDescriptors.js +2 -2
- package/dist/esm/injection-engine/skillToolDescriptors.js.map +1 -1
- package/dist/esm/injection-engine/startRuleClaim.d.ts +1 -1
- package/dist/esm/injection-engine/types.d.ts +1 -1
- package/dist/esm/lib/cosine.js.map +1 -0
- package/dist/esm/lib/iterationBudget.d.ts +3 -0
- package/dist/esm/lib/iterationBudget.js +7 -0
- package/dist/esm/lib/iterationBudget.js.map +1 -1
- package/dist/esm/lib/saidByPerson.d.ts +1 -0
- package/dist/esm/lib/saidByPerson.js +2 -0
- package/dist/esm/lib/saidByPerson.js.map +1 -1
- package/dist/esm/lib/spokenIds.js +2 -2
- package/dist/esm/lib/spokenIds.js.map +1 -1
- package/dist/esm/lib/toolBytes.d.ts +1 -1
- package/dist/esm/lib/toolBytes.js +2 -2
- package/dist/esm/lib/toolBytes.js.map +1 -1
- package/dist/esm/maps/engagement/lease.js +1 -1
- package/dist/esm/maps/engagement/lease.js.map +1 -1
- package/dist/esm/memory/causal/evidenceRecorder.d.ts +8 -56
- package/dist/esm/memory/causal/evidenceRecorder.js +221 -213
- package/dist/esm/memory/causal/evidenceRecorder.js.map +1 -1
- package/dist/esm/memory/causal/loadSnapshot.js +16 -59
- package/dist/esm/memory/causal/loadSnapshot.js.map +1 -1
- package/dist/esm/memory/causal/observation.d.ts +72 -0
- package/dist/esm/memory/causal/observation.js +13 -0
- package/dist/esm/memory/causal/observation.js.map +1 -0
- package/dist/esm/memory/causal/snapshotProjection.d.ts +5 -0
- package/dist/esm/memory/causal/snapshotProjection.js +61 -0
- package/dist/esm/memory/causal/snapshotProjection.js.map +1 -0
- package/dist/esm/memory/causal/snapshotSchema.d.ts +8 -0
- package/dist/esm/memory/causal/snapshotSchema.js +168 -0
- package/dist/esm/memory/causal/snapshotSchema.js.map +1 -0
- package/dist/esm/memory/causal/types.d.ts +5 -82
- package/dist/esm/memory/causal/types.js +0 -18
- package/dist/esm/memory/causal/types.js.map +1 -1
- package/dist/esm/memory/causal/writeSnapshot.js +17 -14
- package/dist/esm/memory/causal/writeSnapshot.js.map +1 -1
- package/dist/esm/memory/embedding/index.d.ts +1 -1
- package/dist/esm/memory/embedding/index.js +1 -1
- package/dist/esm/memory/embedding/index.js.map +1 -1
- package/dist/esm/memory/stages/types.d.ts +1 -1
- package/dist/esm/memory/store/InMemoryStore.js +1 -1
- package/dist/esm/memory/store/InMemoryStore.js.map +1 -1
- package/dist/esm/memory/store/staticVectorStore.js +1 -1
- package/dist/esm/memory/store/staticVectorStore.js.map +1 -1
- package/dist/esm/memory/wire/mountMemoryPipeline.d.ts +7 -7
- package/dist/esm/memory/wire/mountMemoryPipeline.js +8 -2
- package/dist/esm/memory/wire/mountMemoryPipeline.js.map +1 -1
- package/dist/esm/patterns/LlmRouter.d.ts +11 -149
- package/dist/esm/patterns/LlmRouter.js +51 -179
- package/dist/esm/patterns/LlmRouter.js.map +1 -1
- package/dist/esm/patterns/LlmSwarm.d.ts +5 -49
- package/dist/esm/patterns/LlmSwarm.js +7 -70
- package/dist/esm/patterns/LlmSwarm.js.map +1 -1
- package/dist/esm/patterns/MapReduce.js +33 -23
- package/dist/esm/patterns/MapReduce.js.map +1 -1
- package/dist/esm/patterns/Swarm.d.ts +14 -45
- package/dist/esm/patterns/Swarm.js +230 -76
- package/dist/esm/patterns/Swarm.js.map +1 -1
- package/dist/esm/patterns/index.d.ts +1 -1
- package/dist/esm/patterns/index.js.map +1 -1
- package/dist/esm/patterns/routing.d.ts +15 -0
- package/dist/esm/patterns/routing.js +18 -0
- package/dist/esm/patterns/routing.js.map +1 -0
- package/dist/esm/provider-contract/types.d.ts +5 -5
- package/dist/esm/recorders/core/CompactionMeter.d.ts +1 -1
- package/dist/esm/recorders/observability/BoundaryRecorder.d.ts +13 -427
- package/dist/esm/recorders/observability/BoundaryRecorder.js +7 -283
- package/dist/esm/recorders/observability/BoundaryRecorder.js.map +1 -1
- package/dist/esm/recorders/observability/boundaryRecorder/agentInternal.d.ts +13 -0
- package/dist/esm/recorders/observability/boundaryRecorder/agentInternal.js +58 -0
- package/dist/esm/recorders/observability/boundaryRecorder/agentInternal.js.map +1 -0
- package/dist/esm/recorders/observability/boundaryRecorder/domainEvents.d.ts +210 -0
- package/dist/esm/recorders/observability/boundaryRecorder/domainEvents.js +2 -0
- package/dist/esm/recorders/observability/boundaryRecorder/domainEvents.js.map +1 -0
- package/dist/esm/recorders/observability/boundaryRecorder/eventBuilders.d.ts +11 -0
- package/dist/esm/recorders/observability/boundaryRecorder/eventBuilders.js +77 -0
- package/dist/esm/recorders/observability/boundaryRecorder/eventBuilders.js.map +1 -0
- package/dist/esm/recorders/observability/boundaryRecorder/flowEvents.d.ts +12 -0
- package/dist/esm/recorders/observability/boundaryRecorder/flowEvents.js +2 -0
- package/dist/esm/recorders/observability/boundaryRecorder/flowEvents.js.map +1 -0
- package/dist/esm/recorders/observability/boundaryRecorder/leanContent.d.ts +52 -0
- package/dist/esm/recorders/observability/boundaryRecorder/leanContent.js +52 -0
- package/dist/esm/recorders/observability/boundaryRecorder/leanContent.js.map +1 -0
- package/dist/esm/recorders/observability/boundaryRecorder/options.d.ts +95 -0
- package/dist/esm/recorders/observability/boundaryRecorder/options.js +2 -0
- package/dist/esm/recorders/observability/boundaryRecorder/options.js.map +1 -0
- package/dist/esm/recorders/observability/boundaryRecorder/rangeLabels.d.ts +33 -0
- package/dist/esm/recorders/observability/boundaryRecorder/rangeLabels.js +39 -0
- package/dist/esm/recorders/observability/boundaryRecorder/rangeLabels.js.map +1 -0
- package/dist/esm/recorders/observability/boundaryRecorder/rollups.d.ts +53 -0
- package/dist/esm/recorders/observability/boundaryRecorder/rollups.js +69 -0
- package/dist/esm/recorders/observability/boundaryRecorder/rollups.js.map +1 -0
- package/dist/esm/recorders/observability/fileRecordingSink.d.ts +2 -4
- package/dist/esm/recorders/observability/fileRecordingSink.js +2 -4
- package/dist/esm/recorders/observability/fileRecordingSink.js.map +1 -1
- package/dist/esm/recorders/observability/recordingEnvelope.d.ts +6 -10
- package/dist/esm/recorders/observability/recordingEnvelope.js +6 -10
- package/dist/esm/recorders/observability/recordingEnvelope.js.map +1 -1
- package/dist/esm/redaction/coverage.d.ts +5 -3
- package/dist/esm/redaction/coverage.js +5 -3
- package/dist/esm/redaction/coverage.js.map +1 -1
- package/dist/esm/redaction/declared.d.ts +4 -0
- package/dist/esm/redaction/declared.js +15 -2
- package/dist/esm/redaction/declared.js.map +1 -1
- package/dist/esm/redaction/knownStrings.d.ts +5 -34
- package/dist/esm/redaction/knownStrings.js +10 -34
- package/dist/esm/redaction/knownStrings.js.map +1 -1
- package/dist/esm/redaction/marker.d.ts +1 -1
- package/dist/esm/redaction/marker.js +1 -1
- package/dist/esm/redaction/privateCaller.d.ts +43 -0
- package/dist/esm/redaction/privateCaller.js +74 -0
- package/dist/esm/redaction/privateCaller.js.map +1 -0
- package/dist/esm/redaction/privateCheckpoint.d.ts +22 -0
- package/dist/esm/redaction/privateCheckpoint.js +89 -0
- package/dist/esm/redaction/privateCheckpoint.js.map +1 -0
- package/dist/esm/redaction/privateFields.d.ts +28 -0
- package/dist/esm/redaction/privateFields.js +152 -0
- package/dist/esm/redaction/privateFields.js.map +1 -0
- package/dist/esm/redaction/privateRun.d.ts +32 -0
- package/dist/esm/redaction/privateRun.js +105 -0
- package/dist/esm/redaction/privateRun.js.map +1 -0
- package/dist/esm/redaction/runRedaction.d.ts +47 -41
- package/dist/esm/redaction/runRedaction.js +134 -91
- package/dist/esm/redaction/runRedaction.js.map +1 -1
- package/dist/esm/redaction/served.d.ts +10 -4
- package/dist/esm/redaction/served.js +28 -7
- package/dist/esm/redaction/served.js.map +1 -1
- package/dist/esm/resilience/withCircuitBreaker.d.ts +1 -1
- package/dist/esm/resilience/withCircuitBreaker.js +1 -1
- package/dist/esm/security/extractSequence.js +1 -1
- package/dist/esm/semantics/coverage/answer.js +1 -1
- package/dist/esm/semantics/coverage/answer.js.map +1 -1
- package/dist/esm/semantics/coverage/composedCoverage.d.ts +1 -1
- package/dist/esm/semantics/coverage/composedCoverage.js +1 -1
- package/dist/esm/semantics/coverage/items.d.ts +1 -1
- package/dist/esm/semantics/coverage/items.js +1 -1
- package/dist/esm/semantics/coverage/read.d.ts +3 -3
- package/dist/esm/semantics/coverage/read.js +3 -3
- package/dist/esm/semantics/types.d.ts +1 -1
- package/dist/esm/semantics/types.js +1 -1
- package/dist/esm/time/drift.d.ts +1 -1
- package/dist/esm/time/drift.js +1 -1
- package/dist/esm/time-travel/servedView/assembly.d.ts +4 -0
- package/dist/esm/time-travel/servedView/assembly.js +44 -0
- package/dist/esm/time-travel/servedView/assembly.js.map +1 -0
- package/dist/esm/time-travel/servedView/conversation.d.ts +8 -0
- package/dist/esm/time-travel/servedView/conversation.js +30 -0
- package/dist/esm/time-travel/servedView/conversation.js.map +1 -0
- package/dist/esm/time-travel/servedView/findings.d.ts +11 -0
- package/dist/esm/time-travel/servedView/findings.js +68 -0
- package/dist/esm/time-travel/servedView/findings.js.map +1 -0
- package/dist/esm/time-travel/servedView/gaps.d.ts +76 -0
- package/dist/esm/time-travel/servedView/gaps.js +476 -0
- package/dist/esm/time-travel/servedView/gaps.js.map +1 -0
- package/dist/esm/time-travel/servedView/ontology.d.ts +4 -0
- package/dist/esm/time-travel/servedView/ontology.js +60 -0
- package/dist/esm/time-travel/servedView/ontology.js.map +1 -0
- package/dist/esm/time-travel/servedView/recordReads.d.ts +44 -0
- package/dist/esm/time-travel/servedView/recordReads.js +73 -0
- package/dist/esm/time-travel/servedView/recordReads.js.map +1 -0
- package/dist/esm/time-travel/servedView/requestOnly.d.ts +6 -0
- package/dist/esm/time-travel/servedView/requestOnly.js +67 -0
- package/dist/esm/time-travel/servedView/requestOnly.js.map +1 -0
- package/dist/esm/time-travel/servedView/system.d.ts +15 -0
- package/dist/esm/time-travel/servedView/system.js +36 -0
- package/dist/esm/time-travel/servedView/system.js.map +1 -0
- package/dist/esm/time-travel/servedView/tools.d.ts +9 -0
- package/dist/esm/time-travel/servedView/tools.js +36 -0
- package/dist/esm/time-travel/servedView/tools.js.map +1 -0
- package/dist/esm/time-travel/servedView/value.d.ts +38 -0
- package/dist/esm/time-travel/servedView/value.js +57 -0
- package/dist/esm/time-travel/servedView/value.js.map +1 -0
- package/dist/esm/time-travel/servedView.d.ts +5 -65
- package/dist/esm/time-travel/servedView.js +155 -877
- package/dist/esm/time-travel/servedView.js.map +1 -1
- package/dist/esm/tools/displayName.d.ts +6 -0
- package/dist/esm/tools/displayName.js +15 -0
- package/dist/esm/tools/displayName.js.map +1 -0
- package/dist/esm/tools/finiteLabel.d.ts +16 -0
- package/dist/esm/tools/finiteLabel.js +28 -0
- package/dist/esm/tools/finiteLabel.js.map +1 -0
- package/dist/esm/tools/inputRequest.d.ts +1 -1
- package/dist/esm/tools/inputRequest.js +2 -2
- package/dist/esm/tools/toolParty.d.ts +17 -0
- package/dist/esm/tools/toolParty.js +40 -0
- package/dist/esm/tools/toolParty.js.map +1 -0
- package/dist/esm/tools/toolProvider.d.ts +1 -0
- package/dist/esm/tools/toolResourceOwner.d.ts +27 -0
- package/dist/esm/tools/toolResourceOwner.js +79 -0
- package/dist/esm/tools/toolResourceOwner.js.map +1 -0
- package/dist/esm/tools/toolSessions/contracts.d.ts +130 -0
- package/dist/esm/tools/toolSessions/contracts.js +7 -0
- package/dist/esm/tools/toolSessions/contracts.js.map +1 -0
- package/dist/esm/tools/toolSessions/keys.d.ts +53 -0
- package/dist/esm/tools/toolSessions/keys.js +113 -0
- package/dist/esm/tools/toolSessions/keys.js.map +1 -0
- package/dist/esm/tools/toolSessions/localStatus.d.ts +7 -0
- package/dist/esm/tools/toolSessions/localStatus.js +9 -0
- package/dist/esm/tools/toolSessions/localStatus.js.map +1 -0
- package/dist/esm/tools/toolSessions.d.ts +30 -178
- package/dist/esm/tools/toolSessions.js +138 -119
- package/dist/esm/tools/toolSessions.js.map +1 -1
- package/dist/esm/tools/tools.d.ts +6 -8
- package/dist/esm/tools/tools.js +5 -15
- package/dist/esm/tools/tools.js.map +1 -1
- package/dist/esm/trace-toolpack/traceToolpack/artifactFacts.d.ts +15 -0
- package/dist/esm/trace-toolpack/traceToolpack/artifactFacts.js +14 -0
- package/dist/esm/trace-toolpack/traceToolpack/artifactFacts.js.map +1 -0
- package/dist/esm/trace-toolpack/traceToolpack/backtrackView.d.ts +17 -0
- package/dist/esm/trace-toolpack/traceToolpack/backtrackView.js +117 -0
- package/dist/esm/trace-toolpack/traceToolpack/backtrackView.js.map +1 -0
- package/dist/esm/trace-toolpack/traceToolpack/contextErrors.d.ts +43 -0
- package/dist/esm/trace-toolpack/traceToolpack/contextErrors.js +354 -0
- package/dist/esm/trace-toolpack/traceToolpack/contextErrors.js.map +1 -0
- package/dist/esm/trace-toolpack/traceToolpack/findInTrace.d.ts +26 -0
- package/dist/esm/trace-toolpack/traceToolpack/findInTrace.js +178 -0
- package/dist/esm/trace-toolpack/traceToolpack/findInTrace.js.map +1 -0
- package/dist/esm/trace-toolpack/traceToolpack/findingEvidence.d.ts +73 -0
- package/dist/esm/trace-toolpack/traceToolpack/findingEvidence.js +176 -0
- package/dist/esm/trace-toolpack/traceToolpack/findingEvidence.js.map +1 -0
- package/dist/esm/trace-toolpack/traceToolpack/innerRecords.d.ts +11 -0
- package/dist/esm/trace-toolpack/traceToolpack/innerRecords.js +88 -0
- package/dist/esm/trace-toolpack/traceToolpack/innerRecords.js.map +1 -0
- package/dist/esm/trace-toolpack/traceToolpack/narrativeView.d.ts +3 -0
- package/dist/esm/trace-toolpack/traceToolpack/narrativeView.js +44 -0
- package/dist/esm/trace-toolpack/traceToolpack/narrativeView.js.map +1 -0
- package/dist/esm/trace-toolpack/traceToolpack/navigationHints.d.ts +6 -0
- package/dist/esm/trace-toolpack/traceToolpack/navigationHints.js +42 -0
- package/dist/esm/trace-toolpack/traceToolpack/navigationHints.js.map +1 -0
- package/dist/esm/trace-toolpack/traceToolpack/nodeView.d.ts +5 -0
- package/dist/esm/trace-toolpack/traceToolpack/nodeView.js +130 -0
- package/dist/esm/trace-toolpack/traceToolpack/nodeView.js.map +1 -0
- package/dist/esm/trace-toolpack/traceToolpack/packIndex.d.ts +69 -0
- package/dist/esm/trace-toolpack/traceToolpack/packIndex.js +155 -0
- package/dist/esm/trace-toolpack/traceToolpack/packIndex.js.map +1 -0
- package/dist/esm/trace-toolpack/traceToolpack/parameterSchemas.d.ts +10 -0
- package/dist/esm/trace-toolpack/traceToolpack/parameterSchemas.js +36 -0
- package/dist/esm/trace-toolpack/traceToolpack/parameterSchemas.js.map +1 -0
- package/dist/esm/trace-toolpack/traceToolpack/recursiveFactory.d.ts +40 -0
- package/dist/esm/trace-toolpack/traceToolpack/recursiveFactory.js +392 -0
- package/dist/esm/trace-toolpack/traceToolpack/recursiveFactory.js.map +1 -0
- package/dist/esm/trace-toolpack/traceToolpack/runOverview.d.ts +5 -0
- package/dist/esm/trace-toolpack/traceToolpack/runOverview.js +114 -0
- package/dist/esm/trace-toolpack/traceToolpack/runOverview.js.map +1 -0
- package/dist/esm/trace-toolpack/traceToolpack/sliceView.d.ts +5 -0
- package/dist/esm/trace-toolpack/traceToolpack/sliceView.js +87 -0
- package/dist/esm/trace-toolpack/traceToolpack/sliceView.js.map +1 -0
- package/dist/esm/trace-toolpack/traceToolpack/structuralLimits.d.ts +41 -0
- package/dist/esm/trace-toolpack/traceToolpack/structuralLimits.js +44 -0
- package/dist/esm/trace-toolpack/traceToolpack/structuralLimits.js.map +1 -0
- package/dist/esm/trace-toolpack/traceToolpack/toolCallJournal.d.ts +105 -0
- package/dist/esm/trace-toolpack/traceToolpack/toolCallJournal.js +384 -0
- package/dist/esm/trace-toolpack/traceToolpack/toolCallJournal.js.map +1 -0
- package/dist/esm/trace-toolpack/traceToolpack/valueLines.d.ts +29 -0
- package/dist/esm/trace-toolpack/traceToolpack/valueLines.js +52 -0
- package/dist/esm/trace-toolpack/traceToolpack/valueLines.js.map +1 -0
- package/dist/esm/trace-toolpack/traceToolpack/valueQueries.d.ts +6 -0
- package/dist/esm/trace-toolpack/traceToolpack/valueQueries.js +122 -0
- package/dist/esm/trace-toolpack/traceToolpack/valueQueries.js.map +1 -0
- package/dist/esm/trace-toolpack/traceToolpack/writerHints.d.ts +13 -0
- package/dist/esm/trace-toolpack/traceToolpack/writerHints.js +43 -0
- package/dist/esm/trace-toolpack/traceToolpack/writerHints.js.map +1 -0
- package/dist/esm/trace-toolpack/traceToolpack.d.ts +15 -40
- package/dist/esm/trace-toolpack/traceToolpack.js +15 -2452
- package/dist/esm/trace-toolpack/traceToolpack.js.map +1 -1
- package/dist/events/dispatcher.js +2 -2
- package/dist/events/payloads/access.js +3 -0
- package/dist/events/payloads/access.js.map +1 -0
- package/dist/events/payloads/agent.js +3 -0
- package/dist/events/payloads/agent.js.map +1 -0
- package/dist/events/payloads/answer.js +3 -0
- package/dist/events/payloads/answer.js.map +1 -0
- package/dist/events/payloads/artifacts.js +3 -0
- package/dist/events/payloads/artifacts.js.map +1 -0
- package/dist/events/payloads/consent.js +3 -0
- package/dist/events/payloads/consent.js.map +1 -0
- package/dist/events/payloads/context.js +3 -0
- package/dist/events/payloads/context.js.map +1 -0
- package/dist/events/payloads/cost.js +3 -0
- package/dist/events/payloads/cost.js.map +1 -0
- package/dist/events/payloads/dependencyTypes.js +3 -0
- package/dist/events/payloads/dependencyTypes.js.map +1 -0
- package/dist/events/payloads/evaluation.js +3 -0
- package/dist/events/payloads/evaluation.js.map +1 -0
- package/dist/events/payloads/fallback.js +3 -0
- package/dist/events/payloads/fallback.js.map +1 -0
- package/dist/events/payloads/findings.js +3 -0
- package/dist/events/payloads/findings.js.map +1 -0
- package/dist/events/payloads/flow.js +3 -0
- package/dist/events/payloads/flow.js.map +1 -0
- package/dist/events/payloads/integrity.js +4 -0
- package/dist/events/payloads/integrity.js.map +1 -0
- package/dist/events/payloads/maps.js +4 -0
- package/dist/events/payloads/maps.js.map +1 -0
- package/dist/events/payloads/mcpRequests.js +4 -0
- package/dist/events/payloads/mcpRequests.js.map +1 -0
- package/dist/events/payloads/memory.js +4 -0
- package/dist/events/payloads/memory.js.map +1 -0
- package/dist/events/payloads/reliability.js +3 -0
- package/dist/events/payloads/reliability.js.map +1 -0
- package/dist/events/payloads/runConfiguration.js +3 -0
- package/dist/events/payloads/runConfiguration.js.map +1 -0
- package/dist/events/payloads/skills.js +3 -0
- package/dist/events/payloads/skills.js.map +1 -0
- package/dist/events/payloads/stream.js +3 -0
- package/dist/events/payloads/stream.js.map +1 -0
- package/dist/events/payloads/thinking.js +3 -0
- package/dist/events/payloads/thinking.js.map +1 -0
- package/dist/events/payloads/toolCatalog.js +3 -0
- package/dist/events/payloads/toolCatalog.js.map +1 -0
- package/dist/events/payloads/toolChoice.js +3 -0
- package/dist/events/payloads/toolChoice.js.map +1 -0
- package/dist/events/payloads/toolEffects.js +3 -0
- package/dist/events/payloads/toolEffects.js.map +1 -0
- package/dist/events/payloads/toolSemantics.js +3 -0
- package/dist/events/payloads/toolSemantics.js.map +1 -0
- package/dist/events/payloads/toolSessionPayloads.js +18 -0
- package/dist/events/payloads/toolSessionPayloads.js.map +1 -0
- package/dist/events/payloads/validation.js +3 -0
- package/dist/events/payloads/validation.js.map +1 -0
- package/dist/events/registry.js +5 -15
- package/dist/events/registry.js.map +1 -1
- package/dist/hosting/answeredPause.js +16 -28
- package/dist/hosting/answeredPause.js.map +1 -1
- package/dist/hosting/durability.js +10 -8
- package/dist/hosting/durability.js.map +1 -1
- package/dist/hosting/standingAgent.js +72 -108
- package/dist/hosting/standingAgent.js.map +1 -1
- package/dist/hosting/stream.js +2 -5
- package/dist/hosting/stream.js.map +1 -1
- package/dist/hosting/streamHandler.js +5 -5
- package/dist/hosting/streamHandler.js.map +1 -1
- package/dist/index.js +7 -10
- package/dist/index.js.map +1 -1
- package/dist/influence-core/attribute.js +1 -1
- package/dist/influence-core/attribute.js.map +1 -1
- package/dist/influence-core/contrastive.js +1 -1
- package/dist/influence-core/contrastive.js.map +1 -1
- package/dist/influence-core/margin.js +1 -1
- package/dist/influence-core/margin.js.map +1 -1
- package/dist/influence-core/signals.js +1 -1
- package/dist/influence-core/signals.js.map +1 -1
- package/dist/influence-core/similarity.js +1 -1
- package/dist/influence-core/similarity.js.map +1 -1
- package/dist/injection-engine/buildInjectionEngineSubflow.js +1 -1
- package/dist/injection-engine/buildInjectionEngineSubflow.js.map +1 -1
- package/dist/injection-engine/devWarn.js +3 -2
- package/dist/injection-engine/devWarn.js.map +1 -1
- package/dist/injection-engine/entryScorer.js +1 -1
- package/dist/injection-engine/entryScorer.js.map +1 -1
- package/dist/injection-engine/skillGraph/cursorEvidence.js +58 -0
- package/dist/injection-engine/skillGraph/cursorEvidence.js.map +1 -0
- package/dist/injection-engine/skillGraph/cursorResolution.js +245 -0
- package/dist/injection-engine/skillGraph/cursorResolution.js.map +1 -0
- package/dist/injection-engine/skillGraph/decision.js +15 -0
- package/dist/injection-engine/skillGraph/decision.js.map +1 -0
- package/dist/injection-engine/skillGraph/entryScores.js +34 -0
- package/dist/injection-engine/skillGraph/entryScores.js.map +1 -0
- package/dist/injection-engine/skillGraph/entrySuppression.js +50 -0
- package/dist/injection-engine/skillGraph/entrySuppression.js.map +1 -0
- package/dist/injection-engine/skillGraph/graphConfig.js +3 -0
- package/dist/injection-engine/skillGraph/graphConfig.js.map +1 -0
- package/dist/injection-engine/skillGraph/graphContracts.js +17 -0
- package/dist/injection-engine/skillGraph/graphContracts.js.map +1 -0
- package/dist/injection-engine/skillGraph/graphCursor.js +3 -0
- package/dist/injection-engine/skillGraph/graphCursor.js.map +1 -0
- package/dist/injection-engine/skillGraph/graphDrawing.js +35 -0
- package/dist/injection-engine/skillGraph/graphDrawing.js.map +1 -0
- package/dist/injection-engine/skillGraph/graphRoutes.js +3 -0
- package/dist/injection-engine/skillGraph/graphRoutes.js.map +1 -0
- package/dist/injection-engine/skillGraph/passMemo.js +42 -0
- package/dist/injection-engine/skillGraph/passMemo.js.map +1 -0
- package/dist/injection-engine/skillGraph/reachability.js +67 -0
- package/dist/injection-engine/skillGraph/reachability.js.map +1 -0
- package/dist/injection-engine/skillGraph/routePredicates.js +66 -0
- package/dist/injection-engine/skillGraph/routePredicates.js.map +1 -0
- package/dist/injection-engine/skillGraph/routingView.js +28 -0
- package/dist/injection-engine/skillGraph/routingView.js.map +1 -0
- package/dist/injection-engine/skillGraph/treeCompilation.js +158 -0
- package/dist/injection-engine/skillGraph/treeCompilation.js.map +1 -0
- package/dist/injection-engine/skillGraph/triggerCompilation.js +79 -0
- package/dist/injection-engine/skillGraph/triggerCompilation.js.map +1 -0
- package/dist/injection-engine/skillGraph.js +40 -832
- package/dist/injection-engine/skillGraph.js.map +1 -1
- package/dist/injection-engine/skillMatch.js +2 -1
- package/dist/injection-engine/skillMatch.js.map +1 -1
- package/dist/injection-engine/skillToolDescriptors.js +2 -2
- package/dist/injection-engine/skillToolDescriptors.js.map +1 -1
- package/dist/lib/cosine.js.map +1 -0
- package/dist/lib/iterationBudget.js +9 -1
- package/dist/lib/iterationBudget.js.map +1 -1
- package/dist/lib/saidByPerson.js +3 -1
- package/dist/lib/saidByPerson.js.map +1 -1
- package/dist/lib/spokenIds.js +2 -2
- package/dist/lib/spokenIds.js.map +1 -1
- package/dist/lib/toolBytes.js +2 -2
- package/dist/lib/toolBytes.js.map +1 -1
- package/dist/maps/engagement/lease.js +1 -1
- package/dist/maps/engagement/lease.js.map +1 -1
- package/dist/memory/causal/evidenceRecorder.js +221 -213
- package/dist/memory/causal/evidenceRecorder.js.map +1 -1
- package/dist/memory/causal/loadSnapshot.js +16 -59
- package/dist/memory/causal/loadSnapshot.js.map +1 -1
- package/dist/memory/causal/observation.js +16 -0
- package/dist/memory/causal/observation.js.map +1 -0
- package/dist/memory/causal/snapshotProjection.js +65 -0
- package/dist/memory/causal/snapshotProjection.js.map +1 -0
- package/dist/memory/causal/snapshotSchema.js +172 -0
- package/dist/memory/causal/snapshotSchema.js.map +1 -0
- package/dist/memory/causal/types.js +0 -18
- package/dist/memory/causal/types.js.map +1 -1
- package/dist/memory/causal/writeSnapshot.js +17 -14
- package/dist/memory/causal/writeSnapshot.js.map +1 -1
- package/dist/memory/embedding/index.js +1 -1
- package/dist/memory/embedding/index.js.map +1 -1
- package/dist/memory/store/InMemoryStore.js +1 -1
- package/dist/memory/store/InMemoryStore.js.map +1 -1
- package/dist/memory/store/staticVectorStore.js +1 -1
- package/dist/memory/store/staticVectorStore.js.map +1 -1
- package/dist/memory/wire/mountMemoryPipeline.js +8 -2
- package/dist/memory/wire/mountMemoryPipeline.js.map +1 -1
- package/dist/patterns/LlmRouter.js +49 -177
- package/dist/patterns/LlmRouter.js.map +1 -1
- package/dist/patterns/LlmSwarm.js +7 -70
- package/dist/patterns/LlmSwarm.js.map +1 -1
- package/dist/patterns/MapReduce.js +30 -20
- package/dist/patterns/MapReduce.js.map +1 -1
- package/dist/patterns/Swarm.js +233 -79
- package/dist/patterns/Swarm.js.map +1 -1
- package/dist/patterns/index.js.map +1 -1
- package/dist/patterns/routing.js +22 -0
- package/dist/patterns/routing.js.map +1 -0
- package/dist/recorders/observability/BoundaryRecorder.js +23 -299
- package/dist/recorders/observability/BoundaryRecorder.js.map +1 -1
- package/dist/recorders/observability/boundaryRecorder/agentInternal.js +61 -0
- package/dist/recorders/observability/boundaryRecorder/agentInternal.js.map +1 -0
- package/dist/recorders/observability/boundaryRecorder/domainEvents.js +3 -0
- package/dist/recorders/observability/boundaryRecorder/domainEvents.js.map +1 -0
- package/dist/recorders/observability/boundaryRecorder/eventBuilders.js +84 -0
- package/dist/recorders/observability/boundaryRecorder/eventBuilders.js.map +1 -0
- package/dist/recorders/observability/boundaryRecorder/flowEvents.js +3 -0
- package/dist/recorders/observability/boundaryRecorder/flowEvents.js.map +1 -0
- package/dist/recorders/observability/boundaryRecorder/leanContent.js +55 -0
- package/dist/recorders/observability/boundaryRecorder/leanContent.js.map +1 -0
- package/dist/recorders/observability/boundaryRecorder/options.js +3 -0
- package/dist/recorders/observability/boundaryRecorder/options.js.map +1 -0
- package/dist/recorders/observability/boundaryRecorder/rangeLabels.js +43 -0
- package/dist/recorders/observability/boundaryRecorder/rangeLabels.js.map +1 -0
- package/dist/recorders/observability/boundaryRecorder/rollups.js +72 -0
- package/dist/recorders/observability/boundaryRecorder/rollups.js.map +1 -0
- package/dist/recorders/observability/fileRecordingSink.js +2 -4
- package/dist/recorders/observability/fileRecordingSink.js.map +1 -1
- package/dist/recorders/observability/recordingEnvelope.js +6 -10
- package/dist/recorders/observability/recordingEnvelope.js.map +1 -1
- package/dist/redaction/coverage.js +5 -3
- package/dist/redaction/coverage.js.map +1 -1
- package/dist/redaction/declared.js +18 -3
- package/dist/redaction/declared.js.map +1 -1
- package/dist/redaction/knownStrings.js +10 -34
- package/dist/redaction/knownStrings.js.map +1 -1
- package/dist/redaction/marker.js +1 -1
- package/dist/redaction/privateCaller.js +84 -0
- package/dist/redaction/privateCaller.js.map +1 -0
- package/dist/redaction/privateCheckpoint.js +99 -0
- package/dist/redaction/privateCheckpoint.js.map +1 -0
- package/dist/redaction/privateFields.js +159 -0
- package/dist/redaction/privateFields.js.map +1 -0
- package/dist/redaction/privateRun.js +112 -0
- package/dist/redaction/privateRun.js.map +1 -0
- package/dist/redaction/runRedaction.js +141 -93
- package/dist/redaction/runRedaction.js.map +1 -1
- package/dist/redaction/served.js +28 -7
- package/dist/redaction/served.js.map +1 -1
- package/dist/resilience/withCircuitBreaker.js +1 -1
- package/dist/security/extractSequence.js +1 -1
- package/dist/semantics/coverage/answer.js +1 -1
- package/dist/semantics/coverage/answer.js.map +1 -1
- package/dist/semantics/coverage/composedCoverage.js +1 -1
- package/dist/semantics/coverage/items.js +1 -1
- package/dist/semantics/coverage/read.js +3 -3
- package/dist/semantics/types.js +1 -1
- package/dist/time/drift.js +1 -1
- package/dist/time-travel/servedView/assembly.js +48 -0
- package/dist/time-travel/servedView/assembly.js.map +1 -0
- package/dist/time-travel/servedView/conversation.js +34 -0
- package/dist/time-travel/servedView/conversation.js.map +1 -0
- package/dist/time-travel/servedView/findings.js +72 -0
- package/dist/time-travel/servedView/findings.js.map +1 -0
- package/dist/time-travel/servedView/gaps.js +480 -0
- package/dist/time-travel/servedView/gaps.js.map +1 -0
- package/dist/time-travel/servedView/ontology.js +64 -0
- package/dist/time-travel/servedView/ontology.js.map +1 -0
- package/dist/time-travel/servedView/recordReads.js +79 -0
- package/dist/time-travel/servedView/recordReads.js.map +1 -0
- package/dist/time-travel/servedView/requestOnly.js +71 -0
- package/dist/time-travel/servedView/requestOnly.js.map +1 -0
- package/dist/time-travel/servedView/system.js +41 -0
- package/dist/time-travel/servedView/system.js.map +1 -0
- package/dist/time-travel/servedView/tools.js +40 -0
- package/dist/time-travel/servedView/tools.js.map +1 -0
- package/dist/time-travel/servedView/value.js +62 -0
- package/dist/time-travel/servedView/value.js.map +1 -0
- package/dist/time-travel/servedView.js +161 -882
- package/dist/time-travel/servedView.js.map +1 -1
- package/dist/tools/displayName.js +19 -0
- package/dist/tools/displayName.js.map +1 -0
- package/dist/tools/finiteLabel.js +36 -0
- package/dist/tools/finiteLabel.js.map +1 -0
- package/dist/tools/inputRequest.js +2 -2
- package/dist/tools/toolParty.js +45 -0
- package/dist/tools/toolParty.js.map +1 -0
- package/dist/tools/toolResourceOwner.js +87 -0
- package/dist/tools/toolResourceOwner.js.map +1 -0
- package/dist/tools/toolSessions/contracts.js +10 -0
- package/dist/tools/toolSessions/contracts.js.map +1 -0
- package/dist/tools/toolSessions/keys.js +120 -0
- package/dist/tools/toolSessions/keys.js.map +1 -0
- package/dist/tools/toolSessions/localStatus.js +13 -0
- package/dist/tools/toolSessions/localStatus.js.map +1 -0
- package/dist/tools/toolSessions.js +151 -127
- package/dist/tools/toolSessions.js.map +1 -1
- package/dist/tools/tools.js +18 -17
- package/dist/tools/tools.js.map +1 -1
- package/dist/trace-toolpack/traceToolpack/artifactFacts.js +18 -0
- package/dist/trace-toolpack/traceToolpack/artifactFacts.js.map +1 -0
- package/dist/trace-toolpack/traceToolpack/backtrackView.js +120 -0
- package/dist/trace-toolpack/traceToolpack/backtrackView.js.map +1 -0
- package/dist/trace-toolpack/traceToolpack/contextErrors.js +357 -0
- package/dist/trace-toolpack/traceToolpack/contextErrors.js.map +1 -0
- package/dist/trace-toolpack/traceToolpack/findInTrace.js +181 -0
- package/dist/trace-toolpack/traceToolpack/findInTrace.js.map +1 -0
- package/dist/trace-toolpack/traceToolpack/findingEvidence.js +189 -0
- package/dist/trace-toolpack/traceToolpack/findingEvidence.js.map +1 -0
- package/dist/trace-toolpack/traceToolpack/innerRecords.js +94 -0
- package/dist/trace-toolpack/traceToolpack/innerRecords.js.map +1 -0
- package/dist/trace-toolpack/traceToolpack/narrativeView.js +47 -0
- package/dist/trace-toolpack/traceToolpack/narrativeView.js.map +1 -0
- package/dist/trace-toolpack/traceToolpack/navigationHints.js +47 -0
- package/dist/trace-toolpack/traceToolpack/navigationHints.js.map +1 -0
- package/dist/trace-toolpack/traceToolpack/nodeView.js +133 -0
- package/dist/trace-toolpack/traceToolpack/nodeView.js.map +1 -0
- package/dist/trace-toolpack/traceToolpack/packIndex.js +160 -0
- package/dist/trace-toolpack/traceToolpack/packIndex.js.map +1 -0
- package/dist/trace-toolpack/traceToolpack/parameterSchemas.js +40 -0
- package/dist/trace-toolpack/traceToolpack/parameterSchemas.js.map +1 -0
- package/dist/trace-toolpack/traceToolpack/recursiveFactory.js +397 -0
- package/dist/trace-toolpack/traceToolpack/recursiveFactory.js.map +1 -0
- package/dist/trace-toolpack/traceToolpack/runOverview.js +117 -0
- package/dist/trace-toolpack/traceToolpack/runOverview.js.map +1 -0
- package/dist/trace-toolpack/traceToolpack/sliceView.js +90 -0
- package/dist/trace-toolpack/traceToolpack/sliceView.js.map +1 -0
- package/dist/trace-toolpack/traceToolpack/structuralLimits.js +71 -0
- package/dist/trace-toolpack/traceToolpack/structuralLimits.js.map +1 -0
- package/dist/trace-toolpack/traceToolpack/toolCallJournal.js +388 -0
- package/dist/trace-toolpack/traceToolpack/toolCallJournal.js.map +1 -0
- package/dist/trace-toolpack/traceToolpack/valueLines.js +60 -0
- package/dist/trace-toolpack/traceToolpack/valueLines.js.map +1 -0
- package/dist/trace-toolpack/traceToolpack/valueQueries.js +126 -0
- package/dist/trace-toolpack/traceToolpack/valueQueries.js.map +1 -0
- package/dist/trace-toolpack/traceToolpack/writerHints.js +47 -0
- package/dist/trace-toolpack/traceToolpack/writerHints.js.map +1 -0
- package/dist/trace-toolpack/traceToolpack.js +18 -2455
- package/dist/trace-toolpack/traceToolpack.js.map +1 -1
- package/dist/types/adapters/observability/auditShapes.d.ts +5 -31
- package/dist/types/adapters/observability/auditShapes.d.ts.map +1 -1
- package/dist/types/adapters/observability/otel.d.ts +1 -1
- package/dist/types/bridge/eventMeta.d.ts +2 -0
- package/dist/types/bridge/eventMeta.d.ts.map +1 -1
- package/dist/types/core/Agent.d.ts +18 -121
- package/dist/types/core/Agent.d.ts.map +1 -1
- package/dist/types/core/LLMCall.d.ts +1 -4
- package/dist/types/core/LLMCall.d.ts.map +1 -1
- package/dist/types/core/RunnerBase.d.ts +42 -114
- package/dist/types/core/RunnerBase.d.ts.map +1 -1
- package/dist/types/core/agent/arguments/answerRows.d.ts +27 -0
- package/dist/types/core/agent/arguments/answerRows.d.ts.map +1 -0
- package/dist/types/core/agent/arguments/ask.d.ts +5 -11
- package/dist/types/core/agent/arguments/ask.d.ts.map +1 -1
- package/dist/types/core/agent/arguments/dispatch.d.ts +4 -4
- package/dist/types/core/agent/arguments/dispatch.d.ts.map +1 -1
- package/dist/types/core/agent/arguments/kept.d.ts +1 -1
- package/dist/types/core/agent/arguments/partialWindow.d.ts +2 -1
- package/dist/types/core/agent/arguments/partialWindow.d.ts.map +1 -1
- package/dist/types/core/agent/arguments/pendingPrivateAsk.d.ts +38 -0
- package/dist/types/core/agent/arguments/pendingPrivateAsk.d.ts.map +1 -0
- package/dist/types/core/agent/arguments/privateAnswers.d.ts +47 -0
- package/dist/types/core/agent/arguments/privateAnswers.d.ts.map +1 -0
- package/dist/types/core/agent/arguments/resolutionRows.d.ts +30 -0
- package/dist/types/core/agent/arguments/resolutionRows.d.ts.map +1 -0
- package/dist/types/core/agent/arguments/resolve.d.ts +2 -13
- package/dist/types/core/agent/arguments/resolve.d.ts.map +1 -1
- package/dist/types/core/agent/arguments/serve.d.ts +0 -5
- package/dist/types/core/agent/arguments/serve.d.ts.map +1 -1
- package/dist/types/core/agent/arguments/subflow.d.ts.map +1 -1
- package/dist/types/core/agent/buildAgentChart.d.ts +3 -326
- package/dist/types/core/agent/buildAgentChart.d.ts.map +1 -1
- package/dist/types/core/agent/buildToolRegistry.d.ts +1 -1
- package/dist/types/core/agent/callerIdentity.d.ts +9 -64
- package/dist/types/core/agent/callerIdentity.d.ts.map +1 -1
- package/dist/types/core/agent/chartContract.d.ts +328 -0
- package/dist/types/core/agent/chartContract.d.ts.map +1 -0
- package/dist/types/core/agent/checkpointDomain.d.ts +12 -0
- package/dist/types/core/agent/checkpointDomain.d.ts.map +1 -0
- package/dist/types/core/agent/componentObservers.d.ts +15 -0
- package/dist/types/core/agent/componentObservers.d.ts.map +1 -0
- package/dist/types/core/agent/componentResources.d.ts +40 -0
- package/dist/types/core/agent/componentResources.d.ts.map +1 -0
- package/dist/types/core/agent/evidence/frames.d.ts.map +1 -1
- package/dist/types/core/agent/evidence/servedJson.d.ts +1 -1
- package/dist/types/core/agent/findings/contingent.d.ts +1 -1
- package/dist/types/core/agent/findings/judge.d.ts +1 -1
- package/dist/types/core/agent/findings/types.d.ts +1 -1
- package/dist/types/core/agent/findings/unsettled.d.ts +3 -3
- package/dist/types/core/agent/honesty/inputsMountContract.d.ts +67 -0
- package/dist/types/core/agent/honesty/inputsMountContract.d.ts.map +1 -0
- package/dist/types/core/agent/honesty/mounts.d.ts +4 -66
- package/dist/types/core/agent/honesty/mounts.d.ts.map +1 -1
- package/dist/types/core/agent/hostTurn.d.ts +18 -0
- package/dist/types/core/agent/hostTurn.d.ts.map +1 -0
- package/dist/types/core/agent/pauseOwnership.d.ts +25 -0
- package/dist/types/core/agent/pauseOwnership.d.ts.map +1 -0
- package/dist/types/core/agent/presentTool.d.ts +1 -1
- package/dist/types/core/agent/resultCeiling.d.ts +1 -1
- package/dist/types/core/agent/resumeAnswer.d.ts +11 -0
- package/dist/types/core/agent/resumeAnswer.d.ts.map +1 -0
- package/dist/types/core/agent/resumeCheckpoint.d.ts +13 -0
- package/dist/types/core/agent/resumeCheckpoint.d.ts.map +1 -0
- package/dist/types/core/agent/resumeError.d.ts +9 -0
- package/dist/types/core/agent/resumeError.d.ts.map +1 -0
- package/dist/types/core/agent/run/clocks.d.ts +45 -0
- package/dist/types/core/agent/run/clocks.d.ts.map +1 -0
- package/dist/types/core/agent/run/commitRunRedaction.d.ts +5 -0
- package/dist/types/core/agent/run/commitRunRedaction.d.ts.map +1 -0
- package/dist/types/core/agent/run/eventStageIds.d.ts +41 -0
- package/dist/types/core/agent/run/eventStageIds.d.ts.map +1 -0
- package/dist/types/core/agent/run/injectionDelivery.d.ts +5 -0
- package/dist/types/core/agent/run/injectionDelivery.d.ts.map +1 -0
- package/dist/types/core/agent/run/ledgerFacts.d.ts +9 -0
- package/dist/types/core/agent/run/ledgerFacts.d.ts.map +1 -0
- package/dist/types/core/agent/run/resumeRedaction.d.ts +7 -0
- package/dist/types/core/agent/run/resumeRedaction.d.ts.map +1 -0
- package/dist/types/core/agent/run/withoutTime.d.ts +9 -0
- package/dist/types/core/agent/run/withoutTime.d.ts.map +1 -0
- package/dist/types/core/agent/runValues.d.ts +72 -0
- package/dist/types/core/agent/runValues.d.ts.map +1 -0
- package/dist/types/core/agent/scripts/rows.d.ts +1 -1
- package/dist/types/core/agent/scripts/types.d.ts +1 -1
- package/dist/types/core/agent/stages/argumentAsk.d.ts +7 -1
- package/dist/types/core/agent/stages/argumentAsk.d.ts.map +1 -1
- package/dist/types/core/agent/stages/argumentParties.d.ts +4 -0
- package/dist/types/core/agent/stages/argumentParties.d.ts.map +1 -0
- package/dist/types/core/agent/stages/batchParties.d.ts +22 -0
- package/dist/types/core/agent/stages/batchParties.d.ts.map +1 -0
- package/dist/types/core/agent/stages/finalStageContract.d.ts +46 -0
- package/dist/types/core/agent/stages/finalStageContract.d.ts.map +1 -0
- package/dist/types/core/agent/stages/prepareFinal.d.ts +2 -45
- package/dist/types/core/agent/stages/prepareFinal.d.ts.map +1 -1
- package/dist/types/core/agent/stages/searchCoverage.d.ts +1 -1
- package/dist/types/core/agent/stages/seed.d.ts.map +1 -1
- package/dist/types/core/agent/stages/servedParties.d.ts +40 -0
- package/dist/types/core/agent/stages/servedParties.d.ts.map +1 -0
- package/dist/types/core/agent/stages/timeLayer.d.ts +3 -3
- package/dist/types/core/agent/stages/timeLayer.d.ts.map +1 -1
- package/dist/types/core/agent/stages/toolCallShape.d.ts +8 -0
- package/dist/types/core/agent/stages/toolCallShape.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/access/argumentGate.d.ts +22 -0
- package/dist/types/core/agent/stages/toolCalls/access/argumentGate.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/access/argumentValidation.d.ts +11 -0
- package/dist/types/core/agent/stages/toolCalls/access/argumentValidation.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/access/bindings.d.ts +62 -0
- package/dist/types/core/agent/stages/toolCalls/access/bindings.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/access/callState.d.ts +15 -0
- package/dist/types/core/agent/stages/toolCalls/access/callState.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/access/capabilityQuestion.d.ts +29 -0
- package/dist/types/core/agent/stages/toolCalls/access/capabilityQuestion.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/access/checkInAdmission.d.ts +45 -0
- package/dist/types/core/agent/stages/toolCalls/access/checkInAdmission.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/access/heldAnswer.d.ts +9 -0
- package/dist/types/core/agent/stages/toolCalls/access/heldAnswer.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/access/middlewareAdmission.d.ts +51 -0
- package/dist/types/core/agent/stages/toolCalls/access/middlewareAdmission.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/access/toolPermission.d.ts +25 -0
- package/dist/types/core/agent/stages/toolCalls/access/toolPermission.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/batch/completion.d.ts +19 -0
- package/dist/types/core/agent/stages/toolCalls/batch/completion.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/batch/dispatchContext.d.ts +37 -0
- package/dist/types/core/agent/stages/toolCalls/batch/dispatchContext.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/batch/execute.d.ts +8 -0
- package/dist/types/core/agent/stages/toolCalls/batch/execute.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/batch/findingsAdmission.d.ts +19 -0
- package/dist/types/core/agent/stages/toolCalls/batch/findingsAdmission.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/batch/inputResolutions.d.ts +7 -0
- package/dist/types/core/agent/stages/toolCalls/batch/inputResolutions.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/batch/paused.d.ts +66 -0
- package/dist/types/core/agent/stages/toolCalls/batch/paused.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/batch/refusal.d.ts +6 -0
- package/dist/types/core/agent/stages/toolCalls/batch/refusal.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/batch/settle.d.ts +67 -0
- package/dist/types/core/agent/stages/toolCalls/batch/settle.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/batch/settlementOperations.d.ts +18 -0
- package/dist/types/core/agent/stages/toolCalls/batch/settlementOperations.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/compose.d.ts +240 -0
- package/dist/types/core/agent/stages/toolCalls/compose.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/contracts/access.d.ts +111 -0
- package/dist/types/core/agent/stages/toolCalls/contracts/access.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/contracts/artifacts.d.ts +27 -0
- package/dist/types/core/agent/stages/toolCalls/contracts/artifacts.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/contracts/batchCall.d.ts +9 -0
- package/dist/types/core/agent/stages/toolCalls/contracts/batchCall.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/contracts/callCells.d.ts +44 -0
- package/dist/types/core/agent/stages/toolCalls/contracts/callCells.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/contracts/callFacts.d.ts +51 -0
- package/dist/types/core/agent/stages/toolCalls/contracts/callFacts.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/contracts/catalog.d.ts +57 -0
- package/dist/types/core/agent/stages/toolCalls/contracts/catalog.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/contracts/dispatchBatch.d.ts +18 -0
- package/dist/types/core/agent/stages/toolCalls/contracts/dispatchBatch.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/contracts/dispatchCall.d.ts +15 -0
- package/dist/types/core/agent/stages/toolCalls/contracts/dispatchCall.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/contracts/evidence.d.ts +212 -0
- package/dist/types/core/agent/stages/toolCalls/contracts/evidence.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/contracts/handlerDeps.d.ts +12 -0
- package/dist/types/core/agent/stages/toolCalls/contracts/handlerDeps.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/contracts/inputsDispatch.d.ts +3 -0
- package/dist/types/core/agent/stages/toolCalls/contracts/inputsDispatch.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/contracts/invocationInputs.d.ts +12 -0
- package/dist/types/core/agent/stages/toolCalls/contracts/invocationInputs.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/contracts/observation.d.ts +25 -0
- package/dist/types/core/agent/stages/toolCalls/contracts/observation.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/contracts/operations/artifacts.d.ts +38 -0
- package/dist/types/core/agent/stages/toolCalls/contracts/operations/artifacts.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/contracts/operations/catalog.d.ts +32 -0
- package/dist/types/core/agent/stages/toolCalls/contracts/operations/catalog.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/contracts/operations/context.d.ts +15 -0
- package/dist/types/core/agent/stages/toolCalls/contracts/operations/context.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/contracts/operations/coverage.d.ts +24 -0
- package/dist/types/core/agent/stages/toolCalls/contracts/operations/coverage.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/contracts/operations/credentials.d.ts +6 -0
- package/dist/types/core/agent/stages/toolCalls/contracts/operations/credentials.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/contracts/operations/effects.d.ts +15 -0
- package/dist/types/core/agent/stages/toolCalls/contracts/operations/effects.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/contracts/operations/integrity.d.ts +17 -0
- package/dist/types/core/agent/stages/toolCalls/contracts/operations/integrity.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/contracts/operations/limits.d.ts +20 -0
- package/dist/types/core/agent/stages/toolCalls/contracts/operations/limits.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/contracts/operations/middleware.d.ts +26 -0
- package/dist/types/core/agent/stages/toolCalls/contracts/operations/middleware.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/contracts/operations/observations.d.ts +9 -0
- package/dist/types/core/agent/stages/toolCalls/contracts/operations/observations.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/contracts/operations/progress.d.ts +12 -0
- package/dist/types/core/agent/stages/toolCalls/contracts/operations/progress.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/contracts/operations/resources.d.ts +13 -0
- package/dist/types/core/agent/stages/toolCalls/contracts/operations/resources.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/contracts/operations/resumedInvocation.d.ts +31 -0
- package/dist/types/core/agent/stages/toolCalls/contracts/operations/resumedInvocation.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/contracts/operations/scripts.d.ts +41 -0
- package/dist/types/core/agent/stages/toolCalls/contracts/operations/scripts.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/contracts/operations/semantics.d.ts +11 -0
- package/dist/types/core/agent/stages/toolCalls/contracts/operations/semantics.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/contracts/operations/settlement.d.ts +14 -0
- package/dist/types/core/agent/stages/toolCalls/contracts/operations/settlement.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/contracts/operations/steps.d.ts +27 -0
- package/dist/types/core/agent/stages/toolCalls/contracts/operations/steps.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/contracts/resources.d.ts +68 -0
- package/dist/types/core/agent/stages/toolCalls/contracts/resources.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/contracts/results.d.ts +27 -0
- package/dist/types/core/agent/stages/toolCalls/contracts/results.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/contracts/resumeFrames.d.ts +15 -0
- package/dist/types/core/agent/stages/toolCalls/contracts/resumeFrames.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/contracts/routing.d.ts +115 -0
- package/dist/types/core/agent/stages/toolCalls/contracts/routing.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/decorators/limitsOperations.d.ts +5 -0
- package/dist/types/core/agent/stages/toolCalls/decorators/limitsOperations.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/decorators/middlewareOperations.d.ts +5 -0
- package/dist/types/core/agent/stages/toolCalls/decorators/middlewareOperations.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/decorators/reportingCredentials.d.ts +30 -0
- package/dist/types/core/agent/stages/toolCalls/decorators/reportingCredentials.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/evidence/coverageOperations.d.ts +10 -0
- package/dist/types/core/agent/stages/toolCalls/evidence/coverageOperations.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/evidence/integrityOperations.d.ts +5 -0
- package/dist/types/core/agent/stages/toolCalls/evidence/integrityOperations.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/evidence/judgeLanded.d.ts +30 -0
- package/dist/types/core/agent/stages/toolCalls/evidence/judgeLanded.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/evidence/madeInRun.d.ts +7 -0
- package/dist/types/core/agent/stages/toolCalls/evidence/madeInRun.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/evidence/producerCorpus.d.ts +23 -0
- package/dist/types/core/agent/stages/toolCalls/evidence/producerCorpus.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/evidence/scriptsOperations.d.ts +12 -0
- package/dist/types/core/agent/stages/toolCalls/evidence/scriptsOperations.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/evidence/semanticsOperations.d.ts +5 -0
- package/dist/types/core/agent/stages/toolCalls/evidence/semanticsOperations.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/evidence/sourceClock.d.ts +12 -0
- package/dist/types/core/agent/stages/toolCalls/evidence/sourceClock.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/evidence/towers.d.ts +19 -0
- package/dist/types/core/agent/stages/toolCalls/evidence/towers.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/execution/artifactsOperations.d.ts +13 -0
- package/dist/types/core/agent/stages/toolCalls/execution/artifactsOperations.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/execution/callStart.d.ts +36 -0
- package/dist/types/core/agent/stages/toolCalls/execution/callStart.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/execution/catalogOperations.d.ts +18 -0
- package/dist/types/core/agent/stages/toolCalls/execution/catalogOperations.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/execution/contextOperations.d.ts +16 -0
- package/dist/types/core/agent/stages/toolCalls/execution/contextOperations.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/execution/credentialAdmission.d.ts +49 -0
- package/dist/types/core/agent/stages/toolCalls/execution/credentialAdmission.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/execution/credentialsOperations.d.ts +10 -0
- package/dist/types/core/agent/stages/toolCalls/execution/credentialsOperations.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/execution/deliveredResult.d.ts +41 -0
- package/dist/types/core/agent/stages/toolCalls/execution/deliveredResult.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/execution/dispatchCall.d.ts +6 -0
- package/dist/types/core/agent/stages/toolCalls/execution/dispatchCall.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/execution/initialInvocation.d.ts +71 -0
- package/dist/types/core/agent/stages/toolCalls/execution/initialInvocation.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/execution/resourcesOperations.d.ts +10 -0
- package/dist/types/core/agent/stages/toolCalls/execution/resourcesOperations.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/execution/resumedInvocation.d.ts +43 -0
- package/dist/types/core/agent/stages/toolCalls/execution/resumedInvocation.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/execution/wantedArguments.d.ts +20 -0
- package/dist/types/core/agent/stages/toolCalls/execution/wantedArguments.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/helpers/dedupeIds.d.ts +4 -0
- package/dist/types/core/agent/stages/toolCalls/helpers/dedupeIds.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/helpers/dispatchRefusals.d.ts +62 -0
- package/dist/types/core/agent/stages/toolCalls/helpers/dispatchRefusals.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/helpers/mountedCursor.d.ts +42 -0
- package/dist/types/core/agent/stages/toolCalls/helpers/mountedCursor.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/helpers/periodWarnings.d.ts +24 -0
- package/dist/types/core/agent/stages/toolCalls/helpers/periodWarnings.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/helpers/readSkillRefusal.d.ts +88 -0
- package/dist/types/core/agent/stages/toolCalls/helpers/readSkillRefusal.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/helpers/sourceNote.d.ts +9 -0
- package/dist/types/core/agent/stages/toolCalls/helpers/sourceNote.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/helpers/unscopedRun.d.ts +12 -0
- package/dist/types/core/agent/stages/toolCalls/helpers/unscopedRun.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/index.d.ts +15 -0
- package/dist/types/core/agent/stages/toolCalls/index.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/observation/callSettlement.d.ts +30 -0
- package/dist/types/core/agent/stages/toolCalls/observation/callSettlement.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/observation/observationsOperations.d.ts +5 -0
- package/dist/types/core/agent/stages/toolCalls/observation/observationsOperations.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/observation/progressOperations.d.ts +8 -0
- package/dist/types/core/agent/stages/toolCalls/observation/progressOperations.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/resume/ask.d.ts +45 -0
- package/dist/types/core/agent/stages/toolCalls/resume/ask.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/resume/checkIn.d.ts +40 -0
- package/dist/types/core/agent/stages/toolCalls/resume/checkIn.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/resume/credential.d.ts +38 -0
- package/dist/types/core/agent/stages/toolCalls/resume/credential.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/resume/handler.d.ts +7 -0
- package/dist/types/core/agent/stages/toolCalls/resume/handler.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/resume/plain.d.ts +33 -0
- package/dist/types/core/agent/stages/toolCalls/resume/plain.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/routing/effectsOperations.d.ts +5 -0
- package/dist/types/core/agent/stages/toolCalls/routing/effectsOperations.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/routing/policyHalt.d.ts +18 -0
- package/dist/types/core/agent/stages/toolCalls/routing/policyHalt.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/routing/readSkillRoute.d.ts +21 -0
- package/dist/types/core/agent/stages/toolCalls/routing/readSkillRoute.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/routing/skillActivation.d.ts +16 -0
- package/dist/types/core/agent/stages/toolCalls/routing/skillActivation.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls/routing/stepsOperations.d.ts +5 -0
- package/dist/types/core/agent/stages/toolCalls/routing/stepsOperations.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolResolver.d.ts +3 -2
- package/dist/types/core/agent/stages/toolResolver.d.ts.map +1 -1
- package/dist/types/core/agent/toolChoice/pick.d.ts +1 -1
- package/dist/types/core/agent/toolResultCap.d.ts +1 -1
- package/dist/types/core/agent/types.d.ts +16 -27
- package/dist/types/core/agent/types.d.ts.map +1 -1
- package/dist/types/core/agent/window/toolNames.d.ts +3 -3
- package/dist/types/core/answerConsumption.d.ts +8 -0
- package/dist/types/core/answerConsumption.d.ts.map +1 -0
- package/dist/types/core/checkin.d.ts +1 -1
- package/dist/types/core/codeRunnerTool.d.ts +1 -1
- package/dist/types/core/consentLedger.d.ts +22 -0
- package/dist/types/core/consentLedger.d.ts.map +1 -0
- package/dist/types/core/consentRequest.d.ts +35 -54
- package/dist/types/core/consentRequest.d.ts.map +1 -1
- package/dist/types/core/conversation.d.ts +8 -29
- package/dist/types/core/conversation.d.ts.map +1 -1
- package/dist/types/core/memberRun.d.ts +1 -0
- package/dist/types/core/memberRun.d.ts.map +1 -1
- package/dist/types/core/pause.d.ts +5 -5
- package/dist/types/core/pauseRecord.d.ts +14 -0
- package/dist/types/core/pauseRecord.d.ts.map +1 -0
- package/dist/types/core/runEntry.d.ts +9 -0
- package/dist/types/core/runEntry.d.ts.map +1 -0
- package/dist/types/core/runnerCoreValues.d.ts +17 -0
- package/dist/types/core/runnerCoreValues.d.ts.map +1 -0
- package/dist/types/core/runnerExecution.d.ts +72 -0
- package/dist/types/core/runnerExecution.d.ts.map +1 -0
- package/dist/types/core/runnerLive.d.ts +32 -1
- package/dist/types/core/runnerLive.d.ts.map +1 -1
- package/dist/types/core/slots/buildThinkingSubflow.d.ts +1 -1
- package/dist/types/core/slots/buildToolsSlot.d.ts +27 -56
- package/dist/types/core/slots/buildToolsSlot.d.ts.map +1 -1
- package/dist/types/core/slots/discoverTools.d.ts +22 -0
- package/dist/types/core/slots/discoverTools.d.ts.map +1 -0
- package/dist/types/core-flow/Conditional.d.ts +0 -2
- package/dist/types/core-flow/Conditional.d.ts.map +1 -1
- package/dist/types/core-flow/Graph.d.ts +18 -23
- package/dist/types/core-flow/Graph.d.ts.map +1 -1
- package/dist/types/core-flow/Loop.d.ts +0 -2
- package/dist/types/core-flow/Loop.d.ts.map +1 -1
- package/dist/types/core-flow/Parallel.d.ts +11 -40
- package/dist/types/core-flow/Parallel.d.ts.map +1 -1
- package/dist/types/core-flow/Sequence.d.ts +0 -2
- package/dist/types/core-flow/Sequence.d.ts.map +1 -1
- package/dist/types/core-flow/Workflow.d.ts +0 -2
- package/dist/types/core-flow/Workflow.d.ts.map +1 -1
- package/dist/types/events/dispatcher.d.ts +2 -2
- package/dist/types/events/payloads/access.d.ts +89 -0
- package/dist/types/events/payloads/access.d.ts.map +1 -0
- package/dist/types/events/payloads/agent.d.ts +242 -0
- package/dist/types/events/payloads/agent.d.ts.map +1 -0
- package/dist/types/events/payloads/answer.d.ts +96 -0
- package/dist/types/events/payloads/answer.d.ts.map +1 -0
- package/dist/types/events/payloads/artifacts.d.ts +140 -0
- package/dist/types/events/payloads/artifacts.d.ts.map +1 -0
- package/dist/types/events/payloads/consent.d.ts +87 -0
- package/dist/types/events/payloads/consent.d.ts.map +1 -0
- package/dist/types/events/payloads/context.d.ts +277 -0
- package/dist/types/events/payloads/context.d.ts.map +1 -0
- package/dist/types/events/payloads/cost.d.ts +41 -0
- package/dist/types/events/payloads/cost.d.ts.map +1 -0
- package/dist/types/events/payloads/dependencyTypes.d.ts +19 -0
- package/dist/types/events/payloads/dependencyTypes.d.ts.map +1 -0
- package/dist/types/events/payloads/evaluation.d.ts +298 -0
- package/dist/types/events/payloads/evaluation.d.ts.map +1 -0
- package/dist/types/events/payloads/fallback.d.ts +7 -0
- package/dist/types/events/payloads/fallback.d.ts.map +1 -0
- package/dist/types/events/payloads/findings.d.ts +244 -0
- package/dist/types/events/payloads/findings.d.ts.map +1 -0
- package/dist/types/events/payloads/flow.d.ts +69 -0
- package/dist/types/events/payloads/flow.d.ts.map +1 -0
- package/dist/types/events/payloads/integrity.d.ts +49 -0
- package/dist/types/events/payloads/integrity.d.ts.map +1 -0
- package/dist/types/events/payloads/maps.d.ts +48 -0
- package/dist/types/events/payloads/maps.d.ts.map +1 -0
- package/dist/types/events/payloads/mcpRequests.d.ts +328 -0
- package/dist/types/events/payloads/mcpRequests.d.ts.map +1 -0
- package/dist/types/events/payloads/memory.d.ts +118 -0
- package/dist/types/events/payloads/memory.d.ts.map +1 -0
- package/dist/types/events/payloads/reliability.d.ts +150 -0
- package/dist/types/events/payloads/reliability.d.ts.map +1 -0
- package/dist/types/events/payloads/runConfiguration.d.ts +225 -0
- package/dist/types/events/payloads/runConfiguration.d.ts.map +1 -0
- package/dist/types/events/payloads/skills.d.ts +360 -0
- package/dist/types/events/payloads/skills.d.ts.map +1 -0
- package/dist/types/events/payloads/stream.d.ts +231 -0
- package/dist/types/events/payloads/stream.d.ts.map +1 -0
- package/dist/types/events/payloads/thinking.d.ts +119 -0
- package/dist/types/events/payloads/thinking.d.ts.map +1 -0
- package/dist/types/events/payloads/toolCatalog.d.ts +158 -0
- package/dist/types/events/payloads/toolCatalog.d.ts.map +1 -0
- package/dist/types/events/payloads/toolChoice.d.ts +66 -0
- package/dist/types/events/payloads/toolChoice.d.ts.map +1 -0
- package/dist/types/events/payloads/toolEffects.d.ts +330 -0
- package/dist/types/events/payloads/toolEffects.d.ts.map +1 -0
- package/dist/types/events/payloads/toolSemantics.d.ts +69 -0
- package/dist/types/events/payloads/toolSemantics.d.ts.map +1 -0
- package/dist/types/events/payloads/toolSessionPayloads.d.ts +51 -0
- package/dist/types/events/payloads/toolSessionPayloads.d.ts.map +1 -0
- package/dist/types/events/payloads/validation.d.ts +30 -0
- package/dist/types/events/payloads/validation.d.ts.map +1 -0
- package/dist/types/events/payloads.d.ts +26 -3888
- package/dist/types/events/payloads.d.ts.map +1 -1
- package/dist/types/events/registry.d.ts +8 -15
- package/dist/types/events/registry.d.ts.map +1 -1
- package/dist/types/hosting/answeredPause.d.ts +9 -23
- package/dist/types/hosting/answeredPause.d.ts.map +1 -1
- package/dist/types/hosting/durability.d.ts +10 -7
- package/dist/types/hosting/durability.d.ts.map +1 -1
- package/dist/types/hosting/standingAgent.d.ts +4 -14
- package/dist/types/hosting/standingAgent.d.ts.map +1 -1
- package/dist/types/hosting/stream.d.ts +3 -3
- package/dist/types/hosting/stream.d.ts.map +1 -1
- package/dist/types/hosting/streamHandler.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/injection-engine/devWarn.d.ts +3 -2
- package/dist/types/injection-engine/devWarn.d.ts.map +1 -1
- package/dist/types/injection-engine/hostContract.d.ts +3 -3
- package/dist/types/injection-engine/skillExamples.d.ts +1 -1
- package/dist/types/injection-engine/skillGraph/cursorEvidence.d.ts +49 -0
- package/dist/types/injection-engine/skillGraph/cursorEvidence.d.ts.map +1 -0
- package/dist/types/injection-engine/skillGraph/cursorResolution.d.ts +5 -0
- package/dist/types/injection-engine/skillGraph/cursorResolution.d.ts.map +1 -0
- package/dist/types/injection-engine/skillGraph/decision.d.ts +22 -0
- package/dist/types/injection-engine/skillGraph/decision.d.ts.map +1 -0
- package/dist/types/injection-engine/skillGraph/entryScores.d.ts +15 -0
- package/dist/types/injection-engine/skillGraph/entryScores.d.ts.map +1 -0
- package/dist/types/injection-engine/skillGraph/entrySuppression.d.ts +24 -0
- package/dist/types/injection-engine/skillGraph/entrySuppression.d.ts.map +1 -0
- package/dist/types/injection-engine/skillGraph/graphConfig.d.ts +40 -0
- package/dist/types/injection-engine/skillGraph/graphConfig.d.ts.map +1 -0
- package/dist/types/injection-engine/skillGraph/graphContracts.d.ts +480 -0
- package/dist/types/injection-engine/skillGraph/graphContracts.d.ts.map +1 -0
- package/dist/types/injection-engine/skillGraph/graphCursor.d.ts +126 -0
- package/dist/types/injection-engine/skillGraph/graphCursor.d.ts.map +1 -0
- package/dist/types/injection-engine/skillGraph/graphDrawing.d.ts +3 -0
- package/dist/types/injection-engine/skillGraph/graphDrawing.d.ts.map +1 -0
- package/dist/types/injection-engine/skillGraph/graphRoutes.d.ts +270 -0
- package/dist/types/injection-engine/skillGraph/graphRoutes.d.ts.map +1 -0
- package/dist/types/injection-engine/skillGraph/passMemo.d.ts +25 -0
- package/dist/types/injection-engine/skillGraph/passMemo.d.ts.map +1 -0
- package/dist/types/injection-engine/skillGraph/reachability.d.ts +72 -0
- package/dist/types/injection-engine/skillGraph/reachability.d.ts.map +1 -0
- package/dist/types/injection-engine/skillGraph/routePredicates.d.ts +37 -0
- package/dist/types/injection-engine/skillGraph/routePredicates.d.ts.map +1 -0
- package/dist/types/injection-engine/skillGraph/routingView.d.ts +4 -0
- package/dist/types/injection-engine/skillGraph/routingView.d.ts.map +1 -0
- package/dist/types/injection-engine/skillGraph/treeCompilation.d.ts +39 -0
- package/dist/types/injection-engine/skillGraph/treeCompilation.d.ts.map +1 -0
- package/dist/types/injection-engine/skillGraph/triggerCompilation.d.ts +17 -0
- package/dist/types/injection-engine/skillGraph/triggerCompilation.d.ts.map +1 -0
- package/dist/types/injection-engine/skillGraph.d.ts +12 -948
- package/dist/types/injection-engine/skillGraph.d.ts.map +1 -1
- package/dist/types/injection-engine/skillIntent.d.ts +1 -1
- package/dist/types/injection-engine/skillIntent.d.ts.map +1 -1
- package/dist/types/injection-engine/skillMatch.d.ts +2 -1
- package/dist/types/injection-engine/skillMatch.d.ts.map +1 -1
- package/dist/types/injection-engine/startRuleClaim.d.ts +1 -1
- package/dist/types/injection-engine/types.d.ts +1 -1
- package/dist/types/lib/cosine.d.ts.map +1 -0
- package/dist/types/lib/iterationBudget.d.ts +3 -0
- package/dist/types/lib/iterationBudget.d.ts.map +1 -1
- package/dist/types/lib/saidByPerson.d.ts +1 -0
- package/dist/types/lib/saidByPerson.d.ts.map +1 -1
- package/dist/types/lib/toolBytes.d.ts +1 -1
- package/dist/types/memory/causal/evidenceRecorder.d.ts +8 -56
- package/dist/types/memory/causal/evidenceRecorder.d.ts.map +1 -1
- package/dist/types/memory/causal/loadSnapshot.d.ts.map +1 -1
- package/dist/types/memory/causal/observation.d.ts +73 -0
- package/dist/types/memory/causal/observation.d.ts.map +1 -0
- package/dist/types/memory/causal/snapshotProjection.d.ts +6 -0
- package/dist/types/memory/causal/snapshotProjection.d.ts.map +1 -0
- package/dist/types/memory/causal/snapshotSchema.d.ts +9 -0
- package/dist/types/memory/causal/snapshotSchema.d.ts.map +1 -0
- package/dist/types/memory/causal/types.d.ts +5 -82
- package/dist/types/memory/causal/types.d.ts.map +1 -1
- package/dist/types/memory/causal/writeSnapshot.d.ts.map +1 -1
- package/dist/types/memory/embedding/index.d.ts +1 -1
- package/dist/types/memory/embedding/index.d.ts.map +1 -1
- package/dist/types/memory/stages/types.d.ts +1 -1
- package/dist/types/memory/wire/mountMemoryPipeline.d.ts +7 -7
- package/dist/types/memory/wire/mountMemoryPipeline.d.ts.map +1 -1
- package/dist/types/patterns/LlmRouter.d.ts +11 -149
- package/dist/types/patterns/LlmRouter.d.ts.map +1 -1
- package/dist/types/patterns/LlmSwarm.d.ts +5 -49
- package/dist/types/patterns/LlmSwarm.d.ts.map +1 -1
- package/dist/types/patterns/MapReduce.d.ts.map +1 -1
- package/dist/types/patterns/Swarm.d.ts +14 -45
- package/dist/types/patterns/Swarm.d.ts.map +1 -1
- package/dist/types/patterns/index.d.ts +1 -1
- package/dist/types/patterns/index.d.ts.map +1 -1
- package/dist/types/patterns/routing.d.ts +16 -0
- package/dist/types/patterns/routing.d.ts.map +1 -0
- package/dist/types/provider-contract/types.d.ts +5 -5
- package/dist/types/recorders/core/CompactionMeter.d.ts +1 -1
- package/dist/types/recorders/observability/BoundaryRecorder.d.ts +13 -427
- package/dist/types/recorders/observability/BoundaryRecorder.d.ts.map +1 -1
- package/dist/types/recorders/observability/boundaryRecorder/agentInternal.d.ts +14 -0
- package/dist/types/recorders/observability/boundaryRecorder/agentInternal.d.ts.map +1 -0
- package/dist/types/recorders/observability/boundaryRecorder/domainEvents.d.ts +211 -0
- package/dist/types/recorders/observability/boundaryRecorder/domainEvents.d.ts.map +1 -0
- package/dist/types/recorders/observability/boundaryRecorder/eventBuilders.d.ts +12 -0
- package/dist/types/recorders/observability/boundaryRecorder/eventBuilders.d.ts.map +1 -0
- package/dist/types/recorders/observability/boundaryRecorder/flowEvents.d.ts +13 -0
- package/dist/types/recorders/observability/boundaryRecorder/flowEvents.d.ts.map +1 -0
- package/dist/types/recorders/observability/boundaryRecorder/leanContent.d.ts +53 -0
- package/dist/types/recorders/observability/boundaryRecorder/leanContent.d.ts.map +1 -0
- package/dist/types/recorders/observability/boundaryRecorder/options.d.ts +96 -0
- package/dist/types/recorders/observability/boundaryRecorder/options.d.ts.map +1 -0
- package/dist/types/recorders/observability/boundaryRecorder/rangeLabels.d.ts +34 -0
- package/dist/types/recorders/observability/boundaryRecorder/rangeLabels.d.ts.map +1 -0
- package/dist/types/recorders/observability/boundaryRecorder/rollups.d.ts +54 -0
- package/dist/types/recorders/observability/boundaryRecorder/rollups.d.ts.map +1 -0
- package/dist/types/recorders/observability/fileRecordingSink.d.ts +2 -4
- package/dist/types/recorders/observability/fileRecordingSink.d.ts.map +1 -1
- package/dist/types/recorders/observability/recordingEnvelope.d.ts +6 -10
- package/dist/types/recorders/observability/recordingEnvelope.d.ts.map +1 -1
- package/dist/types/redaction/coverage.d.ts +5 -3
- package/dist/types/redaction/coverage.d.ts.map +1 -1
- package/dist/types/redaction/declared.d.ts +4 -0
- package/dist/types/redaction/declared.d.ts.map +1 -1
- package/dist/types/redaction/knownStrings.d.ts +5 -34
- package/dist/types/redaction/knownStrings.d.ts.map +1 -1
- package/dist/types/redaction/marker.d.ts +1 -1
- package/dist/types/redaction/privateCaller.d.ts +44 -0
- package/dist/types/redaction/privateCaller.d.ts.map +1 -0
- package/dist/types/redaction/privateCheckpoint.d.ts +23 -0
- package/dist/types/redaction/privateCheckpoint.d.ts.map +1 -0
- package/dist/types/redaction/privateFields.d.ts +29 -0
- package/dist/types/redaction/privateFields.d.ts.map +1 -0
- package/dist/types/redaction/privateRun.d.ts +33 -0
- package/dist/types/redaction/privateRun.d.ts.map +1 -0
- package/dist/types/redaction/runRedaction.d.ts +47 -41
- package/dist/types/redaction/runRedaction.d.ts.map +1 -1
- package/dist/types/redaction/served.d.ts +10 -4
- package/dist/types/redaction/served.d.ts.map +1 -1
- package/dist/types/resilience/withCircuitBreaker.d.ts +1 -1
- package/dist/types/semantics/coverage/composedCoverage.d.ts +1 -1
- package/dist/types/semantics/coverage/items.d.ts +1 -1
- package/dist/types/semantics/coverage/read.d.ts +3 -3
- package/dist/types/semantics/types.d.ts +1 -1
- package/dist/types/time/drift.d.ts +1 -1
- package/dist/types/time-travel/servedView/assembly.d.ts +5 -0
- package/dist/types/time-travel/servedView/assembly.d.ts.map +1 -0
- package/dist/types/time-travel/servedView/conversation.d.ts +9 -0
- package/dist/types/time-travel/servedView/conversation.d.ts.map +1 -0
- package/dist/types/time-travel/servedView/findings.d.ts +12 -0
- package/dist/types/time-travel/servedView/findings.d.ts.map +1 -0
- package/dist/types/time-travel/servedView/gaps.d.ts +77 -0
- package/dist/types/time-travel/servedView/gaps.d.ts.map +1 -0
- package/dist/types/time-travel/servedView/ontology.d.ts +5 -0
- package/dist/types/time-travel/servedView/ontology.d.ts.map +1 -0
- package/dist/types/time-travel/servedView/recordReads.d.ts +45 -0
- package/dist/types/time-travel/servedView/recordReads.d.ts.map +1 -0
- package/dist/types/time-travel/servedView/requestOnly.d.ts +7 -0
- package/dist/types/time-travel/servedView/requestOnly.d.ts.map +1 -0
- package/dist/types/time-travel/servedView/system.d.ts +16 -0
- package/dist/types/time-travel/servedView/system.d.ts.map +1 -0
- package/dist/types/time-travel/servedView/tools.d.ts +10 -0
- package/dist/types/time-travel/servedView/tools.d.ts.map +1 -0
- package/dist/types/time-travel/servedView/value.d.ts +39 -0
- package/dist/types/time-travel/servedView/value.d.ts.map +1 -0
- package/dist/types/time-travel/servedView.d.ts +5 -65
- package/dist/types/time-travel/servedView.d.ts.map +1 -1
- package/dist/types/tools/displayName.d.ts +7 -0
- package/dist/types/tools/displayName.d.ts.map +1 -0
- package/dist/types/tools/finiteLabel.d.ts +17 -0
- package/dist/types/tools/finiteLabel.d.ts.map +1 -0
- package/dist/types/tools/inputRequest.d.ts +1 -1
- package/dist/types/tools/toolParty.d.ts +18 -0
- package/dist/types/tools/toolParty.d.ts.map +1 -0
- package/dist/types/tools/toolProvider.d.ts +1 -0
- package/dist/types/tools/toolProvider.d.ts.map +1 -1
- package/dist/types/tools/toolResourceOwner.d.ts +28 -0
- package/dist/types/tools/toolResourceOwner.d.ts.map +1 -0
- package/dist/types/tools/toolSessions/contracts.d.ts +131 -0
- package/dist/types/tools/toolSessions/contracts.d.ts.map +1 -0
- package/dist/types/tools/toolSessions/keys.d.ts +54 -0
- package/dist/types/tools/toolSessions/keys.d.ts.map +1 -0
- package/dist/types/tools/toolSessions/localStatus.d.ts +8 -0
- package/dist/types/tools/toolSessions/localStatus.d.ts.map +1 -0
- package/dist/types/tools/toolSessions.d.ts +30 -178
- package/dist/types/tools/toolSessions.d.ts.map +1 -1
- package/dist/types/tools/tools.d.ts +6 -8
- package/dist/types/tools/tools.d.ts.map +1 -1
- package/dist/types/trace-toolpack/traceToolpack/artifactFacts.d.ts +16 -0
- package/dist/types/trace-toolpack/traceToolpack/artifactFacts.d.ts.map +1 -0
- package/dist/types/trace-toolpack/traceToolpack/backtrackView.d.ts +18 -0
- package/dist/types/trace-toolpack/traceToolpack/backtrackView.d.ts.map +1 -0
- package/dist/types/trace-toolpack/traceToolpack/contextErrors.d.ts +44 -0
- package/dist/types/trace-toolpack/traceToolpack/contextErrors.d.ts.map +1 -0
- package/dist/types/trace-toolpack/traceToolpack/findInTrace.d.ts +27 -0
- package/dist/types/trace-toolpack/traceToolpack/findInTrace.d.ts.map +1 -0
- package/dist/types/trace-toolpack/traceToolpack/findingEvidence.d.ts +74 -0
- package/dist/types/trace-toolpack/traceToolpack/findingEvidence.d.ts.map +1 -0
- package/dist/types/trace-toolpack/traceToolpack/innerRecords.d.ts +12 -0
- package/dist/types/trace-toolpack/traceToolpack/innerRecords.d.ts.map +1 -0
- package/dist/types/trace-toolpack/traceToolpack/narrativeView.d.ts +4 -0
- package/dist/types/trace-toolpack/traceToolpack/narrativeView.d.ts.map +1 -0
- package/dist/types/trace-toolpack/traceToolpack/navigationHints.d.ts +7 -0
- package/dist/types/trace-toolpack/traceToolpack/navigationHints.d.ts.map +1 -0
- package/dist/types/trace-toolpack/traceToolpack/nodeView.d.ts +6 -0
- package/dist/types/trace-toolpack/traceToolpack/nodeView.d.ts.map +1 -0
- package/dist/types/trace-toolpack/traceToolpack/packIndex.d.ts +70 -0
- package/dist/types/trace-toolpack/traceToolpack/packIndex.d.ts.map +1 -0
- package/dist/types/trace-toolpack/traceToolpack/parameterSchemas.d.ts +11 -0
- package/dist/types/trace-toolpack/traceToolpack/parameterSchemas.d.ts.map +1 -0
- package/dist/types/trace-toolpack/traceToolpack/recursiveFactory.d.ts +41 -0
- package/dist/types/trace-toolpack/traceToolpack/recursiveFactory.d.ts.map +1 -0
- package/dist/types/trace-toolpack/traceToolpack/runOverview.d.ts +6 -0
- package/dist/types/trace-toolpack/traceToolpack/runOverview.d.ts.map +1 -0
- package/dist/types/trace-toolpack/traceToolpack/sliceView.d.ts +6 -0
- package/dist/types/trace-toolpack/traceToolpack/sliceView.d.ts.map +1 -0
- package/dist/types/trace-toolpack/traceToolpack/structuralLimits.d.ts +42 -0
- package/dist/types/trace-toolpack/traceToolpack/structuralLimits.d.ts.map +1 -0
- package/dist/types/trace-toolpack/traceToolpack/toolCallJournal.d.ts +106 -0
- package/dist/types/trace-toolpack/traceToolpack/toolCallJournal.d.ts.map +1 -0
- package/dist/types/trace-toolpack/traceToolpack/valueLines.d.ts +30 -0
- package/dist/types/trace-toolpack/traceToolpack/valueLines.d.ts.map +1 -0
- package/dist/types/trace-toolpack/traceToolpack/valueQueries.d.ts +7 -0
- package/dist/types/trace-toolpack/traceToolpack/valueQueries.d.ts.map +1 -0
- package/dist/types/trace-toolpack/traceToolpack/writerHints.d.ts +14 -0
- package/dist/types/trace-toolpack/traceToolpack/writerHints.d.ts.map +1 -0
- package/dist/types/trace-toolpack/traceToolpack.d.ts +15 -40
- package/dist/types/trace-toolpack/traceToolpack.d.ts.map +1 -1
- package/package.json +7 -6
- package/dist/core/agent/stages/toolCalls.js +0 -6194
- package/dist/core/agent/stages/toolCalls.js.map +0 -1
- package/dist/esm/core/agent/stages/toolCalls.d.ts +0 -895
- package/dist/esm/core/agent/stages/toolCalls.js +0 -6159
- package/dist/esm/core/agent/stages/toolCalls.js.map +0 -1
- package/dist/esm/memory/embedding/cosine.js.map +0 -1
- package/dist/memory/embedding/cosine.js.map +0 -1
- package/dist/types/core/agent/stages/toolCalls.d.ts +0 -896
- package/dist/types/core/agent/stages/toolCalls.d.ts.map +0 -1
- package/dist/types/memory/embedding/cosine.d.ts.map +0 -1
- /package/dist/esm/{memory/embedding → lib}/cosine.d.ts +0 -0
- /package/dist/esm/{memory/embedding → lib}/cosine.js +0 -0
- /package/dist/{memory/embedding → lib}/cosine.js +0 -0
- /package/dist/types/{memory/embedding → lib}/cosine.d.ts +0 -0
package/dist/esm/core/Agent.js
CHANGED
|
@@ -1,20 +1,14 @@
|
|
|
1
|
+
import { refuseFollowUpIdentity, refuseKnownSpentAnswer, refuseMissingPlainAnswer, } from './agent/resumeAnswer.js';
|
|
2
|
+
import { hostedTurns } from './agent/hostTurn.js';
|
|
3
|
+
import { componentResources } from './agent/componentResources.js';
|
|
4
|
+
import { resumeStateOf, resumeSessionOf } from './agent/resumeCheckpoint.js';
|
|
5
|
+
import { capturePauseOwnership, pendingQuestionOf, preservePendingQuestion, abandonStoredPause, abandonPendingQuestion, } from './agent/pauseOwnership.js';
|
|
6
|
+
import { registerRunnerLive, runnerLive } from './runnerLive.js';
|
|
7
|
+
import { agentComponentObservers, componentEvidence } from './agent/componentObservers.js';
|
|
8
|
+
import { bindScopeComputation, captureLateEmitter } from '../redaction/runRedaction.js';
|
|
9
|
+
import { createAgentRunValues } from './agent/runValues.js';
|
|
10
|
+
import { bindRunnerStage, } from './runnerExecution.js';
|
|
1
11
|
import { findingsContextBytes } from './agent/findings/context.js';
|
|
2
|
-
/**
|
|
3
|
-
* Agent — ReAct primitive (LLM + tools + iteration loop).
|
|
4
|
-
*
|
|
5
|
-
* Pattern: Builder (GoF) → produces a Runner backed by a footprintjs FlowChart.
|
|
6
|
-
* Role: Layer-5 primitive (core/). Assembles the 3-slot context
|
|
7
|
-
* pipeline + callLLM + route decider + tool-calls subflow +
|
|
8
|
-
* loopTo. Composition nestable anywhere that accepts a Runner.
|
|
9
|
-
* Emits: Via internal recorders:
|
|
10
|
-
* agentfootprint.agent.turn_start / turn_end
|
|
11
|
-
* agentfootprint.agent.iteration_start / iteration_end
|
|
12
|
-
* agentfootprint.agent.route_decided
|
|
13
|
-
* agentfootprint.stream.llm_start / llm_end
|
|
14
|
-
* agentfootprint.stream.tool_start / tool_end
|
|
15
|
-
* agentfootprint.context.* (via ContextRecorder)
|
|
16
|
-
*/
|
|
17
|
-
import { FlowChartExecutor, } from 'footprintjs';
|
|
18
12
|
import { ReliabilityFailFastError } from '../reliability/types.js';
|
|
19
13
|
import { extractSequence } from '../security/extractSequence.js';
|
|
20
14
|
import { PolicyHaltError } from '../security/PolicyHaltError.js';
|
|
@@ -28,8 +22,8 @@ import { assistantReplayFields } from './agent/assistantReplay.js';
|
|
|
28
22
|
import { buildBrainFor, describeServingBrain } from './agent/skillBrains.js';
|
|
29
23
|
import { SUBFLOW_IDS } from '../lib/conventions.js';
|
|
30
24
|
import { readDisplayName } from '../lib/displayName.js';
|
|
31
|
-
import {
|
|
32
|
-
import { checkDecisionAgainst,
|
|
25
|
+
import { assertDecisionIsNotStale, isPaused, pauseDemandsDecision, } from './pause.js';
|
|
26
|
+
import { checkDecisionAgainst, processDecisionLedger, registerConsentLedger, registerConsentRules, } from './consentRequest.js';
|
|
33
27
|
import { assertArtifactPlacement } from '../artifacts/placement.js';
|
|
34
28
|
import { recordingPutInput } from '../artifacts/recordingArtifact.js';
|
|
35
29
|
import { recordRunWhere } from '../recorders/observability/recordRun.js';
|
|
@@ -54,76 +48,33 @@ import { toolsRecorder } from '../recorders/core/ToolsRecorder.js';
|
|
|
54
48
|
import { reliabilityRecorder } from '../recorders/core/ReliabilityRecorder.js';
|
|
55
49
|
import { resilienceRecorder } from '../recorders/core/ResilienceRecorder.js';
|
|
56
50
|
import { checkInEventsBridge } from '../recorders/core/CheckInRecorder.js';
|
|
57
|
-
import {
|
|
58
|
-
import { assertRedactionPolicy, CarriedPolicyError, carriedVocabularyOf, policyFromCarried, policyOfMarks, unionRedactionPolicies, } from '../redaction/policy.js';
|
|
59
|
-
import { coverageOfExecutor } from '../redaction/runRedaction.js';
|
|
51
|
+
import { assertRedactionPolicy, unionRedactionPolicies } from '../redaction/policy.js';
|
|
60
52
|
import { policyOfCoverage } from '../redaction/coverage.js';
|
|
61
53
|
import { ResumeRedactionError } from './conversation.js';
|
|
62
|
-
import {
|
|
63
|
-
import {
|
|
64
|
-
import {
|
|
65
|
-
import { createReceiptDigests } from './agent/receipt/receiptDigests.js';
|
|
54
|
+
import { privateResumeOf } from '../redaction/privateCheckpoint.js';
|
|
55
|
+
import { declareRedaction, redactionDeclaredBy, declarePrivateFields, } from '../redaction/declared.js';
|
|
56
|
+
import { carriedRunPolicy, conversationRedaction } from '../redaction/conversation.js';
|
|
66
57
|
import { packRecording } from '../recorders/observability/recordingPack.js';
|
|
67
58
|
import { pendingDurableWrite } from './durabilityBarrier.js';
|
|
68
59
|
import { ToolSessionTier, TOOL_TEARDOWN_TIMEOUT_MS, } from '../tools/toolSessions.js';
|
|
69
60
|
import { buildEventMeta, eventBelongsToRun } from '../bridge/eventMeta.js';
|
|
70
|
-
import { assertIdentityShape, callerIdentityOf,
|
|
61
|
+
import { assertIdentityShape, callerIdentityOf, restoredIdentityOf, sameIdentity, } from './agent/callerIdentity.js';
|
|
71
62
|
import { hostedConversationKey, hostedConversationOf, registerServingConversation, sessionConversationKey, } from './agent/servingConversation.js';
|
|
72
63
|
import { buildRunManifest } from './agent/runManifest.js';
|
|
73
64
|
import { beginIntegrityRun } from '../integrity/disposition/lifecycle.js';
|
|
74
|
-
/**
|
|
75
|
-
* The pseudo-stage a tool-teardown event is stamped with.
|
|
76
|
-
*
|
|
77
|
-
* `session_closed` and `session_close_failed` fire after the run's last stage
|
|
78
|
-
* has committed — there is no runtimeStageId to inherit, and inventing one that
|
|
79
|
-
* looked like a real stage would put a fictitious node in every consumer's step
|
|
80
|
-
* strip. This says plainly where it came from, the way `'<stageId>#paused'`
|
|
81
|
-
* does at the pause boundary. Their two siblings, `session_started` and
|
|
82
|
-
* `session_reused`, happen inside a real stage and carry its real id.
|
|
83
|
-
*/
|
|
84
|
-
const TOOL_TEARDOWN_STAGE_ID = 'tool-teardown#0';
|
|
85
|
-
/**
|
|
86
|
-
* The pseudo-stage a LATE artifact fact is stamped with — one that lands after
|
|
87
|
-
* the run its binding was made in had ended (a tool's floating upload). Its
|
|
88
|
-
* stage is long gone; like the teardown events it says plainly where it came
|
|
89
|
-
* from, and carries the run it belongs to rather than the one that is live.
|
|
90
|
-
*/
|
|
91
|
-
const LATE_ARTIFACT_FACT_STAGE_ID = 'artifact-late#0';
|
|
92
|
-
/**
|
|
93
|
-
* The pseudo-stage the run-configuration manifest is stamped with (9.41.0).
|
|
94
|
-
*
|
|
95
|
-
* Same reasoning as the teardown id above, at the other end of the run: the
|
|
96
|
-
* manifest is dispatched before the chart starts, so there is no stage to
|
|
97
|
-
* inherit and inventing a plausible one would put a node in every step strip
|
|
98
|
-
* that no traversal ever visited. This says plainly where it came from.
|
|
99
|
-
*/
|
|
100
|
-
const RUN_MANIFEST_STAGE_ID = 'run-configured#0';
|
|
101
|
-
/**
|
|
102
|
-
* Pseudo-stage for `agentfootprint.integrity.disposition` (9.60.0) — the
|
|
103
|
-
* ledger is filed at the run boundary, after the last stage committed, so it
|
|
104
|
-
* states where it came from exactly as the teardown id above does.
|
|
105
|
-
*/
|
|
106
|
-
const INTEGRITY_DISPOSITION_STAGE_ID = 'integrity-disposition#0';
|
|
107
|
-
/**
|
|
108
|
-
* Pseudo-stage for `agentfootprint.skill.graph_declared` (9.50.0) — same
|
|
109
|
-
* reasoning as the manifest id directly above: dispatched before the chart
|
|
110
|
-
* starts, so it states where it came from instead of inheriting a stage no
|
|
111
|
-
* traversal visited.
|
|
112
|
-
*/
|
|
113
|
-
const GRAPH_DECLARED_STAGE_ID = 'graph-declared#0';
|
|
114
65
|
import { EmitBridge } from '../recorders/core/EmitBridge.js';
|
|
115
66
|
import { buildWindowStage } from './agent/stages/window.js';
|
|
116
67
|
import { requireKeepLastToolResults } from './agent/window/options.js';
|
|
117
|
-
import {
|
|
68
|
+
import { buildDeliverStage } from './agent/stages/deliver.js';
|
|
118
69
|
import { providerTargets } from './agent/providerTargets.js';
|
|
119
|
-
import {
|
|
70
|
+
import { assertInjectionDelivery } from './agent/run/injectionDelivery.js';
|
|
120
71
|
import { CompactionUnmeasurableError } from './agent/window/errors.js';
|
|
121
72
|
import { resolveCheckInConfig, } from './checkin.js';
|
|
122
73
|
import { assertCostBudgetHasPricing, resolveCostBudget } from './cost.js';
|
|
123
|
-
import { causalEvidenceRecorder, } from '../memory/causal/evidenceRecorder.js';
|
|
124
74
|
import { buildSystemPromptSlot } from './slots/buildSystemPromptSlot.js';
|
|
125
75
|
import { buildMessagesSlot } from './slots/buildMessagesSlot.js';
|
|
126
|
-
import { buildToolsSlot
|
|
76
|
+
import { buildToolsSlot } from './slots/buildToolsSlot.js';
|
|
77
|
+
import { ensureDiscoveredTools } from './slots/discoverTools.js';
|
|
127
78
|
import { isDevMode } from 'footprintjs';
|
|
128
79
|
import { buildReadSkillTool } from '../injection-engine/skillTools.js';
|
|
129
80
|
import { foldStepPlans } from '../injection-engine/skillSteps.js';
|
|
@@ -144,14 +95,14 @@ import { makeRouteTurnStage } from './agent/stages/routeTurn.js';
|
|
|
144
95
|
import { applyOutputFallback, } from './outputFallback.js';
|
|
145
96
|
import { assertContinuable, buildCheckpoint, checkpointReplayHistory, retainReplayRetirements, classifyFailurePhase, RunCheckpointError, validateCheckpoint, } from './runCheckpoint.js';
|
|
146
97
|
import { requireVerificationOnResume } from './agent/findings/verificationCheckpoint.js';
|
|
147
|
-
import { NoConversationError, PendingQuestionError, ResumeIdentityConflictError,
|
|
98
|
+
import { NoConversationError, PendingQuestionError, ResumeIdentityConflictError, } from './conversation.js';
|
|
148
99
|
import { applyInputResponse, readAwaitingInput, } from '../tools/inputRequest.js';
|
|
149
100
|
import { applyOutputSchema, OutputSchemaError, } from '../answer-validation/outputSchema.js';
|
|
150
101
|
import { InvalidRunInputError, normalizeRunInput } from './runInput.js';
|
|
151
|
-
import
|
|
152
|
-
import { draftClock,
|
|
102
|
+
import '../time/rows.js';
|
|
103
|
+
import { draftClock, readTimeOptions, } from '../time/clock.js';
|
|
153
104
|
import { buildOutputRetryStage } from './agent/stages/outputRetry.js';
|
|
154
|
-
import { RunnerBase
|
|
105
|
+
import { RunnerBase } from './RunnerBase.js';
|
|
155
106
|
import { clampIterations, validateMemoryIdUniqueness, validateToolNameUniqueness, } from './agent/validators.js';
|
|
156
107
|
import { buildRouteDeciderStage } from './agent/stages/route.js';
|
|
157
108
|
import { negativeCheckpointOf } from './agent/negativeClaims/checkpoint.js';
|
|
@@ -163,7 +114,7 @@ import { withAnswerCoverage } from './agent/stages/answerCoverage.js';
|
|
|
163
114
|
import { AnswerValidationError, resolveAnswerValidation, } from '../answer-validation/index.js';
|
|
164
115
|
import { buildSeedStage } from './agent/stages/seed.js';
|
|
165
116
|
import { buildCallLLMStage } from './agent/stages/callLLM.js';
|
|
166
|
-
import { buildToolCallsHandler, notServedResult } from './agent/stages/toolCalls.js';
|
|
117
|
+
import { buildToolCallsHandler, notServedResult } from './agent/stages/toolCalls/index.js';
|
|
167
118
|
import { buildToolResolver } from './agent/stages/toolResolver.js';
|
|
168
119
|
import { answeredValuesOf, declaredDefaultsFrom } from './agent/stages/route.js';
|
|
169
120
|
import { isRefused, rulesOf } from '../tools/declare.js';
|
|
@@ -180,40 +131,15 @@ import { buildToolRegistry } from './agent/buildToolRegistry.js';
|
|
|
180
131
|
import { AgentBuilder } from './agent/AgentBuilder.js';
|
|
181
132
|
import { buildThinkingSubflow } from './slots/buildThinkingSubflow.js';
|
|
182
133
|
import { thinkingForProviders } from '../thinking/dispatch.js';
|
|
134
|
+
import { TOOL_TEARDOWN_STAGE_ID, LATE_ARTIFACT_FACT_STAGE_ID, RUN_MANIFEST_STAGE_ID, INTEGRITY_DISPOSITION_STAGE_ID, GRAPH_DECLARED_STAGE_ID, } from './agent/run/eventStageIds.js';
|
|
135
|
+
import { requireKeepLedgerFacts, resolveKeepLedgerFacts } from './agent/run/ledgerFacts.js';
|
|
136
|
+
import { withoutTime } from './agent/run/withoutTime.js';
|
|
137
|
+
import { resumeRedactionOf } from './agent/run/resumeRedaction.js';
|
|
138
|
+
import { draftAgentClock, clockForSeed, readAgentTime, agentTimeAnswerContext, } from './agent/run/clocks.js';
|
|
183
139
|
export { AgentBuilder };
|
|
184
140
|
// Public types (AgentOptions, AgentInput, AgentOutput) extracted to
|
|
185
141
|
// ./agent/types.ts and re-exported above (v2.11.1).
|
|
186
142
|
// AgentState extracted to ./agent/types.ts (v2.11.1).
|
|
187
|
-
/**
|
|
188
|
-
* The ledger-fact hold's default ceiling (9.102.0): how many fact turns the
|
|
189
|
-
* window holds beyond `keepRecentTurns` when `.findings()` and a window
|
|
190
|
-
* strategy are both configured and nobody named a number. Resolved in the
|
|
191
|
-
* constructor, ONCE, and threaded to `buildWindowStage` as a plain number —
|
|
192
|
-
* the stage applies no default of its own (absent = unarmed = no hold), so a
|
|
193
|
-
* reader has one place to look. `window/options.ts ·
|
|
194
|
-
* DEFAULT_KEEP_LAST_TOOL_RESULTS` is the pin's twin of this constant.
|
|
195
|
-
*/
|
|
196
|
-
const DEFAULT_KEEP_LEDGER_FACTS = 4;
|
|
197
|
-
/**
|
|
198
|
-
* Validate the `keepLedgerFacts` dial — `window/options.ts ·
|
|
199
|
-
* requireKeepLastToolResults`'s twin: the same rule, the same moment.
|
|
200
|
-
* Refused at construction, never mid-run.
|
|
201
|
-
*/
|
|
202
|
-
function requireKeepLedgerFacts(value, label) {
|
|
203
|
-
if (value === false)
|
|
204
|
-
return;
|
|
205
|
-
if (!Number.isInteger(value) || value < 0) {
|
|
206
|
-
throw new Error(`${label}: keepLedgerFacts must be a whole number >= 0, or false, got ` +
|
|
207
|
-
`${String(value)}. It is how many fact turns the window holds beyond ` +
|
|
208
|
-
`keepRecentTurns under .findings(); 0 and false both switch the hold off.`);
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
/** `false` → `0`; a number as named; nothing named → the default. */
|
|
212
|
-
function resolveKeepLedgerFacts(named) {
|
|
213
|
-
if (named === false)
|
|
214
|
-
return 0;
|
|
215
|
-
return named ?? DEFAULT_KEEP_LEDGER_FACTS;
|
|
216
|
-
}
|
|
217
143
|
export class Agent extends RunnerBase {
|
|
218
144
|
name;
|
|
219
145
|
id;
|
|
@@ -316,7 +242,6 @@ export class Agent extends RunnerBase {
|
|
|
316
242
|
skillGraphCascade;
|
|
317
243
|
/** Side channel for the conversation's inherited skill cursor (SG-C) —
|
|
318
244
|
* stashed by `applyContinuation`, consumed-and-cleared by seed. */
|
|
319
|
-
pendingResumeSkillCursor;
|
|
320
245
|
pricingTable;
|
|
321
246
|
/** Normalized at construction: a bare number is `{ usd, onExceed: 'warn' }`. */
|
|
322
247
|
costBudget;
|
|
@@ -383,18 +308,15 @@ export class Agent extends RunnerBase {
|
|
|
383
308
|
* cleared when `run()` ends, so a later turn this agent did not start (its
|
|
384
309
|
* chart mounted in a composition) never stamps a clock nobody declared for
|
|
385
310
|
* it (`seedClockDraft`). */
|
|
386
|
-
runClockDraft;
|
|
387
311
|
/** The incoming request each of this agent's OWN scopes serves — recorded
|
|
388
312
|
* by the executor that made the scope (`createExecutor`), so a scope keeps
|
|
389
313
|
* ITS run's request for as long as it lives: a stage still running after
|
|
390
314
|
* its run was aborted can never be served the next run's request. A stage
|
|
391
315
|
* mounted in another runner's executor reads its run's request by link
|
|
392
316
|
* (`memberRun.ts`). Never written to scope. */
|
|
393
|
-
scopeRequests = new WeakMap();
|
|
394
317
|
/** The `time` the CURRENT resume passed, as read — TAKEN once by the first
|
|
395
318
|
* ToolCalls pass of the resumed leg (`ToolCallsHandlerDeps.time`), and
|
|
396
319
|
* cleared when `run()` or `resume()` ends. */
|
|
397
|
-
resumePassedTime;
|
|
398
320
|
/** Tool choice by classifier (9.105.0, `.toolChoice()`): the classifier,
|
|
399
321
|
* the serve dial and the app's own doors. Threaded to the tools slot (the
|
|
400
322
|
* pick and the narrowing), to call-llm (`toolChoice: true`, the outcome
|
|
@@ -438,13 +360,6 @@ export class Agent extends RunnerBase {
|
|
|
438
360
|
/** The message chain (`.messageMiddleware()`), in declaration order. Empty
|
|
439
361
|
* keeps seed synchronous and prepare-final untouched. */
|
|
440
362
|
messageMiddleware;
|
|
441
|
-
/** The instrument the window stage reads mid-run (adapter-reported usage +
|
|
442
|
-
* per-message provenance). Only ever created alongside a strategy. */
|
|
443
|
-
compactionMeterHandle;
|
|
444
|
-
/** The window stage's seam to the receipt (9.93.0): what left the window at
|
|
445
|
-
* this iteration's head, read by the call-llm mint in the same iteration.
|
|
446
|
-
* Only ever created alongside a strategy, like the meter. */
|
|
447
|
-
evictedTurnsHandle;
|
|
448
363
|
/** Snapshot read-tracking policy (#18/#14) — forwarded to the internal
|
|
449
364
|
* executor. Agent default is `'summary'` (cheap markers), NOT
|
|
450
365
|
* footprintjs's `'full'`. See AgentOptions.readTracking. */
|
|
@@ -494,9 +409,6 @@ export class Agent extends RunnerBase {
|
|
|
494
409
|
* plumbing, never scope state). `run()` resets it; the run boundary
|
|
495
410
|
* files its report and clears it.
|
|
496
411
|
*/
|
|
497
|
-
integrityLedgerHolder = {
|
|
498
|
-
current: undefined,
|
|
499
|
-
};
|
|
500
412
|
/** Set at chart build: whether any tool in the FULL declared catalog
|
|
501
413
|
* (static registry + skill-carried tools) declared `argumentsFrom`. */
|
|
502
414
|
integrityDanglingPresent = false;
|
|
@@ -531,9 +443,6 @@ export class Agent extends RunnerBase {
|
|
|
531
443
|
* every `run()` / `resume()` so one run can never raise on another's block,
|
|
532
444
|
* and cleared per service the moment that credential is issued.
|
|
533
445
|
*/
|
|
534
|
-
consentOutstanding = new Map();
|
|
535
|
-
/** Evidence bridge (#5) — present iff a CAUSAL memory is mounted. */
|
|
536
|
-
causalEvidence;
|
|
537
446
|
/** Observer delivery tier (RFC-001 Block 10). `'inline'` (default) is
|
|
538
447
|
* byte-identical to pre-10 releases; `'deferred'` routes the bridge
|
|
539
448
|
* recorders + consumer attachments through footprintjs's bounded
|
|
@@ -552,11 +461,6 @@ export class Agent extends RunnerBase {
|
|
|
552
461
|
appName;
|
|
553
462
|
commentaryTemplates;
|
|
554
463
|
thinkingTemplates;
|
|
555
|
-
currentRunContext = {
|
|
556
|
-
runStartMs: 0,
|
|
557
|
-
runId: 'pending',
|
|
558
|
-
compositionPath: [],
|
|
559
|
-
};
|
|
560
464
|
/**
|
|
561
465
|
* The typed ask the CURRENT run's resume answered — set by
|
|
562
466
|
* `resume()` when a person's answer completed an `awaitingInput`, cleared
|
|
@@ -565,8 +469,6 @@ export class Agent extends RunnerBase {
|
|
|
565
469
|
* `ToolCallsHandlerDeps.answeredAsk`. The count crosses checkpoints on the
|
|
566
470
|
* awaiting-input shape itself (`repeat.count`), not here.
|
|
567
471
|
*/
|
|
568
|
-
answeredAsk;
|
|
569
|
-
// `lastExecutor` is now inherited as a protected field from RunnerBase
|
|
570
472
|
// (single canonical source for footprintjs snapshot access across all
|
|
571
473
|
// runners). Agent's `getLastSnapshot()` delegates to the inherited
|
|
572
474
|
// implementation but is kept here for the JSDoc + clearer return type.
|
|
@@ -610,28 +512,21 @@ export class Agent extends RunnerBase {
|
|
|
610
512
|
* instead of starting fresh, and appends this turn's user entry when
|
|
611
513
|
* `appendsUserTurn` says so. Cleared on first read so subsequent runs
|
|
612
514
|
* start clean. */
|
|
613
|
-
pendingResumeHistory;
|
|
614
515
|
/** Retried request's repair state; never inherited by a new human turn. */
|
|
615
|
-
pendingEvidenceRecovery;
|
|
616
516
|
/** Its sibling for the folded spans. A restored conversation that dropped
|
|
617
517
|
* them would carry summaries nobody could unpack — the evidence would be
|
|
618
518
|
* destroyed by the act of continuing, which is the one thing retention
|
|
619
519
|
* exists to prevent. Cleared on first read, exactly like the history. */
|
|
620
|
-
pendingResumeFolded;
|
|
621
520
|
/** Its sibling for the findings ledger (9.101.0) — the model's standings
|
|
622
521
|
* on results this process never saw, carried by the checkpoint and
|
|
623
522
|
* restored as a stored record. Cleared on first read, like the history. */
|
|
624
|
-
pendingResumeFindingsLedger;
|
|
625
523
|
/** The last completed run's final answer — see `checkpoint()` for why it is
|
|
626
524
|
* kept here rather than read back from the recording. Undefined after a run
|
|
627
525
|
* that failed or paused. */
|
|
628
|
-
lastRunAnswer;
|
|
629
526
|
/** Last run's checkpoint owner, including explicit replay edits from a failed child stage. */
|
|
630
|
-
checkpointTracker;
|
|
631
527
|
/** Whether any run on this instance got past input admission — so a
|
|
632
528
|
* refused FIRST turn is reported as 'never-run', never as "continue from
|
|
633
529
|
* your earlier accepted checkpoint" when there is none. */
|
|
634
|
-
hadAdmittedRun = false;
|
|
635
530
|
/** The id the CONSUMER chose, or undefined when they took the default.
|
|
636
531
|
* `this.id` cannot answer that question — it is `'agent'` either way — and
|
|
637
532
|
* the stored-conversation fingerprint refuses only on ids somebody picked
|
|
@@ -647,28 +542,22 @@ export class Agent extends RunnerBase {
|
|
|
647
542
|
* paused run's own record (`agent/callerIdentity.ts · callerIdentityOf`).
|
|
648
543
|
* A resume that inherited it instead stored another person's identity on
|
|
649
544
|
* a shared agent and none on a rebuilt pooled one. */
|
|
650
|
-
lastRunIdentity;
|
|
651
545
|
/** Run ids this instance minted, most recent last (bounded) — evidence that a
|
|
652
546
|
* checkpoint's `{ conversationId: '<runId>' }` is the per-run default
|
|
653
547
|
* (`agent/callerIdentity.ts`). */
|
|
654
|
-
mintedRunIds = new Set();
|
|
655
548
|
/** The self-explain evidence key of the run in flight (or served last):
|
|
656
549
|
* its session, else a host's per-request key, else undefined
|
|
657
550
|
* (`agent/servingConversation.ts`). */
|
|
658
|
-
servingConversation;
|
|
659
551
|
/** How long ONE tool teardown may take before the runner stops waiting.
|
|
660
552
|
* See `AgentOptions.toolTeardownTimeoutMs`. */
|
|
661
553
|
toolTeardownTimeoutMs;
|
|
662
554
|
/** The run in flight, by id — the whole of the one-turn-at-a-time guard.
|
|
663
555
|
* Set before the executor is built and cleared in `finally`, so a run that
|
|
664
556
|
* throws does not leave the agent permanently refusing. */
|
|
665
|
-
inFlightRunId;
|
|
666
557
|
/** The scopes this agent's OWN executors made — see the `isOwnRun` seed dep. */
|
|
667
|
-
ownScopes = new WeakSet();
|
|
668
558
|
/** The question a person still owes this agent an answer to. Set when a run
|
|
669
559
|
* ends paused, cleared by `resume()`, `abandonPause()`, or a run that
|
|
670
560
|
* completes. Read by the `run()` guard — see `PendingQuestionError`. */
|
|
671
|
-
pendingQuestion;
|
|
672
561
|
/** The `.selfExplain()` binding, when the builder mounted one. Held so
|
|
673
562
|
* `canExplain()` can answer the same question the trace tools answer, from
|
|
674
563
|
* the same fact. Undefined on every agent that never called `.selfExplain()`. */
|
|
@@ -741,9 +630,6 @@ export class Agent extends RunnerBase {
|
|
|
741
630
|
/** `AgentOptions.recordReceipt` (9.88.0) — ON by default. `false` declines
|
|
742
631
|
* the mint at `callLLM`; nothing else about the run changes. */
|
|
743
632
|
recordReceiptValue = true;
|
|
744
|
-
/** The receipt memo every call of a run mints through — one per agent,
|
|
745
|
-
* rebinding itself to each run id (`core/agent/receipt/receiptDigests.ts`). */
|
|
746
|
-
receiptDigests = createReceiptDigests();
|
|
747
633
|
answerValidationConfig;
|
|
748
634
|
negativeClaimsConfig;
|
|
749
635
|
typedNegativeClaimsConfig;
|
|
@@ -753,11 +639,15 @@ export class Agent extends RunnerBase {
|
|
|
753
639
|
// Which conversation this instance's self-explain evidence belongs to —
|
|
754
640
|
// held in a module registry, not on the class, so it is not public API
|
|
755
641
|
// (`agent/servingConversation.ts`).
|
|
756
|
-
registerServingConversation(this, () =>
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
642
|
+
registerServingConversation(this, () => {
|
|
643
|
+
const selected = this.runExecution().selected();
|
|
644
|
+
const conversation = selected?.value.servingConversation;
|
|
645
|
+
return {
|
|
646
|
+
conversation,
|
|
647
|
+
runId: selected?.context.runId ?? 'pending',
|
|
648
|
+
...(conversation?.startsWith('hosted:') === true && { oneShot: true }),
|
|
649
|
+
};
|
|
650
|
+
});
|
|
761
651
|
this.negativeClaimsConfig = negativeClaimsConfig;
|
|
762
652
|
this.typedNegativeClaimsConfig =
|
|
763
653
|
negativeClaimsConfig?.mode === 'typed' ? negativeClaimsConfig : undefined;
|
|
@@ -850,20 +740,6 @@ export class Agent extends RunnerBase {
|
|
|
850
740
|
// Eager validation: memory ids must be unique so per-id scope keys
|
|
851
741
|
// (`memoryInjection_${id}`) don't collide.
|
|
852
742
|
validateMemoryIdUniqueness(memories);
|
|
853
|
-
// Evidence bridge (#5): a CAUSAL memory gets a run-scoped harvest recorder
|
|
854
|
-
// (decisions/toolCalls/iterations/duration/tokens). Attached per run below;
|
|
855
|
-
// its `collect` is threaded into the write mount via chartDeps.
|
|
856
|
-
if (memories.some((m) => m.type === 'causal')) {
|
|
857
|
-
const evidence = causalEvidenceRecorder();
|
|
858
|
-
this.causalEvidence = evidence;
|
|
859
|
-
// A causal memory is working state: its store keeps what a later run
|
|
860
|
-
// replays to the MODEL, so its tool calls are read on the real-value
|
|
861
|
-
// path, never off the served events — a policy keeps a run's records
|
|
862
|
-
// clean, never what the agent will compute on (`src/redaction/`). The
|
|
863
|
-
// decisions it keeps come from footprintjs's flow channel, which serves
|
|
864
|
-
// them under the policy (a named limit in `src/redaction/README.md`).
|
|
865
|
-
this.dispatcher.onRealEvent((event) => evidence.onEmit({ name: event.type, payload: event.payload }));
|
|
866
|
-
}
|
|
867
743
|
// A dial without its switch — refused rather than run as a no-op (8.13.0).
|
|
868
744
|
// Same policy as `observerDeliveryOptions` below; the message and the check
|
|
869
745
|
// are shared with LLMCall, which takes the identical pair.
|
|
@@ -958,20 +834,8 @@ export class Agent extends RunnerBase {
|
|
|
958
834
|
// (attached per run, cleared between runs like every other recorder)
|
|
959
835
|
// because the window stage closes over it at chart-build time — and the
|
|
960
836
|
// chart is built once.
|
|
961
|
-
if (windowStrategy !== undefined)
|
|
837
|
+
if (windowStrategy !== undefined)
|
|
962
838
|
this.windowStrategy = windowStrategy;
|
|
963
|
-
const meter = compactionMeter();
|
|
964
|
-
this.compactionMeterHandle = meter;
|
|
965
|
-
this.evictedTurnsHandle = createEvictedTurnsHandle();
|
|
966
|
-
// The provider's token count is a MEASUREMENT the window decides on, so
|
|
967
|
-
// the meter reads it on the real-value path, never off the served event:
|
|
968
|
-
// a redaction pattern that happens to match `input` must not switch
|
|
969
|
-
// compaction off (`src/redaction/runRedaction.ts`).
|
|
970
|
-
this.dispatcher.onRealEvent((event) => {
|
|
971
|
-
if (event.type === 'agentfootprint.stream.llm_end')
|
|
972
|
-
meter.noteLlmEnd(event.payload);
|
|
973
|
-
});
|
|
974
|
-
}
|
|
975
839
|
// The two governance chains. Empty arrays (not undefined) so every read
|
|
976
840
|
// site is a plain `.length > 0` test rather than an optional dance.
|
|
977
841
|
this.toolMiddleware = toolMiddleware ?? [];
|
|
@@ -1200,20 +1064,60 @@ export class Agent extends RunnerBase {
|
|
|
1200
1064
|
this.appName = voice.appName;
|
|
1201
1065
|
this.commentaryTemplates = voice.commentaryTemplates;
|
|
1202
1066
|
this.thinkingTemplates = voice.thinkingTemplates;
|
|
1203
|
-
//
|
|
1204
|
-
//
|
|
1205
|
-
//
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1067
|
+
// Build the chart once. Private executable tool catalogs and their domain
|
|
1068
|
+
// handlers are initialized in the actual native component, shared with
|
|
1069
|
+
// its internal charts and isolated from other mounts and admissions.
|
|
1070
|
+
this.initChart(() => this.buildChart(), {
|
|
1071
|
+
runnerId: this.id,
|
|
1072
|
+
compositionPath: [`Agent:${this.id}`],
|
|
1073
|
+
initialize: () => {
|
|
1074
|
+
const values = createAgentRunValues({ window: this.windowStrategy !== undefined });
|
|
1075
|
+
this.beginIntegrityLedger(values);
|
|
1076
|
+
return values;
|
|
1077
|
+
},
|
|
1078
|
+
options: {
|
|
1079
|
+
readTracking: this.readTracking,
|
|
1080
|
+
commitValues: this.commitValues,
|
|
1081
|
+
writeProvenance: this.writeProvenance,
|
|
1082
|
+
},
|
|
1083
|
+
componentSetup: (component, value, entry) => {
|
|
1084
|
+
value.resources = componentResources(component, () => this.toolSessions());
|
|
1085
|
+
if (entry?.kind === 'resume')
|
|
1086
|
+
value.resources.expectAnswer();
|
|
1087
|
+
const observers = agentComponentObservers(component, value, entry, {
|
|
1088
|
+
causal: this.memories.some((memory) => memory.type === 'causal'),
|
|
1089
|
+
window: this.windowStrategy !== undefined,
|
|
1090
|
+
});
|
|
1091
|
+
return {
|
|
1092
|
+
recorder: observers.recorder,
|
|
1093
|
+
bindScope: (scope) => {
|
|
1094
|
+
const run = this.runExecution().forScope(scope);
|
|
1095
|
+
value.resources?.bindReporter((status) => captureLateEmitter(scope, TOOL_TEARDOWN_STAGE_ID)?.('agentfootprint.tools.resource_restore', status));
|
|
1096
|
+
bindScopeComputation(scope, {
|
|
1097
|
+
owner: component,
|
|
1098
|
+
retired: () => run.retired,
|
|
1099
|
+
emit: observers.emit,
|
|
1100
|
+
});
|
|
1101
|
+
},
|
|
1102
|
+
};
|
|
1103
|
+
},
|
|
1104
|
+
});
|
|
1105
|
+
const live = runnerLive(this);
|
|
1106
|
+
if (live === undefined)
|
|
1107
|
+
throw new TypeError('Agent live taps were not initialized');
|
|
1108
|
+
registerRunnerLive(this, {
|
|
1109
|
+
...live,
|
|
1110
|
+
turn: hostedTurns(this.runExecution(), {
|
|
1111
|
+
run: (run, input, options) => this.runOwned(run, input, options),
|
|
1112
|
+
resume: (run, checkpoint, input, options) => this.resumeOwned(run, checkpoint, input, options),
|
|
1113
|
+
prepareResume: (checkpoint) => this.noteResumeTakenUp(checkpoint),
|
|
1114
|
+
checkpoint: (run) => this.checkpointFor(run),
|
|
1115
|
+
}),
|
|
1116
|
+
pause: {
|
|
1117
|
+
capture: (outcome) => capturePauseOwnership(this.runExecution().selected()?.value, outcome),
|
|
1118
|
+
abandon: (checkpoint) => this.runExecution().withRun(() => abandonStoredPause(checkpoint, () => this.toolSessions())),
|
|
1119
|
+
},
|
|
1120
|
+
});
|
|
1217
1121
|
}
|
|
1218
1122
|
static create(opts) {
|
|
1219
1123
|
return new AgentBuilder(opts);
|
|
@@ -1259,13 +1163,26 @@ export class Agent extends RunnerBase {
|
|
|
1259
1163
|
* The one difference is the timeline's filter: a recording filed FOR a
|
|
1260
1164
|
* person keeps only the events of that person's run.
|
|
1261
1165
|
*/
|
|
1262
|
-
startRunRecording() {
|
|
1166
|
+
startRunRecording(invocation) {
|
|
1263
1167
|
if (this.artifactRecordings === undefined || this.artifactStore === undefined)
|
|
1264
1168
|
return undefined;
|
|
1265
1169
|
// Only THIS run's events: on an instance serving several sessions, the
|
|
1266
1170
|
// hosting door emits facts for other sessions while this run is in flight,
|
|
1267
1171
|
// and a recording is redeemable by the person it was filed for.
|
|
1268
|
-
|
|
1172
|
+
const recording = recordRunWhere(this, (event) => invocation.run.origin !== undefined && eventBelongsToRun(event.meta, invocation.context()));
|
|
1173
|
+
let outcome;
|
|
1174
|
+
// Registered before component setup. Native reverse finalization joins
|
|
1175
|
+
// resource cleanup first, then files this recording, then detaches it.
|
|
1176
|
+
invocation.run.onFinalize(() => recording.stop());
|
|
1177
|
+
invocation.run.onFinalize(async () => {
|
|
1178
|
+
if (outcome !== undefined)
|
|
1179
|
+
await this.fileRunRecording(invocation, recording, outcome);
|
|
1180
|
+
});
|
|
1181
|
+
return {
|
|
1182
|
+
complete(value) {
|
|
1183
|
+
outcome = value;
|
|
1184
|
+
},
|
|
1185
|
+
};
|
|
1269
1186
|
}
|
|
1270
1187
|
/**
|
|
1271
1188
|
* Does `event` belong to the run this agent is serving (or served last)? The
|
|
@@ -1276,13 +1193,14 @@ export class Agent extends RunnerBase {
|
|
|
1276
1193
|
* @internal
|
|
1277
1194
|
*/
|
|
1278
1195
|
ownsEvent(event) {
|
|
1279
|
-
|
|
1196
|
+
const selected = this.runExecution().selected();
|
|
1197
|
+
return selected !== undefined && eventBelongsToRun(event.meta, selected.context);
|
|
1280
1198
|
}
|
|
1281
1199
|
/**
|
|
1282
1200
|
* File the finished recording into the artifact store.
|
|
1283
1201
|
*
|
|
1284
1202
|
* ── When ────────────────────────────────────────────────────────────────
|
|
1285
|
-
* After the answer
|
|
1203
|
+
* After the answer and joined component resource cleanup, only for a run that COMPLETED. A pause
|
|
1286
1204
|
* is not a finished run (the turn continues, and the resume mints its own);
|
|
1287
1205
|
* a throw never reaches here at all.
|
|
1288
1206
|
*
|
|
@@ -1306,14 +1224,14 @@ export class Agent extends RunnerBase {
|
|
|
1306
1224
|
* The recording is FROZEN before the mint, so it can never contain the
|
|
1307
1225
|
* `artifacts.minted` event describing itself.
|
|
1308
1226
|
*/
|
|
1309
|
-
async fileRunRecording(recorder, outcome) {
|
|
1227
|
+
async fileRunRecording(invocation, recorder, outcome) {
|
|
1310
1228
|
const store = this.artifactStore;
|
|
1311
1229
|
if (recorder === undefined || store === undefined || this.artifactRecordings === undefined) {
|
|
1312
1230
|
return;
|
|
1313
1231
|
}
|
|
1314
1232
|
if (isPaused(outcome))
|
|
1315
1233
|
return;
|
|
1316
|
-
const runId =
|
|
1234
|
+
const runId = invocation.context().runId;
|
|
1317
1235
|
let input;
|
|
1318
1236
|
try {
|
|
1319
1237
|
const recording = recorder.toRecording();
|
|
@@ -1329,7 +1247,7 @@ export class Agent extends RunnerBase {
|
|
|
1329
1247
|
return;
|
|
1330
1248
|
}
|
|
1331
1249
|
try {
|
|
1332
|
-
const result = await store.put(this.runArtifactScope(), input);
|
|
1250
|
+
const result = await store.put(this.runArtifactScope(invocation), input);
|
|
1333
1251
|
// Sweeps ride the put result, so retention that evicted an older
|
|
1334
1252
|
// recording to make room says so on the record — the same law a tool's
|
|
1335
1253
|
// own mint follows.
|
|
@@ -1373,14 +1291,14 @@ export class Agent extends RunnerBase {
|
|
|
1373
1291
|
* the one the run's tools used, and a recording filed in a different scope
|
|
1374
1292
|
* from the artifacts it describes is a recording nobody can find.
|
|
1375
1293
|
*/
|
|
1376
|
-
runArtifactScope() {
|
|
1377
|
-
const identity =
|
|
1294
|
+
runArtifactScope(invocation) {
|
|
1295
|
+
const identity = invocation.view.snapshot()?.sharedState
|
|
1378
1296
|
?.runIdentity;
|
|
1379
1297
|
if (identity === undefined) {
|
|
1380
1298
|
// No state to read means no run happened, which this path cannot reach —
|
|
1381
1299
|
// but a scope is required and inventing a tenant would be worse than a
|
|
1382
1300
|
// conversation id that names the run itself.
|
|
1383
|
-
return { conversationId:
|
|
1301
|
+
return { conversationId: invocation.context().runId };
|
|
1384
1302
|
}
|
|
1385
1303
|
return {
|
|
1386
1304
|
conversationId: identity.conversationId,
|
|
@@ -1426,14 +1344,13 @@ export class Agent extends RunnerBase {
|
|
|
1426
1344
|
* read or write of a selected key reads `[REDACTED]`, and an `[emit]` line
|
|
1427
1345
|
* shows the event's served payload (`src/redaction/runRedaction.ts`).
|
|
1428
1346
|
*/
|
|
1347
|
+
/** Empty during preparation before native origin; capture prior entries before the next call. */
|
|
1429
1348
|
getLastNarrativeEntries() {
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
// nothing — its narrative was written under no rule anyone knows.
|
|
1434
|
-
if (coverageOfExecutor(this.lastExecutor).state === 'unknown')
|
|
1349
|
+
const selected = this.runExecution().selected();
|
|
1350
|
+
const coverage = selected?.value.redaction?.coverage;
|
|
1351
|
+
if (selected === undefined || coverage === undefined || coverage.state === 'unknown')
|
|
1435
1352
|
return [];
|
|
1436
|
-
return
|
|
1353
|
+
return selected.view.getNarrativeEntries();
|
|
1437
1354
|
}
|
|
1438
1355
|
/**
|
|
1439
1356
|
* The FlowChart compiled for the most recent run (or a freshly-built
|
|
@@ -1518,7 +1435,7 @@ export class Agent extends RunnerBase {
|
|
|
1518
1435
|
* `OutputSchemaError` — hand it to the 3-tier fallback. The one settle for
|
|
1519
1436
|
* `parseOutputAsync`'s parse failure and `runTyped`'s native stop failure.
|
|
1520
1437
|
*/
|
|
1521
|
-
async settleTypedFailure(raw, err) {
|
|
1438
|
+
async settleTypedFailure(raw, err, invocation) {
|
|
1522
1439
|
const parser = this.outputSchemaParser;
|
|
1523
1440
|
if (!this.outputFallbackCfg || !(err instanceof OutputSchemaError))
|
|
1524
1441
|
throw err;
|
|
@@ -1534,13 +1451,16 @@ export class Agent extends RunnerBase {
|
|
|
1534
1451
|
type: eventType,
|
|
1535
1452
|
timestamp: Date.now(),
|
|
1536
1453
|
payload,
|
|
1454
|
+
...(invocation !== undefined && {
|
|
1455
|
+
meta: buildEventMeta({ runtimeStageId: '__typed_output__' }, invocation.context()),
|
|
1456
|
+
}),
|
|
1537
1457
|
});
|
|
1538
1458
|
}
|
|
1539
1459
|
catch {
|
|
1540
1460
|
/* observability errors must not poison the fallback path */
|
|
1541
1461
|
}
|
|
1542
1462
|
};
|
|
1543
|
-
return applyOutputFallback(raw, parser, this.outputFallbackCfg, emit, err, this.
|
|
1463
|
+
return applyOutputFallback(raw, parser, this.outputFallbackCfg, emit, err, invocation === undefined ? undefined : this.retriesSpent(invocation));
|
|
1544
1464
|
}
|
|
1545
1465
|
/**
|
|
1546
1466
|
* Corrective re-asks the agent's LAST run paid for, read off its own ledger.
|
|
@@ -1549,8 +1469,8 @@ export class Agent extends RunnerBase {
|
|
|
1549
1469
|
* any string, including one that never came from this agent, and reporting
|
|
1550
1470
|
* `0` for "I do not know" would be an invented fact in an event payload.
|
|
1551
1471
|
*/
|
|
1552
|
-
|
|
1553
|
-
const state =
|
|
1472
|
+
retriesSpent(invocation) {
|
|
1473
|
+
const state = invocation.view.snapshot()?.sharedState;
|
|
1554
1474
|
if (state === undefined)
|
|
1555
1475
|
return undefined;
|
|
1556
1476
|
return Math.max(0, (state.outputAttempts?.length ?? 1) - 1);
|
|
@@ -1571,36 +1491,43 @@ export class Agent extends RunnerBase {
|
|
|
1571
1491
|
* `agent.answerCoverage()`.
|
|
1572
1492
|
*/
|
|
1573
1493
|
async runTyped(input, options) {
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
`Agent.
|
|
1577
|
-
|
|
1578
|
-
const out = await this.run(input, options);
|
|
1579
|
-
if (typeof out !== 'string') {
|
|
1580
|
-
throw new Error('Agent.runTyped: run paused — typed mode does not support pauses. ' +
|
|
1581
|
-
'Use agent.run() + agent.parseOutput(...) after resume.');
|
|
1582
|
-
}
|
|
1583
|
-
// `strategy: 'native'`: an answer whose last attempt failed on a refusal
|
|
1584
|
-
// or truncation stop is refused here even when its text parses — the
|
|
1585
|
-
// format did not hold for it (outputEnforcement.ts · nativeStopFailure).
|
|
1586
|
-
// FIRST, before any delivery path. It takes the same path a parse failure
|
|
1587
|
-
// takes, `.outputFallback()` included.
|
|
1588
|
-
const stopped = this.outputEnforcement?.outputFormat !== undefined ? this.outputContractUnmet() : undefined;
|
|
1589
|
-
if (stopped?.stopReason !== undefined) {
|
|
1590
|
-
return this.settleTypedFailure(out, new OutputSchemaError(stopped.error, { rawOutput: out, stage: stopped.stage }));
|
|
1591
|
-
}
|
|
1592
|
-
if (this.answerValidationConfig !== undefined) {
|
|
1593
|
-
// The validator judged the schema's JSON output. Do not run a transforming
|
|
1594
|
-
// or stateful parser again and hand back a value the validator never saw.
|
|
1595
|
-
if (this.answerValidation()?.schemaAccepted !== true) {
|
|
1596
|
-
throw new OutputSchemaError('Answer validation could not establish a JSON schema result.', {
|
|
1597
|
-
rawOutput: out,
|
|
1598
|
-
stage: 'schema-validate',
|
|
1599
|
-
});
|
|
1494
|
+
return this.runExecution().withRun(async (invocation) => {
|
|
1495
|
+
if (!this.outputSchemaParser) {
|
|
1496
|
+
throw new Error(`Agent.runTyped: this agent has no outputSchema. Use ` +
|
|
1497
|
+
`Agent.create({...}).outputSchema(parser).build() to enable typed output.`);
|
|
1600
1498
|
}
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1499
|
+
const out = await this.runOwned(invocation, input, options);
|
|
1500
|
+
if (typeof out !== 'string') {
|
|
1501
|
+
throw new Error('Agent.runTyped: run paused — typed mode does not support pauses. ' +
|
|
1502
|
+
'Use agent.run() + agent.parseOutput(...) after resume.');
|
|
1503
|
+
}
|
|
1504
|
+
// `strategy: 'native'`: an answer whose last attempt failed on a refusal
|
|
1505
|
+
// or truncation stop is refused here even when its text parses — the
|
|
1506
|
+
// format did not hold for it (outputEnforcement.ts · nativeStopFailure).
|
|
1507
|
+
// FIRST, before any delivery path. It takes the same path a parse failure
|
|
1508
|
+
// takes, `.outputFallback()` included.
|
|
1509
|
+
const stopped = this.outputEnforcement?.outputFormat !== undefined ? this.outputContractUnmet() : undefined;
|
|
1510
|
+
if (stopped?.stopReason !== undefined) {
|
|
1511
|
+
return this.settleTypedFailure(out, new OutputSchemaError(stopped.error, { rawOutput: out, stage: stopped.stage }), invocation);
|
|
1512
|
+
}
|
|
1513
|
+
if (this.answerValidationConfig !== undefined) {
|
|
1514
|
+
// The validator judged the schema's JSON output. Do not run a transforming
|
|
1515
|
+
// or stateful parser again and hand back a value the validator never saw.
|
|
1516
|
+
if (this.answerValidation()?.schemaAccepted !== true) {
|
|
1517
|
+
throw new OutputSchemaError('Answer validation could not establish a JSON schema result.', {
|
|
1518
|
+
rawOutput: out,
|
|
1519
|
+
stage: 'schema-validate',
|
|
1520
|
+
});
|
|
1521
|
+
}
|
|
1522
|
+
return applyOutputSchema(out, { parse: (value) => value });
|
|
1523
|
+
}
|
|
1524
|
+
try {
|
|
1525
|
+
return applyOutputSchema(out, this.outputSchemaParser);
|
|
1526
|
+
}
|
|
1527
|
+
catch (error) {
|
|
1528
|
+
return this.settleTypedFailure(out, error, invocation);
|
|
1529
|
+
}
|
|
1530
|
+
});
|
|
1604
1531
|
}
|
|
1605
1532
|
/**
|
|
1606
1533
|
* Answer one turn.
|
|
@@ -1640,6 +1567,10 @@ export class Agent extends RunnerBase {
|
|
|
1640
1567
|
* ```
|
|
1641
1568
|
*/
|
|
1642
1569
|
async run(input, options) {
|
|
1570
|
+
return this.runExecution().withRun((invocation) => this.runOwned(invocation, input, options));
|
|
1571
|
+
}
|
|
1572
|
+
async runOwned(invocation, input, options) {
|
|
1573
|
+
invocation.value.hadAdmitted = invocation.previous?.value.hadAdmitted === true;
|
|
1643
1574
|
// Normalize or refuse BEFORE anything is created. A bare string is the
|
|
1644
1575
|
// message; anything that is not a message is named and refused here
|
|
1645
1576
|
// rather than becoming `content: undefined` inside the messages slot.
|
|
@@ -1669,13 +1600,12 @@ export class Agent extends RunnerBase {
|
|
|
1669
1600
|
// never on the server's zone.
|
|
1670
1601
|
const clockDraft = this.clockDraftFor(runInput.time ?? options?.time, 'Agent.run');
|
|
1671
1602
|
// The engine's options; the run's signal (and its deadline) is armed just
|
|
1672
|
-
// before
|
|
1603
|
+
// before native execution, whose lifecycle releases it.
|
|
1673
1604
|
const engineOptions = withoutTime(options);
|
|
1674
1605
|
// Timing next, and before the executor exists: both of these refuse a call
|
|
1675
1606
|
// that would have SUCCEEDED into corrupted per-instance state or an
|
|
1676
1607
|
// orphaned human question. See ./conversation.ts for why they are throws.
|
|
1677
|
-
this.
|
|
1678
|
-
this.assertNoPendingQuestion('Agent.run');
|
|
1608
|
+
this.assertNoPendingQuestion('Agent.run', invocation.previous?.value);
|
|
1679
1609
|
// A conversation handed in continues through the same side channel
|
|
1680
1610
|
// `resumeOnError` uses — one restoration path, so the two doors cannot
|
|
1681
1611
|
// drift about what "continue" means. This turn's message IS appended:
|
|
@@ -1684,97 +1614,98 @@ export class Agent extends RunnerBase {
|
|
|
1684
1614
|
let continued;
|
|
1685
1615
|
if (runInput.continueFrom !== undefined) {
|
|
1686
1616
|
continued = validateCheckpoint(runInput.continueFrom);
|
|
1687
|
-
this.applyContinuation(continued, 'Agent.run({ continueFrom })', true);
|
|
1617
|
+
this.applyContinuation(invocation.value, continued, 'Agent.run({ continueFrom })', true);
|
|
1688
1618
|
}
|
|
1689
1619
|
// Only an EXPLICIT identity is remembered for `checkpoint()`; see the
|
|
1690
1620
|
// field's note. `input.identity` wins over `options.identity` because the
|
|
1691
1621
|
// input bag is where a caller looks first, and both win over the stored
|
|
1692
1622
|
// conversation's — but the conversation's is used when neither was given,
|
|
1693
1623
|
// so a continued turn stays in the namespace it started in.
|
|
1694
|
-
|
|
1624
|
+
invocation.value.identity =
|
|
1695
1625
|
runInput.identity ?? options?.identity ?? (continued ? continued.identity : undefined);
|
|
1696
1626
|
// Recordings-as-artifacts (9.26.0). BEFORE `createExecutor`, because
|
|
1697
1627
|
// `attach()` collects recorders for the executor that has not been built
|
|
1698
1628
|
// yet — a recording started one line later would be missing its
|
|
1699
1629
|
// boundaries, which is the failure mode `recordRun` exists to prevent.
|
|
1700
1630
|
// Returns `undefined` (and touches nothing) unless the dial is on.
|
|
1701
|
-
const recording = this.startRunRecording();
|
|
1631
|
+
const recording = this.startRunRecording(invocation);
|
|
1702
1632
|
// (helper used in the catch block below — module-private function
|
|
1703
1633
|
// declared at file end via hoisting)
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
const
|
|
1707
|
-
this.inFlightRunId = this.currentRunContext.runId;
|
|
1634
|
+
invocation.value.answeredAsk = undefined;
|
|
1635
|
+
invocation.value.resumePassedTime = undefined;
|
|
1636
|
+
const prepared = this.prepareAgentRun(invocation, engineOptions, runRequest);
|
|
1708
1637
|
// One disposition ledger per run (9.60.0) — registration mirrors what
|
|
1709
1638
|
// this agent's configuration makes applicable; dev posture runs the
|
|
1710
1639
|
// canaries here, BEFORE any real work, so a dead check is named first.
|
|
1711
|
-
this.beginIntegrityLedger();
|
|
1712
1640
|
// Auto-checkpoint at iteration boundaries — captures the latest
|
|
1713
1641
|
// conversation history into a per-run tracker. On error, we
|
|
1714
1642
|
// wrap the underlying error in `RunCheckpointError` carrying
|
|
1715
1643
|
// this checkpoint so `agent.resumeOnError(checkpoint)` can
|
|
1716
1644
|
// continue from the last good iteration.
|
|
1717
1645
|
const tracker = {
|
|
1718
|
-
|
|
1646
|
+
get runId() {
|
|
1647
|
+
return invocation.context().runId;
|
|
1648
|
+
},
|
|
1719
1649
|
originalInput: { message: runInput.message },
|
|
1720
1650
|
history: [],
|
|
1721
1651
|
lastCompletedIteration: 0,
|
|
1722
1652
|
};
|
|
1723
|
-
|
|
1724
|
-
const stopTracking = this.installCheckpointTracker(tracker);
|
|
1653
|
+
invocation.value.checkpointTracker = tracker;
|
|
1725
1654
|
// The answer this run produces is the only place the final assistant turn
|
|
1726
1655
|
// exists (nothing writes it back into `scope.history`), so `checkpoint()`
|
|
1727
1656
|
// keeps it. Cleared here so a failed or paused run cannot hand back the
|
|
1728
1657
|
// previous run's answer.
|
|
1729
|
-
|
|
1658
|
+
invocation.value.answer = undefined;
|
|
1730
1659
|
// One run can never raise on another run's consent block.
|
|
1731
|
-
|
|
1660
|
+
invocation.value.consentOutstanding.clear();
|
|
1732
1661
|
// Set here, beside the `try` whose `finally` clears it, so no exit path
|
|
1733
1662
|
// can leave it behind for a turn this `run()` did not start.
|
|
1734
|
-
|
|
1663
|
+
invocation.value.clockDraft = clockDraft;
|
|
1735
1664
|
// Armed here, beside the `try` whose `finally` releases it: no refused
|
|
1736
1665
|
// call above can leave a deadline running.
|
|
1737
|
-
const runSignal = runSignalOf(engineOptions);
|
|
1738
1666
|
try {
|
|
1739
|
-
const result = await
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1667
|
+
const result = await invocation.execute({
|
|
1668
|
+
kind: 'run',
|
|
1669
|
+
options: {
|
|
1670
|
+
input: {
|
|
1671
|
+
message: runInput.message,
|
|
1672
|
+
...(invocation.value.identity !== undefined && {
|
|
1673
|
+
identity: invocation.value.identity,
|
|
1674
|
+
}),
|
|
1675
|
+
// A composed message reaches seed only on an agent that reads it
|
|
1676
|
+
// (declared sources, or the time layer's reader) — every other run's
|
|
1677
|
+
// input is the bytes it was.
|
|
1678
|
+
...(messageFrom === 'composed' &&
|
|
1679
|
+
(this.argumentSourcesArmed === true || this.timeOptions?.reader !== undefined) && {
|
|
1680
|
+
messageFrom: 'composed',
|
|
1681
|
+
}),
|
|
1682
|
+
},
|
|
1683
|
+
// Co-engineered boundary (#16): the engine's loop-iteration limit
|
|
1684
|
+
// (footprintjs 9 default 1000) must never fire BELOW the agent's own
|
|
1685
|
+
// budget — give it headroom (×2 + 10 covers double-hop loop shapes).
|
|
1686
|
+
// Consumer-provided options win.
|
|
1687
|
+
maxIterations: this.maxIterations * 2 + 10,
|
|
1688
|
+
...(engineOptions ?? {}),
|
|
1750
1689
|
},
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
// budget — give it headroom (×2 + 10 covers double-hop loop shapes).
|
|
1754
|
-
// Consumer-provided options win.
|
|
1755
|
-
maxIterations: this.maxIterations * 2 + 10,
|
|
1756
|
-
...(runSignal.options ?? {}),
|
|
1757
|
-
});
|
|
1758
|
-
const finalized = this.finalizeResult(executor, result);
|
|
1690
|
+
}, prepared.setup, prepared.binding);
|
|
1691
|
+
const finalized = this.finalizeResult(invocation, result);
|
|
1759
1692
|
if (typeof finalized === 'string')
|
|
1760
|
-
|
|
1761
|
-
this.recordPendingQuestion(finalized);
|
|
1762
|
-
await this.endRunToolSessions(finalized);
|
|
1693
|
+
invocation.value.answer = finalized;
|
|
1694
|
+
this.recordPendingQuestion(invocation.value, finalized);
|
|
1763
1695
|
// The answer is FINISHED before this line and cannot be changed by it.
|
|
1764
1696
|
// The liveness theorems (9.60.0, dev posture only) — a run that would
|
|
1765
1697
|
// return green while its registered checkers demonstrably never ran
|
|
1766
1698
|
// fails HERE instead, before the recording is filed. A finished run is
|
|
1767
1699
|
// itself the proof work existed: the loop cannot finish without at
|
|
1768
1700
|
// least one model call.
|
|
1769
|
-
this.assertIntegrityAlive();
|
|
1701
|
+
this.assertIntegrityAlive(invocation);
|
|
1770
1702
|
// See `fileRunRecording` for why the write is awaited rather than left
|
|
1771
1703
|
// in flight, and why it can never fail the run.
|
|
1772
|
-
|
|
1704
|
+
recording?.complete(finalized);
|
|
1773
1705
|
return finalized;
|
|
1774
1706
|
}
|
|
1775
1707
|
catch (cause) {
|
|
1776
1708
|
// A THROWN pause is still a pause — see `endRunToolSessions`.
|
|
1777
|
-
await this.endRunToolSessions(cause);
|
|
1778
1709
|
// Wrap recoverable errors with the last-known-good checkpoint.
|
|
1779
1710
|
// Don't wrap intentional terminal signals — let them propagate as
|
|
1780
1711
|
// their typed shapes so callers can `instanceof` them:
|
|
@@ -1813,7 +1744,10 @@ export class Agent extends RunnerBase {
|
|
|
1813
1744
|
// 9.60.0 — a dead checker is a WIRING verdict on this build, not a
|
|
1814
1745
|
// recoverable run state: resuming would run the same dead wiring.
|
|
1815
1746
|
cause.name === 'CheckerDeadError');
|
|
1816
|
-
if (cause instanceof Error &&
|
|
1747
|
+
if (cause instanceof Error &&
|
|
1748
|
+
!isTerminalTypedError &&
|
|
1749
|
+
!invocation.value.checkpointObservationFailed &&
|
|
1750
|
+
tracker.history.length > 0) {
|
|
1817
1751
|
// Observation beats the heuristic: if a bracket was open, it says
|
|
1818
1752
|
// exactly what the run was doing. `classifyFailurePhase` only decides
|
|
1819
1753
|
// when nothing was — a failure between brackets, where the error's own
|
|
@@ -1835,7 +1769,7 @@ export class Agent extends RunnerBase {
|
|
|
1835
1769
|
// resuming after a crash would be the one path that still lost the
|
|
1836
1770
|
// identity, and the memory written after the recovery would land
|
|
1837
1771
|
// where nothing could read it.
|
|
1838
|
-
this.conversationOwner(),
|
|
1772
|
+
this.conversationOwner(invocation.value),
|
|
1839
1773
|
// …and the same graph cursor (SG-C), from the same snapshot reader —
|
|
1840
1774
|
// one reader, two carriers, so neither can lose what the other keeps.
|
|
1841
1775
|
this.continuityCursorOf(this.liveSnapshot()?.sharedState), this.evidenceRecoveryOf(this.liveSnapshot()?.sharedState),
|
|
@@ -1852,32 +1786,28 @@ export class Agent extends RunnerBase {
|
|
|
1852
1786
|
throw cause;
|
|
1853
1787
|
}
|
|
1854
1788
|
finally {
|
|
1855
|
-
//
|
|
1856
|
-
runSignal.release();
|
|
1789
|
+
// Native admission owns deadlines, signal links and final joining.
|
|
1857
1790
|
// The time layer's per-run inputs end with the run: a stale draft would
|
|
1858
1791
|
// be stamped by the next seed this agent did not start (a composition
|
|
1859
1792
|
// mounting its chart) as if the app had declared it.
|
|
1860
|
-
|
|
1861
|
-
|
|
1793
|
+
invocation.value.clockDraft = undefined;
|
|
1794
|
+
invocation.value.resumePassedTime = undefined;
|
|
1862
1795
|
// The run's disposition rows, on EVERY path — success, failure, pause —
|
|
1863
1796
|
// and BEFORE the recording stops, so a recording carries its run's
|
|
1864
1797
|
// checker accounting (9.60.0).
|
|
1865
|
-
this.fileIntegrityDisposition();
|
|
1798
|
+
this.fileIntegrityDisposition(invocation);
|
|
1866
1799
|
// Always released: a recording left subscribed would keep listening
|
|
1867
1800
|
// through the next run and grow a tail nobody reads.
|
|
1868
|
-
this.noteAdmittedRun();
|
|
1869
|
-
recording?.stop();
|
|
1870
|
-
stopTracking();
|
|
1871
|
-
this.inFlightRunId = undefined;
|
|
1801
|
+
this.noteAdmittedRun(invocation);
|
|
1872
1802
|
// `seed` consumes the restored conversation on its way past. A run that
|
|
1873
1803
|
// died BEFORE seed never did, and a history left armed here would be
|
|
1874
1804
|
// picked up by the next run — which would then continue a conversation
|
|
1875
1805
|
// nobody asked it to. One run, one continuation.
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1806
|
+
invocation.value.pendingResumeHistory = undefined;
|
|
1807
|
+
invocation.value.pendingResumeFolded = undefined;
|
|
1808
|
+
invocation.value.pendingResumeFindingsLedger = undefined;
|
|
1809
|
+
invocation.value.pendingResumeSkillCursor = undefined;
|
|
1810
|
+
invocation.value.pendingEvidenceRecovery = undefined;
|
|
1881
1811
|
}
|
|
1882
1812
|
}
|
|
1883
1813
|
/**
|
|
@@ -1913,17 +1843,24 @@ export class Agent extends RunnerBase {
|
|
|
1913
1843
|
* ```
|
|
1914
1844
|
*/
|
|
1915
1845
|
async followUp(message, options) {
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1846
|
+
return this.runExecution().withRun(async (invocation) => {
|
|
1847
|
+
assertIdentityShape(options?.identity, 'Agent.followUp');
|
|
1848
|
+
// A continuation must exist before any history can be selected.
|
|
1849
|
+
if (invocation.previous?.view.snapshot() === undefined ||
|
|
1850
|
+
(this.lastInputRefused(invocation.previous?.view) &&
|
|
1851
|
+
!invocation.previous?.value.hadAdmitted)) {
|
|
1852
|
+
throw new NoConversationError('Agent.followUp', 'never-run');
|
|
1853
|
+
}
|
|
1854
|
+
const conversation = this.checkpointFor(invocation.previous);
|
|
1855
|
+
if (conversation === undefined || conversation.history.length === 0) {
|
|
1856
|
+
throw new NoConversationError('Agent.followUp', this.lastInputRefused(invocation.previous?.view)
|
|
1857
|
+
? 'last-input-refused'
|
|
1858
|
+
: 'last-run-unfinished');
|
|
1859
|
+
}
|
|
1860
|
+
if (conversation.identity !== undefined)
|
|
1861
|
+
refuseFollowUpIdentity(options?.identity, conversation.identity);
|
|
1862
|
+
return this.runOwned(invocation, { message, continueFrom: conversation }, options);
|
|
1863
|
+
});
|
|
1927
1864
|
}
|
|
1928
1865
|
/**
|
|
1929
1866
|
* Drop the question this agent's last run paused to ask, on the record.
|
|
@@ -1940,10 +1877,8 @@ export class Agent extends RunnerBase {
|
|
|
1940
1877
|
* does not touch the paused run's checkpoint: if you still hold that, it
|
|
1941
1878
|
* remains resumable.
|
|
1942
1879
|
*/
|
|
1943
|
-
abandonPause() {
|
|
1944
|
-
|
|
1945
|
-
this.pendingQuestion = undefined;
|
|
1946
|
-
return dropped;
|
|
1880
|
+
async abandonPause() {
|
|
1881
|
+
return this.runExecution().withRun((invocation) => abandonPendingQuestion(invocation.previous?.value));
|
|
1947
1882
|
}
|
|
1948
1883
|
/**
|
|
1949
1884
|
* Whether {@link Agent.selfExplain}'s why-questions have a run to answer
|
|
@@ -2011,32 +1946,33 @@ export class Agent extends RunnerBase {
|
|
|
2011
1946
|
* ```
|
|
2012
1947
|
*/
|
|
2013
1948
|
async resumeOnError(checkpoint, options) {
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
1949
|
+
return this.runExecution().withRun(async (invocation) => {
|
|
1950
|
+
const cp = validateCheckpoint(checkpoint);
|
|
1951
|
+
// The timing guards run HERE, not only inside `run()`, because the line
|
|
1952
|
+
// below writes the side channel: a refusal after that write would leave a
|
|
1953
|
+
// restored history armed and the NEXT run would silently continue somebody
|
|
1954
|
+
// else's conversation.
|
|
1955
|
+
this.assertNoPendingQuestion('Agent.resumeOnError', invocation.previous?.value);
|
|
1956
|
+
// A request `run()` would refuse is refused HERE, before the side channel
|
|
1957
|
+
// below is armed — a refusal after it would leave the restored history for
|
|
1958
|
+
// the next, unrelated run.
|
|
1959
|
+
requestOf(options, 'Agent.resumeOnError');
|
|
1960
|
+
// Stash the checkpointed history on the side channel; the seed function
|
|
1961
|
+
// reads + clears it before scope.history initializes. No message is
|
|
1962
|
+
// appended — the failing run's message is already the last user turn in
|
|
1963
|
+
// that history, and adding it again would ask twice.
|
|
1964
|
+
this.applyContinuation(invocation.value, cp, 'Agent.resumeOnError', false);
|
|
1965
|
+
return this.runOwned(invocation, {
|
|
1966
|
+
message: cp.originalInput.message,
|
|
1967
|
+
// The conversation's own identity, unless this call named one. Until
|
|
1968
|
+
// 9.2.0 there was no way to pass either, so a recovered run silently
|
|
1969
|
+
// re-namespaced its memory under a fresh runId and wrote turn two
|
|
1970
|
+
// where turn three could not read it.
|
|
1971
|
+
...(this.identityFor(options, cp) !== undefined && {
|
|
1972
|
+
identity: this.identityFor(options, cp),
|
|
1973
|
+
}),
|
|
1974
|
+
}, options);
|
|
1975
|
+
});
|
|
2040
1976
|
}
|
|
2041
1977
|
/**
|
|
2042
1978
|
* Which identity a continued turn runs under: the caller's if they named
|
|
@@ -2047,141 +1983,21 @@ export class Agent extends RunnerBase {
|
|
|
2047
1983
|
identityFor(options, cp) {
|
|
2048
1984
|
return options?.identity ?? cp.identity;
|
|
2049
1985
|
}
|
|
2050
|
-
/**
|
|
2051
|
-
* A run's `time`, read into the turn's clock draft (the time layer) — or
|
|
2052
|
-
* refused, before the turn starts: `time` on an agent without `.time()` or
|
|
2053
|
-
* a malformed value. No zone anywhere (the run's, else the builder's) is no
|
|
2054
|
-
* refusal: the zone is UNKNOWN (`zoneSource: 'unknown'`, G15) — never the
|
|
2055
|
-
* server's, never guessed; the person is asked it before any time they
|
|
2056
|
-
* wrote is read. `undefined` on an agent without the layer.
|
|
2057
|
-
*
|
|
2058
|
-
* @internal
|
|
2059
|
-
*/
|
|
2060
1986
|
clockDraftFor(time, runner) {
|
|
2061
|
-
|
|
2062
|
-
if (this.timeOptions === undefined)
|
|
2063
|
-
return undefined;
|
|
2064
|
-
return draftClock(passed, this.timeOptions);
|
|
1987
|
+
return draftAgentClock(time, runner, this.timeOptions);
|
|
2065
1988
|
}
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
* for a turn this agent's `run()` did not start (its chart mounted in a
|
|
2069
|
-
* composition, which passes no `time`), the builder's fallback zone with
|
|
2070
|
-
* the turn's start as `now` (`zoneSource: 'builder'`, `nowSource:
|
|
2071
|
-
* 'default'` — the same record a `run()` with no `time` files). With no
|
|
2072
|
-
* fallback zone that turn's zone is unknown, as a `run()`'s is (G15): the
|
|
2073
|
-
* server's zone is never used.
|
|
2074
|
-
*
|
|
2075
|
-
* @internal
|
|
2076
|
-
*/
|
|
2077
|
-
seedClockDraft() {
|
|
2078
|
-
if (this.runClockDraft !== undefined)
|
|
2079
|
-
return this.runClockDraft;
|
|
2080
|
-
return draftClock(undefined, this.timeOptions ?? {});
|
|
1989
|
+
seedClockDraft(values) {
|
|
1990
|
+
return clockForSeed(values, this.timeOptions);
|
|
2081
1991
|
}
|
|
2082
|
-
/**
|
|
2083
|
-
* A `time` passed to a run or a resume, read — or refused by name: passed to
|
|
2084
|
-
* an agent without `.time()` (a door that ignored it would look configured
|
|
2085
|
-
* and do nothing), or malformed.
|
|
2086
|
-
*
|
|
2087
|
-
* @internal
|
|
2088
|
-
*/
|
|
2089
1992
|
passedTimeFor(time, runner) {
|
|
2090
|
-
|
|
2091
|
-
return undefined;
|
|
2092
|
-
if (this.timeOptions === undefined) {
|
|
2093
|
-
throw new InvalidRunInputError({
|
|
2094
|
-
runner,
|
|
2095
|
-
received: 'time',
|
|
2096
|
-
hint: 'this agent reads no clock — arm the time layer with .time() to pass time',
|
|
2097
|
-
});
|
|
2098
|
-
}
|
|
2099
|
-
const read = readRunTime(time);
|
|
2100
|
-
if ('problem' in read) {
|
|
2101
|
-
throw new InvalidRunInputError({ runner, received: 'a malformed time', hint: read.problem });
|
|
2102
|
-
}
|
|
2103
|
-
return read.value;
|
|
2104
|
-
}
|
|
2105
|
-
/**
|
|
2106
|
-
* Install a per-run checkpoint tracker. Listens for the agent's own
|
|
2107
|
-
* iteration and stream brackets and snapshots the conversation history into
|
|
2108
|
-
* the tracker. Returns a stop function.
|
|
2109
|
-
*
|
|
2110
|
-
* It listens on the REAL-value path (`EventDispatcher · onRealEvent`), never
|
|
2111
|
-
* on the served one: the crash checkpoint it builds is what
|
|
2112
|
-
* `resumeOnError` replays to the model, and a resume checkpoint keeps real
|
|
2113
|
-
* values — a redaction policy that names `history` must not turn the
|
|
2114
|
-
* conversation a crash resumes into placeholders (`src/redaction/`).
|
|
2115
|
-
*
|
|
2116
|
-
* @internal
|
|
2117
|
-
*/
|
|
2118
|
-
installCheckpointTracker(tracker) {
|
|
2119
|
-
return this.dispatcher.onRealEvent((event) => {
|
|
2120
|
-
switch (event.type) {
|
|
2121
|
-
case 'agentfootprint.agent.iteration_start': {
|
|
2122
|
-
const p = event.payload;
|
|
2123
|
-
if (typeof p?.iterIndex === 'number')
|
|
2124
|
-
tracker.inFlightIteration = p.iterIndex;
|
|
2125
|
-
return;
|
|
2126
|
-
}
|
|
2127
|
-
// Phase OBSERVATION (8.14.0) — the run's own stream brackets. A crash
|
|
2128
|
-
// inside one of these is attributable without asking the error to
|
|
2129
|
-
// describe itself. `'call-llm'` is a literal and `toolName` is a name
|
|
2130
|
-
// the app declared: no URL, no credential, no payload ever reaches the
|
|
2131
|
-
// checkpoint.
|
|
2132
|
-
case 'agentfootprint.stream.llm_start':
|
|
2133
|
-
tracker.inFlightPhase = { phase: 'llm', stage: 'call-llm' };
|
|
2134
|
-
return;
|
|
2135
|
-
case 'agentfootprint.stream.llm_end':
|
|
2136
|
-
tracker.inFlightPhase = undefined;
|
|
2137
|
-
return;
|
|
2138
|
-
// A bracket carrying `notDispatched` (9.113.0) is a call a paused batch
|
|
2139
|
-
// never dispatched: nothing of it was ever in flight, so it neither
|
|
2140
|
-
// opens nor clears the phase. Nothing observable depends on this today
|
|
2141
|
-
// — the settlement emits both halves back to back with no await between
|
|
2142
|
-
// them (`toolCalls.ts` · `bracketSettled`), so a crash can never land
|
|
2143
|
-
// inside one — it keeps the phase true to the marker should that ever
|
|
2144
|
-
// change.
|
|
2145
|
-
case 'agentfootprint.stream.tool_start': {
|
|
2146
|
-
const p = event.payload;
|
|
2147
|
-
if (p?.notDispatched !== undefined)
|
|
2148
|
-
return;
|
|
2149
|
-
const name = p?.toolName;
|
|
2150
|
-
tracker.inFlightPhase = {
|
|
2151
|
-
phase: 'tool',
|
|
2152
|
-
stage: typeof name === 'string' ? name : 'tool',
|
|
2153
|
-
};
|
|
2154
|
-
return;
|
|
2155
|
-
}
|
|
2156
|
-
case 'agentfootprint.stream.tool_end': {
|
|
2157
|
-
const p = event.payload;
|
|
2158
|
-
if (p?.notDispatched !== undefined)
|
|
2159
|
-
return;
|
|
2160
|
-
tracker.inFlightPhase = undefined;
|
|
2161
|
-
return;
|
|
2162
|
-
}
|
|
2163
|
-
case 'agentfootprint.agent.iteration_end': {
|
|
2164
|
-
const p = event.payload;
|
|
2165
|
-
if (typeof p?.iterIndex === 'number')
|
|
2166
|
-
tracker.lastCompletedIteration = p.iterIndex;
|
|
2167
|
-
if (Array.isArray(p?.history)) {
|
|
2168
|
-
tracker.history = p.history;
|
|
2169
|
-
}
|
|
2170
|
-
tracker.inFlightIteration = undefined;
|
|
2171
|
-
tracker.inFlightPhase = undefined;
|
|
2172
|
-
return;
|
|
2173
|
-
}
|
|
2174
|
-
default:
|
|
2175
|
-
return;
|
|
2176
|
-
}
|
|
2177
|
-
});
|
|
1993
|
+
return readAgentTime(time, runner, this.timeOptions);
|
|
2178
1994
|
}
|
|
2179
1995
|
/**
|
|
2180
1996
|
* Continue a run that paused to ask a person something, with their answer.
|
|
2181
1997
|
*
|
|
2182
1998
|
* WHO the resumed run is for is the paused run's caller, read off the
|
|
2183
1999
|
* checkpoint (`agent/callerIdentity.ts`) — never whatever this instance ran
|
|
2184
|
-
* last;
|
|
2000
|
+
* last; the session is the paused run's. A supplied `sessionId` must match. A
|
|
2185
2001
|
* checkpoint names who it is for; it is not proof: a host that lets
|
|
2186
2002
|
* checkpoints leave its trust boundary signs them or keeps them
|
|
2187
2003
|
* server-side, and passes the identity it verified as `options.identity`.
|
|
@@ -2204,11 +2020,15 @@ export class Agent extends RunnerBase {
|
|
|
2204
2020
|
* ```
|
|
2205
2021
|
*/
|
|
2206
2022
|
async resume(checkpoint, input, options) {
|
|
2023
|
+
this.noteResumeTakenUp(checkpoint);
|
|
2024
|
+
return this.runExecution().withRun((invocation) => preservePendingQuestion(invocation.previous?.value, () => invocation.value.resources?.answer.consumed === true, () => this.resumeOwned(invocation, checkpoint, input, options)));
|
|
2025
|
+
}
|
|
2026
|
+
async resumeOwned(invocation, checkpoint, input, options) {
|
|
2207
2027
|
// Taken up, before anything can refuse: from here every use of a consent
|
|
2208
2028
|
// decision passes through the one spend a door watching this pause sees
|
|
2209
2029
|
// (`consentRequest.ts` · `watchDecisionUse`) — so a resume that fails
|
|
2210
2030
|
// without reaching it, refused or aborted, used nothing.
|
|
2211
|
-
|
|
2031
|
+
resumeStateOf(checkpoint);
|
|
2212
2032
|
// ── A consent gate is answered with a DECISION (8.13.0) ─────────────
|
|
2213
2033
|
// Refused HERE, before the engine is handed the checkpoint, so nothing
|
|
2214
2034
|
// executes and the checkpoint is unchanged — the caller can answer the same
|
|
@@ -2226,8 +2046,6 @@ export class Agent extends RunnerBase {
|
|
|
2226
2046
|
// The incoming request is the RESUMING caller's — never the paused one's:
|
|
2227
2047
|
// a checkpoint carries no request, and a resume without one serves none.
|
|
2228
2048
|
const resumeRequest = requestOf(options, 'Agent.resume');
|
|
2229
|
-
// Native guard lands with the new checkpoint protocol, before its runtime
|
|
2230
|
-
// opt-in is mounted. Until then no Agent is armed to consume this carrier.
|
|
2231
2049
|
requireVerificationOnResume(checkpoint.sharedState ?? {}, false);
|
|
2232
2050
|
if (this.negativeClaimsConfig !== undefined) {
|
|
2233
2051
|
const prior = negativeCheckpointOf(checkpoint.sharedState ?? {});
|
|
@@ -2245,6 +2063,7 @@ export class Agent extends RunnerBase {
|
|
|
2245
2063
|
options?.redact,
|
|
2246
2064
|
conversationRedaction(),
|
|
2247
2065
|
]);
|
|
2066
|
+
Object.assign(invocation.value, privateResumeOf(checkpoint));
|
|
2248
2067
|
// A resume's `time` (the time layer) is read or refused before anything
|
|
2249
2068
|
// moves; it is never applied — the paused turn's clock is kept, and a
|
|
2250
2069
|
// differing value is recorded by the ToolCalls resume door.
|
|
@@ -2259,10 +2078,7 @@ export class Agent extends RunnerBase {
|
|
|
2259
2078
|
// principal and stored ownership. A checkpoint names who it is for; it is
|
|
2260
2079
|
// not proof — a host that lets checkpoints leave its trust boundary signs
|
|
2261
2080
|
// them or keeps them server-side, and passes the identity it verified here.
|
|
2262
|
-
const pausedFor = callerIdentityOf(checkpoint.sharedState
|
|
2263
|
-
...(this.lastRunIdentity !== undefined && { named: this.lastRunIdentity }),
|
|
2264
|
-
minted: this.mintedRunIds,
|
|
2265
|
-
});
|
|
2081
|
+
const pausedFor = callerIdentityOf(checkpoint.sharedState);
|
|
2266
2082
|
// The identity the run's memory namespace and credentials are restored
|
|
2267
2083
|
// from, WHATEVER its source (a caller's, the session rung, the per-run
|
|
2268
2084
|
// default). One run, one identity: a call that names an identity must
|
|
@@ -2275,6 +2091,9 @@ export class Agent extends RunnerBase {
|
|
|
2275
2091
|
(restored === undefined || !sameIdentity(options.identity, restored)))) {
|
|
2276
2092
|
throw new ResumeIdentityConflictError();
|
|
2277
2093
|
}
|
|
2094
|
+
const sessionId = resumeSessionOf(checkpoint);
|
|
2095
|
+
if (options?.sessionId !== undefined && options.sessionId !== sessionId)
|
|
2096
|
+
throw new ResumeIdentityConflictError('session');
|
|
2278
2097
|
// …and the decision must be for THIS request and this exact call
|
|
2279
2098
|
// (`core/consentRequest.ts`): refused here, before anything moves, when it
|
|
2280
2099
|
// names no request, another request, a call the checkpoint no longer
|
|
@@ -2287,11 +2106,12 @@ export class Agent extends RunnerBase {
|
|
|
2287
2106
|
// A request minted under a ledger that can prove is spent only there.
|
|
2288
2107
|
this.decisionLedger ?? processDecisionLedger());
|
|
2289
2108
|
}
|
|
2109
|
+
if (gate !== undefined)
|
|
2110
|
+
await refuseKnownSpentAnswer(this.decisionLedger ?? processDecisionLedger(), input, gate, options?.signal, options?.env?.signal);
|
|
2290
2111
|
// Typed data collection is not consent. Validate before changing any run state.
|
|
2291
2112
|
const awaitingInput = gate === undefined ? readAwaitingInput(checkpoint.pauseData) : undefined;
|
|
2292
2113
|
let answeredAsk;
|
|
2293
2114
|
if (awaitingInput !== undefined) {
|
|
2294
|
-
this.assertNotRunning('Agent.resume');
|
|
2295
2115
|
const answered = applyInputResponse(awaitingInput, input, this.timeAnswerContextOf(checkpoint.sharedState));
|
|
2296
2116
|
if ('cancel' in answered) {
|
|
2297
2117
|
throw new TypeError('[input request] Cancel a hosted request through its host, or abandonPause() before starting another run.');
|
|
@@ -2308,7 +2128,7 @@ export class Agent extends RunnerBase {
|
|
|
2308
2128
|
pauseData,
|
|
2309
2129
|
awaitingInput: answered,
|
|
2310
2130
|
};
|
|
2311
|
-
this.recordPendingQuestion(outcome);
|
|
2131
|
+
this.recordPendingQuestion(invocation.value, outcome);
|
|
2312
2132
|
return outcome;
|
|
2313
2133
|
}
|
|
2314
2134
|
answeredAsk = {
|
|
@@ -2329,77 +2149,62 @@ export class Agent extends RunnerBase {
|
|
|
2329
2149
|
// the same door and before any state moves, because a resume that has begun
|
|
2330
2150
|
// is a resume that has already used the value.
|
|
2331
2151
|
assertDecisionIsNotStale(checkpoint.pauseData, input);
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
//
|
|
2335
|
-
|
|
2336
|
-
//
|
|
2337
|
-
|
|
2338
|
-
//
|
|
2339
|
-
//
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
this.pendingQuestion = undefined;
|
|
2343
|
-
// WHO this resumed run is for — set BEFORE the executor exists, because the
|
|
2344
|
-
// run context's principal (every event's `EventMeta.principal`), a tool's
|
|
2345
|
-
// `ctx.identity` and `checkpoint()` all read it: the identity the PAUSED
|
|
2346
|
-
// run's caller named (a named `options.identity` was checked equal to the
|
|
2347
|
-
// restored one at the top of this method) — never the identity of whatever
|
|
2348
|
-
// this instance ran last, which on a shared or pooled agent is another
|
|
2349
|
-
// person's, or nobody's (`callerIdentity.ts`).
|
|
2350
|
-
this.lastRunIdentity = options?.identity ?? pausedFor;
|
|
2351
|
-
// …and WHICH session: the call's, else the one the paused run recorded in
|
|
2352
|
-
// its own state (`runSessionId`, or the session rung's) — one source, no
|
|
2353
|
-
// instance memory — so a host that resumes without repeating the session
|
|
2354
|
-
// does not file the resumed turn (its tool teardown, its events, its
|
|
2355
|
-
// self-explain evidence) as sessionless.
|
|
2356
|
-
const sessionId = options?.sessionId ?? pausedSessionOf(checkpoint.sharedState);
|
|
2152
|
+
if (gate === undefined && awaitingInput === undefined)
|
|
2153
|
+
refuseMissingPlainAnswer(checkpoint, input);
|
|
2154
|
+
// A native-admitted answer settles the old question even if its leg fails.
|
|
2155
|
+
// The outer pause-ownership boundary restores pre-origin refusals; named
|
|
2156
|
+
// unanswered refusals after origin are restored below.
|
|
2157
|
+
const questionBefore = invocation.previous?.value.pendingQuestion;
|
|
2158
|
+
// Capture this paused conversation's identity before native origin; selected readers
|
|
2159
|
+
// on a shared instance can belong to another conversation (`callerIdentity.ts`).
|
|
2160
|
+
invocation.value.identity = options?.identity ?? pausedFor;
|
|
2161
|
+
// Resume retains the paused transport session; an override was checked equal above.
|
|
2357
2162
|
const sessionResumeOptions = sessionId !== undefined && options?.sessionId === undefined
|
|
2358
2163
|
? { ...options, sessionId }
|
|
2359
2164
|
: options;
|
|
2360
2165
|
// The leg's policy — the carried one, the caller's, and the paused leg's
|
|
2361
2166
|
// marks — comes back from the emitter and goes to THIS leg's executor
|
|
2362
|
-
// (
|
|
2167
|
+
// (native setup → `prepareRunRedaction`); nothing per-run is held on the instance.
|
|
2363
2168
|
const resumeLeg = this.emitPauseResume(checkpoint, input, unionRedactionPolicies(carriedRedaction, sessionResumeOptions?.redact));
|
|
2364
2169
|
const resumeOptions = resumeLeg === sessionResumeOptions?.redact
|
|
2365
2170
|
? sessionResumeOptions
|
|
2366
2171
|
: { ...sessionResumeOptions, redact: resumeLeg };
|
|
2367
|
-
// Fresh
|
|
2368
|
-
//
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
// covers the RESUMED run, which is what the recorder saw. A turn that
|
|
2373
|
-
// paused and resumed is two runs, and each mints its own recording when
|
|
2374
|
-
// (and only when) it completes.
|
|
2375
|
-
const recording = this.startRunRecording();
|
|
2376
|
-
this.answeredAsk = answeredAsk;
|
|
2377
|
-
const executor = this.createExecutor(resumeOptions, resumeRequest);
|
|
2172
|
+
// Fresh native execution restores its checkpoint; no paused executor is retained.
|
|
2173
|
+
// Each resumed native leg files its own recording when it completes.
|
|
2174
|
+
const recording = this.startRunRecording(invocation);
|
|
2175
|
+
invocation.value.answeredAsk = answeredAsk;
|
|
2176
|
+
const prepared = this.prepareAgentRun(invocation, resumeOptions, resumeRequest);
|
|
2378
2177
|
// The leg's WHOLE policy rides its own state too (`runRedaction`), so a
|
|
2379
2178
|
// later pause carries what this leg was covered by — names the resume
|
|
2380
2179
|
// added included — and a third leg is never less covered than this one.
|
|
2381
2180
|
// `createExecutor` opened this executor's run; one it did not is refused
|
|
2382
2181
|
// before anything is held or runs — a leg whose policy nothing knows must
|
|
2383
2182
|
// not start.
|
|
2384
|
-
const legCoverage =
|
|
2183
|
+
const legCoverage = invocation.value.redaction?.coverage;
|
|
2184
|
+
if (legCoverage === undefined)
|
|
2185
|
+
throw new ResumeRedactionError('unreadable');
|
|
2385
2186
|
if (legCoverage.state === 'unknown')
|
|
2386
2187
|
throw new ResumeRedactionError('unreadable');
|
|
2387
2188
|
const leg = { policy: policyOfCoverage(legCoverage) };
|
|
2388
|
-
this.inFlightRunId = this.currentRunContext.runId;
|
|
2389
2189
|
// A resumed turn is two runs, and each keeps its own ledger — exactly
|
|
2390
2190
|
// the recording's terms one comment up.
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2191
|
+
invocation.value.answer = undefined;
|
|
2192
|
+
const resumedMessage = checkpoint.sharedState.userMessage;
|
|
2193
|
+
invocation.value.checkpointTracker =
|
|
2194
|
+
typeof resumedMessage === 'string'
|
|
2195
|
+
? {
|
|
2196
|
+
get runId() {
|
|
2197
|
+
return invocation.context().runId;
|
|
2198
|
+
},
|
|
2199
|
+
originalInput: { message: resumedMessage },
|
|
2200
|
+
history: [],
|
|
2201
|
+
lastCompletedIteration: 0,
|
|
2202
|
+
}
|
|
2203
|
+
: undefined;
|
|
2399
2204
|
// One run can never raise on another run's consent block.
|
|
2400
|
-
|
|
2205
|
+
invocation.value.consentOutstanding.clear();
|
|
2401
2206
|
// Beside the `try` whose `finally` clears it (the fresh-run path's terms).
|
|
2402
|
-
|
|
2207
|
+
invocation.value.resumePassedTime = passedTime;
|
|
2403
2208
|
const legCheckpoint = leg.policy === undefined
|
|
2404
2209
|
? checkpoint
|
|
2405
2210
|
: {
|
|
@@ -2409,81 +2214,38 @@ export class Agent extends RunnerBase {
|
|
|
2409
2214
|
runRedaction: carriedRunPolicy(leg.policy),
|
|
2410
2215
|
},
|
|
2411
2216
|
};
|
|
2412
|
-
//
|
|
2413
|
-
// the `finally` below.
|
|
2414
|
-
const runSignal = runSignalOf(resumeOptions);
|
|
2217
|
+
// The native resumed leg owns its signal and deadline.
|
|
2415
2218
|
try {
|
|
2416
|
-
const result = await
|
|
2417
|
-
const finalized = this.finalizeResult(
|
|
2219
|
+
const result = await invocation.execute({ kind: 'resume', mode: 'fresh', checkpoint: legCheckpoint, input, options: resumeOptions }, prepared.setup, prepared.binding);
|
|
2220
|
+
const finalized = this.finalizeResult(invocation, result);
|
|
2418
2221
|
if (typeof finalized === 'string')
|
|
2419
|
-
|
|
2222
|
+
invocation.value.answer = finalized;
|
|
2420
2223
|
// The question this resume answered is settled; a resume that paused
|
|
2421
2224
|
// AGAIN has asked a new one, and that one is outstanding from here.
|
|
2422
|
-
this.recordPendingQuestion(finalized);
|
|
2423
|
-
await this.endRunToolSessions(finalized);
|
|
2225
|
+
this.recordPendingQuestion(invocation.value, finalized);
|
|
2424
2226
|
// Same liveness gate the fresh-run path applies (9.60.0).
|
|
2425
|
-
this.assertIntegrityAlive();
|
|
2426
|
-
|
|
2227
|
+
this.assertIntegrityAlive(invocation);
|
|
2228
|
+
recording?.complete(finalized);
|
|
2427
2229
|
return finalized;
|
|
2428
2230
|
}
|
|
2429
|
-
catch (cause) {
|
|
2430
|
-
// An answer the run refused ran nothing and answered nothing: the
|
|
2431
|
-
// question this agent was waiting on (if any) is still outstanding, and
|
|
2432
|
-
// no tool session ended — a replayed decision must not tear down the
|
|
2433
|
-
// sandbox a live pause is holding.
|
|
2434
|
-
if (cause instanceof ResumeDecisionError || cause instanceof DecisionRequiredError) {
|
|
2435
|
-
this.pendingQuestion = questionBefore;
|
|
2436
|
-
throw cause;
|
|
2437
|
-
}
|
|
2438
|
-
await this.endRunToolSessions(cause);
|
|
2439
|
-
throw cause;
|
|
2440
|
-
}
|
|
2441
2231
|
finally {
|
|
2442
|
-
|
|
2232
|
+
if (invocation.value.resources?.answer.consumed === true) {
|
|
2233
|
+
if (invocation.previous !== undefined)
|
|
2234
|
+
invocation.previous.value.pendingQuestion = undefined;
|
|
2235
|
+
}
|
|
2236
|
+
else {
|
|
2237
|
+
invocation.value.pendingQuestion = questionBefore;
|
|
2238
|
+
if (invocation.previous !== undefined)
|
|
2239
|
+
invocation.previous.value.pendingQuestion = questionBefore;
|
|
2240
|
+
}
|
|
2443
2241
|
// A resume's passed `time` ends with the resume (the fresh-run path's terms).
|
|
2444
|
-
|
|
2242
|
+
invocation.value.resumePassedTime = undefined;
|
|
2445
2243
|
// Same terms as the fresh-run path: rows on every exit, before the
|
|
2446
2244
|
// recording stops (9.60.0).
|
|
2447
|
-
this.fileIntegrityDisposition();
|
|
2448
|
-
this.noteAdmittedRun();
|
|
2449
|
-
recording?.stop();
|
|
2450
|
-
this.inFlightRunId = undefined;
|
|
2245
|
+
this.fileIntegrityDisposition(invocation);
|
|
2246
|
+
this.noteAdmittedRun(invocation);
|
|
2451
2247
|
}
|
|
2452
2248
|
}
|
|
2453
|
-
/**
|
|
2454
|
-
* Fire `'run'`-scoped tool teardown — IF this run really ended.
|
|
2455
|
-
*
|
|
2456
|
-
* **Not on `finally`, and that is the whole point.** `finally` runs on every
|
|
2457
|
-
* exit including a pause, and a pause exits TWO ways: a returned
|
|
2458
|
-
* `RunnerPauseOutcome` and a thrown `PauseSignal`. A check-in on a
|
|
2459
|
-
* code-interpreter call pauses the run so a person can approve the code —
|
|
2460
|
-
* tearing the sandbox down there destroys the exact state the resume needs,
|
|
2461
|
-
* and it fails QUIETLY, as a resumed run that "just re-ran everything".
|
|
2462
|
-
* Both shapes are discriminated here and both are skipped.
|
|
2463
|
-
*
|
|
2464
|
-
* An error IS a terminal: the run is over, nobody is coming back, and a
|
|
2465
|
-
* sandbox held by a run that crashed is the clearest kind of leak. Only a
|
|
2466
|
-
* pause survives.
|
|
2467
|
-
*
|
|
2468
|
-
* Fired for the TURN, not for `currentRunContext.runId` — `resume()` mints a
|
|
2469
|
-
* fresh run id, so a pause and its resume are one turn across two runs, and
|
|
2470
|
-
* filtering on the id would leave everything a paused turn opened alive
|
|
2471
|
-
* forever. Hosted turns are scoped to their session, preserving other pauses. See `ToolSessionTier.fireRun`.
|
|
2472
|
-
*
|
|
2473
|
-
* @param outcome what `run()`/`resume()` is about to return, or about to throw.
|
|
2474
|
-
*/
|
|
2475
|
-
async endRunToolSessions(outcome) {
|
|
2476
|
-
if (!this.toolSessionTier)
|
|
2477
|
-
return;
|
|
2478
|
-
if (isPaused(outcome))
|
|
2479
|
-
return;
|
|
2480
|
-
if (outcome instanceof Error && outcome.name === 'PauseSignal')
|
|
2481
|
-
return;
|
|
2482
|
-
if (this.currentRunContext.sessionId !== undefined)
|
|
2483
|
-
await this.toolSessionTier.fireSessionRuns(this.currentRunContext.sessionId);
|
|
2484
|
-
else
|
|
2485
|
-
await this.toolSessionTier.fireRun();
|
|
2486
|
-
}
|
|
2487
2249
|
/**
|
|
2488
2250
|
* The conversation this agent's LAST completed run leaves behind, packed as
|
|
2489
2251
|
* the same `AgentRunCheckpoint` that `resumeOnError(...)` accepts. Store it,
|
|
@@ -2538,35 +2300,39 @@ export class Agent extends RunnerBase {
|
|
|
2538
2300
|
* // it does not rewrite entries manually appended to that history.
|
|
2539
2301
|
* ```
|
|
2540
2302
|
*/
|
|
2303
|
+
/** During preparation before native origin this is undefined; capture before the next call. */
|
|
2541
2304
|
checkpoint() {
|
|
2542
|
-
|
|
2305
|
+
return this.checkpointFor(this.runExecution().selected());
|
|
2306
|
+
}
|
|
2307
|
+
checkpointFor(selected) {
|
|
2308
|
+
const snapshot = selected?.view.snapshot();
|
|
2543
2309
|
if (!snapshot)
|
|
2544
2310
|
return undefined;
|
|
2545
2311
|
const state = snapshot.sharedState;
|
|
2546
2312
|
// Admission is decided by seed, before any conversation state is written.
|
|
2547
2313
|
// Do not manufacture a blank replay carrier for an unadmitted attempt.
|
|
2548
|
-
if (this.lastInputRefused())
|
|
2314
|
+
if (this.lastInputRefused(selected?.view))
|
|
2549
2315
|
return undefined;
|
|
2550
2316
|
const recorded = (state?.history ?? []);
|
|
2551
2317
|
const history = [...recorded];
|
|
2552
|
-
if (
|
|
2553
|
-
(
|
|
2318
|
+
if (selected.value.answer !== undefined &&
|
|
2319
|
+
(selected.value.answer.length > 0 || state?.llmLatestReplay !== undefined)) {
|
|
2554
2320
|
history.push({
|
|
2555
2321
|
role: 'assistant',
|
|
2556
|
-
content:
|
|
2322
|
+
content: selected.value.answer,
|
|
2557
2323
|
...assistantReplayFields(state ?? {}),
|
|
2558
2324
|
});
|
|
2559
2325
|
}
|
|
2560
2326
|
const folded = this.foldedSpansOf(state);
|
|
2561
|
-
const owner = this.conversationOwner();
|
|
2327
|
+
const owner = this.conversationOwner(selected.value);
|
|
2562
2328
|
const skillCursor = this.continuityCursorOf(state);
|
|
2563
2329
|
const evidenceRecovery = this.evidenceRecoveryOf(state);
|
|
2564
2330
|
const findingsLedger = this.findingsLedgerOf(state);
|
|
2565
2331
|
const turnNumber = this.turnNumberOf(state);
|
|
2566
2332
|
return {
|
|
2567
2333
|
version: 1,
|
|
2568
|
-
runId:
|
|
2569
|
-
history: structuredClone(checkpointReplayHistory(history,
|
|
2334
|
+
runId: selected.context.runId,
|
|
2335
|
+
history: structuredClone(checkpointReplayHistory(history, selected.value.checkpointTracker)),
|
|
2570
2336
|
lastCompletedIteration: typeof state?.iteration === 'number' ? state.iteration : 0,
|
|
2571
2337
|
originalInput: { message: typeof state?.userMessage === 'string' ? state.userMessage : '' },
|
|
2572
2338
|
checkpointedAt: Date.now(),
|
|
@@ -2594,9 +2360,9 @@ export class Agent extends RunnerBase {
|
|
|
2594
2360
|
};
|
|
2595
2361
|
}
|
|
2596
2362
|
/** Called as each run/resume ends: remember a run that got past input admission. */
|
|
2597
|
-
noteAdmittedRun() {
|
|
2598
|
-
if (
|
|
2599
|
-
|
|
2363
|
+
noteAdmittedRun(invocation) {
|
|
2364
|
+
if (invocation.view.snapshot() !== undefined && !this.lastInputRefused(invocation.view)) {
|
|
2365
|
+
invocation.value.hadAdmitted = true;
|
|
2600
2366
|
}
|
|
2601
2367
|
}
|
|
2602
2368
|
/**
|
|
@@ -2610,8 +2376,8 @@ export class Agent extends RunnerBase {
|
|
|
2610
2376
|
this.evidenceGate?.toolsOffAfterRevision === true);
|
|
2611
2377
|
}
|
|
2612
2378
|
/** Whether input middleware refused the last run's message — the one reading both doors ask. */
|
|
2613
|
-
lastInputRefused() {
|
|
2614
|
-
const state =
|
|
2379
|
+
lastInputRefused(view) {
|
|
2380
|
+
const state = view?.snapshot()?.sharedState;
|
|
2615
2381
|
return state?.messageDeniedPhase === 'input';
|
|
2616
2382
|
}
|
|
2617
2383
|
/** Both checkpoint doors keep the repair budget separately from conversation text. */
|
|
@@ -2668,27 +2434,8 @@ export class Agent extends RunnerBase {
|
|
|
2668
2434
|
return undefined;
|
|
2669
2435
|
return structuredClone(spans);
|
|
2670
2436
|
}
|
|
2671
|
-
/**
|
|
2672
|
-
* What the resume door checks a time field's answer with (the time design
|
|
2673
|
-
* § 6.2, step T4): the paused turn's clock zone — the kept `clock` row, so
|
|
2674
|
-
* a resume that passes another `time` changes nothing — and the app's
|
|
2675
|
-
* catalog overrides. `undefined` without `.time()`: a `format` field is
|
|
2676
|
-
* then judged for shape, order and offset only, in the default words.
|
|
2677
|
-
*
|
|
2678
|
-
* @internal
|
|
2679
|
-
*/
|
|
2680
2437
|
timeAnswerContextOf(state) {
|
|
2681
|
-
|
|
2682
|
-
return undefined;
|
|
2683
|
-
const ledger = state?.findingsLedger;
|
|
2684
|
-
const clock = clockOf(Array.isArray(ledger) ? ledger : undefined);
|
|
2685
|
-
// An unknown zone (G15) judges no wall time: `zone` is then only the UTC spelling.
|
|
2686
|
-
const zone = clock?.zoneSource === 'unknown' ? undefined : clock?.zone;
|
|
2687
|
-
const messages = this.timeOptions.messages;
|
|
2688
|
-
return {
|
|
2689
|
-
...(zone !== undefined && { zone }),
|
|
2690
|
-
...(messages !== undefined && { messages }),
|
|
2691
|
-
};
|
|
2438
|
+
return agentTimeAnswerContext(state, this.timeOptions);
|
|
2692
2439
|
}
|
|
2693
2440
|
/**
|
|
2694
2441
|
* The findings ledger for a checkpoint (9.101.0) — `foldedSpansOf`'s twin:
|
|
@@ -2732,9 +2479,9 @@ export class Agent extends RunnerBase {
|
|
|
2732
2479
|
*
|
|
2733
2480
|
* @internal
|
|
2734
2481
|
*/
|
|
2735
|
-
conversationOwner() {
|
|
2482
|
+
conversationOwner(values) {
|
|
2736
2483
|
return {
|
|
2737
|
-
...(
|
|
2484
|
+
...(values.identity !== undefined && { identity: values.identity }),
|
|
2738
2485
|
...(this.explicitId !== undefined && { agentId: this.explicitId }),
|
|
2739
2486
|
};
|
|
2740
2487
|
}
|
|
@@ -2761,12 +2508,12 @@ export class Agent extends RunnerBase {
|
|
|
2761
2508
|
*
|
|
2762
2509
|
* @internal
|
|
2763
2510
|
*/
|
|
2764
|
-
applyContinuation(cp, door, appendsUserTurn) {
|
|
2511
|
+
applyContinuation(values, cp, door, appendsUserTurn) {
|
|
2765
2512
|
assertContinuable(cp, this.explicitId, door);
|
|
2766
2513
|
requireVerificationOnResume(cp, false);
|
|
2767
2514
|
if (this.negativeClaimsConfig === undefined && negativeCheckpointOf(cp) !== undefined)
|
|
2768
2515
|
throw new TypeError('Continuation requires the negative-claims setting used by the recording agent.');
|
|
2769
|
-
|
|
2516
|
+
values.pendingResumeHistory = {
|
|
2770
2517
|
history: cp.history,
|
|
2771
2518
|
appendsUserTurn,
|
|
2772
2519
|
// The turn the stored history ends on (honesty layers) — seed continues
|
|
@@ -2777,36 +2524,30 @@ export class Agent extends RunnerBase {
|
|
|
2777
2524
|
// The folded spans beside it. A conversation stored before 8.2 has none,
|
|
2778
2525
|
// and `undefined` is the right answer there — it means "this conversation
|
|
2779
2526
|
// recorded no folds", which is exactly true.
|
|
2780
|
-
|
|
2527
|
+
values.pendingResumeFolded = cp.folded;
|
|
2781
2528
|
// The findings ledger beside it (9.101.0). Stashed whether or not THIS
|
|
2782
2529
|
// agent is armed: seed restores it only under `.findings()` (the deps
|
|
2783
2530
|
// gate), and an unarmed continuation consumes and ignores it — exactly
|
|
2784
2531
|
// like a `folded` field on an agent that never folds.
|
|
2785
|
-
|
|
2532
|
+
values.pendingResumeFindingsLedger = cp.findingsLedger;
|
|
2786
2533
|
// The conversation's skill cursor (SG-C). Stashed unconditionally —
|
|
2787
2534
|
// whether it is HONORED is seed's `restoreSkillCursor` gate, which reads
|
|
2788
2535
|
// the mounted graph's `continuity` declaration; a checkpoint written by a
|
|
2789
2536
|
// continuity graph and continued on a `'turn'` one is consumed and
|
|
2790
2537
|
// ignored, exactly like a `folded` field on an agent that never folds.
|
|
2791
|
-
|
|
2538
|
+
values.pendingResumeSkillCursor = cp.skillCursor;
|
|
2792
2539
|
// Same failed request retains its single repair budget. A new user turn
|
|
2793
2540
|
// receives neither the rejected draft nor a spent retry allowance.
|
|
2794
|
-
|
|
2541
|
+
values.pendingEvidenceRecovery =
|
|
2795
2542
|
!appendsUserTurn && cp.evidenceRecovery !== undefined
|
|
2796
2543
|
? structuredClone(cp.evidenceRecovery)
|
|
2797
2544
|
: undefined;
|
|
2798
2545
|
}
|
|
2799
|
-
/** One turn at a time — see `RunInFlightError`. @internal */
|
|
2800
|
-
assertNotRunning(door) {
|
|
2801
|
-
if (this.inFlightRunId !== undefined) {
|
|
2802
|
-
throw new RunInFlightError(door, this.id, this.inFlightRunId);
|
|
2803
|
-
}
|
|
2804
|
-
}
|
|
2805
2546
|
/** A person's unanswered question outranks a new message — see
|
|
2806
2547
|
* `PendingQuestionError`. @internal */
|
|
2807
|
-
assertNoPendingQuestion(door) {
|
|
2808
|
-
if (
|
|
2809
|
-
throw new PendingQuestionError(door,
|
|
2548
|
+
assertNoPendingQuestion(door, values) {
|
|
2549
|
+
if (values?.pendingQuestion !== undefined) {
|
|
2550
|
+
throw new PendingQuestionError(door, values.pendingQuestion);
|
|
2810
2551
|
}
|
|
2811
2552
|
}
|
|
2812
2553
|
/**
|
|
@@ -2819,17 +2560,14 @@ export class Agent extends RunnerBase {
|
|
|
2819
2560
|
*
|
|
2820
2561
|
* @internal
|
|
2821
2562
|
*/
|
|
2822
|
-
recordPendingQuestion(outcome) {
|
|
2563
|
+
recordPendingQuestion(values, outcome) {
|
|
2823
2564
|
if (typeof outcome === 'string') {
|
|
2824
|
-
|
|
2565
|
+
values.pauseOutcome = undefined;
|
|
2566
|
+
values.pendingQuestion = undefined;
|
|
2825
2567
|
return;
|
|
2826
2568
|
}
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
...(typeof data?.toolName === 'string' && { toolName: data.toolName }),
|
|
2830
|
-
...(typeof data?.toolCallId === 'string' && { toolCallId: data.toolCallId }),
|
|
2831
|
-
...(typeof data?.question === 'string' && { question: data.question }),
|
|
2832
|
-
};
|
|
2569
|
+
values.pauseOutcome = outcome;
|
|
2570
|
+
values.pendingQuestion = pendingQuestionOf(outcome.pauseData);
|
|
2833
2571
|
}
|
|
2834
2572
|
/**
|
|
2835
2573
|
* Hand the `.selfExplain()` binding to the agent that owns it.
|
|
@@ -2897,21 +2635,21 @@ export class Agent extends RunnerBase {
|
|
|
2897
2635
|
* is withheld here for that reason — `sessionId` beside it is the fact the
|
|
2898
2636
|
* transport really delivered.
|
|
2899
2637
|
*/
|
|
2900
|
-
toolRunFacts() {
|
|
2638
|
+
toolRunFacts(run) {
|
|
2901
2639
|
return {
|
|
2902
|
-
runContext: { ...
|
|
2903
|
-
runId:
|
|
2904
|
-
...(
|
|
2905
|
-
sessionId:
|
|
2640
|
+
runContext: { ...run.context },
|
|
2641
|
+
runId: run.context.runId,
|
|
2642
|
+
...(run.context.sessionId !== undefined && {
|
|
2643
|
+
sessionId: run.context.sessionId,
|
|
2906
2644
|
}),
|
|
2907
|
-
...(
|
|
2645
|
+
...(run.value.identity !== undefined && { identity: run.value.identity }),
|
|
2908
2646
|
};
|
|
2909
2647
|
}
|
|
2910
2648
|
/**
|
|
2911
|
-
* The teardown tier, built on
|
|
2649
|
+
* The existing teardown tier, built on first component resource admission.
|
|
2912
2650
|
*
|
|
2913
|
-
*
|
|
2914
|
-
*
|
|
2651
|
+
* Admission precedes tool resource effects so restored owners cannot be
|
|
2652
|
+
* borrowed concurrently. Components without tool admission do not allocate it.
|
|
2915
2653
|
*/
|
|
2916
2654
|
toolSessions() {
|
|
2917
2655
|
if (!this.toolSessionTier) {
|
|
@@ -2953,14 +2691,18 @@ export class Agent extends RunnerBase {
|
|
|
2953
2691
|
const type = report.kind === 'closed'
|
|
2954
2692
|
? 'agentfootprint.tools.session_closed'
|
|
2955
2693
|
: 'agentfootprint.tools.session_close_failed';
|
|
2694
|
+
const { kind: _kind, ...payload } = report;
|
|
2695
|
+
if (origin.emit !== undefined) {
|
|
2696
|
+
origin.emit(type, payload);
|
|
2697
|
+
return;
|
|
2698
|
+
}
|
|
2956
2699
|
const dispatcher = this.getDispatcher();
|
|
2957
2700
|
if (!dispatcher.hasListenersFor(type))
|
|
2958
2701
|
return;
|
|
2959
|
-
const { kind: _kind, ...payload } = report;
|
|
2960
2702
|
dispatcher.dispatch({
|
|
2961
2703
|
type,
|
|
2962
2704
|
payload,
|
|
2963
|
-
meta: buildEventMeta({ runtimeStageId: TOOL_TEARDOWN_STAGE_ID }, origin.runContext ??
|
|
2705
|
+
meta: buildEventMeta({ runtimeStageId: TOOL_TEARDOWN_STAGE_ID }, origin.runContext ?? { runId: 'consumer-scope', runStartMs: 0, compositionPath: [] }),
|
|
2964
2706
|
});
|
|
2965
2707
|
}
|
|
2966
2708
|
openSkillIds() {
|
|
@@ -3091,7 +2833,8 @@ export class Agent extends RunnerBase {
|
|
|
3091
2833
|
return async (scope) => {
|
|
3092
2834
|
// The caller of THIS run: the instance's caller on its own run, the
|
|
3093
2835
|
// member's run (never the instance's last caller) on a mount.
|
|
3094
|
-
const
|
|
2836
|
+
const run = this.runExecution().forScope(scope);
|
|
2837
|
+
const identity = run.own ? run.value.identity : memberIdentityIn(scope);
|
|
3095
2838
|
const hidden = [];
|
|
3096
2839
|
for (const id of skillIds) {
|
|
3097
2840
|
let allowed = false;
|
|
@@ -3118,27 +2861,7 @@ export class Agent extends RunnerBase {
|
|
|
3118
2861
|
};
|
|
3119
2862
|
}
|
|
3120
2863
|
assertDeliverableRoles() {
|
|
3121
|
-
|
|
3122
|
-
for (const inj of this.injections) {
|
|
3123
|
-
for (const msg of inj.inject?.messages ?? []) {
|
|
3124
|
-
assertDeliverableRole(providers, msg.role, `Agent injection '${inj.id}'`);
|
|
3125
|
-
// Content, judged at the same funnel as role (8.18.0). The named
|
|
3126
|
-
// factories refuse empty content; a hand-built Injection reached the
|
|
3127
|
-
// delivery stage unchecked and put a contentless turn on the wire.
|
|
3128
|
-
const content = msg.content;
|
|
3129
|
-
if (typeof content !== 'string' || content.trim() === '') {
|
|
3130
|
-
throw new Error(messagesContentRefusal({
|
|
3131
|
-
site: `Agent injection '${inj.id}'`,
|
|
3132
|
-
role: msg.role,
|
|
3133
|
-
received: typeof content !== 'string'
|
|
3134
|
-
? content === undefined
|
|
3135
|
-
? 'missing'
|
|
3136
|
-
: `a ${content === null ? 'null' : typeof content}`
|
|
3137
|
-
: 'empty',
|
|
3138
|
-
}));
|
|
3139
|
-
}
|
|
3140
|
-
}
|
|
3141
|
-
}
|
|
2864
|
+
assertInjectionDelivery(this.injections, providerTargets(this.provider, this.model, this.reliabilityConfig?.providers).map((target) => target.provider));
|
|
3142
2865
|
}
|
|
3143
2866
|
/**
|
|
3144
2867
|
* Refuse, at run start, a `'tool-forced'` output strategy on a provider
|
|
@@ -3206,7 +2929,7 @@ export class Agent extends RunnerBase {
|
|
|
3206
2929
|
`not in this release. Use { strategy: 'instruct', retries: N } on this provider — it ` +
|
|
3207
2930
|
`works on every wire — or run the native strategy on a provider that declares it.`);
|
|
3208
2931
|
}
|
|
3209
|
-
|
|
2932
|
+
prepareAgentRun(invocation, runOptions, request) {
|
|
3210
2933
|
this.assertDeliverableRoles();
|
|
3211
2934
|
this.assertForcedToolChoiceSupported();
|
|
3212
2935
|
this.assertNativeOutputSchemaSupported();
|
|
@@ -3228,71 +2951,33 @@ export class Agent extends RunnerBase {
|
|
|
3228
2951
|
// is exactly the string an auditor must not read as "who did this".
|
|
3229
2952
|
// `conversationId` is deliberately not carried: it is a thread, not a
|
|
3230
2953
|
// person, and `sessionId` beside it is the fact the transport delivered.
|
|
3231
|
-
const actor = runOptions?.identity ??
|
|
2954
|
+
const actor = runOptions?.identity ?? invocation.value.identity;
|
|
2955
|
+
invocation.value.request = request;
|
|
3232
2956
|
// A fresh run starts with no evictions filed — the previous run's last
|
|
3233
2957
|
// visit must not be read as this run's (`window/evictedTurns.ts`).
|
|
3234
|
-
this.evictedTurnsHandle?.clear();
|
|
3235
|
-
const runId = makeRunId();
|
|
3236
|
-
this.mintedRunIds.add(runId);
|
|
3237
|
-
boundInsertionOrder(this.mintedRunIds, MAX_REMEMBERED_RUNS);
|
|
3238
2958
|
const hosted = hostedConversationOf(runOptions);
|
|
3239
|
-
|
|
2959
|
+
invocation.value.servingConversation =
|
|
3240
2960
|
sessionId !== undefined
|
|
3241
2961
|
? sessionConversationKey(sessionId)
|
|
3242
2962
|
: hosted !== undefined
|
|
3243
2963
|
? hostedConversationKey(hosted)
|
|
3244
2964
|
: undefined;
|
|
3245
|
-
|
|
3246
|
-
runStartMs: Date.now(),
|
|
3247
|
-
runId,
|
|
2965
|
+
const metadata = {
|
|
3248
2966
|
compositionPath: [`Agent:${this.id}`],
|
|
3249
2967
|
...(correlationId !== undefined && { correlationId }),
|
|
3250
2968
|
...(traceId !== undefined && { traceId }),
|
|
3251
|
-
// Session identity rides beside runId, not instead of it: one session
|
|
3252
|
-
// produces many runs, and an event needs to say which of each it is.
|
|
3253
2969
|
...(sessionId !== undefined && { sessionId }),
|
|
3254
2970
|
...(actor?.principal !== undefined && { principal: actor.principal }),
|
|
3255
2971
|
...(actor?.tenant !== undefined && { tenant: actor.tenant }),
|
|
3256
2972
|
};
|
|
3257
|
-
const getRunCtx = () =>
|
|
2973
|
+
const getRunCtx = () => invocation.context();
|
|
3258
2974
|
// The run's redaction (`src/redaction/`): this agent's `redact` joined
|
|
3259
2975
|
// with any policy the caller handed down for this run (a tool's
|
|
3260
2976
|
// `ctx.redact`). Opened for EVERY run — with no policy the serving is the
|
|
3261
2977
|
// identity, but the stages' scopes still feed the real-value path the
|
|
3262
2978
|
// crash checkpoint and the window's meter read.
|
|
3263
|
-
const redaction = this.
|
|
3264
|
-
|
|
3265
|
-
// The Agent's executor dials: readTracking (#18/#14, snapshot stageReads),
|
|
3266
|
-
// commitValues (#13c-B, commit-log value encoding) and writeProvenance
|
|
3267
|
-
// (#P1, per-write read provenance — the exact-dataflow debugging dial).
|
|
3268
|
-
const spec = this.getSpec();
|
|
3269
|
-
// Every scope THIS executor makes is marked as the agent's own, so a stage
|
|
3270
|
-
// can tell its own run from a mount in another runner's executor
|
|
3271
|
-
// (`memberRun.ts`) — per scope, never by instance state.
|
|
3272
|
-
const scopeFactory = redaction.scopeFactoryFor(spec);
|
|
3273
|
-
const ownScopes = this.ownScopes;
|
|
3274
|
-
const scopeRequests = this.scopeRequests;
|
|
3275
|
-
const executor = new FlowChartExecutor(spec, {
|
|
3276
|
-
readTracking: this.readTracking,
|
|
3277
|
-
commitValues: this.commitValues,
|
|
3278
|
-
writeProvenance: this.writeProvenance,
|
|
3279
|
-
scopeFactory: (...args) => {
|
|
3280
|
-
const scope = scopeFactory(...args);
|
|
3281
|
-
if (scope !== null && typeof scope === 'object') {
|
|
3282
|
-
ownScopes.add(scope);
|
|
3283
|
-
// THIS executor's request, bound to the scope for its whole life.
|
|
3284
|
-
if (request !== undefined)
|
|
3285
|
-
scopeRequests.set(scope, request);
|
|
3286
|
-
}
|
|
3287
|
-
return scope;
|
|
3288
|
-
},
|
|
3289
|
-
});
|
|
3290
|
-
redaction.applyTo(executor);
|
|
3291
|
-
// Enable structured narrative so `getLastNarrativeEntries()` can
|
|
3292
|
-
// hand a populated array to consumer Trace views (ExplainableShell).
|
|
3293
|
-
// Cheap when no consumer reads it; the recorder accumulates only.
|
|
3294
|
-
executor.enableNarrative();
|
|
3295
|
-
this.lastExecutor = executor;
|
|
2979
|
+
const redaction = this.prepareRunRedaction(invocation, runOptions?.redact);
|
|
2980
|
+
const attachments = redaction.recorders.map((recorder) => ({ recorder }));
|
|
3296
2981
|
const dispatcher = this.getDispatcher();
|
|
3297
2982
|
// RFC-001 Block 10 — observer delivery tier. With 'deferred', every
|
|
3298
2983
|
// bridge below is attached onto footprintjs's bounded capture queue
|
|
@@ -3304,35 +2989,11 @@ export class Agent extends RunnerBase {
|
|
|
3304
2989
|
? { delivery: 'deferred', ...this.observerDeliveryOptions }
|
|
3305
2990
|
: undefined;
|
|
3306
2991
|
const attachObserver = (rec) => {
|
|
3307
|
-
|
|
3308
|
-
executor.attachCombinedRecorder(rec, deferredOpts);
|
|
3309
|
-
else
|
|
3310
|
-
executor.attachCombinedRecorder(rec);
|
|
2992
|
+
attachments.push({ recorder: rec, ...(deferredOpts && { options: deferredOpts }) });
|
|
3311
2993
|
};
|
|
3312
2994
|
attachObserver(new ContextRecorder({ dispatcher, getRunContext: getRunCtx, realWrites: redaction }));
|
|
3313
|
-
//
|
|
3314
|
-
|
|
3315
|
-
// write stage consumes its accumulators MID-run (`collect()` via
|
|
3316
|
-
// `evidenceSource`, mountMemoryPipeline). Deferred delivery would run
|
|
3317
|
-
// `collect()` before the queue flushed the turn's tool/token/decision
|
|
3318
|
-
// events, persisting an incomplete causal snapshot.
|
|
3319
|
-
if (this.causalEvidence) {
|
|
3320
|
-
// Its emits arrive on the real-value path (constructor); the executor
|
|
3321
|
-
// feeds it the flow channel's decisions and the per-run reset only.
|
|
3322
|
-
const evidence = this.causalEvidence;
|
|
3323
|
-
executor.attachCombinedRecorder({
|
|
3324
|
-
id: evidence.id,
|
|
3325
|
-
onDecision: (event) => evidence.onDecision(event),
|
|
3326
|
-
onSelected: (event) => evidence.onSelected(event),
|
|
3327
|
-
clear: () => evidence.clear(),
|
|
3328
|
-
});
|
|
3329
|
-
}
|
|
3330
|
-
// Compaction's instrument. ALWAYS INLINE, for the same reason the evidence
|
|
3331
|
-
// bridge is: the compaction stage reads it MID-run, at the loop head, to
|
|
3332
|
-
// decide whether this iteration's window is over budget. A measurement
|
|
3333
|
-
// delivered one beat behind would be a measurement of the wrong window.
|
|
3334
|
-
if (this.compactionMeterHandle) {
|
|
3335
|
-
executor.attachCombinedRecorder(this.compactionMeterHandle);
|
|
2995
|
+
// Computational observers belong to native component setup, always inline.
|
|
2996
|
+
if (this.windowStrategy !== undefined) {
|
|
3336
2997
|
// Folds speak the context vocabulary consumers already subscribe to
|
|
3337
2998
|
// (`context.evicted` / `context.budget_pressure`) — no new event types.
|
|
3338
2999
|
// ContextRecorder only dispatches those from writes INSIDE a slot
|
|
@@ -3489,17 +3150,30 @@ export class Agent extends RunnerBase {
|
|
|
3489
3150
|
// `{ id, delivery: 'inline', ...hooks }` stays inline under an
|
|
3490
3151
|
// observerDelivery: 'deferred' agent, and vice versa.
|
|
3491
3152
|
if (r.delivery !== undefined)
|
|
3492
|
-
|
|
3153
|
+
attachments.push({ recorder: r });
|
|
3493
3154
|
else
|
|
3494
3155
|
attachObserver(r);
|
|
3495
3156
|
}
|
|
3496
|
-
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
|
|
3157
|
+
return {
|
|
3158
|
+
setup: {
|
|
3159
|
+
redaction: redaction.recordPolicy,
|
|
3160
|
+
narrative: {},
|
|
3161
|
+
attachments,
|
|
3162
|
+
onOrigin: () => {
|
|
3163
|
+
// Native is the only ID/clock authority. Remaining domain consumers
|
|
3164
|
+
// still migrate to captured component values; no private ID is minted.
|
|
3165
|
+
this.bindRunServing(invocation);
|
|
3166
|
+
this.emitRunManifest(invocation.context());
|
|
3167
|
+
this.emitSkillGraphDeclared(invocation.context());
|
|
3168
|
+
},
|
|
3169
|
+
},
|
|
3170
|
+
binding: {
|
|
3171
|
+
metadata,
|
|
3172
|
+
bindScope: (scope, context) => {
|
|
3173
|
+
redaction.bindScope(scope, context);
|
|
3174
|
+
},
|
|
3175
|
+
},
|
|
3176
|
+
};
|
|
3503
3177
|
}
|
|
3504
3178
|
/**
|
|
3505
3179
|
* File the run-configuration manifest (9.41.0) — which adapters and
|
|
@@ -3527,8 +3201,8 @@ export class Agent extends RunnerBase {
|
|
|
3527
3201
|
* with `'*'` before the run starts, so every recording carries one.
|
|
3528
3202
|
*/
|
|
3529
3203
|
/** Fresh per-run ledger — see AgentOptions.integrityPosture (9.60.0). */
|
|
3530
|
-
beginIntegrityLedger() {
|
|
3531
|
-
|
|
3204
|
+
beginIntegrityLedger(values) {
|
|
3205
|
+
values.integrityLedger.current = beginIntegrityRun({
|
|
3532
3206
|
wire: true,
|
|
3533
3207
|
composeInvariant: this.mapsPlan !== undefined,
|
|
3534
3208
|
dangling: this.integrityDanglingPresent,
|
|
@@ -3554,11 +3228,11 @@ export class Agent extends RunnerBase {
|
|
|
3554
3228
|
* uncaught. Called on the SUCCESS path before the recording files, so the
|
|
3555
3229
|
* failure is the run's result, never a masked afterthought.
|
|
3556
3230
|
*/
|
|
3557
|
-
assertIntegrityAlive() {
|
|
3231
|
+
assertIntegrityAlive(invocation) {
|
|
3558
3232
|
if (this.integrityPosture !== 'dev')
|
|
3559
3233
|
return;
|
|
3560
|
-
|
|
3561
|
-
workExisted: this.integrityWorkExisted(),
|
|
3234
|
+
invocation.value.integrityLedger.current?.assertAlive({
|
|
3235
|
+
workExisted: this.integrityWorkExisted(invocation),
|
|
3562
3236
|
});
|
|
3563
3237
|
}
|
|
3564
3238
|
/**
|
|
@@ -3573,8 +3247,8 @@ export class Agent extends RunnerBase {
|
|
|
3573
3247
|
* circular: an unhooked check would report "no work existed" and silence
|
|
3574
3248
|
* the very alarm it should be tripping.
|
|
3575
3249
|
*/
|
|
3576
|
-
integrityWorkExisted() {
|
|
3577
|
-
const state =
|
|
3250
|
+
integrityWorkExisted(invocation) {
|
|
3251
|
+
const state = invocation.view.snapshot()?.sharedState;
|
|
3578
3252
|
return state !== undefined && state.llmLatestContent !== undefined;
|
|
3579
3253
|
}
|
|
3580
3254
|
/**
|
|
@@ -3583,9 +3257,9 @@ export class Agent extends RunnerBase {
|
|
|
3583
3257
|
* before the recording stops. Listener-gated like every typed event, and
|
|
3584
3258
|
* deliberately throw-proof: accounting must never change a run's outcome.
|
|
3585
3259
|
*/
|
|
3586
|
-
fileIntegrityDisposition() {
|
|
3587
|
-
const ledger =
|
|
3588
|
-
|
|
3260
|
+
fileIntegrityDisposition(invocation) {
|
|
3261
|
+
const ledger = invocation.value.integrityLedger.current;
|
|
3262
|
+
invocation.value.integrityLedger.current = undefined;
|
|
3589
3263
|
if (ledger === undefined)
|
|
3590
3264
|
return;
|
|
3591
3265
|
try {
|
|
@@ -3597,17 +3271,17 @@ export class Agent extends RunnerBase {
|
|
|
3597
3271
|
type,
|
|
3598
3272
|
payload: {
|
|
3599
3273
|
posture: this.integrityPosture,
|
|
3600
|
-
workExisted: this.integrityWorkExisted(),
|
|
3274
|
+
workExisted: this.integrityWorkExisted(invocation),
|
|
3601
3275
|
rows: ledger.report(),
|
|
3602
3276
|
},
|
|
3603
|
-
meta: buildEventMeta({ runtimeStageId: INTEGRITY_DISPOSITION_STAGE_ID },
|
|
3277
|
+
meta: buildEventMeta({ runtimeStageId: INTEGRITY_DISPOSITION_STAGE_ID }, invocation.context()),
|
|
3604
3278
|
});
|
|
3605
3279
|
}
|
|
3606
3280
|
catch {
|
|
3607
3281
|
// Recorder/dispatcher failures never abort a run — the house rule.
|
|
3608
3282
|
}
|
|
3609
3283
|
}
|
|
3610
|
-
emitRunManifest() {
|
|
3284
|
+
emitRunManifest(context) {
|
|
3611
3285
|
const type = 'agentfootprint.agent.run_configured';
|
|
3612
3286
|
const dispatcher = this.getDispatcher();
|
|
3613
3287
|
if (!dispatcher.hasListenersFor(type))
|
|
@@ -3658,7 +3332,7 @@ export class Agent extends RunnerBase {
|
|
|
3658
3332
|
},
|
|
3659
3333
|
}),
|
|
3660
3334
|
}),
|
|
3661
|
-
meta: buildEventMeta({ runtimeStageId: RUN_MANIFEST_STAGE_ID },
|
|
3335
|
+
meta: buildEventMeta({ runtimeStageId: RUN_MANIFEST_STAGE_ID }, context),
|
|
3662
3336
|
});
|
|
3663
3337
|
}
|
|
3664
3338
|
/**
|
|
@@ -3677,7 +3351,7 @@ export class Agent extends RunnerBase {
|
|
|
3677
3351
|
* No graph, or a graph that could not state its map ⇒ no event — absent,
|
|
3678
3352
|
* never guessed.
|
|
3679
3353
|
*/
|
|
3680
|
-
emitSkillGraphDeclared() {
|
|
3354
|
+
emitSkillGraphDeclared(context) {
|
|
3681
3355
|
if (this.skillGraphDeclared === undefined)
|
|
3682
3356
|
return;
|
|
3683
3357
|
const type = 'agentfootprint.skill.graph_declared';
|
|
@@ -3687,7 +3361,7 @@ export class Agent extends RunnerBase {
|
|
|
3687
3361
|
dispatcher.dispatch({
|
|
3688
3362
|
type,
|
|
3689
3363
|
payload: this.skillGraphDeclared,
|
|
3690
|
-
meta: buildEventMeta({ runtimeStageId: GRAPH_DECLARED_STAGE_ID },
|
|
3364
|
+
meta: buildEventMeta({ runtimeStageId: GRAPH_DECLARED_STAGE_ID }, context),
|
|
3691
3365
|
});
|
|
3692
3366
|
}
|
|
3693
3367
|
/**
|
|
@@ -3711,9 +3385,10 @@ export class Agent extends RunnerBase {
|
|
|
3711
3385
|
* ```
|
|
3712
3386
|
*/
|
|
3713
3387
|
drainObservers(opts) {
|
|
3714
|
-
|
|
3388
|
+
const view = this.runExecution().view();
|
|
3389
|
+
if (view === undefined)
|
|
3715
3390
|
return Promise.resolve({ done: 0, failed: 0, pending: 0 });
|
|
3716
|
-
return
|
|
3391
|
+
return view.drainObservers(opts);
|
|
3717
3392
|
}
|
|
3718
3393
|
/**
|
|
3719
3394
|
* Did the last turn stop because a LIMIT cut it short — and if so, which?
|
|
@@ -3959,15 +3634,16 @@ export class Agent extends RunnerBase {
|
|
|
3959
3634
|
* ```
|
|
3960
3635
|
*/
|
|
3961
3636
|
async assessment(declarations) {
|
|
3962
|
-
const
|
|
3637
|
+
const selected = this.runExecution().selected();
|
|
3638
|
+
const snapshot = selected?.view.snapshot();
|
|
3963
3639
|
if (snapshot === undefined)
|
|
3964
3640
|
return undefined;
|
|
3965
3641
|
// Settled before the fold, which cannot tell a crash from its committed state: an answer
|
|
3966
3642
|
// this run RETURNED (`lastRunAnswer`, cleared at every run's start), or a pause — the fold
|
|
3967
3643
|
// reads that one from the committed state itself. Read BEFORE the import resolves, so a
|
|
3968
3644
|
// run started meanwhile cannot change which run is assessed.
|
|
3969
|
-
const paused =
|
|
3970
|
-
if (!paused &&
|
|
3645
|
+
const paused = selected?.view.isPaused() === true;
|
|
3646
|
+
if (!paused && selected?.value.answer === undefined)
|
|
3971
3647
|
return undefined;
|
|
3972
3648
|
// Loaded on first use, off the default graph (the findings/peel.ts precedent).
|
|
3973
3649
|
// The live state, read as values — never as a served record (`assess.ts` · `assessLive`).
|
|
@@ -4102,11 +3778,13 @@ export class Agent extends RunnerBase {
|
|
|
4102
3778
|
}
|
|
4103
3779
|
return undefined;
|
|
4104
3780
|
}
|
|
4105
|
-
finalizeResult(
|
|
4106
|
-
const paused = this.detectPause(
|
|
3781
|
+
finalizeResult(invocation, result) {
|
|
3782
|
+
const paused = this.detectPause(invocation, result);
|
|
4107
3783
|
if (paused)
|
|
4108
3784
|
return paused;
|
|
4109
|
-
const snap =
|
|
3785
|
+
const snap = invocation.view.snapshot();
|
|
3786
|
+
if (snap === undefined)
|
|
3787
|
+
throw new TypeError('The native execution has no ready snapshot');
|
|
4110
3788
|
const state = snap.sharedState;
|
|
4111
3789
|
const refusal = this.refusalVerdictOf(state);
|
|
4112
3790
|
if (refusal !== undefined) {
|
|
@@ -4122,7 +3800,7 @@ export class Agent extends RunnerBase {
|
|
|
4122
3800
|
stage: '__output_admission__',
|
|
4123
3801
|
scope: 'run',
|
|
4124
3802
|
},
|
|
4125
|
-
meta: buildEventMeta({ runtimeStageId: '__output_admission__' },
|
|
3803
|
+
meta: buildEventMeta({ runtimeStageId: '__output_admission__' }, invocation.context()),
|
|
4126
3804
|
});
|
|
4127
3805
|
}
|
|
4128
3806
|
// The verdict was decoded from the LIVE state above; the snapshot a
|
|
@@ -4143,10 +3821,10 @@ export class Agent extends RunnerBase {
|
|
|
4143
3821
|
// `'pause'` this is unreachable for the first block (the run pauses and
|
|
4144
3822
|
// `detectPause` returned above); it still fires if a RESUME found consent
|
|
4145
3823
|
// ungranted and the model then finished the turn on its own.
|
|
4146
|
-
if (
|
|
4147
|
-
const [record] = [...
|
|
3824
|
+
if (invocation.value.consentOutstanding.size > 0) {
|
|
3825
|
+
const [record] = [...invocation.value.consentOutstanding.values()];
|
|
4148
3826
|
if (record) {
|
|
4149
|
-
|
|
3827
|
+
invocation.value.consentOutstanding.clear();
|
|
4150
3828
|
throw new CredentialConsentRequiredError(record);
|
|
4151
3829
|
}
|
|
4152
3830
|
}
|
|
@@ -4227,163 +3905,177 @@ export class Agent extends RunnerBase {
|
|
|
4227
3905
|
// keep them. Negative-claim observations also persist independently of those
|
|
4228
3906
|
// layers. Still value-conditional inside seed (only when rows exist).
|
|
4229
3907
|
let ledgerRestoreArmed = this.findingsOptions !== undefined || this.negativeClaimsConfig !== undefined;
|
|
4230
|
-
const
|
|
4231
|
-
const
|
|
4232
|
-
|
|
4233
|
-
|
|
4234
|
-
|
|
4235
|
-
|
|
4236
|
-
|
|
4237
|
-
|
|
4238
|
-
|
|
4239
|
-
|
|
4240
|
-
|
|
4241
|
-
|
|
4242
|
-
|
|
4243
|
-
|
|
4244
|
-
|
|
4245
|
-
|
|
4246
|
-
|
|
4247
|
-
get toolWantsByName() {
|
|
4248
|
-
return seededToolWants;
|
|
4249
|
-
},
|
|
4250
|
-
get ruledTools() {
|
|
4251
|
-
return seededRuledTools;
|
|
4252
|
-
},
|
|
4253
|
-
get honestyLayers() {
|
|
4254
|
-
return seededHonestyLayers;
|
|
4255
|
-
},
|
|
4256
|
-
// The time layer's clock: the draft `run()` read (refusing a run with no
|
|
4257
|
-
// zone), stamped by seed as the turn's one `clock` row. Absent → the
|
|
4258
|
-
// deps object seed always had.
|
|
4259
|
-
// The caller's clock belongs to the agent's OWN run: a member (another
|
|
4260
|
-
// runner's executor) gets the builder's fallback, never a concurrent
|
|
4261
|
-
// direct caller's `time` (`memberRun.ts`).
|
|
4262
|
-
...(this.timeOptions !== undefined && {
|
|
4263
|
-
timeClock: (scope) => this.ownScopes.has(scope)
|
|
4264
|
-
? this.seedClockDraft()
|
|
4265
|
-
: draftClock(undefined, this.timeOptions ?? {}),
|
|
4266
|
-
}),
|
|
4267
|
-
// The time layer's reader: seed reads the person's words once per turn,
|
|
4268
|
-
// after the clock. Absent → nothing is read.
|
|
4269
|
-
...(this.timeOptions?.reader !== undefined &&
|
|
4270
|
-
this.timeOptions.policy !== undefined && {
|
|
4271
|
-
timeReader: { reader: this.timeOptions.reader, policy: this.timeOptions.policy },
|
|
4272
|
-
}),
|
|
4273
|
-
// Declared sources (honesty layer 2): the seed twin plants `_findings.from`
|
|
4274
|
-
// on ruled tools, and the run's `messageFrom` constant is written — only
|
|
4275
|
-
// under the arm (refused at build without the inputs layer).
|
|
4276
|
-
...(this.argumentSourcesArmed === true && { argumentSources: true }),
|
|
4277
|
-
// The answer check's tool-call ledger — value-conditional, so an agent
|
|
4278
|
-
// without answer validation or negative claims keeps its prior shape.
|
|
4279
|
-
...((this.answerValidationConfig !== undefined ||
|
|
4280
|
-
this.negativeClaimsConfig !== undefined) && { toolCallLedger: true }),
|
|
4281
|
-
...(this.negativeClaimsConfig !== undefined && { negativeClaimsArmed: true }),
|
|
4282
|
-
get consumePendingResumeFindingsLedger() {
|
|
4283
|
-
return ledgerRestoreArmed ? consumeResumeLedger : undefined;
|
|
4284
|
-
},
|
|
4285
|
-
consumePendingResumeHistory: () => {
|
|
4286
|
-
const h = this.pendingResumeHistory;
|
|
4287
|
-
this.pendingResumeHistory = undefined;
|
|
4288
|
-
return h;
|
|
4289
|
-
},
|
|
4290
|
-
...(this.evidenceGate !== undefined &&
|
|
4291
|
-
this.evidenceGate.posture !== 'assist' && {
|
|
4292
|
-
consumePendingEvidenceRecovery: () => {
|
|
4293
|
-
const recovery = this.pendingEvidenceRecovery;
|
|
4294
|
-
this.pendingEvidenceRecovery = undefined;
|
|
4295
|
-
return recovery;
|
|
3908
|
+
const seedFor = (run) => {
|
|
3909
|
+
const consumeResumeLedger = () => {
|
|
3910
|
+
const l = run.value.pendingResumeFindingsLedger;
|
|
3911
|
+
run.value.pendingResumeFindingsLedger = undefined;
|
|
3912
|
+
return l;
|
|
3913
|
+
};
|
|
3914
|
+
return buildSeedStage({
|
|
3915
|
+
maxIterations,
|
|
3916
|
+
// The forced-output tool's name (9.88.0) — a build-time constant, put on
|
|
3917
|
+
// the record once so a rebuild can name it without reading a receipt.
|
|
3918
|
+
...(this.outputEnforcement?.schemaTool !== undefined && {
|
|
3919
|
+
forcedOutputToolName: this.outputEnforcement.schemaTool.name,
|
|
3920
|
+
}),
|
|
3921
|
+
cachingDisabled,
|
|
3922
|
+
...(costBudget !== undefined && { costBudgetOnExceed: costBudget.onExceed }),
|
|
3923
|
+
get toolSchemas() {
|
|
3924
|
+
return toolSchemasResolved;
|
|
4296
3925
|
},
|
|
4297
|
-
|
|
4298
|
-
|
|
4299
|
-
|
|
4300
|
-
|
|
4301
|
-
|
|
4302
|
-
|
|
4303
|
-
|
|
4304
|
-
|
|
4305
|
-
|
|
4306
|
-
|
|
4307
|
-
|
|
4308
|
-
|
|
4309
|
-
|
|
4310
|
-
|
|
4311
|
-
|
|
4312
|
-
|
|
4313
|
-
|
|
4314
|
-
|
|
4315
|
-
|
|
3926
|
+
get toolWantsByName() {
|
|
3927
|
+
return seededToolWants;
|
|
3928
|
+
},
|
|
3929
|
+
get ruledTools() {
|
|
3930
|
+
return seededRuledTools;
|
|
3931
|
+
},
|
|
3932
|
+
get honestyLayers() {
|
|
3933
|
+
return seededHonestyLayers;
|
|
3934
|
+
},
|
|
3935
|
+
// The time layer's clock: the draft `run()` read (refusing a run with no
|
|
3936
|
+
// zone), stamped by seed as the turn's one `clock` row. Absent → the
|
|
3937
|
+
// deps object seed always had.
|
|
3938
|
+
// The caller's clock belongs to the agent's OWN run: a member (another
|
|
3939
|
+
// runner's executor) gets the builder's fallback, never a concurrent
|
|
3940
|
+
// direct caller's `time` (`memberRun.ts`).
|
|
3941
|
+
...(this.timeOptions !== undefined && {
|
|
3942
|
+
timeClock: () => run.own
|
|
3943
|
+
? this.seedClockDraft(run.value)
|
|
3944
|
+
: draftClock(undefined, this.timeOptions ?? {}),
|
|
4316
3945
|
}),
|
|
4317
|
-
|
|
4318
|
-
|
|
4319
|
-
|
|
4320
|
-
|
|
4321
|
-
|
|
4322
|
-
|
|
4323
|
-
|
|
4324
|
-
|
|
4325
|
-
|
|
4326
|
-
|
|
4327
|
-
|
|
4328
|
-
|
|
4329
|
-
|
|
4330
|
-
|
|
4331
|
-
|
|
4332
|
-
|
|
4333
|
-
|
|
4334
|
-
},
|
|
4335
|
-
restoreSkillCursor: this.skillGraphCascade?.continuity === 'conversation',
|
|
4336
|
-
// Steps (9.18.0): gate the per-run stepPointer/stepNudgeSpent reset on
|
|
4337
|
-
// the feature, so every other agent seeds exactly the keys it always did.
|
|
4338
|
-
...(stepPlanFor !== undefined && { hasSteps: true }),
|
|
4339
|
-
// Escalation (9.19.0): same gate discipline — the per-run counter/flip
|
|
4340
|
-
// reset exists only when the policy does (de-escalation IS the seed).
|
|
4341
|
-
...(this.skillBrains?.escalation !== undefined && { hasEscalation: true }),
|
|
4342
|
-
// The evidence gate's one bounded revision (9.35.0) — a per-turn budget,
|
|
4343
|
-
// reset here. Only a posture that can revise writes the key.
|
|
4344
|
-
...((this.typedNegativeClaimsConfig !== undefined ||
|
|
4345
|
-
(this.evidenceGate !== undefined && this.evidenceGate.posture !== 'assist')) && {
|
|
4346
|
-
hasEvidenceRevision: true,
|
|
4347
|
-
}),
|
|
4348
|
-
// Under an enforcing answer validation the tools stay off for a run
|
|
4349
|
-
// resumed after its revision was asked (`toolsOffAfterRevision`).
|
|
4350
|
-
...(this.revisionWithholdsTools() && { toolsOffAfterRevision: true }),
|
|
4351
|
-
getCurrentRunId: () => this.currentRunContext?.runId,
|
|
4352
|
-
// WHO this run is for, when the caller named nobody (9.10.0). Seed uses
|
|
4353
|
-
// it for exactly one rung of the identity ladder — see `seedFrom` — and
|
|
4354
|
-
// an explicit identity outranks it there. Read through an accessor for
|
|
4355
|
-
// the same reason the runId is: the chart is built once, and this
|
|
4356
|
-
// changes every run.
|
|
4357
|
-
getCurrentSessionId: () => this.currentRunContext?.sessionId,
|
|
4358
|
-
// Whether this stage runs in THIS agent's own executor, or inside another
|
|
4359
|
-
// runner's (a composition, a chart a caller built) — where the accessors
|
|
4360
|
-
// above describe some other run (`memberRun.ts`). Asked per scope.
|
|
4361
|
-
isOwnRun: (scope) => this.ownScopes.has(scope),
|
|
4362
|
-
// WHICH TURN THIS IS (9.6.0). Only memories that WRITE the conversation
|
|
4363
|
-
// are consulted: they are the ones whose entry ids are turn-stamped, and
|
|
4364
|
-
// a corpus (`.rag(...)`, which reads under its own namespace) has no
|
|
4365
|
-
// turns at all. Empty list → seed stays synchronous and makes no store
|
|
4366
|
-
// call, so an agent without memory is unchanged.
|
|
4367
|
-
...(conversationStores.length > 0 && { conversationStores }),
|
|
4368
|
-
// The `'input'` half of the message chain, run BEFORE `userMessage` and
|
|
4369
|
-
// `history` are committed — see SeedStageDeps.messageMiddleware.
|
|
4370
|
-
...(this.messageMiddleware.length > 0 && { messageMiddleware: this.messageMiddleware }),
|
|
4371
|
-
// `.configure()` — seed is where run-level facts are decided and
|
|
4372
|
-
// committed, so the resolver rides that commit. The closure supplies
|
|
4373
|
-
// the build-time defaults so a resolver can decide RELATIVE to them
|
|
4374
|
-
// ("upgrade the model when the message is long") instead of having to
|
|
4375
|
-
// restate them.
|
|
4376
|
-
...(this.runConfigFn && {
|
|
4377
|
-
resolveRunConfig: (input) => {
|
|
4378
|
-
const ctx = {
|
|
4379
|
-
message: input.message,
|
|
4380
|
-
...(input.identity !== undefined && { identity: input.identity }),
|
|
4381
|
-
runId: this.currentRunContext?.runId ?? 'unknown',
|
|
4382
|
-
defaults: { model, instructions: systemPromptValue },
|
|
4383
|
-
};
|
|
4384
|
-
return this.runConfigFn?.(ctx);
|
|
3946
|
+
// The time layer's reader: seed reads the person's words once per turn,
|
|
3947
|
+
// after the clock. Absent → nothing is read.
|
|
3948
|
+
...(this.timeOptions?.reader !== undefined &&
|
|
3949
|
+
this.timeOptions.policy !== undefined && {
|
|
3950
|
+
timeReader: { reader: this.timeOptions.reader, policy: this.timeOptions.policy },
|
|
3951
|
+
}),
|
|
3952
|
+
// Declared sources (honesty layer 2): the seed twin plants `_findings.from`
|
|
3953
|
+
// on ruled tools, and the run's `messageFrom` constant is written — only
|
|
3954
|
+
// under the arm (refused at build without the inputs layer).
|
|
3955
|
+
...(this.argumentSourcesArmed === true && { argumentSources: true }),
|
|
3956
|
+
// The answer check's tool-call ledger — value-conditional, so an agent
|
|
3957
|
+
// without answer validation or negative claims keeps its prior shape.
|
|
3958
|
+
...((this.answerValidationConfig !== undefined ||
|
|
3959
|
+
this.negativeClaimsConfig !== undefined) && { toolCallLedger: true }),
|
|
3960
|
+
...(this.negativeClaimsConfig !== undefined && { negativeClaimsArmed: true }),
|
|
3961
|
+
get consumePendingResumeFindingsLedger() {
|
|
3962
|
+
return ledgerRestoreArmed ? consumeResumeLedger : undefined;
|
|
4385
3963
|
},
|
|
4386
|
-
|
|
3964
|
+
consumePendingResumeHistory: () => {
|
|
3965
|
+
const h = run.value.pendingResumeHistory;
|
|
3966
|
+
run.value.pendingResumeHistory = undefined;
|
|
3967
|
+
return h;
|
|
3968
|
+
},
|
|
3969
|
+
...(this.evidenceGate !== undefined &&
|
|
3970
|
+
this.evidenceGate.posture !== 'assist' && {
|
|
3971
|
+
consumePendingEvidenceRecovery: () => {
|
|
3972
|
+
const recovery = run.value.pendingEvidenceRecovery;
|
|
3973
|
+
run.value.pendingEvidenceRecovery = undefined;
|
|
3974
|
+
return recovery;
|
|
3975
|
+
},
|
|
3976
|
+
}),
|
|
3977
|
+
consumePendingResumeFolded: () => {
|
|
3978
|
+
const f = run.value.pendingResumeFolded;
|
|
3979
|
+
run.value.pendingResumeFolded = undefined;
|
|
3980
|
+
return f;
|
|
3981
|
+
},
|
|
3982
|
+
// The findings ledger (9.101.0): the arm, the serve mode it puts on the
|
|
3983
|
+
// record (the `forcedOutputToolName` precedent — a build-time constant
|
|
3984
|
+
// the rebuild reads instead of the receipt), and the continued
|
|
3985
|
+
// conversation's rows, all under the one gate — an unarmed agent hands
|
|
3986
|
+
// seed exactly the deps object it always did.
|
|
3987
|
+
...(this.findingsOptions !== undefined && {
|
|
3988
|
+
findings: true,
|
|
3989
|
+
findingsServe: this.findingsOptions.serve ?? 'ledger-and-facts',
|
|
3990
|
+
findingsContextBytes: this.findingsOptions.maxContextBytes,
|
|
3991
|
+
// The answer-turn ask (9.103.0): VALUE-conditional inside the arm —
|
|
3992
|
+
// the default `'none'` threads nothing and writes no key.
|
|
3993
|
+
...(this.findingsOptions.answerAsk === 'quote-facts' && {
|
|
3994
|
+
findingsAnswerAsk: 'quote-facts',
|
|
3995
|
+
}),
|
|
3996
|
+
}),
|
|
3997
|
+
// The declared ontology (9.106.0): the whole frozen map, which seed
|
|
3998
|
+
// writes ONCE as the run constant `ontology` — the `findingsServe`
|
|
3999
|
+
// precedent, a build-time fact the rebuild reads from the RECORD. An
|
|
4000
|
+
// unarmed agent hands seed exactly the deps object it always did.
|
|
4001
|
+
...(this.ontology !== undefined && {
|
|
4002
|
+
ontology: this.ontology,
|
|
4003
|
+
ontologyTools: () => this.ontologyTools,
|
|
4004
|
+
}),
|
|
4005
|
+
// The conversation's inherited skill cursor (SG-C). Consumed (cleared)
|
|
4006
|
+
// on every run; HONORED only when the mounted graph declared
|
|
4007
|
+
// `continuity: 'conversation'` — the same one-option-one-behavior gate
|
|
4008
|
+
// the write side (`checkpoint()`) applies.
|
|
4009
|
+
consumePendingResumeSkillCursor: () => {
|
|
4010
|
+
const c = run.value.pendingResumeSkillCursor;
|
|
4011
|
+
run.value.pendingResumeSkillCursor = undefined;
|
|
4012
|
+
return c;
|
|
4013
|
+
},
|
|
4014
|
+
restoreSkillCursor: this.skillGraphCascade?.continuity === 'conversation',
|
|
4015
|
+
// Steps (9.18.0): gate the per-run stepPointer/stepNudgeSpent reset on
|
|
4016
|
+
// the feature, so every other agent seeds exactly the keys it always did.
|
|
4017
|
+
...(stepPlanFor !== undefined && { hasSteps: true }),
|
|
4018
|
+
// Escalation (9.19.0): same gate discipline — the per-run counter/flip
|
|
4019
|
+
// reset exists only when the policy does (de-escalation IS the seed).
|
|
4020
|
+
...(this.skillBrains?.escalation !== undefined && { hasEscalation: true }),
|
|
4021
|
+
// The evidence gate's one bounded revision (9.35.0) — a per-turn budget,
|
|
4022
|
+
// reset here. Only a posture that can revise writes the key.
|
|
4023
|
+
...((this.typedNegativeClaimsConfig !== undefined ||
|
|
4024
|
+
(this.evidenceGate !== undefined && this.evidenceGate.posture !== 'assist')) && {
|
|
4025
|
+
hasEvidenceRevision: true,
|
|
4026
|
+
}),
|
|
4027
|
+
// Under an enforcing answer validation the tools stay off for a run
|
|
4028
|
+
// resumed after its revision was asked (`toolsOffAfterRevision`).
|
|
4029
|
+
...(this.revisionWithholdsTools() && { toolsOffAfterRevision: true }),
|
|
4030
|
+
getCurrentRunId: () => run.context.runId,
|
|
4031
|
+
// WHO this run is for, when the caller named nobody (9.10.0). Seed uses
|
|
4032
|
+
// it for exactly one rung of the identity ladder — see `seedFrom` — and
|
|
4033
|
+
// an explicit identity outranks it there. Read through an accessor for
|
|
4034
|
+
// the same reason the runId is: the chart is built once, and this
|
|
4035
|
+
// changes every run.
|
|
4036
|
+
getCurrentSessionId: () => run.context.sessionId,
|
|
4037
|
+
// Whether this stage runs in THIS agent's own executor, or inside another
|
|
4038
|
+
// runner's (a composition, a chart a caller built) — where the accessors
|
|
4039
|
+
// above describe some other run (`memberRun.ts`). Asked per scope.
|
|
4040
|
+
isOwnRun: () => run.own,
|
|
4041
|
+
// WHICH TURN THIS IS (9.6.0). Only memories that WRITE the conversation
|
|
4042
|
+
// are consulted: they are the ones whose entry ids are turn-stamped, and
|
|
4043
|
+
// a corpus (`.rag(...)`, which reads under its own namespace) has no
|
|
4044
|
+
// turns at all. Empty list → seed stays synchronous and makes no store
|
|
4045
|
+
// call, so an agent without memory is unchanged.
|
|
4046
|
+
...(conversationStores.length > 0 && { conversationStores }),
|
|
4047
|
+
// The `'input'` half of the message chain, run BEFORE `userMessage` and
|
|
4048
|
+
// `history` are committed — see SeedStageDeps.messageMiddleware.
|
|
4049
|
+
...(this.messageMiddleware.length > 0 && { messageMiddleware: this.messageMiddleware }),
|
|
4050
|
+
// `.configure()` — seed is where run-level facts are decided and
|
|
4051
|
+
// committed, so the resolver rides that commit. The closure supplies
|
|
4052
|
+
// the build-time defaults so a resolver can decide RELATIVE to them
|
|
4053
|
+
// ("upgrade the model when the message is long") instead of having to
|
|
4054
|
+
// restate them.
|
|
4055
|
+
...(this.runConfigFn && {
|
|
4056
|
+
resolveRunConfig: (input) => {
|
|
4057
|
+
const ctx = {
|
|
4058
|
+
message: input.message,
|
|
4059
|
+
...(input.identity !== undefined && { identity: input.identity }),
|
|
4060
|
+
runId: run.context.runId ?? 'unknown',
|
|
4061
|
+
defaults: { model, instructions: systemPromptValue },
|
|
4062
|
+
};
|
|
4063
|
+
return this.runConfigFn?.(ctx);
|
|
4064
|
+
},
|
|
4065
|
+
}),
|
|
4066
|
+
});
|
|
4067
|
+
};
|
|
4068
|
+
const seed = bindRunnerStage((scope) => this.runExecution().forScope(scope), (run) => (scope) => {
|
|
4069
|
+
run.value.resources?.seed(scope);
|
|
4070
|
+
// Mounted runs have no Agent.run() admission. Seed's actual input is
|
|
4071
|
+
// their original message; never read another run's selected values.
|
|
4072
|
+
run.value.checkpointTracker ??= {
|
|
4073
|
+
runId: run.context.runId,
|
|
4074
|
+
originalInput: { message: scope.$getArgs().message },
|
|
4075
|
+
history: [],
|
|
4076
|
+
lastCompletedIteration: 0,
|
|
4077
|
+
};
|
|
4078
|
+
return (run.value.seed ??= seedFor(run))(scope);
|
|
4387
4079
|
});
|
|
4388
4080
|
// Tool registry composition extracted to ./agent/buildToolRegistry.ts.
|
|
4389
4081
|
// Composes static .tool() registry + auto-attached read_skill (+ the
|
|
@@ -4399,6 +4091,8 @@ export class Agent extends RunnerBase {
|
|
|
4399
4091
|
// plants `_findings.from` on it and its sentences name that argument.
|
|
4400
4092
|
...(this.argumentSourcesArmed === true && { argumentSources: true }),
|
|
4401
4093
|
});
|
|
4094
|
+
if ([...registryByName.values()].some(carriesArgumentView))
|
|
4095
|
+
declarePrivateFields(this);
|
|
4402
4096
|
// The declared ontology's tool edges (9.106.0): every name a node's `via`
|
|
4403
4097
|
// names must be a tool this registry can dispatch — the static registry,
|
|
4404
4098
|
// the framework's doors and every skill's tools, `registryByName` being
|
|
@@ -4646,44 +4340,22 @@ export class Agent extends RunnerBase {
|
|
|
4646
4340
|
const messagesSubflow = buildMessagesSlot({
|
|
4647
4341
|
...(budget?.messages !== undefined && { budgetCap: budget.messages }),
|
|
4648
4342
|
});
|
|
4649
|
-
//
|
|
4650
|
-
|
|
4651
|
-
// Tool[] from `provider.list(ctx)` so dispatch doesn't re-invoke `list()`
|
|
4652
|
-
// — vital for async network providers.
|
|
4653
|
-
//
|
|
4654
|
-
// LIFETIME, stated correctly (9.92.0): the chart is built ONCE, at
|
|
4655
|
-
// construction (`initChart`), and reused by every `run()` and `resume()`
|
|
4656
|
-
// of this Agent — so this cache and the record below outlive a run. They
|
|
4657
|
-
// are safe because one Agent runs one turn at a time and the slot
|
|
4658
|
-
// overwrites them every iteration before dispatch reads them. What that
|
|
4659
|
-
// does NOT cover is a resume in a FRESH instance, whose closure is empty
|
|
4660
|
-
// and whose Compose never re-runs before the resumed dispatch — which is
|
|
4661
|
-
// why the pause paths carry `pausedToolParty` on the checkpoint.
|
|
4662
|
-
const providerToolCache = { current: [] };
|
|
4663
|
-
// Who put each name on the wire (9.92.0) — the same closure-shared shape,
|
|
4664
|
-
// written by the tools slot's merge and read by dispatch so the party
|
|
4665
|
-
// whose contract the model read is the party that answers. `lastServed`
|
|
4666
|
-
// is the run's memory of the same fact, for a name that left the wire.
|
|
4667
|
-
const servedTools = { current: new Map(), lastServed: new Map() };
|
|
4668
|
-
// THE ONE DISPATCH RESOLVER, for the inputs layer (honesty layer 2): built
|
|
4669
|
-
// from the SAME deps objects the dispatch handler builds its own from, so
|
|
4670
|
-
// the layer reads a call's rules off the implementation that will answer.
|
|
4671
|
-
const resolveForLayer = buildToolResolver({
|
|
4343
|
+
// Every reader binds the same native component's private catalog.
|
|
4344
|
+
const resolverForValues = (values) => buildToolResolver({
|
|
4672
4345
|
registryByName,
|
|
4673
4346
|
...(this.externalToolProvider && { externalToolProvider: this.externalToolProvider }),
|
|
4674
|
-
...(this.externalToolProvider && { providerToolCache }),
|
|
4675
|
-
servedTools,
|
|
4347
|
+
...(this.externalToolProvider && { providerToolCache: values.providerToolCache }),
|
|
4348
|
+
servedTools: values.servedTools,
|
|
4676
4349
|
toolClaimants,
|
|
4677
4350
|
notServed: notServedResult,
|
|
4678
4351
|
});
|
|
4679
|
-
|
|
4680
|
-
|
|
4681
|
-
// the one rule (`lib/displayName.ts` · `readDisplayName`), so a value nobody vetted
|
|
4682
|
-
// is never printed. Wired only where a tool can declare one: on every other agent
|
|
4683
|
-
// the final branch is the one it always was.
|
|
4684
|
-
const displayNameOf = this.externalToolProvider !== undefined ||
|
|
4352
|
+
const resolveForLayer = (scope) => resolverForValues(this.runExecution().forScope(scope).value);
|
|
4353
|
+
const displayNameOfFor = this.externalToolProvider !== undefined ||
|
|
4685
4354
|
[...registryByName.values()].some((tool) => tool.displayName !== undefined)
|
|
4686
|
-
? (
|
|
4355
|
+
? (scope) => {
|
|
4356
|
+
const resolve = resolveForLayer(scope);
|
|
4357
|
+
return (toolName) => readDisplayName(resolve(toolName).tool?.displayName);
|
|
4358
|
+
}
|
|
4687
4359
|
: undefined;
|
|
4688
4360
|
const readSkillFor = this.readSkillOfferFor();
|
|
4689
4361
|
// Per-role skill visibility. The Injection Engine resolves the ids once per
|
|
@@ -4692,9 +4364,9 @@ export class Agent extends RunnerBase {
|
|
|
4692
4364
|
// mount. Since 9.86.0 the description is NOT the only reader — the read_skill gate's refusals, the
|
|
4693
4365
|
// `skill.rejected` payload, the propose-transition refusal and the dispatch
|
|
4694
4366
|
// roster all filter through that published set
|
|
4695
|
-
// (`stages/toolCalls.ts` ·
|
|
4367
|
+
// (`stages/toolCalls/routing/readSkillRoute.ts` · `applyReadSkillRoute` the gate, `toolCalls/routing/effectsOperations.ts` ·
|
|
4696
4368
|
// "── THE REFUSAL SPEAKS WITH THE FILTERED SETS" the propose-transition refusal,
|
|
4697
|
-
// `toolCalls.ts` · `dispatchRoster`). Nothing is cached here: an
|
|
4369
|
+
// `toolCalls/execution/catalogOperations.ts` · `dispatchRoster`). Nothing is cached here: an
|
|
4698
4370
|
// earlier draft of 9.84.0 cached the resolved ids so the gate could filter
|
|
4699
4371
|
// the self-call notice's move offer through them; the notice no longer names
|
|
4700
4372
|
// a destination at all (see `selfCallNotice`), so there is nothing left to
|
|
@@ -4762,17 +4434,20 @@ export class Agent extends RunnerBase {
|
|
|
4762
4434
|
...(this.mapsPlan !== undefined && {
|
|
4763
4435
|
mountedMaps: this.mapsPlan.maps.map((m) => ({ id: m.id, toolNames: m.toolNames })),
|
|
4764
4436
|
}),
|
|
4765
|
-
|
|
4437
|
+
runtime: (scope) => {
|
|
4438
|
+
const value = this.runExecution().forScope(scope).value;
|
|
4439
|
+
return { ...value, integrityLedger: value.integrityLedger };
|
|
4440
|
+
},
|
|
4766
4441
|
...(this.externalToolProvider && { toolProvider: this.externalToolProvider }),
|
|
4767
|
-
...(this.externalToolProvider && { providerToolCache }),
|
|
4768
4442
|
// The caller of THIS run, for `ToolDispatchContext.callerIdentity`: the
|
|
4769
4443
|
// instance's caller on its own run, the member's run on a mount — never a
|
|
4770
4444
|
// derived identity (the `hiddenSkillIdsNow` precedent).
|
|
4771
4445
|
...(this.externalToolProvider && {
|
|
4772
|
-
callerIdentity: (scope) => this.
|
|
4446
|
+
callerIdentity: (scope) => this.runExecution().forScope(scope).own
|
|
4447
|
+
? this.runExecution().forScope(scope).value.identity
|
|
4448
|
+
: memberIdentityIn(scope),
|
|
4773
4449
|
}),
|
|
4774
4450
|
toolClaimants,
|
|
4775
|
-
servedTools,
|
|
4776
4451
|
...(readSkillFor && { readSkillFor }),
|
|
4777
4452
|
...(budget?.tools !== undefined && { budgetCap: budget.tools }),
|
|
4778
4453
|
// Steps (9.18.0): per-step narrowing + banner + the skip_step offer.
|
|
@@ -4815,11 +4490,11 @@ export class Agent extends RunnerBase {
|
|
|
4815
4490
|
});
|
|
4816
4491
|
// callLLM extracted to ./agent/stages/callLLM.ts (v2.11.2). Same
|
|
4817
4492
|
// late-binding pattern as seed for toolSchemas (computed below).
|
|
4818
|
-
const
|
|
4493
|
+
const callLLMFor = (run) => buildCallLLMStage({
|
|
4819
4494
|
onReplayPrepared: (preparation) => {
|
|
4820
|
-
if (
|
|
4821
|
-
|
|
4822
|
-
retainReplayRetirements(
|
|
4495
|
+
if (run.value.checkpointTracker !== undefined &&
|
|
4496
|
+
run.context.runId === run.value.checkpointTracker.runId)
|
|
4497
|
+
retainReplayRetirements(run.value.checkpointTracker, preparation);
|
|
4823
4498
|
},
|
|
4824
4499
|
...((this.typedNegativeClaimsConfig !== undefined ||
|
|
4825
4500
|
(this.evidenceGate !== undefined && this.evidenceGate.posture !== 'assist')) && {
|
|
@@ -4865,17 +4540,19 @@ export class Agent extends RunnerBase {
|
|
|
4865
4540
|
// layer). Step T8: the same line carries the turn's time limits.
|
|
4866
4541
|
...(this.timeOptions !== undefined && { timeLine: true }),
|
|
4867
4542
|
// The receipt's salt (9.88.0) — read per call, like seed's own accessor.
|
|
4868
|
-
getRunId: () =>
|
|
4543
|
+
getRunId: () => run.context.runId,
|
|
4869
4544
|
// …and its off switch. Value-conditional, so an agent on the default
|
|
4870
4545
|
// hands `callLLM` exactly the dep bag it always did.
|
|
4871
4546
|
...(this.recordReceiptValue === false && { recordReceipt: false }),
|
|
4872
4547
|
// …and the window's evictions for `omittedForAttention` (9.93.0) — only
|
|
4873
4548
|
// an agent with a window strategy has any, and only it hands the seam.
|
|
4874
|
-
...(
|
|
4549
|
+
...(run.value.evictedTurnsHandle !== undefined && {
|
|
4550
|
+
evictedTurns: run.value.evictedTurnsHandle,
|
|
4551
|
+
}),
|
|
4875
4552
|
// …and the receipt memo, so a run hashes each message once rather than
|
|
4876
4553
|
// once per call (`core/agent/receipt/receiptDigests.ts`). Only where a
|
|
4877
4554
|
// receipt is minted at all.
|
|
4878
|
-
...(this.recordReceiptValue !== false && { receiptDigests:
|
|
4555
|
+
...(this.recordReceiptValue !== false && { receiptDigests: run.value.receiptDigests }),
|
|
4879
4556
|
provider,
|
|
4880
4557
|
model,
|
|
4881
4558
|
...(temperature !== undefined && { temperature }),
|
|
@@ -4908,7 +4585,7 @@ export class Agent extends RunnerBase {
|
|
|
4908
4585
|
// was called this response" not-applicable notes.
|
|
4909
4586
|
...(this.checkColumnTypes !== 'off' &&
|
|
4910
4587
|
toolColumns.size > 0 && { columnDeclaringTools: new Set(toolColumns.keys()) }),
|
|
4911
|
-
integrityLedger:
|
|
4588
|
+
integrityLedger: run.value.integrityLedger,
|
|
4912
4589
|
...(this.reliabilityConfig !== undefined && { reliability: this.reliabilityConfig }),
|
|
4913
4590
|
...(this.outputSchemaParser !== undefined && {
|
|
4914
4591
|
outputSchemaParser: this.outputSchemaParser,
|
|
@@ -4955,18 +4632,20 @@ export class Agent extends RunnerBase {
|
|
|
4955
4632
|
// it becomes the ReAct loop target (see the chart builders), so it runs
|
|
4956
4633
|
// once per iteration boundary with the previous call's adapter-reported
|
|
4957
4634
|
// usage already measured by the meter.
|
|
4958
|
-
const
|
|
4635
|
+
const callLLM = bindRunnerStage((scope) => this.runExecution().forScope(scope), (run) => (run.value.callLLM ??= callLLMFor(run)));
|
|
4636
|
+
const configuredWindow = this.windowStrategy;
|
|
4637
|
+
const windowStage = configuredWindow
|
|
4959
4638
|
? {
|
|
4960
4639
|
strategyName: this.windowStrategy.name,
|
|
4961
|
-
run: buildWindowStage({
|
|
4962
|
-
strategy:
|
|
4963
|
-
meter:
|
|
4964
|
-
...(
|
|
4965
|
-
evictedTurns:
|
|
4640
|
+
run: bindRunnerStage((scope) => this.runExecution().forScope(scope), (run) => (run.value.window ??= buildWindowStage({
|
|
4641
|
+
strategy: configuredWindow,
|
|
4642
|
+
meter: run.value.compactionMeter,
|
|
4643
|
+
...(run.value.evictedTurnsHandle !== undefined && {
|
|
4644
|
+
evictedTurns: run.value.evictedTurnsHandle,
|
|
4966
4645
|
}),
|
|
4967
4646
|
agentModel: model,
|
|
4968
4647
|
providerName: provider.name,
|
|
4969
|
-
getRunId: () =>
|
|
4648
|
+
getRunId: () => run.context.runId,
|
|
4970
4649
|
// Value-conditional (the `repeatedCallNudge` precedent): an
|
|
4971
4650
|
// agent on the default hands the stage exactly the deps object
|
|
4972
4651
|
// it always did.
|
|
@@ -4985,7 +4664,7 @@ export class Agent extends RunnerBase {
|
|
|
4985
4664
|
}),
|
|
4986
4665
|
...(pricingTable !== undefined && { pricingTable }),
|
|
4987
4666
|
...(costBudget !== undefined && { costBudget }),
|
|
4988
|
-
}),
|
|
4667
|
+
}))),
|
|
4989
4668
|
}
|
|
4990
4669
|
: undefined;
|
|
4991
4670
|
// routeDecider extracted to ./agent/stages/route.ts (v2.11.2).
|
|
@@ -5016,82 +4695,87 @@ export class Agent extends RunnerBase {
|
|
|
5016
4695
|
// question a build-time mount can answer.
|
|
5017
4696
|
const canCallTools = registryByName.size > 0 || this.externalToolProvider !== undefined;
|
|
5018
4697
|
const hasWrapUp = canCallTools && this.wrapUpAtMaxIterations !== false;
|
|
5019
|
-
const baseRouteDecider = buildRouteDeciderStage(this.messageMiddleware, this.outputEnforcement, stepPlanFor, this.evidenceGate, hasWrapUp, this.claimContract, this.integrityLedgerHolder,
|
|
5020
|
-
// THE CLAIM SEAM'S RECENCY READ (9.83.0). Value-conditional on both
|
|
5021
|
-
// halves, so an agent that armed neither hands the decider builder
|
|
5022
|
-
// exactly the arguments it always did — and `buildRouteDeciderStage`'s
|
|
5023
|
-
// no-judge fast path still returns the very function reference every
|
|
5024
|
-
// pre-9.83.0 chart was given.
|
|
5025
|
-
this.noticePriorTurnEvidence && this.evidenceGate !== undefined ? true : undefined,
|
|
5026
|
-
// THE ANSWER TURN'S STANDINGS (9.101.0) — the same value-conditional
|
|
5027
|
-
// trailing positional, for the same reason: an unarmed agent hands the
|
|
5028
|
-
// builder exactly the arguments it always did.
|
|
5029
|
-
this.findingsOptions !== undefined ? true : undefined,
|
|
5030
|
-
// THE INPUTS LAYER (honesty layer 2) — the same value-conditional
|
|
5031
|
-
// trailing positional: the rows this decider files carry the turn
|
|
5032
|
-
// stamp, and with the evidence gate armed too, the gate's exempt corpus
|
|
5033
|
-
// gains this turn's assumed values, read from the tools' declarations,
|
|
5034
|
-
// and the values the person gave the layer's batch ask (step 4). The
|
|
5035
|
-
// results layer (step 7b) arms the stamp alone — "while any layer is
|
|
5036
|
-
// armed, the one writer stamps the turn" — and nothing else.
|
|
5037
|
-
inputsArmed || resultsArmed
|
|
5038
|
-
? {
|
|
5039
|
-
...(inputsArmed &&
|
|
5040
|
-
this.evidenceGate !== undefined && {
|
|
5041
|
-
declaredDefaults: declaredDefaultsFrom((toolName, argument) => {
|
|
5042
|
-
const rules = rulesOf(resolveForLayer(toolName).tool);
|
|
5043
|
-
if (rules === undefined || isRefused(rules))
|
|
5044
|
-
return undefined;
|
|
5045
|
-
return rules.ruled.find((r) => r.argument === argument)?.assume;
|
|
5046
|
-
}),
|
|
5047
|
-
answeredValues: answeredValuesOf,
|
|
5048
|
-
// Under `.time()` (step T7): the turn's time spellings by
|
|
5049
|
-
// lineage — said ones exempt, derived ones filed, not flagged.
|
|
5050
|
-
...(this.timeOptions !== undefined && { timeLineage: true }),
|
|
5051
|
-
}),
|
|
5052
|
-
}
|
|
5053
|
-
: undefined,
|
|
5054
|
-
// THE ANSWER LAYER (honesty layer 4) — the same value-conditional
|
|
5055
|
-
// trailing positional: the judges file the answer's witness rows, and
|
|
5056
|
-
// every row this decider files carries the turn stamp.
|
|
5057
|
-
answerArmed ? true : undefined);
|
|
5058
|
-
const validatedRouteDecider = this.answerValidationConfig === undefined
|
|
5059
|
-
? baseRouteDecider
|
|
5060
|
-
: withAnswerValidation(baseRouteDecider, this.answerValidationConfig, this.outputSchemaParser, artifactStore, () => this.consentOutstanding.size > 0, this.outputEnforcement?.outputFormat !== undefined,
|
|
5061
|
-
// Read only when `agentChecks` lists 'claims' (the agent's own rows).
|
|
5062
|
-
this.claimContract, this.typedNegativeClaimsConfig === undefined
|
|
5063
|
-
? undefined
|
|
5064
|
-
: {
|
|
5065
|
-
config: this.typedNegativeClaimsConfig,
|
|
5066
|
-
phrases: this.typedNegativeClaimsConfig.phrases,
|
|
5067
|
-
applicationValidation: this.applicationAnswerValidation,
|
|
5068
|
-
runId: () => this.currentRunContext.runId,
|
|
5069
|
-
});
|
|
5070
|
-
const routeDecider = this.negativeClaimsConfig?.mode === 'prose'
|
|
5071
|
-
? withNegativeProse(validatedRouteDecider, {
|
|
5072
|
-
runId: () => this.currentRunContext.runId,
|
|
5073
|
-
hasOutstandingConsent: () => this.consentOutstanding.size > 0,
|
|
5074
|
-
structured: this.outputSchemaParser !== undefined,
|
|
5075
|
-
phrases: this.negativeClaimsConfig.phrases,
|
|
5076
|
-
})
|
|
5077
|
-
: validatedRouteDecider;
|
|
5078
|
-
// `.limitsTravelWithTheAnswer()` on a TYPED answer — decided once, here.
|
|
5079
|
-
// An output schema makes the answer JSON, and the appended block would
|
|
5080
|
-
// make it JSON followed by prose, which `runTyped()` cannot parse. So the
|
|
5081
|
-
// limits travel as DATA: the Route decider's terminal decision commits the
|
|
5082
|
-
// fold (`withAnswerCoverage`) and the Final branch projects it onto
|
|
5083
|
-
// `turn_end`. A prose answer keeps the block; an agent that asked for
|
|
5084
|
-
// neither is handed the decider it always had.
|
|
5085
4698
|
const limitsAsData = this.limitsTravelWithTheAnswerValue && this.outputSchemaParser !== undefined;
|
|
5086
|
-
|
|
5087
|
-
|
|
5088
|
-
|
|
5089
|
-
|
|
5090
|
-
|
|
5091
|
-
|
|
5092
|
-
|
|
5093
|
-
|
|
5094
|
-
|
|
4699
|
+
const routeFor = (run) => {
|
|
4700
|
+
const resolve = resolverForValues(run.value);
|
|
4701
|
+
const baseRouteDecider = buildRouteDeciderStage(this.messageMiddleware, this.outputEnforcement, stepPlanFor, this.evidenceGate, hasWrapUp, this.claimContract, run.value.integrityLedger,
|
|
4702
|
+
// THE CLAIM SEAM'S RECENCY READ (9.83.0). Value-conditional on both
|
|
4703
|
+
// halves, so an agent that armed neither hands the decider builder
|
|
4704
|
+
// exactly the arguments it always did — and `buildRouteDeciderStage`'s
|
|
4705
|
+
// no-judge fast path still returns the very function reference every
|
|
4706
|
+
// pre-9.83.0 chart was given.
|
|
4707
|
+
this.noticePriorTurnEvidence && this.evidenceGate !== undefined ? true : undefined,
|
|
4708
|
+
// THE ANSWER TURN'S STANDINGS (9.101.0) — the same value-conditional
|
|
4709
|
+
// trailing positional, for the same reason: an unarmed agent hands the
|
|
4710
|
+
// builder exactly the arguments it always did.
|
|
4711
|
+
this.findingsOptions !== undefined ? true : undefined,
|
|
4712
|
+
// THE INPUTS LAYER (honesty layer 2) — the same value-conditional
|
|
4713
|
+
// trailing positional: the rows this decider files carry the turn
|
|
4714
|
+
// stamp, and with the evidence gate armed too, the gate's exempt corpus
|
|
4715
|
+
// gains this turn's assumed values, read from the tools' declarations,
|
|
4716
|
+
// and the values the person gave the layer's batch ask (step 4). The
|
|
4717
|
+
// results layer (step 7b) arms the stamp alone — "while any layer is
|
|
4718
|
+
// armed, the one writer stamps the turn" — and nothing else.
|
|
4719
|
+
inputsArmed || resultsArmed
|
|
4720
|
+
? {
|
|
4721
|
+
...(inputsArmed &&
|
|
4722
|
+
this.evidenceGate !== undefined && {
|
|
4723
|
+
declaredDefaults: declaredDefaultsFrom((toolName, argument) => {
|
|
4724
|
+
const rules = rulesOf(resolve(toolName).tool);
|
|
4725
|
+
if (rules === undefined || isRefused(rules))
|
|
4726
|
+
return undefined;
|
|
4727
|
+
return rules.ruled.find((r) => r.argument === argument)?.assume;
|
|
4728
|
+
}),
|
|
4729
|
+
answeredValues: answeredValuesOf,
|
|
4730
|
+
// Under `.time()` (step T7): the turn's time spellings by
|
|
4731
|
+
// lineage — said ones exempt, derived ones filed, not flagged.
|
|
4732
|
+
...(this.timeOptions !== undefined && { timeLineage: true }),
|
|
4733
|
+
}),
|
|
4734
|
+
}
|
|
4735
|
+
: undefined,
|
|
4736
|
+
// THE ANSWER LAYER (honesty layer 4) — the same value-conditional
|
|
4737
|
+
// trailing positional: the judges file the answer's witness rows, and
|
|
4738
|
+
// every row this decider files carries the turn stamp.
|
|
4739
|
+
answerArmed ? true : undefined);
|
|
4740
|
+
const validatedRouteDecider = this.answerValidationConfig === undefined
|
|
4741
|
+
? baseRouteDecider
|
|
4742
|
+
: withAnswerValidation(baseRouteDecider, this.answerValidationConfig, this.outputSchemaParser, artifactStore, () => run.value.consentOutstanding.size > 0, this.outputEnforcement?.outputFormat !== undefined,
|
|
4743
|
+
// Read only when `agentChecks` lists 'claims' (the agent's own rows).
|
|
4744
|
+
this.claimContract, this.typedNegativeClaimsConfig === undefined
|
|
4745
|
+
? undefined
|
|
4746
|
+
: {
|
|
4747
|
+
config: this.typedNegativeClaimsConfig,
|
|
4748
|
+
phrases: this.typedNegativeClaimsConfig.phrases,
|
|
4749
|
+
applicationValidation: this.applicationAnswerValidation,
|
|
4750
|
+
runId: () => run.context.runId,
|
|
4751
|
+
});
|
|
4752
|
+
const routeDecider = this.negativeClaimsConfig?.mode === 'prose'
|
|
4753
|
+
? withNegativeProse(validatedRouteDecider, {
|
|
4754
|
+
runId: () => run.context.runId,
|
|
4755
|
+
hasOutstandingConsent: () => run.value.consentOutstanding.size > 0,
|
|
4756
|
+
structured: this.outputSchemaParser !== undefined,
|
|
4757
|
+
phrases: this.negativeClaimsConfig.phrases,
|
|
4758
|
+
})
|
|
4759
|
+
: validatedRouteDecider;
|
|
4760
|
+
// `.limitsTravelWithTheAnswer()` on a TYPED answer — decided once, here.
|
|
4761
|
+
// An output schema makes the answer JSON, and the appended block would
|
|
4762
|
+
// make it JSON followed by prose, which `runTyped()` cannot parse. So the
|
|
4763
|
+
// limits travel as DATA: the Route decider's terminal decision commits the
|
|
4764
|
+
// fold (`withAnswerCoverage`) and the Final branch projects it onto
|
|
4765
|
+
// `turn_end`. A prose answer keeps the block; an agent that asked for
|
|
4766
|
+
// neither is handed the decider it always had.
|
|
4767
|
+
// With the inputs layer armed, the typed answer's limits carry this
|
|
4768
|
+
// turn's assumed values too — the same rows the prose "Assumed" block
|
|
4769
|
+
// prints (`withAnswerCoverage`'s second argument); a rewrite by a
|
|
4770
|
+
// before-tool chain is read only when the agent has one.
|
|
4771
|
+
const terminalRouteDecider = limitsAsData
|
|
4772
|
+
? withAnswerCoverage(routeDecider, inputsArmed ? { rewrites: this.toolMiddleware.length > 0 } : undefined)
|
|
4773
|
+
: routeDecider;
|
|
4774
|
+
// toolCallsHandler extracted to ./agent/stages/toolCalls/index.ts (v2.11.2).
|
|
4775
|
+
return terminalRouteDecider;
|
|
4776
|
+
};
|
|
4777
|
+
const terminalRouteDecider = bindRunnerStage((scope) => this.runExecution().forScope(scope), (run) => (run.value.route ??= routeFor(run)));
|
|
4778
|
+
const toolCallsFor = (run) => buildToolCallsHandler({
|
|
5095
4779
|
registryByName,
|
|
5096
4780
|
// WHICH SKILLS DECLARE EACH TOOL NAME (9.86.0) — read by the unknown-tool
|
|
5097
4781
|
// roster so a role that may not see a skill is not told the names of the
|
|
@@ -5146,7 +4830,7 @@ export class Agent extends RunnerBase {
|
|
|
5146
4830
|
...(this.noticeEmptyLookups &&
|
|
5147
4831
|
toolGrounding.size > 0 && {
|
|
5148
4832
|
emptyLookupGrounding: toolGrounding,
|
|
5149
|
-
integrityLedger:
|
|
4833
|
+
integrityLedger: run.value.integrityLedger,
|
|
5150
4834
|
}),
|
|
5151
4835
|
// THE WRITE SEAM'S other check (9.78.0) — the column-type contract.
|
|
5152
4836
|
// Value-conditional on both halves for the same reason, so an agent
|
|
@@ -5156,11 +4840,21 @@ export class Agent extends RunnerBase {
|
|
|
5156
4840
|
toolColumns.size > 0 && {
|
|
5157
4841
|
columnDeclarations: toolColumns,
|
|
5158
4842
|
columnCheckMode: this.checkColumnTypes,
|
|
5159
|
-
integrityLedger:
|
|
4843
|
+
integrityLedger: run.value.integrityLedger,
|
|
5160
4844
|
}),
|
|
5161
4845
|
...(this.externalToolProvider && { externalToolProvider: this.externalToolProvider }),
|
|
5162
|
-
...(this.externalToolProvider && {
|
|
5163
|
-
|
|
4846
|
+
...(this.externalToolProvider && {
|
|
4847
|
+
providerToolCache: run.value.providerToolCache,
|
|
4848
|
+
prepareProviderTools: (scope) => ensureDiscoveredTools(scope, {
|
|
4849
|
+
provider: this.externalToolProvider,
|
|
4850
|
+
cache: run.value.providerToolCache,
|
|
4851
|
+
callerIdentity: run.own ? run.value.identity : memberIdentityIn(scope),
|
|
4852
|
+
get iteration() {
|
|
4853
|
+
return scope.iteration ?? 1;
|
|
4854
|
+
},
|
|
4855
|
+
}),
|
|
4856
|
+
}),
|
|
4857
|
+
servedTools: run.value.servedTools,
|
|
5164
4858
|
toolClaimants,
|
|
5165
4859
|
...(permissionChecker && { permissionChecker }),
|
|
5166
4860
|
...(credentialProvider && { credentialProvider }),
|
|
@@ -5168,7 +4862,7 @@ export class Agent extends RunnerBase {
|
|
|
5168
4862
|
// or — on a mount — the run its link names (`memberRun.ts`). An accessor,
|
|
5169
4863
|
// because the chart is built once and the request is per run.
|
|
5170
4864
|
...(credentialProvider && {
|
|
5171
|
-
currentRequest: (scope) =>
|
|
4865
|
+
currentRequest: (scope) => (run.own ? run.value.request : memberRequestIn(scope)),
|
|
5172
4866
|
}),
|
|
5173
4867
|
// The claim-check store (9.21.0). Absent → not one new line runs in
|
|
5174
4868
|
// dispatch: `ctx.artifacts` is the fail-closed teacher and no artifact
|
|
@@ -5242,7 +4936,8 @@ export class Agent extends RunnerBase {
|
|
|
5242
4936
|
// injections exist; nothing runs until a tool returns an effect.
|
|
5243
4937
|
...(this.injections.length > 0 && {
|
|
5244
4938
|
leaseTargets: new Map(this.injections.map((inj) => {
|
|
5245
|
-
const surfaceMode = inj.metadata
|
|
4939
|
+
const surfaceMode = inj.metadata
|
|
4940
|
+
?.surfaceMode;
|
|
5246
4941
|
return [inj.id, { ...(surfaceMode !== undefined && { surfaceMode }) }];
|
|
5247
4942
|
})),
|
|
5248
4943
|
}),
|
|
@@ -5265,19 +4960,20 @@ export class Agent extends RunnerBase {
|
|
|
5265
4960
|
// at construction, and a captured value would be run #1's forever. The
|
|
5266
4961
|
// tier one is lazy on top of that — an agent whose tools hold no sessions
|
|
5267
4962
|
// never allocates it.
|
|
5268
|
-
currentRun: () => this.toolRunFacts(),
|
|
5269
|
-
|
|
5270
|
-
|
|
4963
|
+
currentRun: () => this.toolRunFacts(run),
|
|
4964
|
+
isRunRetired: () => run.retired,
|
|
4965
|
+
isOwnRun: () => run.own,
|
|
4966
|
+
answeredAsk: () => run.value.answeredAsk,
|
|
5271
4967
|
// The time layer: each dispatched call files its `call` row, and the
|
|
5272
4968
|
// resume door compares a resume's passed `time` with the kept clock.
|
|
5273
4969
|
...(this.timeOptions !== undefined && {
|
|
5274
4970
|
time: {
|
|
5275
|
-
takePassedOnResume: (
|
|
4971
|
+
takePassedOnResume: () => {
|
|
5276
4972
|
// Only the agent's own resumed leg takes it — never a member's.
|
|
5277
|
-
if (!
|
|
4973
|
+
if (!run.own)
|
|
5278
4974
|
return undefined;
|
|
5279
|
-
const passed =
|
|
5280
|
-
|
|
4975
|
+
const passed = run.value.resumePassedTime;
|
|
4976
|
+
run.value.resumePassedTime = undefined;
|
|
5281
4977
|
return passed;
|
|
5282
4978
|
},
|
|
5283
4979
|
...(this.timeOptions.zone !== undefined && { appZone: this.timeOptions.zone }),
|
|
@@ -5294,7 +4990,7 @@ export class Agent extends RunnerBase {
|
|
|
5294
4990
|
},
|
|
5295
4991
|
}),
|
|
5296
4992
|
emitForRun: (type, payload, runContext) => this.emitLateFact(type, payload, runContext),
|
|
5297
|
-
|
|
4993
|
+
resources: run.value.resources,
|
|
5298
4994
|
// 8.6.0 — what a run does when a declared credential needs 3LO consent.
|
|
5299
4995
|
onAuthorizationRequired: this.onAuthorizationRequired,
|
|
5300
4996
|
// The `'tell-model'` consent record travels OFF tracked state (a tracked
|
|
@@ -5302,10 +4998,10 @@ export class Agent extends RunnerBase {
|
|
|
5302
4998
|
// these two callbacks are its whole route to the caller. Cleared at the
|
|
5303
4999
|
// top of every run; read in `finalizeResult`.
|
|
5304
5000
|
reportConsentOutstanding: (record) => {
|
|
5305
|
-
|
|
5001
|
+
run.value.consentOutstanding.set(record.service, record);
|
|
5306
5002
|
},
|
|
5307
5003
|
clearConsentOutstanding: (service) => {
|
|
5308
|
-
|
|
5004
|
+
run.value.consentOutstanding.delete(service);
|
|
5309
5005
|
},
|
|
5310
5006
|
});
|
|
5311
5007
|
// v2.14 — Build the NormalizeThinking sub-subflow only when a
|
|
@@ -5313,6 +5009,11 @@ export class Agent extends RunnerBase {
|
|
|
5313
5009
|
// explicitly set via .thinkingHandler()). Conditional mount ensures
|
|
5314
5010
|
// zero overhead for non-thinking agents — the chart has zero extra
|
|
5315
5011
|
// stages when undefined.
|
|
5012
|
+
const handlerFor = (run) => (run.value.toolCalls ??= toolCallsFor(run));
|
|
5013
|
+
const toolCallsHandler = {
|
|
5014
|
+
execute: bindRunnerStage((scope) => this.runExecution().forScope(scope), (run) => (scope) => handlerFor(run).execute(scope)),
|
|
5015
|
+
resume: bindRunnerStage((scope) => this.runExecution().forScope(scope), (run) => (scope, input) => handlerFor(run).resume(scope, input)),
|
|
5016
|
+
};
|
|
5316
5017
|
const thinkingSubflow = this.thinkingHandler
|
|
5317
5018
|
? buildThinkingSubflow(this.thinkingHandler, this.provider.name)
|
|
5318
5019
|
: undefined;
|
|
@@ -5322,7 +5023,9 @@ export class Agent extends RunnerBase {
|
|
|
5322
5023
|
const chartDeps = {
|
|
5323
5024
|
memories: this.memories,
|
|
5324
5025
|
// Evidence bridge (#5): closure hand-off to the CAUSAL write mounts.
|
|
5325
|
-
...(this.
|
|
5026
|
+
...(this.memories.some((memory) => memory.type === 'causal') && {
|
|
5027
|
+
causalEvidenceSource: (binding) => componentEvidence(this.runExecution().forScope(binding).value, binding),
|
|
5028
|
+
}),
|
|
5326
5029
|
systemPromptCachePolicy,
|
|
5327
5030
|
maxIterations,
|
|
5328
5031
|
seed,
|
|
@@ -5386,7 +5089,10 @@ export class Agent extends RunnerBase {
|
|
|
5386
5089
|
// Route's sixth dispatch value, read only by an agent whose revision
|
|
5387
5090
|
// turns the tools off (an enforcing answer validation).
|
|
5388
5091
|
...(this.revisionWithholdsTools() && { toolsOffAfterRevision: true }),
|
|
5389
|
-
|
|
5092
|
+
toolOfFor: (scope) => {
|
|
5093
|
+
const resolve = resolveForLayer(scope);
|
|
5094
|
+
return (toolName) => resolve(toolName).tool;
|
|
5095
|
+
},
|
|
5390
5096
|
...(this.toolMiddleware.length > 0 && { rewrites: true }),
|
|
5391
5097
|
// The time layer (step T5a): a tool whose period declares forms is filled from the
|
|
5392
5098
|
// turn's one window, bound to the person's window, or recorded as the model's.
|
|
@@ -5424,7 +5130,12 @@ export class Agent extends RunnerBase {
|
|
|
5424
5130
|
// head, in both builders through one helper, reading each call's
|
|
5425
5131
|
// `ToolPeriod` off the implementation that answered it; absent → untouched.
|
|
5426
5132
|
...(resultsArmed && {
|
|
5427
|
-
resultsLayer: {
|
|
5133
|
+
resultsLayer: {
|
|
5134
|
+
toolOfFor: (scope) => {
|
|
5135
|
+
const resolve = resolveForLayer(scope);
|
|
5136
|
+
return (toolName) => resolve(toolName).tool;
|
|
5137
|
+
},
|
|
5138
|
+
},
|
|
5428
5139
|
}),
|
|
5429
5140
|
// The answer layer (honesty layer 4): its stage heads the final branch
|
|
5430
5141
|
// in both builders through one helper, reading only the committed keys
|
|
@@ -5442,11 +5153,11 @@ export class Agent extends RunnerBase {
|
|
|
5442
5153
|
standingLine: this.answerLayerOption.standingLine,
|
|
5443
5154
|
}),
|
|
5444
5155
|
...(this.answerValidationConfig !== undefined && { validated: true }),
|
|
5445
|
-
...(
|
|
5156
|
+
...(displayNameOfFor !== undefined && { displayNameOfFor }),
|
|
5446
5157
|
},
|
|
5447
5158
|
}),
|
|
5448
5159
|
// The prose limits block names an item's calls in the app's words — under the same wiring.
|
|
5449
|
-
...(
|
|
5160
|
+
...(displayNameOfFor !== undefined && { displayNameOfFor }),
|
|
5450
5161
|
// Tool choice by classifier (9.105.0): the mount args on the Tools
|
|
5451
5162
|
// branch and the key across the sf-llm-call boundary, under the arm.
|
|
5452
5163
|
...(this.toolChoiceOptions !== undefined && { hasToolChoice: true }),
|
|
@@ -5536,60 +5247,4 @@ export class Agent extends RunnerBase {
|
|
|
5536
5247
|
// AgentBuilder extracted to ./agent/AgentBuilder.ts (v2.11.2).
|
|
5537
5248
|
// Re-export so the 28+ existing import sites continue to work unchanged.
|
|
5538
5249
|
// Validators + helpers extracted to ./agent/validators.ts (v2.11.1).
|
|
5539
|
-
/** How many run ids one instance remembers. */
|
|
5540
|
-
const MAX_REMEMBERED_RUNS = 256;
|
|
5541
|
-
/** Drop the oldest entries of an insertion-ordered Set or Map past `max`. */
|
|
5542
|
-
function boundInsertionOrder(held, max) {
|
|
5543
|
-
while (held.size > max) {
|
|
5544
|
-
const oldest = held.keys().next();
|
|
5545
|
-
if (oldest.done === true)
|
|
5546
|
-
return;
|
|
5547
|
-
held.delete(oldest.value);
|
|
5548
|
-
}
|
|
5549
|
-
}
|
|
5550
|
-
/**
|
|
5551
|
-
* The run options without the time layer's `time` — what the engine is handed.
|
|
5552
|
-
* The SAME object when it carries no `time` key, so a run that passed none
|
|
5553
|
-
* hands the executor exactly the options it always did.
|
|
5554
|
-
*/
|
|
5555
|
-
function withoutTime(options) {
|
|
5556
|
-
if (options === undefined || !('time' in options))
|
|
5557
|
-
return options;
|
|
5558
|
-
const { time: _time, ...rest } = options;
|
|
5559
|
-
void _time;
|
|
5560
|
-
return rest;
|
|
5561
|
-
}
|
|
5562
|
-
/**
|
|
5563
|
-
* The policy a paused agent run was covered by, read off its own checkpoint
|
|
5564
|
-
* (`AgentState.runRedaction`, committed by seed and by every resumed leg) —
|
|
5565
|
-
* FAIL CLOSED: a value this library did not write, or a checkpoint whose run
|
|
5566
|
-
* kept names out of its records (`redactionMarks`) but carries no policy,
|
|
5567
|
-
* refuses the resume (`ResumeRedactionError`) before anything moves. A leg its
|
|
5568
|
-
* policy could not keep covered must never start.
|
|
5569
|
-
*/
|
|
5570
|
-
function resumeRedactionOf(checkpoint, trusted) {
|
|
5571
|
-
const state = checkpoint.sharedState;
|
|
5572
|
-
let carried;
|
|
5573
|
-
try {
|
|
5574
|
-
// A carried pattern is a reference to one the resuming side holds — never
|
|
5575
|
-
// compiled from the checkpoint (`redaction/policy.ts` · `policyFromCarried`).
|
|
5576
|
-
carried = policyFromCarried(state?.runRedaction, 'Agent.resume', trusted);
|
|
5577
|
-
// A policy built under ANOTHER vocabulary version is joined with the
|
|
5578
|
-
// current list — the leg is never covered by an older list alone.
|
|
5579
|
-
carried = withCurrentVocabulary(carried, carriedVocabularyOf(state?.runRedaction));
|
|
5580
|
-
}
|
|
5581
|
-
catch (refusal) {
|
|
5582
|
-
throw new ResumeRedactionError(refusal instanceof CarriedPolicyError && refusal.refusal === 'unknown-pattern'
|
|
5583
|
-
? 'unknown-pattern'
|
|
5584
|
-
: 'unreadable');
|
|
5585
|
-
}
|
|
5586
|
-
// Every leg of a covered run writes its policy into its checkpoint's state
|
|
5587
|
-
// (seed, and `resume` for a resumed leg), so a checkpoint whose run kept
|
|
5588
|
-
// names out but carries none was altered — refused even when the resume
|
|
5589
|
-
// names a policy, which cannot stand in for the one the run was covered by.
|
|
5590
|
-
if (carried === undefined && policyOfMarks(checkpoint.redactionMarks) !== undefined) {
|
|
5591
|
-
throw new ResumeRedactionError('missing');
|
|
5592
|
-
}
|
|
5593
|
-
return carried;
|
|
5594
|
-
}
|
|
5595
5250
|
//# sourceMappingURL=Agent.js.map
|