@qredence/fleet 0.10.0 → 0.10.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/CHANGELOG.md +32 -0
- package/bin/prime-runtime.d.mts +19 -0
- package/bin/prime-runtime.mjs +42 -5
- package/dist/web/client/assets/{artifacts-panel-6JEdy6jU.js → artifacts-panel-CfWH5cQn.js} +1 -1
- package/dist/web/client/assets/{chat-command-palette-Bxr5EkO6.js → chat-command-palette-CKGrP-Ke.js} +1 -1
- package/dist/web/client/assets/{ease-DYVhTl2n.js → ease-nNJMFgD_.js} +1 -1
- package/dist/web/client/assets/globals-C6h6fq-s.css +2 -0
- package/dist/web/client/assets/{index-Cf8tRpHL.js → index-D3OD2pV7.js} +2 -2
- package/dist/web/client/assets/{model-selector-list-CbDAT0Rw.js → model-selector-list-CIJArf3L.js} +1 -1
- package/dist/web/client/assets/{prompt-input-CoV1gTUQ.js → prompt-input-0kaw0ekd.js} +1 -1
- package/dist/web/client/assets/{right-panel-registry-BAJ6TuEY.js → right-panel-registry-BkBAryPm.js} +2 -2
- package/dist/web/client/assets/routes-DgbWbQOu.js +14 -0
- package/dist/web/client/assets/{session-activity-panel-DwaXiSrS.js → session-activity-panel-BloVPsLJ.js} +1 -1
- package/dist/web/client/assets/{session-tool-renderer-DEABxZG3.js → session-tool-renderer-CGMatufW.js} +1 -1
- package/dist/web/client/assets/{subagent-chat-panel-R2RoX1Yt.js → subagent-chat-panel-xm-zBsFL.js} +1 -1
- package/dist/web/client/assets/{subagent-transcript-DVZhMo7a.js → subagent-transcript-BzToBVWk.js} +1 -1
- package/dist/web/client/assets/{subagents-panel-CMMRUP8F.js → subagents-panel-B5ooG4sS.js} +1 -1
- package/dist/web/client/assets/{tool-part-normalizer-CF6bmJ0s.js → tool-part-normalizer-CJ2sY87r.js} +1 -1
- package/dist/web/client/assets/{tool-result-7qREIVv_.js → tool-result-C_RIixge.js} +4 -4
- package/dist/web/client/assets/{tool-timeline-CGhwMeNl.js → tool-timeline-BVY5VQ3a.js} +2 -2
- package/dist/web/client/assets/{use-reduced-motion-CFEp5oKr.js → use-reduced-motion-69Ji0Qlf.js} +1 -1
- package/dist/web/client/assets/workspace-panel-DsZZnfkm.js +1 -0
- package/dist/web/client/bundle-budget.json +5 -5
- package/dist/web/server/{_tanstack-start-manifest_v-Io433TLr-YWPNQWQI.js → _tanstack-start-manifest_v-CGHXgy5L-KSOQEPW7.js} +9 -9
- package/dist/web/server/{artifacts-panel-cYqS54cM-K6SF3K6W.js → artifacts-panel-CHPMYc6C-OWIYGSRM.js} +5 -5
- package/dist/web/server/{chat-command-palette-BDnwcymZ-DSTFIAOD.js → chat-command-palette-VF4C0ttN-GY52QBFP.js} +3 -3
- package/dist/web/server/{chunk-RX2ZJARF.js → chunk-4OLRCVML.js} +2 -21
- package/dist/web/server/{chunk-W2GI7NRX.js → chunk-7DUB7HGF.js} +43 -38
- package/dist/web/server/{chunk-37EK2TYH.js → chunk-GW7HYECO.js} +169 -528
- package/dist/web/server/{chunk-FI3UF2GW.js → chunk-LYJ3XDEZ.js} +5 -5
- package/dist/web/server/{chunk-2OC2FKHR.js → chunk-MDGXRDJM.js} +3 -3
- package/dist/web/server/{chunk-W7GGECTL.js → chunk-NDU4LK5M.js} +3 -3
- package/dist/web/server/{chunk-NSFKPEFI.js → chunk-P3ZJ6L7V.js} +2 -2
- package/dist/web/server/{chunk-KBMRRJQN.js → chunk-PBNUO4IN.js} +2 -2
- package/dist/web/server/{chunk-RHJEOG37.js → chunk-W72ZBCJ5.js} +4 -4
- package/dist/web/server/{create-project-dialog-BS5Sva46-BO4RLW2Q.js → create-project-dialog-CSZHeLNg-EEW3DRTY.js} +3 -3
- package/dist/web/server/{model-selector-list-By_G7_Hr-GXT27BZO.js → model-selector-list-q8bMnmhy-SPFJGUBT.js} +2 -2
- package/dist/web/server/{openui-renderer-Q31y65CQ-QNVSP4NN.js → openui-renderer-BkDeIpwC-S5BOLH5L.js} +2 -2
- package/dist/web/server/{resources-panel-CH8sG0Od-4BZN6SLY.js → resources-panel-tCQCqEQv-NJO5FRHW.js} +4 -4
- package/dist/web/server/{router-8EzTM9Eq-COVGJKKX.js → router-DBc-HYGW-CC6DTCFR.js} +1 -1
- package/dist/web/server/{routes-88H0fiN3-WIAZJ3RT.js → routes-CcRh_tDy-M7ZRBLVA.js} +2 -2
- package/dist/web/server/server.js +2 -2
- package/dist/web/server/{session-activity-panel-CgSOde03-B5RCAGB4.js → session-activity-panel-CS56rTyW-J4GAZSTC.js} +4 -4
- package/dist/web/server/{session-reasoning-panel-Dmny6YTk-D3HQV2YB.js → session-reasoning-panel-DlqaQNE2-RMOBVYVD.js} +3 -3
- package/dist/web/server/{session-tool-renderer-BrnTO2w3-V6EE6AB2.js → session-tool-renderer-CHYJwJej-Z3K5TRIZ.js} +4 -4
- package/dist/web/server/{session-tree-panel-BEqR_cAJ-TZS7VRCB.js → session-tree-panel-B2GT3Hf_-WGHVVRRR.js} +3 -3
- package/dist/web/server/{settings-dialog-DkesVBrS-BAAA3YNU.js → settings-dialog-7V9x-CPC-6IEB2DFH.js} +4 -4
- package/dist/web/server/{subagent-chat-panel-Bfmt1bCE-DKDVH3NJ.js → subagent-chat-panel-Cjg1oOFO-PNWSFYNA.js} +7 -7
- package/dist/web/server/{subagents-panel-ChJDDvad-GNCHDTPB.js → subagents-panel-DPfqOHdw-B74PSAMP.js} +7 -7
- package/dist/web/server/{workspace-panel-Cij_JylD-WPYSV5FA.js → workspace-panel-DRaU8AWD-7AYOEM55.js} +4 -4
- package/package.json +1 -1
- package/dist/web/client/assets/globals-DDDleTbS.css +0 -2
- package/dist/web/client/assets/routes--tnF7d6H.js +0 -14
- package/dist/web/client/assets/workspace-panel-Da5I4p_t.js +0 -1
package/dist/web/client/assets/{tool-part-normalizer-CF6bmJ0s.js → tool-part-normalizer-CJ2sY87r.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/openui-renderer-DG-iML7M.js","assets/rolldown-runtime-hePW80VL.js","assets/react-Cvdyeg_0.js","assets/react-dom-B7th3XGm.js","assets/jsx-runtime-NZYk81nU.js","assets/with-selector-B_VDO56x.js","assets/utils-oBThwhjm.js","assets/card-Dj1SnGUU.js","assets/useButton-CvcmqA2s.js","assets/FloatingPortal-D8-EPDs2.js","assets/createBaseUIEventDetails-DIxvaz-Y.js","assets/select-DYh951qi.js","assets/useScrollLock-BcsteNzT.js","assets/useBaseUiId-lKfDDIcw.js","assets/check-BTwIaCtI.js","assets/createLucideIcon-CQY2ECfR.js","assets/chevron-down-Bse1ggZM.js","assets/input-CBoTMPC_.js","assets/useControlled-CkQSkSv1.js","assets/surfaces-BUjUJTyD.js","assets/open-panel-action-message-SdA1VU42.js","assets/chat-hpzV6IA6.js","assets/markdown-CvBfbPCn.js","assets/file-code-corner-BkDULqko.js","assets/button-CWYjn8Zk.js","assets/dist-BogNzeK9.js","assets/clsx-DB0hHKMi.js","assets/preload-helper-BLdHbfdN.js","assets/chunk-D32TOXHM-BM74MRmz.js","assets/space-separated-tokens-Ciu5hotc.js","assets/lib-CJ9xR_xY.js","assets/lib-BvGd2E-G.js","assets/code-block-pKKmFZ5w.js","assets/arrow-left-Bfkw0vUM.js","assets/createLucideIcon-CR62Fawq.js","assets/arrow-up-CzxAS3J9.js","assets/blocks-BmVH6RoL.js","assets/boxes-P3I8BDys.js","assets/calendar-days-CXqvsoor.js","assets/check-check-Btqs36TD.js","assets/check-IbKELFd2.js","assets/chevron-down-D5amraNy.js","assets/chevron-left-AyR1xUDb.js","assets/chevron-right-E-3OemuN.js","assets/chevron-up-DCTJ3XA-.js","assets/circle-alert-CSVDHZOw.js","assets/copy-CLOAxiYY.js","assets/ellipsis-dxrmXw37.js","assets/globe-eVRxbI0y.js","assets/image-1Usfao59.js","assets/info-DJfctP7D.js","assets/lightbulb-BwqxgRpD.js","assets/link-DreltefI.js","assets/list-VCLXYdos.js","assets/loader-circle-BAwTuoks.js","assets/menu-ykZJO64E.js","assets/message-square-CZNlkRgV.js","assets/panel-left-D8Dtrg9O.js","assets/rotate-ccw-3h4Oynp3.js","assets/search-yqNIhSMn.js","assets/share-2-2ysz1TZP.js","assets/square-code-BL_X7jLn.js","assets/square-pen-C4QgEtsH.js","assets/square-DS8IK_lK.js","assets/trash-2-BhumKxcC.js","assets/type-H-QEoR0y.js","assets/x-CXE81yPy.js","assets/character-entities-legacy-Wut6vMuj.js","assets/alert-CzWGeumf.js","assets/badge-CzQFgmVK.js","assets/useRender-CzJUrRlB.js","assets/dist-BJJVCio8.js","assets/provider-catalog-CLEDlH_v.js","assets/dialog-CK8dym6z.js","assets/DialogTitle-BlVq-tcv.js","assets/x-DEU6H3M-.js","assets/switch-BrxDfsX6.js","assets/safe-external-url-D3PJJIcM.js","assets/openui-utils-DawGoQNp.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./react-Cvdyeg_0.js";import{t as n}from"./react-dom-B7th3XGm.js";import{t as r}from"./jsx-runtime-NZYk81nU.js";import{n as i,r as a,t as o}from"./utils-oBThwhjm.js";import{o as s,r as c,u as l}from"./ease-DYVhTl2n.js";import{n as u,t as d}from"./use-reduced-motion-CFEp5oKr.js";import{o as f}from"./useButton-CvcmqA2s.js";import{t as p}from"./createLucideIcon-CQY2ECfR.js";import{t as m}from"./chevron-right-BPCB1mOg.js";import{n as h,t as g}from"./file-text-cqOanUYv.js";import{t as _}from"./circle-check-DBhaebaM.js";import{n as v}from"./wrench-BXX_Ah2s.js";import{a as y,n as b,t as x}from"./tool-output-normalizer-DDU09Zc6.js";import{t as S}from"./loader-circle-BmKYM_C4.js";import{t as C}from"./x-DEU6H3M-.js";import{t as w}from"./dist-BogNzeK9.js";import{t as T}from"./preload-helper-BLdHbfdN.js";import{t as E}from"./useRender-CzJUrRlB.js";import{t as D}from"./openui-utils-DawGoQNp.js";import"./tokens-DinEQBG4.js";import{i as O}from"./workspace-path-nav-D-77sJ_A.js";import{t as k}from"./reasoning-line-DGdPUMwT.js";import{t as A}from"./use-hover-capable-CLq8BADD.js";import{a as j,c as M,i as N,n as P,o as F,r as I,s as L,t as R}from"./trace-IsV5RRvM.js";var z={name:`chevron-left`,size:24,node:[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]};z.node;var B=p(z),V={name:`file-braces`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1`,key:`1oajmo`}],[`path`,{d:`M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1`,key:`mpwhp6`}]],aliases:[`file-json`]};V.node;var ee=p(V),H={name:`file-code`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 12.5 8 15l2 2.5`,key:`1tg20x`}],[`path`,{d:`m14 12.5 2 2.5-2 2.5`,key:`yinavb`}]]};H.node;var te=p(H),ne={name:`rotate-cw`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]};ne.node;var re=p(ne),U=e(t(),1),W=r(),ie=(0,U.lazy)(()=>T(async()=>{let{GenerativeTextRenderer:e}=await import(`./openui-renderer-DG-iML7M.js`);return{GenerativeTextRenderer:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78])).then(({GenerativeTextRenderer:e})=>({default:e})));function ae({className:e,content:t}){return(0,W.jsx)(`div`,{className:e?`${e} whitespace-pre-wrap`:`whitespace-pre-wrap`,children:t})}function oe(e){return(0,U.useMemo)(()=>D(e.content).some(e=>e.type===`openui`),[e.content])?(0,W.jsx)(U.Suspense,{fallback:(0,W.jsx)(ae,{className:e.className,content:e.content}),children:(0,W.jsx)(ie,{...e})}):(0,W.jsx)(O,{className:e.className,content:e.content,isStreaming:e.isStreaming})}function se(e){return e.status===`running`||e.status===`recovering`?`streaming`:e.status===`error`||e.status===`failed`?`error`:`ready`}function ce(e,t){let n=new Map(e.map(e=>[e.id,e])),r=new Set,i=[],a=e=>{if(r.has(e))return;r.add(e);let o=n.get(e);o&&i.push(o);for(let n of t?.nodes[e]?.childrenIds??[])a(n)};for(let e of t?.rootChildrenIds??[])a(e);for(let t of e)a(t.id);return i}function le(e){return e===`done`?(0,W.jsx)(_,{className:`size-3.5 text-success`}):e===`error`||e===`failed`?(0,W.jsx)(h,{className:`size-3.5 text-destructive`}):e===`cancelled`?(0,W.jsx)(v,{className:`size-3.5 text-muted-foreground`}):e===`recovering`?(0,W.jsx)(re,{className:`size-3.5 animate-spin text-warning`}):(0,W.jsx)(S,{className:`size-3.5 animate-spin text-primary`})}var G=(0,U.createContext)({from:`assistant`}),ue={type:`spring`,stiffness:480,damping:32,mass:.62},de={duration:.12,ease:c,delay:.04};function fe({from:e,animateIn:t=!1,children:n,className:r,initial:i,animate:a,transition:s,exit:c,style:u,...f}){let p=d()??!1,m=(0,U.useMemo)(()=>({from:e}),[e]);return(0,W.jsx)(G.Provider,{value:m,children:(0,W.jsx)(l.article,{"data-slot":`message`,"data-from":e,"aria-label":f[`aria-label`]??`${e} message`,initial:i??(t&&!p?{opacity:0,transform:`translateY(8px) scale(0.95)`}:!1),animate:a??(t&&!p?{opacity:1,transform:`translateY(0px) scale(1)`}:{opacity:1}),exit:c??(p?{opacity:0}:{opacity:0,transform:`translateY(-3px) scale(0.99)`}),transition:s??(p?{duration:.12}:ue),style:{transformOrigin:e===`user`?`100% 100%`:`0% 100%`,...u},className:o(`group/message flex w-full items-start gap-2`,e===`user`?`flex-row-reverse`:`flex-row`,r),...f,children:n})})}function pe({className:e,...t}){let{from:n}=(0,U.useContext)(G);return(0,W.jsx)(`div`,{"data-slot":`message-content`,className:o(`flex min-w-0 flex-1 flex-col gap-1.5`,n===`user`?`items-end`:`items-start`,e),...t})}function me({variant:e=`ghost`,align:t,className:n,children:r,initial:i,animate:a,exit:c,transition:u,layout:f,...p}){let m=d()??!1,{from:h}=(0,U.useContext)(G),g=t??(h===`user`?`end`:`start`);return(0,W.jsx)(l.div,{"data-slot":`message-bubble`,"data-align":g,"data-variant":e,layout:f,initial:i??!1,animate:a,exit:c??(m?{opacity:0}:{opacity:0,y:-3,scale:.99}),transition:u??(m?{duration:.12}:s),className:o(`group/bubble flex w-full flex-col`,g===`end`?`items-end`:`items-start`,n),...p,children:r})}function he({className:e,children:t,ref:n,...r}){let i=d()??!1;return(0,W.jsx)(`div`,{ref:n,"data-slot":`message-bubble-content`,className:o(`relative z-0 w-full max-w-none min-w-9 text-sm leading-6 text-foreground`,e),...r,children:(0,W.jsx)(l.div,{initial:!1,animate:{opacity:1},transition:i?{duration:.12,ease:c}:de,className:`relative`,children:t})})}var K=56,ge=88;function _e(e,t){if(e.length<=t)return e;let n=e.slice(0,t),r=n.lastIndexOf(` `);return`${n.slice(0,r>t*.65?r:t).trim()}…`}function q(e){return((e.querySelector(`[data-slot="message-bubble-content"]`)??e.querySelector(`[data-slot="message-content"]`)??e).textContent??``).replace(/\s+/g,` `).trim()}function ve(e,t){let n=q(e);if(!n)return{label:`Message`,description:void 0};if(n.length<=K){let e=t?q(t):``;return{label:n,description:e?_e(e,ge):void 0}}let r=n.slice(0,K).lastIndexOf(` `),i=r>K*.65?r:K,a=`${n.slice(0,i).trim()}…`,o=t?q(t):n.slice(i).trim();return{label:a,description:o?_e(o,ge):void 0}}function ye({navigation:e,followThreshold:t,contentRef:n,viewportRef:r,reduce:i,smooth:a,scrollToEnd:o,setFollowing:s,markProgrammaticScroll:c}){let l=(0,U.useRef)(void 0),u=(0,U.useRef)(new WeakMap),d=(0,U.useRef)(0),f=(0,U.useRef)(new Map),[p,m]=(0,U.useState)([]),[h,g]=(0,U.useState)(``),[_,v]=(0,U.useState)(!1),y=(0,U.useCallback)(()=>{if(e!==`rail`)return;let n=r.current,i=[...f.current.entries()];if(!n||i.length===0)return;let a=n.getBoundingClientRect();if(n.scrollTop<=t){let e=i[0]?.[0]??``;g(t=>t===e?t:e);return}if(n.scrollHeight-n.scrollTop-n.clientHeight<=t){let e=i.at(-1)?.[0]??``;g(t=>t===e?t:e);return}let o=a.top+a.height/2,s=i[0]?.[0]??``,c=1/0;for(let[e,t]of i){let n=t.getBoundingClientRect(),r=Math.abs(n.top+n.height/2-o);r<c&&(c=r,s=e)}g(e=>e===s?e:s)},[t,e,r]),b=(0,U.useCallback)(()=>{if(e!==`rail`)return;let t=n.current,i=r.current;if(!t||!i)return;let a=Array.from(t.querySelectorAll(`[data-slot="message"]`)),o=new Map,s=a.map((e,t)=>{let n=u.current.get(e);n||(d.current+=1,n=`message-rail-${d.current}`,u.current.set(e,n)),o.set(n,e);let r=e.dataset.from??`conversation`,i=ve(e,r===`user`?a.slice(t+1).find(e=>e.dataset.from===`assistant`):void 0);return{id:n,label:i.label,description:i.description,ariaLabel:`Go to ${r} message ${t+1} of ${a.length}`}});f.current=o,m(e=>e.length===s.length&&e.every((e,t)=>e.id===s[t]?.id&&e.label===s[t]?.label&&e.description===s[t]?.description&&e.ariaLabel===s[t]?.ariaLabel)?e:s),v(i.scrollHeight>i.clientHeight+1&&a.length>1)},[n,e,r]),x=(0,U.useCallback)(()=>{e===`rail`&&(l.current&&cancelAnimationFrame(l.current),l.current=requestAnimationFrame(()=>{b(),y()}))},[e,b,y]);return(0,U.useEffect)(()=>{if(e!==`rail`){f.current.clear(),m([]),v(!1);return}let t=n.current,i=r.current;if(!t||!i)return;x();let a=typeof MutationObserver>`u`?null:new MutationObserver(x);a?.observe(t,{childList:!0,characterData:!0,subtree:!0});let o=typeof ResizeObserver>`u`?null:new ResizeObserver(x);return o?.observe(t),o?.observe(i),()=>{a?.disconnect(),o?.disconnect()}},[n,e,x,r]),(0,U.useEffect)(()=>()=>{l.current&&cancelAnimationFrame(l.current)},[]),{activeRailId:h,railItems:p,railOverflowing:_,scheduleRailSync:x,scrollToRailItem:(0,U.useCallback)(e=>{let t=r.current,n=f.current.get(e.id);if(!t||!n)return;let l=p.at(-1)?.id===e.id;if(g(e.id),l){s(!0),o(i||!a?`auto`:`smooth`);return}s(!1),c(i||!a?`auto`:`smooth`);let u=t.getBoundingClientRect(),d=n.getBoundingClientRect(),m=t.scrollTop+d.top-u.top-(t.clientHeight-d.height)/2,h=i||!a?`auto`:`smooth`;typeof t.scrollTo==`function`?t.scrollTo({top:m,behavior:h}):t.scrollTop=m},[c,p,i,o,s,a,r])}}function be({item:e}){return(0,W.jsxs)(`div`,{"data-slot":`preview-rail-card`,className:`rounded-2xl border border-border bg-card p-4 shadow-sm`,children:[(0,W.jsx)(`p`,{"data-slot":`preview-rail-title`,className:`font-medium text-card-foreground`,children:e.label}),e.description?(0,W.jsx)(`div`,{"data-slot":`preview-rail-description`,className:`mt-1 text-sm leading-6 text-muted-foreground`,children:e.description}):null]})}function xe({items:e,label:t=`Section navigation`,orientation:n=`vertical`,activeId:r,defaultActiveId:i,onActiveChange:a,onItemSelect:f,renderPreview:p,showPreview:m=!0,previewSide:h=`after`,highlightActive:g=!1,itemSize:_=24,children:v,className:y,railClassName:b,previewContainerClassName:x,previewClassName:S}){let C=(0,U.useId)(),w=d(),T=A(),[E,D]=(0,U.useState)(i??e[0]?.id??``),[O,k]=(0,U.useState)(null),[j,M]=(0,U.useState)(null),N=r??E,P=e.some(e=>e.id===N)?N:e[0]?.id??``,F=O??j??``,I=F||(g?P:``),L=e.findIndex(e=>e.id===I),R=e.length?`repeat(${e.length}, ${_}px)`:void 0,z=n===`horizontal`,B=e=>{r===void 0&&D(e),a?.(e)};return(0,W.jsxs)(l.div,{layoutRoot:!0,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||M(null)},className:o(`isolate relative flex w-full overflow-visible`,z?`min-h-64 flex-col items-center justify-center`:`min-h-80`,y),children:[(0,W.jsx)(`nav`,{"aria-label":t,onPointerLeave:()=>k(null),style:z?{gridTemplateColumns:R}:{gridTemplateRows:R},className:o(`relative z-10 grid shrink-0`,z?`h-12 w-fit max-w-full self-center justify-center`:`w-12 content-center`,b),children:e.map((e,t)=>{let n=e.id===P,r=e.id===I,i=L<0?1/0:Math.abs(t-L),a=r?1:i===1?.68:i===2?.44:.25,c=(0,W.jsx)(W.Fragment,{children:(0,W.jsx)(l.span,{"data-slot":`preview-rail-tick`,"aria-hidden":`true`,animate:z?{scaleY:a}:{scaleX:a},transition:w?{duration:0}:s,className:o(`block bg-current`,z?`h-12 w-0.5 origin-bottom`:`h-0.5 w-12 origin-left`,r?`text-foreground`:void 0)})}),u=o(`relative flex text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background`,z?`h-12 w-6 items-end justify-center`:`h-6 w-12 items-center`),d=z?{width:_}:{height:_},p=()=>{T&&k(e.id)},m=t=>{t.matches(`:focus-visible`)&&M(e.id)},h=()=>{B(e.id),f?.(e)};return e.href?(0,W.jsx)(`a`,{"data-slot":`preview-rail-item`,href:e.href,target:e.target,rel:e.rel??(e.target===`_blank`?`noreferrer noopener`:void 0),"aria-label":e.ariaLabel??e.label,"aria-current":n?`page`:void 0,onPointerEnter:p,onMouseEnter:p,onPointerDown:()=>M(null),onFocus:e=>m(e.currentTarget),onClick:h,style:d,className:u,children:c},e.id):(0,W.jsx)(`button`,{"data-slot":`preview-rail-item`,type:`button`,"aria-label":e.ariaLabel??e.label,"aria-current":n?`location`:void 0,onPointerEnter:p,onMouseEnter:p,onPointerDown:()=>M(null),onFocus:e=>m(e.currentTarget),onClick:h,style:d,className:u,children:c},e.id)})}),m?(0,W.jsx)(`div`,{"aria-hidden":`true`,style:z?{gridTemplateColumns:R}:{gridTemplateRows:R},className:o(`pointer-events-none absolute z-50 grid`,z?`top-1/2 left-1/2 h-5 w-fit max-w-full -translate-x-1/2 -translate-y-1/2 justify-center`:h===`before`?`inset-y-0 right-16 left-4 content-center`:`inset-y-0 right-4 left-16 content-center`,x),children:e.map(e=>(0,W.jsx)(`div`,{style:z?{width:_}:{height:_},className:o(`relative flex items-center`,z?`justify-center`:void 0),children:(0,W.jsx)(u,{mode:`wait`,initial:!1,children:e.id===F?(0,W.jsx)(l.div,{initial:w?{opacity:0}:{opacity:0,y:4,filter:`blur(6px)`},animate:w?{opacity:1}:{opacity:1,y:0,filter:`blur(0px)`},exit:w?{opacity:0}:{opacity:0,y:-2,filter:`blur(4px)`,transition:{duration:.12,ease:c}},transition:{duration:w?0:.18,ease:c},className:o(z?`absolute bottom-12 left-1/2 w-72 -translate-x-1/2`:o(`w-full max-w-sm`,h===`before`&&`ml-auto`),S),children:(0,W.jsx)(l.div,{layoutId:`preview-rail-card-${C}`,transition:w?{duration:0}:s,children:p?p(e):(0,W.jsx)(be,{item:e})})},e.id):null})},e.id))}):null,v?(0,W.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1`,children:v}):null]})}function Se({followOutput:e=!0,followThreshold:t=56,smooth:n=!0,onFollowChange:r,label:i=`Conversation`,busy:a,navigation:s,navigationLabel:c=`Message navigation`,viewportClassName:l,contentClassName:u,railClassName:f,viewportRef:p,viewportProps:m,contentProps:h,className:g,children:_,...v}){let y=d()??!1,b=(0,U.useRef)(null),x=(0,U.useRef)(null),S=(0,U.useRef)(e),C=(0,U.useRef)(!1),w=(0,U.useRef)(void 0),T=(0,U.useRef)(void 0),{onScroll:E,onWheel:D,onTouchStart:O,onKeyDown:k,...A}=m??{},j=(0,U.useCallback)(e=>{b.current=e,typeof p==`function`?p(e):p&&(p.current=e)},[p]),M=(0,U.useCallback)(e=>{S.current!==e&&(S.current=e,r?.(e))},[r]),N=(0,U.useCallback)(e=>{C.current=!0,w.current&&window.clearTimeout(w.current),w.current=window.setTimeout(()=>{C.current=!1},e===`smooth`?320:0)},[]),P=(0,U.useCallback)(e=>{let t=b.current;t&&(N(e),typeof t.scrollTo==`function`?t.scrollTo({top:t.scrollHeight,behavior:e}):t.scrollTop=t.scrollHeight)},[N]),{activeRailId:F,railItems:I,railOverflowing:L,scheduleRailSync:R,scrollToRailItem:z}=ye({navigation:s,followThreshold:t,contentRef:x,viewportRef:b,reduce:y,smooth:n,scrollToEnd:P,setFollowing:M,markProgrammaticScroll:N}),B=(0,U.useEffectEvent)(R),V=(0,U.useEffectEvent)(P),ee=(0,U.useCallback)(()=>{let e=b.current;if(!e||C.current)return;let n=e.scrollHeight-e.scrollTop-e.clientHeight;M(n<=t),R()},[t,R,M]),H=(0,U.useCallback)(()=>{C.current=!1},[]);(0,U.useLayoutEffect)(()=>{if(S.current=e,e)return T.current=requestAnimationFrame(()=>V(`auto`)),()=>{T.current&&cancelAnimationFrame(T.current)}},[e]),(0,U.useEffect)(()=>{let t=x.current;if(!t||typeof ResizeObserver>`u`)return;let r=new ResizeObserver(()=>{B(),!(!e||!S.current)&&V(y||!n?`auto`:`smooth`)});return r.observe(t),()=>r.disconnect()},[e,y,n]),(0,U.useEffect)(()=>()=>{w.current&&window.clearTimeout(w.current),T.current&&cancelAnimationFrame(T.current)},[]);let te=(0,W.jsx)(`section`,{ref:j,"aria-label":i,...A,onScroll:e=>{ee(),E?.(e)},onWheel:e=>{H(),D?.(e)},onTouchStart:e=>{H(),O?.(e)},onKeyDown:e=>{[`ArrowUp`,`PageUp`,`Home`].includes(e.key)&&H(),k?.(e)},className:o(`h-full overflow-y-auto overscroll-contain outline-none [overflow-anchor:none] focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,s===`rail`?`[-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden`:`[scrollbar-gutter:stable]`,l,s===`rail`&&L&&`pr-10`),children:(0,W.jsx)(`div`,{ref:x,role:`log`,"aria-live":a?`off`:`polite`,"aria-relevant":`additions text`,"aria-busy":a,className:u,...h,children:_})});return(0,W.jsx)(`div`,{"data-slot":`message-scroller`,className:o(`min-h-0`,g),...v,children:s===`rail`?(0,W.jsx)(xe,{items:L?I:[],label:c,activeId:F,onItemSelect:z,previewSide:`before`,highlightActive:!0,itemSize:14,className:`h-full min-h-0 overflow-hidden`,previewContainerClassName:`right-8 left-3`,previewClassName:`mr-1 w-64 max-w-full [&_[data-slot=preview-rail-card]]:h-20 [&_[data-slot=preview-rail-card]]:overflow-hidden [&_[data-slot=preview-rail-card]]:p-3 [&_[data-slot=preview-rail-title]]:line-clamp-1 [&_[data-slot=preview-rail-title]]:text-xs [&_[data-slot=preview-rail-title]]:leading-4 [&_[data-slot=preview-rail-description]]:line-clamp-2 [&_[data-slot=preview-rail-description]]:text-xs [&_[data-slot=preview-rail-description]]:leading-4`,railClassName:o(`absolute inset-y-3 right-1 w-7 content-center py-1 [&_[data-slot=preview-rail-item]]:w-7 [&_[data-slot=preview-rail-item]]:justify-end [&_[data-slot=preview-rail-tick]]:h-px [&_[data-slot=preview-rail-tick]]:w-4 [&_[data-slot=preview-rail-tick]]:origin-right`,L?`pointer-events-auto opacity-100`:`pointer-events-none opacity-0`,f),children:te}):te})}function J(e){return typeof e==`object`&&!!e}function Ce(e){return J(e)&&e.type===`text`&&typeof e.text==`string`}function we(e){return J(e)&&e.type===`error`&&typeof e.message==`string`}function Te(e){return J(e)&&e.type===`payload`&&typeof e.kind==`string`&&typeof e.title==`string`}function Y(e){if(!J(e))return!1;let t=e.type;return t===`dynamic-tool`||typeof t==`string`&&t.startsWith(`tool-`)}function Ee(e){if(typeof e==`string`)return e;if(e===void 0)return``;try{return JSON.stringify(e,null,2)??``}catch{return String(e)}}function De({part:e}){let t=Ee(e.payload);return e.kind===`agent_message`?t||e.text?(0,W.jsxs)(`section`,{"data-payload-kind":e.kind,className:`w-full min-w-0 text-xs text-muted-foreground`,children:[e.text?(0,W.jsx)(`pre`,{className:`m-0 whitespace-pre-wrap break-words p-3 font-mono text-xs leading-5 text-foreground/80`,children:e.text}):null,t?(0,W.jsxs)(`details`,{children:[(0,W.jsx)(`summary`,{className:`w-fit cursor-pointer py-1 font-medium`,children:`Details`}),(0,W.jsx)(`pre`,{className:`m-0 max-h-60 overflow-auto whitespace-pre-wrap break-words border-l border-border pl-3 font-mono text-xs leading-5`,children:t})]}):null]}):null:(0,W.jsxs)(`section`,{"data-payload-kind":e.kind,className:`w-full min-w-0 overflow-hidden rounded-xl border border-border/60 bg-muted/40 text-sm`,children:[e.title===`Details`?null:(0,W.jsx)(`div`,{className:`border-b border-border/50 px-3 py-2 text-xs font-medium text-muted-foreground`,children:e.title}),e.text?(0,W.jsx)(`pre`,{className:`m-0 whitespace-pre-wrap break-words p-3 font-mono text-xs leading-5 text-foreground/80`,children:e.text}):null,t?(0,W.jsxs)(`details`,{className:`border-t border-border/50 px-3 py-2`,children:[(0,W.jsx)(`summary`,{className:`cursor-pointer text-xs font-medium text-muted-foreground`,children:`Payload`}),(0,W.jsx)(`pre`,{className:`m-0 mt-2 max-w-full whitespace-pre-wrap break-words font-mono text-xs leading-5 text-foreground/70`,children:t})]}):null]})}var Oe=[],ke=(0,U.memo)(function({title:e=`Unable to complete request`,message:t,className:n}){return(0,W.jsx)(`div`,{className:o(`flex justify-start`,n),children:(0,W.jsxs)(`div`,{className:`rounded-lg border border-destructive/30 bg-destructive/10 px-4 py-2.5 text-sm text-foreground`,children:[(0,W.jsx)(`div`,{className:`font-medium text-foreground`,children:e}),(0,W.jsx)(`div`,{className:`mt-0.5 text-muted-foreground`,children:t})]})})}),Ae=`tool-call:`,je=`unkeyed-tool:`;function Me(e,t,n){return t.toolCallId?`${Ae}${t.toolCallId}`:`${je}${e}:${t.type}:${n}`}function Ne(e,t){let{messageId:n,isLast:r,isStreaming:i,suppressTextWhenPlanWrite:a=!1,ToolRendererComponent:o,TextRendererComponent:s,toolRenderers:c,onOpenUIAction:l,onOpenUIArtifactReady:u,onOpenArtifact:d,artifactByToolCallId:f,onOpenToolArtifact:p}=t,m=[],h=[],g=a&&e.some(e=>Y(e)&&e.type===`tool-PlanWrite`),_=new Set(e.filter(e=>Y(e)&&(e.type===`tool-Task`||e.type===`tool-Agent`)&&typeof e.toolCallId==`string`).map(e=>e.toolCallId)),v=new Map,y=new Set,S=new Map,C=()=>{let e=h.splice(0).join(`
|
|
2
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./react-Cvdyeg_0.js";import{t as n}from"./react-dom-B7th3XGm.js";import{t as r}from"./jsx-runtime-NZYk81nU.js";import{n as i,r as a,t as o}from"./utils-oBThwhjm.js";import{l as s,o as c,r as l}from"./ease-nNJMFgD_.js";import{n as u,t as d}from"./use-reduced-motion-69Ji0Qlf.js";import{o as f}from"./useButton-CvcmqA2s.js";import{t as p}from"./createLucideIcon-CQY2ECfR.js";import{t as m}from"./chevron-right-BPCB1mOg.js";import{n as h,t as g}from"./file-text-cqOanUYv.js";import{t as _}from"./circle-check-DBhaebaM.js";import{n as v}from"./wrench-BXX_Ah2s.js";import{a as y,n as b,t as x}from"./tool-output-normalizer-DDU09Zc6.js";import{t as S}from"./loader-circle-BmKYM_C4.js";import{t as C}from"./x-DEU6H3M-.js";import{t as w}from"./dist-BogNzeK9.js";import{t as T}from"./preload-helper-BLdHbfdN.js";import{t as E}from"./useRender-CzJUrRlB.js";import{t as D}from"./openui-utils-DawGoQNp.js";import"./tokens-DinEQBG4.js";import{i as O}from"./workspace-path-nav-D-77sJ_A.js";import{t as k}from"./reasoning-line-DGdPUMwT.js";import{t as A}from"./use-hover-capable-CLq8BADD.js";import{a as j,c as M,i as N,n as P,o as F,r as I,s as L,t as R}from"./trace-IsV5RRvM.js";var z={name:`chevron-left`,size:24,node:[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]};z.node;var B=p(z),V={name:`file-braces`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1`,key:`1oajmo`}],[`path`,{d:`M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1`,key:`mpwhp6`}]],aliases:[`file-json`]};V.node;var ee=p(V),H={name:`file-code`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 12.5 8 15l2 2.5`,key:`1tg20x`}],[`path`,{d:`m14 12.5 2 2.5-2 2.5`,key:`yinavb`}]]};H.node;var te=p(H),ne={name:`rotate-cw`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]};ne.node;var re=p(ne),U=e(t(),1),W=r(),ie=(0,U.lazy)(()=>T(async()=>{let{GenerativeTextRenderer:e}=await import(`./openui-renderer-DG-iML7M.js`);return{GenerativeTextRenderer:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78])).then(({GenerativeTextRenderer:e})=>({default:e})));function ae({className:e,content:t}){return(0,W.jsx)(`div`,{className:e?`${e} whitespace-pre-wrap`:`whitespace-pre-wrap`,children:t})}function oe(e){return(0,U.useMemo)(()=>D(e.content).some(e=>e.type===`openui`),[e.content])?(0,W.jsx)(U.Suspense,{fallback:(0,W.jsx)(ae,{className:e.className,content:e.content}),children:(0,W.jsx)(ie,{...e})}):(0,W.jsx)(O,{className:e.className,content:e.content,isStreaming:e.isStreaming})}function se(e){return e.status===`running`||e.status===`recovering`?`streaming`:e.status===`error`||e.status===`failed`?`error`:`ready`}function ce(e,t){let n=new Map(e.map(e=>[e.id,e])),r=new Set,i=[],a=e=>{if(r.has(e))return;r.add(e);let o=n.get(e);o&&i.push(o);for(let n of t?.nodes[e]?.childrenIds??[])a(n)};for(let e of t?.rootChildrenIds??[])a(e);for(let t of e)a(t.id);return i}function le(e){return e===`done`?(0,W.jsx)(_,{className:`size-3.5 text-success`}):e===`error`||e===`failed`?(0,W.jsx)(h,{className:`size-3.5 text-destructive`}):e===`cancelled`?(0,W.jsx)(v,{className:`size-3.5 text-muted-foreground`}):e===`recovering`?(0,W.jsx)(re,{className:`size-3.5 animate-spin text-warning`}):(0,W.jsx)(S,{className:`size-3.5 animate-spin text-primary`})}var G=(0,U.createContext)({from:`assistant`}),ue={type:`spring`,stiffness:480,damping:32,mass:.62},de={duration:.12,ease:l,delay:.04};function fe({from:e,animateIn:t=!1,children:n,className:r,initial:i,animate:a,transition:c,exit:l,style:u,...f}){let p=d()??!1,m=(0,U.useMemo)(()=>({from:e}),[e]);return(0,W.jsx)(G.Provider,{value:m,children:(0,W.jsx)(s.article,{"data-slot":`message`,"data-from":e,"aria-label":f[`aria-label`]??`${e} message`,initial:i??(t&&!p?{opacity:0,transform:`translateY(8px) scale(0.95)`}:!1),animate:a??(t&&!p?{opacity:1,transform:`translateY(0px) scale(1)`}:{opacity:1}),exit:l??(p?{opacity:0}:{opacity:0,transform:`translateY(-3px) scale(0.99)`}),transition:c??(p?{duration:.12}:ue),style:{transformOrigin:e===`user`?`100% 100%`:`0% 100%`,...u},className:o(`group/message flex w-full items-start gap-2`,e===`user`?`flex-row-reverse`:`flex-row`,r),...f,children:n})})}function pe({className:e,...t}){let{from:n}=(0,U.useContext)(G);return(0,W.jsx)(`div`,{"data-slot":`message-content`,className:o(`flex min-w-0 flex-1 flex-col gap-1.5`,n===`user`?`items-end`:`items-start`,e),...t})}function me({variant:e=`ghost`,align:t,className:n,children:r,initial:i,animate:a,exit:l,transition:u,layout:f,...p}){let m=d()??!1,{from:h}=(0,U.useContext)(G),g=t??(h===`user`?`end`:`start`);return(0,W.jsx)(s.div,{"data-slot":`message-bubble`,"data-align":g,"data-variant":e,layout:f,initial:i??!1,animate:a,exit:l??(m?{opacity:0}:{opacity:0,y:-3,scale:.99}),transition:u??(m?{duration:.12}:c),className:o(`group/bubble flex w-full flex-col`,g===`end`?`items-end`:`items-start`,n),...p,children:r})}function he({className:e,children:t,ref:n,...r}){let i=d()??!1;return(0,W.jsx)(`div`,{ref:n,"data-slot":`message-bubble-content`,className:o(`relative z-0 w-full max-w-none min-w-9 text-sm leading-6 text-foreground`,e),...r,children:(0,W.jsx)(s.div,{initial:!1,animate:{opacity:1},transition:i?{duration:.12,ease:l}:de,className:`relative`,children:t})})}var K=56,ge=88;function _e(e,t){if(e.length<=t)return e;let n=e.slice(0,t),r=n.lastIndexOf(` `);return`${n.slice(0,r>t*.65?r:t).trim()}…`}function q(e){return((e.querySelector(`[data-slot="message-bubble-content"]`)??e.querySelector(`[data-slot="message-content"]`)??e).textContent??``).replace(/\s+/g,` `).trim()}function ve(e,t){let n=q(e);if(!n)return{label:`Message`,description:void 0};if(n.length<=K){let e=t?q(t):``;return{label:n,description:e?_e(e,ge):void 0}}let r=n.slice(0,K).lastIndexOf(` `),i=r>K*.65?r:K,a=`${n.slice(0,i).trim()}…`,o=t?q(t):n.slice(i).trim();return{label:a,description:o?_e(o,ge):void 0}}function ye({navigation:e,followThreshold:t,contentRef:n,viewportRef:r,reduce:i,smooth:a,scrollToEnd:o,setFollowing:s,markProgrammaticScroll:c}){let l=(0,U.useRef)(void 0),u=(0,U.useRef)(new WeakMap),d=(0,U.useRef)(0),f=(0,U.useRef)(new Map),[p,m]=(0,U.useState)([]),[h,g]=(0,U.useState)(``),[_,v]=(0,U.useState)(!1),y=(0,U.useCallback)(()=>{if(e!==`rail`)return;let n=r.current,i=[...f.current.entries()];if(!n||i.length===0)return;let a=n.getBoundingClientRect();if(n.scrollTop<=t){let e=i[0]?.[0]??``;g(t=>t===e?t:e);return}if(n.scrollHeight-n.scrollTop-n.clientHeight<=t){let e=i.at(-1)?.[0]??``;g(t=>t===e?t:e);return}let o=a.top+a.height/2,s=i[0]?.[0]??``,c=1/0;for(let[e,t]of i){let n=t.getBoundingClientRect(),r=Math.abs(n.top+n.height/2-o);r<c&&(c=r,s=e)}g(e=>e===s?e:s)},[t,e,r]),b=(0,U.useCallback)(()=>{if(e!==`rail`)return;let t=n.current,i=r.current;if(!t||!i)return;let a=Array.from(t.querySelectorAll(`[data-slot="message"]`)),o=new Map,s=a.map((e,t)=>{let n=u.current.get(e);n||(d.current+=1,n=`message-rail-${d.current}`,u.current.set(e,n)),o.set(n,e);let r=e.dataset.from??`conversation`,i=ve(e,r===`user`?a.slice(t+1).find(e=>e.dataset.from===`assistant`):void 0);return{id:n,label:i.label,description:i.description,ariaLabel:`Go to ${r} message ${t+1} of ${a.length}`}});f.current=o,m(e=>e.length===s.length&&e.every((e,t)=>e.id===s[t]?.id&&e.label===s[t]?.label&&e.description===s[t]?.description&&e.ariaLabel===s[t]?.ariaLabel)?e:s),v(i.scrollHeight>i.clientHeight+1&&a.length>1)},[n,e,r]),x=(0,U.useCallback)(()=>{e===`rail`&&(l.current&&cancelAnimationFrame(l.current),l.current=requestAnimationFrame(()=>{b(),y()}))},[e,b,y]);return(0,U.useEffect)(()=>{if(e!==`rail`){f.current.clear(),m([]),v(!1);return}let t=n.current,i=r.current;if(!t||!i)return;x();let a=typeof MutationObserver>`u`?null:new MutationObserver(x);a?.observe(t,{childList:!0,characterData:!0,subtree:!0});let o=typeof ResizeObserver>`u`?null:new ResizeObserver(x);return o?.observe(t),o?.observe(i),()=>{a?.disconnect(),o?.disconnect()}},[n,e,x,r]),(0,U.useEffect)(()=>()=>{l.current&&cancelAnimationFrame(l.current)},[]),{activeRailId:h,railItems:p,railOverflowing:_,scheduleRailSync:x,scrollToRailItem:(0,U.useCallback)(e=>{let t=r.current,n=f.current.get(e.id);if(!t||!n)return;let l=p.at(-1)?.id===e.id;if(g(e.id),l){s(!0),o(i||!a?`auto`:`smooth`);return}s(!1),c(i||!a?`auto`:`smooth`);let u=t.getBoundingClientRect(),d=n.getBoundingClientRect(),m=t.scrollTop+d.top-u.top-(t.clientHeight-d.height)/2,h=i||!a?`auto`:`smooth`;typeof t.scrollTo==`function`?t.scrollTo({top:m,behavior:h}):t.scrollTop=m},[c,p,i,o,s,a,r])}}function be({item:e}){return(0,W.jsxs)(`div`,{"data-slot":`preview-rail-card`,className:`rounded-2xl border border-border bg-card p-4 shadow-sm`,children:[(0,W.jsx)(`p`,{"data-slot":`preview-rail-title`,className:`font-medium text-card-foreground`,children:e.label}),e.description?(0,W.jsx)(`div`,{"data-slot":`preview-rail-description`,className:`mt-1 text-sm leading-6 text-muted-foreground`,children:e.description}):null]})}function xe({items:e,label:t=`Section navigation`,orientation:n=`vertical`,activeId:r,defaultActiveId:i,onActiveChange:a,onItemSelect:f,renderPreview:p,showPreview:m=!0,previewSide:h=`after`,highlightActive:g=!1,itemSize:_=24,children:v,className:y,railClassName:b,previewContainerClassName:x,previewClassName:S}){let C=(0,U.useId)(),w=d(),T=A(),[E,D]=(0,U.useState)(i??e[0]?.id??``),[O,k]=(0,U.useState)(null),[j,M]=(0,U.useState)(null),N=r??E,P=e.some(e=>e.id===N)?N:e[0]?.id??``,F=O??j??``,I=F||(g?P:``),L=e.findIndex(e=>e.id===I),R=e.length?`repeat(${e.length}, ${_}px)`:void 0,z=n===`horizontal`,B=e=>{r===void 0&&D(e),a?.(e)};return(0,W.jsxs)(s.div,{layoutRoot:!0,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||M(null)},className:o(`isolate relative flex w-full overflow-visible`,z?`min-h-64 flex-col items-center justify-center`:`min-h-80`,y),children:[(0,W.jsx)(`nav`,{"aria-label":t,onPointerLeave:()=>k(null),style:z?{gridTemplateColumns:R}:{gridTemplateRows:R},className:o(`relative z-10 grid shrink-0`,z?`h-12 w-fit max-w-full self-center justify-center`:`w-12 content-center`,b),children:e.map((e,t)=>{let n=e.id===P,r=e.id===I,i=L<0?1/0:Math.abs(t-L),a=r?1:i===1?.68:i===2?.44:.25,l=(0,W.jsx)(W.Fragment,{children:(0,W.jsx)(s.span,{"data-slot":`preview-rail-tick`,"aria-hidden":`true`,animate:z?{scaleY:a}:{scaleX:a},transition:w?{duration:0}:c,className:o(`block bg-current`,z?`h-12 w-0.5 origin-bottom`:`h-0.5 w-12 origin-left`,r?`text-foreground`:void 0)})}),u=o(`relative flex text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background`,z?`h-12 w-6 items-end justify-center`:`h-6 w-12 items-center`),d=z?{width:_}:{height:_},p=()=>{T&&k(e.id)},m=t=>{t.matches(`:focus-visible`)&&M(e.id)},h=()=>{B(e.id),f?.(e)};return e.href?(0,W.jsx)(`a`,{"data-slot":`preview-rail-item`,href:e.href,target:e.target,rel:e.rel??(e.target===`_blank`?`noreferrer noopener`:void 0),"aria-label":e.ariaLabel??e.label,"aria-current":n?`page`:void 0,onPointerEnter:p,onMouseEnter:p,onPointerDown:()=>M(null),onFocus:e=>m(e.currentTarget),onClick:h,style:d,className:u,children:l},e.id):(0,W.jsx)(`button`,{"data-slot":`preview-rail-item`,type:`button`,"aria-label":e.ariaLabel??e.label,"aria-current":n?`location`:void 0,onPointerEnter:p,onMouseEnter:p,onPointerDown:()=>M(null),onFocus:e=>m(e.currentTarget),onClick:h,style:d,className:u,children:l},e.id)})}),m?(0,W.jsx)(`div`,{"aria-hidden":`true`,style:z?{gridTemplateColumns:R}:{gridTemplateRows:R},className:o(`pointer-events-none absolute z-50 grid`,z?`top-1/2 left-1/2 h-5 w-fit max-w-full -translate-x-1/2 -translate-y-1/2 justify-center`:h===`before`?`inset-y-0 right-16 left-4 content-center`:`inset-y-0 right-4 left-16 content-center`,x),children:e.map(e=>(0,W.jsx)(`div`,{style:z?{width:_}:{height:_},className:o(`relative flex items-center`,z?`justify-center`:void 0),children:(0,W.jsx)(u,{mode:`wait`,initial:!1,children:e.id===F?(0,W.jsx)(s.div,{initial:w?{opacity:0}:{opacity:0,y:4,filter:`blur(6px)`},animate:w?{opacity:1}:{opacity:1,y:0,filter:`blur(0px)`},exit:w?{opacity:0}:{opacity:0,y:-2,filter:`blur(4px)`,transition:{duration:.12,ease:l}},transition:{duration:w?0:.18,ease:l},className:o(z?`absolute bottom-12 left-1/2 w-72 -translate-x-1/2`:o(`w-full max-w-sm`,h===`before`&&`ml-auto`),S),children:(0,W.jsx)(s.div,{layoutId:`preview-rail-card-${C}`,transition:w?{duration:0}:c,children:p?p(e):(0,W.jsx)(be,{item:e})})},e.id):null})},e.id))}):null,v?(0,W.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1`,children:v}):null]})}function Se({followOutput:e=!0,followThreshold:t=56,smooth:n=!0,onFollowChange:r,label:i=`Conversation`,busy:a,navigation:s,navigationLabel:c=`Message navigation`,viewportClassName:l,contentClassName:u,railClassName:f,viewportRef:p,viewportProps:m,contentProps:h,className:g,children:_,...v}){let y=d()??!1,b=(0,U.useRef)(null),x=(0,U.useRef)(null),S=(0,U.useRef)(e),C=(0,U.useRef)(!1),w=(0,U.useRef)(void 0),T=(0,U.useRef)(void 0),{onScroll:E,onWheel:D,onTouchStart:O,onKeyDown:k,...A}=m??{},j=(0,U.useCallback)(e=>{b.current=e,typeof p==`function`?p(e):p&&(p.current=e)},[p]),M=(0,U.useCallback)(e=>{S.current!==e&&(S.current=e,r?.(e))},[r]),N=(0,U.useCallback)(e=>{C.current=!0,w.current&&window.clearTimeout(w.current),w.current=window.setTimeout(()=>{C.current=!1},e===`smooth`?320:0)},[]),P=(0,U.useCallback)(e=>{let t=b.current;t&&(N(e),typeof t.scrollTo==`function`?t.scrollTo({top:t.scrollHeight,behavior:e}):t.scrollTop=t.scrollHeight)},[N]),{activeRailId:F,railItems:I,railOverflowing:L,scheduleRailSync:R,scrollToRailItem:z}=ye({navigation:s,followThreshold:t,contentRef:x,viewportRef:b,reduce:y,smooth:n,scrollToEnd:P,setFollowing:M,markProgrammaticScroll:N}),B=(0,U.useEffectEvent)(R),V=(0,U.useEffectEvent)(P),ee=(0,U.useCallback)(()=>{let e=b.current;if(!e||C.current)return;let n=e.scrollHeight-e.scrollTop-e.clientHeight;M(n<=t),R()},[t,R,M]),H=(0,U.useCallback)(()=>{C.current=!1},[]);(0,U.useLayoutEffect)(()=>{if(S.current=e,e)return T.current=requestAnimationFrame(()=>V(`auto`)),()=>{T.current&&cancelAnimationFrame(T.current)}},[e]),(0,U.useEffect)(()=>{let t=x.current;if(!t||typeof ResizeObserver>`u`)return;let r=new ResizeObserver(()=>{B(),!(!e||!S.current)&&V(y||!n?`auto`:`smooth`)});return r.observe(t),()=>r.disconnect()},[e,y,n]),(0,U.useEffect)(()=>()=>{w.current&&window.clearTimeout(w.current),T.current&&cancelAnimationFrame(T.current)},[]);let te=(0,W.jsx)(`section`,{ref:j,"aria-label":i,...A,onScroll:e=>{ee(),E?.(e)},onWheel:e=>{H(),D?.(e)},onTouchStart:e=>{H(),O?.(e)},onKeyDown:e=>{[`ArrowUp`,`PageUp`,`Home`].includes(e.key)&&H(),k?.(e)},className:o(`h-full overflow-y-auto overscroll-contain outline-none [overflow-anchor:none] focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,s===`rail`?`[-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden`:`[scrollbar-gutter:stable]`,l,s===`rail`&&L&&`pr-10`),children:(0,W.jsx)(`div`,{ref:x,role:`log`,"aria-live":a?`off`:`polite`,"aria-relevant":`additions text`,"aria-busy":a,className:u,...h,children:_})});return(0,W.jsx)(`div`,{"data-slot":`message-scroller`,className:o(`min-h-0`,g),...v,children:s===`rail`?(0,W.jsx)(xe,{items:L?I:[],label:c,activeId:F,onItemSelect:z,previewSide:`before`,highlightActive:!0,itemSize:14,className:`h-full min-h-0 overflow-hidden`,previewContainerClassName:`right-8 left-3`,previewClassName:`mr-1 w-64 max-w-full [&_[data-slot=preview-rail-card]]:h-20 [&_[data-slot=preview-rail-card]]:overflow-hidden [&_[data-slot=preview-rail-card]]:p-3 [&_[data-slot=preview-rail-title]]:line-clamp-1 [&_[data-slot=preview-rail-title]]:text-xs [&_[data-slot=preview-rail-title]]:leading-4 [&_[data-slot=preview-rail-description]]:line-clamp-2 [&_[data-slot=preview-rail-description]]:text-xs [&_[data-slot=preview-rail-description]]:leading-4`,railClassName:o(`absolute inset-y-3 right-1 w-7 content-center py-1 [&_[data-slot=preview-rail-item]]:w-7 [&_[data-slot=preview-rail-item]]:justify-end [&_[data-slot=preview-rail-tick]]:h-px [&_[data-slot=preview-rail-tick]]:w-4 [&_[data-slot=preview-rail-tick]]:origin-right`,L?`pointer-events-auto opacity-100`:`pointer-events-none opacity-0`,f),children:te}):te})}function J(e){return typeof e==`object`&&!!e}function Ce(e){return J(e)&&e.type===`text`&&typeof e.text==`string`}function we(e){return J(e)&&e.type===`error`&&typeof e.message==`string`}function Te(e){return J(e)&&e.type===`payload`&&typeof e.kind==`string`&&typeof e.title==`string`}function Y(e){if(!J(e))return!1;let t=e.type;return t===`dynamic-tool`||typeof t==`string`&&t.startsWith(`tool-`)}function Ee(e){if(typeof e==`string`)return e;if(e===void 0)return``;try{return JSON.stringify(e,null,2)??``}catch{return String(e)}}function De({part:e}){let t=Ee(e.payload);return e.kind===`agent_message`?t||e.text?(0,W.jsxs)(`section`,{"data-payload-kind":e.kind,className:`w-full min-w-0 text-xs text-muted-foreground`,children:[e.text?(0,W.jsx)(`pre`,{className:`m-0 whitespace-pre-wrap break-words p-3 font-mono text-xs leading-5 text-foreground/80`,children:e.text}):null,t?(0,W.jsxs)(`details`,{children:[(0,W.jsx)(`summary`,{className:`w-fit cursor-pointer py-1 font-medium`,children:`Details`}),(0,W.jsx)(`pre`,{className:`m-0 max-h-60 overflow-auto whitespace-pre-wrap break-words border-l border-border pl-3 font-mono text-xs leading-5`,children:t})]}):null]}):null:(0,W.jsxs)(`section`,{"data-payload-kind":e.kind,className:`w-full min-w-0 overflow-hidden rounded-xl border border-border/60 bg-muted/40 text-sm`,children:[e.title===`Details`?null:(0,W.jsx)(`div`,{className:`border-b border-border/50 px-3 py-2 text-xs font-medium text-muted-foreground`,children:e.title}),e.text?(0,W.jsx)(`pre`,{className:`m-0 whitespace-pre-wrap break-words p-3 font-mono text-xs leading-5 text-foreground/80`,children:e.text}):null,t?(0,W.jsxs)(`details`,{className:`border-t border-border/50 px-3 py-2`,children:[(0,W.jsx)(`summary`,{className:`cursor-pointer text-xs font-medium text-muted-foreground`,children:`Payload`}),(0,W.jsx)(`pre`,{className:`m-0 mt-2 max-w-full whitespace-pre-wrap break-words font-mono text-xs leading-5 text-foreground/70`,children:t})]}):null]})}var Oe=[],ke=(0,U.memo)(function({title:e=`Unable to complete request`,message:t,className:n}){return(0,W.jsx)(`div`,{className:o(`flex justify-start`,n),children:(0,W.jsxs)(`div`,{className:`rounded-lg border border-destructive/30 bg-destructive/10 px-4 py-2.5 text-sm text-foreground`,children:[(0,W.jsx)(`div`,{className:`font-medium text-foreground`,children:e}),(0,W.jsx)(`div`,{className:`mt-0.5 text-muted-foreground`,children:t})]})})}),Ae=`tool-call:`,je=`unkeyed-tool:`;function Me(e,t,n){return t.toolCallId?`${Ae}${t.toolCallId}`:`${je}${e}:${t.type}:${n}`}function Ne(e,t){let{messageId:n,isLast:r,isStreaming:i,suppressTextWhenPlanWrite:a=!1,ToolRendererComponent:o,TextRendererComponent:s,toolRenderers:c,onOpenUIAction:l,onOpenUIArtifactReady:u,onOpenArtifact:d,artifactByToolCallId:f,onOpenToolArtifact:p}=t,m=[],h=[],g=a&&e.some(e=>Y(e)&&e.type===`tool-PlanWrite`),_=new Set(e.filter(e=>Y(e)&&(e.type===`tool-Task`||e.type===`tool-Agent`)&&typeof e.toolCallId==`string`).map(e=>e.toolCallId)),v=new Map,y=new Set,S=new Map,C=()=>{let e=h.splice(0).join(`
|
|
3
3
|
|
|
4
4
|
`);e&&m.push((0,W.jsx)(`div`,{className:`group/assistant-text text-body [&_a]:font-medium [&_a]:underline [&_a]:underline-offset-4 [&_ol]:my-2 [&_ol]:list-decimal [&_ol]:pl-5 [&_p+p]:mt-2 [&_ul]:my-2 [&_ul]:list-disc [&_ul]:pl-5`,children:(0,W.jsx)(s,{content:e,isStreaming:i,messageId:n,onOpenUIAction:l,onOpenUIArtifactReady:u,onOpenArtifact:d,className:`leading-relaxed [&_p]:leading-relaxed`})},`${n}-text-${m.length}`))};for(let t of e){if(!Y(t)||t.type===`tool-TaskOutput`||!t.toolCallId||!t.toolCallId.includes(`:`))continue;let e=t.toolCallId.split(`:`)[0];_.has(e)&&(v.has(e)||v.set(e,[]),v.get(e).push(t),y.add(t.toolCallId))}let w=0;for(;w<e.length;){let t=e[w];if(typeof t==`object`&&t&&`type`in t&&t.type===`reasoning`&&`text`in t&&typeof t.text==`string`&&`contentIndex`in t&&typeof t.contentIndex==`number`&&`state`in t&&typeof t.state==`string`){C(),m.push((0,W.jsx)(k,{text:t.text,streaming:r&&i&&t.state===`streaming`,durationMs:`durationMs`in t&&typeof t.durationMs==`number`?t.durationMs:void 0},`${n}-reasoning-${t.contentIndex}`)),w++;continue}if(Y(t)&&t.type===`tool-TaskOutput`){w++;continue}if(Ce(t)){let e=t.text;e&&!g&&h.push(e),w++;continue}if(we(t)){C(),m.push((0,W.jsx)(ke,{title:t.title,message:t.message},`${n}-error-${t.title}-${t.message}`)),w++;continue}if(Te(t)){C(),m.push((0,W.jsx)(De,{part:t},`${n}-payload-${w}`)),w++;continue}if(Y(t)){if(t.type===`tool-Question`){w++;continue}if(t.toolCallId&&y.has(t.toolCallId)){w++;continue}C();let e=typeof t.state==`string`?t.state:``,a=r&&i&&(e===`input-streaming`||e===`streaming`)?`streaming`:void 0,s=e===`input-available`||e===`pending`,l=x(t,a),u=b(t.type.replace(/^tool-/,``)),d=l?.status===`error`,h=l?.status===`cancelled`,g=`Details for ${t.type.replace(/^tool-/,``)}${t.toolCallId?` (${t.toolCallId})`:``}`,_=t.toolCallId?f?.get(t.toolCallId):void 0,T=t.toolCallId,E=(t.type===`tool-Task`||t.type===`tool-Agent`)&&T?v.get(T)??Oe:void 0,D=t.toolCallId?0:S.get(t.type)??0;t.toolCallId||S.set(t.type,D+1),m.push((0,W.jsxs)(R,{className:`my-1 flex-row items-center`,"data-testid":`assistant-tool-trace`,children:[(0,W.jsxs)(P,{defaultOpen:t.type===`tool-PlanWrite`&&!!t.input?.pendingDecision,children:[(0,W.jsx)(N,{"aria-label":g,children:(0,W.jsxs)(L,{status:d?`error`:a?`running`:s?`pending`:void 0,children:[(0,W.jsx)(F,{children:(0,W.jsx)(u,{})}),(0,W.jsx)(M,{children:t.type.replace(/^tool-/,``)}),l?.traceDescription?(0,W.jsx)(j,{className:`max-w-48 truncate`,title:l.traceDescription,children:l.traceDescription}):null,(0,W.jsx)(j,{className:l?.outputSummary.isError?`text-destructive`:void 0,children:d?`failed`:a?`running`:s?`waiting`:h?`cancelled`:l?.outputSummary.isError?`reported error`:`done`}),l?.durationLabel?(0,W.jsx)(j,{children:l.durationLabel}):null]})}),(0,W.jsx)(I,{children:(0,W.jsx)(o,{part:t,nestedTools:E,chatStatus:a,toolRenderers:c,insideTrace:!0})})]}),_&&p?(0,W.jsx)(`button`,{type:`button`,className:`shrink-0 text-micro underline`,"aria-label":`Open ${_.title} in ${_.kind===`ipython`?`REPL`:`artifacts`}`,onClick:()=>p(_.id,_.kind===`ipython`?`repl`:`artifacts`),children:`Open`}):null]},Me(n,t,D))),w++;continue}w++}return C(),m}var Pe=e(n(),1);function Fe({open:e,onClose:t,images:n,initialIndex:r=0}){let[i,a]=(0,U.useState)(r),s=n.length>1;(0,U.useEffect)(()=>{e&&a(r)},[e,r]);let c=(0,U.useCallback)(e=>{e?.stopPropagation(),a(e=>e>0?e-1:n.length-1)},[n.length]),l=(0,U.useCallback)(e=>{e?.stopPropagation(),a(e=>e<n.length-1?e+1:0)},[n.length]),u=(0,U.useEffectEvent)(e=>{switch(e.key){case`ArrowLeft`:e.preventDefault(),s&&c();break;case`ArrowRight`:e.preventDefault(),s&&l()}});(0,U.useEffect)(()=>{if(!e)return;let t=e=>u(e);return window.addEventListener(`keydown`,t,!0),()=>window.removeEventListener(`keydown`,t,!0)},[e]),(0,U.useEffect)(()=>{if(!e)return;let t=document.body.style.overflow;return document.body.style.overflow=`hidden`,()=>{document.body.style.overflow=t}},[e]);let d=(0,U.useRef)(null),f=(0,U.useEffectEvent)(e=>{d.current&&e.target===d.current&&t()});if((0,U.useEffect)(()=>{if(!e)return;let t=d.current;if(!t)return;t.open||t.showModal();let n=e=>f(e);return t.addEventListener(`click`,n),()=>{t.removeEventListener(`click`,n),t.open&&t.close()}},[e]),typeof document>`u`||!e)return null;let p=n[i]??n[0];return p?.url?(0,Pe.createPortal)((0,W.jsxs)(`dialog`,{ref:d,"aria-label":`Image viewer`,onClose:()=>t(),className:`fixed inset-0 z-50 m-0 flex h-full max-h-none w-full max-w-none items-center justify-center border-0 bg-black/90 p-0 backdrop:bg-transparent`,children:[(0,W.jsx)(`button`,{type:`button`,onClick:t,"aria-label":`Close fullscreen (Esc)`,className:`absolute top-4 right-4 z-10 inline-flex size-9 items-center justify-center rounded-full bg-black/50 text-white transition-colors hover:bg-black/70`,children:(0,W.jsx)(C,{className:`size-5`})}),s&&(0,W.jsx)(`button`,{type:`button`,onClick:c,"aria-label":`Previous image (←)`,className:`absolute top-1/2 left-4 z-10 inline-flex size-10 -translate-y-1/2 items-center justify-center rounded-full bg-black/50 text-white transition-colors hover:bg-black/70`,children:(0,W.jsx)(B,{className:`size-6`})}),(0,W.jsx)(`img`,{src:p.url,alt:p.filename??`Image preview`,className:`max-h-[85vh] max-w-[90vw] object-contain select-none`,onClick:e=>e.stopPropagation(),draggable:!1}),s&&(0,W.jsx)(`button`,{type:`button`,onClick:l,"aria-label":`Next image (→)`,className:`absolute top-1/2 right-4 z-10 inline-flex size-10 -translate-y-1/2 items-center justify-center rounded-full bg-black/50 text-white transition-colors hover:bg-black/70`,children:(0,W.jsx)(m,{className:`size-6`})}),s&&(0,W.jsxs)(`div`,{className:`absolute bottom-6 left-1/2 flex -translate-x-1/2 flex-col items-center gap-3`,children:[(0,W.jsx)(`div`,{className:`flex gap-2`,children:n.map((e,t)=>(0,W.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),a(t)},"aria-label":`Go to image ${t+1}`,className:o(`size-2 rounded-full transition-[background-color,transform] duration-150`,t===i?`scale-125 bg-white`:`bg-white/40 hover:bg-white/60`)},e.url))}),(0,W.jsxs)(`span`,{className:`text-sm tabular-nums text-white/70`,children:[i+1,` / `,n.length]})]})]}),document.body):null}function Ie(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`}function Le(e,t){if(t)return`image`;let n=e.split(`.`).pop()?.toLowerCase();return[`js`,`ts`,`jsx`,`tsx`,`py`,`rb`,`go`,`rs`,`java`,`kt`,`swift`,`c`,`cpp`,`h`,`hpp`,`cs`,`php`].includes(n||``)?`code`:[`json`,`yaml`,`yml`,`xml`].includes(n||``)?`data`:`text`}function Re(e){switch(e){case`image`:return(0,W.jsx)(y,{"aria-hidden":`true`,className:`size-4 text-muted-foreground`});case`code`:return(0,W.jsx)(te,{"aria-hidden":`true`,className:`size-4 text-muted-foreground`});case`data`:return(0,W.jsx)(ee,{"aria-hidden":`true`,className:`size-4 text-muted-foreground`});default:return(0,W.jsx)(g,{"aria-hidden":`true`,className:`size-4 text-muted-foreground`})}}function ze({id:e,filename:t,size:n,isImage:r,url:i,onRemove:a,className:s,display:c=`chip`,enableImagePreview:l=!0}){let[u,d]=(0,U.useState)(!1),[f,p]=(0,U.useState)(!1),m=Le(t,r),h=c===`image-only`&&r&&!!i,g=!!(l&&r&&i),_=e=>{e?.stopPropagation(),p(!0)},v=o(`shrink-0 overflow-hidden rounded-[calc(var(--chat-input-radius)-var(--chat-context-padding)-2px)]`,g&&`cursor-pointer focus-visible:ring-2 focus-visible:ring-ring`);return(0,W.jsxs)(`div`,{className:o(`group relative rounded-[calc(var(--chat-input-radius)-var(--chat-context-padding))] bg-muted/50`,h?`flex size-10 items-center justify-center`:`flex max-w-[min(12.5rem,100%)] min-w-0 items-center gap-2 py-1 ps-1 pe-2`,s),onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),children:[h?g?(0,W.jsx)(`button`,{type:`button`,className:o(v,`size-8 border-0 bg-transparent p-0`),onClick:_,"aria-label":`Preview ${t}`,children:(0,W.jsx)(`img`,{src:i,alt:``,className:`h-full w-full object-cover`})}):(0,W.jsx)(`div`,{className:o(v,`size-8`),children:(0,W.jsx)(`img`,{src:i,alt:t,className:`h-full w-full object-cover`})}):(0,W.jsxs)(W.Fragment,{children:[r&&i?g?(0,W.jsx)(`button`,{type:`button`,className:o(v,`w-8 self-stretch border-0 bg-transparent p-0`),onClick:_,"aria-label":`Preview ${t}`,children:(0,W.jsx)(`img`,{src:i,alt:``,className:`aspect-square h-full w-full object-cover`})}):(0,W.jsx)(`div`,{className:o(v,`w-8 self-stretch`),children:(0,W.jsx)(`img`,{src:i,alt:t,className:`aspect-square h-full w-full object-cover`})}):(0,W.jsx)(`div`,{className:`flex w-8 shrink-0 items-center justify-center self-stretch rounded-[calc(var(--chat-input-radius)-var(--chat-context-padding)-2px)] bg-muted`,children:Re(m)}),(0,W.jsxs)(`div`,{className:`flex min-w-0 flex-col`,children:[(0,W.jsx)(`span`,{className:`truncate text-sm font-medium text-foreground`,title:t,children:t}),n!==void 0&&(0,W.jsx)(`span`,{className:`text-micro text-muted-foreground`,children:Ie(n)})]})]}),a&&(0,W.jsx)(`button`,{onClick:e=>{e.stopPropagation(),a()},"aria-label":`Remove ${t}`,className:o(`relative after:absolute after:top-1/2 after:left-1/2 after:size-10 after:-translate-x-1/2 after:-translate-y-1/2`,`absolute -top-1.5 -end-1.5 z-10 flex size-6 items-center justify-center rounded-full border border-border bg-background text-muted-foreground transition-[opacity,transform] duration-150 ease-out hover:text-foreground focus-visible:opacity-100 focus-visible:ring-2 focus-visible:ring-ring enabled:active:scale-[0.96] group-hover:opacity-100 group-focus-within:opacity-100 [@media(hover:none)]:opacity-100`,u?`opacity-100`:`opacity-0`),type:`button`,children:(0,W.jsx)(C,{"aria-hidden":`true`,className:`size-3`})}),g&&i&&(0,W.jsx)(Fe,{open:f,onClose:()=>p(!1),images:[{id:e,url:i,filename:t}]})]})}var Be=48,X=(e,t=0)=>{let n=new Int32Array(e.length);for(let r=0;r<e.length;r++)n[r]=e.charCodeAt(r)-Be-t;return n},Z=e=>{let t=new Int32Array(e.length+1);for(let n=0;n<e.length;n++)t[n+1]=t[n]+e[n];return t},Q=e=>{let t=new Int32Array(e.length),n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r)-Be;n+=i>>>1^-(i&1),t[r]=n}return t},Ve=384,He=[],$=Z(X(`E0500002005282000000002000150000020021820000011200000003022202000300004200120000200420001200021200301200010400162000010000220021010:2192001200220012000220012000200200200400010200040000000000400200108200110100000022010313000162002000020020012020080213000228200000000082000000000120002000120020020040101020300130001001010`)),Ue=Z(X(`:11111111211111119311546544411119731869:671397415686432441111111111161114151214313433415:78311132233313187211117221449443411141111151152226611131111112212518142224214215421421542142424242516171151615616347111111111197911327451111111111111111111113134714133513411111311111111111111111111112444411111342312715245411117:3`)),We=`@containerabcdefghinlmoprstunderlineviawzccentlignnimatespectuto-colsrowsaglorightnessckdrop-sisbcontrastfiltergrayscalehue-rotateinvertopacityslurrightnessaturateepia-coniclinearpositionradialsizeockurrderttom-belrstxyespacing-xyaretoursorlnt-umnsendspantartainentrasteividerop-shadowurationcorationlay-xyasendillexontromlter-featuresstretchapr-xyayscaleidow-colsrowsue-rotatedentlinesetvert-beringsxyeshadoweiadingftnest-clamp-imageabein-lrstxyskx--b-coniclpositionrsizet-x-y-fromto-fromto-inearfromto-fromto-adialfromto-fromtofromtofromtofromtoblockhinlinew-screenesblockhinlinewbjectpacityrutlinederigin-offsetbelrstxyesrspective-originaceholderioghtng-offsettateundedw-xyz-belrstlreseslr-endspantartaturatecepiahizekewpace-taleroll-xyz-barmpbelrstxyesbelrstxyes-thumbrackadowrink-xyxyartrokeabextora-shadowpckingnsformitionlate-xyz-offsetill-changeoom`,Ge=(()=>{let e=$.length-1,t=new Int32Array(e);for(let n=e-1;n>=0;n--){let e=1,r=n+1;for(let i=$[n];i<$[n+1];i++)e+=t[r],r+=t[r];t[n]=e}let n=new Int32Array($[e]),r=0;for(let i=0;i<e;i++){let e=i+1;for(let a=$[i];a<$[i+1];a++)n[r++]=e,e+=t[e]}return n})(),Ke=X(`02000000000000900<=0?000B000F00F00ŏI0J0LNPRTVX0000]_a00000000000000000000000rst0000000zŏ00000000000
ŏ0000000ŏ00000000000000000000000000000000000000000000000000000000000000Ë000000000000000000000Þ000000000000000000ð0000000ø0ùúûüýþÿĀāĂ㥹Ć000000000000000000000000000000000000000000ħ0ĨĪ00000000000000000000ļĽ00000Ŭ000000`,1),qe=Z(X(`123333359346463635126536711576`)),Je=X(`93203242332583253248325D>E?F@03263243255B:032523853:0325B:8GA032542H<C=12727B:0328432553;D>E?3257D>032585:0325B:;0328B:032`),Ye=X(`012113445661666666789111:5;;;;;;;;444;;;:62999<1161=62>>?61:21@ABCD4446996:64E:::;:?::64:F114GHHIHHHHIHH1HH1HH1HHHHHH::EEJ4444::EE4444441691;644444114244444:;K6666555555555555555999666664444444444444444444444226?6:66644L9M?D:111::::6DE199`),Xe=Q(`020200202020020020020020020020200200200200200200200002020202001003040106000200200200200200200200200200200200200200200200200200200200200200200200200200200200020020020020020020002020200202002002002002002002002002002020002002020020200220200200200200200200200200200200020020020000200020002000200200200020020020002000200200200020020202002020202000200200020022000200200020020002002000200220002002000200W0Z00020020002002020002002000200g0j0002002000200200020020002002000200200020020002000200002000002002002002002000200020000200002002002002002002002020020020200200200200200200200200202020020020020020020020020002002002020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020002002002002002002000200200200200200200200200200020202020002000200020002002002002000020200200`),Ze=(()=>{let e=new Int32Array(319).fill(-1),t=Q(`02422242:222222242224222242442222222422222244442242226224222426222422442462222422622222222626222462242622422622422424242422222222422222222242422222222222222222622442224222222222222224424442262222222222222222222226224222424242422224422422422222`),n=Q(`02222222222222222222202222222222222222222222221422222222222222222222222222222222222Y\\222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221422222222222222222222222222222222222222Ŀł222222222222222222`);for(let r=0;r<t.length;r++)e[t[r]]=n[r];return e})(),Qe=`container |break-after- all auto avoid avoid-page column left page right|break-before- all auto avoid avoid-page column left page right|break-inside-a uto void void-column void-page|box-decoration- clone slice|box- border content| contents flow-root hidden table table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group| not-sr-only sr-only|float- end left none right start|clear- both end left none right start|isolat e ion-auto|overflow- auto clip hidden scroll visible|overflow-x- auto clip hidden scroll visible|overflow-y- auto clip hidden scroll visible|overscroll- auto contain none|overscroll-x- auto contain none|overscroll-y- auto contain none| absolute fixed relative static sticky| collapse invisible visible|justify- around baseline between center center-safe end end-safe evenly normal start stretch|justify-items- center center-safe end end-safe normal start stretch|justify-self- auto center center-safe end end-safe start stretch|items- baseline baseline-last center center-safe end end-safe start stretch|self- auto baseline baseline-last center center-safe end end-safe start stretch|place-content- around baseline between center center-safe end end-safe evenly start stretch|place-items- baseline center center-safe end end-safe start stretch|place-self- auto center center-safe end end-safe start stretch| antialiased subpixel-antialiased| italic not-italic|normal-nums |ordinal |slashed-zero | lining-nums oldstyle-nums| proportional-nums tabular-nums| diagonal-fractions stacked-fractions| no-underline overline| capitalize lowercase normal-case uppercase|truncate |whitespace- break-spaces normal nowrap pre pre-line pre-wrap|break- all keep normal words|wrap- anywhere break-word normal|hyphens- auto manual none|mix-blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay plus-darker plus-lighter saturation screen soft-light|table- auto fixed|caption- bottom top|backface- hidden visible|appearance- auto none|scheme- dark light light-dark normal only-dark only-light|field-sizing- content fixed|pointer-events- auto none|resize -none -x -y|snap- align-none center end start|snap- always normal|snap- both none x y|snap- mandatory proximity|touch- auto manipulation none|touch-pan- left right x|touch-pan- down up y|touch-pinch-zoom |select- all auto none text|forced-color-adjust- auto none| normal size| baseline bottom middle sub super text-bottom text-top top| bounce none ping pulse spin| auto square video| auto fr max min px|none | auto full px| fixed local scroll|clip- border content padding text|origin- border content padding| bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| no-repeat repeat repeat-round repeat-space repeat-x repeat-y| auto contain cover| gradient-to-b gradient-to-bl gradient-to-br gradient-to-l gradient-to-r gradient-to-t gradient-to-tl gradient-to-tr none|blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay saturation screen soft-light|to- b bl br l r t tl tr| auto dvh fit full lh lvh max min px screen svh| dashed dotted double hidden none solid| collapse separate|px |auto |full | content none strict| inline-size size|layout |paint |style | around baseline between center center-safe end end-safe evenly normal start stretch| alias all-scroll auto cell col-resize context-menu copy crosshair default e-resize ew-resize grab grabbing help move n-resize ne-resize nesw-resize no-drop none not-allowed ns-resize nw-resize nwse-resize pointer progress row-resize s-resize se-resize sw-resize text vertical-text w-resize wait zoom-in zoom-out| dashed dotted double solid wavy| auto from-font|reverse |initial | in in-out initial linear out| col col-reverse row row-reverse| nowrap wrap wrap-reverse| auto initial none| black bold extrabold extralight light medium normal semibold thin| condensed expanded extra-condensed extra-expanded normal semi-condensed semi-expanded ultra-condensed ultra-expanded|flow- col col-dense dense row row-dense| none subgrid| auto dvh dvw fit full lh lvh lvw max min px screen svh svw| block flex grid table| auto dvw fit full lvw max min px screen svw| loose none normal px relaxed snug tight|through |item | inside outside| decimal disc none| auto px| clip-border clip-content clip-fill clip-padding clip-stroke clip-view no-clip| add exclude intersect subtract| alpha luminance match|origin- border content fill padding stroke view|type- alpha luminance| circle ellipse| closest-corner closest-side farthest-corner farthest-side|at- bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| dvh fit full lh lvh max min none px screen svh| auto dvh dvw fit full lh lvh lvw max min none px screen svh svw| dvw fit full lvw max min none px screen svw| auto dvh dvw fit full lvh lvw max min none prose px svh svw| auto dvh dvw fit full lvh lvw max min none px screen svh svw| contain cover fill none scale-down| first last none| distant dramatic midrange near none normal|inset | full none|3d | auto smooth|gutter- auto both stable| auto none thin| inner none| auto dvh dvw fit full lvh lvw max min px svh svw|base | center end justify left right start| clip ellipsis| balance nowrap pretty wrap| normal tight tighter wide wider widest| cpu gpu none| 3d flat| all colors none opacity shadow transform| discrete normal| full px| auto dvh dvw fit full lvh lvw max min px screen svh svw| auto contents scroll transform`.split(`|`).map(e=>{let t=e.split(` `),n=t.shift();for(let e=0;e<t.length;e++)t[e]=n+t[e];return t}),$e=Q(`0000000000000000000000000000000000000000000000000000000000000262242:6@200000006:240B428:4422400002046044222426220026642642462026224222824220022400000000\\00N222422242222222224062242222222422226264222422222222222222442804222422222222222222222222220<4<0204260002444020204224422`),et=Q(`ɠ222222222222222222222222222222222222222222222222222222222222˕4222226>ʶ22ʷʺʷ2ʸʷ42ʴ2ʓ22>621422ɶ222ɹɼɷɺɷɺ22ɱ42222ɨ2ɧ26622ɘɓ244ƸƵ222]d24242ǖǓƚÄȫ2263ȨȥȨ2222222ǣ222222222222222222ǂƽ2ƾƵ2222222422222ƜƑ22222222222222222222144Ŧţ22Ţş222222222222222222222ĸ2ı68ĦģĦɡŰ4Ġ«®ĝ822ĔđĔ2ē2222622`),tt=Q(`02222222222222222222222222222222222222222222222222222222222222222202022222222222EH2200IL021042222Y\\222IL0cf2e10j2222U00X202[^2y0000120|{~22
:22|22222222222G000qOVI00000}2>40000B00000I¨©000¬00000000000000021M®00°000000000000000000000222HGHa1º222¿2À2222ÉÌ000°2±`),nt=new Int32Array(995),rt=new Int32Array(995),it=new Int32Array(995),at=``,ot=new Int32Array(1038);{let e=new Map,t=0,n=0;for(let r=0;r<$e.length;r++)for(let i of Qe[tt[r]]){let a=e.get(i);a===void 0&&(a=t++,e.set(i,a),ot[a*2]=at.length,ot[a*2+1]=i.length,at+=i),nt[n]=$e[r],rt[n]=et[r],it[n]=a,n++}}var st=Q(`0b2N:222@R>F@286¦2@H2D266226FB22B2>BD\\6N22222Z222D222p`),ct=Z(X(`1::24444432:442:44:44>222222:44:4421322511111311111114`)),lt=Q(`24A;33N=C@H4A;33N=C@<27;83:;8393NQ:3NQʰ222ˉºŴŽ2R2=18cƴÅŇ=cĞÛC1ƈǝȈ:ħ25=11D3A@4=<1;1DEr25;11B3?<6;:371BCn9@7=<8192>2E121@9@EHE@9>2T25511<398454131<=V25511<398454131<=ƧNž2Đå242L222290000f22500ɛ000ǘ222`),ut=X(`ij`),dt=X(``),ft=X(`1`),pt=i({GROUP_COUNT:Ve,customValidatorNames:He,edgeStart:$,labelStart:Ue,labelText:We,edgeTarget:Ge,nodeGroup:Ke,nodeVlist:Ze,vlistPat:qe,vlistOps:Je,vlistRef:Ye,vlistGroup:Xe,litAnchor:nt,litGroup:rt,litPool:it,poolOffsets:ot,poolText:at,adjGid:st,adjStart:ct,adjTgt:lt,patGid:ut,patTgt:dt,postfixLookupGroups:ft,orderSensitiveModifiers:`* ** after backdrop before details-content file first-letter first-line marker placeholder selection`}),mt=a(pt.mergeString,pt);pt.merge;var ht=w(`group/bubble relative flex w-fit max-w-[80%] min-w-0 flex-col gap-1 group-data-[align=end]/message:self-end data-[align=end]:self-end data-[variant=ghost]:max-w-full`,{variants:{variant:{default:`*:data-[slot=bubble-content]:bg-primary *:data-[slot=bubble-content]:text-primary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-primary/80`,secondary:`*:data-[slot=bubble-content]:bg-secondary *:data-[slot=bubble-content]:text-secondary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)]`,muted:`*:data-[slot=bubble-content]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--muted),var(--foreground)_5%)]`,tinted:`*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.93_calc(c*0.4)_h)] *:data-[slot=bubble-content]:text-foreground dark:*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.3_calc(c*0.4)_h)] [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.88_calc(c*0.5)_h)] dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.35_calc(c*0.5)_h)]`,outline:`*:data-[slot=bubble-content]:border-border *:data-[slot=bubble-content]:bg-background [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-input/30`,ghost:`border-none *:data-[slot=bubble-content]:rounded-none *:data-[slot=bubble-content]:bg-transparent *:data-[slot=bubble-content]:p-0 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted/50`,destructive:`*:data-[slot=bubble-content]:bg-destructive/10 *:data-[slot=bubble-content]:text-destructive dark:*:data-[slot=bubble-content]:bg-destructive/20 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/20 dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/30`}},defaultVariants:{variant:`default`}});function gt({variant:e=`default`,align:t=`start`,className:n,...r}){return(0,W.jsx)(`div`,{"data-slot":`bubble`,"data-variant":e,"data-align":t,className:mt(ht({variant:e}),n),...r})}function _t({className:e,render:t,...n}){return E({defaultTagName:`div`,props:f({className:mt(`w-fit max-w-full min-w-0 overflow-hidden rounded-xl border border-transparent px-3 py-2 text-sm leading-relaxed wrap-break-word group-data-[align=end]/bubble:self-end [button]:text-left [button,a]:transition-colors [button,a]:outline-none [button,a]:focus-visible:border-ring [button,a]:focus-visible:ring-3 [button,a]:focus-visible:ring-ring/50`,e)},n),render:t,state:{slot:`bubble-content`}})}w(`absolute z-10 flex w-fit shrink-0 items-center justify-center gap-1 rounded-full bg-muted px-1.5 py-0.5 text-sm ring-3 ring-card has-[button]:p-0`,{variants:{side:{top:`top-0 -translate-y-3/4`,bottom:`bottom-0 translate-y-3/4`},align:{start:`left-3`,end:`right-3`}},defaultVariants:{side:`bottom`,align:`end`}});function vt(e){return typeof e==`object`&&!!e}function yt(e){if(!vt(e))return null;let t=e.type;if(typeof t!=`string`)return null;if(t===`image`){let t=e;return t.url??t.image??null}if(t===`data-image`)return e.data?.url??null;if(t===`file`){let t=e;if(t.mimeType?.startsWith(`image/`)){if(t.url)return t.url;if(t.data)return`data:${t.mimeType};base64,${t.data}`}}return null}function bt(e){if(!vt(e)||e.type!==`file`)return null;let t=e,n=t.filename||t.name||t.fileName||`Attachment`;return t.mimeType?.startsWith(`image/`)??!1?null:{filename:n,size:t.size}}var xt=(0,U.memo)(function({message:e,className:t,enableImagePreview:n=!0}){let[r,i]=(0,U.useState)(null),a=(e.parts?.filter(Ce)??[]).map(e=>e.text).join(``),s=[],c=[];for(let t of e.parts??[]){let e=yt(t);e&&s.push(e);let n=bt(t);n&&c.push(n)}if(vt(e)&&Array.isArray(e.experimental_attachments))for(let t of e.experimental_attachments)t.contentType?.startsWith(`image/`)&&t.url&&s.push(t.url);if(!a&&s.length===0&&c.length===0)return null;let l=s.map((t,n)=>({id:`${e.id}-img-${n}`,url:t,filename:`image-${n+1}`}));return(0,W.jsxs)(`div`,{className:o(`flex flex-col items-end gap-1`,t),children:[s.length>0&&s.map((e,t)=>(0,W.jsx)(`div`,{className:o(`max-w-[200px] rounded-chat-message bg-foreground/4 p-1.5`,n&&`cursor-pointer`),onClick:n?()=>i(t):void 0,role:n?`button`:void 0,tabIndex:n?0:void 0,onKeyDown:n?e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),i(t))}:void 0,children:(0,W.jsx)(`img`,{src:e,alt:`attachment`,width:184,height:120,className:`block max-h-[120px] max-w-[184px] rounded-chat-message-inner object-cover`})},e)),n&&l.length>0&&(0,W.jsx)(Fe,{open:r!==null,onClose:()=>i(null),images:l,initialIndex:r??0}),c.length>0&&(0,W.jsx)(`div`,{className:`flex flex-col items-end gap-2`,children:c.map((e,t)=>(0,W.jsx)(ze,{id:`${e.filename}-${t}`,filename:e.filename,size:e.size},`${e.filename}-${e.size}`))}),a&&(0,W.jsx)(gt,{align:`end`,variant:`muted`,className:`max-w-[85%]`,children:(0,W.jsx)(_t,{className:`rounded-chat-message px-3.5 py-1.5 whitespace-pre-wrap text-pretty`,children:a})})]})});function St(e,t,n){if(n===0)return 0;let r=0,i=n;for(;r<i;){let n=Math.floor((r+i)/2);e[n]<=t?r=n+1:i=n}return Math.max(0,Math.min(n-1,r-1))}function Ct(e,t,n,r){let i=[0];for(let[a,o]of e.entries())i.push(i[i.length-1]+(t.get(o)??n)+(a<e.length-1?r:0));return i}function wt({estimateSize:e,getItemKey:t,itemGap:n=0,items:r,overscan:i=1.5,renderItem:a,viewportRef:o}){let s=(0,U.useMemo)(()=>r.map((e,n)=>t(e,n)),[t,r]),c=r.length>=16,[l,u]=(0,U.useState)(()=>new Map),[d,f]=(0,U.useState)({height:0,scrollTop:0}),p=(0,U.useRef)(s),m=(0,U.useRef)(l),h=(0,U.useRef)(e),g=(0,U.useRef)(n),_=(0,U.useRef)([0]),v=(0,U.useRef)(0),y=(0,U.useRef)(new Map),b=(0,U.useRef)(new WeakMap),x=(0,U.useRef)(null),S=(0,U.useRef)(null),C=(0,U.useCallback)(()=>{let e=o.current;if(!e)return;let t={height:e.clientHeight,scrollTop:e.scrollTop};f(e=>e.height===t.height&&e.scrollTop===t.scrollTop?e:t)},[o]),w=(0,U.useCallback)(()=>{S.current??=window.requestAnimationFrame(()=>{S.current=null,C()})},[C]),T=(0,U.useCallback)((e,t)=>{let n=y.current.get(e);n&&n!==t&&(x.current?.unobserve(n),y.current.delete(e)),t&&(y.current.set(e,t),b.current.set(t,e),x.current?.observe(t))},[]),E=(0,U.useMemo)(()=>Ct(s,l,e,n),[e,n,s,l]);(0,U.useLayoutEffect)(()=>{C()},[r.length,C]),(0,U.useLayoutEffect)(()=>{p.current=s,m.current=l,h.current=e,g.current=n,_.current=E},[e,n,s,l,E]),(0,U.useEffect)(()=>{let e=o.current;if(!e)return;e.addEventListener(`scroll`,w,{passive:!0}),window.addEventListener(`resize`,w),C();let t;return typeof ResizeObserver<`u`&&(t=new ResizeObserver(w),t.observe(e)),()=>{e.removeEventListener(`scroll`,w),window.removeEventListener(`resize`,w),t?.disconnect(),S.current!=null&&(window.cancelAnimationFrame(S.current),S.current=null)}},[w,C,o]);let D=(0,U.useCallback)(e=>{let t=m.current,n=t;for(let r of e){let e=b.current.get(r.target),i=r.contentRect.height;!e||i<=0||t.get(e)===i||(n===t&&(n=new Map(t)),n.set(e,i))}if(n===t)return;let r=o.current,i=p.current,a=Ct(i,n,h.current,g.current);if(r&&i.length>0){let e=_.current,t=St(e,Math.max(0,r.scrollTop),i.length),n=i[t];if(n&&t>0){let r=(a[i.indexOf(n)]??0)-(e[t]??0);r!==0&&(v.current+=r)}}m.current=n,_.current=a,u(n)},[o]);if((0,U.useLayoutEffect)(()=>{if(!c||typeof ResizeObserver>`u`)return;let e=new ResizeObserver(e=>D(e));x.current=e;for(let t of y.current.values())e.observe(t);return()=>{e.disconnect(),x.current===e&&(x.current=null)}},[c,D]),(0,U.useEffect)(()=>{let e=m.current;if(e.size===0)return;let t=new Set(s),n=new Map([...e].filter(([e])=>t.has(e)));n.size!==e.size&&(m.current=n,u(n))},[s]),(0,U.useLayoutEffect)(()=>{let e=v.current,t=o.current;!t||e===0||(t.scrollTop+=e,v.current=0,C())},[l,C,o]),!c)return(0,W.jsx)(W.Fragment,{children:r.map((e,t)=>(0,W.jsx)(U.Fragment,{children:a(e,t)},s[t]))});let O=E[E.length-1]??0,k=Math.max(e,d.height*i),A=St(E,Math.max(0,d.scrollTop-k),r.length),j=Math.min(r.length-1,St(E,d.scrollTop+d.height+k,r.length)+1);return(0,W.jsx)(`div`,{"data-rendered-turn-count":j-A+1,"data-total-turn-count":r.length,"data-virtualized-transcript":`true`,style:{height:O,position:`relative`,width:`100%`},children:r.slice(A,j+1).map((e,t)=>{let n=A+t,r=s[n];return(0,W.jsx)(`div`,{ref:e=>T(r,e),"data-virtualized-turn-index":n,style:{left:0,position:`absolute`,right:0,top:E[n]},children:a(e,n)},r)})})}function Tt(e){return typeof e==`object`&&!!e}function Et(e){if(typeof e!=`string`)return e;let t=e.trim();if(!t)return e;try{let n=JSON.parse(t);return Tt(n)||Array.isArray(n)?n:e}catch{return e}}function Dt(e){if(!Tt(e)||typeof e.type!=`string`||!e.type.startsWith(`tool-`))return e;let t=Et(e.input),n=Et(e.output),r=Et(e.result),i=t!==e.input,a=n!==e.output,o=r!==e.result;if(!i&&!a&&!o)return e;let s={...e};return i&&(s.input=t),a&&(s.output=n),o&&(s.result=r),s}function Ot(e){let t=!1,n=e.map(e=>{let n=Dt(e);return n!==e&&(t=!0),n});return t?n:e}export{Ne as a,me as c,ce as d,le as f,B as h,ze as i,he as l,oe as m,wt as n,Se as o,se as p,xt as r,fe as s,Ot as t,pe as u};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dist-CprW0Qol.js","assets/rolldown-runtime-hePW80VL.js","assets/preload-helper-BLdHbfdN.js","assets/space-separated-tokens-Ciu5hotc.js","assets/character-entities-legacy-Wut6vMuj.js","assets/lib-BvGd2E-G.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./react-Cvdyeg_0.js";import{t as n}from"./jsx-runtime-NZYk81nU.js";import{t as r}from"./utils-oBThwhjm.js";import{c as i,i as a,
|
|
3
|
-
`),g),q=(0,M.useCallback)(e=>{a===void 0&&I(e),l?.(e)},[l,a]);(0,M.useEffect)(()=>{O.current!==`streaming`&&n===`streaming`&&q(!0),O.current===`streaming`&&n!==`streaming`&&d&&q(!1),O.current=n},[d,q,n]),(0,M.useEffect)(()=>()=>{A.current&&window.clearTimeout(A.current)},[]),(0,M.useLayoutEffect)(()=>{let e=D.current;if(!e||!L||!R)return;let t=requestAnimationFrame(()=>{e.scrollHeight<=e.clientHeight||(typeof e.scrollTo==`function`?e.scrollTo({top:e.scrollHeight,behavior:C?`auto`:`smooth`}):e.scrollTop=e.scrollHeight)});return()=>cancelAnimationFrame(t)});let J=(0,M.useCallback)(async()=>{x?await x():b&&await navigator.clipboard?.writeText(b),P(!0),A.current&&window.clearTimeout(A.current),A.current=window.setTimeout(()=>P(!1),1600)},[b,x]);return(0,N.jsxs)(`div`,{"data-state":n,"aria-busy":R,className:r(`w-full text-sm`,S),children:[(0,N.jsxs)(`button`,{id:T,type:`button`,"aria-expanded":L,"aria-controls":E,onClick:()=>q(!L),className:`group flex min-h-9 w-full items-center gap-2 rounded-md py-1 text-left outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background`,children:[(0,N.jsx)(v,{"aria-hidden":`true`,className:`size-4 shrink-0 text-muted-foreground`}),(0,N.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-xs text-foreground/80`,children:e}),(0,N.jsxs)(`span`,{className:`flex shrink-0 items-center gap-2`,children:[(0,N.jsx)(K,{value:z,type:`added`}),(0,N.jsx)(K,{value:B,type:`removed`})]}),(0,N.jsx)(`span`,{className:`grid size-4 shrink-0 place-items-center text-muted-foreground/60`,children:R?(0,N.jsx)(y,{"aria-label":`Applying changes`,className:r(`size-3.5`,!C&&`animate-spin`)}):n===`error`?(0,N.jsx)(h,{"aria-label":`Changes failed`,className:`size-3.5`}):n===`cancelled`?(0,N.jsx)(k,{"aria-label":`Changes cancelled`,className:`size-3.5`}):(0,N.jsx)(f,{"aria-label":`Changes applied`,className:`size-3.5`})}),(0,N.jsx)(
|
|
4
|
-
`).map(e=>{let t={content:e,offset:F};return F+=e.length+1,t}),L=n??{bash:`Bash`,diff:`Diff`,json:`JSON`,python:`Python`,text:`Text`,tsx:`TSX`,typescript:`TypeScript`}[t];(0,M.useEffect)(()=>()=>{C.current&&window.clearTimeout(C.current)},[]),(0,M.useLayoutEffect)(()=>{let e=x.current;if(!e||!A)return;let t=requestAnimationFrame(()=>{e.scrollHeight<=e.clientHeight||(typeof e.scrollTo==`function`?e.scrollTo({top:e.scrollHeight,behavior:b?`auto`:`smooth`}):e.scrollTop=e.scrollHeight)});return()=>cancelAnimationFrame(t)});let R=(0,M.useCallback)(async()=>{g?await g():await navigator.clipboard?.writeText(e),k(!0),C.current&&window.clearTimeout(C.current),C.current=window.setTimeout(()=>k(!1),1600)},[e,g]);return(0,N.jsxs)(D,{"data-state":a,"aria-busy":A,size:`sm`,className:`bg-muted/80`,children:[(0,N.jsxs)(S,{className:`h-10 gap-2.5 px-3 pt-0`,children:[(0,N.jsx)(v,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground/70`}),i?(0,N.jsx)(T,{className:`font-mono text-xs text-foreground/80`,children:i}):null,(0,N.jsx)(`span`,{className:`text-micro font-medium uppercase tracking-wide text-muted-foreground/55`,children:L}),
|
|
5
|
-
`:void 0,className:r(`pr-4`,l?`pl-1`:`pl-4`,m?`whitespace-pre-wrap break-words`:`whitespace-pre`)})},e.offset)})})]})}var X={initial:{opacity:0,y:`90%`,filter:`blur(3px)`},animate:{opacity:1,y:`0%`,filter:`blur(0px)`,transition:i},exit:{opacity:0,y:`-90%`,filter:`blur(3px)`,transition:{duration:.14,ease:
|
|
2
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./react-Cvdyeg_0.js";import{t as n}from"./jsx-runtime-NZYk81nU.js";import{t as r}from"./utils-oBThwhjm.js";import{c as i,i as a,l as o,r as s,s as c}from"./ease-nNJMFgD_.js";import{n as l,t as u}from"./use-reduced-motion-69Ji0Qlf.js";import{t as d}from"./createLucideIcon-CQY2ECfR.js";import{t as f}from"./check-BTwIaCtI.js";import{t as p}from"./chevron-down-Bse1ggZM.js";import{t as m}from"./circle-check-DBhaebaM.js";import{n as h,t as g}from"./wrench-BXX_Ah2s.js";import{n as _,t as v}from"./file-code-corner-BkDULqko.js";import{t as y}from"./loader-circle-BmKYM_C4.js";import{t as b}from"./square-terminal-BLq2bQVF.js";import{t as x}from"./preload-helper-BLdHbfdN.js";import{a as S,i as C,n as w,o as T,r as E,t as D}from"./code-block-pKKmFZ5w.js";var O={name:`ban`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M4.929 4.929 19.07 19.071`,key:`196cmz`}]]};O.node;var k=d(O),A={name:`braces`,size:24,node:[[`path`,{d:`M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1`,key:`ezmyqa`}],[`path`,{d:`M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1`,key:`e1hn23`}]],aliases:[`curly-braces`]};A.node;var j=d(A),M=e(t(),1),N=n(),P=`github-light-high-contrast`,F=`github-dark-high-contrast`,I=null,L=new Map,R=500;function z(e,t){if(L.size>=R){let e=L.keys().next().value;e!==void 0&&L.delete(e)}L.set(e,t)}var B=()=>x(()=>import(`./dist-CprW0Qol.js`).then(e=>e.t),__vite__mapDeps([0,1,2,3,4,5]));function V(){return I||=B().then(({createHighlighter:e})=>e({themes:[P,F],langs:[`bash`,`diff`,`json`,`python`,`tsx`,`typescript`]})),I}function H(e,t){return`${t}\u0000${e}`}function U(e,t){let n=H(e,t),r=L.get(n),[i,a]=(0,M.useState)(r?{key:n,code:e,language:t,lines:r}:null);return(0,M.useEffect)(()=>{let r=L.get(n);if(r){a({key:n,code:e,language:t,lines:r});return}let i=!1;return V().then(r=>{if(i)return;let o=r.codeToTokensWithThemes(e,{lang:t,themes:{light:P,dark:F}}).map(e=>e.map(e=>({content:e.content,offset:e.offset,light:e.variants.light?.color,dark:e.variants.dark?.color})));z(n,o),a({key:n,code:e,language:t,lines:o})}),()=>{i=!0}},[e,n,t]),i?.key===n||i?.language===t&&e.startsWith(i.code)?i.lines:null}function W({code:e,tokens:t,suffix:n,className:r}){return(0,N.jsxs)(`span`,{className:r,children:[t?t.map(e=>(0,N.jsx)(`span`,{style:{"--agent-code-light":e.light??`currentColor`,"--agent-code-dark":e.dark??e.light??`currentColor`},className:`text-[var(--agent-code-light)] dark:text-[var(--agent-code-dark)]`,children:e.content},`${e.offset}-${e.content}`)):e,n]})}function G({open:e,openHeight:t=`auto`,className:n,style:i,transition:a,...c}){let l=u()??!1;return(0,N.jsx)(o.div,{...c,"aria-hidden":!e,inert:!e,initial:!1,animate:l?{opacity:+!!e}:{opacity:+!!e,clipPath:e?`inset(0 0 0% 0)`:`inset(0 0 100% 0)`,y:e?0:-4},transition:a??{duration:l?0:e?.22:.14,ease:s},className:r(`overflow-hidden`,n),style:{...i,height:e?t:0,pointerEvents:e?void 0:`none`,transformOrigin:`top`}})}function K({value:e,type:t}){return e?(0,N.jsxs)(`span`,{className:r(`font-mono text-xs tabular-nums`,t===`added`?`text-product-diff-added`:`text-product-diff-removed`),children:[t===`added`?`+`:`−`,e]}):null}function q({file:e,lines:t,status:n=`streaming`,open:a,defaultOpen:s=!0,onOpenChange:l,collapseOnComplete:d=!0,maxHeight:m=220,language:g=`typescript`,copyText:b,onCopy:x,className:S}){let C=u()??!1,w=(0,M.useId)(),T=`${w}-trigger`,E=`${w}-content`,D=(0,M.useRef)(null),O=(0,M.useRef)(n),A=(0,M.useRef)(void 0),[j,P]=(0,M.useState)(!1),[F,I]=(0,M.useState)(s),L=a??F,R=n===`streaming`,z=t.filter(e=>e.type===`added`).length,B=t.filter(e=>e.type===`removed`).length,V=!!(b||x),H=U(t.map(e=>e.content).join(`
|
|
3
|
+
`),g),q=(0,M.useCallback)(e=>{a===void 0&&I(e),l?.(e)},[l,a]);(0,M.useEffect)(()=>{O.current!==`streaming`&&n===`streaming`&&q(!0),O.current===`streaming`&&n!==`streaming`&&d&&q(!1),O.current=n},[d,q,n]),(0,M.useEffect)(()=>()=>{A.current&&window.clearTimeout(A.current)},[]),(0,M.useLayoutEffect)(()=>{let e=D.current;if(!e||!L||!R)return;let t=requestAnimationFrame(()=>{e.scrollHeight<=e.clientHeight||(typeof e.scrollTo==`function`?e.scrollTo({top:e.scrollHeight,behavior:C?`auto`:`smooth`}):e.scrollTop=e.scrollHeight)});return()=>cancelAnimationFrame(t)});let J=(0,M.useCallback)(async()=>{x?await x():b&&await navigator.clipboard?.writeText(b),P(!0),A.current&&window.clearTimeout(A.current),A.current=window.setTimeout(()=>P(!1),1600)},[b,x]);return(0,N.jsxs)(`div`,{"data-state":n,"aria-busy":R,className:r(`w-full text-sm`,S),children:[(0,N.jsxs)(`button`,{id:T,type:`button`,"aria-expanded":L,"aria-controls":E,onClick:()=>q(!L),className:`group flex min-h-9 w-full items-center gap-2 rounded-md py-1 text-left outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background`,children:[(0,N.jsx)(v,{"aria-hidden":`true`,className:`size-4 shrink-0 text-muted-foreground`}),(0,N.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-xs text-foreground/80`,children:e}),(0,N.jsxs)(`span`,{className:`flex shrink-0 items-center gap-2`,children:[(0,N.jsx)(K,{value:z,type:`added`}),(0,N.jsx)(K,{value:B,type:`removed`})]}),(0,N.jsx)(`span`,{className:`grid size-4 shrink-0 place-items-center text-muted-foreground/60`,children:R?(0,N.jsx)(y,{"aria-label":`Applying changes`,className:r(`size-3.5`,!C&&`animate-spin`)}):n===`error`?(0,N.jsx)(h,{"aria-label":`Changes failed`,className:`size-3.5`}):n===`cancelled`?(0,N.jsx)(k,{"aria-label":`Changes cancelled`,className:`size-3.5`}):(0,N.jsx)(f,{"aria-label":`Changes applied`,className:`size-3.5`})}),(0,N.jsx)(o.span,{"aria-hidden":`true`,animate:{rotate:L?180:0},transition:C?{duration:0}:i,className:`shrink-0 text-muted-foreground/45 transition-colors group-hover:text-muted-foreground`,children:(0,N.jsx)(p,{className:`size-3.5`})})]}),(0,N.jsx)(G,{id:E,role:`region`,"aria-labelledby":T,open:L,children:(0,N.jsx)(`div`,{className:`pl-6 pt-1.5`,children:(0,N.jsxs)(`div`,{className:`overflow-hidden rounded-xl bg-muted/80`,children:[(0,N.jsx)(`div`,{ref:D,"data-slot":`file-diff-viewport`,"aria-live":R?`off`:`polite`,className:`scrollbar-hide overflow-auto`,style:{maxHeight:m},children:(0,N.jsxs)(`div`,{className:`font-mono text-xs leading-5`,children:[(0,N.jsx)(`span`,{className:`sr-only`,children:`File changes`}),t.map((e,t)=>{let n=e.type??`context`;return(0,N.jsxs)(`div`,{className:r(`grid grid-cols-[2.25rem_2.25rem_1rem_minmax(0,1fr)]`,n===`added`&&`bg-success/[0.07]`,n===`removed`&&`bg-destructive/[0.07]`),children:[(0,N.jsx)(`span`,{className:`select-none pr-2 text-right tabular-nums text-muted-foreground/40`,children:e.oldLine}),(0,N.jsx)(`span`,{className:`select-none pr-2 text-right tabular-nums text-muted-foreground/40`,children:e.newLine}),(0,N.jsx)(`span`,{className:r(`select-none text-center text-muted-foreground/45`,n===`added`&&`text-product-diff-added`,n===`removed`&&`text-product-diff-removed`),children:n===`added`?`+`:n===`removed`?`−`:``}),(0,N.jsx)(W,{code:e.content,tokens:H?.[t],className:`min-w-0 whitespace-pre px-1.5`})]},e.id)})]})}),V?(0,N.jsx)(`div`,{className:`flex justify-end px-2 pb-1.5 pt-1`,children:(0,N.jsx)(o.button,{type:`button`,"aria-label":j?`Copied`:`Copy diff`,title:j?`Copied`:`Copy diff`,onClick:J,whileTap:C?void 0:{scale:.96},transition:c,className:`grid size-7 place-items-center rounded-md text-muted-foreground outline-none transition-colors hover:bg-background/70 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring`,children:j?(0,N.jsx)(f,{className:`size-3.5`}):(0,N.jsx)(_,{className:`size-3.5`})})}):null]})})})]})}var J=[];function Y({code:e,language:t=`typescript`,languageLabel:n,filename:i,status:a=`complete`,showStatus:s=!0,showLineNumbers:l=!0,highlightLines:d=J,maxHeight:p=280,wrap:m=!1,copyable:h=!0,onCopy:g}){let b=u()??!1,x=(0,M.useRef)(null),C=(0,M.useRef)(void 0),[O,k]=(0,M.useState)(!1),A=a===`streaming`,j=U(e,t),P=(0,M.useMemo)(()=>new Set(d),[d]),F=0,I=e.split(`
|
|
4
|
+
`).map(e=>{let t={content:e,offset:F};return F+=e.length+1,t}),L=n??{bash:`Bash`,diff:`Diff`,json:`JSON`,python:`Python`,text:`Text`,tsx:`TSX`,typescript:`TypeScript`}[t];(0,M.useEffect)(()=>()=>{C.current&&window.clearTimeout(C.current)},[]),(0,M.useLayoutEffect)(()=>{let e=x.current;if(!e||!A)return;let t=requestAnimationFrame(()=>{e.scrollHeight<=e.clientHeight||(typeof e.scrollTo==`function`?e.scrollTo({top:e.scrollHeight,behavior:b?`auto`:`smooth`}):e.scrollTop=e.scrollHeight)});return()=>cancelAnimationFrame(t)});let R=(0,M.useCallback)(async()=>{g?await g():await navigator.clipboard?.writeText(e),k(!0),C.current&&window.clearTimeout(C.current),C.current=window.setTimeout(()=>k(!1),1600)},[e,g]);return(0,N.jsxs)(D,{"data-state":a,"aria-busy":A,size:`sm`,className:`bg-muted/80`,children:[(0,N.jsxs)(S,{className:`h-10 gap-2.5 px-3 pt-0`,children:[(0,N.jsx)(v,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground/70`}),i?(0,N.jsx)(T,{className:`font-mono text-xs text-foreground/80`,children:i}):null,(0,N.jsx)(`span`,{className:`text-micro font-medium uppercase tracking-wide text-muted-foreground/55`,children:L}),s?(0,N.jsxs)(`span`,{className:r(!h&&!g&&`ml-auto`,`inline-flex shrink-0 items-center gap-1 text-micro font-medium`,A?`text-info`:`text-success`),children:[A?(0,N.jsx)(y,{className:r(`size-3`,!b&&`animate-spin`)}):(0,N.jsx)(f,{className:`size-3`}),A?`Writing`:`Ready`]}):null,h||g?(0,N.jsx)(w,{className:r(`-my-0 -me-0`,s?`ms-0`:`ms-auto`),children:(0,N.jsx)(o.button,{type:`button`,"aria-label":O?`Copied`:`Copy code`,title:O?`Copied`:`Copy code`,onClick:R,whileTap:b?void 0:{scale:.96},transition:c,className:`grid size-7 shrink-0 place-items-center rounded-full text-muted-foreground outline-none transition-colors hover:bg-background/70 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring`,children:O?(0,N.jsx)(f,{className:`size-3.5`}):(0,N.jsx)(_,{className:`size-3.5`})})}):null]}),(0,N.jsx)(E,{ref:x,role:A?`log`:void 0,"aria-live":A?`off`:void 0,className:`max-w-full overflow-auto border-t border-foreground/[0.06] px-0 py-2 font-mono text-xs leading-5 text-foreground/85 [scrollbar-color:color-mix(in_oklab,var(--muted-foreground)_35%,transparent)_transparent] [scrollbar-width:thin]`,style:{maxHeight:p},wrap:m,children:I.map((e,t)=>{let n=t+1;return(0,N.jsx)(`span`,{"data-line-number":l?n:void 0,className:r(`grid min-h-5`,l?`grid-cols-[2.75rem_minmax(0,1fr)] before:content-[attr(data-line-number)] before:select-none before:pr-3 before:text-right before:tabular-nums before:text-muted-foreground/35`:`grid-cols-1`,P.has(n)&&`bg-primary/[0.07]`),children:(0,N.jsx)(W,{code:e.content,tokens:j?.[t],suffix:t<I.length-1?`
|
|
5
|
+
`:void 0,className:r(`pr-4`,l?`pl-1`:`pl-4`,m?`whitespace-pre-wrap break-words`:`whitespace-pre`)})},e.offset)})})]})}var X={initial:{opacity:0,y:`90%`,filter:`blur(3px)`},animate:{opacity:1,y:`0%`,filter:`blur(0px)`,transition:i},exit:{opacity:0,y:`-90%`,filter:`blur(3px)`,transition:{duration:.14,ease:s}}};function Z({value:e,children:t,className:n}){let i=u(),s=(0,M.useRef)(null),[c,d]=(0,M.useState)();return(0,M.useLayoutEffect)(()=>{let e=s.current?.offsetWidth;e&&d(t=>t===e?t:e)}),(0,N.jsxs)(`span`,{className:r(`relative inline-block overflow-hidden whitespace-nowrap align-bottom`,n),style:{width:c,transition:i?void 0:`width 220ms ${a}`},children:[(0,N.jsx)(`span`,{ref:s,"aria-hidden":!0,className:`invisible inline-block whitespace-nowrap`,children:t}),(0,N.jsx)(l,{initial:!1,children:(0,N.jsx)(o.span,{variants:X,initial:!i&&`initial`,animate:i?{opacity:1,filter:`blur(0px)`,scale:1,y:0}:`animate`,exit:i?void 0:`exit`,className:`absolute left-0 top-0 inline-block`,children:t},`roll-${e}`)})]})}function Q(e){return e===`running`?`Running`:e===`success`?`Completed`:e===`error`?`Failed`:`Cancelled`}function $(e){return e===`running`?`text-primary`:e===`success`?`text-success`:e===`error`?`text-destructive`:`text-muted-foreground`}function ee({kind:e}){return e===`terminal`?(0,N.jsx)(b,{className:`size-4`}):e===`request`?(0,N.jsx)(j,{className:`size-4`}):(0,N.jsx)(g,{className:`size-4`})}function te({status:e,reduce:t}){return e===`running`?(0,N.jsx)(y,{className:r(`size-3`,!t&&`animate-spin`)}):e===`success`?(0,N.jsx)(m,{className:`size-3`}):e===`error`?(0,N.jsx)(h,{className:`size-3`}):(0,N.jsx)(k,{className:`size-3`})}function ne({label:e,onClick:t,children:n}){let r=u()??!1;return(0,N.jsx)(o.button,{type:`button`,"aria-label":e,title:e,onClick:t,whileTap:r?void 0:{scale:.96},transition:c,className:`grid size-7 place-items-center rounded-md text-muted-foreground outline-none transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring`,children:n})}function re({children:e,language:t=`bash`,label:n,error:i=!1,className:a}){return(0,N.jsxs)(D,{"data-error":i||void 0,variant:i?`destructive`:`default`,size:`sm`,className:a,children:[(0,N.jsxs)(S,{className:`py-1`,children:[n?(0,N.jsx)(T,{className:r(`text-micro uppercase tracking-[0.12em]`,i?`text-destructive`:`text-muted-foreground/60`),children:i?`Reported error`:n}):null,(0,N.jsx)(w,{children:(0,N.jsx)(C,{value:e,"aria-label":`Copy result`})})]}),(0,N.jsx)(E,{wrap:!0,className:r(`max-h-60 text-xs leading-5`,i?`text-destructive`:`text-foreground/80`),children:e})]})}function ie({tool:e,title:t,children:n,status:a=`running`,kind:s=`custom`,meta:c,open:l,defaultOpen:d=!0,onOpenChange:m,collapseOnComplete:h=!0,maxHeight:g=220,copyText:v}){let y=u()??!1,b=(0,M.useId)(),x=`${b}-trigger`,S=`${b}-content`,C=(0,M.useRef)(null),w=(0,M.useRef)(a),T=(0,M.useRef)(void 0),[E,D]=(0,M.useState)(!1),[O,k]=(0,M.useState)(d),A=l??O,j=a===`running`,P=!!v,F=Q(a),I=(0,M.useCallback)(e=>{l===void 0&&k(e),m?.(e)},[m,l]);(0,M.useEffect)(()=>{w.current!==`running`&&a===`running`&&I(!0),w.current===`running`&&a!==`running`&&h&&I(!1),w.current=a},[h,I,a]),(0,M.useEffect)(()=>()=>{T.current&&window.clearTimeout(T.current)},[]),(0,M.useLayoutEffect)(()=>{let e=C.current;if(!e||!A||!j)return;let t=requestAnimationFrame(()=>{typeof e.scrollTo==`function`?e.scrollTo({top:e.scrollHeight,behavior:y?`auto`:`smooth`}):e.scrollTop=e.scrollHeight});return()=>cancelAnimationFrame(t)});let L=(0,M.useCallback)(async()=>{v&&await navigator.clipboard?.writeText(v),D(!0),T.current&&window.clearTimeout(T.current),T.current=window.setTimeout(()=>D(!1),1600)},[v]);return(0,N.jsxs)(`div`,{"data-state":a,"aria-busy":j,className:`w-full text-sm`,children:[(0,N.jsxs)(`button`,{id:x,type:`button`,"aria-expanded":A,"aria-controls":S,onClick:()=>I(!A),className:`group flex min-h-9 w-full items-center gap-2 py-1 text-left outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background`,children:[(0,N.jsx)(`span`,{"aria-hidden":`true`,className:`grid size-4 shrink-0 place-items-center text-muted-foreground`,children:(0,N.jsx)(ee,{kind:s})}),(0,N.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-2`,children:[(0,N.jsx)(`span`,{className:`min-w-0 truncate font-medium text-foreground/90`,children:t}),c?(0,N.jsx)(`span`,{className:`shrink-0 text-xs tabular-nums text-muted-foreground/60`,children:c}):null,(0,N.jsx)(`span`,{className:`hidden min-w-0 truncate font-mono text-caption text-muted-foreground/55 sm:inline`,children:e})]}),(0,N.jsxs)(`span`,{className:r(`inline-flex shrink-0 items-center gap-1 text-caption font-medium`,$(a)),children:[(0,N.jsx)(te,{status:a,reduce:y}),(0,N.jsx)(Z,{value:a,children:F})]}),(0,N.jsx)(o.span,{"aria-hidden":`true`,animate:{rotate:A?180:0},transition:y?{duration:0}:i,className:`shrink-0 text-muted-foreground/50 transition-colors group-hover:text-muted-foreground`,children:(0,N.jsx)(p,{className:`size-3.5`})})]}),(0,N.jsx)(G,{id:S,role:`region`,"aria-labelledby":x,open:A,children:(0,N.jsx)(`div`,{className:`pl-6 pt-1.5`,children:(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`div`,{ref:C,role:`log`,"aria-live":`polite`,className:`scrollbar-hide overflow-y-auto overscroll-contain`,style:{maxHeight:g},children:n}),P?(0,N.jsxs)(`div`,{className:`flex items-center gap-0.5 px-2 pb-1.5`,children:[(0,N.jsx)(ne,{label:E?`Copied`:`Copy result`,onClick:L,children:E?(0,N.jsx)(f,{className:`size-3.5`}):(0,N.jsx)(_,{className:`size-3.5`})}),(0,N.jsx)(`span`,{className:`ml-auto text-caption text-muted-foreground/55`,children:(0,N.jsx)(Z,{value:a,children:F})})]}):null]})})})]})}export{q as a,Y as i,re as n,G as o,Z as r,ie as t};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/session-tool-renderer-
|
|
2
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./react-Cvdyeg_0.js";import{t as n}from"./jsx-runtime-NZYk81nU.js";import{t as r}from"./utils-oBThwhjm.js";import{n as i,t as a}from"./tool-output-normalizer-DDU09Zc6.js";import{t as o}from"./preload-helper-BLdHbfdN.js";import{a as s,c,i as l,n as u,o as d,r as f,s as p,t as m}from"./trace-IsV5RRvM.js";var h=e(t(),1),g=n(),_=(0,h.lazy)(()=>o(async()=>{let{SessionToolRenderer:e}=await import(`./session-tool-renderer-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/session-tool-renderer-CGMatufW.js","assets/rolldown-runtime-hePW80VL.js","assets/react-Cvdyeg_0.js","assets/jsx-runtime-NZYk81nU.js","assets/utils-oBThwhjm.js","assets/ease-nNJMFgD_.js","assets/is-ref-object-h-bjS8Eq.js","assets/use-reduced-motion-69Ji0Qlf.js","assets/use-presence-BPZ36pcg.js","assets/useButton-CvcmqA2s.js","assets/createLucideIcon-CQY2ECfR.js","assets/arrow-up-right-CG9RNk4p.js","assets/tool-result-C_RIixge.js","assets/check-BTwIaCtI.js","assets/chevron-down-Bse1ggZM.js","assets/circle-check-DBhaebaM.js","assets/wrench-BXX_Ah2s.js","assets/file-code-corner-BkDULqko.js","assets/loader-circle-BmKYM_C4.js","assets/square-terminal-BLq2bQVF.js","assets/preload-helper-BLdHbfdN.js","assets/code-block-pKKmFZ5w.js","assets/button-CWYjn8Zk.js","assets/dist-BogNzeK9.js","assets/clsx-DB0hHKMi.js","assets/chevron-right-BPCB1mOg.js","assets/file-text-cqOanUYv.js","assets/ipython-tool-bieUhw9K.js","assets/tool-output-normalizer-DDU09Zc6.js","assets/search-Cb6fFWew.js","assets/shield-check-7HDd-2Fn.js","assets/safe-external-url-D3PJJIcM.js","assets/eye-iNSvs0UA.js","assets/git-branch-DZEh2mM2.js","assets/sparkles-CASAe1AI.js","assets/rotate-ccw-DLkfsmG9.js","assets/x-DEU6H3M-.js","assets/dist-CprW0Qol.js","assets/space-separated-tokens-Ciu5hotc.js","assets/character-entities-legacy-Wut6vMuj.js","assets/lib-BvGd2E-G.js","assets/useRender-CzJUrRlB.js","assets/surfaces-BUjUJTyD.js","assets/collapsible-Bk6zCsRX.js","assets/createBaseUIEventDetails-DIxvaz-Y.js","assets/react-dom-B7th3XGm.js","assets/useBaseUiId-lKfDDIcw.js","assets/useControlled-CkQSkSv1.js","assets/workspace-path-nav-D-77sJ_A.js","assets/use-hover-capable-CLq8BADD.js","assets/trace-IsV5RRvM.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./react-Cvdyeg_0.js";import{t as n}from"./jsx-runtime-NZYk81nU.js";import{t as r}from"./utils-oBThwhjm.js";import{n as i,t as a}from"./tool-output-normalizer-DDU09Zc6.js";import{t as o}from"./preload-helper-BLdHbfdN.js";import{a as s,c,i as l,n as u,o as d,r as f,s as p,t as m}from"./trace-IsV5RRvM.js";var h=e(t(),1),g=n(),_=(0,h.lazy)(()=>o(async()=>{let{SessionToolRenderer:e}=await import(`./session-tool-renderer-CGMatufW.js`).then(e=>e.n);return{SessionToolRenderer:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50])).then(({SessionToolRenderer:e})=>({default:e}))),v=[];function y(e){return e===`ipython`?`repl`:`artifacts`}function b(e,t){return t?{...e,artifactId:t.id,artifactTitle:t.title,artifactTarget:y(t.kind)}:e}function x(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:void 0}function S(e,t){let n=e.state;return n===`output-error`||n===`error`?`error`:n===`cancelled`||n===`canceled`||n===`aborted`||n===`interrupted`?`cancelled`:n===`input-streaming`||n===`streaming`?t?`running`:`cancelled`:n===`input-available`||n===`pending`||n===`queued`?`pending`:t&&e.output===void 0&&e.result===void 0?`running`:`complete`}function C(e,t,n,r=[],i=!1){let o=e.type;if(typeof o!=`string`||!o.startsWith(`tool-`)||o===`tool-Question`||o===`tool-FleetReasoning`||o===`tool-Thinking`||i)return;let s=o.slice(5),c=s.toLowerCase(),l=c.includes(`edit`)||c.includes(`write`)||c.includes(`patch`)?`Edited`:c.includes(`read`)?`Read`:c.includes(`search`)||c.includes(`grep`)||c.includes(`glob`)?`Searched`:c.includes(`bash`)||c.includes(`shell`)||c.includes(`python`)||c.includes(`ipython`)?`Ran`:s,u=a(e);return{id:typeof e.toolCallId==`string`?e.toolCallId:t,verb:l,target:s,status:S(e,n),part:e,nestedTools:r,traceDescription:u?.traceDescription,durationLabel:u?.durationLabel,reportedError:u?.outputSummary.isError}}function w(e){return{id:`artifact:${e.id}`,verb:e.kind===`compaction`?`Compacted`:e.kind===`refinement`?`Refined`:e.kind===`rlm`?`Delegated`:e.kind===`diff`?`Edited`:`Completed`,target:e.kind===`bash`?`Bash output`:e.kind===`ipython`?`IPython result`:e.kind===`diff`?`File change`:e.kind===`rlm`?`Child task`:e.kind===`refinement`?`Refinement`:`Session activity`,status:e.status===`success`?`complete`:e.status}}function T({step:e,onOpenArtifact:t,renderToolDetails:n}){let a=i(e.part?.type.replace(/^tool-/,``)??e.target),o=e.artifactId,m=o&&e.artifactTitle?e.artifactTarget===`repl`?`Open ${e.artifactTitle} in REPL`:`Open ${e.artifactTitle} in artifacts`:void 0,v=`Details for ${e.target}${e.id?` (${e.id})`:``}`,y=e.reportedError?`reported error`:e.status===`error`?`failed`:e.status===`running`?`running`:e.status===`pending`?`waiting`:e.status===`cancelled`?`cancelled`:`done`,b=(0,g.jsxs)(p,{status:e.status===`running`?`running`:e.status===`error`?`error`:e.status===`pending`?`pending`:void 0,children:[(0,g.jsx)(d,{children:(0,g.jsx)(a,{className:r(`size-3.5`,e.status===`running`&&`animate-pulse text-primary`,e.status===`error`&&`text-destructive`)})}),(0,g.jsxs)(c,{children:[e.verb,` `,e.target]}),(0,g.jsx)(s,{className:e.reportedError?`text-destructive`:void 0,children:y}),e.traceDescription?(0,g.jsx)(s,{className:`max-w-48 truncate`,title:e.traceDescription,children:e.traceDescription}):null,e.durationLabel?(0,g.jsx)(s,{children:e.durationLabel}):null]});return(0,g.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2`,children:[e.part?(0,g.jsxs)(u,{className:`min-w-0 flex-1`,children:[(0,g.jsx)(l,{"aria-label":v,children:b}),(0,g.jsx)(f,{children:n?n(e.part,e.status===`running`,e.nestedTools):(0,g.jsx)(h.Suspense,{fallback:null,children:(0,g.jsx)(_,{part:e.part,nestedTools:e.nestedTools,chatStatus:e.status===`running`?`streaming`:void 0,insideTrace:!0})})})]}):(0,g.jsx)(`div`,{className:`min-w-0 flex-1`,children:b}),m&&o&&t?(0,g.jsx)(`button`,{type:`button`,className:`shrink-0 text-micro underline`,"aria-label":m,onClick:()=>t(o,e.artifactTarget),children:`Open`}):null]})}function E({messages:e,artifacts:t=v,streaming:n,className:a,onOpenArtifact:o,renderToolDetails:_}){let y=(0,h.useMemo)(()=>{let r=new Set,i=new Map(t.flatMap(e=>e.sourceToolCallId?[[e.sourceToolCallId,e]]:[])),a=e.flatMap(e=>{let t=new Set(e.parts.flatMap(e=>{let t=x(e);return(t?.type===`tool-Task`||t?.type===`tool-Agent`)&&typeof t.toolCallId==`string`?[t.toolCallId]:[]})),a=new Map,o=new Set;for(let n of e.parts){let e=x(n),r=typeof e?.toolCallId==`string`?e.toolCallId:void 0,i=r?.indexOf(`:`)??-1;if(!r||i<=0)continue;let s=r.slice(0,i);if(!t.has(s))continue;o.add(r);let c=a.get(s)??[];c.push(e),a.set(s,c)}return e.parts.flatMap((t,s)=>{let c=x(t)??{},l=typeof c.toolCallId==`string`?c.toolCallId:void 0,u=C(c,`${e.id}:${s}`,n,l?a.get(l)??[]:[],l?o.has(l):!1);return!u||r.has(u.id)?[]:(r.add(u.id),[b(u,i.get(u.id))])})}),o=t.flatMap(e=>{if(e.kind===`recap`||e.sourceToolCallId&&r.has(e.sourceToolCallId))return[];let t=b(w(e),e);return r.has(t.id)?[]:(r.add(t.id),[t])});return[...a,...o]},[t,e,n]),[S,E]=(0,h.useState)(!0);if(y.length===0)return null;let D=[...y].reverse().find(e=>e.status===`running`)??y.at(-1),O=i(D?.part?.type.replace(/^tool-/,``)??D?.target??`activity`);return(0,g.jsx)(m,{className:r(`mb-2`,a),"data-testid":`tool-trace`,children:(0,g.jsxs)(u,{open:S,onOpenChange:E,children:[(0,g.jsx)(l,{"aria-label":`${y.length} tool ${y.length===1?`action`:`actions`}`,children:(0,g.jsxs)(p,{status:D?.status===`running`?`running`:D?.status===`error`?`error`:void 0,children:[(0,g.jsx)(d,{children:(0,g.jsx)(O,{className:r(`size-3.5`,D?.status===`running`&&`animate-spin`)})}),(0,g.jsx)(c,{children:n&&D?`${D.verb} ${D.target}`:`${y.length} tool ${y.length===1?`action`:`actions`}`}),(0,g.jsx)(s,{children:y.length})]})}),(0,g.jsx)(f,{children:(0,g.jsx)(m,{className:`gap-1`,children:y.map(e=>(0,g.jsx)(T,{step:e,onOpenArtifact:o,renderToolDetails:_},e.id))})})]})})}export{E as t};
|
package/dist/web/client/assets/{use-reduced-motion-CFEp5oKr.js → use-reduced-motion-69Ji0Qlf.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./react-Cvdyeg_0.js";import{t as n}from"./jsx-runtime-NZYk81nU.js";import{It as r,Lt as i,Rt as a,_ as o,g as s,h as c,s as l}from"./is-ref-object-h-bjS8Eq.js";import{
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./react-Cvdyeg_0.js";import{t as n}from"./jsx-runtime-NZYk81nU.js";import{It as r,Lt as i,Rt as a,_ as o,g as s,h as c,s as l}from"./is-ref-object-h-bjS8Eq.js";import{u}from"./ease-nNJMFgD_.js";import{n as d,t as f}from"./use-presence-BPZ36pcg.js";var p=n(),m=e(t(),1);function h(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function g(...e){return t=>{let n=!1,r=e.map(e=>{let r=h(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():h(e[t],null)}}}}function _(...e){return m.useCallback(g(...e),e)}var v=class extends m.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(d(t)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){let e=t.offsetParent,n=d(e)&&e.offsetWidth||0,r=d(e)&&e.offsetHeight||0,i=getComputedStyle(t),a=this.props.sizeRef.current;a.height=parseFloat(i.height),a.width=parseFloat(i.width),a.top=t.offsetTop,a.left=t.offsetLeft,a.right=n-a.width-a.left,a.bottom=r-a.height-a.top,a.direction=i.direction}return null}componentDidUpdate(){}render(){return this.props.children}};function y({children:e,isPresent:t,anchorX:n,anchorY:r,root:i,pop:a}){let o=(0,m.useId)(),s=(0,m.useRef)(null),c=(0,m.useRef)({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:`ltr`}),{nonce:u}=(0,m.useContext)(l),d=_(s,a===!1?void 0:e.props?.ref??e?.ref);return(0,m.useInsertionEffect)(()=>{let{width:e,height:l,top:d,left:f,right:p,bottom:m,direction:h}=c.current;if(t||a===!1||!s.current||!e||!l)return;let g=h===`rtl`,_=n===`left`?g?`right: ${p}`:`left: ${f}`:g?`left: ${f}`:`right: ${p}`,v=r===`bottom`?`bottom: ${m}`:`top: ${d}`,y=s.current;y.dataset.motionPopId=o;let b=y.ownerDocument,x=b.createElement(`style`);u&&(x.nonce=u);let S=i??b.head;return S.appendChild(x),x.sheet&&x.sheet.insertRule(`
|
|
2
2
|
[data-motion-pop-id="${o}"] {
|
|
3
3
|
position: absolute !important;
|
|
4
4
|
width: ${e}px !important;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./react-Cvdyeg_0.js";import{t as n}from"./jsx-runtime-NZYk81nU.js";import{t as r}from"./utils-oBThwhjm.js";import{c as i,l as a,o,r as s}from"./ease-nNJMFgD_.js";import{n as c,t as l}from"./use-reduced-motion-69Ji0Qlf.js";import{t as u}from"./resource-helpers-CKbSmzpw.js";import{t as d}from"./chevron-right-BPCB1mOg.js";import{n as f,t as p}from"./file-text-cqOanUYv.js";import{d as m,f as h,l as g,o as _,s as v,u as y}from"./layout-constants-BWf8QAZ6.js";import{f as b,r as x}from"./chat-helpers-Bj7_hES7.js";import{t as S}from"./folder-COBtkKZa.js";import{t as C}from"./hard-drive-B3opVeEB.js";import{i as w,t as T}from"./workspace-path-nav-D-77sJ_A.js";import{a as E,i as D,n as O,r as k}from"./skeleton-loaders-DWc1eDL3.js";var A=e(t(),1),j=n(),M={initial:{opacity:0,filter:`blur(6px)`},animate:{opacity:1,filter:`blur(0px)`},exit:e=>e?{}:{opacity:0,filter:`blur(6px)`}},N={initial:{opacity:0},animate:{opacity:1},exit:e=>e?{}:{opacity:0}},P=(0,A.forwardRef)(function({children:e,as:t=`div`,className:n,onMouseLeave:i,pillClassName:s,pillContainerClassName:u,inset:d=20,...f},p){let[m,h]=(0,A.useState)(null),g=(0,A.useId)(),_=l(),v=A.Children.toArray(e).reduce((e,t,n)=>{if(!(0,A.isValidElement)(t))return e;let i=t,l=i.key?String(i.key):`item-${n}`;return e.push((0,A.cloneElement)(i,{key:l,className:r(`relative`,i.props.className),onMouseEnter:()=>{i.props.onMouseEnter?.(),h(l)}},(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(c,{custom:m!==null,children:m===null?null:(0,j.jsx)(a.div,{variants:_?N:M,initial:`initial`,animate:`animate`,exit:`exit`,custom:m!==null,className:r(`pointer-events-none absolute inset-y-0`,u),style:{left:-d,right:-d},children:m===l?(0,j.jsx)(a.div,{layoutId:`shared-bg-${g}`,transition:_?{duration:0}:o,className:r(`pointer-events-none h-full w-full rounded-2xl bg-primary/[0.06]`,s)}):null})}),(0,j.jsx)(`div`,{className:`relative z-10`,children:i.props.children})]}))),e},[]),y=e=>{h(null),i?.(e)};return t===`ul`?(0,j.jsx)(a.ul,{...f,ref:p,layoutRoot:!0,onMouseLeave:y,className:r(`flex w-full flex-col`,n),children:v}):(0,j.jsx)(a.div,{...f,ref:p,layoutRoot:!0,onMouseLeave:y,className:r(`flex w-full flex-col`,n),children:v})});function F(e){return null}function I(e){return null}var L={duration:.22,ease:s},R={duration:.3,ease:s};function z(e,t,n=0,r=null){return e.flatMap((i,a)=>{let o={item:i,depth:n,parentId:r,position:a+1,setSize:e.length};return i.type!==`folder`||!t.has(i.value)||!i.children?.length?[o]:[o,...z(i.children,t,n+1,i.value)]})}function B(e){let t=[];return A.Children.forEach(e,e=>{if((0,A.isValidElement)(e)){if(e.type===A.Fragment){let n=e.props;t.push(...B(n.children));return}if(e.type===F){let n=e.props;t.push({value:n.value,name:n.name,type:`folder`,icon:n.icon,disabled:n.disabled,className:n.className,children:B(n.children)});return}if(e.type===I){let n=e.props;t.push({value:n.value,name:n.name,type:`file`,icon:n.icon,disabled:n.disabled,className:n.className})}}}),t}function V({item:e,open:t,reduce:n}){return e.type===`file`?(0,j.jsx)(h,{className:`size-4`}):n?t?(0,j.jsx)(b,{className:`size-4`}):(0,j.jsx)(S,{className:`size-4`}):(0,j.jsx)(c,{initial:!1,mode:`popLayout`,children:(0,j.jsx)(a.span,{initial:{opacity:0,scale:.75,rotate:t?-8:8},animate:{opacity:1,scale:1,rotate:0},exit:{opacity:0,scale:.75,rotate:t?8:-8},transition:i,className:`absolute inset-0 grid place-items-center`,children:t?(0,j.jsx)(b,{className:`size-4`}):(0,j.jsx)(S,{className:`size-4`})},t?`open`:`closed`)})}function H({children:e,value:t,defaultValue:n=null,onValueChange:s,expandedIds:c,defaultExpandedIds:u=[],onExpandedChange:f,ariaLabel:p=`Files`,indent:m=18,className:h,classNames:g}){let _=l()??!1,[v,y]=(0,A.useState)(n),[b,x]=(0,A.useState)(u),[S,C]=(0,A.useState)(t??n),w=(0,A.useRef)(new Map),T=t===void 0?v:t,E=c??b,D=(0,A.useMemo)(()=>new Set(E),[E]),O=(0,A.useMemo)(()=>B(e),[e]),k=(0,A.useMemo)(()=>z(O,D),[D,O]),M=S!==null&&k.some(({item:e})=>e.value===S)?S:k[0]?.item.value??null;S!==M&&C(M);let N=(0,A.useCallback)(e=>{C(e);let t=w.current.get(e);t?t.focus():requestAnimationFrame(()=>w.current.get(e)?.focus())},[]),F=(0,A.useCallback)(e=>{e.disabled||(t===void 0&&y(e.value),s?.(e.value))},[s,t]),I=(0,A.useCallback)(e=>{c===void 0&&x(e),f?.(e)},[c,f]),H=(0,A.useCallback)(e=>{let t=new Set(E);t.has(e)?t.delete(e):t.add(e),I(Array.from(t))},[E,I]),U=(0,A.useCallback)((e,t)=>{let n=k.findIndex(({item:e})=>e.value===t.item.value),r=k[n-1],i=k[n+1],a=t.item.type===`folder`&&!!t.item.children?.length,o=a&&D.has(t.item.value);if(e.key===`ArrowDown`&&i)e.preventDefault(),N(i.item.value);else if(e.key===`ArrowUp`&&r)e.preventDefault(),N(r.item.value);else if(e.key===`Home`&&k[0])e.preventDefault(),N(k[0].item.value);else if(e.key===`End`&&k.at(-1))e.preventDefault(),N(k.at(-1)?.item.value??t.item.value);else if(e.key===`ArrowRight`&&a)e.preventDefault(),!o&&!t.item.disabled?H(t.item.value):i?.parentId===t.item.value&&N(i.item.value);else if(e.key===`ArrowLeft`)e.preventDefault(),a&&o&&!t.item.disabled?H(t.item.value):t.parentId&&N(t.parentId);else if(e.key===`Enter`||e.key===` `){if(e.preventDefault(),t.item.disabled)return;F(t.item),a&&H(t.item.value)}},[D,N,k,F,H]);return(0,j.jsx)(P,{role:`tree`,"aria-label":p,"aria-multiselectable":`false`,inset:0,pillClassName:`rounded-xl bg-muted`,pillContainerClassName:`inset-y-auto top-0 h-9`,className:r(`min-w-0`,h,g?.tree),children:k.map(e=>{let t=e.item.type===`folder`,n=t&&!!e.item.children?.length,s=n&&D.has(e.item.value),c=T===e.item.value;return(0,j.jsx)(a.div,{layout:!_&&`position`,initial:!_&&{opacity:0,y:-6},animate:{opacity:e.item.disabled?.42:1,y:0,transition:_?{duration:0}:{...L,delay:Math.min(e.position*.025,.1)}},transition:_?{duration:0}:o,children:(0,j.jsxs)(`button`,{ref:t=>{t?w.current.set(e.item.value,t):w.current.delete(e.item.value)},type:`button`,role:`treeitem`,"aria-level":e.depth+1,"aria-posinset":e.position,"aria-setsize":e.setSize,"aria-selected":c,"aria-expanded":n?s:void 0,"aria-disabled":e.item.disabled||void 0,tabIndex:M===e.item.value?0:-1,onFocus:()=>C(e.item.value),onKeyDown:t=>U(t,e),onClick:()=>{e.item.disabled||(F(e.item),n&&H(e.item.value))},className:r(`group/file-tree relative flex h-9 w-full items-center gap-2 overflow-hidden rounded-lg pr-2 text-left text-sm text-muted-foreground outline-none`,`transition-colors hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset`,`aria-disabled:cursor-not-allowed`,c&&`bg-muted font-medium text-foreground`,g?.item,e.item.className),style:{paddingLeft:8+e.depth*m},children:[e.depth>0?(0,j.jsx)(a.span,{"aria-hidden":`true`,initial:!_&&{opacity:0,scaleY:0},animate:{opacity:1,scaleY:1},exit:{opacity:0,scaleY:0},transition:_?{duration:0}:R,className:`absolute top-0 bottom-0 w-px origin-top bg-border/70`,style:{left:16+(e.depth-1)*m}}):null,(0,j.jsx)(a.span,{"aria-hidden":`true`,animate:{rotate:s?90:0},transition:_?{duration:0}:i,className:r(`relative z-10 grid size-4 shrink-0 place-items-center`,!n&&`opacity-0`),children:(0,j.jsx)(d,{className:`size-3.5`})}),(0,j.jsx)(`span`,{"aria-hidden":`true`,className:r(`relative z-10 grid size-4 shrink-0 place-items-center text-muted-foreground transition-colors group-hover/file-tree:text-foreground`,t&&s&&`text-foreground`,g?.icon),children:e.item.icon??(0,j.jsx)(V,{item:e.item,open:s,reduce:_})}),(0,j.jsx)(`span`,{className:r(`relative z-10 min-w-0 flex-1 truncate`,g?.label),children:e.item.name})]})},e.item.value)})})}var U=`fleet-prime:v1:workspace-tree-width`,W=120,G=200;function K(e,t){let n=Math.max(W,t-160-8);return Math.min(n,Math.max(W,Math.round(e)))}function q(e,t,n,r){return K(n+(t-e),r)}function J(e,t){if(e)return{gridTemplateColumns:`minmax(160px, 1fr) 8px ${t}px`,gridTemplateAreas:`"preview handle tree"`}}function Y(e){return y(U,G,t=>e===void 0?Math.max(W,Math.round(t)):K(t,e))}function X(e){m(U,e)}var Z=e=>{let t=window.matchMedia(`(min-width: 640px)`);return t.addEventListener(`change`,e),()=>t.removeEventListener(`change`,e)},Q=()=>window.matchMedia(`(min-width: 640px)`).matches,ee=()=>!1;function te(){let[e,t]=(0,A.useState)(Y),n=(0,A.useSyncExternalStore)(Z,Q,ee),r=(0,A.useRef)(null),i=(0,A.useCallback)(n=>{let i=r.current?.clientWidth??0;if(i===0)return;let a=K(e,i);g({event:n,startWidth:a,getNextWidth:(e,t,n)=>q(e,t,n,i),onWidthChange:e=>{t(e),X(e)}})},[e]);return(0,A.useEffect)(()=>{let e=r.current;if(!e)return;let n=e.clientWidth;n<640||t(e=>{let t=K(e,n);return t===e?e:(X(t),t)})},[]),{handleTreeResizeStart:i,isSplitLayout:n,splitRef:r,splitStyle:J(n,e)}}var ne=15e3;function re(e){return e instanceof DOMException&&e.name===`AbortError`?Error(`Preview timed out`):e instanceof Error?e.name===`AbortError`||/aborted|timed out/i.test(e.message)?Error(`Preview timed out`):e:Error(String(e))}function ie({error:e,emptyDescription:t=`agent-workspace has not been loaded yet.`,emptyTitle:n=`Workspace unavailable`,loadWorkspaceFile:r,loading:i,onSelectedPathChange:a,previewEmptyDescription:o=`Choose a workspace file to preview its Markdown.`,previewEmptyTitle:s=`Select a file`,scopePath:c,scopeLabel:l,selectedPath:d,treeTestId:p=`workspace-tree`,workspace:m}){let[h,g]=(0,A.useState)(null),y=a!==void 0,b=y?d??null:h,S=e=>{if(y){a(e);return}g(e)},[w,O]=(0,A.useState)(null),[M,N]=(0,A.useState)(null),[P,F]=(0,A.useState)(!1),I=(0,A.useRef)(null),{handleTreeResizeStart:L,isSplitLayout:R,splitRef:z,splitStyle:B}=te(),V=(0,A.useMemo)(()=>{if(!m)return{headerLabel:l??`agent-workspace`,nodes:[]};if(!c)return{headerLabel:m.root,nodes:m.nodes};let e=u(m.nodes,c);return e?e.type===`directory`?{headerLabel:l??e.name,nodes:e.children??[]}:{headerLabel:l??e.name,nodes:[e]}:{headerLabel:l??c.split(`/`).pop()??c,nodes:[]}},[l,c,m]);if((0,A.useEffect)(()=>{if(!(!m||!b)){if(c&&!T(b,c)){S(null),O(null),N(null);return}u(m.nodes,b)?.type!==`file`&&(S(null),O(null),N(null))}},[a,c,b,m]),(0,A.useEffect)(()=>{if(!b){F(!1);return}let e=b,t=new AbortController,n=window.setTimeout(()=>t.abort(),ne),i=!1;return O(t=>t?.path===e?t:null),F(!0),N(null),(async()=>{try{let n=await Promise.race([r(e,t.signal),new Promise((e,n)=>{let r=()=>n(new DOMException(`Preview timed out`,`AbortError`));if(t.signal.aborted){r();return}t.signal.addEventListener(`abort`,r,{once:!0})})]);if(i)return;O(n),N(null)}catch(e){if(i)return;O(null),N(re(e))}finally{i||F(!1)}})(),()=>{i=!0,window.clearTimeout(n),t.abort()}},[r,b,m]),(0,A.useEffect)(()=>{if(!b||typeof window>`u`||window.matchMedia(`(min-width: 960px)`).matches)return;let e=window.requestAnimationFrame(()=>{I.current?.scrollIntoView({block:`start`,inline:`nearest`,behavior:`auto`})});return()=>window.cancelAnimationFrame(e)},[b]),e)return x(e)?(0,j.jsx)(E,{icon:f,title:`Daytona not connected`,description:`Connect a Daytona API key for your account to browse and preview your agent workspace.`}):(0,j.jsx)(E,{icon:f,title:`Unable to load workspace`,description:e.message});if(i&&!m)return(0,j.jsx)(k,{});if(!m||c&&V.nodes.length===0)return(0,j.jsx)(E,{icon:C,title:n,description:t});let U=(0,j.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-col overflow-hidden`,style:R?{gridArea:`tree`}:void 0,children:(0,j.jsxs)(`div`,{"data-testid":p,className:`min-h-0 min-w-0 flex-1 overflow-y-auto`,children:[(0,j.jsxs)(`div`,{className:`mb-2 flex min-w-0 items-center gap-2 rounded-sm bg-foreground/5 px-2 py-1.5`,children:[(0,j.jsx)(C,{className:`size-3.5 shrink-0 text-foreground/45`}),(0,j.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-label font-medium text-foreground/70`,children:V.headerLabel})]}),(0,j.jsx)(H,{ariaLabel:c?`Files in ${V.headerLabel}`:`Workspace files`,className:`gap-0.5`,classNames:{item:`h-8 gap-1.5 rounded-sm text-label font-normal text-foreground/65 hover:bg-foreground/5 hover:text-foreground/80 aria-selected:bg-foreground/8 aria-selected:text-foreground/80`,icon:`size-3.5 text-foreground/35`,label:`text-label`},value:b,onValueChange:e=>{u(m.nodes,e)?.type===`file`&&S(e)},children:V.nodes.map(e=>$(e))}),m.diagnostics.length>0&&!c&&(0,j.jsx)(`div`,{className:`mt-2 border-t border-border/60 pt-2`,children:(0,j.jsx)(D,{id:`workspace-diagnostics`,label:`Diagnostics`,icon:f,items:m.diagnostics.map((e,t)=>({name:`Diagnostic ${t+1}`,description:e}))})})]})}),W=(0,j.jsx)(`button`,{type:`button`,"aria-label":`Resize workspace tree`,className:`min-h-0 cursor-col-resize touch-none bg-transparent transition-colors outline-none hover:bg-foreground/10 focus-visible:bg-foreground/10 ${v}`,"data-testid":`workspace-tree-resize-handle`,style:R?{gridArea:`handle`}:void 0,onPointerDown:L}),G=(0,j.jsx)(ae,{emptyDescription:o,emptyTitle:s,error:M,loading:P,preview:w,previewRef:I,selectedPath:b,splitGridArea:R?`preview`:void 0});return(0,j.jsxs)(`div`,{ref:z,className:`relative grid h-full min-h-0 grid-cols-1 gap-2 overflow-hidden ${_}`,style:B,children:[U,W,G]})}function $(e){return e.type===`directory`?(0,j.jsx)(F,{value:e.path,name:e.name,children:e.children?.map(e=>$(e))},e.path):(0,j.jsx)(I,{value:e.path,name:e.name},e.path)}function ae({emptyDescription:e,emptyTitle:t,error:n,loading:r,preview:i,previewRef:a,selectedPath:o,splitGridArea:s}){return(0,j.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-col overflow-hidden rounded-md border border-border/60 bg-background`,"data-testid":`workspace-preview`,ref:a,style:s?{gridArea:s}:void 0,children:[(0,j.jsxs)(`div`,{className:`flex min-h-9 min-w-0 shrink-0 items-center gap-2 border-b border-border/60 px-2.5`,children:[(0,j.jsx)(p,{className:`size-3.5 shrink-0 text-foreground/35`}),(0,j.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-label font-medium text-foreground/70`,children:i?.name??o??`Preview`})]}),(0,j.jsxs)(`div`,{className:`flex-1 overflow-y-auto px-3 py-2`,children:[!o&&(0,j.jsx)(E,{icon:p,title:t,description:e}),o&&r&&!i&&(0,j.jsx)(O,{}),o&&n&&(0,j.jsx)(E,{icon:f,title:`Unable to load preview`,description:n.message}),o&&!n&&i?.status===`too-large`&&(0,j.jsx)(E,{icon:f,title:`Preview too large`,description:`${i.name} is too large to preview safely.`}),o&&!n&&i?.status===`unsupported`&&(0,j.jsx)(E,{icon:f,title:`Unsupported preview`,description:`${i.name} is not a supported text file.`}),o&&!n&&i&&(i.status===void 0||i.status===`ok`)&&(0,j.jsx)(w,{className:`text-label leading-relaxed`,content:i.content})]})]})}export{ie as WorkspacePanelContent};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
|
-
"timestamp": "2026-
|
|
3
|
-
"routeEntry": "routes
|
|
4
|
-
"routeEntryGzipBytes":
|
|
5
|
-
"routeEntryReduction": 0.
|
|
2
|
+
"timestamp": "2026-11-01T20:30:05.000Z",
|
|
3
|
+
"routeEntry": "routes-DgbWbQOu.js",
|
|
4
|
+
"routeEntryGzipBytes": 81141,
|
|
5
|
+
"routeEntryReduction": 0.9233458726880761,
|
|
6
6
|
"eagerFiles": 88,
|
|
7
|
-
"eagerGzipBytes":
|
|
7
|
+
"eagerGzipBytes": 361937,
|
|
8
8
|
"passed": true,
|
|
9
9
|
"violations": []
|
|
10
10
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./chunk-CZ7CSFO4.js";
|
|
2
2
|
|
|
3
|
-
// web/app/dist/server/assets/_tanstack-start-manifest_v-
|
|
3
|
+
// web/app/dist/server/assets/_tanstack-start-manifest_v-CGHXgy5L.js
|
|
4
4
|
var tsrStartManifest = () => ({ routes: {
|
|
5
5
|
__root__: {
|
|
6
6
|
filePath: "/home/circleci/prime-agent/web/app/src/routes/__root.tsx",
|
|
@@ -15,7 +15,7 @@ var tsrStartManifest = () => ({ routes: {
|
|
|
15
15
|
"/api/workspace/tree"
|
|
16
16
|
],
|
|
17
17
|
preloads: [
|
|
18
|
-
"/assets/index-
|
|
18
|
+
"/assets/index-D3OD2pV7.js",
|
|
19
19
|
"/assets/rolldown-runtime-hePW80VL.js",
|
|
20
20
|
"/assets/react-Cvdyeg_0.js",
|
|
21
21
|
"/assets/react-dom-B7th3XGm.js",
|
|
@@ -32,19 +32,19 @@ var tsrStartManifest = () => ({ routes: {
|
|
|
32
32
|
scripts: [{ attrs: {
|
|
33
33
|
type: "module",
|
|
34
34
|
async: true,
|
|
35
|
-
src: "/assets/index-
|
|
35
|
+
src: "/assets/index-D3OD2pV7.js"
|
|
36
36
|
} }]
|
|
37
37
|
},
|
|
38
38
|
"/": {
|
|
39
39
|
filePath: "/home/circleci/prime-agent/web/app/src/routes/index.tsx",
|
|
40
40
|
children: void 0,
|
|
41
41
|
preloads: [
|
|
42
|
-
"/assets/routes
|
|
42
|
+
"/assets/routes-DgbWbQOu.js",
|
|
43
43
|
"/assets/with-selector-B_VDO56x.js",
|
|
44
44
|
"/assets/chat-queries-ty76G6rK.js",
|
|
45
45
|
"/assets/utils-oBThwhjm.js",
|
|
46
|
-
"/assets/ease-
|
|
47
|
-
"/assets/use-reduced-motion-
|
|
46
|
+
"/assets/ease-nNJMFgD_.js",
|
|
47
|
+
"/assets/use-reduced-motion-69Ji0Qlf.js",
|
|
48
48
|
"/assets/useButton-CvcmqA2s.js",
|
|
49
49
|
"/assets/createBaseUIEventDetails-DIxvaz-Y.js",
|
|
50
50
|
"/assets/FloatingPortal-D8-EPDs2.js",
|
|
@@ -59,7 +59,7 @@ var tsrStartManifest = () => ({ routes: {
|
|
|
59
59
|
"/assets/provider-label-BItazQ6H.js",
|
|
60
60
|
"/assets/check-BTwIaCtI.js",
|
|
61
61
|
"/assets/chevron-down-Bse1ggZM.js",
|
|
62
|
-
"/assets/tool-part-normalizer-
|
|
62
|
+
"/assets/tool-part-normalizer-CJ2sY87r.js",
|
|
63
63
|
"/assets/open-panel-action-message-SdA1VU42.js",
|
|
64
64
|
"/assets/chevron-right-BPCB1mOg.js",
|
|
65
65
|
"/assets/file-text-cqOanUYv.js",
|
|
@@ -72,7 +72,7 @@ var tsrStartManifest = () => ({ routes: {
|
|
|
72
72
|
"/assets/folder-COBtkKZa.js",
|
|
73
73
|
"/assets/gauge-0Nn96wfZ.js",
|
|
74
74
|
"/assets/sparkles-CASAe1AI.js",
|
|
75
|
-
"/assets/right-panel-registry-
|
|
75
|
+
"/assets/right-panel-registry-BkBAryPm.js",
|
|
76
76
|
"/assets/loader-circle-BmKYM_C4.js",
|
|
77
77
|
"/assets/package-BkC-HSi-.js",
|
|
78
78
|
"/assets/pencil-Cbgq3ybX.js",
|
|
@@ -94,7 +94,7 @@ var tsrStartManifest = () => ({ routes: {
|
|
|
94
94
|
"/assets/useControlled-CkQSkSv1.js",
|
|
95
95
|
"/assets/openui-utils-DawGoQNp.js",
|
|
96
96
|
"/assets/tokens-DinEQBG4.js",
|
|
97
|
-
"/assets/prompt-input-
|
|
97
|
+
"/assets/prompt-input-0kaw0ekd.js",
|
|
98
98
|
"/assets/workspace-path-nav-D-77sJ_A.js",
|
|
99
99
|
"/assets/reasoning-line-DGdPUMwT.js",
|
|
100
100
|
"/assets/use-hover-capable-CLq8BADD.js",
|
|
@@ -3,12 +3,12 @@ import {
|
|
|
3
3
|
FileDiff,
|
|
4
4
|
ToolResult,
|
|
5
5
|
ToolResultOutput
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-PBNUO4IN.js";
|
|
7
7
|
import {
|
|
8
8
|
GenerativeTextRenderer,
|
|
9
9
|
OpenUIHtmlArtifactView
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
10
|
+
} from "./chunk-MDGXRDJM.js";
|
|
11
|
+
import "./chunk-7DUB7HGF.js";
|
|
12
12
|
import "./chunk-KSGGSGOA.js";
|
|
13
13
|
import "./chunk-Q4ECIATK.js";
|
|
14
14
|
import "./chunk-GNXIDE26.js";
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
CollapsibleTrigger,
|
|
25
25
|
primeAgentArtifactDiff
|
|
26
26
|
} from "./chunk-5MOXRFX6.js";
|
|
27
|
-
import "./chunk-
|
|
27
|
+
import "./chunk-4OLRCVML.js";
|
|
28
28
|
import {
|
|
29
29
|
UiErrorBoundary
|
|
30
30
|
} from "./chunk-C5XHGLET.js";
|
|
@@ -2022,7 +2022,7 @@ import "./chunk-DP65WGRD.js";
|
|
|
2022
2022
|
import "./chunk-IGN54DHU.js";
|
|
2023
2023
|
import "./chunk-CZ7CSFO4.js";
|
|
2024
2024
|
|
|
2025
|
-
// web/app/dist/server/assets/artifacts-panel-
|
|
2025
|
+
// web/app/dist/server/assets/artifacts-panel-CHPMYc6C.js
|
|
2026
2026
|
import { useEffect, useMemo, useRef, useState } from "react";
|
|
2027
2027
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
2028
2028
|
var DEFAULT_ARTIFACT_RUNS = [];
|
|
@@ -12,10 +12,10 @@ import "./chunk-BC4GIC2P.js";
|
|
|
12
12
|
import "./chunk-FT7HNDR5.js";
|
|
13
13
|
import {
|
|
14
14
|
RIGHT_PANEL_DEFINITIONS
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-GW7HYECO.js";
|
|
16
16
|
import "./chunk-QOZCYKMA.js";
|
|
17
17
|
import "./chunk-5MOXRFX6.js";
|
|
18
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-4OLRCVML.js";
|
|
19
19
|
import "./chunk-C5XHGLET.js";
|
|
20
20
|
import "./chunk-CE7U5QB2.js";
|
|
21
21
|
import "./chunk-6GYLXDX3.js";
|
|
@@ -40,7 +40,7 @@ import "./chunk-35RIM6VP.js";
|
|
|
40
40
|
import "./chunk-NXAVRSI5.js";
|
|
41
41
|
import "./chunk-CZ7CSFO4.js";
|
|
42
42
|
|
|
43
|
-
// web/app/dist/server/assets/chat-command-palette-
|
|
43
|
+
// web/app/dist/server/assets/chat-command-palette-VF4C0ttN.js
|
|
44
44
|
import { useState } from "react";
|
|
45
45
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
46
46
|
function ChatCommandPalette({ open, onOpenChange, onNewSession, onStop, onResumeSession, onSetRightPanel, onThemeChange, sessions, isStreaming, themePreference }) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// web/app/dist/server/assets/ease-
|
|
1
|
+
// web/app/dist/server/assets/ease-BsySqXCj.js
|
|
2
2
|
var EASE_OUT = [
|
|
3
3
|
0.16,
|
|
4
4
|
1,
|
|
@@ -41,24 +41,6 @@ var SPRING_GLIDE = {
|
|
|
41
41
|
damping: 50,
|
|
42
42
|
mass: 0.5
|
|
43
43
|
};
|
|
44
|
-
var spring = {
|
|
45
|
-
fast: {
|
|
46
|
-
enter: {
|
|
47
|
-
type: "spring",
|
|
48
|
-
duration: 0.08,
|
|
49
|
-
bounce: 0
|
|
50
|
-
},
|
|
51
|
-
exit: { duration: 0.06 }
|
|
52
|
-
},
|
|
53
|
-
moderate: {
|
|
54
|
-
enter: {
|
|
55
|
-
type: "spring",
|
|
56
|
-
duration: 0.16,
|
|
57
|
-
bounce: 0
|
|
58
|
-
},
|
|
59
|
-
exit: { duration: 0.12 }
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
44
|
|
|
63
45
|
export {
|
|
64
46
|
EASE_OUT,
|
|
@@ -68,6 +50,5 @@ export {
|
|
|
68
50
|
SPRING_PRESS,
|
|
69
51
|
SPRING_SWAP,
|
|
70
52
|
SPRING_LAYOUT,
|
|
71
|
-
SPRING_GLIDE
|
|
72
|
-
spring
|
|
53
|
+
SPRING_GLIDE
|
|
73
54
|
};
|