@inkeep/agents-ui 0.15.30 → 0.16.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/index.cjs +1 -1
- package/dist/index.js +74 -73
- package/dist/primitives/atoms/markdown/index.cjs +1 -1
- package/dist/primitives/atoms/markdown/index.js +41 -39
- package/dist/primitives/components/embedded-chat.cjs +3 -3
- package/dist/primitives/components/embedded-chat.js +691 -695
- package/dist/primitives/hooks/use-simple-scroll.cjs +1 -1
- package/dist/primitives/hooks/use-simple-scroll.d.ts +7 -0
- package/dist/primitives/hooks/use-simple-scroll.js +33 -30
- package/dist/primitives/index.cjs +1 -1
- package/dist/primitives/index.js +55 -54
- package/dist/primitives/providers/base-events-provider.cjs +1 -1
- package/dist/primitives/providers/base-events-provider.js +1 -1
- package/dist/primitives/utils/default-settings.cjs +1 -1
- package/dist/primitives/utils/default-settings.d.ts +1 -0
- package/dist/primitives/utils/default-settings.js +6 -5
- package/dist/primitives/utils/misc.cjs +5 -1
- package/dist/primitives/utils/misc.d.ts +2 -1
- package/dist/primitives/utils/misc.js +45 -20
- package/dist/react/embedded-chat.cjs +1 -1
- package/dist/react/embedded-chat.js +1 -1
- package/dist/react/index.cjs +1 -1
- package/dist/react/index.js +74 -73
- package/dist/styled/components/message.cjs +1 -1
- package/dist/styled/components/message.js +65 -67
- package/dist/styled/index.cjs +1 -1
- package/dist/styled/index.js +60 -59
- package/dist/types/config/ai.d.ts +7 -0
- package/package.json +1 -1
|
@@ -5,16 +5,17 @@ import { useInkeepConfig as de } from "../../primitives/providers/config-provide
|
|
|
5
5
|
import { useMessage as pe } from "../../primitives/providers/message-provider.js";
|
|
6
6
|
import { EmbeddedChatPrimitiveMarkdown as ce, PrimitiveMessagePart as D } from "../../primitives/components/embedded-chat.js";
|
|
7
7
|
import { useChat as me } from "../../primitives/components/embedded-chat/chat-provider.js";
|
|
8
|
-
import {
|
|
8
|
+
import { isCitationArtifact as ue } from "../../primitives/utils/misc.js";
|
|
9
|
+
import { merge as he } from "merge-anything";
|
|
9
10
|
import { cn as y } from "../utils.js";
|
|
10
|
-
import { markdownStyles as
|
|
11
|
-
import { useStreamProcessor as
|
|
12
|
-
import { DataSummaryGroup as
|
|
13
|
-
import { useState as L, useRef as
|
|
14
|
-
import { DynamicComponent as M, MessageLoading as
|
|
15
|
-
import { Hammer as
|
|
11
|
+
import { markdownStyles as xe } from "./ui/markdown-styles.js";
|
|
12
|
+
import { useStreamProcessor as fe } from "../../primitives/components/embedded-chat/use-stream-processor.js";
|
|
13
|
+
import { DataSummaryGroup as ge } from "./data-summary-group.js";
|
|
14
|
+
import { useState as L, useRef as A, useEffect as $, useMemo as E, useCallback as P } from "react";
|
|
15
|
+
import { DynamicComponent as M, MessageLoading as ye } from "./embedded-chat.js";
|
|
16
|
+
import { Hammer as be, ChevronDown as X, Check as F, X as we, Library as ke, ComponentIcon as Ne, XCircle as ve, TriangleAlert as Ce, CheckCircle as K, Clock as Se, Loader2 as De, Circle as Te } from "lucide-react";
|
|
16
17
|
import { button as W } from "./ui/recipes/button.js";
|
|
17
|
-
const
|
|
18
|
+
const Ae = {
|
|
18
19
|
"input-streaming": "Pending",
|
|
19
20
|
"input-available": "Running",
|
|
20
21
|
"approval-requested": "Awaiting Approval",
|
|
@@ -23,12 +24,12 @@ const Te = {
|
|
|
23
24
|
"output-error": "Error",
|
|
24
25
|
"output-denied": "Denied"
|
|
25
26
|
};
|
|
26
|
-
function
|
|
27
|
+
function Ee(t) {
|
|
27
28
|
if (!t || typeof t != "object") return !1;
|
|
28
29
|
const a = t;
|
|
29
30
|
return typeof a.type == "string" && a.type.startsWith("tool-");
|
|
30
31
|
}
|
|
31
|
-
const
|
|
32
|
+
const Pe = (t) => {
|
|
32
33
|
if (!t || typeof t != "object" || !("status" in t)) return;
|
|
33
34
|
const a = t.status;
|
|
34
35
|
return typeof a == "string" ? a : void 0;
|
|
@@ -51,7 +52,7 @@ const Ee = (t) => {
|
|
|
51
52
|
/* @__PURE__ */ e("div", { className: "flex items-center px-1.5 py-0.5 rounded-md text-2xs uppercase tracking-wider bg-gray-200 dark:bg-white-alpha-200 font-medium text-gray-700 dark:text-white-alpha-700 font-mono", children: s })
|
|
52
53
|
] }),
|
|
53
54
|
/* @__PURE__ */ e("pre", { className: "whitespace-pre-wrap text-xs text-gray-700 dark:text-white-alpha-700 font-mono px-4 py-2", children: JSON.stringify(i, null, 2) })
|
|
54
|
-
] }),
|
|
55
|
+
] }), je = ({ name: t, props: a }) => /* @__PURE__ */ e(G, { name: t, Icon: Ne, props: a, componentType: "component" }), Ie = ({ name: t, props: a }) => /* @__PURE__ */ e(G, { name: t, Icon: ke, props: a, componentType: "artifact" }), _e = ({
|
|
55
56
|
tool: t,
|
|
56
57
|
componentDef: a,
|
|
57
58
|
renderText: i,
|
|
@@ -62,19 +63,19 @@ const Ee = (t) => {
|
|
|
62
63
|
sendMessage: d,
|
|
63
64
|
conversationId: f
|
|
64
65
|
}) => {
|
|
65
|
-
const l =
|
|
66
|
+
const l = A(d);
|
|
66
67
|
l.current = d;
|
|
67
|
-
const m =
|
|
68
|
+
const m = A(c);
|
|
68
69
|
m.current = c;
|
|
69
|
-
const p =
|
|
70
|
+
const p = A(n);
|
|
70
71
|
p.current = n;
|
|
71
|
-
const h =
|
|
72
|
-
async (
|
|
73
|
-
s && (p.current({ partCount: u }), m.current({ id: s, approved:
|
|
72
|
+
const h = P(
|
|
73
|
+
async (j = !0) => {
|
|
74
|
+
s && (p.current({ partCount: u }), m.current({ id: s, approved: j }), await l.current(void 0, { body: { conversationId: f } }));
|
|
74
75
|
},
|
|
75
76
|
[s, u, f]
|
|
76
|
-
), v =
|
|
77
|
-
return /* @__PURE__ */ e(a ? M :
|
|
77
|
+
), v = E(() => ({ tool: t, approve: h, renderMarkdown: i }), [t]);
|
|
78
|
+
return /* @__PURE__ */ e(a ? M : Me, { name: t.type, props: v, componentDef: a });
|
|
78
79
|
};
|
|
79
80
|
function H(t) {
|
|
80
81
|
return t === null ? /* @__PURE__ */ e("span", { className: "text-gray-500 dark:text-white-alpha-500 font-mono font-medium text-1xs", children: "null" }) : t === void 0 ? /* @__PURE__ */ e("span", { className: "text-gray-400 dark:text-white-alpha-400 italic text-xs font-medium", children: "undefined" }) : typeof t == "boolean" ? /* @__PURE__ */ e(
|
|
@@ -107,7 +108,7 @@ const J = ({
|
|
|
107
108
|
children: i ? "—" : t
|
|
108
109
|
}
|
|
109
110
|
),
|
|
110
|
-
/* @__PURE__ */ e("span", { children: H(a) })
|
|
111
|
+
/* @__PURE__ */ e("span", { className: "min-w-0", children: H(a) })
|
|
111
112
|
] });
|
|
112
113
|
const l = d ? a.map((p, h) => [String(h), p]) : Object.entries(a);
|
|
113
114
|
return l.length === 0 ? /* @__PURE__ */ o("div", { className: "flex items-baseline gap-2 py-1 text-xs", children: [
|
|
@@ -139,13 +140,13 @@ const J = ({
|
|
|
139
140
|
),
|
|
140
141
|
u && /* @__PURE__ */ e("div", { className: "border-l-2 border-gray-200 dark:border-white-alpha-200 ml-1.5 pl-3", children: l.map(([p, h]) => /* @__PURE__ */ e(J, { name: p, value: h, isArrayIndex: d, depth: s + 1 }, p)) })
|
|
141
142
|
] });
|
|
142
|
-
},
|
|
143
|
+
}, $e = ({ value: t }) => {
|
|
143
144
|
if (t == null || typeof t != "object")
|
|
144
145
|
return /* @__PURE__ */ e("span", { className: "text-xs", children: H(t) });
|
|
145
146
|
const a = Array.isArray(t) ? t.map((i, s) => [String(s), i]) : Object.entries(t);
|
|
146
147
|
return a.length === 0 ? /* @__PURE__ */ e("div", { className: "text-xs text-gray-400 dark:text-white-alpha-400 italic", children: "No arguments" }) : /* @__PURE__ */ e("div", { className: "space-y-1", children: a.map(([i, s]) => /* @__PURE__ */ e(J, { name: i, value: s, isArrayIndex: Array.isArray(t) }, i)) });
|
|
147
|
-
},
|
|
148
|
-
const { tool: a, approve: i } = t, s = a.type, u = s.startsWith("tool-") ? s.slice(5) : s, n = a.state, c = a.approval?.id, d = !!c, f = n === "approval-requested", l =
|
|
148
|
+
}, Me = ({ props: t }) => {
|
|
149
|
+
const { tool: a, approve: i } = t, s = a.type, u = s.startsWith("tool-") ? s.slice(5) : s, n = a.state, c = a.approval?.id, d = !!c, f = n === "approval-requested", l = Pe(a.output), [m, p] = L(d), h = n ? Ae[n] ?? n : "tool";
|
|
149
150
|
return $(() => {
|
|
150
151
|
f && p(!0);
|
|
151
152
|
}, [f]), /* @__PURE__ */ o("div", { className: "border rounded-lg mb-3 overflow-hidden", children: [
|
|
@@ -159,7 +160,7 @@ const J = ({
|
|
|
159
160
|
"data-expanded": m,
|
|
160
161
|
children: [
|
|
161
162
|
/* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ o("div", { className: "font-medium flex items-center gap-2", children: [
|
|
162
|
-
/* @__PURE__ */ e(
|
|
163
|
+
/* @__PURE__ */ e(be, { className: "w-3 h-3 text-gray-600 dark:text-white-alpha-600" }),
|
|
163
164
|
/* @__PURE__ */ e("span", { children: u })
|
|
164
165
|
] }) }),
|
|
165
166
|
/* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: [
|
|
@@ -167,19 +168,19 @@ const J = ({
|
|
|
167
168
|
(() => {
|
|
168
169
|
switch (n) {
|
|
169
170
|
case "input-streaming":
|
|
170
|
-
return /* @__PURE__ */ e(
|
|
171
|
+
return /* @__PURE__ */ e(Te, { className: "w-3 h-3" });
|
|
171
172
|
case "input-available":
|
|
172
|
-
return /* @__PURE__ */ e(
|
|
173
|
+
return /* @__PURE__ */ e(De, { className: "w-3 h-3 animate-spin" });
|
|
173
174
|
case "approval-requested":
|
|
174
|
-
return /* @__PURE__ */ e(
|
|
175
|
+
return /* @__PURE__ */ e(Se, { className: "w-3 h-3" });
|
|
175
176
|
case "approval-responded":
|
|
176
177
|
return /* @__PURE__ */ e(K, { className: "w-3 h-3" });
|
|
177
178
|
case "output-available":
|
|
178
179
|
return /* @__PURE__ */ e(K, { className: "w-3 h-3" });
|
|
179
180
|
case "output-error":
|
|
180
|
-
return /* @__PURE__ */ e(
|
|
181
|
+
return /* @__PURE__ */ e(Ce, { className: "w-3 h-3" });
|
|
181
182
|
case "output-denied":
|
|
182
|
-
return /* @__PURE__ */ e(
|
|
183
|
+
return /* @__PURE__ */ e(ve, { className: "w-3 h-3" });
|
|
183
184
|
default:
|
|
184
185
|
return null;
|
|
185
186
|
}
|
|
@@ -219,7 +220,7 @@ const J = ({
|
|
|
219
220
|
"[scrollbar-width:thin] px-4",
|
|
220
221
|
"data-[expanded=true]:max-h-48 data-[expanded=true]:overflow-y-auto"
|
|
221
222
|
),
|
|
222
|
-
children: a.input != null && /* @__PURE__ */ e("div", { className: "text-xs py-2", children: /* @__PURE__ */ e(
|
|
223
|
+
children: a.input != null && /* @__PURE__ */ e("div", { className: "text-xs py-2", children: /* @__PURE__ */ e($e, { value: a.input }) })
|
|
223
224
|
}
|
|
224
225
|
)
|
|
225
226
|
}
|
|
@@ -258,14 +259,14 @@ const J = ({
|
|
|
258
259
|
l
|
|
259
260
|
] }),
|
|
260
261
|
n === "output-denied" && /* @__PURE__ */ o("div", { className: "flex justify-end items-center gap-1 whitespace-pre-wrap text-xs text-gray-700 dark:text-white-alpha-700 capitalize pb-3 px-4", children: [
|
|
261
|
-
/* @__PURE__ */ e(
|
|
262
|
+
/* @__PURE__ */ e(we, { className: "w-3 h-3" }),
|
|
262
263
|
h
|
|
263
264
|
] })
|
|
264
265
|
]
|
|
265
266
|
}
|
|
266
267
|
)
|
|
267
268
|
] });
|
|
268
|
-
},
|
|
269
|
+
}, Ze = ({
|
|
269
270
|
className: t,
|
|
270
271
|
componentStyles: a,
|
|
271
272
|
children: i,
|
|
@@ -273,30 +274,25 @@ const J = ({
|
|
|
273
274
|
...u
|
|
274
275
|
}) => {
|
|
275
276
|
const { message: n } = pe(), { logEvent: c } = le(), { conversationId: d, isStreaming: f, isLoading: l, setError: m, addToolApprovalResponse: p, sendMessage: h } = me(), {
|
|
276
|
-
aiChatSettings: { components: v, artifacts: R, headers:
|
|
277
|
-
} = de(), Q =
|
|
277
|
+
aiChatSettings: { components: v, artifacts: R, headers: j }
|
|
278
|
+
} = de(), Q = j?.["x-emit-operations"] === "true", O = n.role === "user", Y = (f || l) && s && n.role === "assistant", { processedParts: Z, summaryTimings: ee, shouldShowInitialLoading: te, shouldShowStreamDelayLoading: ae } = fe(n.parts, Y, m), [C, z] = L(null), [re, I] = L(!1), g = A(null);
|
|
278
279
|
$(() => {
|
|
279
280
|
if (!C) {
|
|
280
|
-
|
|
281
|
+
I(!1), g.current && (clearTimeout(g.current), g.current = null);
|
|
281
282
|
return;
|
|
282
283
|
}
|
|
283
|
-
return
|
|
284
|
-
|
|
284
|
+
return I(!1), g.current && clearTimeout(g.current), g.current = window.setTimeout(() => {
|
|
285
|
+
I(!0);
|
|
285
286
|
}, 1e3), () => {
|
|
286
287
|
g.current && (clearTimeout(g.current), g.current = null);
|
|
287
288
|
};
|
|
288
289
|
}, [C]), $(() => {
|
|
289
290
|
C && (!s || n.parts.length > C.partCount) && z(null);
|
|
290
291
|
}, [C, s, n.parts.length]);
|
|
291
|
-
const q =
|
|
292
|
-
() =>
|
|
293
|
-
(r) => r.type === "data-artifact" && r.data?.type?.toLowerCase() === "citation"
|
|
294
|
-
),
|
|
295
|
-
[n.parts]
|
|
296
|
-
), U = A(
|
|
297
|
-
() => ue(he, a ?? {}),
|
|
292
|
+
const q = E(() => n.parts.filter(ue), [n.parts]), U = E(
|
|
293
|
+
() => he(xe, a ?? {}),
|
|
298
294
|
[a]
|
|
299
|
-
), V =
|
|
295
|
+
), V = P(
|
|
300
296
|
(r, x) => {
|
|
301
297
|
c({
|
|
302
298
|
eventName: "assistant_message_inline_link_opened",
|
|
@@ -307,7 +303,7 @@ const J = ({
|
|
|
307
303
|
});
|
|
308
304
|
},
|
|
309
305
|
[c]
|
|
310
|
-
), B =
|
|
306
|
+
), B = P(
|
|
311
307
|
(r, x) => {
|
|
312
308
|
c({
|
|
313
309
|
eventName: "assistant_code_block_copied",
|
|
@@ -319,7 +315,7 @@ const J = ({
|
|
|
319
315
|
});
|
|
320
316
|
},
|
|
321
317
|
[c, d]
|
|
322
|
-
),
|
|
318
|
+
), _ = P(
|
|
323
319
|
(r) => /* @__PURE__ */ e(
|
|
324
320
|
ce,
|
|
325
321
|
{
|
|
@@ -331,7 +327,7 @@ const J = ({
|
|
|
331
327
|
}
|
|
332
328
|
),
|
|
333
329
|
[U, V, B, q]
|
|
334
|
-
), ne =
|
|
330
|
+
), ne = E(
|
|
335
331
|
() => y(
|
|
336
332
|
"data-[role=user]:whitespace-pre-wrap mb-3 data-[role=user]:mb-0 [&[data-role=user]>p]:mb-0 max-w-full",
|
|
337
333
|
t
|
|
@@ -351,44 +347,46 @@ const J = ({
|
|
|
351
347
|
};
|
|
352
348
|
switch (r?.type) {
|
|
353
349
|
case "text":
|
|
354
|
-
return /* @__PURE__ */ e(D, { ...k, children: O ? r.text :
|
|
350
|
+
return /* @__PURE__ */ e(D, { ...k, children: O ? r.text : _(r.text || "") }, x);
|
|
355
351
|
case "data-component": {
|
|
356
|
-
const { type:
|
|
357
|
-
switch (
|
|
352
|
+
const { type: w } = r.data;
|
|
353
|
+
switch (w) {
|
|
358
354
|
case "text":
|
|
359
|
-
return /* @__PURE__ */ e("div", { ...k, children:
|
|
355
|
+
return /* @__PURE__ */ e("div", { ...k, children: _(r.data.text || "") }, x);
|
|
360
356
|
default: {
|
|
361
|
-
const N = r.data, { name:
|
|
362
|
-
return /* @__PURE__ */ e(D, { ...k, children: /* @__PURE__ */ e(S ? M :
|
|
357
|
+
const N = r.data, { name: b, props: T } = N, S = v?.[b];
|
|
358
|
+
return /* @__PURE__ */ e(D, { ...k, children: /* @__PURE__ */ e(S ? M : je, { name: b, props: T, componentDef: S }) }, `${b}-${x}`);
|
|
363
359
|
}
|
|
364
360
|
}
|
|
365
361
|
}
|
|
366
362
|
case "data-artifact": {
|
|
367
|
-
const
|
|
368
|
-
|
|
363
|
+
const w = r.data, { name: N, type: b, artifactSummary: T } = w;
|
|
364
|
+
if (b === "citation" && !T?.url) return null;
|
|
365
|
+
const S = R?.[b];
|
|
366
|
+
return /* @__PURE__ */ e(D, { ...k, children: /* @__PURE__ */ e(S ? M : Ie, { name: b, props: T, componentDef: S }) }, `${N}-${x}`);
|
|
369
367
|
}
|
|
370
368
|
case "summary-group": {
|
|
371
|
-
const
|
|
369
|
+
const w = ee.get(r.groupKey) || {
|
|
372
370
|
isCompleted: !1
|
|
373
371
|
};
|
|
374
372
|
return /* @__PURE__ */ e(D, { ...k, children: /* @__PURE__ */ e(
|
|
375
|
-
|
|
373
|
+
ge,
|
|
376
374
|
{
|
|
377
375
|
summaries: r.summaries || [],
|
|
378
|
-
isCompleted:
|
|
376
|
+
isCompleted: w.isCompleted
|
|
379
377
|
}
|
|
380
378
|
) }, `${r.groupKey}-${x}`);
|
|
381
379
|
}
|
|
382
380
|
default: {
|
|
383
|
-
if (!
|
|
381
|
+
if (!Ee(r))
|
|
384
382
|
return null;
|
|
385
|
-
const
|
|
383
|
+
const w = r, N = r.approval?.id;
|
|
386
384
|
return Q || N ? /* @__PURE__ */ e(D, { ...k, children: /* @__PURE__ */ e(
|
|
387
|
-
|
|
385
|
+
_e,
|
|
388
386
|
{
|
|
389
|
-
tool:
|
|
387
|
+
tool: w,
|
|
390
388
|
componentDef: v?.IkpTool,
|
|
391
|
-
renderText:
|
|
389
|
+
renderText: _,
|
|
392
390
|
approvalId: N,
|
|
393
391
|
messagePartsLength: n.parts.length,
|
|
394
392
|
setApprovalDelayPending: z,
|
|
@@ -400,11 +398,11 @@ const J = ({
|
|
|
400
398
|
}
|
|
401
399
|
}
|
|
402
400
|
}),
|
|
403
|
-
te && /* @__PURE__ */ e(
|
|
401
|
+
te && /* @__PURE__ */ e(ye, {}),
|
|
404
402
|
(ae || re) && /* @__PURE__ */ e(Le, {})
|
|
405
403
|
] });
|
|
406
404
|
};
|
|
407
405
|
export {
|
|
408
|
-
|
|
409
|
-
|
|
406
|
+
Me as DefaultToolComponent,
|
|
407
|
+
Ze as EmbeddedChatMessagePart
|
|
410
408
|
};
|
package/dist/styled/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const B=require("./components/embedded-chat.cjs"),M=require("./components/chat-history.cjs"),k=require("./components/sidebar-chat.cjs"),F=require("./components/chat-bubble.cjs"),w=require("./components/embedded-search.cjs"),f=require("./components/modal.cjs"),H=require("./components/chat-button.cjs"),R=require("./components/searchbar.cjs"),T=require("./components/shadow.cjs"),E=require("./components/loading-indicator.cjs"),D=require("./components/ui/recipes/widget-toggle.cjs"),c=require("./components/message.cjs"),O=require("./components/data-summary-group.cjs"),C=require("../primitives/providers/base-events-provider.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const B=require("./components/embedded-chat.cjs"),M=require("./components/chat-history.cjs"),k=require("./components/sidebar-chat.cjs"),F=require("./components/chat-bubble.cjs"),w=require("./components/embedded-search.cjs"),f=require("./components/modal.cjs"),H=require("./components/chat-button.cjs"),R=require("./components/searchbar.cjs"),T=require("./components/shadow.cjs"),E=require("./components/loading-indicator.cjs"),D=require("./components/ui/recipes/widget-toggle.cjs"),c=require("./components/message.cjs"),O=require("./components/data-summary-group.cjs"),C=require("../primitives/providers/base-events-provider.cjs"),i=require("../primitives/providers/chat-form-provider.cjs"),l=require("../primitives/providers/chat-history-provider.cjs"),n=require("../primitives/providers/config-provider.cjs"),h=require("../primitives/providers/feedback-provider.cjs"),p=require("../primitives/providers/form-field-provider.cjs"),d=require("../primitives/providers/help-menu-provider.cjs"),S=require("../primitives/providers/markdown-provider.cjs"),u=require("../primitives/providers/message-provider.cjs"),W=require("../primitives/providers/root-provider.cjs"),b=require("../primitives/providers/source-item-provider.cjs"),x=require("../primitives/providers/theme-provider.cjs"),P=require("../primitives/providers/widget-provider.cjs"),t=require("../primitives/providers/sidebar-chat-provider.cjs"),a=require("../primitives/providers/chat-bubble-provider.cjs"),v=require("../primitives/components/factory.cjs"),A=require("../primitives/components/embedded-chat.cjs"),z=require("../primitives/components/sidebar-chat/index.cjs"),I=require("../primitives/components/embedded-chat/chat-provider.cjs"),$=require("../primitives/components/embedded-search.cjs"),m=require("../primitives/components/embedded-search/search-provider.cjs"),L=require("../primitives/components/modal.cjs"),q=require("../primitives/components/modal/modal-provider.cjs"),j=require("../primitives/components/chat-button.cjs"),G=require("../primitives/components/searchbar.cjs"),Q=require("../primitives/components/chat-bubble/index.cjs"),U=require("../primitives/components/data-summaries.cjs"),K=require("../primitives/components/chat-history/index.cjs"),N=require("../primitives/hooks/use-boolean.cjs"),J=require("../primitives/hooks/use-component-classnames.cjs"),V=require("../primitives/hooks/use-container-size.cjs"),X=require("../primitives/hooks/use-inkeep-open-state.cjs"),Y=require("../primitives/hooks/use-copy-to-clipboard.cjs"),Z=require("../primitives/hooks/use-instant-update.cjs"),_=require("../primitives/hooks/use-is-mounted.cjs"),ee=require("../primitives/hooks/use-media-query.cjs"),re=require("../primitives/hooks/use-resize-observer.cjs"),g=require("../primitives/hooks/use-scrolling-fades.cjs"),oe=require("../primitives/hooks/use-settle-action.cjs"),te=require("../primitives/hooks/use-simple-scroll.cjs"),o=require("../primitives/utils/misc.cjs"),e=require("../primitives/utils/component-ids.cjs"),y=require("../primitives/utils/compose-refs.cjs"),ae=require("../primitives/utils/merge-props.cjs"),se=require("../primitives/atoms/portal.cjs"),ie=require("../primitives/atoms/icons/custom-icon.cjs"),ne=require("../primitives/atoms/icons/built-in-icon-renderer.cjs"),de=require("../primitives/atoms/portal-with-theme.cjs"),r=require("../primitives/atoms/cmdk/index.cjs"),ue=require("../primitives/atoms/error-boundary.cjs"),s=require("../primitives/atoms/shadow/context.cjs");exports.EmbeddedChat=B;exports.ChatHistory=M;exports.SidebarChat=k;exports.ChatBubble=F;exports.EmbeddedSearch=w;exports.Modal=f;exports.ChatButton=H;exports.SearchBar=R;exports.Shadow=T.Shadow;exports.LoadingIndicator=E.LoadingIndicator;exports.widgetToggle=D.widgetToggle;exports.DefaultToolComponent=c.DefaultToolComponent;exports.EmbeddedChatMessagePart=c.EmbeddedChatMessagePart;exports.DataSummaryGroup=O.DataSummaryGroup;exports.BaseEventsProvider=C.BaseEventsProvider;exports.useBaseEvents=C.useBaseEvents;exports.ChatFormProvider=i.ChatFormProvider;exports.useChatForm=i.useChatForm;exports.useChatFormState=i.useChatFormState;exports.ChatHistoryProvider=l.ChatHistoryProvider;exports.useChatHistory=l.useChatHistory;exports.InkeepConfigProvider=n.InkeepConfigProvider;exports.WebWidgetInteractionType=n.WebWidgetInteractionType;exports.useInkeepConfig=n.useInkeepConfig;exports.FeedbackProvider=h.FeedbackProvider;exports.useMessageFeedback=h.useMessageFeedback;exports.FormFieldProvider=p.FormFieldProvider;exports.useFormField=p.useFormField;exports.HelpMenuProvider=d.HelpMenuProvider;exports.useHelpMenu=d.useHelpMenu;exports.useHelpMenuState=d.useHelpMenuState;exports.ChatMarkdownProvider=S.ChatMarkdownProvider;exports.useChatMarkdown=S.useChatMarkdown;exports.MessageProvider=u.MessageProvider;exports.useMessage=u.useMessage;exports.useOptionalMessage=u.useOptionalMessage;exports.RootProvider=W.RootProvider;exports.SourceItemProvider=b.SourceItemProvider;exports.useSourceItem=b.useSourceItem;exports.ThemeProvider=x.ThemeProvider;exports.WidgetProvider=P.WidgetProvider;exports.useWidget=P.useWidget;exports.SidebarChatProvider=t.SidebarChatProvider;exports.useInkeepSidebarChat=t.useInkeepSidebarChat;exports.useOptionalSidebarChat=t.useOptionalSidebarChat;exports.useSidebarChat=t.useSidebarChat;exports.ChatBubbleProvider=a.ChatBubbleProvider;exports.useChatBubble=a.useChatBubble;exports.useInkeepChatBubble=a.useInkeepChatBubble;exports.useOptionalChatBubble=a.useOptionalChatBubble;exports.ikp=v.ikp;exports.jsxFactory=v.jsxFactory;exports.EmbeddedChatPrimitive=A;exports.SidebarChatPrimitive=z;exports.ChatProvider=I.ChatProvider;exports.useChat=I.useChat;exports.EmbeddedSearchPrimitive=$;exports.SearchProvider=m.SearchProvider;exports.SearchProviderImpl=m.SearchProviderImpl;exports.useSearch=m.useSearch;exports.ModalPrimitive=L;exports.ModalProvider=q.ModalProvider;exports.useModal=q.useModal;exports.ChatButtonPrimitive=j;exports.SearchBarPrimitive=G;exports.ChatBubblePrimitive=Q;exports.DataSummaryPrimitive=U;exports.ChatHistoryPrimitive=K;exports.useBoolean=N.useBoolean;exports.useComponentClassNames=J.useComponentClassNames;exports.useContainerSize=V.useContainerSize;exports.useInkeepOpenState=X.useInkeepOpenState;exports.useCopyToClipboard=Y.useCopyToClipboard;exports.useInstantUpdate=Z.useInstantUpdate;exports.useIsMounted=_.useIsMounted;exports.useMediaQuery=ee.useMediaQuery;exports.useResizeObserver=re.useResizeObserver;exports.useScrollingFades=g.useScrollingFades;exports.useScrollingFadesHorizontal=g.useScrollingFadesHorizontal;exports.useSettleAction=oe.useSettleAction;exports.useSimpleScroll=te.useSimpleScroll;exports.callAll=o.callAll;exports.dataAttr=o.dataAttr;exports.getInitials=o.getInitials;exports.getMessageContent=o.getMessageContent;exports.isCitationArtifact=o.isCitationArtifact;exports.isString=o.isString;exports.maybeRender=o.maybeRender;exports.toKebabCase=o.toKebabCase;exports.ChatBubbleComponentIds=e.ChatBubbleComponentIds;exports.DataSummaryComponentIds=e.DataSummaryComponentIds;exports.SearchBarComponentIds=e.SearchBarComponentIds;exports.SidebarChatComponentIds=e.SidebarChatComponentIds;exports.aiChatComponentIds=e.aiChatComponentIds;exports.aiChatHistoryComponentIds=e.aiChatHistoryComponentIds;exports.aiSearchComponentIds=e.aiSearchComponentIds;exports.chatButtonComponentIds=e.chatButtonComponentIds;exports.componentIDs=e.componentIDs;exports.markDownComponentIds=e.markDownComponentIds;exports.miscellanousComponentIds=e.miscellanousComponentIds;exports.modalComponentIds=e.modalComponentIds;exports.composeRefs=y.composeRefs;exports.useComposedRefs=y.useComposedRefs;exports.mergeProps=ae.mergeProps;exports.Portal=se.Portal;exports.CustomIcon=ie.CustomIcon;exports.BuiltInIconRenderer=ne.BuiltInIconRenderer;exports.PortalWithTheme=de.PortalWithTheme;exports.Command=r.Command;exports.CommandDialog=r.CommandDialog;exports.CommandEmpty=r.CommandEmpty;exports.CommandInput=r.CommandInput;exports.CommandItem=r.CommandItem;exports.CommandList=r.CommandList;exports.CommandLoading=r.CommandLoading;exports.CommandRoot=r.CommandRoot;exports.CommandSeparator=r.CommandSeparator;exports.defaultFilter=r.defaultFilter;exports.useCommandState=r.useCommandState;exports.useCommandStore=r.useCommandStore;exports.ErrorBoundary=ue.ErrorBoundary;exports.InkeepShadow=s.InkeepShadow;exports.InkeepShadowProvider=s.InkeepShadowProvider;exports.ShadowContext=s.ShadowContext;exports.useShadow=s.useShadow;
|
package/dist/styled/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import * as t from "./components/chat-bubble.js";
|
|
|
5
5
|
import * as a from "./components/embedded-search.js";
|
|
6
6
|
import * as m from "./components/modal.js";
|
|
7
7
|
import * as s from "./components/chat-button.js";
|
|
8
|
-
import * as
|
|
8
|
+
import * as i from "./components/searchbar.js";
|
|
9
9
|
import { Shadow as c } from "./components/shadow.js";
|
|
10
10
|
import { LoadingIndicator as v } from "./components/loading-indicator.js";
|
|
11
11
|
import { widgetToggle as g } from "./components/ui/recipes/widget-toggle.js";
|
|
@@ -13,27 +13,27 @@ import { DefaultToolComponent as M, EmbeddedChatMessagePart as y } from "./compo
|
|
|
13
13
|
import { DataSummaryGroup as F } from "./components/data-summary-group.js";
|
|
14
14
|
import { BaseEventsProvider as w, useBaseEvents as E } from "../primitives/providers/base-events-provider.js";
|
|
15
15
|
import { ChatFormProvider as R, useChatForm as $, useChatFormState as T } from "../primitives/providers/chat-form-provider.js";
|
|
16
|
-
import { ChatHistoryProvider as W, useChatHistory as
|
|
16
|
+
import { ChatHistoryProvider as W, useChatHistory as A } from "../primitives/providers/chat-history-provider.js";
|
|
17
17
|
import { InkeepConfigProvider as L, WebWidgetInteractionType as j, useInkeepConfig as G } from "../primitives/providers/config-provider.js";
|
|
18
18
|
import { FeedbackProvider as N, useMessageFeedback as Q } from "../primitives/providers/feedback-provider.js";
|
|
19
19
|
import { FormFieldProvider as q, useFormField as J } from "../primitives/providers/form-field-provider.js";
|
|
20
20
|
import { HelpMenuProvider as X, useHelpMenu as Y, useHelpMenuState as Z } from "../primitives/providers/help-menu-provider.js";
|
|
21
21
|
import { ChatMarkdownProvider as ee, useChatMarkdown as oe } from "../primitives/providers/markdown-provider.js";
|
|
22
22
|
import { MessageProvider as te, useMessage as ae, useOptionalMessage as me } from "../primitives/providers/message-provider.js";
|
|
23
|
-
import { RootProvider as
|
|
23
|
+
import { RootProvider as ie } from "../primitives/providers/root-provider.js";
|
|
24
24
|
import { SourceItemProvider as de, useSourceItem as ne } from "../primitives/providers/source-item-provider.js";
|
|
25
25
|
import { ThemeProvider as fe } from "../primitives/providers/theme-provider.js";
|
|
26
26
|
import { WidgetProvider as xe, useWidget as he } from "../primitives/providers/widget-provider.js";
|
|
27
27
|
import { SidebarChatProvider as be, useInkeepSidebarChat as Se, useOptionalSidebarChat as ce, useSidebarChat as Pe } from "../primitives/providers/sidebar-chat-provider.js";
|
|
28
28
|
import { ChatBubbleProvider as Ie, useChatBubble as ge, useInkeepChatBubble as Be, useOptionalChatBubble as Me } from "../primitives/providers/chat-bubble-provider.js";
|
|
29
29
|
import { ikp as ke, jsxFactory as Fe } from "../primitives/components/factory.js";
|
|
30
|
-
import * as
|
|
30
|
+
import * as p from "../primitives/components/embedded-chat.js";
|
|
31
31
|
import * as d from "../primitives/components/sidebar-chat/index.js";
|
|
32
32
|
import { ChatProvider as we, useChat as Ee } from "../primitives/components/embedded-chat/chat-provider.js";
|
|
33
33
|
import * as n from "../primitives/components/embedded-search.js";
|
|
34
34
|
import { SearchProvider as Re, SearchProviderImpl as $e, useSearch as Te } from "../primitives/components/embedded-search/search-provider.js";
|
|
35
35
|
import * as u from "../primitives/components/modal.js";
|
|
36
|
-
import { ModalProvider as We, useModal as
|
|
36
|
+
import { ModalProvider as We, useModal as Ae } from "../primitives/components/modal/modal-provider.js";
|
|
37
37
|
import * as f from "../primitives/components/chat-button.js";
|
|
38
38
|
import * as C from "../primitives/components/searchbar.js";
|
|
39
39
|
import * as x from "../primitives/components/chat-bubble/index.js";
|
|
@@ -49,24 +49,24 @@ import { useIsMounted as Ze } from "../primitives/hooks/use-is-mounted.js";
|
|
|
49
49
|
import { useMediaQuery as eo } from "../primitives/hooks/use-media-query.js";
|
|
50
50
|
import { useResizeObserver as ro } from "../primitives/hooks/use-resize-observer.js";
|
|
51
51
|
import { useScrollingFades as ao, useScrollingFadesHorizontal as mo } from "../primitives/hooks/use-scrolling-fades.js";
|
|
52
|
-
import { useSettleAction as
|
|
52
|
+
import { useSettleAction as io } from "../primitives/hooks/use-settle-action.js";
|
|
53
53
|
import { useSimpleScroll as no } from "../primitives/hooks/use-simple-scroll.js";
|
|
54
|
-
import { callAll as fo, dataAttr as Co, getInitials as xo, getMessageContent as ho,
|
|
55
|
-
import { ChatBubbleComponentIds as
|
|
56
|
-
import { composeRefs as
|
|
57
|
-
import { mergeProps as
|
|
54
|
+
import { callAll as fo, dataAttr as Co, getInitials as xo, getMessageContent as ho, isCitationArtifact as lo, isString as bo, maybeRender as So, toKebabCase as co } from "../primitives/utils/misc.js";
|
|
55
|
+
import { ChatBubbleComponentIds as vo, DataSummaryComponentIds as Io, SearchBarComponentIds as go, SidebarChatComponentIds as Bo, aiChatComponentIds as Mo, aiChatHistoryComponentIds as yo, aiSearchComponentIds as ko, chatButtonComponentIds as Fo, componentIDs as Ho, markDownComponentIds as wo, miscellanousComponentIds as Eo, modalComponentIds as Do } from "../primitives/utils/component-ids.js";
|
|
56
|
+
import { composeRefs as $o, useComposedRefs as To } from "../primitives/utils/compose-refs.js";
|
|
57
|
+
import { mergeProps as Wo } from "../primitives/utils/merge-props.js";
|
|
58
58
|
import { Portal as zo } from "../primitives/atoms/portal.js";
|
|
59
|
-
import { CustomIcon as
|
|
60
|
-
import { BuiltInIconRenderer as
|
|
61
|
-
import { PortalWithTheme as
|
|
62
|
-
import { Command as
|
|
63
|
-
import { ErrorBoundary as
|
|
64
|
-
import { InkeepShadow as pr, InkeepShadowProvider as
|
|
59
|
+
import { CustomIcon as jo } from "../primitives/atoms/icons/custom-icon.js";
|
|
60
|
+
import { BuiltInIconRenderer as Ko } from "../primitives/atoms/icons/built-in-icon-renderer.js";
|
|
61
|
+
import { PortalWithTheme as Qo } from "../primitives/atoms/portal-with-theme.js";
|
|
62
|
+
import { Command as qo, CommandDialog as Jo, CommandEmpty as Vo, CommandInput as Xo, CommandItem as Yo, CommandList as Zo, CommandLoading as _o, CommandRoot as er, CommandSeparator as or, defaultFilter as rr, useCommandState as tr, useCommandStore as ar } from "../primitives/atoms/cmdk/index.js";
|
|
63
|
+
import { ErrorBoundary as sr } from "../primitives/atoms/error-boundary.js";
|
|
64
|
+
import { InkeepShadow as pr, InkeepShadowProvider as dr, ShadowContext as nr, useShadow as ur } from "../primitives/atoms/shadow/context.js";
|
|
65
65
|
export {
|
|
66
66
|
w as BaseEventsProvider,
|
|
67
|
-
|
|
67
|
+
Ko as BuiltInIconRenderer,
|
|
68
68
|
t as ChatBubble,
|
|
69
|
-
|
|
69
|
+
vo as ChatBubbleComponentIds,
|
|
70
70
|
x as ChatBubblePrimitive,
|
|
71
71
|
Ie as ChatBubbleProvider,
|
|
72
72
|
s as ChatButton,
|
|
@@ -77,87 +77,88 @@ export {
|
|
|
77
77
|
W as ChatHistoryProvider,
|
|
78
78
|
ee as ChatMarkdownProvider,
|
|
79
79
|
we as ChatProvider,
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
80
|
+
qo as Command,
|
|
81
|
+
Jo as CommandDialog,
|
|
82
|
+
Vo as CommandEmpty,
|
|
83
|
+
Xo as CommandInput,
|
|
84
|
+
Yo as CommandItem,
|
|
85
|
+
Zo as CommandList,
|
|
86
|
+
_o as CommandLoading,
|
|
87
|
+
er as CommandRoot,
|
|
88
|
+
or as CommandSeparator,
|
|
89
|
+
jo as CustomIcon,
|
|
90
|
+
Io as DataSummaryComponentIds,
|
|
91
91
|
F as DataSummaryGroup,
|
|
92
92
|
h as DataSummaryPrimitive,
|
|
93
93
|
M as DefaultToolComponent,
|
|
94
94
|
e as EmbeddedChat,
|
|
95
95
|
y as EmbeddedChatMessagePart,
|
|
96
|
-
|
|
96
|
+
p as EmbeddedChatPrimitive,
|
|
97
97
|
a as EmbeddedSearch,
|
|
98
98
|
n as EmbeddedSearchPrimitive,
|
|
99
|
-
|
|
99
|
+
sr as ErrorBoundary,
|
|
100
100
|
N as FeedbackProvider,
|
|
101
101
|
q as FormFieldProvider,
|
|
102
102
|
X as HelpMenuProvider,
|
|
103
103
|
L as InkeepConfigProvider,
|
|
104
104
|
pr as InkeepShadow,
|
|
105
|
-
|
|
105
|
+
dr as InkeepShadowProvider,
|
|
106
106
|
v as LoadingIndicator,
|
|
107
107
|
te as MessageProvider,
|
|
108
108
|
m as Modal,
|
|
109
109
|
u as ModalPrimitive,
|
|
110
110
|
We as ModalProvider,
|
|
111
111
|
zo as Portal,
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
112
|
+
Qo as PortalWithTheme,
|
|
113
|
+
ie as RootProvider,
|
|
114
|
+
i as SearchBar,
|
|
115
|
+
go as SearchBarComponentIds,
|
|
116
116
|
C as SearchBarPrimitive,
|
|
117
117
|
Re as SearchProvider,
|
|
118
118
|
$e as SearchProviderImpl,
|
|
119
119
|
c as Shadow,
|
|
120
|
-
|
|
120
|
+
nr as ShadowContext,
|
|
121
121
|
r as SidebarChat,
|
|
122
|
-
|
|
122
|
+
Bo as SidebarChatComponentIds,
|
|
123
123
|
d as SidebarChatPrimitive,
|
|
124
124
|
be as SidebarChatProvider,
|
|
125
125
|
de as SourceItemProvider,
|
|
126
126
|
fe as ThemeProvider,
|
|
127
127
|
j as WebWidgetInteractionType,
|
|
128
128
|
xe as WidgetProvider,
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
129
|
+
Mo as aiChatComponentIds,
|
|
130
|
+
yo as aiChatHistoryComponentIds,
|
|
131
|
+
ko as aiSearchComponentIds,
|
|
132
132
|
fo as callAll,
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
133
|
+
Fo as chatButtonComponentIds,
|
|
134
|
+
Ho as componentIDs,
|
|
135
|
+
$o as composeRefs,
|
|
136
136
|
Co as dataAttr,
|
|
137
|
-
|
|
137
|
+
rr as defaultFilter,
|
|
138
138
|
xo as getInitials,
|
|
139
139
|
ho as getMessageContent,
|
|
140
140
|
ke as ikp,
|
|
141
|
-
lo as
|
|
141
|
+
lo as isCitationArtifact,
|
|
142
|
+
bo as isString,
|
|
142
143
|
Fe as jsxFactory,
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
144
|
+
wo as markDownComponentIds,
|
|
145
|
+
So as maybeRender,
|
|
146
|
+
Wo as mergeProps,
|
|
147
|
+
Eo as miscellanousComponentIds,
|
|
148
|
+
Do as modalComponentIds,
|
|
149
|
+
co as toKebabCase,
|
|
149
150
|
E as useBaseEvents,
|
|
150
151
|
Le as useBoolean,
|
|
151
152
|
Ee as useChat,
|
|
152
153
|
ge as useChatBubble,
|
|
153
154
|
$ as useChatForm,
|
|
154
155
|
T as useChatFormState,
|
|
155
|
-
|
|
156
|
+
A as useChatHistory,
|
|
156
157
|
oe as useChatMarkdown,
|
|
157
|
-
|
|
158
|
-
|
|
158
|
+
tr as useCommandState,
|
|
159
|
+
ar as useCommandStore,
|
|
159
160
|
Ge as useComponentClassNames,
|
|
160
|
-
|
|
161
|
+
To as useComposedRefs,
|
|
161
162
|
Ne as useContainerSize,
|
|
162
163
|
Je as useCopyToClipboard,
|
|
163
164
|
J as useFormField,
|
|
@@ -172,7 +173,7 @@ export {
|
|
|
172
173
|
eo as useMediaQuery,
|
|
173
174
|
ae as useMessage,
|
|
174
175
|
Q as useMessageFeedback,
|
|
175
|
-
|
|
176
|
+
Ae as useModal,
|
|
176
177
|
Me as useOptionalChatBubble,
|
|
177
178
|
me as useOptionalMessage,
|
|
178
179
|
ce as useOptionalSidebarChat,
|
|
@@ -180,8 +181,8 @@ export {
|
|
|
180
181
|
ao as useScrollingFades,
|
|
181
182
|
mo as useScrollingFadesHorizontal,
|
|
182
183
|
Te as useSearch,
|
|
183
|
-
|
|
184
|
-
|
|
184
|
+
io as useSettleAction,
|
|
185
|
+
ur as useShadow,
|
|
185
186
|
Pe as useSidebarChat,
|
|
186
187
|
no as useSimpleScroll,
|
|
187
188
|
ne as useSourceItem,
|
|
@@ -195,6 +195,13 @@ export interface InkeepAIChatSettings {
|
|
|
195
195
|
*/
|
|
196
196
|
components?: ComponentsConfig<any>;
|
|
197
197
|
artifacts?: ComponentsConfig<any>;
|
|
198
|
+
/**
|
|
199
|
+
* Controls whether the chat automatically scrolls to the bottom
|
|
200
|
+
* during streaming. When false, streaming auto-scroll is disabled
|
|
201
|
+
* but the chat still scrolls to bottom when the user sends a new message.
|
|
202
|
+
* @default true
|
|
203
|
+
*/
|
|
204
|
+
shouldAutoScroll?: boolean;
|
|
198
205
|
}
|
|
199
206
|
export interface AIChatDisclaimerSettings {
|
|
200
207
|
/**
|