assistant-stream 0.3.14 → 0.3.16

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.
Files changed (238) hide show
  1. package/README.md +6 -4
  2. package/dist/core/AssistantStream.d.ts +50 -9
  3. package/dist/core/AssistantStream.d.ts.map +1 -1
  4. package/dist/core/AssistantStream.js +39 -15
  5. package/dist/core/AssistantStream.js.map +1 -1
  6. package/dist/core/AssistantStreamChunk.d.ts +84 -61
  7. package/dist/core/AssistantStreamChunk.d.ts.map +1 -1
  8. package/dist/core/AssistantStreamChunk.js +0 -2
  9. package/dist/core/accumulators/AssistantMessageStream.d.ts +15 -11
  10. package/dist/core/accumulators/AssistantMessageStream.d.ts.map +1 -1
  11. package/dist/core/accumulators/AssistantMessageStream.js +52 -48
  12. package/dist/core/accumulators/AssistantMessageStream.js.map +1 -1
  13. package/dist/core/accumulators/TimingTracker.d.ts +15 -11
  14. package/dist/core/accumulators/TimingTracker.d.ts.map +1 -1
  15. package/dist/core/accumulators/TimingTracker.js +36 -43
  16. package/dist/core/accumulators/TimingTracker.js.map +1 -1
  17. package/dist/core/accumulators/assistant-message-accumulator.d.ts +21 -11
  18. package/dist/core/accumulators/assistant-message-accumulator.d.ts.map +1 -1
  19. package/dist/core/accumulators/assistant-message-accumulator.js +349 -390
  20. package/dist/core/accumulators/assistant-message-accumulator.js.map +1 -1
  21. package/dist/core/converters/toGenericMessages.d.ts +49 -47
  22. package/dist/core/converters/toGenericMessages.d.ts.map +1 -1
  23. package/dist/core/converters/toGenericMessages.js +122 -136
  24. package/dist/core/converters/toGenericMessages.js.map +1 -1
  25. package/dist/core/modules/assistant-stream.d.ts +92 -28
  26. package/dist/core/modules/assistant-stream.d.ts.map +1 -1
  27. package/dist/core/modules/assistant-stream.js +177 -162
  28. package/dist/core/modules/assistant-stream.js.map +1 -1
  29. package/dist/core/modules/text.d.ts +11 -7
  30. package/dist/core/modules/text.d.ts.map +1 -1
  31. package/dist/core/modules/text.js +45 -45
  32. package/dist/core/modules/text.js.map +1 -1
  33. package/dist/core/modules/tool-call.d.ts +15 -11
  34. package/dist/core/modules/tool-call.d.ts.map +1 -1
  35. package/dist/core/modules/tool-call.js +81 -96
  36. package/dist/core/modules/tool-call.js.map +1 -1
  37. package/dist/core/object/ObjectStreamAccumulator.d.ts +13 -9
  38. package/dist/core/object/ObjectStreamAccumulator.d.ts.map +1 -1
  39. package/dist/core/object/ObjectStreamAccumulator.js +44 -52
  40. package/dist/core/object/ObjectStreamAccumulator.js.map +1 -1
  41. package/dist/core/object/ObjectStreamResponse.d.ts +12 -8
  42. package/dist/core/object/ObjectStreamResponse.d.ts.map +1 -1
  43. package/dist/core/object/ObjectStreamResponse.js +52 -71
  44. package/dist/core/object/ObjectStreamResponse.js.map +1 -1
  45. package/dist/core/object/createObjectStream.d.ts +14 -8
  46. package/dist/core/object/createObjectStream.d.ts.map +1 -1
  47. package/dist/core/object/createObjectStream.js +50 -47
  48. package/dist/core/object/createObjectStream.js.map +1 -1
  49. package/dist/core/object/types.d.ts +14 -11
  50. package/dist/core/object/types.d.ts.map +1 -1
  51. package/dist/core/object/types.js +0 -2
  52. package/dist/core/serialization/PlainText.d.ts +11 -7
  53. package/dist/core/serialization/PlainText.d.ts.map +1 -1
  54. package/dist/core/serialization/PlainText.js +40 -48
  55. package/dist/core/serialization/PlainText.js.map +1 -1
  56. package/dist/core/serialization/assistant-transport/AssistantTransport.d.ts +11 -7
  57. package/dist/core/serialization/assistant-transport/AssistantTransport.d.ts.map +1 -1
  58. package/dist/core/serialization/assistant-transport/AssistantTransport.js +102 -117
  59. package/dist/core/serialization/assistant-transport/AssistantTransport.js.map +1 -1
  60. package/dist/core/serialization/data-stream/DataStream.d.ts +11 -7
  61. package/dist/core/serialization/data-stream/DataStream.d.ts.map +1 -1
  62. package/dist/core/serialization/data-stream/DataStream.js +320 -371
  63. package/dist/core/serialization/data-stream/DataStream.js.map +1 -1
  64. package/dist/core/serialization/data-stream/chunk-types.d.ts +101 -100
  65. package/dist/core/serialization/data-stream/chunk-types.d.ts.map +1 -1
  66. package/dist/core/serialization/data-stream/chunk-types.js +27 -23
  67. package/dist/core/serialization/data-stream/chunk-types.js.map +1 -1
  68. package/dist/core/serialization/data-stream/serialization.d.ts +9 -5
  69. package/dist/core/serialization/data-stream/serialization.d.ts.map +1 -1
  70. package/dist/core/serialization/data-stream/serialization.js +23 -24
  71. package/dist/core/serialization/data-stream/serialization.js.map +1 -1
  72. package/dist/core/serialization/ui-message-stream/UIMessageStream.d.ts +15 -12
  73. package/dist/core/serialization/ui-message-stream/UIMessageStream.d.ts.map +1 -1
  74. package/dist/core/serialization/ui-message-stream/UIMessageStream.js +205 -228
  75. package/dist/core/serialization/ui-message-stream/UIMessageStream.js.map +1 -1
  76. package/dist/core/serialization/ui-message-stream/chunk-types.d.ts +68 -65
  77. package/dist/core/serialization/ui-message-stream/chunk-types.d.ts.map +1 -1
  78. package/dist/core/serialization/ui-message-stream/chunk-types.js +0 -2
  79. package/dist/core/tool/ToolCallReader.d.ts +34 -30
  80. package/dist/core/tool/ToolCallReader.d.ts.map +1 -1
  81. package/dist/core/tool/ToolCallReader.js +264 -317
  82. package/dist/core/tool/ToolCallReader.js.map +1 -1
  83. package/dist/core/tool/ToolExecutionStream.d.ts +20 -17
  84. package/dist/core/tool/ToolExecutionStream.d.ts.map +1 -1
  85. package/dist/core/tool/ToolExecutionStream.js +123 -146
  86. package/dist/core/tool/ToolExecutionStream.js.map +1 -1
  87. package/dist/core/tool/ToolResponse.d.ts +60 -19
  88. package/dist/core/tool/ToolResponse.d.ts.map +1 -1
  89. package/dist/core/tool/ToolResponse.js +51 -34
  90. package/dist/core/tool/ToolResponse.js.map +1 -1
  91. package/dist/core/tool/schema-utils.d.ts +19 -15
  92. package/dist/core/tool/schema-utils.d.ts.map +1 -1
  93. package/dist/core/tool/schema-utils.js +50 -84
  94. package/dist/core/tool/schema-utils.js.map +1 -1
  95. package/dist/core/tool/tool-types.d.ts +173 -92
  96. package/dist/core/tool/tool-types.d.ts.map +1 -1
  97. package/dist/core/tool/tool-types.js +0 -2
  98. package/dist/core/tool/toolResultStream.d.ts +24 -7
  99. package/dist/core/tool/toolResultStream.d.ts.map +1 -1
  100. package/dist/core/tool/toolResultStream.js +128 -145
  101. package/dist/core/tool/toolResultStream.js.map +1 -1
  102. package/dist/core/tool/type-path-utils.d.ts +8 -19
  103. package/dist/core/tool/type-path-utils.d.ts.map +1 -1
  104. package/dist/core/tool/type-path-utils.js +0 -2
  105. package/dist/core/utils/Counter.d.ts +6 -3
  106. package/dist/core/utils/Counter.d.ts.map +1 -1
  107. package/dist/core/utils/Counter.js +10 -6
  108. package/dist/core/utils/Counter.js.map +1 -1
  109. package/dist/core/utils/generateId.d.ts +4 -1
  110. package/dist/core/utils/generateId.d.ts.map +1 -1
  111. package/dist/core/utils/generateId.js +5 -1
  112. package/dist/core/utils/generateId.js.map +1 -1
  113. package/dist/core/utils/stream/AssistantMetaTransformStream.d.ts +15 -11
  114. package/dist/core/utils/stream/AssistantMetaTransformStream.d.ts.map +1 -1
  115. package/dist/core/utils/stream/AssistantMetaTransformStream.js +38 -42
  116. package/dist/core/utils/stream/AssistantMetaTransformStream.js.map +1 -1
  117. package/dist/core/utils/stream/AssistantTransformStream.d.ts +11 -8
  118. package/dist/core/utils/stream/AssistantTransformStream.d.ts.map +1 -1
  119. package/dist/core/utils/stream/AssistantTransformStream.js +37 -35
  120. package/dist/core/utils/stream/AssistantTransformStream.js.map +1 -1
  121. package/dist/core/utils/stream/LineDecoderStream.d.ts +6 -3
  122. package/dist/core/utils/stream/LineDecoderStream.d.ts.map +1 -1
  123. package/dist/core/utils/stream/LineDecoderStream.js +23 -26
  124. package/dist/core/utils/stream/LineDecoderStream.js.map +1 -1
  125. package/dist/core/utils/stream/PipeableTransformStream.d.ts +5 -2
  126. package/dist/core/utils/stream/PipeableTransformStream.d.ts.map +1 -1
  127. package/dist/core/utils/stream/PipeableTransformStream.js +14 -10
  128. package/dist/core/utils/stream/PipeableTransformStream.js.map +1 -1
  129. package/dist/core/utils/stream/SSE.d.ts +10 -6
  130. package/dist/core/utils/stream/SSE.d.ts.map +1 -1
  131. package/dist/core/utils/stream/SSE.js +79 -91
  132. package/dist/core/utils/stream/SSE.js.map +1 -1
  133. package/dist/core/utils/stream/UnderlyingReadable.d.ts +7 -4
  134. package/dist/core/utils/stream/UnderlyingReadable.d.ts.map +1 -1
  135. package/dist/core/utils/stream/UnderlyingReadable.js +0 -2
  136. package/dist/core/utils/stream/merge.d.ts +11 -7
  137. package/dist/core/utils/stream/merge.d.ts.map +1 -1
  138. package/dist/core/utils/stream/merge.js +68 -170
  139. package/dist/core/utils/stream/merge.js.map +1 -1
  140. package/dist/core/utils/stream/path-utils.d.ts +11 -7
  141. package/dist/core/utils/stream/path-utils.d.ts.map +1 -1
  142. package/dist/core/utils/stream/path-utils.js +46 -52
  143. package/dist/core/utils/stream/path-utils.js.map +1 -1
  144. package/dist/core/utils/types.d.ts +109 -113
  145. package/dist/core/utils/types.d.ts.map +1 -1
  146. package/dist/core/utils/types.js +0 -2
  147. package/dist/core/utils/withPromiseOrValue.d.ts +4 -1
  148. package/dist/core/utils/withPromiseOrValue.d.ts.map +1 -1
  149. package/dist/core/utils/withPromiseOrValue.js +12 -15
  150. package/dist/core/utils/withPromiseOrValue.js.map +1 -1
  151. package/dist/index.d.ts +23 -24
  152. package/dist/index.js +16 -16
  153. package/dist/node_modules/.pnpm/@types_json-schema@7.0.15/node_modules/@types/json-schema/index.d.ts +141 -0
  154. package/dist/node_modules/.pnpm/@types_json-schema@7.0.15/node_modules/@types/json-schema/index.d.ts.map +1 -0
  155. package/dist/resumable/ResumableStreamContext.d.ts +28 -24
  156. package/dist/resumable/ResumableStreamContext.d.ts.map +1 -1
  157. package/dist/resumable/ResumableStreamContext.js +99 -114
  158. package/dist/resumable/ResumableStreamContext.js.map +1 -1
  159. package/dist/resumable/constants.d.ts +4 -1
  160. package/dist/resumable/constants.d.ts.map +1 -1
  161. package/dist/resumable/constants.js +5 -1
  162. package/dist/resumable/constants.js.map +1 -1
  163. package/dist/resumable/createResumableAssistantStreamResponse.d.ts +22 -21
  164. package/dist/resumable/createResumableAssistantStreamResponse.d.ts.map +1 -1
  165. package/dist/resumable/createResumableAssistantStreamResponse.js +25 -32
  166. package/dist/resumable/createResumableAssistantStreamResponse.js.map +1 -1
  167. package/dist/resumable/errors.d.ts +8 -5
  168. package/dist/resumable/errors.d.ts.map +1 -1
  169. package/dist/resumable/errors.js +14 -12
  170. package/dist/resumable/errors.js.map +1 -1
  171. package/dist/resumable/index.d.ts +7 -7
  172. package/dist/resumable/index.js +5 -5
  173. package/dist/resumable/stores/InMemoryResumableStreamStore.d.ts +14 -10
  174. package/dist/resumable/stores/InMemoryResumableStreamStore.d.ts.map +1 -1
  175. package/dist/resumable/stores/InMemoryResumableStreamStore.js +159 -193
  176. package/dist/resumable/stores/InMemoryResumableStreamStore.js.map +1 -1
  177. package/dist/resumable/stores/ioredis.d.ts +9 -5
  178. package/dist/resumable/stores/ioredis.d.ts.map +1 -1
  179. package/dist/resumable/stores/ioredis.js +70 -82
  180. package/dist/resumable/stores/ioredis.js.map +1 -1
  181. package/dist/resumable/stores/redis-impl.d.ts +51 -48
  182. package/dist/resumable/stores/redis-impl.d.ts.map +1 -1
  183. package/dist/resumable/stores/redis-impl.js +176 -176
  184. package/dist/resumable/stores/redis-impl.js.map +1 -1
  185. package/dist/resumable/stores/redis.d.ts +31 -28
  186. package/dist/resumable/stores/redis.d.ts.map +1 -1
  187. package/dist/resumable/stores/redis.js +87 -95
  188. package/dist/resumable/stores/redis.js.map +1 -1
  189. package/dist/resumable/types.d.ts +29 -26
  190. package/dist/resumable/types.d.ts.map +1 -1
  191. package/dist/resumable/types.js +0 -2
  192. package/dist/utils/AsyncIterableStream.d.ts +5 -2
  193. package/dist/utils/AsyncIterableStream.d.ts.map +1 -1
  194. package/dist/utils/AsyncIterableStream.js +17 -16
  195. package/dist/utils/AsyncIterableStream.js.map +1 -1
  196. package/dist/utils/json/fix-json.d.ts +4 -1
  197. package/dist/utils/json/fix-json.d.ts.map +1 -1
  198. package/dist/utils/json/fix-json.js +286 -380
  199. package/dist/utils/json/fix-json.js.map +1 -1
  200. package/dist/utils/json/is-json.d.ts +8 -4
  201. package/dist/utils/json/is-json.d.ts.map +1 -1
  202. package/dist/utils/json/is-json.js +13 -21
  203. package/dist/utils/json/is-json.js.map +1 -1
  204. package/dist/utils/json/json-value.d.ts +7 -4
  205. package/dist/utils/json/json-value.d.ts.map +1 -1
  206. package/dist/utils/json/json-value.js +0 -2
  207. package/dist/utils/json/parse-partial-json-object.d.ts +11 -8
  208. package/dist/utils/json/parse-partial-json-object.d.ts.map +1 -1
  209. package/dist/utils/json/parse-partial-json-object.js +50 -62
  210. package/dist/utils/json/parse-partial-json-object.js.map +1 -1
  211. package/dist/utils/promiseWithResolvers.d.ts +7 -4
  212. package/dist/utils/promiseWithResolvers.d.ts.map +1 -1
  213. package/dist/utils/promiseWithResolvers.js +17 -10
  214. package/dist/utils/promiseWithResolvers.js.map +1 -1
  215. package/dist/utils.d.ts +6 -6
  216. package/dist/utils.js +5 -5
  217. package/package.json +5 -4
  218. package/src/core/AssistantStream.ts +37 -0
  219. package/src/core/AssistantStreamChunk.ts +30 -0
  220. package/src/core/modules/assistant-stream.ts +68 -0
  221. package/src/core/tool/ToolResponse.ts +45 -1
  222. package/src/core/tool/tool-types.ts +102 -2
  223. package/src/core/tool/toolResultStream.ts +15 -0
  224. package/dist/core/AssistantStreamChunk.js.map +0 -1
  225. package/dist/core/object/types.js.map +0 -1
  226. package/dist/core/serialization/ui-message-stream/chunk-types.js.map +0 -1
  227. package/dist/core/tool/tool-types.js.map +0 -1
  228. package/dist/core/tool/type-path-utils.js.map +0 -1
  229. package/dist/core/utils/stream/UnderlyingReadable.js.map +0 -1
  230. package/dist/core/utils/types.js.map +0 -1
  231. package/dist/index.d.ts.map +0 -1
  232. package/dist/index.js.map +0 -1
  233. package/dist/resumable/index.d.ts.map +0 -1
  234. package/dist/resumable/index.js.map +0 -1
  235. package/dist/resumable/types.js.map +0 -1
  236. package/dist/utils/json/json-value.js.map +0 -1
  237. package/dist/utils.d.ts.map +0 -1
  238. package/dist/utils.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"ToolResponse.js","sourceRoot":"","sources":["../../../src/core/tool/ToolResponse.ts"],"names":[],"mappings":"AAGA,MAAM,oBAAoB,GAAG,MAAM,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;AAU7D,MAAM,OAAO,YAAY;IACvB,IAAI,CAAC,oBAAoB,CAAC;QACxB,OAAO,IAAI,CAAC;IACd,CAAC;IAEQ,QAAQ,CAAqB;IAC7B,MAAM,CAAU;IAChB,OAAO,CAAU;IACjB,YAAY,CAAmC;IAC/C,QAAQ,CAAqB;IAEtC,YAAY,OAAkC;QAC5C,IAAI,OAAO,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;YACnC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;QACnC,CAAC;QACD,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAC7B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,KAAK,CAAC;QACxC,IAAI,OAAO,CAAC,YAAY,KAAK,SAAS,EAAE,CAAC;YACvC,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;QAC3C,CAAC;QACD,IAAI,OAAO,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;YACnC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;QACnC,CAAC;IACH,CAAC;IAED,MAAM,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CACzB,GAAY;QAEZ,OAAO,CACL,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI,IAAI,oBAAoB,IAAI,GAAG,CACvE,CAAC;IACJ,CAAC;IAED,MAAM,CAAC,UAAU,CAAC,MAA+B;QAC/C,IAAI,MAAM,YAAY,YAAY,EAAE,CAAC;YACnC,OAAO,MAAM,CAAC;QAChB,CAAC;QACD,OAAO,IAAI,YAAY,CAAC;YACtB,MAAM,EAAE,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM;SACtD,CAAC,CAAC;IACL,CAAC;CACF"}
