agentfootprint 18.0.0 → 18.1.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/CAPABILITIES.md +2 -1
- package/dist/adapters/llm/BedrockProvider/client.js +93 -0
- package/dist/adapters/llm/BedrockProvider/client.js.map +1 -0
- package/dist/adapters/llm/BedrockProvider/guardedStream.js +150 -0
- package/dist/adapters/llm/BedrockProvider/guardedStream.js.map +1 -0
- package/dist/adapters/llm/BedrockProvider/guardedStreamBuffer.js +109 -0
- package/dist/adapters/llm/BedrockProvider/guardedStreamBuffer.js.map +1 -0
- package/dist/adapters/llm/BedrockProvider/guardrailClassify.js +189 -0
- package/dist/adapters/llm/BedrockProvider/guardrailClassify.js.map +1 -0
- package/dist/adapters/llm/BedrockProvider/guardrailConfig.js +79 -0
- package/dist/adapters/llm/BedrockProvider/guardrailConfig.js.map +1 -0
- package/dist/adapters/llm/BedrockProvider/guardrailRead.js +101 -0
- package/dist/adapters/llm/BedrockProvider/guardrailRead.js.map +1 -0
- package/dist/adapters/llm/BedrockProvider/guardrailResponse.js +81 -0
- package/dist/adapters/llm/BedrockProvider/guardrailResponse.js.map +1 -0
- package/dist/adapters/llm/BedrockProvider/guardrailSchemas.js +95 -0
- package/dist/adapters/llm/BedrockProvider/guardrailSchemas.js.map +1 -0
- package/dist/adapters/llm/BedrockProvider/request.js +119 -0
- package/dist/adapters/llm/BedrockProvider/request.js.map +1 -0
- package/dist/adapters/llm/BedrockProvider/response.js +107 -0
- package/dist/adapters/llm/BedrockProvider/response.js.map +1 -0
- package/dist/adapters/llm/BedrockProvider/stream.js +109 -0
- package/dist/adapters/llm/BedrockProvider/stream.js.map +1 -0
- package/dist/adapters/llm/BedrockProvider/types.js +3 -0
- package/dist/adapters/llm/BedrockProvider/types.js.map +1 -0
- package/dist/adapters/llm/BedrockProvider.js +48 -381
- package/dist/adapters/llm/BedrockProvider.js.map +1 -1
- package/dist/adapters/llm/MockProvider.js +1 -0
- package/dist/adapters/llm/MockProvider.js.map +1 -1
- package/dist/ag-ui/serializer/settle.js +110 -0
- package/dist/ag-ui/serializer/settle.js.map +1 -0
- package/dist/ag-ui/serializer/translate.js +310 -0
- package/dist/ag-ui/serializer/translate.js.map +1 -0
- package/dist/ag-ui/serializer/types.js +3 -0
- package/dist/ag-ui/serializer/types.js.map +1 -0
- package/dist/ag-ui/serializer/values.js +72 -0
- package/dist/ag-ui/serializer/values.js.map +1 -0
- package/dist/ag-ui/serializer.js +110 -543
- package/dist/ag-ui/serializer.js.map +1 -1
- package/dist/core/LLMCall/chart.js +294 -0
- package/dist/core/LLMCall/chart.js.map +1 -0
- package/dist/core/LLMCall.js +30 -314
- package/dist/core/LLMCall.js.map +1 -1
- package/dist/core/agent/buildAgentMessageApiChart.js +10 -5
- package/dist/core/agent/buildAgentMessageApiChart.js.map +1 -1
- package/dist/core/agent/buildDynamicAgentChart/boundary.js +148 -0
- package/dist/core/agent/buildDynamicAgentChart/boundary.js.map +1 -0
- package/dist/core/agent/buildDynamicAgentChart/engineBoundary.js +122 -0
- package/dist/core/agent/buildDynamicAgentChart/engineBoundary.js.map +1 -0
- package/dist/core/agent/buildDynamicAgentChart/finalBranch.js +26 -0
- package/dist/core/agent/buildDynamicAgentChart/finalBranch.js.map +1 -0
- package/dist/core/agent/buildDynamicAgentChart.js +14 -263
- package/dist/core/agent/buildDynamicAgentChart.js.map +1 -1
- package/dist/core/agent/buildMessageApiChart.js +11 -6
- package/dist/core/agent/buildMessageApiChart.js.map +1 -1
- package/dist/core/agent/composeRequest.js +1 -1
- package/dist/core/agent/dynamicTurnSeed.js +2 -0
- package/dist/core/agent/dynamicTurnSeed.js.map +1 -1
- package/dist/core/agent/findings/answerText.js +1 -1
- package/dist/core/agent/receipt/receipt.js +2 -2
- package/dist/core/agent/runtime/admission/owner.js +1 -1
- package/dist/core/agent/runtime/admission/owner.js.map +1 -1
- package/dist/core/agent/runtime/terminal/verdicts.js +4 -0
- package/dist/core/agent/runtime/terminal/verdicts.js.map +1 -1
- package/dist/core/agent/stagedRefs.js +1 -1
- package/dist/core/agent/stagedRefs.js.map +1 -1
- package/dist/core/agent/stages/callLLM/acceptResponse.js +226 -0
- package/dist/core/agent/stages/callLLM/acceptResponse.js.map +1 -0
- package/dist/core/agent/stages/callLLM/executeCall.js +254 -0
- package/dist/core/agent/stages/callLLM/executeCall.js.map +1 -0
- package/dist/core/agent/stages/callLLM/prepareCall.js +467 -0
- package/dist/core/agent/stages/callLLM/prepareCall.js.map +1 -0
- package/dist/core/agent/stages/callLLM/responseAccounting.js +34 -0
- package/dist/core/agent/stages/callLLM/responseAccounting.js.map +1 -0
- package/dist/core/agent/stages/callLLM.js +34 -852
- package/dist/core/agent/stages/callLLM.js.map +1 -1
- package/dist/core/agent/stages/reliabilityExecution/contracts.js +28 -0
- package/dist/core/agent/stages/reliabilityExecution/contracts.js.map +1 -0
- package/dist/core/agent/stages/reliabilityExecution/feedback.js +40 -0
- package/dist/core/agent/stages/reliabilityExecution/feedback.js.map +1 -0
- package/dist/core/agent/stages/reliabilityExecution/stuckLoop.js +48 -0
- package/dist/core/agent/stages/reliabilityExecution/stuckLoop.js.map +1 -0
- package/dist/core/agent/stages/reliabilityExecution.js +18 -156
- package/dist/core/agent/stages/reliabilityExecution.js.map +1 -1
- package/dist/core/agent/toolChoice/record.js +1 -1
- package/dist/core/agent/window/toolNames.js +1 -1
- package/dist/core/providerIntervention.js +115 -0
- package/dist/core/providerIntervention.js.map +1 -0
- package/dist/core/slots/buildMessagesSlot.js +1 -1
- package/dist/core/terminalVerdict.js +3 -0
- package/dist/core/terminalVerdict.js.map +1 -1
- package/dist/core-flow/Graph.js +1 -1
- package/dist/core-flow/Parallel/builder.js +101 -0
- package/dist/core-flow/Parallel/builder.js.map +1 -0
- package/dist/core-flow/Parallel/chart.js +221 -0
- package/dist/core-flow/Parallel/chart.js.map +1 -0
- package/dist/core-flow/Parallel/mapper.js +41 -0
- package/dist/core-flow/Parallel/mapper.js.map +1 -0
- package/dist/core-flow/Parallel/merge.js +63 -0
- package/dist/core-flow/Parallel/merge.js.map +1 -0
- package/dist/core-flow/Parallel/types.js +3 -0
- package/dist/core-flow/Parallel/types.js.map +1 -0
- package/dist/core-flow/Parallel.js +19 -395
- package/dist/core-flow/Parallel.js.map +1 -1
- package/dist/esm/adapters/llm/BedrockProvider/client.d.ts +11 -0
- package/dist/esm/adapters/llm/BedrockProvider/client.js +87 -0
- package/dist/esm/adapters/llm/BedrockProvider/client.js.map +1 -0
- package/dist/esm/adapters/llm/BedrockProvider/guardedStream.d.ts +7 -0
- package/dist/esm/adapters/llm/BedrockProvider/guardedStream.js +145 -0
- package/dist/esm/adapters/llm/BedrockProvider/guardedStream.js.map +1 -0
- package/dist/esm/adapters/llm/BedrockProvider/guardedStreamBuffer.d.ts +21 -0
- package/dist/esm/adapters/llm/BedrockProvider/guardedStreamBuffer.js +105 -0
- package/dist/esm/adapters/llm/BedrockProvider/guardedStreamBuffer.js.map +1 -0
- package/dist/esm/adapters/llm/BedrockProvider/guardrailClassify.d.ts +8 -0
- package/dist/esm/adapters/llm/BedrockProvider/guardrailClassify.js +183 -0
- package/dist/esm/adapters/llm/BedrockProvider/guardrailClassify.js.map +1 -0
- package/dist/esm/adapters/llm/BedrockProvider/guardrailConfig.d.ts +30 -0
- package/dist/esm/adapters/llm/BedrockProvider/guardrailConfig.js +74 -0
- package/dist/esm/adapters/llm/BedrockProvider/guardrailConfig.js.map +1 -0
- package/dist/esm/adapters/llm/BedrockProvider/guardrailRead.d.ts +19 -0
- package/dist/esm/adapters/llm/BedrockProvider/guardrailRead.js +96 -0
- package/dist/esm/adapters/llm/BedrockProvider/guardrailRead.js.map +1 -0
- package/dist/esm/adapters/llm/BedrockProvider/guardrailResponse.d.ts +13 -0
- package/dist/esm/adapters/llm/BedrockProvider/guardrailResponse.js +74 -0
- package/dist/esm/adapters/llm/BedrockProvider/guardrailResponse.js.map +1 -0
- package/dist/esm/adapters/llm/BedrockProvider/guardrailSchemas.d.ts +13 -0
- package/dist/esm/adapters/llm/BedrockProvider/guardrailSchemas.js +92 -0
- package/dist/esm/adapters/llm/BedrockProvider/guardrailSchemas.js.map +1 -0
- package/dist/esm/adapters/llm/BedrockProvider/request.d.ts +4 -0
- package/dist/esm/adapters/llm/BedrockProvider/request.js +115 -0
- package/dist/esm/adapters/llm/BedrockProvider/request.js.map +1 -0
- package/dist/esm/adapters/llm/BedrockProvider/response.d.ts +32 -0
- package/dist/esm/adapters/llm/BedrockProvider/response.js +100 -0
- package/dist/esm/adapters/llm/BedrockProvider/response.js.map +1 -0
- package/dist/esm/adapters/llm/BedrockProvider/stream.d.ts +4 -0
- package/dist/esm/adapters/llm/BedrockProvider/stream.js +105 -0
- package/dist/esm/adapters/llm/BedrockProvider/stream.js.map +1 -0
- package/dist/esm/adapters/llm/BedrockProvider/types.d.ts +174 -0
- package/dist/esm/adapters/llm/BedrockProvider/types.js +2 -0
- package/dist/esm/adapters/llm/BedrockProvider/types.js.map +1 -0
- package/dist/esm/adapters/llm/BedrockProvider.d.ts +5 -148
- package/dist/esm/adapters/llm/BedrockProvider.js +44 -377
- package/dist/esm/adapters/llm/BedrockProvider.js.map +1 -1
- package/dist/esm/adapters/llm/MockProvider.js +1 -0
- package/dist/esm/adapters/llm/MockProvider.js.map +1 -1
- package/dist/esm/ag-ui/serializer/settle.d.ts +28 -0
- package/dist/esm/ag-ui/serializer/settle.js +106 -0
- package/dist/esm/ag-ui/serializer/settle.js.map +1 -0
- package/dist/esm/ag-ui/serializer/translate.d.ts +39 -0
- package/dist/esm/ag-ui/serializer/translate.js +306 -0
- package/dist/esm/ag-ui/serializer/translate.js.map +1 -0
- package/dist/esm/ag-ui/serializer/types.d.ts +66 -0
- package/dist/esm/ag-ui/serializer/types.js +2 -0
- package/dist/esm/ag-ui/serializer/types.js.map +1 -0
- package/dist/esm/ag-ui/serializer/values.d.ts +39 -0
- package/dist/esm/ag-ui/serializer/values.js +59 -0
- package/dist/esm/ag-ui/serializer/values.js.map +1 -0
- package/dist/esm/ag-ui/serializer.d.ts +3 -146
- package/dist/esm/ag-ui/serializer.js +85 -522
- package/dist/esm/ag-ui/serializer.js.map +1 -1
- package/dist/esm/core/LLMCall/chart.d.ts +21 -0
- package/dist/esm/core/LLMCall/chart.js +290 -0
- package/dist/esm/core/LLMCall/chart.js.map +1 -0
- package/dist/esm/core/LLMCall.d.ts +3 -0
- package/dist/esm/core/LLMCall.js +31 -315
- package/dist/esm/core/LLMCall.js.map +1 -1
- package/dist/esm/core/agent/buildAgentMessageApiChart.js +10 -5
- package/dist/esm/core/agent/buildAgentMessageApiChart.js.map +1 -1
- package/dist/esm/core/agent/buildDynamicAgentChart/boundary.d.ts +100 -0
- package/dist/esm/core/agent/buildDynamicAgentChart/boundary.js +144 -0
- package/dist/esm/core/agent/buildDynamicAgentChart/boundary.js.map +1 -0
- package/dist/esm/core/agent/buildDynamicAgentChart/engineBoundary.d.ts +51 -0
- package/dist/esm/core/agent/buildDynamicAgentChart/engineBoundary.js +118 -0
- package/dist/esm/core/agent/buildDynamicAgentChart/engineBoundary.js.map +1 -0
- package/dist/esm/core/agent/buildDynamicAgentChart/finalBranch.d.ts +3 -0
- package/dist/esm/core/agent/buildDynamicAgentChart/finalBranch.js +22 -0
- package/dist/esm/core/agent/buildDynamicAgentChart/finalBranch.js.map +1 -0
- package/dist/esm/core/agent/buildDynamicAgentChart.d.ts +0 -50
- package/dist/esm/core/agent/buildDynamicAgentChart.js +14 -263
- package/dist/esm/core/agent/buildDynamicAgentChart.js.map +1 -1
- package/dist/esm/core/agent/buildMessageApiChart.js +11 -6
- package/dist/esm/core/agent/buildMessageApiChart.js.map +1 -1
- package/dist/esm/core/agent/composeRequest.d.ts +1 -1
- package/dist/esm/core/agent/composeRequest.js +1 -1
- package/dist/esm/core/agent/dynamicTurnSeed.js +2 -0
- package/dist/esm/core/agent/dynamicTurnSeed.js.map +1 -1
- package/dist/esm/core/agent/findings/answerText.d.ts +1 -1
- package/dist/esm/core/agent/findings/answerText.js +1 -1
- package/dist/esm/core/agent/receipt/receipt.d.ts +2 -2
- package/dist/esm/core/agent/receipt/receipt.js +2 -2
- package/dist/esm/core/agent/runtime/admission/owner.js +1 -1
- package/dist/esm/core/agent/runtime/admission/owner.js.map +1 -1
- package/dist/esm/core/agent/runtime/terminal/verdicts.js +4 -0
- package/dist/esm/core/agent/runtime/terminal/verdicts.js.map +1 -1
- package/dist/esm/core/agent/stagedRefs.js +1 -1
- package/dist/esm/core/agent/stagedRefs.js.map +1 -1
- package/dist/esm/core/agent/stages/callLLM/acceptResponse.d.ts +6 -0
- package/dist/esm/core/agent/stages/callLLM/acceptResponse.js +199 -0
- package/dist/esm/core/agent/stages/callLLM/acceptResponse.js.map +1 -0
- package/dist/esm/core/agent/stages/callLLM/executeCall.d.ts +26 -0
- package/dist/esm/core/agent/stages/callLLM/executeCall.js +250 -0
- package/dist/esm/core/agent/stages/callLLM/executeCall.js.map +1 -0
- package/dist/esm/core/agent/stages/callLLM/prepareCall.d.ts +88 -0
- package/dist/esm/core/agent/stages/callLLM/prepareCall.js +440 -0
- package/dist/esm/core/agent/stages/callLLM/prepareCall.js.map +1 -0
- package/dist/esm/core/agent/stages/callLLM/responseAccounting.d.ts +10 -0
- package/dist/esm/core/agent/stages/callLLM/responseAccounting.js +29 -0
- package/dist/esm/core/agent/stages/callLLM/responseAccounting.js.map +1 -0
- package/dist/esm/core/agent/stages/callLLM.d.ts +1 -1
- package/dist/esm/core/agent/stages/callLLM.js +34 -829
- package/dist/esm/core/agent/stages/callLLM.js.map +1 -1
- package/dist/esm/core/agent/stages/reliabilityExecution/contracts.d.ts +53 -0
- package/dist/esm/core/agent/stages/reliabilityExecution/contracts.js +24 -0
- package/dist/esm/core/agent/stages/reliabilityExecution/contracts.js.map +1 -0
- package/dist/esm/core/agent/stages/reliabilityExecution/feedback.d.ts +19 -0
- package/dist/esm/core/agent/stages/reliabilityExecution/feedback.js +36 -0
- package/dist/esm/core/agent/stages/reliabilityExecution/feedback.js.map +1 -0
- package/dist/esm/core/agent/stages/reliabilityExecution/stuckLoop.d.ts +29 -0
- package/dist/esm/core/agent/stages/reliabilityExecution/stuckLoop.js +44 -0
- package/dist/esm/core/agent/stages/reliabilityExecution/stuckLoop.js.map +1 -0
- package/dist/esm/core/agent/stages/reliabilityExecution.d.ts +4 -81
- package/dist/esm/core/agent/stages/reliabilityExecution.js +7 -147
- package/dist/esm/core/agent/stages/reliabilityExecution.js.map +1 -1
- package/dist/esm/core/agent/toolChoice/record.d.ts +1 -1
- package/dist/esm/core/agent/toolChoice/record.js +1 -1
- package/dist/esm/core/agent/window/toolNames.d.ts +1 -1
- package/dist/esm/core/agent/window/toolNames.js +1 -1
- package/dist/esm/core/providerIntervention.d.ts +25 -0
- package/dist/esm/core/providerIntervention.js +106 -0
- package/dist/esm/core/providerIntervention.js.map +1 -0
- package/dist/esm/core/slots/buildMessagesSlot.d.ts +1 -1
- package/dist/esm/core/slots/buildMessagesSlot.js +1 -1
- package/dist/esm/core/terminalVerdict.d.ts +4 -0
- package/dist/esm/core/terminalVerdict.js +3 -0
- package/dist/esm/core/terminalVerdict.js.map +1 -1
- package/dist/esm/core-flow/Graph.d.ts +1 -1
- package/dist/esm/core-flow/Graph.js +1 -1
- package/dist/esm/core-flow/Parallel/builder.d.ts +39 -0
- package/dist/esm/core-flow/Parallel/builder.js +97 -0
- package/dist/esm/core-flow/Parallel/builder.js.map +1 -0
- package/dist/esm/core-flow/Parallel/chart.d.ts +15 -0
- package/dist/esm/core-flow/Parallel/chart.js +217 -0
- package/dist/esm/core-flow/Parallel/chart.js.map +1 -0
- package/dist/esm/core-flow/Parallel/mapper.d.ts +21 -0
- package/dist/esm/core-flow/Parallel/mapper.js +37 -0
- package/dist/esm/core-flow/Parallel/mapper.js.map +1 -0
- package/dist/esm/core-flow/Parallel/merge.d.ts +4 -0
- package/dist/esm/core-flow/Parallel/merge.js +58 -0
- package/dist/esm/core-flow/Parallel/merge.js.map +1 -0
- package/dist/esm/core-flow/Parallel/types.d.ts +179 -0
- package/dist/esm/core-flow/Parallel/types.js +2 -0
- package/dist/esm/core-flow/Parallel/types.js.map +1 -0
- package/dist/esm/core-flow/Parallel.d.ts +7 -233
- package/dist/esm/core-flow/Parallel.js +18 -394
- package/dist/esm/core-flow/Parallel.js.map +1 -1
- package/dist/esm/hosting/failedSettlement.d.ts +9 -0
- package/dist/esm/hosting/failedSettlement.js +15 -0
- package/dist/esm/hosting/failedSettlement.js.map +1 -0
- package/dist/esm/hosting/headers.d.ts +8 -0
- package/dist/esm/hosting/headers.js +18 -0
- package/dist/esm/hosting/headers.js.map +1 -1
- package/dist/esm/hosting/httpHost.js +5 -20
- package/dist/esm/hosting/httpHost.js.map +1 -1
- package/dist/esm/hosting/httpStreaming.d.ts +5 -2
- package/dist/esm/hosting/protocolRoute.js +9 -2
- package/dist/esm/hosting/protocolRoute.js.map +1 -1
- package/dist/esm/hosting/refusalStatus.d.ts +3 -0
- package/dist/esm/hosting/refusalStatus.js +5 -0
- package/dist/esm/hosting/refusalStatus.js.map +1 -1
- package/dist/esm/hosting/streamHandler/conversation.d.ts +17 -0
- package/dist/esm/hosting/streamHandler/conversation.js +32 -0
- package/dist/esm/hosting/streamHandler/conversation.js.map +1 -0
- package/dist/esm/hosting/streamHandler/request.d.ts +12 -0
- package/dist/esm/hosting/streamHandler/request.js +84 -0
- package/dist/esm/hosting/streamHandler/request.js.map +1 -0
- package/dist/esm/hosting/streamHandler/types.d.ts +106 -0
- package/dist/esm/hosting/streamHandler/types.js +5 -0
- package/dist/esm/hosting/streamHandler/types.js.map +1 -0
- package/dist/esm/hosting/streamHandler.d.ts +3 -133
- package/dist/esm/hosting/streamHandler.js +10 -119
- package/dist/esm/hosting/streamHandler.js.map +1 -1
- package/dist/esm/hosting/unstreamedText.d.ts +1 -1
- package/dist/esm/hosting/unstreamedText.js +1 -1
- package/dist/esm/lib/iterationBudget.js +1 -1
- package/dist/esm/lib/iterationBudget.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/ontology/serve.d.ts +2 -2
- package/dist/esm/ontology/serve.js +2 -2
- package/dist/esm/provider-contract/intervention.d.ts +56 -0
- package/dist/esm/provider-contract/intervention.js +112 -0
- package/dist/esm/provider-contract/intervention.js.map +1 -0
- package/dist/esm/provider-contract/replaySafety.d.ts +4 -0
- package/dist/esm/provider-contract/replaySafety.js +25 -0
- package/dist/esm/provider-contract/replaySafety.js.map +1 -0
- package/dist/esm/provider-contract/requestRefusal.js +3 -1
- package/dist/esm/provider-contract/requestRefusal.js.map +1 -1
- package/dist/esm/provider-contract/responseAdmission.d.ts +10 -0
- package/dist/esm/provider-contract/responseAdmission.js +91 -0
- package/dist/esm/provider-contract/responseAdmission.js.map +1 -0
- package/dist/esm/provider-contract/types/code.d.ts +434 -0
- package/dist/esm/provider-contract/types/code.js +27 -0
- package/dist/esm/provider-contract/types/code.js.map +1 -0
- package/dist/esm/provider-contract/types/message.d.ts +226 -0
- package/dist/esm/provider-contract/types/message.js +2 -0
- package/dist/esm/provider-contract/types/message.js.map +1 -0
- package/dist/esm/provider-contract/types/provider.d.ts +261 -0
- package/dist/esm/provider-contract/types/provider.js +2 -0
- package/dist/esm/provider-contract/types/provider.js.map +1 -0
- package/dist/esm/provider-contract/types/request.d.ts +93 -0
- package/dist/esm/provider-contract/types/request.js +2 -0
- package/dist/esm/provider-contract/types/request.js.map +1 -0
- package/dist/esm/provider-contract/types/response.d.ts +142 -0
- package/dist/esm/provider-contract/types/response.js +2 -0
- package/dist/esm/provider-contract/types/response.js.map +1 -0
- package/dist/esm/provider-contract/types.d.ts +7 -1149
- package/dist/esm/provider-contract/types.js +1 -25
- package/dist/esm/provider-contract/types.js.map +1 -1
- package/dist/esm/providers.d.ts +2 -1
- package/dist/esm/providers.js +1 -0
- package/dist/esm/providers.js.map +1 -1
- package/dist/esm/recorders/core/ErrorBridge.d.ts +3 -1
- package/dist/esm/recorders/core/ErrorBridge.js +14 -0
- package/dist/esm/recorders/core/ErrorBridge.js.map +1 -1
- package/dist/esm/recorders/core/ResilienceRecorder.d.ts +4 -4
- package/dist/esm/recorders/core/ResilienceRecorder.js +4 -4
- package/dist/esm/reliability/buildReliabilityGateChart.d.ts +1 -1
- package/dist/esm/reliability/buildReliabilityGateChart.js +2 -2
- package/dist/esm/reliability/buildReliabilityGateChart.js.map +1 -1
- package/dist/esm/resilience/replayAttempt.d.ts +1 -1
- package/dist/esm/resilience/replayAttempt.js +18 -6
- package/dist/esm/resilience/replayAttempt.js.map +1 -1
- package/dist/esm/resilience/withCircuitBreaker.js +29 -13
- package/dist/esm/resilience/withCircuitBreaker.js.map +1 -1
- package/dist/esm/resilience/withFallback.js +22 -7
- package/dist/esm/resilience/withFallback.js.map +1 -1
- package/dist/esm/resilience/withRetry.js +35 -11
- package/dist/esm/resilience/withRetry.js.map +1 -1
- package/dist/esm/time-travel/servedView/findings.js +2 -2
- package/dist/esm/time-travel/servedView/findings.js.map +1 -1
- package/dist/esm/time-travel/servedView/gaps.js +1 -1
- package/dist/esm/time-travel/servedView/gaps.js.map +1 -1
- package/dist/esm/time-travel/servedView/ontology.js +1 -1
- package/dist/esm/time-travel/servedView.d.ts +2 -2
- package/dist/esm/time-travel/servedView.js +2 -2
- package/dist/hosting/failedSettlement.js +19 -0
- package/dist/hosting/failedSettlement.js.map +1 -0
- package/dist/hosting/headers.js +20 -1
- package/dist/hosting/headers.js.map +1 -1
- package/dist/hosting/httpHost.js +5 -20
- package/dist/hosting/httpHost.js.map +1 -1
- package/dist/hosting/protocolRoute.js +9 -2
- package/dist/hosting/protocolRoute.js.map +1 -1
- package/dist/hosting/refusalStatus.js +5 -0
- package/dist/hosting/refusalStatus.js.map +1 -1
- package/dist/hosting/streamHandler/conversation.js +37 -0
- package/dist/hosting/streamHandler/conversation.js.map +1 -0
- package/dist/hosting/streamHandler/request.js +93 -0
- package/dist/hosting/streamHandler/request.js.map +1 -0
- package/dist/hosting/streamHandler/types.js +8 -0
- package/dist/hosting/streamHandler/types.js.map +1 -0
- package/dist/hosting/streamHandler.js +25 -132
- package/dist/hosting/streamHandler.js.map +1 -1
- package/dist/hosting/unstreamedText.js +1 -1
- package/dist/lib/iterationBudget.js +1 -1
- package/dist/lib/iterationBudget.js.map +1 -1
- package/dist/lib/toolBytes.js +2 -2
- package/dist/lib/toolBytes.js.map +1 -1
- package/dist/ontology/serve.js +2 -2
- package/dist/provider-contract/intervention.js +122 -0
- package/dist/provider-contract/intervention.js.map +1 -0
- package/dist/provider-contract/replaySafety.js +30 -0
- package/dist/provider-contract/replaySafety.js.map +1 -0
- package/dist/provider-contract/requestRefusal.js +3 -1
- package/dist/provider-contract/requestRefusal.js.map +1 -1
- package/dist/provider-contract/responseAdmission.js +96 -0
- package/dist/provider-contract/responseAdmission.js.map +1 -0
- package/dist/provider-contract/types/code.js +33 -0
- package/dist/provider-contract/types/code.js.map +1 -0
- package/dist/provider-contract/types/message.js +3 -0
- package/dist/provider-contract/types/message.js.map +1 -0
- package/dist/provider-contract/types/provider.js +3 -0
- package/dist/provider-contract/types/provider.js.map +1 -0
- package/dist/provider-contract/types/request.js +3 -0
- package/dist/provider-contract/types/request.js.map +1 -0
- package/dist/provider-contract/types/response.js +3 -0
- package/dist/provider-contract/types/response.js.map +1 -0
- package/dist/provider-contract/types.js +6 -29
- package/dist/provider-contract/types.js.map +1 -1
- package/dist/providers.js +5 -1
- package/dist/providers.js.map +1 -1
- package/dist/recorders/core/ErrorBridge.js +14 -0
- package/dist/recorders/core/ErrorBridge.js.map +1 -1
- package/dist/recorders/core/ResilienceRecorder.js +4 -4
- package/dist/reliability/buildReliabilityGateChart.js +2 -2
- package/dist/reliability/buildReliabilityGateChart.js.map +1 -1
- package/dist/resilience/replayAttempt.js +18 -6
- package/dist/resilience/replayAttempt.js.map +1 -1
- package/dist/resilience/withCircuitBreaker.js +29 -13
- package/dist/resilience/withCircuitBreaker.js.map +1 -1
- package/dist/resilience/withFallback.js +22 -7
- package/dist/resilience/withFallback.js.map +1 -1
- package/dist/resilience/withRetry.js +35 -11
- package/dist/resilience/withRetry.js.map +1 -1
- package/dist/time-travel/servedView/findings.js +2 -2
- package/dist/time-travel/servedView/findings.js.map +1 -1
- package/dist/time-travel/servedView/gaps.js +1 -1
- package/dist/time-travel/servedView/gaps.js.map +1 -1
- package/dist/time-travel/servedView/ontology.js +1 -1
- package/dist/time-travel/servedView.js +2 -2
- package/dist/types/adapters/llm/BedrockProvider/client.d.ts +12 -0
- package/dist/types/adapters/llm/BedrockProvider/client.d.ts.map +1 -0
- package/dist/types/adapters/llm/BedrockProvider/guardedStream.d.ts +8 -0
- package/dist/types/adapters/llm/BedrockProvider/guardedStream.d.ts.map +1 -0
- package/dist/types/adapters/llm/BedrockProvider/guardedStreamBuffer.d.ts +22 -0
- package/dist/types/adapters/llm/BedrockProvider/guardedStreamBuffer.d.ts.map +1 -0
- package/dist/types/adapters/llm/BedrockProvider/guardrailClassify.d.ts +9 -0
- package/dist/types/adapters/llm/BedrockProvider/guardrailClassify.d.ts.map +1 -0
- package/dist/types/adapters/llm/BedrockProvider/guardrailConfig.d.ts +31 -0
- package/dist/types/adapters/llm/BedrockProvider/guardrailConfig.d.ts.map +1 -0
- package/dist/types/adapters/llm/BedrockProvider/guardrailRead.d.ts +20 -0
- package/dist/types/adapters/llm/BedrockProvider/guardrailRead.d.ts.map +1 -0
- package/dist/types/adapters/llm/BedrockProvider/guardrailResponse.d.ts +14 -0
- package/dist/types/adapters/llm/BedrockProvider/guardrailResponse.d.ts.map +1 -0
- package/dist/types/adapters/llm/BedrockProvider/guardrailSchemas.d.ts +14 -0
- package/dist/types/adapters/llm/BedrockProvider/guardrailSchemas.d.ts.map +1 -0
- package/dist/types/adapters/llm/BedrockProvider/request.d.ts +5 -0
- package/dist/types/adapters/llm/BedrockProvider/request.d.ts.map +1 -0
- package/dist/types/adapters/llm/BedrockProvider/response.d.ts +33 -0
- package/dist/types/adapters/llm/BedrockProvider/response.d.ts.map +1 -0
- package/dist/types/adapters/llm/BedrockProvider/stream.d.ts +5 -0
- package/dist/types/adapters/llm/BedrockProvider/stream.d.ts.map +1 -0
- package/dist/types/adapters/llm/BedrockProvider/types.d.ts +175 -0
- package/dist/types/adapters/llm/BedrockProvider/types.d.ts.map +1 -0
- package/dist/types/adapters/llm/BedrockProvider.d.ts +5 -148
- package/dist/types/adapters/llm/BedrockProvider.d.ts.map +1 -1
- package/dist/types/adapters/llm/MockProvider.d.ts.map +1 -1
- package/dist/types/ag-ui/serializer/settle.d.ts +29 -0
- package/dist/types/ag-ui/serializer/settle.d.ts.map +1 -0
- package/dist/types/ag-ui/serializer/translate.d.ts +40 -0
- package/dist/types/ag-ui/serializer/translate.d.ts.map +1 -0
- package/dist/types/ag-ui/serializer/types.d.ts +67 -0
- package/dist/types/ag-ui/serializer/types.d.ts.map +1 -0
- package/dist/types/ag-ui/serializer/values.d.ts +40 -0
- package/dist/types/ag-ui/serializer/values.d.ts.map +1 -0
- package/dist/types/ag-ui/serializer.d.ts +3 -146
- package/dist/types/ag-ui/serializer.d.ts.map +1 -1
- package/dist/types/core/LLMCall/chart.d.ts +22 -0
- package/dist/types/core/LLMCall/chart.d.ts.map +1 -0
- package/dist/types/core/LLMCall.d.ts +3 -0
- package/dist/types/core/LLMCall.d.ts.map +1 -1
- package/dist/types/core/agent/buildAgentMessageApiChart.d.ts.map +1 -1
- package/dist/types/core/agent/buildDynamicAgentChart/boundary.d.ts +101 -0
- package/dist/types/core/agent/buildDynamicAgentChart/boundary.d.ts.map +1 -0
- package/dist/types/core/agent/buildDynamicAgentChart/engineBoundary.d.ts +52 -0
- package/dist/types/core/agent/buildDynamicAgentChart/engineBoundary.d.ts.map +1 -0
- package/dist/types/core/agent/buildDynamicAgentChart/finalBranch.d.ts +4 -0
- package/dist/types/core/agent/buildDynamicAgentChart/finalBranch.d.ts.map +1 -0
- package/dist/types/core/agent/buildDynamicAgentChart.d.ts +0 -50
- package/dist/types/core/agent/buildDynamicAgentChart.d.ts.map +1 -1
- package/dist/types/core/agent/buildMessageApiChart.d.ts.map +1 -1
- package/dist/types/core/agent/composeRequest.d.ts +1 -1
- package/dist/types/core/agent/dynamicTurnSeed.d.ts.map +1 -1
- package/dist/types/core/agent/findings/answerText.d.ts +1 -1
- package/dist/types/core/agent/receipt/receipt.d.ts +2 -2
- package/dist/types/core/agent/runtime/terminal/verdicts.d.ts.map +1 -1
- package/dist/types/core/agent/stages/callLLM/acceptResponse.d.ts +7 -0
- package/dist/types/core/agent/stages/callLLM/acceptResponse.d.ts.map +1 -0
- package/dist/types/core/agent/stages/callLLM/executeCall.d.ts +27 -0
- package/dist/types/core/agent/stages/callLLM/executeCall.d.ts.map +1 -0
- package/dist/types/core/agent/stages/callLLM/prepareCall.d.ts +89 -0
- package/dist/types/core/agent/stages/callLLM/prepareCall.d.ts.map +1 -0
- package/dist/types/core/agent/stages/callLLM/responseAccounting.d.ts +11 -0
- package/dist/types/core/agent/stages/callLLM/responseAccounting.d.ts.map +1 -0
- package/dist/types/core/agent/stages/callLLM.d.ts +1 -1
- package/dist/types/core/agent/stages/callLLM.d.ts.map +1 -1
- package/dist/types/core/agent/stages/reliabilityExecution/contracts.d.ts +54 -0
- package/dist/types/core/agent/stages/reliabilityExecution/contracts.d.ts.map +1 -0
- package/dist/types/core/agent/stages/reliabilityExecution/feedback.d.ts +20 -0
- package/dist/types/core/agent/stages/reliabilityExecution/feedback.d.ts.map +1 -0
- package/dist/types/core/agent/stages/reliabilityExecution/stuckLoop.d.ts +30 -0
- package/dist/types/core/agent/stages/reliabilityExecution/stuckLoop.d.ts.map +1 -0
- package/dist/types/core/agent/stages/reliabilityExecution.d.ts +4 -81
- package/dist/types/core/agent/stages/reliabilityExecution.d.ts.map +1 -1
- package/dist/types/core/agent/toolChoice/record.d.ts +1 -1
- package/dist/types/core/agent/window/toolNames.d.ts +1 -1
- package/dist/types/core/providerIntervention.d.ts +26 -0
- package/dist/types/core/providerIntervention.d.ts.map +1 -0
- package/dist/types/core/slots/buildMessagesSlot.d.ts +1 -1
- package/dist/types/core/terminalVerdict.d.ts +4 -0
- package/dist/types/core/terminalVerdict.d.ts.map +1 -1
- package/dist/types/core-flow/Graph.d.ts +1 -1
- package/dist/types/core-flow/Parallel/builder.d.ts +40 -0
- package/dist/types/core-flow/Parallel/builder.d.ts.map +1 -0
- package/dist/types/core-flow/Parallel/chart.d.ts +16 -0
- package/dist/types/core-flow/Parallel/chart.d.ts.map +1 -0
- package/dist/types/core-flow/Parallel/mapper.d.ts +22 -0
- package/dist/types/core-flow/Parallel/mapper.d.ts.map +1 -0
- package/dist/types/core-flow/Parallel/merge.d.ts +5 -0
- package/dist/types/core-flow/Parallel/merge.d.ts.map +1 -0
- package/dist/types/core-flow/Parallel/types.d.ts +180 -0
- package/dist/types/core-flow/Parallel/types.d.ts.map +1 -0
- package/dist/types/core-flow/Parallel.d.ts +7 -233
- package/dist/types/core-flow/Parallel.d.ts.map +1 -1
- package/dist/types/hosting/failedSettlement.d.ts +10 -0
- package/dist/types/hosting/failedSettlement.d.ts.map +1 -0
- package/dist/types/hosting/headers.d.ts +8 -0
- package/dist/types/hosting/headers.d.ts.map +1 -1
- package/dist/types/hosting/httpHost.d.ts.map +1 -1
- package/dist/types/hosting/httpStreaming.d.ts +5 -2
- package/dist/types/hosting/httpStreaming.d.ts.map +1 -1
- package/dist/types/hosting/protocolRoute.d.ts.map +1 -1
- package/dist/types/hosting/refusalStatus.d.ts +3 -0
- package/dist/types/hosting/refusalStatus.d.ts.map +1 -1
- package/dist/types/hosting/streamHandler/conversation.d.ts +18 -0
- package/dist/types/hosting/streamHandler/conversation.d.ts.map +1 -0
- package/dist/types/hosting/streamHandler/request.d.ts +13 -0
- package/dist/types/hosting/streamHandler/request.d.ts.map +1 -0
- package/dist/types/hosting/streamHandler/types.d.ts +107 -0
- package/dist/types/hosting/streamHandler/types.d.ts.map +1 -0
- package/dist/types/hosting/streamHandler.d.ts +3 -133
- package/dist/types/hosting/streamHandler.d.ts.map +1 -1
- package/dist/types/hosting/unstreamedText.d.ts +1 -1
- package/dist/types/lib/toolBytes.d.ts +1 -1
- package/dist/types/ontology/serve.d.ts +2 -2
- package/dist/types/provider-contract/intervention.d.ts +57 -0
- package/dist/types/provider-contract/intervention.d.ts.map +1 -0
- package/dist/types/provider-contract/replaySafety.d.ts +5 -0
- package/dist/types/provider-contract/replaySafety.d.ts.map +1 -0
- package/dist/types/provider-contract/requestRefusal.d.ts.map +1 -1
- package/dist/types/provider-contract/responseAdmission.d.ts +11 -0
- package/dist/types/provider-contract/responseAdmission.d.ts.map +1 -0
- package/dist/types/provider-contract/types/code.d.ts +435 -0
- package/dist/types/provider-contract/types/code.d.ts.map +1 -0
- package/dist/types/provider-contract/types/message.d.ts +227 -0
- package/dist/types/provider-contract/types/message.d.ts.map +1 -0
- package/dist/types/provider-contract/types/provider.d.ts +262 -0
- package/dist/types/provider-contract/types/provider.d.ts.map +1 -0
- package/dist/types/provider-contract/types/request.d.ts +94 -0
- package/dist/types/provider-contract/types/request.d.ts.map +1 -0
- package/dist/types/provider-contract/types/response.d.ts +143 -0
- package/dist/types/provider-contract/types/response.d.ts.map +1 -0
- package/dist/types/provider-contract/types.d.ts +7 -1149
- package/dist/types/provider-contract/types.d.ts.map +1 -1
- package/dist/types/providers.d.ts +2 -1
- package/dist/types/providers.d.ts.map +1 -1
- package/dist/types/recorders/core/ErrorBridge.d.ts +3 -1
- package/dist/types/recorders/core/ErrorBridge.d.ts.map +1 -1
- package/dist/types/recorders/core/ResilienceRecorder.d.ts +4 -4
- package/dist/types/reliability/buildReliabilityGateChart.d.ts +1 -1
- package/dist/types/resilience/replayAttempt.d.ts +1 -1
- package/dist/types/resilience/replayAttempt.d.ts.map +1 -1
- package/dist/types/resilience/withCircuitBreaker.d.ts.map +1 -1
- package/dist/types/resilience/withFallback.d.ts.map +1 -1
- package/dist/types/resilience/withRetry.d.ts.map +1 -1
- package/dist/types/time-travel/servedView.d.ts +2 -2
- package/package.json +1 -1
|
@@ -1,110 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
* (`framing.ts`); reading a request is the adapter's (`adapter.ts`).
|
|
7
|
-
* Role: the Lens over a run for an AG-UI reader. It composes what that reader
|
|
8
|
-
* is served, from the RECORD only: every value it writes comes from a
|
|
9
|
-
* served event (the placeholder wherever a redaction policy selected a
|
|
10
|
-
* value), from the record's address (`meta.runtimeStageId`,
|
|
11
|
-
* `meta.subflowPath` — never selected by a policy), or from the
|
|
12
|
-
* AG-UI request's own ids. It never reads the run's live values, so
|
|
13
|
-
* nothing a policy hides can reach an AG-UI event. The record's own
|
|
14
|
-
* run id is never written: it counts every run the process made.
|
|
15
|
-
*
|
|
16
|
-
* THE MAPPING
|
|
17
|
-
* agent.turn_start (nested) → SUBAGENT_STARTED (a sub-agent's turn)
|
|
18
|
-
* agent.turn_end → SUBAGENT_FINISHED / the root answer
|
|
19
|
-
* agent.iteration_start/_end → STEP_STARTED/_FINISHED `iteration <n>`
|
|
20
|
-
* composition.enter/exit → STEP_STARTED/_FINISHED `<Kind>[:<mount>]`
|
|
21
|
-
* stream.token → TEXT_MESSAGE_START/CONTENT/END
|
|
22
|
-
* stream.llm_end (no agent around) → one whole TEXT message (an LLM call that streams nothing)
|
|
23
|
-
* stream.thinking_delta/_end → REASONING_START … REASONING_END (only with `reasoning: true`)
|
|
24
|
-
* stream.tool_start → TOOL_CALL_START + TOOL_CALL_ARGS (the view) + TOOL_CALL_END
|
|
25
|
-
* stream.tool_end → TOOL_CALL_RESULT
|
|
26
|
-
* pause.request + settle('paused') → RUN_FINISHED { outcome: interrupt }
|
|
27
|
-
* settle('paused', awaiting caller) → RUN_FINISHED { outcome: success, pendingToolCallIds }
|
|
28
|
-
* (a tool the client runs: its call is left to answer)
|
|
29
|
-
* error.fatal + settle('failed') → RUN_ERROR — the served error.fatal's words when they
|
|
30
|
-
* are a fixed sentence, else "The run failed."
|
|
31
|
-
* an allow-listed event → CUSTOM { name: <event type>, value: <its listed fields> }
|
|
32
|
-
* anything else → nothing
|
|
33
|
-
*
|
|
34
|
-
* WHAT LEAVES THE PROCESS. An AG-UI stream goes to a browser, so nothing goes
|
|
35
|
-
* out by default that a person is not meant to read. In record-only mode every value comes from a
|
|
36
|
-
* served payload; `CUSTOM` carries only the event types on an allow-list, each
|
|
37
|
-
* with the fields its projection picks ({@link AG_UI_CUSTOM_EVENTS} — the whole
|
|
38
|
-
* record, such as `context.injected`'s assembled prompt or `error.retried`'s
|
|
39
|
-
* raw error, stays off the wire unless the app lists it); the model's
|
|
40
|
-
* reasoning goes out only when the app says so; and a failure is described by
|
|
41
|
-
* the record, never by the thrown value. Identity on the meta (`principal`,
|
|
42
|
-
* `tenant`, `sessionId`) is never written.
|
|
43
|
-
*
|
|
44
|
-
* HOST DELIVERY is explicit: candidate answer text at every depth stays off
|
|
45
|
-
* the wire until the host completes. Its final output and allow-listed custom
|
|
46
|
-
* reply data are app-authorized delivery, not observations from the record.
|
|
47
|
-
* Tools, steps and progress still use served native events.
|
|
48
|
-
*
|
|
49
|
-
* WHO OWNS AN EVENT. Each agent's turn opens a SCOPE at its mount — the
|
|
50
|
-
* subflow path its `turn_start` fired at (`[]` for the root agent, `step-p/x`
|
|
51
|
-
* for an agent in a parallel branch). An event belongs to the deepest open scope
|
|
52
|
-
* whose mount prefixes its own subflow path, segment by segment, and carries
|
|
53
|
-
* that scope's `subagentRunId`. Parallel branches have different mounts, so
|
|
54
|
-
* their interleaved events can never be attributed to each other.
|
|
55
|
-
*
|
|
56
|
-
* A RUN THAT CONTINUES A PAUSE. A paused run hands back `suspension()` — the
|
|
57
|
-
* ids it gave the client (the interrupt, the open call) and every scope and
|
|
58
|
-
* step open at the pause. The run that continues it passes that as `resume`:
|
|
59
|
-
* the same sub-agents re-open (AG-UI: "a later run may continue the same
|
|
60
|
-
* invocation"), their steps re-open, and the first result in the paused call's
|
|
61
|
-
* scope answers that call under its own id — or, for a tool the client ran, is
|
|
62
|
-
* not written at all, because the client holds the result it sent.
|
|
63
|
-
*
|
|
64
|
-
* TEXT in record-only mode comes from `stream.token`, then from the rest of
|
|
65
|
-
* `turn_end.finalContent` as its own message. A marked root `turn_end` can
|
|
66
|
-
* deliver the answer even when this reader joined after the turn started.
|
|
67
|
-
* `unstreamedText` uses the same prefix rule as `toSSE({ format: 'text' })`.
|
|
68
|
-
* Refused final content and an agent's draft `llm_end.content` stay off the wire.
|
|
69
|
-
*/
|
|
1
|
+
import { addressOf, owned } from './serializer/values.js';
|
|
2
|
+
import { eventTranslator } from './serializer/translate.js';
|
|
3
|
+
import { settleTranslation } from './serializer/settle.js';
|
|
4
|
+
import { leads, record, text, questionOf, AG_UI_SUBAGENT_UNFINISHED } from './serializer/values.js';
|
|
5
|
+
export { AG_UI_RUN_FAILED, AG_UI_ANSWER_WITHHELD, AG_UI_SUBAGENT_UNFINISHED, AG_UI_SUBAGENT_CANCELLED, } from './serializer/values.js';
|
|
70
6
|
import { CONSUMER_SCOPE_RUN_ID } from '../bridge/eventMeta.js';
|
|
71
|
-
import {
|
|
72
|
-
import {
|
|
73
|
-
import { toWireJson, withWireErrors } from '../lib/wireJson.js';
|
|
74
|
-
import { newScope, takeCall } from './translationScope.js';
|
|
7
|
+
import { withWireErrors } from '../lib/wireJson.js';
|
|
8
|
+
import { newScope } from './translationScope.js';
|
|
75
9
|
import { agUiIdMinter } from './ids.js';
|
|
76
|
-
import {
|
|
77
|
-
import { argsShownOf, checkInHiddenNamesOf } from './shownArgs.js';
|
|
10
|
+
import { checkInHiddenNamesOf } from './shownArgs.js';
|
|
78
11
|
import { AG_UI_PROTOCOL_VERSION, } from './types.js';
|
|
79
12
|
import { AG_UI_CUSTOM_EVENTS } from './customEvents.js';
|
|
80
13
|
export { AG_UI_CUSTOM_EVENTS } from './customEvents.js';
|
|
81
|
-
/** Said by `RUN_ERROR` when the run's `error.fatal` is not one of the record's fixed sentences. */
|
|
82
|
-
export const AG_UI_RUN_FAILED = 'The run failed.';
|
|
83
|
-
/**
|
|
84
|
-
* Said by `RUN_ERROR` (with `code: 'ERR_ANSWER_VALIDATION'`) when an enforcing
|
|
85
|
-
* `.answerValidation()` withheld the answer: a refusal, not a crash.
|
|
86
|
-
*/
|
|
87
|
-
export const AG_UI_ANSWER_WITHHELD = "The answer was withheld: it did not pass the app's answer checks.";
|
|
88
|
-
/** Is `said` one of the record's fixed failure sentences — the only `error.fatal` words a `RUN_ERROR` repeats? */
|
|
89
|
-
const isFixedFailure = (said) => Object.values(LLM_ERROR_SENTENCES).includes(said);
|
|
90
|
-
/** Said by `SUBAGENT_ERROR` for a sub-agent whose turn ended without an answer. */
|
|
91
|
-
export const AG_UI_SUBAGENT_UNFINISHED = "The sub-agent's turn ended without an answer.";
|
|
92
|
-
/** Said by `SUBAGENT_ERROR` for a sub-agent still running when its run was cancelled. */
|
|
93
|
-
export const AG_UI_SUBAGENT_CANCELLED = 'The run was cancelled before this sub-agent finished.';
|
|
94
|
-
/** Does `prefix` lead `path`, segment by segment? */
|
|
95
|
-
function leads(prefix, path) {
|
|
96
|
-
if (prefix.length > path.length)
|
|
97
|
-
return false;
|
|
98
|
-
for (let i = 0; i < prefix.length; i++)
|
|
99
|
-
if (prefix[i] !== path[i])
|
|
100
|
-
return false;
|
|
101
|
-
return true;
|
|
102
|
-
}
|
|
103
|
-
const sameMount = (a, b) => a.length === b.length && leads(a, b);
|
|
104
|
-
const record = (value) => typeof value === 'object' && value !== null ? value : {};
|
|
105
|
-
const text = (value) => typeof value === 'string' ? value : undefined;
|
|
106
|
-
/** A tool result as AG-UI text: a string as it is, anything else through the wire rule. */
|
|
107
|
-
const resultText = (value) => typeof value === 'string' ? value : value === undefined ? '' : toWireJson(value);
|
|
108
14
|
/**
|
|
109
15
|
* The AG-UI serializer for ONE run: feed it every served agentfootprint event
|
|
110
16
|
* of the run, in order, then settle it once. `RUN_STARTED` comes before the
|
|
@@ -172,19 +78,6 @@ export function agUiSerializer(options) {
|
|
|
172
78
|
}
|
|
173
79
|
return best;
|
|
174
80
|
};
|
|
175
|
-
/** The record's address of `event`, as AG-UI metadata. */
|
|
176
|
-
const addressOf = (event, extra) => ({
|
|
177
|
-
agentfootprint: {
|
|
178
|
-
runtimeStageId: event.meta.runtimeStageId,
|
|
179
|
-
subflowPath: [...event.meta.subflowPath],
|
|
180
|
-
...extra,
|
|
181
|
-
},
|
|
182
|
-
});
|
|
183
|
-
/** The fields every event of `scope` carries. */
|
|
184
|
-
const owned = (scope, event) => ({
|
|
185
|
-
...(event !== undefined && { timestamp: event.meta.wallClockMs }),
|
|
186
|
-
...(scope.subagentRunId !== undefined && { subagentRunId: scope.subagentRunId }),
|
|
187
|
-
});
|
|
188
81
|
// ── closers — each leaves its entity closed and writes the events that say so ──
|
|
189
82
|
const closeText = (scope, out) => {
|
|
190
83
|
if (scope.text === undefined)
|
|
@@ -280,302 +173,53 @@ export function agUiSerializer(options) {
|
|
|
280
173
|
scope.callMessageId = id;
|
|
281
174
|
};
|
|
282
175
|
// ── the mapping ──
|
|
283
|
-
const translate = (
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
closeSteps(scope, out);
|
|
331
|
-
return;
|
|
332
|
-
}
|
|
333
|
-
endScope(scope, out, (subagentRunId) => ({
|
|
334
|
-
type: 'SUBAGENT_FINISHED',
|
|
335
|
-
subagentRunId,
|
|
336
|
-
...(!hostDelivery && answer !== undefined && { result: answer }),
|
|
337
|
-
timestamp: event.meta.wallClockMs,
|
|
338
|
-
}));
|
|
339
|
-
return;
|
|
340
|
-
}
|
|
341
|
-
case 'agentfootprint.agent.iteration_start':
|
|
342
|
-
openStep(scopeOf(path), `iteration ${String(payload.iterIndex)}`, event, out);
|
|
343
|
-
return;
|
|
344
|
-
case 'agentfootprint.agent.iteration_end':
|
|
345
|
-
finishStep(scopeOf(path), `iteration ${String(payload.iterIndex)}`, event, out);
|
|
346
|
-
return;
|
|
347
|
-
case 'agentfootprint.composition.enter':
|
|
348
|
-
openStep(scopeOf(path), compositionStep(payload.kind, path), event, out);
|
|
349
|
-
return;
|
|
350
|
-
case 'agentfootprint.composition.exit': {
|
|
351
|
-
// A turn under this composition that is still open never answered — a
|
|
352
|
-
// branch a tolerant merge let fail. Said, never left dangling.
|
|
353
|
-
for (const inner of scopesUnder(path))
|
|
354
|
-
closeScope(inner, out, unfinished);
|
|
355
|
-
finishStep(scopeOf(path), compositionStep(payload.kind, path), event, out);
|
|
356
|
-
return;
|
|
357
|
-
}
|
|
358
|
-
case 'agentfootprint.stream.llm_start': {
|
|
359
|
-
const scope = scopeOf(path);
|
|
360
|
-
closeText(scope, out);
|
|
361
|
-
closeReasoning(scope, out);
|
|
362
|
-
if (scope === root)
|
|
363
|
-
rootCallText = undefined;
|
|
364
|
-
scope.streamedText = undefined;
|
|
365
|
-
scope.callMessageId = undefined;
|
|
366
|
-
scope.llmAddress = address;
|
|
367
|
-
return;
|
|
368
|
-
}
|
|
369
|
-
case 'agentfootprint.stream.token': {
|
|
370
|
-
if (hostDelivery)
|
|
371
|
-
return;
|
|
372
|
-
const content = text(payload.content);
|
|
373
|
-
if (content === undefined)
|
|
374
|
-
return;
|
|
375
|
-
const scope = scopeOf(path);
|
|
376
|
-
const index = typeof payload.tokenIndex === 'number' ? payload.tokenIndex : Number.NaN;
|
|
377
|
-
const open = scope.text;
|
|
378
|
-
if (open === undefined || open.address !== address || !(index > open.lastTokenIndex)) {
|
|
379
|
-
// A new message: the first token of a call, another stage's tokens (an
|
|
380
|
-
// answer released after validation), or a stream that restarted.
|
|
381
|
-
closeText(scope, out);
|
|
382
|
-
const { id } = ids.next('text', address);
|
|
383
|
-
scope.text = { id, address, lastTokenIndex: Number.isNaN(index) ? -1 : index };
|
|
384
|
-
scope.callMessageId = id;
|
|
385
|
-
out.push({
|
|
386
|
-
type: 'TEXT_MESSAGE_START',
|
|
387
|
-
messageId: id,
|
|
388
|
-
role: 'assistant',
|
|
389
|
-
...owned(scope, event),
|
|
390
|
-
metadata: addressOf(event),
|
|
391
|
-
});
|
|
392
|
-
}
|
|
393
|
-
else {
|
|
394
|
-
open.lastTokenIndex = index;
|
|
395
|
-
}
|
|
396
|
-
scope.streamedText = (scope.streamedText ?? '') + content;
|
|
397
|
-
out.push({
|
|
398
|
-
type: 'TEXT_MESSAGE_CONTENT',
|
|
399
|
-
messageId: scope.text.id,
|
|
400
|
-
delta: content,
|
|
401
|
-
...owned(scope, event),
|
|
402
|
-
});
|
|
403
|
-
return;
|
|
404
|
-
}
|
|
405
|
-
case 'agentfootprint.stream.llm_end': {
|
|
406
|
-
const scope = scopeOf(path);
|
|
407
|
-
if (hostDelivery)
|
|
408
|
-
return;
|
|
409
|
-
closeText(scope, out);
|
|
410
|
-
// A scope that did not see an agent turn open can already have written
|
|
411
|
-
// the text of a complete-only call by the time its root end arrives.
|
|
412
|
-
const content = text(payload.content);
|
|
413
|
-
const quiet = scope.streamedText === undefined && payload.contentWithheld !== true;
|
|
414
|
-
if (!scope.isAgent && quiet && content) {
|
|
415
|
-
wholeText(scope, content, event, out);
|
|
416
|
-
if (scope === root)
|
|
417
|
-
rootCallText = content;
|
|
418
|
-
}
|
|
419
|
-
return;
|
|
420
|
-
}
|
|
421
|
-
case 'agentfootprint.stream.thinking_delta': {
|
|
422
|
-
const content = text(payload.content);
|
|
423
|
-
if (!reasoning || content === undefined)
|
|
424
|
-
return;
|
|
425
|
-
const scope = scopeOf(path);
|
|
426
|
-
if (scope.reasoning === undefined || scope.reasoning.iteration !== payload.iteration) {
|
|
427
|
-
closeReasoning(scope, out);
|
|
428
|
-
const { id } = ids.next('reasoning', address);
|
|
429
|
-
scope.reasoning = { id, iteration: payload.iteration };
|
|
430
|
-
out.push({
|
|
431
|
-
type: 'REASONING_START',
|
|
432
|
-
messageId: id,
|
|
433
|
-
...owned(scope, event),
|
|
434
|
-
metadata: addressOf(event),
|
|
435
|
-
});
|
|
436
|
-
out.push({
|
|
437
|
-
type: 'REASONING_MESSAGE_START',
|
|
438
|
-
messageId: id,
|
|
439
|
-
role: 'reasoning',
|
|
440
|
-
...owned(scope, event),
|
|
441
|
-
});
|
|
442
|
-
}
|
|
443
|
-
out.push({
|
|
444
|
-
type: 'REASONING_MESSAGE_CONTENT',
|
|
445
|
-
messageId: scope.reasoning.id,
|
|
446
|
-
delta: content,
|
|
447
|
-
...owned(scope, event),
|
|
448
|
-
});
|
|
449
|
-
return;
|
|
450
|
-
}
|
|
451
|
-
case 'agentfootprint.stream.thinking_end': {
|
|
452
|
-
if (!reasoning)
|
|
453
|
-
return;
|
|
454
|
-
const scope = scopeOf(path);
|
|
455
|
-
if (scope.reasoning !== undefined && scope.reasoning.iteration === payload.iteration) {
|
|
456
|
-
closeReasoning(scope, out);
|
|
457
|
-
return;
|
|
458
|
-
}
|
|
459
|
-
// Nothing streamed for this call: the blocks are the reasoning, one
|
|
460
|
-
// message each, in one span. A redacted block carries no text to show.
|
|
461
|
-
const blocks = Array.isArray(payload.blocks) ? payload.blocks : [];
|
|
462
|
-
const thoughts = blocks
|
|
463
|
-
.map((block) => record(block))
|
|
464
|
-
.filter((block) => block.type === 'thinking')
|
|
465
|
-
.map((block) => text(block.content))
|
|
466
|
-
.filter((content) => content !== undefined && content.length > 0);
|
|
467
|
-
if (thoughts.length === 0)
|
|
468
|
-
return;
|
|
469
|
-
closeReasoning(scope, out);
|
|
470
|
-
const messageIds = thoughts.map(() => ids.next('reasoning', address).id);
|
|
471
|
-
const span = messageIds[0];
|
|
472
|
-
out.push({
|
|
473
|
-
type: 'REASONING_START',
|
|
474
|
-
messageId: span,
|
|
475
|
-
...owned(scope, event),
|
|
476
|
-
metadata: addressOf(event),
|
|
477
|
-
});
|
|
478
|
-
thoughts.forEach((content, i) => {
|
|
479
|
-
const messageId = messageIds[i];
|
|
480
|
-
out.push({
|
|
481
|
-
type: 'REASONING_MESSAGE_START',
|
|
482
|
-
messageId,
|
|
483
|
-
role: 'reasoning',
|
|
484
|
-
...owned(scope, event),
|
|
485
|
-
});
|
|
486
|
-
out.push({
|
|
487
|
-
type: 'REASONING_MESSAGE_CONTENT',
|
|
488
|
-
messageId,
|
|
489
|
-
delta: content,
|
|
490
|
-
...owned(scope, event),
|
|
491
|
-
});
|
|
492
|
-
out.push({ type: 'REASONING_MESSAGE_END', messageId, ...owned(scope, event) });
|
|
493
|
-
});
|
|
494
|
-
out.push({ type: 'REASONING_END', messageId: span, ...owned(scope, event) });
|
|
495
|
-
return;
|
|
496
|
-
}
|
|
497
|
-
case 'agentfootprint.stream.tool_start': {
|
|
498
|
-
const scope = scopeOf(path);
|
|
499
|
-
// The call's arguments are complete: its text message and its reasoning are over.
|
|
500
|
-
closeText(scope, out);
|
|
501
|
-
closeReasoning(scope, out);
|
|
502
|
-
// Every call of one LLM response belongs to ONE assistant message: the
|
|
503
|
-
// call's text message when it wrote any, else a message minted at the
|
|
504
|
-
// LLM call's own address for the first call and held for the rest.
|
|
505
|
-
if (scope.callMessageId === undefined)
|
|
506
|
-
scope.callMessageId = ids.next('text', scope.llmAddress ?? address).id;
|
|
507
|
-
const { id, n } = ids.next('tool', address);
|
|
508
|
-
scope.calls.push({ id, n, address, servedId: payload.toolCallId });
|
|
509
|
-
const toolCallName = text(payload.toolName) ?? '';
|
|
510
|
-
const view = argsShownOf(payload, id, options.toolArguments);
|
|
511
|
-
out.push({
|
|
512
|
-
type: 'TOOL_CALL_START',
|
|
513
|
-
toolCallId: id,
|
|
514
|
-
toolCallName,
|
|
515
|
-
parentMessageId: scope.callMessageId,
|
|
516
|
-
...owned(scope, event),
|
|
517
|
-
metadata: addressOf(event, view.address),
|
|
518
|
-
});
|
|
519
|
-
out.push({
|
|
520
|
-
type: 'TOOL_CALL_ARGS',
|
|
521
|
-
toolCallId: id,
|
|
522
|
-
delta: toWireJson(view.args),
|
|
523
|
-
...owned(scope, event),
|
|
524
|
-
});
|
|
525
|
-
out.push({ type: 'TOOL_CALL_END', toolCallId: id, ...owned(scope, event) });
|
|
526
|
-
return;
|
|
527
|
-
}
|
|
528
|
-
case 'agentfootprint.stream.tool_end': {
|
|
529
|
-
const scope = scopeOf(path);
|
|
530
|
-
const call = takeCall(scope, address, payload.toolCallId);
|
|
531
|
-
if (call === undefined) {
|
|
532
|
-
// A result the record cannot tie to a call this run opened — never
|
|
533
|
-
// attached to a call it may not belong to (CUSTOM only if listed).
|
|
534
|
-
pushCustom(event, scope, out);
|
|
535
|
-
return;
|
|
536
|
-
}
|
|
537
|
-
// A frontend tool's result is the one the client sent: it holds it already.
|
|
538
|
-
if (call.client === true)
|
|
539
|
-
return;
|
|
540
|
-
// A FAILED call's result is the thrown text — a connection string, a
|
|
541
|
-
// stack line, a provider's body. A person reads the fixed words unless
|
|
542
|
-
// the app chose to serve the record's own.
|
|
543
|
-
// Any `error` but an explicit `false` counts — under a policy that
|
|
544
|
-
// selects the key, the flag itself is served as the placeholder.
|
|
545
|
-
const failed = payload.error !== undefined && payload.error !== false && toolErrors !== 'served';
|
|
546
|
-
out.push({
|
|
547
|
-
type: 'TOOL_CALL_RESULT',
|
|
548
|
-
messageId: call.n < 0 ? ids.next('result', address).id : ids.at('result', call.n, call.address),
|
|
549
|
-
toolCallId: call.id,
|
|
550
|
-
content: failed
|
|
551
|
-
? failedCallWords(payload)
|
|
552
|
-
: resultText(options.toolResults === undefined
|
|
553
|
-
? payload.result
|
|
554
|
-
: options.toolResults(payload, {
|
|
555
|
-
toolCallId: call.id,
|
|
556
|
-
...(typeof payload.toolName === 'string' && { toolName: payload.toolName }),
|
|
557
|
-
})),
|
|
558
|
-
role: 'tool',
|
|
559
|
-
...owned(scope, event),
|
|
560
|
-
});
|
|
561
|
-
return;
|
|
562
|
-
}
|
|
563
|
-
case 'agentfootprint.pause.request':
|
|
564
|
-
pause = { event, scope: scopeOf(path) };
|
|
565
|
-
return;
|
|
566
|
-
case 'agentfootprint.error.fatal': {
|
|
567
|
-
// Only a FIXED sentence goes to a browser. The record's own fallback
|
|
568
|
-
// quotes the raw thrown message ("The AI call failed: …"), which may
|
|
569
|
-
// hold anything a provider or a tool put in it.
|
|
570
|
-
const said = text(payload.error);
|
|
571
|
-
if (said !== undefined && isFixedFailure(said))
|
|
572
|
-
fatal = said;
|
|
573
|
-
return;
|
|
574
|
-
}
|
|
575
|
-
default:
|
|
576
|
-
pushCustom(event, scopeOf(path), out);
|
|
577
|
-
}
|
|
578
|
-
};
|
|
176
|
+
const translate = eventTranslator({
|
|
177
|
+
options,
|
|
178
|
+
root,
|
|
179
|
+
scopes,
|
|
180
|
+
ids,
|
|
181
|
+
hostDelivery,
|
|
182
|
+
reasoning,
|
|
183
|
+
toolErrors,
|
|
184
|
+
scopeOf,
|
|
185
|
+
addressOf,
|
|
186
|
+
owned,
|
|
187
|
+
closeText,
|
|
188
|
+
closeReasoning,
|
|
189
|
+
closeSteps,
|
|
190
|
+
closeScope,
|
|
191
|
+
scopesUnder,
|
|
192
|
+
endScope,
|
|
193
|
+
unfinished,
|
|
194
|
+
openStep,
|
|
195
|
+
finishStep,
|
|
196
|
+
wholeText,
|
|
197
|
+
pushCustom,
|
|
198
|
+
get rootCallText() {
|
|
199
|
+
return rootCallText;
|
|
200
|
+
},
|
|
201
|
+
set rootCallText(value) {
|
|
202
|
+
rootCallText = value;
|
|
203
|
+
},
|
|
204
|
+
get rootResult() {
|
|
205
|
+
return rootResult;
|
|
206
|
+
},
|
|
207
|
+
set rootResult(value) {
|
|
208
|
+
rootResult = value;
|
|
209
|
+
},
|
|
210
|
+
get pause() {
|
|
211
|
+
return pause;
|
|
212
|
+
},
|
|
213
|
+
set pause(value) {
|
|
214
|
+
pause = value;
|
|
215
|
+
},
|
|
216
|
+
get fatal() {
|
|
217
|
+
return fatal;
|
|
218
|
+
},
|
|
219
|
+
set fatal(value) {
|
|
220
|
+
fatal = value;
|
|
221
|
+
},
|
|
222
|
+
});
|
|
579
223
|
/**
|
|
580
224
|
* Re-open what the paused run left open — the scopes (same `subagentRunId`),
|
|
581
225
|
* their steps and the call it stopped in — and return the events that say so,
|
|
@@ -774,101 +418,36 @@ export function agUiSerializer(options) {
|
|
|
774
418
|
settled = true;
|
|
775
419
|
const out = [];
|
|
776
420
|
start(out);
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
endAllNested(out, () => (subagentRunId) => ({
|
|
808
|
-
type: 'SUBAGENT_FINISHED',
|
|
809
|
-
subagentRunId,
|
|
810
|
-
outcome: { type: 'suspended' },
|
|
811
|
-
}));
|
|
812
|
-
closeContents(root, out);
|
|
813
|
-
out.push({
|
|
814
|
-
type: 'RUN_FINISHED',
|
|
815
|
-
threadId,
|
|
816
|
-
runId,
|
|
817
|
-
outcome: { type: 'success', pendingToolCallIds: [clientCall] },
|
|
818
|
-
});
|
|
819
|
-
return out;
|
|
820
|
-
}
|
|
821
|
-
const interrupt = interruptOf();
|
|
822
|
-
endAllNested(out, (scope) => (subagentRunId) => ({
|
|
823
|
-
type: 'SUBAGENT_FINISHED',
|
|
824
|
-
subagentRunId,
|
|
825
|
-
outcome: {
|
|
826
|
-
type: 'suspended',
|
|
827
|
-
...(pause?.scope === scope && { interruptIds: [interrupt.id] }),
|
|
828
|
-
},
|
|
829
|
-
}));
|
|
830
|
-
closeContents(root, out);
|
|
831
|
-
out.push({
|
|
832
|
-
type: 'RUN_FINISHED',
|
|
833
|
-
threadId,
|
|
834
|
-
runId,
|
|
835
|
-
outcome: { type: 'interrupt', interrupts: [interrupt] },
|
|
836
|
-
});
|
|
837
|
-
return out;
|
|
838
|
-
}
|
|
839
|
-
case 'cancelled':
|
|
840
|
-
endAllNested(out, () => (subagentRunId) => ({
|
|
841
|
-
type: 'SUBAGENT_ERROR',
|
|
842
|
-
subagentRunId,
|
|
843
|
-
message: AG_UI_SUBAGENT_CANCELLED,
|
|
844
|
-
code: 'cancelled',
|
|
845
|
-
}));
|
|
846
|
-
closeContents(root, out);
|
|
847
|
-
out.push({
|
|
848
|
-
type: 'RUN_FINISHED',
|
|
849
|
-
threadId,
|
|
850
|
-
runId,
|
|
851
|
-
outcome: { type: 'cancelled' },
|
|
852
|
-
});
|
|
853
|
-
return out;
|
|
854
|
-
case 'finished':
|
|
855
|
-
if (hostDelivery) {
|
|
856
|
-
rootResult = settlement.output;
|
|
857
|
-
if (settlement.output) {
|
|
858
|
-
const id = ids.next('text', 'host-delivery').id;
|
|
859
|
-
out.push({ type: 'TEXT_MESSAGE_START', messageId: id, role: 'assistant' }, { type: 'TEXT_MESSAGE_CONTENT', messageId: id, delta: settlement.output }, { type: 'TEXT_MESSAGE_END', messageId: id });
|
|
860
|
-
}
|
|
861
|
-
}
|
|
862
|
-
endAllNested(out, () => unfinished);
|
|
863
|
-
closeContents(root, out);
|
|
864
|
-
out.push({
|
|
865
|
-
type: 'RUN_FINISHED',
|
|
866
|
-
threadId,
|
|
867
|
-
runId,
|
|
868
|
-
...(rootResult !== undefined && { result: rootResult }),
|
|
869
|
-
});
|
|
870
|
-
return out;
|
|
871
|
-
}
|
|
421
|
+
return settleTranslation(settlement, out, {
|
|
422
|
+
root,
|
|
423
|
+
threadId,
|
|
424
|
+
runId,
|
|
425
|
+
ids,
|
|
426
|
+
hostDelivery,
|
|
427
|
+
pausedRecord,
|
|
428
|
+
endAllNested,
|
|
429
|
+
closeContents,
|
|
430
|
+
interruptOf,
|
|
431
|
+
unfinished,
|
|
432
|
+
get rootResult() {
|
|
433
|
+
return rootResult;
|
|
434
|
+
},
|
|
435
|
+
set rootResult(value) {
|
|
436
|
+
rootResult = value;
|
|
437
|
+
},
|
|
438
|
+
get suspended() {
|
|
439
|
+
return suspended;
|
|
440
|
+
},
|
|
441
|
+
set suspended(value) {
|
|
442
|
+
suspended = value;
|
|
443
|
+
},
|
|
444
|
+
get fatal() {
|
|
445
|
+
return fatal;
|
|
446
|
+
},
|
|
447
|
+
get pause() {
|
|
448
|
+
return pause;
|
|
449
|
+
},
|
|
450
|
+
});
|
|
872
451
|
},
|
|
873
452
|
suspension: (awaiting) => {
|
|
874
453
|
if (settled)
|
|
@@ -877,20 +456,4 @@ export function agUiSerializer(options) {
|
|
|
877
456
|
},
|
|
878
457
|
};
|
|
879
458
|
}
|
|
880
|
-
/**
|
|
881
|
-
* The question a pause put to a person, from whichever home its kind keeps it
|
|
882
|
-
* in: a plain ask (`askHuman` / `pauseHere` / an input request) at the top, a
|
|
883
|
-
* middleware's ask on `ask.question`, a check-in as the plain-words claim of
|
|
884
|
-
* what the tool will do (`checkIn.evidence.willDo`).
|
|
885
|
-
*/
|
|
886
|
-
function questionOf(payload) {
|
|
887
|
-
return (text(payload.question) ??
|
|
888
|
-
text(record(payload.ask).question) ??
|
|
889
|
-
text(record(record(payload.checkIn).evidence).willDo));
|
|
890
|
-
}
|
|
891
|
-
/** A composition's step name: its kind, and where it is mounted when it is not the run itself. */
|
|
892
|
-
function compositionStep(kind, path) {
|
|
893
|
-
const name = typeof kind === 'string' && kind.length > 0 ? kind : 'Composition';
|
|
894
|
-
return path.length === 0 ? name : `${name}:${path.join('/')}`;
|
|
895
|
-
}
|
|
896
459
|
//# sourceMappingURL=serializer.js.map
|