@aigentyc/chat-sdk 0.4.0 → 0.5.1
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/context7.json +1 -1
- package/dist/{ChatInterface-0rq8D5-8.d.cts → ChatInterface-DrzYAWnG.d.cts} +1 -1
- package/dist/{ChatInterface--yaDB5yp.d.ts → ChatInterface-qiVhkmx3.d.ts} +1 -1
- package/dist/{SlotsContext-CWTjP0mA.d.ts → SlotsContext-B_087V7B.d.ts} +99 -5
- package/dist/{SlotsContext-u5CFB7MS.d.cts → SlotsContext-DAQiASVu.d.cts} +99 -5
- package/dist/ai-elements.cjs +164 -567
- package/dist/ai-elements.cjs.map +1 -1
- package/dist/ai-elements.d.cts +10 -2
- package/dist/ai-elements.d.ts +10 -2
- package/dist/ai-elements.js +17 -462
- package/dist/ai-elements.js.map +1 -1
- package/dist/{chunk-LSKOJ7SH.js → chunk-3H4CX3MS.js} +8 -5
- package/dist/chunk-3H4CX3MS.js.map +1 -0
- package/dist/{chunk-4WOBNRRB.cjs → chunk-6CVBJ4EI.cjs} +594 -10
- package/dist/chunk-6CVBJ4EI.cjs.map +1 -0
- package/dist/{chunk-3MP2EGEJ.cjs → chunk-72QJ2ORD.cjs} +4 -2
- package/dist/chunk-72QJ2ORD.cjs.map +1 -0
- package/dist/chunk-BYTPAQ7F.js +70 -0
- package/dist/chunk-BYTPAQ7F.js.map +1 -0
- package/dist/{chunk-P3RPAI4F.cjs → chunk-BYX6IOGX.cjs} +4 -4
- package/dist/{chunk-P3RPAI4F.cjs.map → chunk-BYX6IOGX.cjs.map} +1 -1
- package/dist/{chunk-B27JIQ4Z.js → chunk-CNGIOCLR.js} +577 -7
- package/dist/chunk-CNGIOCLR.js.map +1 -0
- package/dist/chunk-CNPYBLLT.js +81 -0
- package/dist/chunk-CNPYBLLT.js.map +1 -0
- package/dist/{chunk-6ZZTTD5E.js → chunk-CW6LCVNC.js} +3 -3
- package/dist/{chunk-6ZZTTD5E.js.map → chunk-CW6LCVNC.js.map} +1 -1
- package/dist/chunk-DDATCJ3O.cjs +75 -0
- package/dist/chunk-DDATCJ3O.cjs.map +1 -0
- package/dist/{chunk-LVWSWTI3.cjs → chunk-DTOOWY2S.cjs} +184 -74
- package/dist/chunk-DTOOWY2S.cjs.map +1 -0
- package/dist/{chunk-NYQSM3EB.cjs → chunk-DVWX2UGY.cjs} +16 -2
- package/dist/chunk-DVWX2UGY.cjs.map +1 -0
- package/dist/{chunk-TZ7EM3EG.cjs → chunk-EMVZ7HWM.cjs} +44 -2
- package/dist/chunk-EMVZ7HWM.cjs.map +1 -0
- package/dist/{chunk-3EN3DMUL.js → chunk-JAEXKKSE.js} +47 -38
- package/dist/chunk-JAEXKKSE.js.map +1 -0
- package/dist/{chunk-JHWSG5IB.js → chunk-JAOD6CNW.js} +38 -3
- package/dist/chunk-JAOD6CNW.js.map +1 -0
- package/dist/{chunk-OEEDYJTV.cjs → chunk-JEK2V5I3.cjs} +6 -6
- package/dist/{chunk-OEEDYJTV.cjs.map → chunk-JEK2V5I3.cjs.map} +1 -1
- package/dist/{chunk-QYCEHFAB.js → chunk-LDQVDUUJ.js} +4 -2
- package/dist/chunk-LDQVDUUJ.js.map +1 -0
- package/dist/{chunk-AWRQSM42.cjs → chunk-NBZDBH4M.cjs} +8 -5
- package/dist/chunk-NBZDBH4M.cjs.map +1 -0
- package/dist/{chunk-5F3O3ZJH.js → chunk-P7UR37HP.js} +17 -4
- package/dist/chunk-P7UR37HP.js.map +1 -0
- package/dist/{chunk-3KSMOHNY.js → chunk-R3TYC66R.js} +46 -81
- package/dist/chunk-R3TYC66R.js.map +1 -0
- package/dist/{chunk-RAQVW2D7.js → chunk-UTEGHMBN.js} +142 -33
- package/dist/chunk-UTEGHMBN.js.map +1 -0
- package/dist/{chunk-46MUOYPR.cjs → chunk-UXVOUC2A.cjs} +47 -38
- package/dist/chunk-UXVOUC2A.cjs.map +1 -0
- package/dist/{chunk-IU7Q7O5G.js → chunk-VQPOUMBC.js} +3 -3
- package/dist/{chunk-IU7Q7O5G.js.map → chunk-VQPOUMBC.js.map} +1 -1
- package/dist/chunk-VYBHYFG3.cjs +87 -0
- package/dist/chunk-VYBHYFG3.cjs.map +1 -0
- package/dist/{chunk-OU5OZKYH.cjs → chunk-Y4B45DW4.cjs} +48 -90
- package/dist/chunk-Y4B45DW4.cjs.map +1 -0
- package/dist/components.cjs +22 -21
- package/dist/components.cjs.map +1 -1
- package/dist/components.d.cts +3 -3
- package/dist/components.d.ts +3 -3
- package/dist/components.js +10 -9
- package/dist/components.js.map +1 -1
- package/dist/core.cjs +21 -82
- package/dist/core.cjs.map +1 -1
- package/dist/core.d.cts +2 -2
- package/dist/core.d.ts +2 -2
- package/dist/core.js +2 -78
- package/dist/core.js.map +1 -1
- package/dist/hooks.cjs +36 -14
- package/dist/hooks.cjs.map +1 -1
- package/dist/hooks.d.cts +2 -2
- package/dist/hooks.d.ts +2 -2
- package/dist/hooks.js +7 -5
- package/dist/hooks.js.map +1 -1
- package/dist/i18n.cjs +5 -5
- package/dist/i18n.d.cts +2 -2
- package/dist/i18n.d.ts +2 -2
- package/dist/i18n.js +1 -1
- package/dist/index.cjs +61 -35
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +15 -5
- package/dist/index.d.ts +15 -5
- package/dist/index.js +16 -14
- package/dist/index.js.map +1 -1
- package/dist/llms-full.txt +10 -10
- package/dist/styles.css +1 -1
- package/dist/theme.cjs +4 -4
- package/dist/theme.d.cts +1 -1
- package/dist/theme.d.ts +1 -1
- package/dist/theme.js +2 -2
- package/dist/tools.cjs +6 -5
- package/dist/tools.d.cts +2 -2
- package/dist/tools.d.ts +2 -2
- package/dist/tools.js +3 -2
- package/dist/{types-DQCjs81O.d.cts → types-DRa1zFlN.d.cts} +33 -1
- package/dist/{types-DQCjs81O.d.ts → types-DRa1zFlN.d.ts} +33 -1
- package/dist/ui.cjs +52 -52
- package/dist/ui.js +2 -2
- package/package.json +2 -2
- package/dist/chunk-3EN3DMUL.js.map +0 -1
- package/dist/chunk-3KSMOHNY.js.map +0 -1
- package/dist/chunk-3MP2EGEJ.cjs.map +0 -1
- package/dist/chunk-46MUOYPR.cjs.map +0 -1
- package/dist/chunk-4WOBNRRB.cjs.map +0 -1
- package/dist/chunk-5F3O3ZJH.js.map +0 -1
- package/dist/chunk-AWRQSM42.cjs.map +0 -1
- package/dist/chunk-B27JIQ4Z.js.map +0 -1
- package/dist/chunk-JHWSG5IB.js.map +0 -1
- package/dist/chunk-LSKOJ7SH.js.map +0 -1
- package/dist/chunk-LVWSWTI3.cjs.map +0 -1
- package/dist/chunk-NYQSM3EB.cjs.map +0 -1
- package/dist/chunk-OU5OZKYH.cjs.map +0 -1
- package/dist/chunk-QYCEHFAB.js.map +0 -1
- package/dist/chunk-RAQVW2D7.js.map +0 -1
- package/dist/chunk-TZ7EM3EG.cjs.map +0 -1
package/dist/theme.cjs
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('./chunk-
|
|
4
|
+
var chunkBYX6IOGX_cjs = require('./chunk-BYX6IOGX.cjs');
|
|
5
|
+
require('./chunk-72QJ2ORD.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
Object.defineProperty(exports, "ThemeProvider", {
|
|
10
10
|
enumerable: true,
|
|
11
|
-
get: function () { return
|
|
11
|
+
get: function () { return chunkBYX6IOGX_cjs.ThemeProvider; }
|
|
12
12
|
});
|
|
13
13
|
Object.defineProperty(exports, "useTheme", {
|
|
14
14
|
enumerable: true,
|
|
15
|
-
get: function () { return
|
|
15
|
+
get: function () { return chunkBYX6IOGX_cjs.useTheme; }
|
|
16
16
|
});
|
|
17
17
|
//# sourceMappingURL=theme.cjs.map
|
|
18
18
|
//# sourceMappingURL=theme.cjs.map
|
package/dist/theme.d.cts
CHANGED
package/dist/theme.d.ts
CHANGED
package/dist/theme.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export { ThemeProvider, useTheme } from './chunk-
|
|
3
|
-
import './chunk-
|
|
2
|
+
export { ThemeProvider, useTheme } from './chunk-VQPOUMBC.js';
|
|
3
|
+
import './chunk-LDQVDUUJ.js';
|
|
4
4
|
//# sourceMappingURL=theme.js.map
|
|
5
5
|
//# sourceMappingURL=theme.js.map
|
package/dist/tools.cjs
CHANGED
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
var chunk7AZMWPKX_cjs = require('./chunk-7AZMWPKX.cjs');
|
|
5
|
-
var
|
|
6
|
-
require('./chunk-
|
|
5
|
+
var chunkJEK2V5I3_cjs = require('./chunk-JEK2V5I3.cjs');
|
|
6
|
+
require('./chunk-UXVOUC2A.cjs');
|
|
7
|
+
require('./chunk-VYBHYFG3.cjs');
|
|
7
8
|
require('./chunk-JOO6C3XT.cjs');
|
|
8
9
|
var chunkH7C3AGA2_cjs = require('./chunk-H7C3AGA2.cjs');
|
|
9
10
|
var chunkQ7T3VAJV_cjs = require('./chunk-Q7T3VAJV.cjs');
|
|
@@ -23,15 +24,15 @@ Object.defineProperty(exports, "normalizeToolRows", {
|
|
|
23
24
|
});
|
|
24
25
|
Object.defineProperty(exports, "ComponentRenderer", {
|
|
25
26
|
enumerable: true,
|
|
26
|
-
get: function () { return
|
|
27
|
+
get: function () { return chunkJEK2V5I3_cjs.ComponentRenderer; }
|
|
27
28
|
});
|
|
28
29
|
Object.defineProperty(exports, "SearchKnowledgeBaseRenderer", {
|
|
29
30
|
enumerable: true,
|
|
30
|
-
get: function () { return
|
|
31
|
+
get: function () { return chunkJEK2V5I3_cjs.SearchKnowledgeBaseRenderer; }
|
|
31
32
|
});
|
|
32
33
|
Object.defineProperty(exports, "ToolRenderer", {
|
|
33
34
|
enumerable: true,
|
|
34
|
-
get: function () { return
|
|
35
|
+
get: function () { return chunkJEK2V5I3_cjs.ToolRenderer; }
|
|
35
36
|
});
|
|
36
37
|
Object.defineProperty(exports, "JsonRenderResult", {
|
|
37
38
|
enumerable: true,
|
package/dist/tools.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import {
|
|
3
|
-
export {
|
|
2
|
+
import { T as ToolRendererProps } from './types-DRa1zFlN.cjs';
|
|
3
|
+
export { C as ComponentAction, a as ToolResult } from './types-DRa1zFlN.cjs';
|
|
4
4
|
export { J as JsonRenderResult } from './JsonRenderResult-D6ogds0_.cjs';
|
|
5
5
|
export { g as getToolDisplayData, n as normalizeToolRows } from './normalize-KzCLLqpU.cjs';
|
|
6
6
|
import 'react';
|
package/dist/tools.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import {
|
|
3
|
-
export {
|
|
2
|
+
import { T as ToolRendererProps } from './types-DRa1zFlN.js';
|
|
3
|
+
export { C as ComponentAction, a as ToolResult } from './types-DRa1zFlN.js';
|
|
4
4
|
export { J as JsonRenderResult } from './JsonRenderResult-D6ogds0_.js';
|
|
5
5
|
export { g as getToolDisplayData, n as normalizeToolRows } from './normalize-KzCLLqpU.js';
|
|
6
6
|
import 'react';
|
package/dist/tools.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
export { getToolDisplayData, normalizeToolRows } from './chunk-XEAAB5ZM.js';
|
|
3
|
-
export { ComponentRenderer, SearchKnowledgeBaseRenderer, ToolRenderer } from './chunk-
|
|
4
|
-
import './chunk-
|
|
3
|
+
export { ComponentRenderer, SearchKnowledgeBaseRenderer, ToolRenderer } from './chunk-CW6LCVNC.js';
|
|
4
|
+
import './chunk-JAEXKKSE.js';
|
|
5
|
+
import './chunk-CNPYBLLT.js';
|
|
5
6
|
import './chunk-PS3U7T37.js';
|
|
6
7
|
export { JsonRenderResult } from './chunk-ZXP7IYRC.js';
|
|
7
8
|
export { VisualizationRenderer } from './chunk-5T4FJ2SR.js';
|
|
@@ -178,6 +178,15 @@ interface SlotMap {
|
|
|
178
178
|
floatingButton?: ComponentType<SlotProps>;
|
|
179
179
|
/** Custom empty-state shown when no messages exist */
|
|
180
180
|
emptyState?: ComponentType<SlotProps>;
|
|
181
|
+
/**
|
|
182
|
+
* Custom failure card, shown in place of the answer when a turn is refused
|
|
183
|
+
* or the stream dies. Receives `{ error, onRetry, onNewConversation }`.
|
|
184
|
+
*
|
|
185
|
+
* Override it to match the host's styling — but a host that renders nothing
|
|
186
|
+
* here brings back the failure mode this slot exists to end: a refused turn
|
|
187
|
+
* that looks exactly like a turn nobody sent.
|
|
188
|
+
*/
|
|
189
|
+
error?: ComponentType<SlotProps>;
|
|
181
190
|
}
|
|
182
191
|
/**
|
|
183
192
|
* Describes a follow-up action attached to a tool invocation result.
|
|
@@ -358,6 +367,12 @@ interface ChatMessage {
|
|
|
358
367
|
input?: Record<string, unknown>;
|
|
359
368
|
/** Tool output */
|
|
360
369
|
output?: unknown;
|
|
370
|
+
/** File source (when `type === "file"`) — a `data:` URI or an https URL */
|
|
371
|
+
url?: string;
|
|
372
|
+
/** File MIME type (when `type === "file"`) */
|
|
373
|
+
mediaType?: string;
|
|
374
|
+
/** Original file name (when `type === "file"`) */
|
|
375
|
+
filename?: string;
|
|
361
376
|
}>;
|
|
362
377
|
}
|
|
363
378
|
/**
|
|
@@ -393,5 +408,22 @@ interface ChatProviderProps extends ChatConfig, ChatEventCallbacks {
|
|
|
393
408
|
/** React children to render inside the provider */
|
|
394
409
|
children?: React.ReactNode;
|
|
395
410
|
}
|
|
411
|
+
/**
|
|
412
|
+
* One file travelling out with a user message.
|
|
413
|
+
*
|
|
414
|
+
* Structurally the AI SDK's `FileUIPart`, restated here so consumers do not have
|
|
415
|
+
* to depend on `ai` directly just to type a composer. `url` is what the model is
|
|
416
|
+
* eventually shown: either a `data:` URI or an https URL the backend can read.
|
|
417
|
+
*/
|
|
418
|
+
interface ChatAttachmentInput {
|
|
419
|
+
/** Always `"file"` — present so the value is already a valid message part. */
|
|
420
|
+
type?: "file";
|
|
421
|
+
/** MIME type, e.g. `"image/jpeg"`. */
|
|
422
|
+
mediaType: string;
|
|
423
|
+
/** `data:` URI or an https URL the backend can fetch. */
|
|
424
|
+
url: string;
|
|
425
|
+
/** Original file name, shown in the transcript. */
|
|
426
|
+
filename?: string;
|
|
427
|
+
}
|
|
396
428
|
|
|
397
|
-
export type {
|
|
429
|
+
export type { ComponentAction as C, Language as L, QuestionConfig as Q, SlotMap as S, ToolRendererProps as T, ToolResult as a, ChatProviderProps as b, ChatAttachmentInput as c, ChatConfig as d, ChatEventCallbacks as e, ChatMessage as f, LiveChatMessage as g, LiveChatState as h, ThemeConfig as i, SlotProps as j };
|
|
@@ -178,6 +178,15 @@ interface SlotMap {
|
|
|
178
178
|
floatingButton?: ComponentType<SlotProps>;
|
|
179
179
|
/** Custom empty-state shown when no messages exist */
|
|
180
180
|
emptyState?: ComponentType<SlotProps>;
|
|
181
|
+
/**
|
|
182
|
+
* Custom failure card, shown in place of the answer when a turn is refused
|
|
183
|
+
* or the stream dies. Receives `{ error, onRetry, onNewConversation }`.
|
|
184
|
+
*
|
|
185
|
+
* Override it to match the host's styling — but a host that renders nothing
|
|
186
|
+
* here brings back the failure mode this slot exists to end: a refused turn
|
|
187
|
+
* that looks exactly like a turn nobody sent.
|
|
188
|
+
*/
|
|
189
|
+
error?: ComponentType<SlotProps>;
|
|
181
190
|
}
|
|
182
191
|
/**
|
|
183
192
|
* Describes a follow-up action attached to a tool invocation result.
|
|
@@ -358,6 +367,12 @@ interface ChatMessage {
|
|
|
358
367
|
input?: Record<string, unknown>;
|
|
359
368
|
/** Tool output */
|
|
360
369
|
output?: unknown;
|
|
370
|
+
/** File source (when `type === "file"`) — a `data:` URI or an https URL */
|
|
371
|
+
url?: string;
|
|
372
|
+
/** File MIME type (when `type === "file"`) */
|
|
373
|
+
mediaType?: string;
|
|
374
|
+
/** Original file name (when `type === "file"`) */
|
|
375
|
+
filename?: string;
|
|
361
376
|
}>;
|
|
362
377
|
}
|
|
363
378
|
/**
|
|
@@ -393,5 +408,22 @@ interface ChatProviderProps extends ChatConfig, ChatEventCallbacks {
|
|
|
393
408
|
/** React children to render inside the provider */
|
|
394
409
|
children?: React.ReactNode;
|
|
395
410
|
}
|
|
411
|
+
/**
|
|
412
|
+
* One file travelling out with a user message.
|
|
413
|
+
*
|
|
414
|
+
* Structurally the AI SDK's `FileUIPart`, restated here so consumers do not have
|
|
415
|
+
* to depend on `ai` directly just to type a composer. `url` is what the model is
|
|
416
|
+
* eventually shown: either a `data:` URI or an https URL the backend can read.
|
|
417
|
+
*/
|
|
418
|
+
interface ChatAttachmentInput {
|
|
419
|
+
/** Always `"file"` — present so the value is already a valid message part. */
|
|
420
|
+
type?: "file";
|
|
421
|
+
/** MIME type, e.g. `"image/jpeg"`. */
|
|
422
|
+
mediaType: string;
|
|
423
|
+
/** `data:` URI or an https URL the backend can fetch. */
|
|
424
|
+
url: string;
|
|
425
|
+
/** Original file name, shown in the transcript. */
|
|
426
|
+
filename?: string;
|
|
427
|
+
}
|
|
396
428
|
|
|
397
|
-
export type {
|
|
429
|
+
export type { ComponentAction as C, Language as L, QuestionConfig as Q, SlotMap as S, ToolRendererProps as T, ToolResult as a, ChatProviderProps as b, ChatAttachmentInput as c, ChatConfig as d, ChatEventCallbacks as e, ChatMessage as f, LiveChatMessage as g, LiveChatState as h, ThemeConfig as i, SlotProps as j };
|
package/dist/ui.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
var
|
|
4
|
+
var chunkY4B45DW4_cjs = require('./chunk-Y4B45DW4.cjs');
|
|
5
|
+
var chunkEMVZ7HWM_cjs = require('./chunk-EMVZ7HWM.cjs');
|
|
6
6
|
var chunkJI5KCSOI_cjs = require('./chunk-JI5KCSOI.cjs');
|
|
7
7
|
var chunkAWAJOSFP_cjs = require('./chunk-AWAJOSFP.cjs');
|
|
8
8
|
var chunk525KS5HM_cjs = require('./chunk-525KS5HM.cjs');
|
|
@@ -442,163 +442,163 @@ TableCaption.displayName = "TableCaption";
|
|
|
442
442
|
|
|
443
443
|
Object.defineProperty(exports, "Alert", {
|
|
444
444
|
enumerable: true,
|
|
445
|
-
get: function () { return
|
|
445
|
+
get: function () { return chunkY4B45DW4_cjs.Alert; }
|
|
446
446
|
});
|
|
447
447
|
Object.defineProperty(exports, "AlertDescription", {
|
|
448
448
|
enumerable: true,
|
|
449
|
-
get: function () { return
|
|
449
|
+
get: function () { return chunkY4B45DW4_cjs.AlertDescription; }
|
|
450
450
|
});
|
|
451
451
|
Object.defineProperty(exports, "AlertTitle", {
|
|
452
452
|
enumerable: true,
|
|
453
|
-
get: function () { return
|
|
453
|
+
get: function () { return chunkY4B45DW4_cjs.AlertTitle; }
|
|
454
454
|
});
|
|
455
455
|
Object.defineProperty(exports, "Badge", {
|
|
456
456
|
enumerable: true,
|
|
457
|
-
get: function () { return
|
|
457
|
+
get: function () { return chunkY4B45DW4_cjs.Badge; }
|
|
458
458
|
});
|
|
459
459
|
Object.defineProperty(exports, "Carousel", {
|
|
460
460
|
enumerable: true,
|
|
461
|
-
get: function () { return
|
|
461
|
+
get: function () { return chunkY4B45DW4_cjs.Carousel; }
|
|
462
462
|
});
|
|
463
463
|
Object.defineProperty(exports, "CarouselContent", {
|
|
464
464
|
enumerable: true,
|
|
465
|
-
get: function () { return
|
|
465
|
+
get: function () { return chunkY4B45DW4_cjs.CarouselContent; }
|
|
466
466
|
});
|
|
467
467
|
Object.defineProperty(exports, "CarouselItem", {
|
|
468
468
|
enumerable: true,
|
|
469
|
-
get: function () { return
|
|
469
|
+
get: function () { return chunkY4B45DW4_cjs.CarouselItem; }
|
|
470
470
|
});
|
|
471
471
|
Object.defineProperty(exports, "CarouselNext", {
|
|
472
472
|
enumerable: true,
|
|
473
|
-
get: function () { return
|
|
473
|
+
get: function () { return chunkY4B45DW4_cjs.CarouselNext; }
|
|
474
474
|
});
|
|
475
475
|
Object.defineProperty(exports, "CarouselPrevious", {
|
|
476
476
|
enumerable: true,
|
|
477
|
-
get: function () { return
|
|
477
|
+
get: function () { return chunkY4B45DW4_cjs.CarouselPrevious; }
|
|
478
478
|
});
|
|
479
479
|
Object.defineProperty(exports, "Dialog", {
|
|
480
480
|
enumerable: true,
|
|
481
|
-
get: function () { return
|
|
481
|
+
get: function () { return chunkY4B45DW4_cjs.Dialog; }
|
|
482
482
|
});
|
|
483
483
|
Object.defineProperty(exports, "DialogClose", {
|
|
484
484
|
enumerable: true,
|
|
485
|
-
get: function () { return
|
|
485
|
+
get: function () { return chunkY4B45DW4_cjs.DialogClose; }
|
|
486
486
|
});
|
|
487
487
|
Object.defineProperty(exports, "DialogContent", {
|
|
488
488
|
enumerable: true,
|
|
489
|
-
get: function () { return
|
|
489
|
+
get: function () { return chunkY4B45DW4_cjs.DialogContent; }
|
|
490
490
|
});
|
|
491
491
|
Object.defineProperty(exports, "DialogDescription", {
|
|
492
492
|
enumerable: true,
|
|
493
|
-
get: function () { return
|
|
493
|
+
get: function () { return chunkY4B45DW4_cjs.DialogDescription; }
|
|
494
494
|
});
|
|
495
495
|
Object.defineProperty(exports, "DialogFooter", {
|
|
496
496
|
enumerable: true,
|
|
497
|
-
get: function () { return
|
|
497
|
+
get: function () { return chunkY4B45DW4_cjs.DialogFooter; }
|
|
498
498
|
});
|
|
499
499
|
Object.defineProperty(exports, "DialogHeader", {
|
|
500
500
|
enumerable: true,
|
|
501
|
-
get: function () { return
|
|
501
|
+
get: function () { return chunkY4B45DW4_cjs.DialogHeader; }
|
|
502
502
|
});
|
|
503
503
|
Object.defineProperty(exports, "DialogTitle", {
|
|
504
504
|
enumerable: true,
|
|
505
|
-
get: function () { return
|
|
505
|
+
get: function () { return chunkY4B45DW4_cjs.DialogTitle; }
|
|
506
506
|
});
|
|
507
507
|
Object.defineProperty(exports, "DialogTrigger", {
|
|
508
508
|
enumerable: true,
|
|
509
|
-
get: function () { return
|
|
509
|
+
get: function () { return chunkY4B45DW4_cjs.DialogTrigger; }
|
|
510
510
|
});
|
|
511
511
|
Object.defineProperty(exports, "DropdownMenu", {
|
|
512
512
|
enumerable: true,
|
|
513
|
-
get: function () { return
|
|
513
|
+
get: function () { return chunkY4B45DW4_cjs.DropdownMenu; }
|
|
514
514
|
});
|
|
515
515
|
Object.defineProperty(exports, "DropdownMenuContent", {
|
|
516
516
|
enumerable: true,
|
|
517
|
-
get: function () { return
|
|
517
|
+
get: function () { return chunkY4B45DW4_cjs.DropdownMenuContent; }
|
|
518
518
|
});
|
|
519
519
|
Object.defineProperty(exports, "DropdownMenuItem", {
|
|
520
520
|
enumerable: true,
|
|
521
|
-
get: function () { return
|
|
521
|
+
get: function () { return chunkY4B45DW4_cjs.DropdownMenuItem; }
|
|
522
522
|
});
|
|
523
523
|
Object.defineProperty(exports, "DropdownMenuTrigger", {
|
|
524
524
|
enumerable: true,
|
|
525
|
-
get: function () { return
|
|
525
|
+
get: function () { return chunkY4B45DW4_cjs.DropdownMenuTrigger; }
|
|
526
526
|
});
|
|
527
527
|
Object.defineProperty(exports, "Input", {
|
|
528
528
|
enumerable: true,
|
|
529
|
-
get: function () { return
|
|
529
|
+
get: function () { return chunkY4B45DW4_cjs.Input; }
|
|
530
530
|
});
|
|
531
531
|
Object.defineProperty(exports, "Progress", {
|
|
532
532
|
enumerable: true,
|
|
533
|
-
get: function () { return
|
|
533
|
+
get: function () { return chunkY4B45DW4_cjs.Progress; }
|
|
534
534
|
});
|
|
535
535
|
Object.defineProperty(exports, "ScrollArea", {
|
|
536
536
|
enumerable: true,
|
|
537
|
-
get: function () { return
|
|
537
|
+
get: function () { return chunkY4B45DW4_cjs.ScrollArea; }
|
|
538
538
|
});
|
|
539
539
|
Object.defineProperty(exports, "ScrollBar", {
|
|
540
540
|
enumerable: true,
|
|
541
|
-
get: function () { return
|
|
541
|
+
get: function () { return chunkY4B45DW4_cjs.ScrollBar; }
|
|
542
542
|
});
|
|
543
543
|
Object.defineProperty(exports, "Select", {
|
|
544
544
|
enumerable: true,
|
|
545
|
-
get: function () { return
|
|
545
|
+
get: function () { return chunkY4B45DW4_cjs.Select; }
|
|
546
546
|
});
|
|
547
547
|
Object.defineProperty(exports, "SelectContent", {
|
|
548
548
|
enumerable: true,
|
|
549
|
-
get: function () { return
|
|
549
|
+
get: function () { return chunkY4B45DW4_cjs.SelectContent; }
|
|
550
550
|
});
|
|
551
551
|
Object.defineProperty(exports, "SelectItem", {
|
|
552
552
|
enumerable: true,
|
|
553
|
-
get: function () { return
|
|
553
|
+
get: function () { return chunkY4B45DW4_cjs.SelectItem; }
|
|
554
554
|
});
|
|
555
555
|
Object.defineProperty(exports, "SelectTrigger", {
|
|
556
556
|
enumerable: true,
|
|
557
|
-
get: function () { return
|
|
557
|
+
get: function () { return chunkY4B45DW4_cjs.SelectTrigger; }
|
|
558
558
|
});
|
|
559
559
|
Object.defineProperty(exports, "SelectValue", {
|
|
560
560
|
enumerable: true,
|
|
561
|
-
get: function () { return
|
|
561
|
+
get: function () { return chunkY4B45DW4_cjs.SelectValue; }
|
|
562
562
|
});
|
|
563
|
-
Object.defineProperty(exports, "
|
|
563
|
+
Object.defineProperty(exports, "Button", {
|
|
564
564
|
enumerable: true,
|
|
565
|
-
get: function () { return
|
|
565
|
+
get: function () { return chunkEMVZ7HWM_cjs.Button; }
|
|
566
566
|
});
|
|
567
|
-
Object.defineProperty(exports, "
|
|
567
|
+
Object.defineProperty(exports, "Collapsible", {
|
|
568
568
|
enumerable: true,
|
|
569
|
-
get: function () { return
|
|
569
|
+
get: function () { return chunkEMVZ7HWM_cjs.Collapsible; }
|
|
570
570
|
});
|
|
571
|
-
Object.defineProperty(exports, "
|
|
571
|
+
Object.defineProperty(exports, "CollapsibleContent", {
|
|
572
572
|
enumerable: true,
|
|
573
|
-
get: function () { return
|
|
573
|
+
get: function () { return chunkEMVZ7HWM_cjs.CollapsibleContent; }
|
|
574
574
|
});
|
|
575
|
-
Object.defineProperty(exports, "
|
|
575
|
+
Object.defineProperty(exports, "CollapsibleTrigger", {
|
|
576
576
|
enumerable: true,
|
|
577
|
-
get: function () { return
|
|
577
|
+
get: function () { return chunkEMVZ7HWM_cjs.CollapsibleTrigger; }
|
|
578
578
|
});
|
|
579
|
-
Object.defineProperty(exports, "
|
|
579
|
+
Object.defineProperty(exports, "Separator", {
|
|
580
580
|
enumerable: true,
|
|
581
|
-
get: function () { return
|
|
581
|
+
get: function () { return chunkEMVZ7HWM_cjs.Separator; }
|
|
582
582
|
});
|
|
583
|
-
Object.defineProperty(exports, "
|
|
583
|
+
Object.defineProperty(exports, "Textarea", {
|
|
584
584
|
enumerable: true,
|
|
585
|
-
get: function () { return
|
|
585
|
+
get: function () { return chunkEMVZ7HWM_cjs.Textarea; }
|
|
586
586
|
});
|
|
587
|
-
Object.defineProperty(exports, "
|
|
587
|
+
Object.defineProperty(exports, "Tooltip", {
|
|
588
588
|
enumerable: true,
|
|
589
|
-
get: function () { return
|
|
589
|
+
get: function () { return chunkEMVZ7HWM_cjs.Tooltip; }
|
|
590
590
|
});
|
|
591
|
-
Object.defineProperty(exports, "
|
|
591
|
+
Object.defineProperty(exports, "TooltipContent", {
|
|
592
592
|
enumerable: true,
|
|
593
|
-
get: function () { return
|
|
593
|
+
get: function () { return chunkEMVZ7HWM_cjs.TooltipContent; }
|
|
594
594
|
});
|
|
595
|
-
Object.defineProperty(exports, "
|
|
595
|
+
Object.defineProperty(exports, "TooltipProvider", {
|
|
596
596
|
enumerable: true,
|
|
597
|
-
get: function () { return
|
|
597
|
+
get: function () { return chunkEMVZ7HWM_cjs.TooltipProvider; }
|
|
598
598
|
});
|
|
599
|
-
Object.defineProperty(exports, "
|
|
599
|
+
Object.defineProperty(exports, "TooltipTrigger", {
|
|
600
600
|
enumerable: true,
|
|
601
|
-
get: function () { return
|
|
601
|
+
get: function () { return chunkEMVZ7HWM_cjs.TooltipTrigger; }
|
|
602
602
|
});
|
|
603
603
|
Object.defineProperty(exports, "Spinner", {
|
|
604
604
|
enumerable: true,
|
package/dist/ui.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export { Alert, AlertDescription, AlertTitle, Badge, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, Input, Progress, ScrollArea, ScrollBar, Select, SelectContent, SelectItem, SelectTrigger, SelectValue
|
|
3
|
-
export { Button, Collapsible, CollapsibleContent, CollapsibleTrigger, Textarea } from './chunk-
|
|
2
|
+
export { Alert, AlertDescription, AlertTitle, Badge, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, Input, Progress, ScrollArea, ScrollBar, Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from './chunk-R3TYC66R.js';
|
|
3
|
+
export { Button, Collapsible, CollapsibleContent, CollapsibleTrigger, Separator, Textarea, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from './chunk-JAOD6CNW.js';
|
|
4
4
|
export { Spinner } from './chunk-4QT25AXI.js';
|
|
5
5
|
export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from './chunk-NPJKLYLV.js';
|
|
6
6
|
import { cn } from './chunk-3RW7O444.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aigentyc/chat-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "React SDK for building AI-powered chat interfaces connected to the Aigentyc platform",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
@@ -123,7 +123,7 @@
|
|
|
123
123
|
"LICENSE"
|
|
124
124
|
],
|
|
125
125
|
"bin": {
|
|
126
|
-
"aigentyc": "
|
|
126
|
+
"aigentyc": "bin/aigentyc.mjs"
|
|
127
127
|
},
|
|
128
128
|
"homepage": "https://www.npmjs.com/package/@aigentyc/chat-sdk",
|
|
129
129
|
"scripts": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/providers/SlotsContext.tsx","../src/providers/ChatContext.tsx"],"names":["createContext","jsx","useContext"],"mappings":";;;;;;AA2CA,IAAM,YAAA,GAAe,aAAA,CAAuB,EAAE,CAAA;AAcvC,SAAS,cAAc,EAAE,KAAA,GAAQ,EAAC,EAAG,UAAS,EAAuB;AAC1E,EAAA,2BACG,YAAA,CAAa,QAAA,EAAb,EAAsB,KAAA,EAAO,OAAQ,QAAA,EAAS,CAAA;AAEnD;AAKO,SAAS,QAAA,GAAoB;AAClC,EAAA,OAAO,WAAW,YAAY,CAAA;AAChC;AAKO,SAAS,QACd,IAAA,EAC8B;AAC9B,EAAA,MAAM,KAAA,GAAQ,WAAW,YAAY,CAAA;AACrC,EAAA,OAAO,MAAM,IAAI,CAAA;AACnB;AAeO,SAAS,UAAA,CACd,IAAA,EACA,KAAA,EACA,gBAAA,EACA,KAAA,EACoB;AACpB,EAAA,MAAM,WAAA,GAAc,KAAA;AACpB,EAAA,MAAM,QAAA,GAAW,MAAM,IAAI,CAAA;AAG3B,EAAA,IAAI,QAAA,EAAU;AACZ,IAAA,uBAAO,GAAA,CAAC,QAAA,EAAA,EAAU,GAAG,WAAA,EAAa,gBAAA,EAAoC,CAAA;AAAA,EACxE;AACA,EAAA,MAAM,OAAA,GAAU,gBAAA;AAChB,EAAA,uBAAO,GAAA,CAAC,OAAA,EAAA,EAAS,GAAG,WAAA,EAAa,CAAA;AACnC;AC9EA,IAAM,kBAAA,GAAqB,mBAAA;AAC3B,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,MAAM,IAAI,KAAA;AAAA,MACR;AAAA,KACF;AAAA,EACF;AACA,EAAA,OAAO,GAAA;AACT","file":"chunk-3EN3DMUL.js","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport {\n createContext,\n useContext,\n type ReactNode,\n type ComponentType,\n} from \"react\";\n\n/**\n * All available slot names that can be overridden.\n */\nexport type SlotName =\n | \"header\"\n | \"footer\"\n | \"input\"\n | \"welcomePage\"\n | \"userMessage\"\n | \"assistantMessage\"\n | \"systemMessage\"\n | \"loader\"\n | \"feedback\"\n | \"tools\"\n | \"toolRenderers\"\n | \"liveChatPanel\"\n | \"satisfactionRating\"\n | \"visitorIdentityForm\"\n | \"floatingButton\"\n | \"emptyState\";\n\n/**\n * A slot component receives the default component as a prop alongside its own props.\n */\nexport type SlotComponent<P = Record<string, unknown>> = ComponentType<\n P & { DefaultComponent: ComponentType<P> }\n>;\n\n/**\n * Map of slot name to override component.\n */\nexport type SlotMap = Partial<Record<SlotName, SlotComponent<any>>>;\n\nconst SlotsContext = createContext<SlotMap>({});\n\n/** Props for the SlotsProvider component. */\nexport interface SlotsProviderProps {\n /** Slot overrides map */\n slots?: SlotMap;\n children: ReactNode;\n}\n\n/**\n * Provides slot overrides to descendant components.\n * Wrap your chat tree with this provider and pass a `slots` map\n * to replace built-in UI sections.\n */\nexport function SlotsProvider({ slots = {}, children }: SlotsProviderProps) {\n return (\n <SlotsContext.Provider value={slots}>{children}</SlotsContext.Provider>\n );\n}\n\n/**\n * Returns the full SlotMap from context.\n */\nexport function useSlots(): SlotMap {\n return useContext(SlotsContext);\n}\n\n/**\n * Returns the override component for the given slot name, or undefined if none is set.\n */\nexport function useSlot<P = Record<string, unknown>>(\n name: SlotName\n): SlotComponent<P> | undefined {\n const slots = useContext(SlotsContext);\n return slots[name] as SlotComponent<P> | undefined;\n}\n\n/**\n * Renders a slot: if an override exists, renders it with `{...props, DefaultComponent}`.\n * Otherwise renders the DefaultComponent with the given props.\n *\n * The generic `P` is NOT constrained to `Record<string, unknown>` so concrete\n * component prop types (e.g. `ChatHeaderProps`) flow through at call sites\n * without `as never` casts. Internal spreads are cast through\n * `Record<string, unknown>` — safe because JSX spread accepts any record.\n *\n * @param name - The slot name\n * @param props - Props to pass to the component\n * @param DefaultComponent - The built-in fallback component\n */\nexport function renderSlot<P>(\n name: SlotName,\n props: P,\n DefaultComponent: ComponentType<P>,\n slots: SlotMap\n): React.ReactElement {\n const spreadProps = props as unknown as Record<string, unknown>;\n const Override = slots[name] as\n | ComponentType<Record<string, unknown> & { DefaultComponent: ComponentType<P> }>\n | undefined;\n if (Override) {\n return <Override {...spreadProps} DefaultComponent={DefaultComponent} />;\n }\n const Default = DefaultComponent as ComponentType<Record<string, unknown>>;\n return <Default {...spreadProps} />;\n}\n","\"use client\";\n\nimport {\n createContext,\n useContext,\n useState,\n useCallback,\n useRef,\n useEffect,\n useMemo,\n type ReactNode,\n} from \"react\";\nimport type {\n ChatConfig,\n ChatMessage,\n ChatEventCallbacks,\n} from \"../core/types\";\nimport { useChat } from \"@ai-sdk/react\";\nimport { DefaultChatTransport } from \"ai\";\n\ntype ChatStatus = \"idle\" | \"streaming\" | \"error\";\n\ninterface ActiveTool {\n toolName: string;\n state: \"partial-call\" | \"call\" | \"output-available\";\n args: Record<string, unknown>;\n result?: unknown;\n renderMode: string;\n}\n\nconst SESSION_KEY_PREFIX = \"aigentyc-session-\";\nconst MESSAGE_KEY_PREFIX = \"aigentyc-messages-\";\n\nfunction getOrCreateSessionId(projectId: string): string {\n if (typeof window === \"undefined\") return crypto.randomUUID();\n const key = SESSION_KEY_PREFIX + projectId;\n try {\n const stored = sessionStorage.getItem(key);\n if (stored) return stored;\n const id = crypto.randomUUID();\n sessionStorage.setItem(key, id);\n return id;\n } catch {\n return crypto.randomUUID();\n }\n}\n\nfunction persistMessages(projectId: string, messages: unknown[]): void {\n if (typeof window === \"undefined\") return;\n try {\n localStorage.setItem(MESSAGE_KEY_PREFIX + projectId, JSON.stringify(messages));\n } catch {\n // Quota or unavailable\n }\n}\n\nfunction loadPersistedMessages(projectId: string): ChatMessage[] {\n if (typeof window === \"undefined\") return [];\n try {\n const raw = localStorage.getItem(MESSAGE_KEY_PREFIX + projectId);\n return raw ? JSON.parse(raw) : [];\n } catch {\n return [];\n }\n}\n\nfunction clearPersistedMessages(projectId: string): void {\n if (typeof window === \"undefined\") return;\n try {\n localStorage.removeItem(MESSAGE_KEY_PREFIX + projectId);\n } catch {\n // ignore\n }\n}\n\nexport interface ChatContextValue {\n messages: ChatMessage[];\n status: ChatStatus;\n error: Error | undefined;\n sessionId: string;\n config: ChatConfig;\n activeTools: ActiveTool[];\n sendMessage: (content: string) => void;\n stopGeneration: () => void;\n newConversation: () => void;\n clearMessages: () => void;\n callbacks?: ChatEventCallbacks;\n}\n\nexport const ChatContext = createContext<ChatContextValue | null>(null);\n\nexport interface ChatContextProviderProps {\n config: ChatConfig;\n callbacks?: ChatEventCallbacks;\n children: ReactNode;\n}\n\n/**\n * Internal provider that manages chat state via @ai-sdk/react `useChat`.\n * Handles message persistence and session management.\n */\nexport function ChatContextProvider({\n config,\n callbacks,\n children,\n}: ChatContextProviderProps) {\n const projectId = config.projectId || \"default\";\n const [sessionId, setSessionId] = useState(() => getOrCreateSessionId(projectId));\n const callbacksRef = useRef(callbacks);\n callbacksRef.current = callbacks;\n\n // Re-load persisted messages whenever the session changes (incl. after\n // newConversation()). Keying only on mount cached the original array, so\n // useChat would re-inject the OLD messages into the new sessionId — a real\n // \"new chat\" effectively kept the old conversation alive.\n const initialMessages = useMemo(\n () => loadPersistedMessages(projectId),\n [projectId, sessionId]\n );\n\n // Page context is whatever the host page looks like *right now*, so it is read\n // through a ref at send time rather than captured when the transport is built.\n // Rebuilding the transport on every navigation would remount `useChat` and\n // drop an in-flight stream — in a single-page host that is one route change.\n const pageRef = useRef({\n pageUrl: config.pageUrl,\n pageTitle: config.pageTitle,\n pageContext: config.pageContext,\n });\n pageRef.current = {\n pageUrl: config.pageUrl,\n pageTitle: config.pageTitle,\n pageContext: config.pageContext,\n };\n\n const transport = useMemo(\n () =>\n new DefaultChatTransport({\n api: `${config.apiEndpoint || \"\"}/api/kb/chat`,\n headers: config.apiKey ? { Authorization: `Bearer ${config.apiKey}` } : undefined,\n // A function body is resolved per request by the AI SDK transport.\n body: () => {\n const { pageUrl, pageTitle, pageContext } = pageRef.current;\n return {\n projectId: config.projectId,\n sessionId,\n ...(pageUrl ? { pageUrl } : {}),\n ...(pageTitle ? { pageTitle } : {}),\n ...(pageContext !== undefined ? { pageContext } : {}),\n };\n },\n }),\n [config.apiEndpoint, config.apiKey, config.projectId, sessionId]\n );\n\n const {\n messages,\n sendMessage: sdkSendMessage,\n status: sdkStatus,\n error,\n stop,\n setMessages,\n } = useChat({\n id: sessionId,\n messages: initialMessages as never,\n transport,\n onFinish: (message) => {\n callbacksRef.current?.onMessageReceived?.(message as unknown as ChatMessage);\n },\n onError: (err) => {\n callbacksRef.current?.onError?.(err);\n },\n });\n\n const status: ChatStatus = error\n ? \"error\"\n : sdkStatus === \"streaming\" || sdkStatus === \"submitted\"\n ? \"streaming\"\n : \"idle\";\n\n useEffect(() => {\n persistMessages(projectId, messages);\n }, [messages, projectId]);\n\n const activeTools = useMemo<ActiveTool[]>(() => {\n if (messages.length === 0) return [];\n const last = messages[messages.length - 1] as { role: string; parts?: unknown[] };\n if (last.role !== \"assistant\" || !Array.isArray(last.parts)) return [];\n return (last.parts as Array<Record<string, unknown>>)\n .filter((p) => typeof p.type === \"string\" && (p.type as string).startsWith(\"tool-\"))\n .map((p) => ({\n toolName: (p.toolName as string) || (p.type as string).replace(\"tool-\", \"\"),\n state: (p.state as ActiveTool[\"state\"]) || \"output-available\",\n args: (p.args as Record<string, unknown>) || {},\n result: p.result,\n renderMode: (p.renderMode as string) || \"inline\",\n }));\n }, [messages]);\n\n const sendMessage = useCallback(\n (content: string) => {\n if (!content.trim()) return;\n callbacksRef.current?.onMessageSent?.({\n id: crypto.randomUUID(),\n role: \"user\",\n content,\n } as ChatMessage);\n sdkSendMessage({ text: content });\n },\n [sdkSendMessage]\n );\n\n const stopGeneration = useCallback(() => stop(), [stop]);\n\n const newConversation = useCallback(() => {\n setMessages([]);\n clearPersistedMessages(projectId);\n if (typeof window !== \"undefined\") {\n try {\n sessionStorage.removeItem(SESSION_KEY_PREFIX + projectId);\n } catch {\n // ignore\n }\n }\n setSessionId(getOrCreateSessionId(projectId));\n }, [projectId, setMessages]);\n\n const clearMessages = useCallback(() => {\n setMessages([]);\n clearPersistedMessages(projectId);\n }, [projectId, setMessages]);\n\n const value = useMemo<ChatContextValue>(\n () => ({\n messages: messages as unknown as ChatMessage[],\n status,\n error: error as Error | undefined,\n sessionId,\n config,\n activeTools,\n sendMessage,\n stopGeneration,\n newConversation,\n clearMessages,\n callbacks: callbacksRef.current,\n }),\n [\n messages,\n status,\n error,\n sessionId,\n config,\n activeTools,\n sendMessage,\n stopGeneration,\n newConversation,\n clearMessages,\n ]\n );\n\n return <ChatContext.Provider value={value}>{children}</ChatContext.Provider>;\n}\n\n/**\n * Returns the chat context. Must be used within a `ChatContextProvider`.\n */\nexport function useChatContext(): ChatContextValue {\n const ctx = useContext(ChatContext);\n if (!ctx) {\n throw new Error(\n \"useChatContext must be used within a ChatProvider or ChatContextProvider\"\n );\n }\n return ctx;\n}\n"]}
|