1
+ {"version":3,"file":"ToolResponse.js","names":[],"sources":["../../../src/core/tool/ToolResponse.ts"],"sourcesContent":["import type { ReadonlyJSONValue } from \"../../utils/json/json-value\";\nimport type {\n ToolModelContentPart,\n ToolModelOutputFunction,\n} from \"./tool-types\";\n\nconst TOOL_RESPONSE_SYMBOL = Symbol.for(\"aui.tool-response\");\n\n/**\n * Shape accepted anywhere a {@link ToolResponse} can be returned.\n */\nexport type ToolResponseLike<TResult> = {\n /** UI-visible tool result value. */\n result: TResult;\n /**\n * Optional UI-only artifact associated with the result.\n *\n * Artifacts are useful for large or structured data that should be available\n * to renderers without necessarily being sent back to the model.\n */\n artifact?: ReadonlyJSONValue | undefined;\n /** Marks the tool result as an error result. */\n isError?: boolean | undefined;\n /**\n * Explicit model-visible content to send back after the tool call.\n *\n * When omitted, assistant-ui derives model output from `result` or a tool's\n * {@link ToolModelOutputFunction}.\n */\n modelContent?: readonly ToolModelContentPart[] | undefined;\n /** Optional provider-specific message payload associated with the tool result. */\n messages?: ReadonlyJSONValue | undefined;\n};\n\n/**\n * Tool result wrapper for separating UI-visible output from model-visible\n * output.\n *\n * Return `ToolResponse` from a tool when you need to attach an artifact, mark\n * the result as an error, or control the content sent back to the model.\n *\n * @example\n * ```ts\n * return new ToolResponse({\n * result: { title: \"Report ready\" },\n * artifact: { reportId },\n * modelContent: [{ type: \"text\", text: \"The report is ready.\" }],\n * });\n * ```\n */\nexport class ToolResponse<TResult> {\n get [TOOL_RESPONSE_SYMBOL]() {\n return true;\n }\n\n readonly artifact?: ReadonlyJSONValue;\n readonly result: TResult;\n readonly isError: boolean;\n readonly modelContent?: readonly ToolModelContentPart[];\n readonly messages?: ReadonlyJSONValue;\n\n constructor(options: ToolResponseLike<TResult>) {\n if (options.artifact !== undefined) {\n this.artifact = options.artifact;\n }\n this.result = options.result;\n this.isError = options.isError ?? false;\n if (options.modelContent !== undefined) {\n this.modelContent = options.modelContent;\n }\n if (options.messages !== undefined) {\n this.messages = options.messages;\n }\n }\n\n static [Symbol.hasInstance](\n obj: unknown,\n ): obj is ToolResponse<ReadonlyJSONValue> {\n return (\n typeof obj === \"object\" && obj !== null && TOOL_RESPONSE_SYMBOL in obj\n );\n }\n\n /**\n * Converts a plain tool return value into a {@link ToolResponse}.\n *\n * Existing `ToolResponse` instances are returned unchanged. `undefined`\n * becomes the string `\"<no result>\"` so downstream protocol chunks always\n * carry a concrete result.\n */\n static toResponse(result: any | ToolResponse<any>): ToolResponse<any> {\n if (result instanceof ToolResponse) {\n return result;\n }\n return new ToolResponse({\n result: result === undefined ? \"<no result>\" : result,\n });\n }\n}\n"],"mappings":";AAMA,MAAM,uBAAuB,OAAO,IAAI,mBAAmB;;;;;;;;;;;;;;;;;AA4C3D,IAAa,eAAb,MAAa,aAAsB;CACjC,KAAK,wBAAwB;EAC3B,OAAO;CACT;CAEA;CACA;CACA;CACA;CACA;CAEA,YAAY,SAAoC;EAC9C,IAAI,QAAQ,aAAa,KAAA,GACvB,KAAK,WAAW,QAAQ;EAE1B,KAAK,SAAS,QAAQ;EACtB,KAAK,UAAU,QAAQ,WAAW;EAClC,IAAI,QAAQ,iBAAiB,KAAA,GAC3B,KAAK,eAAe,QAAQ;EAE9B,IAAI,QAAQ,aAAa,KAAA,GACvB,KAAK,WAAW,QAAQ;CAE5B;CAEA,QAAQ,OAAO,aACb,KACwC;EACxC,OACE,OAAO,QAAQ,YAAY,QAAQ,QAAQ,wBAAwB;CAEvE;;;;;;;;CASA,OAAO,WAAW,QAAoD;EACpE,IAAI,kBAAkB,cACpB,OAAO;EAET,OAAO,IAAI,aAAa,EACtB,QAAQ,WAAW,KAAA,IAAY,gBAAgB,OACjD,CAAC;CACH;AACF"}
@@ -1,19 +1,21 @@
1
- import type { JSONSchema7 } from "json-schema";
2
- import type { StandardSchemaV1 } from "@standard-schema/spec";
3
- import type { Tool } from "./tool-types.js";
1
+ import { JSONSchema7 } from "../../node_modules/.pnpm/@types_json-schema@7.0.15/node_modules/@types/json-schema/index.js";
2
+ import { Tool } from "./tool-types.js";
3
+ import { StandardSchemaV1 } from "@standard-schema/spec";
4
+
5
+ //#region src/core/tool/schema-utils.d.ts
4
6
  /**
5
7
  * Type for a tool definition with JSON Schema parameters.
6
8
  */
