@inkeep/agents-ui 0.15.7 → 0.15.9

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.
@@ -1,3 +1,3 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Y=require("@ai-sdk/react"),Z=require("ai"),n=require("react"),ee=require("../../providers/config-provider.cjs"),te=require("../../hooks/use-media-query.cjs"),k=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"),A=`Hmm..
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ee=require("@ai-sdk/react"),te=require("ai"),n=require("react"),se=require("../../providers/config-provider.cjs"),ne=require("../../hooks/use-media-query.cjs"),A=require("../../utils/generate-uid.cjs"),re=require("../../providers/base-events-provider.cjs"),oe=require("../../providers/chat-form-provider.cjs"),ae=require("../../providers/widget-provider.cjs"),ie=require("@radix-ui/react-use-controllable-state"),ce=require("../../hooks/use-streaming-events.cjs"),P=`Hmm..
2
2
 
3
- It seems I might be having some issues right now. Please clear the chat and try again.`,ie=()=>{const{baseSettings:C,aiChatSettings:i}=ee.useInkeepConfig(),[t="",b]=ae.useControllableState({prop:i.conversationId,defaultProp:i.conversationId??""}),{logEvent:a}=se.useBaseEvents(),{setConversationId:D,emitToParent:u}=oe.useStreamingEvents(),[o,l]=n.useState(""),N=e=>l(e.target.value),{filters:y}=C,{onInputMessageChange:U,filters:I,agentUrl:M,context:d,headers:g,apiKey:p}=i,T=e=>{switch(e.code){case 400:return e.message;case 403:return`There seems to be a configuration error. Please contact ${C.organizationDisplayName??"Administrator"}`;default:return A}},[O,m]=n.useState([]),[H,w]=n.useState(null),K=n.useMemo(()=>new Z.DefaultChatTransport({api:M,headers:{...p?{Authorization:`Bearer ${p}`}:{},...g},body:{requestContext:d}}),[M,p,g,d]),{messages:h,sendMessage:L,status:_,setMessages:q,stop:W,error:f}=Y.useChat({transport:K,onData(e){u(e.type,e.data)},async onFinish(){u("completion",{conversationId:t}),await a({eventName:"assistant_message_received",properties:{conversationId:t}}),a({eventName:"assistant_answer_displayed",properties:{conversationId:t}})},onError(e){console.log("onError",e.message),a({eventName:"chat_error",properties:{conversationId:t,error:e.message}}),q(c=>{const r=[...c],s=r[r.length-1];if(s){const P=T(e);s.role==="user"?r.push({id:k.generateUid(16),role:"assistant",parts:[{type:"text",text:P}]}):s.parts=[{type:"text",text:P}]}return r})}}),x=_==="submitted",$=_==="streaming",z=h.length===0,v=!o.trim()||x,B=te.useMediaQuery("(max-width: 768px)"),[G,E]=n.useState(null);n.useEffect(()=>{f&&E(f)},[f]);const Q=()=>E(null),F=n.useRef(null);n.useEffect(()=>{U?.(o)},[o]);const j=e=>{e.key==="Enter"&&!e.shiftKey&&!v&&!e.nativeEvent.isComposing&&(e.preventDefault(),S())},S=async(e=o)=>{if(v&&(!e||e.trim().length===0))return;m([]),l(""),await a({eventName:"user_message_submitted",properties:{conversationId:t}});const c=y||I?JSON.stringify({...y,...I}):void 0,r={...g};c&&(r["inkeep-filters"]=c);let s=t;s||(s=`conv_${k.generateUid(16)}`,b(s)),D(s),L({text:e},{headers:r,body:{conversationId:s,requestContext:d}})},J=()=>{W().then(()=>{u("aborted",{conversationId:t})})},R=()=>{Q(),q([]),b(""),m([]),w(null),a({eventName:"chat_clear_button_clicked",properties:{conversationId:t}})},{openForm:V}=ne.useChatForm(),X=re.useWidget();return n.useImperativeHandle(i.chatFunctionsRef,()=>({submitMessage:S,updateInputMessage(e){l(e)},clearChat:R,openForm:e=>{X?.setView("chat"),V(e,void 0)},focusInput:()=>{F.current?.focus()}})),{messages:h,isLoading:x,isStreaming:$,error:G,setError:E,isSubmitDisabled:v,input:o,handleInputChange:N,handleInputKeyDown:j,handleSubmit:S,stop:J,clear:R,isEmpty:h.length===0,inputRef:F,isMobile:B,messageAttachments:O,setMessageAttachments:m,selectedWorkflow:H,setSelectedWorkflow:w,isNewChat:z,conversationId:t}};exports.DEFAULT_ERROR_MESSAGE=A;exports.useInkeepChat=ie;
3
+ It seems I might be having some issues right now. Please clear the chat and try again.`,ue=()=>{const{baseSettings:C,aiChatSettings:i}=se.useInkeepConfig(),[t="",I]=ie.useControllableState({prop:i.conversationId,defaultProp:i.conversationId??""}),{logEvent:o}=re.useBaseEvents(),{setConversationId:N,emitToParent:u}=ce.useStreamingEvents(),[a,l]=n.useState(""),T=e=>l(e.target.value),{filters:b}=C,{onInputMessageChange:U,filters:y,agentUrl:w,context:d,headers:p,apiKey:g}=i,O=e=>{switch(e.code){case 400:return e.message;case 403:return`There seems to be a configuration error. Please contact ${C.organizationDisplayName??"Administrator"}`;default:return P}},[H,m]=n.useState([]),[z,M]=n.useState(null),K=()=>({"x-inkeep-client-timezone":Intl.DateTimeFormat().resolvedOptions().timeZone,"x-inkeep-client-timestamp":new Date().toISOString()}),L=n.useMemo(()=>new te.DefaultChatTransport({api:w,headers:{...g?{Authorization:`Bearer ${g}`}:{},...p},body:{requestContext:d}}),[w,g,p,d]),{messages:h,sendMessage:_,addToolApprovalResponse:W,status:q,setMessages:x,stop:$,error:f}=ee.useChat({transport:L,onData(e){u(e.type,e.data)},async onFinish(){u("completion",{conversationId:t}),await o({eventName:"assistant_message_received",properties:{conversationId:t}}),o({eventName:"assistant_answer_displayed",properties:{conversationId:t}})},onError(e){console.log("onError",e.message),o({eventName:"chat_error",properties:{conversationId:t,error:e.message}}),x(c=>{const r=[...c],s=r[r.length-1];if(s){const D=O(e);s.role==="user"?r.push({id:A.generateUid(16),role:"assistant",parts:[{type:"text",text:D}]}):s.parts=[{type:"text",text:D}]}return r})}}),F=q==="submitted",B=q==="streaming",G=h.length===0,v=!a.trim()||F,Q=ne.useMediaQuery("(max-width: 768px)"),[j,S]=n.useState(null);n.useEffect(()=>{f&&S(f)},[f]);const J=()=>S(null),R=n.useRef(null);n.useEffect(()=>{U?.(a)},[a]);const V=e=>{e.key==="Enter"&&!e.shiftKey&&!v&&!e.nativeEvent.isComposing&&(e.preventDefault(),E())},E=async(e=a)=>{if(v&&(!e||e.trim().length===0))return;m([]),l(""),await o({eventName:"user_message_submitted",properties:{conversationId:t}});const c=b||y?JSON.stringify({...b,...y}):void 0,r={...p};c&&(r["inkeep-filters"]=c);let s=t;s||(s=`conv_${A.generateUid(16)}`,I(s)),N(s),_({text:e},{headers:{...K(),...r},body:{conversationId:s,requestContext:d}})},Z=()=>{$().then(()=>{u("aborted",{conversationId:t})})},k=()=>{J(),x([]),I(""),m([]),M(null),o({eventName:"chat_clear_button_clicked",properties:{conversationId:t}})},{openForm:X}=oe.useChatForm(),Y=ae.useWidget();return n.useImperativeHandle(i.chatFunctionsRef,()=>({submitMessage:E,updateInputMessage(e){l(e)},clearChat:k,openForm:e=>{Y?.setView("chat"),X(e,void 0)},focusInput:()=>{R.current?.focus()}})),{messages:h,sendMessage:_,addToolApprovalResponse:W,isLoading:F,isStreaming:B,error:j,setError:S,isSubmitDisabled:v,input:a,handleInputChange:T,handleInputKeyDown:V,handleSubmit:E,stop:Z,clear:k,isEmpty:h.length===0,inputRef:R,isMobile:Q,messageAttachments:H,setMessageAttachments:m,selectedWorkflow:z,setSelectedWorkflow:M,isNewChat:G,conversationId:t}};exports.DEFAULT_ERROR_MESSAGE=P;exports.useInkeepChat=ue;
@@ -1,8 +1,29 @@
1
1
  import { KeyboardEvent, Dispatch, SetStateAction, RefObject } from 'react';
2
2
  import { Message, MessageAttachment, Workflow } from '../../../types/index.ts';
3
+ import { FileUIPart, ChatRequestOptions, ChatAddToolApproveResponseFunction } from 'ai';
3
4
  export declare const DEFAULT_ERROR_MESSAGE = "Hmm.. \n\nIt seems I might be having some issues right now. Please clear the chat and try again.";
4
5
  export declare const useInkeepChat: () => {
5
6
  messages: Message[];
7
+ sendMessage: (message?: (Omit<Message, "id" | "role"> & {
8
+ id?: string | undefined;
9
+ role?: "system" | "user" | "assistant" | undefined;
10
+ } & {
11
+ text?: never;
12
+ files?: never;
13
+ messageId?: string;
14
+ }) | {
15
+ text: string;
16
+ files?: FileList | FileUIPart[];
17
+ metadata?: unknown;
18
+ parts?: never;
19
+ messageId?: string;
20
+ } | {
21
+ files: FileList | FileUIPart[];
22
+ metadata?: unknown;
23
+ parts?: never;
24
+ messageId?: string;
25
+ } | undefined, options?: ChatRequestOptions) => Promise<void>;
26
+ addToolApprovalResponse: ChatAddToolApproveResponseFunction;
6
27
  isLoading: boolean;
7
28
  isStreaming: boolean;
8
29
  error: Error | null;
@@ -1,32 +1,32 @@
1
1
  "use client";
2
- import { useChat as Y } from "@ai-sdk/react";
3
- import { DefaultChatTransport as Z } from "ai";
4
- import { useState as c, useMemo as ee, useEffect as A, useRef as te, useImperativeHandle as se } from "react";
5
- import { useInkeepConfig as ne } from "../../providers/config-provider.js";
6
- import { useMediaQuery as oe } from "../../hooks/use-media-query.js";
7
- import { generateUid as R } from "../../utils/generate-uid.js";
8
- import { useBaseEvents as re } from "../../providers/base-events-provider.js";
9
- import { useChatForm as ae } from "../../providers/chat-form-provider.js";
10
- import { useWidget as ie } from "../../providers/widget-provider.js";
11
- import { useControllableState as ce } from "@radix-ui/react-use-controllable-state";
12
- import { useStreamingEvents as me } from "../../hooks/use-streaming-events.js";
2
+ import { useChat as ee } from "@ai-sdk/react";
3
+ import { DefaultChatTransport as te } from "ai";
4
+ import { useState as c, useMemo as se, useEffect as R, useRef as ne, useImperativeHandle as oe } from "react";
5
+ import { useInkeepConfig as re } from "../../providers/config-provider.js";
6
+ import { useMediaQuery as ae } from "../../hooks/use-media-query.js";
7
+ import { generateUid as T } from "../../utils/generate-uid.js";
8
+ import { useBaseEvents as ie } from "../../providers/base-events-provider.js";
9
+ import { useChatForm as ce } from "../../providers/chat-form-provider.js";
10
+ import { useWidget as me } from "../../providers/widget-provider.js";
11
+ import { useControllableState as le } from "@radix-ui/react-use-controllable-state";
12
+ import { useStreamingEvents as pe } from "../../hooks/use-streaming-events.js";
13
13
  const ue = `Hmm..
