@qredence/fleet 0.10.3 → 0.10.4
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 +12 -0
- package/dist/web/client/assets/{artifacts-panel-CfWH5cQn.js → artifacts-panel-CDuvwZXW.js} +1 -1
- package/dist/web/client/assets/{chat-command-palette-CKGrP-Ke.js → chat-command-palette-DSpwG3Ph.js} +1 -1
- package/dist/web/client/assets/{ipython-tool-bieUhw9K.js → cpython-tool-CcGMkNQ4.js} +1 -1
- package/dist/web/client/assets/globals-CR3boQb2.css +2 -0
- package/dist/web/client/assets/{index-DJDQWCGd.js → index-BpqhS0Xv.js} +2 -2
- package/dist/web/client/assets/prime-agent-artifacts-CuR1D_ch.js +5 -0
- package/dist/web/client/assets/reasoning-line-B79r9oqP.js +1 -0
- package/dist/web/client/assets/{repl-panel-5xgkDXO5.js → repl-panel-Dj0nX5A6.js} +1 -1
- package/dist/web/client/assets/right-panel-registry-HNH3niQ8.js +2 -0
- package/dist/web/client/assets/routes-CJRPrnVB.js +14 -0
- package/dist/web/client/assets/session-activity-panel-Dvy044_T.js +1 -0
- package/dist/web/client/assets/{session-insights-panel-BXEmuJKf.js → session-insights-panel-Bltz_o6C.js} +1 -1
- package/dist/web/client/assets/{session-tool-renderer-CGMatufW.js → session-tool-renderer-BLFqj28b.js} +7 -7
- package/dist/web/client/assets/{subagent-chat-panel-xm-zBsFL.js → subagent-chat-panel-Cr57arv9.js} +1 -1
- package/dist/web/client/assets/subagent-transcript-CqAEPEJp.js +1 -0
- package/dist/web/client/assets/subagents-panel-DCjSDcM4.js +1 -0
- package/dist/web/client/assets/tool-action-icon-vTW_L1Fj.js +1 -0
- package/dist/web/client/assets/tool-output-normalizer-DDoLNo4P.js +4 -0
- package/dist/web/client/assets/tool-part-normalizer-DdgmYc9z.js +4 -0
- package/dist/web/client/assets/{tool-result-C_RIixge.js → tool-result-DxWDQJSF.js} +3 -3
- package/dist/web/client/assets/tool-timeline-BoWCZg0K.js +2 -0
- package/dist/web/client/bundle-budget.json +5 -5
- package/dist/web/server/{_tanstack-start-manifest_v-Cs4JeecK-7Q7PABV3.js → _tanstack-start-manifest_v-BhSwNUm2-HUY424SL.js} +9 -9
- package/dist/web/server/{agents-DOgCHixY-TU7YLWS2.js → agents-DOgCHixY-U362NTZW.js} +1 -1
- package/dist/web/server/{agents-page-BdiR9H8w-UXB7T3LH.js → agents-page-BdiR9H8w-WK3UCXSA.js} +5 -5
- package/dist/web/server/{artifacts-panel-DjaLT-MS-DAPJTA2V.js → artifacts-panel-C9OUKEU0-N74QLS6E.js} +18 -18
- package/dist/web/server/{chat-command-palette-CGCsCr9E-U5PCLXNE.js → chat-command-palette-CnKy1Q4g-GJJGAVQ4.js} +12 -12
- package/dist/web/server/{chunk-GNXIDE26.js → chunk-2R5CY7DW.js} +2 -2
- package/dist/web/server/{chunk-MEAWBN4N.js → chunk-37MAYG3X.js} +15 -15
- package/dist/web/server/{chunk-3LAD2C43.js → chunk-3KHS4HHI.js} +13 -13
- package/dist/web/server/{chunk-BD7YKYWL.js → chunk-4ISLMQ2M.js} +3 -3
- package/dist/web/server/{chunk-FSQWWR2M.js → chunk-4ZKBYAHH.js} +1 -1
- package/dist/web/server/{chunk-BLGKLQJG.js → chunk-63IBRYZL.js} +6 -6
- package/dist/web/server/{chunk-TXZDDJCT.js → chunk-6OZY4XH7.js} +3 -3
- package/dist/web/server/{chunk-QWJE6ES6.js → chunk-A6LRK2MC.js} +142 -32
- package/dist/web/server/{chunk-PBNUO4IN.js → chunk-BG4DVGLL.js} +2 -2
- package/dist/web/server/{chunk-KSGGSGOA.js → chunk-BVSDXFQ6.js} +1 -1
- package/dist/web/server/{chunk-HAFELESQ.js → chunk-ETTLRHDY.js} +3 -3
- package/dist/web/server/{chunk-BZ2EAUZZ.js → chunk-F6P2FTIT.js} +3 -3
- package/dist/web/server/{chunk-CE7U5QB2.js → chunk-FGOT5FGH.js} +2 -2
- package/dist/web/server/{chunk-UULUKSQD.js → chunk-FSIRN7F7.js} +104 -94
- package/dist/web/server/{chunk-R4BS3KYI.js → chunk-FVTCXLYO.js} +12 -12
- package/dist/web/server/{chunk-2Y2543CV.js → chunk-IJZDCYFG.js} +15 -10
- package/dist/web/server/{chunk-FT7HNDR5.js → chunk-JR5TXTGV.js} +5 -5
- package/dist/web/server/{chunk-PQVTLG3E.js → chunk-NEMK2RTM.js} +4 -4
- package/dist/web/server/{chunk-AXN2OBPF.js → chunk-O5CPI2JH.js} +1 -1
- package/dist/web/server/{chunk-Q4ECIATK.js → chunk-ORO7KXHF.js} +4 -4
- package/dist/web/server/{chunk-VDEUVEWL.js → chunk-U26ZMWVI.js} +300 -300
- package/dist/web/server/{chunk-APOS34PW.js → chunk-U73UDYRF.js} +2 -2
- package/dist/web/server/{chunk-VBCFQNR3.js → chunk-USP4O3V7.js} +2 -2
- package/dist/web/server/{chunk-FNV3WZXL.js → chunk-VFW2KPLD.js} +2 -2
- package/dist/web/server/{chunk-5MOXRFX6.js → chunk-Y3YE73VQ.js} +45 -5
- package/dist/web/server/{chunk-UZ2KHDSW.js → chunk-ZRISZYHZ.js} +14 -14
- package/dist/web/server/{connectors-Dv_uPdv0-2TCNQ3TU.js → connectors-Dv_uPdv0-WIJGW5CQ.js} +1 -1
- package/dist/web/server/{connectors-page-DW75T-uH-BR36R6FT.js → connectors-page-DW75T-uH-3KBZRVAT.js} +8 -8
- package/dist/web/server/{create-project-dialog-aCD1v__i-37Y2AYF7.js → create-project-dialog-dwXNUwY--APUSOU5G.js} +13 -13
- package/dist/web/server/{fork-picker-dialog-DFpKOdAw-JPLJSYYU.js → fork-picker-dialog-DFpKOdAw-WJPMXHSE.js} +6 -6
- package/dist/web/server/{markdown-Cc8V9dOF-JTNTJKQU.js → markdown-Cc8V9dOF-MMI3ZBVZ.js} +4 -4
- package/dist/web/server/{markdown-code-gaRnbgNM-V5LIRYCD.js → markdown-code-gaRnbgNM-ND6VVJ7D.js} +4 -4
- package/dist/web/server/{message-queue-nQ2_kU82-KKSLYR4S.js → message-queue-nQ2_kU82-3PN7CKFG.js} +4 -4
- package/dist/web/server/{model-selector-list-q8bMnmhy-SPFJGUBT.js → model-selector-list-q8bMnmhy-W6JM2N7G.js} +8 -8
- package/dist/web/server/{openui-renderer-DNl7TU3v-LAP3OM5H.js → openui-renderer-Das3EemD-AODSN4I2.js} +14 -14
- package/dist/web/server/{prompt-suggestions-B67Uy5Rk-5SMTSIFQ.js → prompt-suggestions-B67Uy5Rk-6MV56U6N.js} +4 -4
- package/dist/web/server/{repl-panel-1kSS1UGd-POXRYDDJ.js → repl-panel-DfC-BCfn-4OZEKSFX.js} +8 -8
- package/dist/web/server/{resources-panel-Dtm8nlrt-PMS7NWKW.js → resources-panel-BL41dm3H-UWWMTOFL.js} +10 -10
- package/dist/web/server/{router-CFtn3QOM-3WK4R4UB.js → router-DJDog9kJ-IHEFPUCH.js} +5 -5
- package/dist/web/server/{routes-CpT-KFt7-F6WEPWF6.js → routes-BWk0YodE-CEPOI27O.js} +29 -31
- package/dist/web/server/server.js +2 -2
- package/dist/web/server/{session-activity-panel-Dr9Q0Wmd-2F7ZYCAY.js → session-activity-panel-B56ALLHr-6PDGEA2M.js} +83 -18
- package/dist/web/server/{session-insights-panel-BiVObm_6-AP4FITT7.js → session-insights-panel-cS12HsWt-YX7QOWIA.js} +2 -2
- package/dist/web/server/{session-reasoning-panel-BFyfdmnZ-AQBC4WAL.js → session-reasoning-panel-CtQUqSv9-JIXRXBH7.js} +9 -9
- package/dist/web/server/{session-tool-renderer-DHu5tv0A-YFP7I2UC.js → session-tool-renderer-Co466pSk-QUTYNAOE.js} +12 -12
- package/dist/web/server/{session-tree-panel-BkMTm2QF-K56UQR2K.js → session-tree-panel-B23gApxX-44NFOCFB.js} +9 -9
- package/dist/web/server/{settings-dialog-1Zr_EiEd-GDE4IXK2.js → settings-dialog-CdRjXyfc-IYMPCNR5.js} +16 -16
- package/dist/web/server/{subagent-chat-panel-BCm1x_mR-HY6QEHEF.js → subagent-chat-panel-DwvOMUnh-EPVZRTRM.js} +15 -15
- package/dist/web/server/{subagents-panel-3gfZLsTx-7D53UO7K.js → subagents-panel-DlFBFoX6-SAWYBVZJ.js} +31 -30
- package/dist/web/server/{workspace-panel-BeSOuvp7-7N3CAG2K.js → workspace-panel-CxUsWmIE-3BMZFN5O.js} +10 -10
- package/package.json +1 -1
- package/dist/web/client/assets/globals-C6h6fq-s.css +0 -2
- package/dist/web/client/assets/prime-agent-artifacts-C-g1VPiW.js +0 -5
- package/dist/web/client/assets/reasoning-line-DGdPUMwT.js +0 -1
- package/dist/web/client/assets/right-panel-registry-BkBAryPm.js +0 -2
- package/dist/web/client/assets/routes-C6C0y-oH.js +0 -14
- package/dist/web/client/assets/session-activity-panel-BloVPsLJ.js +0 -1
- package/dist/web/client/assets/subagent-transcript-BzToBVWk.js +0 -1
- package/dist/web/client/assets/subagents-panel-B5ooG4sS.js +0 -1
- package/dist/web/client/assets/tool-output-normalizer-DDU09Zc6.js +0 -4
- package/dist/web/client/assets/tool-part-normalizer-CJ2sY87r.js +0 -4
- package/dist/web/client/assets/tool-timeline-BVY5VQ3a.js +0 -2
- package/dist/web/client/assets/wrench-BXX_Ah2s.js +0 -1
package/dist/web/client/assets/{subagent-chat-panel-xm-zBsFL.js → subagent-chat-panel-Cr57arv9.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./jsx-runtime-NZYk81nU.js";import{t}from"./prompt-input-0kaw0ekd.js";import{t as n}from"./subagent-transcript-
|
|
1
|
+
import{t as e}from"./jsx-runtime-NZYk81nU.js";import{t}from"./prompt-input-0kaw0ekd.js";import{t as n}from"./subagent-transcript-CqAEPEJp.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./react-Cvdyeg_0.js";import{t as n}from"./jsx-runtime-NZYk81nU.js";import{t as r}from"./utils-oBThwhjm.js";import{t as i}from"./bot-DETalD3q.js";import{a,c as o,d as s,f as c,l,m as u,n as d,o as f,p,r as m,s as h,t as g,u as _}from"./tool-part-normalizer-DdgmYc9z.js";import{t as v}from"./session-tool-renderer-BLFqj28b.js";import{n as y}from"./file-text-cqOanUYv.js";import{t as b}from"./circle-check-DBhaebaM.js";import{t as x}from"./loader-circle-BmKYM_C4.js";import{t as S}from"./refresh-cw-CqPE3kNY.js";import{t as C}from"./button-CWYjn8Zk.js";import{t as w}from"./prime-agent-artifacts-CuR1D_ch.js";import{n as T}from"./reasoning-line-B79r9oqP.js";import{a as E,c as D,i as O,n as k,o as A,r as j,s as M,t as N}from"./trace-IsV5RRvM.js";import{t as P}from"./tool-timeline-BoWCZg0K.js";var F=e(t(),1),I=n();function L({children:e,tree:t,className:n}){let i=(0,F.useMemo)(()=>s(e,t),[e,t]),a=i.some(e=>e.status===`queued`||e.status===`running`||e.status===`recovering`),[o,l]=(0,F.useState)(a);return i.length===0?null:(0,I.jsx)(N,{className:r(`mt-2`,n),"data-testid":`subagent-trace`,children:(0,I.jsxs)(k,{open:o||a,onOpenChange:l,children:[(0,I.jsx)(O,{"aria-label":a?`Subagents working`:`Subagents completed`,children:(0,I.jsxs)(M,{status:a?`running`:void 0,children:[(0,I.jsx)(A,{children:a?(0,I.jsx)(x,{className:`animate-spin`}):(0,I.jsx)(b,{})}),(0,I.jsx)(D,{children:a?`Subagents working`:`Subagents completed`}),(0,I.jsx)(E,{children:i.length})]})}),(0,I.jsx)(j,{children:(0,I.jsx)(N,{className:`gap-1`,children:i.map(e=>(0,I.jsxs)(M,{style:{paddingLeft:`${Math.max(0,e.depth??0)*12}px`},children:[(0,I.jsx)(A,{children:c(e.status)}),(0,I.jsx)(D,{children:e.label}),e.model?(0,I.jsx)(E,{children:e.model}):null,(0,I.jsx)(E,{className:`capitalize`,children:e.status}),e.error||e.answerPreview||e.progressNote||e.activity?.toolName?(0,I.jsx)(E,{className:`max-w-56 truncate`,children:e.error||e.answerPreview||e.progressNote||e.activity?.toolName}):null]},e.id))})})]})})}function R({turn:e,isLast:t,isStreaming:n,presentation:r,artifacts:i}){let s=(0,F.useMemo)(()=>e.assistants.flatMap((r,i)=>a(g((r.parts??[]).filter(e=>e.type!==`tool-FleetReasoning`&&e.type!==`tool-Thinking`)),{messageId:r.id,isLast:t&&i===e.assistants.length-1,isStreaming:n,ToolRendererComponent:v,TextRendererComponent:u})),[t,n,e.assistants]);return(0,I.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[e.user?(0,I.jsx)(h,{from:`user`,children:(0,I.jsx)(_,{children:(0,I.jsx)(m,{message:e.user,enableImagePreview:!1})})}):null,e.assistants.length>0?(0,I.jsx)(h,{from:`assistant`,children:(0,I.jsx)(_,{children:(0,I.jsx)(o,{variant:`ghost`,children:(0,I.jsxs)(l,{children:[(0,I.jsx)(`div`,{className:`flex flex-col gap-3`,children:s}),t&&i.length>0?(0,I.jsx)(P,{messages:[],artifacts:i,streaming:n}):null,t&&r?(0,I.jsx)(L,{tree:r.rlmTree,children:r.rlmChildren}):null]})})})}):null]})}function z(e,t){return e.user?.id??e.assistants[0]?.id??`subagent-turn-${t}`}function B({child:e,parentSessionId:t,transcript:n,onRefresh:a,fullWidth:o=!1,status:s}){let c=(0,F.useMemo)(()=>n?.status===`loading`?[]:T(n?.messages??[]),[n]),l=s??p(e),u=(0,F.useMemo)(()=>n?.status===`loading`?[]:w(n?.messages??[],n?.presentation,l),[l,n]),m=(0,F.useMemo)(()=>{let e=new Set((n?.messages??[]).flatMap(e=>e.parts.flatMap(e=>`toolCallId`in e&&e.toolCallId?[e.toolCallId]:[])));return u.flatMap(e=>e.artifacts).filter(t=>!t.sourceToolCallId||!e.has(t.sourceToolCallId))},[u,n]),h=n?.presentation,g=(0,F.useCallback)((e,t)=>{let n=t===c.length-1;return(0,I.jsx)(R,{turn:e,isLast:n,isStreaming:n&&l===`streaming`,presentation:n?h:void 0,artifacts:n?m:[]})},[m,l,h,c.length]),_=e.sessionName||e.label,[v,b]=(0,F.useState)(null);(0,F.useEffect)(()=>{b(e.lastHeardFrom?new Date(e.lastHeardFrom).toLocaleTimeString():null)},[e.lastHeardFrom]);let x=(0,F.useRef)(null);return(0,I.jsxs)(`section`,{"aria-label":`Subagent thread: ${e.label}`,className:`flex min-h-0 min-w-0 flex-1 flex-col gap-2`,"data-testid":o?`subagent-conversation-surface`:void 0,children:[(0,I.jsxs)(`div`,{className:r(`flex shrink-0 min-w-0 items-start gap-2`,o?`rounded-md border border-border/60 bg-background px-2.5 py-2`:`border-b border-border/40 pb-2`),children:[(0,I.jsx)(i,{className:`mt-0.5 size-3.5 shrink-0 text-foreground/45`}),(0,I.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,I.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs font-medium text-foreground/80`,children:_}),(0,I.jsx)(`span`,{className:`shrink-0 text-micro capitalize text-foreground/45`,children:e.status})]}),e.model?(0,I.jsx)(`p`,{className:`truncate font-mono text-micro text-foreground/40`,children:e.model}):null,v?(0,I.jsxs)(`p`,{className:`truncate text-micro text-foreground/40`,children:[`Heartbeat: `,v]}):null,e.progressNote&&e.status===`running`?(0,I.jsxs)(`p`,{className:`truncate text-micro text-foreground/50`,title:e.progressNote,children:[`Progress: `,e.progressNote]}):null,e.answerPreview?(0,I.jsx)(`p`,{className:r(`mt-1 whitespace-pre-wrap text-caption leading-4 text-foreground/55`,o?`line-clamp-3`:`line-clamp-2`),children:e.answerPreview}):null]}),a?(0,I.jsx)(C,{"aria-label":`Refresh ${e.label} thread`,className:`shrink-0 text-foreground/40 hover:text-foreground/70`,onClick:a,size:`icon-compact`,title:`Refresh ${e.label} thread`,type:`button`,variant:`ghost`,children:(0,I.jsx)(S,{className:r(`size-3.5`,n?.status===`loading`&&`animate-spin`)})}):null]}),t?n?.status===`loading`?(0,I.jsx)(`div`,{className:`flex min-h-32 flex-1 items-center justify-center text-caption text-foreground/45`,children:`Loading subagent thread…`}):n?.status===`error`&&c.length===0?(0,I.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,I.jsx)(y,{className:`mt-0.5 size-3.5 shrink-0`}),(0,I.jsx)(`span`,{children:n.error?.message??`Unable to load this subagent thread.`})]}):c.length===0?(0,I.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,I.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[n?.error?(0,I.jsxs)(`div`,{role:`alert`,className:r(`mb-2 flex shrink-0 items-start gap-2 rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2 text-caption leading-4 text-destructive`,o&&`mx-4 mt-2 sm:mx-6`),children:[(0,I.jsx)(y,{className:`mt-0.5 size-3.5 shrink-0`}),(0,I.jsx)(`span`,{children:n.error.message})]}):null,(0,I.jsx)(`div`,{className:r(`flex min-h-0 flex-1 flex-col bg-background`,o?`rounded-none border-x-0 border-b-0 border-t border-border/60`:`rounded-md border border-border/60`),children:(0,I.jsx)(f,{busy:l===`streaming`,className:`min-h-0 flex-1`,followOutput:l===`streaming`,label:`Transcript for ${e.label}`,smooth:l!==`streaming`,viewportRef:x,viewportClassName:o?`px-0`:void 0,contentClassName:r(`flex flex-col gap-4`,o?`mx-auto w-full max-w-3xl px-4 py-6 sm:px-6`:`px-0.5 py-2`),children:(0,I.jsx)(d,{estimateSize:320,getItemKey:z,itemGap:16,items:c,renderItem:g,viewportRef:x})})})]}):(0,I.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{B as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./react-Cvdyeg_0.js";import{t as n}from"./jsx-runtime-NZYk81nU.js";import{t as r}from"./utils-oBThwhjm.js";import{t as i}from"./bot-DETalD3q.js";import{d as a,f as o}from"./tool-part-normalizer-DdgmYc9z.js";import{t as s}from"./button-CWYjn8Zk.js";import{t as c}from"./subagent-transcript-CqAEPEJp.js";var l=e(t(),1),u=n();function d({agents:e,loadSession:t,onOpenTab:n,parentSessionId:d,tree:f}){let p=(0,l.useMemo)(()=>a(e,f),[e,f]),[m,h]=(0,l.useState)(null),[g,_]=(0,l.useState)({}),v=(0,l.useRef)(new Map),y=p.find(e=>e.id===m)??p[0];(0,l.useEffect)(()=>{m&&p.some(e=>e.id===m)||h(p[0]?.id??null)},[p,m]);let b=(0,l.useCallback)(async(e,n=!1)=>{if(!d)return;let r=`${d}:${e.id}:${e.status}:${e.timestamp}:${e.activeSessionId??``}`,i=g[e.id];if(!n&&i?.requestKey===r)return;let a=(v.current.get(e.id)??0)+1;v.current.set(e.id,a),_(t=>({...t,[e.id]:{requestKey:r,status:`loading`,messages:[]}}));try{let n=await t(d,e.id);if(v.current.get(e.id)!==a)return;_(t=>({...t,[e.id]:{requestKey:r,status:`ready`,messages:n.messages,presentation:n.presentation}}))}catch(t){if(v.current.get(e.id)!==a)return;_(n=>({...n,[e.id]:{requestKey:r,status:`error`,messages:[],error:t instanceof Error?t:Error(String(t))}}))}},[t,d,g]);return(0,l.useEffect)(()=>{y&&b(y)},[b,y]),p.length===0?(0,u.jsx)(`section`,{"aria-label":`Subagents`,className:`flex min-h-36 flex-1 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,u.jsxs)(`section`,{"aria-label":`Subagents`,className:`flex h-full min-h-0 min-w-0 flex-1 flex-col gap-3`,children:[(0,u.jsxs)(`header`,{className:`flex shrink-0 items-center gap-2 px-0.5`,children:[(0,u.jsx)(i,{className:`size-3.5 shrink-0 text-foreground/45`}),(0,u.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-label font-medium text-foreground/70`,children:`Invoked`}),(0,u.jsx)(`span`,{className:`shrink-0 tabular-nums text-micro text-foreground/40`,children:p.length})]}),(0,u.jsx)(`div`,{className:`max-h-[min(9.5rem,32%)] shrink-0 space-y-0.5 overflow-y-auto overscroll-contain`,"data-testid":`subagent-thread-list`,children:p.map(e=>{let t=e.id===y?.id;return(0,u.jsxs)(s,{type:`button`,variant:`ghost`,size:`compact`,"aria-pressed":t,className:r(`flex h-auto 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:()=>{h(e.id),n?.(e.id)},children:[(0,u.jsx)(`span`,{className:`shrink-0`,children:o(e.status)}),(0,u.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-foreground/80`,children:e.label}),(0,u.jsx)(`span`,{className:`shrink-0 text-micro capitalize text-foreground/45`,children:e.status})]},e.id)})}),y?(0,u.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col border-t border-border/50 pt-3`,children:(0,u.jsx)(c,{child:y,parentSessionId:d,transcript:g[y.id],onRefresh:()=>void b(y,!0)})}):null]})}export{d as SubagentsPanelContent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./createLucideIcon-CQY2ECfR.js";import{t}from"./search-Cb6fFWew.js";import{t as n}from"./shield-check-7HDd-2Fn.js";var r={name:`circle-x`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]],aliases:[`x-circle`]};r.node;var i=e(r),a={name:`earth`,size:24,node:[[`path`,{d:`M21.54 15H17a2 2 0 0 0-2 2v4.54`,key:`1djwo0`}],[`path`,{d:`M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17`,key:`1tzkfa`}],[`path`,{d:`M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05`,key:`14pb5j`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]],aliases:[`globe-2`]};a.node;var o=e(a),s={name:`file-pen-line`,size:24,node:[[`path`,{d:`M14.364 13.634a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506l4.013-4.009a1 1 0 0 0-3.004-3.004z`,key:`ukzhwg`}],[`path`,{d:`M14.487 7.858A1 1 0 0 1 14 7V2`,key:`1klhew`}],[`path`,{d:`M20 19.645V20a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l2.516 2.516`,key:`rxaxab`}],[`path`,{d:`M8 18h1`,key:`13wk12`}]],aliases:[`file-signature`]};s.node;var c=e(s),l={name:`file-search`,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`}],[`circle`,{cx:`11.5`,cy:`14.5`,r:`2.5`,key:`1bq0ko`}],[`path`,{d:`M13.3 16.3 15 18`,key:`2quom7`}]]};l.node;var u=e(l),d={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`}]]};d.node;var f=e(d),p={name:`list-todo`,size:24,node:[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`rect`,{x:`3`,y:`4`,width:`6`,height:`6`,rx:`1`,key:`cif1o7`}]]};p.node;var m=e(p),h={name:`message-circle-question-mark`,size:24,node:[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`message-circle-question`]};h.node;var g=e(h),_={name:`terminal`,size:24,node:[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]};_.node;var v=e(_),y={name:`users-round`,size:24,node:[[`path`,{d:`M18 21a8 8 0 0 0-16 0`,key:`3ypg7q`}],[`circle`,{cx:`10`,cy:`8`,r:`5`,key:`o932ke`}],[`path`,{d:`M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3`,key:`10s06x`}]],aliases:[`users-2`]};y.node;var b=e(y),x={name:`wrench`,size:24,node:[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]};x.node;var S=e(x);function C(e){let t=e.replace(/^tool-/,``);return t.toLowerCase()===`ipython`?`CPython`:t}function w(e){return e.toLowerCase()===`ipython`?`CPython`:e}function T(e){let r=e.toLowerCase();return r.includes(`plan`)||r.includes(`todo`)?m:r.includes(`approval`)||r.includes(`permission`)?n:r.includes(`question`)||r.includes(`ask`)?g:r.includes(`citation`)||r.includes(`source`)?o:r.includes(`agent`)||r.includes(`task`)||r.includes(`rlm`)?b:r.includes(`image`)||r.includes(`visual`)?f:r.includes(`edit`)||r.includes(`write`)||r.includes(`patch`)||r.includes(`diff`)?c:r.includes(`read`)||r.includes(`file`)?u:r.includes(`search`)||r.includes(`grep`)||r.includes(`glob`)?t:r.includes(`bash`)||r.includes(`shell`)||r.includes(`python`)||r.includes(`ipython`)?v:S}export{v as a,o as c,S as i,i as l,T as n,m as o,C as r,f as s,w as t};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{t as e}from"./safe-external-url-D3PJJIcM.js";function t(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:void 0}function n(e){let n=t(e);if(n)return n;if(typeof e==`string`)try{return t(JSON.parse(e))}catch{return}}function r(e,...t){for(let n of t){let t=e?.[n];if(typeof t==`string`&&t.trim())return t}}function i(e,...t){for(let n of t){let t=e?.[n];if(typeof t==`number`&&Number.isFinite(t))return t;if(typeof t==`string`&&t.trim()){let e=Number(t);if(Number.isFinite(e))return e}}}function a(e,...t){for(let n of t){let t=e?.[n];if(typeof t==`boolean`)return t}}function o(e){if(typeof e==`string`)return e;if(e==null)return``;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function s(e){return e.output!==void 0&&e.output!==null?e.output:e.result}function c(e){let t=n(e),s=n(t?.details),c={...t??{},...s??{}},l=c.result,u=r(c,`stdout`,`standardOutput`,`standard_output`),d=r(c,`stderr`,`standardError`,`standard_error`),f=c.error??c.errorMessage??c.evalue,p=f===void 0?void 0:o(f),m=a(c,`isError`,`is_error`)===!0||!!p,h=i(c,`durationMs`,`duration_ms`,`duration`),g=a(c,`kernelRestarted`,`kernel_restarted`),_=new Set([`stdout`,`stderr`,`standardOutput`,`standard_output`,`standardError`,`standard_error`,`error`,`errorMessage`,`evalue`,`durationMs`,`duration_ms`,`duration`,`kernelRestarted`,`kernel_restarted`,`status`,`isError`]),v=Object.keys(c).some(e=>!_.has(e));return{record:t,details:s,stdout:u,stderr:d,result:l,error:p,isError:m,durationMs:h,kernelRestarted:g,structured:!u&&!d&&!p&&(typeof l==`object`&&!!l||v)}}function l(e,t){let n=[];if(e.stdout&&n.push({label:`stdout`,content:e.stdout,language:`text`}),e.stderr&&n.push({label:`stderr`,content:e.stderr,language:`text`}),e.result!==void 0&&n.push({label:`result`,content:o(e.result),language:typeof e.result==`object`&&e.result!==null?`json`:`text`}),e.error?n.push({label:`reported-error`,content:e.error,language:`text`}):e.isError&&n.push({label:`reported-error`,content:`The tool reported an error.`,language:`text`}),n.length>0)return n;let r=e.details??e.record;if(r){let e={...r};if(delete e.details,delete e.isError,Object.keys(e).length>0)return[{label:`result`,content:o(e),language:`json`}]}let i=o(t);return i.trim()?[{label:`output`,content:i,language:`text`}]:[]}function u(e,t){return l(e,t).map(e=>`${e.label}\n${e.content}`).join(`
|
|
2
|
+
|
|
3
|
+
`)}function d(e){return n(e.input)??n(e.args)}function f(e,...t){for(let n of t){let t=e?.[n];if(Array.isArray(t))return t}}function p(e,t){return r(t.details??t.record,`diff`,`patch`)??r(e,`diff`,`patch`)}function m(e,t){return r(e,`path`,`filePath`,`filename`,`file`)??r(t.details??t.record,`path`,`filePath`,`filename`,`file`)??`workspace file`}function h(e){return e.split(`
|
|
4
|
+
`).map((e,t)=>({id:`${t}-${e.slice(0,16)}`,type:e.startsWith(`+`)&&!e.startsWith(`+++`)?`added`:e.startsWith(`-`)&&!e.startsWith(`---`)?`removed`:`context`,content:e}))}function g(e,i){let a=i.details??i.record,o=n(e?.plan)??n(a?.plan),s=f(e,`todos`)??f(o,`todos`,`items`)??f(a,`todos`,`newTodos`,`items`);return s?s.flatMap((e,n)=>{let i=t(e);if(!i)return[];let a=r(i,`content`,`title`,`text`,`label`);if(!a)return[];let o=r(i,`status`),s=o===`in_progress`||o===`in-progress`?`in-progress`:o===`completed`?`completed`:o===`cancelled`?`cancelled`:`pending`;return[{id:`${n}-${a}`,title:a,status:s}]}):[]}function _(n){let i=f(n.details??n.record,`results`,`sources`,`citations`);return i?i.flatMap((n,i)=>{let a=t(n);if(!a)return[];let o=r(a,`title`,`name`,`snippet`);if(!o)return[];let s=r(a,`url`,`link`),c=s&&e(s)?s:void 0;return[{id:`${i}-${o}`,title:o,url:c,domain:r(a,`domain`,`source`)}]}):[]}function v(e){return r(e.details??e.record,`url`,`imageUrl`,`image_url`)}function y(e,n){return t(e?.approval)??t(n.details?.approval)??t(n.record?.approval)}function b(e){let t=typeof e.type==`string`?e.type:`Tool`;return t.startsWith(`tool-`)?t.slice(5):t}function x(e,t){let n=typeof e.state==`string`?e.state:void 0;return n===`output-error`||n===`error`?`error`:n===`output-available`||n===`complete`||n===`success`?`success`:n===`cancelled`||n===`canceled`||n===`aborted`||n===`interrupted`?`cancelled`:e.error===void 0?n===`input-streaming`||n===`streaming`?t===`streaming`?`running`:`cancelled`:e.output!==void 0||e.result!==void 0?`success`:t===`streaming`?`running`:`cancelled`:`error`}function S(e,t){return t||e.toLowerCase().includes(`json`)?`json`:e.toLowerCase().includes(`bash`)||e.toLowerCase().includes(`shell`)?`bash`:e.toLowerCase().includes(`python`)?`python`:`text`}function C(e,t){if(!t)return;let n=e.toLowerCase();return n.includes(`bash`)||n.includes(`shell`)?`bash`:n.includes(`python`)?/^\s*%%bash(?:\s|$)/im.test(t)?`bash`:`python`:`text`}function w(e,t){if(!t)return;let n=e.toLowerCase();return n.includes(`ipython`)||n.includes(`cpython`)||n===`python_repl`?`CPython`:n.includes(`bash`)||n.includes(`shell`)?`Bash`:n.includes(`python`)?`Python`:t===`json`?`JSON`:t===`text`?`Text`:t.toUpperCase()}var T=new WeakMap;function E(e,t){if(e&&typeof e==`object`){let n=T.get(e);if(n&&n.chatStatus===t)return n.value;let r=O(e,t);return T.set(e,{chatStatus:t,value:r}),r}return O(e,t)}function D(e){if(!e)return;let t=e.replace(/\s+/g,` `).replace(/(\bauthorization\b\s*[:=]\s*)(?:"(?:\\.|[^"\\])*(?:"|$)|'(?:\\.|[^'\\])*(?:'|$)|[a-z]+\s+[^\s,;'"\\]+|[^\s,;'"\\]+)/gi,`$1[redacted]`).replace(/(\b[a-z][a-z0-9+.-]*:\/\/)[^/@\s]+@/gi,`$1[redacted]@`).replace(/(\b(?:[a-z0-9]+_)*(?:api[_ -]?key|access[_ -]?(?:token|key)|auth(?:orization)?|credential|password|secret|token)\b\s*[:=]\s*)(?:(?:Basic|Bearer)\s+)?(?:"(?:\\.|[^"\\])*(?:"|$)|'(?:\\.|[^'\\])*(?:'|$)|[^\s,;"']+)/gi,`$1[redacted]`).replace(/(--(?:api-key|access-token|password|secret|token)\s+)(?:"(?:\\.|[^"\\])*(?:"|$)|'(?:\\.|[^'\\])*(?:'|$)|\S+)/gi,`$1[redacted]`).replace(/(\b[a-z][a-z0-9+.-]*:\/\/)[^\s/@]+@/gi,`$1[redacted]@`).trim();if(t)return t.length>96?`${t.slice(0,93)}…`:t}function O(e,n){let i=t(e);if(!i)return;let a=b(i),o=a.toLowerCase(),f=d(i),T=s(i),E=c(T),D=x(i,n),O=r(f,`command`,`cmd`,`code`,`script`),j=k(f,O),M=C(a,O),N=[];E.durationMs!==void 0&&N.push(A(E.durationMs)),E.kernelRestarted&&N.push(`kernel restarted`);let P=p(f,E),F=o.includes(`todo`)||o.includes(`plan`)?g(f,E):[],I=o.includes(`search`)||o.includes(`web`)||o.includes(`source`)||o.includes(`citation`)?_(E):[],L=o.includes(`image`)||o.includes(`generat`)?v(E):void 0,R=y(f,E),z=u(E,T),B=!!z.trim(),V=typeof i.toolCallId==`string`&&i.toolCallId?i.toolCallId:`${a}-${JSON.stringify(f??{})}`,H;return F.length>0?H={kind:`todo`,title:o.includes(`plan`)?`Plan`:`Todo list`,items:F}:I.length>0?H={kind:`citations`,citations:I}:L?H={kind:`image`,url:L}:P&&(o.includes(`edit`)||o.includes(`write`)||o.includes(`patch`))?H={kind:`diff`,file:m(f,E),lines:h(P),copyText:P}:(O||B||R||N.length>0)&&(H={kind:`output`,content:z,language:S(a,E.structured),structured:E.structured,sections:l(E,T),sourceCode:O,sourceLanguage:M,sourceLabel:w(a,M)}),{id:V,name:a,lowerName:o,status:D,input:f,output:T,outputSummary:E,command:O,traceDescription:j,durationLabel:E.durationMs===void 0?void 0:A(E.durationMs),metadata:N,approval:R,detail:H}}function k(e,t){return D(r(e,`path`,`filePath`,`filename`,`file`)??t??r(e,`query`,`pattern`,`url`,`description`,`task`,`prompt`))}function A(e){if(e<1e3)return`${Math.round(e)} ms`;if(e<6e4)return`${(e/1e3).toFixed(+(e<1e4))} s`;let t=Math.floor(e/6e4),n=Math.round(e%6e4/1e3);return n===60?`${t+1} min`:n>0?`${t} min ${n} s`:`${t} min`}export{E as t};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/openui-renderer-DG-iML7M.js","assets/rolldown-runtime-hePW80VL.js","assets/react-Cvdyeg_0.js","assets/react-dom-B7th3XGm.js","assets/jsx-runtime-NZYk81nU.js","assets/with-selector-B_VDO56x.js","assets/utils-oBThwhjm.js","assets/card-Dj1SnGUU.js","assets/useButton-CvcmqA2s.js","assets/FloatingPortal-D8-EPDs2.js","assets/createBaseUIEventDetails-DIxvaz-Y.js","assets/select-DYh951qi.js","assets/useScrollLock-BcsteNzT.js","assets/useBaseUiId-lKfDDIcw.js","assets/check-BTwIaCtI.js","assets/createLucideIcon-CQY2ECfR.js","assets/chevron-down-Bse1ggZM.js","assets/input-CBoTMPC_.js","assets/useControlled-CkQSkSv1.js","assets/surfaces-BUjUJTyD.js","assets/open-panel-action-message-SdA1VU42.js","assets/chat-hpzV6IA6.js","assets/markdown-CvBfbPCn.js","assets/file-code-corner-BkDULqko.js","assets/button-CWYjn8Zk.js","assets/dist-BogNzeK9.js","assets/clsx-DB0hHKMi.js","assets/preload-helper-BLdHbfdN.js","assets/chunk-D32TOXHM-BM74MRmz.js","assets/space-separated-tokens-Ciu5hotc.js","assets/lib-CJ9xR_xY.js","assets/lib-BvGd2E-G.js","assets/code-block-pKKmFZ5w.js","assets/arrow-left-Bfkw0vUM.js","assets/createLucideIcon-CR62Fawq.js","assets/arrow-up-CzxAS3J9.js","assets/blocks-BmVH6RoL.js","assets/boxes-P3I8BDys.js","assets/calendar-days-CXqvsoor.js","assets/check-check-Btqs36TD.js","assets/check-IbKELFd2.js","assets/chevron-down-D5amraNy.js","assets/chevron-left-AyR1xUDb.js","assets/chevron-right-E-3OemuN.js","assets/chevron-up-DCTJ3XA-.js","assets/circle-alert-CSVDHZOw.js","assets/copy-CLOAxiYY.js","assets/ellipsis-dxrmXw37.js","assets/globe-eVRxbI0y.js","assets/image-1Usfao59.js","assets/info-DJfctP7D.js","assets/lightbulb-BwqxgRpD.js","assets/link-DreltefI.js","assets/list-VCLXYdos.js","assets/loader-circle-BAwTuoks.js","assets/menu-ykZJO64E.js","assets/message-square-CZNlkRgV.js","assets/panel-left-D8Dtrg9O.js","assets/rotate-ccw-3h4Oynp3.js","assets/search-yqNIhSMn.js","assets/share-2-2ysz1TZP.js","assets/square-code-BL_X7jLn.js","assets/square-pen-C4QgEtsH.js","assets/square-DS8IK_lK.js","assets/trash-2-BhumKxcC.js","assets/type-H-QEoR0y.js","assets/x-CXE81yPy.js","assets/character-entities-legacy-Wut6vMuj.js","assets/alert-CzWGeumf.js","assets/badge-CzQFgmVK.js","assets/useRender-CzJUrRlB.js","assets/dist-BJJVCio8.js","assets/provider-catalog-CLEDlH_v.js","assets/dialog-CK8dym6z.js","assets/DialogTitle-BlVq-tcv.js","assets/x-DEU6H3M-.js","assets/switch-BrxDfsX6.js","assets/safe-external-url-D3PJJIcM.js","assets/openui-utils-DawGoQNp.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./react-Cvdyeg_0.js";import{t as n}from"./react-dom-B7th3XGm.js";import{t as r}from"./jsx-runtime-NZYk81nU.js";import{n as i,r as a,t as o}from"./utils-oBThwhjm.js";import{l as s,o as c,r as l}from"./ease-nNJMFgD_.js";import{n as u,t as d}from"./use-reduced-motion-69Ji0Qlf.js";import{o as f}from"./useButton-CvcmqA2s.js";import{t as p}from"./createLucideIcon-CQY2ECfR.js";import{t as m}from"./chevron-right-BPCB1mOg.js";import{n as h,t as g}from"./file-text-cqOanUYv.js";import{t as _}from"./circle-check-DBhaebaM.js";import{l as v,n as y,r as b,s as x,t as S}from"./tool-action-icon-vTW_L1Fj.js";import{t as C}from"./loader-circle-BmKYM_C4.js";import{t as w}from"./x-DEU6H3M-.js";import{t as T}from"./dist-BogNzeK9.js";import{t as E}from"./preload-helper-BLdHbfdN.js";import{t as D}from"./useRender-CzJUrRlB.js";import{t as O}from"./openui-utils-DawGoQNp.js";import"./tokens-DinEQBG4.js";import{i as k}from"./workspace-path-nav-D-77sJ_A.js";import{t as A}from"./reasoning-line-B79r9oqP.js";import{t as j}from"./use-hover-capable-CLq8BADD.js";import{a as M,c as N,i as P,n as F,o as I,r as L,s as R,t as z}from"./trace-IsV5RRvM.js";import{t as B}from"./tool-output-normalizer-DDoLNo4P.js";var V={name:`chevron-left`,size:24,node:[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]};V.node;var ee=p(V),H={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`]};H.node;var te=p(H),ne={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`}]]};ne.node;var re=p(ne),ie={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`}]]};ie.node;var ae=p(ie),U=e(t(),1),W=r(),oe=(0,U.lazy)(()=>E(async()=>{let{GenerativeTextRenderer:e}=await import(`./openui-renderer-DG-iML7M.js`);return{GenerativeTextRenderer:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78])).then(({GenerativeTextRenderer:e})=>({default:e})));function se({className:e,content:t}){return(0,W.jsx)(`div`,{className:e?`${e} whitespace-pre-wrap`:`whitespace-pre-wrap`,children:t})}function ce(e){return(0,U.useMemo)(()=>O(e.content).some(e=>e.type===`openui`),[e.content])?(0,W.jsx)(U.Suspense,{fallback:(0,W.jsx)(se,{className:e.className,content:e.content}),children:(0,W.jsx)(oe,{...e})}):(0,W.jsx)(k,{className:e.className,content:e.content,isStreaming:e.isStreaming})}function le(e){return e.status===`running`||e.status===`recovering`?`streaming`:e.status===`error`||e.status===`failed`?`error`:`ready`}function ue(e,t){let n=new Map(e.map(e=>[e.id,e])),r=new Set,i=[],a=e=>{if(r.has(e))return;r.add(e);let o=n.get(e);o&&i.push(o);for(let n of t?.nodes[e]?.childrenIds??[])a(n)};for(let e of t?.rootChildrenIds??[])a(e);for(let t of e)a(t.id);return i}function de(e){return e===`done`?(0,W.jsx)(_,{className:`size-3.5 text-success`}):e===`error`||e===`failed`?(0,W.jsx)(h,{className:`size-3.5 text-destructive`}):e===`cancelled`?(0,W.jsx)(v,{className:`size-3.5 text-muted-foreground`}):e===`recovering`?(0,W.jsx)(ae,{className:`size-3.5 animate-spin text-warning`}):(0,W.jsx)(C,{className:`size-3.5 animate-spin text-primary`})}var G=(0,U.createContext)({from:`assistant`}),fe={type:`spring`,stiffness:480,damping:32,mass:.62},pe={duration:.12,ease:l,delay:.04};function me({from:e,animateIn:t=!1,children:n,className:r,initial:i,animate:a,transition:c,exit:l,style:u,...f}){let p=d()??!1,m=(0,U.useMemo)(()=>({from:e}),[e]);return(0,W.jsx)(G.Provider,{value:m,children:(0,W.jsx)(s.article,{"data-slot":`message`,"data-from":e,"aria-label":f[`aria-label`]??`${e} message`,initial:i??(t&&!p?{opacity:0,transform:`translateY(8px) scale(0.95)`}:!1),animate:a??(t&&!p?{opacity:1,transform:`translateY(0px) scale(1)`}:{opacity:1}),exit:l??(p?{opacity:0}:{opacity:0,transform:`translateY(-3px) scale(0.99)`}),transition:c??(p?{duration:.12}:fe),style:{transformOrigin:e===`user`?`100% 100%`:`0% 100%`,...u},className:o(`group/message flex w-full items-start gap-2`,e===`user`?`flex-row-reverse`:`flex-row`,r),...f,children:n})})}function he({className:e,...t}){let{from:n}=(0,U.useContext)(G);return(0,W.jsx)(`div`,{"data-slot":`message-content`,className:o(`flex min-w-0 flex-1 flex-col gap-1.5`,n===`user`?`items-end`:`items-start`,e),...t})}function ge({variant:e=`ghost`,align:t,className:n,children:r,initial:i,animate:a,exit:l,transition:u,layout:f,...p}){let m=d()??!1,{from:h}=(0,U.useContext)(G),g=t??(h===`user`?`end`:`start`);return(0,W.jsx)(s.div,{"data-slot":`message-bubble`,"data-align":g,"data-variant":e,layout:f,initial:i??!1,animate:a,exit:l??(m?{opacity:0}:{opacity:0,y:-3,scale:.99}),transition:u??(m?{duration:.12}:c),className:o(`group/bubble flex w-full flex-col`,g===`end`?`items-end`:`items-start`,n),...p,children:r})}function _e({className:e,children:t,ref:n,...r}){let i=d()??!1;return(0,W.jsx)(`div`,{ref:n,"data-slot":`message-bubble-content`,className:o(`relative z-0 w-full max-w-none min-w-9 text-sm leading-6 text-foreground`,e),...r,children:(0,W.jsx)(s.div,{initial:!1,animate:{opacity:1},transition:i?{duration:.12,ease:l}:pe,className:`relative`,children:t})})}var K=56,ve=88;function ye(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 be(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?ye(e,ve):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?ye(o,ve):void 0}}function xe({navigation:e,followThreshold:t,contentRef:n,viewportRef:r,reduce:i,smooth:a,scrollToEnd:o,setFollowing:s,markProgrammaticScroll:c}){let l=(0,U.useRef)(void 0),u=(0,U.useRef)(new WeakMap),d=(0,U.useRef)(0),f=(0,U.useRef)(new Map),[p,m]=(0,U.useState)([]),[h,g]=(0,U.useState)(``),[_,v]=(0,U.useState)(!1),y=(0,U.useCallback)(()=>{if(e!==`rail`)return;let n=r.current,i=[...f.current.entries()];if(!n||i.length===0)return;let a=n.getBoundingClientRect();if(n.scrollTop<=t){let e=i[0]?.[0]??``;g(t=>t===e?t:e);return}if(n.scrollHeight-n.scrollTop-n.clientHeight<=t){let e=i.at(-1)?.[0]??``;g(t=>t===e?t:e);return}let o=a.top+a.height/2,s=i[0]?.[0]??``,c=1/0;for(let[e,t]of i){let n=t.getBoundingClientRect(),r=Math.abs(n.top+n.height/2-o);r<c&&(c=r,s=e)}g(e=>e===s?e:s)},[t,e,r]),b=(0,U.useCallback)(()=>{if(e!==`rail`)return;let t=n.current,i=r.current;if(!t||!i)return;let a=Array.from(t.querySelectorAll(`[data-slot="message"]`)),o=new Map,s=a.map((e,t)=>{let n=u.current.get(e);n||(d.current+=1,n=`message-rail-${d.current}`,u.current.set(e,n)),o.set(n,e);let r=e.dataset.from??`conversation`,i=be(e,r===`user`?a.slice(t+1).find(e=>e.dataset.from===`assistant`):void 0);return{id:n,label:i.label,description:i.description,ariaLabel:`Go to ${r} message ${t+1} of ${a.length}`}});f.current=o,m(e=>e.length===s.length&&e.every((e,t)=>e.id===s[t]?.id&&e.label===s[t]?.label&&e.description===s[t]?.description&&e.ariaLabel===s[t]?.ariaLabel)?e:s),v(i.scrollHeight>i.clientHeight+1&&a.length>1)},[n,e,r]),x=(0,U.useCallback)(()=>{e===`rail`&&(l.current&&cancelAnimationFrame(l.current),l.current=requestAnimationFrame(()=>{b(),y()}))},[e,b,y]);return(0,U.useEffect)(()=>{if(e!==`rail`){f.current.clear(),m([]),v(!1);return}let t=n.current,i=r.current;if(!t||!i)return;x();let a=typeof MutationObserver>`u`?null:new MutationObserver(x);a?.observe(t,{childList:!0,characterData:!0,subtree:!0});let o=typeof ResizeObserver>`u`?null:new ResizeObserver(x);return o?.observe(t),o?.observe(i),()=>{a?.disconnect(),o?.disconnect()}},[n,e,x,r]),(0,U.useEffect)(()=>()=>{l.current&&cancelAnimationFrame(l.current)},[]),{activeRailId:h,railItems:p,railOverflowing:_,scheduleRailSync:x,scrollToRailItem:(0,U.useCallback)(e=>{let t=r.current,n=f.current.get(e.id);if(!t||!n)return;let l=p.at(-1)?.id===e.id;if(g(e.id),l){s(!0),o(i||!a?`auto`:`smooth`);return}s(!1),c(i||!a?`auto`:`smooth`);let u=t.getBoundingClientRect(),d=n.getBoundingClientRect(),m=t.scrollTop+d.top-u.top-(t.clientHeight-d.height)/2,h=i||!a?`auto`:`smooth`;typeof t.scrollTo==`function`?t.scrollTo({top:m,behavior:h}):t.scrollTop=m},[c,p,i,o,s,a,r])}}function Se({item:e}){return(0,W.jsxs)(`div`,{"data-slot":`preview-rail-card`,className:`rounded-2xl border border-border bg-card p-4 shadow-sm`,children:[(0,W.jsx)(`p`,{"data-slot":`preview-rail-title`,className:`font-medium text-card-foreground`,children:e.label}),e.description?(0,W.jsx)(`div`,{"data-slot":`preview-rail-description`,className:`mt-1 text-sm leading-6 text-muted-foreground`,children:e.description}):null]})}function Ce({items:e,label:t=`Section navigation`,orientation:n=`vertical`,activeId:r,defaultActiveId:i,onActiveChange:a,onItemSelect:f,renderPreview:p,showPreview:m=!0,previewSide:h=`after`,highlightActive:g=!1,itemSize:_=24,children:v,className:y,railClassName:b,previewContainerClassName:x,previewClassName:S}){let C=(0,U.useId)(),w=d(),T=j(),[E,D]=(0,U.useState)(i??e[0]?.id??``),[O,k]=(0,U.useState)(null),[A,M]=(0,U.useState)(null),N=r??E,P=e.some(e=>e.id===N)?N:e[0]?.id??``,F=O??A??``,I=F||(g?P:``),L=e.findIndex(e=>e.id===I),R=e.length?`repeat(${e.length}, ${_}px)`:void 0,z=n===`horizontal`,B=e=>{r===void 0&&D(e),a?.(e)};return(0,W.jsxs)(s.div,{layoutRoot:!0,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||M(null)},className:o(`isolate relative flex w-full overflow-visible`,z?`min-h-64 flex-col items-center justify-center`:`min-h-80`,y),children:[(0,W.jsx)(`nav`,{"aria-label":t,onPointerLeave:()=>k(null),style:z?{gridTemplateColumns:R}:{gridTemplateRows:R},className:o(`relative z-10 grid shrink-0`,z?`h-12 w-fit max-w-full self-center justify-center`:`w-12 content-center`,b),children:e.map((e,t)=>{let n=e.id===P,r=e.id===I,i=L<0?1/0:Math.abs(t-L),a=r?1:i===1?.68:i===2?.44:.25,l=(0,W.jsx)(W.Fragment,{children:(0,W.jsx)(s.span,{"data-slot":`preview-rail-tick`,"aria-hidden":`true`,animate:z?{scaleY:a}:{scaleX:a},transition:w?{duration:0}:c,className:o(`block bg-current`,z?`h-12 w-0.5 origin-bottom`:`h-0.5 w-12 origin-left`,r?`text-foreground`:void 0)})}),u=o(`relative flex text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background`,z?`h-12 w-6 items-end justify-center`:`h-6 w-12 items-center`),d=z?{width:_}:{height:_},p=()=>{T&&k(e.id)},m=t=>{t.matches(`:focus-visible`)&&M(e.id)},h=()=>{B(e.id),f?.(e)};return e.href?(0,W.jsx)(`a`,{"data-slot":`preview-rail-item`,href:e.href,target:e.target,rel:e.rel??(e.target===`_blank`?`noreferrer noopener`:void 0),"aria-label":e.ariaLabel??e.label,"aria-current":n?`page`:void 0,onPointerEnter:p,onMouseEnter:p,onPointerDown:()=>M(null),onFocus:e=>m(e.currentTarget),onClick:h,style:d,className:u,children:l},e.id):(0,W.jsx)(`button`,{"data-slot":`preview-rail-item`,type:`button`,"aria-label":e.ariaLabel??e.label,"aria-current":n?`location`:void 0,onPointerEnter:p,onMouseEnter:p,onPointerDown:()=>M(null),onFocus:e=>m(e.currentTarget),onClick:h,style:d,className:u,children:l},e.id)})}),m?(0,W.jsx)(`div`,{"aria-hidden":`true`,style:z?{gridTemplateColumns:R}:{gridTemplateRows:R},className:o(`pointer-events-none absolute z-50 grid`,z?`top-1/2 left-1/2 h-5 w-fit max-w-full -translate-x-1/2 -translate-y-1/2 justify-center`:h===`before`?`inset-y-0 right-16 left-4 content-center`:`inset-y-0 right-4 left-16 content-center`,x),children:e.map(e=>(0,W.jsx)(`div`,{style:z?{width:_}:{height:_},className:o(`relative flex items-center`,z?`justify-center`:void 0),children:(0,W.jsx)(u,{mode:`wait`,initial:!1,children:e.id===F?(0,W.jsx)(s.div,{initial:w?{opacity:0}:{opacity:0,y:4,filter:`blur(6px)`},animate:w?{opacity:1}:{opacity:1,y:0,filter:`blur(0px)`},exit:w?{opacity:0}:{opacity:0,y:-2,filter:`blur(4px)`,transition:{duration:.12,ease:l}},transition:{duration:w?0:.18,ease:l},className:o(z?`absolute bottom-12 left-1/2 w-72 -translate-x-1/2`:o(`w-full max-w-sm`,h===`before`&&`ml-auto`),S),children:(0,W.jsx)(s.div,{layoutId:`preview-rail-card-${C}`,transition:w?{duration:0}:c,children:p?p(e):(0,W.jsx)(Se,{item:e})})},e.id):null})},e.id))}):null,v?(0,W.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1`,children:v}):null]})}function we({followOutput:e=!0,followThreshold:t=56,smooth:n=!0,onFollowChange:r,label:i=`Conversation`,busy:a,navigation:s,navigationLabel:c=`Message navigation`,viewportClassName:l,contentClassName:u,railClassName:f,viewportRef:p,viewportProps:m,contentProps:h,className:g,children:_,...v}){let y=d()??!1,b=(0,U.useRef)(null),x=(0,U.useRef)(null),S=(0,U.useRef)(e),C=(0,U.useRef)(!1),w=(0,U.useRef)(void 0),T=(0,U.useRef)(void 0),{onScroll:E,onWheel:D,onTouchStart:O,onKeyDown:k,...A}=m??{},j=(0,U.useCallback)(e=>{b.current=e,typeof p==`function`?p(e):p&&(p.current=e)},[p]),M=(0,U.useCallback)(e=>{S.current!==e&&(S.current=e,r?.(e))},[r]),N=(0,U.useCallback)(e=>{C.current=!0,w.current&&window.clearTimeout(w.current),w.current=window.setTimeout(()=>{C.current=!1},e===`smooth`?320:0)},[]),P=(0,U.useCallback)(e=>{let t=b.current;t&&(N(e),typeof t.scrollTo==`function`?t.scrollTo({top:t.scrollHeight,behavior:e}):t.scrollTop=t.scrollHeight)},[N]),{activeRailId:F,railItems:I,railOverflowing:L,scheduleRailSync:R,scrollToRailItem:z}=xe({navigation:s,followThreshold:t,contentRef:x,viewportRef:b,reduce:y,smooth:n,scrollToEnd:P,setFollowing:M,markProgrammaticScroll:N}),B=(0,U.useEffectEvent)(R),V=(0,U.useEffectEvent)(P),ee=(0,U.useCallback)(()=>{let e=b.current;if(!e||C.current)return;let n=e.scrollHeight-e.scrollTop-e.clientHeight;M(n<=t),R()},[t,R,M]),H=(0,U.useCallback)(()=>{C.current=!1},[]);(0,U.useLayoutEffect)(()=>{if(S.current=e,e)return T.current=requestAnimationFrame(()=>V(`auto`)),()=>{T.current&&cancelAnimationFrame(T.current)}},[e]),(0,U.useEffect)(()=>{let t=x.current;if(!t||typeof ResizeObserver>`u`)return;let r=new ResizeObserver(()=>{B(),!(!e||!S.current)&&V(y||!n?`auto`:`smooth`)});return r.observe(t),()=>r.disconnect()},[e,y,n]),(0,U.useEffect)(()=>()=>{w.current&&window.clearTimeout(w.current),T.current&&cancelAnimationFrame(T.current)},[]);let te=(0,W.jsx)(`section`,{ref:j,"aria-label":i,...A,onScroll:e=>{ee(),E?.(e)},onWheel:e=>{H(),D?.(e)},onTouchStart:e=>{H(),O?.(e)},onKeyDown:e=>{[`ArrowUp`,`PageUp`,`Home`].includes(e.key)&&H(),k?.(e)},className:o(`h-full overflow-y-auto overscroll-contain outline-none [overflow-anchor:none] focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,s===`rail`?`[-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden`:`[scrollbar-gutter:stable]`,l,s===`rail`&&L&&`pr-10`),children:(0,W.jsx)(`div`,{ref:x,role:`log`,"aria-live":a?`off`:`polite`,"aria-relevant":`additions text`,"aria-busy":a,className:u,...h,children:_})});return(0,W.jsx)(`div`,{"data-slot":`message-scroller`,className:o(`min-h-0`,g),...v,children:s===`rail`?(0,W.jsx)(Ce,{items:L?I:[],label:c,activeId:F,onItemSelect:z,previewSide:`before`,highlightActive:!0,itemSize:14,className:`h-full min-h-0 overflow-hidden`,previewContainerClassName:`right-8 left-3`,previewClassName:`mr-1 w-64 max-w-full [&_[data-slot=preview-rail-card]]:h-20 [&_[data-slot=preview-rail-card]]:overflow-hidden [&_[data-slot=preview-rail-card]]:p-3 [&_[data-slot=preview-rail-title]]:line-clamp-1 [&_[data-slot=preview-rail-title]]:text-xs [&_[data-slot=preview-rail-title]]:leading-4 [&_[data-slot=preview-rail-description]]:line-clamp-2 [&_[data-slot=preview-rail-description]]:text-xs [&_[data-slot=preview-rail-description]]:leading-4`,railClassName:o(`absolute inset-y-3 right-1 w-7 content-center py-1 [&_[data-slot=preview-rail-item]]:w-7 [&_[data-slot=preview-rail-item]]:justify-end [&_[data-slot=preview-rail-tick]]:h-px [&_[data-slot=preview-rail-tick]]:w-4 [&_[data-slot=preview-rail-tick]]:origin-right`,L?`pointer-events-auto opacity-100`:`pointer-events-none opacity-0`,f),children:te}):te})}function J(e){return typeof e==`object`&&!!e}function Te(e){return J(e)&&e.type===`text`&&typeof e.text==`string`}function Ee(e){return J(e)&&e.type===`error`&&typeof e.message==`string`}function De(e){return J(e)&&e.type===`payload`&&typeof e.kind==`string`&&typeof e.title==`string`}function Y(e){if(!J(e))return!1;let t=e.type;return t===`dynamic-tool`||typeof t==`string`&&t.startsWith(`tool-`)}function Oe(e){if(typeof e==`string`)return e;if(e===void 0)return``;try{return JSON.stringify(e,null,2)??``}catch{return String(e)}}function ke({part:e}){let t=Oe(e.payload);return e.kind===`agent_message`?t||e.text?(0,W.jsxs)(`section`,{"data-payload-kind":e.kind,className:`w-full min-w-0 text-xs text-muted-foreground`,children:[e.text?(0,W.jsx)(`pre`,{className:`m-0 whitespace-pre-wrap break-words p-3 font-mono text-xs leading-5 text-foreground/80`,children:e.text}):null,t?(0,W.jsxs)(`details`,{children:[(0,W.jsx)(`summary`,{className:`w-fit cursor-pointer py-1 font-medium`,children:`Details`}),(0,W.jsx)(`pre`,{className:`m-0 max-h-60 overflow-auto whitespace-pre-wrap break-words border-l border-border pl-3 font-mono text-xs leading-5`,children:t})]}):null]}):null:(0,W.jsxs)(`section`,{"data-payload-kind":e.kind,className:`w-full min-w-0 overflow-hidden rounded-xl border border-border/60 bg-muted/40 text-sm`,children:[e.title===`Details`?null:(0,W.jsx)(`div`,{className:`border-b border-border/50 px-3 py-2 text-xs font-medium text-muted-foreground`,children:e.title}),e.text?(0,W.jsx)(`pre`,{className:`m-0 whitespace-pre-wrap break-words p-3 font-mono text-xs leading-5 text-foreground/80`,children:e.text}):null,t?(0,W.jsxs)(`details`,{className:`border-t border-border/50 px-3 py-2`,children:[(0,W.jsx)(`summary`,{className:`cursor-pointer text-xs font-medium text-muted-foreground`,children:`Payload`}),(0,W.jsx)(`pre`,{className:`m-0 mt-2 max-w-full whitespace-pre-wrap break-words font-mono text-xs leading-5 text-foreground/70`,children:t})]}):null]})}var Ae=[],je=(0,U.memo)(function({title:e=`Unable to complete request`,message:t,className:n}){return(0,W.jsx)(`div`,{className:o(`flex justify-start`,n),children:(0,W.jsxs)(`div`,{className:`rounded-lg border border-destructive/30 bg-destructive/10 px-4 py-2.5 text-sm text-foreground`,children:[(0,W.jsx)(`div`,{className:`font-medium text-foreground`,children:e}),(0,W.jsx)(`div`,{className:`mt-0.5 text-muted-foreground`,children:t})]})})}),Me=`tool-call:`,Ne=`unkeyed-tool:`;function Pe(e,t,n){return t.toolCallId?`${Me}${t.toolCallId}`:`${Ne}${e}:${t.type}:${n}`}function Fe(e,t){let{messageId:n,isLast:r,isStreaming:i,suppressTextWhenPlanWrite:a=!1,ToolRendererComponent:o,TextRendererComponent:s,toolRenderers:c,onOpenUIAction:l,onOpenUIArtifactReady:u,onOpenArtifact:d,artifactByToolCallId:f,onOpenToolArtifact:p}=t,m=[],h=[],g=a&&e.some(e=>Y(e)&&e.type===`tool-PlanWrite`),_=new Set(e.filter(e=>Y(e)&&(e.type===`tool-Task`||e.type===`tool-Agent`)&&typeof e.toolCallId==`string`).map(e=>e.toolCallId)),v=new Map,x=new Set,C=new Map,w=()=>{let e=h.splice(0).join(`
|
|
3
|
+
|
|
4
|
+
`);e&&m.push((0,W.jsx)(`div`,{className:`group/assistant-text text-body [&_a]:font-medium [&_a]:underline [&_a]:underline-offset-4 [&_ol]:my-2 [&_ol]:list-decimal [&_ol]:pl-5 [&_p+p]:mt-2 [&_ul]:my-2 [&_ul]:list-disc [&_ul]:pl-5`,children:(0,W.jsx)(s,{content:e,isStreaming:i,messageId:n,onOpenUIAction:l,onOpenUIArtifactReady:u,onOpenArtifact:d,className:`leading-relaxed [&_p]:leading-relaxed`})},`${n}-text-${m.length}`))};for(let t of e){if(!Y(t)||t.type===`tool-TaskOutput`||!t.toolCallId||!t.toolCallId.includes(`:`))continue;let e=t.toolCallId.split(`:`)[0];_.has(e)&&(v.has(e)||v.set(e,[]),v.get(e).push(t),x.add(t.toolCallId))}let T=0;for(;T<e.length;){let t=e[T];if(typeof t==`object`&&t&&`type`in t&&t.type===`reasoning`&&`text`in t&&typeof t.text==`string`&&`contentIndex`in t&&typeof t.contentIndex==`number`&&`state`in t&&typeof t.state==`string`){w(),m.push((0,W.jsx)(A,{text:t.text,streaming:r&&i&&t.state===`streaming`,durationMs:`durationMs`in t&&typeof t.durationMs==`number`?t.durationMs:void 0},`${n}-reasoning-${t.contentIndex}-${T}`)),T++;continue}if(Y(t)&&t.type===`tool-TaskOutput`){T++;continue}if(Te(t)){let e=t.text;e&&!g&&h.push(e),T++;continue}if(Ee(t)){w(),m.push((0,W.jsx)(je,{title:t.title,message:t.message},`${n}-error-${t.title}-${t.message}`)),T++;continue}if(De(t)){w(),m.push((0,W.jsx)(ke,{part:t},`${n}-payload-${T}`)),T++;continue}if(Y(t)){if(t.type===`tool-Question`){T++;continue}if(t.toolCallId&&x.has(t.toolCallId)){T++;continue}w();let e=typeof t.state==`string`?t.state:``,a=r&&i&&(e===`input-streaming`||e===`streaming`)?`streaming`:void 0,s=e===`input-available`||e===`pending`,l=B(t,a),u=b(t.type),d=y(u),h=l?.status===`error`,g=l?.status===`cancelled`,_=`Details for ${u}${t.toolCallId?` (${t.toolCallId})`:``}`,E=t.toolCallId?f?.get(t.toolCallId):void 0,D=t.toolCallId,O=(t.type===`tool-Task`||t.type===`tool-Agent`)&&D?v.get(D)??Ae:void 0,k=t.toolCallId?0:C.get(t.type)??0;t.toolCallId||C.set(t.type,k+1),m.push((0,W.jsxs)(z,{className:`my-1 flex-row items-center`,"data-testid":`assistant-tool-trace`,children:[(0,W.jsxs)(F,{defaultOpen:t.type===`tool-PlanWrite`&&!!t.input?.pendingDecision,children:[(0,W.jsx)(P,{"aria-label":_,children:(0,W.jsxs)(R,{status:h?`error`:a?`running`:s?`pending`:void 0,children:[(0,W.jsx)(I,{children:(0,W.jsx)(d,{})}),(0,W.jsx)(N,{children:u}),l?.traceDescription?(0,W.jsx)(M,{className:`max-w-48 truncate`,title:l.traceDescription,children:l.traceDescription}):null,(0,W.jsx)(M,{className:l?.outputSummary.isError?`text-destructive`:void 0,children:h?`failed`:a?`running`:s?`waiting`:g?`cancelled`:l?.outputSummary.isError?`reported error`:`done`}),l?.durationLabel?(0,W.jsx)(M,{children:l.durationLabel}):null]})}),(0,W.jsx)(L,{children:(0,W.jsx)(o,{part:t,nestedTools:O,chatStatus:a,toolRenderers:c,insideTrace:!0})})]}),E&&p?(0,W.jsx)(`button`,{type:`button`,className:`shrink-0 text-micro underline`,"aria-label":`Open ${S(E.title)} in ${E.kind===`ipython`?`REPL`:`artifacts`}`,onClick:()=>p(E.id,E.kind===`ipython`?`repl`:`artifacts`),children:`Open`}):null]},Pe(n,t,k))),T++;continue}T++}return w(),m}var Ie=e(n(),1);function Le({open:e,onClose:t,images:n,initialIndex:r=0}){let[i,a]=(0,U.useState)(r),s=n.length>1;(0,U.useEffect)(()=>{e&&a(r)},[e,r]);let c=(0,U.useCallback)(e=>{e?.stopPropagation(),a(e=>e>0?e-1:n.length-1)},[n.length]),l=(0,U.useCallback)(e=>{e?.stopPropagation(),a(e=>e<n.length-1?e+1:0)},[n.length]),u=(0,U.useEffectEvent)(e=>{switch(e.key){case`ArrowLeft`:e.preventDefault(),s&&c();break;case`ArrowRight`:e.preventDefault(),s&&l()}});(0,U.useEffect)(()=>{if(!e)return;let t=e=>u(e);return window.addEventListener(`keydown`,t,!0),()=>window.removeEventListener(`keydown`,t,!0)},[e]),(0,U.useEffect)(()=>{if(!e)return;let t=document.body.style.overflow;return document.body.style.overflow=`hidden`,()=>{document.body.style.overflow=t}},[e]);let d=(0,U.useRef)(null),f=(0,U.useEffectEvent)(e=>{d.current&&e.target===d.current&&t()});if((0,U.useEffect)(()=>{if(!e)return;let t=d.current;if(!t)return;t.open||t.showModal();let n=e=>f(e);return t.addEventListener(`click`,n),()=>{t.removeEventListener(`click`,n),t.open&&t.close()}},[e]),typeof document>`u`||!e)return null;let p=n[i]??n[0];return p?.url?(0,Ie.createPortal)((0,W.jsxs)(`dialog`,{ref:d,"aria-label":`Image viewer`,onClose:()=>t(),className:`fixed inset-0 z-50 m-0 flex h-full max-h-none w-full max-w-none items-center justify-center border-0 bg-black/90 p-0 backdrop:bg-transparent`,children:[(0,W.jsx)(`button`,{type:`button`,onClick:t,"aria-label":`Close fullscreen (Esc)`,className:`absolute top-4 right-4 z-10 inline-flex size-9 items-center justify-center rounded-full bg-black/50 text-white transition-colors hover:bg-black/70`,children:(0,W.jsx)(w,{className:`size-5`})}),s&&(0,W.jsx)(`button`,{type:`button`,onClick:c,"aria-label":`Previous image (←)`,className:`absolute top-1/2 left-4 z-10 inline-flex size-10 -translate-y-1/2 items-center justify-center rounded-full bg-black/50 text-white transition-colors hover:bg-black/70`,children:(0,W.jsx)(ee,{className:`size-6`})}),(0,W.jsx)(`img`,{src:p.url,alt:p.filename??`Image preview`,className:`max-h-[85vh] max-w-[90vw] object-contain select-none`,onClick:e=>e.stopPropagation(),draggable:!1}),s&&(0,W.jsx)(`button`,{type:`button`,onClick:l,"aria-label":`Next image (→)`,className:`absolute top-1/2 right-4 z-10 inline-flex size-10 -translate-y-1/2 items-center justify-center rounded-full bg-black/50 text-white transition-colors hover:bg-black/70`,children:(0,W.jsx)(m,{className:`size-6`})}),s&&(0,W.jsxs)(`div`,{className:`absolute bottom-6 left-1/2 flex -translate-x-1/2 flex-col items-center gap-3`,children:[(0,W.jsx)(`div`,{className:`flex gap-2`,children:n.map((e,t)=>(0,W.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),a(t)},"aria-label":`Go to image ${t+1}`,className:o(`size-2 rounded-full transition-[background-color,transform] duration-150`,t===i?`scale-125 bg-white`:`bg-white/40 hover:bg-white/60`)},e.url))}),(0,W.jsxs)(`span`,{className:`text-sm tabular-nums text-white/70`,children:[i+1,` / `,n.length]})]})]}),document.body):null}function Re(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`}function ze(e,t){if(t)return`image`;let n=e.split(`.`).pop()?.toLowerCase();return[`js`,`ts`,`jsx`,`tsx`,`py`,`rb`,`go`,`rs`,`java`,`kt`,`swift`,`c`,`cpp`,`h`,`hpp`,`cs`,`php`].includes(n||``)?`code`:[`json`,`yaml`,`yml`,`xml`].includes(n||``)?`data`:`text`}function Be(e){switch(e){case`image`:return(0,W.jsx)(x,{"aria-hidden":`true`,className:`size-4 text-muted-foreground`});case`code`:return(0,W.jsx)(re,{"aria-hidden":`true`,className:`size-4 text-muted-foreground`});case`data`:return(0,W.jsx)(te,{"aria-hidden":`true`,className:`size-4 text-muted-foreground`});default:return(0,W.jsx)(g,{"aria-hidden":`true`,className:`size-4 text-muted-foreground`})}}function Ve({id:e,filename:t,size:n,isImage:r,url:i,onRemove:a,className:s,display:c=`chip`,enableImagePreview:l=!0}){let[u,d]=(0,U.useState)(!1),[f,p]=(0,U.useState)(!1),m=ze(t,r),h=c===`image-only`&&r&&!!i,g=!!(l&&r&&i),_=e=>{e?.stopPropagation(),p(!0)},v=o(`shrink-0 overflow-hidden rounded-[calc(var(--chat-input-radius)-var(--chat-context-padding)-2px)]`,g&&`cursor-pointer focus-visible:ring-2 focus-visible:ring-ring`);return(0,W.jsxs)(`div`,{className:o(`group relative rounded-[calc(var(--chat-input-radius)-var(--chat-context-padding))] bg-muted/50`,h?`flex size-10 items-center justify-center`:`flex max-w-[min(12.5rem,100%)] min-w-0 items-center gap-2 py-1 ps-1 pe-2`,s),onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),children:[h?g?(0,W.jsx)(`button`,{type:`button`,className:o(v,`size-8 border-0 bg-transparent p-0`),onClick:_,"aria-label":`Preview ${t}`,children:(0,W.jsx)(`img`,{src:i,alt:``,className:`h-full w-full object-cover`})}):(0,W.jsx)(`div`,{className:o(v,`size-8`),children:(0,W.jsx)(`img`,{src:i,alt:t,className:`h-full w-full object-cover`})}):(0,W.jsxs)(W.Fragment,{children:[r&&i?g?(0,W.jsx)(`button`,{type:`button`,className:o(v,`w-8 self-stretch border-0 bg-transparent p-0`),onClick:_,"aria-label":`Preview ${t}`,children:(0,W.jsx)(`img`,{src:i,alt:``,className:`aspect-square h-full w-full object-cover`})}):(0,W.jsx)(`div`,{className:o(v,`w-8 self-stretch`),children:(0,W.jsx)(`img`,{src:i,alt:t,className:`aspect-square h-full w-full object-cover`})}):(0,W.jsx)(`div`,{className:`flex w-8 shrink-0 items-center justify-center self-stretch rounded-[calc(var(--chat-input-radius)-var(--chat-context-padding)-2px)] bg-muted`,children:Be(m)}),(0,W.jsxs)(`div`,{className:`flex min-w-0 flex-col`,children:[(0,W.jsx)(`span`,{className:`truncate text-sm font-medium text-foreground`,title:t,children:t}),n!==void 0&&(0,W.jsx)(`span`,{className:`text-micro text-muted-foreground`,children:Re(n)})]})]}),a&&(0,W.jsx)(`button`,{onClick:e=>{e.stopPropagation(),a()},"aria-label":`Remove ${t}`,className:o(`relative after:absolute after:top-1/2 after:left-1/2 after:size-10 after:-translate-x-1/2 after:-translate-y-1/2`,`absolute -top-1.5 -end-1.5 z-10 flex size-6 items-center justify-center rounded-full border border-border bg-background text-muted-foreground transition-[opacity,transform] duration-150 ease-out hover:text-foreground focus-visible:opacity-100 focus-visible:ring-2 focus-visible:ring-ring enabled:active:scale-[0.96] group-hover:opacity-100 group-focus-within:opacity-100 [@media(hover:none)]:opacity-100`,u?`opacity-100`:`opacity-0`),type:`button`,children:(0,W.jsx)(w,{"aria-hidden":`true`,className:`size-3`})}),g&&i&&(0,W.jsx)(Le,{open:f,onClose:()=>p(!1),images:[{id:e,url:i,filename:t}]})]})}var He=48,X=(e,t=0)=>{let n=new Int32Array(e.length);for(let r=0;r<e.length;r++)n[r]=e.charCodeAt(r)-He-t;return n},Z=e=>{let t=new Int32Array(e.length+1);for(let n=0;n<e.length;n++)t[n+1]=t[n]+e[n];return t},Q=e=>{let t=new Int32Array(e.length),n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r)-He;n+=i>>>1^-(i&1),t[r]=n}return t},Ue=384,We=[],$=Z(X(`E0500002005282000000002000150000020021820000011200000003022202000300004200120000200420001200021200301200010400162000010000220021010:2192001200220012000220012000200200200400010200040000000000400200108200110100000022010313000162002000020020012020080213000228200000000082000000000120002000120020020040101020300130001001010`)),Ge=Z(X(`:11111111211111119311546544411119731869:671397415686432441111111111161114151214313433415:78311132233313187211117221449443411141111151152226611131111112212518142224214215421421542142424242516171151615616347111111111197911327451111111111111111111113134714133513411111311111111111111111111112444411111342312715245411117:3`)),Ke=`@containerabcdefghinlmoprstunderlineviawzccentlignnimatespectuto-colsrowsaglorightnessckdrop-sisbcontrastfiltergrayscalehue-rotateinvertopacityslurrightnessaturateepia-coniclinearpositionradialsizeockurrderttom-belrstxyespacing-xyaretoursorlnt-umnsendspantartainentrasteividerop-shadowurationcorationlay-xyasendillexontromlter-featuresstretchapr-xyayscaleidow-colsrowsue-rotatedentlinesetvert-beringsxyeshadoweiadingftnest-clamp-imageabein-lrstxyskx--b-coniclpositionrsizet-x-y-fromto-fromto-inearfromto-fromto-adialfromto-fromtofromtofromtofromtoblockhinlinew-screenesblockhinlinewbjectpacityrutlinederigin-offsetbelrstxyesrspective-originaceholderioghtng-offsettateundedw-xyz-belrstlreseslr-endspantartaturatecepiahizekewpace-taleroll-xyz-barmpbelrstxyesbelrstxyes-thumbrackadowrink-xyxyartrokeabextora-shadowpckingnsformitionlate-xyz-offsetill-changeoom`,qe=(()=>{let e=$.length-1,t=new Int32Array(e);for(let n=e-1;n>=0;n--){let e=1,r=n+1;for(let i=$[n];i<$[n+1];i++)e+=t[r],r+=t[r];t[n]=e}let n=new Int32Array($[e]),r=0;for(let i=0;i<e;i++){let e=i+1;for(let a=$[i];a<$[i+1];a++)n[r++]=e,e+=t[e]}return n})(),Je=X(`02000000000000900<=0?000B000F00F00ŏI0J0LNPRTVX0000]_a00000000000000000000000rst0000000zŏ00000000000
ŏ0000000ŏ00000000000000000000000000000000000000000000000000000000000000Ë000000000000000000000Þ000000000000000000ð0000000ø0ùúûüýþÿĀāĂ㥹Ć000000000000000000000000000000000000000000ħ0ĨĪ00000000000000000000ļĽ00000Ŭ000000`,1),Ye=Z(X(`123333359346463635126536711576`)),Xe=X(`93203242332583253248325D>E?F@03263243255B:032523853:0325B:8GA032542H<C=12727B:0328432553;D>E?3257D>032585:0325B:;0328B:032`),Ze=X(`012113445661666666789111:5;;;;;;;;444;;;:62999<1161=62>>?61:21@ABCD4446996:64E:::;:?::64:F114GHHIHHHHIHH1HH1HH1HHHHHH::EEJ4444::EE4444441691;644444114244444:;K6666555555555555555999666664444444444444444444444226?6:66644L9M?D:111::::6DE199`),Qe=Q(`020200202020020020020020020020200200200200200200200002020202001003040106000200200200200200200200200200200200200200200200200200200200200200200200200200200200020020020020020020002020200202002002002002002002002002002020002002020020200220200200200200200200200200200200020020020000200020002000200200200020020020002000200200200020020202002020202000200200020022000200200020020002002000200220002002000200W0Z00020020002002020002002000200g0j0002002000200200020020002002000200200020020002000200002000002002002002002000200020000200002002002002002002002020020020200200200200200200200200202020020020020020020020020002002002020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020002002002002002002000200200200200200200200200200020202020002000200020002002002002000020200200`),$e=(()=>{let e=new Int32Array(319).fill(-1),t=Q(`02422242:222222242224222242442222222422222244442242226224222426222422442462222422622222222626222462242622422622422424242422222222422222222242422222222222222222622442224222222222222224424442262222222222222222222226224222424242422224422422422222`),n=Q(`02222222222222222222202222222222222222222222221422222222222222222222222222222222222Y\\222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221422222222222222222222222222222222222222Ŀł222222222222222222`);for(let r=0;r<t.length;r++)e[t[r]]=n[r];return e})(),et=`container |break-after- all auto avoid avoid-page column left page right|break-before- all auto avoid avoid-page column left page right|break-inside-a uto void void-column void-page|box-decoration- clone slice|box- border content| contents flow-root hidden table table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group| not-sr-only sr-only|float- end left none right start|clear- both end left none right start|isolat e ion-auto|overflow- auto clip hidden scroll visible|overflow-x- auto clip hidden scroll visible|overflow-y- auto clip hidden scroll visible|overscroll- auto contain none|overscroll-x- auto contain none|overscroll-y- auto contain none| absolute fixed relative static sticky| collapse invisible visible|justify- around baseline between center center-safe end end-safe evenly normal start stretch|justify-items- center center-safe end end-safe normal start stretch|justify-self- auto center center-safe end end-safe start stretch|items- baseline baseline-last center center-safe end end-safe start stretch|self- auto baseline baseline-last center center-safe end end-safe start stretch|place-content- around baseline between center center-safe end end-safe evenly start stretch|place-items- baseline center center-safe end end-safe start stretch|place-self- auto center center-safe end end-safe start stretch| antialiased subpixel-antialiased| italic not-italic|normal-nums |ordinal |slashed-zero | lining-nums oldstyle-nums| proportional-nums tabular-nums| diagonal-fractions stacked-fractions| no-underline overline| capitalize lowercase normal-case uppercase|truncate |whitespace- break-spaces normal nowrap pre pre-line pre-wrap|break- all keep normal words|wrap- anywhere break-word normal|hyphens- auto manual none|mix-blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay plus-darker plus-lighter saturation screen soft-light|table- auto fixed|caption- bottom top|backface- hidden visible|appearance- auto none|scheme- dark light light-dark normal only-dark only-light|field-sizing- content fixed|pointer-events- auto none|resize -none -x -y|snap- align-none center end start|snap- always normal|snap- both none x y|snap- mandatory proximity|touch- auto manipulation none|touch-pan- left right x|touch-pan- down up y|touch-pinch-zoom |select- all auto none text|forced-color-adjust- auto none| normal size| baseline bottom middle sub super text-bottom text-top top| bounce none ping pulse spin| auto square video| auto fr max min px|none | auto full px| fixed local scroll|clip- border content padding text|origin- border content padding| bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| no-repeat repeat repeat-round repeat-space repeat-x repeat-y| auto contain cover| gradient-to-b gradient-to-bl gradient-to-br gradient-to-l gradient-to-r gradient-to-t gradient-to-tl gradient-to-tr none|blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay saturation screen soft-light|to- b bl br l r t tl tr| auto dvh fit full lh lvh max min px screen svh| dashed dotted double hidden none solid| collapse separate|px |auto |full | content none strict| inline-size size|layout |paint |style | around baseline between center center-safe end end-safe evenly normal start stretch| alias all-scroll auto cell col-resize context-menu copy crosshair default e-resize ew-resize grab grabbing help move n-resize ne-resize nesw-resize no-drop none not-allowed ns-resize nw-resize nwse-resize pointer progress row-resize s-resize se-resize sw-resize text vertical-text w-resize wait zoom-in zoom-out| dashed dotted double solid wavy| auto from-font|reverse |initial | in in-out initial linear out| col col-reverse row row-reverse| nowrap wrap wrap-reverse| auto initial none| black bold extrabold extralight light medium normal semibold thin| condensed expanded extra-condensed extra-expanded normal semi-condensed semi-expanded ultra-condensed ultra-expanded|flow- col col-dense dense row row-dense| none subgrid| auto dvh dvw fit full lh lvh lvw max min px screen svh svw| block flex grid table| auto dvw fit full lvw max min px screen svw| loose none normal px relaxed snug tight|through |item | inside outside| decimal disc none| auto px| clip-border clip-content clip-fill clip-padding clip-stroke clip-view no-clip| add exclude intersect subtract| alpha luminance match|origin- border content fill padding stroke view|type- alpha luminance| circle ellipse| closest-corner closest-side farthest-corner farthest-side|at- bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| dvh fit full lh lvh max min none px screen svh| auto dvh dvw fit full lh lvh lvw max min none px screen svh svw| dvw fit full lvw max min none px screen svw| auto dvh dvw fit full lvh lvw max min none prose px svh svw| auto dvh dvw fit full lvh lvw max min none px screen svh svw| contain cover fill none scale-down| first last none| distant dramatic midrange near none normal|inset | full none|3d | auto smooth|gutter- auto both stable| auto none thin| inner none| auto dvh dvw fit full lvh lvw max min px svh svw|base | center end justify left right start| clip ellipsis| balance nowrap pretty wrap| normal tight tighter wide wider widest| cpu gpu none| 3d flat| all colors none opacity shadow transform| discrete normal| full px| auto dvh dvw fit full lvh lvw max min px screen svh svw| auto contents scroll transform`.split(`|`).map(e=>{let t=e.split(` `),n=t.shift();for(let e=0;e<t.length;e++)t[e]=n+t[e];return t}),tt=Q(`0000000000000000000000000000000000000000000000000000000000000262242:6@200000006:240B428:4422400002046044222426220026642642462026224222824220022400000000\\00N222422242222222224062242222222422226264222422222222222222442804222422222222222222222222220<4<0204260002444020204224422`),nt=Q(`ɠ222222222222222222222222222222222222222222222222222222222222˕4222226>ʶ22ʷʺʷ2ʸʷ42ʴ2ʓ22>621422ɶ222ɹɼɷɺɷɺ22ɱ42222ɨ2ɧ26622ɘɓ244ƸƵ222]d24242ǖǓƚÄȫ2263ȨȥȨ2222222ǣ222222222222222222ǂƽ2ƾƵ2222222422222ƜƑ22222222222222222222144Ŧţ22Ţş222222222222222222222ĸ2ı68ĦģĦɡŰ4Ġ«®ĝ822ĔđĔ2ē2222622`),rt=Q(`02222222222222222222222222222222222222222222222222222222222222222202022222222222EH2200IL021042222Y\\222IL0cf2e10j2222U00X202[^2y0000120|{~22
:22|22222222222G000qOVI00000}2>40000B00000I¨©000¬00000000000000021M®00°000000000000000000000222HGHa1º222¿2À2222ÉÌ000°2±`),it=new Int32Array(995),at=new Int32Array(995),ot=new Int32Array(995),st=``,ct=new Int32Array(1038);{let e=new Map,t=0,n=0;for(let r=0;r<tt.length;r++)for(let i of et[rt[r]]){let a=e.get(i);a===void 0&&(a=t++,e.set(i,a),ct[a*2]=st.length,ct[a*2+1]=i.length,st+=i),it[n]=tt[r],at[n]=nt[r],ot[n]=a,n++}}var lt=Q(`0b2N:222@R>F@286¦2@H2D266226FB22B2>BD\\6N22222Z222D222p`),ut=Z(X(`1::24444432:442:44:44>222222:44:4421322511111311111114`)),dt=Q(`24A;33N=C@H4A;33N=C@<27;83:;8393NQ:3NQʰ222ˉºŴŽ2R2=18cƴÅŇ=cĞÛC1ƈǝȈ:ħ25=11D3A@4=<1;1DEr25;11B3?<6;:371BCn9@7=<8192>2E121@9@EHE@9>2T25511<398454131<=V25511<398454131<=ƧNž2Đå242L222290000f22500ɛ000ǘ222`),ft=X(`ij`),pt=X(``),mt=X(`1`),ht=i({GROUP_COUNT:Ue,customValidatorNames:We,edgeStart:$,labelStart:Ge,labelText:Ke,edgeTarget:qe,nodeGroup:Je,nodeVlist:$e,vlistPat:Ye,vlistOps:Xe,vlistRef:Ze,vlistGroup:Qe,litAnchor:it,litGroup:at,litPool:ot,poolOffsets:ct,poolText:st,adjGid:lt,adjStart:ut,adjTgt:dt,patGid:ft,patTgt:pt,postfixLookupGroups:mt,orderSensitiveModifiers:`* ** after backdrop before details-content file first-letter first-line marker placeholder selection`}),gt=a(ht.mergeString,ht);ht.merge;var _t=T(`group/bubble relative flex w-fit max-w-[80%] min-w-0 flex-col gap-1 group-data-[align=end]/message:self-end data-[align=end]:self-end data-[variant=ghost]:max-w-full`,{variants:{variant:{default:`*:data-[slot=bubble-content]:bg-primary *:data-[slot=bubble-content]:text-primary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-primary/80`,secondary:`*:data-[slot=bubble-content]:bg-secondary *:data-[slot=bubble-content]:text-secondary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)]`,muted:`*:data-[slot=bubble-content]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--muted),var(--foreground)_5%)]`,tinted:`*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.93_calc(c*0.4)_h)] *:data-[slot=bubble-content]:text-foreground dark:*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.3_calc(c*0.4)_h)] [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.88_calc(c*0.5)_h)] dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.35_calc(c*0.5)_h)]`,outline:`*:data-[slot=bubble-content]:border-border *:data-[slot=bubble-content]:bg-background [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-input/30`,ghost:`border-none *:data-[slot=bubble-content]:rounded-none *:data-[slot=bubble-content]:bg-transparent *:data-[slot=bubble-content]:p-0 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted/50`,destructive:`*:data-[slot=bubble-content]:bg-destructive/10 *:data-[slot=bubble-content]:text-destructive dark:*:data-[slot=bubble-content]:bg-destructive/20 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/20 dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/30`}},defaultVariants:{variant:`default`}});function vt({variant:e=`default`,align:t=`start`,className:n,...r}){return(0,W.jsx)(`div`,{"data-slot":`bubble`,"data-variant":e,"data-align":t,className:gt(_t({variant:e}),n),...r})}function yt({className:e,render:t,...n}){return D({defaultTagName:`div`,props:f({className:gt(`w-fit max-w-full min-w-0 overflow-hidden rounded-xl border border-transparent px-3 py-2 text-sm leading-relaxed wrap-break-word group-data-[align=end]/bubble:self-end [button]:text-left [button,a]:transition-colors [button,a]:outline-none [button,a]:focus-visible:border-ring [button,a]:focus-visible:ring-3 [button,a]:focus-visible:ring-ring/50`,e)},n),render:t,state:{slot:`bubble-content`}})}T(`absolute z-10 flex w-fit shrink-0 items-center justify-center gap-1 rounded-full bg-muted px-1.5 py-0.5 text-sm ring-3 ring-card has-[button]:p-0`,{variants:{side:{top:`top-0 -translate-y-3/4`,bottom:`bottom-0 translate-y-3/4`},align:{start:`left-3`,end:`right-3`}},defaultVariants:{side:`bottom`,align:`end`}});function bt(e){return typeof e==`object`&&!!e}function xt(e){if(!bt(e))return null;let t=e.type;if(typeof t!=`string`)return null;if(t===`image`){let t=e;return t.url??t.image??null}if(t===`data-image`)return e.data?.url??null;if(t===`file`){let t=e;if(t.mimeType?.startsWith(`image/`)){if(t.url)return t.url;if(t.data)return`data:${t.mimeType};base64,${t.data}`}}return null}function St(e){if(!bt(e)||e.type!==`file`)return null;let t=e,n=t.filename||t.name||t.fileName||`Attachment`;return t.mimeType?.startsWith(`image/`)??!1?null:{filename:n,size:t.size}}var Ct=(0,U.memo)(function({message:e,className:t,enableImagePreview:n=!0}){let[r,i]=(0,U.useState)(null),a=(e.parts?.filter(Te)??[]).map(e=>e.text).join(``),s=[],c=[];for(let t of e.parts??[]){let e=xt(t);e&&s.push(e);let n=St(t);n&&c.push(n)}if(bt(e)&&Array.isArray(e.experimental_attachments))for(let t of e.experimental_attachments)t.contentType?.startsWith(`image/`)&&t.url&&s.push(t.url);if(!a&&s.length===0&&c.length===0)return null;let l=s.map((t,n)=>({id:`${e.id}-img-${n}`,url:t,filename:`image-${n+1}`}));return(0,W.jsxs)(`div`,{className:o(`flex flex-col items-end gap-1`,t),children:[s.length>0&&s.map((e,t)=>(0,W.jsx)(`div`,{className:o(`max-w-[200px] rounded-chat-message bg-foreground/4 p-1.5`,n&&`cursor-pointer`),onClick:n?()=>i(t):void 0,role:n?`button`:void 0,tabIndex:n?0:void 0,onKeyDown:n?e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),i(t))}:void 0,children:(0,W.jsx)(`img`,{src:e,alt:`attachment`,width:184,height:120,className:`block max-h-[120px] max-w-[184px] rounded-chat-message-inner object-cover`})},e)),n&&l.length>0&&(0,W.jsx)(Le,{open:r!==null,onClose:()=>i(null),images:l,initialIndex:r??0}),c.length>0&&(0,W.jsx)(`div`,{className:`flex flex-col items-end gap-2`,children:c.map((e,t)=>(0,W.jsx)(Ve,{id:`${e.filename}-${t}`,filename:e.filename,size:e.size},`${e.filename}-${e.size}`))}),a&&(0,W.jsx)(vt,{align:`end`,variant:`muted`,className:`max-w-[85%]`,children:(0,W.jsx)(yt,{className:`rounded-chat-message px-3.5 py-1.5 whitespace-pre-wrap text-pretty`,children:a})})]})});function wt(e,t,n){if(n===0)return 0;let r=0,i=n;for(;r<i;){let n=Math.floor((r+i)/2);e[n]<=t?r=n+1:i=n}return Math.max(0,Math.min(n-1,r-1))}function Tt(e,t,n,r){let i=[0];for(let[a,o]of e.entries())i.push(i[i.length-1]+(t.get(o)??n)+(a<e.length-1?r:0));return i}function Et({estimateSize:e,getItemKey:t,itemGap:n=0,items:r,overscan:i=1.5,renderItem:a,viewportRef:o}){let s=(0,U.useMemo)(()=>r.map((e,n)=>t(e,n)),[t,r]),c=r.length>=16,[l,u]=(0,U.useState)(()=>new Map),[d,f]=(0,U.useState)({height:0,scrollTop:0}),p=(0,U.useRef)(s),m=(0,U.useRef)(l),h=(0,U.useRef)(e),g=(0,U.useRef)(n),_=(0,U.useRef)([0]),v=(0,U.useRef)(0),y=(0,U.useRef)(new Map),b=(0,U.useRef)(new WeakMap),x=(0,U.useRef)(null),S=(0,U.useRef)(null),C=(0,U.useCallback)(()=>{let e=o.current;if(!e)return;let t={height:e.clientHeight,scrollTop:e.scrollTop};f(e=>e.height===t.height&&e.scrollTop===t.scrollTop?e:t)},[o]),w=(0,U.useCallback)(()=>{S.current??=window.requestAnimationFrame(()=>{S.current=null,C()})},[C]),T=(0,U.useCallback)((e,t)=>{let n=y.current.get(e);n&&n!==t&&(x.current?.unobserve(n),y.current.delete(e)),t&&(y.current.set(e,t),b.current.set(t,e),x.current?.observe(t))},[]),E=(0,U.useMemo)(()=>Tt(s,l,e,n),[e,n,s,l]);(0,U.useLayoutEffect)(()=>{C()},[r.length,C]),(0,U.useLayoutEffect)(()=>{p.current=s,m.current=l,h.current=e,g.current=n,_.current=E},[e,n,s,l,E]),(0,U.useEffect)(()=>{let e=o.current;if(!e)return;e.addEventListener(`scroll`,w,{passive:!0}),window.addEventListener(`resize`,w),C();let t;return typeof ResizeObserver<`u`&&(t=new ResizeObserver(w),t.observe(e)),()=>{e.removeEventListener(`scroll`,w),window.removeEventListener(`resize`,w),t?.disconnect(),S.current!=null&&(window.cancelAnimationFrame(S.current),S.current=null)}},[w,C,o]);let D=(0,U.useCallback)(e=>{let t=m.current,n=t;for(let r of e){let e=b.current.get(r.target),i=r.contentRect.height;!e||i<=0||t.get(e)===i||(n===t&&(n=new Map(t)),n.set(e,i))}if(n===t)return;let r=o.current,i=p.current,a=Tt(i,n,h.current,g.current);if(r&&i.length>0){let e=_.current,t=wt(e,Math.max(0,r.scrollTop),i.length),n=i[t];if(n&&t>0){let r=(a[i.indexOf(n)]??0)-(e[t]??0);r!==0&&(v.current+=r)}}m.current=n,_.current=a,u(n)},[o]);if((0,U.useLayoutEffect)(()=>{if(!c||typeof ResizeObserver>`u`)return;let e=new ResizeObserver(e=>D(e));x.current=e;for(let t of y.current.values())e.observe(t);return()=>{e.disconnect(),x.current===e&&(x.current=null)}},[c,D]),(0,U.useEffect)(()=>{let e=m.current;if(e.size===0)return;let t=new Set(s),n=new Map([...e].filter(([e])=>t.has(e)));n.size!==e.size&&(m.current=n,u(n))},[s]),(0,U.useLayoutEffect)(()=>{let e=v.current,t=o.current;!t||e===0||(t.scrollTop+=e,v.current=0,C())},[l,C,o]),!c)return(0,W.jsx)(W.Fragment,{children:r.map((e,t)=>(0,W.jsx)(U.Fragment,{children:a(e,t)},s[t]))});let O=E[E.length-1]??0,k=Math.max(e,d.height*i),A=wt(E,Math.max(0,d.scrollTop-k),r.length),j=Math.min(r.length-1,wt(E,d.scrollTop+d.height+k,r.length)+1);return(0,W.jsx)(`div`,{"data-rendered-turn-count":j-A+1,"data-total-turn-count":r.length,"data-virtualized-transcript":`true`,style:{height:O,position:`relative`,width:`100%`},children:r.slice(A,j+1).map((e,t)=>{let n=A+t,r=s[n];return(0,W.jsx)(`div`,{ref:e=>T(r,e),"data-virtualized-turn-index":n,style:{left:0,position:`absolute`,right:0,top:E[n]},children:a(e,n)},r)})})}function Dt(e){return typeof e==`object`&&!!e}function Ot(e){if(typeof e!=`string`)return e;let t=e.trim();if(!t)return e;try{let n=JSON.parse(t);return Dt(n)||Array.isArray(n)?n:e}catch{return e}}function kt(e){if(!Dt(e)||typeof e.type!=`string`||!e.type.startsWith(`tool-`))return e;let t=Ot(e.input),n=Ot(e.output),r=Ot(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 At(e){let t=!1,n=e.map(e=>{let n=kt(e);return n!==e&&(t=!0),n});return t?n:e}export{Fe as a,ge as c,ue as d,de as f,ee as h,Ve as i,_e as l,ce as m,Et as n,we as o,le as p,Ct as r,me as s,At as t,he as u};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dist-CprW0Qol.js","assets/rolldown-runtime-hePW80VL.js","assets/preload-helper-BLdHbfdN.js","assets/space-separated-tokens-Ciu5hotc.js","assets/character-entities-legacy-Wut6vMuj.js","assets/lib-BvGd2E-G.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./react-Cvdyeg_0.js";import{t as n}from"./jsx-runtime-NZYk81nU.js";import{t as r}from"./utils-oBThwhjm.js";import{c as i,i as a,l as o,r as s,s as c}from"./ease-nNJMFgD_.js";import{n as l,t as u}from"./use-reduced-motion-69Ji0Qlf.js";import{t as d}from"./createLucideIcon-CQY2ECfR.js";import{t as f}from"./check-BTwIaCtI.js";import{t as p}from"./chevron-down-Bse1ggZM.js";import{t as m}from"./circle-check-DBhaebaM.js";import{
|
|
3
|
-
`),
|
|
2
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./react-Cvdyeg_0.js";import{t as n}from"./jsx-runtime-NZYk81nU.js";import{t as r}from"./utils-oBThwhjm.js";import{c as i,i as a,l as o,r as s,s as c}from"./ease-nNJMFgD_.js";import{n as l,t as u}from"./use-reduced-motion-69Ji0Qlf.js";import{t as d}from"./createLucideIcon-CQY2ECfR.js";import{t as f}from"./check-BTwIaCtI.js";import{t as p}from"./chevron-down-Bse1ggZM.js";import{t as m}from"./circle-check-DBhaebaM.js";import{i as h,l as g}from"./tool-action-icon-vTW_L1Fj.js";import{n as _,t as v}from"./file-code-corner-BkDULqko.js";import{t as y}from"./loader-circle-BmKYM_C4.js";import{t as b}from"./square-terminal-BLq2bQVF.js";import{t as x}from"./preload-helper-BLdHbfdN.js";import{a as S,i as C,n as w,o as T,r as E,t as D}from"./code-block-pKKmFZ5w.js";var O={name:`ban`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M4.929 4.929 19.07 19.071`,key:`196cmz`}]]};O.node;var k=d(O),A={name:`braces`,size:24,node:[[`path`,{d:`M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1`,key:`ezmyqa`}],[`path`,{d:`M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1`,key:`e1hn23`}]],aliases:[`curly-braces`]};A.node;var j=d(A),M=e(t(),1),N=n(),P=`github-light-high-contrast`,F=`github-dark-high-contrast`,I=null,L=new Map,R=500;function z(e,t){if(L.size>=R){let e=L.keys().next().value;e!==void 0&&L.delete(e)}L.set(e,t)}var B=()=>x(()=>import(`./dist-CprW0Qol.js`).then(e=>e.t),__vite__mapDeps([0,1,2,3,4,5]));function V(){return I||=B().then(({createHighlighter:e})=>e({themes:[P,F],langs:[`bash`,`diff`,`json`,`python`,`tsx`,`typescript`]})),I}function H(e,t){return`${t}\u0000${e}`}function U(e,t){let n=H(e,t),r=L.get(n),[i,a]=(0,M.useState)(r?{key:n,code:e,language:t,lines:r}:null);return(0,M.useEffect)(()=>{let r=L.get(n);if(r){a({key:n,code:e,language:t,lines:r});return}let i=!1;return V().then(r=>{if(i)return;let o=r.codeToTokensWithThemes(e,{lang:t,themes:{light:P,dark:F}}).map(e=>e.map(e=>({content:e.content,offset:e.offset,light:e.variants.light?.color,dark:e.variants.dark?.color})));z(n,o),a({key:n,code:e,language:t,lines:o})}),()=>{i=!0}},[e,n,t]),i?.key===n||i?.language===t&&e.startsWith(i.code)?i.lines:null}function W({code:e,tokens:t,suffix:n,className:r}){return(0,N.jsxs)(`span`,{className:r,children:[t?t.map(e=>(0,N.jsx)(`span`,{style:{"--agent-code-light":e.light??`currentColor`,"--agent-code-dark":e.dark??e.light??`currentColor`},className:`text-[var(--agent-code-light)] dark:text-[var(--agent-code-dark)]`,children:e.content},`${e.offset}-${e.content}`)):e,n]})}function G({open:e,openHeight:t=`auto`,className:n,style:i,transition:a,...c}){let l=u()??!1;return(0,N.jsx)(o.div,{...c,"aria-hidden":!e,inert:!e,initial:!1,animate:l?{opacity:+!!e}:{opacity:+!!e,clipPath:e?`inset(0 0 0% 0)`:`inset(0 0 100% 0)`,y:e?0:-4},transition:a??{duration:l?0:e?.22:.14,ease:s},className:r(`overflow-hidden`,n),style:{...i,height:e?t:0,pointerEvents:e?void 0:`none`,transformOrigin:`top`}})}function K({value:e,type:t}){return e?(0,N.jsxs)(`span`,{className:r(`font-mono text-xs tabular-nums`,t===`added`?`text-product-diff-added`:`text-product-diff-removed`),children:[t===`added`?`+`:`−`,e]}):null}function q({file:e,lines:t,status:n=`streaming`,open:a,defaultOpen:s=!0,onOpenChange:l,collapseOnComplete:d=!0,maxHeight:m=220,language:h=`typescript`,copyText:b,onCopy:x,className:S}){let C=u()??!1,w=(0,M.useId)(),T=`${w}-trigger`,E=`${w}-content`,D=(0,M.useRef)(null),O=(0,M.useRef)(n),A=(0,M.useRef)(void 0),[j,P]=(0,M.useState)(!1),[F,I]=(0,M.useState)(s),L=a??F,R=n===`streaming`,z=t.filter(e=>e.type===`added`).length,B=t.filter(e=>e.type===`removed`).length,V=!!(b||x),H=U(t.map(e=>e.content).join(`
|
|
3
|
+
`),h),q=(0,M.useCallback)(e=>{a===void 0&&I(e),l?.(e)},[l,a]);(0,M.useEffect)(()=>{O.current!==`streaming`&&n===`streaming`&&q(!0),O.current===`streaming`&&n!==`streaming`&&d&&q(!1),O.current=n},[d,q,n]),(0,M.useEffect)(()=>()=>{A.current&&window.clearTimeout(A.current)},[]),(0,M.useLayoutEffect)(()=>{let e=D.current;if(!e||!L||!R)return;let t=requestAnimationFrame(()=>{e.scrollHeight<=e.clientHeight||(typeof e.scrollTo==`function`?e.scrollTo({top:e.scrollHeight,behavior:C?`auto`:`smooth`}):e.scrollTop=e.scrollHeight)});return()=>cancelAnimationFrame(t)});let J=(0,M.useCallback)(async()=>{x?await x():b&&await navigator.clipboard?.writeText(b),P(!0),A.current&&window.clearTimeout(A.current),A.current=window.setTimeout(()=>P(!1),1600)},[b,x]);return(0,N.jsxs)(`div`,{"data-state":n,"aria-busy":R,className:r(`w-full text-sm`,S),children:[(0,N.jsxs)(`button`,{id:T,type:`button`,"aria-expanded":L,"aria-controls":E,onClick:()=>q(!L),className:`group flex min-h-9 w-full items-center gap-2 rounded-md py-1 text-left outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background`,children:[(0,N.jsx)(v,{"aria-hidden":`true`,className:`size-4 shrink-0 text-muted-foreground`}),(0,N.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-xs text-foreground/80`,children:e}),(0,N.jsxs)(`span`,{className:`flex shrink-0 items-center gap-2`,children:[(0,N.jsx)(K,{value:z,type:`added`}),(0,N.jsx)(K,{value:B,type:`removed`})]}),(0,N.jsx)(`span`,{className:`grid size-4 shrink-0 place-items-center text-muted-foreground/60`,children:R?(0,N.jsx)(y,{"aria-label":`Applying changes`,className:r(`size-3.5`,!C&&`animate-spin`)}):n===`error`?(0,N.jsx)(g,{"aria-label":`Changes failed`,className:`size-3.5`}):n===`cancelled`?(0,N.jsx)(k,{"aria-label":`Changes cancelled`,className:`size-3.5`}):(0,N.jsx)(f,{"aria-label":`Changes applied`,className:`size-3.5`})}),(0,N.jsx)(o.span,{"aria-hidden":`true`,animate:{rotate:L?180:0},transition:C?{duration:0}:i,className:`shrink-0 text-muted-foreground/45 transition-colors group-hover:text-muted-foreground`,children:(0,N.jsx)(p,{className:`size-3.5`})})]}),(0,N.jsx)(G,{id:E,role:`region`,"aria-labelledby":T,open:L,children:(0,N.jsx)(`div`,{className:`pl-6 pt-1.5`,children:(0,N.jsxs)(`div`,{className:`overflow-hidden rounded-xl bg-muted/80`,children:[(0,N.jsx)(`div`,{ref:D,"data-slot":`file-diff-viewport`,"aria-live":R?`off`:`polite`,className:`scrollbar-hide overflow-auto`,style:{maxHeight:m},children:(0,N.jsxs)(`div`,{className:`font-mono text-xs leading-5`,children:[(0,N.jsx)(`span`,{className:`sr-only`,children:`File changes`}),t.map((e,t)=>{let n=e.type??`context`;return(0,N.jsxs)(`div`,{className:r(`grid grid-cols-[2.25rem_2.25rem_1rem_minmax(0,1fr)]`,n===`added`&&`bg-success/[0.07]`,n===`removed`&&`bg-destructive/[0.07]`),children:[(0,N.jsx)(`span`,{className:`select-none pr-2 text-right tabular-nums text-muted-foreground/40`,children:e.oldLine}),(0,N.jsx)(`span`,{className:`select-none pr-2 text-right tabular-nums text-muted-foreground/40`,children:e.newLine}),(0,N.jsx)(`span`,{className:r(`select-none text-center text-muted-foreground/45`,n===`added`&&`text-product-diff-added`,n===`removed`&&`text-product-diff-removed`),children:n===`added`?`+`:n===`removed`?`−`:``}),(0,N.jsx)(W,{code:e.content,tokens:H?.[t],className:`min-w-0 whitespace-pre px-1.5`})]},e.id)})]})}),V?(0,N.jsx)(`div`,{className:`flex justify-end px-2 pb-1.5 pt-1`,children:(0,N.jsx)(o.button,{type:`button`,"aria-label":j?`Copied`:`Copy diff`,title:j?`Copied`:`Copy diff`,onClick:J,whileTap:C?void 0:{scale:.96},transition:c,className:`grid size-7 place-items-center rounded-md text-muted-foreground outline-none transition-colors hover:bg-background/70 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring`,children:j?(0,N.jsx)(f,{className:`size-3.5`}):(0,N.jsx)(_,{className:`size-3.5`})})}):null]})})})]})}var J=[];function Y({code:e,language:t=`typescript`,languageLabel:n,filename:i,status:a=`complete`,showStatus:s=!0,showLineNumbers:l=!0,highlightLines:d=J,maxHeight:p=280,wrap:m=!1,copyable:h=!0,onCopy:g}){let b=u()??!1,x=(0,M.useRef)(null),C=(0,M.useRef)(void 0),[O,k]=(0,M.useState)(!1),A=a===`streaming`,j=U(e,t),P=(0,M.useMemo)(()=>new Set(d),[d]),F=0,I=e.split(`
|
|
4
4
|
`).map(e=>{let t={content:e,offset:F};return F+=e.length+1,t}),L=n??{bash:`Bash`,diff:`Diff`,json:`JSON`,python:`Python`,text:`Text`,tsx:`TSX`,typescript:`TypeScript`}[t];(0,M.useEffect)(()=>()=>{C.current&&window.clearTimeout(C.current)},[]),(0,M.useLayoutEffect)(()=>{let e=x.current;if(!e||!A)return;let t=requestAnimationFrame(()=>{e.scrollHeight<=e.clientHeight||(typeof e.scrollTo==`function`?e.scrollTo({top:e.scrollHeight,behavior:b?`auto`:`smooth`}):e.scrollTop=e.scrollHeight)});return()=>cancelAnimationFrame(t)});let R=(0,M.useCallback)(async()=>{g?await g():await navigator.clipboard?.writeText(e),k(!0),C.current&&window.clearTimeout(C.current),C.current=window.setTimeout(()=>k(!1),1600)},[e,g]);return(0,N.jsxs)(D,{"data-state":a,"aria-busy":A,size:`sm`,className:`bg-muted/80`,children:[(0,N.jsxs)(S,{className:`h-10 gap-2.5 px-3 pt-0`,children:[(0,N.jsx)(v,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground/70`}),i?(0,N.jsx)(T,{className:`font-mono text-xs text-foreground/80`,children:i}):null,(0,N.jsx)(`span`,{className:`text-micro font-medium uppercase tracking-wide text-muted-foreground/55`,children:L}),s?(0,N.jsxs)(`span`,{className:r(!h&&!g&&`ml-auto`,`inline-flex shrink-0 items-center gap-1 text-micro font-medium`,A?`text-info`:`text-success`),children:[A?(0,N.jsx)(y,{className:r(`size-3`,!b&&`animate-spin`)}):(0,N.jsx)(f,{className:`size-3`}),A?`Writing`:`Ready`]}):null,h||g?(0,N.jsx)(w,{className:r(`-my-0 -me-0`,s?`ms-0`:`ms-auto`),children:(0,N.jsx)(o.button,{type:`button`,"aria-label":O?`Copied`:`Copy code`,title:O?`Copied`:`Copy code`,onClick:R,whileTap:b?void 0:{scale:.96},transition:c,className:`grid size-7 shrink-0 place-items-center rounded-full text-muted-foreground outline-none transition-colors hover:bg-background/70 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring`,children:O?(0,N.jsx)(f,{className:`size-3.5`}):(0,N.jsx)(_,{className:`size-3.5`})})}):null]}),(0,N.jsx)(E,{ref:x,role:A?`log`:void 0,"aria-live":A?`off`:void 0,className:`max-w-full overflow-auto border-t border-foreground/[0.06] px-0 py-2 font-mono text-xs leading-5 text-foreground/85 [scrollbar-color:color-mix(in_oklab,var(--muted-foreground)_35%,transparent)_transparent] [scrollbar-width:thin]`,style:{maxHeight:p},wrap:m,children:I.map((e,t)=>{let n=t+1;return(0,N.jsx)(`span`,{"data-line-number":l?n:void 0,className:r(`grid min-h-5`,l?`grid-cols-[2.75rem_minmax(0,1fr)] before:content-[attr(data-line-number)] before:select-none before:pr-3 before:text-right before:tabular-nums before:text-muted-foreground/35`:`grid-cols-1`,P.has(n)&&`bg-primary/[0.07]`),children:(0,N.jsx)(W,{code:e.content,tokens:j?.[t],suffix:t<I.length-1?`
|
|
5
|
-
`:void 0,className:r(`pr-4`,l?`pl-1`:`pl-4`,m?`whitespace-pre-wrap break-words`:`whitespace-pre`)})},e.offset)})})]})}var X={initial:{opacity:0,y:`90%`,filter:`blur(3px)`},animate:{opacity:1,y:`0%`,filter:`blur(0px)`,transition:i},exit:{opacity:0,y:`-90%`,filter:`blur(3px)`,transition:{duration:.14,ease:s}}};function Z({value:e,children:t,className:n}){let i=u(),s=(0,M.useRef)(null),[c,d]=(0,M.useState)();return(0,M.useLayoutEffect)(()=>{let e=s.current?.offsetWidth;e&&d(t=>t===e?t:e)}),(0,N.jsxs)(`span`,{className:r(`relative inline-block overflow-hidden whitespace-nowrap align-bottom`,n),style:{width:c,transition:i?void 0:`width 220ms ${a}`},children:[(0,N.jsx)(`span`,{ref:s,"aria-hidden":!0,className:`invisible inline-block whitespace-nowrap`,children:t}),(0,N.jsx)(l,{initial:!1,children:(0,N.jsx)(o.span,{variants:X,initial:!i&&`initial`,animate:i?{opacity:1,filter:`blur(0px)`,scale:1,y:0}:`animate`,exit:i?void 0:`exit`,className:`absolute left-0 top-0 inline-block`,children:t},`roll-${e}`)})]})}function Q(e){return e===`running`?`Running`:e===`success`?`Completed`:e===`error`?`Failed`:`Cancelled`}function $(e){return e===`running`?`text-primary`:e===`success`?`text-success`:e===`error`?`text-destructive`:`text-muted-foreground`}function ee({kind:e}){return e===`terminal`?(0,N.jsx)(b,{className:`size-4`}):e===`request`?(0,N.jsx)(j,{className:`size-4`}):(0,N.jsx)(
|
|
5
|
+
`:void 0,className:r(`pr-4`,l?`pl-1`:`pl-4`,m?`whitespace-pre-wrap break-words`:`whitespace-pre`)})},e.offset)})})]})}var X={initial:{opacity:0,y:`90%`,filter:`blur(3px)`},animate:{opacity:1,y:`0%`,filter:`blur(0px)`,transition:i},exit:{opacity:0,y:`-90%`,filter:`blur(3px)`,transition:{duration:.14,ease:s}}};function Z({value:e,children:t,className:n}){let i=u(),s=(0,M.useRef)(null),[c,d]=(0,M.useState)();return(0,M.useLayoutEffect)(()=>{let e=s.current?.offsetWidth;e&&d(t=>t===e?t:e)}),(0,N.jsxs)(`span`,{className:r(`relative inline-block overflow-hidden whitespace-nowrap align-bottom`,n),style:{width:c,transition:i?void 0:`width 220ms ${a}`},children:[(0,N.jsx)(`span`,{ref:s,"aria-hidden":!0,className:`invisible inline-block whitespace-nowrap`,children:t}),(0,N.jsx)(l,{initial:!1,children:(0,N.jsx)(o.span,{variants:X,initial:!i&&`initial`,animate:i?{opacity:1,filter:`blur(0px)`,scale:1,y:0}:`animate`,exit:i?void 0:`exit`,className:`absolute left-0 top-0 inline-block`,children:t},`roll-${e}`)})]})}function Q(e){return e===`running`?`Running`:e===`success`?`Completed`:e===`error`?`Failed`:`Cancelled`}function $(e){return e===`running`?`text-primary`:e===`success`?`text-success`:e===`error`?`text-destructive`:`text-muted-foreground`}function ee({kind:e}){return e===`terminal`?(0,N.jsx)(b,{className:`size-4`}):e===`request`?(0,N.jsx)(j,{className:`size-4`}):(0,N.jsx)(h,{className:`size-4`})}function te({status:e,reduce:t}){return e===`running`?(0,N.jsx)(y,{className:r(`size-3`,!t&&`animate-spin`)}):e===`success`?(0,N.jsx)(m,{className:`size-3`}):e===`error`?(0,N.jsx)(g,{className:`size-3`}):(0,N.jsx)(k,{className:`size-3`})}function ne({label:e,onClick:t,children:n}){let r=u()??!1;return(0,N.jsx)(o.button,{type:`button`,"aria-label":e,title:e,onClick:t,whileTap:r?void 0:{scale:.96},transition:c,className:`grid size-7 place-items-center rounded-md text-muted-foreground outline-none transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring`,children:n})}function re({children:e,language:t=`bash`,label:n,error:i=!1,className:a}){return(0,N.jsxs)(D,{"data-error":i||void 0,variant:i?`destructive`:`default`,size:`sm`,className:a,children:[(0,N.jsxs)(S,{className:`py-1`,children:[n?(0,N.jsx)(T,{className:r(`text-micro uppercase tracking-[0.12em]`,i?`text-destructive`:`text-muted-foreground/60`),children:i?`Reported error`:n}):null,(0,N.jsx)(w,{children:(0,N.jsx)(C,{value:e,"aria-label":`Copy result`})})]}),(0,N.jsx)(E,{wrap:!0,className:r(`max-h-60 text-xs leading-5`,i?`text-destructive`:`text-foreground/80`),children:e})]})}function ie({tool:e,title:t,children:n,status:a=`running`,kind:s=`custom`,meta:c,open:l,defaultOpen:d=!0,onOpenChange:m,collapseOnComplete:h=!0,maxHeight:g=220,copyText:v}){let y=u()??!1,b=(0,M.useId)(),x=`${b}-trigger`,S=`${b}-content`,C=(0,M.useRef)(null),w=(0,M.useRef)(a),T=(0,M.useRef)(void 0),[E,D]=(0,M.useState)(!1),[O,k]=(0,M.useState)(d),A=l??O,j=a===`running`,P=!!v,F=Q(a),I=(0,M.useCallback)(e=>{l===void 0&&k(e),m?.(e)},[m,l]);(0,M.useEffect)(()=>{w.current!==`running`&&a===`running`&&I(!0),w.current===`running`&&a!==`running`&&h&&I(!1),w.current=a},[h,I,a]),(0,M.useEffect)(()=>()=>{T.current&&window.clearTimeout(T.current)},[]),(0,M.useLayoutEffect)(()=>{let e=C.current;if(!e||!A||!j)return;let t=requestAnimationFrame(()=>{typeof e.scrollTo==`function`?e.scrollTo({top:e.scrollHeight,behavior:y?`auto`:`smooth`}):e.scrollTop=e.scrollHeight});return()=>cancelAnimationFrame(t)});let L=(0,M.useCallback)(async()=>{v&&await navigator.clipboard?.writeText(v),D(!0),T.current&&window.clearTimeout(T.current),T.current=window.setTimeout(()=>D(!1),1600)},[v]);return(0,N.jsxs)(`div`,{"data-state":a,"aria-busy":j,className:`w-full text-sm`,children:[(0,N.jsxs)(`button`,{id:x,type:`button`,"aria-expanded":A,"aria-controls":S,onClick:()=>I(!A),className:`group flex min-h-9 w-full items-center gap-2 py-1 text-left outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background`,children:[(0,N.jsx)(`span`,{"aria-hidden":`true`,className:`grid size-4 shrink-0 place-items-center text-muted-foreground`,children:(0,N.jsx)(ee,{kind:s})}),(0,N.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-2`,children:[(0,N.jsx)(`span`,{className:`min-w-0 truncate font-medium text-foreground/90`,children:t}),c?(0,N.jsx)(`span`,{className:`shrink-0 text-xs tabular-nums text-muted-foreground/60`,children:c}):null,(0,N.jsx)(`span`,{className:`hidden min-w-0 truncate font-mono text-caption text-muted-foreground/55 sm:inline`,children:e})]}),(0,N.jsxs)(`span`,{className:r(`inline-flex shrink-0 items-center gap-1 text-caption font-medium`,$(a)),children:[(0,N.jsx)(te,{status:a,reduce:y}),(0,N.jsx)(Z,{value:a,children:F})]}),(0,N.jsx)(o.span,{"aria-hidden":`true`,animate:{rotate:A?180:0},transition:y?{duration:0}:i,className:`shrink-0 text-muted-foreground/50 transition-colors group-hover:text-muted-foreground`,children:(0,N.jsx)(p,{className:`size-3.5`})})]}),(0,N.jsx)(G,{id:S,role:`region`,"aria-labelledby":x,open:A,children:(0,N.jsx)(`div`,{className:`pl-6 pt-1.5`,children:(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`div`,{ref:C,role:`log`,"aria-live":`polite`,className:`scrollbar-hide overflow-y-auto overscroll-contain`,style:{maxHeight:g},children:n}),P?(0,N.jsxs)(`div`,{className:`flex items-center gap-0.5 px-2 pb-1.5`,children:[(0,N.jsx)(ne,{label:E?`Copied`:`Copy result`,onClick:L,children:E?(0,N.jsx)(f,{className:`size-3.5`}):(0,N.jsx)(_,{className:`size-3.5`})}),(0,N.jsx)(`span`,{className:`ml-auto text-caption text-muted-foreground/55`,children:(0,N.jsx)(Z,{value:a,children:F})})]}):null]})})})]})}export{q as a,Y as i,re as n,G as o,Z as r,ie as t};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/session-tool-renderer-BLFqj28b.js","assets/rolldown-runtime-hePW80VL.js","assets/react-Cvdyeg_0.js","assets/jsx-runtime-NZYk81nU.js","assets/utils-oBThwhjm.js","assets/ease-nNJMFgD_.js","assets/is-ref-object-h-bjS8Eq.js","assets/use-reduced-motion-69Ji0Qlf.js","assets/use-presence-BPZ36pcg.js","assets/useButton-CvcmqA2s.js","assets/createLucideIcon-CQY2ECfR.js","assets/arrow-up-right-CG9RNk4p.js","assets/tool-result-DxWDQJSF.js","assets/check-BTwIaCtI.js","assets/chevron-down-Bse1ggZM.js","assets/circle-check-DBhaebaM.js","assets/tool-action-icon-vTW_L1Fj.js","assets/search-Cb6fFWew.js","assets/shield-check-7HDd-2Fn.js","assets/file-code-corner-BkDULqko.js","assets/loader-circle-BmKYM_C4.js","assets/square-terminal-BLq2bQVF.js","assets/preload-helper-BLdHbfdN.js","assets/code-block-pKKmFZ5w.js","assets/button-CWYjn8Zk.js","assets/dist-BogNzeK9.js","assets/clsx-DB0hHKMi.js","assets/chevron-right-BPCB1mOg.js","assets/file-text-cqOanUYv.js","assets/cpython-tool-CcGMkNQ4.js","assets/eye-iNSvs0UA.js","assets/git-branch-DZEh2mM2.js","assets/sparkles-CASAe1AI.js","assets/rotate-ccw-DLkfsmG9.js","assets/x-DEU6H3M-.js","assets/dist-CprW0Qol.js","assets/space-separated-tokens-Ciu5hotc.js","assets/character-entities-legacy-Wut6vMuj.js","assets/lib-BvGd2E-G.js","assets/useRender-CzJUrRlB.js","assets/surfaces-BUjUJTyD.js","assets/safe-external-url-D3PJJIcM.js","assets/collapsible-Bk6zCsRX.js","assets/createBaseUIEventDetails-DIxvaz-Y.js","assets/react-dom-B7th3XGm.js","assets/useBaseUiId-lKfDDIcw.js","assets/useControlled-CkQSkSv1.js","assets/workspace-path-nav-D-77sJ_A.js","assets/use-hover-capable-CLq8BADD.js","assets/trace-IsV5RRvM.js","assets/tool-output-normalizer-DDoLNo4P.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./react-Cvdyeg_0.js";import{t as n}from"./jsx-runtime-NZYk81nU.js";import{t as r}from"./utils-oBThwhjm.js";import{n as i,r as a,t as o}from"./tool-action-icon-vTW_L1Fj.js";import{t as s}from"./preload-helper-BLdHbfdN.js";import{a as c,c as l,i as u,n as d,o as f,r as p,s as m,t as h}from"./trace-IsV5RRvM.js";import{t as g}from"./tool-output-normalizer-DDoLNo4P.js";var _=e(t(),1),v=n(),y=(0,_.lazy)(()=>s(async()=>{let{SessionToolRenderer:e}=await import(`./session-tool-renderer-BLFqj28b.js`).then(e=>e.n);return{SessionToolRenderer:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50])).then(({SessionToolRenderer:e})=>({default:e}))),b=[];function x(e){return e===`ipython`?`repl`:`artifacts`}function S(e,t){return t?{...e,artifactId:t.id,artifactTitle:t.title,artifactTarget:x(t.kind)}:e}function C(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:void 0}function w(e,t){let n=e.state;return n===`output-error`||n===`error`?`error`:n===`cancelled`||n===`canceled`||n===`aborted`||n===`interrupted`?`cancelled`:n===`input-streaming`||n===`streaming`?t?`running`:`cancelled`:n===`input-available`||n===`pending`||n===`queued`?`pending`:t&&e.output===void 0&&e.result===void 0?`running`:`complete`}function T(e,t,n,r=[],i=!1){let o=e.type;if(typeof o!=`string`||!o.startsWith(`tool-`)||o===`tool-Question`||o===`tool-FleetReasoning`||o===`tool-Thinking`||i)return;let s=o.slice(5),c=s.toLowerCase(),l=a(s),u=c.includes(`edit`)||c.includes(`write`)||c.includes(`patch`)?`Edited`:c.includes(`read`)?`Read`:c.includes(`search`)||c.includes(`grep`)||c.includes(`glob`)?`Searched`:c.includes(`bash`)||c.includes(`shell`)||c.includes(`python`)||c.includes(`ipython`)?`Ran`:l,d=g(e);return{id:typeof e.toolCallId==`string`?e.toolCallId:t,verb:u,target:l,status:w(e,n),part:e,nestedTools:r,traceDescription:d?.traceDescription,durationLabel:d?.durationLabel,reportedError:d?.outputSummary.isError}}function E(e){return{id:`artifact:${e.id}`,verb:e.kind===`compaction`?`Compacted`:e.kind===`refinement`?`Refined`:e.kind===`rlm`?`Delegated`:e.kind===`diff`?`Edited`:`Completed`,target:e.kind===`bash`?`Bash output`:e.kind===`ipython`?`CPython result`:e.kind===`diff`?`File change`:e.kind===`rlm`?`Child task`:e.kind===`refinement`?`Refinement`:`Session activity`,status:e.status===`success`?`complete`:e.status}}function D({step:e,onOpenArtifact:t,renderToolDetails:n}){let a=i(e.part?.type.replace(/^tool-/,``)??e.target),s=e.artifactId,h=s&&e.artifactTitle?`Open ${o(e.artifactTitle)} in ${e.artifactTarget===`repl`?`REPL`:`artifacts`}`:void 0,g=`Details for ${e.target}${e.id?` (${e.id})`:``}`,b=e.reportedError?`reported error`:e.status===`error`?`failed`:e.status===`running`?`running`:e.status===`pending`?`waiting`:e.status===`cancelled`?`cancelled`:`done`,x=(0,v.jsxs)(m,{status:e.status===`running`?`running`:e.status===`error`?`error`:e.status===`pending`?`pending`:void 0,children:[(0,v.jsx)(f,{children:(0,v.jsx)(a,{className:r(`size-3.5`,e.status===`running`&&`animate-pulse text-primary`,e.status===`error`&&`text-destructive`)})}),(0,v.jsxs)(l,{children:[e.verb,` `,e.target]}),(0,v.jsx)(c,{className:e.reportedError?`text-destructive`:void 0,children:b}),e.traceDescription?(0,v.jsx)(c,{className:`max-w-48 truncate`,title:e.traceDescription,children:e.traceDescription}):null,e.durationLabel?(0,v.jsx)(c,{children:e.durationLabel}):null]});return(0,v.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2`,children:[e.part?(0,v.jsxs)(d,{className:`min-w-0 flex-1`,children:[(0,v.jsx)(u,{"aria-label":g,children:x}),(0,v.jsx)(p,{children:n?n(e.part,e.status===`running`,e.nestedTools):(0,v.jsx)(_.Suspense,{fallback:null,children:(0,v.jsx)(y,{part:e.part,nestedTools:e.nestedTools,chatStatus:e.status===`running`?`streaming`:void 0,insideTrace:!0})})})]}):(0,v.jsx)(`div`,{className:`min-w-0 flex-1`,children:x}),h&&s&&t?(0,v.jsx)(`button`,{type:`button`,className:`shrink-0 text-micro underline`,"aria-label":h,onClick:()=>t(s,e.artifactTarget),children:`Open`}):null]})}function O({messages:e,artifacts:t=b,streaming:n,className:a,onOpenArtifact:o,renderToolDetails:s}){let g=(0,_.useMemo)(()=>{let r=new Set,i=new Map(t.flatMap(e=>e.sourceToolCallId?[[e.sourceToolCallId,e]]:[])),a=e.flatMap(e=>{let t=new Set(e.parts.flatMap(e=>{let t=C(e);return(t?.type===`tool-Task`||t?.type===`tool-Agent`)&&typeof t.toolCallId==`string`?[t.toolCallId]:[]})),a=new Map,o=new Set;for(let n of e.parts){let e=C(n),r=typeof e?.toolCallId==`string`?e.toolCallId:void 0,i=r?.indexOf(`:`)??-1;if(!r||i<=0)continue;let s=r.slice(0,i);if(!t.has(s))continue;o.add(r);let c=a.get(s)??[];c.push(e),a.set(s,c)}return e.parts.flatMap((t,s)=>{let c=C(t)??{},l=typeof c.toolCallId==`string`?c.toolCallId:void 0,u=T(c,`${e.id}:${s}`,n,l?a.get(l)??[]:[],l?o.has(l):!1);return!u||r.has(u.id)?[]:(r.add(u.id),[S(u,i.get(u.id))])})}),o=t.flatMap(e=>{if(e.kind===`recap`||e.sourceToolCallId&&r.has(e.sourceToolCallId))return[];let t=S(E(e),e);return r.has(t.id)?[]:(r.add(t.id),[t])});return[...a,...o]},[t,e,n]),[y,x]=(0,_.useState)(!0);if(g.length===0)return null;let w=[...g].reverse().find(e=>e.status===`running`)??g.at(-1),O=i(w?.part?.type.replace(/^tool-/,``)??w?.target??`activity`);return(0,v.jsx)(h,{className:r(`mb-2`,a),"data-testid":`tool-trace`,children:(0,v.jsxs)(d,{open:y,onOpenChange:x,children:[(0,v.jsx)(u,{"aria-label":`${g.length} tool ${g.length===1?`action`:`actions`}`,children:(0,v.jsxs)(m,{status:w?.status===`running`?`running`:w?.status===`error`?`error`:void 0,children:[(0,v.jsx)(f,{children:(0,v.jsx)(O,{className:r(`size-3.5`,w?.status===`running`&&`animate-spin`)})}),(0,v.jsx)(l,{children:n&&w?`${w.verb} ${w.target}`:`${g.length} tool ${g.length===1?`action`:`actions`}`}),(0,v.jsx)(c,{children:g.length})]})}),(0,v.jsx)(p,{children:(0,v.jsx)(h,{className:`gap-1`,children:g.map(e=>(0,v.jsx)(D,{step:e,onOpenArtifact:o,renderToolDetails:s},e.id))})})]})})}export{O as t};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
|
-
"timestamp": "2026-11-
|
|
3
|
-
"routeEntry": "routes-
|
|
4
|
-
"routeEntryGzipBytes":
|
|
5
|
-
"routeEntryReduction": 0.
|
|
2
|
+
"timestamp": "2026-11-04T01:10:04.000Z",
|
|
3
|
+
"routeEntry": "routes-CJRPrnVB.js",
|
|
4
|
+
"routeEntryGzipBytes": 81269,
|
|
5
|
+
"routeEntryReduction": 0.9232249507337507,
|
|
6
6
|
"eagerFiles": 88,
|
|
7
|
-
"eagerGzipBytes":
|
|
7
|
+
"eagerGzipBytes": 362338,
|
|
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-BhSwNUm2.js
|
|
4
4
|
var tsrStartManifest = () => ({ routes: {
|
|
5
5
|
__root__: {
|
|
6
6
|
filePath: "/home/circleci/prime-agent/web/app/src/routes/__root.tsx",
|
|
@@ -15,7 +15,7 @@ var tsrStartManifest = () => ({ routes: {
|
|
|
15
15
|
"/api/workspace/tree"
|
|
16
16
|
],
|
|
17
17
|
preloads: [
|
|
18
|
-
"/assets/index-
|
|
18
|
+
"/assets/index-BpqhS0Xv.js",
|
|
19
19
|
"/assets/rolldown-runtime-hePW80VL.js",
|
|
20
20
|
"/assets/react-Cvdyeg_0.js",
|
|
21
21
|
"/assets/react-dom-B7th3XGm.js",
|
|
@@ -32,14 +32,14 @@ var tsrStartManifest = () => ({ routes: {
|
|
|
32
32
|
scripts: [{ attrs: {
|
|
33
33
|
type: "module",
|
|
34
34
|
async: true,
|
|
35
|
-
src: "/assets/index-
|
|
35
|
+
src: "/assets/index-BpqhS0Xv.js"
|
|
36
36
|
} }]
|
|
37
37
|
},
|
|
38
38
|
"/": {
|
|
39
39
|
filePath: "/home/circleci/prime-agent/web/app/src/routes/index.tsx",
|
|
40
40
|
children: void 0,
|
|
41
41
|
preloads: [
|
|
42
|
-
"/assets/routes-
|
|
42
|
+
"/assets/routes-CJRPrnVB.js",
|
|
43
43
|
"/assets/with-selector-B_VDO56x.js",
|
|
44
44
|
"/assets/chat-queries-ty76G6rK.js",
|
|
45
45
|
"/assets/utils-oBThwhjm.js",
|
|
@@ -59,20 +59,20 @@ var tsrStartManifest = () => ({ routes: {
|
|
|
59
59
|
"/assets/provider-label-BItazQ6H.js",
|
|
60
60
|
"/assets/check-BTwIaCtI.js",
|
|
61
61
|
"/assets/chevron-down-Bse1ggZM.js",
|
|
62
|
-
"/assets/tool-part-normalizer-
|
|
62
|
+
"/assets/tool-part-normalizer-DdgmYc9z.js",
|
|
63
63
|
"/assets/open-panel-action-message-SdA1VU42.js",
|
|
64
64
|
"/assets/chevron-right-BPCB1mOg.js",
|
|
65
65
|
"/assets/file-text-cqOanUYv.js",
|
|
66
|
+
"/assets/tool-action-icon-vTW_L1Fj.js",
|
|
66
67
|
"/assets/clock-3-BwWCSCm_.js",
|
|
67
68
|
"/assets/file-code-corner-BkDULqko.js",
|
|
68
|
-
"/assets/tool-output-normalizer-DDU09Zc6.js",
|
|
69
69
|
"/assets/layout-constants-BWf8QAZ6.js",
|
|
70
70
|
"/assets/chat-helpers-Bj7_hES7.js",
|
|
71
71
|
"/assets/types-gIgIxnnG.js",
|
|
72
72
|
"/assets/folder-COBtkKZa.js",
|
|
73
73
|
"/assets/gauge-0Nn96wfZ.js",
|
|
74
74
|
"/assets/sparkles-CASAe1AI.js",
|
|
75
|
-
"/assets/right-panel-registry-
|
|
75
|
+
"/assets/right-panel-registry-HNH3niQ8.js",
|
|
76
76
|
"/assets/loader-circle-BmKYM_C4.js",
|
|
77
77
|
"/assets/package-BkC-HSi-.js",
|
|
78
78
|
"/assets/pencil-Cbgq3ybX.js",
|
|
@@ -88,7 +88,7 @@ var tsrStartManifest = () => ({ routes: {
|
|
|
88
88
|
"/assets/safe-storage-s25GrfpH.js",
|
|
89
89
|
"/assets/chat-hpzV6IA6.js",
|
|
90
90
|
"/assets/badge-CzQFgmVK.js",
|
|
91
|
-
"/assets/prime-agent-artifacts-
|
|
91
|
+
"/assets/prime-agent-artifacts-CuR1D_ch.js",
|
|
92
92
|
"/assets/input-CBoTMPC_.js",
|
|
93
93
|
"/assets/surfaces-BUjUJTyD.js",
|
|
94
94
|
"/assets/useControlled-CkQSkSv1.js",
|
|
@@ -96,7 +96,7 @@ var tsrStartManifest = () => ({ routes: {
|
|
|
96
96
|
"/assets/tokens-DinEQBG4.js",
|
|
97
97
|
"/assets/prompt-input-0kaw0ekd.js",
|
|
98
98
|
"/assets/workspace-path-nav-D-77sJ_A.js",
|
|
99
|
-
"/assets/reasoning-line-
|
|
99
|
+
"/assets/reasoning-line-B79r9oqP.js",
|
|
100
100
|
"/assets/use-hover-capable-CLq8BADD.js",
|
|
101
101
|
"/assets/notify-BIL0-CGy.js",
|
|
102
102
|
"/assets/right-panel-context-CjX-HkDO.js",
|
|
@@ -3,7 +3,7 @@ import "./chunk-CZ7CSFO4.js";
|
|
|
3
3
|
// web/app/dist/server/assets/agents-DOgCHixY.js
|
|
4
4
|
import { Suspense, lazy } from "react";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
|
-
var AgentsPage = lazy(() => import("./agents-page-BdiR9H8w-
|
|
6
|
+
var AgentsPage = lazy(() => import("./agents-page-BdiR9H8w-WK3UCXSA.js").then(({ AgentsPage: page }) => ({ default: page })));
|
|
7
7
|
function PageLoading() {
|
|
8
8
|
return /* @__PURE__ */ jsx("main", {
|
|
9
9
|
className: "min-h-svh bg-background p-8",
|
package/dist/web/server/{agents-page-BdiR9H8w-UXB7T3LH.js → agents-page-BdiR9H8w-WK3UCXSA.js}
RENAMED
|
@@ -7,25 +7,25 @@ import {
|
|
|
7
7
|
CardDescription,
|
|
8
8
|
CardHeader,
|
|
9
9
|
CardTitle
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-BVSDXFQ6.js";
|
|
11
11
|
import {
|
|
12
12
|
Alert,
|
|
13
13
|
AlertDescription,
|
|
14
14
|
AlertTitle
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-2R5CY7DW.js";
|
|
16
16
|
import {
|
|
17
17
|
chatClient,
|
|
18
18
|
useChatProjects
|
|
19
19
|
} from "./chunk-QOZCYKMA.js";
|
|
20
20
|
import {
|
|
21
21
|
Badge
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-FGOT5FGH.js";
|
|
23
23
|
import {
|
|
24
24
|
useQuery
|
|
25
25
|
} from "./chunk-NZCEQWK2.js";
|
|
26
26
|
import {
|
|
27
27
|
Button$1
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-4ZKBYAHH.js";
|
|
29
29
|
import {
|
|
30
30
|
Activity,
|
|
31
31
|
ArrowUpRight,
|
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
CalendarClock,
|
|
34
34
|
Clock3,
|
|
35
35
|
LoaderCircle
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-U26ZMWVI.js";
|
|
37
37
|
import "./chunk-6JOAWERA.js";
|
|
38
38
|
import {
|
|
39
39
|
Link
|
|
@@ -3,18 +3,18 @@ import {
|
|
|
3
3
|
FileDiff,
|
|
4
4
|
ToolResult,
|
|
5
5
|
ToolResultOutput
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-BG4DVGLL.js";
|
|
7
7
|
import {
|
|
8
8
|
GenerativeTextRenderer,
|
|
9
9
|
OpenUIHtmlArtifactView
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
10
|
+
} from "./chunk-3KHS4HHI.js";
|
|
11
|
+
import "./chunk-A6LRK2MC.js";
|
|
12
|
+
import "./chunk-BVSDXFQ6.js";
|
|
13
|
+
import "./chunk-ORO7KXHF.js";
|
|
14
|
+
import "./chunk-2R5CY7DW.js";
|
|
15
15
|
import "./chunk-TAPQMXA7.js";
|
|
16
16
|
import "./chunk-BC4GIC2P.js";
|
|
17
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-JR5TXTGV.js";
|
|
18
18
|
import "./chunk-ZAEIBARP.js";
|
|
19
19
|
import "./chunk-N6RHJATN.js";
|
|
20
20
|
import "./chunk-3L5VHELG.js";
|
|
@@ -23,18 +23,18 @@ import {
|
|
|
23
23
|
CollapsibleContent,
|
|
24
24
|
CollapsibleTrigger,
|
|
25
25
|
primeAgentArtifactDiff
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-Y3YE73VQ.js";
|
|
27
27
|
import "./chunk-4OLRCVML.js";
|
|
28
28
|
import {
|
|
29
29
|
UiErrorBoundary
|
|
30
30
|
} from "./chunk-C5XHGLET.js";
|
|
31
|
-
import "./chunk-
|
|
31
|
+
import "./chunk-FGOT5FGH.js";
|
|
32
32
|
import "./chunk-6GYLXDX3.js";
|
|
33
33
|
import "./chunk-NZCEQWK2.js";
|
|
34
34
|
import "./chunk-7DQQMT5V.js";
|
|
35
|
-
import "./chunk-
|
|
36
|
-
import "./chunk-
|
|
37
|
-
import "./chunk-
|
|
35
|
+
import "./chunk-4ISLMQ2M.js";
|
|
36
|
+
import "./chunk-6OZY4XH7.js";
|
|
37
|
+
import "./chunk-U73UDYRF.js";
|
|
38
38
|
import "./chunk-6X2JN5JP.js";
|
|
39
39
|
import "./chunk-JG4OYC4G.js";
|
|
40
40
|
import "./chunk-2EAUHOIA.js";
|
|
@@ -1996,17 +1996,17 @@ import "./chunk-UTHOHZGM.js";
|
|
|
1996
1996
|
import "./chunk-XL5KHOU6.js";
|
|
1997
1997
|
import "./chunk-Z74XBU75.js";
|
|
1998
1998
|
import "./chunk-MPHREEUA.js";
|
|
1999
|
-
import "./chunk-
|
|
2000
|
-
import "./chunk-
|
|
1999
|
+
import "./chunk-NEMK2RTM.js";
|
|
2000
|
+
import "./chunk-VFW2KPLD.js";
|
|
2001
2001
|
import "./chunk-OO7NBFQQ.js";
|
|
2002
2002
|
import {
|
|
2003
2003
|
Button$1
|
|
2004
|
-
} from "./chunk-
|
|
2004
|
+
} from "./chunk-4ZKBYAHH.js";
|
|
2005
2005
|
import {
|
|
2006
2006
|
ChevronRight,
|
|
2007
2007
|
LayoutTemplate,
|
|
2008
2008
|
Package
|
|
2009
|
-
} from "./chunk-
|
|
2009
|
+
} from "./chunk-U26ZMWVI.js";
|
|
2010
2010
|
import "./chunk-SYS5FDNA.js";
|
|
2011
2011
|
import "./chunk-6JOAWERA.js";
|
|
2012
2012
|
import "./chunk-B5WGZMKA.js";
|
|
@@ -2022,7 +2022,7 @@ import "./chunk-DP65WGRD.js";
|
|
|
2022
2022
|
import "./chunk-IGN54DHU.js";
|
|
2023
2023
|
import "./chunk-CZ7CSFO4.js";
|
|
2024
2024
|
|
|
2025
|
-
// web/app/dist/server/assets/artifacts-panel-
|
|
2025
|
+
// web/app/dist/server/assets/artifacts-panel-C9OUKEU0.js
|
|
2026
2026
|
import { useEffect, useMemo, useRef, useState } from "react";
|
|
2027
2027
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
2028
2028
|
var DEFAULT_ARTIFACT_RUNS = [];
|
|
@@ -2091,7 +2091,7 @@ function artifactSource(artifact) {
|
|
|
2091
2091
|
if (artifact.kind === "ipython") return {
|
|
2092
2092
|
code,
|
|
2093
2093
|
language: /^\s*%%bash(?:\s|$)/im.test(code) ? "bash" : "python",
|
|
2094
|
-
label: "
|
|
2094
|
+
label: "CPython"
|
|
2095
2095
|
};
|
|
2096
2096
|
if (artifact.kind === "diff") return {
|
|
2097
2097
|
code,
|
|
@@ -6,26 +6,26 @@ import {
|
|
|
6
6
|
CommandItem,
|
|
7
7
|
CommandList,
|
|
8
8
|
CommandSeparator
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-F6P2FTIT.js";
|
|
10
|
+
import "./chunk-ETTLRHDY.js";
|
|
11
11
|
import "./chunk-BC4GIC2P.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-JR5TXTGV.js";
|
|
13
13
|
import {
|
|
14
14
|
RIGHT_PANEL_DEFINITIONS
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-FSIRN7F7.js";
|
|
16
16
|
import "./chunk-QOZCYKMA.js";
|
|
17
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-Y3YE73VQ.js";
|
|
18
18
|
import "./chunk-4OLRCVML.js";
|
|
19
19
|
import "./chunk-C5XHGLET.js";
|
|
20
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-FGOT5FGH.js";
|
|
21
21
|
import "./chunk-6GYLXDX3.js";
|
|
22
22
|
import "./chunk-NZCEQWK2.js";
|
|
23
23
|
import "./chunk-7DQQMT5V.js";
|
|
24
|
-
import "./chunk-
|
|
25
|
-
import "./chunk-
|
|
26
|
-
import "./chunk-
|
|
24
|
+
import "./chunk-4ISLMQ2M.js";
|
|
25
|
+
import "./chunk-6OZY4XH7.js";
|
|
26
|
+
import "./chunk-U73UDYRF.js";
|
|
27
27
|
import "./chunk-OO7NBFQQ.js";
|
|
28
|
-
import "./chunk-
|
|
28
|
+
import "./chunk-4ZKBYAHH.js";
|
|
29
29
|
import {
|
|
30
30
|
Keyboard,
|
|
31
31
|
Monitor,
|
|
@@ -34,13 +34,13 @@ import {
|
|
|
34
34
|
RotateCcwClock,
|
|
35
35
|
Square,
|
|
36
36
|
Sun
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-U26ZMWVI.js";
|
|
38
38
|
import "./chunk-6JOAWERA.js";
|
|
39
39
|
import "./chunk-CPB76YQU.js";
|
|
40
40
|
import "./chunk-NXAVRSI5.js";
|
|
41
41
|
import "./chunk-CZ7CSFO4.js";
|
|
42
42
|
|
|
43
|
-
// web/app/dist/server/assets/chat-command-palette-
|
|
43
|
+
// web/app/dist/server/assets/chat-command-palette-CnKy1Q4g.js
|
|
44
44
|
import { useState } from "react";
|
|
45
45
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
46
46
|
function ChatCommandPalette({ open, onOpenChange, onNewSession, onStop, onResumeSession, onSetRightPanel, onThemeChange, sessions, isStreaming, themePreference }) {
|