veryfront 0.1.516 → 0.1.518
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/esm/deno.js +3 -3
- package/esm/src/agent/ag-ui/browser-chunk-encoder.d.ts +14 -0
- package/esm/src/agent/ag-ui/browser-chunk-encoder.d.ts.map +1 -0
- package/esm/src/agent/ag-ui/browser-chunk-encoder.js +31 -0
- package/esm/src/agent/ag-ui/browser-encoder.d.ts +32 -0
- package/esm/src/agent/ag-ui/browser-encoder.d.ts.map +1 -0
- package/esm/src/agent/ag-ui/browser-encoder.js +405 -0
- package/esm/src/agent/ag-ui/browser-finalize-tracker.d.ts +12 -0
- package/esm/src/agent/ag-ui/browser-finalize-tracker.d.ts.map +1 -0
- package/esm/src/agent/ag-ui/browser-finalize-tracker.js +42 -0
- package/esm/src/agent/ag-ui/browser-response-stream.d.ts +28 -0
- package/esm/src/agent/ag-ui/browser-response-stream.d.ts.map +1 -0
- package/esm/src/agent/ag-ui/chat-ui-chunk-browser-encoder.d.ts +20 -0
- package/esm/src/agent/ag-ui/chat-ui-chunk-browser-encoder.d.ts.map +1 -0
- package/esm/src/agent/ag-ui/chat-ui-chunk-browser-encoder.js +108 -0
- package/esm/src/agent/ag-ui/chunk-encoder-bridge.d.ts +11 -0
- package/esm/src/agent/ag-ui/chunk-encoder-bridge.d.ts.map +1 -0
- package/esm/src/agent/ag-ui/chunk-encoder-bridge.js +9 -0
- package/esm/src/agent/ag-ui/detached-start.d.ts +158 -0
- package/esm/src/agent/ag-ui/detached-start.d.ts.map +1 -0
- package/esm/src/agent/ag-ui/detached-start.js +256 -0
- package/esm/src/agent/ag-ui/forwarded-context.d.ts +14 -0
- package/esm/src/agent/ag-ui/forwarded-context.d.ts.map +1 -0
- package/esm/src/agent/ag-ui/forwarded-context.js +56 -0
- package/esm/src/agent/ag-ui/handler.d.ts +14 -0
- package/esm/src/agent/ag-ui/handler.d.ts.map +1 -0
- package/esm/src/agent/ag-ui/handler.js +244 -0
- package/esm/src/agent/ag-ui/host-support.d.ts +131 -0
- package/esm/src/agent/ag-ui/host-support.d.ts.map +1 -0
- package/esm/src/agent/ag-ui/host-support.js +179 -0
- package/esm/src/agent/ag-ui/request-shared.d.ts +4 -0
- package/esm/src/agent/ag-ui/request-shared.d.ts.map +1 -0
- package/esm/src/agent/ag-ui/request-shared.js +56 -0
- package/esm/src/agent/ag-ui/run-control.d.ts +39 -0
- package/esm/src/agent/ag-ui/run-control.d.ts.map +1 -0
- package/esm/src/agent/ag-ui/run-control.js +84 -0
- package/esm/src/agent/ag-ui/runtime-browser-response.d.ts +18 -0
- package/esm/src/agent/ag-ui/runtime-browser-response.d.ts.map +1 -0
- package/esm/src/agent/ag-ui/runtime-browser-response.js +15 -0
- package/esm/src/agent/ag-ui/runtime-chat-stream-encoder.d.ts +17 -0
- package/esm/src/agent/ag-ui/runtime-chat-stream-encoder.d.ts.map +1 -0
- package/esm/src/agent/ag-ui/runtime-chat-stream-encoder.js +304 -0
- package/esm/src/agent/ag-ui/runtime-event-encoder.d.ts +11 -0
- package/esm/src/agent/ag-ui/runtime-event-encoder.d.ts.map +1 -0
- package/esm/src/agent/ag-ui/runtime-event-encoder.js +37 -0
- package/esm/src/agent/ag-ui/runtime-handler.d.ts +44 -0
- package/esm/src/agent/ag-ui/runtime-handler.d.ts.map +1 -0
- package/esm/src/agent/ag-ui/runtime-handler.js +301 -0
- package/esm/src/agent/ag-ui/runtime-support.d.ts +4 -0
- package/esm/src/agent/ag-ui/runtime-support.d.ts.map +1 -0
- package/esm/src/agent/ag-ui/sse-parser.d.ts +57 -0
- package/esm/src/agent/ag-ui/sse-parser.d.ts.map +1 -0
- package/esm/src/agent/ag-ui/sse-parser.js +227 -0
- package/esm/src/agent/ag-ui/tool-shared.d.ts +15 -0
- package/esm/src/agent/ag-ui/tool-shared.d.ts.map +1 -0
- package/esm/src/agent/ag-ui/tool-shared.js +48 -0
- package/esm/src/agent/ag-ui/tracked-browser-response.d.ts +9 -0
- package/esm/src/agent/ag-ui/tracked-browser-response.d.ts.map +1 -0
- package/esm/src/agent/ag-ui/tracked-browser-response.js +19 -0
- package/esm/src/agent/agent-runtime-message-adapter.js +1 -1
- package/esm/src/agent/chat-ui-message-stream.js +1 -1
- package/esm/src/agent/child-run/execution-cleanup.d.ts +14 -0
- package/esm/src/agent/child-run/execution-cleanup.d.ts.map +1 -0
- package/esm/src/agent/child-run/execution-snapshot.d.ts +70 -0
- package/esm/src/agent/child-run/execution-snapshot.d.ts.map +1 -0
- package/esm/src/agent/child-run/execution-support.d.ts +5 -0
- package/esm/src/agent/child-run/execution-support.d.ts.map +1 -0
- package/esm/src/agent/child-run/final-step-support.d.ts +18 -0
- package/esm/src/agent/child-run/final-step-support.d.ts.map +1 -0
- package/esm/src/agent/child-run/result-summary.d.ts +14 -0
- package/esm/src/agent/child-run/result-summary.d.ts.map +1 -0
- package/esm/src/agent/conversation/bootstrap.d.ts +94 -0
- package/esm/src/agent/conversation/bootstrap.d.ts.map +1 -0
- package/esm/src/agent/conversation/bootstrap.js +210 -0
- package/esm/src/agent/conversation/delegation-policy.d.ts +53 -0
- package/esm/src/agent/conversation/delegation-policy.d.ts.map +1 -0
- package/esm/src/agent/conversation/delegation-policy.js +192 -0
- package/esm/src/agent/conversation/hosted-lifecycle.d.ts +39 -0
- package/esm/src/agent/conversation/hosted-lifecycle.d.ts.map +1 -0
- package/esm/src/agent/conversation/hosted-lifecycle.js +138 -0
- package/esm/src/agent/conversation/hosted-terminal.d.ts +46 -0
- package/esm/src/agent/conversation/hosted-terminal.d.ts.map +1 -0
- package/esm/src/agent/conversation/hosted-terminal.js +138 -0
- package/esm/src/agent/conversation/root-run-context.d.ts +57 -0
- package/esm/src/agent/conversation/root-run-context.d.ts.map +1 -0
- package/esm/src/agent/conversation/root-run-context.js +79 -0
- package/esm/src/agent/conversation/root-run-lifecycle.d.ts +61 -0
- package/esm/src/agent/conversation/root-run-lifecycle.d.ts.map +1 -0
- package/esm/src/agent/conversation/root-run-lifecycle.js +94 -0
- package/esm/src/agent/conversation/run-chunk-mirror.d.ts +74 -0
- package/esm/src/agent/conversation/run-chunk-mirror.d.ts.map +1 -0
- package/esm/src/agent/conversation/run-chunk-mirror.js +188 -0
- package/esm/src/agent/conversation/run-context.d.ts +19 -0
- package/esm/src/agent/conversation/run-context.d.ts.map +1 -0
- package/esm/src/agent/conversation/run-event-normalization.d.ts +8 -0
- package/esm/src/agent/conversation/run-event-normalization.d.ts.map +1 -0
- package/esm/src/agent/conversation/run-event-preparation.d.ts +7 -0
- package/esm/src/agent/conversation/run-event-preparation.d.ts.map +1 -0
- package/esm/src/agent/conversation/run-event-preparation.js +48 -0
- package/esm/src/agent/conversation/run-events.d.ts +34 -0
- package/esm/src/agent/conversation/run-events.d.ts.map +1 -0
- package/esm/src/agent/conversation/run-events.js +200 -0
- package/esm/src/agent/conversation/run-mirror.d.ts +43 -0
- package/esm/src/agent/conversation/run-mirror.d.ts.map +1 -0
- package/esm/src/agent/conversation/run-mirror.js +157 -0
- package/esm/src/agent/conversation/run-stream-mirror.d.ts +21 -0
- package/esm/src/agent/conversation/run-stream-mirror.d.ts.map +1 -0
- package/esm/src/agent/conversation/run-stream-mirror.js +31 -0
- package/esm/src/agent/data-stream.d.ts +1 -1
- package/esm/src/agent/default-hosted-chat-runtime.d.ts +5 -5
- package/esm/src/agent/default-hosted-chat-runtime.d.ts.map +1 -1
- package/esm/src/agent/default-hosted-chat-runtime.js +3 -3
- package/esm/src/agent/default-hosted-invoke-agent-tool.d.ts +7 -7
- package/esm/src/agent/default-hosted-invoke-agent-tool.d.ts.map +1 -1
- package/esm/src/agent/default-hosted-invoke-agent-tool.js +13 -13
- package/esm/src/agent/default-hosted-project-steering-refresh.d.ts +4 -4
- package/esm/src/agent/default-hosted-project-steering-refresh.js +1 -1
- package/esm/src/agent/default-research-artifact-support.js +2 -2
- package/esm/src/agent/fork-runtime-stream.d.ts +1 -1
- package/esm/src/agent/fork-runtime-stream.js +1 -1
- package/esm/src/agent/hosted/ag-ui-chat-request.d.ts +56 -0
- package/esm/src/agent/hosted/ag-ui-chat-request.d.ts.map +1 -0
- package/esm/src/agent/hosted/ag-ui-chat-request.js +112 -0
- package/esm/src/agent/hosted/agent-project-steering.d.ts +33 -0
- package/esm/src/agent/hosted/agent-project-steering.d.ts.map +1 -0
- package/esm/src/agent/hosted/agent-project-steering.js +73 -0
- package/esm/src/agent/hosted/agent-run-lifecycle.d.ts +60 -0
- package/esm/src/agent/hosted/agent-run-lifecycle.d.ts.map +1 -0
- package/esm/src/agent/hosted/agent-run-lifecycle.js +72 -0
- package/esm/src/agent/hosted/chat-execution-runtime.d.ts +127 -0
- package/esm/src/agent/hosted/chat-execution-runtime.d.ts.map +1 -0
- package/esm/src/agent/hosted/chat-execution-runtime.js +400 -0
- package/esm/src/agent/hosted/chat-preparation.d.ts +105 -0
- package/esm/src/agent/hosted/chat-preparation.d.ts.map +1 -0
- package/esm/src/agent/hosted/chat-preparation.js +156 -0
- package/esm/src/agent/hosted/chat-request-parser.d.ts +53 -0
- package/esm/src/agent/hosted/chat-request-parser.d.ts.map +1 -0
- package/esm/src/agent/hosted/chat-request-parser.js +105 -0
- package/esm/src/agent/hosted/chat-request.d.ts +305 -0
- package/esm/src/agent/hosted/chat-request.d.ts.map +1 -0
- package/esm/src/agent/hosted/chat-request.js +68 -0
- package/esm/src/agent/hosted/chat-runtime-agent-adapter.d.ts +14 -0
- package/esm/src/agent/hosted/chat-runtime-agent-adapter.d.ts.map +1 -0
- package/esm/src/agent/hosted/chat-runtime-agent-adapter.js +48 -0
- package/esm/src/agent/hosted/chat-runtime-contract.d.ts +86 -0
- package/esm/src/agent/hosted/chat-runtime-contract.d.ts.map +1 -0
- package/esm/src/agent/hosted/chat-runtime-tool-assembly.d.ts +51 -0
- package/esm/src/agent/hosted/chat-runtime-tool-assembly.d.ts.map +1 -0
- package/esm/src/agent/hosted/chat-runtime-tool-assembly.js +84 -0
- package/esm/src/agent/hosted/child-artifact-support.d.ts +25 -0
- package/esm/src/agent/hosted/child-artifact-support.d.ts.map +1 -0
- package/esm/src/agent/hosted/child-artifact-support.js +121 -0
- package/esm/src/agent/hosted/child-bootstrap.d.ts +40 -0
- package/esm/src/agent/hosted/child-bootstrap.d.ts.map +1 -0
- package/esm/src/agent/hosted/child-bootstrap.js +44 -0
- package/esm/src/agent/hosted/child-execution-logging.d.ts +35 -0
- package/esm/src/agent/hosted/child-execution-logging.d.ts.map +1 -0
- package/esm/src/agent/hosted/child-execution-logging.js +69 -0
- package/esm/src/agent/hosted/child-fork-execution-runner.d.ts +101 -0
- package/esm/src/agent/hosted/child-fork-execution-runner.d.ts.map +1 -0
- package/esm/src/agent/hosted/child-fork-execution-runner.js +205 -0
- package/esm/src/agent/hosted/child-fork-instructions.d.ts +8 -0
- package/esm/src/agent/hosted/child-fork-instructions.d.ts.map +1 -0
- package/esm/src/agent/hosted/child-fork-run-context.d.ts +88 -0
- package/esm/src/agent/hosted/child-fork-run-context.d.ts.map +1 -0
- package/esm/src/agent/hosted/child-fork-run-context.js +144 -0
- package/esm/src/agent/hosted/child-fork-runtime-start.d.ts +18 -0
- package/esm/src/agent/hosted/child-fork-runtime-start.d.ts.map +1 -0
- package/esm/src/agent/hosted/child-fork-runtime-start.js +41 -0
- package/esm/src/agent/hosted/child-fork-step-message-preparation.d.ts +19 -0
- package/esm/src/agent/hosted/child-fork-step-message-preparation.d.ts.map +1 -0
- package/esm/src/agent/hosted/child-fork-step-message-preparation.js +52 -0
- package/esm/src/agent/hosted/child-fork-stream-execution.d.ts +153 -0
- package/esm/src/agent/hosted/child-fork-stream-execution.d.ts.map +1 -0
- package/esm/src/agent/hosted/child-fork-stream-execution.js +416 -0
- package/esm/src/agent/hosted/child-fork-tool-sources.d.ts +46 -0
- package/esm/src/agent/hosted/child-fork-tool-sources.d.ts.map +1 -0
- package/esm/src/agent/hosted/child-fork-tool-sources.js +132 -0
- package/esm/src/agent/hosted/child-invoke-tool.d.ts +20 -0
- package/esm/src/agent/hosted/child-invoke-tool.d.ts.map +1 -0
- package/esm/src/agent/hosted/child-invoke-tool.js +49 -0
- package/esm/src/agent/hosted/child-lifecycle.d.ts +63 -0
- package/esm/src/agent/hosted/child-lifecycle.d.ts.map +1 -0
- package/esm/src/agent/hosted/child-lifecycle.js +192 -0
- package/esm/src/agent/hosted/child-mirror.d.ts +108 -0
- package/esm/src/agent/hosted/child-mirror.d.ts.map +1 -0
- package/esm/src/agent/hosted/child-pending-tool-lifecycle.d.ts +50 -0
- package/esm/src/agent/hosted/child-pending-tool-lifecycle.d.ts.map +1 -0
- package/esm/src/agent/hosted/child-pending-tool-lifecycle.js +119 -0
- package/esm/src/agent/hosted/child-requested-tools.d.ts +109 -0
- package/esm/src/agent/hosted/child-requested-tools.d.ts.map +1 -0
- package/esm/src/agent/hosted/child-requested-tools.js +233 -0
- package/esm/src/agent/hosted/child-status.d.ts +39 -0
- package/esm/src/agent/hosted/child-status.d.ts.map +1 -0
- package/esm/src/agent/hosted/child-status.js +98 -0
- package/esm/src/agent/hosted/child-steering-tools.d.ts +20 -0
- package/esm/src/agent/hosted/child-steering-tools.d.ts.map +1 -0
- package/esm/src/agent/hosted/child-steering-tools.js +53 -0
- package/esm/src/agent/hosted/child-stream-watchdog.d.ts +27 -0
- package/esm/src/agent/hosted/child-stream-watchdog.d.ts.map +1 -0
- package/esm/src/agent/hosted/child-stream-watchdog.js +95 -0
- package/esm/src/agent/hosted/child-tool-input.d.ts +44 -0
- package/esm/src/agent/hosted/child-tool-input.d.ts.map +1 -0
- package/esm/src/agent/hosted/child-tool-input.js +44 -0
- package/esm/src/agent/hosted/durable-chat-run-start.d.ts +46 -0
- package/esm/src/agent/hosted/durable-chat-run-start.d.ts.map +1 -0
- package/esm/src/agent/hosted/durable-chat-run-start.js +148 -0
- package/esm/src/agent/hosted/durable-child-fork-execution.d.ts +159 -0
- package/esm/src/agent/hosted/durable-child-fork-execution.d.ts.map +1 -0
- package/esm/src/agent/hosted/durable-child-fork-execution.js +324 -0
- package/esm/src/agent/hosted/finalized-message.d.ts +44 -0
- package/esm/src/agent/hosted/finalized-message.d.ts.map +1 -0
- package/esm/src/agent/hosted/finalized-message.js +67 -0
- package/esm/src/agent/hosted/form-input-tool.d.ts +85 -0
- package/esm/src/agent/hosted/form-input-tool.d.ts.map +1 -0
- package/esm/src/agent/hosted/form-input-tool.js +88 -0
- package/esm/src/agent/hosted/lifecycle.d.ts +41 -0
- package/esm/src/agent/hosted/lifecycle.d.ts.map +1 -0
- package/esm/src/agent/hosted/project-remote-tool-source.d.ts +46 -0
- package/esm/src/agent/hosted/project-remote-tool-source.d.ts.map +1 -0
- package/esm/src/agent/hosted/project-remote-tool-source.js +147 -0
- package/esm/src/agent/hosted/project-steering-adapter.d.ts +34 -0
- package/esm/src/agent/hosted/project-steering-adapter.d.ts.map +1 -0
- package/esm/src/agent/hosted/project-steering-adapter.js +82 -0
- package/esm/src/agent/hosted/response-stream.d.ts +22 -0
- package/esm/src/agent/hosted/response-stream.d.ts.map +1 -0
- package/esm/src/agent/hosted/response-stream.js +52 -0
- package/esm/src/agent/hosted/runtime-request-config.d.ts +27 -0
- package/esm/src/agent/hosted/runtime-request-config.d.ts.map +1 -0
- package/esm/src/agent/hosted/runtime-request-config.js +54 -0
- package/esm/src/agent/hosted/runtime-state-resolver.d.ts +28 -0
- package/esm/src/agent/hosted/runtime-state-resolver.d.ts.map +1 -0
- package/esm/src/agent/hosted/runtime-state-resolver.js +71 -0
- package/esm/src/agent/hosted/stream-finalization.d.ts +61 -0
- package/esm/src/agent/hosted/stream-finalization.d.ts.map +1 -0
- package/esm/src/agent/hosted/stream-terminal-error.d.ts +16 -0
- package/esm/src/agent/hosted/stream-terminal-error.d.ts.map +1 -0
- package/esm/src/agent/hosted/stream-terminal-error.js +54 -0
- package/esm/src/agent/hosted/veryfront-api-tool-access.d.ts +49 -0
- package/esm/src/agent/hosted/veryfront-api-tool-access.d.ts.map +1 -0
- package/esm/src/agent/hosted/veryfront-api-tool-access.js +182 -0
- package/esm/src/agent/human-input.js +1 -1
- package/esm/src/agent/index.d.ts +108 -107
- package/esm/src/agent/index.d.ts.map +1 -1
- package/esm/src/agent/index.js +106 -105
- package/esm/src/agent/live-studio-mcp-tools.d.ts +1 -1
- package/esm/src/agent/live-studio-mcp-tools.js +1 -1
- package/esm/src/agent/prepared-hosted-chat-execution.d.ts +2 -2
- package/esm/src/agent/prepared-hosted-chat-execution.js +3 -3
- package/esm/src/agent/project-agent-runtime.d.ts +25 -0
- package/esm/src/agent/project-agent-runtime.d.ts.map +1 -0
- package/esm/src/agent/project-agent-runtime.js +84 -0
- package/esm/src/agent/runtime/ag-ui-contract.d.ts +213 -0
- package/esm/src/agent/runtime/ag-ui-contract.d.ts.map +1 -0
- package/esm/src/agent/runtime/ag-ui-contract.js +134 -0
- package/esm/src/agent/runtime/agent-definition-files.d.ts +23 -0
- package/esm/src/agent/runtime/agent-definition-files.d.ts.map +1 -0
- package/esm/src/agent/runtime/agent-definition-files.js +79 -0
- package/esm/src/agent/runtime/agent-definition.d.ts +60 -0
- package/esm/src/agent/runtime/agent-definition.d.ts.map +1 -0
- package/esm/src/agent/runtime/agent-definition.js +105 -0
- package/esm/src/agent/runtime/agent-invocation-contract.d.ts +326 -0
- package/esm/src/agent/runtime/agent-invocation-contract.d.ts.map +1 -0
- package/esm/src/agent/runtime/agent-invocation-contract.js +212 -0
- package/esm/src/agent/runtime/agent-markdown-adapter.d.ts +6 -0
- package/esm/src/agent/runtime/agent-markdown-adapter.d.ts.map +1 -0
- package/esm/src/agent/runtime/agent-markdown-adapter.js +20 -0
- package/esm/src/agent/runtime/builtin-skill-files.d.ts +18 -0
- package/esm/src/agent/runtime/builtin-skill-files.d.ts.map +1 -0
- package/esm/src/agent/runtime/builtin-skill-files.js +82 -0
- package/esm/src/agent/runtime/client-profile.d.ts +26 -0
- package/esm/src/agent/runtime/client-profile.d.ts.map +1 -0
- package/esm/src/agent/runtime/client-profile.js +82 -0
- package/esm/src/agent/runtime/load-skill-tool.d.ts +43 -0
- package/esm/src/agent/runtime/load-skill-tool.d.ts.map +1 -0
- package/esm/src/agent/runtime/load-skill-tool.js +115 -0
- package/esm/src/agent/runtime/message-file-url-refresh.d.ts +9 -0
- package/esm/src/agent/runtime/message-file-url-refresh.d.ts.map +1 -0
- package/esm/src/agent/runtime/message-preparation.d.ts +10 -0
- package/esm/src/agent/runtime/message-preparation.d.ts.map +1 -0
- package/esm/src/agent/runtime/message-preparation.js +34 -0
- package/esm/src/agent/runtime/project-files-client.d.ts +50 -0
- package/esm/src/agent/runtime/project-files-client.d.ts.map +1 -0
- package/esm/src/agent/runtime/project-files-client.js +143 -0
- package/esm/src/agent/runtime/project-skill-catalog.d.ts +26 -0
- package/esm/src/agent/runtime/project-skill-catalog.d.ts.map +1 -0
- package/esm/src/agent/runtime/project-skill-catalog.js +148 -0
- package/esm/src/agent/runtime/project-skill-loader.d.ts +28 -0
- package/esm/src/agent/runtime/project-skill-loader.d.ts.map +1 -0
- package/esm/src/agent/runtime/project-skill-loader.js +122 -0
- package/esm/src/agent/runtime/prompt-block.d.ts +7 -0
- package/esm/src/agent/runtime/prompt-block.d.ts.map +1 -0
- package/esm/src/agent/runtime/skill-metadata.d.ts +75 -0
- package/esm/src/agent/runtime/skill-metadata.d.ts.map +1 -0
- package/esm/src/agent/runtime/skill-metadata.js +159 -0
- package/esm/src/agent/runtime/skill-prompt.d.ts +5 -0
- package/esm/src/agent/runtime/skill-prompt.d.ts.map +1 -0
- package/esm/src/agent/runtime/skill-prompt.js +40 -0
- package/esm/src/agent/runtime/tool-inventory.d.ts +4 -0
- package/esm/src/agent/runtime/tool-inventory.d.ts.map +1 -0
- package/esm/src/agent/runtime/upload-url-client.d.ts +13 -0
- package/esm/src/agent/runtime/upload-url-client.d.ts.map +1 -0
- package/esm/src/agent/runtime/upload-url-client.js +54 -0
- package/esm/src/agent/service/auth.d.ts +81 -0
- package/esm/src/agent/service/auth.d.ts.map +1 -0
- package/esm/src/agent/service/bootstrap.d.ts +23 -0
- package/esm/src/agent/service/bootstrap.d.ts.map +1 -0
- package/esm/src/agent/service/bootstrap.js +38 -0
- package/esm/src/agent/service/config.d.ts +140 -0
- package/esm/src/agent/service/config.d.ts.map +1 -0
- package/esm/src/agent/service/definition.d.ts +87 -0
- package/esm/src/agent/service/definition.d.ts.map +1 -0
- package/esm/src/agent/service/env-files.d.ts +13 -0
- package/esm/src/agent/service/env-files.d.ts.map +1 -0
- package/esm/src/agent/service/env-files.js +34 -0
- package/esm/src/agent/service/mcp-server-config.d.ts +33 -0
- package/esm/src/agent/service/mcp-server-config.d.ts.map +1 -0
- package/esm/src/agent/service/mcp-server-config.js +49 -0
- package/esm/src/agent/service/node-runtime-infrastructure.d.ts +26 -0
- package/esm/src/agent/service/node-runtime-infrastructure.d.ts.map +1 -0
- package/esm/src/agent/service/node-runtime-infrastructure.js +30 -0
- package/esm/src/agent/service/node-telemetry.d.ts +44 -0
- package/esm/src/agent/service/node-telemetry.d.ts.map +1 -0
- package/esm/src/agent/service/registration.d.ts +110 -0
- package/esm/src/agent/service/registration.d.ts.map +1 -0
- package/esm/src/agent/service/registration.js +228 -0
- package/esm/src/agent/service/routes.d.ts +81 -0
- package/esm/src/agent/service/routes.d.ts.map +1 -0
- package/esm/src/agent/service/routes.js +204 -0
- package/esm/src/agent/service/runtime.d.ts +73 -0
- package/esm/src/agent/service/runtime.d.ts.map +1 -0
- package/esm/src/agent/service/runtime.js +118 -0
- package/esm/src/agent/service/server.d.ts +30 -0
- package/esm/src/agent/service/server.d.ts.map +1 -0
- package/esm/src/agent/service/server.js +47 -0
- package/esm/src/agent/veryfront-cloud-agent-service.d.ts +8 -7
- package/esm/src/agent/veryfront-cloud-agent-service.d.ts.map +1 -1
- package/esm/src/agent/veryfront-cloud-agent-service.js +17 -72
- package/esm/src/agent/veryfront-cloud-hosted-chat-execution-preparation.d.ts +3 -3
- package/esm/src/agent/veryfront-cloud-hosted-chat-execution-preparation.js +1 -1
- package/esm/src/agent/veryfront-cloud-prepared-hosted-chat-execution-runtime.d.ts +1 -1
- package/esm/src/agent/veryfront-cloud-runtime-system-messages.d.ts +3 -3
- package/esm/src/agent/veryfront-cloud-runtime-system-messages.js +2 -2
- package/esm/src/discovery/handlers/runtime-agent-markdown-handler.js +2 -2
- package/esm/src/internal-agents/ag-ui-sse.d.ts +2 -2
- package/esm/src/internal-agents/ag-ui-sse.js +1 -1
- package/esm/src/internal-agents/run-stream.js +1 -1
- package/esm/src/internal-agents/schema.d.ts +2 -2
- package/esm/src/internal-agents/schema.js +2 -2
- package/esm/src/tool/project-scoped-remote-tools.d.ts +6 -0
- package/esm/src/tool/project-scoped-remote-tools.d.ts.map +1 -1
- package/esm/src/tool/project-scoped-remote-tools.js +15 -4
- package/esm/src/utils/version-constant.d.ts +1 -1
- package/esm/src/utils/version-constant.js +1 -1
- package/package.json +3 -3
- package/src/deno.js +3 -3
- package/src/deps/esm.sh/@types/react-dom@19.2.3/client.d.ts +1 -1
- package/src/deps/esm.sh/@types/react@19.2.14/global.d.ts +166 -0
- package/src/deps/esm.sh/@types/react@19.2.14/index.d.ts +4370 -0
- package/src/deps/esm.sh/react-dom@19.2.4/client.d.ts +1 -1
- package/src/src/agent/ag-ui/browser-chunk-encoder.ts +58 -0
- package/src/src/agent/ag-ui/browser-encoder.ts +538 -0
- package/src/src/agent/ag-ui/browser-finalize-tracker.ts +65 -0
- package/src/src/agent/ag-ui/browser-response-stream.ts +175 -0
- package/src/src/agent/ag-ui/chat-ui-chunk-browser-encoder.ts +172 -0
- package/src/src/agent/ag-ui/chunk-encoder-bridge.ts +34 -0
- package/src/src/agent/ag-ui/detached-start.ts +425 -0
- package/src/src/agent/ag-ui/forwarded-context.ts +83 -0
- package/src/src/agent/ag-ui/handler.ts +388 -0
- package/src/src/agent/ag-ui/host-support.ts +244 -0
- package/src/src/agent/ag-ui/request-shared.ts +76 -0
- package/src/src/agent/ag-ui/run-control.ts +145 -0
- package/src/src/agent/ag-ui/runtime-browser-response.ts +41 -0
- package/src/src/agent/ag-ui/runtime-chat-stream-encoder.ts +359 -0
- package/src/src/agent/ag-ui/runtime-event-encoder.ts +71 -0
- package/src/src/agent/ag-ui/runtime-handler.ts +510 -0
- package/src/src/agent/ag-ui/runtime-support.ts +64 -0
- package/src/src/agent/ag-ui/sse-parser.ts +306 -0
- package/src/src/agent/ag-ui/tool-shared.ts +80 -0
- package/src/src/agent/ag-ui/tracked-browser-response.ts +42 -0
- package/src/src/agent/agent-runtime-message-adapter.ts +1 -1
- package/src/src/agent/chat-ui-message-stream.ts +1 -1
- package/src/src/agent/conversation/bootstrap.ts +335 -0
- package/src/src/agent/conversation/delegation-policy.ts +299 -0
- package/src/src/agent/conversation/hosted-lifecycle.ts +215 -0
- package/src/src/agent/conversation/hosted-terminal.ts +235 -0
- package/src/src/agent/conversation/root-run-context.ts +143 -0
- package/src/src/agent/conversation/root-run-lifecycle.ts +184 -0
- package/src/src/agent/conversation/run-chunk-mirror.ts +350 -0
- package/src/src/agent/conversation/run-context.ts +22 -0
- package/src/src/agent/conversation/run-event-preparation.ts +76 -0
- package/src/src/agent/conversation/run-events.ts +242 -0
- package/src/src/agent/conversation/run-mirror.ts +235 -0
- package/src/src/agent/conversation/run-stream-mirror.ts +56 -0
- package/src/src/agent/data-stream.ts +1 -1
- package/src/src/agent/default-hosted-chat-runtime.ts +6 -6
- package/src/src/agent/default-hosted-invoke-agent-tool.ts +19 -19
- package/src/src/agent/default-hosted-project-steering-refresh.ts +5 -5
- package/src/src/agent/default-research-artifact-support.ts +2 -2
- package/src/src/agent/fork-runtime-stream.ts +2 -2
- package/src/src/agent/hosted/ag-ui-chat-request.ts +197 -0
- package/src/src/agent/hosted/agent-project-steering.ts +129 -0
- package/src/src/agent/hosted/agent-run-lifecycle.ts +161 -0
- package/src/src/agent/hosted/chat-execution-runtime.ts +703 -0
- package/src/src/agent/hosted/chat-preparation.ts +357 -0
- package/src/src/agent/hosted/chat-request-parser.ts +209 -0
- package/src/src/agent/hosted/chat-request.ts +112 -0
- package/src/src/agent/hosted/chat-runtime-agent-adapter.ts +88 -0
- package/src/src/agent/hosted/chat-runtime-contract.ts +101 -0
- package/src/src/agent/hosted/chat-runtime-tool-assembly.ts +183 -0
- package/src/src/agent/hosted/child-artifact-support.ts +201 -0
- package/src/src/agent/hosted/child-bootstrap.ts +75 -0
- package/src/src/agent/hosted/child-execution-logging.ts +114 -0
- package/src/src/agent/hosted/child-fork-execution-runner.ts +396 -0
- package/src/src/agent/hosted/child-fork-run-context.ts +309 -0
- package/src/src/agent/hosted/child-fork-runtime-start.ts +84 -0
- package/src/src/agent/hosted/child-fork-step-message-preparation.ts +96 -0
- package/src/src/agent/hosted/child-fork-stream-execution.ts +626 -0
- package/src/src/agent/hosted/child-fork-tool-sources.ts +231 -0
- package/src/src/agent/hosted/child-invoke-tool.ts +90 -0
- package/src/src/agent/hosted/child-lifecycle.ts +352 -0
- package/src/src/agent/hosted/child-mirror.ts +272 -0
- package/src/src/agent/hosted/child-pending-tool-lifecycle.ts +191 -0
- package/src/src/agent/hosted/child-requested-tools.ts +411 -0
- package/src/src/agent/hosted/child-status.ts +167 -0
- package/src/src/agent/hosted/child-steering-tools.ts +92 -0
- package/src/src/agent/hosted/child-stream-watchdog.ts +146 -0
- package/src/src/agent/hosted/child-tool-input.ts +91 -0
- package/src/src/agent/hosted/durable-chat-run-start.ts +246 -0
- package/src/src/agent/hosted/durable-child-fork-execution.ts +597 -0
- package/src/src/agent/hosted/finalized-message.ts +170 -0
- package/src/src/agent/hosted/form-input-tool.ts +128 -0
- package/src/src/agent/hosted/project-remote-tool-source.ts +279 -0
- package/src/src/agent/hosted/project-steering-adapter.ts +184 -0
- package/src/src/agent/hosted/response-stream.ts +87 -0
- package/src/src/agent/hosted/runtime-request-config.ts +112 -0
- package/src/src/agent/hosted/runtime-state-resolver.ts +133 -0
- package/src/src/agent/hosted/stream-finalization.ts +188 -0
- package/src/src/agent/hosted/stream-terminal-error.ts +81 -0
- package/src/src/agent/hosted/veryfront-api-tool-access.ts +293 -0
- package/src/src/agent/human-input.ts +1 -1
- package/src/src/agent/index.ts +120 -107
- package/src/src/agent/live-studio-mcp-tools.ts +1 -1
- package/src/src/agent/prepared-hosted-chat-execution.ts +4 -4
- package/src/src/agent/project-agent-runtime.ts +139 -0
- package/src/src/agent/runtime/ag-ui-contract.ts +216 -0
- package/src/src/agent/runtime/agent-definition-files.ts +128 -0
- package/src/src/agent/runtime/agent-definition.ts +163 -0
- package/src/src/agent/runtime/agent-invocation-contract.ts +355 -0
- package/src/src/agent/runtime/agent-markdown-adapter.ts +31 -0
- package/src/src/agent/runtime/builtin-skill-files.ts +122 -0
- package/src/src/agent/runtime/client-profile.ts +123 -0
- package/src/src/agent/runtime/load-skill-tool.ts +239 -0
- package/src/src/agent/runtime/message-file-url-refresh.ts +120 -0
- package/src/src/agent/runtime/message-preparation.ts +58 -0
- package/src/src/agent/runtime/project-files-client.ts +256 -0
- package/src/src/agent/runtime/project-skill-catalog.ts +238 -0
- package/src/src/agent/runtime/project-skill-loader.ts +217 -0
- package/src/src/agent/runtime/skill-metadata.ts +260 -0
- package/src/src/agent/runtime/skill-prompt.ts +61 -0
- package/src/src/agent/runtime/tool-inventory.ts +46 -0
- package/src/src/agent/runtime/upload-url-client.ts +95 -0
- package/src/src/agent/service/bootstrap.ts +79 -0
- package/src/src/agent/service/definition.ts +386 -0
- package/src/src/agent/service/env-files.ts +60 -0
- package/src/src/agent/service/mcp-server-config.ts +112 -0
- package/src/src/agent/service/node-runtime-infrastructure.ts +71 -0
- package/src/src/agent/service/registration.ts +320 -0
- package/src/src/agent/service/routes.ts +386 -0
- package/src/src/agent/service/runtime.ts +303 -0
- package/src/src/agent/service/server.ts +98 -0
- package/src/src/agent/veryfront-cloud-agent-service.ts +37 -115
- package/src/src/agent/veryfront-cloud-hosted-chat-execution-preparation.ts +3 -3
- package/src/src/agent/veryfront-cloud-prepared-hosted-chat-execution-runtime.ts +1 -1
- package/src/src/agent/veryfront-cloud-runtime-system-messages.ts +4 -4
- package/src/src/discovery/handlers/runtime-agent-markdown-handler.ts +2 -2
- package/src/src/internal-agents/ag-ui-sse.ts +2 -2
- package/src/src/internal-agents/run-stream.ts +1 -1
- package/src/src/internal-agents/schema.ts +2 -2
- package/src/src/tool/project-scoped-remote-tools.ts +23 -4
- package/src/src/utils/version-constant.ts +1 -1
- package/esm/src/agent/ag-ui-browser-chunk-encoder.d.ts +0 -14
- package/esm/src/agent/ag-ui-browser-chunk-encoder.d.ts.map +0 -1
- package/esm/src/agent/ag-ui-browser-chunk-encoder.js +0 -31
- package/esm/src/agent/ag-ui-browser-encoder.d.ts +0 -32
- package/esm/src/agent/ag-ui-browser-encoder.d.ts.map +0 -1
- package/esm/src/agent/ag-ui-browser-encoder.js +0 -405
- package/esm/src/agent/ag-ui-browser-finalize-tracker.d.ts +0 -12
- package/esm/src/agent/ag-ui-browser-finalize-tracker.d.ts.map +0 -1
- package/esm/src/agent/ag-ui-browser-finalize-tracker.js +0 -42
- package/esm/src/agent/ag-ui-browser-response-stream.d.ts +0 -28
- package/esm/src/agent/ag-ui-browser-response-stream.d.ts.map +0 -1
- package/esm/src/agent/ag-ui-chat-ui-chunk-browser-encoder.d.ts +0 -20
- package/esm/src/agent/ag-ui-chat-ui-chunk-browser-encoder.d.ts.map +0 -1
- package/esm/src/agent/ag-ui-chat-ui-chunk-browser-encoder.js +0 -108
- package/esm/src/agent/ag-ui-chunk-encoder-bridge.d.ts +0 -11
- package/esm/src/agent/ag-ui-chunk-encoder-bridge.d.ts.map +0 -1
- package/esm/src/agent/ag-ui-chunk-encoder-bridge.js +0 -9
- package/esm/src/agent/ag-ui-detached-start.d.ts +0 -158
- package/esm/src/agent/ag-ui-detached-start.d.ts.map +0 -1
- package/esm/src/agent/ag-ui-detached-start.js +0 -256
- package/esm/src/agent/ag-ui-forwarded-context.d.ts +0 -14
- package/esm/src/agent/ag-ui-forwarded-context.d.ts.map +0 -1
- package/esm/src/agent/ag-ui-forwarded-context.js +0 -56
- package/esm/src/agent/ag-ui-handler.d.ts +0 -14
- package/esm/src/agent/ag-ui-handler.d.ts.map +0 -1
- package/esm/src/agent/ag-ui-handler.js +0 -244
- package/esm/src/agent/ag-ui-host-support.d.ts +0 -131
- package/esm/src/agent/ag-ui-host-support.d.ts.map +0 -1
- package/esm/src/agent/ag-ui-host-support.js +0 -179
- package/esm/src/agent/ag-ui-request-shared.d.ts +0 -4
- package/esm/src/agent/ag-ui-request-shared.d.ts.map +0 -1
- package/esm/src/agent/ag-ui-request-shared.js +0 -56
- package/esm/src/agent/ag-ui-run-control.d.ts +0 -39
- package/esm/src/agent/ag-ui-run-control.d.ts.map +0 -1
- package/esm/src/agent/ag-ui-run-control.js +0 -84
- package/esm/src/agent/ag-ui-runtime-browser-response.d.ts +0 -18
- package/esm/src/agent/ag-ui-runtime-browser-response.d.ts.map +0 -1
- package/esm/src/agent/ag-ui-runtime-browser-response.js +0 -15
- package/esm/src/agent/ag-ui-runtime-chat-stream-encoder.d.ts +0 -17
- package/esm/src/agent/ag-ui-runtime-chat-stream-encoder.d.ts.map +0 -1
- package/esm/src/agent/ag-ui-runtime-chat-stream-encoder.js +0 -304
- package/esm/src/agent/ag-ui-runtime-event-encoder.d.ts +0 -11
- package/esm/src/agent/ag-ui-runtime-event-encoder.d.ts.map +0 -1
- package/esm/src/agent/ag-ui-runtime-event-encoder.js +0 -37
- package/esm/src/agent/ag-ui-runtime-handler.d.ts +0 -44
- package/esm/src/agent/ag-ui-runtime-handler.d.ts.map +0 -1
- package/esm/src/agent/ag-ui-runtime-handler.js +0 -301
- package/esm/src/agent/ag-ui-runtime-support.d.ts +0 -4
- package/esm/src/agent/ag-ui-runtime-support.d.ts.map +0 -1
- package/esm/src/agent/ag-ui-sse-parser.d.ts +0 -57
- package/esm/src/agent/ag-ui-sse-parser.d.ts.map +0 -1
- package/esm/src/agent/ag-ui-sse-parser.js +0 -227
- package/esm/src/agent/ag-ui-tool-shared.d.ts +0 -15
- package/esm/src/agent/ag-ui-tool-shared.d.ts.map +0 -1
- package/esm/src/agent/ag-ui-tool-shared.js +0 -48
- package/esm/src/agent/ag-ui-tracked-browser-response.d.ts +0 -9
- package/esm/src/agent/ag-ui-tracked-browser-response.d.ts.map +0 -1
- package/esm/src/agent/ag-ui-tracked-browser-response.js +0 -19
- package/esm/src/agent/agent-service-auth.d.ts +0 -81
- package/esm/src/agent/agent-service-auth.d.ts.map +0 -1
- package/esm/src/agent/agent-service-bootstrap.d.ts +0 -23
- package/esm/src/agent/agent-service-bootstrap.d.ts.map +0 -1
- package/esm/src/agent/agent-service-bootstrap.js +0 -38
- package/esm/src/agent/agent-service-config.d.ts +0 -140
- package/esm/src/agent/agent-service-config.d.ts.map +0 -1
- package/esm/src/agent/agent-service-env-files.d.ts +0 -13
- package/esm/src/agent/agent-service-env-files.d.ts.map +0 -1
- package/esm/src/agent/agent-service-env-files.js +0 -34
- package/esm/src/agent/agent-service-mcp-server-config.d.ts +0 -33
- package/esm/src/agent/agent-service-mcp-server-config.d.ts.map +0 -1
- package/esm/src/agent/agent-service-mcp-server-config.js +0 -49
- package/esm/src/agent/agent-service-registration.d.ts +0 -110
- package/esm/src/agent/agent-service-registration.d.ts.map +0 -1
- package/esm/src/agent/agent-service-registration.js +0 -228
- package/esm/src/agent/agent-service-routes.d.ts +0 -81
- package/esm/src/agent/agent-service-routes.d.ts.map +0 -1
- package/esm/src/agent/agent-service-routes.js +0 -204
- package/esm/src/agent/agent-service-runtime.d.ts +0 -73
- package/esm/src/agent/agent-service-runtime.d.ts.map +0 -1
- package/esm/src/agent/agent-service-runtime.js +0 -118
- package/esm/src/agent/agent-service-server.d.ts +0 -30
- package/esm/src/agent/agent-service-server.d.ts.map +0 -1
- package/esm/src/agent/agent-service-server.js +0 -47
- package/esm/src/agent/agent-service.d.ts +0 -87
- package/esm/src/agent/agent-service.d.ts.map +0 -1
- package/esm/src/agent/child-run-execution-cleanup.d.ts +0 -14
- package/esm/src/agent/child-run-execution-cleanup.d.ts.map +0 -1
- package/esm/src/agent/child-run-execution-snapshot.d.ts +0 -70
- package/esm/src/agent/child-run-execution-snapshot.d.ts.map +0 -1
- package/esm/src/agent/child-run-execution-support.d.ts +0 -5
- package/esm/src/agent/child-run-execution-support.d.ts.map +0 -1
- package/esm/src/agent/child-run-final-step-support.d.ts +0 -18
- package/esm/src/agent/child-run-final-step-support.d.ts.map +0 -1
- package/esm/src/agent/child-run-result-summary.d.ts +0 -14
- package/esm/src/agent/child-run-result-summary.d.ts.map +0 -1
- package/esm/src/agent/conversation-bootstrap.d.ts +0 -94
- package/esm/src/agent/conversation-bootstrap.d.ts.map +0 -1
- package/esm/src/agent/conversation-bootstrap.js +0 -210
- package/esm/src/agent/conversation-delegation-policy.d.ts +0 -53
- package/esm/src/agent/conversation-delegation-policy.d.ts.map +0 -1
- package/esm/src/agent/conversation-delegation-policy.js +0 -192
- package/esm/src/agent/conversation-hosted-lifecycle.d.ts +0 -39
- package/esm/src/agent/conversation-hosted-lifecycle.d.ts.map +0 -1
- package/esm/src/agent/conversation-hosted-lifecycle.js +0 -138
- package/esm/src/agent/conversation-hosted-terminal.d.ts +0 -46
- package/esm/src/agent/conversation-hosted-terminal.d.ts.map +0 -1
- package/esm/src/agent/conversation-hosted-terminal.js +0 -138
- package/esm/src/agent/conversation-root-run-context.d.ts +0 -57
- package/esm/src/agent/conversation-root-run-context.d.ts.map +0 -1
- package/esm/src/agent/conversation-root-run-context.js +0 -79
- package/esm/src/agent/conversation-root-run-lifecycle.d.ts +0 -61
- package/esm/src/agent/conversation-root-run-lifecycle.d.ts.map +0 -1
- package/esm/src/agent/conversation-root-run-lifecycle.js +0 -94
- package/esm/src/agent/conversation-run-chunk-mirror.d.ts +0 -74
- package/esm/src/agent/conversation-run-chunk-mirror.d.ts.map +0 -1
- package/esm/src/agent/conversation-run-chunk-mirror.js +0 -188
- package/esm/src/agent/conversation-run-context.d.ts +0 -19
- package/esm/src/agent/conversation-run-context.d.ts.map +0 -1
- package/esm/src/agent/conversation-run-event-normalization.d.ts +0 -8
- package/esm/src/agent/conversation-run-event-normalization.d.ts.map +0 -1
- package/esm/src/agent/conversation-run-event-preparation.d.ts +0 -7
- package/esm/src/agent/conversation-run-event-preparation.d.ts.map +0 -1
- package/esm/src/agent/conversation-run-event-preparation.js +0 -48
- package/esm/src/agent/conversation-run-events.d.ts +0 -34
- package/esm/src/agent/conversation-run-events.d.ts.map +0 -1
- package/esm/src/agent/conversation-run-events.js +0 -200
- package/esm/src/agent/conversation-run-mirror.d.ts +0 -43
- package/esm/src/agent/conversation-run-mirror.d.ts.map +0 -1
- package/esm/src/agent/conversation-run-mirror.js +0 -157
- package/esm/src/agent/conversation-run-stream-mirror.d.ts +0 -21
- package/esm/src/agent/conversation-run-stream-mirror.d.ts.map +0 -1
- package/esm/src/agent/conversation-run-stream-mirror.js +0 -31
- package/esm/src/agent/hosted-ag-ui-chat-request.d.ts +0 -56
- package/esm/src/agent/hosted-ag-ui-chat-request.d.ts.map +0 -1
- package/esm/src/agent/hosted-ag-ui-chat-request.js +0 -112
- package/esm/src/agent/hosted-agent-project-steering.d.ts +0 -33
- package/esm/src/agent/hosted-agent-project-steering.d.ts.map +0 -1
- package/esm/src/agent/hosted-agent-project-steering.js +0 -73
- package/esm/src/agent/hosted-agent-run-lifecycle.d.ts +0 -60
- package/esm/src/agent/hosted-agent-run-lifecycle.d.ts.map +0 -1
- package/esm/src/agent/hosted-agent-run-lifecycle.js +0 -72
- package/esm/src/agent/hosted-chat-execution-runtime.d.ts +0 -127
- package/esm/src/agent/hosted-chat-execution-runtime.d.ts.map +0 -1
- package/esm/src/agent/hosted-chat-execution-runtime.js +0 -400
- package/esm/src/agent/hosted-chat-preparation.d.ts +0 -105
- package/esm/src/agent/hosted-chat-preparation.d.ts.map +0 -1
- package/esm/src/agent/hosted-chat-preparation.js +0 -156
- package/esm/src/agent/hosted-chat-request-parser.d.ts +0 -53
- package/esm/src/agent/hosted-chat-request-parser.d.ts.map +0 -1
- package/esm/src/agent/hosted-chat-request-parser.js +0 -105
- package/esm/src/agent/hosted-chat-request.d.ts +0 -305
- package/esm/src/agent/hosted-chat-request.d.ts.map +0 -1
- package/esm/src/agent/hosted-chat-request.js +0 -68
- package/esm/src/agent/hosted-chat-runtime-agent-adapter.d.ts +0 -14
- package/esm/src/agent/hosted-chat-runtime-agent-adapter.d.ts.map +0 -1
- package/esm/src/agent/hosted-chat-runtime-agent-adapter.js +0 -48
- package/esm/src/agent/hosted-chat-runtime-contract.d.ts +0 -86
- package/esm/src/agent/hosted-chat-runtime-contract.d.ts.map +0 -1
- package/esm/src/agent/hosted-chat-runtime-tool-assembly.d.ts +0 -51
- package/esm/src/agent/hosted-chat-runtime-tool-assembly.d.ts.map +0 -1
- package/esm/src/agent/hosted-chat-runtime-tool-assembly.js +0 -84
- package/esm/src/agent/hosted-child-artifact-support.d.ts +0 -25
- package/esm/src/agent/hosted-child-artifact-support.d.ts.map +0 -1
- package/esm/src/agent/hosted-child-artifact-support.js +0 -121
- package/esm/src/agent/hosted-child-bootstrap.d.ts +0 -40
- package/esm/src/agent/hosted-child-bootstrap.d.ts.map +0 -1
- package/esm/src/agent/hosted-child-bootstrap.js +0 -44
- package/esm/src/agent/hosted-child-execution-logging.d.ts +0 -35
- package/esm/src/agent/hosted-child-execution-logging.d.ts.map +0 -1
- package/esm/src/agent/hosted-child-execution-logging.js +0 -69
- package/esm/src/agent/hosted-child-fork-execution-runner.d.ts +0 -101
- package/esm/src/agent/hosted-child-fork-execution-runner.d.ts.map +0 -1
- package/esm/src/agent/hosted-child-fork-execution-runner.js +0 -205
- package/esm/src/agent/hosted-child-fork-instructions.d.ts +0 -8
- package/esm/src/agent/hosted-child-fork-instructions.d.ts.map +0 -1
- package/esm/src/agent/hosted-child-fork-run-context.d.ts +0 -88
- package/esm/src/agent/hosted-child-fork-run-context.d.ts.map +0 -1
- package/esm/src/agent/hosted-child-fork-run-context.js +0 -144
- package/esm/src/agent/hosted-child-fork-runtime-start.d.ts +0 -18
- package/esm/src/agent/hosted-child-fork-runtime-start.d.ts.map +0 -1
- package/esm/src/agent/hosted-child-fork-runtime-start.js +0 -41
- package/esm/src/agent/hosted-child-fork-step-message-preparation.d.ts +0 -19
- package/esm/src/agent/hosted-child-fork-step-message-preparation.d.ts.map +0 -1
- package/esm/src/agent/hosted-child-fork-step-message-preparation.js +0 -52
- package/esm/src/agent/hosted-child-fork-stream-execution.d.ts +0 -153
- package/esm/src/agent/hosted-child-fork-stream-execution.d.ts.map +0 -1
- package/esm/src/agent/hosted-child-fork-stream-execution.js +0 -416
- package/esm/src/agent/hosted-child-fork-tool-sources.d.ts +0 -46
- package/esm/src/agent/hosted-child-fork-tool-sources.d.ts.map +0 -1
- package/esm/src/agent/hosted-child-fork-tool-sources.js +0 -124
- package/esm/src/agent/hosted-child-invoke-tool.d.ts +0 -20
- package/esm/src/agent/hosted-child-invoke-tool.d.ts.map +0 -1
- package/esm/src/agent/hosted-child-invoke-tool.js +0 -49
- package/esm/src/agent/hosted-child-lifecycle.d.ts +0 -63
- package/esm/src/agent/hosted-child-lifecycle.d.ts.map +0 -1
- package/esm/src/agent/hosted-child-lifecycle.js +0 -192
- package/esm/src/agent/hosted-child-mirror.d.ts +0 -108
- package/esm/src/agent/hosted-child-mirror.d.ts.map +0 -1
- package/esm/src/agent/hosted-child-pending-tool-lifecycle.d.ts +0 -50
- package/esm/src/agent/hosted-child-pending-tool-lifecycle.d.ts.map +0 -1
- package/esm/src/agent/hosted-child-pending-tool-lifecycle.js +0 -119
- package/esm/src/agent/hosted-child-requested-tools.d.ts +0 -109
- package/esm/src/agent/hosted-child-requested-tools.d.ts.map +0 -1
- package/esm/src/agent/hosted-child-requested-tools.js +0 -233
- package/esm/src/agent/hosted-child-status.d.ts +0 -39
- package/esm/src/agent/hosted-child-status.d.ts.map +0 -1
- package/esm/src/agent/hosted-child-status.js +0 -98
- package/esm/src/agent/hosted-child-steering-tools.d.ts +0 -20
- package/esm/src/agent/hosted-child-steering-tools.d.ts.map +0 -1
- package/esm/src/agent/hosted-child-steering-tools.js +0 -53
- package/esm/src/agent/hosted-child-stream-watchdog.d.ts +0 -27
- package/esm/src/agent/hosted-child-stream-watchdog.d.ts.map +0 -1
- package/esm/src/agent/hosted-child-stream-watchdog.js +0 -95
- package/esm/src/agent/hosted-child-tool-input.d.ts +0 -44
- package/esm/src/agent/hosted-child-tool-input.d.ts.map +0 -1
- package/esm/src/agent/hosted-child-tool-input.js +0 -44
- package/esm/src/agent/hosted-durable-chat-run-start.d.ts +0 -46
- package/esm/src/agent/hosted-durable-chat-run-start.d.ts.map +0 -1
- package/esm/src/agent/hosted-durable-chat-run-start.js +0 -148
- package/esm/src/agent/hosted-durable-child-fork-execution.d.ts +0 -159
- package/esm/src/agent/hosted-durable-child-fork-execution.d.ts.map +0 -1
- package/esm/src/agent/hosted-durable-child-fork-execution.js +0 -324
- package/esm/src/agent/hosted-finalized-message.d.ts +0 -44
- package/esm/src/agent/hosted-finalized-message.d.ts.map +0 -1
- package/esm/src/agent/hosted-finalized-message.js +0 -67
- package/esm/src/agent/hosted-form-input-tool.d.ts +0 -85
- package/esm/src/agent/hosted-form-input-tool.d.ts.map +0 -1
- package/esm/src/agent/hosted-form-input-tool.js +0 -88
- package/esm/src/agent/hosted-lifecycle.d.ts +0 -41
- package/esm/src/agent/hosted-lifecycle.d.ts.map +0 -1
- package/esm/src/agent/hosted-project-remote-tool-source.d.ts +0 -45
- package/esm/src/agent/hosted-project-remote-tool-source.d.ts.map +0 -1
- package/esm/src/agent/hosted-project-remote-tool-source.js +0 -135
- package/esm/src/agent/hosted-project-steering-adapter.d.ts +0 -34
- package/esm/src/agent/hosted-project-steering-adapter.d.ts.map +0 -1
- package/esm/src/agent/hosted-project-steering-adapter.js +0 -82
- package/esm/src/agent/hosted-response-stream.d.ts +0 -22
- package/esm/src/agent/hosted-response-stream.d.ts.map +0 -1
- package/esm/src/agent/hosted-response-stream.js +0 -52
- package/esm/src/agent/hosted-runtime-request-config.d.ts +0 -27
- package/esm/src/agent/hosted-runtime-request-config.d.ts.map +0 -1
- package/esm/src/agent/hosted-runtime-request-config.js +0 -54
- package/esm/src/agent/hosted-runtime-state-resolver.d.ts +0 -28
- package/esm/src/agent/hosted-runtime-state-resolver.d.ts.map +0 -1
- package/esm/src/agent/hosted-runtime-state-resolver.js +0 -71
- package/esm/src/agent/hosted-stream-finalization.d.ts +0 -61
- package/esm/src/agent/hosted-stream-finalization.d.ts.map +0 -1
- package/esm/src/agent/hosted-stream-terminal-error.d.ts +0 -16
- package/esm/src/agent/hosted-stream-terminal-error.d.ts.map +0 -1
- package/esm/src/agent/hosted-stream-terminal-error.js +0 -54
- package/esm/src/agent/node-agent-service-runtime-infrastructure.d.ts +0 -26
- package/esm/src/agent/node-agent-service-runtime-infrastructure.d.ts.map +0 -1
- package/esm/src/agent/node-agent-service-runtime-infrastructure.js +0 -30
- package/esm/src/agent/node-agent-service-telemetry.d.ts +0 -44
- package/esm/src/agent/node-agent-service-telemetry.d.ts.map +0 -1
- package/esm/src/agent/runtime-ag-ui-contract.d.ts +0 -213
- package/esm/src/agent/runtime-ag-ui-contract.d.ts.map +0 -1
- package/esm/src/agent/runtime-ag-ui-contract.js +0 -134
- package/esm/src/agent/runtime-agent-definition-files.d.ts +0 -23
- package/esm/src/agent/runtime-agent-definition-files.d.ts.map +0 -1
- package/esm/src/agent/runtime-agent-definition-files.js +0 -79
- package/esm/src/agent/runtime-agent-definition.d.ts +0 -60
- package/esm/src/agent/runtime-agent-definition.d.ts.map +0 -1
- package/esm/src/agent/runtime-agent-definition.js +0 -105
- package/esm/src/agent/runtime-agent-invocation-contract.d.ts +0 -326
- package/esm/src/agent/runtime-agent-invocation-contract.d.ts.map +0 -1
- package/esm/src/agent/runtime-agent-invocation-contract.js +0 -212
- package/esm/src/agent/runtime-agent-markdown-adapter.d.ts +0 -6
- package/esm/src/agent/runtime-agent-markdown-adapter.d.ts.map +0 -1
- package/esm/src/agent/runtime-agent-markdown-adapter.js +0 -20
- package/esm/src/agent/runtime-builtin-skill-files.d.ts +0 -18
- package/esm/src/agent/runtime-builtin-skill-files.d.ts.map +0 -1
- package/esm/src/agent/runtime-builtin-skill-files.js +0 -82
- package/esm/src/agent/runtime-client-profile.d.ts +0 -26
- package/esm/src/agent/runtime-client-profile.d.ts.map +0 -1
- package/esm/src/agent/runtime-client-profile.js +0 -82
- package/esm/src/agent/runtime-load-skill-tool.d.ts +0 -43
- package/esm/src/agent/runtime-load-skill-tool.d.ts.map +0 -1
- package/esm/src/agent/runtime-load-skill-tool.js +0 -115
- package/esm/src/agent/runtime-message-file-url-refresh.d.ts +0 -9
- package/esm/src/agent/runtime-message-file-url-refresh.d.ts.map +0 -1
- package/esm/src/agent/runtime-message-preparation.d.ts +0 -10
- package/esm/src/agent/runtime-message-preparation.d.ts.map +0 -1
- package/esm/src/agent/runtime-message-preparation.js +0 -34
- package/esm/src/agent/runtime-project-files-client.d.ts +0 -50
- package/esm/src/agent/runtime-project-files-client.d.ts.map +0 -1
- package/esm/src/agent/runtime-project-files-client.js +0 -143
- package/esm/src/agent/runtime-project-skill-catalog.d.ts +0 -26
- package/esm/src/agent/runtime-project-skill-catalog.d.ts.map +0 -1
- package/esm/src/agent/runtime-project-skill-catalog.js +0 -148
- package/esm/src/agent/runtime-project-skill-loader.d.ts +0 -28
- package/esm/src/agent/runtime-project-skill-loader.d.ts.map +0 -1
- package/esm/src/agent/runtime-project-skill-loader.js +0 -122
- package/esm/src/agent/runtime-prompt-block.d.ts +0 -7
- package/esm/src/agent/runtime-prompt-block.d.ts.map +0 -1
- package/esm/src/agent/runtime-skill-metadata.d.ts +0 -75
- package/esm/src/agent/runtime-skill-metadata.d.ts.map +0 -1
- package/esm/src/agent/runtime-skill-metadata.js +0 -159
- package/esm/src/agent/runtime-skill-prompt.d.ts +0 -5
- package/esm/src/agent/runtime-skill-prompt.d.ts.map +0 -1
- package/esm/src/agent/runtime-skill-prompt.js +0 -40
- package/esm/src/agent/runtime-tool-inventory.d.ts +0 -4
- package/esm/src/agent/runtime-tool-inventory.d.ts.map +0 -1
- package/esm/src/agent/runtime-upload-url-client.d.ts +0 -13
- package/esm/src/agent/runtime-upload-url-client.d.ts.map +0 -1
- package/esm/src/agent/runtime-upload-url-client.js +0 -54
- package/src/deps/esm.sh/@types/react@19.2.3/global.d.ts +0 -165
- package/src/deps/esm.sh/@types/react@19.2.3/index.d.ts +0 -4301
- package/src/src/agent/ag-ui-browser-chunk-encoder.ts +0 -58
- package/src/src/agent/ag-ui-browser-encoder.ts +0 -538
- package/src/src/agent/ag-ui-browser-finalize-tracker.ts +0 -65
- package/src/src/agent/ag-ui-browser-response-stream.ts +0 -175
- package/src/src/agent/ag-ui-chat-ui-chunk-browser-encoder.ts +0 -172
- package/src/src/agent/ag-ui-chunk-encoder-bridge.ts +0 -34
- package/src/src/agent/ag-ui-detached-start.ts +0 -425
- package/src/src/agent/ag-ui-forwarded-context.ts +0 -83
- package/src/src/agent/ag-ui-handler.ts +0 -388
- package/src/src/agent/ag-ui-host-support.ts +0 -244
- package/src/src/agent/ag-ui-request-shared.ts +0 -76
- package/src/src/agent/ag-ui-run-control.ts +0 -145
- package/src/src/agent/ag-ui-runtime-browser-response.ts +0 -41
- package/src/src/agent/ag-ui-runtime-chat-stream-encoder.ts +0 -359
- package/src/src/agent/ag-ui-runtime-event-encoder.ts +0 -71
- package/src/src/agent/ag-ui-runtime-handler.ts +0 -510
- package/src/src/agent/ag-ui-runtime-support.ts +0 -64
- package/src/src/agent/ag-ui-sse-parser.ts +0 -306
- package/src/src/agent/ag-ui-tool-shared.ts +0 -80
- package/src/src/agent/ag-ui-tracked-browser-response.ts +0 -42
- package/src/src/agent/agent-service-bootstrap.ts +0 -79
- package/src/src/agent/agent-service-env-files.ts +0 -60
- package/src/src/agent/agent-service-mcp-server-config.ts +0 -112
- package/src/src/agent/agent-service-registration.ts +0 -320
- package/src/src/agent/agent-service-routes.ts +0 -389
- package/src/src/agent/agent-service-runtime.ts +0 -303
- package/src/src/agent/agent-service-server.ts +0 -98
- package/src/src/agent/agent-service.ts +0 -386
- package/src/src/agent/conversation-bootstrap.ts +0 -335
- package/src/src/agent/conversation-delegation-policy.ts +0 -299
- package/src/src/agent/conversation-hosted-lifecycle.ts +0 -215
- package/src/src/agent/conversation-hosted-terminal.ts +0 -235
- package/src/src/agent/conversation-root-run-context.ts +0 -143
- package/src/src/agent/conversation-root-run-lifecycle.ts +0 -184
- package/src/src/agent/conversation-run-chunk-mirror.ts +0 -353
- package/src/src/agent/conversation-run-context.ts +0 -22
- package/src/src/agent/conversation-run-event-preparation.ts +0 -76
- package/src/src/agent/conversation-run-events.ts +0 -242
- package/src/src/agent/conversation-run-mirror.ts +0 -235
- package/src/src/agent/conversation-run-stream-mirror.ts +0 -59
- package/src/src/agent/hosted-ag-ui-chat-request.ts +0 -197
- package/src/src/agent/hosted-agent-project-steering.ts +0 -129
- package/src/src/agent/hosted-agent-run-lifecycle.ts +0 -161
- package/src/src/agent/hosted-chat-execution-runtime.ts +0 -703
- package/src/src/agent/hosted-chat-preparation.ts +0 -357
- package/src/src/agent/hosted-chat-request-parser.ts +0 -209
- package/src/src/agent/hosted-chat-request.ts +0 -112
- package/src/src/agent/hosted-chat-runtime-agent-adapter.ts +0 -88
- package/src/src/agent/hosted-chat-runtime-contract.ts +0 -101
- package/src/src/agent/hosted-chat-runtime-tool-assembly.ts +0 -183
- package/src/src/agent/hosted-child-artifact-support.ts +0 -201
- package/src/src/agent/hosted-child-bootstrap.ts +0 -75
- package/src/src/agent/hosted-child-execution-logging.ts +0 -114
- package/src/src/agent/hosted-child-fork-execution-runner.ts +0 -393
- package/src/src/agent/hosted-child-fork-run-context.ts +0 -312
- package/src/src/agent/hosted-child-fork-runtime-start.ts +0 -84
- package/src/src/agent/hosted-child-fork-step-message-preparation.ts +0 -96
- package/src/src/agent/hosted-child-fork-stream-execution.ts +0 -626
- package/src/src/agent/hosted-child-fork-tool-sources.ts +0 -223
- package/src/src/agent/hosted-child-invoke-tool.ts +0 -90
- package/src/src/agent/hosted-child-lifecycle.ts +0 -352
- package/src/src/agent/hosted-child-mirror.ts +0 -272
- package/src/src/agent/hosted-child-pending-tool-lifecycle.ts +0 -191
- package/src/src/agent/hosted-child-requested-tools.ts +0 -411
- package/src/src/agent/hosted-child-status.ts +0 -167
- package/src/src/agent/hosted-child-steering-tools.ts +0 -92
- package/src/src/agent/hosted-child-stream-watchdog.ts +0 -146
- package/src/src/agent/hosted-child-tool-input.ts +0 -91
- package/src/src/agent/hosted-durable-chat-run-start.ts +0 -246
- package/src/src/agent/hosted-durable-child-fork-execution.ts +0 -597
- package/src/src/agent/hosted-finalized-message.ts +0 -170
- package/src/src/agent/hosted-form-input-tool.ts +0 -128
- package/src/src/agent/hosted-project-remote-tool-source.ts +0 -262
- package/src/src/agent/hosted-project-steering-adapter.ts +0 -184
- package/src/src/agent/hosted-response-stream.ts +0 -87
- package/src/src/agent/hosted-runtime-request-config.ts +0 -112
- package/src/src/agent/hosted-runtime-state-resolver.ts +0 -133
- package/src/src/agent/hosted-stream-finalization.ts +0 -188
- package/src/src/agent/hosted-stream-terminal-error.ts +0 -81
- package/src/src/agent/node-agent-service-runtime-infrastructure.ts +0 -71
- package/src/src/agent/runtime-ag-ui-contract.ts +0 -216
- package/src/src/agent/runtime-agent-definition-files.ts +0 -128
- package/src/src/agent/runtime-agent-definition.ts +0 -163
- package/src/src/agent/runtime-agent-invocation-contract.ts +0 -355
- package/src/src/agent/runtime-agent-markdown-adapter.ts +0 -31
- package/src/src/agent/runtime-builtin-skill-files.ts +0 -122
- package/src/src/agent/runtime-client-profile.ts +0 -123
- package/src/src/agent/runtime-load-skill-tool.ts +0 -239
- package/src/src/agent/runtime-message-file-url-refresh.ts +0 -120
- package/src/src/agent/runtime-message-preparation.ts +0 -58
- package/src/src/agent/runtime-project-files-client.ts +0 -256
- package/src/src/agent/runtime-project-skill-catalog.ts +0 -238
- package/src/src/agent/runtime-project-skill-loader.ts +0 -217
- package/src/src/agent/runtime-skill-metadata.ts +0 -260
- package/src/src/agent/runtime-skill-prompt.ts +0 -61
- package/src/src/agent/runtime-tool-inventory.ts +0 -46
- package/src/src/agent/runtime-upload-url-client.ts +0 -95
- /package/esm/src/agent/{ag-ui-browser-response-stream.js → ag-ui/browser-response-stream.js} +0 -0
- /package/esm/src/agent/{ag-ui-runtime-support.js → ag-ui/runtime-support.js} +0 -0
- /package/esm/src/agent/{child-run-execution-cleanup.js → child-run/execution-cleanup.js} +0 -0
- /package/esm/src/agent/{child-run-execution-snapshot.js → child-run/execution-snapshot.js} +0 -0
- /package/esm/src/agent/{child-run-execution-support.js → child-run/execution-support.js} +0 -0
- /package/esm/src/agent/{child-run-final-step-support.js → child-run/final-step-support.js} +0 -0
- /package/esm/src/agent/{child-run-result-summary.js → child-run/result-summary.js} +0 -0
- /package/esm/src/agent/{conversation-run-context.js → conversation/run-context.js} +0 -0
- /package/esm/src/agent/{conversation-run-event-normalization.js → conversation/run-event-normalization.js} +0 -0
- /package/esm/src/agent/{hosted-chat-runtime-contract.js → hosted/chat-runtime-contract.js} +0 -0
- /package/esm/src/agent/{hosted-child-fork-instructions.js → hosted/child-fork-instructions.js} +0 -0
- /package/esm/src/agent/{hosted-child-mirror.js → hosted/child-mirror.js} +0 -0
- /package/esm/src/agent/{hosted-lifecycle.js → hosted/lifecycle.js} +0 -0
- /package/esm/src/agent/{hosted-stream-finalization.js → hosted/stream-finalization.js} +0 -0
- /package/esm/src/agent/{runtime-message-file-url-refresh.js → runtime/message-file-url-refresh.js} +0 -0
- /package/esm/src/agent/{runtime-prompt-block.js → runtime/prompt-block.js} +0 -0
- /package/esm/src/agent/{runtime-tool-inventory.js → runtime/tool-inventory.js} +0 -0
- /package/esm/src/agent/{agent-service-auth.js → service/auth.js} +0 -0
- /package/esm/src/agent/{agent-service-config.js → service/config.js} +0 -0
- /package/esm/src/agent/{agent-service.js → service/definition.js} +0 -0
- /package/esm/src/agent/{node-agent-service-telemetry.js → service/node-telemetry.js} +0 -0
- /package/src/src/agent/{child-run-execution-cleanup.ts → child-run/execution-cleanup.ts} +0 -0
- /package/src/src/agent/{child-run-execution-snapshot.ts → child-run/execution-snapshot.ts} +0 -0
- /package/src/src/agent/{child-run-execution-support.ts → child-run/execution-support.ts} +0 -0
- /package/src/src/agent/{child-run-final-step-support.ts → child-run/final-step-support.ts} +0 -0
- /package/src/src/agent/{child-run-result-summary.ts → child-run/result-summary.ts} +0 -0
- /package/src/src/agent/{conversation-run-event-normalization.ts → conversation/run-event-normalization.ts} +0 -0
- /package/src/src/agent/{hosted-child-fork-instructions.ts → hosted/child-fork-instructions.ts} +0 -0
- /package/src/src/agent/{hosted-lifecycle.ts → hosted/lifecycle.ts} +0 -0
- /package/src/src/agent/{runtime-prompt-block.ts → runtime/prompt-block.ts} +0 -0
- /package/src/src/agent/{agent-service-auth.ts → service/auth.ts} +0 -0
- /package/src/src/agent/{agent-service-config.ts → service/config.ts} +0 -0
- /package/src/src/agent/{node-agent-service-telemetry.ts → service/node-telemetry.ts} +0 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { createConversationAgentRun } from "../durable.js";
|
|
2
|
+
function normalizeProvidedRun(input) {
|
|
3
|
+
return {
|
|
4
|
+
runId: input.providedRun.runId,
|
|
5
|
+
conversationId: input.conversationId,
|
|
6
|
+
messageId: input.providedRun.messageId,
|
|
7
|
+
latestEventId: input.providedRun.latestEventId ?? 0,
|
|
8
|
+
latestExternalEventSequence: input.providedRun.latestExternalEventSequence ?? 0,
|
|
9
|
+
waitingToolCallId: null,
|
|
10
|
+
waitingToolName: null,
|
|
11
|
+
status: "running",
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
function createMirrorPublisher(appendEvents) {
|
|
15
|
+
return appendEvents ? (events) => appendEvents(events) : undefined;
|
|
16
|
+
}
|
|
17
|
+
export function createConversationRootRunContext(input) {
|
|
18
|
+
return {
|
|
19
|
+
run: input.run,
|
|
20
|
+
effectiveParentRunId: input.run?.runId ?? input.parentRunId,
|
|
21
|
+
effectiveParentMessageId: input.run?.messageId ?? input.parentMessageId,
|
|
22
|
+
publishParentRunEvents: createMirrorPublisher(input.appendParentRunEvents),
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export async function startConversationRootRun(input) {
|
|
26
|
+
if (input.providedRun) {
|
|
27
|
+
if (!input.conversationId) {
|
|
28
|
+
throw new Error("CONVERSATION_ROOT_RUN_REQUIRES_CONVERSATION");
|
|
29
|
+
}
|
|
30
|
+
return normalizeProvidedRun({
|
|
31
|
+
conversationId: input.conversationId,
|
|
32
|
+
providedRun: input.providedRun,
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
if (!input.conversationId) {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
return createConversationAgentRun({
|
|
39
|
+
authToken: input.authToken,
|
|
40
|
+
apiUrl: input.apiUrl,
|
|
41
|
+
conversationId: input.conversationId,
|
|
42
|
+
projectId: input.projectId ?? null,
|
|
43
|
+
branchId: input.branchId,
|
|
44
|
+
agentId: input.agentId,
|
|
45
|
+
implementationKind: input.implementationKind,
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
export function createConversationRootRunStartAdapter(input) {
|
|
49
|
+
return async () => ({
|
|
50
|
+
run: await startConversationRootRun({
|
|
51
|
+
authToken: input.authToken,
|
|
52
|
+
apiUrl: input.apiUrl,
|
|
53
|
+
conversationId: input.conversationId,
|
|
54
|
+
projectId: input.projectId,
|
|
55
|
+
branchId: input.branchId,
|
|
56
|
+
agentId: input.agentId,
|
|
57
|
+
implementationKind: input.implementationKind,
|
|
58
|
+
providedRun: input.providedRun,
|
|
59
|
+
}),
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
export async function prepareConversationRootRunContext(input) {
|
|
63
|
+
const { run } = await createConversationRootRunStartAdapter({
|
|
64
|
+
authToken: input.authToken,
|
|
65
|
+
apiUrl: input.apiUrl,
|
|
66
|
+
conversationId: input.conversationId,
|
|
67
|
+
projectId: input.projectId,
|
|
68
|
+
branchId: input.branchId,
|
|
69
|
+
agentId: input.agentId,
|
|
70
|
+
implementationKind: input.implementationKind,
|
|
71
|
+
providedRun: input.providedRun,
|
|
72
|
+
})({ abortSignal: new AbortController().signal });
|
|
73
|
+
return createConversationRootRunContext({
|
|
74
|
+
run,
|
|
75
|
+
parentRunId: input.parentRunId,
|
|
76
|
+
parentMessageId: input.parentMessageId,
|
|
77
|
+
appendParentRunEvents: input.appendParentRunEvents,
|
|
78
|
+
});
|
|
79
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { type ConversationRootRunContext, type ConversationRootRunDescriptor } from "./root-run-context.js";
|
|
2
|
+
import { persistLatestConversationUserMessage } from "./bootstrap.js";
|
|
3
|
+
import { type ConversationRunChunkMirror, type HostedConversationRunChunkMirrorInstrumentation } from "./run-chunk-mirror.js";
|
|
4
|
+
import { type ConversationRunEvent } from "./run-events.js";
|
|
5
|
+
import type { ConversationRunProjection } from "../durable.js";
|
|
6
|
+
import type { ChatUiMessage } from "../../chat/types.js";
|
|
7
|
+
export interface ConversationRootRunLifecycle<TMirror> extends ConversationRootRunContext {
|
|
8
|
+
mirror: TMirror | null;
|
|
9
|
+
}
|
|
10
|
+
export interface PrepareConversationRootRunLifecycleOptions<TMirror> {
|
|
11
|
+
startRun: (input: {
|
|
12
|
+
abortSignal: AbortSignal;
|
|
13
|
+
}) => Promise<{
|
|
14
|
+
run: ConversationRunProjection | null;
|
|
15
|
+
}> | {
|
|
16
|
+
run: ConversationRunProjection | null;
|
|
17
|
+
};
|
|
18
|
+
parentRunId?: string;
|
|
19
|
+
parentMessageId?: string;
|
|
20
|
+
appendParentRunEvents?: ((events: unknown[]) => Promise<void> | void) | undefined;
|
|
21
|
+
createMirror?: (run: ConversationRunProjection) => Promise<TMirror> | TMirror;
|
|
22
|
+
}
|
|
23
|
+
export declare function prepareConversationRootRunLifecycle<TMirror>(input: PrepareConversationRootRunLifecycleOptions<TMirror>, options: {
|
|
24
|
+
abortSignal: AbortSignal;
|
|
25
|
+
}): Promise<ConversationRootRunLifecycle<TMirror>>;
|
|
26
|
+
export interface HostedConversationRootRunState {
|
|
27
|
+
runId: string;
|
|
28
|
+
conversationId: string;
|
|
29
|
+
messageId: string;
|
|
30
|
+
latestEventId: number;
|
|
31
|
+
latestExternalEventSequence: number;
|
|
32
|
+
}
|
|
33
|
+
export interface HostedConversationRootRunContext {
|
|
34
|
+
durableRootRun: HostedConversationRootRunState | null;
|
|
35
|
+
durableRunMirror: ConversationRunChunkMirror | null;
|
|
36
|
+
effectiveParentRunId?: string;
|
|
37
|
+
effectiveParentMessageId?: string;
|
|
38
|
+
publishParentRunEvents?: (events: ConversationRunEvent[]) => Promise<void>;
|
|
39
|
+
}
|
|
40
|
+
export interface PrepareHostedConversationRootRunContextInput {
|
|
41
|
+
authToken: string;
|
|
42
|
+
apiUrl: string;
|
|
43
|
+
conversationId?: string;
|
|
44
|
+
projectId?: string | null;
|
|
45
|
+
branchId?: string | null;
|
|
46
|
+
agentId: string;
|
|
47
|
+
implementationKind?: string | null;
|
|
48
|
+
messages: ChatUiMessage[];
|
|
49
|
+
parentRunId?: string;
|
|
50
|
+
parentMessageId?: string;
|
|
51
|
+
providedRun?: ConversationRootRunDescriptor;
|
|
52
|
+
persistLatestUserMessageBeforeRun: boolean;
|
|
53
|
+
persistLatestUserMessageOperation?: string;
|
|
54
|
+
missingUserMessageErrorMessage?: string;
|
|
55
|
+
onPersistLatestUserMessageFailure?: Parameters<typeof persistLatestConversationUserMessage>[0]["onFailure"];
|
|
56
|
+
instrumentation?: HostedConversationRunChunkMirrorInstrumentation;
|
|
57
|
+
}
|
|
58
|
+
export declare function prepareHostedConversationRootRunContext(input: PrepareHostedConversationRootRunContextInput, options: {
|
|
59
|
+
abortSignal: AbortSignal;
|
|
60
|
+
}): Promise<HostedConversationRootRunContext>;
|
|
61
|
+
//# sourceMappingURL=root-run-lifecycle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"root-run-lifecycle.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/conversation/root-run-lifecycle.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { createConversationRootRunContext, createConversationRootRunStartAdapter, } from "./root-run-context.js";
|
|
2
|
+
import { persistLatestConversationUserMessage } from "./bootstrap.js";
|
|
3
|
+
import { createHostedConversationRunChunkMirror, } from "./run-chunk-mirror.js";
|
|
4
|
+
export async function prepareConversationRootRunLifecycle(input, options) {
|
|
5
|
+
const { run } = await input.startRun({ abortSignal: options.abortSignal });
|
|
6
|
+
const context = createConversationRootRunContext({
|
|
7
|
+
run,
|
|
8
|
+
parentRunId: input.parentRunId,
|
|
9
|
+
parentMessageId: input.parentMessageId,
|
|
10
|
+
appendParentRunEvents: input.appendParentRunEvents,
|
|
11
|
+
});
|
|
12
|
+
return {
|
|
13
|
+
...context,
|
|
14
|
+
mirror: run && input.createMirror ? await input.createMirror(run) : null,
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
function isConversationRunEvent(value) {
|
|
18
|
+
return typeof value === "object" && value !== null && "type" in value &&
|
|
19
|
+
typeof value.type === "string";
|
|
20
|
+
}
|
|
21
|
+
function toHostedConversationRootRunState(run) {
|
|
22
|
+
if (!run) {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
return {
|
|
26
|
+
runId: run.runId,
|
|
27
|
+
conversationId: run.conversationId,
|
|
28
|
+
messageId: run.messageId,
|
|
29
|
+
latestEventId: run.latestEventId,
|
|
30
|
+
latestExternalEventSequence: run.latestExternalEventSequence,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
export async function prepareHostedConversationRootRunContext(input, options) {
|
|
34
|
+
let durableRunMirror = null;
|
|
35
|
+
const startConversationRootRun = createConversationRootRunStartAdapter({
|
|
36
|
+
authToken: input.authToken,
|
|
37
|
+
apiUrl: input.apiUrl,
|
|
38
|
+
conversationId: input.conversationId,
|
|
39
|
+
projectId: input.projectId,
|
|
40
|
+
branchId: input.branchId,
|
|
41
|
+
agentId: input.agentId,
|
|
42
|
+
implementationKind: input.implementationKind,
|
|
43
|
+
providedRun: input.providedRun,
|
|
44
|
+
});
|
|
45
|
+
const rootRunLifecycle = await prepareConversationRootRunLifecycle({
|
|
46
|
+
startRun: async ({ abortSignal }) => {
|
|
47
|
+
if (!input.providedRun) {
|
|
48
|
+
await persistLatestConversationUserMessage({
|
|
49
|
+
authToken: input.authToken,
|
|
50
|
+
apiUrl: input.apiUrl,
|
|
51
|
+
conversationId: input.conversationId,
|
|
52
|
+
messages: input.messages,
|
|
53
|
+
enabled: input.persistLatestUserMessageBeforeRun,
|
|
54
|
+
operation: input.persistLatestUserMessageOperation,
|
|
55
|
+
missingUserMessageErrorMessage: input.missingUserMessageErrorMessage,
|
|
56
|
+
onFailure: input.onPersistLatestUserMessageFailure,
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
return await startConversationRootRun({ abortSignal });
|
|
60
|
+
},
|
|
61
|
+
parentRunId: input.parentRunId,
|
|
62
|
+
parentMessageId: input.parentMessageId,
|
|
63
|
+
appendParentRunEvents: async (events) => {
|
|
64
|
+
if (!durableRunMirror || !events.every(isConversationRunEvent)) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
await durableRunMirror.appendEvents(events);
|
|
68
|
+
},
|
|
69
|
+
createMirror: (run) => {
|
|
70
|
+
durableRunMirror = createHostedConversationRunChunkMirror({
|
|
71
|
+
authToken: input.authToken,
|
|
72
|
+
apiUrl: input.apiUrl,
|
|
73
|
+
conversationId: run.conversationId,
|
|
74
|
+
runId: run.runId,
|
|
75
|
+
latestEventId: run.latestEventId,
|
|
76
|
+
latestExternalEventSequence: run.latestExternalEventSequence,
|
|
77
|
+
instrumentation: input.instrumentation,
|
|
78
|
+
});
|
|
79
|
+
return durableRunMirror;
|
|
80
|
+
},
|
|
81
|
+
}, options);
|
|
82
|
+
durableRunMirror = rootRunLifecycle.mirror;
|
|
83
|
+
return {
|
|
84
|
+
durableRootRun: toHostedConversationRootRunState(rootRunLifecycle.run),
|
|
85
|
+
durableRunMirror,
|
|
86
|
+
effectiveParentRunId: rootRunLifecycle.effectiveParentRunId,
|
|
87
|
+
effectiveParentMessageId: rootRunLifecycle.effectiveParentMessageId,
|
|
88
|
+
publishParentRunEvents: rootRunLifecycle.publishParentRunEvents
|
|
89
|
+
? async (events) => {
|
|
90
|
+
await rootRunLifecycle.publishParentRunEvents?.(events);
|
|
91
|
+
}
|
|
92
|
+
: undefined,
|
|
93
|
+
};
|
|
94
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { ChatMessageMetadata, ChatUiMessageChunk } from "../../chat/protocol.js";
|
|
2
|
+
import { type ConversationRunEvent, ConversationRunEventEncoder } from "./run-events.js";
|
|
3
|
+
import { type ConversationRunMirror, type ConversationRunMirrorRetryScheduledState, type ConversationRunMirrorStoppedState } from "./run-mirror.js";
|
|
4
|
+
import { type ConversationRunEventQueueController } from "../durable.js";
|
|
5
|
+
export interface ConversationRunChunkMirror {
|
|
6
|
+
handleChunk(chunk: ChatUiMessageChunk<ChatMessageMetadata>): Promise<void>;
|
|
7
|
+
appendEvents(events: ConversationRunEvent[]): Promise<void>;
|
|
8
|
+
flush(): Promise<void>;
|
|
9
|
+
getSnapshot(): ReturnType<ConversationRunMirror["getSnapshot"]>;
|
|
10
|
+
dispose(): void;
|
|
11
|
+
}
|
|
12
|
+
export interface ConversationRunChunkMirrorPreparedChunk {
|
|
13
|
+
chunk: ChatUiMessageChunk<ChatMessageMetadata>;
|
|
14
|
+
events: ConversationRunEvent[];
|
|
15
|
+
}
|
|
16
|
+
export interface ConversationRunChunkMirrorPreparedEvents {
|
|
17
|
+
events: ConversationRunEvent[];
|
|
18
|
+
}
|
|
19
|
+
export interface ConversationRunChunkMirrorPrepareChunkEventsInput {
|
|
20
|
+
chunk: ChatUiMessageChunk<ChatMessageMetadata>;
|
|
21
|
+
defaultPrepare: () => ConversationRunEvent[];
|
|
22
|
+
}
|
|
23
|
+
export interface ConversationRunChunkMirrorPrepareExternalEventsInput {
|
|
24
|
+
events: ConversationRunEvent[];
|
|
25
|
+
defaultPrepare: () => ConversationRunEvent[];
|
|
26
|
+
}
|
|
27
|
+
interface ConversationRunChunkMirrorSharedOptions {
|
|
28
|
+
immediateFlushEventCount?: number;
|
|
29
|
+
encoder?: ConversationRunEventEncoder;
|
|
30
|
+
flushDelayMs?: number;
|
|
31
|
+
getRetryDelayMs?: (consecutiveFailures: number) => number;
|
|
32
|
+
onRetryScheduled?: (state: ConversationRunMirrorRetryScheduledState) => Promise<void> | void;
|
|
33
|
+
onStopped?: (state: ConversationRunMirrorStoppedState) => Promise<void> | void;
|
|
34
|
+
prepareChunkEvents?: (input: ConversationRunChunkMirrorPrepareChunkEventsInput) => Promise<ConversationRunEvent[]> | ConversationRunEvent[];
|
|
35
|
+
prepareExternalEvents?: (input: ConversationRunChunkMirrorPrepareExternalEventsInput) => Promise<ConversationRunEvent[]> | ConversationRunEvent[];
|
|
36
|
+
onChunkPrepared?: (input: ConversationRunChunkMirrorPreparedChunk) => Promise<void> | void;
|
|
37
|
+
onExternalEventsPrepared?: (input: ConversationRunChunkMirrorPreparedEvents) => Promise<void> | void;
|
|
38
|
+
}
|
|
39
|
+
export interface ConversationRunChunkMirrorQueueOptions extends ConversationRunChunkMirrorSharedOptions {
|
|
40
|
+
queueController: ConversationRunEventQueueController;
|
|
41
|
+
}
|
|
42
|
+
export interface ConversationRunChunkMirrorApiOptions extends ConversationRunChunkMirrorSharedOptions {
|
|
43
|
+
authToken: string;
|
|
44
|
+
apiUrl: string;
|
|
45
|
+
conversationId: string;
|
|
46
|
+
runId: string;
|
|
47
|
+
latestEventId: number;
|
|
48
|
+
latestExternalEventSequence?: number;
|
|
49
|
+
maxEventsPerBatch?: number;
|
|
50
|
+
maxCursorResyncsPerFlush?: number;
|
|
51
|
+
}
|
|
52
|
+
export type ConversationRunChunkMirrorOptions = ConversationRunChunkMirrorQueueOptions | ConversationRunChunkMirrorApiOptions;
|
|
53
|
+
export type HostedConversationRunChunkMirrorTraceAttributes = Record<string, string | number | boolean | null | undefined>;
|
|
54
|
+
export interface HostedConversationRunChunkMirrorInstrumentation {
|
|
55
|
+
trace?: <T>(operationName: string, operation: () => Promise<T>) => Promise<T>;
|
|
56
|
+
setTraceAttributes?: (attributes: HostedConversationRunChunkMirrorTraceAttributes) => void;
|
|
57
|
+
debug?: (message: string, metadata: Record<string, unknown>) => void;
|
|
58
|
+
warn?: (message: string, metadata: Record<string, unknown>) => void;
|
|
59
|
+
error?: (message: string, metadata: Record<string, unknown>) => void;
|
|
60
|
+
}
|
|
61
|
+
export interface HostedConversationRunChunkMirrorOptions {
|
|
62
|
+
authToken: string;
|
|
63
|
+
apiUrl: string;
|
|
64
|
+
conversationId: string;
|
|
65
|
+
runId: string;
|
|
66
|
+
latestEventId: number;
|
|
67
|
+
latestExternalEventSequence?: number;
|
|
68
|
+
batchSize?: number;
|
|
69
|
+
instrumentation?: HostedConversationRunChunkMirrorInstrumentation;
|
|
70
|
+
}
|
|
71
|
+
export declare function createConversationRunChunkMirror(input: ConversationRunChunkMirrorOptions): ConversationRunChunkMirror;
|
|
72
|
+
export declare function createHostedConversationRunChunkMirror(input: HostedConversationRunChunkMirrorOptions): ConversationRunChunkMirror;
|
|
73
|
+
export {};
|
|
74
|
+
//# sourceMappingURL=run-chunk-mirror.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-chunk-mirror.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/conversation/run-chunk-mirror.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { ConversationRunEventEncoder } from "./run-events.js";
|
|
2
|
+
import { createConversationRunMirror, } from "./run-mirror.js";
|
|
3
|
+
import { prepareConversationRunChunkEvents, prepareConversationRunExternalEvents, } from "./run-event-preparation.js";
|
|
4
|
+
import { createConversationRunEventQueueController, } from "../durable.js";
|
|
5
|
+
const DEFAULT_IMMEDIATE_FLUSH_EVENT_COUNT = 24;
|
|
6
|
+
const DEFAULT_MAX_CURSOR_RESYNCS_PER_FLUSH = 3;
|
|
7
|
+
const DEFAULT_HOSTED_CHUNK_MIRROR_BATCH_SIZE = 24;
|
|
8
|
+
function resolveQueueController(input) {
|
|
9
|
+
if ("queueController" in input) {
|
|
10
|
+
return input.queueController;
|
|
11
|
+
}
|
|
12
|
+
const maxEventsPerBatch = input.maxEventsPerBatch ?? DEFAULT_IMMEDIATE_FLUSH_EVENT_COUNT;
|
|
13
|
+
return createConversationRunEventQueueController({
|
|
14
|
+
authToken: input.authToken,
|
|
15
|
+
apiUrl: input.apiUrl,
|
|
16
|
+
conversationId: input.conversationId,
|
|
17
|
+
runId: input.runId,
|
|
18
|
+
latestEventId: input.latestEventId,
|
|
19
|
+
latestExternalEventSequence: input.latestExternalEventSequence ?? 0,
|
|
20
|
+
maxEventsPerBatch,
|
|
21
|
+
maxCursorResyncsPerFlush: input.maxCursorResyncsPerFlush ??
|
|
22
|
+
DEFAULT_MAX_CURSOR_RESYNCS_PER_FLUSH,
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
export function createConversationRunChunkMirror(input) {
|
|
26
|
+
const encoder = input.encoder ?? new ConversationRunEventEncoder();
|
|
27
|
+
const immediateFlushEventCount = input.immediateFlushEventCount ??
|
|
28
|
+
DEFAULT_IMMEDIATE_FLUSH_EVENT_COUNT;
|
|
29
|
+
const mirror = createConversationRunMirror({
|
|
30
|
+
queueController: resolveQueueController(input),
|
|
31
|
+
immediateFlushEventCount,
|
|
32
|
+
...(input.flushDelayMs !== undefined ? { flushDelayMs: input.flushDelayMs } : {}),
|
|
33
|
+
...(input.getRetryDelayMs ? { getRetryDelayMs: input.getRetryDelayMs } : {}),
|
|
34
|
+
...(input.onRetryScheduled ? { onRetryScheduled: input.onRetryScheduled } : {}),
|
|
35
|
+
...(input.onStopped ? { onStopped: input.onStopped } : {}),
|
|
36
|
+
});
|
|
37
|
+
return {
|
|
38
|
+
async handleChunk(chunk) {
|
|
39
|
+
if (mirror.getSnapshot().disabled) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
const events = await (input.prepareChunkEvents?.({
|
|
43
|
+
chunk,
|
|
44
|
+
defaultPrepare: () => prepareConversationRunChunkEvents([chunk], encoder),
|
|
45
|
+
}) ?? prepareConversationRunChunkEvents([chunk], encoder));
|
|
46
|
+
await input.onChunkPrepared?.({ chunk, events });
|
|
47
|
+
if (events.length === 0) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
mirror.enqueue(events);
|
|
51
|
+
},
|
|
52
|
+
async appendEvents(events) {
|
|
53
|
+
if (mirror.getSnapshot().disabled || events.length === 0) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
const normalizedEvents = await (input.prepareExternalEvents?.({
|
|
57
|
+
events,
|
|
58
|
+
defaultPrepare: () => prepareConversationRunExternalEvents(events),
|
|
59
|
+
}) ?? prepareConversationRunExternalEvents(events));
|
|
60
|
+
await input.onExternalEventsPrepared?.({ events: normalizedEvents });
|
|
61
|
+
if (normalizedEvents.length === 0) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
mirror.enqueue(normalizedEvents);
|
|
65
|
+
},
|
|
66
|
+
flush() {
|
|
67
|
+
return mirror.flush();
|
|
68
|
+
},
|
|
69
|
+
getSnapshot() {
|
|
70
|
+
return mirror.getSnapshot();
|
|
71
|
+
},
|
|
72
|
+
dispose() {
|
|
73
|
+
mirror.dispose();
|
|
74
|
+
},
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
function createHostedChunkMirrorRetryMetadata(input) {
|
|
78
|
+
return {
|
|
79
|
+
conversationId: input.conversationId,
|
|
80
|
+
runId: input.runId,
|
|
81
|
+
error: input.errorMessage,
|
|
82
|
+
retryDelayMs: input.retryDelayMs,
|
|
83
|
+
pendingEventCount: input.pendingEventCount,
|
|
84
|
+
consecutiveFailures: input.consecutiveFailures,
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
async function runHostedChunkMirrorTrace(instrumentation, operationName, operation) {
|
|
88
|
+
if (instrumentation?.trace) {
|
|
89
|
+
return await instrumentation.trace(operationName, operation);
|
|
90
|
+
}
|
|
91
|
+
return await operation();
|
|
92
|
+
}
|
|
93
|
+
function recordHostedChunkMirrorRetryScheduled(input) {
|
|
94
|
+
input.instrumentation?.error?.("Durable run mirror flush failed; queued for retry", createHostedChunkMirrorRetryMetadata({
|
|
95
|
+
conversationId: input.conversationId,
|
|
96
|
+
runId: input.runId,
|
|
97
|
+
errorMessage: input.flushAttempt.errorMessage ?? "Conversation run append failed",
|
|
98
|
+
retryDelayMs: input.flushAttempt.retryDelayMs,
|
|
99
|
+
pendingEventCount: input.flushAttempt.pendingEventCount,
|
|
100
|
+
consecutiveFailures: input.flushAttempt.consecutiveFailures,
|
|
101
|
+
}));
|
|
102
|
+
}
|
|
103
|
+
function recordHostedChunkMirrorStopped(input) {
|
|
104
|
+
if (input.flushAttempt.disableReason === "cursor_resyncs_exhausted") {
|
|
105
|
+
input.instrumentation?.error?.("Disabling durable run mirroring after repeated cursor resync failures", {
|
|
106
|
+
conversationId: input.conversationId,
|
|
107
|
+
runId: input.runId,
|
|
108
|
+
});
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
if (input.flushAttempt.disableReason === "ignorable_append_rejection") {
|
|
112
|
+
input.instrumentation?.warn?.("Disabling durable run mirroring after external append rejection", {
|
|
113
|
+
conversationId: input.conversationId,
|
|
114
|
+
runId: input.runId,
|
|
115
|
+
});
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
if (input.flushAttempt.disableReason === "non_appendable") {
|
|
119
|
+
input.instrumentation?.warn?.("Disabling durable run mirroring after cursor mismatch reached a non-appendable run state", {
|
|
120
|
+
conversationId: input.conversationId,
|
|
121
|
+
runId: input.runId,
|
|
122
|
+
latestEventId: input.flushAttempt.latestEventId,
|
|
123
|
+
latestExternalEventSequence: input.flushAttempt.latestExternalEventSequence,
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
export function createHostedConversationRunChunkMirror(input) {
|
|
128
|
+
const batchSize = input.batchSize ?? DEFAULT_HOSTED_CHUNK_MIRROR_BATCH_SIZE;
|
|
129
|
+
return createConversationRunChunkMirror({
|
|
130
|
+
authToken: input.authToken,
|
|
131
|
+
apiUrl: input.apiUrl,
|
|
132
|
+
conversationId: input.conversationId,
|
|
133
|
+
runId: input.runId,
|
|
134
|
+
latestEventId: input.latestEventId,
|
|
135
|
+
latestExternalEventSequence: input.latestExternalEventSequence,
|
|
136
|
+
maxEventsPerBatch: batchSize,
|
|
137
|
+
maxCursorResyncsPerFlush: DEFAULT_MAX_CURSOR_RESYNCS_PER_FLUSH,
|
|
138
|
+
immediateFlushEventCount: batchSize,
|
|
139
|
+
prepareChunkEvents: ({ chunk, defaultPrepare }) => runHostedChunkMirrorTrace(input.instrumentation, "durable.mirrorChunk", async () => {
|
|
140
|
+
const events = defaultPrepare();
|
|
141
|
+
input.instrumentation?.setTraceAttributes?.({
|
|
142
|
+
"conversation.id": input.conversationId,
|
|
143
|
+
"run.id": input.runId,
|
|
144
|
+
"stream.ui_chunk.type": chunk.type,
|
|
145
|
+
"durable.event_count": events.length,
|
|
146
|
+
});
|
|
147
|
+
input.instrumentation?.debug?.("Durable run mirror processed UI chunk", {
|
|
148
|
+
conversationId: input.conversationId,
|
|
149
|
+
runId: input.runId,
|
|
150
|
+
chunkType: chunk.type,
|
|
151
|
+
durableEventTypes: events.map((event) => event.type),
|
|
152
|
+
durableEventCount: events.length,
|
|
153
|
+
});
|
|
154
|
+
return events;
|
|
155
|
+
}),
|
|
156
|
+
prepareExternalEvents: ({ defaultPrepare }) => runHostedChunkMirrorTrace(input.instrumentation, "durable.mirrorAppendEvents", async () => {
|
|
157
|
+
const events = defaultPrepare();
|
|
158
|
+
input.instrumentation?.setTraceAttributes?.({
|
|
159
|
+
"conversation.id": input.conversationId,
|
|
160
|
+
"run.id": input.runId,
|
|
161
|
+
"durable.event_count": events.length,
|
|
162
|
+
});
|
|
163
|
+
input.instrumentation?.debug?.("Durable run mirror queued external events", {
|
|
164
|
+
conversationId: input.conversationId,
|
|
165
|
+
runId: input.runId,
|
|
166
|
+
durableEventTypes: events.map((event) => event.type),
|
|
167
|
+
durableEventCount: events.length,
|
|
168
|
+
});
|
|
169
|
+
return events;
|
|
170
|
+
}),
|
|
171
|
+
onRetryScheduled: (flushAttempt) => {
|
|
172
|
+
recordHostedChunkMirrorRetryScheduled({
|
|
173
|
+
instrumentation: input.instrumentation,
|
|
174
|
+
conversationId: input.conversationId,
|
|
175
|
+
runId: input.runId,
|
|
176
|
+
flushAttempt,
|
|
177
|
+
});
|
|
178
|
+
},
|
|
179
|
+
onStopped: (flushAttempt) => {
|
|
180
|
+
recordHostedChunkMirrorStopped({
|
|
181
|
+
instrumentation: input.instrumentation,
|
|
182
|
+
conversationId: input.conversationId,
|
|
183
|
+
runId: input.runId,
|
|
184
|
+
flushAttempt,
|
|
185
|
+
});
|
|
186
|
+
},
|
|
187
|
+
});
|
|
188
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ConversationRunProjection } from "../durable.js";
|
|
2
|
+
export interface ConversationRunContext {
|
|
3
|
+
run: ConversationRunProjection | null;
|
|
4
|
+
effectiveParentRunId?: string;
|
|
5
|
+
effectiveParentMessageId?: string;
|
|
6
|
+
publishParentRunEvents?: (events: unknown[]) => Promise<void> | void;
|
|
7
|
+
}
|
|
8
|
+
export declare function createConversationRunContext(input: {
|
|
9
|
+
run: ConversationRunProjection | null;
|
|
10
|
+
parentRunId?: string;
|
|
11
|
+
parentMessageId?: string;
|
|
12
|
+
publishParentRunEvents?: ((events: unknown[]) => Promise<void> | void) | undefined;
|
|
13
|
+
}): {
|
|
14
|
+
run: ConversationRunProjection | null;
|
|
15
|
+
effectiveParentRunId: string | undefined;
|
|
16
|
+
effectiveParentMessageId: string | undefined;
|
|
17
|
+
publishParentRunEvents: ((events: unknown[]) => Promise<void> | void) | undefined;
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=run-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-context.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/conversation/run-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAC;AAE/D,MAAM,WAAW,sBAAsB;IACrC,GAAG,EAAE,yBAAyB,GAAG,IAAI,CAAC;IACtC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,sBAAsB,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;CACtE;AAED,wBAAgB,4BAA4B,CAAC,KAAK,EAAE;IAClD,GAAG,EAAE,yBAAyB,GAAG,IAAI,CAAC;IACtC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,sBAAsB,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,SAAS,CAAC;CACpF;;;;sCADoC,OAAO,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;EAQtE"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
type ConversationRunEventRecord = Record<string, unknown> & {
|
|
2
|
+
type: string;
|
|
3
|
+
};
|
|
4
|
+
export declare function getConversationRunEventJsonByteLength(value: unknown): number;
|
|
5
|
+
export declare function normalizeConversationRunEvent(event: ConversationRunEventRecord): ConversationRunEventRecord[];
|
|
6
|
+
export declare function normalizeConversationRunEvents(events: ConversationRunEventRecord[]): ConversationRunEventRecord[];
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=run-event-normalization.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-event-normalization.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/conversation/run-event-normalization.ts"],"names":[],"mappings":"AAQA,KAAK,0BAA0B,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAS7E,wBAAgB,qCAAqC,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAM5E;AAED,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE,0BAA0B,GAChC,0BAA0B,EAAE,CAkB9B;AAED,wBAAgB,8BAA8B,CAC5C,MAAM,EAAE,0BAA0B,EAAE,GACnC,0BAA0B,EAAE,CAE9B"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type ChatMessageMetadata, type ChatStreamEvent, type ChatUiMessageChunk } from "../../chat/protocol.js";
|
|
2
|
+
import { type ConversationRunEvent, ConversationRunEventEncoder } from "./run-events.js";
|
|
3
|
+
export declare function toConversationRunStreamEvent(chunk: ChatUiMessageChunk<ChatMessageMetadata>): ChatStreamEvent;
|
|
4
|
+
export declare function prepareConversationRunStreamEvents(events: ChatStreamEvent[], encoder?: ConversationRunEventEncoder): ConversationRunEvent[];
|
|
5
|
+
export declare function prepareConversationRunChunkEvents(chunks: ChatUiMessageChunk<ChatMessageMetadata>[], encoder?: ConversationRunEventEncoder): ConversationRunEvent[];
|
|
6
|
+
export declare function prepareConversationRunExternalEvents(events: ConversationRunEvent[]): ConversationRunEvent[];
|
|
7
|
+
//# sourceMappingURL=run-event-preparation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-event-preparation.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/conversation/run-event-preparation.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACxB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,KAAK,oBAAoB,EACzB,2BAA2B,EAE5B,MAAM,iBAAiB,CAAC;AAiBzB,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,kBAAkB,CAAC,mBAAmB,CAAC,GAC7C,eAAe,CAuBjB;AAED,wBAAgB,kCAAkC,CAChD,MAAM,EAAE,eAAe,EAAE,EACzB,OAAO,8BAAoC,GAC1C,oBAAoB,EAAE,CAExB;AAED,wBAAgB,iCAAiC,CAC/C,MAAM,EAAE,kBAAkB,CAAC,mBAAmB,CAAC,EAAE,EACjD,OAAO,8BAAoC,GAC1C,oBAAoB,EAAE,CAKxB;AAED,wBAAgB,oCAAoC,CAClD,MAAM,EAAE,oBAAoB,EAAE,GAC7B,oBAAoB,EAAE,CAExB"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { ConversationRunEventEncoder, encodeConversationRunEvents, } from "./run-events.js";
|
|
2
|
+
import { normalizeConversationRunEvents } from "./run-event-normalization.js";
|
|
3
|
+
function normalizeFinishReason(reason) {
|
|
4
|
+
switch (reason) {
|
|
5
|
+
case "stop":
|
|
6
|
+
case "length":
|
|
7
|
+
case "tool-calls":
|
|
8
|
+
case "content-filter":
|
|
9
|
+
case "error":
|
|
10
|
+
case "other":
|
|
11
|
+
return reason;
|
|
12
|
+
default:
|
|
13
|
+
return undefined;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
export function toConversationRunStreamEvent(chunk) {
|
|
17
|
+
switch (chunk.type) {
|
|
18
|
+
case "start":
|
|
19
|
+
return {
|
|
20
|
+
type: "start",
|
|
21
|
+
...(chunk.messageId !== undefined ? { messageId: chunk.messageId } : {}),
|
|
22
|
+
...(chunk.messageMetadata !== undefined ? { messageMetadata: chunk.messageMetadata } : {}),
|
|
23
|
+
};
|
|
24
|
+
case "finish": {
|
|
25
|
+
const finishReason = normalizeFinishReason(chunk.finishReason);
|
|
26
|
+
return {
|
|
27
|
+
type: "finish",
|
|
28
|
+
...(finishReason !== undefined ? { finishReason } : {}),
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
case "message-metadata":
|
|
32
|
+
return {
|
|
33
|
+
type: "message-metadata",
|
|
34
|
+
messageMetadata: chunk.messageMetadata,
|
|
35
|
+
};
|
|
36
|
+
default:
|
|
37
|
+
return chunk;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
export function prepareConversationRunStreamEvents(events, encoder = new ConversationRunEventEncoder()) {
|
|
41
|
+
return normalizeConversationRunEvents(encodeConversationRunEvents(events, encoder));
|
|
42
|
+
}
|
|
43
|
+
export function prepareConversationRunChunkEvents(chunks, encoder = new ConversationRunEventEncoder()) {
|
|
44
|
+
return prepareConversationRunStreamEvents(chunks.map((chunk) => toConversationRunStreamEvent(chunk)), encoder);
|
|
45
|
+
}
|
|
46
|
+
export function prepareConversationRunExternalEvents(events) {
|
|
47
|
+
return normalizeConversationRunEvents(events);
|
|
48
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { InferSchema } from "../../extensions/schema/index.js";
|
|
2
|
+
import { type ChatStreamEvent } from "../../chat/protocol.js";
|
|
3
|
+
export declare const conversationRunEventTypes: {
|
|
4
|
+
readonly custom: "CUSTOM";
|
|
5
|
+
readonly textMessageStart: "TEXT_MESSAGE_START";
|
|
6
|
+
readonly textMessageContent: "TEXT_MESSAGE_CONTENT";
|
|
7
|
+
readonly textMessageEnd: "TEXT_MESSAGE_END";
|
|
8
|
+
readonly reasoningMessageStart: "REASONING_MESSAGE_START";
|
|
9
|
+
readonly reasoningMessageContent: "REASONING_MESSAGE_CONTENT";
|
|
10
|
+
readonly reasoningMessageEnd: "REASONING_MESSAGE_END";
|
|
11
|
+
readonly toolCallStart: "TOOL_CALL_START";
|
|
12
|
+
readonly toolCallArgs: "TOOL_CALL_ARGS";
|
|
13
|
+
readonly toolCallEnd: "TOOL_CALL_END";
|
|
14
|
+
readonly toolCallResult: "TOOL_CALL_RESULT";
|
|
15
|
+
};
|
|
16
|
+
export declare const getConversationRunEventSchema: () => import("../../internal-agents/schema.js").Schema<{
|
|
17
|
+
type: string;
|
|
18
|
+
} & {} & Record<string, unknown>>;
|
|
19
|
+
/** @deprecated Use getConversationRunEventSchema() */
|
|
20
|
+
export declare const ConversationRunEventSchema: import("../../internal-agents/schema.js").Schema<{
|
|
21
|
+
type: string;
|
|
22
|
+
} & {} & Record<string, unknown>>;
|
|
23
|
+
export type ConversationRunEvent = InferSchema<ReturnType<typeof getConversationRunEventSchema>> & Record<string, unknown>;
|
|
24
|
+
export declare class ConversationRunEventEncoder {
|
|
25
|
+
private readonly streamedToolInputs;
|
|
26
|
+
private readonly toolInputs;
|
|
27
|
+
private activeMessageId;
|
|
28
|
+
private getToolResultMessageId;
|
|
29
|
+
private serializeToolResultContent;
|
|
30
|
+
encode(chunk: ChatStreamEvent): ConversationRunEvent[];
|
|
31
|
+
}
|
|
32
|
+
export declare function encodeConversationRunEvents(events: ChatStreamEvent[], encoder?: ConversationRunEventEncoder): ConversationRunEvent[];
|
|
33
|
+
export declare function normalizeEncodedConversationRunEvents(events: ChatStreamEvent[], encoder?: ConversationRunEventEncoder): ConversationRunEvent[];
|
|
34
|
+
//# sourceMappingURL=run-events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-events.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/conversation/run-events.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAG9D,eAAO,MAAM,yBAAyB;;;;;;;;;;;;CAY5B,CAAC;AAEX,eAAO,MAAM,6BAA6B;;iCAIzC,CAAC;AAEF,sDAAsD;AACtD,eAAO,MAAM,0BAA0B;;iCAAkC,CAAC;AAE1E,MAAM,MAAM,oBAAoB,GAC5B,WAAW,CAAC,UAAU,CAAC,OAAO,6BAA6B,CAAC,CAAC,GAC7D,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAyB5B,qBAAa,2BAA2B;IACtC,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAqB;IACxD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA8B;IACzD,OAAO,CAAC,eAAe,CAAuB;IAE9C,OAAO,CAAC,sBAAsB;IAM9B,OAAO,CAAC,0BAA0B;IAYlC,MAAM,CAAC,KAAK,EAAE,eAAe,GAAG,oBAAoB,EAAE;CAqJvD;AAED,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,eAAe,EAAE,EACzB,OAAO,8BAAoC,GAC1C,oBAAoB,EAAE,CAExB;AAED,wBAAgB,qCAAqC,CACnD,MAAM,EAAE,eAAe,EAAE,EACzB,OAAO,8BAAoC,GAC1C,oBAAoB,EAAE,CAExB"}
|