@assistant-ui/react 0.8.1 → 0.8.4
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/api/MessageRuntime.d.ts.map +1 -1
- package/dist/api/ThreadRuntime.d.ts.map +1 -1
- package/dist/api/ThreadRuntime.js +1 -2
- package/dist/api/ThreadRuntime.js.map +1 -1
- package/dist/api/ThreadRuntime.mjs +1 -2
- package/dist/api/ThreadRuntime.mjs.map +1 -1
- package/dist/cloud/AssistantCloudThreadHistoryAdapter.d.ts.map +1 -1
- package/dist/cloud/auiV0.d.ts +6 -0
- package/dist/cloud/auiV0.d.ts.map +1 -1
- package/dist/cloud/auiV0.js +2 -0
- package/dist/cloud/auiV0.js.map +1 -1
- package/dist/cloud/auiV0.mjs +2 -0
- package/dist/cloud/auiV0.mjs.map +1 -1
- package/dist/cloud/useCloudThreadListRuntime.d.ts.map +1 -1
- package/dist/context/ReadonlyStore.d.ts.map +1 -1
- package/dist/context/react/utils/ensureBinding.d.ts.map +1 -1
- package/dist/model-context/ModelContextTypes.d.ts.map +1 -1
- package/dist/model-context/makeAssistantTool.d.ts.map +1 -1
- package/dist/model-context/makeAssistantToolUI.d.ts.map +1 -1
- package/dist/model-context/makeAssistantVisible.d.ts.map +1 -1
- package/dist/model-context/useAssistantInstructions.d.ts.map +1 -1
- package/dist/model-context/useAssistantTool.d.ts.map +1 -1
- package/dist/model-context/useAssistantToolUI.d.ts.map +1 -1
- package/dist/model-context/useInlineRender.d.ts.map +1 -1
- package/dist/primitives/actionBar/ActionBarCopy.d.ts.map +1 -1
- package/dist/primitives/actionBar/useActionBarFloatStatus.d.ts.map +1 -1
- package/dist/primitives/composer/ComposerAddAttachment.d.ts.map +1 -1
- package/dist/primitives/composer/ComposerInput.d.ts.map +1 -1
- package/dist/primitives/composer/ComposerInput.js +1 -4
- package/dist/primitives/composer/ComposerInput.js.map +1 -1
- package/dist/primitives/composer/ComposerInput.mjs +1 -4
- package/dist/primitives/composer/ComposerInput.mjs.map +1 -1
- package/dist/primitives/message/MessageContent.d.ts +3 -2
- package/dist/primitives/message/MessageContent.d.ts.map +1 -1
- package/dist/primitives/message/MessageContent.js +5 -1
- package/dist/primitives/message/MessageContent.js.map +1 -1
- package/dist/primitives/message/MessageContent.mjs +5 -1
- package/dist/primitives/message/MessageContent.mjs.map +1 -1
- package/dist/primitives/thread/ThreadSuggestion.d.ts.map +1 -1
- package/dist/primitives/thread/useThreadViewportAutoScroll.d.ts.map +1 -1
- package/dist/runtimes/dangerous-in-browser/useDangerousInBrowserRuntime.d.ts.map +1 -1
- package/dist/runtimes/edge/converters/fromCoreMessage.d.ts.map +1 -1
- package/dist/runtimes/edge/converters/fromLanguageModelMessages.d.ts.map +1 -1
- package/dist/runtimes/edge/converters/fromLanguageModelTools.d.ts.map +1 -1
- package/dist/runtimes/edge/converters/toCoreMessages.d.ts.map +1 -1
- package/dist/runtimes/edge/converters/toCoreMessages.js +2 -1
- package/dist/runtimes/edge/converters/toCoreMessages.js.map +1 -1
- package/dist/runtimes/edge/converters/toCoreMessages.mjs +2 -1
- package/dist/runtimes/edge/converters/toCoreMessages.mjs.map +1 -1
- package/dist/runtimes/edge/converters/toLanguageModelMessages.d.ts.map +1 -1
- package/dist/runtimes/edge/converters/toLanguageModelMessages.js +2 -1
- package/dist/runtimes/edge/converters/toLanguageModelMessages.js.map +1 -1
- package/dist/runtimes/edge/converters/toLanguageModelMessages.mjs +2 -1
- package/dist/runtimes/edge/converters/toLanguageModelMessages.mjs.map +1 -1
- package/dist/runtimes/edge/converters/toLanguageModelTools.d.ts.map +1 -1
- package/dist/runtimes/edge/createEdgeRuntimeAPI.d.ts.map +1 -1
- package/dist/runtimes/edge/streams/AssistantStreamChunkType.d.ts +8 -1
- package/dist/runtimes/edge/streams/AssistantStreamChunkType.d.ts.map +1 -1
- package/dist/runtimes/edge/streams/AssistantStreamChunkType.js +1 -0
- package/dist/runtimes/edge/streams/AssistantStreamChunkType.js.map +1 -1
- package/dist/runtimes/edge/streams/AssistantStreamChunkType.mjs +1 -0
- package/dist/runtimes/edge/streams/AssistantStreamChunkType.mjs.map +1 -1
- package/dist/runtimes/edge/streams/assistantDecoderStream.d.ts.map +1 -1
- package/dist/runtimes/edge/streams/assistantDecoderStream.js +6 -0
- package/dist/runtimes/edge/streams/assistantDecoderStream.js.map +1 -1
- package/dist/runtimes/edge/streams/assistantDecoderStream.mjs +6 -0
- package/dist/runtimes/edge/streams/assistantDecoderStream.mjs.map +1 -1
- package/dist/runtimes/edge/streams/assistantEncoderStream.d.ts.map +1 -1
- package/dist/runtimes/edge/streams/assistantEncoderStream.js +6 -0
- package/dist/runtimes/edge/streams/assistantEncoderStream.js.map +1 -1
- package/dist/runtimes/edge/streams/assistantEncoderStream.mjs +6 -0
- package/dist/runtimes/edge/streams/assistantEncoderStream.mjs.map +1 -1
- package/dist/runtimes/edge/streams/runResultStream.d.ts.map +1 -1
- package/dist/runtimes/edge/streams/runResultStream.js +17 -0
- package/dist/runtimes/edge/streams/runResultStream.js.map +1 -1
- package/dist/runtimes/edge/streams/runResultStream.mjs +17 -0
- package/dist/runtimes/edge/streams/runResultStream.mjs.map +1 -1
- package/dist/runtimes/edge/streams/toolResultStream.d.ts +8 -0
- package/dist/runtimes/edge/streams/toolResultStream.d.ts.map +1 -1
- package/dist/runtimes/edge/streams/toolResultStream.js +1 -0
- package/dist/runtimes/edge/streams/toolResultStream.js.map +1 -1
- package/dist/runtimes/edge/streams/toolResultStream.mjs +1 -0
- package/dist/runtimes/edge/streams/toolResultStream.mjs.map +1 -1
- package/dist/runtimes/edge/useEdgeRuntime.d.ts.map +1 -1
- package/dist/runtimes/external-store/ExternalStoreThreadRuntimeCore.d.ts.map +1 -1
- package/dist/runtimes/external-store/ThreadMessageLike.d.ts +2 -2
- package/dist/runtimes/external-store/ThreadMessageLike.d.ts.map +1 -1
- package/dist/runtimes/external-store/ThreadMessageLike.js +2 -0
- package/dist/runtimes/external-store/ThreadMessageLike.js.map +1 -1
- package/dist/runtimes/external-store/ThreadMessageLike.mjs +2 -0
- package/dist/runtimes/external-store/ThreadMessageLike.mjs.map +1 -1
- package/dist/runtimes/external-store/auto-status.d.ts.map +1 -1
- package/dist/runtimes/external-store/createMessageConverter.d.ts.map +1 -1
- package/dist/runtimes/external-store/external-message-converter.d.ts.map +1 -1
- package/dist/runtimes/external-store/getExternalStoreMessage.d.ts.map +1 -1
- package/dist/runtimes/external-store/useExternalStoreRuntime.d.ts.map +1 -1
- package/dist/runtimes/local/ChatModelAdapter.d.ts +2 -2
- package/dist/runtimes/local/ChatModelAdapter.d.ts.map +1 -1
- package/dist/runtimes/local/ChatModelAdapter.js.map +1 -1
- package/dist/runtimes/local/LocalRuntimeOptions.d.ts.map +1 -1
- package/dist/runtimes/local/shouldContinue.d.ts.map +1 -1
- package/dist/runtimes/local/useLocalRuntime.d.ts.map +1 -1
- package/dist/runtimes/remote-thread-list/RemoteThreadListThreadListRuntimeCore.d.ts.map +1 -1
- package/dist/runtimes/remote-thread-list/adapter/cloud.d.ts.map +1 -1
- package/dist/runtimes/remote-thread-list/useRemoteThreadListRuntime.d.ts.map +1 -1
- package/dist/types/AssistantTypes.d.ts +9 -1
- package/dist/types/AssistantTypes.d.ts.map +1 -1
- package/dist/types/AssistantTypes.js.map +1 -1
- package/dist/types/ContentPartComponentTypes.d.ts +3 -1
- package/dist/types/ContentPartComponentTypes.d.ts.map +1 -1
- package/dist/types/ContentPartComponentTypes.js.map +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js.map +1 -1
- package/dist/utils/combined/createCombinedStore.d.ts.map +1 -1
- package/dist/utils/combined/useCombinedStore.d.ts.map +1 -1
- package/dist/utils/createActionButton.d.ts.map +1 -1
- package/dist/utils/getThreadMessageText.d.ts.map +1 -1
- package/dist/utils/hooks/useManagedRef.d.ts.map +1 -1
- package/dist/utils/hooks/useOnResizeContent.d.ts.map +1 -1
- package/dist/utils/hooks/useOnScrollToBottom.d.ts.map +1 -1
- package/dist/utils/idUtils.d.ts.map +1 -1
- package/dist/utils/json/parse-partial-json.d.ts.map +1 -1
- package/dist/utils/smooth/SmoothContext.d.ts.map +1 -1
- package/dist/utils/smooth/useSmooth.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/api/ThreadRuntime.ts +1 -2
- package/src/cloud/auiV0.ts +10 -0
- package/src/primitives/composer/ComposerInput.tsx +1 -4
- package/src/primitives/message/MessageContent.tsx +10 -2
- package/src/runtimes/edge/converters/toCoreMessages.ts +2 -1
- package/src/runtimes/edge/converters/toLanguageModelMessages.ts +3 -2
- package/src/runtimes/edge/streams/AssistantStreamChunkType.ts +7 -0
- package/src/runtimes/edge/streams/assistantDecoderStream.ts +7 -0
- package/src/runtimes/edge/streams/assistantEncoderStream.ts +7 -0
- package/src/runtimes/edge/streams/runResultStream.ts +25 -3
- package/src/runtimes/edge/streams/toolResultStream.ts +10 -0
- package/src/runtimes/external-store/ThreadMessageLike.tsx +10 -2
- package/src/runtimes/local/ChatModelAdapter.tsx +7 -1
- package/src/types/AssistantTypes.ts +11 -2
- package/src/types/ContentPartComponentTypes.tsx +4 -0
- package/src/types/index.ts +3 -0
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/runtimes/external-store/ThreadMessageLike.tsx"],"sourcesContent":["import { generateId } from \"../../internal\";\nimport {\n MessageStatus,\n TextContentPart,\n ImageContentPart,\n ThreadMessage,\n ThreadAssistantContentPart,\n ThreadAssistantMessage,\n ThreadUserContentPart,\n ThreadUserMessage,\n ThreadSystemMessage,\n CompleteAttachment,\n FileContentPart,\n Unstable_AudioContentPart,\n} from \"../../types\";\nimport {
|
1
|
+
{"version":3,"sources":["../../../src/runtimes/external-store/ThreadMessageLike.tsx"],"sourcesContent":["import { generateId } from \"../../internal\";\nimport {\n MessageStatus,\n TextContentPart,\n ImageContentPart,\n ThreadMessage,\n ThreadAssistantContentPart,\n ThreadAssistantMessage,\n ThreadUserContentPart,\n ThreadUserMessage,\n ThreadSystemMessage,\n CompleteAttachment,\n FileContentPart,\n Unstable_AudioContentPart,\n} from \"../../types\";\nimport {\n ReasoningContentPart,\n SourceContentPart,\n ThreadStep,\n} from \"../../types/AssistantTypes\";\nimport {\n ReadonlyJSONObject,\n ReadonlyJSONValue,\n} from \"../../utils/json/json-value\";\nimport { parsePartialJson } from \"../../utils/json/parse-partial-json\";\n\nexport type ThreadMessageLike = {\n readonly role: \"assistant\" | \"user\" | \"system\";\n readonly content:\n | string\n | readonly (\n | TextContentPart\n | ReasoningContentPart\n | SourceContentPart\n | ImageContentPart\n | FileContentPart\n | Unstable_AudioContentPart\n | {\n readonly type: \"tool-call\";\n readonly toolCallId?: string;\n readonly toolName: string;\n readonly args?: ReadonlyJSONObject;\n readonly argsText?: string;\n readonly result?: any | undefined;\n readonly isError?: boolean | undefined;\n }\n )[];\n readonly id?: string | undefined;\n readonly createdAt?: Date | undefined;\n readonly status?: MessageStatus | undefined;\n readonly attachments?: readonly CompleteAttachment[] | undefined;\n readonly metadata?:\n | {\n readonly unstable_annotations?:\n | readonly ReadonlyJSONValue[]\n | undefined;\n readonly unstable_data?: readonly ReadonlyJSONValue[] | undefined;\n readonly steps?: readonly ThreadStep[] | undefined;\n readonly custom?: Record<string, unknown> | undefined;\n }\n | undefined;\n};\n\nexport const fromThreadMessageLike = (\n like: ThreadMessageLike,\n fallbackId: string,\n fallbackStatus: MessageStatus,\n): ThreadMessage => {\n const { role, id, createdAt, attachments, status, metadata } = like;\n const common = {\n id: id ?? fallbackId,\n createdAt: createdAt ?? new Date(),\n };\n\n const content =\n typeof like.content === \"string\"\n ? [{ type: \"text\" as const, text: like.content }]\n : like.content;\n\n if (role !== \"user\" && attachments)\n throw new Error(\"attachments are only supported for user messages\");\n\n if (role !== \"assistant\" && status)\n throw new Error(\"status is only supported for assistant messages\");\n\n if (role !== \"assistant\" && metadata?.steps)\n throw new Error(\"metadata.steps is only supported for assistant messages\");\n\n switch (role) {\n case \"assistant\":\n return {\n ...common,\n role,\n content: content\n .map((part): ThreadAssistantContentPart | null => {\n const type = part.type;\n switch (type) {\n case \"text\":\n case \"reasoning\":\n if (part.text.trim().length === 0) return null;\n return part;\n\n case \"source\":\n return part;\n\n case \"tool-call\": {\n if (part.args) {\n return {\n ...part,\n toolCallId: part.toolCallId ?? \"tool-\" + generateId(),\n args: part.args,\n argsText: JSON.stringify(part.args),\n };\n }\n return {\n ...part,\n toolCallId: part.toolCallId ?? \"tool-\" + generateId(),\n args: part.args ?? parsePartialJson(part.argsText ?? \"{}\"),\n argsText: part.argsText ?? \"\",\n };\n }\n\n default: {\n const unhandledType: \"image\" | \"audio\" | \"file\" = type;\n throw new Error(\n `Unsupported assistant content part type: ${unhandledType}`,\n );\n }\n }\n })\n .filter((c) => !!c),\n status: status ?? fallbackStatus,\n metadata: {\n unstable_annotations: metadata?.unstable_annotations ?? [],\n unstable_data: metadata?.unstable_data ?? [],\n custom: metadata?.custom ?? {},\n steps: metadata?.steps ?? [],\n },\n } satisfies ThreadAssistantMessage;\n\n case \"user\":\n return {\n ...common,\n role,\n content: content.map((part): ThreadUserContentPart => {\n const type = part.type;\n switch (type) {\n case \"text\":\n case \"image\":\n case \"audio\":\n case \"file\":\n return part;\n\n default: {\n const unhandledType: \"tool-call\" | \"reasoning\" | \"source\" = type;\n throw new Error(\n `Unsupported user content part type: ${unhandledType}`,\n );\n }\n }\n }),\n attachments: attachments ?? [],\n metadata: {\n custom: metadata?.custom ?? {},\n },\n } satisfies ThreadUserMessage;\n\n case \"system\":\n if (content.length !== 1 || content[0]!.type !== \"text\")\n throw new Error(\n \"System messages must have exactly one text content part.\",\n );\n\n return {\n ...common,\n role,\n content: content as [TextContentPart],\n metadata: {\n custom: metadata?.custom ?? {},\n },\n } satisfies ThreadSystemMessage;\n\n default: {\n const unsupportedRole: never = role;\n throw new Error(`Unknown message role: ${unsupportedRole}`);\n }\n }\n};\n"],"mappings":";AAAA,SAAS,kBAAkB;AAwB3B,SAAS,wBA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sourceRoot":"","sources":["../../../src/runtimes/external-store/auto-status.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAQ5C,eAAO,MAAM,YAAY,
|
1
|
+
{"version":3,"file":"auto-status.d.ts","sourceRoot":"","sources":["../../../src/runtimes/external-store/auto-status.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAQ5C,eAAO,MAAM,YAAY,GAAI,QAAQ,aAAa,YACiB,CAAC;AAEpE,eAAO,MAAM,aAAa,GAAI,QAAQ,OAAO,EAAE,WAAW,OAAO;;;;;EACC,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"createMessageConverter.d.ts","sourceRoot":"","sources":["../../../src/runtimes/external-store/createMessageConverter.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EACL,2BAA2B,EAE5B,MAAM,8BAA8B,CAAC;AAGtC,eAAO,MAAM,sBAAsB,GAAI,CAAC,SAAS,MAAM,
|
1
|
+
{"version":3,"file":"createMessageConverter.d.ts","sourceRoot":"","sources":["../../../src/runtimes/external-store/createMessageConverter.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EACL,2BAA2B,EAE5B,MAAM,8BAA8B,CAAC;AAGtC,eAAO,MAAM,sBAAsB,GAAI,CAAC,SAAS,MAAM,EACrD,UAAU,2BAA2B,CAAC,QAAQ,CAAC,CAAC,CAAC;kCAGjB,CAAC,EAAE,aAAa,OAAO;iCAOxB,CAAC,EAAE;gCAIvB,WAAW,GAAG,aAAa,GAAG,aAAa,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC;+BAO9D,WAAW,GAAG,aAAa,GAAG,aAAa,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC;;;CAwB1E,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"external-message-converter.d.ts","sourceRoot":"","sources":["../../../src/runtimes/external-store/external-message-converter.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAyB,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAI/E,yBAAiB,2BAA2B,CAAC;IAC3C,KAAY,OAAO,GACf,CAAC,iBAAiB,GAAG;QACnB,QAAQ,CAAC,aAAa,CAAC,EAAE;YACvB,QAAQ,CAAC,YAAY,CAAC,EAAE,gBAAgB,GAAG,MAAM,CAAC;SACnD,CAAC;KACH,CAAC,GACF;QACE,IAAI,EAAE,MAAM,CAAC;QACb,UAAU,EAAE,MAAM,CAAC;QACnB,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAC9B,MAAM,EAAE,GAAG,CAAC;KACb,CAAC;IAEN,KAAY,QAAQ,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,KAAK,OAAO,GAAG,OAAO,EAAE,CAAC;CAC/D;AAqLD,eAAO,MAAM,uBAAuB,GAAI,CAAC,SAAS,OAAO,
|
1
|
+
{"version":3,"file":"external-message-converter.d.ts","sourceRoot":"","sources":["../../../src/runtimes/external-store/external-message-converter.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAyB,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAI/E,yBAAiB,2BAA2B,CAAC;IAC3C,KAAY,OAAO,GACf,CAAC,iBAAiB,GAAG;QACnB,QAAQ,CAAC,aAAa,CAAC,EAAE;YACvB,QAAQ,CAAC,YAAY,CAAC,EAAE,gBAAgB,GAAG,MAAM,CAAC;SACnD,CAAC;KACH,CAAC,GACF;QACE,IAAI,EAAE,MAAM,CAAC;QACb,UAAU,EAAE,MAAM,CAAC;QACnB,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAC9B,MAAM,EAAE,GAAG,CAAC;KACb,CAAC;IAEN,KAAY,QAAQ,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,KAAK,OAAO,GAAG,OAAO,EAAE,CAAC;CAC/D;AAqLD,eAAO,MAAM,uBAAuB,GAAI,CAAC,SAAS,OAAO,EACvD,UAAU,CAAC,EAAE,EACb,UAAU,2BAA2B,CAAC,QAAQ,CAAC,CAAC,CAAC,EACjD,WAAW,OAAO,oCAuBnB,CAAC;AAEF,eAAO,MAAM,2BAA2B,GAAI,CAAC,SAAS,OAAO,EAAE,kDAK5D;IACD,QAAQ,EAAE,2BAA2B,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAClD,QAAQ,EAAE,CAAC,EAAE,CAAC;IACd,SAAS,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,gBAAgB,GAAG,MAAM,GAAG,SAAS,CAAC;CACtD,oCA0EA,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getExternalStoreMessage.d.ts","sourceRoot":"","sources":["../../../src/runtimes/external-store/getExternalStoreMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,eAAO,MAAM,kBAAkB,eAAyB,CAAC;AAQzD;;GAEG;AACH,eAAO,MAAM,uBAAuB,GAAI,CAAC,
|
1
|
+
{"version":3,"file":"getExternalStoreMessage.d.ts","sourceRoot":"","sources":["../../../src/runtimes/external-store/getExternalStoreMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,eAAO,MAAM,kBAAkB,eAAyB,CAAC;AAQzD;;GAEG;AACH,eAAO,MAAM,uBAAuB,GAAI,CAAC,EAAG,OAAO,aAAa,wBAG/D,CAAC;AAIF,eAAO,MAAM,wBAAwB,GAAI,CAAC,EACxC,OAAO,WAAW,GAAG,aAAa,GAAG,aAAa,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,QActE,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useExternalStoreRuntime.d.ts","sourceRoot":"","sources":["../../../src/runtimes/external-store/useExternalStoreRuntime.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAGlE,eAAO,MAAM,uBAAuB,GAAI,CAAC,
|
1
|
+
{"version":3,"file":"useExternalStoreRuntime.d.ts","sourceRoot":"","sources":["../../../src/runtimes/external-store/useExternalStoreRuntime.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAGlE,eAAO,MAAM,uBAAuB,GAAI,CAAC,EAAG,OAAO,oBAAoB,CAAC,CAAC,CAAC,yBAezE,CAAC"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import type { MessageStatus, ReasoningContentPart, RunConfig, TextContentPart, ThreadAssistantContentPart, ThreadMessage, ThreadStep, ToolCallContentPart } from "../../types/AssistantTypes";
|
1
|
+
import type { MessageStatus, ReasoningContentPart, RunConfig, SourceContentPart, TextContentPart, ThreadAssistantContentPart, ThreadMessage, ThreadStep, ToolCallContentPart } from "../../types/AssistantTypes";
|
2
2
|
import type { ModelContext } from "../../model-context/ModelContextTypes";
|
3
3
|
import { ReadonlyJSONValue } from "../../utils/json/json-value";
|
4
4
|
export type ChatModelRunUpdate = {
|
@@ -16,7 +16,7 @@ export type ChatModelRunResult = {
|
|
16
16
|
};
|
17
17
|
};
|
18
18
|
export type CoreChatModelRunResult = Omit<ChatModelRunResult, "content"> & {
|
19
|
-
readonly content: readonly (TextContentPart | ReasoningContentPart | ToolCallContentPart)[];
|
19
|
+
readonly content: readonly (TextContentPart | ReasoningContentPart | ToolCallContentPart | SourceContentPart)[];
|
20
20
|
};
|
21
21
|
export type ChatModelRunOptions = {
|
22
22
|
readonly messages: readonly ThreadMessage[];
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ChatModelAdapter.d.ts","sourceRoot":"","sources":["../../../src/runtimes/local/ChatModelAdapter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,oBAAoB,EACpB,SAAS,EACT,eAAe,EACf,0BAA0B,EAC1B,aAAa,EACb,UAAU,EACV,mBAAmB,EACpB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAEhE,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,CAAC,OAAO,EAAE,SAAS,0BAA0B,EAAE,CAAC;IACxD,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC7C,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,0BAA0B,EAAE,GAAG,SAAS,CAAC;IACrE,QAAQ,CAAC,MAAM,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;IAC5C,QAAQ,CAAC,QAAQ,CAAC,EAAE;QAClB,QAAQ,CAAC,oBAAoB,CAAC,EAAE,SAAS,iBAAiB,EAAE,GAAG,SAAS,CAAC;QACzE,QAAQ,CAAC,aAAa,CAAC,EAAE,SAAS,iBAAiB,EAAE,GAAG,SAAS,CAAC;QAClE,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,UAAU,EAAE,GAAG,SAAS,CAAC;QACnD,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CA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CAAC;CACH,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,IAAI,CAAC,kBAAkB,EAAE,SAAS,CAAC,GAAG;IACzE,QAAQ,CAAC,OAAO,EAAE,SAAS,CACvB,eAAe,GACf,oBAAoB,GACpB,mBAAmB,GACnB,iBAAiB,CACpB,EAAE,CAAC;CACL,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,CAAC,QAAQ,EAAE,SAAS,aAAa,EAAE,CAAC;IAC5C,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IAClC,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAC;IAE/B;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAE9B,QAAQ,CAAC,2BAA2B,CAAC,EAAE,MAAM,CAAC;IAC9C,mBAAmB,IAAI,aAAa,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,GAAG,CACD,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,kBAAkB,CAAC,GAAG,cAAc,CAAC,kBAAkB,EAAE,IAAI,CAAC,CAAC;CAC3E,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/runtimes/local/ChatModelAdapter.tsx"],"sourcesContent":["import type {\n MessageStatus,\n ReasoningContentPart,\n RunConfig,\n TextContentPart,\n ThreadAssistantContentPart,\n ThreadMessage,\n ThreadStep,\n ToolCallContentPart,\n} from \"../../types/AssistantTypes\";\nimport type { ModelContext } from \"../../model-context/ModelContextTypes\";\nimport { ReadonlyJSONValue } from \"../../utils/json/json-value\";\n\nexport type ChatModelRunUpdate = {\n readonly content: readonly ThreadAssistantContentPart[];\n readonly metadata?: Record<string, unknown>;\n};\n\nexport type ChatModelRunResult = {\n readonly content?: readonly ThreadAssistantContentPart[] | undefined;\n readonly status?: MessageStatus | undefined;\n readonly metadata?: {\n readonly unstable_annotations?: readonly ReadonlyJSONValue[] | undefined;\n readonly unstable_data?: readonly ReadonlyJSONValue[] | undefined;\n readonly steps?: readonly ThreadStep[] | undefined;\n readonly custom?: Record<string, unknown> | undefined;\n };\n};\n\nexport type CoreChatModelRunResult = Omit<ChatModelRunResult, \"content\"> & {\n readonly content: readonly (TextContentPart
|
1
|
+
{"version":3,"sources":["../../../src/runtimes/local/ChatModelAdapter.tsx"],"sourcesContent":["import type {\n MessageStatus,\n ReasoningContentPart,\n RunConfig,\n SourceContentPart,\n TextContentPart,\n ThreadAssistantContentPart,\n ThreadMessage,\n ThreadStep,\n ToolCallContentPart,\n} from \"../../types/AssistantTypes\";\nimport type { ModelContext } from \"../../model-context/ModelContextTypes\";\nimport { ReadonlyJSONValue } from \"../../utils/json/json-value\";\n\nexport type ChatModelRunUpdate = {\n readonly content: readonly ThreadAssistantContentPart[];\n readonly metadata?: Record<string, unknown>;\n};\n\nexport type ChatModelRunResult = {\n readonly content?: readonly ThreadAssistantContentPart[] | undefined;\n readonly status?: MessageStatus | undefined;\n readonly metadata?: {\n readonly unstable_annotations?: readonly ReadonlyJSONValue[] | undefined;\n readonly unstable_data?: readonly ReadonlyJSONValue[] | undefined;\n readonly steps?: readonly ThreadStep[] | undefined;\n readonly custom?: Record<string, unknown> | undefined;\n };\n};\n\nexport type CoreChatModelRunResult = Omit<ChatModelRunResult, \"content\"> & {\n readonly content: readonly (\n | TextContentPart\n | ReasoningContentPart\n | ToolCallContentPart\n | SourceContentPart\n )[];\n};\n\nexport type ChatModelRunOptions = {\n readonly messages: readonly ThreadMessage[];\n readonly runConfig: RunConfig;\n readonly abortSignal: AbortSignal;\n readonly context: ModelContext;\n\n /**\n * @deprecated This field was renamed to `context`.\n */\n readonly config: ModelContext;\n\n readonly unstable_assistantMessageId?: string;\n unstable_getMessage(): ThreadMessage;\n};\n\nexport type ChatModelAdapter = {\n run(\n options: ChatModelRunOptions,\n ): Promise<ChatModelRunResult> | AsyncGenerator<ChatModelRunRes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,MAAM,mBAAmB,GAAG,IAAI,CAAC,uBAAuB,EAAE,UAAU,CAAC,GAAG;IAC5E,KAAK,CAAC,EAAE,cAAc,GAAG,SAAS,CAAC;IACnC,eAAe,CAAC,EAAE,SAAS,iBAAiB,EAAE,GAAG,SAAS,CAAC;IAC3D,QAAQ,CAAC,EAAE,IAAI,CAAC,uBAAuB,CAAC,UAAU,CAAC,EAAE,WAAW,CAAC,GAAG,SAAS,CAAC;CAC/E,CAAC;AAEF,eAAO,MAAM,wBAAwB,GAAI,CAAC,SAAS,mBAAmB,EACpE,SAAS,CAAC;;;;;;uBAtBG,gBAAgB;sBACjB,oBAAoB,GAAG,SAAS;0BAC5B,iBAAiB,GAAG,SAAS;qBAClC,sBAAsB,GAAG,SAAS;uBAChC,eAAe,GAAG,SAAS;yBACzB,iBAAiB,GAAG,SAAS;;;;;CAsC7C,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"shouldContinue.d.ts","sourceRoot":"","sources":["../../../src/runtimes/local/shouldContinue.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAE1D,eAAO,MAAM,cAAc,
|
1
|
+
{"version":3,"file":"shouldContinue.d.ts","sourceRoot":"","sources":["../../../src/runtimes/local/shouldContinue.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAE1D,eAAO,MAAM,cAAc,GACzB,QAAQ,sBAAsB,EAC9B,gBAAgB,MAAM,EAAE,GAAG,SAAS,YAqBrC,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useLocalRuntime.d.ts","sourceRoot":"","sources":["../../../src/runtimes/local/useLocalRuntime.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAI5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAkCtD,eAAO,MAAM,eAAe,
|
1
|
+
{"version":3,"file":"useLocalRuntime.d.ts","sourceRoot":"","sources":["../../../src/runtimes/local/useLocalRuntime.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAI5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAkCtD,eAAO,MAAM,eAAe,GAC1B,SAAS,gBAAgB,EACzB,wBAAuB,mBAAwB,yBAOhD,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"RemoteThreadListThreadListRuntimeCore.d.ts","sourceRoot":"","sources":["../../../src/runtimes/remote-thread-list/RemoteThreadListThreadListRuntimeCore.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAEtE,OAAO,EACL,8BAA8B,EAC9B,uBAAuB,EACxB,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGtD,OAAO,EAAE,EAAE,EAA8B,MAAM,OAAO,CAAC;AAGvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAG3D,KAAK,gBAAgB,GACjB;IACE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC;IAC9B,QAAQ,CAAC,UAAU,CAAC,EAAE,SAAS,CAAC;IAChC,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;CAC3B,GACD;IACE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC,8BAA8B,CAAC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EK,MAAM,CAAC,kBAAkB,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;YA4B5D,sBAAsB;IAOvB,OAAO,CAAC,kBAAkB,EAAE,MAAM;IAkBxC,SAAS,CAAC,kBAAkB,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAqB9C,MAAM,CAAC,kBAAkB,EAAE,MAAM;IAkB9C,OAAO,CAAC,WAAW,CAA8B;IAE1C,0BAA0B,EAAE,EAAE,CA0BnC;CACH"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"cloud.d.ts","sourceRoot":"","sources":["../../../../src/runtimes/remote-thread-list/adapter/cloud.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAMnD,KAAK,UAAU,GAAG;IAChB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,KAAK,6BAA6B,GAAG;IACnC,KAAK,CAAC,EAAE,cAAc,GAAG,SAAS,CAAC;IAEnC,MAAM,CAAC,IAAI,OAAO,CAAC,UAAU,CAAC,CAAC;IAC/B,MAAM,CAAC,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1C,CAAC;AASF,eAAO,MAAM,yBAAyB,
|
1
|
+
{"version":3,"file":"cloud.d.ts","sourceRoot":"","sources":["../../../../src/runtimes/remote-thread-list/adapter/cloud.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAMnD,KAAK,UAAU,GAAG;IAChB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,KAAK,6BAA6B,GAAG;IACnC,KAAK,CAAC,EAAE,cAAc,GAAG,SAAS,CAAC;IAEnC,MAAM,CAAC,IAAI,OAAO,CAAC,UAAU,CAAC,CAAC;IAC/B,MAAM,CAAC,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1C,CAAC;AASF,eAAO,MAAM,yBAAyB,GACpC,SAAS,6BAA6B,KACrC,uBA4EF,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useRemoteThreadListRuntime.d.ts","sourceRoot":"","sources":["../../../src/runtimes/remote-thread-list/useRemoteThreadListRuntime.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAsBtD,eAAO,MAAM,0BAA0B,
|
1
|
+
{"version":3,"file":"useRemoteThreadListRuntime.d.ts","sourceRoot":"","sources":["../../../src/runtimes/remote-thread-list/useRemoteThreadListRuntime.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAsBtD,eAAO,MAAM,0BAA0B,GACrC,SAAS,uBAAuB,yBAQjC,CAAC"}
|
@@ -9,6 +9,13 @@ export type ReasoningContentPart = {
|
|
9
9
|
readonly type: "reasoning";
|
10
10
|
readonly text: string;
|
11
11
|
};
|
12
|
+
export type SourceContentPart = {
|
13
|
+
readonly type: "source";
|
14
|
+
readonly sourceType: "url";
|
15
|
+
readonly id: string;
|
16
|
+
readonly url: string;
|
17
|
+
readonly title?: string;
|
18
|
+
};
|
12
19
|
export type ImageContentPart = {
|
13
20
|
readonly type: "image";
|
14
21
|
readonly image: string;
|
@@ -75,12 +82,13 @@ export type ToolCallContentPart<TArgs = ReadonlyJSONObject, TResult = unknown> =
|
|
75
82
|
readonly argsText: string;
|
76
83
|
};
|
77
84
|
export type ThreadUserContentPart = TextContentPart | ImageContentPart | FileContentPart | Unstable_AudioContentPart;
|
78
|
-
export type ThreadAssistantContentPart = TextContentPart | ReasoningContentPart | ToolCallContentPart;
|
85
|
+
export type ThreadAssistantContentPart = TextContentPart | ReasoningContentPart | ToolCallContentPart | SourceContentPart;
|
79
86
|
type MessageCommonProps = {
|
80
87
|
readonly id: string;
|
81
88
|
readonly createdAt: Date;
|
82
89
|
};
|
83
90
|
export type ThreadStep = {
|
91
|
+
readonly messageId?: string;
|
84
92
|
readonly usage?: {
|
85
93
|
readonly promptTokens: number;
|
86
94
|
readonly completionTokens: number;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"AssistantTypes.d.ts","sourceRoot":"","sources":["../../src/types/AssistantTypes.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"AssistantTypes.d.ts","sourceRoot":"","sources":["../../src/types/AssistantTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,0BAA0B,CAAC;AAElC,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,WAAW,GAAG,QAAQ,CAAC;AAE1D,MAAM,MAAM,eAAe,GAAG;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,QAAQ,CAAC,UAAU,EAAE,KAAK,CAAC;IAC3B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC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B,eAAe,GACf,gBAAgB,GAChB,eAAe,GACf,yBAAyB,CAAC;AAC9B,MAAM,MAAM,wBAAwB,GAChC,eAAe,GACf,uBAAuB,CAAC;AAE5B,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,QAAQ,CAAC;IACf,OAAO,EAAE,SAAS,CAAC,eAAe,CAAC,CAAC;CACrC,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,SAAS,mBAAmB,EAAE,CAAC;CACzC,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,EAAE,WAAW,CAAC;IAClB,OAAO,EAAE,SAAS,wBAAwB,EAAE,CAAC;CAC9C,CAAC;AAEF,MAAM,MAAM,WAAW,GACnB,iBAAiB,GACjB,eAAe,GACf,oBAAoB,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../src/types/AssistantTypes.ts"],"sourcesContent":["
|
1
|
+
{"version":3,"sources":["../../src/types/AssistantTypes.ts"],"sourcesContent":["import { CompleteAttachment } from \"./AttachmentTypes\";\nimport {\n ReadonlyJSONObject,\n ReadonlyJSONValue,\n} from \"../utils/json/json-value\";\n\nexport type MessageRole = \"user\" | \"assistant\" | \"system\";\n\nexport type TextContentPart = {\n readonly type: \"text\";\n readonly text: string;\n};\n\nexport type ReasoningContentPart = {\n readonly type: \"reasoning\";\n readonly text: string;\n};\n\nexport type SourceContentPart = {\n readonly type: \"source\";\n readonly sourceType: \"url\";\n readonly id: string;\n readonly url: string;\n readonly title?: string;\n};\n\nexport type ImageContentPart = {\n readonly type: \"image\";\n readonly image: string;\n};\n\nexport type FileContentPart = {\n readonly type: \"file\";\n readonly data: string;\n readonly mimeType: string;\n};\n\nexport type Unstable_AudioContentPart = {\n readonly type: \"audio\";\n readonly audio: {\n readonly data: string;\n readonly format: \"mp3\" | \"wav\";\n };\n};\n\n/**\n * @deprecated UI content parts are deprecated and will be removed in v0.8.0.\n * Migration guide for external-store users using UI content parts:\n * If you must, store UI elements on your external store messages, update your\n * external store converter:\n * ```ts\n * const UI_PLACEHOLDER = Object.freeze({ type: \"text\", text: \"UI content placeholder\" });\n * const convertMessage = (message: TMessage): ThreadMessageLike => ({\n * content: [\n * // other content parts,\n * UI_PLACEHOLDER\n * ],\n * });\n * ```\n *\n * Then, define a custom `TextContentPartComponent`:\n *\n * ```tsx\n * const MyText: FC = () => {\n * const isUIPlaceholder = useContentPart(p => p === UI_PLACEHOLDER);\n *\n * // this assumes that you have a `display` field on your original message objects before conversion.\n * const ui = useMessage(m => isUIPlaceholder ? getExternalStoreMessage(m).display : undefined);\n * if (ui) {\n * return ui;\n * }\n *\n * return <MarkdownText />; // your default text component\n * }\n * ```\n *\n * Pass this component to your Thread:\n *\n * ```tsx\n * <Thread assistantMessage={{ components: { Text: MyText } }} userMessage={{ components: { Text: MyText } }} />\n * ```\n */\nexport type UIContentPart = never;\n\nexport type CoreToolCallContentPart<\n TArgs = ReadonlyJSONObject,\n TResult = unknown,\n> = {\n readonly type: \"tool-call\";\n readonly toolCallId: string;\n readonly toolName: string;\n readonly args: TArgs;\n readonly result?: TResult | undefined;\n readonly isError?: boolean | undefined;\n};\n\nexport type ToolCallContentPart<\n TArgs = ReadonlyJSONObject,\n TResult = unknown,\n> = CoreToolCallContentPart<TArgs, TResult> & {\n readonly argsText: string;\n};\n\nexport type ThreadUserContentPart =\n | TextContentPart\n | ImageContentPart\n | FileContentPart\n | Unstable_AudioContentPart;\n\nexport type ThreadAssistantContentPart =\n | TextContentPart\n | ReasoningContentPart\n | ToolCallContentPart\n | SourceContentPart;\n\ntype MessageCommonProps = {\n readonly id: string;\n readonly createdAt: Date;\n};\n\nexport type ThreadStep = {\n readonly messageId?: string;\n readonly usage?:\n | {\n readonly promptTokens: number;\n readonly completionTokens: number;\n }\n | undefined;\n};\n\nexport type ContentPartStatus =\n | {\n readonly type: \"running\";\n }\n | {\n readonly type: \"complete\";\n }\n | {\n readonly type: \"incomplete\";\n readonly reason:\n | \"cancelled\"\n | \"length\"\n | \"content-filter\"\n | \"other\"\n | \"error\";\n readonly error?: unknown;\n };\n\nexport type ToolCallContentPartStatus =\n | {\n readonly type: \"requires-action\";\n readonly reason: \"tool-calls\";\n }\n | ContentPartStatus;\n\nexport type MessageStatus =\n | {\n readonly type: \"running\";\n }\n | {\n readonly type: \"requires-action\";\n readonly reason: \"tool-calls\";\n }\n | {\n readonly type: \"complete\";\n readonly reason: \"stop\" | \"unknown\";\n }\n | {\n readonly type: \"incomplete\";\n readonly reason:\n | \"cancelled\"\n | \"tool-calls\"\n | \"length\"\n | \"content-filter\"\n | \"other\"\n | \"error\";\n readonly error?: ReadonlyJSONValue;\n };\n\nexport type ThreadSystemMessage = MessageCommonProps & {\n readonly role: \"system\";\n readonly content: readonly [TextContentPart];\n readonly metadata: {\n readonly custom: Record<string, unknown>;\n };\n};\n\nexport type ThreadUserMessage = MessageCommonProps & {\n readonly role: \"user\";\n readonly content: readonly ThreadUserContentPart[];\n readonly attachments: readonly CompleteAttachment[];\n readonly metadata: {\n readonly custom: Record<string, unknown>;\n };\n};\n\nexport type ThreadAssistantMessage = MessageCommonProps & {\n readonly role: \"assistant\";\n readonly content: readonly ThreadAssistantContentPart[];\n readonly status: MessageStatus;\n readonly metadata: {\n readonly unstable_annotations: readonly ReadonlyJSONValue[];\n readonly unstable_data: readonly ReadonlyJSONValue[];\n readonly steps: readonly ThreadStep[];\n readonly custom: Record<string, unknown>;\n };\n};\n\nexport type RunConfig = {\n // TODO allow user customization via global type overrides\n readonly custom?: Record<string, unknown>;\n};\n\nexport type AppendMessage = CoreMessage & {\n parentId: string | null;\n\n /** The ID of the message that was edited or undefined. */\n sourceId: string | null;\n runConfig: RunConfig | undefined;\n\n attachments: readonly CompleteAttachment[];\n startRun?: boolean | undefined;\n};\n\ntype BaseThreadMessage = {\n readonly status?: ThreadAssistantMessage[\"status\"];\n readonly metadata: {\n readonly unstable_annotations?: readonly ReadonlyJSONValue[];\n readonly unstable_data?: readonly ReadonlyJSONValue[];\n readonly steps?: readonly ThreadStep[];\n readonly custom: Record<string, unknown>;\n };\n readonly attachments?: ThreadUserMessage[\"attachments\"];\n};\n\nexport type ThreadMessage = BaseThreadMessage &\n (ThreadSystemMessage | ThreadUserMessage | ThreadAssistantMessage);\n\n/** Core Message Types (without UI content parts) */\n\nexport type CoreUserContentPart =\n | TextContentPart\n | ImageContentPart\n | FileContentPart\n | Unstable_AudioContentPart;\nexport type CoreAssistantContentPart =\n | TextContentPart\n | CoreToolCallContentPart;\n\nexport type CoreSystemMessage = {\n role: \"system\";\n content: readonly [TextContentPart];\n};\n\nexport type CoreUserMessage = {\n role: \"user\";\n content: readonly CoreUserContentPart[];\n};\n\nexport type CoreAssistantMessage = {\n role: \"assistant\";\n content: readonly CoreAssistantContentPart[];\n};\n\nexport type CoreMessage =\n | CoreSystemMessage\n | CoreUserMessage\n | CoreAssistantMessage;\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import type { ComponentType } from "react";
|
2
|
-
import type { ContentPartStatus, FileContentPart, ImageContentPart, ReasoningContentPart, TextContentPart, ToolCallContentPart, Unstable_AudioContentPart } from "./AssistantTypes";
|
2
|
+
import type { ContentPartStatus, FileContentPart, ImageContentPart, ReasoningContentPart, SourceContentPart, TextContentPart, ToolCallContentPart, Unstable_AudioContentPart } from "./AssistantTypes";
|
3
3
|
import { ContentPartState } from "../api/ContentPartRuntime";
|
4
4
|
export type EmptyContentPartProps = {
|
5
5
|
status: ContentPartStatus;
|
@@ -9,6 +9,8 @@ export type TextContentPartProps = ContentPartState & TextContentPart;
|
|
9
9
|
export type TextContentPartComponent = ComponentType<TextContentPartProps>;
|
10
10
|
export type ReasoningContentPartProps = ContentPartState & ReasoningContentPart;
|
11
11
|
export type ReasoningContentPartComponent = ComponentType<ReasoningContentPartProps>;
|
12
|
+
export type SourceContentPartProps = ContentPartState & SourceContentPart;
|
13
|
+
export type SourceContentPartComponent = ComponentType<SourceContentPartProps>;
|
12
14
|
export type ImageContentPartProps = ContentPartState & ImageContentPart;
|
13
15
|
export type ImageContentPartComponent = ComponentType<ImageContentPartProps>;
|
14
16
|
export type FileContentPartProps = ContentPartState & FileContentPart;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ContentPartComponentTypes.d.ts","sourceRoot":"","sources":["../../src/types/ContentPartComponentTypes.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EACV,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,oBAAoB,EACpB,eAAe,EACf,mBAAmB,EACnB,yBAAyB,EAC1B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE7D,MAAM,MAAM,qBAAqB,GAAG;IAClC,MAAM,EAAE,iBAAiB,CAAC;CAC3B,CAAC;AACF,MAAM,MAAM,yBAAyB,GAAG,aAAa,CAAC,qBAAqB,CAAC,CAAC;AAE7E,MAAM,MAAM,oBAAoB,GAAG,gBAAgB,GAAG,eAAe,CAAC;AACtE,MAAM,MAAM,wBAAwB,GAAG,aAAa,CAAC,oBAAoB,CAAC,CAAC;AAE3E,MAAM,MAAM,yBAAyB,GAAG,gBAAgB,GAAG,oBAAoB,CAAC;AAChF,MAAM,MAAM,6BAA6B,GACvC,aAAa,CAAC,yBAAyB,CAAC,CAAC;AAE3C,MAAM,MAAM,qBAAqB,GAAG,gBAAgB,GAAG,gBAAgB,CAAC;AACxE,MAAM,MAAM,yBAAyB,GAAG,aAAa,CAAC,qBAAqB,CAAC,CAAC;AAE7E,MAAM,MAAM,oBAAoB,GAAG,gBAAgB,GAAG,eAAe,CAAC;AACtE,MAAM,MAAM,wBAAwB,GAAG,aAAa,CAAC,oBAAoB,CAAC,CAAC;AAE3E,MAAM,MAAM,8BAA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MAAM,sBAAsB,GAAG,gBAAgB,GAAG,iBAAiB,CAAC;AAC1E,MAAM,MAAM,0BAA0B,GAAG,aAAa,CAAC,sBAAsB,CAAC,CAAC;AAE/E,MAAM,MAAM,qBAAqB,GAAG,gBAAgB,GAAG,gBAAgB,CAAC;AACxE,MAAM,MAAM,yBAAyB,GAAG,aAAa,CAAC,qBAAqB,CAAC,CAAC;AAE7E,MAAM,MAAM,oBAAoB,GAAG,gBAAgB,GAAG,eAAe,CAAC;AACtE,MAAM,MAAM,wBAAwB,GAAG,aAAa,CAAC,oBAAoB,CAAC,CAAC;AAE3E,MAAM,MAAM,8BAA8B,GAAG,gBAAgB,GAC3D,yBAAyB,CAAC;AAC5B,MAAM,MAAM,kCAAkC,GAC5C,aAAa,CAAC,8BAA8B,CAAC,CAAC;AAEhD,MAAM,MAAM,wBAAwB,CAClC,KAAK,GAAG,GAAG,EACX,OAAO,GAAG,OAAO,IACf,gBAAgB,GAClB,mBAAmB,CAAC,KAAK,EAAE,OAAO,CAAC,GAAG;IACpC,SAAS,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,CAAC;CAClC,CAAC;AAEJ,MAAM,MAAM,4BAA4B,CACtC,KAAK,GAAG,GAAG,EACX,OAAO,GAAG,GAAG,IACX,aAAa,CAAC,wBAAwB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../src/types/ContentPartComponentTypes.tsx"],"sourcesContent":["import type { ComponentType } from \"react\";\nimport type {\n ContentPartStatus,\n FileContentPart,\n ImageContentPart,\n ReasoningContentPart,\n TextContentPart,\n ToolCallContentPart,\n Unstable_AudioContentPart,\n} from \"./AssistantTypes\";\nimport { ContentPartState } from \"../api/ContentPartRuntime\";\n\nexport type EmptyContentPartProps = {\n status: ContentPartStatus;\n};\nexport type EmptyContentPartComponent = ComponentType<EmptyContentPartProps>;\n\nexport type TextContentPartProps = ContentPartState & TextContentPart;\nexport type TextContentPartComponent = ComponentType<TextContentPartProps>;\n\nexport type ReasoningContentPartProps = ContentPartState & ReasoningContentPart;\nexport type ReasoningContentPartComponent =\n ComponentType<ReasoningContentPartProps>;\n\nexport type ImageContentPartProps = ContentPartState & ImageContentPart;\nexport type ImageContentPartComponent = ComponentType<ImageContentPartProps>;\n\nexport type FileContentPartProps = ContentPartState & FileContentPart;\nexport type FileContentPartComponent = ComponentType<FileContentPartProps>;\n\nexport type Unstable_AudioContentPartProps = ContentPartState &\n Unstable_AudioContentPart;\nexport type Unstable_AudioContentPartComponent =\n ComponentType<Unstable_AudioContentPartProps>;\n\nexport type ToolCallContentPartProps<\n TArgs = any,\n TResult = unknown,\n> = ContentPartState &\n ToolCallContentPart<TArgs, TResult> & {\n addResult: (result: any) => void;\n };\n\nexport type ToolCallContentPartComponent<\n TArgs = any,\n TResult = any,\n> = ComponentType<ToolCallContentPartProps<TArgs, TResult>>;\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
1
|
+
{"version":3,"sources":["../../src/types/ContentPartComponentTypes.tsx"],"sourcesContent":["import type { ComponentType } from \"react\";\nimport type {\n ContentPartStatus,\n FileContentPart,\n ImageContentPart,\n ReasoningContentPart,\n SourceContentPart,\n TextContentPart,\n ToolCallContentPart,\n Unstable_AudioContentPart,\n} from \"./AssistantTypes\";\nimport { ContentPartState } from \"../api/ContentPartRuntime\";\n\nexport type EmptyContentPartProps = {\n status: ContentPartStatus;\n};\nexport type EmptyContentPartComponent = ComponentType<EmptyContentPartProps>;\n\nexport type TextContentPartProps = ContentPartState & TextContentPart;\nexport type TextContentPartComponent = ComponentType<TextContentPartProps>;\n\nexport type ReasoningContentPartProps = ContentPartState & ReasoningContentPart;\nexport type ReasoningContentPartComponent =\n ComponentType<ReasoningContentPartProps>;\n\nexport type SourceContentPartProps = ContentPartState & SourceContentPart;\nexport type SourceContentPartComponent = ComponentType<SourceContentPartProps>;\n\nexport type ImageContentPartProps = ContentPartState & ImageContentPart;\nexport type ImageContentPartComponent = ComponentType<ImageContentPartProps>;\n\nexport type FileContentPartProps = ContentPartState & FileContentPart;\nexport type FileContentPartComponent = ComponentType<FileContentPartProps>;\n\nexport type Unstable_AudioContentPartProps = ContentPartState &\n Unstable_AudioContentPart;\nexport type Unstable_AudioContentPartComponent =\n ComponentType<Unstable_AudioContentPartProps>;\n\nexport type ToolCallContentPartProps<\n TArgs = any,\n TResult = unknown,\n> = ContentPartState &\n ToolCallContentPart<TArgs, TResult> & {\n addResult: (result: any) => void;\n };\n\nexport type ToolCallContentPartComponent<\n TArgs = any,\n TResult = any,\n> = ComponentType<ToolCallContentPartProps<TArgs, TResult>>;\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
package/dist/types/index.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
export type { Attachment, PendingAttachment, CompleteAttachment, AttachmentStatus, } from "./AttachmentTypes";
|
2
|
-
export type { AppendMessage, TextContentPart, ReasoningContentPart, ImageContentPart, FileContentPart, Unstable_AudioContentPart, ToolCallContentPart, UIContentPart, MessageStatus, ThreadUserContentPart, ThreadAssistantContentPart, ThreadSystemMessage, ThreadAssistantMessage, ThreadUserMessage, ThreadMessage, CoreUserContentPart, CoreAssistantContentPart, CoreSystemMessage, CoreUserMessage, CoreAssistantMessage, CoreMessage, } from "./AssistantTypes";
|
3
|
-
export type { EmptyContentPartProps, EmptyContentPartComponent, TextContentPartProps, TextContentPartComponent, ReasoningContentPartProps, ReasoningContentPartComponent, ImageContentPartProps, ImageContentPartComponent, FileContentPartProps, FileContentPartComponent, Unstable_AudioContentPartProps, Unstable_AudioContentPartComponent, ToolCallContentPartProps, ToolCallContentPartComponent, } from "./ContentPartComponentTypes";
|
2
|
+
export type { AppendMessage, TextContentPart, ReasoningContentPart, SourceContentPart, ImageContentPart, FileContentPart, Unstable_AudioContentPart, ToolCallContentPart, UIContentPart, MessageStatus, ThreadUserContentPart, ThreadAssistantContentPart, ThreadSystemMessage, ThreadAssistantMessage, ThreadUserMessage, ThreadMessage, CoreUserContentPart, CoreAssistantContentPart, CoreSystemMessage, CoreUserMessage, CoreAssistantMessage, CoreMessage, } from "./AssistantTypes";
|
3
|
+
export type { EmptyContentPartProps, EmptyContentPartComponent, TextContentPartProps, TextContentPartComponent, ReasoningContentPartProps, ReasoningContentPartComponent, SourceContentPartProps, SourceContentPartComponent, ImageContentPartProps, ImageContentPartComponent, FileContentPartProps, FileContentPartComponent, Unstable_AudioContentPartProps, Unstable_AudioContentPartComponent, ToolCallContentPartProps, ToolCallContentPartComponent, } from "./ContentPartComponentTypes";
|
4
4
|
export type { Unsubscribe } from "./Unsubscribe";
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,UAAU,EACV,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,mBAAmB,CAAC;AAE3B,YAAY,EACV,aAAa,EACb,eAAe,EACf,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EACf,yBAAyB,EACzB,mBAAmB,EACnB,aAAa,EACb,aAAa,EAGb,qBAAqB,EACrB,0BAA0B,EAC1B,mBAAmB,EACnB,sBAAsB,EACtB,iBAAiB,EACjB,aAAa,EAGb,mBAAmB,EACnB,wBAAwB,EACxB,iBAAiB,EACjB,eAAe,EACf,oBAAoB,EACpB,WAAW,GACZ,MAAM,kBAAkB,CAAC;AAE1B,YAAY,EACV,qBAAqB,EACrB,yBAAyB,EACzB,oBAAoB,EACpB,wBAAwB,EACxB,yBAAyB,EACzB,6BAA6B,EAC7B,qBAAqB,EACrB,yBAAyB,EACzB,oBAAoB,EACpB,wBAAwB,EACxB,8BAA8B,EAC9B,kCAAkC,EAClC,wBAAwB,EACxB,4BAA4B,GAC7B,MAAM,6BAA6B,CAAC;AAErC,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC"}
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,UAAU,EACV,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,mBAAmB,CAAC;AAE3B,YAAY,EACV,aAAa,EACb,eAAe,EACf,oBAAoB,EACpB,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,yBAAyB,EACzB,mBAAmB,EACnB,aAAa,EACb,aAAa,EAGb,qBAAqB,EACrB,0BAA0B,EAC1B,mBAAmB,EACnB,sBAAsB,EACtB,iBAAiB,EACjB,aAAa,EAGb,mBAAmB,EACnB,wBAAwB,EACxB,iBAAiB,EACjB,eAAe,EACf,oBAAoB,EACpB,WAAW,GACZ,MAAM,kBAAkB,CAAC;AAE1B,YAAY,EACV,qBAAqB,EACrB,yBAAyB,EACzB,oBAAoB,EACpB,wBAAwB,EACxB,yBAAyB,EACzB,6BAA6B,EAC7B,sBAAsB,EACtB,0BAA0B,EAC1B,qBAAqB,EACrB,yBAAyB,EACzB,oBAAoB,EACpB,wBAAwB,EACxB,8BAA8B,EAC9B,kCAAkC,EAClC,wBAAwB,EACxB,4BAA4B,GAC7B,MAAM,6BAA6B,CAAC;AAErC,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC"}
|
package/dist/types/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../src/types/index.ts"],"sourcesContent":["export type {\n Attachment,\n PendingAttachment,\n CompleteAttachment,\n AttachmentStatus,\n} from \"./AttachmentTypes\";\n\nexport type {\n AppendMessage,\n TextContentPart,\n ReasoningContentPart,\n ImageContentPart,\n FileContentPart,\n Unstable_AudioContentPart,\n ToolCallContentPart,\n UIContentPart,\n MessageStatus,\n\n // thread message types\n ThreadUserContentPart,\n ThreadAssistantContentPart,\n ThreadSystemMessage,\n ThreadAssistantMessage,\n ThreadUserMessage,\n ThreadMessage,\n\n // core message types\n CoreUserContentPart,\n CoreAssistantContentPart,\n CoreSystemMessage,\n CoreUserMessage,\n CoreAssistantMessage,\n CoreMessage,\n} from \"./AssistantTypes\";\n\nexport type {\n EmptyContentPartProps,\n EmptyContentPartComponent,\n TextContentPartProps,\n TextContentPartComponent,\n ReasoningContentPartProps,\n ReasoningContentPartComponent,\n ImageContentPartProps,\n ImageContentPartComponent,\n FileContentPartProps,\n FileContentPartComponent,\n Unstable_AudioContentPartProps,\n Unstable_AudioContentPartComponent,\n ToolCallContentPartProps,\n ToolCallContentPartComponent,\n} from \"./ContentPartComponentTypes\";\n\nexport type { Unsubscribe } from \"./Unsubscribe\";\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
1
|
+
{"version":3,"sources":["../../src/types/index.ts"],"sourcesContent":["export type {\n Attachment,\n PendingAttachment,\n CompleteAttachment,\n AttachmentStatus,\n} from \"./AttachmentTypes\";\n\nexport type {\n AppendMessage,\n TextContentPart,\n ReasoningContentPart,\n SourceContentPart,\n ImageContentPart,\n FileContentPart,\n Unstable_AudioContentPart,\n ToolCallContentPart,\n UIContentPart,\n MessageStatus,\n\n // thread message types\n ThreadUserContentPart,\n ThreadAssistantContentPart,\n ThreadSystemMessage,\n ThreadAssistantMessage,\n ThreadUserMessage,\n ThreadMessage,\n\n // core message types\n CoreUserContentPart,\n CoreAssistantContentPart,\n CoreSystemMessage,\n CoreUserMessage,\n CoreAssistantMessage,\n CoreMessage,\n} from \"./AssistantTypes\";\n\nexport type {\n EmptyContentPartProps,\n EmptyContentPartComponent,\n TextContentPartProps,\n TextContentPartComponent,\n ReasoningContentPartProps,\n ReasoningContentPartComponent,\n SourceContentPartProps,\n SourceContentPartComponent,\n ImageContentPartProps,\n ImageContentPartComponent,\n FileContentPartProps,\n FileContentPartComponent,\n Unstable_AudioContentPartProps,\n Unstable_AudioContentPartComponent,\n ToolCallContentPartProps,\n ToolCallContentPartComponent,\n} from \"./ContentPartComponentTypes\";\n\nexport type { Unsubscribe } from \"./Unsubscribe\";\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"createCombinedStore.d.ts","sourceRoot":"","sources":["../../../src/utils/combined/createCombinedStore.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D,MAAM,MAAM,cAAc,CAAC,CAAC,IAAI;IAC9B,QAAQ,EAAE,MAAM,CAAC,CAAC;IAClB,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,IAAI,KAAK,WAAW,CAAC;CAClD,CAAC;AAEF,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC;AAE9E,eAAO,MAAM,mBAAmB,GAAI,CAAC,SAAS,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,
|
1
|
+
{"version":3,"file":"createCombinedStore.d.ts","sourceRoot":"","sources":["../../../src/utils/combined/createCombinedStore.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D,MAAM,MAAM,cAAc,CAAC,CAAC,IAAI;IAC9B,QAAQ,EAAE,MAAM,CAAC,CAAC;IAClB,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,IAAI,KAAK,WAAW,CAAC;CAClD,CAAC;AAEF,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC;AAE9E,eAAO,MAAM,mBAAmB,GAAI,CAAC,SAAS,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,QAAQ,GACtE,CAAC,IAAI,MAAM,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GACrC,MAUS,UAAU,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAC,KAAG,CAM5C,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useCombinedStore.d.ts","sourceRoot":"","sources":["../../../src/utils/combined/useCombinedStore.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,gBAAgB,EAErB,cAAc,EACf,MAAM,uBAAuB,CAAC;AAE/B,eAAO,MAAM,gBAAgB,GAAI,CAAC,SAAS,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,
|
1
|
+
{"version":3,"file":"useCombinedStore.d.ts","sourceRoot":"","sources":["../../../src/utils/combined/useCombinedStore.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,gBAAgB,EAErB,cAAc,EACf,MAAM,uBAAuB,CAAC;AAE/B,eAAO,MAAM,gBAAgB,GAAI,CAAC,SAAS,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,EAC1D,QAAQ,GAAG,CAAC,IAAI,MAAM,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAE,EAChD,UAAU,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAC,KAC/B,CAIF,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"createActionButton.d.ts","sourceRoot":"","sources":["../../src/utils/createActionButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAEZ,wBAAwB,EACxB,iBAAiB,EAClB,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAGtD,KAAK,oBAAoB,CAAC,MAAM,IAAI,CAClC,KAAK,EAAE,MAAM,KACV,iBAAiB,CAAC,iBAAiB,CAAC,GAAG,IAAI,CAAC;AAEjD,KAAK,oBAAoB,GAAG,wBAAwB,CAAC,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC;AAE9E,MAAM,MAAM,iBAAiB,CAAC,KAAK,IAAI,oBAAoB,GACzD,CAAC,KAAK,SAAS,CAAC,KAAK,EAAE,MAAM,MAAM,KAAK,OAAO,GAAG,MAAM,GAAG,KAAK,CAAC,CAAC;AAEpE,MAAM,MAAM,mBAAmB,GAAG,YAAY,CAAC,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC;AAExE,eAAO,MAAM,kBAAkB,GAAI,MAAM,
|
1
|
+
{"version":3,"file":"createActionButton.d.ts","sourceRoot":"","sources":["../../src/utils/createActionButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAEZ,wBAAwB,EACxB,iBAAiB,EAClB,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAGtD,KAAK,oBAAoB,CAAC,MAAM,IAAI,CAClC,KAAK,EAAE,MAAM,KACV,iBAAiB,CAAC,iBAAiB,CAAC,GAAG,IAAI,CAAC;AAEjD,KAAK,oBAAoB,GAAG,wBAAwB,CAAC,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC;AAE9E,MAAM,MAAM,iBAAiB,CAAC,KAAK,IAAI,oBAAoB,GACzD,CAAC,KAAK,SAAS,CAAC,KAAK,EAAE,MAAM,MAAM,KAAK,OAAO,GAAG,MAAM,GAAG,KAAK,CAAC,CAAC;AAEpE,MAAM,MAAM,mBAAmB,GAAG,YAAY,CAAC,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC;AAExE,eAAO,MAAM,kBAAkB,GAAI,MAAM,EACvC,aAAa,MAAM,EACnB,iBAAiB,oBAAoB,CAAC,MAAM,CAAC,EAC7C,eAAc,CAAC,MAAM,WAAW,CAAC,MAAM,CAAC,CAAC,EAAO;;uEAgCjD,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getThreadMessageText.d.ts","sourceRoot":"","sources":["../../src/utils/getThreadMessageText.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EAEb,aAAa,EACd,MAAM,yBAAyB,CAAC;AAEjC,eAAO,MAAM,oBAAoB,
|
1
|
+
{"version":3,"file":"getThreadMessageText.d.ts","sourceRoot":"","sources":["../../src/utils/getThreadMessageText.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EAEb,aAAa,EACd,MAAM,yBAAyB,CAAC;AAEjC,eAAO,MAAM,oBAAoB,GAC/B,SAAS,aAAa,GAAG,aAAa,WAOvC,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useManagedRef.d.ts","sourceRoot":"","sources":["../../../src/utils/hooks/useManagedRef.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,GAAI,KAAK,
|
1
|
+
{"version":3,"file":"useManagedRef.d.ts","sourceRoot":"","sources":["../../../src/utils/hooks/useManagedRef.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,GAAI,KAAK,EACjC,UAAU,CAAC,IAAI,EAAE,KAAK,KAAK,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,UAKvC,KAAK,GAAG,IAAI,SAepB,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useOnResizeContent.d.ts","sourceRoot":"","sources":["../../../src/utils/hooks/useOnResizeContent.tsx"],"names":[],"mappings":"AAIA,eAAO,MAAM,kBAAkB,
|
1
|
+
{"version":3,"file":"useOnResizeContent.d.ts","sourceRoot":"","sources":["../../../src/utils/hooks/useOnResizeContent.tsx"],"names":[],"mappings":"AAIA,eAAO,MAAM,kBAAkB,GAAI,UAAU,MAAM,IAAI,qCA8BtD,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useOnScrollToBottom.d.ts","sourceRoot":"","sources":["../../../src/utils/hooks/useOnScrollToBottom.tsx"],"names":[],"mappings":"AAMA,eAAO,MAAM,mBAAmB,
|
1
|
+
{"version":3,"file":"useOnScrollToBottom.d.ts","sourceRoot":"","sources":["../../../src/utils/hooks/useOnScrollToBottom.tsx"],"names":[],"mappings":"AAMA,eAAO,MAAM,mBAAmB,GAAI,UAAU,MAAM,IAAI,SAOvD,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"idUtils.d.ts","sourceRoot":"","sources":["../../src/utils/idUtils.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU,2BAGtB,CAAC;AAGF,eAAO,MAAM,oBAAoB,cAA6C,CAAC;AAC/E,eAAO,MAAM,cAAc,
|
1
|
+
{"version":3,"file":"idUtils.d.ts","sourceRoot":"","sources":["../../src/utils/idUtils.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU,2BAGtB,CAAC;AAGF,eAAO,MAAM,oBAAoB,cAA6C,CAAC;AAC/E,eAAO,MAAM,cAAc,GAAI,IAAI,MAAM,YAAoC,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"parse-partial-json.d.ts","sourceRoot":"","sources":["../../../src/utils/json/parse-partial-json.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,iBAAiB,EAElB,MAAM,4BAA4B,CAAC;AAIpC,eAAO,MAAM,gBAAgB,
|
1
|
+
{"version":3,"file":"parse-partial-json.d.ts","sourceRoot":"","sources":["../../../src/utils/json/parse-partial-json.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,iBAAiB,EAElB,MAAM,4BAA4B,CAAC;AAIpC,eAAO,MAAM,gBAAgB,GAAI,MAAM,MAAM,QAa5C,CAAC;AA8CF,eAAO,MAAM,sBAAsB,GAAI,WAAW,MAAM,EAAE,sBAKzD,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"SmoothContext.d.ts","sourceRoot":"","sources":["../../../src/utils/smooth/SmoothContext.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,aAAa,EAEb,EAAE,EAEF,iBAAiB,EAGlB,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAwB5D,eAAO,MAAM,qBAAqB,EAAE,EAAE,CAAC,iBAAiB,CAcvD,CAAC;AAEF,eAAO,MAAM,yBAAyB,GAAI,CAAC,SAAS,aAAa,CAAC,GAAG,CAAC,
|
1
|
+
{"version":3,"file":"SmoothContext.d.ts","sourceRoot":"","sources":["../../../src/utils/smooth/SmoothContext.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,aAAa,EAEb,EAAE,EAEF,iBAAiB,EAGlB,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAwB5D,eAAO,MAAM,qBAAqB,EAAE,EAAE,CAAC,iBAAiB,CAcvD,CAAC;AAEF,eAAO,MAAM,yBAAyB,GAAI,CAAC,SAAS,aAAa,CAAC,GAAG,CAAC,EACpE,WAAW,CAAC,KACX,CAUF,CAAC;AAiBF,eAAO,MAAQ,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAE,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGnD,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useSmooth.d.ts","sourceRoot":"","sources":["../../../src/utils/smooth/useSmooth.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAqB,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAIhF,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AA4DhE,eAAO,MAAM,SAAS,
|
1
|
+
{"version":3,"file":"useSmooth.d.ts","sourceRoot":"","sources":["../../../src/utils/smooth/useSmooth.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAqB,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAIhF,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AA4DhE,eAAO,MAAM,SAAS,GACpB,OAAO,gBAAgB,GAAG,eAAe,EACzC,SAAQ,OAAe,KACtB,gBAAgB,GAAG,eA2ErB,CAAC"}
|
package/package.json
CHANGED
package/src/api/ThreadRuntime.ts
CHANGED
@@ -20,7 +20,6 @@ import {
|
|
20
20
|
ThreadComposerRuntime,
|
21
21
|
ThreadComposerRuntimeImpl,
|
22
22
|
} from "./ComposerRuntime";
|
23
|
-
import { LazyMemoizeSubject } from "./subscribable/LazyMemoizeSubject";
|
24
23
|
import { SKIP_UPDATE } from "./subscribable/SKIP_UPDATE";
|
25
24
|
import {
|
26
25
|
MessageRuntimePath,
|
@@ -251,7 +250,7 @@ export class ThreadRuntimeImpl implements ThreadRuntime {
|
|
251
250
|
threadBinding: ThreadRuntimeCoreBinding,
|
252
251
|
threadListItemBinding: ThreadListItemRuntimeBinding,
|
253
252
|
) {
|
254
|
-
const stateBinding = new
|
253
|
+
const stateBinding = new ShallowMemoizeSubject({
|
255
254
|
path: threadBinding.path,
|
256
255
|
getState: () =>
|
257
256
|
getThreadState(
|
package/src/cloud/auiV0.ts
CHANGED
@@ -19,6 +19,13 @@ type AuiV0MessageContentPart =
|
|
19
19
|
readonly type: "reasoning";
|
20
20
|
readonly text: string;
|
21
21
|
}
|
22
|
+
| {
|
23
|
+
readonly type: "source";
|
24
|
+
readonly sourceType: "url";
|
25
|
+
readonly id: string;
|
26
|
+
readonly url: string;
|
27
|
+
readonly title?: string;
|
28
|
+
}
|
22
29
|
| {
|
23
30
|
readonly type: "tool-call";
|
24
31
|
readonly toolCallId: string;
|
@@ -75,6 +82,9 @@ export const auiV0Encode = (message: ThreadMessage): AuiV0Message => {
|
|
75
82
|
};
|
76
83
|
}
|
77
84
|
|
85
|
+
case "source":
|
86
|
+
return part;
|
87
|
+
|
78
88
|
case "tool-call": {
|
79
89
|
if (!isJSONValue(part.result)) {
|
80
90
|
console.warn(
|
@@ -101,10 +101,7 @@ export const ComposerPrimitiveInput = forwardRef<
|
|
101
101
|
if (!textarea || !autoFocusEnabled) return;
|
102
102
|
|
103
103
|
textarea.focus({ preventScroll: true });
|
104
|
-
textarea.setSelectionRange(
|
105
|
-
textarea.value.length,
|
106
|
-
textarea.value.length,
|
107
|
-
);
|
104
|
+
textarea.setSelectionRange(textarea.value.length, textarea.value.length);
|
108
105
|
}, [autoFocusEnabled]);
|
109
106
|
|
110
107
|
useEffect(() => focus(), [focus]);
|
@@ -17,8 +17,9 @@ import { ContentPartPrimitiveImage } from "../contentPart/ContentPartImage";
|
|
17
17
|
import type {
|
18
18
|
Unstable_AudioContentPartComponent,
|
19
19
|
EmptyContentPartComponent,
|
20
|
-
ImageContentPartComponent,
|
21
20
|
TextContentPartComponent,
|
21
|
+
ImageContentPartComponent,
|
22
|
+
SourceContentPartComponent,
|
22
23
|
ToolCallContentPartComponent,
|
23
24
|
ToolCallContentPartProps,
|
24
25
|
FileContentPartComponent,
|
@@ -32,8 +33,9 @@ export namespace MessagePrimitiveContent {
|
|
32
33
|
components?:
|
33
34
|
| {
|
34
35
|
Empty?: EmptyContentPartComponent | undefined;
|
35
|
-
Reasoning?: ReasoningContentPartComponent | undefined;
|
36
36
|
Text?: TextContentPartComponent | undefined;
|
37
|
+
Reasoning?: ReasoningContentPartComponent | undefined;
|
38
|
+
Source?: SourceContentPartComponent | undefined;
|
37
39
|
Image?: ImageContentPartComponent | undefined;
|
38
40
|
File?: FileContentPartComponent | undefined;
|
39
41
|
Unstable_Audio?: Unstable_AudioContentPartComponent | undefined;
|
@@ -74,6 +76,7 @@ const defaultComponents = {
|
|
74
76
|
</p>
|
75
77
|
),
|
76
78
|
Reasoning: () => null,
|
79
|
+
Source: () => null,
|
77
80
|
Image: () => <ContentPartPrimitiveImage />,
|
78
81
|
File: () => null,
|
79
82
|
Unstable_Audio: () => null,
|
@@ -88,6 +91,7 @@ const MessageContentPartComponent: FC<MessageContentPartComponentProps> = ({
|
|
88
91
|
Text = defaultComponents.Text,
|
89
92
|
Reasoning = defaultComponents.Reasoning,
|
90
93
|
Image = defaultComponents.Image,
|
94
|
+
Source = defaultComponents.Source,
|
91
95
|
File = defaultComponents.File,
|
92
96
|
Unstable_Audio: Audio = defaultComponents.Unstable_Audio,
|
93
97
|
tools = {},
|
@@ -116,6 +120,9 @@ const MessageContentPartComponent: FC<MessageContentPartComponentProps> = ({
|
|
116
120
|
case "reasoning":
|
117
121
|
return <Reasoning {...part} />;
|
118
122
|
|
123
|
+
case "source":
|
124
|
+
return <Source {...part} />;
|
125
|
+
|
119
126
|
case "image":
|
120
127
|
// eslint-disable-next-line jsx-a11y/alt-text
|
121
128
|
return <Image {...part} />;
|
@@ -160,6 +167,7 @@ const MessageContentPart = memo(
|
|
160
167
|
prev.partIndex === next.partIndex &&
|
161
168
|
prev.components?.Text === next.components?.Text &&
|
162
169
|
prev.components?.Reasoning === next.components?.Reasoning &&
|
170
|
+
prev.components?.Source === next.components?.Source &&
|
163
171
|
prev.components?.Image === next.components?.Image &&
|
164
172
|
prev.components?.File === next.components?.File &&
|
165
173
|
prev.components?.Unstable_Audio === next.components?.Unstable_Audio &&
|
@@ -23,7 +23,8 @@ export const toCoreMessage = <T extends boolean = false>(
|
|
23
23
|
role,
|
24
24
|
content: message.content
|
25
25
|
.map((part) => {
|
26
|
-
if (part.type === "reasoning"
|
26
|
+
if (part.type === "reasoning" || part.type === "source")
|
27
|
+
return null; // reasoning and source parts are omitted
|
27
28
|
if (part.type === "tool-call") {
|
28
29
|
const { argsText, ...rest } = part;
|
29
30
|
return rest;
|
@@ -150,8 +150,9 @@ export function toLanguageModelMessages(
|
|
150
150
|
for (const part of message.content) {
|
151
151
|
const type = part.type;
|
152
152
|
switch (type) {
|
153
|
-
case "reasoning":
|
154
|
-
|
153
|
+
case "reasoning":
|
154
|
+
case "source": {
|
155
|
+
break; // reasoning and source parts are omitted
|
155
156
|
}
|
156
157
|
|
157
158
|
case "text": {
|
@@ -14,6 +14,7 @@ export enum AssistantStreamChunkType {
|
|
14
14
|
FinishStep = "e",
|
15
15
|
StartStep = "f",
|
16
16
|
ReasoningDelta = "g",
|
17
|
+
Source = "h",
|
17
18
|
}
|
18
19
|
|
19
20
|
export type AssistantStreamChunk = {
|
@@ -63,4 +64,10 @@ export type AssistantStreamChunk = {
|
|
63
64
|
id: string;
|
64
65
|
};
|
65
66
|
[AssistantStreamChunkType.ReasoningDelta]: string;
|
67
|
+
[AssistantStreamChunkType.Source]: {
|
68
|
+
readonly sourceType: "url";
|
69
|
+
readonly id: string;
|
70
|
+
readonly url: string;
|
71
|
+
readonly title?: string;
|
72
|
+
};
|
66
73
|
};
|
@@ -145,6 +145,13 @@ export function assistantDecoderStream() {
|
|
145
145
|
});
|
146
146
|
break;
|
147
147
|
|
148
|
+
case AssistantStreamChunkType.Source:
|
149
|
+
controller.enqueue({
|
150
|
+
type: "source",
|
151
|
+
source: value,
|
152
|
+
});
|
153
|
+
break;
|
154
|
+
|
148
155
|
// TODO
|
149
156
|
case AssistantStreamChunkType.ReasoningDelta:
|
150
157
|
case AssistantStreamChunkType.StartStep:
|
@@ -22,6 +22,13 @@ export function assistantEncoderStream() {
|
|
22
22
|
break;
|
23
23
|
}
|
24
24
|
|
25
|
+
case "source":
|
26
|
+
controller.enqueue({
|
27
|
+
type: AssistantStreamChunkType.Source,
|
28
|
+
value: chunk.source,
|
29
|
+
});
|
30
|
+
break;
|
31
|
+
|
25
32
|
case "text-delta": {
|
26
33
|
if (!chunk.textDelta) break; // ignore empty text deltas
|
27
34
|
controller.enqueue({
|