@inkeep/agents-ui 0.16.0 → 0.16.2
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/color-mode/index.js +4 -4
- package/dist/index.cjs +1 -1
- package/dist/index.js +167 -161
- package/dist/node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.3.0-canary-87ae75b3-20260128/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.cjs +9 -0
- package/dist/node_modules/.pnpm/{use-sync-external-store@1.5.0_react@19.0.0 → use-sync-external-store@1.6.0_react@19.3.0-canary-87ae75b3-20260128}/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +2 -2
- package/dist/primitives/atoms/cmdk/index.cjs +1 -1
- package/dist/primitives/atoms/cmdk/index.js +14 -2
- package/dist/primitives/atoms/combobox.d.ts +104 -0
- package/dist/primitives/atoms/icons/built-in-icons.cjs +1 -1
- package/dist/primitives/atoms/icons/built-in-icons.d.ts +4 -1
- package/dist/primitives/atoms/icons/built-in-icons.js +94 -91
- package/dist/primitives/atoms/icons/collections/pi.cjs +1 -1
- package/dist/primitives/atoms/icons/collections/pi.d.ts +3 -0
- package/dist/primitives/atoms/icons/collections/pi.js +82 -37
- package/dist/primitives/atoms/icons/inkeep-default-icons.cjs +1 -1
- package/dist/primitives/atoms/icons/inkeep-default-icons.js +4 -1
- package/dist/primitives/atoms/portal.js +3 -3
- package/dist/primitives/atoms/select.cjs +1 -1
- package/dist/primitives/atoms/select.js +2 -2
- package/dist/primitives/atoms/shadow/context.js +4 -4
- package/dist/primitives/components/embedded-chat/chat-error-helpers.cjs +3 -0
- package/dist/primitives/components/embedded-chat/chat-error-helpers.d.ts +26 -0
- package/dist/primitives/components/embedded-chat/chat-error-helpers.js +32 -0
- package/dist/primitives/components/embedded-chat/file-upload-input.cjs +1 -1
- package/dist/primitives/components/embedded-chat/file-upload-input.d.ts +1 -2
- package/dist/primitives/components/embedded-chat/file-upload-input.js +359 -217
- package/dist/primitives/components/embedded-chat/image-preview-modal.js +3 -3
- package/dist/primitives/components/embedded-chat/use-chat-action.cjs +1 -1
- package/dist/primitives/components/embedded-chat/use-chat-action.js +16 -14
- package/dist/primitives/components/embedded-chat/use-inkeep-chat.cjs +2 -4
- package/dist/primitives/components/embedded-chat/use-inkeep-chat.d.ts +1 -2
- package/dist/primitives/components/embedded-chat/use-inkeep-chat.js +312 -284
- package/dist/primitives/components/embedded-chat/use-stream-processor.cjs +1 -1
- package/dist/primitives/components/embedded-chat/use-stream-processor.js +1 -1
- package/dist/primitives/components/embedded-chat.cjs +3 -3
- package/dist/primitives/components/embedded-chat.d.ts +2 -3
- package/dist/primitives/components/embedded-chat.js +122 -114
- package/dist/primitives/components/embedded-search/search-provider.js +3 -3
- package/dist/primitives/components/embedded-search.cjs +1 -1
- package/dist/primitives/components/embedded-search.d.ts +1 -1
- package/dist/primitives/components/embedded-search.js +3 -3
- package/dist/primitives/components/modal/modal-provider.js +2 -2
- package/dist/primitives/components/modal.js +3 -3
- package/dist/primitives/components/sidebar-chat/index.js +1 -1
- package/dist/primitives/components/tagline-logo-icon.js +50 -9
- package/dist/primitives/hooks/use-events-api.cjs +1 -0
- package/dist/primitives/hooks/use-events-api.d.ts +29 -0
- package/dist/primitives/hooks/use-events-api.js +43 -0
- package/dist/primitives/hooks/use-initial-conversation.js +4 -1
- package/dist/primitives/hooks/use-input-notification.js +9 -9
- package/dist/primitives/index.cjs +1 -1
- package/dist/primitives/index.js +150 -144
- package/dist/primitives/providers/base-events-provider.cjs +1 -1
- package/dist/primitives/providers/base-events-provider.d.ts +2 -0
- package/dist/primitives/providers/base-events-provider.js +23 -22
- package/dist/primitives/providers/chat-auth-provider.cjs +1 -0
- package/dist/primitives/providers/chat-auth-provider.d.ts +27 -0
- package/dist/primitives/providers/chat-auth-provider.js +46 -0
- package/dist/primitives/providers/chat-base-events-provider.cjs +1 -0
- package/dist/primitives/providers/chat-base-events-provider.d.ts +12 -0
- package/dist/primitives/providers/chat-base-events-provider.js +73 -0
- package/dist/primitives/providers/chat-bubble-provider.js +1 -1
- package/dist/primitives/providers/chat-form-provider.d.ts +1 -1
- package/dist/primitives/providers/chat-form-provider.js +4 -4
- package/dist/primitives/providers/chat-history-provider.js +3 -3
- package/dist/primitives/providers/config-provider.js +3 -3
- package/dist/primitives/providers/feedback-provider.cjs +1 -1
- package/dist/primitives/providers/feedback-provider.js +37 -31
- package/dist/primitives/providers/form-field-provider.js +3 -3
- package/dist/primitives/providers/help-menu-provider.js +4 -4
- package/dist/primitives/providers/hover-popover-provider.js +3 -3
- package/dist/primitives/providers/image-preview-provider.js +5 -5
- package/dist/primitives/providers/index.cjs +1 -1
- package/dist/primitives/providers/index.d.ts +2 -0
- package/dist/primitives/providers/index.js +57 -51
- package/dist/primitives/providers/markdown-provider.js +2 -2
- package/dist/primitives/providers/message-provider.js +1 -1
- package/dist/primitives/providers/sidebar-chat-provider.js +3 -3
- package/dist/primitives/providers/source-item-provider.js +3 -3
- package/dist/primitives/providers/widget-provider.js +2 -2
- package/dist/primitives/utils/misc.cjs +1 -1
- package/dist/primitives/utils/misc.js +2 -2
- package/dist/react/chat-button.js +1 -1
- package/dist/react/embedded-chat.cjs +1 -1
- package/dist/react/embedded-chat.js +104 -102
- package/dist/react/embedded-search.cjs +1 -1
- package/dist/react/embedded-search.js +18 -18
- package/dist/react/index.cjs +1 -1
- package/dist/react/index.js +167 -161
- package/dist/styled/components/chat-bubble.js +4 -4
- package/dist/styled/components/chat-button.cjs +1 -1
- package/dist/styled/components/chat-button.js +9 -9
- package/dist/styled/components/chat-history.cjs +1 -1
- package/dist/styled/components/chat-history.js +22 -22
- package/dist/styled/components/embedded-chat/file-upload-input.cjs +1 -1
- package/dist/styled/components/embedded-chat/file-upload-input.js +71 -72
- package/dist/styled/components/embedded-chat/image-preview-modal.js +14 -7
- package/dist/styled/components/embedded-chat.cjs +1 -1
- package/dist/styled/components/embedded-chat.js +211 -199
- package/dist/styled/components/embedded-search.cjs +1 -1
- package/dist/styled/components/embedded-search.js +72 -66
- package/dist/styled/components/loading-indicator.cjs +1 -1
- package/dist/styled/components/loading-indicator.js +1 -1
- package/dist/styled/components/message.cjs +1 -1
- package/dist/styled/components/message.js +142 -139
- package/dist/styled/components/modal.js +3 -3
- package/dist/styled/components/searchbar.js +8 -8
- package/dist/styled/components/sidebar-chat.cjs +1 -1
- package/dist/styled/components/sidebar-chat.js +5 -5
- package/dist/styled/index.cjs +1 -1
- package/dist/styled/index.js +155 -149
- package/dist/styled/inkeep.css.cjs +13 -3
- package/dist/styled/inkeep.css.js +13 -3
- package/dist/theme/utils/generate-theme-variables.js +6 -6
- package/dist/types/config/ai.d.ts +5 -0
- package/dist/types/events.d.ts +11 -0
- package/dist/types/icons/built-in.d.ts +1 -1
- package/dist/types/icons/custom.d.ts +3 -0
- package/package.json +2 -2
- package/dist/node_modules/.pnpm/use-sync-external-store@1.5.0_react@19.0.0/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.cjs +0 -9
- /package/dist/node_modules/.pnpm/{use-sync-external-store@1.5.0_react@19.0.0 → use-sync-external-store@1.6.0_react@19.3.0-canary-87ae75b3-20260128}/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.cjs +0 -0
- /package/dist/node_modules/.pnpm/{use-sync-external-store@1.5.0_react@19.0.0 → use-sync-external-store@1.6.0_react@19.3.0-canary-87ae75b3-20260128}/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +0 -0
- /package/dist/node_modules/.pnpm/{use-sync-external-store@1.5.0_react@19.0.0 → use-sync-external-store@1.6.0_react@19.3.0-canary-87ae75b3-20260128}/node_modules/use-sync-external-store/shim/index.cjs +0 -0
- /package/dist/node_modules/.pnpm/{use-sync-external-store@1.5.0_react@19.0.0 → use-sync-external-store@1.6.0_react@19.3.0-canary-87ae75b3-20260128}/node_modules/use-sync-external-store/shim/index.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),te=require("../../primitives/providers/base-events-provider.cjs"),ae=require("../../primitives/providers/config-provider.cjs"),re=require("../../primitives/providers/message-provider.cjs"),C=require("../../primitives/components/embedded-chat.cjs"),se=require("../../primitives/components/embedded-chat/chat-provider.cjs"),ne=require("../../primitives/utils/misc.cjs"),oe=require("merge-anything"),b=require("../utils.cjs"),ie=require("./ui/markdown-styles.cjs"),le=require("../../primitives/components/embedded-chat/use-stream-processor.cjs"),ce=require("./data-summary-group.cjs"),o=require("react"),T=require("./embedded-chat.cjs"),c=require("lucide-react"),U=require("./ui/recipes/button.cjs"),de={"input-streaming":"Pending","input-available":"Running","approval-requested":"Awaiting Approval","approval-responded":"Responded","output-available":"Completed","output-error":"Error","output-denied":"Denied"};function pe(t){if(!t||typeof t!="object")return!1;const a=t;return typeof a.type=="string"&&a.type.startsWith("tool-")}const ue=t=>{if(!t||typeof t!="object"||!("status"in t))return;const a=t.status;return typeof a=="string"?a:void 0},xe=()=>e.jsx("div",{className:"flex space-x-1",children:[0,1,2].map(t=>e.jsx("span",{className:"animate-bounce-dot opacity-30",style:{animationDelay:`${t*.2}s`},children:"."},t))}),V=({name:t,Icon:a,props:i,componentType:n})=>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:t})]}),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})]}),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(i,null,2)})]}),me=({name:t,props:a})=>e.jsx(V,{name:t,Icon:c.ComponentIcon,props:a,componentType:"component"}),he=({name:t,props:a})=>e.jsx(V,{name:t,Icon:c.Library,props:a,componentType:"artifact"}),fe=({tool:t,componentDef:a,renderText:i,approvalId:n,messagePartsLength:m,setApprovalDelayPending:s,addToolApprovalResponse:u,sendMessage:d,conversationId:g})=>{const l=o.useRef(d);l.current=d;const x=o.useRef(u);x.current=u;const p=o.useRef(s);p.current=s;const h=o.useCallback(async(E=!0)=>{n&&(p.current({partCount:m}),x.current({id:n,approved:E}),await l.current(void 0,{body:{conversationId:g}}))},[n,m,g]),k=o.useMemo(()=>({tool:t,approve:h,renderMarkdown:i}),[t]),A=a?T.DynamicComponent:G;return e.jsx(A,{name:t.type,props:k,componentDef:a})};function B(t){return t===null?e.jsx("span",{className:"text-gray-500 dark:text-white-alpha-500 font-mono font-medium text-1xs",children:"null"}):t===void 0?e.jsx("span",{className:"text-gray-400 dark:text-white-alpha-400 italic text-xs font-medium",children:"undefined"}):typeof t=="boolean"?e.jsx("span",{className:b.cn("inline-flex font-mono font-semibold items-center px-1 py-0.5 text-1xs rounded-md border",t?"bg-inkeep-expanded-primary-50 border-inkeep-expanded-primary-200 text-inkeep-expanded-primary-600 dark:bg-inkeep-expanded-primary-950 dark:border-inkeep-expanded-primary-600 dark:text-inkeep-expanded-primary-200":"bg-gray-100 dark:bg-white-alpha-50 text-gray-700 dark:text-white-alpha-700"),children:t?"true":"false"}):typeof t=="number"?e.jsx("span",{className:"tabular-nums font-medium text-inkeep-expanded-primary-600 dark:text-inkeep-expanded-primary-200",children:t.toLocaleString()}):typeof t=="string"?e.jsx("span",{className:"text-gray-800 dark:text-white-alpha-800 break-words",children:t}):e.jsx("span",{children:String(t)})}const F=({name:t,value:a,isArrayIndex:i,depth:n=0})=>{const[m,s]=o.useState(n<1),u=a!==null&&typeof a=="object"&&!Array.isArray(a),d=Array.isArray(a);if(!(u||d))return e.jsxs("div",{className:"flex items-baseline gap-2 py-1 text-xs",children:[e.jsx("span",{className:b.cn("font-medium shrink-0",i?"text-gray-300 dark:text-white-alpha-300":"text-gray-500 dark:text-white-alpha-500"),children:i?"—":t}),e.jsx("span",{className:"min-w-0",children:B(a)})]});const l=d?a.map((p,h)=>[String(h),p]):Object.entries(a);return l.length===0?e.jsxs("div",{className:"flex items-baseline gap-2 py-1 text-xs",children:[e.jsx("span",{className:"font-medium text-gray-500 dark:text-white-alpha-500 shrink-0",children:t}),e.jsx("span",{className:"text-gray-400 dark:text-white-alpha-400 italic",children:d?"empty list":"empty"})]}):e.jsxs("div",{children:[e.jsxs("button",{type:"button",onClick:p=>{p.stopPropagation(),s(!m)},className:"flex items-center gap-1.5 py-1 text-xs hover:bg-gray-50 dark:hover:bg-white-alpha-50 -mx-1.5 px-1.5 rounded transition-colors w-full text-left",children:[e.jsx(c.ChevronDown,{className:b.cn("h-3.5 w-3.5 text-gray-400 dark:text-white-alpha-400 shrink-0 transition-transform",!m&&"-rotate-90")}),e.jsx("span",{className:"font-medium text-gray-500 dark:text-white-alpha-500",children:t}),!m&&e.jsx("span",{className:"text-gray-400 dark:text-white-alpha-400 text-1xs ml-1",children:d?`${l.length} item${l.length!==1?"s":""}`:`${l.length} field${l.length!==1?"s":""}`})]}),m&&e.jsx("div",{className:"border-l-2 border-gray-200 dark:border-white-alpha-200 ml-1.5 pl-3",children:l.map(([p,h])=>e.jsx(F,{name:p,value:h,isArrayIndex:d,depth:n+1},p))})]})},ge=({value:t})=>{if(t==null||typeof t!="object")return e.jsx("span",{className:"text-xs",children:B(t)});const a=Array.isArray(t)?t.map((i,n)=>[String(n),i]):Object.entries(t);return a.length===0?e.jsx("div",{className:"text-xs text-gray-400 dark:text-white-alpha-400 italic",children:"No arguments"}):e.jsx("div",{className:"space-y-1",children:a.map(([i,n])=>e.jsx(F,{name:i,value:n,isArrayIndex:Array.isArray(t)},i))})},G=({props:t})=>{const{tool:a,approve:i}=t,n=a.type,m=n.startsWith("tool-")?n.slice(5):n,s=a.state,u=a.approval?.id,d=!!u,g=s==="approval-requested",l=ue(a.output),[x,p]=o.useState(d),h=s?de[s]??s:"tool";o.useEffect(()=>{g&&p(!0)},[g]);const k=()=>{switch(s){case"input-streaming":return e.jsx(c.Circle,{className:"w-3 h-3"});case"input-available":return e.jsx(c.Loader2,{className:"w-3 h-3 animate-spin"});case"approval-requested":return e.jsx(c.Clock,{className:"w-3 h-3"});case"approval-responded":return e.jsx(c.CheckCircle,{className:"w-3 h-3"});case"output-available":return e.jsx(c.CheckCircle,{className:"w-3 h-3"});case"output-error":return e.jsx(c.TriangleAlert,{className:"w-3 h-3"});case"output-denied":return e.jsx(c.XCircle,{className:"w-3 h-3"});default:return null}};return e.jsxs("div",{className:"border rounded-lg mb-3 overflow-hidden",children:[e.jsxs("button",{type:"button",className:"inline-flex items-center group gap-2 text-xs text-gray-700 dark:text-white-alpha-700 hover:text-gray-800 dark:hover:text-white-alpha-800 transition-colors cursor-pointer w-full justify-between px-4 py-2 data-[expanded=true]:border-b",onClick:()=>p(!x),"aria-expanded":x,"data-expanded":x,children:[e.jsx("div",{className:"flex items-center gap-2",children:e.jsxs("div",{className:"font-medium flex items-center gap-2",children:[e.jsx(c.Hammer,{className:"w-3 h-3 text-gray-600 dark:text-white-alpha-600"}),e.jsx("span",{children:m})]})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"flex items-center gap-1.5 px-1.5 py-0.5 rounded-md text-2xs uppercase tracking-wider bg-gray-100 dark:bg-white-alpha-100 font-medium text-gray-700 dark:text-white-alpha-700 font-mono",children:[k(),h]}),e.jsx(c.ChevronDown,{className:"w-3.5 h-3.5 text-gray-500 dark:text-white-alpha-500 transition-all duration-200 transform rotate-0 group-data-[expanded=true]:rotate-180"})]})]}),e.jsxs("div",{"data-expanded":x,className:b.cn("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",{"data-expanded":x,className:b.cn("relative",'before:content-[""] before:absolute before:inset-x-0 before:top-0 before:h-3 before:pointer-events-none before:z-10','after:content-[""] after:absolute after:inset-x-0 after:bottom-0 after:h-3 after:pointer-events-none after:z-10',"before:bg-[linear-gradient(white,_transparent)] after:bg-[linear-gradient(transparent,_white)]","dark:before:bg-[linear-gradient(var(--ikp-color-gray-dark-950),_transparent)] dark:after:bg-[linear-gradient(transparent,_var(--ikp-color-gray-dark-950))]","data-[expanded=false]:before:opacity-0 data-[expanded=false]:after:opacity-0"),children:e.jsx("div",{"data-expanded":x,className:b.cn("[scrollbar-width:thin] px-4","data-[expanded=true]:max-h-48 data-[expanded=true]:overflow-y-auto"),children:a.input!=null&&e.jsx("div",{className:"text-xs py-2",children:e.jsx(ge,{value:a.input})})})}),g&&u&&e.jsxs("div",{className:"flex justify-end gap-2 pt-1 pb-3 px-4",children:[e.jsx("button",{type:"button",className:b.cn(U.button({size:"xs",variant:"outline"}),"px-2 py-1 rounded-md text-xs text-gray-700 dark:text-white-alpha-700"),onClick:()=>i(!1),children:"Deny"}),e.jsxs("button",{type:"button",className:b.cn(U.button({size:"xs",variant:"primaryFilled"}),"px-2 py-1 rounded-md text-xs gap-1"),onClick:()=>i(!0),children:[e.jsx(c.Check,{className:"w-3 h-3"}),"Approve"]})]}),s==="output-available"&&l&&a.output!=null&&e.jsxs("div",{className:"flex justify-end items-center gap-1 whitespace-pre-wrap text-xs text-gray-700 dark:text-white-alpha-700 capitalize pb-3 px-4",children:[l==="approved"&&e.jsx(c.Check,{className:"w-3 h-3"}),l]}),s==="output-denied"&&e.jsxs("div",{className:"flex justify-end items-center gap-1 whitespace-pre-wrap text-xs text-gray-700 dark:text-white-alpha-700 capitalize pb-3 px-4",children:[e.jsx(c.X,{className:"w-3 h-3"}),h]})]})]})},ye=({className:t,componentStyles:a,children:i,isLast:n,...m})=>{const{message:s}=re.useMessage(),{logEvent:u}=te.useBaseEvents(),{conversationId:d,isStreaming:g,isLoading:l,setError:x,addToolApprovalResponse:p,sendMessage:h}=se.useChat(),{aiChatSettings:{components:k,artifacts:A,headers:E}}=ae.useInkeepConfig(),K=E?.["x-emit-operations"]==="true",L=s.role==="user",W=(g||l)&&n&&s.role==="assistant",{processedParts:X,summaryTimings:H,shouldShowInitialLoading:J,shouldShowStreamDelayLoading:Q}=le.useStreamProcessor(s.parts,W,x),[S,$]=o.useState(null),[Y,q]=o.useState(!1),y=o.useRef(null);o.useEffect(()=>{if(!S){q(!1),y.current&&(clearTimeout(y.current),y.current=null);return}return q(!1),y.current&&clearTimeout(y.current),y.current=window.setTimeout(()=>{q(!0)},1e3),()=>{y.current&&(clearTimeout(y.current),y.current=null)}},[S]),o.useEffect(()=>{S&&(!n||s.parts.length>S.partCount)&&$(null)},[S,n,s.parts.length]);const _=o.useMemo(()=>s.parts.filter(ne.isCitationArtifact),[s.parts]),I=o.useMemo(()=>oe.merge(ie.markdownStyles,a??{}),[a]),O=o.useCallback((r,f)=>{u({eventName:"assistant_message_inline_link_opened",properties:{title:f?.toString(),url:r}})},[u]),z=o.useCallback((r,f)=>{u({eventName:"assistant_code_block_copied",properties:{conversationId:d,language:r,code:f}})},[u,d]),M=o.useCallback(r=>e.jsx(C.EmbeddedChatPrimitiveMarkdown,{text:r,componentStyles:I,onLinkClick:O,onCodeCopy:z,artifacts:_}),[I,O,z,_]),Z=o.useMemo(()=>b.cn("data-[role=user]:whitespace-pre-wrap mb-3 data-[role=user]:mb-0 [&[data-role=user]>p]:mb-0 max-w-full",t),[t]),ee=!L||s.parts.some(r=>r.type==="text"&&r.text?.trim());return e.jsxs(e.Fragment,{children:[!ee&&e.jsx("span",{className:"text-gray-500 dark:text-white-alpha-500",children:"No message content"}),X.map((r,f)=>{const v={"data-role":s.role,"data-type":r?.type==="data-component"?r.data.type:r?.type,...m,className:Z};switch(r?.type){case"text":return e.jsx(C.PrimitiveMessagePart,{...v,children:L?r.text:M(r.text||"")},f);case"data-component":{const{type:w}=r.data;switch(w){case"text":return e.jsx("div",{...v,children:M(r.data.text||"")},f);default:{const N=r.data,{name:j,props:D}=N,P=k?.[j],R=P?T.DynamicComponent:me;return e.jsx(C.PrimitiveMessagePart,{...v,children:e.jsx(R,{name:j,props:D,componentDef:P})},`${j}-${f}`)}}}case"data-artifact":{const w=r.data,{name:N,type:j,artifactSummary:D}=w;if(j==="citation"&&!D?.url)return null;const P=A?.[j],R=P?T.DynamicComponent:he;return e.jsx(C.PrimitiveMessagePart,{...v,children:e.jsx(R,{name:j,props:D,componentDef:P})},`${N}-${f}`)}case"summary-group":{const w=H.get(r.groupKey)||{isCompleted:!1};return e.jsx(C.PrimitiveMessagePart,{...v,children:e.jsx(ce.DataSummaryGroup,{summaries:r.summaries||[],isCompleted:w.isCompleted})},`${r.groupKey}-${f}`)}default:{if(!pe(r))return null;const w=r,N=r.approval?.id;return K||N?e.jsx(C.PrimitiveMessagePart,{...v,children:e.jsx(fe,{tool:w,componentDef:k?.IkpTool,renderText:M,approvalId:N,messagePartsLength:s.parts.length,setApprovalDelayPending:$,addToolApprovalResponse:p,sendMessage:h,conversationId:d})},r.toolCallId??`${r.type}-${f}`):null}}}),J&&e.jsx(T.MessageLoading,{}),(Q||Y)&&e.jsx(xe,{})]})};exports.DefaultToolComponent=G;exports.EmbeddedChatMessagePart=ye;
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),ae=require("../../primitives/providers/base-events-provider.cjs"),re=require("../../primitives/providers/config-provider.cjs"),se=require("../../primitives/providers/message-provider.cjs"),C=require("../../primitives/components/embedded-chat.cjs"),ne=require("../../primitives/components/embedded-chat/chat-provider.cjs"),oe=require("../../primitives/utils/misc.cjs"),ie=require("merge-anything"),b=require("../utils.cjs"),le=require("./ui/markdown-styles.cjs"),de=require("../../primitives/components/embedded-chat/use-stream-processor.cjs"),ce=require("./data-summary-group.cjs"),o=require("react"),T=require("./embedded-chat.cjs"),c=require("lucide-react"),V=require("./ui/recipes/button.cjs"),pe={"input-streaming":"Pending","input-available":"Running","approval-requested":"Awaiting Approval","approval-responded":"Responded","output-available":"Completed","output-error":"Error","output-denied":"Denied"};function ue(t){if(!t||typeof t!="object")return!1;const a=t;return typeof a.type=="string"&&a.type.startsWith("tool-")}const me=t=>{if(!t||typeof t!="object"||!("status"in t))return;const a=t.status;return typeof a=="string"?a:void 0},xe=()=>e.jsx("div",{className:"flex space-x-1",children:[0,1,2].map(t=>e.jsx("span",{className:"animate-bounce-dot opacity-30",style:{animationDelay:`${t*.2}s`},children:"."},t))}),B=({name:t,Icon:a,props:l,componentType:n})=>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:t})]}),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})]}),e.jsx("div",{className:"px-4 py-2",children:e.jsx(K,{value:l})})]}),he=({name:t,props:a})=>e.jsx(B,{name:t,Icon:c.ComponentIcon,props:a,componentType:"component"}),fe=({name:t,props:a})=>e.jsx(B,{name:t,Icon:c.Library,props:a,componentType:"artifact"}),ge=({tool:t,componentDef:a,renderText:l,approvalId:n,messagePartsLength:x,setApprovalDelayPending:r,addToolApprovalResponse:u,sendMessage:i,conversationId:g})=>{const d=o.useRef(i);d.current=i;const m=o.useRef(u);m.current=u;const p=o.useRef(r);p.current=r;const h=o.useCallback(async(E=!0)=>{n&&(p.current({partCount:x}),m.current({id:n,approved:E}),await d.current(void 0,{body:{conversationId:g}}))},[n,x,g]),k=o.useMemo(()=>({tool:t,approve:h,renderMarkdown:l}),[t]),A=a?T.DynamicComponent:W;return e.jsx(A,{name:t.type,props:k,componentDef:a})};function F(t){return t===null?e.jsx("span",{className:"text-gray-500 dark:text-white-alpha-500 font-mono font-medium text-1xs",children:"null"}):t===void 0?e.jsx("span",{className:"text-gray-400 dark:text-white-alpha-400 italic text-xs font-medium",children:"undefined"}):typeof t=="boolean"?e.jsx("span",{className:b.cn("inline-flex font-mono font-semibold items-center px-1 py-0.5 text-1xs rounded-md border",t?"bg-inkeep-expanded-primary-50 border-inkeep-expanded-primary-200 text-inkeep-expanded-primary-600 dark:bg-inkeep-expanded-primary-950 dark:border-inkeep-expanded-primary-600 dark:text-inkeep-expanded-primary-200":"bg-gray-100 dark:bg-white-alpha-50 text-gray-700 dark:text-white-alpha-700"),children:t?"true":"false"}):typeof t=="number"?e.jsx("span",{className:"tabular-nums font-medium text-inkeep-expanded-primary-600 dark:text-inkeep-expanded-primary-200",children:String(t)}):typeof t=="string"?e.jsx("span",{className:"text-gray-800 dark:text-white-alpha-800 break-words",children:t}):e.jsx("span",{children:String(t)})}const G=({name:t,value:a,isArrayIndex:l,depth:n=0})=>{const[x,r]=o.useState(n<1),u=a!==null&&typeof a=="object"&&!Array.isArray(a),i=Array.isArray(a);if(!(u||i))return e.jsxs("div",{className:"flex items-baseline gap-2 py-1 text-xs",children:[e.jsx("span",{className:b.cn("font-medium shrink-0",l?"text-gray-300 dark:text-white-alpha-300":"text-gray-500 dark:text-white-alpha-500"),children:l?"—":t}),e.jsx("span",{className:"min-w-0",children:F(a)})]});const d=i?a.map((p,h)=>[String(h),p]):Object.entries(a);return d.length===0?e.jsxs("div",{className:"flex items-baseline gap-2 py-1 text-xs",children:[e.jsx("span",{className:"font-medium text-gray-500 dark:text-white-alpha-500 shrink-0",children:t}),e.jsx("span",{className:"text-gray-400 dark:text-white-alpha-400 italic",children:i?"empty list":"empty"})]}):e.jsxs("div",{children:[e.jsxs("button",{type:"button",onClick:p=>{p.stopPropagation(),r(!x)},className:"flex items-center gap-1.5 py-1 text-xs hover:bg-gray-50 dark:hover:bg-white-alpha-50 -mx-1.5 px-1.5 rounded transition-colors w-full text-left",children:[e.jsx(c.ChevronDown,{className:b.cn("h-3.5 w-3.5 text-gray-400 dark:text-white-alpha-400 shrink-0 transition-transform",!x&&"-rotate-90")}),e.jsx("span",{className:"font-medium text-gray-500 dark:text-white-alpha-500",children:t}),!x&&e.jsx("span",{className:"text-gray-400 dark:text-white-alpha-400 text-1xs ml-1",children:i?`${d.length} item${d.length!==1?"s":""}`:`${d.length} field${d.length!==1?"s":""}`})]}),x&&e.jsx("div",{className:"border-l-2 border-gray-200 dark:border-white-alpha-200 ml-1.5 pl-3",children:d.map(([p,h])=>e.jsx(G,{name:p,value:h,isArrayIndex:i,depth:n+1},p))})]})},K=({value:t})=>{if(t==null||typeof t!="object")return e.jsx("span",{className:"text-xs",children:F(t)});const a=Array.isArray(t)?t.map((l,n)=>[String(n),l]):Object.entries(t);return a.length===0?e.jsx("div",{className:"text-xs text-gray-400 dark:text-white-alpha-400 italic",children:"No arguments"}):e.jsx("div",{className:"space-y-1",children:a.map(([l,n])=>e.jsx(G,{name:l,value:n,isArrayIndex:Array.isArray(t)},l))})},W=({props:t})=>{const{tool:a,approve:l}=t,n=a.type,x=n.startsWith("tool-")?n.slice(5):n,r=a.state,u=a.approval?.id,i=!!u,g=r==="approval-requested",d=me(a.output),[m,p]=o.useState(i),h=r?pe[r]??r:"tool";o.useEffect(()=>{g&&p(!0)},[g]);const k=()=>{switch(r){case"input-streaming":return e.jsx(c.Circle,{className:"w-3 h-3"});case"input-available":return e.jsx(c.Loader2,{className:"w-3 h-3 animate-spin"});case"approval-requested":return e.jsx(c.Clock,{className:"w-3 h-3"});case"approval-responded":return e.jsx(c.CheckCircle,{className:"w-3 h-3"});case"output-available":return e.jsx(c.CheckCircle,{className:"w-3 h-3"});case"output-error":return e.jsx(c.TriangleAlert,{className:"w-3 h-3"});case"output-denied":return e.jsx(c.XCircle,{className:"w-3 h-3"});default:return null}};return e.jsxs("div",{className:"border rounded-lg mb-3 overflow-hidden",children:[e.jsxs("button",{type:"button",className:"inline-flex items-center group gap-2 text-xs text-gray-700 dark:text-white-alpha-700 hover:text-gray-800 dark:hover:text-white-alpha-800 transition-colors cursor-pointer w-full justify-between px-4 py-2 data-[expanded=true]:border-b",onClick:()=>p(!m),"aria-expanded":m,"data-expanded":m,children:[e.jsx("div",{className:"flex items-center gap-2",children:e.jsxs("div",{className:"font-medium flex items-center gap-2",children:[e.jsx(c.Hammer,{className:"w-3 h-3 text-gray-600 dark:text-white-alpha-600"}),e.jsx("span",{children:x})]})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"flex items-center gap-1.5 px-1.5 py-0.5 rounded-md text-2xs uppercase tracking-wider bg-gray-100 dark:bg-white-alpha-100 font-medium text-gray-700 dark:text-white-alpha-700 font-mono",children:[k(),h]}),e.jsx(c.ChevronDown,{className:"w-3.5 h-3.5 text-gray-500 dark:text-white-alpha-500 transition-all duration-200 transform rotate-0 group-data-[expanded=true]:rotate-180"})]})]}),e.jsxs("div",{"data-expanded":m,className:b.cn("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",{"data-expanded":m,className:b.cn("relative",'before:content-[""] before:absolute before:inset-x-0 before:top-0 before:h-3 before:pointer-events-none before:z-10','after:content-[""] after:absolute after:inset-x-0 after:bottom-0 after:h-3 after:pointer-events-none after:z-10',"before:bg-[linear-gradient(white,_transparent)] after:bg-[linear-gradient(transparent,_white)]","dark:before:bg-[linear-gradient(var(--ikp-color-gray-dark-950),_transparent)] dark:after:bg-[linear-gradient(transparent,_var(--ikp-color-gray-dark-950))]","data-[expanded=false]:before:opacity-0 data-[expanded=false]:after:opacity-0"),children:e.jsx("div",{"data-expanded":m,className:b.cn("[scrollbar-width:thin] px-4","data-[expanded=true]:max-h-48 data-[expanded=true]:overflow-y-auto"),children:a.input!=null&&e.jsx("div",{className:"text-xs py-2",children:e.jsx(K,{value:a.input})})})}),g&&u&&e.jsxs("div",{className:"flex justify-end gap-2 pt-1 pb-3 px-4",children:[e.jsx("button",{type:"button",className:b.cn(V.button({size:"xs",variant:"outline"}),"px-2 py-1 rounded-md text-xs text-gray-700 dark:text-white-alpha-700"),onClick:()=>l(!1),children:"Deny"}),e.jsxs("button",{type:"button",className:b.cn(V.button({size:"xs",variant:"primaryFilled"}),"px-2 py-1 rounded-md text-xs gap-1"),onClick:()=>l(!0),children:[e.jsx(c.Check,{className:"w-3 h-3"}),"Approve"]})]}),r==="output-available"&&d&&a.output!=null&&e.jsxs("div",{className:"flex justify-end items-center gap-1 whitespace-pre-wrap text-xs text-gray-700 dark:text-white-alpha-700 capitalize pb-3 px-4",children:[d==="approved"&&e.jsx(c.Check,{className:"w-3 h-3"}),d]}),r==="output-denied"&&e.jsxs("div",{className:"flex justify-end items-center gap-1 whitespace-pre-wrap text-xs text-gray-700 dark:text-white-alpha-700 capitalize pb-3 px-4",children:[e.jsx(c.X,{className:"w-3 h-3"}),h]})]})]})},ye=({className:t,componentStyles:a,children:l,isLast:n,...x})=>{const{message:r}=se.useMessage(),{logEvent:u}=ae.useBaseEvents(),{conversationId:i,isStreaming:g,isLoading:d,setError:m,addToolApprovalResponse:p,sendMessage:h}=ne.useChat(),{aiChatSettings:{components:k,artifacts:A,headers:E}}=re.useInkeepConfig(),X=E?.["x-emit-operations"]==="true",$=r.role==="user",q=(g||d)&&n&&r.role==="assistant",{processedParts:H,summaryTimings:J,shouldShowInitialLoading:Q,shouldShowStreamDelayLoading:Y}=de.useStreamProcessor(r.parts,q,m),[S,L]=o.useState(null),[Z,M]=o.useState(!1),y=o.useRef(null);o.useEffect(()=>{if(!S){M(!1),y.current&&(clearTimeout(y.current),y.current=null);return}return M(!1),y.current&&clearTimeout(y.current),y.current=window.setTimeout(()=>{M(!0)},1e3),()=>{y.current&&(clearTimeout(y.current),y.current=null)}},[S]),o.useEffect(()=>{S&&(!n||r.parts.length>S.partCount||!q)&&L(null)},[S,n,r.parts.length,q]);const _=o.useMemo(()=>r.parts.filter(oe.isCitationArtifact),[r.parts]),O=o.useMemo(()=>ie.merge(le.markdownStyles,a??{}),[a]),z=o.useCallback((s,f)=>{u({eventName:"assistant_message_inline_link_opened",properties:{conversationId:i,messageId:r.id,title:f?.toString(),url:s}})},[u,i,r.id]),U=o.useCallback((s,f)=>{u({eventName:"assistant_code_block_copied",properties:{conversationId:i,messageId:r.id,language:s,code:f}})},[u,i,r.id]),R=o.useCallback(s=>e.jsx(C.EmbeddedChatPrimitiveMarkdown,{text:s,componentStyles:O,onLinkClick:z,onCodeCopy:U,artifacts:_}),[O,z,U,_]),ee=o.useMemo(()=>b.cn("data-[role=user]:whitespace-pre-wrap mb-3 data-[role=user]:mb-0 [&[data-role=user]>p]:mb-0 max-w-full",t),[t]),te=!$||r.parts.some(s=>s.type==="text"&&s.text?.trim());return e.jsxs(e.Fragment,{children:[!te&&e.jsx("span",{className:"text-gray-500 dark:text-white-alpha-500",children:"No message content"}),H.map((s,f)=>{const v={"data-role":r.role,"data-type":s?.type==="data-component"?s.data.type:s?.type,...x,className:ee};switch(s?.type){case"text":return e.jsx(C.PrimitiveMessagePart,{...v,children:$?s.text:R(s.text||"")},f);case"data-component":{const{type:w}=s.data;switch(w){case"text":return e.jsx("div",{...v,children:R(s.data.text||"")},f);default:{const N=s.data,{name:j,props:D}=N,P=k?.[j],I=P?T.DynamicComponent:he;return e.jsx(C.PrimitiveMessagePart,{...v,children:e.jsx(I,{name:j,props:D,componentDef:P})},`${j}-${f}`)}}}case"data-artifact":{const w=s.data,{name:N,type:j,artifactSummary:D}=w;if(j==="citation"&&!D?.url)return null;const P=A?.[j],I=P?T.DynamicComponent:fe;return e.jsx(C.PrimitiveMessagePart,{...v,children:e.jsx(I,{name:j,props:D,componentDef:P})},`${N}-${f}`)}case"summary-group":{const w=J.get(s.groupKey)||{isCompleted:!1};return e.jsx(C.PrimitiveMessagePart,{...v,children:e.jsx(ce.DataSummaryGroup,{summaries:s.summaries||[],isCompleted:w.isCompleted})},`${s.groupKey}-${f}`)}default:{if(!ue(s))return null;const w=s,N=s.approval?.id;return X||N?e.jsx(C.PrimitiveMessagePart,{...v,children:e.jsx(ge,{tool:w,componentDef:k?.IkpTool,renderText:R,approvalId:N,messagePartsLength:r.parts.length,setApprovalDelayPending:L,addToolApprovalResponse:p,sendMessage:h,conversationId:i})},s.toolCallId??`${s.type}-${f}`):null}}}),Q&&e.jsx(T.MessageLoading,{}),(Y||Z)&&e.jsx(xe,{})]})};exports.DefaultToolComponent=W;exports.EmbeddedChatMessagePart=ye;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import { useBaseEvents as
|
|
4
|
-
import { useInkeepConfig as
|
|
5
|
-
import { useMessage as
|
|
6
|
-
import { EmbeddedChatPrimitiveMarkdown as
|
|
7
|
-
import { useChat as
|
|
8
|
-
import { isCitationArtifact as
|
|
9
|
-
import { merge as
|
|
2
|
+
import { jsxs as o, jsx as e, Fragment as le } from "react/jsx-runtime";
|
|
3
|
+
import { useBaseEvents as de } from "../../primitives/providers/base-events-provider.js";
|
|
4
|
+
import { useInkeepConfig as pe } from "../../primitives/providers/config-provider.js";
|
|
5
|
+
import { useMessage as ce } from "../../primitives/providers/message-provider.js";
|
|
6
|
+
import { EmbeddedChatPrimitiveMarkdown as me, PrimitiveMessagePart as S } from "../../primitives/components/embedded-chat.js";
|
|
7
|
+
import { useChat as ue } from "../../primitives/components/embedded-chat/chat-provider.js";
|
|
8
|
+
import { isCitationArtifact as he } from "../../primitives/utils/misc.js";
|
|
9
|
+
import { merge as xe } from "merge-anything";
|
|
10
10
|
import { cn as y } from "../utils.js";
|
|
11
|
-
import { markdownStyles as
|
|
12
|
-
import { useStreamProcessor as
|
|
13
|
-
import { DataSummaryGroup as
|
|
14
|
-
import { useState as
|
|
15
|
-
import { DynamicComponent as
|
|
16
|
-
import { Hammer as
|
|
17
|
-
import { button as
|
|
18
|
-
const
|
|
11
|
+
import { markdownStyles as fe } from "./ui/markdown-styles.js";
|
|
12
|
+
import { useStreamProcessor as ge } from "../../primitives/components/embedded-chat/use-stream-processor.js";
|
|
13
|
+
import { DataSummaryGroup as ye } from "./data-summary-group.js";
|
|
14
|
+
import { useState as I, useEffect as M, useRef as A, useMemo as E, useCallback as P } from "react";
|
|
15
|
+
import { DynamicComponent as R, MessageLoading as be } from "./embedded-chat.js";
|
|
16
|
+
import { Hammer as we, ChevronDown as G, Check as K, X as ke, XCircle as Ne, TriangleAlert as ve, CheckCircle as W, Clock as Ce, Loader2 as De, Circle as Se, Library as Te, ComponentIcon as Ae } from "lucide-react";
|
|
17
|
+
import { button as X } from "./ui/recipes/button.js";
|
|
18
|
+
const Ee = {
|
|
19
19
|
"input-streaming": "Pending",
|
|
20
20
|
"input-available": "Running",
|
|
21
21
|
"approval-requested": "Awaiting Approval",
|
|
@@ -24,16 +24,16 @@ const Ae = {
|
|
|
24
24
|
"output-error": "Error",
|
|
25
25
|
"output-denied": "Denied"
|
|
26
26
|
};
|
|
27
|
-
function
|
|
27
|
+
function Pe(t) {
|
|
28
28
|
if (!t || typeof t != "object") return !1;
|
|
29
29
|
const a = t;
|
|
30
30
|
return typeof a.type == "string" && a.type.startsWith("tool-");
|
|
31
31
|
}
|
|
32
|
-
const
|
|
32
|
+
const Ie = (t) => {
|
|
33
33
|
if (!t || typeof t != "object" || !("status" in t)) return;
|
|
34
34
|
const a = t.status;
|
|
35
35
|
return typeof a == "string" ? a : void 0;
|
|
36
|
-
},
|
|
36
|
+
}, je = () => /* @__PURE__ */ e("div", { className: "flex space-x-1", children: [0, 1, 2].map((t) => /* @__PURE__ */ e(
|
|
37
37
|
"span",
|
|
38
38
|
{
|
|
39
39
|
className: "animate-bounce-dot opacity-30",
|
|
@@ -43,7 +43,7 @@ const Pe = (t) => {
|
|
|
43
43
|
children: "."
|
|
44
44
|
},
|
|
45
45
|
t
|
|
46
|
-
)) }),
|
|
46
|
+
)) }), H = ({ name: t, Icon: a, props: l, componentType: s }) => /* @__PURE__ */ o("div", { className: "border rounded-lg bg-gray-50 dark:bg-gray-dark-800 mb-3", children: [
|
|
47
47
|
/* @__PURE__ */ o("div", { className: "flex justify-between px-4 py-2 text-xs", children: [
|
|
48
48
|
/* @__PURE__ */ o("div", { className: "font-medium flex items-center gap-2", children: [
|
|
49
49
|
/* @__PURE__ */ e(a, { className: "w-3 h-3 text-gray-600 dark:text-white-alpha-600" }),
|
|
@@ -51,33 +51,33 @@ const Pe = (t) => {
|
|
|
51
51
|
] }),
|
|
52
52
|
/* @__PURE__ */ e("div", { className: "flex items-center px-1.5 py-0.5 rounded-md text-2xs uppercase tracking-wider bg-gray-200 dark:bg-white-alpha-200 font-medium text-gray-700 dark:text-white-alpha-700 font-mono", children: s })
|
|
53
53
|
] }),
|
|
54
|
-
/* @__PURE__ */ e("
|
|
55
|
-
] }),
|
|
54
|
+
/* @__PURE__ */ e("div", { className: "px-4 py-2", children: /* @__PURE__ */ e(Y, { value: l }) })
|
|
55
|
+
] }), Le = ({ name: t, props: a }) => /* @__PURE__ */ e(H, { name: t, Icon: Ae, props: a, componentType: "component" }), _e = ({ name: t, props: a }) => /* @__PURE__ */ e(H, { name: t, Icon: Te, props: a, componentType: "artifact" }), $e = ({
|
|
56
56
|
tool: t,
|
|
57
57
|
componentDef: a,
|
|
58
|
-
renderText:
|
|
58
|
+
renderText: l,
|
|
59
59
|
approvalId: s,
|
|
60
60
|
messagePartsLength: u,
|
|
61
|
-
setApprovalDelayPending:
|
|
61
|
+
setApprovalDelayPending: r,
|
|
62
62
|
addToolApprovalResponse: c,
|
|
63
|
-
sendMessage:
|
|
63
|
+
sendMessage: i,
|
|
64
64
|
conversationId: f
|
|
65
65
|
}) => {
|
|
66
|
-
const
|
|
67
|
-
|
|
66
|
+
const d = A(i);
|
|
67
|
+
d.current = i;
|
|
68
68
|
const m = A(c);
|
|
69
69
|
m.current = c;
|
|
70
|
-
const p = A(
|
|
71
|
-
p.current =
|
|
70
|
+
const p = A(r);
|
|
71
|
+
p.current = r;
|
|
72
72
|
const h = P(
|
|
73
73
|
async (j = !0) => {
|
|
74
|
-
s && (p.current({ partCount: u }), m.current({ id: s, approved: j }), await
|
|
74
|
+
s && (p.current({ partCount: u }), m.current({ id: s, approved: j }), await d.current(void 0, { body: { conversationId: f } }));
|
|
75
75
|
},
|
|
76
76
|
[s, u, f]
|
|
77
|
-
), v = E(() => ({ tool: t, approve: h, renderMarkdown:
|
|
78
|
-
return /* @__PURE__ */ e(a ?
|
|
77
|
+
), v = E(() => ({ tool: t, approve: h, renderMarkdown: l }), [t]);
|
|
78
|
+
return /* @__PURE__ */ e(a ? R : Me, { name: t.type, props: v, componentDef: a });
|
|
79
79
|
};
|
|
80
|
-
function
|
|
80
|
+
function J(t) {
|
|
81
81
|
return t === null ? /* @__PURE__ */ e("span", { className: "text-gray-500 dark:text-white-alpha-500 font-mono font-medium text-1xs", children: "null" }) : t === void 0 ? /* @__PURE__ */ e("span", { className: "text-gray-400 dark:text-white-alpha-400 italic text-xs font-medium", children: "undefined" }) : typeof t == "boolean" ? /* @__PURE__ */ e(
|
|
82
82
|
"span",
|
|
83
83
|
{
|
|
@@ -87,45 +87,45 @@ function H(t) {
|
|
|
87
87
|
),
|
|
88
88
|
children: t ? "true" : "false"
|
|
89
89
|
}
|
|
90
|
-
) : typeof t == "number" ? /* @__PURE__ */ e("span", { className: "tabular-nums font-medium text-inkeep-expanded-primary-600 dark:text-inkeep-expanded-primary-200", children: t
|
|
90
|
+
) : typeof t == "number" ? /* @__PURE__ */ e("span", { className: "tabular-nums font-medium text-inkeep-expanded-primary-600 dark:text-inkeep-expanded-primary-200", children: String(t) }) : typeof t == "string" ? /* @__PURE__ */ e("span", { className: "text-gray-800 dark:text-white-alpha-800 break-words", children: t }) : /* @__PURE__ */ e("span", { children: String(t) });
|
|
91
91
|
}
|
|
92
|
-
const
|
|
92
|
+
const Q = ({
|
|
93
93
|
name: t,
|
|
94
94
|
value: a,
|
|
95
|
-
isArrayIndex:
|
|
95
|
+
isArrayIndex: l,
|
|
96
96
|
depth: s = 0
|
|
97
97
|
}) => {
|
|
98
|
-
const [u,
|
|
99
|
-
if (!(c ||
|
|
98
|
+
const [u, r] = I(s < 1), c = a !== null && typeof a == "object" && !Array.isArray(a), i = Array.isArray(a);
|
|
99
|
+
if (!(c || i))
|
|
100
100
|
return /* @__PURE__ */ o("div", { className: "flex items-baseline gap-2 py-1 text-xs", children: [
|
|
101
101
|
/* @__PURE__ */ e(
|
|
102
102
|
"span",
|
|
103
103
|
{
|
|
104
104
|
className: y(
|
|
105
105
|
"font-medium shrink-0",
|
|
106
|
-
|
|
106
|
+
l ? "text-gray-300 dark:text-white-alpha-300" : "text-gray-500 dark:text-white-alpha-500"
|
|
107
107
|
),
|
|
108
|
-
children:
|
|
108
|
+
children: l ? "—" : t
|
|
109
109
|
}
|
|
110
110
|
),
|
|
111
|
-
/* @__PURE__ */ e("span", { className: "min-w-0", children:
|
|
111
|
+
/* @__PURE__ */ e("span", { className: "min-w-0", children: J(a) })
|
|
112
112
|
] });
|
|
113
|
-
const
|
|
114
|
-
return
|
|
113
|
+
const d = i ? a.map((p, h) => [String(h), p]) : Object.entries(a);
|
|
114
|
+
return d.length === 0 ? /* @__PURE__ */ o("div", { className: "flex items-baseline gap-2 py-1 text-xs", children: [
|
|
115
115
|
/* @__PURE__ */ e("span", { className: "font-medium text-gray-500 dark:text-white-alpha-500 shrink-0", children: t }),
|
|
116
|
-
/* @__PURE__ */ e("span", { className: "text-gray-400 dark:text-white-alpha-400 italic", children:
|
|
116
|
+
/* @__PURE__ */ e("span", { className: "text-gray-400 dark:text-white-alpha-400 italic", children: i ? "empty list" : "empty" })
|
|
117
117
|
] }) : /* @__PURE__ */ o("div", { children: [
|
|
118
118
|
/* @__PURE__ */ o(
|
|
119
119
|
"button",
|
|
120
120
|
{
|
|
121
121
|
type: "button",
|
|
122
122
|
onClick: (p) => {
|
|
123
|
-
p.stopPropagation(),
|
|
123
|
+
p.stopPropagation(), r(!u);
|
|
124
124
|
},
|
|
125
125
|
className: "flex items-center gap-1.5 py-1 text-xs hover:bg-gray-50 dark:hover:bg-white-alpha-50 -mx-1.5 px-1.5 rounded transition-colors w-full text-left",
|
|
126
126
|
children: [
|
|
127
127
|
/* @__PURE__ */ e(
|
|
128
|
-
|
|
128
|
+
G,
|
|
129
129
|
{
|
|
130
130
|
className: y(
|
|
131
131
|
"h-3.5 w-3.5 text-gray-400 dark:text-white-alpha-400 shrink-0 transition-transform",
|
|
@@ -134,20 +134,20 @@ const J = ({
|
|
|
134
134
|
}
|
|
135
135
|
),
|
|
136
136
|
/* @__PURE__ */ e("span", { className: "font-medium text-gray-500 dark:text-white-alpha-500", children: t }),
|
|
137
|
-
!u && /* @__PURE__ */ e("span", { className: "text-gray-400 dark:text-white-alpha-400 text-1xs ml-1", children:
|
|
137
|
+
!u && /* @__PURE__ */ e("span", { className: "text-gray-400 dark:text-white-alpha-400 text-1xs ml-1", children: i ? `${d.length} item${d.length !== 1 ? "s" : ""}` : `${d.length} field${d.length !== 1 ? "s" : ""}` })
|
|
138
138
|
]
|
|
139
139
|
}
|
|
140
140
|
),
|
|
141
|
-
u && /* @__PURE__ */ e("div", { className: "border-l-2 border-gray-200 dark:border-white-alpha-200 ml-1.5 pl-3", children:
|
|
141
|
+
u && /* @__PURE__ */ e("div", { className: "border-l-2 border-gray-200 dark:border-white-alpha-200 ml-1.5 pl-3", children: d.map(([p, h]) => /* @__PURE__ */ e(Q, { name: p, value: h, isArrayIndex: i, depth: s + 1 }, p)) })
|
|
142
142
|
] });
|
|
143
|
-
},
|
|
143
|
+
}, Y = ({ value: t }) => {
|
|
144
144
|
if (t == null || typeof t != "object")
|
|
145
|
-
return /* @__PURE__ */ e("span", { className: "text-xs", children:
|
|
146
|
-
const a = Array.isArray(t) ? t.map((
|
|
147
|
-
return a.length === 0 ? /* @__PURE__ */ e("div", { className: "text-xs text-gray-400 dark:text-white-alpha-400 italic", children: "No arguments" }) : /* @__PURE__ */ e("div", { className: "space-y-1", children: a.map(([
|
|
145
|
+
return /* @__PURE__ */ e("span", { className: "text-xs", children: J(t) });
|
|
146
|
+
const a = Array.isArray(t) ? t.map((l, s) => [String(s), l]) : Object.entries(t);
|
|
147
|
+
return a.length === 0 ? /* @__PURE__ */ e("div", { className: "text-xs text-gray-400 dark:text-white-alpha-400 italic", children: "No arguments" }) : /* @__PURE__ */ e("div", { className: "space-y-1", children: a.map(([l, s]) => /* @__PURE__ */ e(Q, { name: l, value: s, isArrayIndex: Array.isArray(t) }, l)) });
|
|
148
148
|
}, Me = ({ props: t }) => {
|
|
149
|
-
const { tool: a, approve:
|
|
150
|
-
return
|
|
149
|
+
const { tool: a, approve: l } = t, s = a.type, u = s.startsWith("tool-") ? s.slice(5) : s, r = a.state, c = a.approval?.id, i = !!c, f = r === "approval-requested", d = Ie(a.output), [m, p] = I(i), h = r ? Ee[r] ?? r : "tool";
|
|
150
|
+
return M(() => {
|
|
151
151
|
f && p(!0);
|
|
152
152
|
}, [f]), /* @__PURE__ */ o("div", { className: "border rounded-lg mb-3 overflow-hidden", children: [
|
|
153
153
|
/* @__PURE__ */ o(
|
|
@@ -160,34 +160,34 @@ const J = ({
|
|
|
160
160
|
"data-expanded": m,
|
|
161
161
|
children: [
|
|
162
162
|
/* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ o("div", { className: "font-medium flex items-center gap-2", children: [
|
|
163
|
-
/* @__PURE__ */ e(
|
|
163
|
+
/* @__PURE__ */ e(we, { className: "w-3 h-3 text-gray-600 dark:text-white-alpha-600" }),
|
|
164
164
|
/* @__PURE__ */ e("span", { children: u })
|
|
165
165
|
] }) }),
|
|
166
166
|
/* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: [
|
|
167
167
|
/* @__PURE__ */ o("div", { className: "flex items-center gap-1.5 px-1.5 py-0.5 rounded-md text-2xs uppercase tracking-wider bg-gray-100 dark:bg-white-alpha-100 font-medium text-gray-700 dark:text-white-alpha-700 font-mono", children: [
|
|
168
168
|
(() => {
|
|
169
|
-
switch (
|
|
169
|
+
switch (r) {
|
|
170
170
|
case "input-streaming":
|
|
171
|
-
return /* @__PURE__ */ e(
|
|
171
|
+
return /* @__PURE__ */ e(Se, { className: "w-3 h-3" });
|
|
172
172
|
case "input-available":
|
|
173
173
|
return /* @__PURE__ */ e(De, { className: "w-3 h-3 animate-spin" });
|
|
174
174
|
case "approval-requested":
|
|
175
|
-
return /* @__PURE__ */ e(
|
|
175
|
+
return /* @__PURE__ */ e(Ce, { className: "w-3 h-3" });
|
|
176
176
|
case "approval-responded":
|
|
177
|
-
return /* @__PURE__ */ e(
|
|
177
|
+
return /* @__PURE__ */ e(W, { className: "w-3 h-3" });
|
|
178
178
|
case "output-available":
|
|
179
|
-
return /* @__PURE__ */ e(
|
|
179
|
+
return /* @__PURE__ */ e(W, { className: "w-3 h-3" });
|
|
180
180
|
case "output-error":
|
|
181
|
-
return /* @__PURE__ */ e(Ce, { className: "w-3 h-3" });
|
|
182
|
-
case "output-denied":
|
|
183
181
|
return /* @__PURE__ */ e(ve, { className: "w-3 h-3" });
|
|
182
|
+
case "output-denied":
|
|
183
|
+
return /* @__PURE__ */ e(Ne, { className: "w-3 h-3" });
|
|
184
184
|
default:
|
|
185
185
|
return null;
|
|
186
186
|
}
|
|
187
187
|
})(),
|
|
188
188
|
h
|
|
189
189
|
] }),
|
|
190
|
-
/* @__PURE__ */ e(
|
|
190
|
+
/* @__PURE__ */ e(G, { className: "w-3.5 h-3.5 text-gray-500 dark:text-white-alpha-500 transition-all duration-200 transform rotate-0 group-data-[expanded=true]:rotate-180" })
|
|
191
191
|
] })
|
|
192
192
|
]
|
|
193
193
|
}
|
|
@@ -220,7 +220,7 @@ const J = ({
|
|
|
220
220
|
"[scrollbar-width:thin] px-4",
|
|
221
221
|
"data-[expanded=true]:max-h-48 data-[expanded=true]:overflow-y-auto"
|
|
222
222
|
),
|
|
223
|
-
children: a.input != null && /* @__PURE__ */ e("div", { className: "text-xs py-2", children: /* @__PURE__ */ e(
|
|
223
|
+
children: a.input != null && /* @__PURE__ */ e("div", { className: "text-xs py-2", children: /* @__PURE__ */ e(Y, { value: a.input }) })
|
|
224
224
|
}
|
|
225
225
|
)
|
|
226
226
|
}
|
|
@@ -231,10 +231,10 @@ const J = ({
|
|
|
231
231
|
{
|
|
232
232
|
type: "button",
|
|
233
233
|
className: y(
|
|
234
|
-
|
|
234
|
+
X({ size: "xs", variant: "outline" }),
|
|
235
235
|
"px-2 py-1 rounded-md text-xs text-gray-700 dark:text-white-alpha-700"
|
|
236
236
|
),
|
|
237
|
-
onClick: () =>
|
|
237
|
+
onClick: () => l(!1),
|
|
238
238
|
children: "Deny"
|
|
239
239
|
}
|
|
240
240
|
),
|
|
@@ -243,23 +243,23 @@ const J = ({
|
|
|
243
243
|
{
|
|
244
244
|
type: "button",
|
|
245
245
|
className: y(
|
|
246
|
-
|
|
246
|
+
X({ size: "xs", variant: "primaryFilled" }),
|
|
247
247
|
"px-2 py-1 rounded-md text-xs gap-1"
|
|
248
248
|
),
|
|
249
|
-
onClick: () =>
|
|
249
|
+
onClick: () => l(!0),
|
|
250
250
|
children: [
|
|
251
|
-
/* @__PURE__ */ e(
|
|
251
|
+
/* @__PURE__ */ e(K, { className: "w-3 h-3" }),
|
|
252
252
|
"Approve"
|
|
253
253
|
]
|
|
254
254
|
}
|
|
255
255
|
)
|
|
256
256
|
] }),
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
257
|
+
r === "output-available" && d && a.output != null && /* @__PURE__ */ o("div", { className: "flex justify-end items-center gap-1 whitespace-pre-wrap text-xs text-gray-700 dark:text-white-alpha-700 capitalize pb-3 px-4", children: [
|
|
258
|
+
d === "approved" && /* @__PURE__ */ e(K, { className: "w-3 h-3" }),
|
|
259
|
+
d
|
|
260
260
|
] }),
|
|
261
|
-
|
|
262
|
-
/* @__PURE__ */ e(
|
|
261
|
+
r === "output-denied" && /* @__PURE__ */ o("div", { className: "flex justify-end items-center gap-1 whitespace-pre-wrap text-xs text-gray-700 dark:text-white-alpha-700 capitalize pb-3 px-4", children: [
|
|
262
|
+
/* @__PURE__ */ e(ke, { className: "w-3 h-3" }),
|
|
263
263
|
h
|
|
264
264
|
] })
|
|
265
265
|
]
|
|
@@ -269,137 +269,140 @@ const J = ({
|
|
|
269
269
|
}, Ze = ({
|
|
270
270
|
className: t,
|
|
271
271
|
componentStyles: a,
|
|
272
|
-
children:
|
|
272
|
+
children: l,
|
|
273
273
|
isLast: s,
|
|
274
274
|
...u
|
|
275
275
|
}) => {
|
|
276
|
-
const { message:
|
|
277
|
-
aiChatSettings: { components: v, artifacts:
|
|
278
|
-
} =
|
|
279
|
-
|
|
276
|
+
const { message: r } = ce(), { logEvent: c } = de(), { conversationId: i, isStreaming: f, isLoading: d, setError: m, addToolApprovalResponse: p, sendMessage: h } = ue(), {
|
|
277
|
+
aiChatSettings: { components: v, artifacts: O, headers: j }
|
|
278
|
+
} = pe(), Z = j?.["x-emit-operations"] === "true", z = r.role === "user", L = (f || d) && s && r.role === "assistant", { processedParts: ee, summaryTimings: te, shouldShowInitialLoading: ae, shouldShowStreamDelayLoading: re } = ge(r.parts, L, m), [C, q] = I(null), [ne, _] = I(!1), g = A(null);
|
|
279
|
+
M(() => {
|
|
280
280
|
if (!C) {
|
|
281
|
-
|
|
281
|
+
_(!1), g.current && (clearTimeout(g.current), g.current = null);
|
|
282
282
|
return;
|
|
283
283
|
}
|
|
284
|
-
return
|
|
285
|
-
|
|
284
|
+
return _(!1), g.current && clearTimeout(g.current), g.current = window.setTimeout(() => {
|
|
285
|
+
_(!0);
|
|
286
286
|
}, 1e3), () => {
|
|
287
287
|
g.current && (clearTimeout(g.current), g.current = null);
|
|
288
288
|
};
|
|
289
|
-
}, [C]),
|
|
290
|
-
C && (!s ||
|
|
291
|
-
}, [C, s,
|
|
292
|
-
const
|
|
293
|
-
() =>
|
|
289
|
+
}, [C]), M(() => {
|
|
290
|
+
C && (!s || r.parts.length > C.partCount || !L) && q(null);
|
|
291
|
+
}, [C, s, r.parts.length, L]);
|
|
292
|
+
const U = E(() => r.parts.filter(he), [r.parts]), V = E(
|
|
293
|
+
() => xe(fe, a ?? {}),
|
|
294
294
|
[a]
|
|
295
|
-
),
|
|
296
|
-
(
|
|
295
|
+
), B = P(
|
|
296
|
+
(n, x) => {
|
|
297
297
|
c({
|
|
298
298
|
eventName: "assistant_message_inline_link_opened",
|
|
299
299
|
properties: {
|
|
300
|
+
conversationId: i,
|
|
301
|
+
messageId: r.id,
|
|
300
302
|
title: x?.toString(),
|
|
301
|
-
url:
|
|
303
|
+
url: n
|
|
302
304
|
}
|
|
303
305
|
});
|
|
304
306
|
},
|
|
305
|
-
[c]
|
|
306
|
-
),
|
|
307
|
-
(
|
|
307
|
+
[c, i, r.id]
|
|
308
|
+
), F = P(
|
|
309
|
+
(n, x) => {
|
|
308
310
|
c({
|
|
309
311
|
eventName: "assistant_code_block_copied",
|
|
310
312
|
properties: {
|
|
311
|
-
conversationId:
|
|
312
|
-
|
|
313
|
+
conversationId: i,
|
|
314
|
+
messageId: r.id,
|
|
315
|
+
language: n,
|
|
313
316
|
code: x
|
|
314
317
|
}
|
|
315
318
|
});
|
|
316
319
|
},
|
|
317
|
-
[c,
|
|
318
|
-
),
|
|
319
|
-
(
|
|
320
|
-
|
|
320
|
+
[c, i, r.id]
|
|
321
|
+
), $ = P(
|
|
322
|
+
(n) => /* @__PURE__ */ e(
|
|
323
|
+
me,
|
|
321
324
|
{
|
|
322
|
-
text:
|
|
323
|
-
componentStyles:
|
|
324
|
-
onLinkClick:
|
|
325
|
-
onCodeCopy:
|
|
326
|
-
artifacts:
|
|
325
|
+
text: n,
|
|
326
|
+
componentStyles: V,
|
|
327
|
+
onLinkClick: B,
|
|
328
|
+
onCodeCopy: F,
|
|
329
|
+
artifacts: U
|
|
327
330
|
}
|
|
328
331
|
),
|
|
329
|
-
[
|
|
330
|
-
),
|
|
332
|
+
[V, B, F, U]
|
|
333
|
+
), se = E(
|
|
331
334
|
() => y(
|
|
332
335
|
"data-[role=user]:whitespace-pre-wrap mb-3 data-[role=user]:mb-0 [&[data-role=user]>p]:mb-0 max-w-full",
|
|
333
336
|
t
|
|
334
337
|
),
|
|
335
338
|
[t]
|
|
336
|
-
),
|
|
337
|
-
(
|
|
339
|
+
), oe = !z || r.parts.some(
|
|
340
|
+
(n) => n.type === "text" && n.text?.trim()
|
|
338
341
|
);
|
|
339
|
-
return /* @__PURE__ */ o(
|
|
340
|
-
!
|
|
341
|
-
|
|
342
|
+
return /* @__PURE__ */ o(le, { children: [
|
|
343
|
+
!oe && /* @__PURE__ */ e("span", { className: "text-gray-500 dark:text-white-alpha-500", children: "No message content" }),
|
|
344
|
+
ee.map((n, x) => {
|
|
342
345
|
const k = {
|
|
343
|
-
"data-role":
|
|
344
|
-
"data-type":
|
|
346
|
+
"data-role": r.role,
|
|
347
|
+
"data-type": n?.type === "data-component" ? n.data.type : n?.type,
|
|
345
348
|
...u,
|
|
346
|
-
className:
|
|
349
|
+
className: se
|
|
347
350
|
};
|
|
348
|
-
switch (
|
|
351
|
+
switch (n?.type) {
|
|
349
352
|
case "text":
|
|
350
|
-
return /* @__PURE__ */ e(
|
|
353
|
+
return /* @__PURE__ */ e(S, { ...k, children: z ? n.text : $(n.text || "") }, x);
|
|
351
354
|
case "data-component": {
|
|
352
|
-
const { type: w } =
|
|
355
|
+
const { type: w } = n.data;
|
|
353
356
|
switch (w) {
|
|
354
357
|
case "text":
|
|
355
|
-
return /* @__PURE__ */ e("div", { ...k, children:
|
|
358
|
+
return /* @__PURE__ */ e("div", { ...k, children: $(n.data.text || "") }, x);
|
|
356
359
|
default: {
|
|
357
|
-
const N =
|
|
358
|
-
return /* @__PURE__ */ e(
|
|
360
|
+
const N = n.data, { name: b, props: T } = N, D = v?.[b];
|
|
361
|
+
return /* @__PURE__ */ e(S, { ...k, children: /* @__PURE__ */ e(D ? R : Le, { name: b, props: T, componentDef: D }) }, `${b}-${x}`);
|
|
359
362
|
}
|
|
360
363
|
}
|
|
361
364
|
}
|
|
362
365
|
case "data-artifact": {
|
|
363
|
-
const w =
|
|
366
|
+
const w = n.data, { name: N, type: b, artifactSummary: T } = w;
|
|
364
367
|
if (b === "citation" && !T?.url) return null;
|
|
365
|
-
const
|
|
366
|
-
return /* @__PURE__ */ e(
|
|
368
|
+
const D = O?.[b];
|
|
369
|
+
return /* @__PURE__ */ e(S, { ...k, children: /* @__PURE__ */ e(D ? R : _e, { name: b, props: T, componentDef: D }) }, `${N}-${x}`);
|
|
367
370
|
}
|
|
368
371
|
case "summary-group": {
|
|
369
|
-
const w =
|
|
372
|
+
const w = te.get(n.groupKey) || {
|
|
370
373
|
isCompleted: !1
|
|
371
374
|
};
|
|
372
|
-
return /* @__PURE__ */ e(
|
|
373
|
-
|
|
375
|
+
return /* @__PURE__ */ e(S, { ...k, children: /* @__PURE__ */ e(
|
|
376
|
+
ye,
|
|
374
377
|
{
|
|
375
|
-
summaries:
|
|
378
|
+
summaries: n.summaries || [],
|
|
376
379
|
isCompleted: w.isCompleted
|
|
377
380
|
}
|
|
378
|
-
) }, `${
|
|
381
|
+
) }, `${n.groupKey}-${x}`);
|
|
379
382
|
}
|
|
380
383
|
default: {
|
|
381
|
-
if (!
|
|
384
|
+
if (!Pe(n))
|
|
382
385
|
return null;
|
|
383
|
-
const w =
|
|
384
|
-
return
|
|
385
|
-
|
|
386
|
+
const w = n, N = n.approval?.id;
|
|
387
|
+
return Z || N ? /* @__PURE__ */ e(S, { ...k, children: /* @__PURE__ */ e(
|
|
388
|
+
$e,
|
|
386
389
|
{
|
|
387
390
|
tool: w,
|
|
388
391
|
componentDef: v?.IkpTool,
|
|
389
|
-
renderText:
|
|
392
|
+
renderText: $,
|
|
390
393
|
approvalId: N,
|
|
391
|
-
messagePartsLength:
|
|
392
|
-
setApprovalDelayPending:
|
|
394
|
+
messagePartsLength: r.parts.length,
|
|
395
|
+
setApprovalDelayPending: q,
|
|
393
396
|
addToolApprovalResponse: p,
|
|
394
397
|
sendMessage: h,
|
|
395
|
-
conversationId:
|
|
398
|
+
conversationId: i
|
|
396
399
|
}
|
|
397
|
-
) },
|
|
400
|
+
) }, n.toolCallId ?? `${n.type}-${x}`) : null;
|
|
398
401
|
}
|
|
399
402
|
}
|
|
400
403
|
}),
|
|
401
|
-
|
|
402
|
-
(
|
|
404
|
+
ae && /* @__PURE__ */ e(be, {}),
|
|
405
|
+
(re || ne) && /* @__PURE__ */ e(je, {})
|
|
403
406
|
] });
|
|
404
407
|
};
|
|
405
408
|
export {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as o } from "react/jsx-runtime";
|
|
3
|
-
import { Modal as l,
|
|
3
|
+
import { Modal as l, Close as i, Content as n, Overlay as r } from "../../primitives/components/modal.js";
|
|
4
4
|
import { cn as e } from "../utils.js";
|
|
5
5
|
import { button as m } from "./ui/recipes/button.js";
|
|
6
6
|
import { modal as s } from "./ui/recipes/modal.js";
|
|
7
7
|
const M = l, C = ({
|
|
8
8
|
className: t,
|
|
9
9
|
...a
|
|
10
|
-
}) => /* @__PURE__ */ o(
|
|
10
|
+
}) => /* @__PURE__ */ o(r, { className: e(s({ slot: "overlay" }), t), ...a }), h = ({
|
|
11
11
|
className: t,
|
|
12
12
|
...a
|
|
13
13
|
}) => /* @__PURE__ */ o(
|
|
@@ -26,7 +26,7 @@ const M = l, C = ({
|
|
|
26
26
|
className: t,
|
|
27
27
|
...a
|
|
28
28
|
}) => /* @__PURE__ */ o(
|
|
29
|
-
|
|
29
|
+
i,
|
|
30
30
|
{
|
|
31
31
|
className: e(
|
|
32
32
|
s({ slot: "close" }),
|