eve 0.13.8 → 0.15.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 +30 -0
- package/dist/src/channel/compiled-channel.js +2 -1
- package/dist/src/channel/routes.d.ts +5 -0
- package/dist/src/channel/send.js +1 -1
- package/dist/src/channel/types.d.ts +5 -0
- package/dist/src/cli/dev/tui/runner.js +1 -1
- package/dist/src/cli/dev/tui/setup-panel.d.ts +3 -4
- package/dist/src/cli/dev/tui/setup-panel.js +2 -2
- package/dist/src/cli/dev/tui/terminal-renderer.js +1 -1
- package/dist/src/compiled/.vendor-stamp.json +12 -8
- package/dist/src/compiled/@ai-sdk/anthropic/index.d.ts +2 -2
- package/dist/src/compiled/@ai-sdk/anthropic/index.js +2 -2
- package/dist/src/compiled/@ai-sdk/google/index.d.ts +25 -3
- package/dist/src/compiled/@ai-sdk/google/index.js +6 -6
- package/dist/src/compiled/@ai-sdk/mcp/index.d.ts +647 -30
- package/dist/src/compiled/@ai-sdk/mcp/index.js +1 -1
- package/dist/src/compiled/@ai-sdk/openai/index.d.ts +8 -2
- package/dist/src/compiled/@ai-sdk/openai/index.js +2 -2
- package/dist/src/compiled/@ai-sdk/otel/index.d.ts +165 -28
- package/dist/src/compiled/@ai-sdk/otel/index.js +3 -3
- package/dist/src/compiled/@ai-sdk/provider/index.d.ts +10 -2
- package/dist/src/compiled/@ai-sdk/provider-utils/index.d.ts +2362 -0
- package/dist/src/compiled/@ai-sdk/provider-utils/index.js +1 -0
- package/dist/src/compiled/@workflow/serde/LICENSE.md +3 -0
- package/dist/src/compiled/@workflow/serde/index.d.ts +30 -0
- package/dist/src/compiled/@workflow/serde/index.js +1 -0
- package/dist/src/compiled/_chunks/workflow/{dist-C9PV_vnE.js → dist-D7CzPkf8.js} +1 -1
- package/dist/src/compiled/eventsource-parser/stream/LICENSE +21 -0
- package/dist/src/compiled/eventsource-parser/stream/index.d.ts +121 -0
- package/dist/src/compiled/eventsource-parser/stream/index.js +1 -0
- package/dist/src/compiled/experimental-ai-sdk-code-mode/approval-continuation.d.ts +7 -7
- package/dist/src/compiled/experimental-ai-sdk-code-mode/continuation-capability.d.ts +15 -4
- package/dist/src/compiled/experimental-ai-sdk-code-mode/index.d.ts +1 -1
- package/dist/src/compiled/experimental-ai-sdk-code-mode/index.js +15 -15
- package/dist/src/compiled/experimental-ai-sdk-code-mode/interrupt-continuation.d.ts +5 -5
- package/dist/src/compiled/experimental-ai-sdk-code-mode/runtime/protocol.d.ts +13 -2
- package/dist/src/compiled/experimental-ai-sdk-code-mode/types.d.ts +26 -0
- package/dist/src/compiled/json-schema/LICENSE +21 -0
- package/dist/src/compiled/json-schema/index.d.ts +749 -0
- package/dist/src/compiled/json-schema/index.js +1 -0
- package/dist/src/compiler/manifest.js +1 -1
- package/dist/src/compiler/normalize-agent-config.js +1 -1
- package/dist/src/context/build-dynamic-tools.js +1 -1
- package/dist/src/context/dynamic-tool-lifecycle.js +1 -1
- package/dist/src/context/keys.d.ts +1 -1
- package/dist/src/evals/assertions/collector.d.ts +19 -6
- package/dist/src/evals/assertions/collector.js +1 -1
- package/dist/src/evals/assertions/run.d.ts +24 -17
- package/dist/src/evals/assertions/run.js +2 -2
- package/dist/src/evals/assertions/scoped.d.ts +17 -0
- package/dist/src/evals/assertions/scoped.js +1 -0
- package/dist/src/evals/context.d.ts +1 -0
- package/dist/src/evals/context.js +1 -1
- package/dist/src/evals/control-flow.d.ts +9 -0
- package/dist/src/evals/control-flow.js +1 -0
- package/dist/src/evals/define-eval.d.ts +1 -1
- package/dist/src/evals/define-eval.js +1 -1
- package/dist/src/evals/expect/index.d.ts +5 -3
- package/dist/src/evals/expect/index.js +1 -1
- package/dist/src/evals/index.d.ts +2 -2
- package/dist/src/evals/match.d.ts +50 -13
- package/dist/src/evals/match.js +1 -1
- package/dist/src/evals/runner/artifacts.js +1 -1
- package/dist/src/evals/runner/derive-run-facts.js +1 -1
- package/dist/src/evals/runner/execute-eval.js +1 -1
- package/dist/src/evals/runner/execute-task.d.ts +1 -0
- package/dist/src/evals/runner/execute-task.js +1 -1
- package/dist/src/evals/runner/reporters/braintrust.js +1 -1
- package/dist/src/evals/runner/reporters/console.js +1 -1
- package/dist/src/evals/runner/reporters/junit.js +3 -2
- package/dist/src/evals/runner/run-evals.js +1 -1
- package/dist/src/evals/runner/verdict.d.ts +1 -0
- package/dist/src/evals/runner/verdict.js +1 -1
- package/dist/src/evals/session.d.ts +9 -5
- package/dist/src/evals/session.js +1 -1
- package/dist/src/evals/types.d.ts +69 -47
- package/dist/src/execution/dispatch-runtime-actions-step.js +1 -1
- package/dist/src/execution/dispatch-workflow-runtime-actions-step.d.ts +12 -0
- package/dist/src/execution/dispatch-workflow-runtime-actions-step.js +1 -0
- package/dist/src/execution/next-driver-action.d.ts +1 -1
- package/dist/src/execution/node-step.js +1 -1
- package/dist/src/execution/session.js +3 -3
- package/dist/src/execution/turn-workflow.js +1 -1
- package/dist/src/execution/workflow-entry.js +1 -1
- package/dist/src/execution/workflow-runtime.d.ts +2 -11
- package/dist/src/execution/workflow-runtime.js +1 -1
- package/dist/src/execution/workflow-steps.d.ts +1 -1
- package/dist/src/execution/workflow-steps.js +1 -1
- package/dist/src/harness/action-result-helpers.d.ts +2 -2
- package/dist/src/harness/emission.d.ts +13 -27
- package/dist/src/harness/emission.js +1 -1
- package/dist/src/harness/execute-tool.d.ts +2 -2
- package/dist/src/harness/input-extraction.js +1 -1
- package/dist/src/harness/step-hooks.d.ts +3 -3
- package/dist/src/harness/step-hooks.js +1 -1
- package/dist/src/harness/tool-loop.js +1 -1
- package/dist/src/harness/tools.d.ts +4 -6
- package/dist/src/harness/tools.js +1 -1
- package/dist/src/harness/types.d.ts +4 -10
- package/dist/src/harness/workflow-continuation-security.d.ts +4 -0
- package/dist/src/harness/workflow-continuation-security.js +1 -0
- package/dist/src/harness/workflow-interrupt-state.d.ts +14 -0
- package/dist/src/harness/workflow-interrupt-state.js +1 -0
- package/dist/src/harness/workflow-lifecycle.d.ts +13 -0
- package/dist/src/harness/workflow-lifecycle.js +1 -0
- package/dist/src/harness/workflow-runtime-action-state.d.ts +9 -0
- package/dist/src/harness/workflow-runtime-action-state.js +1 -0
- package/dist/src/harness/workflow-sandbox.d.ts +22 -0
- package/dist/src/harness/workflow-sandbox.js +2 -0
- package/dist/src/harness/workflow-tool-description.d.ts +2 -2
- package/dist/src/harness/workflow-tool-description.js +16 -4
- package/dist/src/internal/application/compiled-artifacts.js +1 -1
- package/dist/src/internal/application/package.d.ts +12 -0
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/internal/application/paths.d.ts +6 -0
- package/dist/src/internal/application/paths.js +1 -1
- package/dist/src/internal/authored-definition/connection.js +1 -1
- package/dist/src/internal/authored-definition/core.js +1 -1
- package/dist/src/internal/authored-definition/schema-backed.js +1 -1
- package/dist/src/internal/nitro/host/configure-nitro-routes.js +2 -2
- package/dist/src/internal/nitro/host/create-application-nitro.js +1 -1
- package/dist/src/internal/nitro/host/workflow-sandbox-runtime-plugin.d.ts +1 -0
- package/dist/src/internal/nitro/host/workflow-sandbox-runtime-plugin.js +1 -0
- package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response-from-manifest.js +1 -1
- package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response.js +1 -1
- package/dist/src/internal/workflow/configure-world.d.ts +6 -0
- package/dist/src/internal/workflow/configure-world.js +1 -1
- package/dist/src/internal/workflow/runtime.d.ts +1 -0
- package/dist/src/internal/workflow/world-compatibility.d.ts +32 -0
- package/dist/src/internal/workflow/world-compatibility.js +1 -0
- package/dist/src/protocol/message.d.ts +7 -5
- package/dist/src/public/channels/slack/attachments.js +1 -1
- package/dist/src/public/channels/slack/auth.d.ts +2 -0
- package/dist/src/public/channels/slack/auth.js +1 -1
- package/dist/src/public/channels/slack/defaults.js +2 -2
- package/dist/src/public/channels/slack/inbound.d.ts +4 -11
- package/dist/src/public/channels/slack/inbound.js +1 -2
- package/dist/src/public/channels/slack/model-context.d.ts +28 -0
- package/dist/src/public/channels/slack/model-context.js +3 -0
- package/dist/src/public/channels/slack/slackChannel.d.ts +8 -0
- package/dist/src/public/channels/slack/slackChannel.js +1 -1
- package/dist/src/public/connections/index.d.ts +1 -1
- package/dist/src/public/definitions/agent.d.ts +1 -1
- package/dist/src/public/definitions/approval.d.ts +40 -0
- package/dist/src/public/definitions/approval.js +1 -0
- package/dist/src/public/definitions/connections/mcp.d.ts +11 -9
- package/dist/src/public/definitions/connections/mcp.js +1 -1
- package/dist/src/public/definitions/connections/openapi.d.ts +9 -7
- package/dist/src/public/definitions/connections/openapi.js +1 -1
- package/dist/src/public/definitions/tool.d.ts +7 -20
- package/dist/src/public/index.d.ts +1 -1
- package/dist/src/public/tools/approval/approval-helpers.d.ts +7 -7
- package/dist/src/public/tools/approval/approval-helpers.js +1 -1
- package/dist/src/public/tools/approval/index.d.ts +1 -1
- package/dist/src/public/tools/index.d.ts +2 -1
- package/dist/src/public/tools/internal.js +1 -1
- package/dist/src/runtime/actions/types.d.ts +10 -11
- package/dist/src/runtime/agent/bootstrap.d.ts +1 -0
- package/dist/src/runtime/agent/bootstrap.js +1 -1
- package/dist/src/runtime/agent/mock-model-adapter.js +2 -3
- package/dist/src/runtime/connections/mcp-client.d.ts +3 -3
- package/dist/src/runtime/connections/mcp-client.js +1 -1
- package/dist/src/runtime/connections/registry.d.ts +2 -2
- package/dist/src/runtime/connections/resolve-authorization.d.ts +11 -0
- package/dist/src/runtime/connections/resolve-authorization.js +1 -0
- package/dist/src/runtime/connections/types.d.ts +27 -11
- package/dist/src/runtime/framework-tools/connection-search-dynamic.js +1 -1
- package/dist/src/runtime/resolve-agent-graph.js +1 -1
- package/dist/src/runtime/resolve-agent.js +1 -1
- package/dist/src/runtime/resolve-connection.js +1 -1
- package/dist/src/runtime/resolve-tool.d.ts +1 -1
- package/dist/src/runtime/resolve-tool.js +1 -1
- package/dist/src/runtime/types.d.ts +8 -7
- package/dist/src/setup/boxes/resolve-provisioning.js +1 -1
- package/dist/src/setup/primitives/pm/pnpm.js +6 -5
- package/dist/src/setup/scaffold/create/add-to-project.js +1 -1
- package/dist/src/setup/scaffold/create/project.js +2 -2
- package/dist/src/setup/scaffold/update/channels.js +1 -1
- package/dist/src/shared/agent-definition.d.ts +11 -13
- package/dist/src/shared/dynamic-tool-definition.d.ts +3 -3
- package/dist/src/shared/tool-definition.d.ts +1 -2
- package/dist/src/shared/workflow-sandbox.d.ts +37 -0
- package/dist/src/shared/workflow-sandbox.js +1 -0
- package/docs/agent-config.md +43 -13
- package/docs/channels/custom.mdx +2 -2
- package/docs/channels/slack.mdx +7 -13
- package/docs/concepts/execution-model-and-durability.md +1 -1
- package/docs/concepts/sessions-runs-and-streaming.md +1 -1
- package/docs/connections/mcp.mdx +2 -2
- package/docs/connections/openapi.mdx +37 -2
- package/docs/connections/overview.mdx +72 -2
- package/docs/evals/assertions.mdx +97 -39
- package/docs/evals/cases.mdx +24 -15
- package/docs/evals/judge.mdx +2 -2
- package/docs/evals/overview.mdx +7 -5
- package/docs/evals/reporters.mdx +2 -2
- package/docs/evals/running.mdx +3 -1
- package/docs/evals/targets.mdx +2 -2
- package/docs/guides/auth-and-route-protection.md +48 -1
- package/docs/guides/client/streaming.mdx +1 -1
- package/docs/guides/deployment.md +5 -4
- package/docs/guides/dynamic-workflows.md +1 -7
- package/docs/guides/frontend/overview.mdx +1 -1
- package/docs/guides/frontend/use-eve-agent-svelte.mdx +1 -1
- package/docs/guides/frontend/use-eve-agent-vue.mdx +1 -1
- package/docs/guides/session-context.md +2 -1
- package/docs/reference/typescript-api.md +2 -2
- package/docs/subagents.mdx +2 -2
- package/docs/tools/human-in-the-loop.md +43 -6
- package/docs/tools/overview.mdx +3 -3
- package/docs/tutorial/connect-a-warehouse.mdx +2 -0
- package/docs/tutorial/first-agent.mdx +1 -1
- package/docs/tutorial/guard-the-spend.mdx +4 -3
- package/docs/tutorial/ship-it.mdx +1 -1
- package/package.json +14 -11
- package/dist/src/compiled/@ai-sdk/anthropic/_provider-utils.d.ts +0 -15
- package/dist/src/compiled/@ai-sdk/google/_provider-utils.d.ts +0 -11
- package/dist/src/compiled/@ai-sdk/openai/_provider-utils.d.ts +0 -15
- package/dist/src/compiled/@ai-sdk/provider/_json-schema.d.ts +0 -5
- package/dist/src/execution/dispatch-code-mode-runtime-actions-step.d.ts +0 -21
- package/dist/src/execution/dispatch-code-mode-runtime-actions-step.js +0 -1
- package/dist/src/harness/code-mode-interrupt-state.d.ts +0 -26
- package/dist/src/harness/code-mode-interrupt-state.js +0 -1
- package/dist/src/harness/code-mode-lifecycle.d.ts +0 -16
- package/dist/src/harness/code-mode-lifecycle.js +0 -1
- package/dist/src/harness/code-mode-runtime-action-state.d.ts +0 -6
- package/dist/src/harness/code-mode-runtime-action-state.js +0 -1
- package/dist/src/harness/code-mode.d.ts +0 -26
- package/dist/src/harness/code-mode.js +0 -1
- package/dist/src/harness/sandbox-surface.d.ts +0 -68
- package/dist/src/harness/sandbox-surface.js +0 -1
- package/dist/src/internal/nitro/host/code-mode-runtime-dependency-plugin.d.ts +0 -1
- package/dist/src/internal/nitro/host/code-mode-runtime-dependency-plugin.js +0 -1
- package/dist/src/runtime/framework-tools/code-mode-connection-auth.d.ts +0 -29
- package/dist/src/runtime/framework-tools/code-mode-connection-auth.js +0 -1
- package/dist/src/shared/code-mode.d.ts +0 -29
- package/dist/src/shared/code-mode.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Symbol used to define custom serialization for user-defined class instances.
|
|
3
|
+
* The static method should accept an instance and return serializable data.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* import { WORKFLOW_SERIALIZE, WORKFLOW_DESERIALIZE } from '@workflow/serde';
|
|
8
|
+
*
|
|
9
|
+
* class MyClass {
|
|
10
|
+
* constructor(public value: string) {}
|
|
11
|
+
*
|
|
12
|
+
* static [WORKFLOW_SERIALIZE](instance: MyClass) {
|
|
13
|
+
* return { value: instance.value };
|
|
14
|
+
* }
|
|
15
|
+
*
|
|
16
|
+
* static [WORKFLOW_DESERIALIZE](data: { value: string }) {
|
|
17
|
+
* return new MyClass(data.value);
|
|
18
|
+
* }
|
|
19
|
+
* }
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export declare const WORKFLOW_SERIALIZE: unique symbol;
|
|
23
|
+
/**
|
|
24
|
+
* Symbol used to define custom deserialization for user-defined class instances.
|
|
25
|
+
* The static method should accept serialized data and return a class instance.
|
|
26
|
+
*
|
|
27
|
+
* @see WORKFLOW_SERIALIZE for usage example
|
|
28
|
+
*/
|
|
29
|
+
export declare const WORKFLOW_DESERIALIZE: unique symbol;
|
|
30
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -70,7 +70,7 @@ ${a}`,l++}else Ac(e,n,i)?u=e.slice(e.charCodeAt(n+6)===32?n+7:n+6,r)||void 0:p(e
|
|
|
70
70
|
`,n)}return e.slice(n)}for(;n<e.length;){let t=e.indexOf(`\r`,n),r=e.indexOf(`
|
|
71
71
|
`,n),i=-1;if(t!==-1&&r!==-1?i=t<r?t:r:t===-1?r!==-1&&(i=r):i=t===e.length-1?-1:t,i===-1)break;p(e,n,i),n=i+1,e.charCodeAt(n-1)===13&&e.charCodeAt(n)===10&&n++}return e.slice(n)}function p(e,t,n){if(t===n){te();return}let r=e.charCodeAt(t);if(kc(e,t,r)){let r=e.charCodeAt(t+5)===32?t+6:t+5,i=e.slice(r,n);c=l===0?i:`${c}
|
|
72
72
|
${i}`,l++;return}if(Ac(e,t,r)){u=e.slice(e.charCodeAt(t+6)===32?t+7:t+6,n)||void 0;return}if(r===105&&e.charCodeAt(t+1)===100&&e.charCodeAt(t+2)===58){let r=e.slice(e.charCodeAt(t+3)===32?t+4:t+3,n);s=r.includes(`\0`)?void 0:r;return}if(r===58){i&&i(e.slice(t,n).slice(e.charCodeAt(t+1)===32?2:1));return}let a=e.slice(t,n),o=a.indexOf(`:`);if(o===-1){ee(a,``,a);return}let d=a.slice(0,o),f=a.charCodeAt(o+1)===32?2:1;ee(d,a.slice(o+f),a)}function ee(e,t,i){switch(e){case`event`:u=t||void 0;break;case`data`:c=l===0?t:`${c}
|
|
73
|
-
${t}`,l++;break;case`id`:s=t.includes(`\0`)?void 0:t;break;case`retry`:/^\d+$/.test(t)?r(parseInt(t,10)):n(new Ec(`Invalid \`retry\` value: "${t}"`,{type:`invalid-retry`,value:t,line:i}));break;default:n(new Ec(`Unknown field "${e.length>20?`${e.slice(0,20)}\u2026`:e}"`,{type:`unknown-field`,field:e,value:t,line:i}));break}}function te(){l>0&&t({id:s,event:u,data:c}),s=void 0,c=``,l=0,u=void 0}function m(e={}){if(e.consume&&a.length>0){let e=a.join(``);p(e,0,e.length)}o=!0,s=void 0,c=``,l=0,u=void 0,a.length=0}return{feed:d,reset:m}}function kc(e,t,n){return n===100&&e.charCodeAt(t+1)===97&&e.charCodeAt(t+2)===116&&e.charCodeAt(t+3)===97&&e.charCodeAt(t+4)===58}function Ac(e,t,n){return n===101&&e.charCodeAt(t+1)===118&&e.charCodeAt(t+2)===101&&e.charCodeAt(t+3)===110&&e.charCodeAt(t+4)===116&&e.charCodeAt(t+5)===58}var jc=class extends TransformStream{constructor({onError:e,onRetry:t,onComment:n}={}){let r;super({start(i){r=Oc({onEvent:e=>{i.enqueue(e)},onError(t){e===`terminate`?i.error(t):typeof e==`function`&&e(t)},onRetry:t,onComment:n})},transform(e){r.feed(e)}})}};const Mc=Symbol.for(`workflow-serialize`),Nc=Symbol.for(`workflow-deserialize`);function Pc(...e){return e.reduce((e,t)=>({...e,...t??{}}),{})}var{btoa:Fc,atob:Ic}=globalThis;function Lc(e){let t=Ic(e.replace(/-/g,`+`).replace(/_/g,`/`));return Uint8Array.from(t,e=>e.codePointAt(0))}function Rc(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCodePoint(e[n]);return Fc(t)}function zc(e){return e instanceof Uint8Array?Rc(e):e}function Bc(e){return e.type===`text`?new TextEncoder().encode(e.text):e.data instanceof Uint8Array?e.data:e.data instanceof ArrayBuffer?new Uint8Array(e.data):Lc(e.data)}function Vc(e,t={}){let{useArrayBrackets:n=!0}=t,r=new FormData;for(let[t,i]of Object.entries(e))if(i!=null){if(Array.isArray(i)){if(i.length===1){r.append(t,i[0]);continue}let e=n?`${t}[]`:t;for(let t of i)r.append(e,t);continue}r.append(t,i)}return r}function Hc({tools:e=[],providerToolNames:t}){let n={},r={};for(let i of e)if(i.type===`provider`&&i.id in t){let e=t[i.id];n[i.name]=e,r[e]=i.name}return{toProviderToolName:e=>n[e]??e,toCustomToolName:e=>r[e]??e}}async function Uc(e,t){if(e==null)return Promise.resolve();let n=t?.abortSignal;return new Promise((t,r)=>{if(n?.aborted){r(Wc());return}let i=setTimeout(()=>{a(),t()},e),a=()=>{clearTimeout(i),n?.removeEventListener(`abort`,o)},o=()=>{a(),r(Wc())};n?.addEventListener(`abort`,o)})}function Wc(){return new DOMException(`Delay was aborted`,`AbortError`)}var Gc=[{mediaType:`image/gif`,bytesPrefix:[71,73,70]},{mediaType:`image/png`,bytesPrefix:[137,80,78,71]},{mediaType:`image/jpeg`,bytesPrefix:[255,216]},{mediaType:`image/webp`,bytesPrefix:[82,73,70,70,null,null,null,null,87,69,66,80]},{mediaType:`image/bmp`,bytesPrefix:[66,77]},{mediaType:`image/tiff`,bytesPrefix:[73,73,42,0]},{mediaType:`image/tiff`,bytesPrefix:[77,77,0,42]},{mediaType:`image/avif`,bytesPrefix:[0,0,0,32,102,116,121,112,97,118,105,102]},{mediaType:`image/heic`,bytesPrefix:[0,0,0,32,102,116,121,112,104,101,105,99]}],Kc=[{mediaType:`application/pdf`,bytesPrefix:[37,80,68,70]}],qc=[{mediaType:`audio/mpeg`,bytesPrefix:[255,251]},{mediaType:`audio/mpeg`,bytesPrefix:[255,250]},{mediaType:`audio/mpeg`,bytesPrefix:[255,243]},{mediaType:`audio/mpeg`,bytesPrefix:[255,242]},{mediaType:`audio/mpeg`,bytesPrefix:[255,227]},{mediaType:`audio/mpeg`,bytesPrefix:[255,226]},{mediaType:`audio/wav`,bytesPrefix:[82,73,70,70,null,null,null,null,87,65,86,69]},{mediaType:`audio/ogg`,bytesPrefix:[79,103,103,83]},{mediaType:`audio/flac`,bytesPrefix:[102,76,97,67]},{mediaType:`audio/aac`,bytesPrefix:[64,21,0,0]},{mediaType:`audio/mp4`,bytesPrefix:[102,116,121,112]},{mediaType:`audio/webm`,bytesPrefix:[26,69,223,163]}],Jc=[{mediaType:`video/mp4`,bytesPrefix:[0,0,0,null,102,116,121,112]},{mediaType:`video/webm`,bytesPrefix:[26,69,223,163]},{mediaType:`video/quicktime`,bytesPrefix:[0,0,0,20,102,116,121,112,113,116]},{mediaType:`video/x-msvideo`,bytesPrefix:[82,73,70,70]}],Yc=e=>{let t=typeof e==`string`?Lc(e):e,n=(t[6]&127)<<21|(t[7]&127)<<14|(t[8]&127)<<7|t[9]&127;return t.slice(n+10)};function Xc(e){return typeof e==`string`&&e.startsWith(`SUQz`)||typeof e!=`string`&&e.length>10&&e[0]===73&&e[1]===68&&e[2]===51?Yc(e):e}function Zc({data:e,signatures:t}){let n=Xc(e),r=typeof n==`string`?Lc(n.substring(0,Math.min(n.length,24))):n;for(let e of t)if(r.length>=e.bytesPrefix.length&&e.bytesPrefix.every((e,t)=>e===null||r[t]===e))return e.mediaType}var Qc={image:Gc,audio:qc,video:Jc,application:Kc};function $c({data:e,topLevelType:t}){if(t===void 0)return Zc({data:e,signatures:[...Gc,...Kc,...qc,...Jc]});let n=Qc[t];if(n!==void 0)return Zc({data:e,signatures:n})}function el(e){let t=e.indexOf(`/`);return t===-1?e:e.substring(0,t)}function tl(e){let t=e.indexOf(`/`);if(t===-1)return!1;let n=e.substring(t+1);return n.length>0&&n!==`*`}async function nl(e){try{await e.body?.cancel()}catch{}}var rl=`AI_DownloadError`,il=`vercel.ai.error.${rl}`,al=Symbol.for(il),ol,sl,J=class extends (sl=e,ol=al,sl){constructor({url:e,statusCode:t,statusText:n,cause:r,message:i=r==null?`Failed to download ${e}: ${t} ${n}`:`Failed to download ${e}: ${r}`}){super({name:rl,message:i,cause:r}),this[ol]=!0,this.url=e,this.statusCode=t,this.statusText=n}static isInstance(t){return e.hasMarker(t,il)}};function cl(e=globalThis){return e.window!=null}function ll(e){let t;try{t=new URL(e)}catch{throw new J({url:e,message:`Invalid URL: ${e}`})}if(t.protocol===`data:`)return;if(t.protocol!==`http:`&&t.protocol!==`https:`)throw new J({url:e,message:`URL scheme must be http, https, or data, got ${t.protocol}`});let n=t.hostname.toLowerCase().replace(/\.+$/,``);if(!n)throw new J({url:e,message:`URL must have a hostname`});if(n===`localhost`||n.endsWith(`.local`)||n.endsWith(`.localhost`))throw new J({url:e,message:`URL with hostname ${n} is not allowed`});if(n.startsWith(`[`)&&n.endsWith(`]`)){if(pl(n.slice(1,-1)))throw new J({url:e,message:`URL with IPv6 address ${n} is not allowed`});return}if(ul(n)){if(dl(n))throw new J({url:e,message:`URL with IP address ${n} is not allowed`});return}}function ul(e){let t=e.split(`.`);return t.length===4?t.every(e=>{let t=Number(e);return Number.isInteger(t)&&t>=0&&t<=255&&String(t)===e}):!1}function dl(e){let[t,n,r]=e.split(`.`).map(Number);return t===0||t===10||t===100&&n>=64&&n<=127||t===127||t===169&&n===254||t===172&&n>=16&&n<=31||t===192&&n===0&&r===0||t===192&&n===168||t===198&&(n===18||n===19)||t>=240}function fl(e){let t=e.toLowerCase(),n=t.indexOf(`%`);n!==-1&&(t=t.slice(0,n));let r=t.split(`::`);if(r.length>2)return null;let i=e=>{if(e===``)return[];let t=[],n=e.split(`:`);for(let e=0;e<n.length;e++){let r=n[e];if(r.includes(`.`)){if(e!==n.length-1||!ul(r))return null;let[i,a,o,s]=r.split(`.`).map(Number);t.push(i<<8|a,o<<8|s);continue}if(!/^[0-9a-f]{1,4}$/.test(r))return null;t.push(parseInt(r,16))}return t},a=i(r[0]);if(a===null)return null;if(r.length===2){let e=i(r[1]);if(e===null)return null;let t=8-a.length-e.length;return t<0?null:[...a,...Array(t).fill(0),...e]}return a.length===8?a:null}function pl(e){let t=fl(e);if(t===null)return!0;let n=e=>t.slice(0,e).every(e=>e===0);return n(7)&&(t[7]===0||t[7]===1)||(t[0]&65024)==64512||(t[0]&65472)==65152||(t[0]&65472)==65216||(t[0]&65280)==65280?!0:n(6)||n(5)&&t[5]===65535||n(4)&&t[4]===65535&&t[5]===0||t[0]===100&&t[1]===65435&&t[2]===0&&t[3]===0&&t[4]===0&&t[5]===0||t[0]===100&&t[1]===65435&&t[2]===1?dl(`${t[6]>>8&255}.${t[6]&255}.${t[7]>>8&255}.${t[7]&255}`):!1}var ml=10;async function hl({url:e,headers:t,abortSignal:n,maxRedirects:r=ml}){let i={signal:n};t!==void 0&&(i.headers=t);let a=e;for(let t=0;t<=r;t++){ll(a);let t=await fetch(a,{...i,redirect:`manual`});if(t.type===`opaqueredirect`){if(!cl())throw new J({url:e,message:`Redirect from ${a} could not be validated and was blocked`});return await fetch(a,{...i,redirect:`follow`})}let n=t.headers.get(`location`);if(t.status>=300&&t.status<400&&n){await nl(t),a=new URL(n,a).toString();continue}return t}throw new J({url:e,message:`Too many redirects (max ${r})`})}var gl=2*1024*1024*1024;async function _l({response:e,url:t,maxBytes:n=gl}){let r=e.headers.get(`content-length`);if(r!=null){let i=parseInt(r,10);if(!isNaN(i)&&i>n)throw await nl(e),new J({url:t,message:`Download of ${t} exceeded maximum size of ${n} bytes (Content-Length: ${i}).`})}let i=e.body;if(i==null)return new Uint8Array;let a=i.getReader(),o=[],s=0;try{for(;;){let{done:e,value:r}=await a.read();if(e)break;if(s+=r.length,s>n)throw new J({url:t,message:`Download of ${t} exceeded maximum size of ${n} bytes.`});o.push(r)}}finally{try{await a.cancel()}finally{a.releaseLock()}}let c=new Uint8Array(s),l=0;for(let e of o)c.set(e,l),l+=e.length;return c}async function vl(e,t){try{let n=await hl({url:e,abortSignal:t?.abortSignal});if(!n.ok)throw await nl(n),new J({url:e,statusCode:n.status,statusText:n.statusText});let r=await _l({response:n,url:e,maxBytes:t?.maxBytes??gl}),i=n.headers.get(`content-type`)??void 0;return new Blob([r],i?{type:i}:void 0)}catch(t){throw J.isInstance(t)?t:new J({url:e,cause:t})}}function yl(e){return Object.fromEntries([...e.headers])}var bl=(({prefix:e,size:t=16,alphabet:n=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz`,separator:i=`-`}={})=>{let a=()=>{let e=n.length,r=Array(t);for(let i=0;i<t;i++)r[i]=n[Math.random()*e|0];return r.join(``)};if(e==null)return a;if(n.includes(i))throw new r({argument:`separator`,message:`The separator "${i}" must not be part of the alphabet "${n}".`});return()=>`${e}${i}${a()}`})();function xl(e){return(e instanceof Error||e instanceof DOMException)&&(e.name===`AbortError`||e.name===`ResponseAborted`||e.name===`TimeoutError`)}var Sl=[`fetch failed`,`failed to fetch`],Cl=[`ConnectionRefused`,`ConnectionClosed`,`FailedToOpenSocket`,`ECONNRESET`,`ECONNREFUSED`,`ETIMEDOUT`,`EPIPE`];function wl(e){if(!(e instanceof Error))return!1;let t=e.code;return!!(typeof t==`string`&&Cl.includes(t))}function Tl({error:e,url:n,requestBodyValues:r}){if(xl(e))return e;if(e instanceof TypeError&&Sl.includes(e.message.toLowerCase())){let i=e.cause;if(i!=null)return new t({message:`Cannot connect to API: ${i.message}`,cause:i,url:n,requestBodyValues:r,isRetryable:!0})}return wl(e)?new t({message:`Cannot connect to API: ${e.message}`,cause:e,url:n,requestBodyValues:r,isRetryable:!0}):e}function El(e=globalThis){return e.window?`runtime/browser`:e.navigator?.userAgent?`runtime/${e.navigator.userAgent.toLowerCase()}`:e.process?.versions?.node?`runtime/node.js/${e.process.version.substring(0)}`:e.EdgeRuntime?`runtime/vercel-edge`:`runtime/unknown`}function Dl(e){if(e==null)return{};let t={};if(e instanceof Headers)e.forEach((e,n)=>{t[n.toLowerCase()]=e});else{Array.isArray(e)||(e=Object.entries(e));for(let[n,r]of e)r!=null&&(t[n.toLowerCase()]=r)}return t}function Ol(e,...t){let n=new Headers(Dl(e)),r=n.get(`user-agent`)||``;return n.set(`user-agent`,[r,...t].filter(Boolean).join(` `)),Object.fromEntries(n.entries())}var kl=`5.0.0-beta.49`,Al=()=>globalThis.fetch,jl=async({url:e,headers:n={},successfulResponseHandler:r,failedResponseHandler:i,abortSignal:a,fetch:o=Al()})=>{try{let s=await o(e,{method:`GET`,headers:Ol(n,`ai-sdk/provider-utils/${kl}`,El()),signal:a}),c=yl(s);if(!s.ok){let n;try{n=await i({response:s,url:e,requestBodyValues:{}})}catch(n){throw xl(n)||t.isInstance(n)?n:new t({message:`Failed to process error response`,cause:n,statusCode:s.status,url:e,responseHeaders:c,requestBodyValues:{}})}throw n.value}try{return await r({response:s,url:e,requestBodyValues:{}})}catch(n){throw n instanceof Error&&(xl(n)||t.isInstance(n))?n:new t({message:`Failed to process successful response`,cause:n,statusCode:s.status,url:e,responseHeaders:c,requestBodyValues:{}})}}catch(t){throw Tl({error:t,url:e,requestBodyValues:{}})}};function Ml(e,t){try{return new URL(e).origin===new URL(t).origin}catch{return!1}}function Nl(e){return e!=null}function Pl({apiKey:e,environmentVariableName:t,apiKeyParameterName:n=`apiKey`,description:r}){if(typeof e==`string`)return e;if(e!=null)throw new o({message:`${r} API key must be a string.`});if(typeof process>`u`)throw new o({message:`${r} API key is missing. Pass it using the '${n}' parameter. Environment variables are not supported in this environment.`});if(e=process.env[t],e==null)throw new o({message:`${r} API key is missing. Pass it using the '${n}' parameter or the ${t} environment variable.`});if(typeof e!=`string`)throw new o({message:`${r} API key must be a string. The value of the ${t} environment variable is not a string.`});return e}function Fl({settingValue:e,environmentVariableName:t}){if(typeof e==`string`||!(e!=null||typeof process>`u`)&&(e=process.env[t],!(e==null||typeof e!=`string`)))return e}function Il(e){return e!==void 0&&e!==`provider-default`}function Ll({reasoning:e,effortMap:t,warnings:n}){let r=t[e];if(r==null){n.push({type:`unsupported`,feature:`reasoning`,details:`reasoning "${e}" is not supported by this model.`});return}return r!==e&&n.push({type:`compatibility`,feature:`reasoning`,details:`reasoning "${e}" is not directly supported by this model. mapped to effort "${r}".`}),r}var Rl={minimal:.02,low:.1,medium:.3,high:.6,xhigh:.9};function zl({reasoning:e,maxOutputTokens:t,maxReasoningBudget:n,minReasoningBudget:r=1024,budgetPercentages:i=Rl,warnings:a}){let o=i[e];if(o==null){a.push({type:`unsupported`,feature:`reasoning`,details:`reasoning "${e}" is not supported by this model.`});return}return Math.min(n,Math.max(r,Math.round(t*o)))}function Bl(e){let[t,n=``]=e.toLowerCase().split(`/`);return{mpeg:`mp3`,"x-wav":`wav`,opus:`ogg`,mp4:`m4a`,"x-m4a":`m4a`}[n]??n}var Vl=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,Hl=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function Ul(e){let t=JSON.parse(e);return typeof t!=`object`||!t||Vl.test(e)===!1&&Hl.test(e)===!1?t:Wl(t)}function Wl(e){let t=[e];for(;t.length;){let e=t;t=[];for(let n of e){if(Object.prototype.hasOwnProperty.call(n,`__proto__`)||Object.prototype.hasOwnProperty.call(n,`constructor`)&&n.constructor!==null&&typeof n.constructor==`object`&&Object.prototype.hasOwnProperty.call(n.constructor,`prototype`))throw SyntaxError(`Object contains forbidden prototype property`);for(let e in n){let r=n[e];r&&typeof r==`object`&&t.push(r)}}}return e}function Gl(e){let{stackTraceLimit:t}=Error;try{Error.stackTraceLimit=0}catch{return Ul(e)}try{return Ul(e)}finally{Error.stackTraceLimit=t}}function Kl(e){if(e.type===`object`||Array.isArray(e.type)&&e.type.includes(`object`)){e.additionalProperties=!1;let{properties:t}=e;if(t!=null)for(let e of Object.keys(t))t[e]=ql(t[e])}e.items!=null&&(e.items=Array.isArray(e.items)?e.items.map(ql):ql(e.items)),e.anyOf!=null&&(e.anyOf=e.anyOf.map(ql)),e.allOf!=null&&(e.allOf=e.allOf.map(ql)),e.oneOf!=null&&(e.oneOf=e.oneOf.map(ql));let{definitions:t}=e;if(t!=null)for(let e of Object.keys(t))t[e]=ql(t[e]);return e}function ql(e){return typeof e==`boolean`?e:Kl(e)}var Jl=Symbol(`Let zodToJsonSchema decide on which parser to use`),Yl={name:void 0,$refStrategy:`root`,basePath:[`#`],effectStrategy:`input`,pipeStrategy:`all`,dateStrategy:`format:date-time`,mapStrategy:`entries`,removeAdditionalStrategy:`passthrough`,allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:`definitions`,strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:`escape`,applyRegexFlags:!1,emailStrategy:`format:email`,base64Strategy:`contentEncoding:base64`,nameStrategy:`ref`},Xl=e=>typeof e==`string`?{...Yl,name:e}:{...Yl,...e};function Y(){return{}}function Zl(e,t){let n={type:`array`};return e.type?._def&&e.type?._def?.typeName!==q.ZodAny&&(n.items=$(e.type._def,{...t,currentPath:[...t.currentPath,`items`]})),e.minLength&&(n.minItems=e.minLength.value),e.maxLength&&(n.maxItems=e.maxLength.value),e.exactLength&&(n.minItems=e.exactLength.value,n.maxItems=e.exactLength.value),n}function Ql(e){let t={type:`integer`,format:`int64`};if(!e.checks)return t;for(let n of e.checks)switch(n.kind){case`min`:n.inclusive?t.minimum=n.value:t.exclusiveMinimum=n.value;break;case`max`:n.inclusive?t.maximum=n.value:t.exclusiveMaximum=n.value;break;case`multipleOf`:t.multipleOf=n.value;break}return t}function $l(){return{type:`boolean`}}function eu(e,t){return $(e.type._def,t)}var tu=(e,t)=>$(e.innerType._def,t);function nu(e,t,n){let r=n??t.dateStrategy;if(Array.isArray(r))return{anyOf:r.map(n=>nu(e,t,n))};switch(r){case`string`:case`format:date-time`:return{type:`string`,format:`date-time`};case`format:date`:return{type:`string`,format:`date`};case`integer`:return ru(e)}}var ru=e=>{let t={type:`integer`,format:`unix-time`};for(let n of e.checks)switch(n.kind){case`min`:t.minimum=n.value;break;case`max`:t.maximum=n.value;break}return t};function iu(e,t){return{...$(e.innerType._def,t),default:e.defaultValue()}}function au(e,t){return t.effectStrategy===`input`?$(e.schema._def,t):Y()}function ou(e){return{type:`string`,enum:Array.from(e.values)}}var su=e=>`type`in e&&e.type===`string`?!1:`allOf`in e;function cu(e,t){let n=[$(e.left._def,{...t,currentPath:[...t.currentPath,`allOf`,`0`]}),$(e.right._def,{...t,currentPath:[...t.currentPath,`allOf`,`1`]})].filter(e=>!!e),r=[];return n.forEach(e=>{if(su(e))r.push(...e.allOf);else{let t=e;if(`additionalProperties`in e&&e.additionalProperties===!1){let{additionalProperties:n,...r}=e;t=r}r.push(t)}}),r.length?{allOf:r}:void 0}function lu(e){let t=typeof e.value;return t!==`bigint`&&t!==`number`&&t!==`boolean`&&t!==`string`?{type:Array.isArray(e.value)?`array`:`object`}:{type:t===`bigint`?`integer`:t,const:e.value}}var uu=void 0,X={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(uu===void 0&&(uu=RegExp(`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,`u`)),uu),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function du(e,t){let n={type:`string`};if(e.checks)for(let r of e.checks)switch(r.kind){case`min`:n.minLength=typeof n.minLength==`number`?Math.max(n.minLength,r.value):r.value;break;case`max`:n.maxLength=typeof n.maxLength==`number`?Math.min(n.maxLength,r.value):r.value;break;case`email`:switch(t.emailStrategy){case`format:email`:Z(n,`email`,r.message,t);break;case`format:idn-email`:Z(n,`idn-email`,r.message,t);break;case`pattern:zod`:Q(n,X.email,r.message,t);break}break;case`url`:Z(n,`uri`,r.message,t);break;case`uuid`:Z(n,`uuid`,r.message,t);break;case`regex`:Q(n,r.regex,r.message,t);break;case`cuid`:Q(n,X.cuid,r.message,t);break;case`cuid2`:Q(n,X.cuid2,r.message,t);break;case`startsWith`:Q(n,RegExp(`^${fu(r.value,t)}`),r.message,t);break;case`endsWith`:Q(n,RegExp(`${fu(r.value,t)}$`),r.message,t);break;case`datetime`:Z(n,`date-time`,r.message,t);break;case`date`:Z(n,`date`,r.message,t);break;case`time`:Z(n,`time`,r.message,t);break;case`duration`:Z(n,`duration`,r.message,t);break;case`length`:n.minLength=typeof n.minLength==`number`?Math.max(n.minLength,r.value):r.value,n.maxLength=typeof n.maxLength==`number`?Math.min(n.maxLength,r.value):r.value;break;case`includes`:Q(n,RegExp(fu(r.value,t)),r.message,t);break;case`ip`:r.version!==`v6`&&Z(n,`ipv4`,r.message,t),r.version!==`v4`&&Z(n,`ipv6`,r.message,t);break;case`base64url`:Q(n,X.base64url,r.message,t);break;case`jwt`:Q(n,X.jwt,r.message,t);break;case`cidr`:r.version!==`v6`&&Q(n,X.ipv4Cidr,r.message,t),r.version!==`v4`&&Q(n,X.ipv6Cidr,r.message,t);break;case`emoji`:Q(n,X.emoji(),r.message,t);break;case`ulid`:Q(n,X.ulid,r.message,t);break;case`base64`:switch(t.base64Strategy){case`format:binary`:Z(n,`binary`,r.message,t);break;case`contentEncoding:base64`:n.contentEncoding=`base64`;break;case`pattern:zod`:Q(n,X.base64,r.message,t);break}break;case`nanoid`:Q(n,X.nanoid,r.message,t);case`toLowerCase`:case`toUpperCase`:case`trim`:break;default:}return n}function fu(e,t){return t.patternStrategy===`escape`?mu(e):e}var pu=new Set(`ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789`);function mu(e){let t=``;for(let n=0;n<e.length;n++)pu.has(e[n])||(t+=`\\`),t+=e[n];return t}function Z(e,t,n,r){e.format||e.anyOf?.some(e=>e.format)?(e.anyOf||=[],e.format&&(e.anyOf.push({format:e.format}),delete e.format),e.anyOf.push({format:t,...n&&r.errorMessages&&{errorMessage:{format:n}}})):e.format=t}function Q(e,t,n,r){e.pattern||e.allOf?.some(e=>e.pattern)?(e.allOf||=[],e.pattern&&(e.allOf.push({pattern:e.pattern}),delete e.pattern),e.allOf.push({pattern:hu(t,r),...n&&r.errorMessages&&{errorMessage:{pattern:n}}})):e.pattern=hu(t,r)}function hu(e,t){if(!t.applyRegexFlags||!e.flags)return e.source;let n={i:e.flags.includes(`i`),m:e.flags.includes(`m`),s:e.flags.includes(`s`)},r=n.i?e.source.toLowerCase():e.source,i=``,a=!1,o=!1,s=!1;for(let e=0;e<r.length;e++){if(a){i+=r[e],a=!1;continue}if(n.i){if(o){if(r[e].match(/[a-z]/)){s?(i+=r[e],i+=`${r[e-2]}-${r[e]}`.toUpperCase(),s=!1):r[e+1]===`-`&&r[e+2]?.match(/[a-z]/)?(i+=r[e],s=!0):i+=`${r[e]}${r[e].toUpperCase()}`;continue}}else if(r[e].match(/[a-z]/)){i+=`[${r[e]}${r[e].toUpperCase()}]`;continue}}if(n.m){if(r[e]===`^`){i+=`(^|(?<=[\r
|
|
73
|
+
${t}`,l++;break;case`id`:s=t.includes(`\0`)?void 0:t;break;case`retry`:/^\d+$/.test(t)?r(parseInt(t,10)):n(new Ec(`Invalid \`retry\` value: "${t}"`,{type:`invalid-retry`,value:t,line:i}));break;default:n(new Ec(`Unknown field "${e.length>20?`${e.slice(0,20)}\u2026`:e}"`,{type:`unknown-field`,field:e,value:t,line:i}));break}}function te(){l>0&&t({id:s,event:u,data:c}),s=void 0,c=``,l=0,u=void 0}function m(e={}){if(e.consume&&a.length>0){let e=a.join(``);p(e,0,e.length)}o=!0,s=void 0,c=``,l=0,u=void 0,a.length=0}return{feed:d,reset:m}}function kc(e,t,n){return n===100&&e.charCodeAt(t+1)===97&&e.charCodeAt(t+2)===116&&e.charCodeAt(t+3)===97&&e.charCodeAt(t+4)===58}function Ac(e,t,n){return n===101&&e.charCodeAt(t+1)===118&&e.charCodeAt(t+2)===101&&e.charCodeAt(t+3)===110&&e.charCodeAt(t+4)===116&&e.charCodeAt(t+5)===58}var jc=class extends TransformStream{constructor({onError:e,onRetry:t,onComment:n}={}){let r;super({start(i){r=Oc({onEvent:e=>{i.enqueue(e)},onError(t){e===`terminate`?i.error(t):typeof e==`function`&&e(t)},onRetry:t,onComment:n})},transform(e){r.feed(e)}})}};const Mc=Symbol.for(`workflow-serialize`),Nc=Symbol.for(`workflow-deserialize`);function Pc(...e){return e.reduce((e,t)=>({...e,...t??{}}),{})}var{btoa:Fc,atob:Ic}=globalThis;function Lc(e){let t=Ic(e.replace(/-/g,`+`).replace(/_/g,`/`));return Uint8Array.from(t,e=>e.codePointAt(0))}function Rc(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCodePoint(e[n]);return Fc(t)}function zc(e){return e instanceof Uint8Array?Rc(e):e}function Bc(e){return e.type===`text`?new TextEncoder().encode(e.text):e.data instanceof Uint8Array?e.data:e.data instanceof ArrayBuffer?new Uint8Array(e.data):Lc(e.data)}function Vc(e,t={}){let{useArrayBrackets:n=!0}=t,r=new FormData;for(let[t,i]of Object.entries(e))if(i!=null){if(Array.isArray(i)){if(i.length===1){r.append(t,i[0]);continue}let e=n?`${t}[]`:t;for(let t of i)r.append(e,t);continue}r.append(t,i)}return r}function Hc({tools:e=[],providerToolNames:t}){let n={},r={};for(let i of e)if(i.type===`provider`&&i.id in t){let e=t[i.id];n[i.name]=e,r[e]=i.name}return{toProviderToolName:e=>n[e]??e,toCustomToolName:e=>r[e]??e}}async function Uc(e,t){if(e==null)return Promise.resolve();let n=t?.abortSignal;return new Promise((t,r)=>{if(n?.aborted){r(Wc());return}let i=setTimeout(()=>{a(),t()},e),a=()=>{clearTimeout(i),n?.removeEventListener(`abort`,o)},o=()=>{a(),r(Wc())};n?.addEventListener(`abort`,o)})}function Wc(){return new DOMException(`Delay was aborted`,`AbortError`)}var Gc=[{mediaType:`image/gif`,bytesPrefix:[71,73,70]},{mediaType:`image/png`,bytesPrefix:[137,80,78,71]},{mediaType:`image/jpeg`,bytesPrefix:[255,216]},{mediaType:`image/webp`,bytesPrefix:[82,73,70,70,null,null,null,null,87,69,66,80]},{mediaType:`image/bmp`,bytesPrefix:[66,77]},{mediaType:`image/tiff`,bytesPrefix:[73,73,42,0]},{mediaType:`image/tiff`,bytesPrefix:[77,77,0,42]},{mediaType:`image/avif`,bytesPrefix:[0,0,0,32,102,116,121,112,97,118,105,102]},{mediaType:`image/heic`,bytesPrefix:[0,0,0,32,102,116,121,112,104,101,105,99]}],Kc=[{mediaType:`application/pdf`,bytesPrefix:[37,80,68,70]}],qc=[{mediaType:`audio/mpeg`,bytesPrefix:[255,251]},{mediaType:`audio/mpeg`,bytesPrefix:[255,250]},{mediaType:`audio/mpeg`,bytesPrefix:[255,243]},{mediaType:`audio/mpeg`,bytesPrefix:[255,242]},{mediaType:`audio/mpeg`,bytesPrefix:[255,227]},{mediaType:`audio/mpeg`,bytesPrefix:[255,226]},{mediaType:`audio/wav`,bytesPrefix:[82,73,70,70,null,null,null,null,87,65,86,69]},{mediaType:`audio/ogg`,bytesPrefix:[79,103,103,83]},{mediaType:`audio/flac`,bytesPrefix:[102,76,97,67]},{mediaType:`audio/aac`,bytesPrefix:[64,21,0,0]},{mediaType:`audio/mp4`,bytesPrefix:[102,116,121,112]},{mediaType:`audio/webm`,bytesPrefix:[26,69,223,163]}],Jc=[{mediaType:`video/mp4`,bytesPrefix:[0,0,0,null,102,116,121,112]},{mediaType:`video/webm`,bytesPrefix:[26,69,223,163]},{mediaType:`video/quicktime`,bytesPrefix:[0,0,0,20,102,116,121,112,113,116]},{mediaType:`video/x-msvideo`,bytesPrefix:[82,73,70,70]}],Yc=e=>{let t=typeof e==`string`?Lc(e):e,n=(t[6]&127)<<21|(t[7]&127)<<14|(t[8]&127)<<7|t[9]&127;return t.slice(n+10)};function Xc(e){return typeof e==`string`&&e.startsWith(`SUQz`)||typeof e!=`string`&&e.length>10&&e[0]===73&&e[1]===68&&e[2]===51?Yc(e):e}function Zc({data:e,signatures:t}){let n=Xc(e),r=typeof n==`string`?Lc(n.substring(0,Math.min(n.length,24))):n;for(let e of t)if(r.length>=e.bytesPrefix.length&&e.bytesPrefix.every((e,t)=>e===null||r[t]===e))return e.mediaType}var Qc={image:Gc,audio:qc,video:Jc,application:Kc};function $c({data:e,topLevelType:t}){if(t===void 0)return Zc({data:e,signatures:[...Gc,...Kc,...qc,...Jc]});let n=Qc[t];if(n!==void 0)return Zc({data:e,signatures:n})}function el(e){let t=e.indexOf(`/`);return t===-1?e:e.substring(0,t)}function tl(e){let t=e.indexOf(`/`);if(t===-1)return!1;let n=e.substring(t+1);return n.length>0&&n!==`*`}async function nl(e){try{await e.body?.cancel()}catch{}}var rl=`AI_DownloadError`,il=`vercel.ai.error.${rl}`,al=Symbol.for(il),ol,sl,J=class extends (sl=e,ol=al,sl){constructor({url:e,statusCode:t,statusText:n,cause:r,message:i=r==null?`Failed to download ${e}: ${t} ${n}`:`Failed to download ${e}: ${r}`}){super({name:rl,message:i,cause:r}),this[ol]=!0,this.url=e,this.statusCode=t,this.statusText=n}static isInstance(t){return e.hasMarker(t,il)}};function cl(e=globalThis){return e.window!=null}function ll(e){let t;try{t=new URL(e)}catch{throw new J({url:e,message:`Invalid URL: ${e}`})}if(t.protocol===`data:`)return;if(t.protocol!==`http:`&&t.protocol!==`https:`)throw new J({url:e,message:`URL scheme must be http, https, or data, got ${t.protocol}`});let n=t.hostname.toLowerCase().replace(/\.+$/,``);if(!n)throw new J({url:e,message:`URL must have a hostname`});if(n===`localhost`||n.endsWith(`.local`)||n.endsWith(`.localhost`))throw new J({url:e,message:`URL with hostname ${n} is not allowed`});if(n.startsWith(`[`)&&n.endsWith(`]`)){if(pl(n.slice(1,-1)))throw new J({url:e,message:`URL with IPv6 address ${n} is not allowed`});return}if(ul(n)){if(dl(n))throw new J({url:e,message:`URL with IP address ${n} is not allowed`});return}}function ul(e){let t=e.split(`.`);return t.length===4?t.every(e=>{let t=Number(e);return Number.isInteger(t)&&t>=0&&t<=255&&String(t)===e}):!1}function dl(e){let[t,n,r]=e.split(`.`).map(Number);return t===0||t===10||t===100&&n>=64&&n<=127||t===127||t===169&&n===254||t===172&&n>=16&&n<=31||t===192&&n===0&&r===0||t===192&&n===168||t===198&&(n===18||n===19)||t>=240}function fl(e){let t=e.toLowerCase(),n=t.indexOf(`%`);n!==-1&&(t=t.slice(0,n));let r=t.split(`::`);if(r.length>2)return null;let i=e=>{if(e===``)return[];let t=[],n=e.split(`:`);for(let e=0;e<n.length;e++){let r=n[e];if(r.includes(`.`)){if(e!==n.length-1||!ul(r))return null;let[i,a,o,s]=r.split(`.`).map(Number);t.push(i<<8|a,o<<8|s);continue}if(!/^[0-9a-f]{1,4}$/.test(r))return null;t.push(parseInt(r,16))}return t},a=i(r[0]);if(a===null)return null;if(r.length===2){let e=i(r[1]);if(e===null)return null;let t=8-a.length-e.length;return t<0?null:[...a,...Array(t).fill(0),...e]}return a.length===8?a:null}function pl(e){let t=fl(e);if(t===null)return!0;let n=e=>t.slice(0,e).every(e=>e===0);return n(7)&&(t[7]===0||t[7]===1)||(t[0]&65024)==64512||(t[0]&65472)==65152||(t[0]&65472)==65216||(t[0]&65280)==65280?!0:n(6)||n(5)&&t[5]===65535||n(4)&&t[4]===65535&&t[5]===0||t[0]===100&&t[1]===65435&&t[2]===0&&t[3]===0&&t[4]===0&&t[5]===0||t[0]===100&&t[1]===65435&&t[2]===1?dl(`${t[6]>>8&255}.${t[6]&255}.${t[7]>>8&255}.${t[7]&255}`):!1}var ml=10;async function hl({url:e,headers:t,abortSignal:n,maxRedirects:r=ml}){let i={signal:n};t!==void 0&&(i.headers=t);let a=e;for(let t=0;t<=r;t++){ll(a);let t=await fetch(a,{...i,redirect:`manual`});if(t.type===`opaqueredirect`){if(!cl())throw new J({url:e,message:`Redirect from ${a} could not be validated and was blocked`});return await fetch(a,{...i,redirect:`follow`})}let n=t.headers.get(`location`);if(t.status>=300&&t.status<400&&n){await nl(t),a=new URL(n,a).toString();continue}return t}throw new J({url:e,message:`Too many redirects (max ${r})`})}var gl=2*1024*1024*1024;async function _l({response:e,url:t,maxBytes:n=gl}){let r=e.headers.get(`content-length`);if(r!=null){let i=parseInt(r,10);if(!isNaN(i)&&i>n)throw await nl(e),new J({url:t,message:`Download of ${t} exceeded maximum size of ${n} bytes (Content-Length: ${i}).`})}let i=e.body;if(i==null)return new Uint8Array;let a=i.getReader(),o=[],s=0;try{for(;;){let{done:e,value:r}=await a.read();if(e)break;if(s+=r.length,s>n)throw new J({url:t,message:`Download of ${t} exceeded maximum size of ${n} bytes.`});o.push(r)}}finally{try{await a.cancel()}finally{a.releaseLock()}}let c=new Uint8Array(s),l=0;for(let e of o)c.set(e,l),l+=e.length;return c}async function vl(e,t){try{let n=await hl({url:e,abortSignal:t?.abortSignal});if(!n.ok)throw await nl(n),new J({url:e,statusCode:n.status,statusText:n.statusText});let r=await _l({response:n,url:e,maxBytes:t?.maxBytes??gl}),i=n.headers.get(`content-type`)??void 0;return new Blob([r],i?{type:i}:void 0)}catch(t){throw J.isInstance(t)?t:new J({url:e,cause:t})}}function yl(e){return Object.fromEntries([...e.headers])}var bl=(({prefix:e,size:t=16,alphabet:n=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz`,separator:i=`-`}={})=>{let a=()=>{let e=n.length,r=Array(t);for(let i=0;i<t;i++)r[i]=n[Math.random()*e|0];return r.join(``)};if(e==null)return a;if(n.includes(i))throw new r({argument:`separator`,message:`The separator "${i}" must not be part of the alphabet "${n}".`});return()=>`${e}${i}${a()}`})();function xl(e){return(e instanceof Error||e instanceof DOMException)&&(e.name===`AbortError`||e.name===`ResponseAborted`||e.name===`TimeoutError`)}var Sl=[`fetch failed`,`failed to fetch`],Cl=[`ConnectionRefused`,`ConnectionClosed`,`FailedToOpenSocket`,`ECONNRESET`,`ECONNREFUSED`,`ETIMEDOUT`,`EPIPE`];function wl(e){if(!(e instanceof Error))return!1;let t=e.code;return!!(typeof t==`string`&&Cl.includes(t))}function Tl({error:e,url:n,requestBodyValues:r}){if(xl(e))return e;if(e instanceof TypeError&&Sl.includes(e.message.toLowerCase())){let i=e.cause;if(i!=null)return new t({message:`Cannot connect to API: ${i.message}`,cause:i,url:n,requestBodyValues:r,isRetryable:!0})}return wl(e)?new t({message:`Cannot connect to API: ${e.message}`,cause:e,url:n,requestBodyValues:r,isRetryable:!0}):e}function El(e=globalThis){return e.window?`runtime/browser`:e.navigator?.userAgent?`runtime/${e.navigator.userAgent.toLowerCase()}`:e.process?.versions?.node?`runtime/node.js/${e.process.version.substring(0)}`:e.EdgeRuntime?`runtime/vercel-edge`:`runtime/unknown`}function Dl(e){if(e==null)return{};let t={};if(e instanceof Headers)e.forEach((e,n)=>{t[n.toLowerCase()]=e});else{Array.isArray(e)||(e=Object.entries(e));for(let[n,r]of e)r!=null&&(t[n.toLowerCase()]=r)}return t}function Ol(e,...t){let n=new Headers(Dl(e)),r=n.get(`user-agent`)||``;return n.set(`user-agent`,[r,...t].filter(Boolean).join(` `)),Object.fromEntries(n.entries())}var kl=`5.0.0`,Al=()=>globalThis.fetch,jl=async({url:e,headers:n={},successfulResponseHandler:r,failedResponseHandler:i,abortSignal:a,fetch:o=Al()})=>{try{let s=await o(e,{method:`GET`,headers:Ol(n,`ai-sdk/provider-utils/${kl}`,El()),signal:a}),c=yl(s);if(!s.ok){let n;try{n=await i({response:s,url:e,requestBodyValues:{}})}catch(n){throw xl(n)||t.isInstance(n)?n:new t({message:`Failed to process error response`,cause:n,statusCode:s.status,url:e,responseHeaders:c,requestBodyValues:{}})}throw n.value}try{return await r({response:s,url:e,requestBodyValues:{}})}catch(n){throw n instanceof Error&&(xl(n)||t.isInstance(n))?n:new t({message:`Failed to process successful response`,cause:n,statusCode:s.status,url:e,responseHeaders:c,requestBodyValues:{}})}}catch(t){throw Tl({error:t,url:e,requestBodyValues:{}})}};function Ml(e,t){try{return new URL(e).origin===new URL(t).origin}catch{return!1}}function Nl(e){return e!=null}function Pl({apiKey:e,environmentVariableName:t,apiKeyParameterName:n=`apiKey`,description:r}){if(typeof e==`string`)return e;if(e!=null)throw new o({message:`${r} API key must be a string.`});if(typeof process>`u`)throw new o({message:`${r} API key is missing. Pass it using the '${n}' parameter. Environment variables are not supported in this environment.`});if(e=process.env[t],e==null)throw new o({message:`${r} API key is missing. Pass it using the '${n}' parameter or the ${t} environment variable.`});if(typeof e!=`string`)throw new o({message:`${r} API key must be a string. The value of the ${t} environment variable is not a string.`});return e}function Fl({settingValue:e,environmentVariableName:t}){if(typeof e==`string`||!(e!=null||typeof process>`u`)&&(e=process.env[t],!(e==null||typeof e!=`string`)))return e}function Il(e){return e!==void 0&&e!==`provider-default`}function Ll({reasoning:e,effortMap:t,warnings:n}){let r=t[e];if(r==null){n.push({type:`unsupported`,feature:`reasoning`,details:`reasoning "${e}" is not supported by this model.`});return}return r!==e&&n.push({type:`compatibility`,feature:`reasoning`,details:`reasoning "${e}" is not directly supported by this model. mapped to effort "${r}".`}),r}var Rl={minimal:.02,low:.1,medium:.3,high:.6,xhigh:.9};function zl({reasoning:e,maxOutputTokens:t,maxReasoningBudget:n,minReasoningBudget:r=1024,budgetPercentages:i=Rl,warnings:a}){let o=i[e];if(o==null){a.push({type:`unsupported`,feature:`reasoning`,details:`reasoning "${e}" is not supported by this model.`});return}return Math.min(n,Math.max(r,Math.round(t*o)))}function Bl(e){let[t,n=``]=e.toLowerCase().split(`/`);return{mpeg:`mp3`,"x-wav":`wav`,opus:`ogg`,mp4:`m4a`,"x-m4a":`m4a`}[n]??n}var Vl=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,Hl=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function Ul(e){let t=JSON.parse(e);return typeof t!=`object`||!t||Vl.test(e)===!1&&Hl.test(e)===!1?t:Wl(t)}function Wl(e){let t=[e];for(;t.length;){let e=t;t=[];for(let n of e){if(Object.prototype.hasOwnProperty.call(n,`__proto__`)||Object.prototype.hasOwnProperty.call(n,`constructor`)&&n.constructor!==null&&typeof n.constructor==`object`&&Object.prototype.hasOwnProperty.call(n.constructor,`prototype`))throw SyntaxError(`Object contains forbidden prototype property`);for(let e in n){let r=n[e];r&&typeof r==`object`&&t.push(r)}}}return e}function Gl(e){let{stackTraceLimit:t}=Error;try{Error.stackTraceLimit=0}catch{return Ul(e)}try{return Ul(e)}finally{Error.stackTraceLimit=t}}function Kl(e){if(e.type===`object`||Array.isArray(e.type)&&e.type.includes(`object`)){e.additionalProperties=!1;let{properties:t}=e;if(t!=null)for(let e of Object.keys(t))t[e]=ql(t[e])}e.items!=null&&(e.items=Array.isArray(e.items)?e.items.map(ql):ql(e.items)),e.anyOf!=null&&(e.anyOf=e.anyOf.map(ql)),e.allOf!=null&&(e.allOf=e.allOf.map(ql)),e.oneOf!=null&&(e.oneOf=e.oneOf.map(ql));let{definitions:t}=e;if(t!=null)for(let e of Object.keys(t))t[e]=ql(t[e]);return e}function ql(e){return typeof e==`boolean`?e:Kl(e)}var Jl=Symbol(`Let zodToJsonSchema decide on which parser to use`),Yl={name:void 0,$refStrategy:`root`,basePath:[`#`],effectStrategy:`input`,pipeStrategy:`all`,dateStrategy:`format:date-time`,mapStrategy:`entries`,removeAdditionalStrategy:`passthrough`,allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:`definitions`,strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:`escape`,applyRegexFlags:!1,emailStrategy:`format:email`,base64Strategy:`contentEncoding:base64`,nameStrategy:`ref`},Xl=e=>typeof e==`string`?{...Yl,name:e}:{...Yl,...e};function Y(){return{}}function Zl(e,t){let n={type:`array`};return e.type?._def&&e.type?._def?.typeName!==q.ZodAny&&(n.items=$(e.type._def,{...t,currentPath:[...t.currentPath,`items`]})),e.minLength&&(n.minItems=e.minLength.value),e.maxLength&&(n.maxItems=e.maxLength.value),e.exactLength&&(n.minItems=e.exactLength.value,n.maxItems=e.exactLength.value),n}function Ql(e){let t={type:`integer`,format:`int64`};if(!e.checks)return t;for(let n of e.checks)switch(n.kind){case`min`:n.inclusive?t.minimum=n.value:t.exclusiveMinimum=n.value;break;case`max`:n.inclusive?t.maximum=n.value:t.exclusiveMaximum=n.value;break;case`multipleOf`:t.multipleOf=n.value;break}return t}function $l(){return{type:`boolean`}}function eu(e,t){return $(e.type._def,t)}var tu=(e,t)=>$(e.innerType._def,t);function nu(e,t,n){let r=n??t.dateStrategy;if(Array.isArray(r))return{anyOf:r.map(n=>nu(e,t,n))};switch(r){case`string`:case`format:date-time`:return{type:`string`,format:`date-time`};case`format:date`:return{type:`string`,format:`date`};case`integer`:return ru(e)}}var ru=e=>{let t={type:`integer`,format:`unix-time`};for(let n of e.checks)switch(n.kind){case`min`:t.minimum=n.value;break;case`max`:t.maximum=n.value;break}return t};function iu(e,t){return{...$(e.innerType._def,t),default:e.defaultValue()}}function au(e,t){return t.effectStrategy===`input`?$(e.schema._def,t):Y()}function ou(e){return{type:`string`,enum:Array.from(e.values)}}var su=e=>`type`in e&&e.type===`string`?!1:`allOf`in e;function cu(e,t){let n=[$(e.left._def,{...t,currentPath:[...t.currentPath,`allOf`,`0`]}),$(e.right._def,{...t,currentPath:[...t.currentPath,`allOf`,`1`]})].filter(e=>!!e),r=[];return n.forEach(e=>{if(su(e))r.push(...e.allOf);else{let t=e;if(`additionalProperties`in e&&e.additionalProperties===!1){let{additionalProperties:n,...r}=e;t=r}r.push(t)}}),r.length?{allOf:r}:void 0}function lu(e){let t=typeof e.value;return t!==`bigint`&&t!==`number`&&t!==`boolean`&&t!==`string`?{type:Array.isArray(e.value)?`array`:`object`}:{type:t===`bigint`?`integer`:t,const:e.value}}var uu=void 0,X={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(uu===void 0&&(uu=RegExp(`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,`u`)),uu),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function du(e,t){let n={type:`string`};if(e.checks)for(let r of e.checks)switch(r.kind){case`min`:n.minLength=typeof n.minLength==`number`?Math.max(n.minLength,r.value):r.value;break;case`max`:n.maxLength=typeof n.maxLength==`number`?Math.min(n.maxLength,r.value):r.value;break;case`email`:switch(t.emailStrategy){case`format:email`:Z(n,`email`,r.message,t);break;case`format:idn-email`:Z(n,`idn-email`,r.message,t);break;case`pattern:zod`:Q(n,X.email,r.message,t);break}break;case`url`:Z(n,`uri`,r.message,t);break;case`uuid`:Z(n,`uuid`,r.message,t);break;case`regex`:Q(n,r.regex,r.message,t);break;case`cuid`:Q(n,X.cuid,r.message,t);break;case`cuid2`:Q(n,X.cuid2,r.message,t);break;case`startsWith`:Q(n,RegExp(`^${fu(r.value,t)}`),r.message,t);break;case`endsWith`:Q(n,RegExp(`${fu(r.value,t)}$`),r.message,t);break;case`datetime`:Z(n,`date-time`,r.message,t);break;case`date`:Z(n,`date`,r.message,t);break;case`time`:Z(n,`time`,r.message,t);break;case`duration`:Z(n,`duration`,r.message,t);break;case`length`:n.minLength=typeof n.minLength==`number`?Math.max(n.minLength,r.value):r.value,n.maxLength=typeof n.maxLength==`number`?Math.min(n.maxLength,r.value):r.value;break;case`includes`:Q(n,RegExp(fu(r.value,t)),r.message,t);break;case`ip`:r.version!==`v6`&&Z(n,`ipv4`,r.message,t),r.version!==`v4`&&Z(n,`ipv6`,r.message,t);break;case`base64url`:Q(n,X.base64url,r.message,t);break;case`jwt`:Q(n,X.jwt,r.message,t);break;case`cidr`:r.version!==`v6`&&Q(n,X.ipv4Cidr,r.message,t),r.version!==`v4`&&Q(n,X.ipv6Cidr,r.message,t);break;case`emoji`:Q(n,X.emoji(),r.message,t);break;case`ulid`:Q(n,X.ulid,r.message,t);break;case`base64`:switch(t.base64Strategy){case`format:binary`:Z(n,`binary`,r.message,t);break;case`contentEncoding:base64`:n.contentEncoding=`base64`;break;case`pattern:zod`:Q(n,X.base64,r.message,t);break}break;case`nanoid`:Q(n,X.nanoid,r.message,t);case`toLowerCase`:case`toUpperCase`:case`trim`:break;default:}return n}function fu(e,t){return t.patternStrategy===`escape`?mu(e):e}var pu=new Set(`ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789`);function mu(e){let t=``;for(let n=0;n<e.length;n++)pu.has(e[n])||(t+=`\\`),t+=e[n];return t}function Z(e,t,n,r){e.format||e.anyOf?.some(e=>e.format)?(e.anyOf||=[],e.format&&(e.anyOf.push({format:e.format}),delete e.format),e.anyOf.push({format:t,...n&&r.errorMessages&&{errorMessage:{format:n}}})):e.format=t}function Q(e,t,n,r){e.pattern||e.allOf?.some(e=>e.pattern)?(e.allOf||=[],e.pattern&&(e.allOf.push({pattern:e.pattern}),delete e.pattern),e.allOf.push({pattern:hu(t,r),...n&&r.errorMessages&&{errorMessage:{pattern:n}}})):e.pattern=hu(t,r)}function hu(e,t){if(!t.applyRegexFlags||!e.flags)return e.source;let n={i:e.flags.includes(`i`),m:e.flags.includes(`m`),s:e.flags.includes(`s`)},r=n.i?e.source.toLowerCase():e.source,i=``,a=!1,o=!1,s=!1;for(let e=0;e<r.length;e++){if(a){i+=r[e],a=!1;continue}if(n.i){if(o){if(r[e].match(/[a-z]/)){s?(i+=r[e],i+=`${r[e-2]}-${r[e]}`.toUpperCase(),s=!1):r[e+1]===`-`&&r[e+2]?.match(/[a-z]/)?(i+=r[e],s=!0):i+=`${r[e]}${r[e].toUpperCase()}`;continue}}else if(r[e].match(/[a-z]/)){i+=`[${r[e]}${r[e].toUpperCase()}]`;continue}}if(n.m){if(r[e]===`^`){i+=`(^|(?<=[\r
|
|
74
74
|
]))`;continue}else if(r[e]===`$`){i+=`($|(?=[\r
|
|
75
75
|
]))`;continue}}if(n.s&&r[e]===`.`){i+=o?`${r[e]}\r
|
|
76
76
|
`:`[${r[e]}\r
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Espen Hovlandsdal <espen@hovlandsdal.com>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The type of error that occurred.
|
|
3
|
+
* @public
|
|
4
|
+
*/
|
|
5
|
+
export declare type ErrorType = "invalid-retry" | "unknown-field";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* A parsed EventSource message event
|
|
9
|
+
*
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
export declare interface EventSourceMessage {
|
|
13
|
+
/**
|
|
14
|
+
* The event type sent from the server. Note that this differs from the browser `EventSource`
|
|
15
|
+
* implementation in that browsers will default this to `message`, whereas this parser will
|
|
16
|
+
* leave this as `undefined` if not explicitly declared.
|
|
17
|
+
*/
|
|
18
|
+
event?: string | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* ID of the message, if any was provided by the server. Can be used by clients to keep the
|
|
21
|
+
* last received message ID in sync when reconnecting.
|
|
22
|
+
*/
|
|
23
|
+
id?: string | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* The data received for this message
|
|
26
|
+
*/
|
|
27
|
+
data: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* A TransformStream that ingests a stream of strings and produces a stream of `EventSourceMessage`.
|
|
32
|
+
*
|
|
33
|
+
* @example Basic usage
|
|
34
|
+
* ```
|
|
35
|
+
* const eventStream =
|
|
36
|
+
* response.body
|
|
37
|
+
* .pipeThrough(new TextDecoderStream())
|
|
38
|
+
* .pipeThrough(new EventSourceParserStream())
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* @example Terminate stream on parsing errors
|
|
42
|
+
* ```
|
|
43
|
+
* const eventStream =
|
|
44
|
+
* response.body
|
|
45
|
+
* .pipeThrough(new TextDecoderStream())
|
|
46
|
+
* .pipeThrough(new EventSourceParserStream({terminateOnError: true}))
|
|
47
|
+
* ```
|
|
48
|
+
*
|
|
49
|
+
* @public
|
|
50
|
+
*/
|
|
51
|
+
export declare class EventSourceParserStream extends TransformStream<
|
|
52
|
+
string,
|
|
53
|
+
EventSourceMessage
|
|
54
|
+
> {
|
|
55
|
+
constructor({ onError, onRetry, onComment }?: StreamOptions);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Error thrown when encountering an issue during parsing.
|
|
60
|
+
*
|
|
61
|
+
* @public
|
|
62
|
+
*/
|
|
63
|
+
export declare class ParseError extends Error {
|
|
64
|
+
/**
|
|
65
|
+
* The type of error that occurred.
|
|
66
|
+
*/
|
|
67
|
+
type: ErrorType;
|
|
68
|
+
/**
|
|
69
|
+
* In the case of an unknown field encountered in the stream, this will be the field name.
|
|
70
|
+
*/
|
|
71
|
+
field?: string | undefined;
|
|
72
|
+
/**
|
|
73
|
+
* In the case of an unknown field encountered in the stream, this will be the value of the field.
|
|
74
|
+
*/
|
|
75
|
+
value?: string | undefined;
|
|
76
|
+
/**
|
|
77
|
+
* The line that caused the error, if available.
|
|
78
|
+
*/
|
|
79
|
+
line?: string | undefined;
|
|
80
|
+
constructor(
|
|
81
|
+
message: string,
|
|
82
|
+
options: {
|
|
83
|
+
type: ErrorType;
|
|
84
|
+
field?: string;
|
|
85
|
+
value?: string;
|
|
86
|
+
line?: string;
|
|
87
|
+
},
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Options for the EventSourceParserStream.
|
|
93
|
+
*
|
|
94
|
+
* @public
|
|
95
|
+
*/
|
|
96
|
+
export declare interface StreamOptions {
|
|
97
|
+
/**
|
|
98
|
+
* Behavior when a parsing error occurs.
|
|
99
|
+
*
|
|
100
|
+
* - A custom function can be provided to handle the error.
|
|
101
|
+
* - `'terminate'` will error the stream and stop parsing.
|
|
102
|
+
* - Any other value will ignore the error and continue parsing.
|
|
103
|
+
*
|
|
104
|
+
* @defaultValue `undefined`
|
|
105
|
+
*/
|
|
106
|
+
onError?: ("terminate" | ((error: Error) => void)) | undefined;
|
|
107
|
+
/**
|
|
108
|
+
* Callback for when a reconnection interval is sent from the server.
|
|
109
|
+
*
|
|
110
|
+
* @param retry - The number of milliseconds to wait before reconnecting.
|
|
111
|
+
*/
|
|
112
|
+
onRetry?: ((retry: number) => void) | undefined;
|
|
113
|
+
/**
|
|
114
|
+
* Callback for when a comment is encountered in the stream.
|
|
115
|
+
*
|
|
116
|
+
* @param comment - The comment encountered in the stream.
|
|
117
|
+
*/
|
|
118
|
+
onComment?: ((comment: string) => void) | undefined;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { generateText, type ModelMessage, streamText } from "ai";
|
|
2
|
-
import type { CodeModeApprovalInterrupt, CodeModeApprovalResponse, CodeModeOptions, CodeModeToolExecutionOptions, CodeModeToolSet } from "./types.js";
|
|
2
|
+
import type { CodeModeApprovalInterrupt, CodeModeApprovalResponse, CodeModeContinuationSecurityOptions, CodeModeOptions, CodeModeToolExecutionOptions, CodeModeToolSet } from "./types.js";
|
|
3
3
|
/**
|
|
4
4
|
* Returns true when a value is a code-mode approval interruption.
|
|
5
5
|
*
|
|
6
6
|
* An approval interruption is a `CodeModeInterrupt` whose payload kind is the
|
|
7
7
|
* reserved approval kind, so this also implies `isCodeModeInterrupt`.
|
|
8
8
|
*/
|
|
9
|
-
export declare function isCodeModeApprovalInterrupt(value: unknown): value is CodeModeApprovalInterrupt;
|
|
9
|
+
export declare function isCodeModeApprovalInterrupt(value: unknown, continuationSecurity?: CodeModeContinuationSecurityOptions): value is CodeModeApprovalInterrupt;
|
|
10
10
|
/**
|
|
11
11
|
* Continues a code-mode invocation that previously returned an approval
|
|
12
12
|
* interruption.
|
|
@@ -37,12 +37,12 @@ export declare function getCodeModeApprovalResponse(messages: ModelMessage[], in
|
|
|
37
37
|
/**
|
|
38
38
|
* Finds a code-mode approval interruption in an AI SDK result-like object.
|
|
39
39
|
*/
|
|
40
|
-
export declare function getCodeModeApprovalInterrupt(result: unknown): CodeModeApprovalInterrupt | undefined;
|
|
40
|
+
export declare function getCodeModeApprovalInterrupt(result: unknown, continuationSecurity?: CodeModeContinuationSecurityOptions): CodeModeApprovalInterrupt | undefined;
|
|
41
41
|
/**
|
|
42
42
|
* Runs `generateText` and annotates the returned result with any code-mode
|
|
43
43
|
* approval interruption and AI SDK approval messages.
|
|
44
44
|
*/
|
|
45
|
-
export declare function generateTextWithCodeModeApprovals(options: Parameters<typeof generateText>[0]): Promise<Awaited<ReturnType<typeof generateText>> & {
|
|
45
|
+
export declare function generateTextWithCodeModeApprovals(options: Parameters<typeof generateText>[0], continuationSecurity?: CodeModeContinuationSecurityOptions): Promise<Awaited<ReturnType<typeof generateText>> & {
|
|
46
46
|
codeModeApproval: CodeModeApprovalInterrupt | undefined;
|
|
47
47
|
codeModeApprovalMessages: ModelMessage[];
|
|
48
48
|
}>;
|
|
@@ -50,7 +50,7 @@ export declare function generateTextWithCodeModeApprovals(options: Parameters<ty
|
|
|
50
50
|
* Runs `streamText` and adds a `codeModeApproval` promise that resolves to any
|
|
51
51
|
* approval interruption found in the final tool results.
|
|
52
52
|
*/
|
|
53
|
-
export declare function streamTextWithCodeModeApprovals(options: Parameters<typeof streamText>[0]): ReturnType<typeof streamText> & {
|
|
53
|
+
export declare function streamTextWithCodeModeApprovals(options: Parameters<typeof streamText>[0], continuationSecurity?: CodeModeContinuationSecurityOptions): ReturnType<typeof streamText> & {
|
|
54
54
|
codeModeApproval: Promise<CodeModeApprovalInterrupt | undefined>;
|
|
55
55
|
};
|
|
56
56
|
/**
|
|
@@ -60,11 +60,11 @@ export declare function streamTextWithCodeModeApprovals(options: Parameters<type
|
|
|
60
60
|
export declare function wrapToolLoopAgentForCodeModeApprovals<T extends {
|
|
61
61
|
generate?: (...args: any[]) => Promise<unknown>;
|
|
62
62
|
stream?: (...args: any[]) => Promise<unknown>;
|
|
63
|
-
}>(agent: T): T;
|
|
63
|
+
}>(agent: T, continuationSecurity?: CodeModeContinuationSecurityOptions): T;
|
|
64
64
|
/**
|
|
65
65
|
* Adds approval interruption metadata to a result-like object.
|
|
66
66
|
*/
|
|
67
|
-
export declare function attachCodeModeApprovalResult<T>(result: T): T & {
|
|
67
|
+
export declare function attachCodeModeApprovalResult<T>(result: T, continuationSecurity?: CodeModeContinuationSecurityOptions): T & {
|
|
68
68
|
codeModeApproval: CodeModeApprovalInterrupt | undefined;
|
|
69
69
|
codeModeApprovalMessages: ModelMessage[];
|
|
70
70
|
};
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import type { CodeModeContinuation, UnsignedCodeModeContinuation } from "./types.js";
|
|
1
|
+
import type { CodeModeContinuation, CodeModeContinuationSecurityOptions, UnsignedCodeModeContinuation } from "./types.js";
|
|
2
|
+
export interface ResolvedCodeModeContinuationSecurity {
|
|
3
|
+
signingKey: Buffer;
|
|
4
|
+
maxAgeMs: number;
|
|
5
|
+
}
|
|
2
6
|
/**
|
|
3
7
|
* Sets the process-global continuation signing key.
|
|
4
8
|
*
|
|
@@ -12,22 +16,29 @@ import type { CodeModeContinuation, UnsignedCodeModeContinuation } from "./types
|
|
|
12
16
|
export declare function setCodeModeContinuationSigningKey(key?: string | Uint8Array, options?: {
|
|
13
17
|
maxAgeMs?: number;
|
|
14
18
|
}): void;
|
|
19
|
+
/**
|
|
20
|
+
* Resolves continuation security for one invocation without mutating process
|
|
21
|
+
* defaults.
|
|
22
|
+
*
|
|
23
|
+
* @internal
|
|
24
|
+
*/
|
|
25
|
+
export declare function resolveCodeModeContinuationSecurity(options?: CodeModeContinuationSecurityOptions): ResolvedCodeModeContinuationSecurity;
|
|
15
26
|
/**
|
|
16
27
|
* Signs a host-created continuation as an unforgeable bearer capability.
|
|
17
28
|
*
|
|
18
29
|
* @internal
|
|
19
30
|
*/
|
|
20
|
-
export declare function signCodeModeContinuation(continuation: UnsignedCodeModeContinuation): CodeModeContinuation;
|
|
31
|
+
export declare function signCodeModeContinuation(continuation: UnsignedCodeModeContinuation, security?: ResolvedCodeModeContinuationSecurity): CodeModeContinuation;
|
|
21
32
|
/**
|
|
22
33
|
* Verifies that a continuation was issued by this host and has not expired.
|
|
23
34
|
*
|
|
24
35
|
* @internal
|
|
25
36
|
*/
|
|
26
|
-
export declare function verifyCodeModeContinuation(continuation: CodeModeContinuation): void;
|
|
37
|
+
export declare function verifyCodeModeContinuation(continuation: CodeModeContinuation, security?: CodeModeContinuationSecurityOptions): void;
|
|
27
38
|
/**
|
|
28
39
|
* Returns whether a value is a currently valid signed continuation.
|
|
29
40
|
*
|
|
30
41
|
* @internal
|
|
31
42
|
*/
|
|
32
|
-
export declare function hasValidCodeModeContinuationCapability(value: unknown): value is CodeModeContinuation;
|
|
43
|
+
export declare function hasValidCodeModeContinuationCapability(value: unknown, security?: CodeModeContinuationSecurityOptions): value is CodeModeContinuation;
|
|
33
44
|
//# sourceMappingURL=continuation-capability.d.ts.map
|
|
@@ -7,5 +7,5 @@ export { continueCodeModeInterrupt, getCodeModeInterrupt, isCodeModeInterrupt, r
|
|
|
7
7
|
export { runCodeMode } from "./run-code-mode.js";
|
|
8
8
|
export { getCodeModeWorkerUrl, getDefaultCodeModeWorkerUrl, setCodeModeWorkerUrl, } from "./runtime/manager.js";
|
|
9
9
|
export { setMaxWorkers } from "./runtime/max-workers.js";
|
|
10
|
-
export type { ApprovalDecision, CodeModeApprovalInterrupt, CodeModeApprovalInterruptPayload, CodeModeApprovalRequest, CodeModeApprovalResolution, CodeModeApprovalResponse, CodeModeContinuation, CodeModeContinuationAuth, CodeModeContinuationLedgerEntry, CodeModeDeterminismState, CodeModeExecutionPolicy, CodeModeFetchPolicy, CodeModeFetchRequestEvent, CodeModeFetchResultEvent, CodeModeInterrupt, CodeModeInterruptEvent, CodeModeInterruptExecutionContext, CodeModeInterruptPayload, CodeModeInterruptResolution, CodeModeLifecycleHookErrorEvent, CodeModeModelOutput, CodeModeModelOutputOptions, CodeModeModelVisibleBridgeSummary, CodeModeNestedToolCallEvent, CodeModeNestedToolResultEvent, CodeModeOptions, CodeModeTelemetryOptions, CodeModeToolExecutionOptions, CodeModeToolInput, CodeModeToolSet, CodeModeTrace, CodeModeTraceEntry, CodeModeUnwrappedResult, CodeModeWorkerUrl, RunCodeModeInput, UnsignedCodeModeContinuation, } from "./types.js";
|
|
10
|
+
export type { ApprovalDecision, CodeModeApprovalInterrupt, CodeModeApprovalInterruptPayload, CodeModeApprovalRequest, CodeModeApprovalResolution, CodeModeApprovalResponse, CodeModeContinuation, CodeModeContinuationAuth, CodeModeContinuationLedgerEntry, CodeModeContinuationSecurityOptions, CodeModeDeterminismState, CodeModeExecutionPolicy, CodeModeFetchPolicy, CodeModeFetchRequestEvent, CodeModeFetchResultEvent, CodeModeInterrupt, CodeModeInterruptEvent, CodeModeInterruptExecutionContext, CodeModeInterruptPayload, CodeModeInterruptResolution, CodeModeLifecycleHookErrorEvent, CodeModeModelOutput, CodeModeModelOutputOptions, CodeModeModelVisibleBridgeSummary, CodeModeNestedToolCallEvent, CodeModeNestedToolResultEvent, CodeModeOptions, CodeModeTelemetryOptions, CodeModeToolExecutionOptions, CodeModeToolInput, CodeModeToolSet, CodeModeTrace, CodeModeTraceEntry, CodeModeUnwrappedResult, CodeModeWorkerUrl, RunCodeModeInput, UnsignedCodeModeContinuation, } from "./types.js";
|
|
11
11
|
//# sourceMappingURL=index.d.ts.map
|