stitchkit 0.133.1 → 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 +121 -0
- package/README.md +14 -11
- package/dist/agent-executor/acp/v1-connect.d.ts +5 -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-probe.d.ts +3 -0
- package/dist/agent-executor/acp/v1-probe.d.ts.map +1 -1
- package/dist/agent-executor/acp/v1-protocol.d.ts +61 -0
- package/dist/agent-executor/acp/v1-protocol.d.ts.map +1 -1
- package/dist/agent-executor/acp/v1-session.d.ts +3 -0
- package/dist/agent-executor/acp/v1-session.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/testing/consumer-stubs.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 +224 -47
- 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-t5g5rm9n.js → index-jzdbkanz.js} +5 -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 +4 -4
- 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 +983 -212
- 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
|
@@ -4,16 +4,25 @@ import {
|
|
|
4
4
|
AgentStoreEventEnvelopeSchema2,
|
|
5
5
|
AppendAgentStoreEventSchema2,
|
|
6
6
|
AgentRecordVersionSchema2,
|
|
7
|
+
AgentTimestampSchema2,
|
|
7
8
|
AgentMessageSchema2,
|
|
8
|
-
AgentUsageSchema2
|
|
9
|
+
AgentUsageSchema2
|
|
10
|
+
} from "./index-j3r7r1mh.js";
|
|
11
|
+
import {
|
|
12
|
+
AgentProviderResponseSchema2
|
|
13
|
+
} from "./index-7qza24g1.js";
|
|
14
|
+
import {
|
|
9
15
|
AgentRunOperationSchema2,
|
|
10
16
|
AgentTerminalReasonSchema2,
|
|
11
17
|
AgentRunSchema2,
|
|
12
18
|
AgentSnapshotSchema2
|
|
13
|
-
} from "./index-
|
|
19
|
+
} from "./index-pd9e8rz4.js";
|
|
14
20
|
import {
|
|
15
21
|
canonicalZodJson
|
|
16
22
|
} from "./index-brhhaygm.js";
|
|
23
|
+
import {
|
|
24
|
+
AgentCacheControlSchema2
|
|
25
|
+
} from "./index-vebzvse6.js";
|
|
17
26
|
|
|
18
27
|
// src/agent-runtime/store-driver-contract.ts
|
|
19
28
|
import { z } from "zod";
|
|
@@ -314,159 +323,374 @@ function conversationOfRun(run, factory) {
|
|
|
314
323
|
return run.run.conversationId;
|
|
315
324
|
}
|
|
316
325
|
|
|
317
|
-
// src/agent-runtime/
|
|
326
|
+
// src/agent-runtime/schemas-invocation-payload.ts
|
|
327
|
+
import { z as z4 } from "zod";
|
|
328
|
+
var Id = z4.string().min(1).max(512);
|
|
329
|
+
var Hash = z4.string().regex(/^[a-f0-9]{64}$/);
|
|
330
|
+
var PayloadBase = z4.object({
|
|
331
|
+
conversationId: Id,
|
|
332
|
+
invocationId: Id,
|
|
333
|
+
operationId: Id,
|
|
334
|
+
runId: Id.optional()
|
|
335
|
+
});
|
|
336
|
+
var InvocationPayloadSchema = PayloadBase.extend({
|
|
337
|
+
artifactId: Id,
|
|
338
|
+
sha256: Hash,
|
|
339
|
+
bytes: z4.int().nonnegative(),
|
|
340
|
+
iv: z4.string(),
|
|
341
|
+
tag: z4.string(),
|
|
342
|
+
ciphertext: z4.string()
|
|
343
|
+
}).strict();
|
|
344
|
+
var InvocationExpiredPayloadSchema = PayloadBase.extend({
|
|
345
|
+
artifactId: Id,
|
|
346
|
+
sha256: Hash,
|
|
347
|
+
bytes: z4.int().nonnegative(),
|
|
348
|
+
expiredAt: AgentTimestampSchema2
|
|
349
|
+
}).strict();
|
|
350
|
+
var PurgeInvocationPayloadsInputSchema2 = z4.object({
|
|
351
|
+
before: AgentTimestampSchema2,
|
|
352
|
+
conversationId: Id.optional(),
|
|
353
|
+
limit: z4.int().positive().max(1e4).optional()
|
|
354
|
+
}).strict();
|
|
355
|
+
var PurgeInvocationPayloadsResultSchema2 = z4.object({
|
|
356
|
+
purged: z4.int().nonnegative(),
|
|
357
|
+
freedBytes: z4.int().nonnegative(),
|
|
358
|
+
hasMore: z4.boolean()
|
|
359
|
+
}).strict();
|
|
360
|
+
function parsePayloadPurgeCutoff(before) {
|
|
361
|
+
const cutoffEpoch = Date.parse(before);
|
|
362
|
+
if (Number.isNaN(cutoffEpoch)) {
|
|
363
|
+
throw new TypeError(`Invalid payload expiry cutoff timestamp: ${JSON.stringify(before)}`);
|
|
364
|
+
}
|
|
365
|
+
return cutoffEpoch;
|
|
366
|
+
}
|
|
367
|
+
function redactLiveInvocationPayload(rawPayload, expiredAt) {
|
|
368
|
+
if (InvocationExpiredPayloadSchema.safeParse(rawPayload).success)
|
|
369
|
+
return;
|
|
370
|
+
const live = InvocationPayloadSchema.parse(rawPayload);
|
|
371
|
+
return InvocationExpiredPayloadSchema.parse({
|
|
372
|
+
conversationId: live.conversationId,
|
|
373
|
+
invocationId: live.invocationId,
|
|
374
|
+
operationId: live.operationId,
|
|
375
|
+
...live.runId !== undefined && { runId: live.runId },
|
|
376
|
+
artifactId: live.artifactId,
|
|
377
|
+
sha256: live.sha256,
|
|
378
|
+
bytes: live.bytes,
|
|
379
|
+
expiredAt
|
|
380
|
+
});
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
// src/agent-runtime/invocation-schema.ts
|
|
318
384
|
import { z as z5 } from "zod";
|
|
385
|
+
var Id2 = z5.string().min(1).max(512);
|
|
386
|
+
var Hash2 = z5.string().regex(/^[a-f0-9]{64}$/);
|
|
387
|
+
var ModelInvocationTraceSchema2 = z5.object({
|
|
388
|
+
operationId: Id2,
|
|
389
|
+
purpose: Id2,
|
|
390
|
+
project: Id2,
|
|
391
|
+
parent: z5.object({ traceId: Id2, invocationId: Id2.optional() }).strict().optional(),
|
|
392
|
+
experiment: Id2.optional(),
|
|
393
|
+
case: Id2.optional(),
|
|
394
|
+
profile: Id2.optional()
|
|
395
|
+
}).strict();
|
|
396
|
+
var CompletionInvocationInputSchema2 = z5.object({
|
|
397
|
+
conversationId: Id2,
|
|
398
|
+
idempotencyKey: Id2,
|
|
399
|
+
trace: ModelInvocationTraceSchema2,
|
|
400
|
+
prompt: z5.string().min(1),
|
|
401
|
+
models: z5.array(Id2).min(1).max(8),
|
|
402
|
+
settings: z5.object({
|
|
403
|
+
maxOutputTokens: z5.int().positive().optional(),
|
|
404
|
+
temperature: z5.number().optional(),
|
|
405
|
+
topP: z5.number().min(0).max(1).optional(),
|
|
406
|
+
seed: z5.int().optional()
|
|
407
|
+
}).strict().optional(),
|
|
408
|
+
timeoutMs: z5.int().positive().max(3600000)
|
|
409
|
+
}).strict();
|
|
410
|
+
var Identity = z5.object({
|
|
411
|
+
provider: Id2.nullable(),
|
|
412
|
+
modelId: Id2.nullable(),
|
|
413
|
+
responseId: Id2.nullable()
|
|
414
|
+
}).strict();
|
|
415
|
+
var InvocationCallerSchema = z5.object({ subject: Id2 }).strict();
|
|
416
|
+
var InvocationProcessSchema = z5.object({
|
|
417
|
+
instanceId: Id2,
|
|
418
|
+
pid: z5.int().positive(),
|
|
419
|
+
hostname: Id2
|
|
420
|
+
}).strict();
|
|
421
|
+
var Base = z5.object({
|
|
422
|
+
conversationId: Id2,
|
|
423
|
+
invocationId: Id2,
|
|
424
|
+
operationId: Id2,
|
|
425
|
+
runId: Id2.optional()
|
|
426
|
+
});
|
|
427
|
+
var InvocationStartedSchema = Base.extend({
|
|
428
|
+
type: z5.literal("invocation/started"),
|
|
429
|
+
mode: z5.enum(["completion", "agent"]),
|
|
430
|
+
trace: ModelInvocationTraceSchema2,
|
|
431
|
+
caller: InvocationCallerSchema,
|
|
432
|
+
executingProcess: InvocationProcessSchema,
|
|
433
|
+
fingerprint: Hash2,
|
|
434
|
+
requested: z5.object({ models: z5.array(Id2), payloadSha256: Hash2 }).strict()
|
|
435
|
+
}).strict();
|
|
436
|
+
var InvocationAttemptContextSchema = Base.extend({
|
|
437
|
+
attemptId: Id2,
|
|
438
|
+
step: z5.int().nonnegative()
|
|
439
|
+
}).strict();
|
|
440
|
+
var InvocationPayloadOmissionReasonSchema2 = z5.enum(["max-payload-bytes"]);
|
|
441
|
+
var Attempt = Base.extend({ attemptId: Id2, step: z5.int().nonnegative() });
|
|
442
|
+
var InvocationRequestSchema = Attempt.extend({
|
|
443
|
+
type: z5.literal("provider/request"),
|
|
444
|
+
requested: z5.object({ modelId: Id2, provider: Id2 }).strict(),
|
|
445
|
+
executingProcess: InvocationProcessSchema,
|
|
446
|
+
sent: z5.object({
|
|
447
|
+
modelId: Id2,
|
|
448
|
+
provider: Id2,
|
|
449
|
+
payloadSha256: Hash2,
|
|
450
|
+
artifactId: Id2.optional(),
|
|
451
|
+
payloadOmitted: InvocationPayloadOmissionReasonSchema2.optional(),
|
|
452
|
+
tools: z5.int().nonnegative()
|
|
453
|
+
}).strict().superRefine((sent, ctx) => {
|
|
454
|
+
const hasArtifact = sent.artifactId !== undefined;
|
|
455
|
+
const hasOmitted = sent.payloadOmitted !== undefined;
|
|
456
|
+
if (hasArtifact === hasOmitted) {
|
|
457
|
+
ctx.addIssue({
|
|
458
|
+
code: "custom",
|
|
459
|
+
message: "provider/request sent requires exactly one of artifactId or payloadOmitted"
|
|
460
|
+
});
|
|
461
|
+
}
|
|
462
|
+
})
|
|
463
|
+
}).strict();
|
|
464
|
+
var InvocationResponseSchema = Attempt.extend({
|
|
465
|
+
type: z5.literal("provider/response"),
|
|
466
|
+
status: z5.enum(["succeeded", "failed", "cancelled"]),
|
|
467
|
+
effective: Identity,
|
|
468
|
+
usage: AgentUsageSchema2,
|
|
469
|
+
artifactId: Id2.optional(),
|
|
470
|
+
payloadOmitted: InvocationPayloadOmissionReasonSchema2.optional(),
|
|
471
|
+
payloadSha256: Hash2
|
|
472
|
+
}).strict().superRefine((response, ctx) => {
|
|
473
|
+
const hasArtifact = response.artifactId !== undefined;
|
|
474
|
+
const hasOmitted = response.payloadOmitted !== undefined;
|
|
475
|
+
if (hasArtifact === hasOmitted) {
|
|
476
|
+
ctx.addIssue({
|
|
477
|
+
code: "custom",
|
|
478
|
+
message: "provider/response requires exactly one of artifactId or payloadOmitted"
|
|
479
|
+
});
|
|
480
|
+
}
|
|
481
|
+
});
|
|
482
|
+
var InvocationFinishedSchema = Base.extend({
|
|
483
|
+
type: z5.literal("invocation/finished"),
|
|
484
|
+
failure: z5.object({ artifactId: Id2, payloadSha256: Hash2 }).strict().optional(),
|
|
485
|
+
status: z5.enum(["succeeded", "failed", "cancelled"])
|
|
486
|
+
}).strict();
|
|
487
|
+
var ModelInvocationRecordSchema2 = z5.discriminatedUnion("type", [
|
|
488
|
+
InvocationStartedSchema,
|
|
489
|
+
InvocationRequestSchema,
|
|
490
|
+
InvocationResponseSchema,
|
|
491
|
+
InvocationFinishedSchema
|
|
492
|
+
]);
|
|
493
|
+
var InvocationStoredPayloadSchema = z5.union([
|
|
494
|
+
InvocationPayloadSchema,
|
|
495
|
+
InvocationExpiredPayloadSchema
|
|
496
|
+
]);
|
|
497
|
+
var InvocationPayloadReceiptSchema = Base.extend({
|
|
498
|
+
artifactId: Id2,
|
|
499
|
+
sha256: Hash2,
|
|
500
|
+
bytes: z5.int().nonnegative(),
|
|
501
|
+
iv: z5.string().optional(),
|
|
502
|
+
tag: z5.string().optional(),
|
|
503
|
+
ciphertext: z5.string().optional(),
|
|
504
|
+
expiredAt: AgentTimestampSchema2.optional()
|
|
505
|
+
}).strict().superRefine((value, ctx) => {
|
|
506
|
+
const cipherParts = [value.iv, value.tag, value.ciphertext].filter((p) => p !== undefined).length;
|
|
507
|
+
if (cipherParts > 0 && cipherParts < 3) {
|
|
508
|
+
ctx.addIssue({
|
|
509
|
+
code: "custom",
|
|
510
|
+
message: "Invocation payload receipt has incomplete encryption fields"
|
|
511
|
+
});
|
|
512
|
+
}
|
|
513
|
+
if (cipherParts > 0 && value.expiredAt !== undefined) {
|
|
514
|
+
ctx.addIssue({
|
|
515
|
+
code: "custom",
|
|
516
|
+
message: "Invocation payload receipt cannot carry both ciphertext and expiredAt"
|
|
517
|
+
});
|
|
518
|
+
}
|
|
519
|
+
});
|
|
520
|
+
var ModelInvocationPayloadReadSchema2 = z5.discriminatedUnion("status", [
|
|
521
|
+
z5.object({
|
|
522
|
+
status: z5.literal("available"),
|
|
523
|
+
artifactId: Id2,
|
|
524
|
+
sha256: Hash2,
|
|
525
|
+
bytes: z5.int().nonnegative(),
|
|
526
|
+
payload: z5.json()
|
|
527
|
+
}).strict(),
|
|
528
|
+
z5.object({
|
|
529
|
+
status: z5.literal("expired"),
|
|
530
|
+
artifactId: Id2,
|
|
531
|
+
sha256: Hash2,
|
|
532
|
+
bytes: z5.int().nonnegative(),
|
|
533
|
+
expiredAt: AgentTimestampSchema2
|
|
534
|
+
}).strict()
|
|
535
|
+
]);
|
|
536
|
+
function isModelInvocationRecord(payload) {
|
|
537
|
+
return payload !== null && typeof payload === "object" && "invocationId" in payload;
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
// src/agent-runtime/provider-journal.ts
|
|
541
|
+
import { z as z7 } from "zod";
|
|
319
542
|
|
|
320
543
|
// src/agent-runtime/provider-content.ts
|
|
321
|
-
import { z as
|
|
544
|
+
import { z as z6 } from "zod";
|
|
322
545
|
var ProviderJournalOptions = {
|
|
323
|
-
providerOptions:
|
|
546
|
+
providerOptions: z6.record(z6.string(), z6.record(z6.string(), z6.json())).optional(),
|
|
547
|
+
cacheControl: AgentCacheControlSchema2.optional()
|
|
324
548
|
};
|
|
325
549
|
var Options = ProviderJournalOptions;
|
|
326
|
-
var Reference =
|
|
327
|
-
var Binary =
|
|
328
|
-
binary:
|
|
329
|
-
sha256:
|
|
330
|
-
bytes:
|
|
550
|
+
var Reference = z6.record(z6.string(), z6.string()).refine((value) => !("type" in value), "Provider reference cannot contain a file discriminator");
|
|
551
|
+
var Binary = z6.object({
|
|
552
|
+
binary: z6.literal(true),
|
|
553
|
+
sha256: z6.string().regex(/^[a-f0-9]{64}$/),
|
|
554
|
+
bytes: z6.int().nonnegative()
|
|
331
555
|
}).strict();
|
|
332
|
-
var Inline =
|
|
333
|
-
var TaggedBinary =
|
|
334
|
-
var TaggedUrl =
|
|
335
|
-
var FileData =
|
|
556
|
+
var Inline = z6.union([z6.string(), Binary]);
|
|
557
|
+
var TaggedBinary = z6.object({ type: z6.literal("data"), data: Inline }).strict();
|
|
558
|
+
var TaggedUrl = z6.object({ type: z6.literal("url"), url: z6.string() }).strict();
|
|
559
|
+
var FileData = z6.union([
|
|
336
560
|
TaggedBinary,
|
|
337
561
|
TaggedUrl,
|
|
338
|
-
|
|
339
|
-
|
|
562
|
+
z6.object({ type: z6.literal("reference"), reference: Reference }).strict(),
|
|
563
|
+
z6.object({ type: z6.literal("text"), text: z6.string() }).strict()
|
|
340
564
|
]);
|
|
341
|
-
var File =
|
|
342
|
-
type:
|
|
343
|
-
data:
|
|
344
|
-
mediaType:
|
|
345
|
-
filename:
|
|
565
|
+
var File = z6.object({
|
|
566
|
+
type: z6.literal("file"),
|
|
567
|
+
data: z6.union([FileData, Inline, Reference]),
|
|
568
|
+
mediaType: z6.string(),
|
|
569
|
+
filename: z6.string().optional(),
|
|
346
570
|
...Options
|
|
347
571
|
}).strict();
|
|
348
|
-
var Text =
|
|
349
|
-
var Output =
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
type:
|
|
355
|
-
value:
|
|
572
|
+
var Text = z6.object({ type: z6.literal("text"), text: z6.string(), ...Options }).strict();
|
|
573
|
+
var Output = z6.discriminatedUnion("type", [
|
|
574
|
+
z6.object({ type: z6.enum(["text", "error-text"]), value: z6.string(), ...Options }).strict(),
|
|
575
|
+
z6.object({ type: z6.enum(["json", "error-json"]), value: z6.json(), ...Options }).strict(),
|
|
576
|
+
z6.object({ type: z6.literal("execution-denied"), reason: z6.string().optional(), ...Options }).strict(),
|
|
577
|
+
z6.object({
|
|
578
|
+
type: z6.literal("content"),
|
|
579
|
+
value: z6.array(z6.union([
|
|
356
580
|
Text,
|
|
357
|
-
|
|
358
|
-
type:
|
|
581
|
+
z6.object({
|
|
582
|
+
type: z6.literal("file"),
|
|
359
583
|
data: FileData,
|
|
360
|
-
mediaType:
|
|
361
|
-
filename:
|
|
584
|
+
mediaType: z6.string(),
|
|
585
|
+
filename: z6.string().optional(),
|
|
362
586
|
...Options
|
|
363
587
|
}).strict(),
|
|
364
|
-
|
|
365
|
-
type:
|
|
366
|
-
data:
|
|
367
|
-
mediaType:
|
|
368
|
-
filename:
|
|
588
|
+
z6.object({
|
|
589
|
+
type: z6.literal("file-data"),
|
|
590
|
+
data: z6.string(),
|
|
591
|
+
mediaType: z6.string(),
|
|
592
|
+
filename: z6.string().optional(),
|
|
369
593
|
...Options
|
|
370
594
|
}).strict(),
|
|
371
|
-
|
|
372
|
-
type:
|
|
373
|
-
data:
|
|
374
|
-
mediaType:
|
|
595
|
+
z6.object({
|
|
596
|
+
type: z6.literal("image-data"),
|
|
597
|
+
data: z6.string(),
|
|
598
|
+
mediaType: z6.string(),
|
|
375
599
|
...Options
|
|
376
600
|
}).strict(),
|
|
377
|
-
|
|
378
|
-
type:
|
|
379
|
-
url:
|
|
380
|
-
mediaType:
|
|
601
|
+
z6.object({
|
|
602
|
+
type: z6.literal("file-url"),
|
|
603
|
+
url: z6.string(),
|
|
604
|
+
mediaType: z6.string().optional(),
|
|
381
605
|
...Options
|
|
382
606
|
}).strict(),
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
type:
|
|
386
|
-
fileId:
|
|
607
|
+
z6.object({ type: z6.literal("image-url"), url: z6.string(), ...Options }).strict(),
|
|
608
|
+
z6.object({
|
|
609
|
+
type: z6.enum(["file-id", "image-file-id"]),
|
|
610
|
+
fileId: z6.union([z6.string(), Reference]),
|
|
387
611
|
...Options
|
|
388
612
|
}).strict(),
|
|
389
|
-
|
|
390
|
-
type:
|
|
613
|
+
z6.object({
|
|
614
|
+
type: z6.enum(["file-reference", "image-file-reference"]),
|
|
391
615
|
providerReference: Reference,
|
|
392
616
|
...Options
|
|
393
617
|
}).strict(),
|
|
394
|
-
|
|
618
|
+
z6.object({ type: z6.literal("custom"), ...Options }).strict()
|
|
395
619
|
]))
|
|
396
620
|
}).strict()
|
|
397
621
|
]);
|
|
398
|
-
var ProviderJournalContentSchema =
|
|
622
|
+
var ProviderJournalContentSchema = z6.union([
|
|
399
623
|
Text,
|
|
400
624
|
File,
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
type:
|
|
405
|
-
data:
|
|
406
|
-
mediaType:
|
|
625
|
+
z6.object({ type: z6.literal("reasoning"), text: z6.string(), ...Options }).strict(),
|
|
626
|
+
z6.object({ type: z6.literal("custom"), kind: z6.string(), ...Options }).strict(),
|
|
627
|
+
z6.object({
|
|
628
|
+
type: z6.literal("reasoning-file"),
|
|
629
|
+
data: z6.union([TaggedBinary, TaggedUrl, Inline]),
|
|
630
|
+
mediaType: z6.string(),
|
|
407
631
|
...Options
|
|
408
632
|
}).strict(),
|
|
409
|
-
|
|
410
|
-
type:
|
|
411
|
-
image:
|
|
412
|
-
mediaType:
|
|
633
|
+
z6.object({
|
|
634
|
+
type: z6.literal("image"),
|
|
635
|
+
image: z6.union([Inline, Reference]),
|
|
636
|
+
mediaType: z6.string().optional(),
|
|
413
637
|
...Options
|
|
414
638
|
}).strict(),
|
|
415
|
-
|
|
416
|
-
type:
|
|
417
|
-
toolCallId:
|
|
418
|
-
toolName:
|
|
419
|
-
input:
|
|
420
|
-
providerExecuted:
|
|
639
|
+
z6.object({
|
|
640
|
+
type: z6.literal("tool-call"),
|
|
641
|
+
toolCallId: z6.string(),
|
|
642
|
+
toolName: z6.string(),
|
|
643
|
+
input: z6.json(),
|
|
644
|
+
providerExecuted: z6.boolean().optional(),
|
|
421
645
|
...Options
|
|
422
646
|
}).strict(),
|
|
423
|
-
|
|
424
|
-
type:
|
|
425
|
-
toolCallId:
|
|
426
|
-
toolName:
|
|
647
|
+
z6.object({
|
|
648
|
+
type: z6.literal("tool-result"),
|
|
649
|
+
toolCallId: z6.string(),
|
|
650
|
+
toolName: z6.string(),
|
|
427
651
|
output: Output,
|
|
428
652
|
...Options
|
|
429
653
|
}).strict(),
|
|
430
|
-
|
|
431
|
-
type:
|
|
432
|
-
approvalId:
|
|
433
|
-
toolCallId:
|
|
434
|
-
signature:
|
|
435
|
-
isAutomatic:
|
|
436
|
-
reason:
|
|
654
|
+
z6.object({
|
|
655
|
+
type: z6.literal("tool-approval-request"),
|
|
656
|
+
approvalId: z6.string(),
|
|
657
|
+
toolCallId: z6.string(),
|
|
658
|
+
signature: z6.string().optional(),
|
|
659
|
+
isAutomatic: z6.boolean().optional(),
|
|
660
|
+
reason: z6.string().optional()
|
|
437
661
|
}).strict(),
|
|
438
|
-
|
|
439
|
-
type:
|
|
440
|
-
approvalId:
|
|
441
|
-
approved:
|
|
442
|
-
reason:
|
|
443
|
-
providerExecuted:
|
|
662
|
+
z6.object({
|
|
663
|
+
type: z6.literal("tool-approval-response"),
|
|
664
|
+
approvalId: z6.string(),
|
|
665
|
+
approved: z6.boolean(),
|
|
666
|
+
reason: z6.string().optional(),
|
|
667
|
+
providerExecuted: z6.boolean().optional()
|
|
444
668
|
}).strict()
|
|
445
669
|
]);
|
|
446
670
|
|
|
447
671
|
// src/agent-runtime/provider-journal.ts
|
|
448
|
-
var
|
|
449
|
-
var Message =
|
|
672
|
+
var Hash3 = z7.string().regex(/^[a-f0-9]{64}$/);
|
|
673
|
+
var Message = z7.object({
|
|
450
674
|
...ProviderJournalOptions,
|
|
451
|
-
role:
|
|
452
|
-
content:
|
|
675
|
+
role: z7.enum(["system", "user", "assistant", "tool"]),
|
|
676
|
+
content: z7.union([z7.string(), z7.array(ProviderJournalContentSchema)])
|
|
453
677
|
}).strict();
|
|
454
|
-
var ProviderJournalMessageSchema =
|
|
455
|
-
var ProviderJournalRequestSchema =
|
|
456
|
-
runId:
|
|
457
|
-
attempt:
|
|
458
|
-
stepNumber:
|
|
459
|
-
modelId:
|
|
460
|
-
instructionsSha256:
|
|
461
|
-
messageShas:
|
|
462
|
-
bodySha256:
|
|
678
|
+
var ProviderJournalMessageSchema = z7.object({ sha256: Hash3, message: Message }).strict();
|
|
679
|
+
var ProviderJournalRequestSchema = z7.object({
|
|
680
|
+
runId: z7.string(),
|
|
681
|
+
attempt: z7.int().nonnegative(),
|
|
682
|
+
stepNumber: z7.int().nonnegative(),
|
|
683
|
+
modelId: z7.string(),
|
|
684
|
+
instructionsSha256: Hash3,
|
|
685
|
+
messageShas: z7.array(Hash3),
|
|
686
|
+
bodySha256: Hash3
|
|
463
687
|
}).strict();
|
|
464
|
-
var ProviderJournalResponseSchema =
|
|
465
|
-
runId:
|
|
466
|
-
attempt:
|
|
467
|
-
stepNumber:
|
|
468
|
-
response:
|
|
688
|
+
var ProviderJournalResponseSchema = z7.strictObject({
|
|
689
|
+
runId: z7.string(),
|
|
690
|
+
attempt: z7.int().nonnegative(),
|
|
691
|
+
stepNumber: z7.int().nonnegative(),
|
|
692
|
+
response: AgentProviderResponseSchema2,
|
|
469
693
|
usage: AgentUsageSchema2.optional()
|
|
470
694
|
});
|
|
471
695
|
|
|
472
|
-
export { AgentRuntimeHeadSchema2, AgentStoredRunSchema2, AgentAdmissionReceiptSchema2, AgentSeedReceiptSchema2, AgentHistoryMutationSchema2, ACTIVE_AGENT_RUN_STATES2, isActiveRunState, emptyHead, AgentStoreConflictSchema2, AgentStoreNotFoundSchema2, AgentStoreAppliedSchema2, AgentStoreDuplicateSchema2, AgentStoreMutationResultSchema2, AgentRunViewSchema2, AcceptInputAndAssignRunSchema2, AcquireAgentRunSchema2, CheckpointRunAssistantSchema2, RecordRunOperationSchema2, CommitRunTerminalSchema2, RequestRunInterruptSchema2, RecoverAgentRunSchema2, ReplaceCompactedRangeSchema2, SeedConversationInputSchema2, AgentRecoverableDescriptorSchema2, AgentRecoverablePageSchema2, AgentStoreTransitionSchema2, AgentStoreCheckpointRecordSchema, AgentStoreTransitionRecordSchema2, decodeAgentStoreEvent2, agentStoreEventDraft, canonicalAgentJson2, AgentConversationArchiveSchema2, encodeAgentConversationArchive2, decodeAgentConversationArchive2, issueRunContext, conversationOfRun, ProviderJournalMessageSchema, ProviderJournalRequestSchema, ProviderJournalResponseSchema };
|
|
696
|
+
export { AgentRuntimeHeadSchema2, AgentStoredRunSchema2, AgentAdmissionReceiptSchema2, AgentSeedReceiptSchema2, AgentHistoryMutationSchema2, ACTIVE_AGENT_RUN_STATES2, isActiveRunState, emptyHead, AgentStoreConflictSchema2, AgentStoreNotFoundSchema2, AgentStoreAppliedSchema2, AgentStoreDuplicateSchema2, AgentStoreMutationResultSchema2, AgentRunViewSchema2, AcceptInputAndAssignRunSchema2, AcquireAgentRunSchema2, CheckpointRunAssistantSchema2, RecordRunOperationSchema2, CommitRunTerminalSchema2, RequestRunInterruptSchema2, RecoverAgentRunSchema2, ReplaceCompactedRangeSchema2, SeedConversationInputSchema2, AgentRecoverableDescriptorSchema2, AgentRecoverablePageSchema2, AgentStoreTransitionSchema2, AgentStoreCheckpointRecordSchema, AgentStoreTransitionRecordSchema2, decodeAgentStoreEvent2, agentStoreEventDraft, canonicalAgentJson2, AgentConversationArchiveSchema2, encodeAgentConversationArchive2, decodeAgentConversationArchive2, issueRunContext, conversationOfRun, InvocationPayloadSchema, InvocationExpiredPayloadSchema, PurgeInvocationPayloadsInputSchema2, PurgeInvocationPayloadsResultSchema2, parsePayloadPurgeCutoff, redactLiveInvocationPayload, ModelInvocationTraceSchema2, CompletionInvocationInputSchema2, InvocationCallerSchema, InvocationStartedSchema, InvocationPayloadOmissionReasonSchema2, InvocationRequestSchema, InvocationResponseSchema, InvocationFinishedSchema, ModelInvocationRecordSchema2, InvocationStoredPayloadSchema, InvocationPayloadReceiptSchema, ModelInvocationPayloadReadSchema2, isModelInvocationRecord, ProviderJournalMessageSchema, ProviderJournalRequestSchema, ProviderJournalResponseSchema };
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
assertCorsConfig,
|
|
5
5
|
requestCorsHeaders,
|
|
6
6
|
applyCors
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-654rhe5d.js";
|
|
8
8
|
import {
|
|
9
9
|
joinRoutePath,
|
|
10
10
|
parseTrailingWildcard
|
|
@@ -59,6 +59,11 @@ import {
|
|
|
59
59
|
badRequest2,
|
|
60
60
|
forbidden2
|
|
61
61
|
} from "./index-7fjbdga8.js";
|
|
62
|
+
import {
|
|
63
|
+
DEADLINE_BUDGET_HEADER2,
|
|
64
|
+
resolveServerDeadlineBudget,
|
|
65
|
+
createRemainingTimeoutReader
|
|
66
|
+
} from "./index-k137ezb6.js";
|
|
62
67
|
import {
|
|
63
68
|
resolveTraceContext2
|
|
64
69
|
} from "./index-y7sy1xdp.js";
|
|
@@ -66,20 +71,24 @@ import {
|
|
|
66
71
|
readBoundedChunks,
|
|
67
72
|
concatChunks,
|
|
68
73
|
readBoundedText
|
|
69
|
-
} from "./index-
|
|
74
|
+
} from "./index-f16b7rze.js";
|
|
70
75
|
import {
|
|
71
76
|
assertPositiveSafeInteger
|
|
72
77
|
} from "./index-gr0kxymw.js";
|
|
73
|
-
import {
|
|
74
|
-
isRecord,
|
|
75
|
-
isAsyncIterable
|
|
76
|
-
} from "./index-ps3djm8d.js";
|
|
77
78
|
import {
|
|
78
79
|
assertTimerMs
|
|
79
|
-
} from "./index-
|
|
80
|
+
} from "./index-e1y74yra.js";
|
|
80
81
|
import {
|
|
81
|
-
abortReason
|
|
82
|
+
abortReason,
|
|
83
|
+
linkAbortSignals
|
|
82
84
|
} from "./index-rptj3qnc.js";
|
|
85
|
+
import {
|
|
86
|
+
abortError
|
|
87
|
+
} from "./index-wz392jyz.js";
|
|
88
|
+
import {
|
|
89
|
+
isRecord,
|
|
90
|
+
isAsyncIterable
|
|
91
|
+
} from "./index-ps3djm8d.js";
|
|
83
92
|
|
|
84
93
|
// src/server/logging.ts
|
|
85
94
|
var LOGGER_METHODS = ["info", "warn", "error", "debug"];
|
|
@@ -524,6 +533,7 @@ var RUNTIME_CONTEXT_RESERVED_KEYS = new Set([
|
|
|
524
533
|
"ipAddress",
|
|
525
534
|
"userAgent",
|
|
526
535
|
"signal",
|
|
536
|
+
"remainingTimeoutMs",
|
|
527
537
|
"toolCallId",
|
|
528
538
|
"mcp",
|
|
529
539
|
"reportProgress"
|
|
@@ -1670,8 +1680,40 @@ async function dispatchEndpoint(state, request, match) {
|
|
|
1670
1680
|
activeContext.serviceName = method.serviceName;
|
|
1671
1681
|
activeContext.action = method.key;
|
|
1672
1682
|
}
|
|
1683
|
+
let deadlineTimer;
|
|
1684
|
+
let deadlineLink;
|
|
1685
|
+
let deadlineOwnedByStream = false;
|
|
1686
|
+
const releaseDeadline = () => {
|
|
1687
|
+
if (deadlineTimer !== undefined) {
|
|
1688
|
+
clearTimeout(deadlineTimer);
|
|
1689
|
+
deadlineTimer = undefined;
|
|
1690
|
+
}
|
|
1691
|
+
deadlineLink?.release();
|
|
1692
|
+
deadlineLink = undefined;
|
|
1693
|
+
};
|
|
1673
1694
|
let multipartLifecycle;
|
|
1674
1695
|
try {
|
|
1696
|
+
const budget = resolveServerDeadlineBudget({
|
|
1697
|
+
headerValue: req.headers.get(DEADLINE_BUDGET_HEADER2),
|
|
1698
|
+
endpointTimeoutMs: method.timeout
|
|
1699
|
+
});
|
|
1700
|
+
if (budget.kind === "bounded") {
|
|
1701
|
+
const deadlineAt = performance.now() + budget.budgetMs;
|
|
1702
|
+
const deadlineController = new AbortController;
|
|
1703
|
+
deadlineTimer = setTimeout(() => {
|
|
1704
|
+
deadlineController.abort(abortError("Request deadline exceeded", "TimeoutError"));
|
|
1705
|
+
}, budget.budgetMs);
|
|
1706
|
+
deadlineTimer.unref?.();
|
|
1707
|
+
deadlineLink = linkAbortSignals(req.signal, deadlineController.signal);
|
|
1708
|
+
ctx.signal = deadlineLink.signal;
|
|
1709
|
+
ctx.remainingTimeoutMs = createRemainingTimeoutReader(deadlineAt);
|
|
1710
|
+
} else if (budget.kind === "expired") {
|
|
1711
|
+
ctx.remainingTimeoutMs = () => 0;
|
|
1712
|
+
} else {
|
|
1713
|
+
ctx.remainingTimeoutMs = () => {
|
|
1714
|
+
return;
|
|
1715
|
+
};
|
|
1716
|
+
}
|
|
1675
1717
|
parsePathParamsInto(ctx, method);
|
|
1676
1718
|
if (hooks?.authorize) {
|
|
1677
1719
|
await hooks.authorize(ctx, method);
|
|
@@ -1679,6 +1721,12 @@ async function dispatchEndpoint(state, request, match) {
|
|
|
1679
1721
|
if (groupHooks?.authorize) {
|
|
1680
1722
|
await groupHooks.authorize(ctx, method);
|
|
1681
1723
|
}
|
|
1724
|
+
if (budget.kind === "expired") {
|
|
1725
|
+
throw new AppError2("REQUEST_TIMEOUT", {
|
|
1726
|
+
status: 408,
|
|
1727
|
+
message: "Request deadline budget exhausted"
|
|
1728
|
+
});
|
|
1729
|
+
}
|
|
1682
1730
|
try {
|
|
1683
1731
|
multipartLifecycle = await parseRequestPayloadInto(ctx, req, url, method, config.maxJsonBodyBytes, request.cors);
|
|
1684
1732
|
} catch (payloadError) {
|
|
@@ -1698,26 +1746,35 @@ async function dispatchEndpoint(state, request, match) {
|
|
|
1698
1746
|
ctx.response = responseMetadata;
|
|
1699
1747
|
const streamAbort = method.stream ? new AbortController : undefined;
|
|
1700
1748
|
if (streamAbort) {
|
|
1701
|
-
|
|
1702
|
-
|
|
1749
|
+
const signal = ctx.signal ?? req.signal;
|
|
1750
|
+
if (signal.aborted)
|
|
1751
|
+
streamAbort.abort(signal.reason);
|
|
1703
1752
|
else {
|
|
1704
|
-
|
|
1753
|
+
signal.addEventListener("abort", () => streamAbort.abort(signal.reason), {
|
|
1705
1754
|
once: true
|
|
1706
1755
|
});
|
|
1707
1756
|
}
|
|
1757
|
+
streamAbort.signal.addEventListener("abort", releaseDeadline, { once: true });
|
|
1708
1758
|
ctx.signal = streamAbort.signal;
|
|
1709
1759
|
}
|
|
1710
1760
|
const result = await method.handler(ctx);
|
|
1711
|
-
|
|
1761
|
+
const response = await endpointResponse(state, request, {
|
|
1712
1762
|
ctx,
|
|
1713
1763
|
match,
|
|
1714
1764
|
result,
|
|
1715
1765
|
responseMetadata,
|
|
1716
1766
|
streamAbort
|
|
1717
1767
|
});
|
|
1768
|
+
if (streamAbort && !streamAbort.signal.aborted) {
|
|
1769
|
+
deadlineOwnedByStream = true;
|
|
1770
|
+
}
|
|
1771
|
+
return response;
|
|
1718
1772
|
} catch (err) {
|
|
1719
1773
|
await multipartLifecycle?.rollback();
|
|
1720
1774
|
return request.respondError(err, ctx, method, groupHooks);
|
|
1775
|
+
} finally {
|
|
1776
|
+
if (!deadlineOwnedByStream)
|
|
1777
|
+
releaseDeadline();
|
|
1721
1778
|
}
|
|
1722
1779
|
}
|
|
1723
1780
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createBoundedChannel2
|
|
3
|
-
} from "./index-
|
|
3
|
+
} from "./index-02kdtrcd.js";
|
|
4
4
|
import {
|
|
5
5
|
assertDrainBound,
|
|
6
6
|
withinBound
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-7an2fs5h.js";
|
|
8
8
|
import {
|
|
9
9
|
ApplicationIdSchema2
|
|
10
10
|
} from "./index-w5s3xftz.js";
|