@qredence/fleet 0.7.0 → 0.7.1
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 +6 -0
- package/dist/web/client/assets/{artifacts-panel-Qd6JlHzz.js → artifacts-panel-C69vz-oo.js} +1 -1
- package/dist/web/client/assets/{badge-BjFxrtmB.js → badge-DOGhnsYk.js} +7 -7
- package/dist/web/client/assets/{chat-command-palette-CPlJp2cO.js → chat-command-palette-wyZjTNa8.js} +1 -1
- package/dist/web/client/assets/{chunk-YOKDWASO-C8deEx7Z.js → chunk-YOKDWASO-Dego39cu.js} +4 -4
- package/dist/web/client/assets/{dist-CZDnnosQ.js → dist-QgsZ1U9l.js} +1 -1
- package/dist/web/client/assets/{highlighted-body-KPVGNVTW-CZcNaoxi.js → highlighted-body-KPVGNVTW-CSgDVUQp.js} +1 -1
- package/dist/web/client/assets/index-BARp0bjW.js +13 -0
- package/dist/web/client/assets/{markdown-code-BqFVdovL.js → markdown-code-DfJbKhL9.js} +1 -1
- package/dist/web/client/assets/{markdown-C-Y9gskI.js → markdown-yn-nhRzB.js} +2 -2
- package/dist/web/client/assets/mermaid-HWGCJPDP-BpEVCu9T.js +1 -0
- package/dist/web/client/assets/{openui-renderer-CH9K7_8t.js → openui-renderer-DrfHxs1t.js} +1 -1
- package/dist/web/client/assets/{preload-helper-Czpn1I53.js → preload-helper-BZ1Pz5am.js} +1 -1
- package/dist/web/client/assets/{right-panel-registry-BJG8ubHt.js → right-panel-registry-CF7GLJrk.js} +2 -2
- package/dist/web/client/assets/{routes-BXFQmjL9.js → routes-DCP1DP1g.js} +4 -4
- package/dist/web/client/assets/session-tool-renderer-Yu4G1165.js +1389 -0
- package/dist/web/client/assets/{subagent-chat-panel-DQEnhU2t.js → subagent-chat-panel-bVnkDkgs.js} +1 -1
- package/dist/web/client/assets/{subagent-transcript-CCpg3uL6.js → subagent-transcript-D_L-8PQi.js} +1 -1
- package/dist/web/client/assets/{subagent-utils-DTV2RcFl.js → subagent-utils-D7sXbLsS.js} +2 -2
- package/dist/web/client/assets/{subagents-panel-B-X7WPUU.js → subagents-panel-i5-12E1U.js} +1 -1
- package/dist/web/client/assets/{tool-result-C5Ixe-AJ.js → tool-result-D7HtJ_yg.js} +2 -2
- package/dist/web/client/assets/{workspace-panel-DDjQuELx.js → workspace-panel-Clbmrdza.js} +1 -1
- package/dist/web/client/assets/{workspace-path-nav-DmxBrMV6.js → workspace-path-nav-eVT0rYvv.js} +2 -2
- package/dist/web/client/bundle-budget.json +5 -5
- package/dist/web/server/{_tanstack-start-manifest_v-vL58CVrY-7SDCWIHD.js → _tanstack-start-manifest_v-CaT-3S-N-VAOGUHEJ.js} +9 -9
- package/dist/web/server/{artifacts-panel-CozDO7ak-5T4W7RME.js → artifacts-panel-BuAqeJzj-6DYYLKUW.js} +8 -8
- package/dist/web/server/{chat-command-palette-CLE-L0qp-ZZNKVTSS.js → chat-command-palette-Ca8gXVi2-P6EOQ43G.js} +5 -5
- package/dist/web/server/{chunk-GRGV5FVO.js → chunk-35AFSKDX.js} +3 -3
- package/dist/web/server/{chunk-SLRV7YNY.js → chunk-COWE2EJ6.js} +2 -2
- package/dist/web/server/{chunk-54UEKLGD.js → chunk-FPPKECLB.js} +5 -5
- package/dist/web/server/{chunk-EUWNVEIC.js → chunk-GCDOYNXR.js} +107 -97
- package/dist/web/server/{chunk-QCDSLD3L.js → chunk-ITKXE2Q5.js} +252 -214
- package/dist/web/server/{chunk-NHV77NOI.js → chunk-J4Y2Z3XM.js} +1 -1
- package/dist/web/server/{chunk-RYU7I34A.js → chunk-JFAUSHBI.js} +4 -4
- package/dist/web/server/{chunk-D7GSWBRI.js → chunk-K4KN3QBT.js} +1 -1
- package/dist/web/server/{chunk-B4EBMF5J.js → chunk-M7BTY55G.js} +2 -2
- package/dist/web/server/{chunk-XJHYJLGU.js → chunk-PHHC52CO.js} +3 -3
- package/dist/web/server/{chunk-RVDWGK6U.js → chunk-UTV66W5H.js} +3 -3
- package/dist/web/server/{chunk-F5DJQ3PQ.js → chunk-WPSI5TBE.js} +1528 -2185
- package/dist/web/server/{create-project-dialog-CReZdM5g-2V7C5J67.js → create-project-dialog-DCvdysey-IZUGGDAN.js} +5 -5
- package/dist/web/server/{empty-plugin-adapters-Cqtvkauv-ILKI7W7V.js → empty-plugin-adapters-DOl-E2pL-RKRSN75W.js} +1 -1
- package/dist/web/server/{fork-picker-dialog-CXcLEaor-6SVM5RJO.js → fork-picker-dialog-QH00XmqX-6YLU5REF.js} +3 -3
- package/dist/web/server/{message-queue-Q_Q6hbqc-AOV2PSCX.js → message-queue-BzEFQR8k-2W53EW32.js} +3 -3
- package/dist/web/server/{model-selector-list-BOKU5_Z3-III72ZT2.js → model-selector-list-BjoXmw92-TEKBPB3E.js} +5 -5
- package/dist/web/server/{openui-renderer-VuQOQeAP-XBOR3XGN.js → openui-renderer-CJ7Q2zZ_-FPXKZPSO.js} +5 -5
- package/dist/web/server/{resources-panel-Cnz-X1bx-TT5KVROR.js → resources-panel-yVB4xF_K-OHFHXVU4.js} +4 -4
- package/dist/web/server/{router-C437aaqv-72HBLLJI.js → router-UgU5vJxm-R33FGTXY.js} +2 -2
- package/dist/web/server/{routes-BkVN3m9i-PYNMNLQ5.js → routes-Cbbo-jh9-ZUPH4SJD.js} +2 -2
- package/dist/web/server/server.js +2410 -1672
- package/dist/web/server/{session-reasoning-panel-2_TR5nKM-KA5OY7ZV.js → session-reasoning-panel-C50VbaQ8-4YLMVVY6.js} +4 -4
- package/dist/web/server/{session-tool-renderer-BFEWy2Pk-JTSYUPO5.js → session-tool-renderer-QcAkYD-V-6RXRKDH6.js} +5 -5
- package/dist/web/server/{session-tree-panel-3y9LVA0A-4V4TJX62.js → session-tree-panel-CL49XSTK-4ZPK6AIV.js} +3 -3
- package/dist/web/server/{settings-dialog-DgZ8Z5e4-6T5AS2EB.js → settings-dialog-DG9HEZeP-TWDRDGMN.js} +6 -6
- package/dist/web/server/{start-QK6aG02q-EMREW2SB.js → start-DEejK9Uj-FODAOTAO.js} +1 -1
- package/dist/web/server/{subagent-chat-panel-B0pmAxCp-DKXNAOUU.js → subagent-chat-panel-Cg2CxshI-WWGFHTIF.js} +7 -7
- package/dist/web/server/{subagents-panel-FUUT0t1i-5ZKJ2QAJ.js → subagents-panel-aC3Eo-MR-RNIPLCZQ.js} +7 -7
- package/dist/web/server/{workspace-panel-BbI1N4f8-WYOEVH4G.js → workspace-panel-DfdFkgHU-6HIOXRBX.js} +4 -4
- package/package.json +2 -2
- package/dist/web/client/assets/index-D3HpiAnD.js +0 -12
- package/dist/web/client/assets/mermaid-HWGCJPDP-CVNXPao6.js +0 -1
- package/dist/web/client/assets/session-tool-renderer-mOZdkbiU.js +0 -1389
package/dist/web/client/assets/{subagent-chat-panel-DQEnhU2t.js → subagent-chat-panel-bVnkDkgs.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./jsx-runtime-NZYk81nU.js";import{t}from"./prompt-input-IwZOepG7.js";import{t as n}from"./subagent-transcript-
|
|
1
|
+
import{t as e}from"./jsx-runtime-NZYk81nU.js";import{t}from"./prompt-input-IwZOepG7.js";import{t as n}from"./subagent-transcript-D_L-8PQi.js";var r=e();function i({disabled:e,sending:n,onSend:i,onStop:a,placeholder:o=`Message this subagent… (Enter to steer)`}){return(0,r.jsx)(`div`,{className:`shrink-0 border-t border-border/60 bg-background/80 px-4 py-3 backdrop-blur`,children:(0,r.jsx)(`div`,{className:`mx-auto w-full max-w-3xl`,children:(0,r.jsx)(t,{"aria-label":`Message subagent`,disabled:e,loading:n,minRows:1,onSubmit:e=>i(e),onStop:a,placeholder:o})})})}function a({child:e,parentSessionId:t,state:a}){let o=a.error??(a.status===`error`?Error(e.error??`The subagent thread ended with an error.`):void 0),s=a.loading?`loading`:a.status===`error`||o?`error`:`ready`,c=t!==void 0&&!a.loading;return(0,r.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[(0,r.jsx)(n,{child:e,fullWidth:!0,parentSessionId:t,status:a.status,transcript:{status:s,messages:a.messages,presentation:a.presentation,error:o},onRefresh:a.refresh}),(0,r.jsx)(i,{disabled:!c,sending:a.sending,onSend:e=>void a.sendMessage(e),onStop:a.stop})]})}export{a as SubagentChatPanel};
|
package/dist/web/client/assets/{subagent-transcript-CCpg3uL6.js → subagent-transcript-D_L-8PQi.js}
RENAMED
|
@@ -1 +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"./button-BJyg7l5W.js";import{t as i}from"./utils-Dpy9ZFOr.js";import{t as a}from"./bot-DETalD3q.js";import{t as o}from"./chevron-down-Bse1ggZM.js";import{c as s,d as c,f as l,i as u,l as d,m as f,n as p,o as m,p as h,r as g,s as _,t as v,u as y}from"./subagent-utils-
|
|
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"./button-BJyg7l5W.js";import{t as i}from"./utils-Dpy9ZFOr.js";import{t as a}from"./bot-DETalD3q.js";import{t as o}from"./chevron-down-Bse1ggZM.js";import{c as s,d as c,f as l,i as u,l as d,m as f,n as p,o as m,p as h,r as g,s as _,t as v,u as y}from"./subagent-utils-D7sXbLsS.js";import{t as b}from"./session-tool-renderer-Yu4G1165.js";import{n as x}from"./file-text-cqOanUYv.js";import{t as S}from"./circle-check-DBhaebaM.js";import{t as C}from"./tool-timeline-B4ci1oJg.js";import{t as w}from"./loader-circle-BmKYM_C4.js";import{t as T}from"./refresh-cw-CqPE3kNY.js";import{t as E}from"./prime-agent-artifacts-C-g1VPiW.js";var D=e(t(),1);function O(e){return e.status===`running`||e.status===`recovering`?`streaming`:e.status===`error`||e.status===`failed`?`error`:`ready`}var k=n();function A({children:e,tree:t,className:n}){let r=(0,D.useMemo)(()=>v(e,t),[e,t]),a=r.some(e=>e.status===`queued`||e.status===`running`||e.status===`recovering`),[s,c]=(0,D.useState)(a);return r.length===0?null:(0,k.jsxs)(`section`,{className:i(`mt-2 rounded-xl border border-border/60 bg-muted/20`,n),children:[(0,k.jsxs)(`button`,{type:`button`,"aria-expanded":s||a,onClick:()=>c(e=>!e),className:`flex w-full items-center gap-2 px-3 py-2 text-left text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:[a?(0,k.jsx)(w,{className:`size-3.5 animate-spin text-primary`}):(0,k.jsx)(S,{className:`size-3.5 text-emerald-600 dark:text-emerald-400`}),(0,k.jsx)(`span`,{className:`flex-1 font-medium`,children:a?`Subagents working`:`Subagents completed`}),(0,k.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:r.length}),(0,k.jsx)(o,{className:i(`size-3.5 text-muted-foreground transition-transform`,(s||a)&&`rotate-180`)})]}),s||a?(0,k.jsx)(`div`,{className:`space-y-1 border-t border-border/50 px-3 py-2`,children:r.map(e=>(0,k.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2`,style:{paddingLeft:`${Math.max(0,e.depth??0)*12}px`},children:[(0,k.jsx)(`span`,{className:`mt-0.5 shrink-0`,children:p(e.status)}),(0,k.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,k.jsxs)(`div`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,k.jsx)(`span`,{className:`truncate text-sm text-foreground/85`,children:e.label}),e.model?(0,k.jsx)(`span`,{className:`truncate font-mono text-micro text-muted-foreground`,children:e.model}):null]}),e.answerPreview||e.activity?.toolName||e.error?(0,k.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,children:e.error??e.answerPreview??e.activity?.toolName}):null]}),(0,k.jsx)(`span`,{className:`shrink-0 text-micro capitalize text-muted-foreground`,children:e.status})]},e.id))}):null]})}function j({turn:e,isLast:t,isStreaming:n,artifacts:r,presentation:i}){let a=(0,D.useMemo)(()=>e.assistants.flatMap((r,i)=>m(_(r.parts??[]),{messageId:r.id,isLast:t&&i===e.assistants.length-1,isStreaming:n,suppressQuestionTool:!0,ToolRendererComponent:b,TextRendererComponent:f})),[t,n,e.assistants]);return(0,k.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[e.user?(0,k.jsx)(s,{from:`user`,children:(0,k.jsx)(d,{children:(0,k.jsx)(u,{message:e.user,enableImagePreview:!1})})}):null,e.assistants.length>0?(0,k.jsx)(s,{from:`assistant`,children:(0,k.jsx)(d,{children:(0,k.jsx)(c,{variant:`ghost`,children:(0,k.jsxs)(l,{children:[t?(0,k.jsx)(C,{messages:e.assistants,artifacts:r,streaming:n}):null,(0,k.jsx)(`div`,{className:`flex flex-col gap-3`,children:a}),t&&i?(0,k.jsx)(A,{tree:i.rlmTree,children:i.rlmChildren}):null]})})})}):null]})}function M(e,t){return e.user?.id??e.assistants[0]?.id??`subagent-turn-${t}`}function N({child:e,parentSessionId:t,transcript:n,onRefresh:o,fullWidth:s=!1,status:c}){let l=(0,D.useMemo)(()=>n?.status===`loading`?[]:h(n?.messages??[]),[n]),u=c??O(e),d=(0,D.useMemo)(()=>n?.status===`loading`?[]:E(n?.messages??[],n?.presentation,u),[u,n]),f=(0,D.useMemo)(()=>d.flatMap(e=>e.artifacts),[d]),p=n?.presentation,m=(0,D.useCallback)((e,t)=>{let n=t===l.length-1;return(0,k.jsx)(j,{turn:e,isLast:n,isStreaming:n&&u===`streaming`,artifacts:n?f:[],presentation:n?p:void 0})},[f,u,p,l.length]),_=e.sessionName||e.label,[v,b]=(0,D.useState)(null);(0,D.useEffect)(()=>{b(e.lastHeardFrom?new Date(e.lastHeardFrom).toLocaleTimeString():null)},[e.lastHeardFrom]);let S=(0,D.useRef)(null);return(0,k.jsxs)(`section`,{"aria-label":`Subagent thread: ${e.label}`,className:i(s?`flex min-h-0 min-w-0 flex-1 flex-col`:`space-y-2`,`min-w-0`),"data-testid":s?`subagent-conversation-surface`:void 0,children:[(0,k.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2 rounded-md border border-border/60 bg-background px-2.5 py-2`,children:[(0,k.jsx)(a,{className:`mt-0.5 size-3.5 shrink-0 text-foreground/45`}),(0,k.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,k.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,k.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs font-medium text-foreground/80`,children:_}),(0,k.jsx)(`span`,{className:`shrink-0 text-micro capitalize text-foreground/45`,children:e.status})]}),e.model?(0,k.jsx)(`p`,{className:`truncate font-mono text-micro text-foreground/40`,children:e.model}):null,v?(0,k.jsxs)(`p`,{className:`truncate text-micro text-foreground/40`,children:[`Heartbeat: `,v]}):null,e.answerPreview||e.recap?(0,k.jsx)(`p`,{className:`mt-1 line-clamp-3 whitespace-pre-wrap text-caption leading-4 text-foreground/55`,children:e.answerPreview??e.recap}):null]}),o?(0,k.jsx)(r,{"aria-label":`Refresh ${e.label} thread`,className:`shrink-0 text-foreground/40 hover:text-foreground/70`,onClick:o,size:`icon-compact`,title:`Refresh ${e.label} thread`,type:`button`,variant:`ghost`,children:(0,k.jsx)(T,{className:i(`size-3.5`,n?.status===`loading`&&`animate-spin`)})}):null]}),t?n?.status===`loading`?(0,k.jsx)(`div`,{className:i(`flex items-center justify-center rounded-md border border-dashed border-border/70 text-caption text-foreground/45`,s?`min-h-32 flex-1`:`min-h-32`),children:`Loading subagent thread…`}):n?.status===`error`&&l.length===0?(0,k.jsxs)(`div`,{role:`alert`,className:`flex items-start gap-2 rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2 text-caption leading-4 text-destructive`,children:[(0,k.jsx)(x,{className:`mt-0.5 size-3.5 shrink-0`}),(0,k.jsx)(`span`,{children:n.error?.message??`Unable to load this subagent thread.`})]}):l.length===0?(0,k.jsx)(`p`,{className:`rounded-md border border-dashed border-border/70 p-3 text-caption leading-4 text-foreground/45`,children:`This subagent thread has no messages yet.`}):(0,k.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[n?.error?(0,k.jsxs)(`div`,{role:`alert`,className:`mx-4 mt-2 flex items-start gap-2 rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2 text-caption leading-4 text-destructive sm:mx-6`,children:[(0,k.jsx)(x,{className:`mt-0.5 size-3.5 shrink-0`}),(0,k.jsx)(`span`,{children:n.error.message})]}):null,(0,k.jsx)(`div`,{className:i(`min-h-0 rounded-md border border-border/60 bg-background`,s?`flex min-h-0 flex-1 flex-col border-x-0 rounded-none border-b-0`:`h-96 max-h-[calc(100svh-18rem)]`),children:(0,k.jsx)(y,{busy:u===`streaming`,className:s?`min-h-0 flex-1`:void 0,followOutput:u===`streaming`,label:`Transcript for ${e.label}`,smooth:u!==`streaming`,viewportRef:S,viewportClassName:s?`px-0`:void 0,contentClassName:i(`flex flex-col gap-4`,s?`mx-auto w-full max-w-3xl px-4 py-6 sm:px-6`:`px-2.5 py-3`),children:(0,k.jsx)(g,{estimateSize:320,getItemKey:M,itemGap:16,items:l,renderItem:m,viewportRef:S})})})]}):(0,k.jsx)(`p`,{className:`rounded-md border border-dashed border-border/70 p-3 text-caption leading-4 text-foreground/45`,children:`This subagent thread is unavailable until the parent session is active.`})]})}export{N as t};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/openui-renderer-
|
|
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{t as i}from"./utils-Dpy9ZFOr.js";import{d as a,o,r as s}from"./ease-DKi-MOH5.js";import{n as c,t as l}from"./use-reduced-motion-BgG7f9xw.js";import{t as u}from"./createLucideIcon-CQY2ECfR.js";import{i as d}from"./citations-BhyqbxcZ.js";import{t as f}from"./check-BTwIaCtI.js";import{t as p}from"./chevron-right-BPCB1mOg.js";import{n as m,t as h}from"./file-text-cqOanUYv.js";import{t as g}from"./circle-check-DBhaebaM.js";import{a as _,i as v}from"./action-swap-roll-BfVrBOVd.js";import{t as y}from"./loader-circle-BmKYM_C4.js";import{t as b}from"./x-DEU6H3M-.js";import{t as x}from"./preload-helper-Czpn1I53.js";import{t as S}from"./openui-utils-DawGoQNp.js";import"./tokens-CtP2s1Y3.js";import{i as C}from"./workspace-path-nav-DmxBrMV6.js";import{t as w}from"./notify-BC0a76VJ.js";var T={name:`chevron-left`,size:24,node:[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]};T.node;var E=u(T),D={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`]};D.node;var O=u(D),k={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`}]]};k.node;var A=u(k),j={name:`image`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]};j.node;var M=u(j),N={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`}]]};N.node;var P=u(N),F=e(t(),1),I=r(),L=(0,F.lazy)(()=>x(async()=>{let{GenerativeTextRenderer:e}=await import(`./openui-renderer-CH9K7_8t.js`).then(e=>e.n);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])).then(({GenerativeTextRenderer:e})=>({default:e})));function R({className:e,content:t}){return(0,I.jsx)(`div`,{className:e?`${e} whitespace-pre-wrap`:`whitespace-pre-wrap`,children:t})}function z(e){return(0,F.useMemo)(()=>S(e.content).some(e=>e.type===`openui`),[e.content])?(0,I.jsx)(F.Suspense,{fallback:(0,I.jsx)(R,{className:e.className,content:e.content}),children:(0,I.jsx)(L,{...e})}):(0,I.jsx)(C,{className:e.className,content:e.content,isStreaming:e.isStreaming})}function B(e){let t=[],n;for(let r of e){if(r.role===`user`){n&&t.push(n),n={user:r,assistants:[]};continue}if(r.role===`assistant`){if(!n||r.source===`local`){n&&t.push(n),n={assistants:[r]};continue}n.assistants.push(r)}}return n&&t.push(n),t}var V=(0,F.createContext)(void 0),H=(0,F.createContext)({animateIn:!0,variant:`soft`}),U=(0,F.createContext)(()=>{});function ee(...e){return t=>{for(let n of e)typeof n==`function`?n(t):n&&(n.current=t)}}var W={duration:.12,ease:s,delay:.04},G={type:`spring`,stiffness:520,damping:27,mass:.52};function te({variant:e=`soft`,align:t,animateIn:n=!1,className:r,children:s,initial:c,animate:u,exit:d,transition:f,layout:p,...m}){let h=l()??!1,g=(0,F.useContext)(V),_=t??g??`start`,v=(0,F.useMemo)(()=>({align:_,animateIn:n,variant:e}),[n,_,e]);return(0,I.jsx)(H.Provider,{value:v,children:(0,I.jsx)(a.div,{"data-slot":`message-bubble`,"data-align":_,"data-variant":e,layout:p,initial:c??!1,animate:u,exit:d??(h?{opacity:0}:{opacity:0,y:-3,scale:.99}),transition:f??(h?{duration:.12}:o),className:i(`group/bubble flex w-full flex-col`,_===`end`?`items-end`:`items-start`,r),...m,children:s})})}function ne(e,t){return i(`relative z-0 min-w-9 max-w-[82%] rounded-2xl px-3.5 py-2.5 text-sm leading-6 text-foreground`,`[&_a]:font-medium [&_a]:underline [&_a]:underline-offset-4 [&_code]:rounded [&_code]:bg-background/60 [&_code]:px-1 [&_code]:py-0.5 [&_code]:font-mono [&_code]:text-[90%] [&_ol]:my-2 [&_ol]:list-decimal [&_ol]:pl-5 [&_p+p]:mt-2 [&_pre]:my-2 [&_pre]:overflow-x-auto [&_pre]:rounded-xl [&_pre]:bg-background/60 [&_pre]:p-3 [&_ul]:my-2 [&_ul]:list-disc [&_ul]:pl-5`,e===`solid`&&`text-background`,e===`ghost`&&`w-full max-w-none rounded-none px-0 py-0`,e===`danger`&&`text-destructive`,t&&`cursor-pointer text-left outline-none transition-[background-color,color,transform] duration-150 hover:brightness-[0.98] focus-visible:ring-2 focus-visible:ring-ring active:scale-[0.99]`)}function re(e,t){return i(`pointer-events-none absolute inset-0 -z-10 rounded-[inherit]`,t===`end`?`origin-bottom-right`:`origin-bottom-left`,e===`solid`&&`bg-foreground`,e===`soft`&&`bg-muted`,e===`tint`&&`bg-primary/10`,e===`outline`&&`border border-border/70 bg-background`,e===`danger`&&`bg-destructive/10`)}function ie({render:e,className:t,children:n,ref:r,...c}){let u=l()??!1,{align:d=`start`,animateIn:f,variant:p}=(0,F.useContext)(H),[m,h]=(0,F.useState)(0),g=(0,F.useCallback)(()=>h(e=>e+1),[]),_=e?.type===`button`||e?.type===`a`,v=i(ne(p,_),t),y=(0,I.jsxs)(I.Fragment,{children:[p===`ghost`?null:(0,I.jsx)(a.span,{"aria-hidden":`true`,layout:!1,layoutDependency:m,initial:f&&!u?{opacity:0,scale:.92}:!1,animate:{opacity:1,scale:1},transition:u?{duration:0}:{opacity:{duration:.12,ease:s},scale:G,layout:o},className:re(p,d)}),(0,I.jsx)(U.Provider,{value:g,children:(0,I.jsx)(a.div,{initial:f?{opacity:0}:!1,animate:{opacity:1},transition:u?{duration:.12,ease:s}:W,className:`relative`,children:n})})]});if(e){let t=e;return(0,F.cloneElement)(t,{...c,ref:ee(t.props.ref,r),className:i(v,t.props.className),children:y,"data-slot":`message-bubble-content`})}return(0,I.jsx)(`div`,{ref:r,"data-slot":`message-bubble-content`,className:v,...c,children:y})}var K=56,ae=88;function oe(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 se(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?oe(e,ae):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?oe(o,ae):void 0}}function ce({navigation:e,followThreshold:t,contentRef:n,viewportRef:r,reduce:i,smooth:a,scrollToEnd:o,setFollowing:s,markProgrammaticScroll:c}){let l=(0,F.useRef)(void 0),u=(0,F.useRef)(new WeakMap),d=(0,F.useRef)(0),f=(0,F.useRef)(new Map),[p,m]=(0,F.useState)([]),[h,g]=(0,F.useState)(``),[_,v]=(0,F.useState)(!1),y=(0,F.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,F.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=se(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,F.useCallback)(()=>{e===`rail`&&(l.current&&cancelAnimationFrame(l.current),l.current=requestAnimationFrame(()=>{b(),y()}))},[e,b,y]);return(0,F.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,F.useEffect)(()=>()=>{l.current&&cancelAnimationFrame(l.current)},[]),{activeRailId:h,railItems:p,railOverflowing:_,scheduleRailSync:x,scrollToRailItem:(0,F.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 le({item:e}){return(0,I.jsxs)(`div`,{"data-slot":`preview-rail-card`,className:`rounded-2xl border border-border bg-card p-4 shadow-sm`,children:[(0,I.jsx)(`p`,{"data-slot":`preview-rail-title`,className:`font-medium text-card-foreground`,children:e.label}),e.description?(0,I.jsx)(`div`,{"data-slot":`preview-rail-description`,className:`mt-1 text-sm leading-6 text-muted-foreground`,children:e.description}):null]})}function ue({items:e,label:t=`Section navigation`,orientation:n=`vertical`,activeId:r,defaultActiveId:u,onActiveChange:f,onItemSelect:p,renderPreview:m,showPreview:h=!0,previewSide:g=`after`,highlightActive:_=!1,itemSize:v=24,children:y,className:b,railClassName:x,previewContainerClassName:S,previewClassName:C}){let w=(0,F.useId)(),T=l(),E=d(),[D,O]=(0,F.useState)(u??e[0]?.id??``),[k,A]=(0,F.useState)(null),[j,M]=(0,F.useState)(null),N=r??D,P=e.some(e=>e.id===N)?N:e[0]?.id??``,L=k??j??``,R=L||(_?P:``),z=e.findIndex(e=>e.id===R),B=e.length?`repeat(${e.length}, ${v}px)`:void 0,V=n===`horizontal`,H=e=>{r===void 0&&O(e),f?.(e)};return(0,I.jsxs)(a.div,{layoutRoot:!0,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||M(null)},className:i(`isolate relative flex w-full overflow-visible`,V?`min-h-64 flex-col items-center justify-center`:`min-h-80`,b),children:[(0,I.jsx)(`nav`,{"aria-label":t,onPointerLeave:()=>A(null),style:V?{gridTemplateColumns:B}:{gridTemplateRows:B},className:i(`relative z-10 grid shrink-0`,V?`h-12 w-fit max-w-full self-center justify-center`:`w-12 content-center`,x),children:e.map((e,t)=>{let n=e.id===P,r=e.id===R,s=z<0?1/0:Math.abs(t-z),c=r?1:s===1?.68:s===2?.44:.25,l=(0,I.jsx)(I.Fragment,{children:(0,I.jsx)(a.span,{"data-slot":`preview-rail-tick`,"aria-hidden":`true`,animate:V?{scaleY:c}:{scaleX:c},transition:T?{duration:0}:o,className:i(`block bg-current`,V?`h-12 w-0.5 origin-bottom`:`h-0.5 w-12 origin-left`,r?`text-foreground`:void 0)})}),u=i(`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`,V?`h-12 w-6 items-end justify-center`:`h-6 w-12 items-center`),d=V?{width:v}:{height:v},f=()=>{E&&A(e.id)},m=t=>{t.matches(`:focus-visible`)&&M(e.id)},h=()=>{H(e.id),p?.(e)};return e.href?(0,I.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:f,onMouseEnter:f,onPointerDown:()=>M(null),onFocus:e=>m(e.currentTarget),onClick:h,style:d,className:u,children:l},e.id):(0,I.jsx)(`button`,{"data-slot":`preview-rail-item`,type:`button`,"aria-label":e.ariaLabel??e.label,"aria-current":n?`location`:void 0,onPointerEnter:f,onMouseEnter:f,onPointerDown:()=>M(null),onFocus:e=>m(e.currentTarget),onClick:h,style:d,className:u,children:l},e.id)})}),h?(0,I.jsx)(`div`,{"aria-hidden":`true`,style:V?{gridTemplateColumns:B}:{gridTemplateRows:B},className:i(`pointer-events-none absolute z-50 grid`,V?`top-1/2 left-1/2 h-5 w-fit max-w-full -translate-x-1/2 -translate-y-1/2 justify-center`:g===`before`?`inset-y-0 right-16 left-4 content-center`:`inset-y-0 right-4 left-16 content-center`,S),children:e.map(e=>(0,I.jsx)(`div`,{style:V?{width:v}:{height:v},className:i(`relative flex items-center`,V?`justify-center`:void 0),children:(0,I.jsx)(c,{mode:`wait`,initial:!1,children:e.id===L?(0,I.jsx)(a.div,{initial:T?{opacity:0}:{opacity:0,y:4,filter:`blur(6px)`},animate:T?{opacity:1}:{opacity:1,y:0,filter:`blur(0px)`},exit:T?{opacity:0}:{opacity:0,y:-2,filter:`blur(4px)`,transition:{duration:.12,ease:s}},transition:{duration:T?0:.18,ease:s},className:i(V?`absolute bottom-12 left-1/2 w-72 -translate-x-1/2`:i(`w-full max-w-sm`,g===`before`&&`ml-auto`),C),children:(0,I.jsx)(a.div,{layoutId:`preview-rail-card-${w}`,transition:T?{duration:0}:o,children:m?m(e):(0,I.jsx)(le,{item:e})})},e.id):null})},e.id))}):null,y?(0,I.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1`,children:y}):null]})}function de({followOutput:e=!0,followThreshold:t=56,smooth:n=!0,onFollowChange:r,label:a=`Conversation`,busy:o,navigation:s,navigationLabel:c=`Message navigation`,viewportClassName:u,contentClassName:d,railClassName:f,viewportRef:p,viewportProps:m,contentProps:h,className:g,children:_,...v}){let y=l()??!1,b=(0,F.useRef)(null),x=(0,F.useRef)(null),S=(0,F.useRef)(e),C=(0,F.useRef)(!1),w=(0,F.useRef)(void 0),T=(0,F.useRef)(void 0),{onScroll:E,onWheel:D,onTouchStart:O,onKeyDown:k,...A}=m??{},j=(0,F.useCallback)(e=>{b.current=e,typeof p==`function`?p(e):p&&(p.current=e)},[p]),M=(0,F.useCallback)(e=>{S.current!==e&&(S.current=e,r?.(e))},[r]),N=(0,F.useCallback)(e=>{C.current=!0,w.current&&window.clearTimeout(w.current),w.current=window.setTimeout(()=>{C.current=!1},e===`smooth`?320:0)},[]),P=(0,F.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:L,railItems:R,railOverflowing:z,scheduleRailSync:B,scrollToRailItem:V}=ce({navigation:s,followThreshold:t,contentRef:x,viewportRef:b,reduce:y,smooth:n,scrollToEnd:P,setFollowing:M,markProgrammaticScroll:N}),H=(0,F.useEffectEvent)(B),U=(0,F.useEffectEvent)(P),ee=(0,F.useCallback)(()=>{let e=b.current;if(!e||C.current)return;let n=e.scrollHeight-e.scrollTop-e.clientHeight;M(n<=t),B()},[t,B,M]),W=(0,F.useCallback)(()=>{C.current=!1},[]);(0,F.useLayoutEffect)(()=>{if(S.current=e,e)return T.current=requestAnimationFrame(()=>U(`auto`)),()=>{T.current&&cancelAnimationFrame(T.current)}},[e]),(0,F.useEffect)(()=>{let t=x.current;if(!t||typeof ResizeObserver>`u`)return;let r=new ResizeObserver(()=>{H(),!(!e||!S.current)&&U(y||!n?`auto`:`smooth`)});return r.observe(t),()=>r.disconnect()},[e,y,n]),(0,F.useEffect)(()=>()=>{w.current&&window.clearTimeout(w.current),T.current&&cancelAnimationFrame(T.current)},[]);let G=(0,I.jsx)(`section`,{ref:j,"aria-label":a,...A,onScroll:e=>{ee(),E?.(e)},onWheel:e=>{W(),D?.(e)},onTouchStart:e=>{W(),O?.(e)},onKeyDown:e=>{[`ArrowUp`,`PageUp`,`Home`].includes(e.key)&&W(),k?.(e)},className:i(`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]`,u,s===`rail`&&z&&`pr-10`),children:(0,I.jsx)(`div`,{ref:x,role:`log`,"aria-live":o?`off`:`polite`,"aria-relevant":`additions text`,"aria-busy":o,className:d,...h,children:_})});return(0,I.jsx)(`div`,{"data-slot":`message-scroller`,className:i(`min-h-0`,g),...v,children:s===`rail`?(0,I.jsx)(ue,{items:z?R:[],label:c,activeId:L,onItemSelect:V,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:i(`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`,z?`pointer-events-auto opacity-100`:`pointer-events-none opacity-0`,f),children:G}):G})}var fe=(0,F.createContext)({from:`assistant`}),pe={type:`spring`,stiffness:480,damping:32,mass:.62};function me({from:e,animateIn:t=!1,children:n,className:r,initial:o,animate:s,transition:c,exit:u,style:d,...f}){let p=l()??!1,m=(0,F.useMemo)(()=>({from:e}),[e]);return(0,I.jsx)(V.Provider,{value:e===`user`?`end`:`start`,children:(0,I.jsx)(fe.Provider,{value:m,children:(0,I.jsx)(a.article,{"data-slot":`message`,"data-from":e,"aria-label":f[`aria-label`]??`${e} message`,initial:o??(t&&!p?{opacity:0,transform:`translateY(8px) scale(0.95)`}:!1),animate:s??(t&&!p?{opacity:1,transform:`translateY(0px) scale(1)`}:{opacity:1}),exit:u??(p?{opacity:0}:{opacity:0,transform:`translateY(-3px) scale(0.99)`}),transition:c??(p?{duration:.12}:pe),style:{transformOrigin:e===`user`?`100% 100%`:`0% 100%`,...d},className:i(`group/message flex w-full items-start gap-2`,e===`user`?`flex-row-reverse`:`flex-row`,r),...f,children:n})})})}function he({className:e,...t}){let{from:n}=(0,F.useContext)(fe);return(0,I.jsx)(`div`,{"data-slot":`message-content`,className:i(`flex min-w-0 flex-1 flex-col gap-1.5`,n===`user`?`items-end`:`items-start`,e),...t})}var ge=(0,F.memo)(function({title:e=`Something went wrong`,message:t,className:n}){return(0,I.jsx)(`div`,{className:i(`flex justify-start`,n),children:(0,I.jsxs)(`div`,{className:`rounded-[8px] border border-red-500/30 bg-red-500/10 px-4 py-2.5 text-sm text-foreground`,children:[(0,I.jsx)(`div`,{className:`font-medium text-foreground`,children:e}),(0,I.jsx)(`div`,{className:`mt-0.5 text-muted-foreground`,children:t})]})})}),_e=new Intl.DateTimeFormat(`en-US`,{hour:`numeric`,minute:`2-digit`,hour12:!0}),ve=new Intl.DateTimeFormat(`en-US`,{month:`short`,day:`numeric`});function ye(e){let t=new Date;return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()?_e.format(e):ve.format(e)}function be({text:e,onCopied:t}){let[n,r]=(0,F.useState)(!1),a=(0,F.useRef)(null);return(0,F.useEffect)(()=>()=>{a.current&&window.clearTimeout(a.current)},[]),(0,I.jsx)(`button`,{type:`button`,tabIndex:-1,"aria-label":n?`Copied`:`Copy message`,onClick:async()=>{try{await navigator.clipboard.writeText(e),r(!0),a.current&&window.clearTimeout(a.current),a.current=window.setTimeout(()=>{r(!1),a.current=null},2e3),w.success(`Copied to clipboard`),t?.()}catch{w.error(`Failed to copy to clipboard`)}},onPointerDown:e=>{e.stopPropagation()},onMouseDown:e=>e.stopPropagation(),className:i(`flex size-6 items-center justify-center rounded-md transition-[background-color,opacity,transform] duration-150 ease-out active:scale-[0.97]`,`bg-transparent opacity-50 hover:bg-foreground/10 hover:opacity-100`),children:(0,I.jsxs)(`div`,{className:`relative size-3.5`,children:[(0,I.jsx)(v,{className:i(`absolute inset-0 h-3.5 w-3.5 text-muted-foreground transition-[opacity,transform] duration-150 ease-out`,n?`scale-50 opacity-0`:`scale-100 opacity-100`)}),(0,I.jsx)(f,{className:i(`absolute inset-0 h-3.5 w-3.5 text-muted-foreground transition-[opacity,transform] duration-150 ease-out`,n?`scale-100 opacity-100`:`scale-50 opacity-0`)})]})})}function xe({text:e,timestamp:t,heightClass:n,hoverClass:r,isVisible:a,alignClass:o,onCopied:s}){return(0,I.jsxs)(`div`,{className:i(`pointer-events-none flex items-center gap-1 pt-1 text-xs text-muted-foreground/70 opacity-0 transition-opacity duration-100`,n,o,r,a&&`pointer-events-auto opacity-100`),onMouseDown:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation(),children:[t&&(0,I.jsx)(`span`,{children:t}),e&&(0,I.jsx)(be,{text:e,onCopied:s})]})}function Se(e){if(typeof e==`string`)return e;if(e===void 0)return``;try{return JSON.stringify(e,null,2)??``}catch{return String(e)}}function Ce({part:e}){let t=Se(e.payload);return(0,I.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:[(0,I.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,I.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,I.jsxs)(`details`,{open:!0,className:`border-t border-border/50 px-3 py-2`,children:[(0,I.jsx)(`summary`,{className:`cursor-pointer text-xs font-medium text-muted-foreground`,children:`Payload`}),(0,I.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]})}function J(e){return typeof e==`object`&&!!e}function Y(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 X(e){if(!J(e))return!1;let t=e.type;return t===`dynamic-tool`||typeof t==`string`&&t.startsWith(`tool-`)}function Ee(e,t){let n=[];for(let t of e)Y(t)&&n.push(t.text);return n.join(t)}function De(e){return typeof e==`object`&&!!e}function Z(e){if(typeof e!=`string`)return e;let t=e.trim();if(!t)return e;try{let n=JSON.parse(t);return De(n)||Array.isArray(n)?n:e}catch{return e}}function Oe(e){if(!De(e)||typeof e.type!=`string`||!e.type.startsWith(`tool-`))return e;let t=Z(e.input),n=Z(e.output),r=Z(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 ke(e){let t=!1,n=e.map(e=>{let n=Oe(e);return n!==e&&(t=!0),n});return t?n:e}var Ae=[];(0,F.memo)(function(e){let{message:t,UserMessageComponent:n,userMessageClassName:r,onCopied:i,display:a}=e,{enableImagePreview:o,showCopyToolbar:s,isMounted:c,isCopyVisible:l}=a,u=Ee(t.parts??[],``),d=(t.parts??[]).length>0;if(!u&&!d)return null;let f=t?.createdAt,p=`user-${t.id}`,m=c&&f?ye(new Date(f)):void 0;return(0,I.jsxs)(`div`,{className:`group/user-message`,children:[(0,I.jsx)(n,{message:t,className:r,enableImagePreview:o}),(s&&!!u||!!m)&&(0,I.jsx)(xe,{text:s?u:``,timestamp:m,heightClass:`h-[28px]`,hoverClass:`group-hover/user-message:opacity-100 group-hover/user-message:pointer-events-auto`,isVisible:l,alignClass:`justify-end`,onCopied:()=>i(p)})]})}),(0,F.memo)(function(e){let{assistantMsgs:t,turnKey:n,ToolRendererComponent:r,TextRendererComponent:i,toolRenderers:a,onOpenUIAction:o,onOpenUIArtifactReady:s,onOpenArtifact:c,onCopied:l,stream:u,copy:d,display:f}=e,{isLast:p,isStreaming:m}=u,{enabled:h,isVisible:g}=d,{suppressQuestionTool:_}=f,v=Ee(t.flatMap(e=>e.parts??[]),`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/openui-renderer-DrfHxs1t.js","assets/rolldown-runtime-hePW80VL.js","assets/react-Cvdyeg_0.js","assets/react-dom-B7th3XGm.js","assets/jsx-runtime-NZYk81nU.js","assets/button-BJyg7l5W.js","assets/utils-Dpy9ZFOr.js","assets/createBaseUIEventDetails-DklXWq23.js","assets/dist-BogNzeK9.js","assets/clsx-DB0hHKMi.js","assets/card-BScRdZNS.js","assets/select-COK0Kaq2.js","assets/surface-context-DWplCCcO.js","assets/useBaseUiId-BlzQUkVG.js","assets/check-BTwIaCtI.js","assets/createLucideIcon-CQY2ECfR.js","assets/chevron-down-Bse1ggZM.js","assets/input-Ce8yLnXY.js","assets/useControlled-CkQSkSv1.js","assets/safe-external-url-BnEhm9A0.js","assets/chunk-YOKDWASO-Dego39cu.js","assets/preload-helper-BZ1Pz5am.js","assets/lib-ChrQ49PO.js","assets/character-entities-legacy-Wut6vMuj.js","assets/badge-DOGhnsYk.js","assets/dist-BJJVCio8.js","assets/markdown-yn-nhRzB.js","assets/switch-DQETDDJT.js","assets/dialog-DLIPvl1s.js","assets/x-DEU6H3M-.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{t as i}from"./utils-Dpy9ZFOr.js";import{d as a,o,r as s}from"./ease-DKi-MOH5.js";import{n as c,t as l}from"./use-reduced-motion-BgG7f9xw.js";import{t as u}from"./createLucideIcon-CQY2ECfR.js";import{i as d}from"./citations-BhyqbxcZ.js";import{t as f}from"./check-BTwIaCtI.js";import{t as p}from"./chevron-right-BPCB1mOg.js";import{n as m,t as h}from"./file-text-cqOanUYv.js";import{t as g}from"./circle-check-DBhaebaM.js";import{a as _,i as v}from"./action-swap-roll-BfVrBOVd.js";import{t as y}from"./loader-circle-BmKYM_C4.js";import{t as b}from"./x-DEU6H3M-.js";import{t as x}from"./preload-helper-BZ1Pz5am.js";import{t as S}from"./openui-utils-DawGoQNp.js";import"./tokens-CtP2s1Y3.js";import{i as C}from"./workspace-path-nav-eVT0rYvv.js";import{t as w}from"./notify-BC0a76VJ.js";var T={name:`chevron-left`,size:24,node:[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]};T.node;var E=u(T),D={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`]};D.node;var O=u(D),k={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`}]]};k.node;var A=u(k),j={name:`image`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]};j.node;var M=u(j),N={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`}]]};N.node;var P=u(N),F=e(t(),1),I=r(),L=(0,F.lazy)(()=>x(async()=>{let{GenerativeTextRenderer:e}=await import(`./openui-renderer-DrfHxs1t.js`).then(e=>e.n);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])).then(({GenerativeTextRenderer:e})=>({default:e})));function R({className:e,content:t}){return(0,I.jsx)(`div`,{className:e?`${e} whitespace-pre-wrap`:`whitespace-pre-wrap`,children:t})}function z(e){return(0,F.useMemo)(()=>S(e.content).some(e=>e.type===`openui`),[e.content])?(0,I.jsx)(F.Suspense,{fallback:(0,I.jsx)(R,{className:e.className,content:e.content}),children:(0,I.jsx)(L,{...e})}):(0,I.jsx)(C,{className:e.className,content:e.content,isStreaming:e.isStreaming})}function B(e){let t=[],n;for(let r of e){if(r.role===`user`){n&&t.push(n),n={user:r,assistants:[]};continue}if(r.role===`assistant`){if(!n||r.source===`local`){n&&t.push(n),n={assistants:[r]};continue}n.assistants.push(r)}}return n&&t.push(n),t}var V=(0,F.createContext)(void 0),H=(0,F.createContext)({animateIn:!0,variant:`soft`}),U=(0,F.createContext)(()=>{});function ee(...e){return t=>{for(let n of e)typeof n==`function`?n(t):n&&(n.current=t)}}var W={duration:.12,ease:s,delay:.04},G={type:`spring`,stiffness:520,damping:27,mass:.52};function te({variant:e=`soft`,align:t,animateIn:n=!1,className:r,children:s,initial:c,animate:u,exit:d,transition:f,layout:p,...m}){let h=l()??!1,g=(0,F.useContext)(V),_=t??g??`start`,v=(0,F.useMemo)(()=>({align:_,animateIn:n,variant:e}),[n,_,e]);return(0,I.jsx)(H.Provider,{value:v,children:(0,I.jsx)(a.div,{"data-slot":`message-bubble`,"data-align":_,"data-variant":e,layout:p,initial:c??!1,animate:u,exit:d??(h?{opacity:0}:{opacity:0,y:-3,scale:.99}),transition:f??(h?{duration:.12}:o),className:i(`group/bubble flex w-full flex-col`,_===`end`?`items-end`:`items-start`,r),...m,children:s})})}function ne(e,t){return i(`relative z-0 min-w-9 max-w-[82%] rounded-2xl px-3.5 py-2.5 text-sm leading-6 text-foreground`,`[&_a]:font-medium [&_a]:underline [&_a]:underline-offset-4 [&_code]:rounded [&_code]:bg-background/60 [&_code]:px-1 [&_code]:py-0.5 [&_code]:font-mono [&_code]:text-[90%] [&_ol]:my-2 [&_ol]:list-decimal [&_ol]:pl-5 [&_p+p]:mt-2 [&_pre]:my-2 [&_pre]:overflow-x-auto [&_pre]:rounded-xl [&_pre]:bg-background/60 [&_pre]:p-3 [&_ul]:my-2 [&_ul]:list-disc [&_ul]:pl-5`,e===`solid`&&`text-background`,e===`ghost`&&`w-full max-w-none rounded-none px-0 py-0`,e===`danger`&&`text-destructive`,t&&`cursor-pointer text-left outline-none transition-[background-color,color,transform] duration-150 hover:brightness-[0.98] focus-visible:ring-2 focus-visible:ring-ring active:scale-[0.99]`)}function re(e,t){return i(`pointer-events-none absolute inset-0 -z-10 rounded-[inherit]`,t===`end`?`origin-bottom-right`:`origin-bottom-left`,e===`solid`&&`bg-foreground`,e===`soft`&&`bg-muted`,e===`tint`&&`bg-primary/10`,e===`outline`&&`border border-border/70 bg-background`,e===`danger`&&`bg-destructive/10`)}function ie({render:e,className:t,children:n,ref:r,...c}){let u=l()??!1,{align:d=`start`,animateIn:f,variant:p}=(0,F.useContext)(H),[m,h]=(0,F.useState)(0),g=(0,F.useCallback)(()=>h(e=>e+1),[]),_=e?.type===`button`||e?.type===`a`,v=i(ne(p,_),t),y=(0,I.jsxs)(I.Fragment,{children:[p===`ghost`?null:(0,I.jsx)(a.span,{"aria-hidden":`true`,layout:!1,layoutDependency:m,initial:f&&!u?{opacity:0,scale:.92}:!1,animate:{opacity:1,scale:1},transition:u?{duration:0}:{opacity:{duration:.12,ease:s},scale:G,layout:o},className:re(p,d)}),(0,I.jsx)(U.Provider,{value:g,children:(0,I.jsx)(a.div,{initial:f?{opacity:0}:!1,animate:{opacity:1},transition:u?{duration:.12,ease:s}:W,className:`relative`,children:n})})]});if(e){let t=e;return(0,F.cloneElement)(t,{...c,ref:ee(t.props.ref,r),className:i(v,t.props.className),children:y,"data-slot":`message-bubble-content`})}return(0,I.jsx)(`div`,{ref:r,"data-slot":`message-bubble-content`,className:v,...c,children:y})}var K=56,ae=88;function oe(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 se(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?oe(e,ae):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?oe(o,ae):void 0}}function ce({navigation:e,followThreshold:t,contentRef:n,viewportRef:r,reduce:i,smooth:a,scrollToEnd:o,setFollowing:s,markProgrammaticScroll:c}){let l=(0,F.useRef)(void 0),u=(0,F.useRef)(new WeakMap),d=(0,F.useRef)(0),f=(0,F.useRef)(new Map),[p,m]=(0,F.useState)([]),[h,g]=(0,F.useState)(``),[_,v]=(0,F.useState)(!1),y=(0,F.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,F.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=se(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,F.useCallback)(()=>{e===`rail`&&(l.current&&cancelAnimationFrame(l.current),l.current=requestAnimationFrame(()=>{b(),y()}))},[e,b,y]);return(0,F.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,F.useEffect)(()=>()=>{l.current&&cancelAnimationFrame(l.current)},[]),{activeRailId:h,railItems:p,railOverflowing:_,scheduleRailSync:x,scrollToRailItem:(0,F.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 le({item:e}){return(0,I.jsxs)(`div`,{"data-slot":`preview-rail-card`,className:`rounded-2xl border border-border bg-card p-4 shadow-sm`,children:[(0,I.jsx)(`p`,{"data-slot":`preview-rail-title`,className:`font-medium text-card-foreground`,children:e.label}),e.description?(0,I.jsx)(`div`,{"data-slot":`preview-rail-description`,className:`mt-1 text-sm leading-6 text-muted-foreground`,children:e.description}):null]})}function ue({items:e,label:t=`Section navigation`,orientation:n=`vertical`,activeId:r,defaultActiveId:u,onActiveChange:f,onItemSelect:p,renderPreview:m,showPreview:h=!0,previewSide:g=`after`,highlightActive:_=!1,itemSize:v=24,children:y,className:b,railClassName:x,previewContainerClassName:S,previewClassName:C}){let w=(0,F.useId)(),T=l(),E=d(),[D,O]=(0,F.useState)(u??e[0]?.id??``),[k,A]=(0,F.useState)(null),[j,M]=(0,F.useState)(null),N=r??D,P=e.some(e=>e.id===N)?N:e[0]?.id??``,L=k??j??``,R=L||(_?P:``),z=e.findIndex(e=>e.id===R),B=e.length?`repeat(${e.length}, ${v}px)`:void 0,V=n===`horizontal`,H=e=>{r===void 0&&O(e),f?.(e)};return(0,I.jsxs)(a.div,{layoutRoot:!0,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||M(null)},className:i(`isolate relative flex w-full overflow-visible`,V?`min-h-64 flex-col items-center justify-center`:`min-h-80`,b),children:[(0,I.jsx)(`nav`,{"aria-label":t,onPointerLeave:()=>A(null),style:V?{gridTemplateColumns:B}:{gridTemplateRows:B},className:i(`relative z-10 grid shrink-0`,V?`h-12 w-fit max-w-full self-center justify-center`:`w-12 content-center`,x),children:e.map((e,t)=>{let n=e.id===P,r=e.id===R,s=z<0?1/0:Math.abs(t-z),c=r?1:s===1?.68:s===2?.44:.25,l=(0,I.jsx)(I.Fragment,{children:(0,I.jsx)(a.span,{"data-slot":`preview-rail-tick`,"aria-hidden":`true`,animate:V?{scaleY:c}:{scaleX:c},transition:T?{duration:0}:o,className:i(`block bg-current`,V?`h-12 w-0.5 origin-bottom`:`h-0.5 w-12 origin-left`,r?`text-foreground`:void 0)})}),u=i(`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`,V?`h-12 w-6 items-end justify-center`:`h-6 w-12 items-center`),d=V?{width:v}:{height:v},f=()=>{E&&A(e.id)},m=t=>{t.matches(`:focus-visible`)&&M(e.id)},h=()=>{H(e.id),p?.(e)};return e.href?(0,I.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:f,onMouseEnter:f,onPointerDown:()=>M(null),onFocus:e=>m(e.currentTarget),onClick:h,style:d,className:u,children:l},e.id):(0,I.jsx)(`button`,{"data-slot":`preview-rail-item`,type:`button`,"aria-label":e.ariaLabel??e.label,"aria-current":n?`location`:void 0,onPointerEnter:f,onMouseEnter:f,onPointerDown:()=>M(null),onFocus:e=>m(e.currentTarget),onClick:h,style:d,className:u,children:l},e.id)})}),h?(0,I.jsx)(`div`,{"aria-hidden":`true`,style:V?{gridTemplateColumns:B}:{gridTemplateRows:B},className:i(`pointer-events-none absolute z-50 grid`,V?`top-1/2 left-1/2 h-5 w-fit max-w-full -translate-x-1/2 -translate-y-1/2 justify-center`:g===`before`?`inset-y-0 right-16 left-4 content-center`:`inset-y-0 right-4 left-16 content-center`,S),children:e.map(e=>(0,I.jsx)(`div`,{style:V?{width:v}:{height:v},className:i(`relative flex items-center`,V?`justify-center`:void 0),children:(0,I.jsx)(c,{mode:`wait`,initial:!1,children:e.id===L?(0,I.jsx)(a.div,{initial:T?{opacity:0}:{opacity:0,y:4,filter:`blur(6px)`},animate:T?{opacity:1}:{opacity:1,y:0,filter:`blur(0px)`},exit:T?{opacity:0}:{opacity:0,y:-2,filter:`blur(4px)`,transition:{duration:.12,ease:s}},transition:{duration:T?0:.18,ease:s},className:i(V?`absolute bottom-12 left-1/2 w-72 -translate-x-1/2`:i(`w-full max-w-sm`,g===`before`&&`ml-auto`),C),children:(0,I.jsx)(a.div,{layoutId:`preview-rail-card-${w}`,transition:T?{duration:0}:o,children:m?m(e):(0,I.jsx)(le,{item:e})})},e.id):null})},e.id))}):null,y?(0,I.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1`,children:y}):null]})}function de({followOutput:e=!0,followThreshold:t=56,smooth:n=!0,onFollowChange:r,label:a=`Conversation`,busy:o,navigation:s,navigationLabel:c=`Message navigation`,viewportClassName:u,contentClassName:d,railClassName:f,viewportRef:p,viewportProps:m,contentProps:h,className:g,children:_,...v}){let y=l()??!1,b=(0,F.useRef)(null),x=(0,F.useRef)(null),S=(0,F.useRef)(e),C=(0,F.useRef)(!1),w=(0,F.useRef)(void 0),T=(0,F.useRef)(void 0),{onScroll:E,onWheel:D,onTouchStart:O,onKeyDown:k,...A}=m??{},j=(0,F.useCallback)(e=>{b.current=e,typeof p==`function`?p(e):p&&(p.current=e)},[p]),M=(0,F.useCallback)(e=>{S.current!==e&&(S.current=e,r?.(e))},[r]),N=(0,F.useCallback)(e=>{C.current=!0,w.current&&window.clearTimeout(w.current),w.current=window.setTimeout(()=>{C.current=!1},e===`smooth`?320:0)},[]),P=(0,F.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:L,railItems:R,railOverflowing:z,scheduleRailSync:B,scrollToRailItem:V}=ce({navigation:s,followThreshold:t,contentRef:x,viewportRef:b,reduce:y,smooth:n,scrollToEnd:P,setFollowing:M,markProgrammaticScroll:N}),H=(0,F.useEffectEvent)(B),U=(0,F.useEffectEvent)(P),ee=(0,F.useCallback)(()=>{let e=b.current;if(!e||C.current)return;let n=e.scrollHeight-e.scrollTop-e.clientHeight;M(n<=t),B()},[t,B,M]),W=(0,F.useCallback)(()=>{C.current=!1},[]);(0,F.useLayoutEffect)(()=>{if(S.current=e,e)return T.current=requestAnimationFrame(()=>U(`auto`)),()=>{T.current&&cancelAnimationFrame(T.current)}},[e]),(0,F.useEffect)(()=>{let t=x.current;if(!t||typeof ResizeObserver>`u`)return;let r=new ResizeObserver(()=>{H(),!(!e||!S.current)&&U(y||!n?`auto`:`smooth`)});return r.observe(t),()=>r.disconnect()},[e,y,n]),(0,F.useEffect)(()=>()=>{w.current&&window.clearTimeout(w.current),T.current&&cancelAnimationFrame(T.current)},[]);let G=(0,I.jsx)(`section`,{ref:j,"aria-label":a,...A,onScroll:e=>{ee(),E?.(e)},onWheel:e=>{W(),D?.(e)},onTouchStart:e=>{W(),O?.(e)},onKeyDown:e=>{[`ArrowUp`,`PageUp`,`Home`].includes(e.key)&&W(),k?.(e)},className:i(`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]`,u,s===`rail`&&z&&`pr-10`),children:(0,I.jsx)(`div`,{ref:x,role:`log`,"aria-live":o?`off`:`polite`,"aria-relevant":`additions text`,"aria-busy":o,className:d,...h,children:_})});return(0,I.jsx)(`div`,{"data-slot":`message-scroller`,className:i(`min-h-0`,g),...v,children:s===`rail`?(0,I.jsx)(ue,{items:z?R:[],label:c,activeId:L,onItemSelect:V,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:i(`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`,z?`pointer-events-auto opacity-100`:`pointer-events-none opacity-0`,f),children:G}):G})}var fe=(0,F.createContext)({from:`assistant`}),pe={type:`spring`,stiffness:480,damping:32,mass:.62};function me({from:e,animateIn:t=!1,children:n,className:r,initial:o,animate:s,transition:c,exit:u,style:d,...f}){let p=l()??!1,m=(0,F.useMemo)(()=>({from:e}),[e]);return(0,I.jsx)(V.Provider,{value:e===`user`?`end`:`start`,children:(0,I.jsx)(fe.Provider,{value:m,children:(0,I.jsx)(a.article,{"data-slot":`message`,"data-from":e,"aria-label":f[`aria-label`]??`${e} message`,initial:o??(t&&!p?{opacity:0,transform:`translateY(8px) scale(0.95)`}:!1),animate:s??(t&&!p?{opacity:1,transform:`translateY(0px) scale(1)`}:{opacity:1}),exit:u??(p?{opacity:0}:{opacity:0,transform:`translateY(-3px) scale(0.99)`}),transition:c??(p?{duration:.12}:pe),style:{transformOrigin:e===`user`?`100% 100%`:`0% 100%`,...d},className:i(`group/message flex w-full items-start gap-2`,e===`user`?`flex-row-reverse`:`flex-row`,r),...f,children:n})})})}function he({className:e,...t}){let{from:n}=(0,F.useContext)(fe);return(0,I.jsx)(`div`,{"data-slot":`message-content`,className:i(`flex min-w-0 flex-1 flex-col gap-1.5`,n===`user`?`items-end`:`items-start`,e),...t})}var ge=(0,F.memo)(function({title:e=`Something went wrong`,message:t,className:n}){return(0,I.jsx)(`div`,{className:i(`flex justify-start`,n),children:(0,I.jsxs)(`div`,{className:`rounded-[8px] border border-red-500/30 bg-red-500/10 px-4 py-2.5 text-sm text-foreground`,children:[(0,I.jsx)(`div`,{className:`font-medium text-foreground`,children:e}),(0,I.jsx)(`div`,{className:`mt-0.5 text-muted-foreground`,children:t})]})})}),_e=new Intl.DateTimeFormat(`en-US`,{hour:`numeric`,minute:`2-digit`,hour12:!0}),ve=new Intl.DateTimeFormat(`en-US`,{month:`short`,day:`numeric`});function ye(e){let t=new Date;return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()?_e.format(e):ve.format(e)}function be({text:e,onCopied:t}){let[n,r]=(0,F.useState)(!1),a=(0,F.useRef)(null);return(0,F.useEffect)(()=>()=>{a.current&&window.clearTimeout(a.current)},[]),(0,I.jsx)(`button`,{type:`button`,tabIndex:-1,"aria-label":n?`Copied`:`Copy message`,onClick:async()=>{try{await navigator.clipboard.writeText(e),r(!0),a.current&&window.clearTimeout(a.current),a.current=window.setTimeout(()=>{r(!1),a.current=null},2e3),w.success(`Copied to clipboard`),t?.()}catch{w.error(`Failed to copy to clipboard`)}},onPointerDown:e=>{e.stopPropagation()},onMouseDown:e=>e.stopPropagation(),className:i(`flex size-6 items-center justify-center rounded-md transition-[background-color,opacity,transform] duration-150 ease-out active:scale-[0.97]`,`bg-transparent opacity-50 hover:bg-foreground/10 hover:opacity-100`),children:(0,I.jsxs)(`div`,{className:`relative size-3.5`,children:[(0,I.jsx)(v,{className:i(`absolute inset-0 h-3.5 w-3.5 text-muted-foreground transition-[opacity,transform] duration-150 ease-out`,n?`scale-50 opacity-0`:`scale-100 opacity-100`)}),(0,I.jsx)(f,{className:i(`absolute inset-0 h-3.5 w-3.5 text-muted-foreground transition-[opacity,transform] duration-150 ease-out`,n?`scale-100 opacity-100`:`scale-50 opacity-0`)})]})})}function xe({text:e,timestamp:t,heightClass:n,hoverClass:r,isVisible:a,alignClass:o,onCopied:s}){return(0,I.jsxs)(`div`,{className:i(`pointer-events-none flex items-center gap-1 pt-1 text-xs text-muted-foreground/70 opacity-0 transition-opacity duration-100`,n,o,r,a&&`pointer-events-auto opacity-100`),onMouseDown:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation(),children:[t&&(0,I.jsx)(`span`,{children:t}),e&&(0,I.jsx)(be,{text:e,onCopied:s})]})}function Se(e){if(typeof e==`string`)return e;if(e===void 0)return``;try{return JSON.stringify(e,null,2)??``}catch{return String(e)}}function Ce({part:e}){let t=Se(e.payload);return(0,I.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:[(0,I.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,I.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,I.jsxs)(`details`,{open:!0,className:`border-t border-border/50 px-3 py-2`,children:[(0,I.jsx)(`summary`,{className:`cursor-pointer text-xs font-medium text-muted-foreground`,children:`Payload`}),(0,I.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]})}function J(e){return typeof e==`object`&&!!e}function Y(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 X(e){if(!J(e))return!1;let t=e.type;return t===`dynamic-tool`||typeof t==`string`&&t.startsWith(`tool-`)}function Ee(e,t){let n=[];for(let t of e)Y(t)&&n.push(t.text);return n.join(t)}function De(e){return typeof e==`object`&&!!e}function Z(e){if(typeof e!=`string`)return e;let t=e.trim();if(!t)return e;try{let n=JSON.parse(t);return De(n)||Array.isArray(n)?n:e}catch{return e}}function Oe(e){if(!De(e)||typeof e.type!=`string`||!e.type.startsWith(`tool-`))return e;let t=Z(e.input),n=Z(e.output),r=Z(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 ke(e){let t=!1,n=e.map(e=>{let n=Oe(e);return n!==e&&(t=!0),n});return t?n:e}var Ae=[];(0,F.memo)(function(e){let{message:t,UserMessageComponent:n,userMessageClassName:r,onCopied:i,display:a}=e,{enableImagePreview:o,showCopyToolbar:s,isMounted:c,isCopyVisible:l}=a,u=Ee(t.parts??[],``),d=(t.parts??[]).length>0;if(!u&&!d)return null;let f=t?.createdAt,p=`user-${t.id}`,m=c&&f?ye(new Date(f)):void 0;return(0,I.jsxs)(`div`,{className:`group/user-message`,children:[(0,I.jsx)(n,{message:t,className:r,enableImagePreview:o}),(s&&!!u||!!m)&&(0,I.jsx)(xe,{text:s?u:``,timestamp:m,heightClass:`h-[28px]`,hoverClass:`group-hover/user-message:opacity-100 group-hover/user-message:pointer-events-auto`,isVisible:l,alignClass:`justify-end`,onCopied:()=>i(p)})]})}),(0,F.memo)(function(e){let{assistantMsgs:t,turnKey:n,ToolRendererComponent:r,TextRendererComponent:i,toolRenderers:a,onOpenUIAction:o,onOpenUIArtifactReady:s,onOpenArtifact:c,onCopied:l,stream:u,copy:d,display:f}=e,{isLast:p,isStreaming:m}=u,{enabled:h,isVisible:g}=d,{suppressQuestionTool:_}=f,v=Ee(t.flatMap(e=>e.parts??[]),`
|
|
3
3
|
|
|
4
4
|
`),y=m&&p,b=h&&!!v.trim()&&!y,x=`assistant-${n}-all`,S=h?v:``;return(0,I.jsxs)(`div`,{className:`group/assistant-turn`,children:[(0,I.jsx)(`div`,{className:`flex flex-col gap-3`,children:t.map((e,n)=>{let l=p&&n===t.length-1;return(0,I.jsx)(Fe,{msg:e,isLast:l,isStreaming:m,suppressQuestionTool:_,ToolRendererComponent:r,TextRendererComponent:i,toolRenderers:a,onOpenUIAction:o,onOpenUIArtifactReady:s,onOpenArtifact:c},e.id)})}),(b||g)&&(0,I.jsx)(xe,{text:S,heightClass:`h-[48px] flex items-start w-full`,hoverClass:`group-hover/assistant-turn:opacity-100 group-hover/assistant-turn:pointer-events-auto`,isVisible:g,alignClass:`justify-start`,onCopied:()=>l(x)})]})});var je=`tool-call:`,Me=`unkeyed-tool:`;function Ne(e,t,n){return t.toolCallId?`${je}${t.toolCallId}`:`${Me}${e}:${t.type}:${n}`}function Pe(e,t){let{messageId:n,isLast:r,isStreaming:i,suppressQuestionTool:a,suppressTextWhenPlanWrite:o=!1,ToolRendererComponent:s,TextRendererComponent:c,toolRenderers:l,onOpenUIAction:u,onOpenUIArtifactReady:d,onOpenArtifact:f}=t,p=[],m=[],h=o&&e.some(e=>X(e)&&e.type===`tool-PlanWrite`),g=new Set(e.filter(e=>X(e)&&(e.type===`tool-Task`||e.type===`tool-Agent`)&&typeof e.toolCallId==`string`).map(e=>e.toolCallId)),_=new Map,v=new Set,y=new Map;for(let t of e){if(!X(t)||t.type===`tool-TaskOutput`||!t.toolCallId||!t.toolCallId.includes(`:`))continue;let e=t.toolCallId.split(`:`)[0];g.has(e)&&(_.has(e)||_.set(e,[]),_.get(e).push(t),v.add(t.toolCallId))}let b=0;for(;b<e.length;){let t=e[b];if(X(t)&&t.type===`tool-TaskOutput`){b++;continue}if(Y(t)){let e=t.text;e&&!h&&m.push(e),b++;continue}if(we(t)){p.push((0,I.jsx)(ge,{title:t.title,message:t.message},`${n}-error-${t.title}-${t.message}`)),b++;continue}if(Te(t)){p.push((0,I.jsx)(Ce,{part:t},`${n}-payload-${b}`)),b++;continue}if(X(t)){if(a&&t.type===`tool-Question`){b++;continue}if(t.toolCallId&&v.has(t.toolCallId)){b++;continue}let e=r&&i?`streaming`:void 0,o=t.toolCallId,c=(t.type===`tool-Task`||t.type===`tool-Agent`)&&o?_.get(o)??Ae:void 0,u=t.toolCallId?0:y.get(t.type)??0;t.toolCallId||y.set(t.type,u+1),p.push((0,I.jsx)(s,{part:t,nestedTools:c,chatStatus:e,toolRenderers:l},Ne(n,t,u))),b++;continue}b++}let x=m.join(`
|
|
5
5
|
|
|
@@ -1 +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"./button-BJyg7l5W.js";import{t as i}from"./utils-Dpy9ZFOr.js";import{t as a}from"./bot-DETalD3q.js";import{n as o,t as s}from"./subagent-utils-
|
|
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"./button-BJyg7l5W.js";import{t as i}from"./utils-Dpy9ZFOr.js";import{t as a}from"./bot-DETalD3q.js";import{n as o,t as s}from"./subagent-utils-D7sXbLsS.js";import{t as c}from"./chevron-right-BPCB1mOg.js";import{t as l}from"./subagent-transcript-D_L-8PQi.js";var u=e(t(),1),d=n();function f({agents:e,loadSession:t,onOpenTab:n,parentSessionId:f,tree:p}){let m=(0,u.useMemo)(()=>s(e,p),[e,p]),[h,g]=(0,u.useState)(null),[_,v]=(0,u.useState)({}),y=(0,u.useRef)(new Map),b=m.find(e=>e.id===h)??m[0];(0,u.useEffect)(()=>{h&&m.some(e=>e.id===h)||g(m[0]?.id??null)},[m,h]);let x=(0,u.useCallback)(async(e,n=!1)=>{if(!f)return;let r=`${f}:${e.id}:${e.status}:${e.timestamp}:${e.activeSessionId??``}`,i=_[e.id];if(!n&&i?.requestKey===r)return;let a=(y.current.get(e.id)??0)+1;y.current.set(e.id,a),v(t=>({...t,[e.id]:{requestKey:r,status:`loading`,messages:[]}}));try{let n=await t(f,e.id);if(y.current.get(e.id)!==a)return;v(t=>({...t,[e.id]:{requestKey:r,status:`ready`,messages:n.messages,presentation:n.presentation}}))}catch(t){if(y.current.get(e.id)!==a)return;v(n=>({...n,[e.id]:{requestKey:r,status:`error`,messages:[],error:t instanceof Error?t:Error(String(t))}}))}},[t,f,_]);return(0,u.useEffect)(()=>{b&&x(b)},[x,b]),m.length===0?(0,d.jsx)(`section`,{"aria-label":`Subagents`,className:`flex min-h-36 items-center rounded-md border border-dashed border-border/70 px-4 text-center text-label leading-5 text-foreground/45`,children:`Subagent threads will appear here when Prime delegates work.`}):(0,d.jsxs)(`section`,{"aria-label":`Subagents`,className:`space-y-2 pb-1`,children:[(0,d.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 rounded-sm bg-foreground/5 px-2 py-1.5`,children:[(0,d.jsx)(a,{className:`size-3.5 shrink-0 text-foreground/45`}),(0,d.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-label font-medium text-foreground/70`,children:`Invoked subagents`}),(0,d.jsx)(`span`,{className:`shrink-0 text-micro text-foreground/40`,children:m.length})]}),(0,d.jsx)(`div`,{className:`space-y-0.5`,"data-testid":`subagent-thread-list`,children:m.map(e=>{let t=e.id===b?.id;return(0,d.jsxs)(r,{type:`button`,variant:`ghost`,size:`compact`,"aria-pressed":t,className:i(`flex w-full min-w-0 items-center gap-2 rounded-md px-2 py-1.5 text-left transition-colors hover:bg-foreground/5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,t&&`bg-foreground/8`),style:{paddingLeft:`${8+Math.max(0,e.depth??0)*12}px`},onClick:()=>{g(e.id),n?.(e.id)},children:[(0,d.jsx)(`span`,{className:`shrink-0`,children:o(e.status)}),(0,d.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-foreground/80`,children:e.label}),(0,d.jsx)(c,{className:`size-3 shrink-0 text-foreground/30`}),(0,d.jsx)(`span`,{className:`shrink-0 text-micro capitalize text-foreground/45`,children:e.status})]},e.id)})}),b?(0,d.jsx)(l,{child:b,parentSessionId:f,transcript:_[b.id],onRefresh:()=>void x(b,!0)}):null]})}export{f as SubagentsPanelContent};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dist-
|
|
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-Dpy9ZFOr.js";import{c as i,d as a,s as o}from"./ease-DKi-MOH5.js";import{t as s}from"./use-reduced-motion-BgG7f9xw.js";import{t as c}from"./createLucideIcon-CQY2ECfR.js";import{t as l}from"./check-BTwIaCtI.js";import{t as u}from"./chevron-down-Bse1ggZM.js";import{t as d}from"./circle-check-DBhaebaM.js";import{a as f,i as p,n as m,r as h,t as g}from"./action-swap-roll-BfVrBOVd.js";import{t as _}from"./loader-circle-BmKYM_C4.js";import{t as v}from"./rotate-ccw-DLkfsmG9.js";import{t as y}from"./square-terminal-BLq2bQVF.js";import{t as b}from"./wrench-BYnD147U.js";import{t as x}from"./preload-helper-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dist-QgsZ1U9l.js","assets/rolldown-runtime-hePW80VL.js","assets/preload-helper-BZ1Pz5am.js","assets/lib-ChrQ49PO.js","assets/character-entities-legacy-Wut6vMuj.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-Dpy9ZFOr.js";import{c as i,d as a,s as o}from"./ease-DKi-MOH5.js";import{t as s}from"./use-reduced-motion-BgG7f9xw.js";import{t as c}from"./createLucideIcon-CQY2ECfR.js";import{t as l}from"./check-BTwIaCtI.js";import{t as u}from"./chevron-down-Bse1ggZM.js";import{t as d}from"./circle-check-DBhaebaM.js";import{a as f,i as p,n as m,r as h,t as g}from"./action-swap-roll-BfVrBOVd.js";import{t as _}from"./loader-circle-BmKYM_C4.js";import{t as v}from"./rotate-ccw-DLkfsmG9.js";import{t as y}from"./square-terminal-BLq2bQVF.js";import{t as b}from"./wrench-BYnD147U.js";import{t as x}from"./preload-helper-BZ1Pz5am.js";var S={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`}]]};S.node;var C=c(S),w={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`]};w.node;var T=c(w),E=e(t(),1),D=n(),O=`github-light-high-contrast`,k=`github-dark-high-contrast`,A=null,j=new Map,M=500;function N(e,t){if(j.size>=M){let e=j.keys().next().value;e!==void 0&&j.delete(e)}j.set(e,t)}var P=()=>x(()=>import(`./dist-QgsZ1U9l.js`).then(e=>e.t),__vite__mapDeps([0,1,2,3,4]));function F(){return A||=P().then(({createHighlighter:e})=>e({themes:[O,k],langs:[`bash`,`diff`,`json`,`python`,`tsx`,`typescript`]})),A}function I(e,t){return`${t}\u0000${e}`}function L(e,t){let n=I(e,t),r=j.get(n),[i,a]=(0,E.useState)(r?{key:n,code:e,language:t,lines:r}:null);return(0,E.useEffect)(()=>{let r=j.get(n);if(r){a({key:n,code:e,language:t,lines:r});return}let i=!1;return F().then(r=>{if(i)return;let o=r.codeToTokensWithThemes(e,{lang:t,themes:{light:O,dark:k}}).map(e=>e.map(e=>({content:e.content,offset:e.offset,light:e.variants.light?.color,dark:e.variants.dark?.color})));N(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 R({code:e,tokens:t,className:n}){return(0,D.jsx)(`span`,{className:n,children:t?t.map(e=>(0,D.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})}var z=[];function B({code:e,language:t=`typescript`,languageLabel:n,filename:i,status:c=`complete`,showStatus:u=!0,showLineNumbers:d=!0,highlightLines:f=z,maxHeight:m=280,wrap:g=!1,copyable:v=!0,onCopy:y,className:b}){let x=s()??!1,S=(0,E.useRef)(null),C=(0,E.useRef)(void 0),[w,T]=(0,E.useState)(!1),O=c===`streaming`,k=L(e,t),A=(0,E.useMemo)(()=>new Set(f),[f]),j=0,M=e.split(`
|
|
3
3
|
`).map(e=>{let t={content:e,offset:j};return j+=e.length+1,t}),N=n??{bash:`Bash`,diff:`Diff`,json:`JSON`,python:`Python`,text:`Text`,tsx:`TSX`,typescript:`TypeScript`}[t];(0,E.useEffect)(()=>()=>{C.current&&window.clearTimeout(C.current)},[]),(0,E.useLayoutEffect)(()=>{let e=S.current;if(!e||!O)return;let t=requestAnimationFrame(()=>{e.scrollHeight<=e.clientHeight||(typeof e.scrollTo==`function`?e.scrollTo({top:e.scrollHeight,behavior:x?`auto`:`smooth`}):e.scrollTop=e.scrollHeight)});return()=>cancelAnimationFrame(t)});let P=(0,E.useCallback)(async()=>{y?await y():await navigator.clipboard?.writeText(e),T(!0),C.current&&window.clearTimeout(C.current),C.current=window.setTimeout(()=>T(!1),1600)},[e,y]);return(0,D.jsxs)(`div`,{"data-state":c,"aria-busy":O,className:r(`w-full overflow-hidden rounded-2xl bg-muted/80 text-sm`,b),children:[(0,D.jsxs)(`div`,{className:`flex h-10 items-center gap-2.5 px-3`,children:[(0,D.jsx)(h,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground/70`}),i?(0,D.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs text-foreground/80`,children:i}):null,(0,D.jsx)(`span`,{className:`text-micro font-medium uppercase tracking-wide text-muted-foreground/55`,children:N}),u?(0,D.jsxs)(`span`,{className:r(`ml-auto inline-flex shrink-0 items-center gap-1 text-micro font-medium`,O?`text-blue-600 dark:text-blue-400`:`text-emerald-600 dark:text-emerald-400`),children:[O?(0,D.jsx)(_,{className:r(`size-3`,!x&&`animate-spin`)}):(0,D.jsx)(l,{className:`size-3`}),O?`Writing`:`Ready`]}):null,v||y?(0,D.jsx)(a.button,{type:`button`,"aria-label":w?`Copied`:`Copy code`,title:w?`Copied`:`Copy code`,onClick:P,whileTap:x?void 0:{scale:.9},transition:o,className:r(`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`,!u&&`ml-auto`),children:w?(0,D.jsx)(l,{className:`size-3.5`}):(0,D.jsx)(p,{className:`size-3.5`})}):null]}),(0,D.jsx)(`div`,{ref:S,role:O?`log`:void 0,"aria-live":O?`off`:void 0,className:`overflow-auto border-t border-foreground/[0.06] py-2 [scrollbar-color:color-mix(in_oklab,var(--muted-foreground)_35%,transparent)_transparent] [scrollbar-width:thin]`,style:{maxHeight:m},children:(0,D.jsx)(`pre`,{className:`m-0 min-w-max font-mono text-xs leading-5 text-foreground/85`,children:(0,D.jsx)(`code`,{children:M.map((e,t)=>{let n=t+1;return(0,D.jsxs)(`span`,{className:r(`grid min-h-5`,d?`grid-cols-[2.75rem_minmax(0,1fr)]`:`grid-cols-1`,A.has(n)&&`bg-primary/[0.07]`),children:[d?(0,D.jsx)(`span`,{className:`select-none pr-3 text-right tabular-nums text-muted-foreground/35`,children:n}):null,(0,D.jsx)(R,{code:e.content,tokens:k?.[t],className:r(`pr-4`,d?`pl-1`:`pl-4`,g?`whitespace-pre-wrap break-words`:`whitespace-pre`)})]},e.offset)})})})})]})}function V({value:e,type:t}){return e?(0,D.jsxs)(`span`,{className:r(`font-mono text-xs tabular-nums`,t===`added`?`text-emerald-600 dark:text-emerald-400`:`text-rose-600 dark:text-rose-400`),children:[t===`added`?`+`:`−`,e]}):null}function H({file:e,lines:t,status:n=`streaming`,open:c,defaultOpen:d=!0,onOpenChange:g,collapseOnComplete:v=!0,maxHeight:y=220,language:b=`typescript`,copyText:x,onCopy:S,className:w}){let T=s()??!1,O=(0,E.useId)(),k=`${O}-trigger`,A=`${O}-content`,j=(0,E.useRef)(null),M=(0,E.useRef)(n),N=(0,E.useRef)(void 0),[P,F]=(0,E.useState)(!1),[I,z]=(0,E.useState)(d),B=c??I,H=n===`streaming`,U=t.filter(e=>e.type===`added`).length,W=t.filter(e=>e.type===`removed`).length,G=!!(x||S),K=L(t.map(e=>e.content).join(`
|
|
4
4
|
`),b),q=(0,E.useCallback)(e=>{c===void 0&&z(e),g?.(e)},[g,c]);(0,E.useEffect)(()=>{M.current!==`streaming`&&n===`streaming`&&q(!0),M.current===`streaming`&&n!==`streaming`&&v&&q(!1),M.current=n},[v,q,n]),(0,E.useEffect)(()=>()=>{N.current&&window.clearTimeout(N.current)},[]),(0,E.useLayoutEffect)(()=>{let e=j.current;if(!e||!B||!H)return;let t=requestAnimationFrame(()=>{e.scrollHeight<=e.clientHeight||(typeof e.scrollTo==`function`?e.scrollTo({top:e.scrollHeight,behavior:T?`auto`:`smooth`}):e.scrollTop=e.scrollHeight)});return()=>cancelAnimationFrame(t)});let J=(0,E.useCallback)(async()=>{S?await S():x&&await navigator.clipboard?.writeText(x),F(!0),N.current&&window.clearTimeout(N.current),N.current=window.setTimeout(()=>F(!1),1600)},[x,S]);return(0,D.jsxs)(`div`,{"data-state":n,"aria-busy":H,className:r(`w-full text-sm`,w),children:[(0,D.jsxs)(`button`,{id:k,type:`button`,"aria-expanded":B,"aria-controls":A,onClick:()=>q(!B),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,D.jsx)(h,{"aria-hidden":`true`,className:`size-4 shrink-0 text-muted-foreground`}),(0,D.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-xs text-foreground/80`,children:e}),(0,D.jsxs)(`span`,{className:`flex shrink-0 items-center gap-2`,children:[(0,D.jsx)(V,{value:U,type:`added`}),(0,D.jsx)(V,{value:W,type:`removed`})]}),(0,D.jsx)(`span`,{className:`grid size-4 shrink-0 place-items-center text-muted-foreground/60`,children:H?(0,D.jsx)(_,{"aria-label":`Applying changes`,className:r(`size-3.5`,!T&&`animate-spin`)}):n===`error`?(0,D.jsx)(f,{"aria-label":`Changes failed`,className:`size-3.5`}):n===`cancelled`?(0,D.jsx)(C,{"aria-label":`Changes cancelled`,className:`size-3.5`}):(0,D.jsx)(l,{"aria-label":`Changes applied`,className:`size-3.5`})}),(0,D.jsx)(a.span,{"aria-hidden":`true`,animate:{rotate:B?180:0},transition:T?{duration:0}:i,className:`shrink-0 text-muted-foreground/45 transition-colors group-hover:text-muted-foreground`,children:(0,D.jsx)(u,{className:`size-3.5`})})]}),(0,D.jsx)(m,{id:A,role:`region`,"aria-labelledby":k,open:B,children:(0,D.jsx)(`div`,{className:`pl-6 pt-1.5`,children:(0,D.jsxs)(`div`,{className:`overflow-hidden rounded-xl bg-muted/80`,children:[(0,D.jsx)(`div`,{ref:j,"data-slot":`file-diff-viewport`,"aria-live":H?`off`:`polite`,className:`scrollbar-hide overflow-auto`,style:{maxHeight:y},children:(0,D.jsxs)(`div`,{className:`font-mono text-xs leading-5`,children:[(0,D.jsx)(`span`,{className:`sr-only`,children:`File changes`}),t.map((e,t)=>{let n=e.type??`context`;return(0,D.jsxs)(`div`,{className:r(`grid grid-cols-[2.25rem_2.25rem_1rem_minmax(0,1fr)]`,n===`added`&&`bg-emerald-500/[0.07]`,n===`removed`&&`bg-rose-500/[0.07]`),children:[(0,D.jsx)(`span`,{className:`select-none pr-2 text-right tabular-nums text-muted-foreground/40`,children:e.oldLine}),(0,D.jsx)(`span`,{className:`select-none pr-2 text-right tabular-nums text-muted-foreground/40`,children:e.newLine}),(0,D.jsx)(`span`,{className:r(`select-none text-center text-muted-foreground/45`,n===`added`&&`text-emerald-600 dark:text-emerald-400`,n===`removed`&&`text-rose-600 dark:text-rose-400`),children:n===`added`?`+`:n===`removed`?`−`:``}),(0,D.jsx)(R,{code:e.content,tokens:K?.[t],className:`min-w-0 whitespace-pre px-1.5`})]},e.id)})]})}),G?(0,D.jsx)(`div`,{className:`flex justify-end px-2 pb-1.5 pt-1`,children:(0,D.jsx)(a.button,{type:`button`,"aria-label":P?`Copied`:`Copy diff`,title:P?`Copied`:`Copy diff`,onClick:J,whileTap:T?void 0:{scale:.9},transition:o,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:P?(0,D.jsx)(l,{className:`size-3.5`}):(0,D.jsx)(p,{className:`size-3.5`})})}):null]})})})]})}function U(e){return e===`running`?`Running`:e===`success`?`Completed`:e===`error`?`Failed`:`Cancelled`}function W(e,t){return typeof e==`string`||typeof e==`number`?String(e):t}function G(e){return e===`running`?`text-primary`:e===`success`?`text-emerald-600 dark:text-emerald-400`:e===`error`?`text-rose-600 dark:text-rose-400`:`text-muted-foreground`}function K({kind:e}){return e===`terminal`?(0,D.jsx)(y,{className:`size-4`}):e===`request`?(0,D.jsx)(T,{className:`size-4`}):(0,D.jsx)(b,{className:`size-4`})}function q({status:e,reduce:t}){return e===`running`?(0,D.jsx)(_,{className:r(`size-3`,!t&&`animate-spin`)}):e===`success`?(0,D.jsx)(d,{className:`size-3`}):e===`error`?(0,D.jsx)(f,{className:`size-3`}):(0,D.jsx)(C,{className:`size-3`})}function J({label:e,onClick:t,children:n}){let r=s()??!1;return(0,D.jsx)(a.button,{type:`button`,"aria-label":e,title:e,onClick:t,whileTap:r?void 0:{scale:.9},transition:o,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 Y({children:e,language:t=`bash`,label:n,className:i}){return(0,D.jsxs)(`div`,{className:`space-y-1.5`,children:[n?(0,D.jsx)(`div`,{className:`px-0.5 text-micro font-medium uppercase tracking-[0.12em] text-muted-foreground/60`,children:n}):null,(0,D.jsx)(`pre`,{className:r(`m-0 whitespace-pre-wrap break-words font-mono text-xs leading-5 text-foreground/80`,i),children:(0,D.jsx)(`code`,{children:e})})]})}function X({tool:e,title:t,children:n,status:o=`running`,kind:c=`custom`,meta:d,icon:f,open:h,defaultOpen:_=!0,onOpenChange:y,collapseOnComplete:b=!0,maxHeight:x=220,copyText:S,onCopy:C,onRetry:w,className:T,contentClassName:O}){let k=s()??!1,A=(0,E.useId)(),j=`${A}-trigger`,M=`${A}-content`,N=(0,E.useRef)(null),P=(0,E.useRef)(o),F=(0,E.useRef)(void 0),[I,L]=(0,E.useState)(!1),[R,z]=(0,E.useState)(_),B=h??R,V=o===`running`,H=!!(S||C),Y=W(t,o),X=W(d,`${o}-meta`),Z=W(e,`${o}-tool`),Q=U(o),$=(0,E.useCallback)(e=>{h===void 0&&z(e),y?.(e)},[y,h]);(0,E.useEffect)(()=>{P.current!==`running`&&o===`running`&&$(!0),P.current===`running`&&o!==`running`&&b&&$(!1),P.current=o},[b,$,o]),(0,E.useEffect)(()=>()=>{F.current&&window.clearTimeout(F.current)},[]),(0,E.useLayoutEffect)(()=>{let e=N.current;if(!e||!B||!V)return;let t=requestAnimationFrame(()=>{typeof e.scrollTo==`function`?e.scrollTo({top:e.scrollHeight,behavior:k?`auto`:`smooth`}):e.scrollTop=e.scrollHeight});return()=>cancelAnimationFrame(t)});let ee=(0,E.useCallback)(async()=>{C?await C():S&&await navigator.clipboard?.writeText(S),L(!0),F.current&&window.clearTimeout(F.current),F.current=window.setTimeout(()=>L(!1),1600)},[S,C]);return(0,D.jsxs)(`div`,{"data-state":o,"aria-busy":V,className:r(`w-full text-sm`,T),children:[(0,D.jsxs)(`button`,{id:j,type:`button`,"aria-expanded":B,"aria-controls":M,onClick:()=>$(!B),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,D.jsx)(`span`,{"aria-hidden":`true`,className:`grid size-4 shrink-0 place-items-center text-muted-foreground`,children:f??(0,D.jsx)(K,{kind:c})}),(0,D.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-2`,children:[(0,D.jsx)(`span`,{className:`min-w-0 truncate font-medium text-foreground/90`,children:(0,D.jsx)(g,{value:Y,children:t})}),d?(0,D.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground/60`,children:(0,D.jsx)(g,{value:X,children:d})}):null,(0,D.jsx)(`span`,{className:`min-w-0 truncate font-mono text-caption text-muted-foreground/55`,children:(0,D.jsx)(g,{value:Z,children:e})})]}),(0,D.jsxs)(`span`,{className:r(`inline-flex shrink-0 items-center gap-1 text-caption font-medium`,G(o)),children:[(0,D.jsx)(q,{status:o,reduce:k}),(0,D.jsx)(g,{value:o,children:Q})]}),(0,D.jsx)(a.span,{"aria-hidden":`true`,animate:{rotate:B?180:0},transition:k?{duration:0}:i,className:`shrink-0 text-muted-foreground/50 transition-colors group-hover:text-muted-foreground`,children:(0,D.jsx)(u,{className:`size-3.5`})})]}),(0,D.jsx)(m,{id:M,role:`region`,"aria-labelledby":j,open:B,children:(0,D.jsx)(`div`,{className:`pl-6 pt-1.5`,children:(0,D.jsxs)(`div`,{className:`overflow-hidden rounded-xl bg-muted/80`,children:[(0,D.jsx)(`div`,{ref:N,role:`log`,"aria-live":`polite`,className:`scrollbar-hide overflow-y-auto`,style:{maxHeight:x},children:(0,D.jsx)(`div`,{className:r(`p-3`,O),children:n})}),H||w?(0,D.jsxs)(`div`,{className:`flex items-center gap-0.5 px-2 pb-1.5`,children:[H?(0,D.jsx)(J,{label:I?`Copied`:`Copy result`,onClick:ee,children:I?(0,D.jsx)(l,{className:`size-3.5`}):(0,D.jsx)(p,{className:`size-3.5`})}):null,w?(0,D.jsx)(J,{label:`Run again`,onClick:w,children:(0,D.jsx)(v,{className:`size-3.5`})}):null,(0,D.jsx)(`span`,{className:`ml-auto text-caption text-muted-foreground/55`,children:(0,D.jsx)(g,{value:o,children:Q})})]}):null]})})})]})}export{B as i,Y as n,H as r,X as t};
|
|
@@ -1 +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-Dpy9ZFOr.js";import{c as i,d as a,o,r as s}from"./ease-DKi-MOH5.js";import{n as c,t as l}from"./use-reduced-motion-BgG7f9xw.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 _,p as v,s as y,u as b}from"./layout-constants-Bl6XCvhY.js";import{f as x,r as S}from"./chat-helpers-Bj7_hES7.js";import{t as C}from"./folder-COBtkKZa.js";import{t as w}from"./hard-drive-B3opVeEB.js";import{i as T,t as E}from"./workspace-path-nav-DmxBrMV6.js";import{a as D,i as O,n as k,r as A}from"./skeleton-loaders-DOKGa7CW.js";var j=e(t(),1),M=n();function N(e){return null}function P(e){return null}var F={duration:.22,ease:s},I={duration:.3,ease:s};function L(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,...L(i.children,t,n+1,i.value)]})}function R(e){let t=[];return j.Children.forEach(e,e=>{if((0,j.isValidElement)(e)){if(e.type===j.Fragment){let n=e.props;t.push(...R(n.children));return}if(e.type===N){let n=e.props;t.push({value:n.value,name:n.name,type:`folder`,icon:n.icon,disabled:n.disabled,className:n.className,children:R(n.children)});return}if(e.type===P){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 z({item:e,open:t,reduce:n}){return e.type===`file`?(0,M.jsx)(v,{className:`size-4`}):n?t?(0,M.jsx)(x,{className:`size-4`}):(0,M.jsx)(C,{className:`size-4`}):(0,M.jsx)(c,{initial:!1,mode:`popLayout`,children:(0,M.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,M.jsx)(x,{className:`size-4`}):(0,M.jsx)(C,{className:`size-4`})},t?`open`:`closed`)})}function B({children:e,value:t,defaultValue:n=null,onValueChange:s,expandedIds:c,defaultExpandedIds:u=[],onExpandedChange:f,ariaLabel:p=`Files`,indent:m=18,className:g,classNames:_}){let v=l()??!1,[y,b]=(0,j.useState)(n),[x,S]=(0,j.useState)(u),[C,w]=(0,j.useState)(t??n),T=(0,j.useRef)(new Map),E=t===void 0?y:t,D=c??x,O=(0,j.useMemo)(()=>new Set(D),[D]),k=(0,j.useMemo)(()=>R(e),[e]),A=(0,j.useMemo)(()=>L(k,O),[O,k]),N=C!==null&&A.some(({item:e})=>e.value===C)?C:A[0]?.item.value??null;C!==N&&w(N);let P=(0,j.useCallback)(e=>{w(e);let t=T.current.get(e);t?t.focus():requestAnimationFrame(()=>T.current.get(e)?.focus())},[]),B=(0,j.useCallback)(e=>{e.disabled||(t===void 0&&b(e.value),s?.(e.value))},[s,t]),V=(0,j.useCallback)(e=>{c===void 0&&S(e),f?.(e)},[c,f]),H=(0,j.useCallback)(e=>{let t=new Set(D);t.has(e)?t.delete(e):t.add(e),V(Array.from(t))},[D,V]),U=(0,j.useCallback)((e,t)=>{let n=A.findIndex(({item:e})=>e.value===t.item.value),r=A[n-1],i=A[n+1],a=t.item.type===`folder`&&!!t.item.children?.length,o=a&&O.has(t.item.value);if(e.key===`ArrowDown`&&i)e.preventDefault(),P(i.item.value);else if(e.key===`ArrowUp`&&r)e.preventDefault(),P(r.item.value);else if(e.key===`Home`&&A[0])e.preventDefault(),P(A[0].item.value);else if(e.key===`End`&&A.at(-1))e.preventDefault(),P(A.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&&P(i.item.value);else if(e.key===`ArrowLeft`)e.preventDefault(),a&&o&&!t.item.disabled?H(t.item.value):t.parentId&&P(t.parentId);else if(e.key===`Enter`||e.key===` `){if(e.preventDefault(),t.item.disabled)return;B(t.item),a&&H(t.item.value)}},[O,P,A,B,H]);return(0,M.jsx)(h,{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`,g,_?.tree),children:A.map(e=>{let t=e.item.type===`folder`,n=t&&!!e.item.children?.length,s=n&&O.has(e.item.value),c=E===e.item.value;return(0,M.jsx)(a.div,{layout:!v&&`position`,initial:!v&&{opacity:0,y:-6},animate:{opacity:e.item.disabled?.42:1,y:0,transition:v?{duration:0}:{...F,delay:Math.min(e.position*.025,.1)}},transition:v?{duration:0}:o,children:(0,M.jsxs)(`button`,{ref:t=>{t?T.current.set(e.item.value,t):T.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:N===e.item.value?0:-1,onFocus:()=>w(e.item.value),onKeyDown:t=>U(t,e),onClick:()=>{e.item.disabled||(B(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`,_?.item,e.item.className),style:{paddingLeft:8+e.depth*m},children:[e.depth>0?(0,M.jsx)(a.span,{"aria-hidden":`true`,initial:!v&&{opacity:0,scaleY:0},animate:{opacity:1,scaleY:1},exit:{opacity:0,scaleY:0},transition:v?{duration:0}:I,className:`absolute top-0 bottom-0 w-px origin-top bg-border/70`,style:{left:16+(e.depth-1)*m}}):null,(0,M.jsx)(a.span,{"aria-hidden":`true`,animate:{rotate:s?90:0},transition:v?{duration:0}:i,className:r(`relative z-10 grid size-4 shrink-0 place-items-center`,!n&&`opacity-0`),children:(0,M.jsx)(d,{className:`size-3.5`})}),(0,M.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`,_?.icon),children:e.item.icon??(0,M.jsx)(z,{item:e.item,open:s,reduce:v})}),(0,M.jsx)(`span`,{className:r(`relative z-10 min-w-0 flex-1 truncate`,_?.label),children:e.item.name})]})},e.item.value)})})}var V=`fleet-prime:v1:workspace-tree-width`,H=120,U=200;function W(e,t){let n=Math.max(H,t-160-8);return Math.min(n,Math.max(H,Math.round(e)))}function G(e,t,n,r){return W(n+(t-e),r)}function K(e,t){if(e)return{gridTemplateColumns:`minmax(160px, 1fr) 8px ${t}px`,gridTemplateAreas:`"preview handle tree"`}}function q(e){return b(V,U,t=>e===void 0?Math.max(H,Math.round(t)):W(t,e))}function J(e){m(V,e)}var Y=e=>{let t=window.matchMedia(`(min-width: 640px)`);return t.addEventListener(`change`,e),()=>t.removeEventListener(`change`,e)},X=()=>window.matchMedia(`(min-width: 640px)`).matches,Z=()=>!1;function Q(){let[e,t]=(0,j.useState)(q),n=(0,j.useSyncExternalStore)(Y,X,Z),r=(0,j.useRef)(null),i=(0,j.useCallback)(n=>{let i=r.current?.clientWidth??0;if(i===0)return;let a=W(e,i);g({event:n,startWidth:a,getNextWidth:(e,t,n)=>G(e,t,n,i),onWidthChange:e=>{t(e),J(e)}})},[e]);return(0,j.useEffect)(()=>{let e=r.current;if(!e)return;let n=e.clientWidth;n<640||t(e=>{let t=W(e,n);return t===e?e:(J(t),t)})},[]),{handleTreeResizeStart:i,isSplitLayout:n,splitRef:r,splitStyle:K(n,e)}}var ee=15e3;function te(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 ne({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,j.useState)(null),v=a!==void 0,b=v?d??null:h,x=e=>{if(v){a(e);return}g(e)},[C,T]=(0,j.useState)(null),[k,N]=(0,j.useState)(null),[P,F]=(0,j.useState)(!1),I=(0,j.useRef)(null),{handleTreeResizeStart:L,isSplitLayout:R,splitRef:z,splitStyle:V}=Q(),H=(0,j.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,j.useEffect)(()=>{if(!(!m||!b)){if(c&&!E(b,c)){x(null),T(null),N(null);return}u(m.nodes,b)?.type!==`file`&&(x(null),T(null),N(null))}},[a,c,b,m]),(0,j.useEffect)(()=>{if(!b){F(!1);return}let e=b,t=new AbortController,n=window.setTimeout(()=>t.abort(),ee),i=!1;return T(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;T(n),N(null)}catch(e){if(i)return;T(null),N(te(e))}finally{i||F(!1)}})(),()=>{i=!0,window.clearTimeout(n),t.abort()}},[r,b,m]),(0,j.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 S(e)?(0,M.jsx)(D,{icon:f,title:`Daytona not connected`,description:`Connect a Daytona API key for your account to browse and preview your agent workspace.`}):(0,M.jsx)(D,{icon:f,title:`Unable to load workspace`,description:e.message});if(i&&!m)return(0,M.jsx)(A,{});if(!m||c&&H.nodes.length===0)return(0,M.jsx)(D,{icon:w,title:n,description:t});let U=(0,M.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-col overflow-hidden`,style:R?{gridArea:`tree`}:void 0,children:(0,M.jsxs)(`div`,{"data-testid":p,className:`min-h-0 min-w-0 flex-1 overflow-y-auto`,children:[(0,M.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,M.jsx)(w,{className:`size-3.5 shrink-0 text-foreground/45`}),(0,M.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-label font-medium text-foreground/70`,children:H.headerLabel})]}),(0,M.jsx)(B,{ariaLabel:c?`Files in ${H.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`&&x(e)},children:H.nodes.map(e=>$(e))}),m.diagnostics.length>0&&!c&&(0,M.jsx)(`div`,{className:`mt-2 border-t border-border/60 pt-2`,children:(0,M.jsx)(O,{id:`workspace-diagnostics`,label:`Diagnostics`,icon:f,items:m.diagnostics.map((e,t)=>({name:`Diagnostic ${t+1}`,description:e}))})})]})}),W=(0,M.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 ${y}`,"data-testid":`workspace-tree-resize-handle`,style:R?{gridArea:`handle`}:void 0,onPointerDown:L}),G=(0,M.jsx)(re,{emptyDescription:o,emptyTitle:s,error:k,loading:P,preview:C,previewRef:I,selectedPath:b,splitGridArea:R?`preview`:void 0});return(0,M.jsxs)(`div`,{ref:z,className:`relative grid h-full min-h-0 grid-cols-1 gap-2 overflow-hidden ${_}`,style:V,children:[U,W,G]})}function $(e){return e.type===`directory`?(0,M.jsx)(N,{value:e.path,name:e.name,children:e.children?.map(e=>$(e))},e.path):(0,M.jsx)(P,{value:e.path,name:e.name},e.path)}function re({emptyDescription:e,emptyTitle:t,error:n,loading:r,preview:i,previewRef:a,selectedPath:o,splitGridArea:s}){return(0,M.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,M.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,M.jsx)(p,{className:`size-3.5 shrink-0 text-foreground/35`}),(0,M.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-label font-medium text-foreground/70`,children:i?.name??o??`Preview`})]}),(0,M.jsxs)(`div`,{className:`flex-1 overflow-y-auto px-3 py-2`,children:[!o&&(0,M.jsx)(D,{icon:p,title:t,description:e}),o&&r&&!i&&(0,M.jsx)(k,{}),o&&n&&(0,M.jsx)(D,{icon:f,title:`Unable to load preview`,description:n.message}),o&&!n&&i?.status===`too-large`&&(0,M.jsx)(D,{icon:f,title:`Preview too large`,description:`${i.name} is too large to preview safely.`}),o&&!n&&i?.status===`unsupported`&&(0,M.jsx)(D,{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,M.jsx)(T,{className:`text-label leading-relaxed`,content:i.content})]})]})}export{ne as WorkspacePanelContent};
|
|
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-Dpy9ZFOr.js";import{c as i,d as a,o,r as s}from"./ease-DKi-MOH5.js";import{n as c,t as l}from"./use-reduced-motion-BgG7f9xw.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 _,p as v,s as y,u as b}from"./layout-constants-Bl6XCvhY.js";import{f as x,r as S}from"./chat-helpers-Bj7_hES7.js";import{t as C}from"./folder-COBtkKZa.js";import{t as w}from"./hard-drive-B3opVeEB.js";import{i as T,t as E}from"./workspace-path-nav-eVT0rYvv.js";import{a as D,i as O,n as k,r as A}from"./skeleton-loaders-DOKGa7CW.js";var j=e(t(),1),M=n();function N(e){return null}function P(e){return null}var F={duration:.22,ease:s},I={duration:.3,ease:s};function L(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,...L(i.children,t,n+1,i.value)]})}function R(e){let t=[];return j.Children.forEach(e,e=>{if((0,j.isValidElement)(e)){if(e.type===j.Fragment){let n=e.props;t.push(...R(n.children));return}if(e.type===N){let n=e.props;t.push({value:n.value,name:n.name,type:`folder`,icon:n.icon,disabled:n.disabled,className:n.className,children:R(n.children)});return}if(e.type===P){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 z({item:e,open:t,reduce:n}){return e.type===`file`?(0,M.jsx)(v,{className:`size-4`}):n?t?(0,M.jsx)(x,{className:`size-4`}):(0,M.jsx)(C,{className:`size-4`}):(0,M.jsx)(c,{initial:!1,mode:`popLayout`,children:(0,M.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,M.jsx)(x,{className:`size-4`}):(0,M.jsx)(C,{className:`size-4`})},t?`open`:`closed`)})}function B({children:e,value:t,defaultValue:n=null,onValueChange:s,expandedIds:c,defaultExpandedIds:u=[],onExpandedChange:f,ariaLabel:p=`Files`,indent:m=18,className:g,classNames:_}){let v=l()??!1,[y,b]=(0,j.useState)(n),[x,S]=(0,j.useState)(u),[C,w]=(0,j.useState)(t??n),T=(0,j.useRef)(new Map),E=t===void 0?y:t,D=c??x,O=(0,j.useMemo)(()=>new Set(D),[D]),k=(0,j.useMemo)(()=>R(e),[e]),A=(0,j.useMemo)(()=>L(k,O),[O,k]),N=C!==null&&A.some(({item:e})=>e.value===C)?C:A[0]?.item.value??null;C!==N&&w(N);let P=(0,j.useCallback)(e=>{w(e);let t=T.current.get(e);t?t.focus():requestAnimationFrame(()=>T.current.get(e)?.focus())},[]),B=(0,j.useCallback)(e=>{e.disabled||(t===void 0&&b(e.value),s?.(e.value))},[s,t]),V=(0,j.useCallback)(e=>{c===void 0&&S(e),f?.(e)},[c,f]),H=(0,j.useCallback)(e=>{let t=new Set(D);t.has(e)?t.delete(e):t.add(e),V(Array.from(t))},[D,V]),U=(0,j.useCallback)((e,t)=>{let n=A.findIndex(({item:e})=>e.value===t.item.value),r=A[n-1],i=A[n+1],a=t.item.type===`folder`&&!!t.item.children?.length,o=a&&O.has(t.item.value);if(e.key===`ArrowDown`&&i)e.preventDefault(),P(i.item.value);else if(e.key===`ArrowUp`&&r)e.preventDefault(),P(r.item.value);else if(e.key===`Home`&&A[0])e.preventDefault(),P(A[0].item.value);else if(e.key===`End`&&A.at(-1))e.preventDefault(),P(A.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&&P(i.item.value);else if(e.key===`ArrowLeft`)e.preventDefault(),a&&o&&!t.item.disabled?H(t.item.value):t.parentId&&P(t.parentId);else if(e.key===`Enter`||e.key===` `){if(e.preventDefault(),t.item.disabled)return;B(t.item),a&&H(t.item.value)}},[O,P,A,B,H]);return(0,M.jsx)(h,{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`,g,_?.tree),children:A.map(e=>{let t=e.item.type===`folder`,n=t&&!!e.item.children?.length,s=n&&O.has(e.item.value),c=E===e.item.value;return(0,M.jsx)(a.div,{layout:!v&&`position`,initial:!v&&{opacity:0,y:-6},animate:{opacity:e.item.disabled?.42:1,y:0,transition:v?{duration:0}:{...F,delay:Math.min(e.position*.025,.1)}},transition:v?{duration:0}:o,children:(0,M.jsxs)(`button`,{ref:t=>{t?T.current.set(e.item.value,t):T.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:N===e.item.value?0:-1,onFocus:()=>w(e.item.value),onKeyDown:t=>U(t,e),onClick:()=>{e.item.disabled||(B(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`,_?.item,e.item.className),style:{paddingLeft:8+e.depth*m},children:[e.depth>0?(0,M.jsx)(a.span,{"aria-hidden":`true`,initial:!v&&{opacity:0,scaleY:0},animate:{opacity:1,scaleY:1},exit:{opacity:0,scaleY:0},transition:v?{duration:0}:I,className:`absolute top-0 bottom-0 w-px origin-top bg-border/70`,style:{left:16+(e.depth-1)*m}}):null,(0,M.jsx)(a.span,{"aria-hidden":`true`,animate:{rotate:s?90:0},transition:v?{duration:0}:i,className:r(`relative z-10 grid size-4 shrink-0 place-items-center`,!n&&`opacity-0`),children:(0,M.jsx)(d,{className:`size-3.5`})}),(0,M.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`,_?.icon),children:e.item.icon??(0,M.jsx)(z,{item:e.item,open:s,reduce:v})}),(0,M.jsx)(`span`,{className:r(`relative z-10 min-w-0 flex-1 truncate`,_?.label),children:e.item.name})]})},e.item.value)})})}var V=`fleet-prime:v1:workspace-tree-width`,H=120,U=200;function W(e,t){let n=Math.max(H,t-160-8);return Math.min(n,Math.max(H,Math.round(e)))}function G(e,t,n,r){return W(n+(t-e),r)}function K(e,t){if(e)return{gridTemplateColumns:`minmax(160px, 1fr) 8px ${t}px`,gridTemplateAreas:`"preview handle tree"`}}function q(e){return b(V,U,t=>e===void 0?Math.max(H,Math.round(t)):W(t,e))}function J(e){m(V,e)}var Y=e=>{let t=window.matchMedia(`(min-width: 640px)`);return t.addEventListener(`change`,e),()=>t.removeEventListener(`change`,e)},X=()=>window.matchMedia(`(min-width: 640px)`).matches,Z=()=>!1;function Q(){let[e,t]=(0,j.useState)(q),n=(0,j.useSyncExternalStore)(Y,X,Z),r=(0,j.useRef)(null),i=(0,j.useCallback)(n=>{let i=r.current?.clientWidth??0;if(i===0)return;let a=W(e,i);g({event:n,startWidth:a,getNextWidth:(e,t,n)=>G(e,t,n,i),onWidthChange:e=>{t(e),J(e)}})},[e]);return(0,j.useEffect)(()=>{let e=r.current;if(!e)return;let n=e.clientWidth;n<640||t(e=>{let t=W(e,n);return t===e?e:(J(t),t)})},[]),{handleTreeResizeStart:i,isSplitLayout:n,splitRef:r,splitStyle:K(n,e)}}var ee=15e3;function te(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 ne({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,j.useState)(null),v=a!==void 0,b=v?d??null:h,x=e=>{if(v){a(e);return}g(e)},[C,T]=(0,j.useState)(null),[k,N]=(0,j.useState)(null),[P,F]=(0,j.useState)(!1),I=(0,j.useRef)(null),{handleTreeResizeStart:L,isSplitLayout:R,splitRef:z,splitStyle:V}=Q(),H=(0,j.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,j.useEffect)(()=>{if(!(!m||!b)){if(c&&!E(b,c)){x(null),T(null),N(null);return}u(m.nodes,b)?.type!==`file`&&(x(null),T(null),N(null))}},[a,c,b,m]),(0,j.useEffect)(()=>{if(!b){F(!1);return}let e=b,t=new AbortController,n=window.setTimeout(()=>t.abort(),ee),i=!1;return T(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;T(n),N(null)}catch(e){if(i)return;T(null),N(te(e))}finally{i||F(!1)}})(),()=>{i=!0,window.clearTimeout(n),t.abort()}},[r,b,m]),(0,j.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 S(e)?(0,M.jsx)(D,{icon:f,title:`Daytona not connected`,description:`Connect a Daytona API key for your account to browse and preview your agent workspace.`}):(0,M.jsx)(D,{icon:f,title:`Unable to load workspace`,description:e.message});if(i&&!m)return(0,M.jsx)(A,{});if(!m||c&&H.nodes.length===0)return(0,M.jsx)(D,{icon:w,title:n,description:t});let U=(0,M.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-col overflow-hidden`,style:R?{gridArea:`tree`}:void 0,children:(0,M.jsxs)(`div`,{"data-testid":p,className:`min-h-0 min-w-0 flex-1 overflow-y-auto`,children:[(0,M.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,M.jsx)(w,{className:`size-3.5 shrink-0 text-foreground/45`}),(0,M.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-label font-medium text-foreground/70`,children:H.headerLabel})]}),(0,M.jsx)(B,{ariaLabel:c?`Files in ${H.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`&&x(e)},children:H.nodes.map(e=>$(e))}),m.diagnostics.length>0&&!c&&(0,M.jsx)(`div`,{className:`mt-2 border-t border-border/60 pt-2`,children:(0,M.jsx)(O,{id:`workspace-diagnostics`,label:`Diagnostics`,icon:f,items:m.diagnostics.map((e,t)=>({name:`Diagnostic ${t+1}`,description:e}))})})]})}),W=(0,M.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 ${y}`,"data-testid":`workspace-tree-resize-handle`,style:R?{gridArea:`handle`}:void 0,onPointerDown:L}),G=(0,M.jsx)(re,{emptyDescription:o,emptyTitle:s,error:k,loading:P,preview:C,previewRef:I,selectedPath:b,splitGridArea:R?`preview`:void 0});return(0,M.jsxs)(`div`,{ref:z,className:`relative grid h-full min-h-0 grid-cols-1 gap-2 overflow-hidden ${_}`,style:V,children:[U,W,G]})}function $(e){return e.type===`directory`?(0,M.jsx)(N,{value:e.path,name:e.name,children:e.children?.map(e=>$(e))},e.path):(0,M.jsx)(P,{value:e.path,name:e.name},e.path)}function re({emptyDescription:e,emptyTitle:t,error:n,loading:r,preview:i,previewRef:a,selectedPath:o,splitGridArea:s}){return(0,M.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,M.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,M.jsx)(p,{className:`size-3.5 shrink-0 text-foreground/35`}),(0,M.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-label font-medium text-foreground/70`,children:i?.name??o??`Preview`})]}),(0,M.jsxs)(`div`,{className:`flex-1 overflow-y-auto px-3 py-2`,children:[!o&&(0,M.jsx)(D,{icon:p,title:t,description:e}),o&&r&&!i&&(0,M.jsx)(k,{}),o&&n&&(0,M.jsx)(D,{icon:f,title:`Unable to load preview`,description:n.message}),o&&!n&&i?.status===`too-large`&&(0,M.jsx)(D,{icon:f,title:`Preview too large`,description:`${i.name} is too large to preview safely.`}),o&&!n&&i?.status===`unsupported`&&(0,M.jsx)(D,{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,M.jsx)(T,{className:`text-label leading-relaxed`,content:i.content})]})]})}export{ne as WorkspacePanelContent};
|
package/dist/web/client/assets/{workspace-path-nav-DmxBrMV6.js → workspace-path-nav-eVT0rYvv.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/markdown-
|
|
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"./preload-helper-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/markdown-yn-nhRzB.js","assets/rolldown-runtime-hePW80VL.js","assets/react-Cvdyeg_0.js","assets/jsx-runtime-NZYk81nU.js","assets/utils-Dpy9ZFOr.js","assets/preload-helper-BZ1Pz5am.js","assets/chunk-YOKDWASO-Dego39cu.js","assets/react-dom-B7th3XGm.js","assets/clsx-DB0hHKMi.js","assets/lib-ChrQ49PO.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"./preload-helper-BZ1Pz5am.js";var i=e(t(),1),a=n(),o=(0,i.lazy)(()=>r(async()=>{let{Markdown:e}=await import(`./markdown-yn-nhRzB.js`).then(e=>e.a);return{Markdown:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9])).then(({Markdown:e})=>({default:e})));function s(e){return(0,a.jsx)(i.Suspense,{fallback:(0,a.jsx)(`div`,{className:e.className?`${e.className} whitespace-pre-wrap`:`whitespace-pre-wrap`,children:e.content}),children:(0,a.jsx)(o,{...e})})}var c=`agent-workspace`;function l(e){let t=[];for(let n of e.split(`/`))if(!(!n||n===`.`)){if(n===`..`){t.pop();continue}t.push(n)}return t.join(`/`)}function u(e,t){return!t||e===t||e.startsWith(`${t}/`)}function d(e){for(let t of[`/project/sandbox/repo/`,`/project/sandbox/`,`/project/`,`/workspace/`])if(e.startsWith(t))return e.slice(t.length);let t=e.indexOf(`.21st/worktrees/`);if(t!==-1){let n=e.slice(t+16).split(`/`);if(n.length>=3&&n[0]&&n[1])return n.slice(2).join(`/`)}return e}function f(e){return e.indexOf(c)}function p(e){let t=e.trim();if(!t)return null;let n=d(t).replace(/\\/g,`/`).replace(/\/+/g,`/`);if(n.startsWith(`${c}/`)){let e=l(n);return e.startsWith(`${c}/`)?e:null}if(n===c)return null;if(n.startsWith(`artifacts/`))return`${c}/${n}`;if(n.startsWith(`/`)){let e=n.split(`/`).filter(Boolean),t=f(e);return t>=0?e.slice(t).join(`/`):null}return null}function m(e){let t=p(e);return t?{panel:`workspace`,path:t}:null}export{s as i,m as n,d as r,u as t};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
|
-
"timestamp": "2026-
|
|
3
|
-
"routeEntry": "routes-
|
|
4
|
-
"routeEntryGzipBytes":
|
|
5
|
-
"routeEntryReduction": 0.
|
|
2
|
+
"timestamp": "2026-10-05T16:59:27.000Z",
|
|
3
|
+
"routeEntry": "routes-DCP1DP1g.js",
|
|
4
|
+
"routeEntryGzipBytes": 100783,
|
|
5
|
+
"routeEntryReduction": 0.9047900209157193,
|
|
6
6
|
"eagerFiles": 69,
|
|
7
|
-
"eagerGzipBytes":
|
|
7
|
+
"eagerGzipBytes": 354964,
|
|
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-CaT-3S-N.js
|
|
4
4
|
var tsrStartManifest = () => ({ routes: {
|
|
5
5
|
__root__: {
|
|
6
6
|
filePath: "/home/circleci/prime-agent/web/app/src/routes/__root.tsx",
|
|
@@ -13,7 +13,7 @@ var tsrStartManifest = () => ({ routes: {
|
|
|
13
13
|
"/api/workspace/tree"
|
|
14
14
|
],
|
|
15
15
|
preloads: [
|
|
16
|
-
"/assets/index-
|
|
16
|
+
"/assets/index-BARp0bjW.js",
|
|
17
17
|
"/assets/rolldown-runtime-hePW80VL.js",
|
|
18
18
|
"/assets/react-Cvdyeg_0.js",
|
|
19
19
|
"/assets/react-dom-B7th3XGm.js",
|
|
@@ -25,19 +25,19 @@ var tsrStartManifest = () => ({ routes: {
|
|
|
25
25
|
"/assets/use-presence-rcUnm8Z7.js",
|
|
26
26
|
"/assets/toast-BFeqSeaR.js",
|
|
27
27
|
"/assets/ui-preferences-1YaENqef.js",
|
|
28
|
-
"/assets/preload-helper-
|
|
28
|
+
"/assets/preload-helper-BZ1Pz5am.js"
|
|
29
29
|
],
|
|
30
30
|
scripts: [{ attrs: {
|
|
31
31
|
type: "module",
|
|
32
32
|
async: true,
|
|
33
|
-
src: "/assets/index-
|
|
33
|
+
src: "/assets/index-BARp0bjW.js"
|
|
34
34
|
} }]
|
|
35
35
|
},
|
|
36
36
|
"/": {
|
|
37
37
|
filePath: "/home/circleci/prime-agent/web/app/src/routes/index.tsx",
|
|
38
38
|
children: void 0,
|
|
39
39
|
preloads: [
|
|
40
|
-
"/assets/routes-
|
|
40
|
+
"/assets/routes-DCP1DP1g.js",
|
|
41
41
|
"/assets/utils-Dpy9ZFOr.js",
|
|
42
42
|
"/assets/ease-DKi-MOH5.js",
|
|
43
43
|
"/assets/use-reduced-motion-BgG7f9xw.js",
|
|
@@ -46,14 +46,14 @@ var tsrStartManifest = () => ({ routes: {
|
|
|
46
46
|
"/assets/select-COK0Kaq2.js",
|
|
47
47
|
"/assets/useBaseUiId-BlzQUkVG.js",
|
|
48
48
|
"/assets/createLucideIcon-CQY2ECfR.js",
|
|
49
|
-
"/assets/right-panel-registry-
|
|
49
|
+
"/assets/right-panel-registry-CF7GLJrk.js",
|
|
50
50
|
"/assets/provider-label-DNZOLldn.js",
|
|
51
51
|
"/assets/citations-BhyqbxcZ.js",
|
|
52
52
|
"/assets/resource-helpers-CKbSmzpw.js",
|
|
53
53
|
"/assets/bot-DETalD3q.js",
|
|
54
54
|
"/assets/check-BTwIaCtI.js",
|
|
55
55
|
"/assets/chevron-down-Bse1ggZM.js",
|
|
56
|
-
"/assets/subagent-utils-
|
|
56
|
+
"/assets/subagent-utils-D7sXbLsS.js",
|
|
57
57
|
"/assets/chevron-right-BPCB1mOg.js",
|
|
58
58
|
"/assets/safe-external-url-BnEhm9A0.js",
|
|
59
59
|
"/assets/file-text-cqOanUYv.js",
|
|
@@ -76,14 +76,14 @@ var tsrStartManifest = () => ({ routes: {
|
|
|
76
76
|
"/assets/dist-BogNzeK9.js",
|
|
77
77
|
"/assets/safe-storage-s25GrfpH.js",
|
|
78
78
|
"/assets/prime-agent-artifacts-C-g1VPiW.js",
|
|
79
|
-
"/assets/badge-
|
|
79
|
+
"/assets/badge-DOGhnsYk.js",
|
|
80
80
|
"/assets/dialog-DLIPvl1s.js",
|
|
81
81
|
"/assets/input-Ce8yLnXY.js",
|
|
82
82
|
"/assets/useControlled-CkQSkSv1.js",
|
|
83
83
|
"/assets/openui-utils-DawGoQNp.js",
|
|
84
84
|
"/assets/tokens-CtP2s1Y3.js",
|
|
85
85
|
"/assets/prompt-input-IwZOepG7.js",
|
|
86
|
-
"/assets/workspace-path-nav-
|
|
86
|
+
"/assets/workspace-path-nav-eVT0rYvv.js",
|
|
87
87
|
"/assets/notify-BC0a76VJ.js",
|
|
88
88
|
"/assets/surfaces-BULKVm-B.js",
|
|
89
89
|
"/assets/alert-dialog-FCppNafx.js"
|
|
@@ -3,25 +3,25 @@ import {
|
|
|
3
3
|
FileDiff,
|
|
4
4
|
ToolResult,
|
|
5
5
|
ToolResultOutput
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-J4Y2Z3XM.js";
|
|
7
7
|
import {
|
|
8
8
|
Collapsible$1,
|
|
9
9
|
CollapsibleContent,
|
|
10
10
|
CollapsibleTrigger
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-K4KN3QBT.js";
|
|
12
12
|
import {
|
|
13
13
|
GenerativeTextRenderer,
|
|
14
14
|
OpenUIHtmlArtifactView
|
|
15
|
-
} from "./chunk-
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
15
|
+
} from "./chunk-FPPKECLB.js";
|
|
16
|
+
import "./chunk-35AFSKDX.js";
|
|
17
|
+
import "./chunk-PHHC52CO.js";
|
|
18
18
|
import "./chunk-WTYNN6EV.js";
|
|
19
19
|
import "./chunk-BC4GIC2P.js";
|
|
20
20
|
import "./chunk-HDS3UQL4.js";
|
|
21
21
|
import {
|
|
22
22
|
UiErrorBoundary,
|
|
23
23
|
primeAgentArtifactDiff
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-GCDOYNXR.js";
|
|
25
25
|
import {
|
|
26
26
|
Button$1
|
|
27
27
|
} from "./chunk-E4YWFQX5.js";
|
|
@@ -336,7 +336,7 @@ import "./chunk-OO7NBFQQ.js";
|
|
|
336
336
|
import "./chunk-B5Y7XOIJ.js";
|
|
337
337
|
import "./chunk-YIJ7D7G5.js";
|
|
338
338
|
import "./chunk-NB3TVOGB.js";
|
|
339
|
-
import "./chunk-
|
|
339
|
+
import "./chunk-WPSI5TBE.js";
|
|
340
340
|
import "./chunk-SQX6GUZF.js";
|
|
341
341
|
import "./chunk-NXAVRSI5.js";
|
|
342
342
|
import "./chunk-WCNBWEHI.js";
|
|
@@ -344,7 +344,7 @@ import "./chunk-DP65WGRD.js";
|
|
|
344
344
|
import "./chunk-IGN54DHU.js";
|
|
345
345
|
import "./chunk-CZ7CSFO4.js";
|
|
346
346
|
|
|
347
|
-
// web/app/dist/server/assets/artifacts-panel-
|
|
347
|
+
// web/app/dist/server/assets/artifacts-panel-BuAqeJzj.js
|
|
348
348
|
import { useEffect, useMemo, useRef, useState } from "react";
|
|
349
349
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
350
350
|
var DEFAULT_ARTIFACT_RUNS = [];
|
|
@@ -6,12 +6,12 @@ import {
|
|
|
6
6
|
CommandItem,
|
|
7
7
|
CommandList,
|
|
8
8
|
CommandSeparator
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-JFAUSHBI.js";
|
|
10
|
+
import "./chunk-COWE2EJ6.js";
|
|
11
11
|
import "./chunk-BC4GIC2P.js";
|
|
12
12
|
import {
|
|
13
13
|
RIGHT_PANEL_LAUNCHER_DEFINITIONS
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-GCDOYNXR.js";
|
|
15
15
|
import "./chunk-E4YWFQX5.js";
|
|
16
16
|
import "./chunk-GDPICT5Q.js";
|
|
17
17
|
import "./chunk-FB3UHLLN.js";
|
|
@@ -27,11 +27,11 @@ import {
|
|
|
27
27
|
import "./chunk-OO7NBFQQ.js";
|
|
28
28
|
import "./chunk-B5Y7XOIJ.js";
|
|
29
29
|
import "./chunk-NB3TVOGB.js";
|
|
30
|
-
import "./chunk-
|
|
30
|
+
import "./chunk-WPSI5TBE.js";
|
|
31
31
|
import "./chunk-NXAVRSI5.js";
|
|
32
32
|
import "./chunk-CZ7CSFO4.js";
|
|
33
33
|
|
|
34
|
-
// web/app/dist/server/assets/chat-command-palette-
|
|
34
|
+
// web/app/dist/server/assets/chat-command-palette-Ca8gXVi2.js
|
|
35
35
|
import { useState } from "react";
|
|
36
36
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
37
37
|
function ChatCommandPalette({ open, onOpenChange, onNewSession, onStop, onResumeSession, onSetRightPanel, onThemeChange, sessions, isStreaming, themePreference }) {
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
useLabelableId,
|
|
11
11
|
useRegisterFieldControl,
|
|
12
12
|
useValueChanged
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-GCDOYNXR.js";
|
|
14
14
|
import {
|
|
15
15
|
EMPTY_OBJECT,
|
|
16
16
|
createChangeEventDetails,
|
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
__export
|
|
35
35
|
} from "./chunk-CZ7CSFO4.js";
|
|
36
36
|
|
|
37
|
-
// web/app/dist/server/assets/switch-
|
|
37
|
+
// web/app/dist/server/assets/switch-MKbwf0nH.js
|
|
38
38
|
import "react";
|
|
39
39
|
import { jsx } from "react/jsx-runtime";
|
|
40
40
|
|
|
@@ -302,7 +302,7 @@ var SwitchThumb = /* @__PURE__ */ React4.forwardRef(function SwitchThumb2(compon
|
|
|
302
302
|
});
|
|
303
303
|
if (process.env.NODE_ENV !== "production") SwitchThumb.displayName = "SwitchThumb";
|
|
304
304
|
|
|
305
|
-
// web/app/dist/server/assets/switch-
|
|
305
|
+
// web/app/dist/server/assets/switch-MKbwf0nH.js
|
|
306
306
|
var alertVariants = cva("group/alert relative grid w-full gap-0.5 rounded-lg border px-2.5 py-2 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4", {
|
|
307
307
|
variants: { variant: {
|
|
308
308
|
default: "bg-card text-card-foreground",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Input$1
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-GCDOYNXR.js";
|
|
4
4
|
import {
|
|
5
5
|
Button$1
|
|
6
6
|
} from "./chunk-E4YWFQX5.js";
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
cn
|
|
12
12
|
} from "./chunk-B5Y7XOIJ.js";
|
|
13
13
|
|
|
14
|
-
// web/app/dist/server/assets/input-group-
|
|
14
|
+
// web/app/dist/server/assets/input-group-0MxRe-sA.js
|
|
15
15
|
import { jsx } from "react/jsx-runtime";
|
|
16
16
|
function Textarea({ className, ...props }) {
|
|
17
17
|
return /* @__PURE__ */ jsx("textarea", {
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
FieldLabel,
|
|
7
7
|
Separator$1,
|
|
8
8
|
Switch$1
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-35AFSKDX.js";
|
|
10
10
|
import {
|
|
11
11
|
Card,
|
|
12
12
|
CardContent,
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
CardHeader,
|
|
15
15
|
CardTitle,
|
|
16
16
|
validateAndNormalizeOpenUIHtmlArtifact
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-PHHC52CO.js";
|
|
18
18
|
import {
|
|
19
19
|
Combination_default,
|
|
20
20
|
Dialog,
|
|
@@ -56,7 +56,7 @@ import {
|
|
|
56
56
|
isSafeExternalUrl,
|
|
57
57
|
segmentOpenUIContent,
|
|
58
58
|
useRegisteredLabelId
|
|
59
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-GCDOYNXR.js";
|
|
60
60
|
import {
|
|
61
61
|
Button$1,
|
|
62
62
|
OpenPanelActionSchema,
|
|
@@ -15588,7 +15588,7 @@ var require_react_is3 = __commonJS({
|
|
|
15588
15588
|
}
|
|
15589
15589
|
});
|
|
15590
15590
|
|
|
15591
|
-
// web/app/dist/server/assets/openui-renderer-
|
|
15591
|
+
// web/app/dist/server/assets/openui-renderer-CJ7Q2zZ_.js
|
|
15592
15592
|
import * as React$1 from "react";
|
|
15593
15593
|
import { createContext as createContext22, useCallback as useCallback25, useContext as useContext22, useEffect as useEffect43, useId as useId5, useMemo as useMemo27, useRef as useRef48, useState as useState37 } from "react";
|
|
15594
15594
|
import { Fragment as Fragment$12, jsx as jsx25, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
@@ -95125,7 +95125,7 @@ var ProgressLabel = /* @__PURE__ */ React158.forwardRef(function ProgressLabel2(
|
|
|
95125
95125
|
});
|
|
95126
95126
|
if (process.env.NODE_ENV !== "production") ProgressLabel.displayName = "ProgressLabel";
|
|
95127
95127
|
|
|
95128
|
-
// web/app/dist/server/assets/openui-renderer-
|
|
95128
|
+
// web/app/dist/server/assets/openui-renderer-CJ7Q2zZ_.js
|
|
95129
95129
|
var OpenUIArtifactContext = createContext22({ artifactIndex: 0 });
|
|
95130
95130
|
function OpenUIArtifactProvider({ children, value }) {
|
|
95131
95131
|
return /* @__PURE__ */ jsx25(OpenUIArtifactContext.Provider, {
|