@qredence/fleet 0.5.1 → 0.5.5

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 (78) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/bin/fleet-prime.mjs +6 -0
  3. package/dist/web/client/assets/action-swap-roll-DX5o_33Q.js +1 -0
  4. package/dist/web/client/assets/artifacts-panel-C3yewUBP.js +1 -0
  5. package/dist/web/client/assets/{chat-CsepBQwy.js → chat-W-yOMyG_.js} +1 -1
  6. package/dist/web/client/assets/chat-command-palette-D0xDK1j4.js +1 -0
  7. package/dist/web/client/assets/command-CQzrtjyj.js +2 -0
  8. package/dist/web/client/assets/{fleet-pi-tool-renderer-BD_ZAjlG.js → fleet-pi-tool-renderer-B0Y7ou0U.js} +16 -16
  9. package/dist/web/client/assets/generative-text-renderer-SS9c1kNX.js +6 -0
  10. package/dist/web/client/assets/globals-D_Hy9bT1.css +2 -0
  11. package/dist/web/client/assets/{index-DweoFRMs.js → index-C9FloFgj.js} +2 -2
  12. package/dist/web/client/assets/{ipython-tool-BfeIa0nK.js → ipython-tool-BrMePqD-.js} +1 -1
  13. package/dist/web/client/assets/{openui-renderer-DlUo6ehT.js → openui-renderer-CCfQqUfE.js} +5 -5
  14. package/dist/web/client/assets/{prime-agent-artifacts-CHGb5V_j.js → prime-agent-artifacts-C-g1VPiW.js} +1 -1
  15. package/dist/web/client/assets/range-65lubOFp.js +2 -0
  16. package/dist/web/client/assets/repl-panel-CCh4ly7J.js +1 -0
  17. package/dist/web/client/assets/routes-DSTyx_J0.js +16 -0
  18. package/dist/web/client/assets/session-insights-panel-CQdT90Op.js +1 -0
  19. package/dist/web/client/assets/subagent-chat-panel-D-qw4uWb.js +1 -0
  20. package/dist/web/client/assets/subagent-transcript-C7oRwEEP.js +1 -0
  21. package/dist/web/client/assets/subagents-panel-aSMWZP9p.js +1 -0
  22. package/dist/web/client/assets/{tool-result-CBzwwUE9.js → tool-result-C2NvnN32.js} +3 -3
  23. package/dist/web/server/{_tanstack-start-manifest_v-bDUlyKY0-KFW35JRO.js → _tanstack-start-manifest_v-DZc7dwm7-6ZQLGXB7.js} +13 -13
  24. package/dist/web/server/{artifacts-panel-D9w1DHAN-FGRDCYU2.js → artifacts-panel-Bt7YUzm4-NCBMXJ25.js} +15 -15
  25. package/dist/web/server/{chat-command-palette-BaenPkCN-BHSOPGU4.js → chat-command-palette-Co1L3rUY-RQLNME4T.js} +33 -12
  26. package/dist/web/server/{chunk-KPNGZR2R.js → chunk-2V6B62OF.js} +204 -204
  27. package/dist/web/server/{chunk-44IVTHDV.js → chunk-3HUI75QM.js} +60 -60
  28. package/dist/web/server/{chunk-5AVQZ4AZ.js → chunk-4UBOIY2S.js} +2 -1
  29. package/dist/web/server/{chunk-Y6LJ4WBI.js → chunk-56HSKUBD.js} +699 -691
  30. package/dist/web/server/{chunk-RPROZ2JC.js → chunk-5RQ6QAZX.js} +133 -133
  31. package/dist/web/server/{chunk-PWK2HJIV.js → chunk-6D524OCJ.js} +175 -175
  32. package/dist/web/server/{chunk-FBOO3G67.js → chunk-AECEK3K7.js} +6 -6
  33. package/dist/web/server/{chunk-VHCAD46L.js → chunk-AWFOBHH4.js} +4 -4
  34. package/dist/web/server/{chunk-FVWDJNXR.js → chunk-BEMDNODD.js} +1 -1
  35. package/dist/web/server/{chunk-X2TUFLTP.js → chunk-BLVCDQ7E.js} +438 -438
  36. package/dist/web/server/{chunk-EIVNRYP3.js → chunk-FZRBAPUM.js} +2 -2
  37. package/dist/web/server/chunk-KOIPYBJF.js +3773 -0
  38. package/dist/web/server/{chunk-XYYNYFFD.js → chunk-LSIHVSUT.js} +2 -2
  39. package/dist/web/server/{chunk-H64JLONZ.js → chunk-PDRD2X5G.js} +2 -2
  40. package/dist/web/server/{chunk-FE4KN6T2.js → chunk-RX62LUDV.js} +4 -4
  41. package/dist/web/server/chunk-SR65ARVS.js +192 -0
  42. package/dist/web/server/{chunk-WK7CQS2N.js → chunk-SZ65K4CO.js} +48 -48
  43. package/dist/web/server/{chunk-DO3TVNGA.js → chunk-TO3YPLNZ.js} +6 -6
  44. package/dist/web/server/{chunk-3IKSPTYI.js → chunk-UKINNXJY.js} +2 -2
  45. package/dist/web/server/{chunk-M2FGGPNA.js → chunk-VGDP4YDU.js} +70 -45
  46. package/dist/web/server/{chunk-PCJ5EKFE.js → chunk-VRLTWOVJ.js} +11 -6
  47. package/dist/web/server/{chunk-HBZ6YKRB.js → chunk-WN77JNYY.js} +2 -2
  48. package/dist/web/server/{chunk-2U7PWSJX.js → chunk-WZNZQNI4.js} +231 -3633
  49. package/dist/web/server/{chunk-B2F6MLVZ.js → chunk-XFVL5ITL.js} +2246 -2228
  50. package/dist/web/server/{chunk-3GSFXWL5.js → chunk-XLCTCC4W.js} +3 -3
  51. package/dist/web/server/{chunk-AZZHUVJR.js → chunk-Y4MHIA7B.js} +18 -26
  52. package/dist/web/server/{fleet-pi-tool-renderer-lJvZWmBJ-4M5YI6VS.js → fleet-pi-tool-renderer-CE45vM6T-2UQN6RJM.js} +11 -9
  53. package/dist/web/server/{fork-picker-dialog-BZzfxdQd-Y725VJ7G.js → fork-picker-dialog-DCzuGelH-TN2Q5OXI.js} +5 -5
  54. package/dist/web/server/{openui-renderer-Cg4RSE9k-7BTJIYZJ.js → openui-renderer-c36_GYes-HX46N4M5.js} +11 -11
  55. package/dist/web/server/{repl-panel-BEQrC2ef-V3YEZ7EO.js → repl-panel-D9E8nkQy-L45ZNG2V.js} +4 -3
  56. package/dist/web/server/{router-CEahIUpn-SRG7XKIH.js → router-_ZpegqiQ-QIE44PIB.js} +1737 -1370
  57. package/dist/web/server/{routes-BznemByz-F4DJAYIM.js → routes-Ct81-8Tq-LHRMOS7R.js} +2882 -2330
  58. package/dist/web/server/server.js +3 -3
  59. package/dist/web/server/{session-insights-panel-JfeTHE0d-3HZB3ZWI.js → session-insights-panel-BHZyKDTo-LRMAMA3O.js} +4 -2
  60. package/dist/web/server/{settings-dialog-DgeBMORv-7SRSENPM.js → settings-dialog-B4uUS6f--AZ4I4ZOT.js} +142 -142
  61. package/dist/web/server/{start-CLAD7RcD-56S4BWMM.js → start-BYVnok_H-IA6TWGA3.js} +1 -1
  62. package/dist/web/server/subagent-chat-panel-C97S3WID-DLOAD5TG.js +63 -0
  63. package/dist/web/server/subagents-panel-iHpvMIZy-LI6XK66M.js +181 -0
  64. package/dist/web/server/{workspace-panel-y54P79_B-VPIYUXF6.js → workspace-panel-CHPoiXEo-YB4WS3MK.js} +2 -2
  65. package/package.json +5 -5
  66. package/dist/web/client/assets/artifacts-panel-CX62LQ13.js +0 -1
  67. package/dist/web/client/assets/chat-command-palette-C4sSf8Kg.js +0 -1
  68. package/dist/web/client/assets/collapsible-DmyYcezk.js +0 -1
  69. package/dist/web/client/assets/command-CB6emP8m.js +0 -2
  70. package/dist/web/client/assets/conversation-turns-ByFoWPXe.js +0 -6
  71. package/dist/web/client/assets/globals-CqqQdk2S.css +0 -2
  72. package/dist/web/client/assets/range-vSJ7Ux_5.js +0 -2
  73. package/dist/web/client/assets/repl-panel-DiGS6uCw.js +0 -1
  74. package/dist/web/client/assets/routes-CxlNCi_v.js +0 -16
  75. package/dist/web/client/assets/session-insights-panel-DwmwiikS.js +0 -1
  76. package/dist/web/client/assets/subagents-panel-DGnsK6Nx.js +0 -1
  77. package/dist/web/server/chunk-ZEVZFLIY.js +0 -334
  78. package/dist/web/server/subagents-panel-CzZe3co7-2VZ5JTWF.js +0 -332