14
14
 
15
- It seems I might be having some issues right now. Please clear the chat and try again.`, be = () => {
16
- const { baseSettings: y, aiChatSettings: a } = ne(), [t = "", E] = ce({
15
+ It seems I might be having some issues right now. Please clear the chat and try again.`, we = () => {
16
+ const { baseSettings: y, aiChatSettings: a } = re(), [t = "", E] = le({
17
17
  prop: a.conversationId,
18
18
  defaultProp: a.conversationId ?? ""
19
- }), { logEvent: o } = re(), { setConversationId: P, emitToParent: m } = me(), [r, u] = c(""), T = (e) => u(e.target.value), {
19
+ }), { logEvent: o } = ie(), { setConversationId: H, emitToParent: m } = pe(), [r, l] = c(""), O = (e) => l(e.target.value), {
20
20
  /* shouldBypassCaptcha, */
21
21
  filters: b
22
22
  } = y, {
23
- onInputMessageChange: q,
24
- filters: w,
25
- agentUrl: S,
26
- context: l,
27
- headers: p,
28
- apiKey: g
29
- } = a, H = (e) => {
23
+ onInputMessageChange: P,
24
+ filters: S,
25
+ agentUrl: w,
26
+ context: p,
27
+ headers: u,
28
+ apiKey: d
29
+ } = a, q = (e) => {
30
30
  switch (e.code) {
31
31
  case 400:
32
32
  return e.message;
@@ -35,26 +35,30 @@ It seems I might be having some issues right now. Please clear the chat and try
35
35
  default:
36
36
  return ue;
37
37
  }
38
- }, [K, d] = c([]), [U, M] = c(null), W = ee(
39
- () => new Z({
40
- api: S,
38
+ }, [z, g] = c([]), [K, x] = c(null), U = () => ({
39
+ "x-inkeep-client-timezone": Intl.DateTimeFormat().resolvedOptions().timeZone,
40
+ "x-inkeep-client-timestamp": (/* @__PURE__ */ new Date()).toISOString()
41
+ }), W = se(
42
+ () => new te({
43
+ api: w,
41
44
  headers: {
42
- ...g ? { Authorization: `Bearer ${g}` } : {},
43
- ...p
45
+ ...d ? { Authorization: `Bearer ${d}` } : {},
46
+ ...u
44
47
  },
45
48
  body: {
46
- requestContext: l
49
+ requestContext: p
47
50
  }
48
51
  }),
49
- [S, g, p, l]
52
+ [w, d, u, p]
50
53
  ), {
51
54
  messages: h,
52
- sendMessage: $,
55
+ sendMessage: M,
56
+ addToolApprovalResponse: $,
53
57
  status: _,
54
- setMessages: x,
55
- stop: z,
58
+ setMessages: k,
59
+ stop: B,
56
60
  error: f
57
- } = Y({
61
+ } = ee({
58
62
  transport: W,
59
63
  onData(e) {
60
64
  m(e.type, e.data);
@@ -79,107 +83,112 @@ It seems I might be having some issues right now. Please clear the chat and try
79
83
  conversationId: t,
80
84
  error: e.message
81
85
  }
82
- }), x((i) => {
86
+ }), k((i) => {
83
87
  const n = [...i], s = n[n.length - 1];
84
88
  if (s) {
85
- const D = H(e);
89
+ const A = q(e);
86
90
  s.role === "user" ? n.push({
87
- id: R(16),
91
+ id: T(16),
88
92
  role: "assistant",
89
- parts: [{ type: "text", text: D }]
90
- }) : s.parts = [{ type: "text", text: D }];
93
+ parts: [{ type: "text", text: A }]
94
+ }) : s.parts = [{ type: "text", text: A }];
91
95
  }
92
96
  return n;
93
97
  });
94
98
  }
95
- }), F = _ === "submitted", B = _ === "streaming", L = h.length === 0, v = !r.trim() || F, O = oe("(max-width: 768px)"), [G, C] = c(null);
96
- A(() => {
97
- f && C(f);
99
+ }), D = _ === "submitted", L = _ === "streaming", G = h.length === 0, v = !r.trim() || D, J = ae("(max-width: 768px)"), [Q, I] = c(null);
100
+ R(() => {
101
+ f && I(f);
98
102
  }, [f]);
