@mastra/schema-compat 1.2.10-alpha.0 → 1.2.11-alpha.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 +14 -0
- package/dist/_types/@internal_ai-sdk-v4/dist/index.d.ts +2 -160
- package/dist/_types/@internal_ai-sdk-v5/dist/index.d.ts +13 -171
- package/dist/_types/@internal_ai-v6/dist/index.d.ts +28 -165
- package/dist/_types/@standard-schema_spec/dist/index.d.ts +119 -0
- package/dist/_types/@types_json-schema/index.d.ts +749 -0
- package/dist/{chunk-MARLM5PM.cjs → chunk-B6ZU4MU5.cjs} +508 -508
- package/dist/chunk-B6ZU4MU5.cjs.map +1 -0
- package/dist/{chunk-JO4RRSYO.cjs → chunk-BQ3VTMIR.cjs} +4 -4
- package/dist/{chunk-JO4RRSYO.cjs.map → chunk-BQ3VTMIR.cjs.map} +1 -1
- package/dist/{chunk-7ZCSAPV3.js → chunk-ECLNT3TQ.js} +3 -2
- package/dist/chunk-ECLNT3TQ.js.map +1 -0
- package/dist/{chunk-K73KZRCA.js → chunk-H72LBCXW.js} +4 -4
- package/dist/{chunk-K73KZRCA.js.map → chunk-H72LBCXW.js.map} +1 -1
- package/dist/{chunk-UFJG5KPA.cjs → chunk-LQOEEQF6.cjs} +3 -2
- package/dist/chunk-LQOEEQF6.cjs.map +1 -0
- package/dist/{chunk-KGSZKLQN.js → chunk-MXN3UURE.js} +506 -506
- package/dist/chunk-MXN3UURE.js.map +1 -0
- package/dist/{chunk-DLZFWLZ2.js → chunk-QFEMCRFS.js} +3 -3
- package/dist/{chunk-DLZFWLZ2.js.map → chunk-QFEMCRFS.js.map} +1 -1
- package/dist/{chunk-3MLZICLP.cjs → chunk-SKPYVQBT.cjs} +4 -4
- package/dist/chunk-SKPYVQBT.cjs.map +1 -0
- package/dist/{chunk-K7I3YXWP.js → chunk-Y4VRRNL5.js} +4 -4
- package/dist/chunk-Y4VRRNL5.js.map +1 -0
- package/dist/{chunk-Q6XZFGLX.cjs → chunk-ZRSV37SF.cjs} +6 -6
- package/dist/{chunk-Q6XZFGLX.cjs.map → chunk-ZRSV37SF.cjs.map} +1 -1
- package/dist/index.cjs +129 -36
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +101 -8
- package/dist/index.js.map +1 -1
- package/dist/json-schema.d.ts +2 -2
- package/dist/provider-compats/anthropic.d.ts +1 -1
- package/dist/provider-compats/deepseek.d.ts +1 -1
- package/dist/provider-compats/google.d.ts.map +1 -1
- package/dist/provider-compats/meta.d.ts +1 -1
- package/dist/schema.cjs +7 -7
- package/dist/schema.js +1 -1
- package/dist/schema.types.d.ts +3 -3
- package/dist/standard-schema/adapters/ai-sdk.d.ts +1 -1
- package/dist/standard-schema/adapters/json-schema.cjs +3 -3
- package/dist/standard-schema/adapters/json-schema.js +1 -1
- package/dist/standard-schema/adapters/zod-v3.cjs +2 -2
- package/dist/standard-schema/adapters/zod-v3.js +1 -1
- package/dist/standard-schema/adapters/zod-v4.d.ts +1 -1
- package/dist/standard-schema/standard-schema.d.ts +1 -1
- package/dist/standard-schema/standard-schema.types.d.ts +1 -1
- package/dist/zod-to-json.cjs +4 -4
- package/dist/zod-to-json.d.ts.map +1 -1
- package/dist/zod-to-json.js +1 -1
- package/package.json +12 -12
- package/dist/chunk-3MLZICLP.cjs.map +0 -1
- package/dist/chunk-7ZCSAPV3.js.map +0 -1
- package/dist/chunk-K7I3YXWP.js.map +0 -1
- package/dist/chunk-KGSZKLQN.js.map +0 -1
- package/dist/chunk-MARLM5PM.cjs.map +0 -1
- package/dist/chunk-UFJG5KPA.cjs.map +0 -1
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { JSONSchema7 } from '../../@types_json-schema/index.d.ts';
|
|
2
|
+
import { JSONSchema7Definition } from '../../@types_json-schema/index.d.ts';
|
|
1
3
|
import { ServerResponse } from 'node:http';
|
|
2
4
|
import { ServerResponse as ServerResponse_2 } from 'http';
|
|
3
5
|
import { z } from 'zod/v4';
|
|
@@ -575,6 +577,7 @@ declare type BaseToolCall = {
|
|
|
575
577
|
toolCallId: string;
|
|
576
578
|
providerExecuted?: boolean;
|
|
577
579
|
providerMetadata?: ProviderMetadata;
|
|
580
|
+
toolMetadata?: JSONObject;
|
|
578
581
|
};
|
|
579
582
|
|
|
580
583
|
/**
|
|
@@ -1571,7 +1574,7 @@ export declare function dynamicTool(tool: {
|
|
|
1571
1574
|
description?: string;
|
|
1572
1575
|
title?: string;
|
|
1573
1576
|
providerOptions?: ProviderOptions;
|
|
1574
|
-
|
|
1577
|
+
metadata?: JSONObject;
|
|
1575
1578
|
inputSchema: FlexibleSchema<unknown>;
|
|
1576
1579
|
execute: ToolExecuteFunction<unknown, unknown>;
|
|
1577
1580
|
/**
|
|
@@ -1625,6 +1628,7 @@ export declare type DynamicToolError = {
|
|
|
1625
1628
|
error: unknown;
|
|
1626
1629
|
providerExecuted?: boolean;
|
|
1627
1630
|
providerMetadata?: ProviderMetadata;
|
|
1631
|
+
toolMetadata?: JSONObject;
|
|
1628
1632
|
dynamic: true;
|
|
1629
1633
|
title?: string;
|
|
1630
1634
|
};
|
|
@@ -1637,6 +1641,7 @@ export declare type DynamicToolResult = {
|
|
|
1637
1641
|
output: unknown;
|
|
1638
1642
|
providerExecuted?: boolean;
|
|
1639
1643
|
providerMetadata?: ProviderMetadata;
|
|
1644
|
+
toolMetadata?: JSONObject;
|
|
1640
1645
|
dynamic: true;
|
|
1641
1646
|
preliminary?: boolean;
|
|
1642
1647
|
title?: string;
|
|
@@ -1653,6 +1658,7 @@ export declare type DynamicToolUIPart = {
|
|
|
1653
1658
|
*/
|
|
1654
1659
|
toolCallId: string;
|
|
1655
1660
|
title?: string;
|
|
1661
|
+
toolMetadata?: JSONObject;
|
|
1656
1662
|
/**
|
|
1657
1663
|
* Whether the tool call was executed by the provider.
|
|
1658
1664
|
*/
|
|
@@ -2892,7 +2898,7 @@ declare interface GatewayLanguageModelEntry {
|
|
|
2892
2898
|
|
|
2893
2899
|
declare type GatewayLanguageModelSpecification = Pick<LanguageModelV3, 'specificationVersion' | 'provider' | 'modelId'>;
|
|
2894
2900
|
|
|
2895
|
-
export declare type GatewayModelId = 'alibaba/qwen-3-14b' | 'alibaba/qwen-3-235b' | 'alibaba/qwen-3-30b' | 'alibaba/qwen-3-32b' | 'alibaba/qwen-3.6-max-preview' | 'alibaba/qwen3-235b-a22b-thinking' | 'alibaba/qwen3-coder' | 'alibaba/qwen3-coder-30b-a3b' | 'alibaba/qwen3-coder-next' | 'alibaba/qwen3-coder-plus' | 'alibaba/qwen3-max' | 'alibaba/qwen3-max-preview' | 'alibaba/qwen3-max-thinking' | 'alibaba/qwen3-next-80b-a3b-instruct' | 'alibaba/qwen3-next-80b-a3b-thinking' | 'alibaba/qwen3-vl-235b-a22b-instruct' | 'alibaba/qwen3-vl-instruct' | 'alibaba/qwen3-vl-thinking' | 'alibaba/qwen3.5-flash' | 'alibaba/qwen3.5-plus' | 'alibaba/qwen3.6-27b' | 'alibaba/qwen3.6-plus' | 'amazon/nova-2-lite' | 'amazon/nova-lite' | 'amazon/nova-micro' | 'amazon/nova-pro' | 'anthropic/claude-3-haiku' | 'anthropic/claude-3.5-haiku' | 'anthropic/claude-3.7-sonnet' | 'anthropic/claude-haiku-4.5' | 'anthropic/claude-opus-4' | 'anthropic/claude-opus-4.1' | 'anthropic/claude-opus-4.5' | 'anthropic/claude-opus-4.6' | 'anthropic/claude-opus-4.7' | 'anthropic/claude-sonnet-4' | 'anthropic/claude-sonnet-4.5' | 'anthropic/claude-sonnet-4.6' | 'arcee-ai/trinity-large-preview' | 'arcee-ai/trinity-large-thinking' | 'arcee-ai/trinity-mini' | 'bytedance/seed-1.6' | 'bytedance/seed-1.8' | 'cohere/command-a' | 'deepseek/deepseek-r1' | 'deepseek/deepseek-v3' | 'deepseek/deepseek-v3.1' | 'deepseek/deepseek-v3.1-terminus' | 'deepseek/deepseek-v3.2' | 'deepseek/deepseek-v3.2-thinking' | 'deepseek/deepseek-v4-flash' | 'deepseek/deepseek-v4-pro' | 'google/gemini-2.0-flash' | 'google/gemini-2.0-flash-lite' | 'google/gemini-2.5-flash' | 'google/gemini-2.5-flash-image' | 'google/gemini-2.5-flash-lite' | 'google/gemini-2.5-pro' | 'google/gemini-3-flash' | 'google/gemini-3-pro-image' | 'google/gemini-3-pro-preview' | 'google/gemini-3.1-flash-image-preview' | 'google/gemini-3.1-flash-lite-preview' | 'google/gemini-3.1-pro-preview' | 'google/gemma-4-26b-a4b-it' | 'google/gemma-4-31b-it' | 'inception/mercury-2' | 'inception/mercury-coder-small' | 'interfaze/interfaze-beta' | 'kwaipilot/kat-coder-pro-v1' | 'kwaipilot/kat-coder-pro-v2' | 'meituan/longcat-flash-chat' | 'meituan/longcat-flash-thinking-2601' | 'meta/llama-3.1-70b' | 'meta/llama-3.1-8b' | 'meta/llama-3.2-11b' | 'meta/llama-3.2-1b' | 'meta/llama-3.2-3b' | 'meta/llama-3.2-90b' | 'meta/llama-3.3-70b' | 'meta/llama-4-maverick' | 'meta/llama-4-scout' | 'minimax/minimax-m2' | 'minimax/minimax-m2.1' | 'minimax/minimax-m2.1-lightning' | 'minimax/minimax-m2.5' | 'minimax/minimax-m2.5-highspeed' | 'minimax/minimax-m2.7' | 'minimax/minimax-m2.7-highspeed' | 'mistral/codestral' | 'mistral/devstral-2' | 'mistral/devstral-small' | 'mistral/devstral-small-2' | 'mistral/magistral-medium' | 'mistral/magistral-small' | 'mistral/ministral-14b' | 'mistral/ministral-3b' | 'mistral/ministral-8b' | 'mistral/mistral-large-3' | 'mistral/mistral-medium' | 'mistral/mistral-nemo' | 'mistral/mistral-small' | 'mistral/pixtral-12b' | 'mistral/pixtral-large' | 'moonshotai/kimi-k2' | 'moonshotai/kimi-k2-thinking' | 'moonshotai/kimi-k2-thinking-turbo' | 'moonshotai/kimi-k2-turbo' | 'moonshotai/kimi-k2.5' | 'moonshotai/kimi-k2.6' | 'morph/morph-v3-fast' | 'morph/morph-v3-large' | 'nvidia/nemotron-3-nano-30b-a3b' | 'nvidia/nemotron-3-super-120b-a12b' | 'nvidia/nemotron-nano-12b-v2-vl' | 'nvidia/nemotron-nano-9b-v2' | 'openai/gpt-3.5-turbo' | 'openai/gpt-3.5-turbo-instruct' | 'openai/gpt-4-turbo' | 'openai/gpt-4.1' | 'openai/gpt-4.1-mini' | 'openai/gpt-4.1-nano' | 'openai/gpt-4o' | 'openai/gpt-4o-mini' | 'openai/gpt-4o-mini-search-preview' | 'openai/gpt-5' | 'openai/gpt-5-chat' | 'openai/gpt-5-codex' | 'openai/gpt-5-mini' | 'openai/gpt-5-nano' | 'openai/gpt-5-pro' | 'openai/gpt-5.1-codex' | 'openai/gpt-5.1-codex-max' | 'openai/gpt-5.1-codex-mini' | 'openai/gpt-5.1-instant' | 'openai/gpt-5.1-thinking' | 'openai/gpt-5.2' | 'openai/gpt-5.2-chat' | 'openai/gpt-5.2-codex' | 'openai/gpt-5.2-pro' | 'openai/gpt-5.3-chat' | 'openai/gpt-5.3-codex' | 'openai/gpt-5.4' | 'openai/gpt-5.4-mini' | 'openai/gpt-5.4-nano' | 'openai/gpt-5.4-pro' | 'openai/gpt-5.5' | 'openai/gpt-5.5-pro' | 'openai/gpt-oss-120b' | 'openai/gpt-oss-20b' | 'openai/gpt-oss-safeguard-20b' | 'openai/o1' | 'openai/o3' | 'openai/o3-deep-research' | 'openai/o3-mini' | 'openai/o3-pro' | 'openai/o4-mini' | 'perplexity/sonar' | 'perplexity/sonar-pro' | 'perplexity/sonar-reasoning-pro' | 'xai/grok-3' | 'xai/grok-3-fast' | 'xai/grok-3-mini' | 'xai/grok-3-mini-fast' | 'xai/grok-4' | 'xai/grok-4-fast-non-reasoning' | 'xai/grok-4-fast-reasoning' | 'xai/grok-4.1-fast-non-reasoning' | 'xai/grok-4.1-fast-reasoning' | 'xai/grok-4.20-multi-agent' | 'xai/grok-4.20-multi-agent-beta' | 'xai/grok-4.20-non-reasoning' | 'xai/grok-4.20-non-reasoning-beta' | 'xai/grok-4.20-reasoning' | 'xai/grok-4.20-reasoning-beta' | 'xai/grok-4.3' | 'xai/grok-code-fast-1' | 'xiaomi/mimo-v2-flash' | 'xiaomi/mimo-v2-pro' | 'xiaomi/mimo-v2.5' | 'xiaomi/mimo-v2.5-pro' | 'zai/glm-4.5' | 'zai/glm-4.5-air' | 'zai/glm-4.5v' | 'zai/glm-4.6' | 'zai/glm-4.6v' | 'zai/glm-4.6v-flash' | 'zai/glm-4.7' | 'zai/glm-4.7-flash' | 'zai/glm-4.7-flashx' | 'zai/glm-5' | 'zai/glm-5-turbo' | 'zai/glm-5.1' | 'zai/glm-5v-turbo' | (string & {});
|
|
2901
|
+
export declare type GatewayModelId = 'alibaba/qwen-3-14b' | 'alibaba/qwen-3-235b' | 'alibaba/qwen-3-30b' | 'alibaba/qwen-3-32b' | 'alibaba/qwen-3.6-max-preview' | 'alibaba/qwen3-235b-a22b-thinking' | 'alibaba/qwen3-coder' | 'alibaba/qwen3-coder-30b-a3b' | 'alibaba/qwen3-coder-next' | 'alibaba/qwen3-coder-plus' | 'alibaba/qwen3-max' | 'alibaba/qwen3-max-preview' | 'alibaba/qwen3-max-thinking' | 'alibaba/qwen3-next-80b-a3b-instruct' | 'alibaba/qwen3-next-80b-a3b-thinking' | 'alibaba/qwen3-vl-235b-a22b-instruct' | 'alibaba/qwen3-vl-instruct' | 'alibaba/qwen3-vl-thinking' | 'alibaba/qwen3.5-flash' | 'alibaba/qwen3.5-plus' | 'alibaba/qwen3.6-27b' | 'alibaba/qwen3.6-plus' | 'amazon/nova-2-lite' | 'amazon/nova-lite' | 'amazon/nova-micro' | 'amazon/nova-pro' | 'anthropic/claude-3-haiku' | 'anthropic/claude-3.5-haiku' | 'anthropic/claude-3.7-sonnet' | 'anthropic/claude-haiku-4.5' | 'anthropic/claude-opus-4' | 'anthropic/claude-opus-4.1' | 'anthropic/claude-opus-4.5' | 'anthropic/claude-opus-4.6' | 'anthropic/claude-opus-4.7' | 'anthropic/claude-sonnet-4' | 'anthropic/claude-sonnet-4.5' | 'anthropic/claude-sonnet-4.6' | 'arcee-ai/trinity-large-preview' | 'arcee-ai/trinity-large-thinking' | 'arcee-ai/trinity-mini' | 'bytedance/seed-1.6' | 'bytedance/seed-1.8' | 'cohere/command-a' | 'deepseek/deepseek-r1' | 'deepseek/deepseek-v3' | 'deepseek/deepseek-v3.1' | 'deepseek/deepseek-v3.1-terminus' | 'deepseek/deepseek-v3.2' | 'deepseek/deepseek-v3.2-thinking' | 'deepseek/deepseek-v4-flash' | 'deepseek/deepseek-v4-pro' | 'google/gemini-2.0-flash' | 'google/gemini-2.0-flash-lite' | 'google/gemini-2.5-flash' | 'google/gemini-2.5-flash-image' | 'google/gemini-2.5-flash-lite' | 'google/gemini-2.5-pro' | 'google/gemini-3-flash' | 'google/gemini-3-pro-image' | 'google/gemini-3-pro-preview' | 'google/gemini-3.1-flash-image-preview' | 'google/gemini-3.1-flash-lite' | 'google/gemini-3.1-flash-lite-preview' | 'google/gemini-3.1-pro-preview' | 'google/gemma-4-26b-a4b-it' | 'google/gemma-4-31b-it' | 'inception/mercury-2' | 'inception/mercury-coder-small' | 'interfaze/interfaze-beta' | 'kwaipilot/kat-coder-pro-v1' | 'kwaipilot/kat-coder-pro-v2' | 'meituan/longcat-flash-chat' | 'meituan/longcat-flash-thinking-2601' | 'meta/llama-3.1-70b' | 'meta/llama-3.1-8b' | 'meta/llama-3.2-11b' | 'meta/llama-3.2-1b' | 'meta/llama-3.2-3b' | 'meta/llama-3.2-90b' | 'meta/llama-3.3-70b' | 'meta/llama-4-maverick' | 'meta/llama-4-scout' | 'minimax/minimax-m2' | 'minimax/minimax-m2.1' | 'minimax/minimax-m2.1-lightning' | 'minimax/minimax-m2.5' | 'minimax/minimax-m2.5-highspeed' | 'minimax/minimax-m2.7' | 'minimax/minimax-m2.7-highspeed' | 'mistral/codestral' | 'mistral/devstral-2' | 'mistral/devstral-small' | 'mistral/devstral-small-2' | 'mistral/magistral-medium' | 'mistral/magistral-small' | 'mistral/ministral-14b' | 'mistral/ministral-3b' | 'mistral/ministral-8b' | 'mistral/mistral-large-3' | 'mistral/mistral-medium' | 'mistral/mistral-nemo' | 'mistral/mistral-small' | 'mistral/pixtral-12b' | 'mistral/pixtral-large' | 'moonshotai/kimi-k2' | 'moonshotai/kimi-k2-thinking' | 'moonshotai/kimi-k2-thinking-turbo' | 'moonshotai/kimi-k2-turbo' | 'moonshotai/kimi-k2.5' | 'moonshotai/kimi-k2.6' | 'morph/morph-v3-fast' | 'morph/morph-v3-large' | 'nvidia/nemotron-3-nano-30b-a3b' | 'nvidia/nemotron-3-super-120b-a12b' | 'nvidia/nemotron-nano-12b-v2-vl' | 'nvidia/nemotron-nano-9b-v2' | 'openai/gpt-3.5-turbo' | 'openai/gpt-3.5-turbo-instruct' | 'openai/gpt-4-turbo' | 'openai/gpt-4.1' | 'openai/gpt-4.1-mini' | 'openai/gpt-4.1-nano' | 'openai/gpt-4o' | 'openai/gpt-4o-mini' | 'openai/gpt-4o-mini-search-preview' | 'openai/gpt-5' | 'openai/gpt-5-chat' | 'openai/gpt-5-codex' | 'openai/gpt-5-mini' | 'openai/gpt-5-nano' | 'openai/gpt-5-pro' | 'openai/gpt-5.1-codex' | 'openai/gpt-5.1-codex-max' | 'openai/gpt-5.1-codex-mini' | 'openai/gpt-5.1-instant' | 'openai/gpt-5.1-thinking' | 'openai/gpt-5.2' | 'openai/gpt-5.2-chat' | 'openai/gpt-5.2-codex' | 'openai/gpt-5.2-pro' | 'openai/gpt-5.3-chat' | 'openai/gpt-5.3-codex' | 'openai/gpt-5.4' | 'openai/gpt-5.4-mini' | 'openai/gpt-5.4-nano' | 'openai/gpt-5.4-pro' | 'openai/gpt-5.5' | 'openai/gpt-5.5-pro' | 'openai/gpt-oss-120b' | 'openai/gpt-oss-20b' | 'openai/gpt-oss-safeguard-20b' | 'openai/o1' | 'openai/o3' | 'openai/o3-deep-research' | 'openai/o3-mini' | 'openai/o3-pro' | 'openai/o4-mini' | 'perplexity/sonar' | 'perplexity/sonar-pro' | 'perplexity/sonar-reasoning-pro' | 'xai/grok-3' | 'xai/grok-3-fast' | 'xai/grok-3-mini' | 'xai/grok-3-mini-fast' | 'xai/grok-4' | 'xai/grok-4-fast-non-reasoning' | 'xai/grok-4-fast-reasoning' | 'xai/grok-4.1-fast-non-reasoning' | 'xai/grok-4.1-fast-reasoning' | 'xai/grok-4.20-multi-agent' | 'xai/grok-4.20-multi-agent-beta' | 'xai/grok-4.20-non-reasoning' | 'xai/grok-4.20-non-reasoning-beta' | 'xai/grok-4.20-reasoning' | 'xai/grok-4.20-reasoning-beta' | 'xai/grok-4.3' | 'xai/grok-code-fast-1' | 'xiaomi/mimo-v2-flash' | 'xiaomi/mimo-v2-pro' | 'xiaomi/mimo-v2.5' | 'xiaomi/mimo-v2.5-pro' | 'zai/glm-4.5' | 'zai/glm-4.5-air' | 'zai/glm-4.5v' | 'zai/glm-4.6' | 'zai/glm-4.6v' | 'zai/glm-4.6v-flash' | 'zai/glm-4.7' | 'zai/glm-4.7-flash' | 'zai/glm-4.7-flashx' | 'zai/glm-5' | 'zai/glm-5-turbo' | 'zai/glm-5.1' | 'zai/glm-5v-turbo' | (string & {});
|
|
2896
2902
|
|
|
2897
2903
|
declare interface GatewayProvider extends ProviderV3 {
|
|
2898
2904
|
(modelId: GatewayModelId): LanguageModelV3;
|
|
@@ -4754,164 +4760,7 @@ export declare function jsonSchema<OBJECT = unknown>(jsonSchema: JSONSchema7 | P
|
|
|
4754
4760
|
validate?: (value: unknown) => ValidationResult<OBJECT> | PromiseLike<ValidationResult<OBJECT>>;
|
|
4755
4761
|
}): Schema<OBJECT>;
|
|
4756
4762
|
|
|
4757
|
-
export
|
|
4758
|
-
$id?: string | undefined;
|
|
4759
|
-
$ref?: string | undefined;
|
|
4760
|
-
$schema?: JSONSchema7Version | undefined;
|
|
4761
|
-
$comment?: string | undefined;
|
|
4762
|
-
|
|
4763
|
-
/**
|
|
4764
|
-
* @see https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-00#section-8.2.4
|
|
4765
|
-
* @see https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-validation-00#appendix-A
|
|
4766
|
-
*/
|
|
4767
|
-
$defs?: {
|
|
4768
|
-
[key: string]: JSONSchema7Definition;
|
|
4769
|
-
} | undefined;
|
|
4770
|
-
|
|
4771
|
-
/**
|
|
4772
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.1
|
|
4773
|
-
*/
|
|
4774
|
-
type?: JSONSchema7TypeName | JSONSchema7TypeName[] | undefined;
|
|
4775
|
-
enum?: JSONSchema7Type[] | undefined;
|
|
4776
|
-
const?: JSONSchema7Type | undefined;
|
|
4777
|
-
|
|
4778
|
-
/**
|
|
4779
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.2
|
|
4780
|
-
*/
|
|
4781
|
-
multipleOf?: number | undefined;
|
|
4782
|
-
maximum?: number | undefined;
|
|
4783
|
-
exclusiveMaximum?: number | undefined;
|
|
4784
|
-
minimum?: number | undefined;
|
|
4785
|
-
exclusiveMinimum?: number | undefined;
|
|
4786
|
-
|
|
4787
|
-
/**
|
|
4788
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.3
|
|
4789
|
-
*/
|
|
4790
|
-
maxLength?: number | undefined;
|
|
4791
|
-
minLength?: number | undefined;
|
|
4792
|
-
pattern?: string | undefined;
|
|
4793
|
-
|
|
4794
|
-
/**
|
|
4795
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.4
|
|
4796
|
-
*/
|
|
4797
|
-
items?: JSONSchema7Definition | JSONSchema7Definition[] | undefined;
|
|
4798
|
-
additionalItems?: JSONSchema7Definition | undefined;
|
|
4799
|
-
maxItems?: number | undefined;
|
|
4800
|
-
minItems?: number | undefined;
|
|
4801
|
-
uniqueItems?: boolean | undefined;
|
|
4802
|
-
contains?: JSONSchema7Definition | undefined;
|
|
4803
|
-
|
|
4804
|
-
/**
|
|
4805
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.5
|
|
4806
|
-
*/
|
|
4807
|
-
maxProperties?: number | undefined;
|
|
4808
|
-
minProperties?: number | undefined;
|
|
4809
|
-
required?: string[] | undefined;
|
|
4810
|
-
properties?: {
|
|
4811
|
-
[key: string]: JSONSchema7Definition;
|
|
4812
|
-
} | undefined;
|
|
4813
|
-
patternProperties?: {
|
|
4814
|
-
[key: string]: JSONSchema7Definition;
|
|
4815
|
-
} | undefined;
|
|
4816
|
-
additionalProperties?: JSONSchema7Definition | undefined;
|
|
4817
|
-
dependencies?: {
|
|
4818
|
-
[key: string]: JSONSchema7Definition | string[];
|
|
4819
|
-
} | undefined;
|
|
4820
|
-
propertyNames?: JSONSchema7Definition | undefined;
|
|
4821
|
-
|
|
4822
|
-
/**
|
|
4823
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.6
|
|
4824
|
-
*/
|
|
4825
|
-
if?: JSONSchema7Definition | undefined;
|
|
4826
|
-
then?: JSONSchema7Definition | undefined;
|
|
4827
|
-
else?: JSONSchema7Definition | undefined;
|
|
4828
|
-
|
|
4829
|
-
/**
|
|
4830
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.7
|
|
4831
|
-
*/
|
|
4832
|
-
allOf?: JSONSchema7Definition[] | undefined;
|
|
4833
|
-
anyOf?: JSONSchema7Definition[] | undefined;
|
|
4834
|
-
oneOf?: JSONSchema7Definition[] | undefined;
|
|
4835
|
-
not?: JSONSchema7Definition | undefined;
|
|
4836
|
-
|
|
4837
|
-
/**
|
|
4838
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-7
|
|
4839
|
-
*/
|
|
4840
|
-
format?: string | undefined;
|
|
4841
|
-
|
|
4842
|
-
/**
|
|
4843
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-8
|
|
4844
|
-
*/
|
|
4845
|
-
contentMediaType?: string | undefined;
|
|
4846
|
-
contentEncoding?: string | undefined;
|
|
4847
|
-
|
|
4848
|
-
/**
|
|
4849
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-9
|
|
4850
|
-
*/
|
|
4851
|
-
definitions?: {
|
|
4852
|
-
[key: string]: JSONSchema7Definition;
|
|
4853
|
-
} | undefined;
|
|
4854
|
-
|
|
4855
|
-
/**
|
|
4856
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-10
|
|
4857
|
-
*/
|
|
4858
|
-
title?: string | undefined;
|
|
4859
|
-
description?: string | undefined;
|
|
4860
|
-
default?: JSONSchema7Type | undefined;
|
|
4861
|
-
readOnly?: boolean | undefined;
|
|
4862
|
-
writeOnly?: boolean | undefined;
|
|
4863
|
-
examples?: JSONSchema7Type | undefined;
|
|
4864
|
-
}
|
|
4865
|
-
|
|
4866
|
-
declare interface JSONSchema7Array extends Array<JSONSchema7Type> {}
|
|
4867
|
-
|
|
4868
|
-
/**
|
|
4869
|
-
* JSON Schema v7
|
|
4870
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01
|
|
4871
|
-
*/
|
|
4872
|
-
declare type JSONSchema7Definition = JSONSchema7 | boolean;
|
|
4873
|
-
|
|
4874
|
-
declare interface JSONSchema7Object {
|
|
4875
|
-
[key: string]: JSONSchema7Type;
|
|
4876
|
-
}
|
|
4877
|
-
|
|
4878
|
-
/**
|
|
4879
|
-
* Primitive type
|
|
4880
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.1.1
|
|
4881
|
-
*/
|
|
4882
|
-
declare type JSONSchema7Type =
|
|
4883
|
-
| string //
|
|
4884
|
-
| number
|
|
4885
|
-
| boolean
|
|
4886
|
-
| JSONSchema7Object
|
|
4887
|
-
| JSONSchema7Array
|
|
4888
|
-
| null;
|
|
4889
|
-
|
|
4890
|
-
/**
|
|
4891
|
-
* Primitive type
|
|
4892
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.1.1
|
|
4893
|
-
*/
|
|
4894
|
-
declare type JSONSchema7TypeName =
|
|
4895
|
-
| "string" //
|
|
4896
|
-
| "number"
|
|
4897
|
-
| "integer"
|
|
4898
|
-
| "boolean"
|
|
4899
|
-
| "object"
|
|
4900
|
-
| "array"
|
|
4901
|
-
| "null";
|
|
4902
|
-
|
|
4903
|
-
/**
|
|
4904
|
-
* Meta schema
|
|
4905
|
-
*
|
|
4906
|
-
* Recommended values:
|
|
4907
|
-
* - 'http://json-schema.org/schema#'
|
|
4908
|
-
* - 'http://json-schema.org/hyper-schema#'
|
|
4909
|
-
* - 'http://json-schema.org/draft-07/schema#'
|
|
4910
|
-
* - 'http://json-schema.org/draft-07/hyper-schema#'
|
|
4911
|
-
*
|
|
4912
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-5
|
|
4913
|
-
*/
|
|
4914
|
-
declare type JSONSchema7Version = string;
|
|
4763
|
+
export { JSONSchema7 }
|
|
4915
4764
|
|
|
4916
4765
|
/**
|
|
4917
4766
|
* A TransformStream that converts JSON objects to Server-Sent Events (SSE) format.
|
|
@@ -9979,6 +9828,7 @@ export declare type StaticToolError<TOOLS extends ToolSet> = ValueOf<{
|
|
|
9979
9828
|
error: unknown;
|
|
9980
9829
|
providerExecuted?: boolean;
|
|
9981
9830
|
providerMetadata?: ProviderMetadata;
|
|
9831
|
+
toolMetadata?: JSONObject;
|
|
9982
9832
|
dynamic?: false | undefined;
|
|
9983
9833
|
title?: string;
|
|
9984
9834
|
};
|
|
@@ -10006,6 +9856,7 @@ export declare type StaticToolResult<TOOLS extends ToolSet> = ValueOf<{
|
|
|
10006
9856
|
output: InferToolOutput<TOOLS[NAME]>;
|
|
10007
9857
|
providerExecuted?: boolean;
|
|
10008
9858
|
providerMetadata?: ProviderMetadata;
|
|
9859
|
+
toolMetadata?: JSONObject;
|
|
10009
9860
|
dynamic?: false | undefined;
|
|
10010
9861
|
preliminary?: boolean;
|
|
10011
9862
|
title?: string;
|
|
@@ -11151,6 +11002,7 @@ export declare type TextStreamPart<TOOLS extends ToolSet> = {
|
|
|
11151
11002
|
id: string;
|
|
11152
11003
|
toolName: string;
|
|
11153
11004
|
providerMetadata?: ProviderMetadata;
|
|
11005
|
+
toolMetadata?: JSONObject;
|
|
11154
11006
|
providerExecuted?: boolean;
|
|
11155
11007
|
dynamic?: boolean;
|
|
11156
11008
|
title?: string;
|
|
@@ -11275,11 +11127,11 @@ export declare type Tool<INPUT extends JSONValue_2 | unknown | never = any, OUTP
|
|
|
11275
11127
|
*
|
|
11276
11128
|
* Unlike `providerOptions`, this metadata is not sent to the language
|
|
11277
11129
|
* model. Instead, it is propagated onto the resulting tool call's
|
|
11278
|
-
* `
|
|
11279
|
-
*
|
|
11280
|
-
*
|
|
11130
|
+
* `toolMetadata` so consumers can read it from tool call / result parts
|
|
11131
|
+
* and UI message parts. This is useful for sources of dynamic tools (e.g.
|
|
11132
|
+
* an MCP server) to identify themselves.
|
|
11281
11133
|
*/
|
|
11282
|
-
|
|
11134
|
+
metadata?: JSONObject;
|
|
11283
11135
|
/**
|
|
11284
11136
|
* The schema of the input that the tool expects.
|
|
11285
11137
|
* The language model will use this to generate the input.
|
|
@@ -12637,6 +12489,7 @@ export declare type UIMessageChunk<METADATA = unknown, DATA_TYPES extends UIData
|
|
|
12637
12489
|
input: unknown;
|
|
12638
12490
|
providerExecuted?: boolean;
|
|
12639
12491
|
providerMetadata?: ProviderMetadata;
|
|
12492
|
+
toolMetadata?: JSONObject;
|
|
12640
12493
|
dynamic?: boolean;
|
|
12641
12494
|
title?: string;
|
|
12642
12495
|
} | {
|
|
@@ -12646,6 +12499,7 @@ export declare type UIMessageChunk<METADATA = unknown, DATA_TYPES extends UIData
|
|
|
12646
12499
|
input: unknown;
|
|
12647
12500
|
providerExecuted?: boolean;
|
|
12648
12501
|
providerMetadata?: ProviderMetadata;
|
|
12502
|
+
toolMetadata?: JSONObject;
|
|
12649
12503
|
dynamic?: boolean;
|
|
12650
12504
|
errorText: string;
|
|
12651
12505
|
title?: string;
|
|
@@ -12659,6 +12513,7 @@ export declare type UIMessageChunk<METADATA = unknown, DATA_TYPES extends UIData
|
|
|
12659
12513
|
output: unknown;
|
|
12660
12514
|
providerExecuted?: boolean;
|
|
12661
12515
|
providerMetadata?: ProviderMetadata;
|
|
12516
|
+
toolMetadata?: JSONObject;
|
|
12662
12517
|
dynamic?: boolean;
|
|
12663
12518
|
preliminary?: boolean;
|
|
12664
12519
|
} | {
|
|
@@ -12667,6 +12522,7 @@ export declare type UIMessageChunk<METADATA = unknown, DATA_TYPES extends UIData
|
|
|
12667
12522
|
errorText: string;
|
|
12668
12523
|
providerExecuted?: boolean;
|
|
12669
12524
|
providerMetadata?: ProviderMetadata;
|
|
12525
|
+
toolMetadata?: JSONObject;
|
|
12670
12526
|
dynamic?: boolean;
|
|
12671
12527
|
} | {
|
|
12672
12528
|
type: 'tool-output-denied';
|
|
@@ -12677,6 +12533,7 @@ export declare type UIMessageChunk<METADATA = unknown, DATA_TYPES extends UIData
|
|
|
12677
12533
|
toolName: string;
|
|
12678
12534
|
providerExecuted?: boolean;
|
|
12679
12535
|
providerMetadata?: ProviderMetadata;
|
|
12536
|
+
toolMetadata?: JSONObject;
|
|
12680
12537
|
dynamic?: boolean;
|
|
12681
12538
|
title?: string;
|
|
12682
12539
|
} | {
|
|
@@ -12743,6 +12600,7 @@ export declare const uiMessageChunkSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
12743
12600
|
toolName: string;
|
|
12744
12601
|
providerExecuted?: boolean | undefined;
|
|
12745
12602
|
providerMetadata?: _ai_sdk_provider.SharedV3ProviderMetadata | undefined;
|
|
12603
|
+
toolMetadata?: JSONObject | undefined;
|
|
12746
12604
|
dynamic?: boolean | undefined;
|
|
12747
12605
|
title?: string | undefined;
|
|
12748
12606
|
} | {
|
|
@@ -12756,6 +12614,7 @@ export declare const uiMessageChunkSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
12756
12614
|
input: unknown;
|
|
12757
12615
|
providerExecuted?: boolean | undefined;
|
|
12758
12616
|
providerMetadata?: _ai_sdk_provider.SharedV3ProviderMetadata | undefined;
|
|
12617
|
+
toolMetadata?: JSONObject | undefined;
|
|
12759
12618
|
dynamic?: boolean | undefined;
|
|
12760
12619
|
title?: string | undefined;
|
|
12761
12620
|
} | {
|
|
@@ -12766,6 +12625,7 @@ export declare const uiMessageChunkSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
12766
12625
|
errorText: string;
|
|
12767
12626
|
providerExecuted?: boolean | undefined;
|
|
12768
12627
|
providerMetadata?: _ai_sdk_provider.SharedV3ProviderMetadata | undefined;
|
|
12628
|
+
toolMetadata?: JSONObject | undefined;
|
|
12769
12629
|
dynamic?: boolean | undefined;
|
|
12770
12630
|
title?: string | undefined;
|
|
12771
12631
|
} | {
|
|
@@ -12778,6 +12638,7 @@ export declare const uiMessageChunkSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
12778
12638
|
output: unknown;
|
|
12779
12639
|
providerExecuted?: boolean | undefined;
|
|
12780
12640
|
providerMetadata?: _ai_sdk_provider.SharedV3ProviderMetadata | undefined;
|
|
12641
|
+
toolMetadata?: JSONObject | undefined;
|
|
12781
12642
|
dynamic?: boolean | undefined;
|
|
12782
12643
|
preliminary?: boolean | undefined;
|
|
12783
12644
|
} | {
|
|
@@ -12786,6 +12647,7 @@ export declare const uiMessageChunkSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
12786
12647
|
errorText: string;
|
|
12787
12648
|
providerExecuted?: boolean | undefined;
|
|
12788
12649
|
providerMetadata?: _ai_sdk_provider.SharedV3ProviderMetadata | undefined;
|
|
12650
|
+
toolMetadata?: JSONObject | undefined;
|
|
12789
12651
|
dynamic?: boolean | undefined;
|
|
12790
12652
|
} | {
|
|
12791
12653
|
type: "tool-output-denied";
|
|
@@ -13024,6 +12886,7 @@ export declare type UIToolInvocation<TOOL extends UITool | Tool> = {
|
|
|
13024
12886
|
*/
|
|
13025
12887
|
toolCallId: string;
|
|
13026
12888
|
title?: string;
|
|
12889
|
+
toolMetadata?: JSONObject;
|
|
13027
12890
|
/**
|
|
13028
12891
|
* Whether the tool call was executed by the provider.
|
|
13029
12892
|
*/
|
|
@@ -13660,5 +13523,5 @@ export declare function zodSchema<OBJECT>(zodSchema: z4.core.$ZodType<OBJECT, an
|
|
|
13660
13523
|
}): Schema<OBJECT>;
|
|
13661
13524
|
|
|
13662
13525
|
export { }
|
|
13663
|
-
export { GatewayProviderSettings as GatewayProviderSettings, GatewayProvider as GatewayProvider, LazySchema as LazySchema, ZodSchema as ZodSchema, StandardSchema as StandardSchema, ValidationResult as ValidationResult, ParseResult as ParseResult, ProviderOptions as ProviderOptions, ReasoningPart as ReasoningPart, ToolOutputProperties as ToolOutputProperties,
|
|
13526
|
+
export { GatewayProviderSettings as GatewayProviderSettings, GatewayProvider as GatewayProvider, LazySchema as LazySchema, ZodSchema as ZodSchema, StandardSchema as StandardSchema, ValidationResult as ValidationResult, ParseResult as ParseResult, ProviderOptions as ProviderOptions, ReasoningPart as ReasoningPart, ToolOutputProperties as ToolOutputProperties, ToolResultOutput as ToolResultOutput, ToolNeedsApprovalFunction as ToolNeedsApprovalFunction, TypeValidationContext as TypeValidationContext, EmbeddingModelV2 as EmbeddingModelV2, EmbeddingModelV3Embedding as EmbeddingModelV3Embedding, EmbeddingModelV3Middleware as EmbeddingModelV3Middleware, ImageModelV2 as ImageModelV2, ImageModelV3ProviderMetadata as ImageModelV3ProviderMetadata, ImageModelV2ProviderMetadata as ImageModelV2ProviderMetadata, ImageModelV3Middleware as ImageModelV3Middleware, GlobalProviderModelId as GlobalProviderModelId, LanguageModelV2 as LanguageModelV2, SharedV3Warning as SharedV3Warning, LanguageModelV3Middleware as LanguageModelV3Middleware, SharedV3ProviderMetadata as SharedV3ProviderMetadata, SpeechModelV2 as SpeechModelV2, TranscriptionModelV2 as TranscriptionModelV2, ImageModelV3Usage as ImageModelV3Usage, DeepPartialInternal as DeepPartialInternal, AttributeValue as AttributeValue, Tracer as Tracer, BaseToolCall as BaseToolCall, Source as Source, ResponseMessage as ResponseMessage, LanguageModelV3ToolCall as LanguageModelV3ToolCall, GenerateTextIncludeSettings as GenerateTextIncludeSettings, ValueOf as ValueOf, asUITool as asUITool, _ai_sdk_provider_utils as _ai_sdk_provider_utils, _ai_sdk_provider as _ai_sdk_provider, DataUIMessageChunk as DataUIMessageChunk, InferElementOutput as InferElementOutput, ConsumeStreamOptions as ConsumeStreamOptions, StreamTextIncludeSettings as StreamTextIncludeSettings, StreamTextOnAbortCallback as StreamTextOnAbortCallback, CallbackModelInfo as CallbackModelInfo, LanguageModelV3ToolChoice as LanguageModelV3ToolChoice, Listener as Listener, MaybePromiseLike as MaybePromiseLike, Output_2 as Output_2, InferAgentTools as InferAgentTools, UIMessageStreamResponseInit as UIMessageStreamResponseInit, getOriginalFetch as getOriginalFetch, InferUIMessageTools as InferUIMessageTools, InferUIMessageToolCall as InferUIMessageToolCall, UIDataTypesToSchemas as UIDataTypesToSchemas, InferUIMessageData as InferUIMessageData, InferUIMessageMetadata as InferUIMessageMetadata, Resolvable as Resolvable, FetchFunction as FetchFunction, SingleRequestTextStreamPart as SingleRequestTextStreamPart, RetryErrorReason as RetryErrorReason, GenerateImagePrompt as GenerateImagePrompt, JSONValue_2 as JSONValue_2, Job as Job, StreamObjectOnErrorCallback as StreamObjectOnErrorCallback, VideoModelResponseMetadata as VideoModelResponseMetadata, VideoModelProviderMetadata as VideoModelProviderMetadata, VideoModel as VideoModel, EmbeddingModelV3CallOptions as EmbeddingModelV3CallOptions, LanguageModelV3CallOptions as LanguageModelV3CallOptions, JSONObject as JSONObject, LanguageModelV3 as LanguageModelV3, EmbeddingModelV3 as EmbeddingModelV3, ImageModelV3 as ImageModelV3, TranscriptionModelV3 as TranscriptionModelV3, SpeechModelV3 as SpeechModelV3, RerankingModelV3 as RerankingModelV3, VideoModelV3 as VideoModelV3, ProviderV2 as ProviderV2, ExtractModelId as ExtractModelId, ExtractLiteralUnion as ExtractLiteralUnion, ProviderV3 as ProviderV3 };
|
|
13664
13527
|
export { schemaSymbol, symbol$1, symbol$1_2, symbol$2, symbol$2_2, symbol$3, symbol$3_2, symbol$4, symbol$4_2, symbol$5, symbol$5_2, symbol$6, symbol$6_2, symbol$7, symbol$7_2, symbol$8, symbol$8_2, symbol$9, symbol$9_2, symbol$a, symbol$a_2, symbol$b, symbol$b_2, symbol$c, symbol$c_2, symbol$d, symbol$d_2, symbol$e, symbol$f, symbol$g, symbol$h, symbol$i, symbol$j, symbol, symbol_2, symbol_3 };
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/** The Standard Typed interface. This is a base type extended by other specs. */
|
|
2
|
+
interface StandardTypedV1<Input = unknown, Output = Input> {
|
|
3
|
+
/** The Standard properties. */
|
|
4
|
+
readonly "~standard": StandardTypedV1.Props<Input, Output>;
|
|
5
|
+
}
|
|
6
|
+
declare namespace StandardTypedV1 {
|
|
7
|
+
/** The Standard Typed properties interface. */
|
|
8
|
+
interface Props<Input = unknown, Output = Input> {
|
|
9
|
+
/** The version number of the standard. */
|
|
10
|
+
readonly version: 1;
|
|
11
|
+
/** The vendor name of the schema library. */
|
|
12
|
+
readonly vendor: string;
|
|
13
|
+
/** Inferred types associated with the schema. */
|
|
14
|
+
readonly types?: Types<Input, Output> | undefined;
|
|
15
|
+
}
|
|
16
|
+
/** The Standard Typed types interface. */
|
|
17
|
+
interface Types<Input = unknown, Output = Input> {
|
|
18
|
+
/** The input type of the schema. */
|
|
19
|
+
readonly input: Input;
|
|
20
|
+
/** The output type of the schema. */
|
|
21
|
+
readonly output: Output;
|
|
22
|
+
}
|
|
23
|
+
/** Infers the input type of a Standard Typed. */
|
|
24
|
+
type InferInput<Schema extends StandardTypedV1> = NonNullable<Schema["~standard"]["types"]>["input"];
|
|
25
|
+
/** Infers the output type of a Standard Typed. */
|
|
26
|
+
type InferOutput<Schema extends StandardTypedV1> = NonNullable<Schema["~standard"]["types"]>["output"];
|
|
27
|
+
}
|
|
28
|
+
/** The Standard Schema interface. */
|
|
29
|
+
interface StandardSchemaV1<Input = unknown, Output = Input> {
|
|
30
|
+
/** The Standard Schema properties. */
|
|
31
|
+
readonly "~standard": StandardSchemaV1.Props<Input, Output>;
|
|
32
|
+
}
|
|
33
|
+
declare namespace StandardSchemaV1 {
|
|
34
|
+
/** The Standard Schema properties interface. */
|
|
35
|
+
interface Props<Input = unknown, Output = Input> extends StandardTypedV1.Props<Input, Output> {
|
|
36
|
+
/** Validates unknown input values. */
|
|
37
|
+
readonly validate: (value: unknown, options?: StandardSchemaV1.Options | undefined) => Result<Output> | Promise<Result<Output>>;
|
|
38
|
+
}
|
|
39
|
+
/** The result interface of the validate function. */
|
|
40
|
+
type Result<Output> = SuccessResult<Output> | FailureResult;
|
|
41
|
+
/** The result interface if validation succeeds. */
|
|
42
|
+
interface SuccessResult<Output> {
|
|
43
|
+
/** The typed output value. */
|
|
44
|
+
readonly value: Output;
|
|
45
|
+
/** A falsy value for `issues` indicates success. */
|
|
46
|
+
readonly issues?: undefined;
|
|
47
|
+
}
|
|
48
|
+
interface Options {
|
|
49
|
+
/** Explicit support for additional vendor-specific parameters, if needed. */
|
|
50
|
+
readonly libraryOptions?: Record<string, unknown> | undefined;
|
|
51
|
+
}
|
|
52
|
+
/** The result interface if validation fails. */
|
|
53
|
+
interface FailureResult {
|
|
54
|
+
/** The issues of failed validation. */
|
|
55
|
+
readonly issues: ReadonlyArray<Issue>;
|
|
56
|
+
}
|
|
57
|
+
/** The issue interface of the failure output. */
|
|
58
|
+
interface Issue {
|
|
59
|
+
/** The error message of the issue. */
|
|
60
|
+
readonly message: string;
|
|
61
|
+
/** The path of the issue, if any. */
|
|
62
|
+
readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;
|
|
63
|
+
}
|
|
64
|
+
/** The path segment interface of the issue. */
|
|
65
|
+
interface PathSegment {
|
|
66
|
+
/** The key representing a path segment. */
|
|
67
|
+
readonly key: PropertyKey;
|
|
68
|
+
}
|
|
69
|
+
/** The Standard types interface. */
|
|
70
|
+
interface Types<Input = unknown, Output = Input> extends StandardTypedV1.Types<Input, Output> {
|
|
71
|
+
}
|
|
72
|
+
/** Infers the input type of a Standard. */
|
|
73
|
+
type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;
|
|
74
|
+
/** Infers the output type of a Standard. */
|
|
75
|
+
type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
|
|
76
|
+
}
|
|
77
|
+
/** The Standard JSON Schema interface. */
|
|
78
|
+
interface StandardJSONSchemaV1<Input = unknown, Output = Input> {
|
|
79
|
+
/** The Standard JSON Schema properties. */
|
|
80
|
+
readonly "~standard": StandardJSONSchemaV1.Props<Input, Output>;
|
|
81
|
+
}
|
|
82
|
+
declare namespace StandardJSONSchemaV1 {
|
|
83
|
+
/** The Standard JSON Schema properties interface. */
|
|
84
|
+
interface Props<Input = unknown, Output = Input> extends StandardTypedV1.Props<Input, Output> {
|
|
85
|
+
/** Methods for generating the input/output JSON Schema. */
|
|
86
|
+
readonly jsonSchema: StandardJSONSchemaV1.Converter;
|
|
87
|
+
}
|
|
88
|
+
/** The Standard JSON Schema converter interface. */
|
|
89
|
+
interface Converter {
|
|
90
|
+
/** Converts the input type to JSON Schema. May throw if conversion is not supported. */
|
|
91
|
+
readonly input: (options: StandardJSONSchemaV1.Options) => Record<string, unknown>;
|
|
92
|
+
/** Converts the output type to JSON Schema. May throw if conversion is not supported. */
|
|
93
|
+
readonly output: (options: StandardJSONSchemaV1.Options) => Record<string, unknown>;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* The target version of the generated JSON Schema.
|
|
97
|
+
*
|
|
98
|
+
* It is *strongly recommended* that implementers support `"draft-2020-12"` and `"draft-07"`, as they are both in wide use. All other targets can be implemented on a best-effort basis. Libraries should throw if they don't support a specified target.
|
|
99
|
+
*
|
|
100
|
+
* The `"openapi-3.0"` target is intended as a standardized specifier for OpenAPI 3.0 which is a superset of JSON Schema `"draft-04"`.
|
|
101
|
+
*/
|
|
102
|
+
type Target = "draft-2020-12" | "draft-07" | "openapi-3.0" | ({} & string);
|
|
103
|
+
/** The options for the input/output methods. */
|
|
104
|
+
interface Options {
|
|
105
|
+
/** Specifies the target version of the generated JSON Schema. Support for all versions is on a best-effort basis. If a given version is not supported, the library should throw. */
|
|
106
|
+
readonly target: Target;
|
|
107
|
+
/** Explicit support for additional vendor-specific parameters, if needed. */
|
|
108
|
+
readonly libraryOptions?: Record<string, unknown> | undefined;
|
|
109
|
+
}
|
|
110
|
+
/** The Standard types interface. */
|
|
111
|
+
interface Types<Input = unknown, Output = Input> extends StandardTypedV1.Types<Input, Output> {
|
|
112
|
+
}
|
|
113
|
+
/** Infers the input type of a Standard. */
|
|
114
|
+
type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;
|
|
115
|
+
/** Infers the output type of a Standard. */
|
|
116
|
+
type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export { StandardJSONSchemaV1, StandardSchemaV1, StandardTypedV1 };
|