@qredence/fleet 0.7.0 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/web/client/assets/{artifacts-panel-Qd6JlHzz.js → artifacts-panel-C69vz-oo.js} +1 -1
  3. package/dist/web/client/assets/{badge-BjFxrtmB.js → badge-DOGhnsYk.js} +7 -7
  4. package/dist/web/client/assets/{chat-command-palette-CPlJp2cO.js → chat-command-palette-wyZjTNa8.js} +1 -1
  5. package/dist/web/client/assets/{chunk-YOKDWASO-C8deEx7Z.js → chunk-YOKDWASO-Dego39cu.js} +4 -4
  6. package/dist/web/client/assets/{dist-CZDnnosQ.js → dist-QgsZ1U9l.js} +1 -1
  7. package/dist/web/client/assets/{highlighted-body-KPVGNVTW-CZcNaoxi.js → highlighted-body-KPVGNVTW-CSgDVUQp.js} +1 -1
  8. package/dist/web/client/assets/index-BARp0bjW.js +13 -0
  9. package/dist/web/client/assets/{markdown-code-BqFVdovL.js → markdown-code-DfJbKhL9.js} +1 -1
  10. package/dist/web/client/assets/{markdown-C-Y9gskI.js → markdown-yn-nhRzB.js} +2 -2
  11. package/dist/web/client/assets/mermaid-HWGCJPDP-BpEVCu9T.js +1 -0
  12. package/dist/web/client/assets/{openui-renderer-CH9K7_8t.js → openui-renderer-DrfHxs1t.js} +1 -1
  13. package/dist/web/client/assets/{preload-helper-Czpn1I53.js → preload-helper-BZ1Pz5am.js} +1 -1
  14. package/dist/web/client/assets/{right-panel-registry-BJG8ubHt.js → right-panel-registry-CF7GLJrk.js} +2 -2
  15. package/dist/web/client/assets/{routes-BXFQmjL9.js → routes-DCP1DP1g.js} +4 -4
  16. package/dist/web/client/assets/session-tool-renderer-Yu4G1165.js +1389 -0
  17. package/dist/web/client/assets/{subagent-chat-panel-DQEnhU2t.js → subagent-chat-panel-bVnkDkgs.js} +1 -1
  18. package/dist/web/client/assets/{subagent-transcript-CCpg3uL6.js → subagent-transcript-D_L-8PQi.js} +1 -1
  19. package/dist/web/client/assets/{subagent-utils-DTV2RcFl.js → subagent-utils-D7sXbLsS.js} +2 -2
  20. package/dist/web/client/assets/{subagents-panel-B-X7WPUU.js → subagents-panel-i5-12E1U.js} +1 -1
  21. package/dist/web/client/assets/{tool-result-C5Ixe-AJ.js → tool-result-D7HtJ_yg.js} +2 -2
  22. package/dist/web/client/assets/{workspace-panel-DDjQuELx.js → workspace-panel-Clbmrdza.js} +1 -1
  23. package/dist/web/client/assets/{workspace-path-nav-DmxBrMV6.js → workspace-path-nav-eVT0rYvv.js} +2 -2
  24. package/dist/web/client/bundle-budget.json +5 -5
  25. package/dist/web/server/{_tanstack-start-manifest_v-vL58CVrY-7SDCWIHD.js → _tanstack-start-manifest_v-CaT-3S-N-VAOGUHEJ.js} +9 -9
  26. package/dist/web/server/{artifacts-panel-CozDO7ak-5T4W7RME.js → artifacts-panel-BuAqeJzj-6DYYLKUW.js} +8 -8
  27. package/dist/web/server/{chat-command-palette-CLE-L0qp-ZZNKVTSS.js → chat-command-palette-Ca8gXVi2-P6EOQ43G.js} +5 -5
  28. package/dist/web/server/{chunk-GRGV5FVO.js → chunk-35AFSKDX.js} +3 -3
  29. package/dist/web/server/{chunk-SLRV7YNY.js → chunk-COWE2EJ6.js} +2 -2
  30. package/dist/web/server/{chunk-54UEKLGD.js → chunk-FPPKECLB.js} +5 -5
  31. package/dist/web/server/{chunk-EUWNVEIC.js → chunk-GCDOYNXR.js} +107 -97
  32. package/dist/web/server/{chunk-QCDSLD3L.js → chunk-ITKXE2Q5.js} +252 -214
  33. package/dist/web/server/{chunk-NHV77NOI.js → chunk-J4Y2Z3XM.js} +1 -1
  34. package/dist/web/server/{chunk-RYU7I34A.js → chunk-JFAUSHBI.js} +4 -4
  35. package/dist/web/server/{chunk-D7GSWBRI.js → chunk-K4KN3QBT.js} +1 -1
  36. package/dist/web/server/{chunk-B4EBMF5J.js → chunk-M7BTY55G.js} +2 -2
  37. package/dist/web/server/{chunk-XJHYJLGU.js → chunk-PHHC52CO.js} +3 -3
  38. package/dist/web/server/{chunk-RVDWGK6U.js → chunk-UTV66W5H.js} +3 -3
  39. package/dist/web/server/{chunk-F5DJQ3PQ.js → chunk-WPSI5TBE.js} +1528 -2185
  40. package/dist/web/server/{create-project-dialog-CReZdM5g-2V7C5J67.js → create-project-dialog-DCvdysey-IZUGGDAN.js} +5 -5
  41. package/dist/web/server/{empty-plugin-adapters-Cqtvkauv-ILKI7W7V.js → empty-plugin-adapters-DOl-E2pL-RKRSN75W.js} +1 -1
  42. package/dist/web/server/{fork-picker-dialog-CXcLEaor-6SVM5RJO.js → fork-picker-dialog-QH00XmqX-6YLU5REF.js} +3 -3
  43. package/dist/web/server/{message-queue-Q_Q6hbqc-AOV2PSCX.js → message-queue-BzEFQR8k-2W53EW32.js} +3 -3
  44. package/dist/web/server/{model-selector-list-BOKU5_Z3-III72ZT2.js → model-selector-list-BjoXmw92-TEKBPB3E.js} +5 -5
  45. package/dist/web/server/{openui-renderer-VuQOQeAP-XBOR3XGN.js → openui-renderer-CJ7Q2zZ_-FPXKZPSO.js} +5 -5
  46. package/dist/web/server/{resources-panel-Cnz-X1bx-TT5KVROR.js → resources-panel-yVB4xF_K-OHFHXVU4.js} +4 -4
  47. package/dist/web/server/{router-C437aaqv-72HBLLJI.js → router-UgU5vJxm-R33FGTXY.js} +2 -2
  48. package/dist/web/server/{routes-BkVN3m9i-PYNMNLQ5.js → routes-Cbbo-jh9-ZUPH4SJD.js} +2 -2
  49. package/dist/web/server/server.js +2410 -1672
  50. package/dist/web/server/{session-reasoning-panel-2_TR5nKM-KA5OY7ZV.js → session-reasoning-panel-C50VbaQ8-4YLMVVY6.js} +4 -4
  51. package/dist/web/server/{session-tool-renderer-BFEWy2Pk-JTSYUPO5.js → session-tool-renderer-QcAkYD-V-6RXRKDH6.js} +5 -5
  52. package/dist/web/server/{session-tree-panel-3y9LVA0A-4V4TJX62.js → session-tree-panel-CL49XSTK-4ZPK6AIV.js} +3 -3
  53. package/dist/web/server/{settings-dialog-DgZ8Z5e4-6T5AS2EB.js → settings-dialog-DG9HEZeP-TWDRDGMN.js} +6 -6
  54. package/dist/web/server/{start-QK6aG02q-EMREW2SB.js → start-DEejK9Uj-FODAOTAO.js} +1 -1
  55. package/dist/web/server/{subagent-chat-panel-B0pmAxCp-DKXNAOUU.js → subagent-chat-panel-Cg2CxshI-WWGFHTIF.js} +7 -7
  56. package/dist/web/server/{subagents-panel-FUUT0t1i-5ZKJ2QAJ.js → subagents-panel-aC3Eo-MR-RNIPLCZQ.js} +7 -7
  57. package/dist/web/server/{workspace-panel-BbI1N4f8-WYOEVH4G.js → workspace-panel-DfdFkgHU-6HIOXRBX.js} +4 -4
  58. package/package.json +2 -2
  59. package/dist/web/client/assets/index-D3HpiAnD.js +0 -12
  60. package/dist/web/client/assets/mermaid-HWGCJPDP-CVNXPao6.js +0 -1
  61. package/dist/web/client/assets/session-tool-renderer-mOZdkbiU.js +0 -1389
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.7.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 38b9e27: Bump the vendored `use-sync-external-store` dependency from 1.6.0 to 1.7.0. No user-facing behavior change is expected; this keeps Fleet aligned with the current React ecosystem patch.
8
+
3
9
  ## 0.7.0
