@darqlabs/curator-sdk-react 0.3.3 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/CuratorAdapter.d.ts +8 -1
- package/dist/cjs/CuratorAdapter.d.ts.map +1 -1
- package/dist/cjs/CuratorAdapter.js +38 -5
- package/dist/cjs/CuratorAdapter.js.map +1 -1
- package/dist/cjs/CuratorAttachmentAdapter.d.ts +87 -0
- package/dist/cjs/CuratorAttachmentAdapter.d.ts.map +1 -0
- package/dist/cjs/CuratorAttachmentAdapter.js +132 -0
- package/dist/cjs/CuratorAttachmentAdapter.js.map +1 -0
- package/dist/cjs/CuratorChat.d.ts +38 -0
- package/dist/cjs/CuratorChat.d.ts.map +1 -1
- package/dist/cjs/CuratorChat.js +239 -39
- package/dist/cjs/CuratorChat.js.map +1 -1
- package/dist/cjs/index.d.ts +3 -1
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +5 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/useCuratorChat.d.ts +21 -2
- package/dist/cjs/useCuratorChat.d.ts.map +1 -1
- package/dist/cjs/useCuratorChat.js +19 -4
- package/dist/cjs/useCuratorChat.js.map +1 -1
- package/dist/esm/CuratorAdapter.d.ts +8 -1
- package/dist/esm/CuratorAdapter.d.ts.map +1 -1
- package/dist/esm/CuratorAdapter.js +38 -5
- package/dist/esm/CuratorAdapter.js.map +1 -1
- package/dist/esm/CuratorAttachmentAdapter.d.ts +87 -0
- package/dist/esm/CuratorAttachmentAdapter.d.ts.map +1 -0
- package/dist/esm/CuratorAttachmentAdapter.js +128 -0
- package/dist/esm/CuratorAttachmentAdapter.js.map +1 -0
- package/dist/esm/CuratorChat.d.ts +38 -0
- package/dist/esm/CuratorChat.d.ts.map +1 -1
- package/dist/esm/CuratorChat.js +239 -39
- package/dist/esm/CuratorChat.js.map +1 -1
- package/dist/esm/index.d.ts +3 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +3 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/useCuratorChat.d.ts +21 -2
- package/dist/esm/useCuratorChat.d.ts.map +1 -1
- package/dist/esm/useCuratorChat.js +19 -4
- package/dist/esm/useCuratorChat.js.map +1 -1
- package/package.json +3 -3
|
@@ -5,8 +5,9 @@
|
|
|
5
5
|
* `Chat` instance from the SDK, exposes the rolling message list, a
|
|
6
6
|
* `send()` action, and the various pending/error states the UI needs.
|
|
7
7
|
*
|
|
8
|
-
* Bring your own UI on top of this hook, or use `<CuratorChat />` for
|
|
9
|
-
*
|
|
8
|
+
* Bring your own UI on top of this hook, or use `<CuratorChat />` for the
|
|
9
|
+
* drop-in styled widget. The two are independent: the widget drives
|
|
10
|
+
* assistant-ui's `useLocalRuntime` through `CuratorAdapter`, not this hook.
|
|
10
11
|
*/
|
|
11
12
|
import type { AssistantMessage, AuthorizationDetails, Chat, Curator, Environment, FileAttachment } from "@darqlabs/curator-sdk";
|
|
12
13
|
import { CuratorError } from "@darqlabs/curator-sdk";
|
|
@@ -15,6 +16,22 @@ import { CuratorError } from "@darqlabs/curator-sdk";
|
|
|
15
16
|
export type ChatBubble = {
|
|
16
17
|
kind: "user";
|
|
17
18
|
content: string;
|
|
19
|
+
/**
|
|
20
|
+
* Files the person attached to this message.
|
|
21
|
+
*
|
|
22
|
+
* `content` is the text as typed — the server renders the file-reference
|
|
23
|
+
* envelope into the prompt the model sees, but not into the stored
|
|
24
|
+
* message. So a message that is *only* an attachment has empty `content`,
|
|
25
|
+
* and this field is the only thing a transcript can draw a chip from.
|
|
26
|
+
* Absent when the message had no attachments.
|
|
27
|
+
*/
|
|
28
|
+
attachments?: FileAttachment[];
|
|
29
|
+
/**
|
|
30
|
+
* ISO-8601 send time, from the client clock — the send response carries
|
|
31
|
+
* the assistant reply's timestamp, not the user message's, so this is a
|
|
32
|
+
* local approximation of the value the server persists.
|
|
33
|
+
*/
|
|
34
|
+
createdAt: string;
|
|
18
35
|
/** Stable local id; not persisted to the server. */
|
|
19
36
|
localId: string;
|
|
20
37
|
} | {
|
|
@@ -27,6 +44,8 @@ export type ChatBubble = {
|
|
|
27
44
|
} | {
|
|
28
45
|
kind: "error";
|
|
29
46
|
message: string;
|
|
47
|
+
/** ISO-8601 time the error surfaced, from the client clock. */
|
|
48
|
+
createdAt: string;
|
|
30
49
|
localId: string;
|
|
31
50
|
};
|
|
32
51
|
export interface UseCuratorChatOptions {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCuratorChat.d.ts","sourceRoot":"","sources":["../../src/useCuratorChat.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"useCuratorChat.d.ts","sourceRoot":"","sources":["../../src/useCuratorChat.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,EACV,gBAAgB,EAChB,oBAAoB,EACpB,IAAI,EACJ,OAAO,EACP,WAAW,EACX,cAAc,EACf,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAEL,YAAY,EAEb,MAAM,uBAAuB,CAAA;AAG9B;yDACyD;AACzD,MAAM,MAAM,UAAU,GAClB;IACE,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;IACf;;;;;;;;OAQG;IACH,WAAW,CAAC,EAAE,cAAc,EAAE,CAAA;IAC9B;;;;OAIG;IACH,SAAS,EAAE,MAAM,CAAA;IACjB,oDAAoD;IACpD,OAAO,EAAE,MAAM,CAAA;CAChB,GACD;IACE,IAAI,EAAE,WAAW,CAAA;IACjB,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;CACd,GACD;IACE,IAAI,EAAE,OAAO,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;IACf,+DAA+D;IAC/D,SAA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AKG;IACH,OAAO,EAAE,CAAC,IAAI,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IACzD;;;;OAIG;IACH,eAAe,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CACzD;AAQD,wBAAgB,cAAc,CAAC,IAAI,EAAE,qBAAqB,GAAG,oBAAoB,CAyJhF"}
|
|
@@ -6,8 +6,9 @@
|
|
|
6
6
|
* `Chat` instance from the SDK, exposes the rolling message list, a
|
|
7
7
|
* `send()` action, and the various pending/error states the UI needs.
|
|
8
8
|
*
|
|
9
|
-
* Bring your own UI on top of this hook, or use `<CuratorChat />` for
|
|
10
|
-
*
|
|
9
|
+
* Bring your own UI on top of this hook, or use `<CuratorChat />` for the
|
|
10
|
+
* drop-in styled widget. The two are independent: the widget drives
|
|
11
|
+
* assistant-ui's `useLocalRuntime` through `CuratorAdapter`, not this hook.
|
|
11
12
|
*/
|
|
12
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
14
|
exports.useCuratorChat = useCuratorChat;
|
|
@@ -56,7 +57,18 @@ function useCuratorChat(opts) {
|
|
|
56
57
|
const trimmed = content.trim();
|
|
57
58
|
if (!trimmed && !args.files?.length)
|
|
58
59
|
return;
|
|
59
|
-
|
|
60
|
+
// Bind the attachments to the bubble, not just to the request. The
|
|
61
|
+
// server stores them structurally and keeps `content` as typed, so a
|
|
62
|
+
// file-only send leaves `content` empty — without this the message
|
|
63
|
+
// renders as an empty bubble the moment the composer's own preview
|
|
64
|
+
// clears.
|
|
65
|
+
const userBubble = {
|
|
66
|
+
kind: "user",
|
|
67
|
+
content: trimmed,
|
|
68
|
+
...(args.files?.length ? { attachments: args.files } : {}),
|
|
69
|
+
createdAt: new Date().toISOString(),
|
|
70
|
+
localId: localId(),
|
|
71
|
+
};
|
|
60
72
|
setMessages((prev) => [...prev, userBubble]);
|
|
61
73
|
setSending(true);
|
|
62
74
|
setError(null);
|
|
@@ -85,7 +97,10 @@ function useCuratorChat(opts) {
|
|
|
85
97
|
}
|
|
86
98
|
const message = renderError(err);
|
|
87
99
|
setError(err);
|
|
88
|
-
setMessages((prev) => [
|
|
100
|
+
setMessages((prev) => [
|
|
101
|
+
...prev,
|
|
102
|
+
{ kind: "error", message, createdAt: new Date().toISOString(), localId: localId() },
|
|
103
|
+
]);
|
|
89
104
|
onError?.(err);
|
|
90
105
|
}
|
|
91
106
|
finally {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCuratorChat.js","sourceRoot":"","sources":["../../src/useCuratorChat.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"useCuratorChat.js","sourceRoot":"","sources":["../../src/useCuratorChat.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;AAsIH,wCAyJC;AA7RD,iCAAyE;AASzE,uDAI8B;AAC9B,6DAAuD;AAgHvD,IAAI,OAAO,GAAG,CAAC,CAAA;AACf,SAAS,OAAO;IACd,OAAO,IAAI,CAAC,CAAA;IACZ,OAAO,SAAS,IAAI,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,OAAO,EAAE,CAAA;AACtD,CAAC;AAED,SAAgB,cAAc,CAAC,IAA2B;IACxD,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,cAAc,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,IAAI,CAAA;IAExF,wEAAwE;IACxE,MAAM,aAAa,GAAG,IAAA,qCAAgB,GAAE,CAAA;IACxC,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,IAAI,aAAa,CAAA;IAC7C,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CACb,+EAA+E;YAC7E,yDAAyD,CAC5D,CAAA;IACH,CAAC;IAED,uEAAuE;IACvE,yEAAyE;IACzE,wDAAwD;IACxD,M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;AACH,SAAS,WAAW,CAAC,GAAY;IAC/B,IAAI,GAAG,YAAY,+CAAiC,EAAE,CAAC;QACrD,oEAAoE;QACpE,kDAAkD;QAClD,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC,aAAa,CAAA;QAC9C,OAAO,MAAM,IAAI,gBAAgB,QAAQ,uBAAuB,CAAA;IAClE,CAAC;IACD,IAAI,GAAG,YAAY,0BAAY;QAAE,OAAO,GAAG,CAAC,WAAW,CAAA;IACvD,OAAO,kCAAoB,CAAA;AAC7B,CAAC"}
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
* mounted CuratorChat / launcher panel) so multi-turn context stays
|
|
18
18
|
* intact across runs.
|
|
19
19
|
*/
|
|
20
|
+
import type { CuratorAttachmentAdapter } from "./CuratorAttachmentAdapter.js";
|
|
20
21
|
import type { ChatModelAdapter } from "@assistant-ui/react";
|
|
21
22
|
import type { AssistantMessage, Chat, CuratorError, StreamState, StreamPlanProgress } from "@darqlabs/curator-sdk";
|
|
22
23
|
export interface CuratorAdapterCallbacks {
|
|
@@ -39,5 +40,11 @@ export interface CuratorAdapterCallbacks {
|
|
|
39
40
|
/** Fired on any send-time error surfaced through the stream. */
|
|
40
41
|
onError?: (error: CuratorError | Error) => void;
|
|
41
42
|
}
|
|
42
|
-
export declare function createCuratorAdapter(chat: Chat, callbacks?: CuratorAdapterCallbacks
|
|
43
|
+
export declare function createCuratorAdapter(chat: Chat, callbacks?: CuratorAdapterCallbacks,
|
|
44
|
+
/**
|
|
45
|
+
* Supplies the storage references for this turn's attachments. Absent when
|
|
46
|
+
* the widget was mounted without attachment support, in which case the send
|
|
47
|
+
* behaves exactly as before.
|
|
48
|
+
*/
|
|
49
|
+
attachments?: Pick<CuratorAttachmentAdapter, "takeReferences">): ChatModelAdapter;
|
|
43
50
|
//# sourceMappingURL=CuratorAdapter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CuratorAdapter.d.ts","sourceRoot":"","sources":["../../src/CuratorAdapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAsB,MAAM,qBAAqB,CAAA;AAC/E,OAAO,KAAK,EACV,gBAAgB,EAChB,IAAI,EACJ,YAAY,EACZ,WAAW,EACX,kBAAkB,EACnB,MAAM,uBAAuB,CAAA;AAE9B,MAAM,WAAW,uBAAuB;IACtC,8DAA8D;IAC9D,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,IAAI,CAAA;IAC/C;;;;;OAKG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAA;IACtC;;;;;OAKG;IACH,cAAc,CAAC,EAAE,CAAC,QAAQ,EAAE,kBAAkB,KAAK,IAAI,CAAA;IACvD,gEAAgE;IAChE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,YAAY,GAAG,KAAK,KAAK,IAAI,CAAA;CAChD;AAED,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,IAAI,EACV,SAAS,GAAE,uBAA4B,
|
|
1
|
+
{"version":3,"file":"CuratorAdapter.d.ts","sourceRoot":"","sources":["../../src/CuratorAdapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAA;AAC7E,OAAO,KAAK,EAAE,gBAAgB,EAAsB,MAAM,qBAAqB,CAAA;AAC/E,OAAO,KAAK,EACV,gBAAgB,EAChB,IAAI,EACJ,YAAY,EACZ,WAAW,EACX,kBAAkB,EACnB,MAAM,uBAAuB,CAAA;AAE9B,MAAM,WAAW,uBAAuB;IACtC,8DAA8D;IAC9D,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,IAAI,CAAA;IAC/C;;;;;OAKG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAA;IACtC;;;;;OAKG;IACH,cAAc,CAAC,EAAE,CAAC,QAAQ,EAAE,kBAAkB,KAAK,IAAI,CAAA;IACvD,gEAAgE;IAChE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,YAAY,GAAG,KAAK,KAAK,IAAI,CAAA;CAChD;AAED,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,IAAI,EACV,SAAS,GAAE,uBAA4B;AACvC;;;;GAIG;AACH,WAAW,CAAC,EAAE,IAAI,CAAC,wBAAwB,EAAE,gBAAgB,CAAC,GAC7D,gBAAgB,CA6JlB"}
|
|
@@ -17,11 +17,24 @@
|
|
|
17
17
|
* mounted CuratorChat / launcher panel) so multi-turn context stays
|
|
18
18
|
* intact across runs.
|
|
19
19
|
*/
|
|
20
|
-
export function createCuratorAdapter(chat, callbacks = {}
|
|
20
|
+
export function createCuratorAdapter(chat, callbacks = {},
|
|
21
|
+
/**
|
|
22
|
+
* Supplies the storage references for this turn's attachments. Absent when
|
|
23
|
+
* the widget was mounted without attachment support, in which case the send
|
|
24
|
+
* behaves exactly as before.
|
|
25
|
+
*/
|
|
26
|
+
attachments) {
|
|
21
27
|
return {
|
|
22
28
|
async *run({ messages, abortSignal }) {
|
|
23
29
|
const userText = extractLatestUserText(messages);
|
|
24
|
-
|
|
30
|
+
const files = attachments
|
|
31
|
+
? attachments.takeReferences(latestUserAttachmentIds(messages))
|
|
32
|
+
: [];
|
|
33
|
+
// A file with no caption is a complete message — the SDK accepts content
|
|
34
|
+
// OR files, and a bill of lading dropped in with nothing typed is the
|
|
35
|
+
// single most common way this widget is used. Returning early on empty
|
|
36
|
+
// text would silently discard it.
|
|
37
|
+
if (!userText && files.length === 0)
|
|
25
38
|
return;
|
|
26
39
|
// Assistant text arrives in SEGMENTS, not as one growing string. A model
|
|
27
40
|
// may narrate ("Let me look those up…") in the same LLM turn that it
|
|
@@ -45,7 +58,11 @@ export function createCuratorAdapter(chat, callbacks = {}) {
|
|
|
45
58
|
}));
|
|
46
59
|
};
|
|
47
60
|
try {
|
|
48
|
-
|
|
61
|
+
// Called with one argument when there are no files: the options object
|
|
62
|
+
// is meaningless then, and passing an empty one changes the observable
|
|
63
|
+
// call shape for anything wrapping or asserting on `stream`.
|
|
64
|
+
const stream = files.length ? chat.stream(userText, { files }) : chat.stream(userText);
|
|
65
|
+
for await (const event of stream) {
|
|
49
66
|
if (abortSignal.aborted)
|
|
50
67
|
return;
|
|
51
68
|
if (event.type === "delta") {
|
|
@@ -155,11 +172,27 @@ export function createCuratorAdapter(chat, callbacks = {}) {
|
|
|
155
172
|
},
|
|
156
173
|
};
|
|
157
174
|
}
|
|
175
|
+
/**
|
|
176
|
+
* Attachment ids on the latest user turn, in composer order.
|
|
177
|
+
*
|
|
178
|
+
* The ids are the join key back to `CuratorAttachmentAdapter`'s upload map —
|
|
179
|
+
* assistant-ui's attachment payload has nowhere to carry a storage key, so the
|
|
180
|
+
* reference is looked up rather than read off the message.
|
|
181
|
+
*/
|
|
182
|
+
function latestUserAttachmentIds(messages) {
|
|
183
|
+
for (let i = messages.length - 1; i >= 0; i--) {
|
|
184
|
+
const m = messages[i];
|
|
185
|
+
if (m.role !== "user")
|
|
186
|
+
continue;
|
|
187
|
+
return (m.attachments ?? []).map((a) => a.id);
|
|
188
|
+
}
|
|
189
|
+
return [];
|
|
190
|
+
}
|
|
158
191
|
/**
|
|
159
192
|
* Pull the latest user-turn text out of assistant-ui's structured
|
|
160
193
|
* message array. Text parts are concatenated with newlines; other
|
|
161
|
-
* part types
|
|
162
|
-
* `
|
|
194
|
+
* part types are not text and are handled separately: attachments travel as
|
|
195
|
+
* storage references via `latestUserAttachmentIds`, not as message content.
|
|
163
196
|
*/
|
|
164
197
|
function extractLatestUserText(messages) {
|
|
165
198
|
for (let i = messages.length - 1; i >= 0; i--) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CuratorAdapter.js","sourceRoot":"","sources":["../../src/CuratorAdapter.ts"],"names":[],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GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QAC9C,MAAM,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAA;QACrB,IAAI,CAAC,CAAC,IAAI,KAAK,MAAM;YAAE,SAAQ;QAC/B,MAAM,IAAI,GAAG,CAAC,CAAC,OAAO;aACnB,MAAM,CAAC,CAAC,CAAC,EAAuC,EAAE,CACjD,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,IAAI,IAAK,CAAuB,CAAC,IAAI,KAAK,MAAM,CAChF;aACA,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;aAClB,IAAI,CAAC,IAAI,CAAC,CAAA;QACb,OAAO,IAAI,CAAC,IAAI,EAAE,CAAA;IACpB,CAAC;IACD,OAAO,EAAE,CAAA;AACX,CAAC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bridges assistant-ui's composer attachments to Curator's file storage.
|
|
3
|
+
*
|
|
4
|
+
* assistant-ui owns the attachment lifecycle in the composer — a chip appears
|
|
5
|
+
* when a file is picked, shows progress, and can be removed before send. What
|
|
6
|
+
* it has no opinion about is where the bytes go. This adapter uploads them
|
|
7
|
+
* through `curator.files`, which returns the `FileAttachment` reference that
|
|
8
|
+
* `chat.send(content, { files })` needs.
|
|
9
|
+
*
|
|
10
|
+
* The reference cannot ride inside the attachment itself: assistant-ui models
|
|
11
|
+
* an attachment's payload as `ThreadUserMessagePart[]`, whose shapes (text,
|
|
12
|
+
* image, file-with-data) have nowhere to carry a storage key, and anything
|
|
13
|
+
* smuggled into a text part would land in the prompt. So the adapter keeps its
|
|
14
|
+
* own id → reference map and `CuratorAdapter` reads it back when assembling the
|
|
15
|
+
* send. Both are constructed together in `CuratorChat`, so they share an
|
|
16
|
+
* instance and the map's lifetime is the widget's.
|
|
17
|
+
*/
|
|
18
|
+
import type { Curator, FileAttachment } from "@darqlabs/curator-sdk";
|
|
19
|
+
/** Mirrors assistant-ui's attachment shapes without importing its internals. */
|
|
20
|
+
interface PendingAttachmentLike {
|
|
21
|
+
id: string;
|
|
22
|
+
type: "image" | "document" | "file" | (string & {});
|
|
23
|
+
name: string;
|
|
24
|
+
contentType?: string;
|
|
25
|
+
file: File;
|
|
26
|
+
status: {
|
|
27
|
+
type: "running";
|
|
28
|
+
reason: "uploading";
|
|
29
|
+
progress: number;
|
|
30
|
+
} | {
|
|
31
|
+
type: "requires-action";
|
|
32
|
+
reason: "composer-send";
|
|
33
|
+
} | {
|
|
34
|
+
type: "incomplete";
|
|
35
|
+
reason: "error" | "upload-paused";
|
|
36
|
+
message?: string;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
interface CompleteAttachmentLike {
|
|
40
|
+
id: string;
|
|
41
|
+
type: "image" | "document" | "file" | (string & {});
|
|
42
|
+
name: string;
|
|
43
|
+
contentType?: string;
|
|
44
|
+
file?: File;
|
|
45
|
+
status: {
|
|
46
|
+
type: "complete";
|
|
47
|
+
};
|
|
48
|
+
content: Array<{
|
|
49
|
+
type: "text";
|
|
50
|
+
text: string;
|
|
51
|
+
}>;
|
|
52
|
+
}
|
|
53
|
+
export interface CuratorAttachmentAdapterOptions {
|
|
54
|
+
/** `accept` string for the picker, e.g. `.pdf,image/*`. Defaults to everything. */
|
|
55
|
+
accept?: string;
|
|
56
|
+
/** Reject client-side before uploading. Bytes. The server enforces its own limit. */
|
|
57
|
+
maxFileSize?: number;
|
|
58
|
+
}
|
|
59
|
+
export declare class CuratorAttachmentAdapter {
|
|
60
|
+
private readonly curator;
|
|
61
|
+
private readonly options;
|
|
62
|
+
accept: string;
|
|
63
|
+
/**
|
|
64
|
+
* Uploaded references by attachment id.
|
|
65
|
+
*
|
|
66
|
+
* Populated on `send` (assistant-ui's term for "the composer is submitting
|
|
67
|
+
* this one"), read by `CuratorAdapter` when it builds the request. Entries
|
|
68
|
+
* are dropped when the attachment is removed or once consumed, so a long
|
|
69
|
+
* conversation does not accumulate references to files it already sent.
|
|
70
|
+
*/
|
|
71
|
+
private readonly uploaded;
|
|
72
|
+
constructor(curator: Curator, options?: CuratorAttachmentAdapterOptions);
|
|
73
|
+
add({ file }: {
|
|
74
|
+
file: File;
|
|
75
|
+
}): Promise<PendingAttachmentLike>;
|
|
76
|
+
send(attachment: PendingAttachmentLike): Promise<CompleteAttachmentLike>;
|
|
77
|
+
remove(attachment: {
|
|
78
|
+
id: string;
|
|
79
|
+
}): Promise<void>;
|
|
80
|
+
/**
|
|
81
|
+
* References for the given attachment ids, in the order given, dropping ids
|
|
82
|
+
* with no upload recorded. Consumed entries are released.
|
|
83
|
+
*/
|
|
84
|
+
takeReferences(ids: readonly string[]): FileAttachment[];
|
|
85
|
+
}
|
|
86
|
+
export {};
|
|
87
|
+
//# sourceMappingURL=CuratorAttachmentAdapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CuratorAttachmentAdapter.d.ts","sourceRoot":"","sources":["../../src/CuratorAttachmentAdapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAEpE,gFAAgF;AAChF,UAAU,qBAAqB;IAC7B,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,OAAO,GAAG,UAAU,GAAG,MAAM,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAA;IACnD,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,IAAI,EAAE,IAAI,CAAA;IACV,MAAM,EACF;QAAE,IAAI,EAAE,SAAS,CAAC;QAAC,MAAM,EAAE,WAAW,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,GAC1D;QAAE,IAAI,EAAE,iBAAiB,CAAC;QAAC,MAAM,EAAE,eAAe,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;;OAGG;IACH,cAAc,CAAC,GAAG,EAAE,SAAS,MAAM,EAAE,GAAG,cAAc,EAAE;CAWzD"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bridges assistant-ui's composer attachments to Curator's file storage.
|
|
3
|
+
*
|
|
4
|
+
* assistant-ui owns the attachment lifecycle in the composer — a chip appears
|
|
5
|
+
* when a file is picked, shows progress, and can be removed before send. What
|
|
6
|
+
* it has no opinion about is where the bytes go. This adapter uploads them
|
|
7
|
+
* through `curator.files`, which returns the `FileAttachment` reference that
|
|
8
|
+
* `chat.send(content, { files })` needs.
|
|
9
|
+
*
|
|
10
|
+
* The reference cannot ride inside the attachment itself: assistant-ui models
|
|
11
|
+
* an attachment's payload as `ThreadUserMessagePart[]`, whose shapes (text,
|
|
12
|
+
* image, file-with-data) have nowhere to carry a storage key, and anything
|
|
13
|
+
* smuggled into a text part would land in the prompt. So the adapter keeps its
|
|
14
|
+
* own id → reference map and `CuratorAdapter` reads it back when assembling the
|
|
15
|
+
* send. Both are constructed together in `CuratorChat`, so they share an
|
|
16
|
+
* instance and the map's lifetime is the widget's.
|
|
17
|
+
*/
|
|
18
|
+
/** Human-readable size for the rejection message; matches the chip's formatting. */
|
|
19
|
+
function formatBytes(bytes) {
|
|
20
|
+
if (bytes < 1024)
|
|
21
|
+
return `${bytes} B`;
|
|
22
|
+
if (bytes < 1024 * 1024)
|
|
23
|
+
return `${Math.round(bytes / 1024)} KB`;
|
|
24
|
+
return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* `image` gets a distinct type so a future thumbnail renderer can pick images
|
|
28
|
+
* out without re-sniffing the MIME type. Everything else is a document.
|
|
29
|
+
*/
|
|
30
|
+
function attachmentKind(file) {
|
|
31
|
+
return file.type.startsWith("image/") ? "image" : "document";
|
|
32
|
+
}
|
|
33
|
+
let counter = 0;
|
|
34
|
+
function attachmentId() {
|
|
35
|
+
counter += 1;
|
|
36
|
+
return `curator_att_${Date.now().toString(36)}_${counter}`;
|
|
37
|
+
}
|
|
38
|
+
export class CuratorAttachmentAdapter {
|
|
39
|
+
curator;
|
|
40
|
+
options;
|
|
41
|
+
accept;
|
|
42
|
+
/**
|
|
43
|
+
* Uploaded references by attachment id.
|
|
44
|
+
*
|
|
45
|
+
* Populated on `send` (assistant-ui's term for "the composer is submitting
|
|
46
|
+
* this one"), read by `CuratorAdapter` when it builds the request. Entries
|
|
47
|
+
* are dropped when the attachment is removed or once consumed, so a long
|
|
48
|
+
* conversation does not accumulate references to files it already sent.
|
|
49
|
+
*/
|
|
50
|
+
uploaded = new Map();
|
|
51
|
+
constructor(curator, options = {}) {
|
|
52
|
+
this.curator = curator;
|
|
53
|
+
this.options = options;
|
|
54
|
+
this.accept = options.accept ?? "*/*";
|
|
55
|
+
}
|
|
56
|
+
async add({ file }) {
|
|
57
|
+
const max = this.options.maxFileSize;
|
|
58
|
+
if (max && file.size > max) {
|
|
59
|
+
// Surfaced on the chip rather than thrown: one oversized file should not
|
|
60
|
+
// discard the other attachments or the typed message.
|
|
61
|
+
return {
|
|
62
|
+
id: attachmentId(),
|
|
63
|
+
type: attachmentKind(file),
|
|
64
|
+
name: file.name,
|
|
65
|
+
contentType: file.type || undefined,
|
|
66
|
+
file,
|
|
67
|
+
status: {
|
|
68
|
+
type: "incomplete",
|
|
69
|
+
reason: "error",
|
|
70
|
+
message: `${file.name} is ${formatBytes(file.size)}; the limit is ${formatBytes(max)}.`,
|
|
71
|
+
},
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
// Upload happens in `send`, not here. Uploading on pick would spend the
|
|
75
|
+
// customer's storage on files the person then removes before sending, and
|
|
76
|
+
// an abandoned composer would leave orphans nothing ever references.
|
|
77
|
+
return {
|
|
78
|
+
id: attachmentId(),
|
|
79
|
+
type: attachmentKind(file),
|
|
80
|
+
name: file.name,
|
|
81
|
+
contentType: file.type || undefined,
|
|
82
|
+
file,
|
|
83
|
+
status: { type: "requires-action", reason: "composer-send" },
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
async send(attachment) {
|
|
87
|
+
const reference = await this.curator.files.upload({
|
|
88
|
+
filename: attachment.name,
|
|
89
|
+
mimeType: attachment.contentType || attachment.file.type || "application/octet-stream",
|
|
90
|
+
data: attachment.file,
|
|
91
|
+
});
|
|
92
|
+
this.uploaded.set(attachment.id, reference);
|
|
93
|
+
return {
|
|
94
|
+
id: attachment.id,
|
|
95
|
+
type: attachment.type,
|
|
96
|
+
name: attachment.name,
|
|
97
|
+
contentType: attachment.contentType,
|
|
98
|
+
file: attachment.file,
|
|
99
|
+
status: { type: "complete" },
|
|
100
|
+
// Deliberately empty. `content` becomes message parts, and the file's
|
|
101
|
+
// meaning reaches the model through the server-rendered attachment
|
|
102
|
+
// envelope — a duplicate here would put the filename in the prompt twice
|
|
103
|
+
// and, worse, make the widget's own text extraction pick it up.
|
|
104
|
+
content: [],
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
async remove(attachment) {
|
|
108
|
+
// Nothing to delete remotely: `send` is the only thing that uploads, so a
|
|
109
|
+
// removal before send never created an object.
|
|
110
|
+
this.uploaded.delete(attachment.id);
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* References for the given attachment ids, in the order given, dropping ids
|
|
114
|
+
* with no upload recorded. Consumed entries are released.
|
|
115
|
+
*/
|
|
116
|
+
takeReferences(ids) {
|
|
117
|
+
const out = [];
|
|
118
|
+
for (const id of ids) {
|
|
119
|
+
const reference = this.uploaded.get(id);
|
|
120
|
+
if (reference) {
|
|
121
|
+
out.push(reference);
|
|
122
|
+
this.uploaded.delete(id);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
return out;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
//# sourceMappingURL=CuratorAttachmentAdapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CuratorAttachmentAdapter.js","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AE;YACjB,IAAI,EAAE,UAAU,CAAC,IAAI;YACrB,IAAI,EAAE,UAAU,CAAC,IAAI;YACrB,WAAW,EAAE,UAAU,CAAC,WAAW;YACnC,IAAI,EAAE,UAAU,CAAC,IAAI;YACrB,MAAM,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE;YAC5B,sEAAsE;YACtE,mEAAmE;YACnE,yEAAyE;YACzE,gEAAgE;YAChE,OAAO,EAAE,EAAE;SACZ,CAAA;IACH,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,UAA0B;QACrC,0EAA0E;QAC1E,+CAA+C;QAC/C,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC,CAAA;IACrC,CAAC;IAED;;;OAGG;IACH,cAAc,CAAC,GAAsB;QACnC,MAAM,GAAG,GAAqB,EAAE,CAAA;QAChC,KAAK,MAAM,EAAE,IAAI,GAAG,EAAE,CAAC;YACrB,MAAM,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;YACvC,IAAI,SAAS,EAAE,CAAC;gBACd,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;gBACnB,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;YAC1B,CAAC;QACH,CAAC;QACD,OAAO,GAAG,CAAA;IACZ,CAAC;CACF"}
|
|
@@ -98,8 +98,46 @@ export interface CuratorChatProps {
|
|
|
98
98
|
* immediately after a reply completes.
|
|
99
99
|
*/
|
|
100
100
|
queueWhileRunning?: boolean;
|
|
101
|
+
/**
|
|
102
|
+
* Allow files to be attached to a message.
|
|
103
|
+
*
|
|
104
|
+
* Off by default. Turning an upload affordance on for every existing embed
|
|
105
|
+
* without the operator choosing it changes what their end users can push
|
|
106
|
+
* into their storage, so this is opt-in even though the capability now
|
|
107
|
+
* exists.
|
|
108
|
+
*/
|
|
109
|
+
enableAttachments?: boolean;
|
|
110
|
+
/**
|
|
111
|
+
* Design tokens — colours, typography, spacing, radii — merged over the
|
|
112
|
+
* palette `theme` selects.
|
|
113
|
+
*
|
|
114
|
+
* The escape hatch below it is plain CSS: every token is a custom property
|
|
115
|
+
* on `[data-curator-chat]`, so anything not named here is still reachable
|
|
116
|
+
* from a stylesheet.
|
|
117
|
+
*
|
|
118
|
+
* <CuratorChat theme="light" tokens={{ fontFamily: "Inter, sans-serif", accent: "#6b46ff", radius: 8 }} />
|
|
119
|
+
*/
|
|
120
|
+
tokens?: CuratorTokens;
|
|
121
|
+
/** `accept` for the file picker, e.g. `.pdf,image/*`. Default: everything. */
|
|
122
|
+
acceptedFileTypes?: string;
|
|
123
|
+
/**
|
|
124
|
+
* Reject files larger than this (bytes) before uploading. A convenience for
|
|
125
|
+
* the person picking, not a control — the server enforces its own limit.
|
|
126
|
+
*/
|
|
127
|
+
maxFileSize?: number;
|
|
101
128
|
}
|
|
102
129
|
export declare function CuratorChat(props: CuratorChatProps): import("react").JSX.Element;
|
|
103
130
|
declare function AssistantMessage(): import("react").JSX.Element;
|
|
131
|
+
/**
|
|
132
|
+
* Consumer-facing token names, mapped to the variables they set.
|
|
133
|
+
*
|
|
134
|
+
* A curated subset rather than every variable: this is the surface someone
|
|
135
|
+
* reaches for first, and a prop that mirrors forty internals is a worse
|
|
136
|
+
* document than one that names the dozen things people actually change.
|
|
137
|
+
* Anything outside it is still reachable as raw CSS.
|
|
138
|
+
*/
|
|
139
|
+
declare const TOKEN_VARS: Record<string, string>;
|
|
140
|
+
/** Token values a consumer may set. Numbers are treated as pixels. */
|
|
141
|
+
export type CuratorTokens = Partial<Record<keyof typeof TOKEN_VARS, string | number>>;
|
|
104
142
|
export {};
|
|
105
143
|
//# sourceMappingURL=CuratorChat.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CuratorChat.d.ts","sourceRoot":"","sources":["../../src/CuratorChat.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAQL,K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