@@ -1,3 +1,3 @@
1
1
  import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t}from"./bundle-mjs-DKHVkVWu.js";import{t as n}from"./jsx-runtime-NZYk81nU.js";import{t as r}from"./utils-Eg7xtNmV.js";import{t as i}from"./createLucideIcon-DwxZHm0M.js";import"./cn-C8c0S2mI.js";var a=i(`code-xml`,[[`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`}]]),o=e(t(),1),s=n();function c({children:e,as:t=`p`,className:n,duration:i=2,spread:a=100,delay:o=0}){let c={"--an-shimmer-duration":`${i}s`,"--an-shimmer-spread":`${a}px`,animationDelay:o>0?`${o}s`:void 0,animationDuration:`${i}s`,animationIterationCount:`infinite`,animationTimingFunction:`linear`};return(0,s.jsx)(t,{className:r(`an-text-shimmer`,`an-text-shimmer--active`,n),style:c,children:e})}var l=o.memo(c);function u(e,t,n){let r=(0,o.useRef)(n);(0,o.useEffect)(()=>{r.current=n},[n]),(0,o.useEffect)(()=>{if(!e)return;let n=setTimeout(()=>r.current(),t);return()=>clearTimeout(n)},[e,t])}function d(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 f(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 p(e){return e===`result`?`complete`:`animating`}function m(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 h(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 g(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:h(n,r),duration:2**53-1,toolVariant:m(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}))}}if(n===`Edit`&&Array.isArray(i?.structuredPatch)&&(a.diffStats=d(i.structuredPatch),a.diffLines=f(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`),n.toLowerCase()===`thinking`||n.toLowerCase()===`reasoning`){let e=typeof r?.thought==`string`?r.thought:typeof r?.text==`string`?r.text:void 0,t=typeof i==`string`?i:i&&typeof i==`object`&&typeof i.text==`string`?i.text:typeof i==`object`&&i&&typeof i.thought==`string`?i.thought:void 0;a.thoughtContent=e??t}return a}function _(e){return e===`output-available`?`result`:e===`input-streaming`?`partial-call`:`call`}function v(e,t){let n=_(e.state);return{step:g(e.toolCallId??e.id??t.toLowerCase(),{toolName:t,args:e.input??e.args??{},state:n,result:e.output??e.result}),stepState:p(n)}}var y=(0,o.memo)(function({isPending:e,approveLabel:t,rejectLabel:n,onApprove:r,onReject:i}){let[a,c]=(0,o.useState)(null),l=a===`approved`?`Approved`:t??`Next`,u=a===`rejected`?`Skipped`:n??`Skip`,d=()=>{a||(c(`approved`),r?.())},f=()=>{a||(c(`rejected`),i?.())},p=(0,o.useMemo)(()=>a===`approved`?{label:`Waiting`,dots:!0}:a===`rejected`?{label:`Canceled`,dots:!1}:e?{label:`Starting`,dots:!0}:null,[a,e]);return(0,s.jsxs)(`div`,{className:`flex items-center justify-between border-t border-border bg-an-tool-background py-1 pr-2 pl-3`,children:[p?(0,s.jsxs)(`span`,{className:`text-xs text-an-tool-color-muted`,children:[p.label,p.dots&&(0,s.jsxs)(`span`,{className:`inline-flex`,"aria-hidden":`true`,children:[(0,s.jsx)(`span`,{className:`animate-[loading-dots_1.4s_infinite_0.2s] text-an-tool-color-muted`,children:`.`}),(0,s.jsx)(`span`,{className:`animate-[loading-dots_1.4s_infinite_0.4s] text-an-tool-color-muted`,children:`.`}),(0,s.jsx)(`span`,{className:`animate-[loading-dots_1.4s_infinite_0.6s] text-an-tool-color-muted`,children:`.`})]})]}):(0,s.jsx)(`span`,{"aria-hidden":`true`}),(0,s.jsxs)(`div`,{className:`flex gap-1`,children:[(0,s.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-an-tool-color active:scale-[0.98] disabled:opacity-60 disabled:hover:bg-transparent disabled:active:scale-100`,children:u}),(0,s.jsx)(`button`,{type:`button`,onClick:d,disabled:!!a,className:`h-5 rounded-[4px] bg-an-primary-color px-1.5 text-xs font-medium text-an-send-button-color transition-[background-color,transform] duration-150 hover:bg-an-primary-color/90 active:scale-[0.98] disabled:opacity-60 disabled:hover:bg-an-primary-color disabled:active:scale-100`,children:l})]})]})});function b(e){let t=e.input??e.args??{};return typeof t.code==`string`?t.code:``}function x(e){let t=e.output??e.result;if(!(!t||typeof t!=`object`))return t}function S(...e){for(let t of e)if(t&&t.trim())return t;return``}function C({step:e,state:t,onComplete:n,approval:r,cellIndex:i,part:o}){u(t===`animating`,e.duration,n);let c=t===`animating`,d=b(o),f=x(o),p=d.trimStart().startsWith(`%%bash`),m=i===void 0?`IPython`:`In [${i}]`,h=S(f?.result,f?.stdout,f?.stderr,f?.error?.evalue),g=!!f?.error||!!f?.errorEname||f?.status===`error`;return(0,s.jsxs)(`div`,{className:`overflow-hidden rounded-an-tool-border-radius border border-border bg-an-tool-background`,children:[(0,s.jsxs)(`div`,{className:`flex h-7 items-center justify-between pr-2 pl-2.5`,children:[(0,s.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5 overflow-hidden`,children:[(0,s.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-sm bg-muted px-1.5 py-0.5 font-mono text-[10px] leading-none text-muted-foreground uppercase`,children:[(0,s.jsx)(a,{className:`h-3 w-3`}),p?`shell`:`python`]}),c?(0,s.jsx)(l,{as:`span`,duration:1.2,className:`m-0 inline-flex h-full items-center truncate text-xs leading-none`,children:`Running cell`}):(0,s.jsxs)(`span`,{className:`truncate text-xs text-muted-foreground`,children:[g?`Cell failed`:`Ran cell`,f?.kernelRestarted&&` · kernel restarted`]})]}),c&&(0,s.jsx)(`svg`,{className:`h-3 w-3 shrink-0 animate-spin text-muted-foreground`,viewBox:`0 0 16 16`,fill:`none`,children:(0,s.jsx)(`circle`,{cx:`8`,cy:`8`,r:`6`,stroke:`currentColor`,strokeWidth:`1.5`,strokeDasharray:`28`,strokeDashoffset:`7`,strokeLinecap:`round`})})]}),(0,s.jsxs)(`div`,{className:`overflow-hidden border-t border-border bg-background px-2.5 py-1.5 font-mono text-[12px] leading-[16px]`,children:[(0,s.jsxs)(`div`,{className:`break-all whitespace-pre-wrap`,children:[(0,s.jsxs)(`span`,{className:`mr-2 text-cyan-600 select-none dark:text-cyan-400`,children:[m,`:`]}),(0,s.jsx)(`span`,{className:`text-foreground`,children:d})]}),!c&&h&&(0,s.jsx)(`div`,{className:`mt-1 max-h-[160px] overflow-hidden whitespace-pre-line ${g?`text-red-600 dark:text-red-400`:`text-muted-foreground`}`,children:h})]}),r&&(0,s.jsx)(y,{isPending:c,...r})]})}var w=new Map,T=0;function E(e){if(!e)return++T;let t=w.get(e);if(t)return t;let n=++T;return w.set(e,n),n}var D=(0,o.memo)(function({part:e}){let t=e.input?.approval??e.args?.approval,{step:n,stepState:r}=v(e,`IPython`),i=E(e.toolCallId);return(0,s.jsx)(C,{step:n,state:r,onComplete:()=>{},approval:t,cellIndex:i,part:e})});export{l as a,u as i,y as n,a as o,v as r,D as t};