4
10
 
5
11
  ### Minor 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"./button-BJyg7l5W.js";import{t as i}from"./createLucideIcon-CQY2ECfR.js";import{i as a,n as o,r as s,t as c}from"./tool-result-C5Ixe-AJ.js";import{t as l}from"./chevron-right-BPCB1mOg.js";import{t as u}from"./package-BkC-HSi-.js";import{r as d,t as f}from"./openui-renderer-CH9K7_8t.js";import{n as p}from"./prime-agent-artifacts-C-g1VPiW.js";import{Z as m}from"./badge-BjFxrtmB.js";import{n as h,r as g,t as _}from"./collapsible-DsbKpD_Y.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=i(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)(d,{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`,[i,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),f=e.kind===`diff`||e.kind===`refinement`?p(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:[f?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(s,{file:f.file,lines:f.lines,status:T(e.status),defaultOpen:r,copyText:f.copyText,maxHeight:240}),d.map(e=>(0,x.jsx)(o,{label:e.label,language:`text`,children:e.text},e.label))]}):null,f?null:(0,x.jsx)(c,{tool:e.kind,title:e.title,status:w(e.status),open:i,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:i,onToggle:a}){return(0,x.jsxs)(_,{open:t,onOpenChange:a,children:[(0,x.jsxs)(g,{render:(0,x.jsx)(r,{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)(m,{resetKeys:[e.content],children:(0,x.jsx)(f,{content:e.content,isStreaming:n,messageId:e.blockId,onOpenUIAction:i})})})})]})}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),[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"./button-BJyg7l5W.js";import{t as i}from"./createLucideIcon-CQY2ECfR.js";import{i as a,n as o,r as s,t as c}from"./tool-result-D7HtJ_yg.js";import{t as l}from"./chevron-right-BPCB1mOg.js";import{t as u}from"./package-BkC-HSi-.js";import{r as d,t as f}from"./openui-renderer-DrfHxs1t.js";import{n as p}from"./prime-agent-artifacts-C-g1VPiW.js";import{Z as m}from"./badge-DOGhnsYk.js";import{n as h,r as g,t as _}from"./collapsible-DsbKpD_Y.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=i(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)(d,{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`,[i,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),f=e.kind===`diff`||e.kind===`refinement`?p(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:[f?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(s,{file:f.file,lines:f.lines,status:T(e.status),defaultOpen:r,copyText:f.copyText,maxHeight:240}),d.map(e=>(0,x.jsx)(o,{label:e.label,language:`text`,children:e.text},e.label))]}):null,f?null:(0,x.jsx)(c,{tool:e.kind,title:e.title,status:w(e.status),open:i,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:i,onToggle:a}){return(0,x.jsxs)(_,{open:t,onOpenChange:a,children:[(0,x.jsxs)(g,{render:(0,x.jsx)(r,{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)(m,{resetKeys:[e.content],children:(0,x.jsx)(f,{content:e.content,isStreaming:n,messageId:e.blockId,onOpenUIAction:i})})})})]})}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),[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};