@assistant-ui/react 0.8.6 → 0.8.8
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/cloud/auiV0.d.ts.map +1 -1
- package/dist/cloud/auiV0.js +9 -2
- package/dist/cloud/auiV0.js.map +1 -1
- package/dist/cloud/auiV0.mjs +9 -2
- package/dist/cloud/auiV0.mjs.map +1 -1
- package/dist/primitives/contentPart/useContentPartFile.d.ts +5 -0
- package/dist/primitives/contentPart/useContentPartFile.d.ts.map +1 -0
- package/dist/{runtimes/edge/streams/utils/index.js → primitives/contentPart/useContentPartFile.js} +18 -12
- package/dist/primitives/contentPart/useContentPartFile.js.map +1 -0
- package/dist/primitives/contentPart/useContentPartFile.mjs +18 -0
- package/dist/primitives/contentPart/useContentPartFile.mjs.map +1 -0
- package/dist/primitives/contentPart/useContentPartSource.d.ts +5 -0
- package/dist/primitives/contentPart/useContentPartSource.d.ts.map +1 -0
- package/dist/{runtimes/edge/streams/utils/PipeableTransformStream.js → primitives/contentPart/useContentPartSource.js} +18 -16
- package/dist/primitives/contentPart/useContentPartSource.js.map +1 -0
- package/dist/primitives/contentPart/useContentPartSource.mjs +18 -0
- package/dist/primitives/contentPart/useContentPartSource.mjs.map +1 -0
- package/dist/primitives/index.d.ts +3 -1
- package/dist/primitives/index.d.ts.map +1 -1
- package/dist/primitives/index.js +7 -1
- package/dist/primitives/index.js.map +1 -1
- package/dist/primitives/index.mjs +5 -1
- package/dist/primitives/index.mjs.map +1 -1
- package/dist/runtimes/adapters/thread-history/ThreadHistoryAdapter.d.ts +5 -1
- package/dist/runtimes/adapters/thread-history/ThreadHistoryAdapter.d.ts.map +1 -1
- package/dist/runtimes/adapters/thread-history/ThreadHistoryAdapter.js.map +1 -1
- package/dist/runtimes/dangerous-in-browser/DangerousInBrowserAdapter.d.ts +1 -1
- package/dist/runtimes/dangerous-in-browser/DangerousInBrowserAdapter.d.ts.map +1 -1
- package/dist/runtimes/dangerous-in-browser/DangerousInBrowserAdapter.js +2 -2
- package/dist/runtimes/dangerous-in-browser/DangerousInBrowserAdapter.js.map +1 -1
- package/dist/runtimes/dangerous-in-browser/DangerousInBrowserAdapter.mjs +2 -2
- package/dist/runtimes/dangerous-in-browser/DangerousInBrowserAdapter.mjs.map +1 -1
- package/dist/runtimes/edge/EdgeChatAdapter.d.ts +1 -2
- package/dist/runtimes/edge/EdgeChatAdapter.d.ts.map +1 -1
- package/dist/runtimes/edge/EdgeChatAdapter.js +6 -8
- package/dist/runtimes/edge/EdgeChatAdapter.js.map +1 -1
- package/dist/runtimes/edge/EdgeChatAdapter.mjs +9 -8
- package/dist/runtimes/edge/EdgeChatAdapter.mjs.map +1 -1
- package/dist/runtimes/edge/converters/fromLanguageModelMessages.d.ts +2 -2
- package/dist/runtimes/edge/converters/fromLanguageModelMessages.d.ts.map +1 -1
- package/dist/runtimes/edge/converters/fromLanguageModelMessages.js +5 -2
- package/dist/runtimes/edge/converters/fromLanguageModelMessages.js.map +1 -1
- package/dist/runtimes/edge/converters/fromLanguageModelMessages.mjs +5 -2
- package/dist/runtimes/edge/converters/fromLanguageModelMessages.mjs.map +1 -1
- package/dist/runtimes/edge/converters/toCoreMessages.d.ts.map +1 -1
- package/dist/runtimes/edge/converters/toCoreMessages.js +1 -1
- package/dist/runtimes/edge/converters/toCoreMessages.js.map +1 -1
- package/dist/runtimes/edge/converters/toCoreMessages.mjs +1 -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/createEdgeRuntimeAPI.d.ts +2 -2
- package/dist/runtimes/edge/createEdgeRuntimeAPI.d.ts.map +1 -1
- package/dist/runtimes/edge/createEdgeRuntimeAPI.js +17 -34
- package/dist/runtimes/edge/createEdgeRuntimeAPI.js.map +1 -1
- package/dist/runtimes/edge/createEdgeRuntimeAPI.mjs +21 -37
- package/dist/runtimes/edge/createEdgeRuntimeAPI.mjs.map +1 -1
- package/dist/runtimes/edge/index.d.ts +0 -1
- package/dist/runtimes/edge/index.d.ts.map +1 -1
- package/dist/runtimes/edge/index.js +1 -3
- package/dist/runtimes/edge/index.js.map +1 -1
- package/dist/runtimes/edge/index.mjs +0 -1
- package/dist/runtimes/edge/index.mjs.map +1 -1
- package/dist/runtimes/edge/streams/toolResultStream.d.ts +2 -33
- package/dist/runtimes/edge/streams/toolResultStream.d.ts.map +1 -1
- package/dist/runtimes/edge/streams/toolResultStream.js +19 -96
- package/dist/runtimes/edge/streams/toolResultStream.js.map +1 -1
- package/dist/runtimes/edge/streams/toolResultStream.mjs +19 -86
- package/dist/runtimes/edge/streams/toolResultStream.mjs.map +1 -1
- package/dist/runtimes/external-store/ThreadMessageLike.d.ts.map +1 -1
- package/dist/runtimes/external-store/ThreadMessageLike.js +1 -0
- package/dist/runtimes/external-store/ThreadMessageLike.js.map +1 -1
- package/dist/runtimes/external-store/ThreadMessageLike.mjs +1 -0
- package/dist/runtimes/external-store/ThreadMessageLike.mjs.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 +1 -1
- package/dist/runtimes/local/LocalThreadRuntimeCore.d.ts +3 -2
- package/dist/runtimes/local/LocalThreadRuntimeCore.d.ts.map +1 -1
- package/dist/runtimes/local/LocalThreadRuntimeCore.js +22 -7
- package/dist/runtimes/local/LocalThreadRuntimeCore.js.map +1 -1
- package/dist/runtimes/local/LocalThreadRuntimeCore.mjs +22 -7
- package/dist/runtimes/local/LocalThreadRuntimeCore.mjs.map +1 -1
- package/dist/runtimes/remote-thread-list/RemoteThreadListThreadListRuntimeCore.d.ts.map +1 -1
- package/dist/runtimes/remote-thread-list/RemoteThreadListThreadListRuntimeCore.js +1 -1
- package/dist/runtimes/remote-thread-list/RemoteThreadListThreadListRuntimeCore.js.map +1 -1
- package/dist/runtimes/remote-thread-list/RemoteThreadListThreadListRuntimeCore.mjs +1 -1
- package/dist/runtimes/remote-thread-list/RemoteThreadListThreadListRuntimeCore.mjs.map +1 -1
- package/dist/runtimes/utils/MessageRepository.d.ts +1 -0
- package/dist/runtimes/utils/MessageRepository.d.ts.map +1 -1
- package/dist/runtimes/utils/MessageRepository.js +3 -0
- package/dist/runtimes/utils/MessageRepository.js.map +1 -1
- package/dist/runtimes/utils/MessageRepository.mjs +3 -0
- package/dist/runtimes/utils/MessageRepository.mjs.map +1 -1
- package/dist/types/AssistantTypes.d.ts +1 -1
- package/dist/types/AssistantTypes.d.ts.map +1 -1
- package/dist/types/AssistantTypes.js.map +1 -1
- package/dist/utils/json/is-json.d.ts +1 -1
- package/dist/utils/json/is-json.d.ts.map +1 -1
- package/dist/utils/json/is-json.js +10 -4
- package/dist/utils/json/is-json.js.map +1 -1
- package/dist/utils/json/is-json.mjs +10 -4
- package/dist/utils/json/is-json.mjs.map +1 -1
- package/package.json +5 -5
- package/src/cloud/auiV0.ts +9 -2
- package/src/primitives/contentPart/useContentPartFile.tsx +18 -0
- package/src/primitives/contentPart/useContentPartSource.tsx +18 -0
- package/src/primitives/index.ts +3 -1
- package/src/runtimes/adapters/thread-history/ThreadHistoryAdapter.ts +5 -1
- package/src/runtimes/dangerous-in-browser/DangerousInBrowserAdapter.ts +2 -2
- package/src/runtimes/edge/EdgeChatAdapter.ts +18 -19
- package/src/runtimes/edge/converters/fromLanguageModelMessages.ts +24 -14
- package/src/runtimes/edge/converters/toCoreMessages.ts +6 -2
- package/src/runtimes/edge/converters/toLanguageModelMessages.ts +3 -2
- package/src/runtimes/edge/createEdgeRuntimeAPI.ts +25 -47
- package/src/runtimes/edge/index.ts +0 -2
- package/src/runtimes/edge/streams/toolResultStream.ts +28 -152
- package/src/runtimes/external-store/ThreadMessageLike.tsx +2 -1
- package/src/runtimes/local/ChatModelAdapter.tsx +2 -0
- package/src/runtimes/local/LocalThreadRuntimeCore.tsx +31 -7
- package/src/runtimes/remote-thread-list/RemoteThreadListThreadListRuntimeCore.tsx +1 -2
- package/src/runtimes/utils/MessageRepository.tsx +4 -0
- package/src/types/AssistantTypes.ts +2 -1
- package/src/utils/json/is-json.ts +17 -4
- package/dist/runtimes/edge/streams/AssistantStreamChunkType.d.ts +0 -62
- package/dist/runtimes/edge/streams/AssistantStreamChunkType.d.ts.map +0 -1
- package/dist/runtimes/edge/streams/AssistantStreamChunkType.js +0 -46
- package/dist/runtimes/edge/streams/AssistantStreamChunkType.js.map +0 -1
- package/dist/runtimes/edge/streams/AssistantStreamChunkType.mjs +0 -21
- package/dist/runtimes/edge/streams/AssistantStreamChunkType.mjs.map +0 -1
- package/dist/runtimes/edge/streams/assistantDecoderStream.d.ts +0 -5
- package/dist/runtimes/edge/streams/assistantDecoderStream.d.ts.map +0 -1
- package/dist/runtimes/edge/streams/assistantDecoderStream.js +0 -170
- package/dist/runtimes/edge/streams/assistantDecoderStream.js.map +0 -1
- package/dist/runtimes/edge/streams/assistantDecoderStream.mjs +0 -147
- package/dist/runtimes/edge/streams/assistantDecoderStream.mjs.map +0 -1
- package/dist/runtimes/edge/streams/assistantEncoderStream.d.ts +0 -5
- package/dist/runtimes/edge/streams/assistantEncoderStream.d.ts.map +0 -1
- package/dist/runtimes/edge/streams/assistantEncoderStream.js +0 -137
- package/dist/runtimes/edge/streams/assistantEncoderStream.js.map +0 -1
- package/dist/runtimes/edge/streams/assistantEncoderStream.mjs +0 -114
- package/dist/runtimes/edge/streams/assistantEncoderStream.mjs.map +0 -1
- package/dist/runtimes/edge/streams/runResultStream.d.ts +0 -4
- package/dist/runtimes/edge/streams/runResultStream.d.ts.map +0 -1
- package/dist/runtimes/edge/streams/runResultStream.js +0 -313
- package/dist/runtimes/edge/streams/runResultStream.js.map +0 -1
- package/dist/runtimes/edge/streams/runResultStream.mjs +0 -288
- package/dist/runtimes/edge/streams/runResultStream.mjs.map +0 -1
- package/dist/runtimes/edge/streams/utils/PipeableTransformStream.d.ts +0 -4
- package/dist/runtimes/edge/streams/utils/PipeableTransformStream.d.ts.map +0 -1
- package/dist/runtimes/edge/streams/utils/PipeableTransformStream.js.map +0 -1
- package/dist/runtimes/edge/streams/utils/PipeableTransformStream.mjs +0 -15
- package/dist/runtimes/edge/streams/utils/PipeableTransformStream.mjs.map +0 -1
- package/dist/runtimes/edge/streams/utils/StreamPart.d.ts +0 -7
- package/dist/runtimes/edge/streams/utils/StreamPart.d.ts.map +0 -1
- package/dist/runtimes/edge/streams/utils/StreamPart.js +0 -19
- package/dist/runtimes/edge/streams/utils/StreamPart.js.map +0 -1
- package/dist/runtimes/edge/streams/utils/StreamPart.mjs +0 -1
- package/dist/runtimes/edge/streams/utils/StreamPart.mjs.map +0 -1
- package/dist/runtimes/edge/streams/utils/chunkByLineStream.d.ts +0 -2
- package/dist/runtimes/edge/streams/utils/chunkByLineStream.d.ts.map +0 -1
- package/dist/runtimes/edge/streams/utils/chunkByLineStream.js +0 -48
- package/dist/runtimes/edge/streams/utils/chunkByLineStream.js.map +0 -1
- package/dist/runtimes/edge/streams/utils/chunkByLineStream.mjs +0 -23
- package/dist/runtimes/edge/streams/utils/chunkByLineStream.mjs.map +0 -1
- package/dist/runtimes/edge/streams/utils/index.d.ts +0 -14
- package/dist/runtimes/edge/streams/utils/index.d.ts.map +0 -1
- package/dist/runtimes/edge/streams/utils/index.js.map +0 -1
- package/dist/runtimes/edge/streams/utils/index.mjs +0 -11
- package/dist/runtimes/edge/streams/utils/index.mjs.map +0 -1
- package/dist/runtimes/edge/streams/utils/streamPartDecoderStream.d.ts +0 -4
- package/dist/runtimes/edge/streams/utils/streamPartDecoderStream.d.ts.map +0 -1
- package/dist/runtimes/edge/streams/utils/streamPartDecoderStream.js +0 -50
- package/dist/runtimes/edge/streams/utils/streamPartDecoderStream.js.map +0 -1
- package/dist/runtimes/edge/streams/utils/streamPartDecoderStream.mjs +0 -25
- package/dist/runtimes/edge/streams/utils/streamPartDecoderStream.mjs.map +0 -1
- package/dist/runtimes/edge/streams/utils/streamPartEncoderStream.d.ts +0 -3
- package/dist/runtimes/edge/streams/utils/streamPartEncoderStream.d.ts.map +0 -1
- package/dist/runtimes/edge/streams/utils/streamPartEncoderStream.js +0 -48
- package/dist/runtimes/edge/streams/utils/streamPartEncoderStream.js.map +0 -1
- package/dist/runtimes/edge/streams/utils/streamPartEncoderStream.mjs +0 -23
- package/dist/runtimes/edge/streams/utils/streamPartEncoderStream.mjs.map +0 -1
- package/src/runtimes/edge/streams/AssistantStreamChunkType.ts +0 -73
- package/src/runtimes/edge/streams/assistantDecoderStream.ts +0 -170
- package/src/runtimes/edge/streams/assistantEncoderStream.ts +0 -126
- package/src/runtimes/edge/streams/runResultStream.ts +0 -360
- package/src/runtimes/edge/streams/utils/PipeableTransformStream.ts +0 -10
- package/src/runtimes/edge/streams/utils/StreamPart.ts +0 -3
- package/src/runtimes/edge/streams/utils/chunkByLineStream.ts +0 -24
- package/src/runtimes/edge/streams/utils/index.ts +0 -15
- package/src/runtimes/edge/streams/utils/streamPartDecoderStream.ts +0 -29
- package/src/runtimes/edge/streams/utils/streamPartEncoderStream.ts +0 -23
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"auiV0.d.ts","sourceRoot":"","sources":["../../src/cloud/auiV0.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAE9D,OAAO,EACL,kBAA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QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;gBAC9B,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;aACnC,CAAC;SACH,EAAE,CAAC;QACJ,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,UAAU,CAAC,CAAC;KACvC,CAAC;CACH,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,SAAS,aAAa,KAAG,YA2EpD,CAAC;AAEF,eAAO,MAAM,WAAW,GACtB,cAAc,YAAY,GAAG;IAAE,MAAM,EAAE,QAAQ,CAAA;CAAE,KAChD,6BAmBF,CAAC"}
|
package/dist/cloud/auiV0.js
CHANGED
@@ -44,8 +44,15 @@ var auiV0Encode = (message) => {
|
|
44
44
|
text: part.text
|
45
45
|
};
|
46
46
|
}
|
47
|
-
case "source":
|
48
|
-
return
|
47
|
+
case "source": {
|
48
|
+
return {
|
49
|
+
type: "source",
|
50
|
+
sourceType: part.sourceType,
|
51
|
+
id: part.id,
|
52
|
+
url: part.url,
|
53
|
+
...part.title ? { title: part.title } : void 0
|
54
|
+
};
|
55
|
+
}
|
49
56
|
case "tool-call": {
|
50
57
|
if (!(0, import_is_json.isJSONValue)(part.result)) {
|
51
58
|
console.warn(
|
package/dist/cloud/auiV0.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../src/cloud/auiV0.ts"],"sourcesContent":["import { JSONObject } from \"@ai-sdk/provider\";\nimport { ThreadMessage } from \"../types\";\nimport { MessageStatus } from \"../types/AssistantTypes\";\nimport { fromThreadMessageLike } from \"../runtimes/external-store/ThreadMessageLike\";\nimport { CloudMessage } from \"./AssistantCloudThreadMessages\";\nimport { isJSONValue } from \"../utils/json/is-json\";\nimport {\n ReadonlyJSONObject,\n ReadonlyJSONValue,\n} from \"../utils/json/json-value\";\nimport { ExportedMessageRepositoryItem } from \"../runtimes/utils/MessageRepository\";\n\ntype AuiV0MessageContentPart =\n | {\n readonly type: \"text\";\n readonly text: string;\n }\n | {\n readonly type: \"reasoning\";\n readonly text: string;\n }\n | {\n readonly type: \"source\";\n readonly sourceType: \"url\";\n readonly id: string;\n readonly url: string;\n readonly title?: string;\n }\n | {\n readonly type: \"tool-call\";\n readonly toolCallId: string;\n readonly toolName: string;\n readonly args: ReadonlyJSONObject;\n readonly result?: ReadonlyJSONValue;\n readonly isError?: true;\n }\n | {\n readonly type: \"tool-call\";\n readonly toolCallId: string;\n readonly toolName: string;\n readonly argsText: string;\n readonly result?: ReadonlyJSONValue;\n readonly isError?: true;\n };\n\ntype AuiV0Message = {\n readonly role: \"assistant\" | \"user\" | \"system\";\n readonly status?: MessageStatus;\n readonly content: readonly AuiV0MessageContentPart[];\n readonly metadata: {\n readonly unstable_annotations: readonly ReadonlyJSONValue[];\n readonly unstable_data: readonly ReadonlyJSONValue[];\n readonly steps: readonly {\n readonly usage?: {\n readonly promptTokens: number;\n readonly completionTokens: number;\n };\n }[];\n readonly custom: Readonly<JSONObject>;\n };\n};\n\nexport const auiV0Encode = (message: ThreadMessage): AuiV0Message => {\n // TODO attachments are currently intentionally ignored\n // info: ID and createdAt are ignored (we use the server value instead)\n return {\n role: message.role,\n content: message.content.map((part) => {\n const type = part.type;\n switch (type) {\n case \"text\": {\n return {\n type: \"text\",\n text: part.text,\n };\n }\n\n case \"reasoning\": {\n return {\n type: \"reasoning\",\n text: part.text,\n };\n }\n\n case \"source\"
|
1
|
+
{"version":3,"sources":["../../src/cloud/auiV0.ts"],"sourcesContent":["import { JSONObject } from \"@ai-sdk/provider\";\nimport { ThreadMessage } from \"../types\";\nimport { MessageStatus } from \"../types/AssistantTypes\";\nimport { fromThreadMessageLike } from \"../runtimes/external-store/ThreadMessageLike\";\nimport { CloudMessage } from \"./AssistantCloudThreadMessages\";\nimport { isJSONValue } from \"../utils/json/is-json\";\nimport {\n ReadonlyJSONObject,\n ReadonlyJSONValue,\n} from \"../utils/json/json-value\";\nimport { ExportedMessageRepositoryItem } from \"../runtimes/utils/MessageRepository\";\n\ntype AuiV0MessageContentPart =\n | {\n readonly type: \"text\";\n readonly text: string;\n }\n | {\n readonly type: \"reasoning\";\n readonly text: string;\n }\n | {\n readonly type: \"source\";\n readonly sourceType: \"url\";\n readonly id: string;\n readonly url: string;\n readonly title?: string;\n }\n | {\n readonly type: \"tool-call\";\n readonly toolCallId: string;\n readonly toolName: string;\n readonly args: ReadonlyJSONObject;\n readonly result?: ReadonlyJSONValue;\n readonly isError?: true;\n }\n | {\n readonly type: \"tool-call\";\n readonly toolCallId: string;\n readonly toolName: string;\n readonly argsText: string;\n readonly result?: ReadonlyJSONValue;\n readonly isError?: true;\n };\n\ntype AuiV0Message = {\n readonly role: \"assistant\" | \"user\" | \"system\";\n readonly status?: MessageStatus;\n readonly content: readonly AuiV0MessageContentPart[];\n readonly metadata: {\n readonly unstable_annotations: readonly ReadonlyJSONValue[];\n readonly unstable_data: readonly ReadonlyJSONValue[];\n readonly steps: readonly {\n readonly usage?: {\n readonly promptTokens: number;\n readonly completionTokens: number;\n };\n }[];\n readonly custom: Readonly<JSONObject>;\n };\n};\n\nexport const auiV0Encode = (message: ThreadMessage): AuiV0Message => {\n // TODO attachments are currently intentionally ignored\n // info: ID and createdAt are ignored (we use the server value instead)\n return {\n role: message.role,\n content: message.content.map((part) => {\n const type = part.type;\n switch (type) {\n case \"text\": {\n return {\n type: \"text\",\n text: part.text,\n };\n }\n\n case \"reasoning\": {\n return {\n type: \"reasoning\",\n text: part.text,\n };\n }\n\n case \"source\": {\n return {\n type: \"source\",\n sourceType: part.sourceType,\n id: part.id,\n url: part.url,\n ...(part.title ? { title: part.title } : undefined),\n };\n }\n\n case \"tool-call\": {\n if (!isJSONValue(part.result)) {\n console.warn(\n \"tool-call result is not JSON! \" + JSON.stringify(part),\n );\n }\n return {\n type: \"tool-call\",\n toolCallId: part.toolCallId,\n toolName: part.toolName,\n ...(JSON.stringify(part.args) === part.argsText\n ? {\n args: part.args,\n }\n : { argsText: part.argsText }),\n ...(part.result\n ? { result: part.result as ReadonlyJSONValue }\n : {}),\n ...(part.isError ? { isError: true } : {}),\n };\n }\n\n default: {\n const unhandledType: \"image\" | \"file\" | \"audio\" = type;\n throw new Error(\n `Content part type not supported by aui/v0: ${unhandledType}`,\n );\n }\n }\n }),\n metadata: message.metadata as AuiV0Message[\"metadata\"],\n ...(message.status\n ? {\n status:\n message.status?.type === \"running\"\n ? {\n type: \"incomplete\",\n reason: \"cancelled\",\n }\n : message.status,\n }\n : undefined),\n };\n};\n\nexport const auiV0Decode = (\n cloudMessage: CloudMessage & { format: \"aui/v0\" },\n): ExportedMessageRepositoryItem => {\n const payload = cloudMessage.content as unknown as AuiV0Message;\n const message = fromThreadMessageLike(\n {\n id: cloudMessage.id,\n createdAt: cloudMessage.created_at,\n ...payload,\n },\n cloudMessage.id,\n {\n type: \"complete\",\n reason: \"unknown\",\n },\n );\n\n return {\n parentId: cloudMessage.parent_id,\n message,\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,+BAAsC;AAEtC,qBAA4B;AAyDrB,IAAM,cAAc,CAAC,YAAyC;AAGnE,SAAO;AAAA,IACL,MAAM,QAAQ;AAAA,IACd,SAAS,QAAQ,QAAQ,IAAI,CAAC,SAAS;AACrC,YAAM,OAAO,KAAK;AAClB,cAAQ,MAAM;AAAA,QACZ,KAAK,QAAQ;AACX,iBAAO;AAAA,YACL,MAAM;AAAA,YACN,MAAM,KAAK;AAAA,UACb;AAAA,QACF;AAAA,QAEA,KAAK,aAAa;AAChB,iBAAO;AAAA,YACL,MAAM;AAAA,YACN,MAAM,KAAK;AAAA,UACb;AAAA,QACF;AAAA,QAEA,KAAK,UAAU;AACb,iBAAO;AAAA,YACL,MAAM;AAAA,YACN,YAAY,KAAK;AAAA,YACjB,IAAI,KAAK;AAAA,YACT,KAAK,KAAK;AAAA,YACV,GAAI,KAAK,QAAQ,EAAE,OAAO,KAAK,MAAM,IAAI;AAAA,UAC3C;AAAA,QACF;AAAA,QAEA,KAAK,aAAa;AAChB,cAAI,KAAC,4BAAY,KAAK,MAAM,GAAG;AAC7B,oBAAQ;AAAA,cACN,mCAAmC,KAAK,UAAU,IAAI;AAAA,YACxD;AAAA,UACF;AACA,iBAAO;AAAA,YACL,MAAM;AAAA,YACN,YAAY,KAAK;AAAA,YACjB,UAAU,KAAK;AAAA,YACf,GAAI,KAAK,UAAU,KAAK,IAAI,MAAM,KAAK,WACnC;AAAA,cACE,MAAM,KAAK;AAAA,YACb,IACA,EAAE,UAAU,KAAK,SAAS;AAAA,YAC9B,GAAI,KAAK,SACL,EAAE,QAAQ,KAAK,OAA4B,IAC3C,CAAC;AAAA,YACL,GAAI,KAAK,UAAU,EAAE,SAAS,KAAK,IAAI,CAAC;AAAA,UAC1C;AAAA,QACF;AAAA,QAEA,SAAS;AACP,gBAAM,gBAA4C;AAClD,gBAAM,IAAI;AAAA,YACR,8CAA8C,aAAa;AAAA,UAC7D;AAAA,QACF;AAAA,MACF;AAAA,IACF,CAAC;AAAA,IACD,UAAU,QAAQ;AAAA,IAClB,GAAI,QAAQ,SACR;AAAA,MACE,QACE,QAAQ,QAAQ,SAAS,YACrB;AAAA,QACE,MAAM;AAAA,QACN,QAAQ;AAAA,MACV,IACA,QAAQ;AAAA,IAChB,IACA;AAAA,EACN;AACF;AAEO,IAAM,cAAc,CACzB,iBACkC;AAClC,QAAM,UAAU,aAAa;AAC7B,QAAM,cAAU;AAAA,IACd;AAAA,MACE,IAAI,aAAa;AAAA,MACjB,WAAW,aAAa;AAAA,MACxB,GAAG;AAAA,IACL;AAAA,IACA,aAAa;AAAA,IACb;AAAA,MACE,MAAM;AAAA,MACN,QAAQ;AAAA,IACV;AAAA,EACF;AAEA,SAAO;AAAA,IACL,UAAU,aAAa;AAAA,IACvB;AAAA,EACF;AACF;","names":[]}
|
package/dist/cloud/auiV0.mjs
CHANGED
@@ -19,8 +19,15 @@ var auiV0Encode = (message) => {
|
|
19
19
|
text: part.text
|
20
20
|
};
|
21
21
|
}
|
22
|
-
case "source":
|
23
|
-
return
|
22
|
+
case "source": {
|
23
|
+
return {
|
24
|
+
type: "source",
|
25
|
+
sourceType: part.sourceType,
|
26
|
+
id: part.id,
|
27
|
+
url: part.url,
|
28
|
+
...part.title ? { title: part.title } : void 0
|
29
|
+
};
|
30
|
+
}
|
24
31
|
case "tool-call": {
|
25
32
|
if (!isJSONValue(part.result)) {
|
26
33
|
console.warn(
|
package/dist/cloud/auiV0.mjs.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../src/cloud/auiV0.ts"],"sourcesContent":["import { JSONObject } from \"@ai-sdk/provider\";\nimport { ThreadMessage } from \"../types\";\nimport { MessageStatus } from \"../types/AssistantTypes\";\nimport { fromThreadMessageLike } from \"../runtimes/external-store/ThreadMessageLike\";\nimport { CloudMessage } from \"./AssistantCloudThreadMessages\";\nimport { isJSONValue } from \"../utils/json/is-json\";\nimport {\n ReadonlyJSONObject,\n ReadonlyJSONValue,\n} from \"../utils/json/json-value\";\nimport { ExportedMessageRepositoryItem } from \"../runtimes/utils/MessageRepository\";\n\ntype AuiV0MessageContentPart =\n | {\n readonly type: \"text\";\n readonly text: string;\n }\n | {\n readonly type: \"reasoning\";\n readonly text: string;\n }\n | {\n readonly type: \"source\";\n readonly sourceType: \"url\";\n readonly id: string;\n readonly url: string;\n readonly title?: string;\n }\n | {\n readonly type: \"tool-call\";\n readonly toolCallId: string;\n readonly toolName: string;\n readonly args: ReadonlyJSONObject;\n readonly result?: ReadonlyJSONValue;\n readonly isError?: true;\n }\n | {\n readonly type: \"tool-call\";\n readonly toolCallId: string;\n readonly toolName: string;\n readonly argsText: string;\n readonly result?: ReadonlyJSONValue;\n readonly isError?: true;\n };\n\ntype AuiV0Message = {\n readonly role: \"assistant\" | \"user\" | \"system\";\n readonly status?: MessageStatus;\n readonly content: readonly AuiV0MessageContentPart[];\n readonly metadata: {\n readonly unstable_annotations: readonly ReadonlyJSONValue[];\n readonly unstable_data: readonly ReadonlyJSONValue[];\n readonly steps: readonly {\n readonly usage?: {\n readonly promptTokens: number;\n readonly completionTokens: number;\n };\n }[];\n readonly custom: Readonly<JSONObject>;\n };\n};\n\nexport const auiV0Encode = (message: ThreadMessage): AuiV0Message => {\n // TODO attachments are currently intentionally ignored\n // info: ID and createdAt are ignored (we use the server value instead)\n return {\n role: message.role,\n content: message.content.map((part) => {\n const type = part.type;\n switch (type) {\n case \"text\": {\n return {\n type: \"text\",\n text: part.text,\n };\n }\n\n case \"reasoning\": {\n return {\n type: \"reasoning\",\n text: part.text,\n };\n }\n\n case \"source\"
|
1
|
+
{"version":3,"sources":["../../src/cloud/auiV0.ts"],"sourcesContent":["import { JSONObject } from \"@ai-sdk/provider\";\nimport { ThreadMessage } from \"../types\";\nimport { MessageStatus } from \"../types/AssistantTypes\";\nimport { fromThreadMessageLike } from \"../runtimes/external-store/ThreadMessageLike\";\nimport { CloudMessage } from \"./AssistantCloudThreadMessages\";\nimport { isJSONValue } from \"../utils/json/is-json\";\nimport {\n ReadonlyJSONObject,\n ReadonlyJSONValue,\n} from \"../utils/json/json-value\";\nimport { ExportedMessageRepositoryItem } from \"../runtimes/utils/MessageRepository\";\n\ntype AuiV0MessageContentPart =\n | {\n readonly type: \"text\";\n readonly text: string;\n }\n | {\n readonly type: \"reasoning\";\n readonly text: string;\n }\n | {\n readonly type: \"source\";\n readonly sourceType: \"url\";\n readonly id: string;\n readonly url: string;\n readonly title?: string;\n }\n | {\n readonly type: \"tool-call\";\n readonly toolCallId: string;\n readonly toolName: string;\n readonly args: ReadonlyJSONObject;\n readonly result?: ReadonlyJSONValue;\n readonly isError?: true;\n }\n | {\n readonly type: \"tool-call\";\n readonly toolCallId: string;\n readonly toolName: string;\n readonly argsText: string;\n readonly result?: ReadonlyJSONValue;\n readonly isError?: true;\n };\n\ntype AuiV0Message = {\n readonly role: \"assistant\" | \"user\" | \"system\";\n readonly status?: MessageStatus;\n readonly content: readonly AuiV0MessageContentPart[];\n readonly metadata: {\n readonly unstable_annotations: readonly ReadonlyJSONValue[];\n readonly unstable_data: readonly ReadonlyJSONValue[];\n readonly steps: readonly {\n readonly usage?: {\n readonly promptTokens: number;\n readonly completionTokens: number;\n };\n }[];\n readonly custom: Readonly<JSONObject>;\n };\n};\n\nexport const auiV0Encode = (message: ThreadMessage): AuiV0Message => {\n // TODO attachments are currently intentionally ignored\n // info: ID and createdAt are ignored (we use the server value instead)\n return {\n role: message.role,\n content: message.content.map((part) => {\n const type = part.type;\n switch (type) {\n case \"text\": {\n return {\n type: \"text\",\n text: part.text,\n };\n }\n\n case \"reasoning\": {\n return {\n type: \"reasoning\",\n text: part.text,\n };\n }\n\n case \"source\": {\n return {\n type: \"source\",\n sourceType: part.sourceType,\n id: part.id,\n url: part.url,\n ...(part.title ? { title: part.title } : undefined),\n };\n }\n\n case \"tool-call\": {\n if (!isJSONValue(part.result)) {\n console.warn(\n \"tool-call result is not JSON! \" + JSON.stringify(part),\n );\n }\n return {\n type: \"tool-call\",\n toolCallId: part.toolCallId,\n toolName: part.toolName,\n ...(JSON.stringify(part.args) === part.argsText\n ? {\n args: part.args,\n }\n : { argsText: part.argsText }),\n ...(part.result\n ? { result: part.result as ReadonlyJSONValue }\n : {}),\n ...(part.isError ? { isError: true } : {}),\n };\n }\n\n default: {\n const unhandledType: \"image\" | \"file\" | \"audio\" = type;\n throw new Error(\n `Content part type not supported by aui/v0: ${unhandledType}`,\n );\n }\n }\n }),\n metadata: message.metadata as AuiV0Message[\"metadata\"],\n ...(message.status\n ? {\n status:\n message.status?.type === \"running\"\n ? {\n type: \"incomplete\",\n reason: \"cancelled\",\n }\n : message.status,\n }\n : undefined),\n };\n};\n\nexport const auiV0Decode = (\n cloudMessage: CloudMessage & { format: \"aui/v0\" },\n): ExportedMessageRepositoryItem => {\n const payload = cloudMessage.content as unknown as AuiV0Message;\n const message = fromThreadMessageLike(\n {\n id: cloudMessage.id,\n createdAt: cloudMessage.created_at,\n ...payload,\n },\n cloudMessage.id,\n {\n type: \"complete\",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I;AAAA,YACR,8CAA8C,aAAa;AAAA,UAC7D;AAAA,QACF;AAAA,MACF;AAAA,IACF,CAAC;AAAA,IACD,UAAU,QAAQ;AAAA,IAClB,GAAI,QAAQ,SACR;AAAA,MACE,QACE,QAAQ,QAAQ,SAAS,YACrB;AAAA,QACE,MAAM;AAAA,QACN,QAAQ;AAAA,MACV,IACA,QAAQ;AAAA,IAChB,IACA;AAAA,EACN;AACF;AAEO,IAAM,cAAc,CACzB,iBACkC;AAClC,QAAM,UAAU,aAAa;AAC7B,QAAM,UAAU;AAAA,IACd;AAAA,MACE,IAAI,aAAa;AAAA,MACjB,WAAW,aAAa;AAAA,MACxB,GAAG;AAAA,IACL;AAAA,IACA,aAAa;AAAA,IACb;AAAA,MACE,MAAM;AAAA,MACN,QAAQ;AAAA,IACV;AAAA,EACF;AAEA,SAAO;AAAA,IACL,UAAU,aAAa;AAAA,IACvB;AAAA,EACF;AACF;","names":[]}
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import { FileContentPart } from "../../types";
|
2
|
+
export declare const useContentPartFile: () => FileContentPart & {
|
3
|
+
readonly status: import("../../types/AssistantTypes").ContentPartStatus | import("../../types/AssistantTypes").ToolCallContentPartStatus;
|
4
|
+
};
|
5
|
+
//# sourceMappingURL=useContentPartFile.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"useContentPartFile.d.ts","sourceRoot":"","sources":["../../../src/primitives/contentPart/useContentPartFile.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C,eAAO,MAAM,kBAAkB;;CAW9B,CAAC"}
|
package/dist/{runtimes/edge/streams/utils/index.js → primitives/contentPart/useContentPartFile.js}
RENAMED
@@ -1,4 +1,5 @@
|
|
1
1
|
"use strict";
|
2
|
+
"use client";
|
2
3
|
var __defProp = Object.defineProperty;
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
@@ -17,20 +18,25 @@ var __copyProps = (to, from, except, desc) => {
|
|
17
18
|
};
|
18
19
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
19
20
|
|
20
|
-
// src/
|
21
|
-
var
|
22
|
-
__export(
|
23
|
-
|
21
|
+
// src/primitives/contentPart/useContentPartFile.tsx
|
22
|
+
var useContentPartFile_exports = {};
|
23
|
+
__export(useContentPartFile_exports, {
|
24
|
+
useContentPartFile: () => useContentPartFile
|
24
25
|
});
|
25
|
-
module.exports = __toCommonJS(
|
26
|
-
var
|
27
|
-
var
|
28
|
-
|
29
|
-
|
30
|
-
|
26
|
+
module.exports = __toCommonJS(useContentPartFile_exports);
|
27
|
+
var import_ContentPartContext = require("../../context/react/ContentPartContext.js");
|
28
|
+
var useContentPartFile = () => {
|
29
|
+
const file = (0, import_ContentPartContext.useContentPart)((c) => {
|
30
|
+
if (c.type !== "file")
|
31
|
+
throw new Error(
|
32
|
+
"ContentPartFile can only be used inside file content parts."
|
33
|
+
);
|
34
|
+
return c;
|
35
|
+
});
|
36
|
+
return file;
|
31
37
|
};
|
32
38
|
// Annotate the CommonJS export names for ESM import in node:
|
33
39
|
0 && (module.exports = {
|
34
|
-
|
40
|
+
useContentPartFile
|
35
41
|
});
|
36
|
-
//# sourceMappingURL=
|
42
|
+
//# sourceMappingURL=useContentPartFile.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../../src/primitives/contentPart/useContentPartFile.tsx"],"sourcesContent":["\"use client\";\n\nimport { ContentPartState } from \"../../api/ContentPartRuntime\";\nimport { useContentPart } from \"../../context/react/ContentPartContext\";\nimport { FileContentPart } from \"../../types\";\n\nexport const useContentPartFile = () => {\n const file = useContentPart((c) => {\n if (c.type !== \"file\")\n throw new Error(\n \"ContentPartFile can only be used inside file content parts.\",\n );\n\n return c as ContentPartState & FileContentPart;\n });\n\n return file;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,gCAA+B;AAGxB,IAAM,qBAAqB,MAAM;AACtC,QAAM,WAAO,0CAAe,CAAC,MAAM;AACjC,QAAI,EAAE,SAAS;AACb,YAAM,IAAI;AAAA,QACR;AAAA,MACF;AAEF,WAAO;AAAA,EACT,CAAC;AAED,SAAO;AACT;","names":[]}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
"use client";
|
2
|
+
|
3
|
+
// src/primitives/contentPart/useContentPartFile.tsx
|
4
|
+
import { useContentPart } from "../../context/react/ContentPartContext.mjs";
|
5
|
+
var useContentPartFile = () => {
|
6
|
+
const file = useContentPart((c) => {
|
7
|
+
if (c.type !== "file")
|
8
|
+
throw new Error(
|
9
|
+
"ContentPartFile can only be used inside file content parts."
|
10
|
+
);
|
11
|
+
return c;
|
12
|
+
});
|
13
|
+
return file;
|
14
|
+
};
|
15
|
+
export {
|
16
|
+
useContentPartFile
|
17
|
+
};
|
18
|
+
//# sourceMappingURL=useContentPartFile.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../../src/primitives/contentPart/useContentPartFile.tsx"],"sourcesContent":["\"use client\";\n\nimport { ContentPartState } from \"../../api/ContentPartRuntime\";\nimport { useContentPart } from \"../../context/react/ContentPartContext\";\nimport { FileContentPart } from \"../../types\";\n\nexport const useContentPartFile = () => {\n const file = useContentPart((c) => {\n if (c.type !== \"file\")\n throw new Error(\n \"ContentPartFile can only be used inside file content parts.\",\n );\n\n return c as ContentPartState & FileContentPart;\n });\n\n return file;\n};\n"],"mappings":";;;AAGA,SAAS,sBAAsB;AAGxB,IAAM,qBAAqB,MAAM;AACtC,QAAM,OAAO,eAAe,CAAC,MAAM;AACjC,QAAI,EAAE,SAAS;AACb,YAAM,IAAI;AAAA,QACR;AAAA,MACF;AAEF,WAAO;AAAA,EACT,CAAC;AAED,SAAO;AACT;","names":[]}
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import { SourceContentPart } from "../../types";
|
2
|
+
export declare const useContentPartSource: () => SourceContentPart & {
|
3
|
+
readonly status: import("../../types/AssistantTypes").ContentPartStatus | import("../../types/AssistantTypes").ToolCallContentPartStatus;
|
4
|
+
};
|
5
|
+
//# sourceMappingURL=useContentPartSource.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"useContentPartSource.d.ts","sourceRoot":"","sources":["../../../src/primitives/contentPart/useContentPartSource.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,eAAO,MAAM,oBAAoB;;CAWhC,CAAC"}
|
@@ -1,4 +1,5 @@
|
|
1
1
|
"use strict";
|
2
|
+
"use client";
|
2
3
|
var __defProp = Object.defineProperty;
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
@@ -17,24 +18,25 @@ var __copyProps = (to, from, except, desc) => {
|
|
17
18
|
};
|
18
19
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
19
20
|
|
20
|
-
// src/
|
21
|
-
var
|
22
|
-
__export(
|
23
|
-
|
21
|
+
// src/primitives/contentPart/useContentPartSource.tsx
|
22
|
+
var useContentPartSource_exports = {};
|
23
|
+
__export(useContentPartSource_exports, {
|
24
|
+
useContentPartSource: () => useContentPartSource
|
24
25
|
});
|
25
|
-
module.exports = __toCommonJS(
|
26
|
-
var
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
}
|
26
|
+
module.exports = __toCommonJS(useContentPartSource_exports);
|
27
|
+
var import_ContentPartContext = require("../../context/react/ContentPartContext.js");
|
28
|
+
var useContentPartSource = () => {
|
29
|
+
const source = (0, import_ContentPartContext.useContentPart)((c) => {
|
30
|
+
if (c.type !== "source")
|
31
|
+
throw new Error(
|
32
|
+
"ContentPartSource can only be used inside source content parts."
|
33
|
+
);
|
34
|
+
return c;
|
35
|
+
});
|
36
|
+
return source;
|
35
37
|
};
|
36
38
|
// Annotate the CommonJS export names for ESM import in node:
|
37
39
|
0 && (module.exports = {
|
38
|
-
|
40
|
+
useContentPartSource
|
39
41
|
});
|
40
|
-
//# sourceMappingURL=
|
42
|
+
//# sourceMappingURL=useContentPartSource.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../../src/primitives/contentPart/useContentPartSource.tsx"],"sourcesContent":["\"use client\";\n\nimport { ContentPartState } from \"../../api/ContentPartRuntime\";\nimport { useContentPart } from \"../../context/react/ContentPartContext\";\nimport { SourceContentPart } from \"../../types\";\n\nexport const useContentPartSource = () => {\n const source = useContentPart((c) => {\n if (c.type !== \"source\")\n throw new Error(\n \"ContentPartSource can only be used inside source content parts.\",\n );\n\n return c as ContentPartState & SourceContentPart;\n });\n\n return source;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,gCAA+B;AAGxB,IAAM,uBAAuB,MAAM;AACxC,QAAM,aAAS,0CAAe,CAAC,MAAM;AACnC,QAAI,EAAE,SAAS;AACb,YAAM,IAAI;AAAA,QACR;AAAA,MACF;AAEF,WAAO;AAAA,EACT,CAAC;AAED,SAAO;AACT;","names":[]}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
"use client";
|
2
|
+
|
3
|
+
// src/primitives/contentPart/useContentPartSource.tsx
|
4
|
+
import { useContentPart } from "../../context/react/ContentPartContext.mjs";
|
5
|
+
var useContentPartSource = () => {
|
6
|
+
const source = useContentPart((c) => {
|
7
|
+
if (c.type !== "source")
|
8
|
+
throw new Error(
|
9
|
+
"ContentPartSource can only be used inside source content parts."
|
10
|
+
);
|
11
|
+
return c;
|
12
|
+
});
|
13
|
+
return source;
|
14
|
+
};
|
15
|
+
export {
|
16
|
+
useContentPartSource
|
17
|
+
};
|
18
|
+
//# sourceMappingURL=useContentPartSource.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../../src/primitives/contentPart/useContentPartSource.tsx"],"sourcesContent":["\"use client\";\n\nimport { ContentPartState } from \"../../api/ContentPartRuntime\";\nimport { useContentPart } from \"../../context/react/ContentPartContext\";\nimport { SourceContentPart } from \"../../types\";\n\nexport const useContentPartSource = () => {\n const source = useContentPart((c) => {\n if (c.type !== \"source\")\n throw new Error(\n \"ContentPartSource can only be used inside source content parts.\",\n );\n\n return c as ContentPartState & SourceContentPart;\n });\n\n return source;\n};\n"],"mappings":";;;AAGA,SAAS,sBAAsB;AAGxB,IAAM,uBAAuB,MAAM;AACxC,QAAM,SAAS,eAAe,CAAC,MAAM;AACnC,QAAI,EAAE,SAAS;AACb,YAAM,IAAI;AAAA,QACR;AAAA,MACF;AAEF,WAAO;AAAA,EACT,CAAC;AAED,SAAO;AACT;","names":[]}
|
@@ -8,8 +8,10 @@ export * as MessagePrimitive from "./message";
|
|
8
8
|
export * as ThreadPrimitive from "./thread";
|
9
9
|
export * as ThreadListPrimitive from "./threadList";
|
10
10
|
export * as ThreadListItemPrimitive from "./threadListItem";
|
11
|
-
export { useContentPartImage } from "./contentPart/useContentPartImage";
|
12
11
|
export { useContentPartText } from "./contentPart/useContentPartText";
|
13
12
|
export { useContentPartReasoning } from "./contentPart/useContentPartReasoning";
|
13
|
+
export { useContentPartSource } from "./contentPart/useContentPartSource";
|
14
|
+
export { useContentPartFile } from "./contentPart/useContentPartFile";
|
15
|
+
export { useContentPartImage } from "./contentPart/useContentPartImage";
|
14
16
|
export { useThreadViewportAutoScroll } from "./thread/useThreadViewportAutoScroll";
|
15
17
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/primitives/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,kBAAkB,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,uBAAuB,MAAM,kBAAkB,CAAC;AAC5D,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dist/primitives/index.js
CHANGED
@@ -40,8 +40,10 @@ __export(primitives_exports, {
|
|
40
40
|
ThreadListItemPrimitive: () => ThreadListItemPrimitive,
|
41
41
|
ThreadListPrimitive: () => ThreadListPrimitive,
|
42
42
|
ThreadPrimitive: () => ThreadPrimitive,
|
43
|
+
useContentPartFile: () => import_useContentPartFile.useContentPartFile,
|
43
44
|
useContentPartImage: () => import_useContentPartImage.useContentPartImage,
|
44
45
|
useContentPartReasoning: () => import_useContentPartReasoning.useContentPartReasoning,
|
46
|
+
useContentPartSource: () => import_useContentPartSource.useContentPartSource,
|
45
47
|
useContentPartText: () => import_useContentPartText.useContentPartText,
|
46
48
|
useThreadViewportAutoScroll: () => import_useThreadViewportAutoScroll.useThreadViewportAutoScroll
|
47
49
|
});
|
@@ -56,9 +58,11 @@ var MessagePrimitive = __toESM(require("./message/index.js"));
|
|
56
58
|
var ThreadPrimitive = __toESM(require("./thread/index.js"));
|
57
59
|
var ThreadListPrimitive = __toESM(require("./threadList/index.js"));
|
58
60
|
var ThreadListItemPrimitive = __toESM(require("./threadListItem/index.js"));
|
59
|
-
var import_useContentPartImage = require("./contentPart/useContentPartImage.js");
|
60
61
|
var import_useContentPartText = require("./contentPart/useContentPartText.js");
|
61
62
|
var import_useContentPartReasoning = require("./contentPart/useContentPartReasoning.js");
|
63
|
+
var import_useContentPartSource = require("./contentPart/useContentPartSource.js");
|
64
|
+
var import_useContentPartFile = require("./contentPart/useContentPartFile.js");
|
65
|
+
var import_useContentPartImage = require("./contentPart/useContentPartImage.js");
|
62
66
|
var import_useThreadViewportAutoScroll = require("./thread/useThreadViewportAutoScroll.js");
|
63
67
|
// Annotate the CommonJS export names for ESM import in node:
|
64
68
|
0 && (module.exports = {
|
@@ -72,8 +76,10 @@ var import_useThreadViewportAutoScroll = require("./thread/useThreadViewportAuto
|
|
72
76
|
ThreadListItemPrimitive,
|
73
77
|
ThreadListPrimitive,
|
74
78
|
ThreadPrimitive,
|
79
|
+
useContentPartFile,
|
75
80
|
useContentPartImage,
|
76
81
|
useContentPartReasoning,
|
82
|
+
useContentPartSource,
|
77
83
|
useContentPartText,
|
78
84
|
useThreadViewportAutoScroll
|
79
85
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../src/primitives/index.ts"],"sourcesContent":["export * as ActionBarPrimitive from \"./actionBar\";\nexport * as AssistantModalPrimitive from \"./assistantModal\";\nexport * as AttachmentPrimitive from \"./attachment\";\nexport * as BranchPickerPrimitive from \"./branchPicker\";\nexport * as ComposerPrimitive from \"./composer\";\nexport * as ContentPartPrimitive from \"./contentPart\";\nexport * as MessagePrimitive from \"./message\";\nexport * as ThreadPrimitive from \"./thread\";\nexport * as ThreadListPrimitive from \"./threadList\";\nexport * as ThreadListItemPrimitive from \"./threadListItem\";\n\nexport {
|
1
|
+
{"version":3,"sources":["../../src/primitives/index.ts"],"sourcesContent":["export * as ActionBarPrimitive from \"./actionBar\";\nexport * as AssistantModalPrimitive from \"./assistantModal\";\nexport * as AttachmentPrimitive from \"./attachment\";\nexport * as BranchPickerPrimitive from \"./branchPicker\";\nexport * as ComposerPrimitive from \"./composer\";\nexport * as ContentPartPrimitive from \"./contentPart\";\nexport * as MessagePrimitive from \"./message\";\nexport * as ThreadPrimitive from \"./thread\";\nexport * as ThreadListPrimitive from \"./threadList\";\nexport * as ThreadListItemPrimitive from \"./threadListItem\";\n\nexport { useContentPartText } from \"./contentPart/useContentPartText\";\nexport { useContentPartReasoning } from \"./contentPart/useContentPartReasoning\";\nexport { useContentPartSource } from \"./contentPart/useContentPartSource\";\nexport { useContentPartFile } from \"./contentPart/useContentPartFile\";\nexport { useContentPartImage } from \"./contentPart/useContentPartImage\";\nexport { useThreadViewportAutoScroll } from \"./thread/useThreadViewportAutoScroll\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAAoC;AACpC,8BAAyC;AACzC,0BAAqC;AACrC,4BAAuC;AACvC,wBAAmC;AACnC,2BAAsC;AACtC,uBAAkC;AAClC,sBAAiC;AACjC,0BAAqC;AACrC,8BAAyC;AAEzC,gCAAmC;AACnC,qCAAwC;AACxC,kCAAqC;AACrC,gCAAmC;AACnC,iCAAoC;AACpC,yCAA4C;","names":[]}
|
@@ -9,9 +9,11 @@ import * as MessagePrimitive from "./message/index.mjs";
|
|
9
9
|
import * as ThreadPrimitive from "./thread/index.mjs";
|
10
10
|
import * as ThreadListPrimitive from "./threadList/index.mjs";
|
11
11
|
import * as ThreadListItemPrimitive from "./threadListItem/index.mjs";
|
12
|
-
import { useContentPartImage } from "./contentPart/useContentPartImage.mjs";
|
13
12
|
import { useContentPartText } from "./contentPart/useContentPartText.mjs";
|
14
13
|
import { useContentPartReasoning } from "./contentPart/useContentPartReasoning.mjs";
|
14
|
+
import { useContentPartSource } from "./contentPart/useContentPartSource.mjs";
|
15
|
+
import { useContentPartFile } from "./contentPart/useContentPartFile.mjs";
|
16
|
+
import { useContentPartImage } from "./contentPart/useContentPartImage.mjs";
|
15
17
|
import { useThreadViewportAutoScroll } from "./thread/useThreadViewportAutoScroll.mjs";
|
16
18
|
export {
|
17
19
|
ActionBarPrimitive,
|
@@ -24,8 +26,10 @@ export {
|
|
24
26
|
ThreadListItemPrimitive,
|
25
27
|
ThreadListPrimitive,
|
26
28
|
ThreadPrimitive,
|
29
|
+
useContentPartFile,
|
27
30
|
useContentPartImage,
|
28
31
|
useContentPartReasoning,
|
32
|
+
useContentPartSource,
|
29
33
|
useContentPartText,
|
30
34
|
useThreadViewportAutoScroll
|
31
35
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../src/primitives/index.ts"],"sourcesContent":["export * as ActionBarPrimitive from \"./actionBar\";\nexport * as AssistantModalPrimitive from \"./assistantModal\";\nexport * as AttachmentPrimitive from \"./attachment\";\nexport * as BranchPickerPrimitive from \"./branchPicker\";\nexport * as ComposerPrimitive from \"./composer\";\nexport * as ContentPartPrimitive from \"./contentPart\";\nexport * as MessagePrimitive from \"./message\";\nexport * as ThreadPrimitive from \"./thread\";\nexport * as ThreadListPrimitive from \"./threadList\";\nexport * as ThreadListItemPrimitive from \"./threadListItem\";\n\nexport {
|
1
|
+
{"version":3,"sources":["../../src/primitives/index.ts"],"sourcesContent":["export * as ActionBarPrimitive from \"./actionBar\";\nexport * as AssistantModalPrimitive from \"./assistantModal\";\nexport * as AttachmentPrimitive from \"./attachment\";\nexport * as BranchPickerPrimitive from \"./branchPicker\";\nexport * as ComposerPrimitive from \"./composer\";\nexport * as ContentPartPrimitive from \"./contentPart\";\nexport * as MessagePrimitive from \"./message\";\nexport * as ThreadPrimitive from \"./thread\";\nexport * as ThreadListPrimitive from \"./threadList\";\nexport * as ThreadListItemPrimitive from \"./threadListItem\";\n\nexport { useContentPartText } from \"./contentPart/useContentPartText\";\nexport { useContentPartReasoning } from \"./contentPart/useContentPartReasoning\";\nexport { useContentPartSource } from \"./contentPart/useContentPartSource\";\nexport { useContentPartFile } from \"./contentPart/useContentPartFile\";\nexport { useContentPartImage } from \"./contentPart/useContentPartImage\";\nexport { useThreadViewportAutoScroll } from \"./thread/useThreadViewportAutoScroll\";\n"],"mappings":";AAAA,YAAY,wBAAwB;AACpC,YAAY,6BAA6B;AACzC,YAAY,yBAAyB;AACrC,YAAY,2BAA2B;AACvC,YAAY,uBAAuB;AACnC,YAAY,0BAA0B;AACtC,YAAY,sBAAsB;AAClC,YAAY,qBAAqB;AACjC,YAAY,yBAAyB;AACrC,YAAY,6BAA6B;AAEzC,SAAS,0BAA0B;AACnC,SAAS,+BAA+B;AACxC,SAAS,4BAA4B;AACrC,SAAS,0BAA0B;AACnC,SAAS,2BAA2B;AACpC,SAAS,mCAAmC;","names":[]}
|
@@ -1,6 +1,10 @@
|
|
1
|
+
import { ChatModelRunOptions, ChatModelRunResult } from "../../local";
|
1
2
|
import { ExportedMessageRepository, ExportedMessageRepositoryItem } from "../../utils/MessageRepository";
|
2
3
|
export type ThreadHistoryAdapter = {
|
3
|
-
load(): Promise<ExportedMessageRepository
|
4
|
+
load(): Promise<ExportedMessageRepository & {
|
5
|
+
unstable_resume?: boolean;
|
6
|
+
}>;
|
7
|
+
resume?(options: ChatModelRunOptions): AsyncGenerator<ChatModelRunResult, void, unknown>;
|
4
8
|
append(item: ExportedMessageRepositoryItem): Promise<void>;
|
5
9
|
};
|
6
10
|
//# sourceMappingURL=ThreadHistoryAdapter.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ThreadHistoryAdapter.d.ts","sourceRoot":"","sources":["../../../../src/runtimes/adapters/thread-history/ThreadHistoryAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,6BAA6B,EAC9B,MAAM,+BAA+B,CAAC;AAEvC,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,IAAI,OAAO,CAAC,yBAAyB,CAAC,CAAC;
|
1
|
+
{"version":3,"file":"ThreadHistoryAdapter.d.ts","sourceRoot":"","sources":["../../../../src/runtimes/adapters/thread-history/ThreadHistoryAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACtE,OAAO,EACL,yBAAyB,EACzB,6BAA6B,EAC9B,MAAM,+BAA+B,CAAC;AAEvC,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,IAAI,OAAO,CAAC,yBAAyB,GAAG;QAAE,eAAe,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;IAC3E,MAAM,CAAC,CACL,OAAO,EAAE,mBAAmB,GAC3B,cAAc,CAAC,kBAAkB,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IACrD,MAAM,CAAC,IAAI,EAAE,6BAA6B,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5D,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../../src/runtimes/adapters/thread-history/ThreadHistoryAdapter.ts"],"sourcesContent":["import {\n ExportedMessageRepository,\n ExportedMessageRepositoryItem,\n} from \"../../utils/MessageRepository\";\n\nexport type ThreadHistoryAdapter = {\n load(): Promise<ExportedMessageRepository>;\n append(item: ExportedMessageRepositoryItem): Promise<void>;\n};\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
1
|
+
{"version":3,"sources":["../../../../src/runtimes/adapters/thread-history/ThreadHistoryAdapter.ts"],"sourcesContent":["import { ChatModelRunOptions, ChatModelRunResult } from \"../../local\";\nimport {\n ExportedMessageRepository,\n ExportedMessageRepositoryItem,\n} from \"../../utils/MessageRepository\";\n\nexport type ThreadHistoryAdapter = {\n load(): Promise<ExportedMessageRepository & { unstable_resume?: boolean }>;\n resume?(\n options: ChatModelRunOptions,\n ): AsyncGenerator<ChatModelRunResult, void, unknown>;\n append(item: ExportedMessageRepositoryItem): Promise<void>;\n};\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
@@ -4,6 +4,6 @@ export type DangerousInBrowserAdapterOptions = CreateEdgeRuntimeAPIOptions;
|
|
4
4
|
export declare class DangerousInBrowserAdapter implements ChatModelAdapter {
|
5
5
|
private options;
|
6
6
|
constructor(options: DangerousInBrowserAdapterOptions);
|
7
|
-
run({ messages, abortSignal, context }: ChatModelRunOptions): AsyncGenerator<import("
|
7
|
+
run({ messages, abortSignal, context }: ChatModelRunOptions): AsyncGenerator<import("assistant-stream").AssistantMessage, void, unknown>;
|
8
8
|
}
|
9
9
|
//# sourceMappingURL=DangerousInBrowserAdapter.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"DangerousInBrowserAdapter.d.ts","sourceRoot":"","sources":["../../../src/runtimes/dangerous-in-browser/DangerousInBrowserAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACpB,MAAM,2BAA2B,CAAC;
|
1
|
+
{"version":3,"file":"DangerousInBrowserAdapter.d.ts","sourceRoot":"","sources":["../../../src/runtimes/dangerous-in-browser/DangerousInBrowserAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACpB,MAAM,2BAA2B,CAAC;AAMnC,OAAO,EACL,2BAA2B,EAE5B,MAAM,8BAA8B,CAAC;AAGtC,MAAM,MAAM,gCAAgC,GAAG,2BAA2B,CAAC;AAE3E,qBAAa,yBAA0B,YAAW,gBAAgB;IACpD,OAAO,CAAC,OAAO;gBAAP,OAAO,EAAE,gCAAgC;IAEtD,GAAG,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,OAAO,EAAE,EAAE,mBAAmB;CAqBnE"}
|
@@ -25,10 +25,10 @@ __export(DangerousInBrowserAdapter_exports, {
|
|
25
25
|
module.exports = __toCommonJS(DangerousInBrowserAdapter_exports);
|
26
26
|
var import_toCoreMessages = require("../edge/converters/toCoreMessages.js");
|
27
27
|
var import_toLanguageModelTools = require("../edge/converters/toLanguageModelTools.js");
|
28
|
-
var import_runResultStream = require("../edge/streams/runResultStream.js");
|
29
28
|
var import_toolResultStream = require("../edge/streams/toolResultStream.js");
|
30
29
|
var import_EdgeChatAdapter = require("../edge/EdgeChatAdapter.js");
|
31
30
|
var import_createEdgeRuntimeAPI = require("../edge/createEdgeRuntimeAPI.js");
|
31
|
+
var import_assistant_stream = require("assistant-stream");
|
32
32
|
var DangerousInBrowserAdapter = class {
|
33
33
|
constructor(options) {
|
34
34
|
this.options = options;
|
@@ -45,7 +45,7 @@ var DangerousInBrowserAdapter = class {
|
|
45
45
|
...context.config
|
46
46
|
}
|
47
47
|
});
|
48
|
-
const stream = res.pipeThrough((0, import_toolResultStream.toolResultStream)(context.tools, abortSignal)).pipeThrough(
|
48
|
+
const stream = res.pipeThrough((0, import_toolResultStream.toolResultStream)(context.tools, abortSignal)).pipeThrough(new import_assistant_stream.AssistantMessageAccumulator());
|
49
49
|
for await (const update of (0, import_EdgeChatAdapter.asAsyncIterable)(stream)) {
|
50
50
|
yield update;
|
51
51
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/runtimes/dangerous-in-browser/DangerousInBrowserAdapter.ts"],"sourcesContent":["import {\n ChatModelAdapter,\n ChatModelRunOptions,\n} from \"../local/ChatModelAdapter\";\nimport { toCoreMessages } from \"../edge/converters/toCoreMessages\";\nimport { toLanguageModelTools } from \"../edge/converters/toLanguageModelTools\";\nimport { EdgeRuntimeRequestOptions } from \"../edge/EdgeRuntimeRequestOptions\";\nimport {
|
1
|
+
{"version":3,"sources":["../../../src/runtimes/dangerous-in-browser/DangerousInBrowserAdapter.ts"],"sourcesContent":["import {\n ChatModelAdapter,\n ChatModelRunOptions,\n} from \"../local/ChatModelAdapter\";\nimport { toCoreMessages } from \"../edge/converters/toCoreMessages\";\nimport { toLanguageModelTools } from \"../edge/converters/toLanguageModelTools\";\nimport { EdgeRuntimeRequestOptions } from \"../edge/EdgeRuntimeRequestOptions\";\nimport { toolResultStream } from \"../edge/streams/toolResultStream\";\nimport { asAsyncIterable } from \"../edge/EdgeChatAdapter\";\nimport {\n CreateEdgeRuntimeAPIOptions,\n getEdgeRuntimeStream,\n} from \"../edge/createEdgeRuntimeAPI\";\nimport { AssistantMessageAccumulator } from \"assistant-stream\";\n\nexport type DangerousInBrowserAdapterOptions = CreateEdgeRuntimeAPIOptions;\n\nexport class DangerousInBrowserAdapter implements ChatModelAdapter {\n constructor(private options: DangerousInBrowserAdapterOptions) {}\n\n async *run({ messages, abortSignal, context }: ChatModelRunOptions) {\n const res = await getEdgeRuntimeStream({\n options: this.options,\n abortSignal,\n requestData: {\n system: context.system,\n messages: toCoreMessages(messages),\n tools: context.tools ? toLanguageModelTools(context.tools) : [],\n ...context.callSettings,\n ...context.config,\n } satisfies EdgeRuntimeRequestOptions,\n });\n\n const stream = res\n .pipeThrough(toolResultStream(context.tools, abortSignal))\n .pipeThrough(new AssistantMessageAccumulator());\n\n for await (const update of asAsyncIterable(stream)) {\n yield update;\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,4BAA+B;AAC/B,kCAAqC;AAErC,8BAAiC;AACjC,6BAAgC;AAChC,kCAGO;AACP,8BAA4C;AAIrC,IAAM,4BAAN,MAA4D;AAAA,EACjE,YAAoB,SAA2C;AAA3C;AAAA,EAA4C;AAAA,EAEhE,OAAO,IAAI,EAAE,UAAU,aAAa,QAAQ,GAAwB;AAClE,UAAM,MAAM,UAAM,kDAAqB;AAAA,MACrC,SAAS,KAAK;AAAA,MACd;AAAA,MACA,aAAa;AAAA,QACX,QAAQ,QAAQ;AAAA,QAChB,cAAU,sCAAe,QAAQ;AAAA,QACjC,OAAO,QAAQ,YAAQ,kDAAqB,QAAQ,KAAK,IAAI,CAAC;AAAA,QAC9D,GAAG,QAAQ;AAAA,QACX,GAAG,QAAQ;AAAA,MACb;AAAA,IACF,CAAC;AAED,UAAM,SAAS,IACZ,gBAAY,0CAAiB,QAAQ,OAAO,WAAW,CAAC,EACxD,YAAY,IAAI,oDAA4B,CAAC;AAEhD,qBAAiB,cAAU,wCAAgB,MAAM,GAAG;AAClD,YAAM;AAAA,IACR;AAAA,EACF;AACF;","names":[]}
|
@@ -1,12 +1,12 @@
|
|
1
1
|
// src/runtimes/dangerous-in-browser/DangerousInBrowserAdapter.ts
|
2
2
|
import { toCoreMessages } from "../edge/converters/toCoreMessages.mjs";
|
3
3
|
import { toLanguageModelTools } from "../edge/converters/toLanguageModelTools.mjs";
|
4
|
-
import { runResultStream } from "../edge/streams/runResultStream.mjs";
|
5
4
|
import { toolResultStream } from "../edge/streams/toolResultStream.mjs";
|
6
5
|
import { asAsyncIterable } from "../edge/EdgeChatAdapter.mjs";
|
7
6
|
import {
|
8
7
|
getEdgeRuntimeStream
|
9
8
|
} from "../edge/createEdgeRuntimeAPI.mjs";
|
9
|
+
import { AssistantMessageAccumulator } from "assistant-stream";
|
10
10
|
var DangerousInBrowserAdapter = class {
|
11
11
|
constructor(options) {
|
12
12
|
this.options = options;
|
@@ -23,7 +23,7 @@ var DangerousInBrowserAdapter = class {
|
|
23
23
|
...context.config
|
24
24
|
}
|
25
25
|
});
|
26
|
-
const stream = res.pipeThrough(toolResultStream(context.tools, abortSignal)).pipeThrough(
|
26
|
+
const stream = res.pipeThrough(toolResultStream(context.tools, abortSignal)).pipeThrough(new AssistantMessageAccumulator());
|
27
27
|
for await (const update of asAsyncIterable(stream)) {
|
28
28
|
yield update;
|
29
29
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/runtimes/dangerous-in-browser/DangerousInBrowserAdapter.ts"],"sourcesContent":["import {\n ChatModelAdapter,\n ChatModelRunOptions,\n} from \"../local/ChatModelAdapter\";\nimport { toCoreMessages } from \"../edge/converters/toCoreMessages\";\nimport { toLanguageModelTools } from \"../edge/converters/toLanguageModelTools\";\nimport { EdgeRuntimeRequestOptions } from \"../edge/EdgeRuntimeRequestOptions\";\nimport {
|
1
|
+
{"version":3,"sources":["../../../src/runtimes/dangerous-in-browser/DangerousInBrowserAdapter.ts"],"sourcesContent":["import {\n ChatModelAdapter,\n ChatModelRunOptions,\n} from \"../local/ChatModelAdapter\";\nimport { toCoreMessages } from \"../edge/converters/toCoreMessages\";\nimport { toLanguageModelTools } from \"../edge/converters/toLanguageModelTools\";\nimport { EdgeRuntimeRequestOptions } from \"../edge/EdgeRuntimeRequestOptions\";\nimport { toolResultStream } from \"../edge/streams/toolResultStream\";\nimport { asAsyncIterable } from \"../edge/EdgeChatAdapter\";\nimport {\n CreateEdgeRuntimeAPIOptions,\n getEdgeRuntimeStream,\n} from \"../edge/createEdgeRuntimeAPI\";\nimport { AssistantMessageAccumulator } from \"assistant-stream\";\n\nexport type DangerousInBrowserAdapterOptions = CreateEdgeRuntimeAPIOptions;\n\nexport class DangerousInBrowserAdapter implements ChatModelAdapter {\n constructor(private options: DangerousInBrowserAdapterOptions) {}\n\n async *run({ messages, abortSignal, context }: ChatModelRunOptions) {\n const res = await getEdgeRuntimeStream({\n options: this.options,\n abortSignal,\n requestData: {\n system: context.system,\n messages: toCoreMessages(messages),\n tools: context.tools ? toLanguageModelTools(context.tools) : [],\n ...context.callSettings,\n ...context.config,\n } satisfies EdgeRuntimeRequestOptions,\n });\n\n const stream = res\n .pipeThrough(toolResultStream(context.tools, abortSignal))\n .pipeThrough(new AssistantMessageAccumulator());\n\n for await (const update of asAsyncIterable(stream)) {\n yield update;\n }\n }\n}\n"],"mappings":";AAIA,SAAS,sBAAsB;AAC/B,SAAS,4BAA4B;AAErC,SAAS,wBAAwB;AACjC,SAAS,uBAAuB;AAChC;AAAA,EAEE;AAAA,OACK;AACP,SAAS,mCAAmC;AAIrC,IAAM,4BAAN,MAA4D;AAAA,EACjE,YAAoB,SAA2C;AAA3C;AAAA,EAA4C;AAAA,EAEhE,OAAO,IAAI,EAAE,UAAU,aAAa,QAAQ,GAAwB;AAClE,UAAM,MAAM,MAAM,qBAAqB;AAAA,MACrC,SAAS,KAAK;AAAA,MACd;AAAA,MACA,aAAa;AAAA,QACX,QAAQ,QAAQ;AAAA,QAChB,UAAU,eAAe,QAAQ;AAAA,QACjC,OAAO,QAAQ,QAAQ,qBAAqB,QAAQ,KAAK,IAAI,CAAC;AAAA,QAC9D,GAAG,QAAQ;AAAA,QACX,GAAG,QAAQ;AAAA,MACb;AAAA,IACF,CAAC;AAED,UAAM,SAAS,IACZ,YAAY,iBAAiB,QAAQ,OAAO,WAAW,CAAC,EACxD,YAAY,IAAI,4BAA4B,CAAC;AAEhD,qBAAiB,UAAU,gBAAgB,MAAM,GAAG;AAClD,YAAM;AAAA,IACR;AAAA,EACF;AACF;","names":[]}
|
@@ -1,5 +1,4 @@
|
|
1
1
|
import { ChatModelAdapter, ChatModelRunOptions } from "../local/ChatModelAdapter";
|
2
|
-
import { ChatModelRunResult } from "../local/ChatModelAdapter";
|
3
2
|
import { ThreadMessage } from "../../types";
|
4
3
|
export declare function asAsyncIterable<T>(source: ReadableStream<T>): AsyncIterable<T>;
|
5
4
|
type HeadersValue = Record<string, string> | Headers;
|
@@ -43,7 +42,7 @@ export type EdgeChatAdapterOptions = {
|
|
43
42
|
export declare class EdgeChatAdapter implements ChatModelAdapter {
|
44
43
|
private options;
|
45
44
|
constructor(options: EdgeChatAdapterOptions);
|
46
|
-
run({ messages, runConfig, abortSignal, context, unstable_assistantMessageId, unstable_getMessage, }: ChatModelRunOptions): AsyncGenerator<
|
45
|
+
run({ messages, runConfig, abortSignal, context, unstable_assistantMessageId, unstable_getMessage, }: ChatModelRunOptions): AsyncGenerator<import("assistant-stream").AssistantMessage, void, unknown>;
|
47
46
|
}
|
48
47
|
export {};
|
49
48
|
//# sourceMappingURL=EdgeChatAdapter.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"EdgeChatAdapter.d.ts","sourceRoot":"","sources":["../../../src/runtimes/edge/EdgeChatAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACpB,MAAM,2BAA2B,CAAC;
|
1
|
+
{"version":3,"file":"EdgeChatAdapter.d.ts","sourceRoot":"","sources":["../../../src/runtimes/edge/EdgeChatAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACpB,MAAM,2BAA2B,CAAC;AAMnC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAU5C,wBAAgB,eAAe,CAAC,CAAC,EAC/B,MAAM,EAAE,cAAc,CAAC,CAAC,CAAC,GACxB,aAAa,CAAC,CAAC,CAAC,CAclB;AAED,KAAK,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC;AAErD,MAAM,MAAM,sBAAsB,GAAG;IACnC,GAAG,EAAE,MAAM,CAAC;IAeZ;;OAEG;IACH,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1D;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,IAAI,CAAC;IAC5C;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IAEjC,WAAW,CAAC,EAAE,kBAAkB,CAAC;IAEjC;;;OAGG;IACH,OAAO,CAAC,EAAE,YAAY,GAAG,CAAC,MAAM,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC;IAEvD,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAElC;;OAEG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;IAEjC;;;;;OAKG;IACH,qBAAqB,CAAC,EAAE,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC;CACpD,CAAC;AAgBF,qBAAa,eAAgB,YAAW,gBAAgB;IAC1C,OAAO,CAAC,OAAO;gBAAP,OAAO,EAAE,sBAAsB;IAE5C,GAAG,CAAC,EACT,QAAQ,EACR,SAAS,EACT,WAAW,EACX,OAAO,EACP,2BAA2B,EAC3B,mBAAmB,GACpB,EAAE,mBAAmB;CAkEvB"}
|
@@ -36,13 +36,11 @@ __export(EdgeChatAdapter_exports, {
|
|
36
36
|
module.exports = __toCommonJS(EdgeChatAdapter_exports);
|
37
37
|
var import_toCoreMessages = require("./converters/toCoreMessages.js");
|
38
38
|
var import_toLanguageModelTools = require("./converters/toLanguageModelTools.js");
|
39
|
-
var import_assistantDecoderStream = require("./streams/assistantDecoderStream.js");
|
40
|
-
var import_streamPartDecoderStream = require("./streams/utils/streamPartDecoderStream.js");
|
41
|
-
var import_runResultStream = require("./streams/runResultStream.js");
|
42
39
|
var import_toolResultStream = require("./streams/toolResultStream.js");
|
43
40
|
var import_converters = require("./converters/index.js");
|
44
41
|
var import_zod = require("zod");
|
45
42
|
var import_zod_to_json_schema = __toESM(require("zod-to-json-schema"));
|
43
|
+
var import_assistant_stream = require("assistant-stream");
|
46
44
|
function asAsyncIterable(source) {
|
47
45
|
return {
|
48
46
|
[Symbol.asyncIterator]: () => {
|
@@ -107,13 +105,13 @@ var EdgeChatAdapter = class {
|
|
107
105
|
if (!result.ok) {
|
108
106
|
throw new Error(`Status ${result.status}: ${await result.text()}`);
|
109
107
|
}
|
110
|
-
|
111
|
-
|
112
|
-
|
108
|
+
if (!result.body) {
|
109
|
+
throw new Error("Response body is null");
|
110
|
+
}
|
111
|
+
const stream = result.body.pipeThrough(new import_assistant_stream.DataStreamDecoder()).pipeThrough((0, import_toolResultStream.toolResultStream)(context.tools, abortSignal)).pipeThrough(new import_assistant_stream.AssistantMessageAccumulator());
|
112
|
+
for await (const update of asAsyncIterable(stream)) {
|
113
113
|
yield update;
|
114
114
|
}
|
115
|
-
if (update === void 0)
|
116
|
-
throw new Error("No data received from Edge Runtime");
|
117
115
|
this.options.onFinish?.(unstable_getMessage());
|
118
116
|
} catch (error) {
|
119
117
|
this.options.onError?.(error);
|