3
+ `);a.diffStats=`+${t.length}`,a.diffLines=t.map(e=>({type:`add`,content:e}))}}if(n===`Edit`&&Array.isArray(i?.structuredPatch)&&(a.diffStats=d(i.structuredPatch),a.diffLines=f(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`),n.toLowerCase()===`thinking`||n.toLowerCase()===`reasoning`){let e=typeof r?.thought==`string`?r.thought:typeof r?.text==`string`?r.text:void 0,t=typeof i==`string`?i:i&&typeof i==`object`&&typeof i.text==`string`?i.text:typeof i==`object`&&i&&typeof i.thought==`string`?i.thought:void 0;a.thoughtContent=e??t}return a}function _(e){return e===`output-available`?`result`:e===`input-streaming`?`partial-call`:`call`}function v(e,t){let n=_(e.state);return{step:g(e.toolCallId??e.id??t.toLowerCase(),{toolName:t,args:e.input??e.args??{},state:n,result:e.output??e.result}),stepState:p(n)}}var y=(0,o.memo)(function({isPending:e,approveLabel:t,rejectLabel:n,onApprove:r,onReject:i}){let[a,c]=(0,o.useState)(null),l=a===`approved`?`Approved`:t??`Next`,u=a===`rejected`?`Skipped`:n??`Skip`,d=()=>{a||(c(`approved`),r?.())},f=()=>{a||(c(`rejected`),i?.())},p=(0,o.useMemo)(()=>a===`approved`?{label:`Waiting`,dots:!0}:a===`rejected`?{label:`Canceled`,dots:!1}:e?{label:`Starting`,dots:!0}:null,[a,e]);return(0,s.jsxs)(`div`,{className:`flex items-center justify-between border-t border-border bg-an-tool-background py-1 pr-2 pl-3`,children:[p?(0,s.jsxs)(`span`,{className:`text-xs text-an-tool-color-muted`,children:[p.label,p.dots&&(0,s.jsxs)(`span`,{className:`inline-flex`,"aria-hidden":`true`,children:[(0,s.jsx)(`span`,{className:`animate-[loading-dots_1.4s_infinite_0.2s] text-an-tool-color-muted`,children:`.`}),(0,s.jsx)(`span`,{className:`animate-[loading-dots_1.4s_infinite_0.4s] text-an-tool-color-muted`,children:`.`}),(0,s.jsx)(`span`,{className:`animate-[loading-dots_1.4s_infinite_0.6s] text-an-tool-color-muted`,children:`.`})]})]}):(0,s.jsx)(`span`,{"aria-hidden":`true`}),(0,s.jsxs)(`div`,{className:`flex gap-1`,children:[(0,s.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-an-tool-color active:scale-[0.98] disabled:opacity-60 disabled:hover:bg-transparent disabled:active:scale-100`,children:u}),(0,s.jsx)(`button`,{type:`button`,onClick:d,disabled:!!a,className:`h-5 rounded-[4px] bg-an-primary-color px-1.5 text-xs font-medium text-an-send-button-color transition-[background-color,transform] duration-150 hover:bg-an-primary-color/90 active:scale-[0.98] disabled:opacity-60 disabled:hover:bg-an-primary-color disabled:active:scale-100`,children:l})]})]})});function b(e){let t=e.input??e.args??{};return typeof t.code==`string`?t.code:``}function x(e){let t=e.output??e.result;if(!(!t||typeof t!=`object`))return t}function S(...e){for(let t of e)if(t&&t.trim())return t;return``}function C({isPending:e,isBashCell:t,hasError:n,kernelRestarted:r}){return(0,s.jsxs)(`div`,{className:`flex h-7 items-center justify-between pr-2 pl-2.5`,children:[(0,s.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5 overflow-hidden`,children:[(0,s.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-sm bg-muted px-1.5 py-0.5 font-mono text-[10px] leading-none text-muted-foreground uppercase`,children:[(0,s.jsx)(a,{className:`h-3 w-3`}),t?`shell`:`python`]}),e?(0,s.jsx)(l,{as:`span`,duration:1.2,className:`m-0 inline-flex h-full items-center truncate text-xs leading-none`,children:`Running cell`}):(0,s.jsxs)(`span`,{className:`truncate text-xs text-muted-foreground`,children:[n?`Cell failed`:`Ran cell`,r&&` · kernel restarted`]})]}),e&&(0,s.jsx)(`svg`,{className:`h-3 w-3 shrink-0 animate-spin text-muted-foreground`,viewBox:`0 0 16 16`,fill:`none`,children:(0,s.jsx)(`circle`,{cx:`8`,cy:`8`,r:`6`,stroke:`currentColor`,strokeWidth:`1.5`,strokeDasharray:`28`,strokeDashoffset:`7`,strokeLinecap:`round`})})]})}function w({output:e}){return(0,s.jsxs)(`div`,{className:`mt-1.5 border-t border-dashed border-border/70 pt-1.5 font-mono text-[11px] leading-[15px]`,children:[(0,s.jsx)(`span`,{className:`text-[10px] font-semibold uppercase tracking-wider text-amber-600/90 dark:text-amber-400/90`,children:`Unattributed background output:`}),(0,s.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 T({step:e,state:t,onComplete:n,approval:r,cellIndex:i,part:a}){u(t===`animating`,e.duration,n);let o=t===`animating`,c=b(a),l=x(a),d=typeof a.backgroundOutput==`string`&&a.backgroundOutput.trim()?a.backgroundOutput:typeof l?.backgroundOutput==`string`&&l.backgroundOutput.trim()?l.backgroundOutput:void 0,f=c.trimStart().startsWith(`%%bash`),p=i===void 0?`IPython`:`In [${i}]`,m=S(l?.result,l?.stdout,l?.stderr,l?.error?.evalue),h=!!l?.error||!!l?.errorEname||l?.status===`error`;return(0,s.jsxs)(`div`,{className:`overflow-hidden rounded-an-tool-border-radius border border-border bg-an-tool-background`,children:[(0,s.jsx)(C,{isPending:o,isBashCell:f,hasError:h,kernelRestarted:l?.kernelRestarted}),(0,s.jsxs)(`div`,{className:`overflow-hidden border-t border-border bg-background px-2.5 py-1.5 font-mono text-[12px] leading-[16px]`,children:[(0,s.jsxs)(`div`,{className:`break-all whitespace-pre-wrap`,children:[(0,s.jsxs)(`span`,{className:`mr-2 text-cyan-600 select-none dark:text-cyan-400`,children:[p,`:`]}),(0,s.jsx)(`span`,{className:`text-foreground`,children:c})]}),!o&&m&&(0,s.jsx)(`div`,{className:`mt-1 max-h-[160px] overflow-hidden whitespace-pre-line ${h?`text-red-600 dark:text-red-400`:`text-muted-foreground`}`,children:m}),d&&(0,s.jsx)(w,{output:d})]}),r&&(0,s.jsx)(y,{isPending:o,...r})]})}var E=new Map,D=0;function O(e){if(!e)return++D;let t=E.get(e);if(t)return t;let n=++D;return E.set(e,n),n}var k=(0,o.memo)(function({part:e}){let t=e.input?.approval??e.args?.approval,{step:n,stepState:r}=v(e,`IPython`),i=O(e.toolCallId);return(0,s.jsx)(T,{step:n,state:r,onComplete:()=>{},approval:t,cellIndex:i,part:e})});export{l as a,u as i,y as n,a as o,v as r,k as t};