@inkeep/agents-ui 0.14.13 → 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-stream-processor.cjs +1 -1
- package/dist/primitives/components/embedded-chat/use-stream-processor.js +35 -33
- 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 +3 -1
- package/dist/types/types.d.ts +3 -1
- 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 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react"),
|
|
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,51 +1,53 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { useState as p, useRef as h, useCallback as D, useEffect as R, useMemo as
|
|
3
|
-
import { DEFAULT_ERROR_MESSAGE as
|
|
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
4
|
import { CITATION_ARTIFACT_TYPE as _ } from "../../../types/message.js";
|
|
5
|
-
function
|
|
6
|
-
const [u,
|
|
7
|
-
|
|
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
8
|
const T = D(() => {
|
|
9
9
|
const e = [];
|
|
10
|
-
let t = "",
|
|
11
|
-
i.length > w.current && (
|
|
12
|
-
const
|
|
13
|
-
if (
|
|
14
|
-
const s = `group-${C.current++}`, n =
|
|
15
|
-
n ?
|
|
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
16
|
...n,
|
|
17
17
|
isCompleted: r
|
|
18
|
-
}) :
|
|
18
|
+
}) : m.set(s, {
|
|
19
19
|
isCompleted: r
|
|
20
20
|
}), e.push({
|
|
21
21
|
type: "summary-group",
|
|
22
|
-
summaries: [...
|
|
22
|
+
summaries: [...a],
|
|
23
23
|
groupKey: s
|
|
24
|
-
}),
|
|
24
|
+
}), a = [];
|
|
25
25
|
}
|
|
26
26
|
};
|
|
27
27
|
for (const r of i)
|
|
28
28
|
if (r.type === "text")
|
|
29
|
-
|
|
29
|
+
o(!0), t += r.text || "";
|
|
30
30
|
else if (r.type === "data-summary")
|
|
31
|
-
t.trim() && (e.push({ type: "text", text: t }), t = ""),
|
|
31
|
+
t.trim() && (e.push({ type: "text", text: t }), t = ""), a.push(r.data);
|
|
32
32
|
else if (r.type === "data-operation") {
|
|
33
33
|
t.trim() && (e.push({ type: "text", text: t }), t = "");
|
|
34
34
|
const s = r.data;
|
|
35
35
|
if (s?.type)
|
|
36
36
|
switch (s.type) {
|
|
37
|
+
case "agent_initializing":
|
|
38
|
+
break;
|
|
37
39
|
case "completion":
|
|
38
|
-
|
|
40
|
+
o(!0);
|
|
39
41
|
break;
|
|
40
42
|
case "error": {
|
|
41
|
-
|
|
43
|
+
o(!0);
|
|
42
44
|
const n = s.message || "Unknown error";
|
|
43
|
-
console.warn("Data operation error:", n), d(new Error(n)), c || (e.push({ type: "text", text:
|
|
45
|
+
console.warn("Data operation error:", n), d(new Error(n)), c || (e.push({ type: "text", text: M }), c = !0);
|
|
44
46
|
break;
|
|
45
47
|
}
|
|
46
48
|
default: {
|
|
47
|
-
const { type: n, label:
|
|
48
|
-
|
|
49
|
+
const { type: n, label: b } = s;
|
|
50
|
+
a.push({ type: n, label: b });
|
|
49
51
|
break;
|
|
50
52
|
}
|
|
51
53
|
}
|
|
@@ -57,24 +59,24 @@ function z(i, f, d) {
|
|
|
57
59
|
t += ` ^${n?.title || s.name}^`;
|
|
58
60
|
} else
|
|
59
61
|
t.trim() && (e.push({ type: "text", text: t }), t = ""), e.push(r);
|
|
60
|
-
else r.type === "data-component" && (t.trim() && (e.push({ type: "text", text: t }), t = ""),
|
|
61
|
-
return
|
|
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 };
|
|
62
64
|
}, [i, f, d]);
|
|
63
65
|
R(() => {
|
|
64
66
|
if (S.current === i)
|
|
65
67
|
return;
|
|
66
68
|
S.current = i;
|
|
67
69
|
const { processed: e, newTimings: t } = T();
|
|
68
|
-
|
|
69
|
-
const
|
|
70
|
-
return !
|
|
71
|
-
})) &&
|
|
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);
|
|
72
74
|
}, [T, i]);
|
|
73
75
|
const A = D(() => {
|
|
74
|
-
const e = Date.now() - x, t = Array.from(
|
|
76
|
+
const e = Date.now() - x, t = Array.from(l.current.values()).some(
|
|
75
77
|
(c) => !c.isCompleted
|
|
76
|
-
),
|
|
77
|
-
g(
|
|
78
|
+
), a = e > 1e3 && !t;
|
|
79
|
+
g(a);
|
|
78
80
|
}, [x]);
|
|
79
81
|
R(() => {
|
|
80
82
|
if (!f) {
|
|
@@ -88,14 +90,14 @@ function z(i, f, d) {
|
|
|
88
90
|
const t = setInterval(A, 200);
|
|
89
91
|
return () => clearInterval(t);
|
|
90
92
|
}, [f, A, u.length]);
|
|
91
|
-
const E =
|
|
93
|
+
const E = I(() => !(u.length > 0), [u.length]);
|
|
92
94
|
return {
|
|
93
95
|
processedParts: u,
|
|
94
96
|
summaryTimings: y,
|
|
95
97
|
shouldShowInitialLoading: E,
|
|
96
|
-
shouldShowStreamDelayLoading:
|
|
98
|
+
shouldShowStreamDelayLoading: P
|
|
97
99
|
};
|
|
98
100
|
}
|
|
99
101
|
export {
|
|
100
|
-
|
|
102
|
+
O as useStreamProcessor
|
|
101
103
|
};
|
|
@@ -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;
|
|
@@ -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;
|
|
@@ -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",
|