@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.
Files changed (91) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/web/client/assets/{artifacts-panel-CfWH5cQn.js → artifacts-panel-CDuvwZXW.js} +1 -1
  3. package/dist/web/client/assets/{chat-command-palette-CKGrP-Ke.js → chat-command-palette-DSpwG3Ph.js} +1 -1
  4. package/dist/web/client/assets/{ipython-tool-bieUhw9K.js → cpython-tool-CcGMkNQ4.js} +1 -1
  5. package/dist/web/client/assets/globals-CR3boQb2.css +2 -0
  6. package/dist/web/client/assets/{index-DJDQWCGd.js → index-BpqhS0Xv.js} +2 -2
  7. package/dist/web/client/assets/prime-agent-artifacts-CuR1D_ch.js +5 -0
  8. package/dist/web/client/assets/reasoning-line-B79r9oqP.js +1 -0
  9. package/dist/web/client/assets/{repl-panel-5xgkDXO5.js → repl-panel-Dj0nX5A6.js} +1 -1
  10. package/dist/web/client/assets/right-panel-registry-HNH3niQ8.js +2 -0
  11. package/dist/web/client/assets/routes-CJRPrnVB.js +14 -0
  12. package/dist/web/client/assets/session-activity-panel-Dvy044_T.js +1 -0
  13. package/dist/web/client/assets/{session-insights-panel-BXEmuJKf.js → session-insights-panel-Bltz_o6C.js} +1 -1
  14. package/dist/web/client/assets/{session-tool-renderer-CGMatufW.js → session-tool-renderer-BLFqj28b.js} +7 -7
  15. package/dist/web/client/assets/{subagent-chat-panel-xm-zBsFL.js → subagent-chat-panel-Cr57arv9.js} +1 -1
  16. package/dist/web/client/assets/subagent-transcript-CqAEPEJp.js +1 -0
  17. package/dist/web/client/assets/subagents-panel-DCjSDcM4.js +1 -0
  18. package/dist/web/client/assets/tool-action-icon-vTW_L1Fj.js +1 -0
  19. package/dist/web/client/assets/tool-output-normalizer-DDoLNo4P.js +4 -0
  20. package/dist/web/client/assets/tool-part-normalizer-DdgmYc9z.js +4 -0
  21. package/dist/web/client/assets/{tool-result-C_RIixge.js → tool-result-DxWDQJSF.js} +3 -3
  22. package/dist/web/client/assets/tool-timeline-BoWCZg0K.js +2 -0
  23. package/dist/web/client/bundle-budget.json +5 -5
  24. package/dist/web/server/{_tanstack-start-manifest_v-Cs4JeecK-7Q7PABV3.js → _tanstack-start-manifest_v-BhSwNUm2-HUY424SL.js} +9 -9
  25. package/dist/web/server/{agents-DOgCHixY-TU7YLWS2.js → agents-DOgCHixY-U362NTZW.js} +1 -1
  26. package/dist/web/server/{agents-page-BdiR9H8w-UXB7T3LH.js → agents-page-BdiR9H8w-WK3UCXSA.js} +5 -5
  27. package/dist/web/server/{artifacts-panel-DjaLT-MS-DAPJTA2V.js → artifacts-panel-C9OUKEU0-N74QLS6E.js} +18 -18
  28. package/dist/web/server/{chat-command-palette-CGCsCr9E-U5PCLXNE.js → chat-command-palette-CnKy1Q4g-GJJGAVQ4.js} +12 -12
  29. package/dist/web/server/{chunk-GNXIDE26.js → chunk-2R5CY7DW.js} +2 -2
  30. package/dist/web/server/{chunk-MEAWBN4N.js → chunk-37MAYG3X.js} +15 -15
  31. package/dist/web/server/{chunk-3LAD2C43.js → chunk-3KHS4HHI.js} +13 -13
  32. package/dist/web/server/{chunk-BD7YKYWL.js → chunk-4ISLMQ2M.js} +3 -3
  33. package/dist/web/server/{chunk-FSQWWR2M.js → chunk-4ZKBYAHH.js} +1 -1
  34. package/dist/web/server/{chunk-BLGKLQJG.js → chunk-63IBRYZL.js} +6 -6
  35. package/dist/web/server/{chunk-TXZDDJCT.js → chunk-6OZY4XH7.js} +3 -3
  36. package/dist/web/server/{chunk-QWJE6ES6.js → chunk-A6LRK2MC.js} +142 -32
  37. package/dist/web/server/{chunk-PBNUO4IN.js → chunk-BG4DVGLL.js} +2 -2
  38. package/dist/web/server/{chunk-KSGGSGOA.js → chunk-BVSDXFQ6.js} +1 -1
  39. package/dist/web/server/{chunk-HAFELESQ.js → chunk-ETTLRHDY.js} +3 -3
  40. package/dist/web/server/{chunk-BZ2EAUZZ.js → chunk-F6P2FTIT.js} +3 -3
  41. package/dist/web/server/{chunk-CE7U5QB2.js → chunk-FGOT5FGH.js} +2 -2
  42. package/dist/web/server/{chunk-UULUKSQD.js → chunk-FSIRN7F7.js} +104 -94
  43. package/dist/web/server/{chunk-R4BS3KYI.js → chunk-FVTCXLYO.js} +12 -12
  44. package/dist/web/server/{chunk-2Y2543CV.js → chunk-IJZDCYFG.js} +15 -10
  45. package/dist/web/server/{chunk-FT7HNDR5.js → chunk-JR5TXTGV.js} +5 -5
  46. package/dist/web/server/{chunk-PQVTLG3E.js → chunk-NEMK2RTM.js} +4 -4
  47. package/dist/web/server/{chunk-AXN2OBPF.js → chunk-O5CPI2JH.js} +1 -1
  48. package/dist/web/server/{chunk-Q4ECIATK.js → chunk-ORO7KXHF.js} +4 -4
  49. package/dist/web/server/{chunk-VDEUVEWL.js → chunk-U26ZMWVI.js} +300 -300
  50. package/dist/web/server/{chunk-APOS34PW.js → chunk-U73UDYRF.js} +2 -2
  51. package/dist/web/server/{chunk-VBCFQNR3.js → chunk-USP4O3V7.js} +2 -2
  52. package/dist/web/server/{chunk-FNV3WZXL.js → chunk-VFW2KPLD.js} +2 -2
  53. package/dist/web/server/{chunk-5MOXRFX6.js → chunk-Y3YE73VQ.js} +45 -5
  54. package/dist/web/server/{chunk-UZ2KHDSW.js → chunk-ZRISZYHZ.js} +14 -14
  55. package/dist/web/server/{connectors-Dv_uPdv0-2TCNQ3TU.js → connectors-Dv_uPdv0-WIJGW5CQ.js} +1 -1
  56. package/dist/web/server/{connectors-page-DW75T-uH-BR36R6FT.js → connectors-page-DW75T-uH-3KBZRVAT.js} +8 -8
  57. package/dist/web/server/{create-project-dialog-aCD1v__i-37Y2AYF7.js → create-project-dialog-dwXNUwY--APUSOU5G.js} +13 -13
  58. package/dist/web/server/{fork-picker-dialog-DFpKOdAw-JPLJSYYU.js → fork-picker-dialog-DFpKOdAw-WJPMXHSE.js} +6 -6
  59. package/dist/web/server/{markdown-Cc8V9dOF-JTNTJKQU.js → markdown-Cc8V9dOF-MMI3ZBVZ.js} +4 -4
  60. package/dist/web/server/{markdown-code-gaRnbgNM-V5LIRYCD.js → markdown-code-gaRnbgNM-ND6VVJ7D.js} +4 -4
  61. package/dist/web/server/{message-queue-nQ2_kU82-KKSLYR4S.js → message-queue-nQ2_kU82-3PN7CKFG.js} +4 -4
  62. package/dist/web/server/{model-selector-list-q8bMnmhy-SPFJGUBT.js → model-selector-list-q8bMnmhy-W6JM2N7G.js} +8 -8
  63. package/dist/web/server/{openui-renderer-DNl7TU3v-LAP3OM5H.js → openui-renderer-Das3EemD-AODSN4I2.js} +14 -14
  64. package/dist/web/server/{prompt-suggestions-B67Uy5Rk-5SMTSIFQ.js → prompt-suggestions-B67Uy5Rk-6MV56U6N.js} +4 -4
  65. package/dist/web/server/{repl-panel-1kSS1UGd-POXRYDDJ.js → repl-panel-DfC-BCfn-4OZEKSFX.js} +8 -8
  66. package/dist/web/server/{resources-panel-Dtm8nlrt-PMS7NWKW.js → resources-panel-BL41dm3H-UWWMTOFL.js} +10 -10
  67. package/dist/web/server/{router-CFtn3QOM-3WK4R4UB.js → router-DJDog9kJ-IHEFPUCH.js} +5 -5
  68. package/dist/web/server/{routes-CpT-KFt7-F6WEPWF6.js → routes-BWk0YodE-CEPOI27O.js} +29 -31
  69. package/dist/web/server/server.js +2 -2
  70. package/dist/web/server/{session-activity-panel-Dr9Q0Wmd-2F7ZYCAY.js → session-activity-panel-B56ALLHr-6PDGEA2M.js} +83 -18
  71. package/dist/web/server/{session-insights-panel-BiVObm_6-AP4FITT7.js → session-insights-panel-cS12HsWt-YX7QOWIA.js} +2 -2
  72. package/dist/web/server/{session-reasoning-panel-BFyfdmnZ-AQBC4WAL.js → session-reasoning-panel-CtQUqSv9-JIXRXBH7.js} +9 -9
  73. package/dist/web/server/{session-tool-renderer-DHu5tv0A-YFP7I2UC.js → session-tool-renderer-Co466pSk-QUTYNAOE.js} +12 -12
  74. package/dist/web/server/{session-tree-panel-BkMTm2QF-K56UQR2K.js → session-tree-panel-B23gApxX-44NFOCFB.js} +9 -9
  75. package/dist/web/server/{settings-dialog-1Zr_EiEd-GDE4IXK2.js → settings-dialog-CdRjXyfc-IYMPCNR5.js} +16 -16
  76. package/dist/web/server/{subagent-chat-panel-BCm1x_mR-HY6QEHEF.js → subagent-chat-panel-DwvOMUnh-EPVZRTRM.js} +15 -15
  77. package/dist/web/server/{subagents-panel-3gfZLsTx-7D53UO7K.js → subagents-panel-DlFBFoX6-SAWYBVZJ.js} +31 -30
  78. package/dist/web/server/{workspace-panel-BeSOuvp7-7N3CAG2K.js → workspace-panel-CxUsWmIE-3BMZFN5O.js} +10 -10
  79. package/package.json +1 -1
  80. package/dist/web/client/assets/globals-C6h6fq-s.css +0 -2
  81. package/dist/web/client/assets/prime-agent-artifacts-C-g1VPiW.js +0 -5
  82. package/dist/web/client/assets/reasoning-line-DGdPUMwT.js +0 -1
  83. package/dist/web/client/assets/right-panel-registry-BkBAryPm.js +0 -2
  84. package/dist/web/client/assets/routes-C6C0y-oH.js +0 -14
  85. package/dist/web/client/assets/session-activity-panel-BloVPsLJ.js +0 -1
  86. package/dist/web/client/assets/subagent-transcript-BzToBVWk.js +0 -1
  87. package/dist/web/client/assets/subagents-panel-B5ooG4sS.js +0 -1
  88. package/dist/web/client/assets/tool-output-normalizer-DDU09Zc6.js +0 -4
  89. package/dist/web/client/assets/tool-part-normalizer-CJ2sY87r.js +0 -4
  90. package/dist/web/client/assets/tool-timeline-BVY5VQ3a.js +0 -2
  91. package/dist/web/client/assets/wrench-BXX_Ah2s.js +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.10.4