7
- export type ToolJSONSchema = {
8
- description?: string;
9
- parameters: JSONSchema7;
9
+ type ToolJSONSchema = {
10
+ description?: string;
11
+ parameters: JSONSchema7;
10
12
  };
11
- export type ToToolsJSONSchemaOptions = {
12
- /**
13
- * Filter to determine which tools to include.
14
- * Defaults to excluding disabled tools and backend tools.
15
- */
16
- filter?: (name: string, tool: Tool) => boolean;
13
+ type ToToolsJSONSchemaOptions = {
14
+ /**
15
+ * Filter to determine which tools to include.
16
+ * Defaults to excluding disabled tools and backend tools.
17
+ */
18
+ filter?: (name: string, tool: Tool) => boolean;
17
19
  };
18
20
  /**
19
21
  * Converts a schema to JSONSchema7.
@@ -24,15 +26,17 @@ export type ToToolsJSONSchemaOptions = {
24
26
  * - Objects with toJSON() method
25
27
  * - Plain JSONSchema7 objects (must have a "type" property)
26
28
  */
27
- export declare function toJSONSchema(schema: StandardSchemaV1 | JSONSchema7): JSONSchema7;
29
+ declare function toJSONSchema(schema: StandardSchemaV1 | JSONSchema7): JSONSchema7;
28
30
  /**
29
31
  * Returns a copy of the JSON Schema with `required` removed recursively,
30
32
  * making every property optional. Array item schemas are left unchanged.
31
33
  */
32
- export declare function toPartialJSONSchema(schema: JSONSchema7): JSONSchema7;
34
+ declare function toPartialJSONSchema(schema: JSONSchema7): JSONSchema7;
33
35
  /**
34
36
  * Converts a record of tools to a record of tool definitions with JSON Schema parameters.
35
37
  * By default, filters out disabled tools and backend tools.
36
38
  */
37
- export declare function toToolsJSONSchema(tools: Record<string, Tool> | undefined, options?: ToToolsJSONSchemaOptions): Record<string, ToolJSONSchema>;
39
+ declare function toToolsJSONSchema(tools: Record<string, Tool> | undefined, options?: ToToolsJSONSchemaOptions): Record<string, ToolJSONSchema>;
40
+ //#endregion
41
+ export { ToToolsJSONSchemaOptions, ToolJSONSchema, toJSONSchema, toPartialJSONSchema, toToolsJSONSchema };
38
42
  //# sourceMappingURL=schema-utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"schema-utils.d.ts","sourceRoot":"","sources":["../../../src/core/tool/schema-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,KAAK,EAAE,IAAI,EAAE,wBAAqB;AAEzC;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,WAAW,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACrC;;;OAGG;IACH,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC;CAChD,CAAC;AAoCF;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,gBAAgB,GAAG,WAAW,GACrC,WAAW,CAyCb;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,WAAW,GAAG,WAAW,CAgBpE;AAMD;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,SAAS,EACvC,OAAO,GAAE,wBAA6B,GACrC,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAgBhC"}
1
+ {"version":3,"file":"schema-utils.d.ts","names":[],"sources":["../../../src/core/tool/schema-utils.ts"],"mappings":";;;;;;;AAOA;KAAY,cAAA;EACV,WAAA;EACA,UAAA,EAAY,WAAW;AAAA;AAAA,KAGb,wBAAA;EAHE;;AAAW;AAGzB;EAKE,MAAA,IAAU,IAAA,UAAc,IAAA,EAAM,IAAI;AAAA;;;;;;;AAAA;AA8CpC;;iBAAgB,YAAA,CACd,MAAA,EAAQ,gBAAA,GAAmB,WAAA,GAC1B,WAAA;;;;;iBA+Ca,mBAAA,CAAoB,MAAA,EAAQ,WAAA,GAAc,WAAW;;;;;iBA0BrD,iBAAA,CACd,KAAA,EAAO,MAAA,SAAe,IAAA,eACtB,OAAA,GAAS,wBAAA,GACR,MAAA,SAAe,cAAA"}
@@ -1,99 +1,65 @@
1
+ //#region src/core/tool/schema-utils.ts
1
2
  function isStandardSchema(schema) {
2
- return (typeof schema === "object" &&
3
- schema !== null &&
4
- "~standard" in schema &&
5
- typeof schema["~standard"] === "object");
3
+ return typeof schema === "object" && schema !== null && "~standard" in schema && typeof schema["~standard"] === "object";
6
4
  }
7
5
  function hasToJSONSchemaMethod(schema) {
8
- return (typeof schema === "object" &&
9
- schema !== null &&
10
- "toJSONSchema" in schema &&
11
- typeof schema.toJSONSchema === "function");
6
+ return typeof schema === "object" && schema !== null && "toJSONSchema" in schema && typeof schema.toJSONSchema === "function";
12
7
  }
13
8
  function hasToJSONMethod(schema) {
14
- return (typeof schema === "object" &&
15
- schema !== null &&
16
- "toJSON" in schema &&
17
- typeof schema.toJSON === "function");
9
+ return typeof schema === "object" && schema !== null && "toJSON" in schema && typeof schema.toJSON === "function";
18
10
  }
19
11
  /**
20
- * Converts a schema to JSONSchema7.
21
- * Supports:
22
- * - StandardSchemaV1 with ~standard.toJSONSchema (e.g., Zod v4)
23
- * - StandardSchemaV1 with ~standard.jsonSchema.input() (e.g., Zod v4)
24
- * - Objects with toJSONSchema() method (e.g., Zod v4)
25
- * - Objects with toJSON() method
26
- * - Plain JSONSchema7 objects (must have a "type" property)
27
- */
28
- export function toJSONSchema(schema) {
29
- // StandardSchemaV1 with ~standard.toJSONSchema (e.g., Zod v4)
30
- if (isStandardSchema(schema)) {
31
- const toJSONSchemaMethod = schema["~standard"].toJSONSchema;
32
- if (typeof toJSONSchemaMethod === "function") {
33
- return toJSONSchemaMethod();
34
- }
35
- // StandardSchemaV1 with ~standard.jsonSchema.input()
36
- const jsonSchema = schema["~standard"].jsonSchema;
37
- if (typeof jsonSchema === "object" &&
38
- jsonSchema !== null &&
39
- typeof jsonSchema.input === "function") {
40
- return jsonSchema.input();
41
- }
42
- }
43
- // toJSONSchema method on the schema itself
44
- if (hasToJSONSchemaMethod(schema)) {
45
- return schema.toJSONSchema();
46
- }
47
- // toJSON method on the schema
48
- if (hasToJSONMethod(schema)) {
49
- return schema.toJSON();
50
- }
51
- // If it's a Standard Schema that we couldn't convert, throw a helpful error
52
- if (isStandardSchema(schema)) {
53
- throw new Error("Could not convert schema to JSON Schema. " +
54
- "The schema implements Standard Schema but does not support JSON Schema conversion. " +
55
- "If you are using Zod, please upgrade to Zod v4 (npm install zod@latest). " +
56
- "Alternatively, pass a plain JSON Schema object instead.");
57
- }
58
- // Already a plain JSONSchema7
59
- return schema;
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;
60
31
  }
61
32
  /**
62
- * Returns a copy of the JSON Schema with `required` removed recursively,
63
- * making every property optional. Array item schemas are left unchanged.
64
- */
65
- export function toPartialJSONSchema(schema) {
66
- const { required: _, ...result } = schema;
67
- if (result.properties) {
68
- result.properties = Object.fromEntries(Object.entries(result.properties).map(([key, prop]) => {
69
- if (typeof prop === "object" && prop !== null && !Array.isArray(prop)) {
70
- const p = prop;
71
- return [key, p.properties != null ? toPartialJSONSchema(p) : prop];
72
- }
73
- return [key, prop];
74
- }));
75
- }
76
- return result;
33
+ * Returns a copy of the JSON Schema with `required` removed recursively,
34
+ * making every property optional. Array item schemas are left unchanged.
35
+ */
36
+ function toPartialJSONSchema(schema) {
37
+ const { required: _, ...result } = schema;
38
+ if (result.properties) result.properties = Object.fromEntries(Object.entries(result.properties).map(([key, prop]) => {
39
+ if (typeof prop === "object" && prop !== null && !Array.isArray(prop)) {
40
+ const p = prop;
41
+ return [key, p.properties != null ? toPartialJSONSchema(p) : prop];
42
+ }
43
+ return [key, prop];
44
+ }));
45
+ return result;
77
46
  }
78
47
  function defaultToolFilter(_name, tool) {
79
- return !tool.disabled && tool.type !== "backend";
48
+ return !tool.disabled && tool.type !== "backend";
80
49
  }
81
50
  /**
82
- * Converts a record of tools to a record of tool definitions with JSON Schema parameters.
83
- * By default, filters out disabled tools and backend tools.
84
- */
85
- export function toToolsJSONSchema(tools, options = {}) {
86
- if (!tools)
87
- return {};
88
- const filter = options.filter ?? defaultToolFilter;
89
- return Object.fromEntries(Object.entries(tools)
90
- .filter(([name, tool]) => filter(name, tool) && tool.parameters)
91
- .map(([name, tool]) => [
92
- name,
93
- {
94
- ...(tool.description && { description: tool.description }),
95
- parameters: toJSONSchema(tool.parameters),
96
- },
97
- ]));
51
+ * Converts a record of tools to a record of tool definitions with JSON Schema parameters.
52
+ * By default, filters out disabled tools and backend tools.
53
+ */
54
+ function toToolsJSONSchema(tools, options = {}) {
55
+ if (!tools) return {};
56
+ const filter = options.filter ?? defaultToolFilter;
57
+ return Object.fromEntries(Object.entries(tools).filter(([name, tool]) => filter(name, tool) && tool.parameters).map(([name, tool]) => [name, {
58
+ ...tool.description && { description: tool.description },
59
+ parameters: toJSONSchema(tool.parameters)
60
+ }]));
98
61
  }
62
+ //#endregion
63
+ export { toJSONSchema, toPartialJSONSchema, toToolsJSONSchema };
64
+
99
65
  //# sourceMappingURL=schema-utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"schema-utils.js","sourceRoot":"","sources":["../../../src/core/tool/schema-utils.ts"],"names":[],"mappings":"AAoBA,SAAS,gBAAgB,CAAC,MAAe;IAMvC,OAAO,CACL,OAAO,MAAM,KAAK,QAAQ;QAC1B,MAAM,KAAK,IAAI;QACf,WAAW,IAAI,MAAM;QACrB,OAAQ,MAA2B,CAAC,WAAW,CAAC,KAAK,QAAQ,CAC9D,CAAC;AACJ,CAAC;AAED,SAAS,qBAAqB,CAC5B,MAAe;IAEf,OAAO,CACL,OAAO,MAAM,KAAK,QAAQ;QAC1B,MAAM,KAAK,IAAI;QACf,cAAc,IAAI,MAAM;QACxB,OAAQ,MAAoC,CAAC,YAAY,KAAK,UAAU,CACzE,CAAC;AACJ,CAAC;AAED,SAAS,eAAe,CAAC,MAAe;IACtC,OAAO,CACL,OAAO,MAAM,KAAK,QAAQ;QAC1B,MAAM,KAAK,IAAI;QACf,QAAQ,IAAI,MAAM;QAClB,OAAQ,MAA8B,CAAC,MAAM,KAAK,UAAU,CAC7D,CAAC;AACJ,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,YAAY,CAC1B,MAAsC;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,UAAU,EAAE,YAAY,CAAC,IAAI,CAAC,UAAW,CAAC;SAC3C;KACF,CAAC,CACL,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"schema-utils.js","names":[],"sources":["../../../src/core/tool/schema-utils.ts"],"sourcesContent":["import type { JSONSchema7 } from \"json-schema\";\nimport type { StandardSchemaV1 } from \"@standard-schema/spec\";\nimport type { Tool } from \"./tool-types\";\n\n/**\n * Type for a tool definition with JSON Schema parameters.\n */\nexport type ToolJSONSchema = {\n description?: string;\n parameters: JSONSchema7;\n};\n\nexport type ToToolsJSONSchemaOptions = {\n /**\n * Filter to determine which tools to include.\n * Defaults to excluding disabled tools and backend tools.\n */\n filter?: (name: string, tool: Tool) => boolean;\n};\n\nfunction isStandardSchema(schema: unknown): schema is StandardSchemaV1 & {\n \"~standard\": StandardSchemaV1[\"~standard\"] & {\n toJSONSchema?: () => unknown;\n jsonSchema?: { input?: () => unknown; output?: () => unknown };\n };\n} {\n return (\n typeof schema === \"object\" &&\n schema !== null &&\n \"~standard\" in schema &&\n typeof (schema as StandardSchemaV1)[\"~standard\"] === \"object\"\n );\n}\n\nfunction hasToJSONSchemaMethod(\n schema: unknown,\n): schema is { toJSONSchema: () => unknown } {\n return (\n typeof schema === \"object\" &&\n schema !== null &&\n \"toJSONSchema\" in schema &&\n typeof (schema as { toJSONSchema: unknown }).toJSONSchema === \"function\"\n );\n}\n\nfunction hasToJSONMethod(schema: unknown): schema is { toJSON: () => unknown } {\n return (\n typeof schema === \"object\" &&\n schema !== null &&\n \"toJSON\" in schema &&\n typeof (schema as { toJSON: unknown }).toJSON === \"function\"\n );\n}\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 */\nexport function toJSONSchema(\n schema: StandardSchemaV1 | JSONSchema7,\n): JSONSchema7 {\n // StandardSchemaV1 with ~standard.toJSONSchema (e.g., Zod v4)\n if (isStandardSchema(schema)) {\n const toJSONSchemaMethod = schema[\"~standard\"].toJSONSchema;\n if (typeof toJSONSchemaMethod === \"function\") {\n return toJSONSchemaMethod() as JSONSchema7;\n }\n\n // StandardSchemaV1 with ~standard.jsonSchema.input()\n const jsonSchema = schema[\"~standard\"].jsonSchema;\n if (\n typeof jsonSchema === \"object\" &&\n jsonSchema !== null &&\n typeof jsonSchema.input === \"function\"\n ) {\n return jsonSchema.input() as JSONSchema7;\n }\n }\n\n // toJSONSchema method on the schema itself\n if (hasToJSONSchemaMethod(schema)) {\n return schema.toJSONSchema() as JSONSchema7;\n }\n\n // toJSON method on the schema\n if (hasToJSONMethod(schema)) {\n return schema.toJSON() as JSONSchema7;\n }\n\n // If it's a Standard Schema that we couldn't convert, throw a helpful error\n if (isStandardSchema(schema)) {\n throw new Error(\n \"Could not convert schema to JSON Schema. \" +\n \"The schema implements Standard Schema but does not support JSON Schema conversion. \" +\n \"If you are using Zod, please upgrade to Zod v4 (npm install zod@latest). \" +\n \"Alternatively, pass a plain JSON Schema object instead.\",\n );\n }\n\n // Already a plain JSONSchema7\n return schema as JSONSchema7;\n}\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 */\nexport function toPartialJSONSchema(schema: JSONSchema7): JSONSchema7 {\n const { required: _, ...result } = schema;\n\n if (result.properties) {\n result.properties = Object.fromEntries(\n Object.entries(result.properties).map(([key, prop]) => {\n if (typeof prop === \"object\" && prop !== null && !Array.isArray(prop)) {\n const p = prop as JSONSchema7;\n return [key, p.properties != null ? toPartialJSONSchema(p) : prop];\n }\n return [key, prop];\n }),\n );\n }\n\n return result;\n}\n\nfunction defaultToolFilter(_name: string, tool: Tool): boolean {\n return !tool.disabled && tool.type !== \"backend\";\n}\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 */\nexport function toToolsJSONSchema(\n tools: Record<string, Tool> | undefined,\n options: ToToolsJSONSchemaOptions = {},\n): Record<string, ToolJSONSchema> {\n if (!tools) return {};\n\n const filter = options.filter ?? defaultToolFilter;\n\n return Object.fromEntries(\n Object.entries(tools)\n .filter(([name, tool]) => filter(name, tool) && tool.parameters)\n .map(([name, tool]) => [\n name,\n {\n ...(tool.description && { description: tool.description }),\n parameters: toJSONSchema(tool.parameters!),\n },\n ]),\n );\n}\n"],"mappings":";AAoBA,SAAS,iBAAiB,QAKxB;CACA,OACE,OAAO,WAAW,YAClB,WAAW,QACX,eAAe,UACf,OAAQ,OAA4B,iBAAiB;AAEzD;AAEA,SAAS,sBACP,QAC2C;CAC3C,OACE,OAAO,WAAW,YAClB,WAAW,QACX,kBAAkB,UAClB,OAAQ,OAAqC,iBAAiB;AAElE;AAEA,SAAS,gBAAgB,QAAsD;CAC7E,OACE,OAAO,WAAW,YAClB,WAAW,QACX,YAAY,UACZ,OAAQ,OAA+B,WAAW;AAEtD;;;;;;;;;;AAWA,SAAgB,aACd,QACa;CAEb,IAAI,iBAAiB,MAAM,GAAG;EAC5B,MAAM,qBAAqB,OAAO,aAAa;EAC/C,IAAI,OAAO,uBAAuB,YAChC,OAAO,mBAAmB;EAI5B,MAAM,aAAa,OAAO,aAAa;EACvC,IACE,OAAO,eAAe,YACtB,eAAe,QACf,OAAO,WAAW,UAAU,YAE5B,OAAO,WAAW,MAAM;CAE5B;CAGA,IAAI,sBAAsB,MAAM,GAC9B,OAAO,OAAO,aAAa;CAI7B,IAAI,gBAAgB,MAAM,GACxB,OAAO,OAAO,OAAO;CAIvB,IAAI,iBAAiB,MAAM,GACzB,MAAM,IAAI,MACR,8PAIF;CAIF,OAAO;AACT;;;;;AAMA,SAAgB,oBAAoB,QAAkC;CACpE,MAAM,EAAE,UAAU,GAAG,GAAG,WAAW;CAEnC,IAAI,OAAO,YACT,OAAO,aAAa,OAAO,YACzB,OAAO,QAAQ,OAAO,UAAU,EAAE,KAAK,CAAC,KAAK,UAAU;EACrD,IAAI,OAAO,SAAS,YAAY,SAAS,QAAQ,CAAC,MAAM,QAAQ,IAAI,GAAG;GACrE,MAAM,IAAI;GACV,OAAO,CAAC,KAAK,EAAE,cAAc,OAAO,oBAAoB,CAAC,IAAI,IAAI;EACnE;EACA,OAAO,CAAC,KAAK,IAAI;CACnB,CAAC,CACH;CAGF,OAAO;AACT;AAEA,SAAS,kBAAkB,OAAe,MAAqB;CAC7D,OAAO,CAAC,KAAK,YAAY,KAAK,SAAS;AACzC;;;;;AAMA,SAAgB,kBACd,OACA,UAAoC,CAAC,GACL;CAChC,IAAI,CAAC,OAAO,OAAO,CAAC;CAEpB,MAAM,SAAS,QAAQ,UAAU;CAEjC,OAAO,OAAO,YACZ,OAAO,QAAQ,KAAK,EACjB,QAAQ,CAAC,MAAM,UAAU,OAAO,MAAM,IAAI,KAAK,KAAK,UAAU,EAC9D,KAAK,CAAC,MAAM,UAAU,CACrB,MACA;EACE,GAAI,KAAK,eAAe,EAAE,aAAa,KAAK,YAAY;EACxD,YAAY,aAAa,KAAK,UAAW;CAC3C,CACF,CAAC,CACL;AACF"}
@@ -1,21 +1,52 @@
1
- import type { JSONSchema7 } from "json-schema";
2
- import type { DeepPartial, TypeAtPath, TypePath } from "./type-path-utils.js";
3
- import type { AsyncIterableStream } from "../../utils.js";
4
- import type { StandardSchemaV1 } from "@standard-schema/spec";
5
- import type { ToolResponse } from "./ToolResponse.js";
6
- export type ToolModelContentPart = {
7
- readonly type: "text";
8
- readonly text: string;
1
+ import { AsyncIterableStream } from "../../utils/AsyncIterableStream.js";
2
+ import { JSONSchema7 } from "../../node_modules/.pnpm/@types_json-schema@7.0.15/node_modules/@types/json-schema/index.js";
3
+ import { DeepPartial, TypeAtPath, TypePath } from "./type-path-utils.js";
4
+ import { ToolResponse } from "./ToolResponse.js";
5
+ import { StandardSchemaV1 } from "@standard-schema/spec";
6
+
7
+ //#region src/core/tool/tool-types.d.ts
8
+ type ToolModelContentPart = {
9
+ /** 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. */
10
+ readonly text: string;
9
11
  } | {
10
- readonly type: "file";
11
- readonly data: string;
12
- readonly mediaType: string;
13
- readonly filename?: string;
12
+ /** A file content part returned to the model after a tool call. */readonly type: "file";
13
+ /**
14
+ * File payload encoded as a provider-compatible string, commonly base64
15
+ * for binary data.
16
+ */
17
+ readonly data: string; /** MIME type for the file payload. */
18
+ readonly mediaType: string; /** Optional display filename for the file payload. */
19
+ readonly filename?: string;
14
20
  };
15
- export type ToolModelOutputFunction<TArgs, TResult> = (options: {
16
- toolCallId: string;
17
- input: TArgs;
18
- output: TResult;
21
+ /**
22
+ * Converts a tool's runtime result into content that is sent back to the
23
+ * model.
24
+ *
25
+ * Return this when the value shown in the UI or stored as the tool result
26
+ * should differ from the model-visible response. When omitted, the successful
27
+ * tool result is sent back to the model as-is. If a tool returns a
28
+ * `ToolResponse` with `modelContent`, that explicit content is used instead
29
+ * of calling this function.
30
+ *
31
+ * @example
32
+ * ```ts
33
+ * const toModelOutput: ToolModelOutputFunction<
34
+ * { documentId: string },
35
+ * { summary: string; pdfBase64: string }
36
+ * > = ({ output }) => [
37
+ * { type: "text", text: output.summary },
38
+ * {
39
+ * type: "file",
40
+ * data: output.pdfBase64,
41
+ * mediaType: "application/pdf",
42
+ * },
43
+ * ];
44
+ * ```
45
+ */
46
+ type ToolModelOutputFunction<TArgs, TResult> = (options: {
47
+ /** Stable identifier for the tool call being converted. */toolCallId: string; /** Arguments supplied by the model for this tool call. */
48
+ input: TArgs; /** Value returned by the tool's {@link ToolExecuteFunction}. */
49
+ output: TResult;
19
50
  }) => readonly ToolModelContentPart[] | Promise<readonly ToolModelContentPart[]>;
20
51
  /**
21
52
  * Interface for reading tool call arguments from a stream, which are
@@ -25,96 +56,146 @@ export type ToolModelOutputFunction<TArgs, TResult> = (options: {
25
56
  *
26
57
  * @template TArgs The type of arguments being read.
27
58
  */
28
- export interface ToolCallArgsReader<TArgs extends Record<string, unknown>> {
29
- /**
30
- * Returns a promise that will resolve to the value at the given path,
31
- * as soon as that path is generated by the LLM.
32
- *
33
- * @param fieldPath An array of object keys or array indices.
34
- */
35
- get<PathT extends TypePath<TArgs>>(...fieldPath: PathT): Promise<TypeAtPath<TArgs, PathT>>;
36
- /**
37
- * Returns a stream that will emit partial values at the given path,
38
- * as they are generated by the LLM.
39
- *
40
- * @param fieldPath An array of object keys or array indices.
41
- */
42
- streamValues<PathT extends TypePath<TArgs>>(...fieldPath: PathT): AsyncIterableStream<DeepPartial<TypeAtPath<TArgs, PathT>>>;
43
- /**
44
- * Returns a stream that will emit partial text at the given path,
45
- * as they are generated by the LLM.
46
- *
47
- * @param fieldPath An array of object keys or array indices.
48
- */
49
- streamText<PathT extends TypePath<TArgs>>(...fieldPath: PathT): TypeAtPath<TArgs, PathT> extends string & infer U ? AsyncIterableStream<U> : never;
50
- /**
51
- * Returns a stream that will emit complete items in the array
52
- * at the given path, as they are generated by the LLM.
53
- *
54
- * @param fieldPath An array of object keys or array indices.
55
- */
56
- forEach<PathT extends TypePath<TArgs>>(...fieldPath: PathT): TypeAtPath<TArgs, PathT> extends Array<infer U> ? AsyncIterableStream<U> : never;
59
+ interface ToolCallArgsReader<TArgs extends Record<string, unknown>> {
60
+ /**
61
+ * Returns a promise that will resolve to the value at the given path,
62
+ * as soon as that path is generated by the LLM.
63
+ *
64
+ * @param fieldPath An array of object keys or array indices.
65
+ */
66
+ get<PathT extends TypePath<TArgs>>(...fieldPath: PathT): Promise<TypeAtPath<TArgs, PathT>>;
67
+ /**
68
+ * Returns a stream that will emit partial values at the given path,
69
+ * as they are generated by the LLM.
70
+ *
71
+ * @param fieldPath An array of object keys or array indices.
72
+ */
73
+ streamValues<PathT extends TypePath<TArgs>>(...fieldPath: PathT): AsyncIterableStream<DeepPartial<TypeAtPath<TArgs, PathT>>>;
74
+ /**
75
+ * Returns a stream that will emit partial text at the given path,
76
+ * as they are generated by the LLM.
77
+ *
78
+ * @param fieldPath An array of object keys or array indices.
79
+ */
80
+ streamText<PathT extends TypePath<TArgs>>(...fieldPath: PathT): TypeAtPath<TArgs, PathT> extends string & infer U ? AsyncIterableStream<U> : never;
81
+ /**
82
+ * Returns a stream that will emit complete items in the array
83
+ * at the given path, as they are generated by the LLM.
84
+ *
85
+ * @param fieldPath An array of object keys or array indices.
86
+ */
87
+ forEach<PathT extends TypePath<TArgs>>(...fieldPath: PathT): TypeAtPath<TArgs, PathT> extends Array<infer U> ? AsyncIterableStream<U> : never;
57
88
  }
58
- export interface ToolCallResponseReader<TResult> {
59
- get: () => Promise<ToolResponse<TResult>>;
89
+ interface ToolCallResponseReader<TResult> {
90
+ get: () => Promise<ToolResponse<TResult>>;
60
91
  }
61
- export interface ToolCallReader<TArgs extends Record<string, unknown> = Record<string, unknown>, TResult = unknown> {
62
- args: ToolCallArgsReader<TArgs>;
63
- response: ToolCallResponseReader<TResult>;
64
- /**
65
- * @deprecated Deprecated. Use `response.get().result` instead.
66
- */
67
- result: {
68
- get: () => Promise<TResult>;
69
- };
92
+ interface ToolCallReader<TArgs extends Record<string, unknown> = Record<string, unknown>, TResult = unknown> {
93
+ args: ToolCallArgsReader<TArgs>;
94
+ response: ToolCallResponseReader<TResult>;
95
+ /**
96
+ * @deprecated Use {@link ToolCallReader.response} and read
97
+ * `response.get().result` instead.
98
+ */
99
+ result: {
100
+ get: () => Promise<TResult>;
101
+ };
70
102
  }
71
- export type ToolExecutionContext = {
72
- toolCallId: string;
73
- abortSignal: AbortSignal;
74
- human: (payload: unknown) => Promise<unknown>;
103
+ type ToolExecutionContext = {
104
+ /** Stable identifier for the tool call being executed. */toolCallId: string; /** Signal that is aborted when the current run is cancelled. */
105
+ abortSignal: AbortSignal;
106
+ /**
107
+ * From inside a frontend tool's execute function, request human input from
108
+ * the UI. Resolves with the payload the UI supplies.
109
+ */
110
+ human: (payload: unknown) => Promise<unknown>;
75
111
  };
76
- export type ToolExecuteFunction<TArgs, TResult> = (args: TArgs, context: ToolExecutionContext) => TResult | Promise<TResult>;
77
- export type ToolStreamCallFunction<TArgs extends Record<string, unknown> = Record<string, unknown>, TResult = unknown> = (reader: ToolCallReader<TArgs, TResult>, context: ToolExecutionContext) => void;
112
+ /**
113
+ * Function called when assistant-ui executes a frontend tool.
114
+ */
115
+ type ToolExecuteFunction<TArgs, TResult> = (args: TArgs, context: ToolExecutionContext) => TResult | Promise<TResult>;
116
+ type ToolStreamCallFunction<TArgs extends Record<string, unknown> = Record<string, unknown>, TResult = unknown> = (reader: ToolCallReader<TArgs, TResult>, context: ToolExecutionContext) => void;
78
117
  type OnSchemaValidationErrorFunction<TResult> = ToolExecuteFunction<unknown, TResult>;
79
118
  type ToolBase<TArgs extends Record<string, unknown> = Record<string, unknown>, TResult = unknown> = {
80
- /**
81
- * @deprecated Experimental, API may change.
82
- */
83
- streamCall?: ToolStreamCallFunction<TArgs, TResult>;
119
+ /**
120
+ * @deprecated Experimental, API may change.
121
+ */
122
+ streamCall?: ToolStreamCallFunction<TArgs, TResult>;
84
123
  };
85
124
  type BackendTool<TArgs extends Record<string, unknown> = Record<string, unknown>, TResult = unknown> = ToolBase<TArgs, TResult> & {
86
- type: "backend";
87
- description?: undefined;
88
- parameters?: undefined;
89
- disabled?: undefined;
90
- execute?: undefined;
91
- toModelOutput?: undefined;
92
- experimental_onSchemaValidationError?: undefined;
125
+ /** Tool that is executed by the backend rather than in the browser. */type: "backend";
126
+ description?: undefined;
127
+ parameters?: undefined;
128
+ disabled?: undefined;
129
+ execute?: undefined;
130
+ toModelOutput?: undefined;
131
+ experimental_onSchemaValidationError?: undefined;
93
132
  };
94
133
  type FrontendTool<TArgs extends Record<string, unknown> = Record<string, unknown>, TResult = unknown> = ToolBase<TArgs, TResult> & {
95
- type: "frontend";
96
- description?: string | undefined;
97
- parameters: StandardSchemaV1<TArgs> | JSONSchema7;
98
- disabled?: boolean;
99
- execute: ToolExecuteFunction<TArgs, TResult>;
100
- toModelOutput?: ToolModelOutputFunction<TArgs, TResult>;
101
- experimental_onSchemaValidationError?: OnSchemaValidationErrorFunction<TResult>;
134
+ /** Tool that is executed in the frontend runtime. */type: "frontend"; /** Natural-language description shown to the model when selecting tools. */
135
+ description?: string | undefined; /** Schema for the arguments the model must provide when calling the tool. */
136
+ parameters: StandardSchemaV1<TArgs> | JSONSchema7; /** Prevents the tool from being exposed to the model while true. */
137
+ disabled?: boolean; /** Executes the tool after the model provides valid arguments. */
138
+ execute: ToolExecuteFunction<TArgs, TResult>; /** Converts the execution result into model-visible output. */
139
+ toModelOutput?: ToolModelOutputFunction<TArgs, TResult>; /** Handles invalid tool arguments when schema validation fails. */
140
+ experimental_onSchemaValidationError?: OnSchemaValidationErrorFunction<TResult>;
102
141
  };
103
142
  type HumanTool<TArgs extends Record<string, unknown> = Record<string, unknown>, TResult = unknown> = ToolBase<TArgs, TResult> & {
104
- type: "human";
105
- description?: string | undefined;
106
- parameters: StandardSchemaV1<TArgs> | JSONSchema7;
107
- disabled?: boolean;
108
- execute?: undefined;
109
- toModelOutput?: undefined;
110
- experimental_onSchemaValidationError?: undefined;
143
+ /** Tool that pauses the run until a user or UI supplies a result. */type: "human"; /** Natural-language description shown to the model when selecting tools. */
144
+ description?: string | undefined; /** Schema for the arguments the model must provide when requesting input. */
145
+ parameters: StandardSchemaV1<TArgs> | JSONSchema7; /** Prevents the tool from being exposed to the model while true. */
146
+ disabled?: boolean;
147
+ execute?: undefined;
148
+ toModelOutput?: undefined;
149
+ experimental_onSchemaValidationError?: undefined;
111
150
  };
112
- export type Tool<TArgs extends Record<string, unknown> = Record<string, unknown>, TResult = unknown> = FrontendTool<TArgs, TResult> | BackendTool<TArgs, TResult> | HumanTool<TArgs, TResult> | ToolWithoutType<TArgs, TResult>;
113
151
  /**
114
- * @deprecated Use `Tool` with an explicit `type` field instead.
152
+ * Definition for a tool that can be exposed to the assistant model.
153
+ *
154
+ * Use `type: "frontend"` for tools executed in the browser, `type: "backend"`
155
+ * for tools handled by your server, and `type: "human"` for flows that pause
156
+ * until the UI supplies a result.
157
+ *
158
+ * @example
159
+ * ```ts
160
+ * const frontendTool: Tool<{ city: string }, string> = {
161
+ * type: "frontend",
162
+ * description: "Get the weather for a city.",
163
+ * parameters: {
164
+ * type: "object",
165
+ * properties: { city: { type: "string" } },
166
+ * required: ["city"],
167
+ * },
168
+ * execute: async ({ city }) => `Sunny in ${city}`,
169
+ * };
170
+ * ```
171
+ *
172
+ * @example
173
+ * ```ts
174
+ * const backendTool: Tool = {
175
+ * type: "backend",
176
+ * };
177
+ * ```
178
+ *
179
+ * @example
180
+ * ```ts
181
+ * const humanTool: Tool<{ question: string }, string> = {
182
+ * type: "human",
183
+ * description: "Ask the user a follow-up question.",
184
+ * parameters: {
185
+ * type: "object",
186
+ * properties: { question: { type: "string" } },
187
+ * required: ["question"],
188
+ * },
189
+ * };
190
+ * ```
191
+ */
192
+ type Tool<TArgs extends Record<string, unknown> = Record<string, unknown>, TResult = unknown> = FrontendTool<TArgs, TResult> | BackendTool<TArgs, TResult> | HumanTool<TArgs, TResult> | ToolWithoutType<TArgs, TResult>;
193
+ /**
194
+ * @deprecated Use {@link Tool} with an explicit `type` field instead.
115
195
  */
116
- export type ToolWithoutType<TArgs extends Record<string, unknown> = Record<string, unknown>, TResult = unknown> = (Omit<FrontendTool<TArgs, TResult>, "type"> | Omit<BackendTool<TArgs, TResult>, "type"> | Omit<HumanTool<TArgs, TResult>, "type">) & {
117
- type?: undefined;
196
+ type ToolWithoutType<TArgs extends Record<string, unknown> = Record<string, unknown>, TResult = unknown> = (Omit<FrontendTool<TArgs, TResult>, "type"> | Omit<BackendTool<TArgs, TResult>, "type"> | Omit<HumanTool<TArgs, TResult>, "type">) & {
197
+ type?: undefined;
118
198
  };
119
- export {};
199
+ //#endregion
200
+ export { Tool, ToolCallArgsReader, ToolCallReader, ToolCallResponseReader, ToolExecuteFunction, ToolExecutionContext, ToolModelContentPart, ToolModelOutputFunction, ToolStreamCallFunction, ToolWithoutType };
120
201
  //# sourceMappingURL=tool-types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tool-types.d.ts","sourceRoot":"","sources":["../../../src/core/tool/tool-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,6BAA0B;AAC3E,OAAO,KAAK,EAAE,mBAAmB,EAAE,uBAAoB;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,KAAK,EAAE,YAAY,EAAE,0BAAuB;AAEnD,MAAM,MAAM,oBAAoB,GAC5B;IACE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB,GACD;IACE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEN,MAAM,MAAM,uBAAuB,CAAC,KAAK,EAAE,OAAO,IAAI,CAAC,OAAO,EAAE;IAC9D,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,KAAK,CAAC;IACb,MAAM,EAAE,OAAO,CAAC;CACjB,KACG,SAAS,oBAAoB,EAAE,GAC/B,OAAO,CAAC,SAAS,oBAAoB,EAAE,CAAC,CAAC;AAE7C;;;;;;;GAOG;AACH,MAAM,WAAW,kBAAkB,CAAC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACvE;;;;;OAKG;IACH,GAAG,CAAC,KAAK,SAAS,QAAQ,CAAC,KAAK,CAAC,EAC/B,GAAG,SAAS,EAAE,KAAK,GAClB,OAAO,CAAC,UAAU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