@inkeep/agents-ui 0.14.12 → 0.14.14
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.d.cts +14 -11
- package/dist/index.d.ts +14 -11
- package/dist/primitives/atoms/dialog.cjs +1 -1
- package/dist/primitives/atoms/dialog.js +129 -131
- package/dist/primitives/components/embedded-chat/use-inkeep-chat.cjs +1 -1
- package/dist/primitives/components/embedded-chat/use-inkeep-chat.js +21 -18
- package/dist/primitives/components/embedded-chat/use-stream-processor.cjs +1 -1
- package/dist/primitives/components/embedded-chat/use-stream-processor.js +73 -105
- package/dist/primitives/hooks/use-streaming-events.cjs +1 -1
- package/dist/primitives/hooks/use-streaming-events.js +19 -126
- package/dist/primitives/providers/base-events-provider.cjs +1 -1
- package/dist/primitives/providers/base-events-provider.js +1 -1
- package/dist/styled/components/data-summary-group.cjs +1 -1
- package/dist/styled/components/data-summary-group.js +35 -31
- package/dist/types/types.d.cts +4 -2
- package/dist/types/types.d.ts +4 -2
- package/package.json +2 -1
package/dist/index.d.cts
CHANGED
|
@@ -1225,17 +1225,7 @@ export declare const dataAttr: (guard: boolean | undefined) => Booleanish;
|
|
|
1225
1225
|
|
|
1226
1226
|
declare type DataParts = {
|
|
1227
1227
|
operation: {
|
|
1228
|
-
type:
|
|
1229
|
-
| 'error'
|
|
1230
|
-
| 'agent_initializing'
|
|
1231
|
-
| 'completion'
|
|
1232
|
-
| 'agent_generate'
|
|
1233
|
-
| 'agent_reasoning'
|
|
1234
|
-
| 'tool_execution'
|
|
1235
|
-
| 'transfer'
|
|
1236
|
-
| 'delegation_sent'
|
|
1237
|
-
| 'delegation_returned'
|
|
1238
|
-
| 'artifact_saved'
|
|
1228
|
+
type: OperationType
|
|
1239
1229
|
ctx: Record<string, unknown>
|
|
1240
1230
|
message?: string
|
|
1241
1231
|
label?: string
|
|
@@ -3851,6 +3841,19 @@ export declare const ModalProvider: React.FC<{
|
|
|
3851
3841
|
|
|
3852
3842
|
declare type OnLoadingStatusChange = AvatarPrimitive.AvatarImageProps['onLoadingStatusChange'];
|
|
3853
3843
|
|
|
3844
|
+
declare type OperationType =
|
|
3845
|
+
| 'error'
|
|
3846
|
+
| 'agent_initializing'
|
|
3847
|
+
| 'completion'
|
|
3848
|
+
| 'agent_generate'
|
|
3849
|
+
| 'agent_reasoning'
|
|
3850
|
+
| 'tool_call'
|
|
3851
|
+
| 'tool_result'
|
|
3852
|
+
| 'transfer'
|
|
3853
|
+
| 'delegation_sent'
|
|
3854
|
+
| 'delegation_returned'
|
|
3855
|
+
| 'artifact_saved'
|
|
3856
|
+
|
|
3854
3857
|
declare const Overlay: React_2.ForwardRefExoticComponent<DialogOverlayProps & React_2.RefAttributes<HTMLDivElement>>;
|
|
3855
3858
|
|
|
3856
3859
|
export declare interface PolymorphicProps {
|
package/dist/index.d.ts
CHANGED
|
@@ -1225,17 +1225,7 @@ export declare const dataAttr: (guard: boolean | undefined) => Booleanish;
|
|
|
1225
1225
|
|
|
1226
1226
|
declare type DataParts = {
|
|
1227
1227
|
operation: {
|
|
1228
|
-
type:
|
|
1229
|
-
| 'error'
|
|
1230
|
-
| 'agent_initializing'
|
|
1231
|
-
| 'completion'
|
|
1232
|
-
| 'agent_generate'
|
|
1233
|
-
| 'agent_reasoning'
|
|
1234
|
-
| 'tool_execution'
|
|
1235
|
-
| 'transfer'
|
|
1236
|
-
| 'delegation_sent'
|
|
1237
|
-
| 'delegation_returned'
|
|
1238
|
-
| 'artifact_saved'
|
|
1228
|
+
type: OperationType
|
|
1239
1229
|
ctx: Record<string, unknown>
|
|
1240
1230
|
message?: string
|
|
1241
1231
|
label?: string
|
|
@@ -3851,6 +3841,19 @@ export declare const ModalProvider: React.FC<{
|
|
|
3851
3841
|
|
|
3852
3842
|
declare type OnLoadingStatusChange = AvatarPrimitive.AvatarImageProps['onLoadingStatusChange'];
|
|
3853
3843
|
|
|
3844
|
+
declare type OperationType =
|
|
3845
|
+
| 'error'
|
|
3846
|
+
| 'agent_initializing'
|
|
3847
|
+
| 'completion'
|
|
3848
|
+
| 'agent_generate'
|
|
3849
|
+
| 'agent_reasoning'
|
|
3850
|
+
| 'tool_call'
|
|
3851
|
+
| 'tool_result'
|
|
3852
|
+
| 'transfer'
|
|
3853
|
+
| 'delegation_sent'
|
|
3854
|
+
| 'delegation_returned'
|
|
3855
|
+
| 'artifact_saved'
|
|
3856
|
+
|
|
3854
3857
|
declare const Overlay: React_2.ForwardRefExoticComponent<DialogOverlayProps & React_2.RefAttributes<HTMLDivElement>>;
|
|
3855
3858
|
|
|
3856
3859
|
export declare interface PolymorphicProps {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),P=require("react"),m=require("@radix-ui/primitive"),O=require("@radix-ui/react-compose-refs"),H=require("@radix-ui/react-context"),R=require("@radix-ui/react-id"),W=require("@radix-ui/react-use-controllable-state"),z=require("@radix-ui/react-dismissable-layer"),B=require("@zag-js/focus-trap"),K=require("@radix-ui/react-portal"),_=require("@radix-ui/react-presence"),g=require("@radix-ui/react-primitive"),U=require("@radix-ui/react-focus-guards"),V=require("aria-hidden"),Y=require("@zag-js/remove-scroll"),$=require("./shadow/context.cjs");function J(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const s=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(n,o,s.get?s:{enumerable:!0,get:()=>e[o]})}}return n.default=e,Object.freeze(n)}const c=J(P),x="Dialog",[w,Q]=H.createContextScope(x),[X,l]=w(x),y=e=>{const{__scopeDialog:n,children:o,open:s,defaultOpen:r,onOpenChange:t,modal:a=!0}=e,u=c.useRef(null),f=c.useRef(null),[D=!1,d]=W.useControllableState({prop:s,defaultProp:r??!1,onChange:t});return i.jsx(X,{scope:n,triggerRef:u,contentRef:f,contentId:R.useId(),titleId:R.useId(),descriptionId:R.useId(),open:D,onOpenChange:d,onOpenToggle:c.useCallback(()=>d(N=>!N),[d]),modal:a,children:o})};y.displayName=x;const M="DialogTrigger",q=c.forwardRef((e,n)=>{const{__scopeDialog:o,...s}=e,r=l(M,o),t=O.useComposedRefs(n,r.triggerRef);return i.jsx(g.Primitive.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":T(r.open),...s,ref:t,onClick:m.composeEventHandlers(e.onClick,r.onOpenToggle)})});q.displayName=M;const v="DialogPortal",[Z,S]=w(v,{forceMount:void 0}),E=e=>{const{__scopeDialog:n,forceMount:o,children:s,container:r}=e,t=l(v,n);return i.jsx(Z,{scope:n,forceMount:o,children:c.Children.map(s,a=>i.jsx(_.Presence,{present:o||t.open,children:i.jsx(K.Portal,{asChild:!0,container:r,children:a})}))})};E.displayName=v;const C="DialogOverlay",I=c.forwardRef((e,n)=>{const o=S(C,e.__scopeDialog),{forceMount:s=o.forceMount,...r}=e,t=l(C,e.__scopeDialog);return t.modal?i.jsx(_.Presence,{present:s||t.open,children:i.jsx(ee,{...r,ref:n})}):null});I.displayName=C;const ee=c.forwardRef((e,n)=>{const{__scopeDialog:o,...s}=e,r=l(C,o),t=$.useShadow();return P.useEffect(()=>{t&&Y.preventBodyScroll(t?.rootElement?.ownerDocument)},[t]),i.jsx(g.Primitive.div,{"data-state":T(r.open),...s,ref:n,style:{pointerEvents:"auto",...s.style}})}),p="DialogContent",h=c.forwardRef((e,n)=>{const o=S(p,e.__scopeDialog),{forceMount:s=o.forceMount,...r}=e,t=l(p,e.__scopeDialog);return i.jsx(_.Presence,{present:s||t.open,children:t.modal?i.jsx(te,{...r,ref:n}):i.jsx(oe,{...r,ref:n})})});h.displayName=p;const te=c.forwardRef((e,n)=>{const o=l(p,e.__scopeDialog),s=c.useRef(null),r=O.useComposedRefs(n,o.contentRef,s);return c.useEffect(()=>{const t=s.current;if(t){const a=document.querySelectorAll("[data-ikp-component]");return V.hideOthers([t,...Array.from(a)])}},[]),i.jsx(k,{...e,ref:r,trapFocus:o.open,disableOutsidePointerEvents:!0,onPointerDownOutside:m.composeEventHandlers(e.onPointerDownOutside,t=>{const a=t.detail.originalEvent,u=a.button===0&&a.ctrlKey===!0;(a.button===2||u)&&t.preventDefault(),t.target.closest("[data-ikp-component]")&&t.preventDefault()}),onFocusOutside:m.composeEventHandlers(e.onFocusOutside,t=>t.preventDefault())})}),oe=c.forwardRef((e,n)=>{const o=l(p,e.__scopeDialog),s=c.useRef(!1),r=c.useRef(!1);return i.jsx(k,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(s.current=!0,t.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const a=t.target;o.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type==="focusin"&&r.current&&t.preventDefault()}})}),k=c.forwardRef((e,n)=>{const{__scopeDialog:o,trapFocus:s,onOpenAutoFocus:r,onCloseAutoFocus:t,...a}=e,u=l(p,o),f=c.useRef(null),D=O.useComposedRefs(n,f);return U.useFocusGuards(),P.useEffect(()=>{if(s)return B.trapFocus(f.current,{preventScroll:!0,onActivate:r,onDeactivate:t,initialFocus:!1,allowOutsideClick:d=>!!d.target.closest("[data-ikp-component]")})},[]),i.jsx(z.DismissableLayer,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":T(u.open),...a,ref:D,onDismiss:()=>u.onOpenChange(!1)})}),A="DialogTitle",b=c.forwardRef((e,n)=>{const{__scopeDialog:o,...s}=e,r=l(A,o);return i.jsx(g.Primitive.h2,{id:r.titleId,...s,ref:n})});b.displayName=A;const F="DialogDescription",L=c.forwardRef((e,n)=>{const{__scopeDialog:o,...s}=e,r=l(F,o);return i.jsx(g.Primitive.p,{id:r.descriptionId,...s,ref:n})});L.displayName=F;const G="DialogClose",j=c.forwardRef((e,n)=>{const{__scopeDialog:o,...s}=e,r=l(G,o);return i.jsx(g.Primitive.button,{type:"button",...s,ref:n,onClick:m.composeEventHandlers(e.onClick,()=>r.onOpenChange(!1))})});j.displayName=G;function T(e){return e?"open":"closed"}const ne=y,re=E,se=I,ce=h,ie=b,ae=j;exports.Close=ae;exports.Content=ce;exports.Dialog=y;exports.DialogClose=j;exports.DialogContent=h;exports.DialogDescription=L;exports.DialogOverlay=I;exports.DialogPortal=E;exports.DialogTitle=b;exports.DialogTrigger=q;exports.Overlay=se;exports.Portal=re;exports.Root=ne;exports.Title=ie;exports.createDialogScope=Q;
|
|
@@ -1,167 +1,165 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as c } from "react/jsx-runtime";
|
|
3
3
|
import * as i from "react";
|
|
4
|
-
import { useEffect as
|
|
4
|
+
import { useEffect as I } from "react";
|
|
5
5
|
import { composeEventHandlers as D } from "@radix-ui/primitive";
|
|
6
6
|
import { useComposedRefs as _ } from "@radix-ui/react-compose-refs";
|
|
7
7
|
import { createContextScope as W } from "@radix-ui/react-context";
|
|
8
|
-
import { useId as
|
|
8
|
+
import { useId as R } from "@radix-ui/react-id";
|
|
9
9
|
import { useControllableState as $ } from "@radix-ui/react-use-controllable-state";
|
|
10
10
|
import { DismissableLayer as j } from "@radix-ui/react-dismissable-layer";
|
|
11
11
|
import { trapFocus as q } from "@zag-js/focus-trap";
|
|
12
12
|
import { Portal as B } from "@radix-ui/react-portal";
|
|
13
13
|
import { Presence as O } from "@radix-ui/react-presence";
|
|
14
|
-
import { Primitive as
|
|
14
|
+
import { Primitive as g } from "@radix-ui/react-primitive";
|
|
15
15
|
import { useFocusGuards as H } from "@radix-ui/react-focus-guards";
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
const P = "Dialog", [
|
|
20
|
-
const { __scopeDialog: n, children: r, open: s, defaultOpen: e, onOpenChange:
|
|
16
|
+
import { hideOthers as K } from "aria-hidden";
|
|
17
|
+
import { preventBodyScroll as V } from "@zag-js/remove-scroll";
|
|
18
|
+
import { useShadow as Y } from "./shadow/context.js";
|
|
19
|
+
const P = "Dialog", [v, Ct] = W(P), [z, l] = v(P), x = (t) => {
|
|
20
|
+
const { __scopeDialog: n, children: r, open: s, defaultOpen: e, onOpenChange: o, modal: a = !0 } = t, p = i.useRef(null), d = i.useRef(null), [m = !1, f] = $({
|
|
21
21
|
prop: s,
|
|
22
22
|
defaultProp: e ?? !1,
|
|
23
|
-
onChange:
|
|
23
|
+
onChange: o
|
|
24
24
|
});
|
|
25
25
|
return /* @__PURE__ */ c(
|
|
26
|
-
|
|
26
|
+
z,
|
|
27
27
|
{
|
|
28
28
|
scope: n,
|
|
29
29
|
triggerRef: p,
|
|
30
|
-
contentRef:
|
|
31
|
-
contentId:
|
|
32
|
-
titleId:
|
|
33
|
-
descriptionId:
|
|
34
|
-
open:
|
|
35
|
-
onOpenChange:
|
|
36
|
-
onOpenToggle: i.useCallback(() =>
|
|
30
|
+
contentRef: d,
|
|
31
|
+
contentId: R(),
|
|
32
|
+
titleId: R(),
|
|
33
|
+
descriptionId: R(),
|
|
34
|
+
open: m,
|
|
35
|
+
onOpenChange: f,
|
|
36
|
+
onOpenToggle: i.useCallback(() => f((E) => !E), [f]),
|
|
37
37
|
modal: a,
|
|
38
38
|
children: r
|
|
39
39
|
}
|
|
40
40
|
);
|
|
41
41
|
};
|
|
42
|
-
|
|
43
|
-
const
|
|
44
|
-
(
|
|
45
|
-
const { __scopeDialog: r, ...s } =
|
|
42
|
+
x.displayName = P;
|
|
43
|
+
const N = "DialogTrigger", J = i.forwardRef(
|
|
44
|
+
(t, n) => {
|
|
45
|
+
const { __scopeDialog: r, ...s } = t, e = l(N, r), o = _(n, e.triggerRef);
|
|
46
46
|
return /* @__PURE__ */ c(
|
|
47
|
-
|
|
47
|
+
g.button,
|
|
48
48
|
{
|
|
49
49
|
type: "button",
|
|
50
50
|
"aria-haspopup": "dialog",
|
|
51
51
|
"aria-expanded": e.open,
|
|
52
52
|
"aria-controls": e.contentId,
|
|
53
|
-
"data-state":
|
|
53
|
+
"data-state": h(e.open),
|
|
54
54
|
...s,
|
|
55
|
-
ref:
|
|
56
|
-
onClick: D(
|
|
55
|
+
ref: o,
|
|
56
|
+
onClick: D(t.onClick, e.onOpenToggle)
|
|
57
57
|
}
|
|
58
58
|
);
|
|
59
59
|
}
|
|
60
60
|
);
|
|
61
|
-
|
|
62
|
-
const
|
|
61
|
+
J.displayName = N;
|
|
62
|
+
const y = "DialogPortal", [Q, w] = v(y, {
|
|
63
63
|
forceMount: void 0
|
|
64
|
-
}),
|
|
65
|
-
const { __scopeDialog: n, forceMount: r, children: s, container: e } =
|
|
66
|
-
return /* @__PURE__ */ c(
|
|
64
|
+
}), T = (t) => {
|
|
65
|
+
const { __scopeDialog: n, forceMount: r, children: s, container: e } = t, o = l(y, n);
|
|
66
|
+
return /* @__PURE__ */ c(Q, { scope: n, forceMount: r, children: i.Children.map(s, (a) => /* @__PURE__ */ c(O, { present: r || o.open, children: /* @__PURE__ */ c(B, { asChild: !0, container: e, children: a }) })) });
|
|
67
67
|
};
|
|
68
|
-
|
|
69
|
-
const
|
|
70
|
-
(
|
|
71
|
-
const r =
|
|
72
|
-
return
|
|
68
|
+
T.displayName = y;
|
|
69
|
+
const C = "DialogOverlay", A = i.forwardRef(
|
|
70
|
+
(t, n) => {
|
|
71
|
+
const r = w(C, t.__scopeDialog), { forceMount: s = r.forceMount, ...e } = t, o = l(C, t.__scopeDialog);
|
|
72
|
+
return o.modal ? /* @__PURE__ */ c(O, { present: s || o.open, children: /* @__PURE__ */ c(U, { ...e, ref: n }) }) : null;
|
|
73
73
|
}
|
|
74
74
|
);
|
|
75
|
-
|
|
76
|
-
const
|
|
77
|
-
(
|
|
78
|
-
const { __scopeDialog: r, ...s } =
|
|
79
|
-
return (
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
)
|
|
99
|
-
}
|
|
100
|
-
)
|
|
75
|
+
A.displayName = C;
|
|
76
|
+
const U = i.forwardRef(
|
|
77
|
+
(t, n) => {
|
|
78
|
+
const { __scopeDialog: r, ...s } = t, e = l(C, r), o = Y();
|
|
79
|
+
return I(() => {
|
|
80
|
+
o && V(o?.rootElement?.ownerDocument);
|
|
81
|
+
}, [o]), // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
|
|
82
|
+
// ie. when `Overlay` and `Content` are siblings
|
|
83
|
+
// <RemoveScroll
|
|
84
|
+
// as={Slot}
|
|
85
|
+
// allowPinchZoom
|
|
86
|
+
// shards={[context.contentRef]}
|
|
87
|
+
// gapMode="padding"
|
|
88
|
+
// removeScrollBar={true}
|
|
89
|
+
// >
|
|
90
|
+
/* @__PURE__ */ c(
|
|
91
|
+
g.div,
|
|
92
|
+
{
|
|
93
|
+
"data-state": h(e.open),
|
|
94
|
+
...s,
|
|
95
|
+
ref: n,
|
|
96
|
+
style: { pointerEvents: "auto", ...s.style }
|
|
97
|
+
}
|
|
101
98
|
);
|
|
102
99
|
}
|
|
103
|
-
),
|
|
104
|
-
(
|
|
105
|
-
const r =
|
|
106
|
-
return /* @__PURE__ */ c(O, { present: s ||
|
|
100
|
+
), u = "DialogContent", M = i.forwardRef(
|
|
101
|
+
(t, n) => {
|
|
102
|
+
const r = w(u, t.__scopeDialog), { forceMount: s = r.forceMount, ...e } = t, o = l(u, t.__scopeDialog);
|
|
103
|
+
return /* @__PURE__ */ c(O, { present: s || o.open, children: o.modal ? /* @__PURE__ */ c(X, { ...e, ref: n }) : /* @__PURE__ */ c(Z, { ...e, ref: n }) });
|
|
107
104
|
}
|
|
108
105
|
);
|
|
109
|
-
|
|
110
|
-
const
|
|
111
|
-
(
|
|
112
|
-
const r = l(
|
|
106
|
+
M.displayName = u;
|
|
107
|
+
const X = i.forwardRef(
|
|
108
|
+
(t, n) => {
|
|
109
|
+
const r = l(u, t.__scopeDialog), s = i.useRef(null), e = _(n, r.contentRef, s);
|
|
113
110
|
return i.useEffect(() => {
|
|
114
|
-
const
|
|
115
|
-
if (
|
|
111
|
+
const o = s.current;
|
|
112
|
+
if (o) {
|
|
116
113
|
const a = document.querySelectorAll("[data-ikp-component]");
|
|
117
|
-
return
|
|
114
|
+
return K([o, ...Array.from(a)]);
|
|
118
115
|
}
|
|
119
116
|
}, []), /* @__PURE__ */ c(
|
|
120
|
-
|
|
117
|
+
b,
|
|
121
118
|
{
|
|
122
|
-
...
|
|
119
|
+
...t,
|
|
123
120
|
ref: e,
|
|
124
121
|
trapFocus: r.open,
|
|
125
122
|
disableOutsidePointerEvents: !0,
|
|
126
|
-
onPointerDownOutside: D(
|
|
127
|
-
const a =
|
|
128
|
-
(a.button === 2 || p) &&
|
|
123
|
+
onPointerDownOutside: D(t.onPointerDownOutside, (o) => {
|
|
124
|
+
const a = o.detail.originalEvent, p = a.button === 0 && a.ctrlKey === !0;
|
|
125
|
+
(a.button === 2 || p) && o.preventDefault(), o.target.closest("[data-ikp-component]") && o.preventDefault();
|
|
129
126
|
}),
|
|
130
127
|
onFocusOutside: D(
|
|
131
|
-
|
|
132
|
-
(
|
|
128
|
+
t.onFocusOutside,
|
|
129
|
+
(o) => o.preventDefault()
|
|
133
130
|
)
|
|
134
131
|
}
|
|
135
132
|
);
|
|
136
133
|
}
|
|
137
|
-
),
|
|
138
|
-
(
|
|
139
|
-
const r = l(
|
|
134
|
+
), Z = i.forwardRef(
|
|
135
|
+
(t, n) => {
|
|
136
|
+
const r = l(u, t.__scopeDialog), s = i.useRef(!1), e = i.useRef(!1);
|
|
140
137
|
return /* @__PURE__ */ c(
|
|
141
|
-
|
|
138
|
+
b,
|
|
142
139
|
{
|
|
143
|
-
...
|
|
140
|
+
...t,
|
|
144
141
|
ref: n,
|
|
145
142
|
trapFocus: !1,
|
|
146
143
|
disableOutsidePointerEvents: !1,
|
|
147
|
-
onInteractOutside: (
|
|
148
|
-
|
|
149
|
-
const a =
|
|
150
|
-
r.triggerRef.current?.contains(a) &&
|
|
144
|
+
onInteractOutside: (o) => {
|
|
145
|
+
t.onInteractOutside?.(o), o.defaultPrevented || (s.current = !0, o.detail.originalEvent.type === "pointerdown" && (e.current = !0));
|
|
146
|
+
const a = o.target;
|
|
147
|
+
r.triggerRef.current?.contains(a) && o.preventDefault(), o.detail.originalEvent.type === "focusin" && e.current && o.preventDefault();
|
|
151
148
|
}
|
|
152
149
|
}
|
|
153
150
|
);
|
|
154
151
|
}
|
|
155
|
-
),
|
|
156
|
-
(
|
|
157
|
-
const { __scopeDialog: r, trapFocus: s, onOpenAutoFocus: e, onCloseAutoFocus:
|
|
158
|
-
return H(),
|
|
152
|
+
), b = i.forwardRef(
|
|
153
|
+
(t, n) => {
|
|
154
|
+
const { __scopeDialog: r, trapFocus: s, onOpenAutoFocus: e, onCloseAutoFocus: o, ...a } = t, p = l(u, r), d = i.useRef(null), m = _(n, d);
|
|
155
|
+
return H(), I(() => {
|
|
159
156
|
if (s)
|
|
160
|
-
return q(
|
|
157
|
+
return q(d.current, {
|
|
161
158
|
preventScroll: !0,
|
|
162
159
|
onActivate: e,
|
|
163
|
-
onDeactivate:
|
|
164
|
-
initialFocus: !1
|
|
160
|
+
onDeactivate: o,
|
|
161
|
+
initialFocus: !1,
|
|
162
|
+
allowOutsideClick: (f) => !!f.target.closest("[data-ikp-component]")
|
|
165
163
|
});
|
|
166
164
|
}, []), /* @__PURE__ */ c(
|
|
167
165
|
j,
|
|
@@ -170,60 +168,60 @@ const U = i.forwardRef(
|
|
|
170
168
|
id: p.contentId,
|
|
171
169
|
"aria-describedby": p.descriptionId,
|
|
172
170
|
"aria-labelledby": p.titleId,
|
|
173
|
-
"data-state":
|
|
171
|
+
"data-state": h(p.open),
|
|
174
172
|
...a,
|
|
175
|
-
ref:
|
|
173
|
+
ref: m,
|
|
176
174
|
onDismiss: () => p.onOpenChange(!1)
|
|
177
175
|
}
|
|
178
176
|
);
|
|
179
177
|
}
|
|
180
|
-
),
|
|
181
|
-
(
|
|
182
|
-
const { __scopeDialog: r, ...s } =
|
|
183
|
-
return /* @__PURE__ */ c(
|
|
178
|
+
), k = "DialogTitle", F = i.forwardRef(
|
|
179
|
+
(t, n) => {
|
|
180
|
+
const { __scopeDialog: r, ...s } = t, e = l(k, r);
|
|
181
|
+
return /* @__PURE__ */ c(g.h2, { id: e.titleId, ...s, ref: n });
|
|
184
182
|
}
|
|
185
183
|
);
|
|
186
|
-
|
|
187
|
-
const
|
|
188
|
-
(
|
|
189
|
-
const { __scopeDialog: r, ...s } =
|
|
190
|
-
return /* @__PURE__ */ c(
|
|
184
|
+
F.displayName = k;
|
|
185
|
+
const S = "DialogDescription", tt = i.forwardRef(
|
|
186
|
+
(t, n) => {
|
|
187
|
+
const { __scopeDialog: r, ...s } = t, e = l(S, r);
|
|
188
|
+
return /* @__PURE__ */ c(g.p, { id: e.descriptionId, ...s, ref: n });
|
|
191
189
|
}
|
|
192
190
|
);
|
|
193
|
-
|
|
194
|
-
const
|
|
195
|
-
(
|
|
196
|
-
const { __scopeDialog: r, ...s } =
|
|
191
|
+
tt.displayName = S;
|
|
192
|
+
const L = "DialogClose", G = i.forwardRef(
|
|
193
|
+
(t, n) => {
|
|
194
|
+
const { __scopeDialog: r, ...s } = t, e = l(L, r);
|
|
197
195
|
return /* @__PURE__ */ c(
|
|
198
|
-
|
|
196
|
+
g.button,
|
|
199
197
|
{
|
|
200
198
|
type: "button",
|
|
201
199
|
...s,
|
|
202
200
|
ref: n,
|
|
203
|
-
onClick: D(
|
|
201
|
+
onClick: D(t.onClick, () => e.onOpenChange(!1))
|
|
204
202
|
}
|
|
205
203
|
);
|
|
206
204
|
}
|
|
207
205
|
);
|
|
208
|
-
|
|
209
|
-
function
|
|
210
|
-
return
|
|
206
|
+
G.displayName = L;
|
|
207
|
+
function h(t) {
|
|
208
|
+
return t ? "open" : "closed";
|
|
211
209
|
}
|
|
212
|
-
const
|
|
210
|
+
const Rt = x, _t = T, Ot = A, Pt = M, yt = F, ht = G;
|
|
213
211
|
export {
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
212
|
+
ht as Close,
|
|
213
|
+
Pt as Content,
|
|
214
|
+
x as Dialog,
|
|
215
|
+
G as DialogClose,
|
|
216
|
+
M as DialogContent,
|
|
217
|
+
tt as DialogDescription,
|
|
218
|
+
A as DialogOverlay,
|
|
219
|
+
T as DialogPortal,
|
|
220
|
+
F as DialogTitle,
|
|
221
|
+
J as DialogTrigger,
|
|
222
|
+
Ot as Overlay,
|
|
223
|
+
_t as Portal,
|
|
224
|
+
Rt as Root,
|
|
225
|
+
yt as Title,
|
|
226
|
+
Ct as createDialogScope
|
|
229
227
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const X=require("@ai-sdk/react"),Y=require("ai"),t=require("react"),Z=require("../../providers/config-provider.cjs"),ee=require("../../hooks/use-media-query.cjs"),te=require("../../utils/generate-uid.cjs"),se=require("../../providers/base-events-provider.cjs"),ne=require("../../providers/chat-form-provider.cjs"),re=require("../../providers/widget-provider.cjs"),ae=require("@radix-ui/react-use-controllable-state"),oe=require("../../hooks/use-streaming-events.cjs"),q=`Hmm..
|
|
2
2
|
|
|
3
|
-
It seems I might be having some issues right now. Please clear the chat and try again.`,ie=()=>{const{baseSettings:f,aiChatSettings:o}=Z.useInkeepConfig(),[n="",v]=ae.useControllableState({prop:o.conversationId,defaultProp:o.conversationId??""}),{logEvent:i}=se.useBaseEvents(),{setConversationId:F,
|
|
3
|
+
It seems I might be having some issues right now. Please clear the chat and try again.`,ie=()=>{const{baseSettings:f,aiChatSettings:o}=Z.useInkeepConfig(),[n="",v]=ae.useControllableState({prop:o.conversationId,defaultProp:o.conversationId??""}),{logEvent:i}=se.useBaseEvents(),{setConversationId:F,emitToParent:R}=oe.useStreamingEvents(),[a,u]=t.useState(""),P=e=>u(e.target.value),{filters:E}=f,{onInputMessageChange:k,filters:S,agentUrl:A,context:D,headers:x,apiKey:C}=o,N=e=>{switch(e.code){case 400:return e.message;case 403:return`There seems to be a configuration error. Please contact ${f.organizationDisplayName??"Administrator"}`;default:return q}},[T,U]=t.useState({}),[B,l]=t.useState([]),[O,I]=t.useState(null),{messages:g,sendMessage:K,status:b,setMessages:y,stop:L,error:d}=X.useChat({transport:new Y.DefaultChatTransport({api:A,headers:{...C?{Authorization:`Bearer ${C}`}:{},...x},body:{requestContext:D}}),onData(e){R(e.type,e.data)},async onFinish(){await i({eventName:"assistant_message_received",properties:{conversationId:n}}),i({eventName:"assistant_answer_displayed",properties:{conversationId:n}})},onError(e){console.log("onError",e.message),y(c=>{const r=[...c],s=r[r.length-1];return s&&(s.parts=[{type:"text",text:N(e)}]),r})}}),w=b==="submitted",W=b==="streaming",$=g.length===0,m=!a.trim()||w,z=ee.useMediaQuery("(max-width: 768px)"),[G,p]=t.useState(null);t.useEffect(()=>{d&&p(d)},[d]);const H=()=>p(null),M=t.useRef(null);t.useEffect(()=>{k?.(a)},[a]);const Q=e=>{e.key==="Enter"&&!e.shiftKey&&!m&&!e.nativeEvent.isComposing&&(e.preventDefault(),h())},h=async(e=a)=>{if(m&&(!e||e.trim().length===0))return;l([]),u(""),await i({eventName:"user_message_submitted",properties:{conversationId:n}});const c=E||S?JSON.stringify({...E,...S}):void 0,r={};c&&(r["inkeep-filters"]=c);let s=n;s||(s=`conv_${te.generateUid(16)}`,v(s)),F(s),K({text:e},{headers:r,body:{conversationId:s}})},j=()=>{L()},_=()=>{H(),y([]),v(""),U({}),l([]),I(null),i({eventName:"chat_clear_button_clicked",properties:{conversationId:n}})},{openForm:J}=ne.useChatForm(),V=re.useWidget();return t.useImperativeHandle(o.chatFunctionsRef,()=>({submitMessage:h,updateInputMessage(e){u(e)},clearChat:_,openForm:e=>{V?.setView("chat"),J(e,void 0)},focusInput:()=>{M.current?.focus()}})),{messages:g,isLoading:w,isStreaming:W,error:G,setError:p,isSubmitDisabled:m,input:a,handleInputChange:P,handleInputKeyDown:Q,handleSubmit:h,stop:j,clear:_,messageButtons:T,isEmpty:g.length===0,inputRef:M,isMobile:z,messageAttachments:B,setMessageAttachments:l,selectedWorkflow:O,setSelectedWorkflow:I,isNewChat:$,conversationId:n}};exports.DEFAULT_ERROR_MESSAGE=q;exports.useInkeepChat=ie;
|
|
@@ -12,21 +12,21 @@ import { useControllableState as ie } from "@radix-ui/react-use-controllable-sta
|
|
|
12
12
|
import { useStreamingEvents as ce } from "../../hooks/use-streaming-events.js";
|
|
13
13
|
const me = `Hmm..
|
|
14
14
|
|
|
15
|
-
It seems I might be having some issues right now. Please clear the chat and try again.`,
|
|
15
|
+
It seems I might be having some issues right now. Please clear the chat and try again.`, ye = () => {
|
|
16
16
|
const { baseSettings: f, aiChatSettings: a } = te(), [s = "", v] = ie({
|
|
17
17
|
prop: a.conversationId,
|
|
18
18
|
defaultProp: a.conversationId ?? ""
|
|
19
|
-
}), { logEvent: i } = oe(), { setConversationId: F,
|
|
19
|
+
}), { logEvent: i } = oe(), { setConversationId: F, emitToParent: k } = ce(), [o, m] = r(""), D = (e) => m(e.target.value), {
|
|
20
20
|
/* shouldBypassCaptcha, */
|
|
21
21
|
filters: I
|
|
22
22
|
} = f, {
|
|
23
|
-
onInputMessageChange:
|
|
23
|
+
onInputMessageChange: N,
|
|
24
24
|
filters: C,
|
|
25
|
-
agentUrl:
|
|
25
|
+
agentUrl: A,
|
|
26
26
|
context: R,
|
|
27
27
|
headers: B,
|
|
28
28
|
apiKey: E
|
|
29
|
-
} = a,
|
|
29
|
+
} = a, P = (e) => {
|
|
30
30
|
switch (e.code) {
|
|
31
31
|
case 400:
|
|
32
32
|
return e.message;
|
|
@@ -35,16 +35,16 @@ It seems I might be having some issues right now. Please clear the chat and try
|
|
|
35
35
|
default:
|
|
36
36
|
return me;
|
|
37
37
|
}
|
|
38
|
-
}, [
|
|
38
|
+
}, [T, K] = r({}), [U, u] = r([]), [W, y] = r(null), {
|
|
39
39
|
messages: l,
|
|
40
40
|
sendMessage: $,
|
|
41
41
|
status: b,
|
|
42
|
-
setMessages:
|
|
42
|
+
setMessages: w,
|
|
43
43
|
stop: z,
|
|
44
44
|
error: p
|
|
45
45
|
} = X({
|
|
46
46
|
transport: new Y({
|
|
47
|
-
api:
|
|
47
|
+
api: A,
|
|
48
48
|
headers: {
|
|
49
49
|
...E ? { Authorization: `Bearer ${E}` } : {},
|
|
50
50
|
...B
|
|
@@ -53,6 +53,9 @@ It seems I might be having some issues right now. Please clear the chat and try
|
|
|
53
53
|
requestContext: R
|
|
54
54
|
}
|
|
55
55
|
}),
|
|
56
|
+
onData(e) {
|
|
57
|
+
k(e.type, e.data);
|
|
58
|
+
},
|
|
56
59
|
async onFinish() {
|
|
57
60
|
await i({
|
|
58
61
|
eventName: "assistant_message_received",
|
|
@@ -67,18 +70,18 @@ It seems I might be having some issues right now. Please clear the chat and try
|
|
|
67
70
|
});
|
|
68
71
|
},
|
|
69
72
|
onError(e) {
|
|
70
|
-
console.log("onError", e.message),
|
|
73
|
+
console.log("onError", e.message), w((c) => {
|
|
71
74
|
const n = [...c], t = n[n.length - 1];
|
|
72
|
-
return t && (t.parts = [{ type: "text", text:
|
|
75
|
+
return t && (t.parts = [{ type: "text", text: P(e) }]), n;
|
|
73
76
|
});
|
|
74
77
|
}
|
|
75
|
-
}),
|
|
78
|
+
}), S = b === "submitted", H = b === "streaming", L = l.length === 0, g = !o.trim() || S, O = se("(max-width: 768px)"), [q, d] = r(null);
|
|
76
79
|
x(() => {
|
|
77
80
|
p && d(p);
|
|
78
81
|
}, [p]);
|
|
79
82
|
const G = () => d(null), M = Z(null);
|
|
80
83
|
x(() => {
|
|
81
|
-
|
|
84
|
+
N?.(o);
|
|
82
85
|
}, [o]);
|
|
83
86
|
const J = (e) => {
|
|
84
87
|
e.key === "Enter" && !e.shiftKey && !g && !e.nativeEvent.isComposing && (e.preventDefault(), h());
|
|
@@ -112,7 +115,7 @@ It seems I might be having some issues right now. Please clear the chat and try
|
|
|
112
115
|
}, Q = () => {
|
|
113
116
|
z();
|
|
114
117
|
}, _ = () => {
|
|
115
|
-
G(),
|
|
118
|
+
G(), w([]), v(""), K({}), u([]), y(null), i({
|
|
116
119
|
eventName: "chat_clear_button_clicked",
|
|
117
120
|
properties: {
|
|
118
121
|
conversationId: s
|
|
@@ -133,18 +136,18 @@ It seems I might be having some issues right now. Please clear the chat and try
|
|
|
133
136
|
}
|
|
134
137
|
})), {
|
|
135
138
|
messages: l,
|
|
136
|
-
isLoading:
|
|
139
|
+
isLoading: S,
|
|
137
140
|
isStreaming: H,
|
|
138
141
|
error: q,
|
|
139
142
|
setError: d,
|
|
140
143
|
isSubmitDisabled: g,
|
|
141
144
|
input: o,
|
|
142
|
-
handleInputChange:
|
|
145
|
+
handleInputChange: D,
|
|
143
146
|
handleInputKeyDown: J,
|
|
144
147
|
handleSubmit: h,
|
|
145
148
|
stop: Q,
|
|
146
149
|
clear: _,
|
|
147
|
-
messageButtons:
|
|
150
|
+
messageButtons: T,
|
|
148
151
|
isEmpty: l.length === 0,
|
|
149
152
|
inputRef: M,
|
|
150
153
|
isMobile: O,
|
|
@@ -152,12 +155,12 @@ It seems I might be having some issues right now. Please clear the chat and try
|
|
|
152
155
|
messageAttachments: U,
|
|
153
156
|
setMessageAttachments: u,
|
|
154
157
|
selectedWorkflow: W,
|
|
155
|
-
setSelectedWorkflow:
|
|
158
|
+
setSelectedWorkflow: y,
|
|
156
159
|
isNewChat: L,
|
|
157
160
|
conversationId: s
|
|
158
161
|
};
|
|
159
162
|
};
|
|
160
163
|
export {
|
|
161
164
|
me as DEFAULT_ERROR_MESSAGE,
|
|
162
|
-
|
|
165
|
+
ye as useInkeepChat
|
|
163
166
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react"),v=require("./use-inkeep-chat.cjs"),E=require("../../../types/message.cjs");function L(u,p,g){const[l,R]=n.useState([]),[h,A]=n.useState(new Map),[d,k]=n.useState(Date.now()),[D,y]=n.useState(!1),S=n.useRef(0),x=n.useRef(0),w=n.useRef([]),f=n.useRef(h);f.current=h;const C=n.useCallback(()=>{const t=[];let e="",o=[],c=!1;u.length>S.current&&(k(Date.now()),S.current=u.length),x.current=0;const m=new Map,i=(s=!1)=>{if(o.length>0){const r=`group-${x.current++}`,a=f.current.get(r);a?m.set(r,{...a,isCompleted:s}):m.set(r,{isCompleted:s}),t.push({type:"summary-group",summaries:[...o],groupKey:r}),o=[]}};for(const s of u)if(s.type==="text")i(!0),e+=s.text||"";else if(s.type==="data-summary")e.trim()&&(t.push({type:"text",text:e}),e=""),o.push(s.data);else if(s.type==="data-operation"){e.trim()&&(t.push({type:"text",text:e}),e="");const r=s.data;if(r?.type)switch(r.type){case"agent_initializing":break;case"completion":i(!0);break;case"error":{i(!0);const a=r.message||"Unknown error";console.warn("Data operation error:",a),g(new Error(a)),c||(t.push({type:"text",text:v.DEFAULT_ERROR_MESSAGE}),c=!0);break}default:{const{type:a,label:b}=r;o.push({type:a,label:b});break}}}else if(s.type==="data-artifact")if(s.data?.type?.toLowerCase()===E.CITATION_ARTIFACT_TYPE){const r=s.data,a=r.artifactSummary||{title:r.name};e+=` ^${a?.title||r.name}^`}else e.trim()&&(t.push({type:"text",text:e}),e=""),t.push(s);else s.type==="data-component"&&(e.trim()&&(t.push({type:"text",text:e}),e=""),i(!0),t.push(s));return i(!p),e.trim()&&t.push({type:"text",text:e}),{processed:t,newTimings:m}},[u,p,g]);n.useEffect(()=>{if(w.current===u)return;w.current=u;const{processed:t,newTimings:e}=C();R(t),(e.size!==f.current.size||Array.from(e.entries()).some(([c,m])=>{const i=f.current.get(c);return!i||i.isCompleted!==m.isCompleted}))&&A(e)},[C,u]);const T=n.useCallback(()=>{const t=Date.now()-d,e=Array.from(f.current.values()).some(c=>!c.isCompleted),o=t>1e3&&!e;y(o)},[d]);n.useEffect(()=>{if(!p){y(!1);return}if(!(l.length>0)){y(!1);return}const e=setInterval(T,200);return()=>clearInterval(e)},[p,T,l.length]);const P=n.useMemo(()=>!(l.length>0),[l.length]);return{processedParts:l,summaryTimings:h,shouldShowInitialLoading:P,shouldShowStreamDelayLoading:D}}exports.useStreamProcessor=L;
|
|
@@ -1,135 +1,103 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { useState as p, useRef as
|
|
3
|
-
import { DEFAULT_ERROR_MESSAGE as
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}), n.push({
|
|
2
|
+
import { useState as p, useRef as h, useCallback as D, useEffect as R, useMemo as I } from "react";
|
|
3
|
+
import { DEFAULT_ERROR_MESSAGE as M } from "./use-inkeep-chat.js";
|
|
4
|
+
import { CITATION_ARTIFACT_TYPE as _ } from "../../../types/message.js";
|
|
5
|
+
function O(i, f, d) {
|
|
6
|
+
const [u, k] = p([]), [y, v] = p(/* @__PURE__ */ new Map()), [x, L] = p(Date.now()), [P, g] = p(!1), w = h(0), C = h(0), S = h([]), l = h(y);
|
|
7
|
+
l.current = y;
|
|
8
|
+
const T = D(() => {
|
|
9
|
+
const e = [];
|
|
10
|
+
let t = "", a = [], c = !1;
|
|
11
|
+
i.length > w.current && (L(Date.now()), w.current = i.length), C.current = 0;
|
|
12
|
+
const m = /* @__PURE__ */ new Map(), o = (r = !1) => {
|
|
13
|
+
if (a.length > 0) {
|
|
14
|
+
const s = `group-${C.current++}`, n = l.current.get(s);
|
|
15
|
+
n ? m.set(s, {
|
|
16
|
+
...n,
|
|
17
|
+
isCompleted: r
|
|
18
|
+
}) : m.set(s, {
|
|
19
|
+
isCompleted: r
|
|
20
|
+
}), e.push({
|
|
22
21
|
type: "summary-group",
|
|
23
|
-
summaries: [...
|
|
24
|
-
groupKey:
|
|
25
|
-
}),
|
|
22
|
+
summaries: [...a],
|
|
23
|
+
groupKey: s
|
|
24
|
+
}), a = [];
|
|
26
25
|
}
|
|
27
26
|
};
|
|
28
|
-
for (const
|
|
29
|
-
if (
|
|
30
|
-
o(!0),
|
|
31
|
-
else if (
|
|
32
|
-
t.trim() && (
|
|
33
|
-
else if (
|
|
34
|
-
t.trim() && (
|
|
35
|
-
const
|
|
36
|
-
if (
|
|
37
|
-
switch (
|
|
38
|
-
case "completion":
|
|
39
|
-
C(
|
|
40
|
-
"unknown",
|
|
41
|
-
// No agent ID available in current structure
|
|
42
|
-
1
|
|
43
|
-
// No iteration available in current structure
|
|
44
|
-
), o(!0);
|
|
45
|
-
break;
|
|
27
|
+
for (const r of i)
|
|
28
|
+
if (r.type === "text")
|
|
29
|
+
o(!0), t += r.text || "";
|
|
30
|
+
else if (r.type === "data-summary")
|
|
31
|
+
t.trim() && (e.push({ type: "text", text: t }), t = ""), a.push(r.data);
|
|
32
|
+
else if (r.type === "data-operation") {
|
|
33
|
+
t.trim() && (e.push({ type: "text", text: t }), t = "");
|
|
34
|
+
const s = r.data;
|
|
35
|
+
if (s?.type)
|
|
36
|
+
switch (s.type) {
|
|
46
37
|
case "agent_initializing":
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
"unknown"
|
|
51
|
-
// No graph ID available in current structure
|
|
52
|
-
);
|
|
38
|
+
break;
|
|
39
|
+
case "completion":
|
|
40
|
+
o(!0);
|
|
53
41
|
break;
|
|
54
42
|
case "error": {
|
|
55
43
|
o(!0);
|
|
56
|
-
const
|
|
57
|
-
console.warn("Data operation error:",
|
|
44
|
+
const n = s.message || "Unknown error";
|
|
45
|
+
console.warn("Data operation error:", n), d(new Error(n)), c || (e.push({ type: "text", text: M }), c = !0);
|
|
58
46
|
break;
|
|
59
47
|
}
|
|
60
48
|
default: {
|
|
61
|
-
const { type:
|
|
62
|
-
|
|
49
|
+
const { type: n, label: b } = s;
|
|
50
|
+
a.push({ type: n, label: b });
|
|
63
51
|
break;
|
|
64
52
|
}
|
|
65
53
|
}
|
|
66
|
-
} else if (
|
|
67
|
-
if (
|
|
68
|
-
const
|
|
69
|
-
title:
|
|
54
|
+
} else if (r.type === "data-artifact")
|
|
55
|
+
if (r.data?.type?.toLowerCase() === _) {
|
|
56
|
+
const s = r.data, n = s.artifactSummary || {
|
|
57
|
+
title: s.name
|
|
70
58
|
};
|
|
71
|
-
t += ` ^${
|
|
59
|
+
t += ` ^${n?.title || s.name}^`;
|
|
72
60
|
} else
|
|
73
|
-
t.trim() && (
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
e.data.artifactType || "unknown",
|
|
79
|
-
e.data.artifactSummary || {},
|
|
80
|
-
// Use artifactSummary as summaryData
|
|
81
|
-
{},
|
|
82
|
-
// fullData not available in current structure
|
|
83
|
-
{ name: e.data.name, description: e.data.description }
|
|
84
|
-
// Use available fields as metadata
|
|
85
|
-
);
|
|
86
|
-
else e.type === "data-component" && (t.trim() && (n.push({ type: "text", text: t }), t = ""), o(!0), n.push(e));
|
|
87
|
-
return o(!u), t.trim() && n.push({ type: "text", text: t }), { processed: n, newTimings: l };
|
|
88
|
-
}, [
|
|
89
|
-
i,
|
|
90
|
-
u,
|
|
91
|
-
T,
|
|
92
|
-
C,
|
|
93
|
-
A,
|
|
94
|
-
D,
|
|
95
|
-
g
|
|
96
|
-
]);
|
|
97
|
-
E(() => {
|
|
61
|
+
t.trim() && (e.push({ type: "text", text: t }), t = ""), e.push(r);
|
|
62
|
+
else r.type === "data-component" && (t.trim() && (e.push({ type: "text", text: t }), t = ""), o(!0), e.push(r));
|
|
63
|
+
return o(!f), t.trim() && e.push({ type: "text", text: t }), { processed: e, newTimings: m };
|
|
64
|
+
}, [i, f, d]);
|
|
65
|
+
R(() => {
|
|
98
66
|
if (S.current === i)
|
|
99
67
|
return;
|
|
100
68
|
S.current = i;
|
|
101
|
-
const { processed:
|
|
102
|
-
|
|
103
|
-
const o =
|
|
104
|
-
return !o || o.isCompleted !==
|
|
105
|
-
})) &&
|
|
106
|
-
}, [
|
|
107
|
-
const
|
|
108
|
-
const
|
|
69
|
+
const { processed: e, newTimings: t } = T();
|
|
70
|
+
k(e), (t.size !== l.current.size || Array.from(t.entries()).some(([c, m]) => {
|
|
71
|
+
const o = l.current.get(c);
|
|
72
|
+
return !o || o.isCompleted !== m.isCompleted;
|
|
73
|
+
})) && v(t);
|
|
74
|
+
}, [T, i]);
|
|
75
|
+
const A = D(() => {
|
|
76
|
+
const e = Date.now() - x, t = Array.from(l.current.values()).some(
|
|
109
77
|
(c) => !c.isCompleted
|
|
110
|
-
),
|
|
111
|
-
|
|
112
|
-
}, [
|
|
113
|
-
|
|
114
|
-
if (!
|
|
115
|
-
|
|
78
|
+
), a = e > 1e3 && !t;
|
|
79
|
+
g(a);
|
|
80
|
+
}, [x]);
|
|
81
|
+
R(() => {
|
|
82
|
+
if (!f) {
|
|
83
|
+
g(!1);
|
|
116
84
|
return;
|
|
117
85
|
}
|
|
118
|
-
if (!(
|
|
119
|
-
|
|
86
|
+
if (!(u.length > 0)) {
|
|
87
|
+
g(!1);
|
|
120
88
|
return;
|
|
121
89
|
}
|
|
122
|
-
const t = setInterval(
|
|
90
|
+
const t = setInterval(A, 200);
|
|
123
91
|
return () => clearInterval(t);
|
|
124
|
-
}, [
|
|
125
|
-
const
|
|
92
|
+
}, [f, A, u.length]);
|
|
93
|
+
const E = I(() => !(u.length > 0), [u.length]);
|
|
126
94
|
return {
|
|
127
|
-
processedParts:
|
|
128
|
-
summaryTimings:
|
|
129
|
-
shouldShowInitialLoading:
|
|
130
|
-
shouldShowStreamDelayLoading:
|
|
95
|
+
processedParts: u,
|
|
96
|
+
summaryTimings: y,
|
|
97
|
+
shouldShowInitialLoading: E,
|
|
98
|
+
shouldShowStreamDelayLoading: P
|
|
131
99
|
};
|
|
132
100
|
}
|
|
133
101
|
export {
|
|
134
|
-
|
|
102
|
+
O as useStreamProcessor
|
|
135
103
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react"),u=require("../atoms/shadow/context.cjs");function i(){const e=u.useShadow()?.shadowHost,s=n.useRef(""),o=n.useCallback(t=>{s.current=t},[]),r=n.useCallback((t,a)=>{if(!e){console.warn("useStreamingEvents: No host element available for parent event emission");return}const c=new CustomEvent(`ikp-${t}`,{detail:{...a,conversationId:s.current,timestamp:Date.now()},bubbles:!0,composed:!0});e.dispatchEvent(c)},[e]);return{setConversationId:o,emitToParent:r}}exports.useStreamingEvents=i;
|
|
@@ -1,140 +1,33 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { useShadow as
|
|
4
|
-
function
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
import { useRef as c, useCallback as o } from "react";
|
|
3
|
+
import { useShadow as u } from "../atoms/shadow/context.js";
|
|
4
|
+
function v() {
|
|
5
|
+
const e = u()?.shadowHost, n = c(""), s = o((t) => {
|
|
6
|
+
n.current = t;
|
|
7
|
+
}, []), r = o(
|
|
8
|
+
(t, a) => {
|
|
9
|
+
if (!e) {
|
|
10
|
+
console.warn("useStreamingEvents: No host element available for parent event emission");
|
|
9
11
|
return;
|
|
10
12
|
}
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
const i = new CustomEvent(`ikp-${t}`, {
|
|
14
|
+
detail: {
|
|
15
|
+
...a,
|
|
16
|
+
conversationId: n.current,
|
|
17
|
+
timestamp: Date.now()
|
|
18
|
+
},
|
|
17
19
|
bubbles: !0,
|
|
18
|
-
// Allow event to bubble up
|
|
19
20
|
composed: !0
|
|
20
|
-
// Allow event to escape Shadow DOM boundary
|
|
21
|
-
});
|
|
22
|
-
r.dispatchEvent(a);
|
|
23
|
-
},
|
|
24
|
-
[r]
|
|
25
|
-
), m = o((t) => {
|
|
26
|
-
c.current = t;
|
|
27
|
-
}, []), l = o(
|
|
28
|
-
(t) => {
|
|
29
|
-
e({
|
|
30
|
-
kind: "text:delta",
|
|
31
|
-
data: { text: t }
|
|
32
|
-
});
|
|
33
|
-
},
|
|
34
|
-
[e]
|
|
35
|
-
), u = o(
|
|
36
|
-
(t, n, a) => {
|
|
37
|
-
e({
|
|
38
|
-
kind: "stream:error",
|
|
39
|
-
data: {
|
|
40
|
-
message: t,
|
|
41
|
-
agent: n,
|
|
42
|
-
severity: "error",
|
|
43
|
-
code: a
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
},
|
|
47
|
-
[e]
|
|
48
|
-
), g = o(
|
|
49
|
-
(t, n) => {
|
|
50
|
-
e({
|
|
51
|
-
kind: "agent:reasoning",
|
|
52
|
-
data: { agentId: t, parts: n }
|
|
53
|
-
});
|
|
54
|
-
},
|
|
55
|
-
[e]
|
|
56
|
-
), v = o(
|
|
57
|
-
(t, n, a) => {
|
|
58
|
-
e({
|
|
59
|
-
kind: "agent:generate",
|
|
60
|
-
data: { agentId: t, parts: n, generationType: a }
|
|
61
|
-
});
|
|
62
|
-
},
|
|
63
|
-
[e]
|
|
64
|
-
), f = o(
|
|
65
|
-
(t, n, a, i, s, d) => {
|
|
66
|
-
e({
|
|
67
|
-
kind: "tool:execution",
|
|
68
|
-
data: { agentId: t, toolName: n, args: a, result: i, toolId: s, duration: d }
|
|
69
|
-
});
|
|
70
|
-
},
|
|
71
|
-
[e]
|
|
72
|
-
), k = o(
|
|
73
|
-
(t, n, a, i) => {
|
|
74
|
-
e({
|
|
75
|
-
kind: "agent:transfer",
|
|
76
|
-
data: { fromAgent: t, targetAgent: n, reason: a, context: i }
|
|
77
|
-
});
|
|
78
|
-
},
|
|
79
|
-
[e]
|
|
80
|
-
), E = o(
|
|
81
|
-
(t, n, a, i, s) => {
|
|
82
|
-
e({
|
|
83
|
-
kind: "delegation:sent",
|
|
84
|
-
data: { delegationId: t, fromAgent: n, targetAgent: a, taskDescription: i, context: s }
|
|
85
|
-
});
|
|
86
|
-
},
|
|
87
|
-
[e]
|
|
88
|
-
), p = o(
|
|
89
|
-
(t, n, a, i) => {
|
|
90
|
-
e({
|
|
91
|
-
kind: "delegation:returned",
|
|
92
|
-
data: { delegationId: t, fromAgent: n, targetAgent: a, result: i }
|
|
93
|
-
});
|
|
94
|
-
},
|
|
95
|
-
[e]
|
|
96
|
-
), h = o(
|
|
97
|
-
(t, n, a, i, s, d, b) => {
|
|
98
|
-
e({
|
|
99
|
-
kind: "artifact:saved",
|
|
100
|
-
data: { artifactId: t, taskId: n, toolCallId: a, artifactType: i, summaryData: s, fullData: d, metadata: b }
|
|
101
|
-
});
|
|
102
|
-
},
|
|
103
|
-
[e]
|
|
104
|
-
), w = o(
|
|
105
|
-
(t, n) => {
|
|
106
|
-
e({
|
|
107
|
-
kind: "completion",
|
|
108
|
-
data: { agent: t, iteration: n }
|
|
109
|
-
});
|
|
110
|
-
},
|
|
111
|
-
[e]
|
|
112
|
-
), S = o(
|
|
113
|
-
(t, n) => {
|
|
114
|
-
e({
|
|
115
|
-
kind: "agent:initializing",
|
|
116
|
-
data: { sessionId: t, graphId: n }
|
|
117
21
|
});
|
|
22
|
+
e.dispatchEvent(i);
|
|
118
23
|
},
|
|
119
24
|
[e]
|
|
120
25
|
);
|
|
121
26
|
return {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
// Convenience methods
|
|
125
|
-
emitTextDelta: l,
|
|
126
|
-
emitStreamError: u,
|
|
127
|
-
emitAgentReasoning: g,
|
|
128
|
-
emitAgentGenerate: v,
|
|
129
|
-
emitToolExecution: f,
|
|
130
|
-
emitAgentTransfer: k,
|
|
131
|
-
emitDelegationSent: E,
|
|
132
|
-
emitDelegationReturned: p,
|
|
133
|
-
emitArtifactSaved: h,
|
|
134
|
-
emitCompletion: w,
|
|
135
|
-
emitAgentInitializing: S
|
|
27
|
+
setConversationId: s,
|
|
28
|
+
emitToParent: r
|
|
136
29
|
};
|
|
137
30
|
}
|
|
138
31
|
export {
|
|
139
|
-
|
|
32
|
+
v as useStreamingEvents
|
|
140
33
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("react/jsx-runtime"),t=require("react"),l=require("./config-provider.cjs"),a=t.createContext(void 0),p=({children:e})=>{const{baseSettings:s,componentType:n}=l.useInkeepConfig(),{tags:o,analyticsProperties:r}=s,i=t.useMemo(()=>({widgetLibraryVersion:"0.14.
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("react/jsx-runtime"),t=require("react"),l=require("./config-provider.cjs"),a=t.createContext(void 0),p=({children:e})=>{const{baseSettings:s,componentType:n}=l.useInkeepConfig(),{tags:o,analyticsProperties:r}=s,i=t.useMemo(()=>({widgetLibraryVersion:"0.14.13",componentType:n,tags:o}),[n,o]),u={logEvent:t.useCallback(async c=>{const v={...i,...c.properties,...r},d={eventName:c.eventName,properties:v};return s.onEvent?.(d)},[s,i,r])};return E.jsx(a.Provider,{value:u,children:e})},g=()=>{const e=t.useContext(a);if(!e)throw new Error("useBaseEvents must be used within a BaseEventsProvider");return e};exports.BaseEventsProvider=p;exports.useBaseEvents=g;
|
|
@@ -5,7 +5,7 @@ import { useInkeepConfig as g } from "./config-provider.js";
|
|
|
5
5
|
const a = d(void 0), P = ({ children: e }) => {
|
|
6
6
|
const { baseSettings: t, componentType: o } = g(), { tags: s, analyticsProperties: n } = t, r = u(
|
|
7
7
|
() => ({
|
|
8
|
-
widgetLibraryVersion: "0.14.
|
|
8
|
+
widgetLibraryVersion: "0.14.13",
|
|
9
9
|
componentType: o,
|
|
10
10
|
tags: s
|
|
11
11
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("react"),
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("react"),t=require("lucide-react"),x=a=>{const{type:s,label:r}=a;return r||s.replace(/_/g," ").replace(/\b\w/g,l=>l.toUpperCase())},d={agent_generate:e.jsx(t.RefreshCw,{className:"w-3 h-3 text-gray-500 dark:text-white-alpha-500"}),agent_reasoning:e.jsx(t.Brain,{className:"w-3 h-3 text-gray-500 dark:text-white-alpha-500"}),tool_call:e.jsx(t.Hammer,{className:"w-3 h-3 text-gray-500 dark:text-white-alpha-500"}),tool_result:e.jsx(t.Hammer,{className:"w-3 h-3 text-gray-500 dark:text-white-alpha-500"}),transfer:e.jsx(t.ArrowRight,{className:"w-3 h-3 text-gray-500 dark:text-white-alpha-500"}),delegation_sent:e.jsx(t.Forward,{className:"w-3 h-3 text-gray-500 dark:text-white-alpha-500"}),delegation_returned:e.jsx(t.CheckCheck,{className:"w-3 h-3 text-gray-500 dark:text-white-alpha-500"}),artifact_saved:e.jsx(t.Download,{className:"w-3 h-3 text-gray-500 dark:text-white-alpha-500"}),error:e.jsx(t.TriangleAlert,{className:"w-3 h-3 text-gray-500 dark:text-white-alpha-500"}),agent_initializing:e.jsx(t.CircleDot,{className:"w-3 h-3 animate-spin"}),completion:e.jsx(t.CheckCheck,{className:"w-3 h-3 text-gray-500 dark:text-white-alpha-500"}),default:e.jsx(t.Dot,{className:"w-3 h-3 text-gray-500 dark:text-white-alpha-500"})},h={retrieve:e.jsx(t.Search,{className:"w-3 h-3 text-gray-500 dark:text-white-alpha-500"}),action:e.jsx(t.CheckCheck,{className:"w-3 h-3 text-gray-500 dark:text-white-alpha-500"}),default:e.jsx(t.Dot,{className:"w-3 h-3 text-gray-500 dark:text-white-alpha-500"}),...d},p=n.memo(({summary:a,index:s,showConnector:r})=>{const l=n.useMemo(()=>a.details?JSON.stringify(a.details,null,2):null,[a.details]),o=n.useMemo(()=>x(a),[a]),i=n.useMemo(()=>h[a.type]||h.default,[a.type]);return e.jsxs("div",{className:"flex items-start gap-2 text-xs relative",children:[r&&e.jsx("div",{className:"absolute left-1.5 top-4 bottom-0 w-px bg-gray-200 dark:bg-white-alpha-200 -mb-3"}),e.jsx("div",{className:"flex items-center justify-center w-3 h-3 relative z-10 mt-0.5",children:i}),e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:" text-gray-700 dark:text-white-alpha-600",children:o}),l&&e.jsx("pre",{className:"mt-2 text-xs whitespace-pre-wrap font-mono bg-gray-50 dark:bg-gray-dark-900 p-2 rounded-md px-3 py-2",children:l})]})]},`op-${a.type}-${s}`)}),m=n.memo(({summaries:a,isCompleted:s})=>{const[r,l]=n.useState(!s);n.useEffect(()=>{let i;return s?i=setTimeout(()=>{l(!1)},1e3):l(!0),()=>{i&&clearTimeout(i)}},[s]);const o=n.useCallback(()=>{l(!r)},[r]);return e.jsxs("div",{className:"flex flex-col items-start mb-2.5 mt-2.5 first:mt-1 relative",children:[e.jsx("button",{type:"button",onClick:o,"data-expanded":r,className:"inline-flex items-center group gap-2 text-xs text-gray-500 dark:text-white-alpha-600 hover:text-gray-700 dark:hover:text-white-alpha-700 transition-colors cursor-pointer",children:s?e.jsxs(e.Fragment,{children:[e.jsx(t.Check,{className:"check-icon w-3 h-3 text-gray-500 dark:text-white-alpha-500 transition-all duration-200 absolute opacity-100 group-hover:opacity-0 group-data-[expanded=true]:opacity-0"}),e.jsx(t.ChevronRight,{className:"chevron-icon w-3 h-3 text-gray-500 dark:text-white-alpha-500 transition-all duration-200 transform opacity-0 rotate-0 group-hover:opacity-100 group-data-[expanded=true]:opacity-100 group-data-[expanded=true]:rotate-90"}),e.jsx("span",{className:"font-medium",children:"Completed"})]}):e.jsxs(e.Fragment,{children:[e.jsx(t.LoaderCircle,{className:"w-3 h-3 animate-spin"}),e.jsx("span",{className:"font-medium",children:"Thinking..."})]})}),e.jsx("div",{"data-expanded":r,className:"overflow-hidden transition-all duration-300 ease-in-out data-[expanded=true]:opacity-100 data-[expanded=false]:max-h-0 data-[expanded=false]:opacity-0 max-w-full",children:e.jsx("div",{className:"pb-2 mt-1.5 space-y-3 relative",children:a.map((i,c)=>e.jsx(p,{summary:i,index:c,showConnector:a.length>1&&c<a.length-1},`op-${i.type}-${c}`))})})]})});exports.DataSummaryGroup=m;
|
|
@@ -1,27 +1,31 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as s, jsx as e, Fragment as
|
|
3
|
-
import { memo as
|
|
4
|
-
import { Check as f, ChevronRight as
|
|
5
|
-
const
|
|
2
|
+
import { jsxs as s, jsx as e, Fragment as h } from "react/jsx-runtime";
|
|
3
|
+
import { memo as m, useState as w, useEffect as u, useCallback as y, useMemo as c } from "react";
|
|
4
|
+
import { Check as f, ChevronRight as N, LoaderCircle as k, Dot as g, CheckCheck as d, Search as v, CircleDot as b, TriangleAlert as _, Download as C, Forward as S, ArrowRight as A, Hammer as p, Brain as D, RefreshCw as E } from "lucide-react";
|
|
5
|
+
const I = (t) => {
|
|
6
6
|
const { type: r, label: a } = t;
|
|
7
7
|
return a || r.replace(/_/g, " ").replace(/\b\w/g, (l) => l.toUpperCase());
|
|
8
|
-
},
|
|
9
|
-
agent_generate: /* @__PURE__ */ e(
|
|
10
|
-
agent_reasoning: /* @__PURE__ */ e(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
default: /* @__PURE__ */ e(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
8
|
+
}, M = {
|
|
9
|
+
agent_generate: /* @__PURE__ */ e(E, { className: "w-3 h-3 text-gray-500 dark:text-white-alpha-500" }),
|
|
10
|
+
agent_reasoning: /* @__PURE__ */ e(D, { className: "w-3 h-3 text-gray-500 dark:text-white-alpha-500" }),
|
|
11
|
+
tool_call: /* @__PURE__ */ e(p, { className: "w-3 h-3 text-gray-500 dark:text-white-alpha-500" }),
|
|
12
|
+
tool_result: /* @__PURE__ */ e(p, { className: "w-3 h-3 text-gray-500 dark:text-white-alpha-500" }),
|
|
13
|
+
transfer: /* @__PURE__ */ e(A, { className: "w-3 h-3 text-gray-500 dark:text-white-alpha-500" }),
|
|
14
|
+
delegation_sent: /* @__PURE__ */ e(S, { className: "w-3 h-3 text-gray-500 dark:text-white-alpha-500" }),
|
|
15
|
+
delegation_returned: /* @__PURE__ */ e(d, { className: "w-3 h-3 text-gray-500 dark:text-white-alpha-500" }),
|
|
16
|
+
artifact_saved: /* @__PURE__ */ e(C, { className: "w-3 h-3 text-gray-500 dark:text-white-alpha-500" }),
|
|
17
|
+
error: /* @__PURE__ */ e(_, { className: "w-3 h-3 text-gray-500 dark:text-white-alpha-500" }),
|
|
18
|
+
agent_initializing: /* @__PURE__ */ e(b, { className: "w-3 h-3 animate-spin" }),
|
|
19
|
+
completion: /* @__PURE__ */ e(d, { className: "w-3 h-3 text-gray-500 dark:text-white-alpha-500" }),
|
|
20
|
+
default: /* @__PURE__ */ e(g, { className: "w-3 h-3 text-gray-500 dark:text-white-alpha-500" })
|
|
21
|
+
}, x = {
|
|
22
|
+
retrieve: /* @__PURE__ */ e(v, { className: "w-3 h-3 text-gray-500 dark:text-white-alpha-500" }),
|
|
23
|
+
action: /* @__PURE__ */ e(d, { className: "w-3 h-3 text-gray-500 dark:text-white-alpha-500" }),
|
|
24
|
+
default: /* @__PURE__ */ e(g, { className: "w-3 h-3 text-gray-500 dark:text-white-alpha-500" }),
|
|
25
|
+
...M
|
|
26
|
+
}, O = m(({ summary: t, index: r, showConnector: a }) => {
|
|
27
|
+
const l = c(() => t.details ? JSON.stringify(t.details, null, 2) : null, [t.details]), n = c(() => I(t), [t]), i = c(
|
|
28
|
+
() => x[t.type] || x.default,
|
|
25
29
|
[t.type]
|
|
26
30
|
);
|
|
27
31
|
return /* @__PURE__ */ s("div", { className: "flex items-start gap-2 text-xs relative", children: [
|
|
@@ -32,9 +36,9 @@ const E = (t) => {
|
|
|
32
36
|
l && /* @__PURE__ */ e("pre", { className: "mt-2 text-xs whitespace-pre-wrap font-mono bg-gray-50 dark:bg-gray-dark-900 p-2 rounded-md px-3 py-2", children: l })
|
|
33
37
|
] })
|
|
34
38
|
] }, `op-${t.type}-${r}`);
|
|
35
|
-
}),
|
|
36
|
-
const [a, l] =
|
|
37
|
-
|
|
39
|
+
}), j = m(({ summaries: t, isCompleted: r }) => {
|
|
40
|
+
const [a, l] = w(!r);
|
|
41
|
+
u(() => {
|
|
38
42
|
let i;
|
|
39
43
|
return r ? i = setTimeout(() => {
|
|
40
44
|
l(!1);
|
|
@@ -42,7 +46,7 @@ const E = (t) => {
|
|
|
42
46
|
i && clearTimeout(i);
|
|
43
47
|
};
|
|
44
48
|
}, [r]);
|
|
45
|
-
const n =
|
|
49
|
+
const n = y(() => {
|
|
46
50
|
l(!a);
|
|
47
51
|
}, [a]);
|
|
48
52
|
return /* @__PURE__ */ s("div", { className: "flex flex-col items-start mb-2.5 mt-2.5 first:mt-1 relative", children: [
|
|
@@ -53,12 +57,12 @@ const E = (t) => {
|
|
|
53
57
|
onClick: n,
|
|
54
58
|
"data-expanded": a,
|
|
55
59
|
className: "inline-flex items-center group gap-2 text-xs text-gray-500 dark:text-white-alpha-600 hover:text-gray-700 dark:hover:text-white-alpha-700 transition-colors cursor-pointer",
|
|
56
|
-
children: r ? /* @__PURE__ */ s(
|
|
60
|
+
children: r ? /* @__PURE__ */ s(h, { children: [
|
|
57
61
|
/* @__PURE__ */ e(f, { className: "check-icon w-3 h-3 text-gray-500 dark:text-white-alpha-500 transition-all duration-200 absolute opacity-100 group-hover:opacity-0 group-data-[expanded=true]:opacity-0" }),
|
|
58
|
-
/* @__PURE__ */ e(
|
|
62
|
+
/* @__PURE__ */ e(N, { className: "chevron-icon w-3 h-3 text-gray-500 dark:text-white-alpha-500 transition-all duration-200 transform opacity-0 rotate-0 group-hover:opacity-100 group-data-[expanded=true]:opacity-100 group-data-[expanded=true]:rotate-90" }),
|
|
59
63
|
/* @__PURE__ */ e("span", { className: "font-medium", children: "Completed" })
|
|
60
|
-
] }) : /* @__PURE__ */ s(
|
|
61
|
-
/* @__PURE__ */ e(
|
|
64
|
+
] }) : /* @__PURE__ */ s(h, { children: [
|
|
65
|
+
/* @__PURE__ */ e(k, { className: "w-3 h-3 animate-spin" }),
|
|
62
66
|
/* @__PURE__ */ e("span", { className: "font-medium", children: "Thinking..." })
|
|
63
67
|
] })
|
|
64
68
|
}
|
|
@@ -69,7 +73,7 @@ const E = (t) => {
|
|
|
69
73
|
"data-expanded": a,
|
|
70
74
|
className: "overflow-hidden transition-all duration-300 ease-in-out data-[expanded=true]:opacity-100 data-[expanded=false]:max-h-0 data-[expanded=false]:opacity-0 max-w-full",
|
|
71
75
|
children: /* @__PURE__ */ e("div", { className: "pb-2 mt-1.5 space-y-3 relative", children: t.map((i, o) => /* @__PURE__ */ e(
|
|
72
|
-
|
|
76
|
+
O,
|
|
73
77
|
{
|
|
74
78
|
summary: i,
|
|
75
79
|
index: o,
|
|
@@ -82,5 +86,5 @@ const E = (t) => {
|
|
|
82
86
|
] });
|
|
83
87
|
});
|
|
84
88
|
export {
|
|
85
|
-
|
|
89
|
+
j as DataSummaryGroup
|
|
86
90
|
};
|
package/dist/types/types.d.cts
CHANGED
|
@@ -317,7 +317,7 @@ export declare interface CustomIcons {
|
|
|
317
317
|
|
|
318
318
|
export declare type DataParts = {
|
|
319
319
|
operation: {
|
|
320
|
-
type:
|
|
320
|
+
type: OperationType;
|
|
321
321
|
ctx: Record<string, unknown>;
|
|
322
322
|
message?: string;
|
|
323
323
|
label?: string;
|
|
@@ -444,7 +444,7 @@ export declare interface InkeepAIChatSettings {
|
|
|
444
444
|
/**
|
|
445
445
|
* Headers for requests
|
|
446
446
|
*/
|
|
447
|
-
headers
|
|
447
|
+
headers?: Record<string, string>;
|
|
448
448
|
/**
|
|
449
449
|
* API key for requests
|
|
450
450
|
*/
|
|
@@ -1164,6 +1164,8 @@ export declare interface OpenUrlAction {
|
|
|
1164
1164
|
url: string;
|
|
1165
1165
|
}
|
|
1166
1166
|
|
|
1167
|
+
export declare type OperationType = 'error' | 'agent_initializing' | 'completion' | 'agent_generate' | 'agent_reasoning' | 'tool_call' | 'tool_result' | 'transfer' | 'delegation_sent' | 'delegation_returned' | 'artifact_saved';
|
|
1168
|
+
|
|
1167
1169
|
declare type QueryCondition = {
|
|
1168
1170
|
$eq: QueryValue;
|
|
1169
1171
|
} | {
|
package/dist/types/types.d.ts
CHANGED
|
@@ -317,7 +317,7 @@ export declare interface CustomIcons {
|
|
|
317
317
|
|
|
318
318
|
export declare type DataParts = {
|
|
319
319
|
operation: {
|
|
320
|
-
type:
|
|
320
|
+
type: OperationType;
|
|
321
321
|
ctx: Record<string, unknown>;
|
|
322
322
|
message?: string;
|
|
323
323
|
label?: string;
|
|
@@ -444,7 +444,7 @@ export declare interface InkeepAIChatSettings {
|
|
|
444
444
|
/**
|
|
445
445
|
* Headers for requests
|
|
446
446
|
*/
|
|
447
|
-
headers
|
|
447
|
+
headers?: Record<string, string>;
|
|
448
448
|
/**
|
|
449
449
|
* API key for requests
|
|
450
450
|
*/
|
|
@@ -1164,6 +1164,8 @@ export declare interface OpenUrlAction {
|
|
|
1164
1164
|
url: string;
|
|
1165
1165
|
}
|
|
1166
1166
|
|
|
1167
|
+
export declare type OperationType = 'error' | 'agent_initializing' | 'completion' | 'agent_generate' | 'agent_reasoning' | 'tool_call' | 'tool_result' | 'transfer' | 'delegation_sent' | 'delegation_returned' | 'artifact_saved';
|
|
1168
|
+
|
|
1167
1169
|
declare type QueryCondition = {
|
|
1168
1170
|
$eq: QueryValue;
|
|
1169
1171
|
} | {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inkeep/agents-ui",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.14",
|
|
4
4
|
"description": "",
|
|
5
5
|
"homepage": "",
|
|
6
6
|
"repository": {
|
|
@@ -70,6 +70,7 @@
|
|
|
70
70
|
"@zag-js/focus-trap": "^1.7.0",
|
|
71
71
|
"@zag-js/presence": "^1.13.1",
|
|
72
72
|
"@zag-js/react": "^1.13.1",
|
|
73
|
+
"@zag-js/remove-scroll": "^1.26.2",
|
|
73
74
|
"ai": "5.0.5",
|
|
74
75
|
"altcha-lib": "^1.2.0",
|
|
75
76
|
"aria-hidden": "^1.2.4",
|