stitchkit 0.133.2 → 0.134.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +115 -0
- package/README.md +14 -11
- package/dist/agent-executor/acp/v1-connect.d.ts +3 -0
- package/dist/agent-executor/acp/v1-connect.d.ts.map +1 -1
- package/dist/agent-executor/acp/v1-map.d.ts +13 -3
- package/dist/agent-executor/acp/v1-map.d.ts.map +1 -1
- package/dist/agent-executor/acp/v1-protocol.d.ts +59 -0
- package/dist/agent-executor/acp/v1-protocol.d.ts.map +1 -1
- package/dist/agent-executor/codex/connect.d.ts +2 -0
- package/dist/agent-executor/codex/connect.d.ts.map +1 -1
- package/dist/agent-executor/codex/driver.d.ts +3 -0
- package/dist/agent-executor/codex/driver.d.ts.map +1 -1
- package/dist/agent-executor/contract.d.ts +42 -0
- package/dist/agent-executor/contract.d.ts.map +1 -1
- package/dist/agent-executor/engine-process.d.ts +20 -0
- package/dist/agent-executor/engine-process.d.ts.map +1 -1
- package/dist/agent-executor/executor-contract.d.ts +42 -0
- package/dist/agent-executor/executor-contract.d.ts.map +1 -1
- package/dist/agent-executor/handoff-schemas.d.ts +30 -0
- package/dist/agent-executor/handoff-schemas.d.ts.map +1 -1
- package/dist/agent-executor/projection.d.ts.map +1 -1
- package/dist/agent-executor/session-primitives.d.ts +4 -1
- package/dist/agent-executor/session-primitives.d.ts.map +1 -1
- package/dist/agent-executor/vocabulary.d.ts +100 -0
- package/dist/agent-executor/vocabulary.d.ts.map +1 -1
- package/dist/agent-parts/model.d.ts +1559 -0
- package/dist/agent-parts/model.d.ts.map +1 -0
- package/dist/agent-parts/parts.d.ts +21 -0
- package/dist/agent-parts/parts.d.ts.map +1 -1
- package/dist/agent-runtime/ai-sdk-convert.d.ts +15 -0
- package/dist/agent-runtime/ai-sdk-convert.d.ts.map +1 -0
- package/dist/agent-runtime/ai-sdk.d.ts +31 -0
- package/dist/agent-runtime/ai-sdk.d.ts.map +1 -0
- package/dist/agent-runtime/anthropic-media.d.ts +11 -0
- package/dist/agent-runtime/anthropic-media.d.ts.map +1 -0
- package/dist/agent-runtime/anthropic-messages.d.ts +24 -0
- package/dist/agent-runtime/anthropic-messages.d.ts.map +1 -0
- package/dist/agent-runtime/anthropic-options.d.ts +79 -0
- package/dist/agent-runtime/anthropic-options.d.ts.map +1 -0
- package/dist/agent-runtime/anthropic-response.d.ts +19 -0
- package/dist/agent-runtime/anthropic-response.d.ts.map +1 -0
- package/dist/agent-runtime/anthropic-sse.d.ts +4 -0
- package/dist/agent-runtime/anthropic-sse.d.ts.map +1 -0
- package/dist/agent-runtime/anthropic.d.ts +27 -0
- package/dist/agent-runtime/anthropic.d.ts.map +1 -0
- package/dist/agent-runtime/branch-observations.d.ts +25 -25
- package/dist/agent-runtime/branch-provider.d.ts +86 -0
- package/dist/agent-runtime/branch-provider.d.ts.map +1 -1
- package/dist/agent-runtime/branch-replay.d.ts +30 -0
- package/dist/agent-runtime/branch-replay.d.ts.map +1 -1
- package/dist/agent-runtime/browser-control-contract.d.ts +204 -0
- package/dist/agent-runtime/browser-control-contract.d.ts.map +1 -1
- package/dist/agent-runtime/browser-controller-view.d.ts +44 -0
- package/dist/agent-runtime/browser-controller-view.d.ts.map +1 -0
- package/dist/agent-runtime/browser-controller.d.ts +12 -8
- package/dist/agent-runtime/browser-controller.d.ts.map +1 -1
- package/dist/agent-runtime/child-budget-policy.d.ts +2 -3
- package/dist/agent-runtime/child-budget-policy.d.ts.map +1 -1
- package/dist/agent-runtime/compaction.d.ts +27 -10
- package/dist/agent-runtime/compaction.d.ts.map +1 -1
- package/dist/agent-runtime/control-interaction-schema.d.ts +157 -0
- package/dist/agent-runtime/control-interaction-schema.d.ts.map +1 -0
- package/dist/agent-runtime/control-schema.d.ts +183 -27
- package/dist/agent-runtime/control-schema.d.ts.map +1 -1
- package/dist/agent-runtime/control-view.d.ts +64 -0
- package/dist/agent-runtime/control-view.d.ts.map +1 -0
- package/dist/agent-runtime/conversations.d.ts +10 -0
- package/dist/agent-runtime/conversations.d.ts.map +1 -1
- package/dist/agent-runtime/deferred-tool-selection.d.ts +2 -2
- package/dist/agent-runtime/deferred-tool-selection.d.ts.map +1 -1
- package/dist/agent-runtime/deferred-tool-types.d.ts +2 -2
- package/dist/agent-runtime/deferred-tool-types.d.ts.map +1 -1
- package/dist/agent-runtime/deferred-tools-internal.d.ts +8 -11
- package/dist/agent-runtime/deferred-tools-internal.d.ts.map +1 -1
- package/dist/agent-runtime/deferred-tools.d.ts.map +1 -1
- package/dist/agent-runtime/event-schema.d.ts +80 -0
- package/dist/agent-runtime/event-schema.d.ts.map +1 -1
- package/dist/agent-runtime/harness-contract.d.ts +2 -2
- package/dist/agent-runtime/harness-contract.d.ts.map +1 -1
- package/dist/agent-runtime/harness-control.d.ts.map +1 -1
- package/dist/agent-runtime/harness-realtime.d.ts.map +1 -1
- package/dist/agent-runtime/harness.d.ts +2 -2
- package/dist/agent-runtime/harness.d.ts.map +1 -1
- package/dist/agent-runtime/history.d.ts +25 -16
- package/dist/agent-runtime/history.d.ts.map +1 -1
- package/dist/agent-runtime/invocation-attempt.d.ts +7 -3
- package/dist/agent-runtime/invocation-attempt.d.ts.map +1 -1
- package/dist/agent-runtime/invocation-payload.d.ts +13 -7
- package/dist/agent-runtime/invocation-payload.d.ts.map +1 -1
- package/dist/agent-runtime/invocation-stream.d.ts +20 -0
- package/dist/agent-runtime/invocation-stream.d.ts.map +1 -0
- package/dist/agent-runtime/invocations.d.ts +2 -2
- package/dist/agent-runtime/invocations.d.ts.map +1 -1
- package/dist/agent-runtime/models-driver-step.d.ts +212 -0
- package/dist/agent-runtime/models-driver-step.d.ts.map +1 -0
- package/dist/agent-runtime/models-driver-telemetry.d.ts +42 -0
- package/dist/agent-runtime/models-driver-telemetry.d.ts.map +1 -0
- package/dist/agent-runtime/models-driver.d.ts +235 -0
- package/dist/agent-runtime/models-driver.d.ts.map +1 -0
- package/dist/agent-runtime/models.d.ts +3 -26
- package/dist/agent-runtime/models.d.ts.map +1 -1
- package/dist/agent-runtime/observability.d.ts +64 -0
- package/dist/agent-runtime/observability.d.ts.map +1 -1
- package/dist/agent-runtime/openai-messages.d.ts +11 -0
- package/dist/agent-runtime/openai-messages.d.ts.map +1 -0
- package/dist/agent-runtime/openai-options.d.ts +91 -0
- package/dist/agent-runtime/openai-options.d.ts.map +1 -0
- package/dist/agent-runtime/openai-response.d.ts +77 -0
- package/dist/agent-runtime/openai-response.d.ts.map +1 -0
- package/dist/agent-runtime/openai-sse-state.d.ts +54 -0
- package/dist/agent-runtime/openai-sse-state.d.ts.map +1 -0
- package/dist/agent-runtime/openai-sse.d.ts +4 -0
- package/dist/agent-runtime/openai-sse.d.ts.map +1 -0
- package/dist/agent-runtime/openai.d.ts +31 -0
- package/dist/agent-runtime/openai.d.ts.map +1 -0
- package/dist/agent-runtime/openrouter-admission.d.ts +3 -0
- package/dist/agent-runtime/openrouter-admission.d.ts.map +1 -1
- package/dist/agent-runtime/openrouter-benchmarks.d.ts +17 -0
- package/dist/agent-runtime/openrouter-benchmarks.d.ts.map +1 -0
- package/dist/agent-runtime/openrouter-catalog-cache.d.ts +70 -0
- package/dist/agent-runtime/openrouter-catalog-cache.d.ts.map +1 -0
- package/dist/agent-runtime/openrouter-catalog-query.d.ts +57 -0
- package/dist/agent-runtime/openrouter-catalog-query.d.ts.map +1 -0
- package/dist/agent-runtime/openrouter-catalog.d.ts +189 -14
- package/dist/agent-runtime/openrouter-catalog.d.ts.map +1 -1
- package/dist/agent-runtime/openrouter-models.d.ts +168 -31
- package/dist/agent-runtime/openrouter-models.d.ts.map +1 -1
- package/dist/agent-runtime/openrouter-options.d.ts +45 -15
- package/dist/agent-runtime/openrouter-options.d.ts.map +1 -1
- package/dist/agent-runtime/openrouter-response.d.ts +22 -0
- package/dist/agent-runtime/openrouter-response.d.ts.map +1 -0
- package/dist/agent-runtime/openrouter.d.ts +21 -24
- package/dist/agent-runtime/openrouter.d.ts.map +1 -1
- package/dist/agent-runtime/owned-provider-stream.d.ts +4 -4
- package/dist/agent-runtime/owned-provider-stream.d.ts.map +1 -1
- package/dist/agent-runtime/prompt.d.ts +3 -3
- package/dist/agent-runtime/prompt.d.ts.map +1 -1
- package/dist/agent-runtime/protocol.d.ts +28 -3
- package/dist/agent-runtime/protocol.d.ts.map +1 -1
- package/dist/agent-runtime/provider-cache.d.ts +30 -0
- package/dist/agent-runtime/provider-cache.d.ts.map +1 -0
- package/dist/agent-runtime/provider-content.d.ts +147 -0
- package/dist/agent-runtime/provider-content.d.ts.map +1 -1
- package/dist/agent-runtime/provider-failure.d.ts +51 -26
- package/dist/agent-runtime/provider-failure.d.ts.map +1 -1
- package/dist/agent-runtime/provider-history.d.ts +13 -0
- package/dist/agent-runtime/provider-history.d.ts.map +1 -0
- package/dist/agent-runtime/provider-http.d.ts +68 -0
- package/dist/agent-runtime/provider-http.d.ts.map +1 -0
- package/dist/agent-runtime/provider-journal.d.ts +149 -0
- package/dist/agent-runtime/provider-journal.d.ts.map +1 -1
- package/dist/agent-runtime/provider-json-schema-strip.d.ts +8 -0
- package/dist/agent-runtime/provider-json-schema-strip.d.ts.map +1 -0
- package/dist/agent-runtime/provider-json-schema.d.ts +28 -0
- package/dist/agent-runtime/provider-json-schema.d.ts.map +1 -0
- package/dist/agent-runtime/provider-media.d.ts +49 -0
- package/dist/agent-runtime/provider-media.d.ts.map +1 -0
- package/dist/agent-runtime/provider-openai-chat-helpers.d.ts +27 -0
- package/dist/agent-runtime/provider-openai-chat-helpers.d.ts.map +1 -0
- package/dist/agent-runtime/provider-openai-chat-sse.d.ts +25 -0
- package/dist/agent-runtime/provider-openai-chat-sse.d.ts.map +1 -0
- package/dist/agent-runtime/provider-openai-chat.d.ts +27 -0
- package/dist/agent-runtime/provider-openai-chat.d.ts.map +1 -0
- package/dist/agent-runtime/provider-origin.d.ts +3 -12
- package/dist/agent-runtime/provider-origin.d.ts.map +1 -1
- package/dist/agent-runtime/provider-sse.d.ts +30 -0
- package/dist/agent-runtime/provider-sse.d.ts.map +1 -0
- package/dist/agent-runtime/provider-stream-parts.d.ts +5 -0
- package/dist/agent-runtime/provider-stream-parts.d.ts.map +1 -0
- package/dist/agent-runtime/provider-stream-segments.d.ts +63 -0
- package/dist/agent-runtime/provider-stream-segments.d.ts.map +1 -0
- package/dist/agent-runtime/provider-usage.d.ts +24 -0
- package/dist/agent-runtime/provider-usage.d.ts.map +1 -0
- package/dist/agent-runtime/retry-policy.d.ts +19 -3
- package/dist/agent-runtime/retry-policy.d.ts.map +1 -1
- package/dist/agent-runtime/run-acquisition.d.ts +4 -4
- package/dist/agent-runtime/run-acquisition.d.ts.map +1 -1
- package/dist/agent-runtime/run-approval.d.ts +82 -0
- package/dist/agent-runtime/run-approval.d.ts.map +1 -0
- package/dist/agent-runtime/run-complete-retry.d.ts +24 -0
- package/dist/agent-runtime/run-complete-retry.d.ts.map +1 -0
- package/dist/agent-runtime/run-complete-stream.d.ts +9 -0
- package/dist/agent-runtime/run-complete-stream.d.ts.map +1 -0
- package/dist/agent-runtime/run-complete-tools.d.ts +21 -0
- package/dist/agent-runtime/run-complete-tools.d.ts.map +1 -0
- package/dist/agent-runtime/run-complete-types.d.ts +168 -0
- package/dist/agent-runtime/run-complete-types.d.ts.map +1 -0
- package/dist/agent-runtime/run-complete.d.ts +25 -0
- package/dist/agent-runtime/run-complete.d.ts.map +1 -0
- package/dist/agent-runtime/run-driver-compose.d.ts +21 -0
- package/dist/agent-runtime/run-driver-compose.d.ts.map +1 -0
- package/dist/agent-runtime/run-execution-state.d.ts +23 -10
- package/dist/agent-runtime/run-execution-state.d.ts.map +1 -1
- package/dist/agent-runtime/run-execution.d.ts +2 -2
- package/dist/agent-runtime/run-execution.d.ts.map +1 -1
- package/dist/agent-runtime/run-failure.d.ts +2 -2
- package/dist/agent-runtime/run-failure.d.ts.map +1 -1
- package/dist/agent-runtime/run-history-parts.d.ts +14 -0
- package/dist/agent-runtime/run-history-parts.d.ts.map +1 -0
- package/dist/agent-runtime/run-loop-events.d.ts +126 -0
- package/dist/agent-runtime/run-loop-events.d.ts.map +1 -0
- package/dist/agent-runtime/run-model-attempts.d.ts +2 -2
- package/dist/agent-runtime/run-model-attempts.d.ts.map +1 -1
- package/dist/agent-runtime/run-model-messages.d.ts +9 -0
- package/dist/agent-runtime/run-model-messages.d.ts.map +1 -0
- package/dist/agent-runtime/run-model-step.d.ts +43 -0
- package/dist/agent-runtime/run-model-step.d.ts.map +1 -0
- package/dist/agent-runtime/run-model-stream.d.ts +27 -0
- package/dist/agent-runtime/run-model-stream.d.ts.map +1 -0
- package/dist/agent-runtime/run-operation-lifecycle.d.ts +8 -4
- package/dist/agent-runtime/run-operation-lifecycle.d.ts.map +1 -1
- package/dist/agent-runtime/run-prompt-history.d.ts +8 -13
- package/dist/agent-runtime/run-prompt-history.d.ts.map +1 -1
- package/dist/agent-runtime/run-provider-ledger.d.ts +7 -4
- package/dist/agent-runtime/run-provider-ledger.d.ts.map +1 -1
- package/dist/agent-runtime/run-step-barriers.d.ts +58 -16
- package/dist/agent-runtime/run-step-barriers.d.ts.map +1 -1
- package/dist/agent-runtime/run-step-helpers.d.ts +49 -0
- package/dist/agent-runtime/run-step-helpers.d.ts.map +1 -0
- package/dist/agent-runtime/run-step-prepare.d.ts +34 -0
- package/dist/agent-runtime/run-step-prepare.d.ts.map +1 -0
- package/dist/agent-runtime/run-step-spend.d.ts +85 -10
- package/dist/agent-runtime/run-step-spend.d.ts.map +1 -1
- package/dist/agent-runtime/run-stream-parts.d.ts +13 -9
- package/dist/agent-runtime/run-stream-parts.d.ts.map +1 -1
- package/dist/agent-runtime/run-stream-recorded.d.ts +8 -0
- package/dist/agent-runtime/run-stream-recorded.d.ts.map +1 -0
- package/dist/agent-runtime/run-stream-step-text.d.ts +29 -0
- package/dist/agent-runtime/run-stream-step-text.d.ts.map +1 -0
- package/dist/agent-runtime/run-terminal.d.ts +3 -3
- package/dist/agent-runtime/run-terminal.d.ts.map +1 -1
- package/dist/agent-runtime/run-tool-approval-flow.d.ts +36 -0
- package/dist/agent-runtime/run-tool-approval-flow.d.ts.map +1 -0
- package/dist/agent-runtime/run-tool-approval-records.d.ts +24 -0
- package/dist/agent-runtime/run-tool-approval-records.d.ts.map +1 -0
- package/dist/agent-runtime/run-tool-call.d.ts +73 -0
- package/dist/agent-runtime/run-tool-call.d.ts.map +1 -0
- package/dist/agent-runtime/run-tool-errors.d.ts +29 -0
- package/dist/agent-runtime/run-tool-errors.d.ts.map +1 -0
- package/dist/agent-runtime/run-tool-executor.d.ts +34 -0
- package/dist/agent-runtime/run-tool-executor.d.ts.map +1 -0
- package/dist/agent-runtime/run-tool-progress.d.ts +2 -2
- package/dist/agent-runtime/run-tool-progress.d.ts.map +1 -1
- package/dist/agent-runtime/run-turn-preparation.d.ts +7 -6
- package/dist/agent-runtime/run-turn-preparation.d.ts.map +1 -1
- package/dist/agent-runtime/run-unacquired.d.ts +2 -2
- package/dist/agent-runtime/run-unacquired.d.ts.map +1 -1
- package/dist/agent-runtime/runtime-control.d.ts +4 -4
- package/dist/agent-runtime/runtime-control.d.ts.map +1 -1
- package/dist/agent-runtime/runtime-internals.d.ts +35 -44
- package/dist/agent-runtime/runtime-internals.d.ts.map +1 -1
- package/dist/agent-runtime/runtime-recovery.d.ts +3 -3
- package/dist/agent-runtime/runtime-recovery.d.ts.map +1 -1
- package/dist/agent-runtime/runtime-state.d.ts +3 -3
- package/dist/agent-runtime/runtime-state.d.ts.map +1 -1
- package/dist/agent-runtime/runtime-submit.d.ts +2 -2
- package/dist/agent-runtime/runtime-submit.d.ts.map +1 -1
- package/dist/agent-runtime/runtime.d.ts +51 -16
- package/dist/agent-runtime/runtime.d.ts.map +1 -1
- package/dist/agent-runtime/sandbox-process-linux.d.ts +8 -0
- package/dist/agent-runtime/sandbox-process-linux.d.ts.map +1 -0
- package/dist/agent-runtime/sandbox-process-macos.d.ts +21 -0
- package/dist/agent-runtime/sandbox-process-macos.d.ts.map +1 -0
- package/dist/agent-runtime/sandbox-process-spec.d.ts +114 -0
- package/dist/agent-runtime/sandbox-process-spec.d.ts.map +1 -0
- package/dist/agent-runtime/sandbox-process-wrapper.d.ts +19 -0
- package/dist/agent-runtime/sandbox-process-wrapper.d.ts.map +1 -0
- package/dist/agent-runtime/schemas-message.d.ts +10 -0
- package/dist/agent-runtime/schemas-message.d.ts.map +1 -1
- package/dist/agent-runtime/schemas-provider.d.ts +2 -0
- package/dist/agent-runtime/schemas-provider.d.ts.map +1 -1
- package/dist/agent-runtime/schemas-run.d.ts +10 -0
- package/dist/agent-runtime/schemas-run.d.ts.map +1 -1
- package/dist/agent-runtime/schemas-usage-state.d.ts +6 -0
- package/dist/agent-runtime/schemas-usage-state.d.ts.map +1 -0
- package/dist/agent-runtime/schemas-usage.d.ts +8 -0
- package/dist/agent-runtime/schemas-usage.d.ts.map +1 -1
- package/dist/agent-runtime/sql-rows.d.ts +20 -10
- package/dist/agent-runtime/sql-rows.d.ts.map +1 -1
- package/dist/agent-runtime/store-conformance-lifecycle.d.ts +40 -20
- package/dist/agent-runtime/store-conformance-lifecycle.d.ts.map +1 -1
- package/dist/agent-runtime/store-conformance-support.d.ts +20 -10
- package/dist/agent-runtime/store-conformance-support.d.ts.map +1 -1
- package/dist/agent-runtime/store-driver-contract.d.ts +70 -0
- package/dist/agent-runtime/store-driver-contract.d.ts.map +1 -1
- package/dist/agent-runtime/store-events.d.ts +120 -0
- package/dist/agent-runtime/store-events.d.ts.map +1 -1
- package/dist/agent-runtime/store.d.ts +140 -0
- package/dist/agent-runtime/store.d.ts.map +1 -1
- package/dist/agent-runtime/terminal-commit.d.ts +10 -0
- package/dist/agent-runtime/terminal-commit.d.ts.map +1 -1
- package/dist/agent-runtime/testing.d.ts +20 -0
- package/dist/agent-runtime/testing.d.ts.map +1 -1
- package/dist/browser/client-call-arguments.d.ts.map +1 -1
- package/dist/browser/client-executors.d.ts.map +1 -1
- package/dist/browser/client-url.d.ts.map +1 -1
- package/dist/browser/client.d.ts +6 -0
- package/dist/browser/client.d.ts.map +1 -1
- package/dist/browser/device-presence-client.d.ts +42 -0
- package/dist/browser/device-presence-client.d.ts.map +1 -0
- package/dist/browser/device-presence-ops.d.ts +47 -0
- package/dist/browser/device-presence-ops.d.ts.map +1 -0
- package/dist/browser/device-presence-relay-adapter.d.ts +37 -0
- package/dist/browser/device-presence-relay-adapter.d.ts.map +1 -0
- package/dist/browser/http-fetch.d.ts +7 -2
- package/dist/browser/http-fetch.d.ts.map +1 -1
- package/dist/browser/http-helpers.d.ts +15 -0
- package/dist/browser/http-helpers.d.ts.map +1 -0
- package/dist/browser/http.d.ts +8 -0
- package/dist/browser/http.d.ts.map +1 -1
- package/dist/contract/client-types.d.ts +8 -0
- package/dist/contract/client-types.d.ts.map +1 -1
- package/dist/contract/runtime-context.d.ts +13 -1
- package/dist/contract/runtime-context.d.ts.map +1 -1
- package/dist/device-relay/agent-handlers.d.ts +45 -0
- package/dist/device-relay/agent-handlers.d.ts.map +1 -0
- package/dist/device-relay/agent.d.ts +80 -0
- package/dist/device-relay/agent.d.ts.map +1 -0
- package/dist/device-relay/broker.d.ts +49 -0
- package/dist/device-relay/broker.d.ts.map +1 -0
- package/dist/device-relay/contract.d.ts +614 -0
- package/dist/device-relay/contract.d.ts.map +1 -0
- package/dist/device-relay/encoding.d.ts +30 -0
- package/dist/device-relay/encoding.d.ts.map +1 -0
- package/dist/device-relay/hub-connection.d.ts +43 -0
- package/dist/device-relay/hub-connection.d.ts.map +1 -0
- package/dist/device-relay/hub-dispatch.d.ts +19 -0
- package/dist/device-relay/hub-dispatch.d.ts.map +1 -0
- package/dist/device-relay/hub-handshake.d.ts +20 -0
- package/dist/device-relay/hub-handshake.d.ts.map +1 -0
- package/dist/device-relay/hub-shared-streams.d.ts +24 -0
- package/dist/device-relay/hub-shared-streams.d.ts.map +1 -0
- package/dist/device-relay/hub-streams.d.ts +57 -0
- package/dist/device-relay/hub-streams.d.ts.map +1 -0
- package/dist/device-relay/hub.d.ts +117 -0
- package/dist/device-relay/hub.d.ts.map +1 -0
- package/dist/entrypoints/agent-executor/acp.d.ts +1 -1
- package/dist/entrypoints/agent-executor/acp.d.ts.map +1 -1
- package/dist/entrypoints/agent-executor/acp.js +183 -29
- package/dist/entrypoints/agent-executor/claude-sdk.js +15 -15
- package/dist/entrypoints/agent-executor/claude.js +13 -15
- package/dist/entrypoints/agent-executor/codex.js +88 -48
- package/dist/entrypoints/agent-executor/testing/claude-sdk.js +5 -5
- package/dist/entrypoints/agent-executor/testing.js +31 -30
- package/dist/entrypoints/agent-executor.d.ts +2 -2
- package/dist/entrypoints/agent-executor.d.ts.map +1 -1
- package/dist/entrypoints/agent-executor.js +23 -17
- package/dist/entrypoints/agent-runtime/ai-sdk.d.ts +9 -0
- package/dist/entrypoints/agent-runtime/ai-sdk.d.ts.map +1 -0
- package/dist/entrypoints/agent-runtime/ai-sdk.js +821 -0
- package/dist/entrypoints/agent-runtime/anthropic.d.ts +4 -0
- package/dist/entrypoints/agent-runtime/anthropic.d.ts.map +1 -0
- package/dist/entrypoints/agent-runtime/anthropic.js +1260 -0
- package/dist/entrypoints/agent-runtime/browser.d.ts +4 -1
- package/dist/entrypoints/agent-runtime/browser.d.ts.map +1 -1
- package/dist/entrypoints/agent-runtime/browser.js +449 -50
- package/dist/entrypoints/agent-runtime/coding-tools.js +3 -3
- package/dist/entrypoints/agent-runtime/harness.js +24 -19
- package/dist/entrypoints/agent-runtime/openai.d.ts +4 -0
- package/dist/entrypoints/agent-runtime/openai.d.ts.map +1 -0
- package/dist/entrypoints/agent-runtime/openai.js +1246 -0
- package/dist/entrypoints/agent-runtime/openrouter.d.ts +5 -2
- package/dist/entrypoints/agent-runtime/openrouter.d.ts.map +1 -1
- package/dist/entrypoints/agent-runtime/openrouter.js +2355 -371
- package/dist/entrypoints/agent-runtime/postgres.js +12 -10
- package/dist/entrypoints/agent-runtime/realtime.js +11 -10
- package/dist/entrypoints/agent-runtime/sandbox.d.ts +3 -0
- package/dist/entrypoints/agent-runtime/sandbox.d.ts.map +1 -1
- package/dist/entrypoints/agent-runtime/sandbox.js +530 -7
- package/dist/entrypoints/agent-runtime/sqlite/bun.js +13 -11
- package/dist/entrypoints/agent-runtime/sqlite/node.js +13 -11
- package/dist/entrypoints/agent-runtime/testing.d.ts +1 -1
- package/dist/entrypoints/agent-runtime/testing.d.ts.map +1 -1
- package/dist/entrypoints/agent-runtime/testing.js +56 -15
- package/dist/entrypoints/agent-runtime.d.ts +14 -6
- package/dist/entrypoints/agent-runtime.d.ts.map +1 -1
- package/dist/entrypoints/agent-runtime.js +1412 -115
- package/dist/entrypoints/application/diagnostic-journal.js +6 -6
- package/dist/entrypoints/application/directory-inbox.js +6 -6
- package/dist/entrypoints/application/opentelemetry.js +3 -3
- package/dist/entrypoints/application.js +17 -17
- package/dist/entrypoints/cli/publish.js +8 -8
- package/dist/entrypoints/cli.js +14 -15
- package/dist/entrypoints/contract.d.ts +1 -0
- package/dist/entrypoints/contract.d.ts.map +1 -1
- package/dist/entrypoints/contract.js +13 -9
- package/dist/entrypoints/device-relay.d.ts +10 -0
- package/dist/entrypoints/device-relay.d.ts.map +1 -0
- package/dist/entrypoints/device-relay.js +2517 -0
- package/dist/entrypoints/files/packaging.js +3 -3
- package/dist/entrypoints/files.js +11 -11
- package/dist/entrypoints/geo.js +5 -5
- package/dist/entrypoints/google.js +1 -1
- package/dist/entrypoints/handler.js +6 -6
- package/dist/entrypoints/http.js +9 -9
- package/dist/entrypoints/index.js +21 -17
- package/dist/entrypoints/live.js +4 -4
- package/dist/entrypoints/node.js +13 -13
- package/dist/entrypoints/observability.js +9 -9
- package/dist/entrypoints/process/bootstrap.js +1 -1
- package/dist/entrypoints/process.js +5 -5
- package/dist/entrypoints/react.js +4 -4
- package/dist/entrypoints/realtime.d.ts +3 -0
- package/dist/entrypoints/realtime.d.ts.map +1 -1
- package/dist/entrypoints/realtime.js +413 -4
- package/dist/entrypoints/release.js +1 -1
- package/dist/entrypoints/remote.js +10 -10
- package/dist/entrypoints/server.d.ts +1 -0
- package/dist/entrypoints/server.d.ts.map +1 -1
- package/dist/entrypoints/server.js +546 -40
- package/dist/entrypoints/service-host/macos.js +10 -10
- package/dist/entrypoints/service-host/work.js +7 -7
- package/dist/entrypoints/service-host.js +15 -15
- package/dist/entrypoints/spend.js +3 -3
- package/dist/entrypoints/sync.js +4 -4
- package/dist/entrypoints/telegram/screens.js +6 -6
- package/dist/entrypoints/telegram.js +20 -20
- package/dist/entrypoints/testing.js +14 -14
- package/dist/entrypoints/tools/agent.d.ts +2 -1
- package/dist/entrypoints/tools/agent.d.ts.map +1 -1
- package/dist/entrypoints/tools/agent.js +8 -7
- package/dist/entrypoints/tools/connections.js +5 -5
- package/dist/entrypoints/tools/invoker.js +3 -4
- package/dist/entrypoints/tools/mcp.js +8 -9
- package/dist/entrypoints/tools/toolkit.js +32 -13
- package/dist/entrypoints/tools.d.ts +3 -1
- package/dist/entrypoints/tools.d.ts.map +1 -1
- package/dist/entrypoints/tools.js +37 -35
- package/dist/entrypoints/tracking/contract.js +1 -1
- package/dist/entrypoints/tracking/performance.js +4 -4
- package/dist/entrypoints/tracking.js +3 -3
- package/dist/{index-09f7w2qq.js → index-02kdtrcd.js} +1 -1
- package/dist/{index-y53cqwke.js → index-033tyx59.js} +1 -1
- package/dist/{index-9ft4n9j1.js → index-05b65gj4.js} +2 -2
- package/dist/{index-d04w81fz.js → index-0sxj3y45.js} +1 -1
- package/dist/{index-dm6nxkn1.js → index-18pf56dq.js} +4 -6
- package/dist/index-1gmgwfn3.js +439 -0
- package/dist/index-23wn8sgf.js +47 -0
- package/dist/{index-tqjamnax.js → index-27srek2g.js} +15 -13
- package/dist/{index-2nwvn7m2.js → index-29v1p1f4.js} +2 -2
- package/dist/index-36dmtzjr.js +194 -0
- package/dist/{index-ycr4pk0z.js → index-42n9jycn.js} +3 -3
- package/dist/{index-ke02kxsr.js → index-43k180c2.js} +1 -1
- package/dist/{index-pbekeqzm.js → index-5c4m8zdf.js} +2 -2
- package/dist/{index-qggqqja2.js → index-5dxgx3yj.js} +1 -1
- package/dist/{index-x5ayy5bn.js → index-5gdexvke.js} +3 -1
- package/dist/{index-t1a2jrg7.js → index-5xsxvk2x.js} +1 -1
- package/dist/{index-mbd92r1w.js → index-654rhe5d.js} +1 -1
- package/dist/{index-2dzc7mv9.js → index-67pnt4bh.js} +1 -1
- package/dist/index-6kpwkpgx.js +415 -0
- package/dist/{index-s43tr4my.js → index-6kwdfb9m.js} +18 -3
- package/dist/{index-1qwd54n3.js → index-6nzzj7qr.js} +1 -1
- package/dist/{index-rkjfzs0a.js → index-6p5pshcd.js} +2 -2
- package/dist/{index-118aebbg.js → index-6t4c98gr.js} +1 -1
- package/dist/{index-pws5c3x6.js → index-6xw1wf4m.js} +51 -32
- package/dist/{index-kwsr7j5k.js → index-6yb4stq3.js} +1 -1
- package/dist/{index-8jf4bt7v.js → index-76yhxa41.js} +8 -8
- package/dist/{index-7416mhyh.js → index-79vqbjcz.js} +1 -1
- package/dist/{index-13wmzpa6.js → index-7an2fs5h.js} +1 -1
- package/dist/index-7qza24g1.js +14 -0
- package/dist/{index-gtaaxe9d.js → index-8cek82ar.js} +1 -1
- package/dist/index-9f60gnfn.js +393 -0
- package/dist/{index-stpy56r3.js → index-aacwkve4.js} +209 -10
- package/dist/{index-rpyn7geq.js → index-ac3rfec5.js} +2 -2
- package/dist/{index-d2drhb9c.js → index-b0mh2t9x.js} +2 -2
- package/dist/index-b23s6e2c.js +158 -0
- package/dist/{index-an7vcmwf.js → index-bvpevwt6.js} +5 -5
- package/dist/{index-msxf2r8x.js → index-by8w2461.js} +1 -1
- package/dist/{index-8t9dr41h.js → index-c0yym4a0.js} +4 -4
- package/dist/{index-wddcfbng.js → index-c7fj4yw9.js} +1 -1
- package/dist/{index-tf70nm22.js → index-cb4nnvfr.js} +8 -6
- package/dist/{index-205456mf.js → index-d3s070eh.js} +2 -2
- package/dist/{index-apf5g7y9.js → index-dz6tstcp.js} +2 -2
- package/dist/{index-agy5fqgf.js → index-e1y74yra.js} +15 -8
- package/dist/index-edtg4tak.js +55 -0
- package/dist/{index-pq6g1k9t.js → index-ek9w11r0.js} +2 -2
- package/dist/{index-x46y9z26.js → index-epyj7ptp.js} +7 -5
- package/dist/{index-6kmjcm81.js → index-er483f3w.js} +93 -4
- package/dist/{index-827bgv33.js → index-f16b7rze.js} +1 -1
- package/dist/{index-gbhj370g.js → index-fec05c9k.js} +21 -21
- package/dist/{index-9wdrwx3b.js → index-fjac2w5e.js} +20 -22
- package/dist/{index-6918kxbf.js → index-fthw8dwa.js} +1 -0
- package/dist/{index-2mz8hj58.js → index-g04hszcm.js} +1 -1
- package/dist/{index-rw8ze745.js → index-ga6avd48.js} +1 -1
- package/dist/{index-paff5y0r.js → index-grhhsrd5.js} +9 -7
- package/dist/{index-mxt0wfjy.js → index-h20qcyh5.js} +5 -2
- package/dist/index-j3r7r1mh.js +150 -0
- package/dist/{index-vgytj9wp.js → index-jmaw365j.js} +1 -1
- package/dist/{index-cjytermm.js → index-jzdbkanz.js} +3 -3
- package/dist/index-k137ezb6.js +79 -0
- package/dist/{index-tazm4dxf.js → index-kdw0n92g.js} +1 -1
- package/dist/{index-wh70tmpd.js → index-ke6jtxkd.js} +1 -1
- package/dist/index-kgj8j7bv.js +83 -0
- package/dist/{index-9kpxz49v.js → index-kgkevngs.js} +1 -1
- package/dist/{index-hab790s6.js → index-kp1j7cc8.js} +4 -4
- package/dist/{index-jcge9tx3.js → index-krekhmp7.js} +142 -123
- package/dist/{index-3y2tzhr8.js → index-ky79wwgs.js} +4 -4
- package/dist/{index-39rmc00v.js → index-mfe9a266.js} +1 -1
- package/dist/{index-qpzyahe3.js → index-mgr0mdqp.js} +5 -2
- package/dist/{index-n20tybgk.js → index-mh3jdb25.js} +2 -2
- package/dist/{index-g5fgeb6v.js → index-mkmep637.js} +1 -1
- package/dist/{index-02r5sq9p.js → index-mrng24wq.js} +19 -21
- package/dist/index-mx2gya05.js +465 -0
- package/dist/{index-8yt3rwe7.js → index-n2t87ggz.js} +5 -5
- package/dist/index-nfeafbzh.js +7379 -0
- package/dist/{index-j0ef04jw.js → index-nfm15ej7.js} +4 -4
- package/dist/index-pd9e8rz4.js +193 -0
- package/dist/{index-zwgwyvdt.js → index-pdcbjd6a.js} +1 -1
- package/dist/{index-q427q23r.js → index-pjjh91vw.js} +2 -2
- package/dist/{index-gnjgkecx.js → index-q46b16xz.js} +1 -1
- package/dist/{index-9xr44d2g.js → index-qv5v6w9c.js} +330 -106
- package/dist/{index-tmv3ez1h.js → index-qymek778.js} +69 -12
- package/dist/{index-yrr3n391.js → index-ry8m2mhg.js} +2 -2
- package/dist/{index-93n6jwy0.js → index-s0n0nnz5.js} +3 -3
- package/dist/{index-1p8q0yrt.js → index-t5zp1jjj.js} +5 -7
- package/dist/{index-2rf33y2h.js → index-tav72wz5.js} +4 -2
- package/dist/{index-jpecjm30.js → index-tgehj4bp.js} +1 -1
- package/dist/{index-ma26mfnt.js → index-v5hmyef8.js} +1 -1
- package/dist/index-vebzvse6.js +230 -0
- package/dist/index-vv0hxrmy.js +295 -0
- package/dist/index-vxm0ya3f.js +707 -0
- package/dist/{index-t3qcac2a.js → index-w3s79kcb.js} +1 -1
- package/dist/{index-r97ppg0g.js → index-x1r7kxzd.js} +1 -1
- package/dist/{index-kynwa08q.js → index-xrsryvd2.js} +2 -2
- package/dist/{index-3mcbr8sx.js → index-xtxxt87z.js} +1 -1
- package/dist/index-zk839vzf.js +231 -0
- package/dist/{index-9c76vfxf.js → index-zyyerdny.js} +4 -4
- package/dist/internal/base64.d.ts +9 -0
- package/dist/internal/base64.d.ts.map +1 -0
- package/dist/internal/deadline-budget.d.ts +57 -0
- package/dist/internal/deadline-budget.d.ts.map +1 -0
- package/dist/internal/deadline.d.ts.map +1 -1
- package/dist/internal/timers.d.ts +2 -0
- package/dist/internal/timers.d.ts.map +1 -1
- package/dist/realtime/device-presence-contract.d.ts +194 -0
- package/dist/realtime/device-presence-contract.d.ts.map +1 -0
- package/dist/server/context-contribution.d.ts.map +1 -1
- package/dist/server/contract-method.d.ts.map +1 -1
- package/dist/server/device-presence-handlers.d.ts +54 -0
- package/dist/server/device-presence-handlers.d.ts.map +1 -0
- package/dist/server/device-presence-registry.d.ts +35 -0
- package/dist/server/device-presence-registry.d.ts.map +1 -0
- package/dist/server/device-presence.d.ts +45 -0
- package/dist/server/device-presence.d.ts.map +1 -0
- package/dist/server/endpoint-dispatch.d.ts.map +1 -1
- package/dist/server/middleware/cors.d.ts +3 -1
- package/dist/server/middleware/cors.d.ts.map +1 -1
- package/dist/server/types.d.ts +4 -11
- package/dist/server/types.d.ts.map +1 -1
- package/dist/service-host/systemd-render-shared.d.ts.map +1 -1
- package/dist/tools/agent-messages.d.ts +6 -0
- package/dist/tools/agent-messages.d.ts.map +1 -0
- package/dist/tools/agent-tool-error.d.ts +2 -2
- package/dist/tools/agent-tools.d.ts +153 -0
- package/dist/tools/agent-tools.d.ts.map +1 -0
- package/dist/tools/agent.d.ts +6 -56
- package/dist/tools/agent.d.ts.map +1 -1
- package/dist/tools/runtime-tool.d.ts +3 -4
- package/dist/tools/runtime-tool.d.ts.map +1 -1
- package/dist/tools/toolkit.d.ts +3 -1
- package/dist/tools/toolkit.d.ts.map +1 -1
- package/dist/tools/transfer/define-view-file-tool.d.ts.map +1 -1
- package/llms/agent-executor-acp.txt +2 -2
- package/llms/agent-executor-codex.txt +1 -1
- package/llms/agent-executor.txt +7 -3
- package/llms/agent-runtime-ai-sdk.txt +26 -0
- package/llms/agent-runtime-anthropic.txt +33 -0
- package/llms/agent-runtime-browser.txt +22 -8
- package/llms/agent-runtime-harness.txt +2 -2
- package/llms/agent-runtime-openai.txt +31 -0
- package/llms/agent-runtime-openrouter.txt +17 -7
- package/llms/agent-runtime-sandbox.txt +53 -1
- package/llms/agent-runtime-testing.txt +4 -2
- package/llms/agent-runtime.2.txt +158 -271
- package/llms/agent-runtime.3.txt +289 -243
- package/llms/agent-runtime.4.txt +273 -216
- package/llms/agent-runtime.5.txt +209 -2
- package/llms/agent-runtime.txt +238 -181
- package/llms/contract.txt +2 -1
- package/llms/device-relay.txt +34 -0
- package/llms/realtime.txt +20 -0
- package/llms/server.2.txt +125 -1
- package/llms/server.3.txt +111 -122
- package/llms/server.4.txt +1 -1
- package/llms/server.5.txt +3 -1
- package/llms/server.txt +31 -1
- package/llms/spend.txt +11 -6
- package/llms/stitchkit.2.txt +21 -43
- package/llms/stitchkit.3.txt +43 -0
- package/llms/stitchkit.txt +93 -84
- package/llms/tools-agent.txt +7 -5
- package/llms/tools-toolkit.txt +1 -1
- package/llms/tools.4.txt +7 -2
- package/llms/{upgrading-0.128.0-0.133.0.txt → upgrading-0.128.0-0.134.0.txt} +173 -3
- package/llms/upgrading.txt +1 -1
- package/llms-full.txt +981 -210
- package/llms.txt +21 -17
- package/package.json +18 -7
- package/dist/index-0p0s5hrj.js +0 -249
- package/dist/index-1dn2wjq6.js +0 -135
- package/dist/index-1psbyyhj.js +0 -21
- package/dist/index-34k82crg.js +0 -3961
- package/dist/index-5n3a8hd8.js +0 -102
- package/dist/index-97rp94ff.js +0 -8
- package/dist/index-bn2baakz.js +0 -336
- package/dist/index-eh71zr32.js +0 -14
- package/dist/index-emgrmavr.js +0 -1193
- package/dist/index-fzd477xk.js +0 -135
- package/dist/index-vgzhw2zk.js +0 -304
- package/dist/internal/ai-sdk-typed.d.ts +0 -14
- package/dist/internal/ai-sdk-typed.d.ts.map +0 -1
- package/dist/tools/runtime-call-context.d.ts +0 -15
- package/dist/tools/runtime-call-context.d.ts.map +0 -1
- package/dist/{index-vmbxj75t.js → index-jwtmw39p.js} +0 -0
- package/dist/{index-877e9y8r.js → index-sk03xe0n.js} +3 -3
- package/dist/{index-21cfxc4z.js → index-vh4291qh.js} +3 -3
|
@@ -0,0 +1,465 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AgentModelProviderOptionsSchema2,
|
|
3
|
+
AgentModelMessageSchema2
|
|
4
|
+
} from "./index-vebzvse6.js";
|
|
5
|
+
import {
|
|
6
|
+
buildAgentTools
|
|
7
|
+
} from "./index-zk839vzf.js";
|
|
8
|
+
import {
|
|
9
|
+
isRecord
|
|
10
|
+
} from "./index-ps3djm8d.js";
|
|
11
|
+
|
|
12
|
+
// src/tools/agent.ts
|
|
13
|
+
import { jsonSchema, tool } from "ai";
|
|
14
|
+
|
|
15
|
+
// src/tools/agent-messages.ts
|
|
16
|
+
function toOwnedBytes(bytes) {
|
|
17
|
+
const copy = new Uint8Array(bytes.byteLength);
|
|
18
|
+
copy.set(bytes);
|
|
19
|
+
return copy;
|
|
20
|
+
}
|
|
21
|
+
function safeJsonValueInternal(value, seen) {
|
|
22
|
+
if (value === null || typeof value === "string" || typeof value === "boolean") {
|
|
23
|
+
return value;
|
|
24
|
+
}
|
|
25
|
+
if (typeof value === "number")
|
|
26
|
+
return Number.isFinite(value) ? value : null;
|
|
27
|
+
if (typeof value === "bigint")
|
|
28
|
+
return value.toString();
|
|
29
|
+
if (value instanceof Date)
|
|
30
|
+
return Number.isNaN(value.getTime()) ? null : value.toISOString();
|
|
31
|
+
if (value instanceof URL)
|
|
32
|
+
return value.toString();
|
|
33
|
+
if (Array.isArray(value)) {
|
|
34
|
+
if (seen.has(value))
|
|
35
|
+
return "[Circular]";
|
|
36
|
+
seen.add(value);
|
|
37
|
+
try {
|
|
38
|
+
return value.map((item) => safeJsonValueInternal(item ?? null, seen));
|
|
39
|
+
} finally {
|
|
40
|
+
seen.delete(value);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
if (isRecord(value)) {
|
|
44
|
+
if (seen.has(value))
|
|
45
|
+
return "[Circular]";
|
|
46
|
+
seen.add(value);
|
|
47
|
+
try {
|
|
48
|
+
const out = {};
|
|
49
|
+
for (const [k, v] of Object.entries(value)) {
|
|
50
|
+
if (v !== undefined)
|
|
51
|
+
out[k] = safeJsonValueInternal(v, seen);
|
|
52
|
+
}
|
|
53
|
+
return out;
|
|
54
|
+
} finally {
|
|
55
|
+
seen.delete(value);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return value === undefined ? null : String(value);
|
|
59
|
+
}
|
|
60
|
+
function safeJsonValue(value) {
|
|
61
|
+
return safeJsonValueInternal(value, new WeakSet);
|
|
62
|
+
}
|
|
63
|
+
function providerOpt(raw) {
|
|
64
|
+
const parsed = AgentModelProviderOptionsSchema2.safeParse(raw);
|
|
65
|
+
return parsed.success ? { providerOptions: parsed.data } : {};
|
|
66
|
+
}
|
|
67
|
+
function parseDataUrl(raw) {
|
|
68
|
+
if (!raw.startsWith("data:"))
|
|
69
|
+
return;
|
|
70
|
+
const comma = raw.indexOf(",");
|
|
71
|
+
if (comma < 0)
|
|
72
|
+
return;
|
|
73
|
+
const mediaType = raw.slice(5, comma).split(";")[0]?.trim();
|
|
74
|
+
return { data: raw.slice(comma + 1), ...mediaType && { mediaType } };
|
|
75
|
+
}
|
|
76
|
+
function normalizeProviderReference(raw) {
|
|
77
|
+
if (typeof raw === "string" && raw.length > 0)
|
|
78
|
+
return { default: raw };
|
|
79
|
+
if (!isRecord(raw))
|
|
80
|
+
return;
|
|
81
|
+
const out = {};
|
|
82
|
+
for (const [k, v] of Object.entries(raw)) {
|
|
83
|
+
if (k !== "type" && typeof v === "string")
|
|
84
|
+
out[k] = v;
|
|
85
|
+
}
|
|
86
|
+
return Object.keys(out).length > 0 ? out : undefined;
|
|
87
|
+
}
|
|
88
|
+
function tryUrl(raw) {
|
|
89
|
+
try {
|
|
90
|
+
return { type: "url", url: new URL(raw), originalUrl: raw };
|
|
91
|
+
} catch {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
function adaptAiSdkFileData(raw) {
|
|
96
|
+
if (raw instanceof Uint8Array)
|
|
97
|
+
return { type: "data", data: toOwnedBytes(raw) };
|
|
98
|
+
if (raw instanceof ArrayBuffer)
|
|
99
|
+
return { type: "data", data: new Uint8Array(raw) };
|
|
100
|
+
if (raw instanceof URL)
|
|
101
|
+
return { type: "url", url: raw };
|
|
102
|
+
if (typeof raw === "string") {
|
|
103
|
+
const dataUrl = parseDataUrl(raw);
|
|
104
|
+
if (dataUrl)
|
|
105
|
+
return { type: "data", data: dataUrl.data };
|
|
106
|
+
if (/^https?:\/\//i.test(raw))
|
|
107
|
+
return tryUrl(raw) ?? { type: "data", data: raw };
|
|
108
|
+
return { type: "data", data: raw };
|
|
109
|
+
}
|
|
110
|
+
if (!isRecord(raw))
|
|
111
|
+
return;
|
|
112
|
+
if (raw.type === "data") {
|
|
113
|
+
if (raw.data instanceof Uint8Array)
|
|
114
|
+
return { type: "data", data: toOwnedBytes(raw.data) };
|
|
115
|
+
if (raw.data instanceof ArrayBuffer)
|
|
116
|
+
return { type: "data", data: new Uint8Array(raw.data) };
|
|
117
|
+
return typeof raw.data === "string" ? { type: "data", data: raw.data } : undefined;
|
|
118
|
+
}
|
|
119
|
+
if (raw.type === "url") {
|
|
120
|
+
if (raw.url instanceof URL) {
|
|
121
|
+
return {
|
|
122
|
+
type: "url",
|
|
123
|
+
url: raw.url,
|
|
124
|
+
...typeof raw.originalUrl === "string" && { originalUrl: raw.originalUrl }
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
return typeof raw.url === "string" ? tryUrl(raw.url) : undefined;
|
|
128
|
+
}
|
|
129
|
+
if (raw.type === "reference") {
|
|
130
|
+
const reference = normalizeProviderReference(raw.reference);
|
|
131
|
+
return reference ? { type: "reference", reference } : undefined;
|
|
132
|
+
}
|
|
133
|
+
if (raw.type === "text" && typeof raw.text === "string") {
|
|
134
|
+
return { type: "text", text: raw.text };
|
|
135
|
+
}
|
|
136
|
+
const reference = normalizeProviderReference(raw);
|
|
137
|
+
return reference ? { type: "reference", reference } : undefined;
|
|
138
|
+
}
|
|
139
|
+
function resolveMediaType(raw, dataSource, fallback) {
|
|
140
|
+
if (typeof raw.mediaType === "string" && raw.mediaType.length > 0)
|
|
141
|
+
return raw.mediaType;
|
|
142
|
+
if (typeof raw.mimeType === "string" && raw.mimeType.length > 0)
|
|
143
|
+
return raw.mimeType;
|
|
144
|
+
return (typeof dataSource === "string" ? parseDataUrl(dataSource)?.mediaType : undefined) ?? fallback;
|
|
145
|
+
}
|
|
146
|
+
function adaptAiSdkToolContentPart(raw) {
|
|
147
|
+
if (!isRecord(raw) || typeof raw.type !== "string")
|
|
148
|
+
return;
|
|
149
|
+
const opt = providerOpt(raw.providerOptions);
|
|
150
|
+
if (raw.type === "text") {
|
|
151
|
+
return typeof raw.text === "string" ? { type: "text", text: raw.text, ...opt } : undefined;
|
|
152
|
+
}
|
|
153
|
+
if (raw.type === "custom")
|
|
154
|
+
return { type: "custom", ...opt };
|
|
155
|
+
if (raw.type === "file" || raw.type === "media" || raw.type === "image-data" || raw.type === "file-data" || raw.type === "image-url" || raw.type === "file-url") {
|
|
156
|
+
const isUrl = raw.type === "image-url" || raw.type === "file-url";
|
|
157
|
+
const source = isUrl ? raw.url : raw.data;
|
|
158
|
+
const data = adaptAiSdkFileData(source);
|
|
159
|
+
if (!data)
|
|
160
|
+
return;
|
|
161
|
+
const fallback = raw.type === "image-data" ? "image/png" : raw.type === "image-url" ? "image/*" : "application/octet-stream";
|
|
162
|
+
return {
|
|
163
|
+
type: "file",
|
|
164
|
+
data,
|
|
165
|
+
mediaType: resolveMediaType(raw, source, fallback),
|
|
166
|
+
...!isUrl && typeof raw.filename === "string" && { filename: raw.filename },
|
|
167
|
+
...opt
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
if (raw.type === "image-file-id" || raw.type === "file-id") {
|
|
171
|
+
const reference = normalizeProviderReference(raw.fileId);
|
|
172
|
+
if (!reference)
|
|
173
|
+
return;
|
|
174
|
+
const fallback = raw.type === "image-file-id" ? "image/*" : "application/octet-stream";
|
|
175
|
+
return {
|
|
176
|
+
type: "file",
|
|
177
|
+
data: { type: "reference", reference },
|
|
178
|
+
mediaType: resolveMediaType(raw, undefined, fallback),
|
|
179
|
+
...opt
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
function adaptAiSdkToolOutput(rawOutput, fallbackResult) {
|
|
185
|
+
const source = rawOutput !== undefined ? rawOutput : fallbackResult;
|
|
186
|
+
if (isRecord(source) && typeof source.type === "string") {
|
|
187
|
+
const opt = providerOpt(source.providerOptions);
|
|
188
|
+
if ((source.type === "text" || source.type === "error-text") && typeof source.value === "string") {
|
|
189
|
+
return { type: source.type, value: source.value, ...opt };
|
|
190
|
+
}
|
|
191
|
+
if (source.type === "json" || source.type === "error-json") {
|
|
192
|
+
return { type: source.type, value: safeJsonValue(source.value ?? null), ...opt };
|
|
193
|
+
}
|
|
194
|
+
if (source.type === "execution-denied") {
|
|
195
|
+
return {
|
|
196
|
+
type: "execution-denied",
|
|
197
|
+
...typeof source.reason === "string" && { reason: source.reason },
|
|
198
|
+
...opt
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
if (source.type === "content" && Array.isArray(source.value)) {
|
|
202
|
+
const value = source.value.map(adaptAiSdkToolContentPart).filter((part) => part !== undefined);
|
|
203
|
+
return { type: "content", value, ...opt };
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
return typeof source === "string" ? { type: "text", value: source } : { type: "json", value: safeJsonValue(source ?? null) };
|
|
207
|
+
}
|
|
208
|
+
function adaptToolResultPart(raw, opt) {
|
|
209
|
+
if (typeof raw.toolCallId !== "string" || typeof raw.toolName !== "string")
|
|
210
|
+
return;
|
|
211
|
+
return {
|
|
212
|
+
type: "tool-result",
|
|
213
|
+
toolCallId: raw.toolCallId,
|
|
214
|
+
toolName: raw.toolName,
|
|
215
|
+
output: adaptAiSdkToolOutput(raw.output, raw.result),
|
|
216
|
+
...opt
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
function adaptAiSdkUserPart(raw) {
|
|
220
|
+
if (!isRecord(raw) || typeof raw.type !== "string")
|
|
221
|
+
return;
|
|
222
|
+
const opt = providerOpt(raw.providerOptions);
|
|
223
|
+
if (raw.type === "text" && typeof raw.text === "string") {
|
|
224
|
+
return { type: "text", text: raw.text, ...opt };
|
|
225
|
+
}
|
|
226
|
+
if (raw.type !== "image" && raw.type !== "file")
|
|
227
|
+
return;
|
|
228
|
+
const source = raw.type === "image" ? raw.image : raw.data;
|
|
229
|
+
const data = adaptAiSdkFileData(source);
|
|
230
|
+
if (!data)
|
|
231
|
+
return;
|
|
232
|
+
const fallback = raw.type === "image" ? "image/png" : "application/octet-stream";
|
|
233
|
+
return {
|
|
234
|
+
type: "file",
|
|
235
|
+
data,
|
|
236
|
+
mediaType: resolveMediaType(raw, source, fallback),
|
|
237
|
+
...raw.type === "file" && typeof raw.filename === "string" && { filename: raw.filename },
|
|
238
|
+
...opt
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
function adaptAiSdkAssistantPart(raw) {
|
|
242
|
+
if (!isRecord(raw) || typeof raw.type !== "string")
|
|
243
|
+
return;
|
|
244
|
+
const opt = providerOpt(raw.providerOptions);
|
|
245
|
+
if ((raw.type === "text" || raw.type === "reasoning") && typeof raw.text === "string") {
|
|
246
|
+
return { type: raw.type, text: raw.text, ...opt };
|
|
247
|
+
}
|
|
248
|
+
if (raw.type === "file" || raw.type === "reasoning-file") {
|
|
249
|
+
const data = adaptAiSdkFileData(raw.data);
|
|
250
|
+
if (!data)
|
|
251
|
+
return;
|
|
252
|
+
return {
|
|
253
|
+
type: raw.type,
|
|
254
|
+
data,
|
|
255
|
+
mediaType: resolveMediaType(raw, raw.data, "application/octet-stream"),
|
|
256
|
+
...raw.type === "file" && typeof raw.filename === "string" && { filename: raw.filename },
|
|
257
|
+
...opt
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
if (raw.type === "tool-call" && typeof raw.toolCallId === "string" && typeof raw.toolName === "string") {
|
|
261
|
+
return {
|
|
262
|
+
type: "tool-call",
|
|
263
|
+
toolCallId: raw.toolCallId,
|
|
264
|
+
toolName: raw.toolName,
|
|
265
|
+
input: raw.input ?? raw.args,
|
|
266
|
+
...typeof raw.providerExecuted === "boolean" && {
|
|
267
|
+
providerExecuted: raw.providerExecuted
|
|
268
|
+
},
|
|
269
|
+
...opt
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
if (raw.type === "tool-result")
|
|
273
|
+
return adaptToolResultPart(raw, opt);
|
|
274
|
+
if (raw.type === "tool-approval-request" && typeof raw.approvalId === "string" && typeof raw.toolCallId === "string") {
|
|
275
|
+
return {
|
|
276
|
+
type: "tool-approval-request",
|
|
277
|
+
approvalId: raw.approvalId,
|
|
278
|
+
toolCallId: raw.toolCallId,
|
|
279
|
+
...typeof raw.signature === "string" && { signature: raw.signature },
|
|
280
|
+
...typeof raw.isAutomatic === "boolean" && { isAutomatic: raw.isAutomatic },
|
|
281
|
+
...typeof raw.reason === "string" && { reason: raw.reason }
|
|
282
|
+
};
|
|
283
|
+
}
|
|
284
|
+
return raw.type === "custom" && typeof raw.kind === "string" ? { type: "custom", kind: raw.kind, ...opt } : undefined;
|
|
285
|
+
}
|
|
286
|
+
function adaptAiSdkToolPart(raw) {
|
|
287
|
+
if (!isRecord(raw) || typeof raw.type !== "string")
|
|
288
|
+
return;
|
|
289
|
+
const opt = providerOpt(raw.providerOptions);
|
|
290
|
+
if (raw.type === "tool-result")
|
|
291
|
+
return adaptToolResultPart(raw, opt);
|
|
292
|
+
if (raw.type === "tool-approval-response" && typeof raw.approvalId === "string" && typeof raw.approved === "boolean") {
|
|
293
|
+
return {
|
|
294
|
+
type: "tool-approval-response",
|
|
295
|
+
approvalId: raw.approvalId,
|
|
296
|
+
approved: raw.approved,
|
|
297
|
+
...typeof raw.reason === "string" && { reason: raw.reason },
|
|
298
|
+
...typeof raw.providerExecuted === "boolean" && {
|
|
299
|
+
providerExecuted: raw.providerExecuted
|
|
300
|
+
}
|
|
301
|
+
};
|
|
302
|
+
}
|
|
303
|
+
return;
|
|
304
|
+
}
|
|
305
|
+
function adaptAiSdkMessage(item) {
|
|
306
|
+
const direct = AgentModelMessageSchema2.safeParse(item);
|
|
307
|
+
if (direct.success)
|
|
308
|
+
return direct.data;
|
|
309
|
+
if (!isRecord(item) || typeof item.role !== "string")
|
|
310
|
+
return;
|
|
311
|
+
const opt = providerOpt(item.providerOptions);
|
|
312
|
+
const adaptParts = (mapper) => Array.isArray(item.content) ? item.content.map(mapper).filter((part) => part !== undefined) : [];
|
|
313
|
+
let candidate;
|
|
314
|
+
if (item.role === "system" && typeof item.content === "string") {
|
|
315
|
+
candidate = { role: "system", content: item.content, ...opt };
|
|
316
|
+
} else if (item.role === "user") {
|
|
317
|
+
candidate = {
|
|
318
|
+
role: "user",
|
|
319
|
+
content: typeof item.content === "string" ? item.content : adaptParts(adaptAiSdkUserPart),
|
|
320
|
+
...opt
|
|
321
|
+
};
|
|
322
|
+
} else if (item.role === "assistant") {
|
|
323
|
+
candidate = {
|
|
324
|
+
role: "assistant",
|
|
325
|
+
content: typeof item.content === "string" ? item.content : adaptParts(adaptAiSdkAssistantPart),
|
|
326
|
+
...opt
|
|
327
|
+
};
|
|
328
|
+
} else if (item.role === "tool" && Array.isArray(item.content)) {
|
|
329
|
+
candidate = { role: "tool", content: adaptParts(adaptAiSdkToolPart), ...opt };
|
|
330
|
+
}
|
|
331
|
+
if (candidate === undefined)
|
|
332
|
+
return;
|
|
333
|
+
const parsed = AgentModelMessageSchema2.safeParse(candidate);
|
|
334
|
+
return parsed.success ? parsed.data : undefined;
|
|
335
|
+
}
|
|
336
|
+
function adaptAiSdkMessages(raw) {
|
|
337
|
+
const result = [];
|
|
338
|
+
for (const item of raw) {
|
|
339
|
+
const adapted = adaptAiSdkMessage(item);
|
|
340
|
+
if (adapted)
|
|
341
|
+
result.push(adapted);
|
|
342
|
+
}
|
|
343
|
+
return result;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
// src/tools/agent.ts
|
|
347
|
+
function toAiSdkProviderOptions(options) {
|
|
348
|
+
if (!options)
|
|
349
|
+
return;
|
|
350
|
+
const out = {};
|
|
351
|
+
for (const [namespace, entry] of Object.entries(options)) {
|
|
352
|
+
if (!entry)
|
|
353
|
+
continue;
|
|
354
|
+
const inner = {};
|
|
355
|
+
for (const [key, value] of Object.entries(entry)) {
|
|
356
|
+
if (value !== undefined)
|
|
357
|
+
inner[key] = safeJsonValue(value);
|
|
358
|
+
}
|
|
359
|
+
out[namespace] = inner;
|
|
360
|
+
}
|
|
361
|
+
return Object.keys(out).length > 0 ? out : undefined;
|
|
362
|
+
}
|
|
363
|
+
function toAiSdkFileData(data) {
|
|
364
|
+
if (data.type === "data")
|
|
365
|
+
return { type: "data", data: data.data };
|
|
366
|
+
if (data.type === "url")
|
|
367
|
+
return { type: "url", url: data.url };
|
|
368
|
+
if (data.type === "reference")
|
|
369
|
+
return { type: "reference", reference: data.reference };
|
|
370
|
+
return { type: "text", text: data.text };
|
|
371
|
+
}
|
|
372
|
+
function toAiSdkModelOutput(output) {
|
|
373
|
+
const sanitized = toAiSdkProviderOptions(output.providerOptions);
|
|
374
|
+
const opts = sanitized ? { providerOptions: sanitized } : {};
|
|
375
|
+
if (output.type === "text" || output.type === "error-text") {
|
|
376
|
+
return { type: output.type, value: output.value, ...opts };
|
|
377
|
+
}
|
|
378
|
+
if (output.type === "json" || output.type === "error-json") {
|
|
379
|
+
return { type: output.type, value: output.value, ...opts };
|
|
380
|
+
}
|
|
381
|
+
if (output.type === "execution-denied") {
|
|
382
|
+
return {
|
|
383
|
+
type: "execution-denied",
|
|
384
|
+
...output.reason !== undefined && { reason: output.reason },
|
|
385
|
+
...opts
|
|
386
|
+
};
|
|
387
|
+
}
|
|
388
|
+
const items = output.value.map((part) => {
|
|
389
|
+
const partSanitized = toAiSdkProviderOptions(part.providerOptions);
|
|
390
|
+
const partOpts = partSanitized ? { providerOptions: partSanitized } : {};
|
|
391
|
+
if (part.type === "text")
|
|
392
|
+
return { type: "text", text: part.text, ...partOpts };
|
|
393
|
+
if (part.type === "file") {
|
|
394
|
+
return {
|
|
395
|
+
type: "file",
|
|
396
|
+
data: toAiSdkFileData(part.data),
|
|
397
|
+
mediaType: part.mediaType,
|
|
398
|
+
...part.filename !== undefined && { filename: part.filename },
|
|
399
|
+
...partOpts
|
|
400
|
+
};
|
|
401
|
+
}
|
|
402
|
+
return { type: "custom", ...partOpts };
|
|
403
|
+
});
|
|
404
|
+
return { type: "content", value: items, ...opts };
|
|
405
|
+
}
|
|
406
|
+
function toAiSdkToolSet(nativeTools) {
|
|
407
|
+
const tools = {};
|
|
408
|
+
for (const [name, nativeTool] of Object.entries(nativeTools)) {
|
|
409
|
+
const parseInput = nativeTool.parseInput;
|
|
410
|
+
const inputSchema = jsonSchema(nativeTool.inputSchema, {
|
|
411
|
+
validate: async (value) => {
|
|
412
|
+
if (parseInput) {
|
|
413
|
+
const parsed = await parseInput(value);
|
|
414
|
+
return parsed.ok ? { success: true, value: parsed.value } : {
|
|
415
|
+
success: false,
|
|
416
|
+
error: parsed.error instanceof Error ? parsed.error : new Error(String(parsed.error))
|
|
417
|
+
};
|
|
418
|
+
}
|
|
419
|
+
return isRecord(value) ? { success: true, value } : { success: false, error: new Error("Tool arguments must be an object") };
|
|
420
|
+
}
|
|
421
|
+
});
|
|
422
|
+
const nativeExecute = nativeTool.execute;
|
|
423
|
+
const execute = nativeExecute ? (rawArgs, options) => {
|
|
424
|
+
let adaptedMessages;
|
|
425
|
+
return nativeExecute.call(nativeTool, rawArgs, {
|
|
426
|
+
toolCallId: options.toolCallId,
|
|
427
|
+
get messages() {
|
|
428
|
+
adaptedMessages ??= adaptAiSdkMessages(options.messages);
|
|
429
|
+
return adaptedMessages;
|
|
430
|
+
},
|
|
431
|
+
abortSignal: options.abortSignal
|
|
432
|
+
});
|
|
433
|
+
} : undefined;
|
|
434
|
+
const nativeToModelOutput = nativeTool.toModelOutput;
|
|
435
|
+
const toModelOutput = nativeToModelOutput ? async (options) => toAiSdkModelOutput(await nativeToModelOutput.call(nativeTool, options)) : undefined;
|
|
436
|
+
const toolProviderOptions = toAiSdkProviderOptions(nativeTool.providerOptions);
|
|
437
|
+
const shared = {
|
|
438
|
+
description: nativeTool.description,
|
|
439
|
+
inputSchema,
|
|
440
|
+
...nativeTool.strict !== undefined && { strict: nativeTool.strict },
|
|
441
|
+
...toolProviderOptions && { providerOptions: toolProviderOptions }
|
|
442
|
+
};
|
|
443
|
+
const withOutput = { ...shared, ...toModelOutput && { toModelOutput } };
|
|
444
|
+
if (execute) {
|
|
445
|
+
tools[name] = tool({
|
|
446
|
+
...withOutput,
|
|
447
|
+
...nativeTool.outputSchema && { outputSchema: nativeTool.outputSchema },
|
|
448
|
+
execute
|
|
449
|
+
});
|
|
450
|
+
} else if (nativeTool.outputSchema) {
|
|
451
|
+
tools[name] = tool({
|
|
452
|
+
...withOutput,
|
|
453
|
+
outputSchema: nativeTool.outputSchema
|
|
454
|
+
});
|
|
455
|
+
} else {
|
|
456
|
+
tools[name] = tool(shared);
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
return tools;
|
|
460
|
+
}
|
|
461
|
+
function mountAgent2(services, config) {
|
|
462
|
+
return toAiSdkToolSet(buildAgentTools(services, config, "mountAgent"));
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
export { mountAgent2 };
|
|
@@ -2,17 +2,17 @@ import {
|
|
|
2
2
|
RealtimeRequestTimeoutError2,
|
|
3
3
|
RealtimeRequestDisconnectedError2
|
|
4
4
|
} from "./index-4s0fep5q.js";
|
|
5
|
+
import {
|
|
6
|
+
isModuleNotFound
|
|
7
|
+
} from "./index-sx3g49y2.js";
|
|
5
8
|
import {
|
|
6
9
|
realtimeRequestTraces,
|
|
7
10
|
createRequestTracer,
|
|
8
11
|
bindRealtimeClient2
|
|
9
|
-
} from "./index-
|
|
10
|
-
import {
|
|
11
|
-
isModuleNotFound
|
|
12
|
-
} from "./index-sx3g49y2.js";
|
|
12
|
+
} from "./index-033tyx59.js";
|
|
13
13
|
import {
|
|
14
14
|
assertTimerMs
|
|
15
|
-
} from "./index-
|
|
15
|
+
} from "./index-e1y74yra.js";
|
|
16
16
|
|
|
17
17
|
// src/browser/retained.ts
|
|
18
18
|
function createRetainedTopics2() {
|