99
- const J = () => C(null), N = te(null);
100
- A(() => {
101
- q?.(r);
103
+ const V = () => I(null), F = ne(null);
104
+ R(() => {
105
+ P?.(r);
102
106
  }, [r]);
103
- const Q = (e) => {
104
- e.key === "Enter" && !e.shiftKey && !v && !e.nativeEvent.isComposing && (e.preventDefault(), I());
105
- }, I = async (e = r) => {
107
+ const Z = (e) => {
108
+ e.key === "Enter" && !e.shiftKey && !v && !e.nativeEvent.isComposing && (e.preventDefault(), C());
109
+ }, C = async (e = r) => {
106
110
  if (v && (!e || e.trim().length === 0)) return;
107
- d([]), u(""), await o({
111
+ g([]), l(""), await o({
108
112
  eventName: "user_message_submitted",
109
113
  properties: {
110
114
  conversationId: t
111
115
  }
112
116
  });
113
- const i = b || w ? JSON.stringify({
117
+ const i = b || S ? JSON.stringify({
114
118
  ...b,
115
- ...w
119
+ ...S
116
120
  }) : void 0, n = {
117
- ...p
121
+ ...u
118
122
  };
119
123
  i && (n["inkeep-filters"] = i);
120
124
  let s = t;
121
- s || (s = `conv_${R(16)}`, E(s)), P(s), $(
125
+ s || (s = `conv_${T(16)}`, E(s)), H(s), M(
122
126
  {
123
127
  text: e
124
128
  },
125
129
  {
126
- headers: n,
130
+ headers: {
131
+ ...U(),
132
+ ...n
133
+ },
127
134
  body: {
128
135
  conversationId: s,
129
- requestContext: l
136
+ requestContext: p
130
137
  }
131
138
  }
132
139
  );
133
- }, V = () => {
134
- z().then(() => {
140
+ }, j = () => {
141
+ B().then(() => {
135
142
  m("aborted", { conversationId: t });
136
143
  });
137
- }, k = () => {
138
- J(), x([]), E(""), d([]), M(null), o({
144
+ }, N = () => {
145
+ V(), k([]), E(""), g([]), x(null), o({
139
146
  eventName: "chat_clear_button_clicked",
140
147
  properties: {
141
148
  conversationId: t
142
149
  }
143
150
  });
144
- }, { openForm: j } = ae(), X = ie();
145
- return se(a.chatFunctionsRef, () => ({
146
- submitMessage: I,
151
+ }, { openForm: X } = ce(), Y = me();
152
+ return oe(a.chatFunctionsRef, () => ({
153
+ submitMessage: C,
147
154
  updateInputMessage(e) {
148
- u(e);
155
+ l(e);
149
156
  },
150
- clearChat: k,
157
+ clearChat: N,
151
158
  openForm: (e) => {
152
- X?.setView("chat"), j(e, void 0);
159
+ Y?.setView("chat"), X(e, void 0);
153
160
  },
154
161
  focusInput: () => {
155
- N.current?.focus();
162
+ F.current?.focus();
156
163
  }
157
164
  })), {
158
165
  messages: h,
159
- isLoading: F,
160
- isStreaming: B,
161
- error: G,
162
- setError: C,
166
+ sendMessage: M,
167
+ addToolApprovalResponse: $,
168
+ isLoading: D,
169
+ isStreaming: L,
170
+ error: Q,
171
+ setError: I,
163
172
  isSubmitDisabled: v,
164
173
  input: r,
165
- handleInputChange: T,
166
- handleInputKeyDown: Q,
167
- handleSubmit: I,
168
- stop: V,
169
- clear: k,
174
+ handleInputChange: O,
175
+ handleInputKeyDown: Z,
176
+ handleSubmit: C,
177
+ stop: j,
178
+ clear: N,
170
179
  isEmpty: h.length === 0,
171
- inputRef: N,
172
- isMobile: O,
180
+ inputRef: F,
181
+ isMobile: J,
173
182
  // Additional state for attachments and workflow
174
- messageAttachments: K,
175
- setMessageAttachments: d,
176
- selectedWorkflow: U,
177
- setSelectedWorkflow: M,
178
- isNewChat: L,
183
+ messageAttachments: z,
184
+ setMessageAttachments: g,
185
+ selectedWorkflow: K,
186
+ setSelectedWorkflow: x,
187
+ isNewChat: G,
179
188
  conversationId: t
180
189
  };
181
190
  };
182
191
  export {
183
192
  ue as DEFAULT_ERROR_MESSAGE,
184
- be as useInkeepChat
193
+ we as useInkeepChat
185
194
  };
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react"),E=require("./use-inkeep-chat.cjs");function L(f,u,d){const[p,D]=n.useState([]),[h,w]=n.useState(new Map),[C,T]=n.useState(Date.now()),[A,y]=n.useState(!1),x=n.useRef(0),S=n.useRef(0),R=n.useRef([]),m=n.useRef(h);m.current=h;const b=n.useCallback(()=>{const t=[];let e="",a=[],i=!1;f.length>x.current&&(T(Date.now()),x.current=f.length),S.current=0;const c=new Map,l=(s=!1)=>{if(a.length>0){const r=`group-${S.current++}`,o=m.current.get(r);o?c.set(r,{...o,isCompleted:s}):c.set(r,{isCompleted:s}),t.push({type:"summary-group",summaries:[...a],groupKey:r}),a=[]}};for(const s of f)if(s.type==="text")l(!0),e+=s.text||"";else if(s.type==="data-summary")e.trim()&&(t.push({type:"text",text:e}),e=""),a.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":{const{type:o}=r;a.push({type:o,label:"Completed"}),l(!0);break}case"error":{const o=r.message||"Unknown error";if(console.warn("Data operation error:",o),!t.length)l(!0),d(new Error(o)),i||(t.push({type:"text",text:E.DEFAULT_ERROR_MESSAGE}),i=!0);else{const{type:g,label:v}=r;a.push({type:g,label:v})}break}default:{const{type:o,label:g}=r;a.push({type:o,label:g});break}}}else if(s.type==="data-artifact")if(s.data?.type?.toLowerCase()==="citation"){const r=s.data,o=r.artifactSummary||{title:r.name};e+=` ^${o?.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=""),l(!0),t.push(s));return l(!u),e.trim()&&t.push({type:"text",text:e}),{processed:t,newTimings:c}},[f,u,d]);n.useEffect(()=>{if(R.current===f)return;R.current=f;const{processed:t,newTimings:e}=b();D(t),(e.size!==m.current.size||Array.from(e.entries()).some(([i,c])=>{const l=m.current.get(i);return!l||l.isCompleted!==c.isCompleted}))&&w(e)},[b,f]),n.useEffect(()=>{u||w(t=>{const e=new Map(t);let a=!1;for(const[i,c]of e.entries())c.isCompleted||(e.set(i,{...c,isCompleted:!0}),a=!0);return a?e:t})},[u]);const k=n.useCallback(()=>{const t=Date.now()-C,e=Array.from(m.current.values()).some(i=>!i.isCompleted),a=t>1e3&&!e;y(a)},[C]);n.useEffect(()=>{if(!u){y(!1);return}if(!(p.length>0)){y(!1);return}const e=setInterval(k,200);return()=>clearInterval(e)},[u,k,p.length]);const P=n.useMemo(()=>!!(!(p.length>0)&&u),[p.length,u]);return{processedParts:p,summaryTimings:h,shouldShowInitialLoading:P,shouldShowStreamDelayLoading:A}}exports.useStreamProcessor=L;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react"),E=require("./use-inkeep-chat.cjs");function L(f,i,d){const[p,D]=n.useState([]),[h,x]=n.useState(new Map),[w,T]=n.useState(Date.now()),[A,y]=n.useState(!1),C=n.useRef(0),S=n.useRef(0),R=n.useRef([]),m=n.useRef(h);m.current=h;const b=n.useCallback(()=>{const t=[];let e="",a=[],c=!1;f.length>C.current&&(T(Date.now()),C.current=f.length),S.current=0;const l=new Map,u=(s=!1)=>{if(a.length>0){const r=`group-${S.current++}`,o=m.current.get(r);o?l.set(r,{...o,isCompleted:s}):l.set(r,{isCompleted:s}),t.push({type:"summary-group",summaries:[...a],groupKey:r}),a=[]}};for(const s of f)if(s.type==="text")u(!0),e+=s.text||"";else if(s.type==="data-summary")e.trim()&&(t.push({type:"text",text:e}),e=""),a.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":{const{type:o}=r;a.push({type:o,label:"Completed"}),u(!0);break}case"error":{const o=r.message||"Unknown error";if(console.warn("Data operation error:",o),!t.length)u(!0),d(new Error(o)),c||(t.push({type:"text",text:E.DEFAULT_ERROR_MESSAGE}),c=!0);else{const{type:g,label:v}=r;a.push({type:g,label:v})}break}default:{const{type:o,label:g}=r;a.push({type:o,label:g});break}}}else if(s.type==="data-artifact")if(s.data?.type?.toLowerCase()==="citation"){const r=s.data,o=r.artifactSummary||{title:r.name};e+=` ^${o?.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=""),u(!0),t.push(s)):(e.trim()&&(t.push({type:"text",text:e}),e=""),u(!0),t.push(s));return u(!i),e.trim()&&t.push({type:"text",text:e}),{processed:t,newTimings:l}},[f,i,d]);n.useEffect(()=>{if(R.current===f)return;R.current=f;const{processed:t,newTimings:e}=b();D(t),(e.size!==m.current.size||Array.from(e.entries()).some(([c,l])=>{const u=m.current.get(c);return!u||u.isCompleted!==l.isCompleted}))&&x(e)},[b,f]),n.useEffect(()=>{i||x(t=>{const e=new Map(t);let a=!1;for(const[c,l]of e.entries())l.isCompleted||(e.set(c,{...l,isCompleted:!0}),a=!0);return a?e:t})},[i]);const k=n.useCallback(()=>{const t=Date.now()-w,e=Array.from(m.current.values()).some(c=>!c.isCompleted),a=t>1e3&&!e;y(a)},[w]);n.useEffect(()=>{if(!i){y(!1);return}if(!(p.length>0)){y(!1);return}const e=setInterval(k,200);return()=>clearInterval(e)},[i,k,p.length]);const P=n.useMemo(()=>!!(!(p.length>0)&&i),[p.length,i]);return{processedParts:p,summaryTimings:h,shouldShowInitialLoading:P,shouldShowStreamDelayLoading:A}}exports.useStreamProcessor=L;
@@ -1,16 +1,16 @@
1
1
  "use client";
2
- import { useState as m, useRef as h, useCallback as L, useEffect as w, useMemo as z } from "react";
2
+ import { useState as m, useRef as h, useCallback as L, useEffect as x, useMemo as z } from "react";
3
3
  import { DEFAULT_ERROR_MESSAGE as G } from "./use-inkeep-chat.js";
4
- function F(l, a, x) {
5
- const [f, R] = m([]), [y, C] = m(/* @__PURE__ */ new Map()), [D, v] = m(Date.now()), [M, g] = m(!1), S = h(0), A = h(0), T = h([]), p = h(y);
6
- p.current = y;
4
+ function F(l, i, w) {
5
+ const [p, R] = m([]), [y, C] = m(/* @__PURE__ */ new Map()), [D, v] = m(Date.now()), [M, g] = m(!1), S = h(0), A = h(0), T = h([]), f = h(y);
6
+ f.current = y;
7
7
  const b = L(() => {
8
8
  const e = [];
9
- let t = "", n = [], i = !1;
9
+ let t = "", n = [], u = !1;
10
10
  l.length > S.current && (v(Date.now()), S.current = l.length), A.current = 0;
11
- const c = /* @__PURE__ */ new Map(), u = (s = !1) => {
11
+ const c = /* @__PURE__ */ new Map(), a = (s = !1) => {
12
12
  if (n.length > 0) {
13
- const r = `group-${A.current++}`, o = p.current.get(r);
13
+ const r = `group-${A.current++}`, o = f.current.get(r);
14
14
  o ? c.set(r, {
15
15
  ...o,
16
16
  isCompleted: s
@@ -25,7 +25,7 @@ function F(l, a, x) {
25
25
  };
26
26
  for (const s of l)
27
27
  if (s.type === "text")
28
- u(!0), t += s.text || "";
28
+ a(!0), t += s.text || "";
29
29
  else if (s.type === "data-summary")
30
30
  t.trim() && (e.push({ type: "text", text: t }), t = ""), n.push(s.data);
31
31
  else if (s.type === "data-operation") {
@@ -37,13 +37,13 @@ function F(l, a, x) {
37
37
  break;
38
38
  case "completion": {
39
39
  const { type: o } = r;
40
- n.push({ type: o, label: "Completed" }), u(!0);
40
+ n.push({ type: o, label: "Completed" }), a(!0);
41
41
  break;
42
42
  }
43
43
  case "error": {
44
44
  const o = r.message || "Unknown error";
45
45
  if (console.warn("Data operation error:", o), !e.length)
46
- u(!0), x(new Error(o)), i || (e.push({ type: "text", text: G }), i = !0);
46
+ a(!0), w(new Error(o)), u || (e.push({ type: "text", text: G }), u = !0);
47
47
  else {
48
48
  const { type: d, label: E } = r;
49
49
  n.push({ type: d, label: E });
@@ -64,51 +64,51 @@ function F(l, a, x) {
64
64
  t += ` ^${o?.title || r.name}^`;
65
65
  } else
66
66
  t.trim() && (e.push({ type: "text", text: t }), t = ""), e.push(s);
67
- else s.type === "data-component" && (t.trim() && (e.push({ type: "text", text: t }), t = ""), u(!0), e.push(s));
68
- return u(!a), t.trim() && e.push({ type: "text", text: t }), { processed: e, newTimings: c };
69
- }, [l, a, x]);
70
- w(() => {
67
+ else s.type === "data-component" ? (t.trim() && (e.push({ type: "text", text: t }), t = ""), a(!0), e.push(s)) : (t.trim() && (e.push({ type: "text", text: t }), t = ""), a(!0), e.push(s));
68
+ return a(!i), t.trim() && e.push({ type: "text", text: t }), { processed: e, newTimings: c };
69
+ }, [l, i, w]);
70
+ x(() => {
71
71
  if (T.current === l)
72
72
  return;
73
73
  T.current = l;
74
74
  const { processed: e, newTimings: t } = b();
75
- R(e), (t.size !== p.current.size || Array.from(t.entries()).some(([i, c]) => {
76
- const u = p.current.get(i);
77
- return !u || u.isCompleted !== c.isCompleted;
75
+ R(e), (t.size !== f.current.size || Array.from(t.entries()).some(([u, c]) => {
76
+ const a = f.current.get(u);
77
+ return !a || a.isCompleted !== c.isCompleted;
78
78
  })) && C(t);
79
- }, [b, l]), w(() => {
80
- a || C((e) => {
79
+ }, [b, l]), x(() => {
80
+ i || C((e) => {
81
81
  const t = new Map(e);
82
82
  let n = !1;
83
- for (const [i, c] of t.entries())
84
- c.isCompleted || (t.set(i, {
83
+ for (const [u, c] of t.entries())
84
+ c.isCompleted || (t.set(u, {
85
85
  ...c,
86
86
  isCompleted: !0
87
87
  }), n = !0);
88
88
  return n ? t : e;
89
89
  });
90
- }, [a]);
90
+ }, [i]);
91
91
  const k = L(() => {
92
- const e = Date.now() - D, t = Array.from(p.current.values()).some(
93
- (i) => !i.isCompleted
92
+ const e = Date.now() - D, t = Array.from(f.current.values()).some(
93
+ (u) => !u.isCompleted
94
94
  ), n = e > 1e3 && !t;
95
95
  g(n);
96
96
  }, [D]);
97
- w(() => {
98
- if (!a) {
97
+ x(() => {
98
+ if (!i) {
99
99
  g(!1);
100
100
  return;
101
101
  }
102
- if (!(f.length > 0)) {
102
+ if (!(p.length > 0)) {
103
103
  g(!1);
104
104
  return;
105
105
  }
106
106
  const t = setInterval(k, 200);
107
107
  return () => clearInterval(t);
108
- }, [a, k, f.length]);
109
- const P = z(() => !!(!(f.length > 0) && a), [f.length, a]);
108
+ }, [i, k, p.length]);
109
+ const P = z(() => !!(!(p.length > 0) && i), [p.length, i]);
110
110
  return {
111
- processedParts: f,
111
+ processedParts: p,
112
112
  summaryTimings: y,
113
113
  shouldShowInitialLoading: P,
114
114
  shouldShowStreamDelayLoading: M
@@ -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.15.6",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;
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.15.8",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.15.6",
8
+ widgetLibraryVersion: "0.15.8",
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"),G=require("../../primitives/providers/base-events-provider.cjs"),K=require("../../primitives/providers/config-provider.cjs"),O=require("../../primitives/providers/message-provider.cjs"),r=require("../../primitives/components/embedded-chat.cjs"),B=require("../../primitives/components/embedded-chat/chat-provider.cjs"),F=require("merge-anything"),J=require("../utils.cjs"),U=require("./ui/markdown-styles.cjs"),z=require("../../primitives/components/embedded-chat/use-stream-processor.cjs"),H=require("./data-summary-group.cjs"),c=require("react"),Q=require("./embedded-chat.cjs"),k=require("lucide-react"),V=()=>e.jsx("div",{className:"flex space-x-1",children:[0,1,2].map(s=>e.jsx("span",{className:"animate-bounce-dot opacity-30",style:{animationDelay:`${s*.2}s`},children:"."},s))}),w=({name:s,Icon:n,props:y,componentType:p})=>e.jsxs("div",{className:"border rounded-lg bg-gray-50 dark:bg-gray-dark-800 mb-3",children:[e.jsxs("div",{className:"flex justify-between px-4 py-2 text-xs",children:[e.jsxs("div",{className:"font-medium flex items-center gap-2",children:[e.jsx(n,{className:"w-3 h-3 text-gray-600 dark:text-white-alpha-600"}),e.jsx("span",{children:s})]}),e.jsx("div",{className:"flex items-center px-1.5 py-0.5 rounded-md text-2xs uppercase tracking-wider bg-gray-200 dark:bg-white-alpha-200 font-medium text-gray-700 dark:text-white-alpha-700 font-mono",children:p})]}),e.jsx("pre",{className:"whitespace-pre-wrap text-xs text-gray-700 dark:text-white-alpha-700 font-mono px-4 py-2",children:JSON.stringify(y,null,2)})]}),W=({name:s,props:n})=>e.jsx(w,{name:s,Icon:k.ComponentIcon,props:n,componentType:"component"}),X=({name:s,props:n})=>e.jsx(w,{name:s,Icon:k.Library,props:n,componentType:"artifact"}),Y=({className:s,componentStyles:n,children:y,isLast:p,...S})=>{const{message:o}=O.useMessage(),{logEvent:u}=G.useBaseEvents(),{conversationId:C,isStreaming:D,isLoading:M,setError:q}=B.useChat(),{aiChatSettings:{components:N,artifacts:E}}=K.useInkeepConfig(),L=o.role==="user",$=(D||M)&&p&&o.role==="assistant",{processedParts:_,summaryTimings:I,shouldShowInitialLoading:T,shouldShowStreamDelayLoading:R}=z.useStreamProcessor(o.parts,$,q),f=c.useMemo(()=>o.parts.filter(t=>t.type==="data-artifact"&&t.data?.type?.toLowerCase()==="citation"),[o.parts]),b=c.useMemo(()=>F.merge(U.markdownStyles,n??{}),[n]),j=c.useCallback((t,a)=>{u({eventName:"assistant_message_inline_link_opened",properties:{title:a?.toString(),url:t}})},[u]),v=c.useCallback((t,a)=>{u({eventName:"assistant_code_block_copied",properties:{conversationId:C,language:t,code:a}})},[u,C]),P=c.useCallback(t=>e.jsx(r.EmbeddedChatPrimitiveMarkdown,{text:t,componentStyles:b,onLinkClick:j,onCodeCopy:v,artifacts:f}),[b,j,v,f]),A=c.useMemo(()=>J.cn("data-[role=user]:whitespace-pre-wrap mb-3 data-[role=user]:mb-0 [&[data-role=user]>p]:mb-0 max-w-full",s),[s]);return e.jsxs(e.Fragment,{children:[_.map((t,a)=>{const m={"data-role":o.role,"data-type":t?.type==="data-component"?t.data.type:t?.type,...S,className:A};switch(t?.type){case"text":return e.jsx(r.PrimitiveMessagePart,{...m,children:L?t.text:P(t.text||"")},a);case"data-component":{const{type:d}=t.data;switch(d){case"text":return e.jsx("div",{...m,children:P(t.data.text||"")},a);default:{const g=t.data,{name:i,props:x}=g,l=N?.[i],h=l?r.EmbeddedChatPrimitiveDynamicComponent:W;return e.jsx(r.PrimitiveMessagePart,{...m,children:e.jsx(h,{name:i,props:x,componentDef:l})},`${i}-${a}`)}}}case"data-artifact":{const d=t.data,{name:g,type:i,artifactSummary:x}=d,l=E?.[i],h=l?r.EmbeddedChatPrimitiveDynamicComponent:X;return e.jsx(r.PrimitiveMessagePart,{...m,children:e.jsx(h,{name:i,props:x,componentDef:l})},`${g}-${a}`)}case"summary-group":{const d=I.get(t.groupKey)||{isCompleted:!1};return e.jsx(r.PrimitiveMessagePart,{...m,children:e.jsx(H.DataSummaryGroup,{summaries:t.summaries||[],isCompleted:d.isCompleted})},`${t.groupKey}-${a}`)}default:return null}}),T&&e.jsx(Q.MessageLoading,{}),R&&e.jsx(V,{})]})};exports.EmbeddedChatMessagePart=Y;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),G=require("../../primitives/providers/base-events-provider.cjs"),K=require("../../primitives/providers/config-provider.cjs"),U=require("../../primitives/providers/message-provider.cjs"),c=require("../../primitives/components/embedded-chat.cjs"),W=require("../../primitives/components/embedded-chat/chat-provider.cjs"),B=require("merge-anything"),j=require("../utils.cjs"),H=require("./ui/markdown-styles.cjs"),Q=require("../../primitives/components/embedded-chat/use-stream-processor.cjs"),V=require("./data-summary-group.cjs"),p=require("react"),X=require("./embedded-chat.cjs"),y=require("lucide-react"),S=require("./ui/recipes/button.cjs");function Y(s){if(!s||typeof s!="object")return!1;const a=s;return typeof a.type=="string"&&a.type.startsWith("tool-")}const Z=()=>e.jsx("div",{className:"flex space-x-1",children:[0,1,2].map(s=>e.jsx("span",{className:"animate-bounce-dot opacity-30",style:{animationDelay:`${s*.2}s`},children:"."},s))}),D=({name:s,Icon:a,props:x,componentType:d})=>e.jsxs("div",{className:"border rounded-lg bg-gray-50 dark:bg-gray-dark-800 mb-3",children:[e.jsxs("div",{className:"flex justify-between px-4 py-2 text-xs",children:[e.jsxs("div",{className:"font-medium flex items-center gap-2",children:[e.jsx(a,{className:"w-3 h-3 text-gray-600 dark:text-white-alpha-600"}),e.jsx("span",{children:s})]}),e.jsx("div",{className:"flex items-center px-1.5 py-0.5 rounded-md text-2xs uppercase tracking-wider bg-gray-200 dark:bg-white-alpha-200 font-medium text-gray-700 dark:text-white-alpha-700 font-mono",children:d})]}),e.jsx("pre",{className:"whitespace-pre-wrap text-xs text-gray-700 dark:text-white-alpha-700 font-mono px-4 py-2",children:JSON.stringify(x,null,2)})]}),ee=({name:s,props:a})=>e.jsx(D,{name:s,Icon:y.ComponentIcon,props:a,componentType:"component"}),te=({name:s,props:a})=>e.jsx(D,{name:s,Icon:y.Library,props:a,componentType:"artifact"}),se=({part:s,onApprove:a,onDeny:x})=>{const d=s.type,g=d.startsWith("tool-")?d.slice(5):d,n=s.state;return e.jsxs("div",{className:"border rounded-lg mb-3",children:[e.jsxs("div",{className:"flex justify-between px-4 py-2 text-xs",children:[e.jsxs("div",{className:"font-medium flex items-center gap-2",children:[e.jsx(y.Hammer,{className:"w-3 h-3 text-gray-600 dark:text-white-alpha-600"}),e.jsx("span",{children:g})]}),e.jsx("div",{className:"flex items-center px-1.5 py-0.5 rounded-md text-2xs uppercase tracking-wider bg-gray-200 dark:bg-white-alpha-200 font-medium text-gray-700 dark:text-white-alpha-700 font-mono",children:n??"tool"})]}),e.jsxs("div",{className:"px-4 pb-3",children:[s.input!=null&&e.jsx("pre",{className:"whitespace-pre-wrap text-xs text-gray-700 dark:text-white-alpha-700 font-mono py-2",children:JSON.stringify(s.input,null,2)}),n==="approval-requested"&&s.approval?.id&&e.jsxs("div",{className:"flex gap-2 pt-1",children:[e.jsxs("button",{type:"button",className:j.cn(S.button({size:"xs",variant:"primaryFilled"}),"px-2 py-1 rounded-md text-xs gap-1"),onClick:a,children:[e.jsx(y.Check,{className:"w-3 h-3"}),"Approve"]}),e.jsx("button",{type:"button",className:j.cn(S.button({size:"xs",variant:"outline"}),"px-2 py-1 rounded-md text-xs text-gray-700 dark:text-white-alpha-700"),onClick:x,children:"Deny"})]}),n==="output-available"&&s.output!=null&&e.jsx("pre",{className:"whitespace-pre-wrap text-xs text-gray-700 dark:text-white-alpha-700 font-mono py-2",children:typeof s.output=="string"?s.output:JSON.stringify(s.output,null,2)})]})]})},ae=({className:s,componentStyles:a,children:x,isLast:d,...g})=>{const{message:n}=U.useMessage(),{logEvent:h}=G.useBaseEvents(),{conversationId:f,isStreaming:M,isLoading:q,setError:$,addToolApprovalResponse:E,sendMessage:I}=W.useChat(),{aiChatSettings:{components:L,artifacts:T}}=K.useInkeepConfig(),_=n.role==="user",A=(M||q)&&d&&n.role==="assistant",{processedParts:O,summaryTimings:R,shouldShowInitialLoading:J,shouldShowStreamDelayLoading:z}=Q.useStreamProcessor(n.parts,A,$),C=p.useMemo(()=>n.parts.filter(t=>t.type==="data-artifact"&&t.data?.type?.toLowerCase()==="citation"),[n.parts]),w=p.useMemo(()=>B.merge(H.markdownStyles,a??{}),[a]),k=p.useCallback((t,o)=>{h({eventName:"assistant_message_inline_link_opened",properties:{title:o?.toString(),url:t}})},[h]),N=p.useCallback((t,o)=>{h({eventName:"assistant_code_block_copied",properties:{conversationId:f,language:t,code:o}})},[h,f]),P=p.useCallback(t=>e.jsx(c.EmbeddedChatPrimitiveMarkdown,{text:t,componentStyles:w,onLinkClick:k,onCodeCopy:N,artifacts:C}),[w,k,N,C]),F=p.useMemo(()=>j.cn("data-[role=user]:whitespace-pre-wrap mb-3 data-[role=user]:mb-0 [&[data-role=user]>p]:mb-0 max-w-full",s),[s]);return e.jsxs(e.Fragment,{children:[O.map((t,o)=>{const l={"data-role":n.role,"data-type":t?.type==="data-component"?t.data.type:t?.type,...g,className:F};switch(t?.type){case"text":return e.jsx(c.PrimitiveMessagePart,{...l,children:_?t.text:P(t.text||"")},o);case"data-component":{const{type:r}=t.data;switch(r){case"text":return e.jsx("div",{...l,children:P(t.data.text||"")},o);default:{const m=t.data,{name:i,props:v}=m,u=L?.[i],b=u?c.EmbeddedChatPrimitiveDynamicComponent:ee;return e.jsx(c.PrimitiveMessagePart,{...l,children:e.jsx(b,{name:i,props:v,componentDef:u})},`${i}-${o}`)}}}case"data-artifact":{const r=t.data,{name:m,type:i,artifactSummary:v}=r,u=T?.[i],b=u?c.EmbeddedChatPrimitiveDynamicComponent:te;return e.jsx(c.PrimitiveMessagePart,{...l,children:e.jsx(b,{name:i,props:v,componentDef:u})},`${m}-${o}`)}case"summary-group":{const r=R.get(t.groupKey)||{isCompleted:!1};return e.jsx(c.PrimitiveMessagePart,{...l,children:e.jsx(V.DataSummaryGroup,{summaries:t.summaries||[],isCompleted:r.isCompleted})},`${t.groupKey}-${o}`)}default:if(Y(t)){const r=t.approval?.id,m=async i=>{r&&(E({id:r,approved:i}),await I(void 0,{body:{conversationId:f}}))};return e.jsx(c.PrimitiveMessagePart,{...l,children:e.jsx(se,{part:t,onApprove:r?()=>void m(!0):void 0,onDeny:r?()=>void m(!1):void 0})},t.toolCallId??`${t.type}-${o}`)}return null}}),J&&e.jsx(X.MessageLoading,{}),z&&e.jsx(Z,{})]})};exports.EmbeddedChatMessagePart=ae;
@@ -1,19 +1,25 @@
1
1
  "use client";
2
- import { jsx as t, jsxs as l, Fragment as J } from "react/jsx-runtime";
3
- import { useBaseEvents as O } from "../../primitives/providers/base-events-provider.js";
4
- import { useInkeepConfig as U } from "../../primitives/providers/config-provider.js";
5
- import { useMessage as q } from "../../primitives/providers/message-provider.js";
6
- import { EmbeddedChatPrimitiveMarkdown as z, PrimitiveMessagePart as d, EmbeddedChatPrimitiveDynamicComponent as S } from "../../primitives/components/embedded-chat.js";
7
- import { useChat as H } from "../../primitives/components/embedded-chat/chat-provider.js";
8
- import { merge as Q } from "merge-anything";
9
- import { cn as R } from "../utils.js";
10
- import { markdownStyles as V } from "./ui/markdown-styles.js";
11
- import { useStreamProcessor as W } from "../../primitives/components/embedded-chat/use-stream-processor.js";
12
- import { DataSummaryGroup as X } from "./data-summary-group.js";
13
- import { useMemo as h, useCallback as y } from "react";
14
- import { MessageLoading as Y } from "./embedded-chat.js";
15
- import { Library as Z, ComponentIcon as ee } from "lucide-react";
16
- const te = () => /* @__PURE__ */ t("div", { className: "flex space-x-1", children: [0, 1, 2].map((a) => /* @__PURE__ */ t(
2
+ import { jsx as e, jsxs as i, Fragment as B } from "react/jsx-runtime";
3
+ import { useBaseEvents as G } from "../../primitives/providers/base-events-provider.js";
4
+ import { useInkeepConfig as H } from "../../primitives/providers/config-provider.js";
5
+ import { useMessage as R } from "../../primitives/providers/message-provider.js";
6
+ import { EmbeddedChatPrimitiveMarkdown as Q, PrimitiveMessagePart as u, EmbeddedChatPrimitiveDynamicComponent as L } from "../../primitives/components/embedded-chat.js";
7
+ import { useChat as V } from "../../primitives/components/embedded-chat/chat-provider.js";
8
+ import { merge as X } from "merge-anything";
9
+ import { cn as C } from "../utils.js";
10
+ import { markdownStyles as Y } from "./ui/markdown-styles.js";
11
+ import { useStreamProcessor as Z } from "../../primitives/components/embedded-chat/use-stream-processor.js";
12
+ import { DataSummaryGroup as ee } from "./data-summary-group.js";
13
+ import { useMemo as v, useCallback as w } from "react";
14
+ import { MessageLoading as te } from "./embedded-chat.js";
15
+ import { Hammer as ae, Check as oe, Library as ne, ComponentIcon as se } from "lucide-react";
16
+ import { button as M } from "./ui/recipes/button.js";
17
+ function re(a) {
18
+ if (!a || typeof a != "object") return !1;
19
+ const o = a;
20
+ return typeof o.type == "string" && o.type.startsWith("tool-");
21
+ }
22
+ const ie = () => /* @__PURE__ */ e("div", { className: "flex space-x-1", children: [0, 1, 2].map((a) => /* @__PURE__ */ e(
17
23
  "span",
18
24
  {
19
25
  className: "animate-bounce-dot opacity-30",
@@ -23,120 +29,188 @@ const te = () => /* @__PURE__ */ t("div", { className: "flex space-x-1", childre
23
29
  children: "."
24
30
  },
25
31
  a
26
- )) }), N = ({ name: a, Icon: n, props: C, componentType: u }) => /* @__PURE__ */ l("div", { className: "border rounded-lg bg-gray-50 dark:bg-gray-dark-800 mb-3", children: [
27
- /* @__PURE__ */ l("div", { className: "flex justify-between px-4 py-2 text-xs", children: [
28
- /* @__PURE__ */ l("div", { className: "font-medium flex items-center gap-2", children: [
29
- /* @__PURE__ */ t(n, { className: "w-3 h-3 text-gray-600 dark:text-white-alpha-600" }),
30
- /* @__PURE__ */ t("span", { children: a })
32
+ )) }), P = ({ name: a, Icon: o, props: h, componentType: m }) => /* @__PURE__ */ i("div", { className: "border rounded-lg bg-gray-50 dark:bg-gray-dark-800 mb-3", children: [
33
+ /* @__PURE__ */ i("div", { className: "flex justify-between px-4 py-2 text-xs", children: [
34
+ /* @__PURE__ */ i("div", { className: "font-medium flex items-center gap-2", children: [
35
+ /* @__PURE__ */ e(o, { className: "w-3 h-3 text-gray-600 dark:text-white-alpha-600" }),
36
+ /* @__PURE__ */ e("span", { children: a })
31
37
  ] }),
32
- /* @__PURE__ */ t("div", { className: "flex items-center px-1.5 py-0.5 rounded-md text-2xs uppercase tracking-wider bg-gray-200 dark:bg-white-alpha-200 font-medium text-gray-700 dark:text-white-alpha-700 font-mono", children: u })
38
+ /* @__PURE__ */ e("div", { className: "flex items-center px-1.5 py-0.5 rounded-md text-2xs uppercase tracking-wider bg-gray-200 dark:bg-white-alpha-200 font-medium text-gray-700 dark:text-white-alpha-700 font-mono", children: m })
33
39
  ] }),
34
- /* @__PURE__ */ t("pre", { className: "whitespace-pre-wrap text-xs text-gray-700 dark:text-white-alpha-700 font-mono px-4 py-2", children: JSON.stringify(C, null, 2) })
35
- ] }), ae = ({ name: a, props: n }) => /* @__PURE__ */ t(N, { name: a, Icon: ee, props: n, componentType: "component" }), oe = ({ name: a, props: n }) => /* @__PURE__ */ t(N, { name: a, Icon: Z, props: n, componentType: "artifact" }), Ce = ({
40
+ /* @__PURE__ */ e("pre", { className: "whitespace-pre-wrap text-xs text-gray-700 dark:text-white-alpha-700 font-mono px-4 py-2", children: JSON.stringify(h, null, 2) })
41
+ ] }), le = ({ name: a, props: o }) => /* @__PURE__ */ e(P, { name: a, Icon: se, props: o, componentType: "component" }), me = ({ name: a, props: o }) => /* @__PURE__ */ e(P, { name: a, Icon: ne, props: o, componentType: "artifact" }), ce = ({ part: a, onApprove: o, onDeny: h }) => {
42
+ const m = a.type, f = m.startsWith("tool-") ? m.slice(5) : m, n = a.state;
43
+ return /* @__PURE__ */ i("div", { className: "border rounded-lg mb-3", children: [
44
+ /* @__PURE__ */ i("div", { className: "flex justify-between px-4 py-2 text-xs", children: [
45
+ /* @__PURE__ */ i("div", { className: "font-medium flex items-center gap-2", children: [
46
+ /* @__PURE__ */ e(ae, { className: "w-3 h-3 text-gray-600 dark:text-white-alpha-600" }),
47
+ /* @__PURE__ */ e("span", { children: f })
48
+ ] }),
49
+ /* @__PURE__ */ e("div", { className: "flex items-center px-1.5 py-0.5 rounded-md text-2xs uppercase tracking-wider bg-gray-200 dark:bg-white-alpha-200 font-medium text-gray-700 dark:text-white-alpha-700 font-mono", children: n ?? "tool" })
50
+ ] }),
51
+ /* @__PURE__ */ i("div", { className: "px-4 pb-3", children: [
52
+ a.input != null && /* @__PURE__ */ e("pre", { className: "whitespace-pre-wrap text-xs text-gray-700 dark:text-white-alpha-700 font-mono py-2", children: JSON.stringify(a.input, null, 2) }),
53
+ n === "approval-requested" && a.approval?.id && /* @__PURE__ */ i("div", { className: "flex gap-2 pt-1", children: [
54
+ /* @__PURE__ */ i(
55
+ "button",
56
+ {
57
+ type: "button",
58
+ className: C(
59
+ M({ size: "xs", variant: "primaryFilled" }),
60
+ "px-2 py-1 rounded-md text-xs gap-1"
61
+ ),
62
+ onClick: o,
63
+ children: [
64
+ /* @__PURE__ */ e(oe, { className: "w-3 h-3" }),
65
+ "Approve"
66
+ ]
67
+ }
68
+ ),
69
+ /* @__PURE__ */ e(
70
+ "button",
71
+ {
72
+ type: "button",
73
+ className: C(
74
+ M({ size: "xs", variant: "outline" }),
75
+ "px-2 py-1 rounded-md text-xs text-gray-700 dark:text-white-alpha-700"
76
+ ),
77
+ onClick: h,
78
+ children: "Deny"
79
+ }
80
+ )
81
+ ] }),
82
+ n === "output-available" && a.output != null && /* @__PURE__ */ e("pre", { className: "whitespace-pre-wrap text-xs text-gray-700 dark:text-white-alpha-700 font-mono py-2", children: typeof a.output == "string" ? a.output : JSON.stringify(a.output, null, 2) })
83
+ ] })
84
+ ] });
85
+ }, Se = ({
36
86
  className: a,
37
- componentStyles: n,
38
- children: C,
39
- isLast: u,
40
- ...L
87
+ componentStyles: o,
88
+ children: h,
89
+ isLast: m,
90
+ ...f
41
91
  }) => {
42
- const { message: s } = q(), { logEvent: p } = O(), { conversationId: x, isStreaming: M, isLoading: P, setError: E } = H(), {
43
- aiChatSettings: { components: _, artifacts: $ }
44
- } = U(), I = s.role === "user", T = (M || P) && u && s.role === "assistant", { processedParts: j, summaryTimings: K, shouldShowInitialLoading: A, shouldShowStreamDelayLoading: B } = W(s.parts, T, E), w = h(
45
- () => s.parts.filter(
46
- (e) => e.type === "data-artifact" && e.data?.type?.toLowerCase() === "citation"
92
+ const { message: n } = R(), { logEvent: y } = G(), { conversationId: g, isStreaming: I, isLoading: $, setError: T, addToolApprovalResponse: E, sendMessage: _ } = V(), {
93
+ aiChatSettings: { components: j, artifacts: A }
94
+ } = H(), J = n.role === "user", O = (I || $) && m && n.role === "assistant", { processedParts: z, summaryTimings: F, shouldShowInitialLoading: K, shouldShowStreamDelayLoading: U } = Z(n.parts, O, T), b = v(
95
+ () => n.parts.filter(
96
+ (t) => t.type === "data-artifact" && t.data?.type?.toLowerCase() === "citation"
47
97
  ),
48
- [s.parts]
49
- ), b = h(
50
- () => Q(V, n ?? {}),
51
- [n]
52
- ), k = y(
53
- (e, o) => {
54
- p({
98
+ [n.parts]
99
+ ), k = v(
100
+ () => X(Y, o ?? {}),
101
+ [o]
102
+ ), N = w(
103
+ (t, s) => {
104
+ y({
55
105
  eventName: "assistant_message_inline_link_opened",
56
106
  properties: {
57
- title: o?.toString(),
58
- url: e
107
+ title: s?.toString(),
108
+ url: t
59
109
  }
60
110
  });
61
111
  },
62
- [p]
63
- ), D = y(
64
- (e, o) => {
65
- p({
112
+ [y]
113
+ ), D = w(
114
+ (t, s) => {
115
+ y({
66
116
  eventName: "assistant_code_block_copied",
67
117
  properties: {
68
- conversationId: x,
69
- language: e,
70
- code: o
118
+ conversationId: g,
119
+ language: t,
120
+ code: s
71
121
  }
72
122
  });
73
123
  },
74
- [p, x]
75
- ), v = y(
76
- (e) => /* @__PURE__ */ t(
77
- z,
124
+ [y, g]
125
+ ), S = w(
126
+ (t) => /* @__PURE__ */ e(
127
+ Q,
78
128
  {
79
- text: e,
80
- componentStyles: b,
81
- onLinkClick: k,
129
+ text: t,
130
+ componentStyles: k,
131
+ onLinkClick: N,
82
132
  onCodeCopy: D,
83
- artifacts: w
133
+ artifacts: b
84
134
  }
85
135
  ),
86
- [b, k, D, w]
87
- ), F = h(
88
- () => R(
136
+ [k, N, D, b]
137
+ ), W = v(
138
+ () => C(
89
139
  "data-[role=user]:whitespace-pre-wrap mb-3 data-[role=user]:mb-0 [&[data-role=user]>p]:mb-0 max-w-full",
90
140
  a
91
141
  ),
92
142
  [a]
93
143
  );
94
- return /* @__PURE__ */ l(J, { children: [
95
- j.map((e, o) => {
96
- const i = {
97
- "data-role": s.role,
98
- "data-type": e?.type === "data-component" ? e.data.type : e?.type,
99
- ...L,
100
- className: F
144
+ return /* @__PURE__ */ i(B, { children: [
145
+ z.map((t, s) => {
146
+ const c = {
147
+ "data-role": n.role,
148
+ "data-type": t?.type === "data-component" ? t.data.type : t?.type,
149
+ ...f,
150
+ className: W
101
151
  };
102
- switch (e?.type) {
152
+ switch (t?.type) {
103
153
  case "text":
104
- return /* @__PURE__ */ t(d, { ...i, children: I ? e.text : v(e.text || "") }, o);
154
+ return /* @__PURE__ */ e(u, { ...c, children: J ? t.text : S(t.text || "") }, s);
105
155
  case "data-component": {
106
- const { type: m } = e.data;
107
- switch (m) {
156
+ const { type: r } = t.data;
157
+ switch (r) {
108
158
  case "text":
109
- return /* @__PURE__ */ t("div", { ...i, children: v(e.data.text || "") }, o);
159
+ return /* @__PURE__ */ e("div", { ...c, children: S(t.data.text || "") }, s);
110
160
  default: {
111
- const g = e.data, { name: r, props: f } = g, c = _?.[r];
112
- return /* @__PURE__ */ t(d, { ...i, children: /* @__PURE__ */ t(c ? S : ae, { name: r, props: f, componentDef: c }) }, `${r}-${o}`);
161
+ const d = t.data, { name: l, props: x } = d, p = j?.[l];
162
+ return /* @__PURE__ */ e(u, { ...c, children: /* @__PURE__ */ e(p ? L : le, { name: l, props: x, componentDef: p }) }, `${l}-${s}`);
113
163
  }
114
164
  }
115
165
  }
116
166
  case "data-artifact": {
117
- const m = e.data, { name: g, type: r, artifactSummary: f } = m, c = $?.[r];
118
- return /* @__PURE__ */ t(d, { ...i, children: /* @__PURE__ */ t(c ? S : oe, { name: r, props: f, componentDef: c }) }, `${g}-${o}`);
167
+ const r = t.data, { name: d, type: l, artifactSummary: x } = r, p = A?.[l];
168
+ return /* @__PURE__ */ e(u, { ...c, children: /* @__PURE__ */ e(p ? L : me, { name: l, props: x, componentDef: p }) }, `${d}-${s}`);
119
169
  }
120
170
  case "summary-group": {
121
- const m = K.get(e.groupKey) || {
171
+ const r = F.get(t.groupKey) || {
122
172
  isCompleted: !1
123
173
  };
124
- return /* @__PURE__ */ t(d, { ...i, children: /* @__PURE__ */ t(
125
- X,
174
+ return /* @__PURE__ */ e(u, { ...c, children: /* @__PURE__ */ e(
175
+ ee,
126
176
  {
127
- summaries: e.summaries || [],
128
- isCompleted: m.isCompleted
177
+ summaries: t.summaries || [],
178
+ isCompleted: r.isCompleted
129
179
  }
130
- ) }, `${e.groupKey}-${o}`);
180
+ ) }, `${t.groupKey}-${s}`);
131
181
  }
132
182
  default:
183
+ if (re(t)) {
184
+ const r = t.approval?.id, d = async (l) => {
185
+ r && (E({ id: r, approved: l }), await _(void 0, {
186
+ body: {
187
+ conversationId: g
188
+ }
189
+ }));
190
+ };
191
+ return /* @__PURE__ */ e(
192
+ u,
193
+ {
194
+ ...c,
195
+ children: /* @__PURE__ */ e(
196
+ ce,
197
+ {
198
+ part: t,
199
+ onApprove: r ? () => void d(!0) : void 0,
200
+ onDeny: r ? () => void d(!1) : void 0
201
+ }
202
+ )
203
+ },
204
+ t.toolCallId ?? `${t.type}-${s}`
205
+ );
206
+ }
133
207
  return null;
134
208
  }
135
209
  }),
136
- A && /* @__PURE__ */ t(Y, {}),
137
- B && /* @__PURE__ */ t(te, {})
210
+ K && /* @__PURE__ */ e(te, {}),
211
+ U && /* @__PURE__ */ e(ie, {})
138
212
  ] });
139
213
  };
140
214
  export {
141
- Ce as EmbeddedChatMessagePart
215
+ Se as EmbeddedChatMessagePart
142
216
  };
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("class-variance-authority"),a=e.cva(["inline-flex","items-center","justify-center","align-middle","select-none","relative","whitespace-nowrap","appearance-none","rounded-md","leading-[1.2]","transition-all","duration-300","cursor-pointer","font-semibold","focus:outline-none","focus:z-base","focus-visible:ring","focus-visible:ring-gray-500","dark:focus-visible:ring-white-alpha-900","focus-visible:ring-2","disabled:opacity-40","disabled:cursor-not-allowed","disabled:shadow-none"],{variants:{variant:{solid:["bg-gray-100 dark:bg-white-alpha-100","text-gray-800 dark:text-white-alpha-950","hover:bg-gray-200 dark:hover:bg-white-alpha-200","hover:disabled:bg-gray-100 dark:hover:disabled:bg-white-alpha-100","active:bg-gray-300 dark:active:bg-white-alpha-400"],iconButton:["px-1 text-gray-500 text-md","hover:text-inkeep-primary-strong","dark:text-gray-dark-200","dark:hover:text-inkeep-expanded-primary-300"],ghost:["text-gray-800 dark:text-white-alpha-950","hover:bg-gray-100 dark:hover:bg-white-alpha-100","active:bg-gray-200 dark:active:bg-white-alpha-200"],outline:["border dark:border-white-alpha-200","text-gray-600 dark:text-gray-200","hover:bg-gray-50 dark:hover:bg-white-alpha-100","active:bg-gray-50 dark:active:bg-white-alpha-100"]},size:{sm:"h-8 min-w-8 text-sm px-3",md:"h-9 min-w-9 text-sm px-4",xs:"h-6 min-w-6 text-xs px-2"},preset:{neutralFilled:["bg-gray-1000 text-white hover:bg-gray-900 active:bg-gray-900","dark:bg-inkeep-expanded-primary-300 dark:text-gray-dark-950","dark:hover:bg-inkeep-expanded-primary-200","dark:active:bg-inkeep-expanded-primary-200"]}},defaultVariants:{size:"md"}});exports.button=a;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("class-variance-authority"),a=e.cva(["inline-flex","items-center","justify-center","align-middle","select-none","relative","whitespace-nowrap","appearance-none","rounded-md","leading-[1.2]","transition-all","duration-300","cursor-pointer","font-semibold","focus:outline-none","focus:z-base","focus-visible:ring","focus-visible:ring-gray-500","dark:focus-visible:ring-white-alpha-900","focus-visible:ring-2","disabled:opacity-40","disabled:cursor-not-allowed","disabled:shadow-none"],{variants:{variant:{solid:["bg-gray-100 dark:bg-white-alpha-100","text-gray-800 dark:text-white-alpha-950","hover:bg-gray-200 dark:hover:bg-white-alpha-200","hover:disabled:bg-gray-100 dark:hover:disabled:bg-white-alpha-100","active:bg-gray-300 dark:active:bg-white-alpha-400"],iconButton:["px-1 text-gray-500 text-md","hover:text-inkeep-primary-strong","dark:text-gray-dark-200","dark:hover:text-inkeep-expanded-primary-300"],ghost:["text-gray-800 dark:text-white-alpha-950","hover:bg-gray-100 dark:hover:bg-white-alpha-100","active:bg-gray-200 dark:active:bg-white-alpha-200"],outline:["border dark:border-white-alpha-200","text-gray-600 dark:text-gray-200","hover:bg-gray-50 dark:hover:bg-white-alpha-100","active:bg-gray-50 dark:active:bg-white-alpha-100"],primaryFilled:["bg-inkeep-expanded-primary-500 text-inkeep-primary-text-color-on-primary hover:bg-inkeep-expanded-primary-700 active:bg-inkeep-expanded-primary-700","dark:bg-inkeep-expanded-primary-300 dark:text-gray-dark-950","dark:hover:bg-inkeep-expanded-primary-200","dark:active:bg-inkeep-expanded-primary-200"]},size:{sm:"h-8 min-w-8 text-sm px-3",md:"h-9 min-w-9 text-sm px-4",xs:"h-6 min-w-6 text-xs px-2"},preset:{neutralFilled:["bg-gray-1000 text-white hover:bg-gray-900 active:bg-gray-900","dark:bg-inkeep-expanded-primary-300 dark:text-gray-dark-950","dark:hover:bg-inkeep-expanded-primary-200","dark:active:bg-inkeep-expanded-primary-200"]}},defaultVariants:{size:"md"}});exports.button=a;
@@ -1,6 +1,6 @@
1
1
  import { ClassProp } from 'class-variance-authority/types';
2
2
  export declare const button: (props?: ({
3
- variant?: "solid" | "iconButton" | "ghost" | "outline" | null | undefined;
3
+ variant?: "solid" | "iconButton" | "ghost" | "outline" | "primaryFilled" | null | undefined;
4
4
  size?: "sm" | "md" | "xs" | null | undefined;
5
5
  preset?: "neutralFilled" | null | undefined;
6
6
  } & ClassProp) | undefined) => string;
@@ -55,6 +55,12 @@ const r = e(
55
55
  "text-gray-600 dark:text-gray-200",
56
56
  "hover:bg-gray-50 dark:hover:bg-white-alpha-100",
57
57
  "active:bg-gray-50 dark:active:bg-white-alpha-100"
58
+ ],
59
+ primaryFilled: [
60
+ "bg-inkeep-expanded-primary-500 text-inkeep-primary-text-color-on-primary hover:bg-inkeep-expanded-primary-700 active:bg-inkeep-expanded-primary-700",
61
+ "dark:bg-inkeep-expanded-primary-300 dark:text-gray-dark-950",
62
+ "dark:hover:bg-inkeep-expanded-primary-200",
63
+ "dark:active:bg-inkeep-expanded-primary-200"
58
64
  ]
59
65
  },
60
66
  size: {
@@ -1456,6 +1456,9 @@ video {
1456
1456
  .bg-inherit {
1457
1457
  background-color: inherit;
1458
1458
  }
1459
+ .bg-inkeep-expanded-primary-500 {
1460
+ background-color: var(--ikp-color-inkeep-expanded-primary-500);
1461
+ }
1459
1462
  .bg-inkeep-primary-medium {
1460
1463
  background-color: var(--ikp-color-inkeep-primary-medium);
1461
1464
  }
@@ -2448,6 +2451,10 @@ slot {
2448
2451
  background-color: var(--ikp-color-gray-900);
2449
2452
  }
2450
2453
 
2454
+ .active\\:bg-inkeep-expanded-primary-700:active {
2455
+ background-color: var(--ikp-color-inkeep-expanded-primary-700);
2456
+ }
2457
+
2451
2458
  .active\\:transition-transform:active {
2452
2459
  transition-property: transform;
2453
2460
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
@@ -3107,6 +3114,10 @@ slot {
3107
3114
  background-color: var(--ikp-color-gray-900);
3108
3115
  }
3109
3116
 
3117
+ .hover\\:bg-inkeep-expanded-primary-700:hover:not(:disabled) {
3118
+ background-color: var(--ikp-color-inkeep-expanded-primary-700);
3119
+ }
3120
+
3110
3121
  .hover\\:bg-inkeep-primary-light-subtle:hover:not(:disabled) {
3111
3122
  background-color: var(--ikp-color-inkeep-primary-light-subtle);
3112
3123
  }
@@ -1457,6 +1457,9 @@ video {
1457
1457
  .bg-inherit {
1458
1458
  background-color: inherit;
1459
1459
  }
1460
+ .bg-inkeep-expanded-primary-500 {
1461
+ background-color: var(--ikp-color-inkeep-expanded-primary-500);
1462
+ }
1460
1463
  .bg-inkeep-primary-medium {
1461
1464
  background-color: var(--ikp-color-inkeep-primary-medium);
1462
1465
  }
@@ -2449,6 +2452,10 @@ slot {
2449
2452
  background-color: var(--ikp-color-gray-900);
2450
2453
  }
2451
2454
 
2455
+ .active\\:bg-inkeep-expanded-primary-700:active {
2456
+ background-color: var(--ikp-color-inkeep-expanded-primary-700);
2457
+ }
2458
+
2452
2459
  .active\\:transition-transform:active {
2453
2460
  transition-property: transform;
2454
2461
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
@@ -3108,6 +3115,10 @@ slot {
3108
3115
  background-color: var(--ikp-color-gray-900);
3109
3116
  }
3110
3117
 
3118
+ .hover\\:bg-inkeep-expanded-primary-700:hover:not(:disabled) {
3119
+ background-color: var(--ikp-color-inkeep-expanded-primary-700);
3120
+ }
3121
+
3111
3122
  .hover\\:bg-inkeep-primary-light-subtle:hover:not(:disabled) {
3112
3123
  background-color: var(--ikp-color-inkeep-primary-light-subtle);
3113
3124
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inkeep/agents-ui",
3
- "version": "0.15.7",
3
+ "version": "0.15.9",
4
4
  "description": "",
5
5
  "homepage": "",
6
6
  "repository": {
@@ -38,9 +38,8 @@
38
38
  },
39
39
  "sideEffects": false,
40
40
  "dependencies": {
41
- "@ai-sdk/openai": "2.0.4",
42
- "@ai-sdk/react": "2.0.5",
43
- "@ai-sdk/ui-utils": "^1.2.11",
41
+ "@ai-sdk/openai": "3.0.14",
42
+ "@ai-sdk/react": "3.0.46",
44
43
  "@radix-ui/number": "^1.1.1",
45
44
  "@radix-ui/primitive": "^1.1.1",
46
45
  "@radix-ui/react-avatar": "1.1.2",
@@ -70,7 +69,7 @@
70
69
  "@zag-js/presence": "^1.13.1",
71
70
  "@zag-js/react": "^1.13.1",
72
71
  "@zag-js/remove-scroll": "^1.26.2",
73
- "ai": "5.0.5",
72
+ "ai": "6.0.44",
74
73
  "altcha-lib": "^1.2.0",
75
74
  "aria-hidden": "^1.2.4",
76
75
  "class-variance-authority": "0.7.1",