4
+
5
+ ### Patch Changes
6
+
7
+ - 4105939: Polish thinking episodes, side panels, and CPython labels
8
+
9
+ - Each thinking stretch in a turn stays its own Thought row instead of growing one collapsible after tools run.
10
+ - Long Thoughts split into paragraphs as blank lines arrive, so Activity and the transcript stay readable.
11
+ - Kernel cells, REPL, and tool traces say CPython instead of IPython; the wire protocol is unchanged.
12
+ - The Subagents panel fills its body and scrolls inside it, and agent tabs can use a bit more width for longer names.
13
+ - The Projects sidebar label lines up vertically with its actions.
14
+
3
15
  ## 0.10.3
4
16
 
5
17
  ### Patch Changes
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./react-Cvdyeg_0.js";import{t as n}from"./jsx-runtime-NZYk81nU.js";import{t as r}from"./createLucideIcon-CQY2ECfR.js";import{a as i,i as a,n as o,t as s}from"./tool-result-C_RIixge.js";import{i as c}from"./open-panel-action-message-SdA1VU42.js";import{t as l}from"./chevron-right-BPCB1mOg.js";import{t as u}from"./package-BkC-HSi-.js";import{t as d}from"./button-CWYjn8Zk.js";import{n as f}from"./prime-agent-artifacts-C-g1VPiW.js";import{GenerativeTextRenderer as p,t as m}from"./openui-renderer-DG-iML7M.js";import{n as h,r as g,t as _}from"./collapsible-Bk6zCsRX.js";var v={name:`layout-template`,size:24,node:[[`rect`,{width:`18`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`f1a2em`}],[`rect`,{width:`9`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`jqznyg`}],[`rect`,{width:`5`,height:`7`,x:`16`,y:`14`,rx:`1`,key:`q5h2i8`}]]};v.node;var y=r(v),b=e(t(),1),x=n(),S=[];function C(e){if(typeof e==`string`)return e;if(e==null)return``;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function w(e){return e===`running`?`running`:e===`error`?`error`:e===`cancelled`?`cancelled`:`success`}function T(e){return e===`running`?`streaming`:e===`error`?`error`:e===`cancelled`?`cancelled`:`complete`}function E(e){let t=typeof e==`object`&&e?e:void 0;if(!t)return e===void 0?[]:[{label:`result`,text:C(e)}];let n=[];for(let e of[`stdout`,`stderr`,`result`,`error`])t[e]!==void 0&&t[e]!==``&&n.push({label:e,text:C(t[e])});let r=t.details??t.output??t.result;if(n.length===0&&r!==e&&n.push(...E(r)),n.length===0&&Array.isArray(t.content)){let e=t.content.flatMap(e=>typeof e==`string`?[e]:typeof e==`object`&&e&&`text`in e&&typeof e.text==`string`?[e.text]:[]).join(``);e&&n.push({label:t.isError===!0?`error`:`stdout`,text:e})}return n.length>0?n:[{label:`result`,text:C(e)}]}function D(e){let t=typeof e.input==`object`&&e.input!==null?e.input:void 0,n=t?.command??t?.code??t?.script;if(!(typeof n!=`string`||!n))return e.kind===`bash`?{code:n,language:`bash`,label:`Bash`}:e.kind===`ipython`?{code:n,language:/^\s*%%bash(?:\s|$)/im.test(n)?`bash`:`python`,label:`IPython`}:e.kind===`diff`?{code:n,language:`text`,label:`Text`}:{code:n,language:`json`,label:`JSON`}}function O(e){if(e.kind!==`openui-html`)return;let t=typeof e.output==`object`&&e.output!==null?e.output:void 0;if(typeof t?.title==`string`&&typeof t.document==`string`)return{title:t.title,document:t.document}}function k({artifact:e,selected:t}){let n=(0,b.useRef)(null);(0,b.useEffect)(()=>{t&&requestAnimationFrame(()=>{n.current?.focus({preventScroll:!0}),n.current?.scrollIntoView({block:`nearest`})})},[t]);let r=O(e);return(0,x.jsxs)(`article`,{ref:n,"data-artifact-id":e.id,tabIndex:-1,className:`min-w-0 rounded-md border border-border/60 bg-background p-2.5 outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:[(0,x.jsxs)(`div`,{className:`mb-2 flex min-w-0 items-center gap-2`,children:[(0,x.jsx)(y,{className:`size-3.5 shrink-0 text-foreground/45`}),(0,x.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs font-medium`,title:e.title,children:e.title||`OpenUI artifact`}),(0,x.jsx)(`span`,{className:`shrink-0 text-micro text-foreground/40`,children:e.status})]}),r?(0,x.jsx)(m,{artifact:r}):(0,x.jsxs)(`div`,{role:`alert`,className:`space-y-2 text-xs text-destructive`,children:[(0,x.jsx)(`p`,{children:`OpenUI artifact data is unavailable.`}),(0,x.jsx)(`pre`,{className:`max-h-48 overflow-auto whitespace-pre-wrap break-words rounded bg-foreground/5 p-2 text-foreground/70`,children:C(e.output)})]})]})}function A({artifact:e,selected:t}){let n=(0,b.useRef)(null),r=t||e.status===`running`,[c,l]=(0,b.useState)(r);(0,b.useEffect)(()=>{t&&(l(!0),requestAnimationFrame(()=>{n.current?.focus({preventScroll:!0}),n.current?.scrollIntoView({block:`nearest`})}))},[t]);let u=D(e),d=E(e.output),p=e.kind===`diff`||e.kind===`refinement`?f(e):void 0;return(0,x.jsxs)(`article`,{ref:n,"data-artifact-id":e.id,tabIndex:-1,className:`rounded-md border border-border/60 bg-background px-2.5 py-2 outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:[p?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(i,{file:p.file,lines:p.lines,status:T(e.status),defaultOpen:r,copyText:p.copyText,maxHeight:240}),d.map(e=>(0,x.jsx)(o,{label:e.label,language:`text`,children:e.text},e.label))]}):null,p?null:(0,x.jsx)(s,{tool:e.kind,title:e.title,status:w(e.status),open:c,onOpenChange:l,defaultOpen:r,kind:e.kind===`bash`||e.kind===`ipython`?`terminal`:`custom`,children:(0,x.jsxs)(`div`,{className:`space-y-3`,children:[u?(0,x.jsx)(a,{code:u.code,language:u.language,languageLabel:u.label,showStatus:!1,showLineNumbers:!1,wrap:!0}):null,d.map(e=>(0,x.jsx)(o,{label:e.label,language:`text`,children:e.text},e.label))]})})]})}function j({block:e,expanded:t,isStreaming:n,onOpenUIAction:r,onToggle:i}){return(0,x.jsxs)(_,{open:t,onOpenChange:i,children:[(0,x.jsxs)(g,{render:(0,x.jsx)(d,{variant:`ghost`,size:`compact`,className:`group w-full justify-start gap-1.5 text-left text-label font-normal text-foreground/65 transition-none hover:bg-foreground/5 hover:text-foreground/80`}),children:[(0,x.jsx)(l,{className:`size-3 shrink-0 text-foreground/35 transition-transform group-data-panel-open:rotate-90`}),(0,x.jsx)(y,{className:`size-3.5 shrink-0 text-foreground/35`}),(0,x.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,title:e.component,children:e.component}),(0,x.jsxs)(`span`,{className:`shrink-0 text-micro text-foreground/40`,children:[`#`,e.ordinal]})]}),(0,x.jsx)(h,{children:(0,x.jsx)(`div`,{className:`mb-1 mt-0.5 flex min-w-0 flex-col overflow-hidden rounded-md border border-border/60 bg-background px-2.5 py-2`,children:(0,x.jsx)(c,{resetKeys:[e.content],children:(0,x.jsx)(p,{content:e.content,isStreaming:n,messageId:e.blockId,onOpenUIAction:r})})})})]})}function M({openUIBlocks:e=[],onOpenUIAction:t,status:n,artifactRuns:r=S,selectedArtifactId:i}){let a=e,[o,s]=(0,b.useState)(null),c=n===`streaming`?a.at(-1)?.blockId:void 0,l=(0,b.useMemo)(()=>r.flatMap(e=>e.artifacts).filter(e=>e.kind!==`recap`),[r]),d=(0,b.useMemo)(()=>l.filter(e=>e.kind===`openui-html`),[l]),f=(0,b.useMemo)(()=>l.filter(e=>e.kind!==`openui-html`&&e.kind!==`ipython`),[l]);return(0,x.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col gap-2 overflow-hidden`,children:[d.length>0?(0,x.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:[(0,x.jsxs)(`div`,{className:`mb-2 flex min-w-0 items-center gap-2 rounded-sm bg-foreground/5 px-2 py-1.5`,children:[(0,x.jsx)(y,{className:`size-3.5 shrink-0 text-foreground/45`}),(0,x.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-label font-medium text-foreground/70`,children:`OpenUI artifacts`}),(0,x.jsx)(`span`,{className:`shrink-0 text-micro text-foreground/40`,children:d.length})]}),(0,x.jsx)(`div`,{className:`space-y-1`,children:d.map(e=>(0,x.jsx)(k,{artifact:e,selected:e.id===i},e.id))})]}):null,f.length>0?(0,x.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:[(0,x.jsxs)(`div`,{className:`mb-2 flex min-w-0 items-center gap-2 rounded-sm bg-foreground/5 px-2 py-1.5`,children:[(0,x.jsx)(u,{className:`size-3.5 shrink-0 text-foreground/45`}),(0,x.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-label font-medium text-foreground/70`,children:`Technical artifacts`}),(0,x.jsx)(`span`,{className:`shrink-0 text-micro text-foreground/40`,children:f.length})]}),(0,x.jsx)(`div`,{className:`space-y-1`,children:f.map(e=>(0,x.jsx)(A,{artifact:e,selected:e.id===i},e.id))})]}):null,(0,x.jsxs)(`div`,{className:`flex min-h-0 flex-col`,children:[(0,x.jsxs)(`div`,{className:`mb-2 flex min-w-0 items-center gap-2 rounded-sm bg-foreground/5 px-2 py-1.5`,children:[(0,x.jsx)(y,{className:`size-3.5 shrink-0 text-foreground/45`}),(0,x.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-label font-medium text-foreground/70`,children:`Generative UI`}),(0,x.jsx)(`span`,{className:`shrink-0 text-micro text-foreground/40`,children:a.length>0?`${a.length}`:`none yet`})]}),a.length===0?(0,x.jsx)(`p`,{className:`px-2 pb-1 text-caption leading-4 text-foreground/40`,children:`OpenUI interfaces the agent generates in this session appear here, and can be re-opened without scrolling the conversation.`}):(0,x.jsx)(`div`,{className:`flex min-h-0 flex-col gap-0.5 overflow-y-auto`,children:a.map(e=>(0,x.jsx)(j,{block:e,expanded:e.blockId===o,isStreaming:e.blockId===c,onOpenUIAction:t,onToggle:()=>s(t=>t===e.blockId?null:e.blockId)},e.blockId))})]})]})}export{M as ArtifactsPanelContent};
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"./createLucideIcon-CQY2ECfR.js";import{a as i,i as a,n as o,t as s}from"./tool-result-DxWDQJSF.js";import{i as c}from"./open-panel-action-message-SdA1VU42.js";import{t as l}from"./chevron-right-BPCB1mOg.js";import{t as u}from"./package-BkC-HSi-.js";import{t as d}from"./button-CWYjn8Zk.js";import{n as f}from"./prime-agent-artifacts-CuR1D_ch.js";import{GenerativeTextRenderer as p,t as m}from"./openui-renderer-DG-iML7M.js";import{n as h,r as g,t as _}from"./collapsible-Bk6zCsRX.js";var v={name:`layout-template`,size:24,node:[[`rect`,{width:`18`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`f1a2em`}],[`rect`,{width:`9`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`jqznyg`}],[`rect`,{width:`5`,height:`7`,x:`16`,y:`14`,rx:`1`,key:`q5h2i8`}]]};v.node;var y=r(v),b=e(t(),1),x=n(),S=[];function C(e){if(typeof e==`string`)return e;if(e==null)return``;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function w(e){return e===`running`?`running`:e===`error`?`error`:e===`cancelled`?`cancelled`:`success`}function T(e){return e===`running`?`streaming`:e===`error`?`error`:e===`cancelled`?`cancelled`:`complete`}function E(e){let t=typeof e==`object`&&e?e:void 0;if(!t)return e===void 0?[]:[{label:`result`,text:C(e)}];let n=[];for(let e of[`stdout`,`stderr`,`result`,`error`])t[e]!==void 0&&t[e]!==``&&n.push({label:e,text:C(t[e])});let r=t.details??t.output??t.result;if(n.length===0&&r!==e&&n.push(...E(r)),n.length===0&&Array.isArray(t.content)){let e=t.content.flatMap(e=>typeof e==`string`?[e]:typeof e==`object`&&e&&`text`in e&&typeof e.text==`string`?[e.text]:[]).join(``);e&&n.push({label:t.isError===!0?`error`:`stdout`,text:e})}return n.length>0?n:[{label:`result`,text:C(e)}]}function D(e){let t=typeof e.input==`object`&&e.input!==null?e.input:void 0,n=t?.command??t?.code??t?.script;if(!(typeof n!=`string`||!n))return e.kind===`bash`?{code:n,language:`bash`,label:`Bash`}:e.kind===`ipython`?{code:n,language:/^\s*%%bash(?:\s|$)/im.test(n)?`bash`:`python`,label:`CPython`}:e.kind===`diff`?{code:n,language:`text`,label:`Text`}:{code:n,language:`json`,label:`JSON`}}function O(e){if(e.kind!==`openui-html`)return;let t=typeof e.output==`object`&&e.output!==null?e.output:void 0;if(typeof t?.title==`string`&&typeof t.document==`string`)return{title:t.title,document:t.document}}function k({artifact:e,selected:t}){let n=(0,b.useRef)(null);(0,b.useEffect)(()=>{t&&requestAnimationFrame(()=>{n.current?.focus({preventScroll:!0}),n.current?.scrollIntoView({block:`nearest`})})},[t]);let r=O(e);return(0,x.jsxs)(`article`,{ref:n,"data-artifact-id":e.id,tabIndex:-1,className:`min-w-0 rounded-md border border-border/60 bg-background p-2.5 outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:[(0,x.jsxs)(`div`,{className:`mb-2 flex min-w-0 items-center gap-2`,children:[(0,x.jsx)(y,{className:`size-3.5 shrink-0 text-foreground/45`}),(0,x.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs font-medium`,title:e.title,children:e.title||`OpenUI artifact`}),(0,x.jsx)(`span`,{className:`shrink-0 text-micro text-foreground/40`,children:e.status})]}),r?(0,x.jsx)(m,{artifact:r}):(0,x.jsxs)(`div`,{role:`alert`,className:`space-y-2 text-xs text-destructive`,children:[(0,x.jsx)(`p`,{children:`OpenUI artifact data is unavailable.`}),(0,x.jsx)(`pre`,{className:`max-h-48 overflow-auto whitespace-pre-wrap break-words rounded bg-foreground/5 p-2 text-foreground/70`,children:C(e.output)})]})]})}function A({artifact:e,selected:t}){let n=(0,b.useRef)(null),r=t||e.status===`running`,[c,l]=(0,b.useState)(r);(0,b.useEffect)(()=>{t&&(l(!0),requestAnimationFrame(()=>{n.current?.focus({preventScroll:!0}),n.current?.scrollIntoView({block:`nearest`})}))},[t]);let u=D(e),d=E(e.output),p=e.kind===`diff`||e.kind===`refinement`?f(e):void 0;return(0,x.jsxs)(`article`,{ref:n,"data-artifact-id":e.id,tabIndex:-1,className:`rounded-md border border-border/60 bg-background px-2.5 py-2 outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:[p?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(i,{file:p.file,lines:p.lines,status:T(e.status),defaultOpen:r,copyText:p.copyText,maxHeight:240}),d.map(e=>(0,x.jsx)(o,{label:e.label,language:`text`,children:e.text},e.label))]}):null,p?null:(0,x.jsx)(s,{tool:e.kind,title:e.title,status:w(e.status),open:c,onOpenChange:l,defaultOpen:r,kind:e.kind===`bash`||e.kind===`ipython`?`terminal`:`custom`,children:(0,x.jsxs)(`div`,{className:`space-y-3`,children:[u?(0,x.jsx)(a,{code:u.code,language:u.language,languageLabel:u.label,showStatus:!1,showLineNumbers:!1,wrap:!0}):null,d.map(e=>(0,x.jsx)(o,{label:e.label,language:`text`,children:e.text},e.label))]})})]})}function j({block:e,expanded:t,isStreaming:n,onOpenUIAction:r,onToggle:i}){return(0,x.jsxs)(_,{open:t,onOpenChange:i,children:[(0,x.jsxs)(g,{render:(0,x.jsx)(d,{variant:`ghost`,size:`compact`,className:`group w-full justify-start gap-1.5 text-left text-label font-normal text-foreground/65 transition-none hover:bg-foreground/5 hover:text-foreground/80`}),children:[(0,x.jsx)(l,{className:`size-3 shrink-0 text-foreground/35 transition-transform group-data-panel-open:rotate-90`}),(0,x.jsx)(y,{className:`size-3.5 shrink-0 text-foreground/35`}),(0,x.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,title:e.component,children:e.component}),(0,x.jsxs)(`span`,{className:`shrink-0 text-micro text-foreground/40`,children:[`#`,e.ordinal]})]}),(0,x.jsx)(h,{children:(0,x.jsx)(`div`,{className:`mb-1 mt-0.5 flex min-w-0 flex-col overflow-hidden rounded-md border border-border/60 bg-background px-2.5 py-2`,children:(0,x.jsx)(c,{resetKeys:[e.content],children:(0,x.jsx)(p,{content:e.content,isStreaming:n,messageId:e.blockId,onOpenUIAction:r})})})})]})}function M({openUIBlocks:e=[],onOpenUIAction:t,status:n,artifactRuns:r=S,selectedArtifactId:i}){let a=e,[o,s]=(0,b.useState)(null),c=n===`streaming`?a.at(-1)?.blockId:void 0,l=(0,b.useMemo)(()=>r.flatMap(e=>e.artifacts).filter(e=>e.kind!==`recap`),[r]),d=(0,b.useMemo)(()=>l.filter(e=>e.kind===`openui-html`),[l]),f=(0,b.useMemo)(()=>l.filter(e=>e.kind!==`openui-html`&&e.kind!==`ipython`),[l]);return(0,x.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col gap-2 overflow-hidden`,children:[d.length>0?(0,x.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:[(0,x.jsxs)(`div`,{className:`mb-2 flex min-w-0 items-center gap-2 rounded-sm bg-foreground/5 px-2 py-1.5`,children:[(0,x.jsx)(y,{className:`size-3.5 shrink-0 text-foreground/45`}),(0,x.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-label font-medium text-foreground/70`,children:`OpenUI artifacts`}),(0,x.jsx)(`span`,{className:`shrink-0 text-micro text-foreground/40`,children:d.length})]}),(0,x.jsx)(`div`,{className:`space-y-1`,children:d.map(e=>(0,x.jsx)(k,{artifact:e,selected:e.id===i},e.id))})]}):null,f.length>0?(0,x.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:[(0,x.jsxs)(`div`,{className:`mb-2 flex min-w-0 items-center gap-2 rounded-sm bg-foreground/5 px-2 py-1.5`,children:[(0,x.jsx)(u,{className:`size-3.5 shrink-0 text-foreground/45`}),(0,x.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-label font-medium text-foreground/70`,children:`Technical artifacts`}),(0,x.jsx)(`span`,{className:`shrink-0 text-micro text-foreground/40`,children:f.length})]}),(0,x.jsx)(`div`,{className:`space-y-1`,children:f.map(e=>(0,x.jsx)(A,{artifact:e,selected:e.id===i},e.id))})]}):null,(0,x.jsxs)(`div`,{className:`flex min-h-0 flex-col`,children:[(0,x.jsxs)(`div`,{className:`mb-2 flex min-w-0 items-center gap-2 rounded-sm bg-foreground/5 px-2 py-1.5`,children:[(0,x.jsx)(y,{className:`size-3.5 shrink-0 text-foreground/45`}),(0,x.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-label font-medium text-foreground/70`,children:`Generative UI`}),(0,x.jsx)(`span`,{className:`shrink-0 text-micro text-foreground/40`,children:a.length>0?`${a.length}`:`none yet`})]}),a.length===0?(0,x.jsx)(`p`,{className:`px-2 pb-1 text-caption leading-4 text-foreground/40`,children:`OpenUI interfaces the agent generates in this session appear here, and can be re-opened without scrolling the conversation.`}):(0,x.jsx)(`div`,{className:`flex min-h-0 flex-col gap-0.5 overflow-y-auto`,children:a.map(e=>(0,x.jsx)(j,{block:e,expanded:e.blockId===o,isStreaming:e.blockId===c,onOpenUIAction:t,onToggle:()=>s(t=>t===e.blockId?null:e.blockId)},e.blockId))})]})]})}export{M as ArtifactsPanelContent};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./react-Cvdyeg_0.js";import{t as n}from"./jsx-runtime-NZYk81nU.js";import{t as r}from"./createLucideIcon-CQY2ECfR.js";import{i,n as a,r as o,t as s}from"./sun-C7zg8Oas.js";import{t as c}from"./right-panel-registry-BkBAryPm.js";import{t as l}from"./plus-DUP2JPVG.js";import{t as u}from"./square-BbTF3gLc.js";import{a as d,c as f,i as p,n as m,o as h,r as g,s as _}from"./command-xo-NK4xO.js";var v={name:`rotate-ccw-clock`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]],aliases:[`history`]};v.node;var y=r(v),b=e(t(),1),x=n();function S({open:e,onOpenChange:t,onNewSession:n,onStop:r,onResumeSession:v,onSetRightPanel:S,onThemeChange:C,sessions:w,isStreaming:T,themePreference:E}){let[D,O]=(0,b.useState)(``),[k,A]=(0,b.useState)(e);e!==k&&(A(e),e&&O(``));let j=e=>{e(),t(!1)};return(0,x.jsxs)(m,{open:e,onOpenChange:t,children:[(0,x.jsx)(d,{placeholder:`Type a command or search…`,value:D,onValueChange:O}),(0,x.jsxs)(_,{children:[(0,x.jsx)(g,{children:`No commands found.`}),(0,x.jsxs)(p,{heading:`Actions`,children:[(0,x.jsxs)(h,{onSelect:()=>j(n),keywords:[`new`,`session`,`chat`],children:[(0,x.jsx)(l,{className:`mr-2 size-4`}),(0,x.jsx)(`span`,{children:`New session`})]}),T&&(0,x.jsxs)(h,{onSelect:()=>j(r),keywords:[`stop`,`abort`,`cancel`],children:[(0,x.jsx)(u,{className:`mr-2 size-4`}),(0,x.jsx)(`span`,{children:`Stop generation`})]})]}),(0,x.jsx)(f,{}),(0,x.jsx)(p,{heading:`Panels`,children:c.map(e=>{let t=e.icon;return(0,x.jsxs)(h,{onSelect:()=>j(()=>S(e.id)),keywords:e.commandKeywords,children:[(0,x.jsx)(t,{}),(0,x.jsx)(`span`,{children:e.commandLabel})]},e.id)})}),w.length>0&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(f,{}),(0,x.jsx)(p,{heading:`Sessions`,children:w.map(e=>{let t=e.title;return(0,x.jsxs)(h,{onSelect:()=>j(()=>v(e)),keywords:[`session`,t],children:[(0,x.jsx)(y,{className:`mr-2 size-4`}),(0,x.jsx)(`span`,{className:`truncate`,children:t})]},e.sessionId)})})]}),(0,x.jsx)(f,{}),(0,x.jsxs)(p,{heading:`Theme`,children:[(0,x.jsxs)(h,{onSelect:()=>j(()=>C(`light`)),keywords:[`theme`,`light`],children:[(0,x.jsx)(s,{className:`mr-2 size-4`}),(0,x.jsx)(`span`,{children:`Light`}),E===`light`&&(0,x.jsx)(i,{className:`ml-auto size-3 opacity-50`})]}),(0,x.jsxs)(h,{onSelect:()=>j(()=>C(`dark`)),keywords:[`theme`,`dark`],children:[(0,x.jsx)(a,{className:`mr-2 size-4`}),(0,x.jsx)(`span`,{children:`Dark`}),E===`dark`&&(0,x.jsx)(i,{className:`ml-auto size-3 opacity-50`})]}),(0,x.jsxs)(h,{onSelect:()=>j(()=>C(`system`)),keywords:[`theme`,`system`],children:[(0,x.jsx)(o,{className:`mr-2 size-4`}),(0,x.jsx)(`span`,{children:`System`}),E===`system`&&(0,x.jsx)(i,{className:`ml-auto size-3 opacity-50`})]})]})]})]})}export{S as ChatCommandPalette};
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"./createLucideIcon-CQY2ECfR.js";import{i,n as a,r as o,t as s}from"./sun-C7zg8Oas.js";import{t as c}from"./right-panel-registry-HNH3niQ8.js";import{t as l}from"./plus-DUP2JPVG.js";import{t as u}from"./square-BbTF3gLc.js";import{a as d,c as f,i as p,n as m,o as h,r as g,s as _}from"./command-xo-NK4xO.js";var v={name:`rotate-ccw-clock`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]],aliases:[`history`]};v.node;var y=r(v),b=e(t(),1),x=n();function S({open:e,onOpenChange:t,onNewSession:n,onStop:r,onResumeSession:v,onSetRightPanel:S,onThemeChange:C,sessions:w,isStreaming:T,themePreference:E}){let[D,O]=(0,b.useState)(``),[k,A]=(0,b.useState)(e);e!==k&&(A(e),e&&O(``));let j=e=>{e(),t(!1)};return(0,x.jsxs)(m,{open:e,onOpenChange:t,children:[(0,x.jsx)(d,{placeholder:`Type a command or search…`,value:D,onValueChange:O}),(0,x.jsxs)(_,{children:[(0,x.jsx)(g,{children:`No commands found.`}),(0,x.jsxs)(p,{heading:`Actions`,children:[(0,x.jsxs)(h,{onSelect:()=>j(n),keywords:[`new`,`session`,`chat`],children:[(0,x.jsx)(l,{className:`mr-2 size-4`}),(0,x.jsx)(`span`,{children:`New session`})]}),T&&(0,x.jsxs)(h,{onSelect:()=>j(r),keywords:[`stop`,`abort`,`cancel`],children:[(0,x.jsx)(u,{className:`mr-2 size-4`}),(0,x.jsx)(`span`,{children:`Stop generation`})]})]}),(0,x.jsx)(f,{}),(0,x.jsx)(p,{heading:`Panels`,children:c.map(e=>{let t=e.icon;return(0,x.jsxs)(h,{onSelect:()=>j(()=>S(e.id)),keywords:e.commandKeywords,children:[(0,x.jsx)(t,{}),(0,x.jsx)(`span`,{children:e.commandLabel})]},e.id)})}),w.length>0&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(f,{}),(0,x.jsx)(p,{heading:`Sessions`,children:w.map(e=>{let t=e.title;return(0,x.jsxs)(h,{onSelect:()=>j(()=>v(e)),keywords:[`session`,t],children:[(0,x.jsx)(y,{className:`mr-2 size-4`}),(0,x.jsx)(`span`,{className:`truncate`,children:t})]},e.sessionId)})})]}),(0,x.jsx)(f,{}),(0,x.jsxs)(p,{heading:`Theme`,children:[(0,x.jsxs)(h,{onSelect:()=>j(()=>C(`light`)),keywords:[`theme`,`light`],children:[(0,x.jsx)(s,{className:`mr-2 size-4`}),(0,x.jsx)(`span`,{children:`Light`}),E===`light`&&(0,x.jsx)(i,{className:`ml-auto size-3 opacity-50`})]}),(0,x.jsxs)(h,{onSelect:()=>j(()=>C(`dark`)),keywords:[`theme`,`dark`],children:[(0,x.jsx)(a,{className:`mr-2 size-4`}),(0,x.jsx)(`span`,{children:`Dark`}),E===`dark`&&(0,x.jsx)(i,{className:`ml-auto size-3 opacity-50`})]}),(0,x.jsxs)(h,{onSelect:()=>j(()=>C(`system`)),keywords:[`theme`,`system`],children:[(0,x.jsx)(o,{className:`mr-2 size-4`}),(0,x.jsx)(`span`,{children:`System`}),E===`system`&&(0,x.jsx)(i,{className:`ml-auto size-3 opacity-50`})]})]})]})]})}export{S as ChatCommandPalette};
@@ -1,3 +1,3 @@
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"./createLucideIcon-CQY2ECfR.js";var a={name:`code-xml`,size:24,node:[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]],aliases:[`code-2`]};a.node;var o=i(a),s=e(t(),1),c=n(),l=(0,s.memo)(function({isPending:e,approveLabel:t,rejectLabel:n,onApprove:r,onReject:i}){let[a,o]=(0,s.useState)(null),l=a===`approved`?`Approved`:t??`Next`,u=a===`rejected`?`Skipped`:n??`Skip`,d=()=>{a||(o(`approved`),r?.())},f=()=>{a||(o(`rejected`),i?.())},p=(0,s.useMemo)(()=>a===`approved`?{label:`Waiting`,dots:!0}:a===`rejected`?{label:`Canceled`,dots:!1}:e?{label:`Starting`,dots:!0}:null,[a,e]);return(0,c.jsxs)(`div`,{className:`flex items-center justify-between border-t border-border bg-muted py-1 pr-2 pl-3`,children:[p?(0,c.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[p.label,p.dots&&(0,c.jsxs)(`span`,{className:`inline-flex`,"aria-hidden":`true`,children:[(0,c.jsx)(`span`,{className:`animate-[loading-dots_1.4s_infinite_0.2s] text-muted-foreground`,children:`.`}),(0,c.jsx)(`span`,{className:`animate-[loading-dots_1.4s_infinite_0.4s] text-muted-foreground`,children:`.`}),(0,c.jsx)(`span`,{className:`animate-[loading-dots_1.4s_infinite_0.6s] text-muted-foreground`,children:`.`})]})]}):(0,c.jsx)(`span`,{"aria-hidden":`true`}),(0,c.jsxs)(`div`,{className:`flex gap-1`,children:[(0,c.jsx)(`button`,{type:`button`,onClick:f,disabled:!!a,className:`h-5 rounded-[4px] px-1.5 text-xs text-muted-foreground transition-[background-color,color,transform] duration-150 hover:bg-muted/50 hover:text-foreground enabled:active:scale-[0.96] disabled:opacity-60 disabled:hover:bg-transparent`,children:u}),(0,c.jsx)(`button`,{type:`button`,onClick:d,disabled:!!a,className:`h-5 rounded-[4px] bg-primary px-1.5 text-xs font-medium text-primary-foreground transition-[background-color,transform] duration-150 hover:bg-primary/90 enabled:active:scale-[0.96] disabled:opacity-60 disabled:hover:bg-primary`,children:l})]})]})});function u({children:e,as:t=`p`,className:n,duration:i=2,spread:a=100,delay:o=0}){let s={"--chat-shimmer-duration":`${i}s`,"--chat-shimmer-spread":`${a}px`,animationDelay:o>0?`${o}s`:void 0,animationDuration:`${i}s`,animationIterationCount:`infinite`,animationTimingFunction:`linear`};return(0,c.jsx)(t,{className:r(`an-text-shimmer`,`an-text-shimmer--active`,n),style:s,children:e})}var d=s.memo(u),f=new Map;function p(e){return{state:e.state,inputJson:JSON.stringify(e.input||{}),outputJson:JSON.stringify(e.output||{})}}function m(e,t){let n=f.get(e),r=p(t);if(!n)return f.set(e,r),!0;let i=n.state!==r.state||n.inputJson!==r.inputJson||n.outputJson!==r.outputJson;return i&&f.set(e,r),i}function h(e,t){if(e.toolCallId!==t.toolCallId||e.type!==t.type)return!1;let n=t.toolCallId;return n?!m(n,t):e.state===t.state}function g(e){return e.output!==void 0&&e.output!==null||e.state===`error`||e.state===`result`}function _(e,t){return h(e.part,t.part)?g(t.part)?!0:e.chatStatus===t.chatStatus:!1}function v(e){if(e<1e3)return``;let t=Math.floor(e/1e3);if(t<60)return`${t}s`;let n=Math.floor(t/60),r=t%60;return r===0?`${n}m`:`${n}m ${r}s`}function y(e,t){let n=e.state!==`output-available`&&e.state!==`output-error`,r=e.state===`output-error`||e.state===`output-available`&&e.output?.success===!1,i=e.state===`output-available`&&!r;return{isPending:n&&t===`streaming`,isError:r,isSuccess:i,isInterrupted:n&&t!==`streaming`&&t!==void 0}}function b(e,t,n){let r=(0,s.useRef)(n);(0,s.useEffect)(()=>{r.current=n},[n]),(0,s.useEffect)(()=>{if(!e)return;let n=setTimeout(()=>r.current(),t);return()=>clearTimeout(n)},[e,t])}function x(e,t){let[n,r]=(0,s.useState)(0);return(0,s.useEffect)(()=>{if(t&&e){r(Date.now()-e);let t=setInterval(()=>{r(Date.now()-e)},1e3);return()=>clearInterval(t)}},[t,e]),n}function S(e){let t=0,n=0;for(let r of e)if(r.lines)for(let e of r.lines)e.startsWith(`+`)?t++:e.startsWith(`-`)&&n++;if(t===0&&n===0)return;let r=[];return t>0&&r.push(`+${t}`),n>0&&r.push(`-${n}`),r.join(` `)}function C(e){let t=[];for(let n of e)if(n.lines)for(let e of n.lines)e.startsWith(`+`)?t.push({type:`add`,content:e.slice(1)}):e.startsWith(`-`)?t.push({type:`remove`,content:e.slice(1)}):e.startsWith(` `)&&t.push({type:`context`,content:e.slice(1)});return t}function w(e){return e===`result`?`complete`:`animating`}function T(e){let t=e.toLowerCase();if(t===`thinking`||t===`reasoning`)return`thinking`;if(t===`websearch`||t===`web_search`||t===`grep`||t===`glob`||t===`webfetch`||t===`web_fetch`)return`search`}function E(e,t){switch(e){case`Bash`:return t?.command?String(t.command).slice(0,80):``;case`Edit`:case`Write`:case`Read`:return t?.file_path?String(t.file_path).split(`/`).pop()??``:``;case`Grep`:return t?.pattern?String(t.pattern):``;case`Glob`:return t?.pattern?String(t.pattern):``;case`WebSearch`:case`web_search`:return t?.query?String(t.query):``;case`WebFetch`:case`web_fetch`:return t?.url?String(t.url).slice(0,60):``;default:return``}}function D(e,t){let{toolName:n,args:r={},result:i}=t,a={id:e,type:`tool-call`,toolName:n===`PlanWrite`?`Plan`:n===`TodoWrite`?`Todo`:n,toolDetail:E(n,r),duration:2**53-1,toolVariant:T(n)};if(n===`Bash`&&(a.bashCommand=r?.command?String(r.command):void 0,t.state===`result`&&i)){if(typeof i==`string`)a.bashOutput=i,a.bashSuccess=!0;else if(typeof i==`object`){let e=typeof i?.stdout==`string`?i.stdout:typeof i?.output==`string`?i.output:``,t=typeof i?.stderr==`string`?i.stderr:``;a.bashOutput=[e,t].filter(Boolean).join(e&&t?`
2
2
  `:``);let n=i?.exitCode??i?.exit_code;a.bashSuccess=n===void 0||n===0}else a.bashOutput=JSON.stringify(i),a.bashSuccess=!0}if((n===`Edit`||n===`Write`||n===`Read`)&&(a.filePath=r?.file_path?String(r.file_path):void 0),n===`Write`){let e=typeof i?.content==`string`?i.content:typeof r?.content==`string`?r.content:``;if(e){let t=e.split(`
3
- `);a.diffStats=`+${t.length}`,a.diffLines=t.map(e=>({type:`add`,content:e}))}}return n===`Edit`&&Array.isArray(i?.structuredPatch)&&(a.diffStats=S(i.structuredPatch),a.diffLines=C(i.structuredPatch)),(n===`WebSearch`||n===`web_search`||n===`Grep`||n===`Glob`)&&(a.searchQuery=r?.query??r?.pattern?String(r?.query??r?.pattern):void 0,a.searchSource=n===`WebSearch`||n===`web_search`?`web`:`code`),a}function O(e){return e===`output-available`?`result`:e===`input-streaming`?`partial-call`:`call`}function k(e,t){let n=O(e.state);return{step:D(e.toolCallId??e.id??t.toLowerCase(),{toolName:t,args:e.input??e.args??{},state:n,result:e.output??e.result}),stepState:w(n)}}function A(e){let t=e.input??e.args??{};return typeof t.code==`string`?t.code:``}function j(e){let t=e.output??e.result;if(!(!t||typeof t!=`object`))return t}function M(...e){for(let t of e)if(t&&t.trim())return t;return``}function N({isPending:e,isBashCell:t,hasError:n,kernelRestarted:r}){return(0,c.jsxs)(`div`,{className:`flex h-7 items-center justify-between pr-2 pl-2.5`,children:[(0,c.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5 overflow-hidden`,children:[(0,c.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-sm bg-muted px-1.5 py-0.5 font-mono text-micro leading-none text-muted-foreground uppercase`,children:[(0,c.jsx)(o,{className:`h-3 w-3`}),t?`shell`:`python`]}),e?(0,c.jsx)(d,{as:`span`,duration:1.2,className:`m-0 inline-flex h-full items-center truncate text-xs leading-none`,children:`Running cell`}):(0,c.jsxs)(`span`,{className:`truncate text-xs text-muted-foreground`,children:[n?`Cell failed`:`Ran cell`,r&&` · kernel restarted`]})]}),e&&(0,c.jsx)(`svg`,{className:`h-3 w-3 shrink-0 animate-spin text-muted-foreground`,viewBox:`0 0 16 16`,fill:`none`,children:(0,c.jsx)(`circle`,{cx:`8`,cy:`8`,r:`6`,stroke:`currentColor`,strokeWidth:`1.5`,strokeDasharray:`28`,strokeDashoffset:`7`,strokeLinecap:`round`})})]})}function P({output:e}){return(0,c.jsxs)(`div`,{className:`mt-1.5 border-t border-dashed border-border/70 pt-1.5 font-mono text-caption leading-[15px]`,children:[(0,c.jsx)(`span`,{className:`text-micro font-semibold uppercase tracking-wider text-warning/90`,children:`Unattributed background output:`}),(0,c.jsx)(`div`,{className:`mt-0.5 max-h-[140px] overflow-auto whitespace-pre-wrap rounded bg-muted/40 p-1.5 text-muted-foreground`,children:e})]})}function F({step:e,state:t,onComplete:n,approval:r,cellIndex:i,part:a}){b(t===`animating`,e.duration,n);let o=t===`animating`,s=A(a),u=j(a),d=typeof a.backgroundOutput==`string`&&a.backgroundOutput.trim()?a.backgroundOutput:typeof u?.backgroundOutput==`string`&&u.backgroundOutput.trim()?u.backgroundOutput:void 0,f=s.trimStart().startsWith(`%%bash`),p=i===void 0?`IPython`:`In [${i}]`,m=M(u?.result,u?.stdout,u?.stderr,u?.error?.evalue),h=!!u?.error||!!u?.errorEname||u?.status===`error`;return(0,c.jsxs)(`div`,{className:`overflow-hidden rounded-chat-tool border border-border bg-muted`,children:[(0,c.jsx)(N,{isPending:o,isBashCell:f,hasError:h,kernelRestarted:u?.kernelRestarted}),(0,c.jsxs)(`div`,{className:`overflow-hidden border-t border-border bg-background px-2.5 py-1.5 font-mono text-label leading-[16px]`,children:[(0,c.jsxs)(`div`,{className:`break-all whitespace-pre-wrap`,children:[(0,c.jsxs)(`span`,{className:`mr-2 text-cyan-600 select-none dark:text-cyan-400`,children:[p,`:`]}),(0,c.jsx)(`span`,{className:`text-foreground`,children:s})]}),!o&&m&&(0,c.jsx)(`div`,{className:`mt-1 max-h-[160px] overflow-hidden whitespace-pre-line ${h?`text-destructive`:`text-muted-foreground`}`,children:m}),d&&(0,c.jsx)(P,{output:d})]}),r&&(0,c.jsx)(l,{isPending:o,...r})]})}var I=new Map,L=0;function R(e){if(!e)return++L;let t=I.get(e);if(t)return t;let n=++L;return I.set(e,n),n}var z=(0,s.memo)(function({part:e}){let t=e.input?.approval??e.args?.approval,{step:n,stepState:r}=k(e,`IPython`),i=R(e.toolCallId);return(0,c.jsx)(F,{step:n,state:r,onComplete:()=>{},approval:t,cellIndex:i,part:e})});export{y as a,d as c,v as i,l,k as n,x as o,_ as r,b as s,z as t,o as u};
3
+ `);a.diffStats=`+${t.length}`,a.diffLines=t.map(e=>({type:`add`,content:e}))}}return n===`Edit`&&Array.isArray(i?.structuredPatch)&&(a.diffStats=S(i.structuredPatch),a.diffLines=C(i.structuredPatch)),(n===`WebSearch`||n===`web_search`||n===`Grep`||n===`Glob`)&&(a.searchQuery=r?.query??r?.pattern?String(r?.query??r?.pattern):void 0,a.searchSource=n===`WebSearch`||n===`web_search`?`web`:`code`),a}function O(e){return e===`output-available`?`result`:e===`input-streaming`?`partial-call`:`call`}function k(e,t){let n=O(e.state);return{step:D(e.toolCallId??e.id??t.toLowerCase(),{toolName:t,args:e.input??e.args??{},state:n,result:e.output??e.result}),stepState:w(n)}}function A(e){let t=e.input??e.args??{};return typeof t.code==`string`?t.code:``}function j(e){let t=e.output??e.result;if(!(!t||typeof t!=`object`))return t}function M(...e){for(let t of e)if(t&&t.trim())return t;return``}function N({isPending:e,isBashCell:t,hasError:n,kernelRestarted:r}){return(0,c.jsxs)(`div`,{className:`flex h-7 items-center justify-between pr-2 pl-2.5`,children:[(0,c.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5 overflow-hidden`,children:[(0,c.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-sm bg-muted px-1.5 py-0.5 font-mono text-micro leading-none text-muted-foreground uppercase`,children:[(0,c.jsx)(o,{className:`h-3 w-3`}),t?`shell`:`python`]}),e?(0,c.jsx)(d,{as:`span`,duration:1.2,className:`m-0 inline-flex h-full items-center truncate text-xs leading-none`,children:`Running cell`}):(0,c.jsxs)(`span`,{className:`truncate text-xs text-muted-foreground`,children:[n?`Cell failed`:`Ran cell`,r&&` · kernel restarted`]})]}),e&&(0,c.jsx)(`svg`,{className:`h-3 w-3 shrink-0 animate-spin text-muted-foreground`,viewBox:`0 0 16 16`,fill:`none`,children:(0,c.jsx)(`circle`,{cx:`8`,cy:`8`,r:`6`,stroke:`currentColor`,strokeWidth:`1.5`,strokeDasharray:`28`,strokeDashoffset:`7`,strokeLinecap:`round`})})]})}function P({output:e}){return(0,c.jsxs)(`div`,{className:`mt-1.5 border-t border-dashed border-border/70 pt-1.5 font-mono text-caption leading-[15px]`,children:[(0,c.jsx)(`span`,{className:`text-micro font-semibold uppercase tracking-wider text-warning/90`,children:`Unattributed background output:`}),(0,c.jsx)(`div`,{className:`mt-0.5 max-h-[140px] overflow-auto whitespace-pre-wrap rounded bg-muted/40 p-1.5 text-muted-foreground`,children:e})]})}function F({step:e,state:t,onComplete:n,approval:r,cellIndex:i,part:a}){b(t===`animating`,e.duration,n);let o=t===`animating`,s=A(a),u=j(a),d=typeof a.backgroundOutput==`string`&&a.backgroundOutput.trim()?a.backgroundOutput:typeof u?.backgroundOutput==`string`&&u.backgroundOutput.trim()?u.backgroundOutput:void 0,f=s.trimStart().startsWith(`%%bash`),p=i===void 0?`CPython`:`In [${i}]`,m=M(u?.result,u?.stdout,u?.stderr,u?.error?.evalue),h=!!u?.error||!!u?.errorEname||u?.status===`error`;return(0,c.jsxs)(`div`,{className:`overflow-hidden rounded-chat-tool border border-border bg-muted`,children:[(0,c.jsx)(N,{isPending:o,isBashCell:f,hasError:h,kernelRestarted:u?.kernelRestarted}),(0,c.jsxs)(`div`,{className:`overflow-hidden border-t border-border bg-background px-2.5 py-1.5 font-mono text-label leading-[16px]`,children:[(0,c.jsxs)(`div`,{className:`break-all whitespace-pre-wrap`,children:[(0,c.jsxs)(`span`,{className:`mr-2 text-cyan-600 select-none dark:text-cyan-400`,children:[p,`:`]}),(0,c.jsx)(`span`,{className:`text-foreground`,children:s})]}),!o&&m&&(0,c.jsx)(`div`,{className:`mt-1 max-h-[160px] overflow-hidden whitespace-pre-line ${h?`text-destructive`:`text-muted-foreground`}`,children:m}),d&&(0,c.jsx)(P,{output:d})]}),r&&(0,c.jsx)(l,{isPending:o,...r})]})}var I=new Map,L=0;function R(e){if(!e)return++L;let t=I.get(e);if(t)return t;let n=++L;return I.set(e,n),n}var z=(0,s.memo)(function({part:e}){let t=e.input?.approval??e.args?.approval,{step:n,stepState:r}=k(e,`CPython`),i=R(e.toolCallId);return(0,c.jsx)(F,{step:n,state:r,onComplete:()=>{},approval:t,cellIndex:i,part:e})});export{y as a,d as c,v as i,l,k as n,x as o,_ as r,b as s,z as t,o as u};