@assistant-ui/react-ai-sdk 1.3.32 → 1.3.35
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/dist/client.d.ts +9 -0
- package/dist/client.js +8 -0
- package/dist/frontendTools.d.ts +1 -1
- package/dist/frontendTools.js.map +1 -1
- package/dist/generativeTools.d.ts +18 -4
- package/dist/generativeTools.d.ts.map +1 -1
- package/dist/generativeTools.js +14 -5
- package/dist/generativeTools.js.map +1 -1
- package/dist/index.d.ts +3 -4
- package/dist/index.js +3 -4
- package/dist/index.native.d.ts +9 -0
- package/dist/index.native.js +8 -0
- package/dist/injectQuoteContext.js.map +1 -1
- package/dist/mcp-stdio.node.d.ts +2 -0
- package/dist/mcp-stdio.node.js +2 -0
- package/dist/mcp-stdio.unsupported.d.ts +7 -0
- package/dist/mcp-stdio.unsupported.d.ts.map +1 -0
- package/dist/mcp-stdio.unsupported.js +11 -0
- package/dist/mcp-stdio.unsupported.js.map +1 -0
- package/dist/modelContentEnvelope.d.ts +2 -1
- package/dist/modelContentEnvelope.d.ts.map +1 -1
- package/dist/toolOutputConversion.d.ts +1 -1
- package/dist/ui/resumable.d.ts +2 -1
- package/dist/ui/resumable.d.ts.map +1 -1
- package/dist/ui/resumable.js +1 -1
- package/dist/ui/use-chat/AssistantChatTransport.js +2 -2
- package/dist/ui/use-chat/AssistantChatTransport.js.map +1 -1
- package/dist/ui/use-chat/useAISDKRuntime.d.ts +10 -0
- package/dist/ui/use-chat/useAISDKRuntime.d.ts.map +1 -1
- package/dist/ui/use-chat/useAISDKRuntime.js +13 -4
- package/dist/ui/use-chat/useAISDKRuntime.js.map +1 -1
- package/dist/ui/use-chat/useChatRuntime.d.ts +1 -0
- package/dist/ui/use-chat/useChatRuntime.d.ts.map +1 -1
- package/dist/ui/use-chat/useChatRuntime.js +3 -2
- package/dist/ui/use-chat/useChatRuntime.js.map +1 -1
- package/dist/ui/use-chat/useExternalHistory.d.ts +4 -1
- package/dist/ui/use-chat/useExternalHistory.d.ts.map +1 -1
- package/dist/ui/use-chat/useExternalHistory.js +25 -1
- package/dist/ui/use-chat/useExternalHistory.js.map +1 -1
- package/dist/ui/use-chat/useStreamingTiming.js +1 -1
- package/dist/ui/utils/convertMessage.d.ts +2 -2
- package/dist/ui/utils/convertMessage.d.ts.map +1 -1
- package/dist/ui/utils/convertMessage.js +5 -2
- package/dist/ui/utils/convertMessage.js.map +1 -1
- package/dist/ui/utils/sliceMessagesUntil.js.map +1 -1
- package/dist/ui/utils/toCreateMessage.js.map +1 -1
- package/dist/usage.js.map +1 -1
- package/package.json +28 -12
- package/src/client.ts +18 -0
- package/src/generativeTools.test.ts +29 -47
- package/src/generativeTools.ts +18 -4
- package/src/index.native.ts +3 -0
- package/src/index.ts +1 -16
- package/src/mcp-stdio.node.ts +1 -0
- package/src/mcp-stdio.unsupported.ts +12 -0
- package/src/ui/use-chat/useAISDKRuntime.test.ts +104 -1
- package/src/ui/use-chat/useAISDKRuntime.ts +31 -1
- package/src/ui/use-chat/useChatRuntime.ts +3 -0
- package/src/ui/use-chat/useExternalHistory.ts +30 -1
- package/src/ui/utils/convertMessage.test.ts +36 -5
- package/src/ui/utils/convertMessage.ts +9 -1
- package/dist/assistant-stream/dist/core/AssistantStream.d.ts +0 -1
- package/dist/assistant-stream/dist/core/AssistantStreamChunk.d.ts +0 -1
- package/dist/assistant-stream/dist/core/accumulators/AssistantMessageStream.d.ts +0 -1
- package/dist/assistant-stream/dist/core/accumulators/assistant-message-accumulator.d.ts +0 -1
- package/dist/assistant-stream/dist/core/modules/assistant-stream.d.ts +0 -1
- package/dist/assistant-stream/dist/core/modules/text.d.ts +0 -1
- package/dist/assistant-stream/dist/core/modules/tool-call.d.ts +0 -1
- package/dist/assistant-stream/dist/core/serialization/PlainText.d.ts +0 -1
- package/dist/assistant-stream/dist/core/serialization/assistant-transport/AssistantTransport.d.ts +0 -1
- package/dist/assistant-stream/dist/core/serialization/data-stream/DataStream.d.ts +0 -1
- package/dist/assistant-stream/dist/core/serialization/ui-message-stream/UIMessageStream.d.ts +0 -1
- package/dist/assistant-stream/dist/core/tool/ToolExecutionStream.d.ts +0 -1
- package/dist/assistant-stream/dist/core/tool/schema-utils.d.ts +0 -15
- package/dist/assistant-stream/dist/core/tool/schema-utils.d.ts.map +0 -1
- package/dist/assistant-stream/dist/core/tool/schema-utils.js +0 -59
- package/dist/assistant-stream/dist/core/tool/schema-utils.js.map +0 -1
- package/dist/assistant-stream/dist/core/tool/tool-types.d.ts +0 -69
- package/dist/assistant-stream/dist/core/tool/tool-types.d.ts.map +0 -1
- package/dist/assistant-stream/dist/core/tool/toolResultStream.d.ts +0 -1
- package/dist/assistant-stream/dist/core/utils/stream/AssistantMetaTransformStream.d.ts +0 -1
- package/dist/assistant-stream/dist/core/utils/stream/AssistantTransformStream.d.ts +0 -1
- package/dist/assistant-stream/dist/core/utils/types.d.ts +0 -1
- package/dist/assistant-stream/dist/index.d.ts +0 -2
- package/dist/assistant-stream/dist/node_modules/.pnpm/@types_json-schema@7.0.15/node_modules/@types/json-schema/index.d.ts +0 -140
- package/dist/assistant-stream/dist/node_modules/.pnpm/@types_json-schema@7.0.15/node_modules/@types/json-schema/index.d.ts.map +0 -1
- package/dist/assistant-stream/dist/resumable/createResumableAssistantStreamResponse.d.ts +0 -6
- package/dist/assistant-stream/dist/resumable/createResumableAssistantStreamResponse.d.ts.map +0 -1
- package/dist/assistant-stream/dist/resumable/createResumableAssistantStreamResponse.js +0 -6
- package/dist/assistant-stream/dist/resumable/createResumableAssistantStreamResponse.js.map +0 -1
- package/dist/assistant-stream/dist/resumable/index.d.ts +0 -1
- package/dist/assistant-stream/dist/utils/json/json-value.d.ts +0 -10
- package/dist/assistant-stream/dist/utils/json/json-value.d.ts.map +0 -1
- package/dist/assistant-stream/dist/utils.d.ts +0 -1
package/dist/assistant-stream/dist/core/serialization/ui-message-stream/UIMessageStream.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { JSONSchema7 } from "../../node_modules/.pnpm/@types_json-schema@7.0.15/node_modules/@types/json-schema/index.js";
|
|
2
|
-
import { ProviderOptions } from "./tool-types.js";
|
|
3
|
-
//#region ../assistant-stream/dist/core/tool/schema-utils.d.ts
|
|
4
|
-
//#region src/core/tool/schema-utils.d.ts
|
|
5
|
-
/**
|
|
6
|
-
* Type for a tool definition with JSON Schema parameters.
|
|
7
|
-
*/
|
|
8
|
-
type ToolJSONSchema = {
|
|
9
|
-
description?: string;
|
|
10
|
-
parameters: JSONSchema7;
|
|
11
|
-
providerOptions?: ProviderOptions;
|
|
12
|
-
};
|
|
13
|
-
//#endregion
|
|
14
|
-
export { ToolJSONSchema };
|
|
15
|
-
//# sourceMappingURL=schema-utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schema-utils.d.ts","names":["description","parameters","JSONSchema7","providerOptions","ProviderOptions","filter","name","Tool","tool","StandardSchemaV1","schema","Record","tools","ToToolsJSONSchemaOptions","options","ToolJSONSchema"],"sources":["../../../../../../assistant-stream/dist/core/tool/schema-utils.d.ts"],"mappings":";;;;AAEyD;;;AAAA,KAMpD,cAAA;EACHA,WAAAA;EACAC,UAAAA,EAAY,WAAA;EACZE,eAAAA,GAAkB,eAAe;AAAA"}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
//#region ../assistant-stream/dist/core/tool/schema-utils.js
|
|
2
|
-
function isStandardSchema(schema) {
|
|
3
|
-
return typeof schema === "object" && schema !== null && "~standard" in schema && typeof schema["~standard"] === "object";
|
|
4
|
-
}
|
|
5
|
-
function hasToJSONSchemaMethod(schema) {
|
|
6
|
-
return typeof schema === "object" && schema !== null && "toJSONSchema" in schema && typeof schema.toJSONSchema === "function";
|
|
7
|
-
}
|
|
8
|
-
function hasToJSONMethod(schema) {
|
|
9
|
-
return typeof schema === "object" && schema !== null && "toJSON" in schema && typeof schema.toJSON === "function";
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Converts a schema to JSONSchema7.
|
|
13
|
-
* Supports:
|
|
14
|
-
* - StandardSchemaV1 with ~standard.toJSONSchema (e.g., Zod v4)
|
|
15
|
-
* - StandardSchemaV1 with ~standard.jsonSchema.input() (e.g., Zod v4)
|
|
16
|
-
* - Objects with toJSONSchema() method (e.g., Zod v4)
|
|
17
|
-
* - Objects with toJSON() method
|
|
18
|
-
* - Plain JSONSchema7 objects (must have a "type" property)
|
|
19
|
-
*/
|
|
20
|
-
function toJSONSchema(schema) {
|
|
21
|
-
if (isStandardSchema(schema)) {
|
|
22
|
-
const toJSONSchemaMethod = schema["~standard"].toJSONSchema;
|
|
23
|
-
if (typeof toJSONSchemaMethod === "function") return toJSONSchemaMethod();
|
|
24
|
-
const jsonSchema = schema["~standard"].jsonSchema;
|
|
25
|
-
if (typeof jsonSchema === "object" && jsonSchema !== null && typeof jsonSchema.input === "function") return jsonSchema.input();
|
|
26
|
-
}
|
|
27
|
-
if (hasToJSONSchemaMethod(schema)) return schema.toJSONSchema();
|
|
28
|
-
if (hasToJSONMethod(schema)) return schema.toJSON();
|
|
29
|
-
if (isStandardSchema(schema)) throw new Error("Could not convert schema to JSON Schema. The schema implements Standard Schema but does not support JSON Schema conversion. If you are using Zod, please upgrade to Zod v4 (npm install zod@latest). Alternatively, pass a plain JSON Schema object instead.");
|
|
30
|
-
return schema;
|
|
31
|
-
}
|
|
32
|
-
function defaultToolFilter(_name, tool) {
|
|
33
|
-
return !tool.disabled && tool.type !== "backend" && (tool.type !== "frontend" || tool.execute !== void 0);
|
|
34
|
-
}
|
|
35
|
-
function toolHasUploadableParameters(tool) {
|
|
36
|
-
return tool.parameters !== void 0 && !tool.unstable_backendDefault?.parameters;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Converts a record of tools to a record of tool definitions with JSON Schema parameters.
|
|
40
|
-
* By default, filters out disabled tools and backend tools.
|
|
41
|
-
*
|
|
42
|
-
* Entries are emitted in alphabetical order so the resulting request body is
|
|
43
|
-
* byte-identical regardless of the order in which tools were registered. This
|
|
44
|
-
* keeps provider prompt caches stable across renders that mount tools in
|
|
45
|
-
* different orders.
|
|
46
|
-
*/
|
|
47
|
-
function toToolsJSONSchema(tools, options = {}) {
|
|
48
|
-
if (!tools) return {};
|
|
49
|
-
const filter = options.filter ?? defaultToolFilter;
|
|
50
|
-
return Object.fromEntries(Object.entries(tools).filter(([name, tool]) => filter(name, tool)).filter((entry) => toolHasUploadableParameters(entry[1])).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0).map(([name, tool]) => [name, {
|
|
51
|
-
...tool.description && { description: tool.description },
|
|
52
|
-
parameters: toJSONSchema(tool.parameters),
|
|
53
|
-
...tool.providerOptions && { providerOptions: tool.providerOptions }
|
|
54
|
-
}]));
|
|
55
|
-
}
|
|
56
|
-
//#endregion
|
|
57
|
-
export { toJSONSchema, toToolsJSONSchema };
|
|
58
|
-
|
|
59
|
-
//# sourceMappingURL=schema-utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schema-utils.js","names":[],"sources":["../../../../../../assistant-stream/dist/core/tool/schema-utils.js"],"sourcesContent":["//#region src/core/tool/schema-utils.ts\nfunction isStandardSchema(schema) {\n\treturn typeof schema === \"object\" && schema !== null && \"~standard\" in schema && typeof schema[\"~standard\"] === \"object\";\n}\nfunction hasToJSONSchemaMethod(schema) {\n\treturn typeof schema === \"object\" && schema !== null && \"toJSONSchema\" in schema && typeof schema.toJSONSchema === \"function\";\n}\nfunction hasToJSONMethod(schema) {\n\treturn typeof schema === \"object\" && schema !== null && \"toJSON\" in schema && typeof schema.toJSON === \"function\";\n}\n/**\n* Converts a schema to JSONSchema7.\n* Supports:\n* - StandardSchemaV1 with ~standard.toJSONSchema (e.g., Zod v4)\n* - StandardSchemaV1 with ~standard.jsonSchema.input() (e.g., Zod v4)\n* - Objects with toJSONSchema() method (e.g., Zod v4)\n* - Objects with toJSON() method\n* - Plain JSONSchema7 objects (must have a \"type\" property)\n*/\nfunction toJSONSchema(schema) {\n\tif (isStandardSchema(schema)) {\n\t\tconst toJSONSchemaMethod = schema[\"~standard\"].toJSONSchema;\n\t\tif (typeof toJSONSchemaMethod === \"function\") return toJSONSchemaMethod();\n\t\tconst jsonSchema = schema[\"~standard\"].jsonSchema;\n\t\tif (typeof jsonSchema === \"object\" && jsonSchema !== null && typeof jsonSchema.input === \"function\") return jsonSchema.input();\n\t}\n\tif (hasToJSONSchemaMethod(schema)) return schema.toJSONSchema();\n\tif (hasToJSONMethod(schema)) return schema.toJSON();\n\tif (isStandardSchema(schema)) throw new Error(\"Could not convert schema to JSON Schema. The schema implements Standard Schema but does not support JSON Schema conversion. If you are using Zod, please upgrade to Zod v4 (npm install zod@latest). Alternatively, pass a plain JSON Schema object instead.\");\n\treturn schema;\n}\n/**\n* Returns a copy of the JSON Schema with `required` removed recursively,\n* making every property optional. Array item schemas are left unchanged.\n*/\nfunction toPartialJSONSchema(schema) {\n\tconst { required: _, ...result } = schema;\n\tif (result.properties) result.properties = Object.fromEntries(Object.entries(result.properties).map(([key, prop]) => {\n\t\tif (typeof prop === \"object\" && prop !== null && !Array.isArray(prop)) {\n\t\t\tconst p = prop;\n\t\t\treturn [key, p.properties != null ? toPartialJSONSchema(p) : prop];\n\t\t}\n\t\treturn [key, prop];\n\t}));\n\treturn result;\n}\nfunction defaultToolFilter(_name, tool) {\n\treturn !tool.disabled && tool.type !== \"backend\" && (tool.type !== \"frontend\" || tool.execute !== void 0);\n}\nfunction toolHasUploadableParameters(tool) {\n\treturn tool.parameters !== void 0 && !tool.unstable_backendDefault?.parameters;\n}\n/**\n* Converts a record of tools to a record of tool definitions with JSON Schema parameters.\n* By default, filters out disabled tools and backend tools.\n*\n* Entries are emitted in alphabetical order so the resulting request body is\n* byte-identical regardless of the order in which tools were registered. This\n* keeps provider prompt caches stable across renders that mount tools in\n* different orders.\n*/\nfunction toToolsJSONSchema(tools, options = {}) {\n\tif (!tools) return {};\n\tconst filter = options.filter ?? defaultToolFilter;\n\treturn Object.fromEntries(Object.entries(tools).filter(([name, tool]) => filter(name, tool)).filter((entry) => toolHasUploadableParameters(entry[1])).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0).map(([name, tool]) => [name, {\n\t\t...tool.description && { description: tool.description },\n\t\tparameters: toJSONSchema(tool.parameters),\n\t\t...tool.providerOptions && { providerOptions: tool.providerOptions }\n\t}]));\n}\n//#endregion\nexport { toJSONSchema, toPartialJSONSchema, toToolsJSONSchema };\n\n//# sourceMappingURL=schema-utils.js.map"],"mappings":";AACA,SAAS,iBAAiB,QAAQ;CACjC,OAAO,OAAO,WAAW,YAAY,WAAW,QAAQ,eAAe,UAAU,OAAO,OAAO,iBAAiB;AACjH;AACA,SAAS,sBAAsB,QAAQ;CACtC,OAAO,OAAO,WAAW,YAAY,WAAW,QAAQ,kBAAkB,UAAU,OAAO,OAAO,iBAAiB;AACpH;AACA,SAAS,gBAAgB,QAAQ;CAChC,OAAO,OAAO,WAAW,YAAY,WAAW,QAAQ,YAAY,UAAU,OAAO,OAAO,WAAW;AACxG;;;;;;;;;;AAUA,SAAS,aAAa,QAAQ;CAC7B,IAAI,iBAAiB,MAAM,GAAG;EAC7B,MAAM,qBAAqB,OAAO,aAAa;EAC/C,IAAI,OAAO,uBAAuB,YAAY,OAAO,mBAAmB;EACxE,MAAM,aAAa,OAAO,aAAa;EACvC,IAAI,OAAO,eAAe,YAAY,eAAe,QAAQ,OAAO,WAAW,UAAU,YAAY,OAAO,WAAW,MAAM;CAC9H;CACA,IAAI,sBAAsB,MAAM,GAAG,OAAO,OAAO,aAAa;CAC9D,IAAI,gBAAgB,MAAM,GAAG,OAAO,OAAO,OAAO;CAClD,IAAI,iBAAiB,MAAM,GAAG,MAAM,IAAI,MAAM,8PAA8P;CAC5S,OAAO;AACR;AAgBA,SAAS,kBAAkB,OAAO,MAAM;CACvC,OAAO,CAAC,KAAK,YAAY,KAAK,SAAS,cAAc,KAAK,SAAS,cAAc,KAAK,YAAY,KAAK;AACxG;AACA,SAAS,4BAA4B,MAAM;CAC1C,OAAO,KAAK,eAAe,KAAK,KAAK,CAAC,KAAK,yBAAyB;AACrE;;;;;;;;;;AAUA,SAAS,kBAAkB,OAAO,UAAU,CAAC,GAAG;CAC/C,IAAI,CAAC,OAAO,OAAO,CAAC;CACpB,MAAM,SAAS,QAAQ,UAAU;CACjC,OAAO,OAAO,YAAY,OAAO,QAAQ,KAAK,EAAE,QAAQ,CAAC,MAAM,UAAU,OAAO,MAAM,IAAI,CAAC,EAAE,QAAQ,UAAU,4BAA4B,MAAM,EAAE,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,OAAO,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,CAAC,EAAE,KAAK,CAAC,MAAM,UAAU,CAAC,MAAM;EACjO,GAAG,KAAK,eAAe,EAAE,aAAa,KAAK,YAAY;EACvD,YAAY,aAAa,KAAK,UAAU;EACxC,GAAG,KAAK,mBAAmB,EAAE,iBAAiB,KAAK,gBAAgB;CACpE,CAAC,CAAC,CAAC;AACJ"}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
//#region ../assistant-stream/dist/core/tool/tool-types.d.ts
|
|
2
|
-
//#region src/core/tool/tool-types.d.ts
|
|
3
|
-
type ToolModelContentPart = {
|
|
4
|
-
/** A text content part returned to the model after a tool call. */readonly type: "text"; /** Text that should be included in the model-visible tool result. */
|
|
5
|
-
readonly text: string;
|
|
6
|
-
} | {
|
|
7
|
-
/** A file content part returned to the model after a tool call. */readonly type: "file";
|
|
8
|
-
/**
|
|
9
|
-
* File payload encoded as a provider-compatible string, commonly base64
|
|
10
|
-
* for binary data.
|
|
11
|
-
*/
|
|
12
|
-
readonly data: string; /** MIME type for the file payload. */
|
|
13
|
-
readonly mediaType: string; /** Optional display filename for the file payload. */
|
|
14
|
-
readonly filename?: string;
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* Converts a tool's runtime result into content that is sent back to the
|
|
18
|
-
* model.
|
|
19
|
-
*
|
|
20
|
-
* Return this when the value shown in the UI or stored as the tool result
|
|
21
|
-
* should differ from the model-visible response. When omitted, the successful
|
|
22
|
-
* tool result is sent back to the model as-is. If a tool returns a
|
|
23
|
-
* `ToolResponse` with `modelContent`, that explicit content is used instead
|
|
24
|
-
* of calling this function.
|
|
25
|
-
*
|
|
26
|
-
* @example
|
|
27
|
-
* ```ts
|
|
28
|
-
* const toModelOutput: ToolModelOutputFunction<
|
|
29
|
-
* { documentId: string },
|
|
30
|
-
* { summary: string; pdfBase64: string }
|
|
31
|
-
* > = ({ output }) => [
|
|
32
|
-
* { type: "text", text: output.summary },
|
|
33
|
-
* {
|
|
34
|
-
* type: "file",
|
|
35
|
-
* data: output.pdfBase64,
|
|
36
|
-
* mediaType: "application/pdf",
|
|
37
|
-
* },
|
|
38
|
-
* ];
|
|
39
|
-
* ```
|
|
40
|
-
*/
|
|
41
|
-
/**
|
|
42
|
-
* Per-provider metadata forwarded into the wire request body verbatim.
|
|
43
|
-
* assistant-ui does not interpret these values; downstream adapters (AI SDK,
|
|
44
|
-
* custom routes) pass them to the model provider as-is.
|
|
45
|
-
*
|
|
46
|
-
* The outer key is the provider name (`anthropic`, `openai`, ...); the inner
|
|
47
|
-
* object is whatever shape that provider's SDK expects under
|
|
48
|
-
* `tool.providerOptions[providerName]`. Use this to enable provider-specific
|
|
49
|
-
* tool behaviors such as Anthropic's `defer_loading`
|
|
50
|
-
* (`{ anthropic: { deferLoading: true } }`) without adding provider-aware
|
|
51
|
-
* code in assistant-ui.
|
|
52
|
-
*/
|
|
53
|
-
type ProviderOptions = Record<string, Record<string, unknown>>;
|
|
54
|
-
/**
|
|
55
|
-
* Controls how a tool call's UI is presented relative to the assistant's
|
|
56
|
-
* chain-of-thought trace.
|
|
57
|
-
*
|
|
58
|
-
* - `"inline"` — the tool call is part of the reasoning trace and is folded
|
|
59
|
-
* into the chain-of-thought grouping alongside other routine tool calls.
|
|
60
|
-
* - `"standalone"` — the tool call is surfaced on its own, outside the
|
|
61
|
-
* chain-of-thought grouping (e.g. a human-in-the-loop prompt, a generative
|
|
62
|
-
* UI surface, or an important action UI worth showing prominently).
|
|
63
|
-
*
|
|
64
|
-
* This is a client-side presentation hint only; it does not affect how the
|
|
65
|
-
* tool is exposed to or executed by the model.
|
|
66
|
-
*/
|
|
67
|
-
//#endregion
|
|
68
|
-
export { ProviderOptions, ToolModelContentPart };
|
|
69
|
-
//# sourceMappingURL=tool-types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tool-types.d.ts","names":["type","text","data","mediaType","filename","TArgs","TResult","toolCallId","input","output","options","ToolModelContentPart","Promise","Record","get","PathT","TypePath","fieldPath","TypeAtPath","streamValues","AsyncIterableStream","DeepPartial","streamText","U","forEach","Array","ToolResponse","args","ToolCallArgsReader","response","ToolCallResponseReader","result","abortSignal","AbortSignal","human","payload","ToolExecutionContext","context","ToolCallReader","reader","ToolExecuteFunction","streamCall","ToolStreamCallFunction","display","ToolDisplay","ToolBase","description","parameters","disabled","execute","toModelOutput","experimental_onSchemaValidationError","providerOptions","StandardSchemaV1","JSONSchema7","ToolModelOutputFunction","OnSchemaValidationErrorFunction","ProviderOptions","providerId","supportsDeferredResults","url","headers","redirect","command","env","cwd","server","McpServerConfig","FrontendTool","BackendTool","HumanTool","ProviderTool","McpTool","ToolWithoutType","BackendToolDeclaration","Omit"],"sources":["../../../../../../assistant-stream/dist/core/tool/tool-types.d.ts"],"mappings":";;KAOK,oBAAA;EAEMC,4EADmED,IAAAA,UACnEC;EAAAA,SAAAA,IAAAA;AAAAA;EAQAE,4EANmEH,IAAAA;EAOnEI;;AAAQ;AAkGiE;EAlGzEA,SAFAF,IAAAA,UAiHS;EAAA,SAhHTC,SAAAA,UAgHkB;EAAA,SA/GlBC,QAAAA;AAAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA+GN,eAAA,GAAkB,MAAM,SAAS,MAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
//#region ../assistant-stream/dist/node_modules/.pnpm/@types_json-schema@7.0.15/node_modules/@types/json-schema/index.d.ts
|
|
2
|
-
//#region ../../node_modules/.pnpm/@types+json-schema@7.0.15/node_modules/@types/json-schema/index.d.ts
|
|
3
|
-
// ==================================================================================================
|
|
4
|
-
// JSON Schema Draft 07
|
|
5
|
-
// ==================================================================================================
|
|
6
|
-
// https://tools.ietf.org/html/draft-handrews-json-schema-validation-01
|
|
7
|
-
// --------------------------------------------------------------------------------------------------
|
|
8
|
-
/**
|
|
9
|
-
* Primitive type
|
|
10
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.1.1
|
|
11
|
-
*/
|
|
12
|
-
type JSONSchema7TypeName = "string" //
|
|
13
|
-
| "number" | "integer" | "boolean" | "object" | "array" | "null";
|
|
14
|
-
/**
|
|
15
|
-
* Primitive type
|
|
16
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.1.1
|
|
17
|
-
*/
|
|
18
|
-
type JSONSchema7Type = string //
|
|
19
|
-
| number | boolean | JSONSchema7Object | JSONSchema7Array | null; // Workaround for infinite type recursion
|
|
20
|
-
interface JSONSchema7Object {
|
|
21
|
-
[key: string]: JSONSchema7Type;
|
|
22
|
-
} // Workaround for infinite type recursion
|
|
23
|
-
// https://github.com/Microsoft/TypeScript/issues/3496#issuecomment-128553540
|
|
24
|
-
interface JSONSchema7Array extends Array<JSONSchema7Type> {}
|
|
25
|
-
/**
|
|
26
|
-
* Meta schema
|
|
27
|
-
*
|
|
28
|
-
* Recommended values:
|
|
29
|
-
* - 'http://json-schema.org/schema#'
|
|
30
|
-
* - 'http://json-schema.org/hyper-schema#'
|
|
31
|
-
* - 'http://json-schema.org/draft-07/schema#'
|
|
32
|
-
* - 'http://json-schema.org/draft-07/hyper-schema#'
|
|
33
|
-
*
|
|
34
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-5
|
|
35
|
-
*/
|
|
36
|
-
type JSONSchema7Version = string;
|
|
37
|
-
/**
|
|
38
|
-
* JSON Schema v7
|
|
39
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01
|
|
40
|
-
*/
|
|
41
|
-
type JSONSchema7Definition = JSONSchema7 | boolean;
|
|
42
|
-
interface JSONSchema7 {
|
|
43
|
-
$id?: string | undefined;
|
|
44
|
-
$ref?: string | undefined;
|
|
45
|
-
$schema?: JSONSchema7Version | undefined;
|
|
46
|
-
$comment?: string | undefined;
|
|
47
|
-
/**
|
|
48
|
-
* @see https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-00#section-8.2.4
|
|
49
|
-
* @see https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-validation-00#appendix-A
|
|
50
|
-
*/
|
|
51
|
-
$defs?: {
|
|
52
|
-
[key: string]: JSONSchema7Definition;
|
|
53
|
-
} | undefined;
|
|
54
|
-
/**
|
|
55
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.1
|
|
56
|
-
*/
|
|
57
|
-
type?: JSONSchema7TypeName | JSONSchema7TypeName[] | undefined;
|
|
58
|
-
enum?: JSONSchema7Type[] | undefined;
|
|
59
|
-
const?: JSONSchema7Type | undefined;
|
|
60
|
-
/**
|
|
61
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.2
|
|
62
|
-
*/
|
|
63
|
-
multipleOf?: number | undefined;
|
|
64
|
-
maximum?: number | undefined;
|
|
65
|
-
exclusiveMaximum?: number | undefined;
|
|
66
|
-
minimum?: number | undefined;
|
|
67
|
-
exclusiveMinimum?: number | undefined;
|
|
68
|
-
/**
|
|
69
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.3
|
|
70
|
-
*/
|
|
71
|
-
maxLength?: number | undefined;
|
|
72
|
-
minLength?: number | undefined;
|
|
73
|
-
pattern?: string | undefined;
|
|
74
|
-
/**
|
|
75
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.4
|
|
76
|
-
*/
|
|
77
|
-
items?: JSONSchema7Definition | JSONSchema7Definition[] | undefined;
|
|
78
|
-
additionalItems?: JSONSchema7Definition | undefined;
|
|
79
|
-
maxItems?: number | undefined;
|
|
80
|
-
minItems?: number | undefined;
|
|
81
|
-
uniqueItems?: boolean | undefined;
|
|
82
|
-
contains?: JSONSchema7Definition | undefined;
|
|
83
|
-
/**
|
|
84
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.5
|
|
85
|
-
*/
|
|
86
|
-
maxProperties?: number | undefined;
|
|
87
|
-
minProperties?: number | undefined;
|
|
88
|
-
required?: string[] | undefined;
|
|
89
|
-
properties?: {
|
|
90
|
-
[key: string]: JSONSchema7Definition;
|
|
91
|
-
} | undefined;
|
|
92
|
-
patternProperties?: {
|
|
93
|
-
[key: string]: JSONSchema7Definition;
|
|
94
|
-
} | undefined;
|
|
95
|
-
additionalProperties?: JSONSchema7Definition | undefined;
|
|
96
|
-
dependencies?: {
|
|
97
|
-
[key: string]: JSONSchema7Definition | string[];
|
|
98
|
-
} | undefined;
|
|
99
|
-
propertyNames?: JSONSchema7Definition | undefined;
|
|
100
|
-
/**
|
|
101
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.6
|
|
102
|
-
*/
|
|
103
|
-
if?: JSONSchema7Definition | undefined;
|
|
104
|
-
then?: JSONSchema7Definition | undefined;
|
|
105
|
-
else?: JSONSchema7Definition | undefined;
|
|
106
|
-
/**
|
|
107
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.7
|
|
108
|
-
*/
|
|
109
|
-
allOf?: JSONSchema7Definition[] | undefined;
|
|
110
|
-
anyOf?: JSONSchema7Definition[] | undefined;
|
|
111
|
-
oneOf?: JSONSchema7Definition[] | undefined;
|
|
112
|
-
not?: JSONSchema7Definition | undefined;
|
|
113
|
-
/**
|
|
114
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-7
|
|
115
|
-
*/
|
|
116
|
-
format?: string | undefined;
|
|
117
|
-
/**
|
|
118
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-8
|
|
119
|
-
*/
|
|
120
|
-
contentMediaType?: string | undefined;
|
|
121
|
-
contentEncoding?: string | undefined;
|
|
122
|
-
/**
|
|
123
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-9
|
|
124
|
-
*/
|
|
125
|
-
definitions?: {
|
|
126
|
-
[key: string]: JSONSchema7Definition;
|
|
127
|
-
} | undefined;
|
|
128
|
-
/**
|
|
129
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-10
|
|
130
|
-
*/
|
|
131
|
-
title?: string | undefined;
|
|
132
|
-
description?: string | undefined;
|
|
133
|
-
default?: JSONSchema7Type | undefined;
|
|
134
|
-
readOnly?: boolean | undefined;
|
|
135
|
-
writeOnly?: boolean | undefined;
|
|
136
|
-
examples?: JSONSchema7Type | undefined;
|
|
137
|
-
} //#endregion
|
|
138
|
-
//#endregion
|
|
139
|
-
export { JSONSchema7 };
|
|
140
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":["JSONSchema7Object","JSONSchema7Array","key","JSONSchema7Type","Array","JSONSchema7","$id","$ref","$schema","JSONSchema7Version","$comment","$defs","JSONSchema7Definition","type","JSONSchema7TypeName","enum","const","multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","items","additionalItems","maxItems","minItems","uniqueItems","contains","maxProperties","minProperties","required","properties","patternProperties","additionalProperties","dependencies","propertyNames","if","then","else","allOf","anyOf","oneOf","not","format","contentMediaType","contentEncoding","definitions","title","description","default","readOnly","writeOnly","examples"],"sources":["../../../../../../../../../../assistant-stream/dist/node_modules/.pnpm/@types_json-schema@7.0.15/node_modules/@types/json-schema/index.d.ts"],"x_google_ignoreList":[0],"mappings":";;;;;;;AAUwB;;;;AAAA,KAAnB,mBAAA;AAAA;;;;AAU2B;KAJ3B,eAAA;AAAA,qBACgB,iBAAA,GAAoB,gBAAgB;AAAA,UAE/C,iBAAA;EAAA,CACPE,GAAAA,WAAc,eAAe;AAAA;AAAA;AAAA,UAItB,gBAAA,SAAyB,KAAK,CAAC,eAAA;AAYlB;AAAA;;;;AAKiB;AAAA;;;;;AALjB,KAAlB,kBAAA;;;;;KAKA,qBAAA,GAAwB,WAAW;AAAA,UAC9B,WAAA;EACRI,GAAAA;EACAC,IAAAA;EACAC,OAAAA,GAAU,kBAAA;EACVE,QAAAA;EAmDiB;;;;EA9CjBC,KAAAA;IAAAA,CACGT,GAAAA,WAAc,qBAAA;EAAA;EA2DT;;;EAtDRW,IAAAA,GAAO,mBAAA,GAAsB,mBAAA;EAC7BE,IAAAA,GAAO,eAAA;EACPC,KAAAA,GAAQ,eAAA;EA6EkB;;;EAzE1BC,UAAAA;EACAC,OAAAA;EACAC,gBAAAA;EACAC,OAAAA;EACAC,gBAAAA;EAfiBT;;;EAmBjBU,SAAAA;EACAC,SAAAA;EACAC,OAAAA;EAdAR;;;EAkBAS,KAAAA,GAAQ,qBAAA,GAAwB,qBAAA;EAChCC,eAAAA,GAAkB,qBAAA;EAClBC,QAAAA;EACAC,QAAAA;EACAC,WAAAA;EACAC,QAAAA,GAAW,qBAAA;EATXN;;;EAaAO,aAAAA;EACAC,aAAAA;EACAC,QAAAA;EACAC,UAAAA;IAAAA,CACGhC,GAAAA,WAAc,qBAAA;EAAA;EAEjBiC,iBAAAA;IAAAA,CACGjC,GAAAA,WAAc,qBAAA;EAAA;EAEjBkC,oBAAAA,GAAuB,qBAAA;EACvBC,YAAAA;IAAAA,CACGnC,GAAAA,WAAc,qBAAA;EAAA;EAEjBoC,aAAAA,GAAgB,qBAAA;EAPhBH;;;EAWAI,EAAAA,GAAK,qBAAA;EACLC,IAAAA,GAAO,qBAAA;EACPC,IAAAA,GAAO,qBAAA;EARJvC;;;EAYHwC,KAAAA,GAAQ,qBAAA;EACRC,KAAAA,GAAQ,qBAAA;EACRC,KAAAA,GAAQ,qBAAA;EACRC,GAAAA,GAAM,qBAAA;EARCjC;;;EAYPkC,MAAAA;EAPQlC;;;EAWRmC,gBAAAA;EACAC,eAAAA;EATAH;;;EAaAI,WAAAA;IAAAA,CACG/C,GAAAA,WAAc,qBAAA;EAAA;EAAdA;;;EAKHgD,KAAAA;EACAC,WAAAA;EACAC,OAAAA,GAAU,eAAA;EACVC,QAAAA;EACAC,SAAAA;EACAC,QAAAA,GAAW,eAAA;AAAA"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
//#region ../assistant-stream/dist/resumable/createResumableAssistantStreamResponse.d.ts
|
|
2
|
-
//#region src/resumable/createResumableAssistantStreamResponse.d.ts
|
|
3
|
-
declare const RESUMABLE_STREAM_ID_HEADER = "x-resumable-stream-id";
|
|
4
|
-
//#endregion
|
|
5
|
-
export { RESUMABLE_STREAM_ID_HEADER };
|
|
6
|
-
//# sourceMappingURL=createResumableAssistantStreamResponse.d.ts.map
|
package/dist/assistant-stream/dist/resumable/createResumableAssistantStreamResponse.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createResumableAssistantStreamResponse.d.ts","names":["context","ResumableStreamContext","streamId","callback","AssistantStreamController","controller","PromiseLike","encoder","AssistantStreamEncoder","headers","HeadersInit","CreateResumableAssistantStreamResponseOptions","options","Promise","Response","missingResponse","CreateResumeAssistantStreamResponseOptions"],"sources":["../../../../../assistant-stream/dist/resumable/createResumableAssistantStreamResponse.d.ts"],"mappings":";;cAKc,0BAAA"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
//#region ../assistant-stream/dist/resumable/createResumableAssistantStreamResponse.js
|
|
2
|
-
const RESUMABLE_STREAM_ID_HEADER = "x-resumable-stream-id";
|
|
3
|
-
//#endregion
|
|
4
|
-
export { RESUMABLE_STREAM_ID_HEADER };
|
|
5
|
-
|
|
6
|
-
//# sourceMappingURL=createResumableAssistantStreamResponse.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createResumableAssistantStreamResponse.js","names":[],"sources":["../../../../../assistant-stream/dist/resumable/createResumableAssistantStreamResponse.js"],"sourcesContent":["import { DataStreamEncoder } from \"../core/serialization/data-stream/DataStream.js\";\nimport { createAssistantStream } from \"../core/modules/assistant-stream.js\";\n//#region src/resumable/createResumableAssistantStreamResponse.ts\nconst RESUMABLE_STREAM_ID_HEADER = \"x-resumable-stream-id\";\nasync function createResumableAssistantStreamResponse(options) {\n\tconst encoder = (options.encoder ?? (() => new DataStreamEncoder()))();\n\tconst stream = await options.context.run(options.streamId, () => {\n\t\treturn createAssistantStream(options.callback).pipeThrough(encoder);\n\t});\n\treturn new Response(stream, { headers: mergeHeaders(encoder.headers, options.headers, options.streamId) });\n}\nasync function createResumeAssistantStreamResponse(options) {\n\tconst stream = await options.context.resume(options.streamId);\n\tif (!stream) return options.missingResponse?.() ?? defaultMissingResponse();\n\tconst encoder = (options.encoder ?? (() => new DataStreamEncoder()))();\n\treturn new Response(stream, { headers: mergeHeaders(encoder.headers, options.headers, options.streamId) });\n}\nfunction defaultMissingResponse() {\n\treturn new Response(JSON.stringify({ error: \"stream not found\" }), {\n\t\tstatus: 404,\n\t\theaders: { \"Content-Type\": \"application/json\" }\n\t});\n}\nfunction mergeHeaders(encoderHeaders, extra, streamId) {\n\tconst merged = new Headers(encoderHeaders ?? {});\n\tif (extra) for (const [key, value] of new Headers(extra)) merged.set(key, value);\n\tmerged.set(RESUMABLE_STREAM_ID_HEADER, streamId);\n\treturn merged;\n}\n//#endregion\nexport { RESUMABLE_STREAM_ID_HEADER, createResumableAssistantStreamResponse, createResumeAssistantStreamResponse };\n\n//# sourceMappingURL=createResumableAssistantStreamResponse.js.map"],"mappings":";AAGA,MAAM,6BAA6B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import { RESUMABLE_STREAM_ID_HEADER } from "./createResumableAssistantStreamResponse.js";
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
//#region ../assistant-stream/dist/utils/json/json-value.d.ts
|
|
2
|
-
//#region src/utils/json/json-value.d.ts
|
|
3
|
-
type ReadonlyJSONValue = null | string | number | boolean | ReadonlyJSONObject | ReadonlyJSONArray;
|
|
4
|
-
type ReadonlyJSONObject = {
|
|
5
|
-
readonly [key: string]: ReadonlyJSONValue;
|
|
6
|
-
};
|
|
7
|
-
type ReadonlyJSONArray = readonly ReadonlyJSONValue[]; //#endregion
|
|
8
|
-
//#endregion
|
|
9
|
-
export { ReadonlyJSONArray, ReadonlyJSONObject, ReadonlyJSONValue };
|
|
10
|
-
//# sourceMappingURL=json-value.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"json-value.d.ts","names":["ReadonlyJSONObject","ReadonlyJSONArray","key","ReadonlyJSONValue"],"sources":["../../../../../../assistant-stream/dist/utils/json/json-value.d.ts"],"mappings":";;KACK,iBAAA,sCAAuD,kBAAA,GAAqB,iBAAiB;AAAA,KAC7F,kBAAA;EAAA,UACOE,GAAAA,WAAc,iBAAiB;AAAA;AAAA,KAEtC,iBAAA,YAA6B,iBAAiB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import { ReadonlyJSONArray, ReadonlyJSONObject, ReadonlyJSONValue } from "./utils/json/json-value.js";
|