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,301 @@
|
|
|
1
|
+
import { isResponseLike } from "../response-like.js";
|
|
2
|
+
import { AgentRuntime, RunAlreadyExistsError, } from "../runtime/index.js";
|
|
3
|
+
import { parseAgUiRuntimeRequestOrError, } from "../runtime/ag-ui-contract.js";
|
|
4
|
+
import { extractRequest } from "./request-shared.js";
|
|
5
|
+
import { buildMergedAgUiTools } from "./tool-shared.js";
|
|
6
|
+
import { normalizeAgUiRuntimeMessages } from "./runtime-support.js";
|
|
7
|
+
import { createStreamTransformState, finalizeRunEvents, formatAgUiEvent, mapRuntimeEventToAgUi, } from "../../internal-agents/ag-ui-sse.js";
|
|
8
|
+
import { streamDataStreamEvents } from "../data-stream.js";
|
|
9
|
+
const AG_UI_HEADERS = {
|
|
10
|
+
"Content-Type": "text/event-stream",
|
|
11
|
+
"Cache-Control": "no-cache",
|
|
12
|
+
Connection: "keep-alive",
|
|
13
|
+
};
|
|
14
|
+
function invokeLifecycleCallback(callback, context) {
|
|
15
|
+
if (!callback)
|
|
16
|
+
return;
|
|
17
|
+
try {
|
|
18
|
+
const result = callback(context);
|
|
19
|
+
void Promise.resolve(result).catch(() => undefined);
|
|
20
|
+
}
|
|
21
|
+
catch {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
async function invokeLifecycleCallbackAndWait(callback, context) {
|
|
26
|
+
if (!callback)
|
|
27
|
+
return;
|
|
28
|
+
try {
|
|
29
|
+
await callback(context);
|
|
30
|
+
}
|
|
31
|
+
catch {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
function isRecord(value) {
|
|
36
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
37
|
+
}
|
|
38
|
+
function buildStreamContext(request, baseContext) {
|
|
39
|
+
return {
|
|
40
|
+
...baseContext,
|
|
41
|
+
threadId: request.threadId,
|
|
42
|
+
runId: request.runId,
|
|
43
|
+
agUi: {
|
|
44
|
+
context: request.context,
|
|
45
|
+
forwardedProps: request.forwardedProps,
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
function closeController(controller) {
|
|
50
|
+
try {
|
|
51
|
+
controller.close();
|
|
52
|
+
}
|
|
53
|
+
catch {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
function enqueueEvent(controller, event, payload) {
|
|
58
|
+
try {
|
|
59
|
+
controller.enqueue(formatAgUiEvent(event, payload));
|
|
60
|
+
return true;
|
|
61
|
+
}
|
|
62
|
+
catch {
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
async function createAgUiRuntimeStreamResponse(options) {
|
|
67
|
+
const { agentId, request, upstreamBody, upstreamStatus, upstreamStatusText, onFinish, onError, onToolCallSeen, } = options;
|
|
68
|
+
const stream = new ReadableStream({
|
|
69
|
+
start: async (controller) => {
|
|
70
|
+
const state = createStreamTransformState();
|
|
71
|
+
const prepareToolResultIfNeeded = (event, payload) => {
|
|
72
|
+
if (event !== "ToolCallStart" && event !== "ToolCallArgs" &&
|
|
73
|
+
event !== "ToolCallEnd") {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
const toolCallId = typeof payload.toolCallId === "string" ? payload.toolCallId : null;
|
|
77
|
+
if (toolCallId) {
|
|
78
|
+
onToolCallSeen?.(toolCallId);
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
if (!enqueueEvent(controller, "RunStarted", {
|
|
82
|
+
runId: request.runId,
|
|
83
|
+
threadId: request.threadId,
|
|
84
|
+
agentId,
|
|
85
|
+
})) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
if (!enqueueEvent(controller, "StateSnapshot", {
|
|
89
|
+
snapshot: isRecord(request.state) ? request.state : {},
|
|
90
|
+
})) {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
if (!enqueueEvent(controller, "MessagesSnapshot", {
|
|
94
|
+
messages: normalizeAgUiRuntimeMessages(request.messages),
|
|
95
|
+
})) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
try {
|
|
99
|
+
if (!upstreamBody) {
|
|
100
|
+
for (const event of finalizeRunEvents(state, null)) {
|
|
101
|
+
if (!enqueueEvent(controller, event.event, event.payload)) {
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
onFinish?.();
|
|
106
|
+
closeController(controller);
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
for await (const event of streamDataStreamEvents(upstreamBody)) {
|
|
110
|
+
for (const mapped of mapRuntimeEventToAgUi(state, event)) {
|
|
111
|
+
prepareToolResultIfNeeded(mapped.event, mapped.payload);
|
|
112
|
+
if (!enqueueEvent(controller, mapped.event, mapped.payload)) {
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
for (const event of finalizeRunEvents(state, null)) {
|
|
118
|
+
if (!enqueueEvent(controller, event.event, event.payload)) {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
onFinish?.();
|
|
123
|
+
}
|
|
124
|
+
catch (error) {
|
|
125
|
+
onError?.(error);
|
|
126
|
+
enqueueEvent(controller, "RunError", {
|
|
127
|
+
message: error instanceof Error ? error.message : "Agent run failed",
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
finally {
|
|
131
|
+
closeController(controller);
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
});
|
|
135
|
+
return new Response(stream, {
|
|
136
|
+
status: upstreamStatus,
|
|
137
|
+
statusText: upstreamStatusText,
|
|
138
|
+
headers: { ...AG_UI_HEADERS },
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
async function createAgUiRuntimeDirectStreamResponse(agent, request, baseContext, lifecycle) {
|
|
142
|
+
await agent.clearMemory();
|
|
143
|
+
const result = await agent.stream({
|
|
144
|
+
messages: normalizeAgUiRuntimeMessages(request.messages),
|
|
145
|
+
context: buildStreamContext(request, baseContext),
|
|
146
|
+
});
|
|
147
|
+
const upstream = result.toDataStreamResponse();
|
|
148
|
+
return await createAgUiRuntimeStreamResponse({
|
|
149
|
+
agentId: agent.id,
|
|
150
|
+
request,
|
|
151
|
+
upstreamBody: upstream.body,
|
|
152
|
+
upstreamStatus: upstream.status,
|
|
153
|
+
upstreamStatusText: upstream.statusText,
|
|
154
|
+
onFinish: lifecycle?.onFinish,
|
|
155
|
+
onError: lifecycle?.onError,
|
|
156
|
+
onToolCallSeen: lifecycle?.onToolCallSeen,
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
function buildMergedTools(agent, request, sessionManager) {
|
|
160
|
+
return buildMergedAgUiTools(agent, request.runId, request.tools, sessionManager);
|
|
161
|
+
}
|
|
162
|
+
async function createAgUiRuntimeInjectedToolsStreamResponse(agent, request, baseContext, sessionManager, lifecycle) {
|
|
163
|
+
try {
|
|
164
|
+
sessionManager.startRun({ runId: request.runId, threadId: request.threadId });
|
|
165
|
+
}
|
|
166
|
+
catch (error) {
|
|
167
|
+
if (error instanceof RunAlreadyExistsError) {
|
|
168
|
+
return Response.json({ error: "Run already active" }, { status: 409 });
|
|
169
|
+
}
|
|
170
|
+
throw error;
|
|
171
|
+
}
|
|
172
|
+
const runtime = new AgentRuntime(agent.id, {
|
|
173
|
+
...agent.config,
|
|
174
|
+
tools: buildMergedTools(agent, request, sessionManager),
|
|
175
|
+
});
|
|
176
|
+
let upstreamBody;
|
|
177
|
+
try {
|
|
178
|
+
upstreamBody = await runtime.stream(normalizeAgUiRuntimeMessages(request.messages), buildStreamContext(request, baseContext), undefined, undefined, undefined);
|
|
179
|
+
}
|
|
180
|
+
catch (error) {
|
|
181
|
+
sessionManager.failRun(request.runId);
|
|
182
|
+
throw error;
|
|
183
|
+
}
|
|
184
|
+
return await createAgUiRuntimeStreamResponse({
|
|
185
|
+
agentId: agent.id,
|
|
186
|
+
request,
|
|
187
|
+
upstreamBody,
|
|
188
|
+
upstreamStatus: 200,
|
|
189
|
+
onFinish: () => {
|
|
190
|
+
sessionManager.completeRun(request.runId);
|
|
191
|
+
void lifecycle?.onFinish?.();
|
|
192
|
+
},
|
|
193
|
+
onError: (error) => {
|
|
194
|
+
sessionManager.failRun(request.runId);
|
|
195
|
+
void lifecycle?.onError?.(error);
|
|
196
|
+
},
|
|
197
|
+
onToolCallSeen: (toolCallId) => {
|
|
198
|
+
sessionManager.prepareForSignal(request.runId, toolCallId);
|
|
199
|
+
void lifecycle?.onToolCallSeen?.(toolCallId);
|
|
200
|
+
},
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
export function createAgUiRuntimeHandler(config) {
|
|
204
|
+
if (!config.agent && !config.execute) {
|
|
205
|
+
throw new Error("createAgUiRuntimeHandler requires either an agent or an execute handler.");
|
|
206
|
+
}
|
|
207
|
+
return async function POST(requestOrCtx) {
|
|
208
|
+
const request = extractRequest(requestOrCtx);
|
|
209
|
+
try {
|
|
210
|
+
const gateResult = await config.beforeParse?.({ request });
|
|
211
|
+
if (isResponseLike(gateResult)) {
|
|
212
|
+
return gateResult;
|
|
213
|
+
}
|
|
214
|
+
const parsed = await parseAgUiRuntimeRequestOrError(request);
|
|
215
|
+
if (isResponseLike(parsed)) {
|
|
216
|
+
if (config.validationErrorResponse) {
|
|
217
|
+
return await config.validationErrorResponse({ request, response: parsed });
|
|
218
|
+
}
|
|
219
|
+
return parsed;
|
|
220
|
+
}
|
|
221
|
+
const context = typeof config.context === "function"
|
|
222
|
+
? await config.context(request)
|
|
223
|
+
: config.context ?? {};
|
|
224
|
+
const createDefaultResponse = config.agent
|
|
225
|
+
? () => parsed.tools.length > 0
|
|
226
|
+
? config.sessionManager
|
|
227
|
+
? createAgUiRuntimeInjectedToolsStreamResponse(config.agent, parsed, context, config.sessionManager)
|
|
228
|
+
: Promise.resolve(Response.json({
|
|
229
|
+
error: "Injected AG-UI tools require a public RunResumeSessionManager on createAgUiRuntimeHandler().",
|
|
230
|
+
}, { status: 501 }))
|
|
231
|
+
: createAgUiRuntimeDirectStreamResponse(config.agent, parsed, context)
|
|
232
|
+
: undefined;
|
|
233
|
+
const invokeLifecycle = (type, extra = {}) => {
|
|
234
|
+
invokeLifecycleCallback(config[type], {
|
|
235
|
+
request: parsed,
|
|
236
|
+
...extra,
|
|
237
|
+
});
|
|
238
|
+
};
|
|
239
|
+
const createDefaultResponseWithLifecycle = createDefaultResponse
|
|
240
|
+
? async () => {
|
|
241
|
+
try {
|
|
242
|
+
if (!config.agent) {
|
|
243
|
+
return await createDefaultResponse();
|
|
244
|
+
}
|
|
245
|
+
if (parsed.tools.length > 0) {
|
|
246
|
+
if (!config.sessionManager) {
|
|
247
|
+
return await createDefaultResponse();
|
|
248
|
+
}
|
|
249
|
+
return await createAgUiRuntimeInjectedToolsStreamResponse(config.agent, parsed, context, config.sessionManager, {
|
|
250
|
+
onFinish: () => invokeLifecycle("onFinish"),
|
|
251
|
+
onError: (error) => invokeLifecycle("onError", { error }),
|
|
252
|
+
onToolCallSeen: (toolCallId) => invokeLifecycle("onToolCallSeen", { toolCallId }),
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
return await createAgUiRuntimeDirectStreamResponse(config.agent, parsed, context, {
|
|
256
|
+
onFinish: () => invokeLifecycle("onFinish"),
|
|
257
|
+
onError: (error) => invokeLifecycle("onError", { error }),
|
|
258
|
+
onToolCallSeen: (toolCallId) => invokeLifecycle("onToolCallSeen", { toolCallId }),
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
catch (error) {
|
|
262
|
+
await invokeLifecycleCallbackAndWait(config.onError, {
|
|
263
|
+
request: parsed,
|
|
264
|
+
error,
|
|
265
|
+
});
|
|
266
|
+
throw error;
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
: undefined;
|
|
270
|
+
if (config.execute) {
|
|
271
|
+
return await config.execute({
|
|
272
|
+
request,
|
|
273
|
+
agUiInput: parsed,
|
|
274
|
+
context,
|
|
275
|
+
createDefaultResponse: createDefaultResponseWithLifecycle,
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
if (createDefaultResponseWithLifecycle) {
|
|
279
|
+
return await createDefaultResponseWithLifecycle();
|
|
280
|
+
}
|
|
281
|
+
throw new Error("createAgUiRuntimeHandler configuration became invalid during execution.");
|
|
282
|
+
}
|
|
283
|
+
catch (error) {
|
|
284
|
+
if (error instanceof Error &&
|
|
285
|
+
"issues" in error &&
|
|
286
|
+
Array.isArray(error.issues)) {
|
|
287
|
+
const issues = error.issues;
|
|
288
|
+
return Response.json({
|
|
289
|
+
error: "Invalid AG-UI runtime request",
|
|
290
|
+
details: issues.map((issue) => ({
|
|
291
|
+
path: issue.path,
|
|
292
|
+
message: issue.message,
|
|
293
|
+
})),
|
|
294
|
+
}, { status: 400 });
|
|
295
|
+
}
|
|
296
|
+
return Response.json({
|
|
297
|
+
error: error instanceof Error ? error.message : "Internal server error",
|
|
298
|
+
}, { status: 500 });
|
|
299
|
+
}
|
|
300
|
+
};
|
|
301
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Message } from "../types.js";
|
|
2
|
+
import type { AgUiRuntimeRequest } from "../runtime/ag-ui-contract.js";
|
|
3
|
+
export declare function normalizeAgUiRuntimeMessages(messages: AgUiRuntimeRequest["messages"]): Message[];
|
|
4
|
+
//# sourceMappingURL=runtime-support.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-support.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/ag-ui/runtime-support.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAevE,wBAAgB,4BAA4B,CAC1C,QAAQ,EAAE,kBAAkB,CAAC,UAAU,CAAC,GACvC,OAAO,EAAE,CA6CX"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/** AG-UI runtime event type constants normalized from browser-wire SSE events. */
|
|
2
|
+
export declare const agUiSseEventTypes: {
|
|
3
|
+
readonly custom: "CUSTOM";
|
|
4
|
+
readonly textMessageStart: "TEXT_MESSAGE_START";
|
|
5
|
+
readonly textMessageContent: "TEXT_MESSAGE_CONTENT";
|
|
6
|
+
readonly textMessageEnd: "TEXT_MESSAGE_END";
|
|
7
|
+
readonly reasoningMessageStart: "REASONING_MESSAGE_START";
|
|
8
|
+
readonly reasoningMessageContent: "REASONING_MESSAGE_CONTENT";
|
|
9
|
+
readonly reasoningMessageEnd: "REASONING_MESSAGE_END";
|
|
10
|
+
readonly toolCallStart: "TOOL_CALL_START";
|
|
11
|
+
readonly toolCallArgs: "TOOL_CALL_ARGS";
|
|
12
|
+
readonly toolCallEnd: "TOOL_CALL_END";
|
|
13
|
+
readonly toolCallResult: "TOOL_CALL_RESULT";
|
|
14
|
+
readonly runStarted: "RUN_STARTED";
|
|
15
|
+
readonly stateSnapshot: "STATE_SNAPSHOT";
|
|
16
|
+
readonly messagesSnapshot: "MESSAGES_SNAPSHOT";
|
|
17
|
+
readonly stepStarted: "STEP_STARTED";
|
|
18
|
+
readonly stepFinished: "STEP_FINISHED";
|
|
19
|
+
readonly runError: "RUN_ERROR";
|
|
20
|
+
readonly runFinished: "RUN_FINISHED";
|
|
21
|
+
};
|
|
22
|
+
/** Normalized AG-UI runtime event type value. */
|
|
23
|
+
export type AgUiSseEventType = (typeof agUiSseEventTypes)[keyof typeof agUiSseEventTypes];
|
|
24
|
+
/** Parsed AG-UI SSE response summary for evals, canaries, and host tests. */
|
|
25
|
+
export interface ParsedAgUiSseRun {
|
|
26
|
+
responseStatus: number;
|
|
27
|
+
events: Array<Record<string, unknown>>;
|
|
28
|
+
eventTypes: string[];
|
|
29
|
+
toolStarts: string[];
|
|
30
|
+
toolArgs: string[];
|
|
31
|
+
text: string;
|
|
32
|
+
runError: string | null;
|
|
33
|
+
}
|
|
34
|
+
/** Progress snapshot emitted while parsing an AG-UI SSE response. */
|
|
35
|
+
export interface AgUiSseProgressSnapshot {
|
|
36
|
+
eventCount: number;
|
|
37
|
+
lastEventType: string | null;
|
|
38
|
+
lastToolCallName: string | null;
|
|
39
|
+
toolStarts: string[];
|
|
40
|
+
textLength: number;
|
|
41
|
+
}
|
|
42
|
+
/** Options for `parseAgUiSseResponse()`. */
|
|
43
|
+
export interface ParseAgUiSseResponseOptions {
|
|
44
|
+
onProgress?: (snapshot: AgUiSseProgressSnapshot) => void;
|
|
45
|
+
progressThrottleMs?: number;
|
|
46
|
+
}
|
|
47
|
+
/** Stringify an AG-UI SSE event or fallback value for diagnostics. */
|
|
48
|
+
export declare function stringifyAgUiSseEvent(value: unknown): string;
|
|
49
|
+
/** Return a string field from a parsed AG-UI SSE event record. */
|
|
50
|
+
export declare function getAgUiSseStringField(record: Record<string, unknown>, key: string): string | null;
|
|
51
|
+
/** Filter parsed AG-UI SSE events by normalized event type. */
|
|
52
|
+
export declare function getAgUiSseEventsOfType(events: Array<Record<string, unknown>>, eventType: string): Array<Record<string, unknown>>;
|
|
53
|
+
/** Build a compact ordered event-type signature for regression checks. */
|
|
54
|
+
export declare function buildAgUiSseTraceSignature(eventTypes: string[]): string;
|
|
55
|
+
/** Parse an AG-UI SSE `Response` into normalized events, text, tool starts, and terminal error state. */
|
|
56
|
+
export declare function parseAgUiSseResponse(response: Response, options?: ParseAgUiSseResponseOptions): Promise<ParsedAgUiSseRun>;
|
|
57
|
+
//# sourceMappingURL=sse-parser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sse-parser.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/ag-ui/sse-parser.ts"],"names":[],"mappings":"AAGA,kFAAkF;AAClF,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;CAmBpB,CAAC;AAEX,iDAAiD;AACjD,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,OAAO,iBAAiB,CAAC,CAAC;AAE1F,6EAA6E;AAC7E,MAAM,WAAW,gBAAgB;IAC/B,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACvC,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED,qEAAqE;AACrE,MAAM,WAAW,uBAAuB;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,4CAA4C;AAC5C,MAAM,WAAW,2BAA2B;IAC1C,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,uBAAuB,KAAK,IAAI,CAAC;IACzD,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,sEAAsE;AACtE,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAE5D;AAED,kEAAkE;AAClE,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAGjG;AAED,+DAA+D;AAC/D,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EACtC,SAAS,EAAE,MAAM,GAChB,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAEhC;AAED,0EAA0E;AAC1E,wBAAgB,0BAA0B,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,MAAM,CAEvE;AAoLD,yGAAyG;AACzG,wBAAsB,oBAAoB,CACxC,QAAQ,EAAE,QAAQ,EAClB,OAAO,GAAE,2BAAgC,GACxC,OAAO,CAAC,gBAAgB,CAAC,CA6C3B"}
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import { isRecord } from "../../chat/conversation.js";
|
|
2
|
+
import { safeJsonParse } from "../../chat/provider-errors.js";
|
|
3
|
+
/** AG-UI runtime event type constants normalized from browser-wire SSE events. */
|
|
4
|
+
export const agUiSseEventTypes = {
|
|
5
|
+
custom: "CUSTOM",
|
|
6
|
+
textMessageStart: "TEXT_MESSAGE_START",
|
|
7
|
+
textMessageContent: "TEXT_MESSAGE_CONTENT",
|
|
8
|
+
textMessageEnd: "TEXT_MESSAGE_END",
|
|
9
|
+
reasoningMessageStart: "REASONING_MESSAGE_START",
|
|
10
|
+
reasoningMessageContent: "REASONING_MESSAGE_CONTENT",
|
|
11
|
+
reasoningMessageEnd: "REASONING_MESSAGE_END",
|
|
12
|
+
toolCallStart: "TOOL_CALL_START",
|
|
13
|
+
toolCallArgs: "TOOL_CALL_ARGS",
|
|
14
|
+
toolCallEnd: "TOOL_CALL_END",
|
|
15
|
+
toolCallResult: "TOOL_CALL_RESULT",
|
|
16
|
+
runStarted: "RUN_STARTED",
|
|
17
|
+
stateSnapshot: "STATE_SNAPSHOT",
|
|
18
|
+
messagesSnapshot: "MESSAGES_SNAPSHOT",
|
|
19
|
+
stepStarted: "STEP_STARTED",
|
|
20
|
+
stepFinished: "STEP_FINISHED",
|
|
21
|
+
runError: "RUN_ERROR",
|
|
22
|
+
runFinished: "RUN_FINISHED",
|
|
23
|
+
};
|
|
24
|
+
/** Stringify an AG-UI SSE event or fallback value for diagnostics. */
|
|
25
|
+
export function stringifyAgUiSseEvent(value) {
|
|
26
|
+
return JSON.stringify(value) ?? String(value);
|
|
27
|
+
}
|
|
28
|
+
/** Return a string field from a parsed AG-UI SSE event record. */
|
|
29
|
+
export function getAgUiSseStringField(record, key) {
|
|
30
|
+
const value = record[key];
|
|
31
|
+
return typeof value === "string" ? value : null;
|
|
32
|
+
}
|
|
33
|
+
/** Filter parsed AG-UI SSE events by normalized event type. */
|
|
34
|
+
export function getAgUiSseEventsOfType(events, eventType) {
|
|
35
|
+
return events.filter((event) => getAgUiSseStringField(event, "type") === eventType);
|
|
36
|
+
}
|
|
37
|
+
/** Build a compact ordered event-type signature for regression checks. */
|
|
38
|
+
export function buildAgUiSseTraceSignature(eventTypes) {
|
|
39
|
+
return eventTypes.join(" > ");
|
|
40
|
+
}
|
|
41
|
+
function serializeToolResult(value) {
|
|
42
|
+
if (typeof value === "string") {
|
|
43
|
+
return value;
|
|
44
|
+
}
|
|
45
|
+
try {
|
|
46
|
+
return JSON.stringify(value ?? null);
|
|
47
|
+
}
|
|
48
|
+
catch {
|
|
49
|
+
return String(value);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
function createEmptyParsedRun(responseStatus) {
|
|
53
|
+
return {
|
|
54
|
+
responseStatus,
|
|
55
|
+
events: [],
|
|
56
|
+
eventTypes: [],
|
|
57
|
+
toolStarts: [],
|
|
58
|
+
toolArgs: [],
|
|
59
|
+
text: "",
|
|
60
|
+
runError: null,
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
function createProgressSnapshot(run) {
|
|
64
|
+
const lastEvent = run.events.at(-1);
|
|
65
|
+
const lastToolStart = [...run.events]
|
|
66
|
+
.reverse()
|
|
67
|
+
.find((event) => getAgUiSseStringField(event, "type") === agUiSseEventTypes.toolCallStart);
|
|
68
|
+
return {
|
|
69
|
+
eventCount: run.events.length,
|
|
70
|
+
lastEventType: lastEvent ? getAgUiSseStringField(lastEvent, "type") : null,
|
|
71
|
+
lastToolCallName: lastToolStart ? getAgUiSseStringField(lastToolStart, "toolCallName") : null,
|
|
72
|
+
toolStarts: [...run.toolStarts],
|
|
73
|
+
textLength: run.text.length,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
function applyParsedEvent(run, event) {
|
|
77
|
+
run.events.push(event);
|
|
78
|
+
const type = getAgUiSseStringField(event, "type");
|
|
79
|
+
if (type) {
|
|
80
|
+
run.eventTypes.push(type);
|
|
81
|
+
}
|
|
82
|
+
if (type === agUiSseEventTypes.toolCallStart) {
|
|
83
|
+
const toolCallName = getAgUiSseStringField(event, "toolCallName");
|
|
84
|
+
if (toolCallName) {
|
|
85
|
+
run.toolStarts.push(toolCallName);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
if (type === agUiSseEventTypes.toolCallArgs) {
|
|
89
|
+
const delta = getAgUiSseStringField(event, "delta");
|
|
90
|
+
if (delta) {
|
|
91
|
+
run.toolArgs.push(delta);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
if (type === agUiSseEventTypes.textMessageContent) {
|
|
95
|
+
const delta = getAgUiSseStringField(event, "delta");
|
|
96
|
+
if (delta) {
|
|
97
|
+
run.text += delta;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
function coerceBrowserWireEvent(eventName, payload) {
|
|
102
|
+
switch (eventName) {
|
|
103
|
+
case "RunStarted":
|
|
104
|
+
return { type: agUiSseEventTypes.runStarted, ...payload };
|
|
105
|
+
case "StateSnapshot":
|
|
106
|
+
return { type: agUiSseEventTypes.stateSnapshot, ...payload };
|
|
107
|
+
case "MessagesSnapshot":
|
|
108
|
+
return { type: agUiSseEventTypes.messagesSnapshot, ...payload };
|
|
109
|
+
case "TextMessageStart":
|
|
110
|
+
return { type: agUiSseEventTypes.textMessageStart, ...payload };
|
|
111
|
+
case "TextMessageContent":
|
|
112
|
+
return { type: agUiSseEventTypes.textMessageContent, ...payload };
|
|
113
|
+
case "TextMessageEnd":
|
|
114
|
+
return { type: agUiSseEventTypes.textMessageEnd, ...payload };
|
|
115
|
+
case "ReasoningMessageStart":
|
|
116
|
+
return { type: agUiSseEventTypes.reasoningMessageStart, ...payload };
|
|
117
|
+
case "ReasoningMessageContent":
|
|
118
|
+
return { type: agUiSseEventTypes.reasoningMessageContent, ...payload };
|
|
119
|
+
case "ReasoningMessageEnd":
|
|
120
|
+
return { type: agUiSseEventTypes.reasoningMessageEnd, ...payload };
|
|
121
|
+
case "StepStarted":
|
|
122
|
+
return { type: agUiSseEventTypes.stepStarted, ...payload };
|
|
123
|
+
case "StepFinished":
|
|
124
|
+
return { type: agUiSseEventTypes.stepFinished, ...payload };
|
|
125
|
+
case "ToolCallStart":
|
|
126
|
+
return { type: agUiSseEventTypes.toolCallStart, ...payload };
|
|
127
|
+
case "ToolCallArgs":
|
|
128
|
+
return { type: agUiSseEventTypes.toolCallArgs, ...payload };
|
|
129
|
+
case "ToolCallEnd":
|
|
130
|
+
return { type: agUiSseEventTypes.toolCallEnd, ...payload };
|
|
131
|
+
case "ToolCallResult":
|
|
132
|
+
return {
|
|
133
|
+
type: agUiSseEventTypes.toolCallResult,
|
|
134
|
+
...payload,
|
|
135
|
+
...(payload.result !== undefined ? { content: serializeToolResult(payload.result) } : {}),
|
|
136
|
+
};
|
|
137
|
+
case "Custom":
|
|
138
|
+
return { type: agUiSseEventTypes.custom, ...payload };
|
|
139
|
+
case "RunError":
|
|
140
|
+
return { type: agUiSseEventTypes.runError, ...payload };
|
|
141
|
+
case "RunFinished":
|
|
142
|
+
return { type: agUiSseEventTypes.runFinished, ...payload };
|
|
143
|
+
default:
|
|
144
|
+
return { type: eventName, ...payload };
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
function normalizeParsedEvent(payload, eventName) {
|
|
148
|
+
if (typeof payload.type === "string") {
|
|
149
|
+
return payload;
|
|
150
|
+
}
|
|
151
|
+
if (!eventName) {
|
|
152
|
+
return null;
|
|
153
|
+
}
|
|
154
|
+
return coerceBrowserWireEvent(eventName, payload);
|
|
155
|
+
}
|
|
156
|
+
function consumeSseBuffer(run, buffer, options, state) {
|
|
157
|
+
let nextBuffer = buffer;
|
|
158
|
+
let separatorIndex = nextBuffer.indexOf("\n\n");
|
|
159
|
+
while (separatorIndex !== -1) {
|
|
160
|
+
const entry = nextBuffer.slice(0, separatorIndex).trim();
|
|
161
|
+
nextBuffer = nextBuffer.slice(separatorIndex + 2);
|
|
162
|
+
const eventName = entry
|
|
163
|
+
.split("\n")
|
|
164
|
+
.flatMap((line) => line.startsWith("event:") ? [line.slice("event:".length).trimStart()] : [])[0] ?? null;
|
|
165
|
+
const data = entry
|
|
166
|
+
.split("\n")
|
|
167
|
+
.flatMap((line) => line.startsWith("data:") ? [line.slice("data:".length).trimStart()] : [])
|
|
168
|
+
.join("\n");
|
|
169
|
+
if (data.length > 0 && data !== "[DONE]") {
|
|
170
|
+
const parsed = safeJsonParse(data);
|
|
171
|
+
if (parsed.ok && isRecord(parsed.value)) {
|
|
172
|
+
const normalizedEvent = normalizeParsedEvent(parsed.value, eventName);
|
|
173
|
+
if (normalizedEvent) {
|
|
174
|
+
applyParsedEvent(run, normalizedEvent);
|
|
175
|
+
const now = Date.now();
|
|
176
|
+
if (options.onProgress && now - state.lastProgressAt >= state.progressThrottleMs) {
|
|
177
|
+
options.onProgress(createProgressSnapshot(run));
|
|
178
|
+
state.lastProgressAt = now;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
separatorIndex = nextBuffer.indexOf("\n\n");
|
|
184
|
+
}
|
|
185
|
+
return nextBuffer;
|
|
186
|
+
}
|
|
187
|
+
/** Parse an AG-UI SSE `Response` into normalized events, text, tool starts, and terminal error state. */
|
|
188
|
+
export async function parseAgUiSseResponse(response, options = {}) {
|
|
189
|
+
const run = createEmptyParsedRun(response.status);
|
|
190
|
+
const decoder = new TextDecoder();
|
|
191
|
+
const rawChunks = [];
|
|
192
|
+
const state = { lastProgressAt: 0, progressThrottleMs: options.progressThrottleMs ?? 15_000 };
|
|
193
|
+
if (!response.body) {
|
|
194
|
+
const body = await response.text();
|
|
195
|
+
rawChunks.push(body);
|
|
196
|
+
}
|
|
197
|
+
else {
|
|
198
|
+
const reader = response.body.getReader();
|
|
199
|
+
let buffer = "";
|
|
200
|
+
while (true) {
|
|
201
|
+
const result = await reader.read();
|
|
202
|
+
if (result.done) {
|
|
203
|
+
const tail = decoder.decode();
|
|
204
|
+
if (tail.length > 0) {
|
|
205
|
+
rawChunks.push(tail);
|
|
206
|
+
buffer += tail;
|
|
207
|
+
}
|
|
208
|
+
break;
|
|
209
|
+
}
|
|
210
|
+
const decoded = decoder.decode(result.value, { stream: true });
|
|
211
|
+
rawChunks.push(decoded);
|
|
212
|
+
buffer += decoded;
|
|
213
|
+
buffer = consumeSseBuffer(run, buffer, options, state);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
if (options.onProgress) {
|
|
217
|
+
options.onProgress(createProgressSnapshot(run));
|
|
218
|
+
}
|
|
219
|
+
run.text = run.text.trim();
|
|
220
|
+
const runErrorEvent = getAgUiSseEventsOfType(run.events, agUiSseEventTypes.runError)[0];
|
|
221
|
+
run.runError = runErrorEvent && typeof runErrorEvent.message === "string"
|
|
222
|
+
? runErrorEvent.message
|
|
223
|
+
: response.ok
|
|
224
|
+
? null
|
|
225
|
+
: rawChunks.join("").trim() || `${response.status}`;
|
|
226
|
+
return run;
|
|
227
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Tool } from "../../tool/types.js";
|
|
2
|
+
import type { RunResumeSessionManager } from "../runtime/index.js";
|
|
3
|
+
import type { Agent } from "../types.js";
|
|
4
|
+
export type AgUiResumeValue = {
|
|
5
|
+
result: unknown;
|
|
6
|
+
isError: boolean;
|
|
7
|
+
};
|
|
8
|
+
export interface AgUiInjectedToolLike {
|
|
9
|
+
name: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
parameters?: unknown;
|
|
12
|
+
}
|
|
13
|
+
export declare function createInjectedAgUiTool(runId: string, tool: AgUiInjectedToolLike, sessionManager: RunResumeSessionManager<AgUiResumeValue>): Tool;
|
|
14
|
+
export declare function buildMergedAgUiTools(agent: Agent, runId: string, tools: AgUiInjectedToolLike[], sessionManager: RunResumeSessionManager<AgUiResumeValue>): Agent["config"]["tools"];
|
|
15
|
+
//# sourceMappingURL=tool-shared.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-shared.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/ag-ui/tool-shared.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEzC,MAAM,MAAM,eAAe,GAAG;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC;AAIpE,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,oBAAoB,EAC1B,cAAc,EAAE,uBAAuB,CAAC,eAAe,CAAC,GACvD,IAAI,CA0BN;AAED,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,oBAAoB,EAAE,EAC7B,cAAc,EAAE,uBAAuB,CAAC,eAAe,CAAC,GACvD,KAAK,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAwB1B"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { defineSchema } from "../../schemas/index.js";
|
|
2
|
+
import { SKILL_TOOL_IDS } from "../../skill/types.js";
|
|
3
|
+
import { toolRegistry } from "../../tool/registry.js";
|
|
4
|
+
const getAnyObjectSchema = defineSchema((v) => v.record(v.string(), v.unknown()));
|
|
5
|
+
export function createInjectedAgUiTool(runId, tool, sessionManager) {
|
|
6
|
+
return {
|
|
7
|
+
id: tool.name,
|
|
8
|
+
type: "function",
|
|
9
|
+
description: tool.description ?? tool.name,
|
|
10
|
+
inputSchema: getAnyObjectSchema(),
|
|
11
|
+
inputSchemaJson: (tool.parameters ??
|
|
12
|
+
{ type: "object", properties: {}, additionalProperties: true }),
|
|
13
|
+
execute: async (_input, context) => {
|
|
14
|
+
const toolCallId = typeof context?.toolCallId === "string" ? context.toolCallId : null;
|
|
15
|
+
if (!toolCallId) {
|
|
16
|
+
throw new Error(`Missing toolCallId for injected tool "${tool.name}"`);
|
|
17
|
+
}
|
|
18
|
+
sessionManager.prepareForSignal(runId, toolCallId);
|
|
19
|
+
const submitted = await sessionManager.waitForSignal(runId, toolCallId);
|
|
20
|
+
if (submitted.isError) {
|
|
21
|
+
throw new Error(typeof submitted.result === "string"
|
|
22
|
+
? submitted.result
|
|
23
|
+
: JSON.stringify(submitted.result));
|
|
24
|
+
}
|
|
25
|
+
return submitted.result;
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export function buildMergedAgUiTools(agent, runId, tools, sessionManager) {
|
|
30
|
+
const injectedTools = Object.fromEntries(tools.map((tool) => [
|
|
31
|
+
tool.name,
|
|
32
|
+
createInjectedAgUiTool(runId, tool, sessionManager),
|
|
33
|
+
]));
|
|
34
|
+
if (!agent.config.tools) {
|
|
35
|
+
return Object.keys(injectedTools).length > 0 ? injectedTools : undefined;
|
|
36
|
+
}
|
|
37
|
+
if (agent.config.tools === true) {
|
|
38
|
+
const merged = {};
|
|
39
|
+
for (const [toolId] of toolRegistry.getAll()) {
|
|
40
|
+
if (!agent.config.skills && SKILL_TOOL_IDS.has(toolId)) {
|
|
41
|
+
continue;
|
|
42
|
+
}
|
|
43
|
+
merged[toolId] = true;
|
|
44
|
+
}
|
|
45
|
+
return { ...merged, ...injectedTools };
|
|
46
|
+
}
|
|
47
|
+
return { ...agent.config.tools, ...injectedTools };
|
|
48
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { AgUiBrowserFinalizeTracker } from "./browser-finalize-tracker.js";
|
|
2
|
+
import type { AgUiChunkEncoderBridge } from "./chunk-encoder-bridge.js";
|
|
3
|
+
import { type CreateAgUiRuntimeBrowserResponseInput } from "./runtime-browser-response.js";
|
|
4
|
+
export interface CreateAgUiTrackedBrowserResponseInput<TChunk> extends Omit<CreateAgUiRuntimeBrowserResponseInput<TChunk, null>, "encoder" | "initialState" | "onChunk" | "getFinalResponse"> {
|
|
5
|
+
chunkEncoder: Pick<AgUiChunkEncoderBridge<TChunk>, "encode" | "finalize">;
|
|
6
|
+
finalizeTracker: Pick<AgUiBrowserFinalizeTracker<TChunk>, "observeChunk" | "observeEncodedEvents" | "getFinalResponse">;
|
|
7
|
+
}
|
|
8
|
+
export declare function createAgUiTrackedBrowserResponse<TChunk>(input: CreateAgUiTrackedBrowserResponseInput<TChunk>): Response;
|
|
9
|
+
//# sourceMappingURL=tracked-browser-response.d.ts.map
|