@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.
- package/CHANGELOG.md +7 -0
- package/bin/fleet-prime.mjs +6 -0
- package/dist/web/client/assets/action-swap-roll-DX5o_33Q.js +1 -0
- package/dist/web/client/assets/artifacts-panel-C3yewUBP.js +1 -0
- package/dist/web/client/assets/{chat-CsepBQwy.js → chat-W-yOMyG_.js} +1 -1
- package/dist/web/client/assets/chat-command-palette-D0xDK1j4.js +1 -0
- package/dist/web/client/assets/command-CQzrtjyj.js +2 -0
- package/dist/web/client/assets/{fleet-pi-tool-renderer-BD_ZAjlG.js → fleet-pi-tool-renderer-B0Y7ou0U.js} +16 -16
- package/dist/web/client/assets/generative-text-renderer-SS9c1kNX.js +6 -0
- package/dist/web/client/assets/globals-D_Hy9bT1.css +2 -0
- package/dist/web/client/assets/{index-DweoFRMs.js → index-C9FloFgj.js} +2 -2
- package/dist/web/client/assets/{ipython-tool-BfeIa0nK.js → ipython-tool-BrMePqD-.js} +1 -1
- package/dist/web/client/assets/{openui-renderer-DlUo6ehT.js → openui-renderer-CCfQqUfE.js} +5 -5
- package/dist/web/client/assets/{prime-agent-artifacts-CHGb5V_j.js → prime-agent-artifacts-C-g1VPiW.js} +1 -1
- package/dist/web/client/assets/range-65lubOFp.js +2 -0
- package/dist/web/client/assets/repl-panel-CCh4ly7J.js +1 -0
- package/dist/web/client/assets/routes-DSTyx_J0.js +16 -0
- package/dist/web/client/assets/session-insights-panel-CQdT90Op.js +1 -0
- package/dist/web/client/assets/subagent-chat-panel-D-qw4uWb.js +1 -0
- package/dist/web/client/assets/subagent-transcript-C7oRwEEP.js +1 -0
- package/dist/web/client/assets/subagents-panel-aSMWZP9p.js +1 -0
- package/dist/web/client/assets/{tool-result-CBzwwUE9.js → tool-result-C2NvnN32.js} +3 -3
- package/dist/web/server/{_tanstack-start-manifest_v-bDUlyKY0-KFW35JRO.js → _tanstack-start-manifest_v-DZc7dwm7-6ZQLGXB7.js} +13 -13
- package/dist/web/server/{artifacts-panel-D9w1DHAN-FGRDCYU2.js → artifacts-panel-Bt7YUzm4-NCBMXJ25.js} +15 -15
- package/dist/web/server/{chat-command-palette-BaenPkCN-BHSOPGU4.js → chat-command-palette-Co1L3rUY-RQLNME4T.js} +33 -12
- package/dist/web/server/{chunk-KPNGZR2R.js → chunk-2V6B62OF.js} +204 -204
- package/dist/web/server/{chunk-44IVTHDV.js → chunk-3HUI75QM.js} +60 -60
- package/dist/web/server/{chunk-5AVQZ4AZ.js → chunk-4UBOIY2S.js} +2 -1
- package/dist/web/server/{chunk-Y6LJ4WBI.js → chunk-56HSKUBD.js} +699 -691
- package/dist/web/server/{chunk-RPROZ2JC.js → chunk-5RQ6QAZX.js} +133 -133
- package/dist/web/server/{chunk-PWK2HJIV.js → chunk-6D524OCJ.js} +175 -175
- package/dist/web/server/{chunk-FBOO3G67.js → chunk-AECEK3K7.js} +6 -6
- package/dist/web/server/{chunk-VHCAD46L.js → chunk-AWFOBHH4.js} +4 -4
- package/dist/web/server/{chunk-FVWDJNXR.js → chunk-BEMDNODD.js} +1 -1
- package/dist/web/server/{chunk-X2TUFLTP.js → chunk-BLVCDQ7E.js} +438 -438
- package/dist/web/server/{chunk-EIVNRYP3.js → chunk-FZRBAPUM.js} +2 -2
- package/dist/web/server/chunk-KOIPYBJF.js +3773 -0
- package/dist/web/server/{chunk-XYYNYFFD.js → chunk-LSIHVSUT.js} +2 -2
- package/dist/web/server/{chunk-H64JLONZ.js → chunk-PDRD2X5G.js} +2 -2
- package/dist/web/server/{chunk-FE4KN6T2.js → chunk-RX62LUDV.js} +4 -4
- package/dist/web/server/chunk-SR65ARVS.js +192 -0
- package/dist/web/server/{chunk-WK7CQS2N.js → chunk-SZ65K4CO.js} +48 -48
- package/dist/web/server/{chunk-DO3TVNGA.js → chunk-TO3YPLNZ.js} +6 -6
- package/dist/web/server/{chunk-3IKSPTYI.js → chunk-UKINNXJY.js} +2 -2
- package/dist/web/server/{chunk-M2FGGPNA.js → chunk-VGDP4YDU.js} +70 -45
- package/dist/web/server/{chunk-PCJ5EKFE.js → chunk-VRLTWOVJ.js} +11 -6
- package/dist/web/server/{chunk-HBZ6YKRB.js → chunk-WN77JNYY.js} +2 -2
- package/dist/web/server/{chunk-2U7PWSJX.js → chunk-WZNZQNI4.js} +231 -3633
- package/dist/web/server/{chunk-B2F6MLVZ.js → chunk-XFVL5ITL.js} +2246 -2228
- package/dist/web/server/{chunk-3GSFXWL5.js → chunk-XLCTCC4W.js} +3 -3
- package/dist/web/server/{chunk-AZZHUVJR.js → chunk-Y4MHIA7B.js} +18 -26
- package/dist/web/server/{fleet-pi-tool-renderer-lJvZWmBJ-4M5YI6VS.js → fleet-pi-tool-renderer-CE45vM6T-2UQN6RJM.js} +11 -9
- package/dist/web/server/{fork-picker-dialog-BZzfxdQd-Y725VJ7G.js → fork-picker-dialog-DCzuGelH-TN2Q5OXI.js} +5 -5
- package/dist/web/server/{openui-renderer-Cg4RSE9k-7BTJIYZJ.js → openui-renderer-c36_GYes-HX46N4M5.js} +11 -11
- package/dist/web/server/{repl-panel-BEQrC2ef-V3YEZ7EO.js → repl-panel-D9E8nkQy-L45ZNG2V.js} +4 -3
- package/dist/web/server/{router-CEahIUpn-SRG7XKIH.js → router-_ZpegqiQ-QIE44PIB.js} +1737 -1370
- package/dist/web/server/{routes-BznemByz-F4DJAYIM.js → routes-Ct81-8Tq-LHRMOS7R.js} +2882 -2330
- package/dist/web/server/server.js +3 -3
- package/dist/web/server/{session-insights-panel-JfeTHE0d-3HZB3ZWI.js → session-insights-panel-BHZyKDTo-LRMAMA3O.js} +4 -2
- package/dist/web/server/{settings-dialog-DgeBMORv-7SRSENPM.js → settings-dialog-B4uUS6f--AZ4I4ZOT.js} +142 -142
- package/dist/web/server/{start-CLAD7RcD-56S4BWMM.js → start-BYVnok_H-IA6TWGA3.js} +1 -1
- package/dist/web/server/subagent-chat-panel-C97S3WID-DLOAD5TG.js +63 -0
- package/dist/web/server/subagents-panel-iHpvMIZy-LI6XK66M.js +181 -0
- package/dist/web/server/{workspace-panel-y54P79_B-VPIYUXF6.js → workspace-panel-CHPoiXEo-YB4WS3MK.js} +2 -2
- package/package.json +5 -5
- package/dist/web/client/assets/artifacts-panel-CX62LQ13.js +0 -1
- package/dist/web/client/assets/chat-command-palette-C4sSf8Kg.js +0 -1
- package/dist/web/client/assets/collapsible-DmyYcezk.js +0 -1
- package/dist/web/client/assets/command-CB6emP8m.js +0 -2
- package/dist/web/client/assets/conversation-turns-ByFoWPXe.js +0 -6
- package/dist/web/client/assets/globals-CqqQdk2S.css +0 -2
- package/dist/web/client/assets/range-vSJ7Ux_5.js +0 -2
- package/dist/web/client/assets/repl-panel-DiGS6uCw.js +0 -1
- package/dist/web/client/assets/routes-CxlNCi_v.js +0 -16
- package/dist/web/client/assets/session-insights-panel-DwmwiikS.js +0 -1
- package/dist/web/client/assets/subagents-panel-DGnsK6Nx.js +0 -1
- package/dist/web/server/chunk-ZEVZFLIY.js +0 -334
- package/dist/web/server/subagents-panel-CzZe3co7-2VZ5JTWF.js +0 -332
package/CHANGELOG.md
CHANGED
package/bin/fleet-prime.mjs
CHANGED
|
@@ -12,6 +12,12 @@ const sourceWebApp = resolve(sourceRoot, "web", "app");
|
|
|
12
12
|
const viteCli = resolve(sourceRoot, "web", "app", "node_modules", "vite", "bin", "vite.js");
|
|
13
13
|
const workspaceRoot = process.cwd();
|
|
14
14
|
|
|
15
|
+
/**
|
|
16
|
+
* Launch a Node.js entry point and mirror its signals and exit status.
|
|
17
|
+
* @param {string} entrypoint - Path to the Node.js entry point.
|
|
18
|
+
* @param {string[]} args - Arguments passed to the entry point.
|
|
19
|
+
* @param {string} cwd - Working directory for the child process.
|
|
20
|
+
*/
|
|
15
21
|
function run(entrypoint, args, cwd) {
|
|
16
22
|
const child = spawn(process.execPath, [entrypoint, ...args], {
|
|
17
23
|
cwd,
|
|
@@ -0,0 +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{d as r,f as i,i as a,m as o,p as s,r as c,u as l}from"./ease-vFBiNFNK.js";import{D as u,F as d,M as f,N as p,O as m,T as h,W as g,_,it as v,j as y,k as b,n as x,p as ee,rt as S,tt as C,w,y as T}from"./x-BgciQ7_C.js";import{n as E,r as D,t as O}from"./useBaseUiId-B9f7fokB.js";import{t as k}from"./utils-Eg7xtNmV.js";import{t as A}from"./createLucideIcon-DwxZHm0M.js";import{t as j}from"./useControlled-CoY1jSuL.js";var M=A(`circle-x`,[[`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`}]]),N=A(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),P=A(`file-code-corner`,[[`path`,{d:`M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35`,key:`1wthlu`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m5 16-3 3 3 3`,key:`331omg`}],[`path`,{d:`m9 22 3-3-3-3`,key:`lsp7cz`}]]),F=A(`wrench`,[[`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`}]]),I=e(t(),1);function L(e){let{open:t,defaultOpen:n,onOpenChange:r,disabled:i}=e,[a,o]=j({controlled:t,default:n,name:`Collapsible`,state:`open`}),{mounted:s,setMounted:c,transitionStatus:l}=E(a,!0,!0),u=O(),[d,f]=I.useState(),p=d===null?void 0:d??u,m=C(e=>{let t=!a,n=x(_,e.nativeEvent);r(t,n),!n.isCanceled&&o(t)});return I.useMemo(()=>({defaultPanelId:u,disabled:i,handleTrigger:m,mounted:s,open:a,panelId:p,setMounted:c,setOpen:o,setPanelIdState:f,transitionStatus:l}),[u,i,m,s,a,p,c,o,f,l])}var R=I.createContext(void 0);function z(){let e=I.useContext(R);if(e===void 0)throw Error(S(15));return e}var B=function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=u.startingStyle]=`startingStyle`,e[e.endingStyle=u.endingStyle]=`endingStyle`,e}({}),V=function(e){return e.panelOpen=`data-panel-open`,e}({}),H={[B.open]:``},U={[B.closed]:``},W={open(e){return e?{[V.panelOpen]:``}:null}},G={open(e){return e?H:U},...m},K=n(),te=I.forwardRef(function(e,t){let{render:n,className:r,defaultOpen:i=!1,disabled:a=!1,onOpenChange:o,open:s,style:c,...l}=e,u=C(o),d=L({open:s,defaultOpen:i,onOpenChange:u,disabled:a}),f=I.useMemo(()=>({open:d.open,disabled:d.disabled,transitionStatus:d.transitionStatus}),[d.open,d.disabled,d.transitionStatus]),p=I.useMemo(()=>({...d,onOpenChange:u,state:f}),[d,u,f]),m=b(`div`,e,{state:f,ref:t,props:l,stateAttributesMapping:G});return(0,K.jsx)(R.Provider,{value:p,children:m})}),ne={...W,...m},re=I.forwardRef(function(e,t){let{panelId:n,open:r,handleTrigger:i,state:a,disabled:o}=z(),{className:s,disabled:c=o,render:l,nativeButton:u=!0,style:d,...f}=e,{getButtonProps:p,buttonRef:m}=T({disabled:c,focusableWhenDisabled:!0,native:u});return b(`button`,e,{state:a,ref:[t,m],props:[{"aria-controls":r?n:void 0,"aria-expanded":r,onClick:i},f,p],stateAttributesMapping:ne})}),q={height:void 0,width:void 0};function ie(e){let{externalRef:t,hiddenUntilFound:n,id:r,keepMounted:i,mounted:a,onOpenChange:o,open:s,setMounted:c,setOpen:l,transitionStatus:u}=e,m=I.useRef(null),g=I.useRef(null),[_,y]=I.useState(q),b=I.useRef(q),S=I.useRef(!1),T=I.useRef(s),E=I.useRef(!1),[O,k]=I.useState(!1),A=I.useRef(null),j=f(t,m),M=D(s),N=h(m),P=!s&&!a,F=O?`idle`:u,L=s&&(T.current||E.current),R=!s&&a&&g.current===`css-animation`&&_.height===void 0&&_.width===void 0?b.current:_,z=n&&P&&g.current!==`css-animation`,V=C((e,t=!0)=>{t&&(b.current=e),y(e)}),H=C(()=>{A.current?.(),A.current=null}),U=C(e=>{H(),A.current=()=>{A.current=null,e()}}),W=C(()=>{s&&a&&g.current===`css-animation`&&(E.current=!0)});v(()=>{!O||u===`starting`||k(!1)},[O,u]),I.useEffect(()=>()=>{W(),H()},[W,H]),v(()=>{let e=m.current;if(!e)return;!s&&A.current&&H();let t=ae(e,L);if(g.current=t,s&&u===`idle`&&T.current&&t===`css-animation`){b.current=J(e);return}if(s&&u===`starting`){let n=S.current;if(S.current=!1,t===`none`){V(J(e)),k(!0);return}if(t===`css-transition`){let t=oe(e);if(V(J(e)),!n)return t;let r=X(e,`transition-duration`,`0s`);return U(r),k(!0),t}V(J(e));let r=X(e,`animation-name`,`none`);if(!n){r();return}let i=X(e,`animation-duration`,`0s`);r(),U(i),k(!0);return}if(!s&&a&&(u===`idle`||u===`starting`)){if(T.current=!1,E.current=!1,t===`none`){V(q,!1),c(!1);return}V(J(e));return}if(u!==`ending`)return;if(t===`none`){c(!1);return}let n=J(e);if(!(n.height>0||n.width>0)){c(!1);return}V(n),t===`css-animation`&&X(e,`animation-name`,`none`)()},[a,s,H,V,c,U,L,u]),w({enabled:s&&a&&F===`idle`,open:!0,ref:m,onComplete(){s&&V(q,!1)}}),I.useEffect(()=>{if(s||!a||F!==`ending`||!m.current)return;let e=new AbortController,t=-1;function n(){M.current||(c(!1),V(q,!1))}return t=p.request(()=>{N(n,e.signal)}),()=>{p.cancel(t),e.abort()}},[M,a,s,F,N,V,c]),v(()=>{let e=m.current;!e||!n||!P||e.setAttribute(`hidden`,`until-found`)},[P,n]),I.useEffect(function(){let e=m.current;if(!e)return;function t(e){let t=x(ee,e);o(!0,t),!t.isCanceled&&(S.current=!0,l(!0))}return d(e,`beforematch`,t)},[o,l]);let G=i||n||a||s;return{height:R.height,props:{...z?{[B.startingStyle]:``}:void 0,hidden:P,id:r},ref:j,shouldPreventOpenAnimation:L,shouldRender:G,transitionStatus:F,width:R.width}}function J(e){return{height:e.scrollHeight,width:e.scrollWidth}}function ae(e,t){let n=g(e).getComputedStyle(e),r=(n.animationName.split(`,`).map(e=>e.trim()).some(e=>e!==``&&e!==`none`)||t)&&Y(n.animationDuration),i=Y(n.transitionDuration);return r&&i||i?`css-transition`:r?`css-animation`:`none`}function Y(e){return e.split(`,`).map(e=>e.trim()).some(e=>e!==``&&Number.parseFloat(e)>0)}function X(e,t,n){let r=e.style.getPropertyValue(t),i=e.style.getPropertyPriority(t);return e.style.setProperty(t,n),()=>{if(r===``){e.style.removeProperty(t);return}e.style.setProperty(t,r,i)}}function oe(e){let t={"justify-content":e.style.justifyContent,"align-items":e.style.alignItems,"align-content":e.style.alignContent,"justify-items":e.style.justifyItems};Object.keys(t).forEach(t=>{e.style.setProperty(t,`initial`,`important`)});function n(){Object.entries(t).forEach(([t,n])=>{if(n===``){e.style.removeProperty(t);return}e.style.setProperty(t,n)})}let r=p.request(n);return()=>{p.cancel(r),n()}}var Z=function(e){return e.collapsiblePanelHeight=`--collapsible-panel-height`,e.collapsiblePanelWidth=`--collapsible-panel-width`,e}({}),se=I.forwardRef(function(e,t){let{className:n,hiddenUntilFound:r,keepMounted:i,render:a,id:o,style:s,...c}=e,{defaultPanelId:l,mounted:u,onOpenChange:d,open:f,setMounted:p,setPanelIdState:m,setOpen:h,state:g,transitionStatus:_}=z(),x=r??!1,ee=i??!1,S=o||void 0,C=S??l;v(()=>(m(e=>S??(e===null?void 0:e)),()=>{m(e=>e===S?null:e)}),[S,m]);let{height:w,props:T,ref:E,shouldPreventOpenAnimation:D,shouldRender:O,transitionStatus:k,width:A}=ie({externalRef:t,hiddenUntilFound:x,id:C,keepMounted:ee,mounted:u,onOpenChange:d,open:f,setMounted:p,setOpen:h,transitionStatus:_}),j={...g,transitionStatus:k},M=y(s,j),N=b(`div`,{...e,style:void 0},{state:j,ref:E,props:[T,{style:{[Z.collapsiblePanelHeight]:w===void 0?`auto`:`${w}px`,[Z.collapsiblePanelWidth]:A===void 0?`auto`:`${A}px`}},c,M?{style:M}:void 0,D?{style:{animationName:`none`}}:void 0],stateAttributesMapping:G});return O?N:null});function ce({...e}){return(0,K.jsx)(te,{"data-slot":`collapsible`,...e})}function le({...e}){return(0,K.jsx)(re,{"data-slot":`collapsible-trigger`,...e})}function ue({...e}){return(0,K.jsx)(se,{"data-slot":`collapsible-content`,...e})}function de({open:e,openHeight:t=`auto`,className:n,style:r,transition:a,...o}){let l=s()??!1;return(0,K.jsx)(i.div,{...o,"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:c},className:k(`overflow-hidden`,n),style:{...r,height:e?t:0,pointerEvents:e?void 0:`none`,transformOrigin:`top`}})}var Q={duration:.2,ease:`easeInOut`},fe=l,pe={duration:.14,ease:c},me=`blur(8px)`,$=`blur(3px)`,he=.025,ge={initial:{opacity:0,y:`105%`,filter:$},animate:(e=0)=>({opacity:1,y:`0%`,filter:`blur(0px)`,transition:{...l,delay:e}}),exit:(e=0)=>({opacity:0,y:`-105%`,filter:$,transition:{duration:.16,ease:c,delay:e*.5}})},_e={blur:{initial:{opacity:0,scale:.94,filter:me},animate:{opacity:1,scale:1,filter:`blur(0px)`,transition:Q},exit:{opacity:0,scale:.94,filter:me,transition:Q}},roll:{initial:{opacity:0,y:`90%`,filter:$},animate:{opacity:1,y:`0%`,filter:`blur(0px)`,transition:fe},exit:{opacity:0,y:`-90%`,filter:$,transition:pe}}};function ve({value:e,children:t,animation:n=`blur`,className:i}){let c=s(),l=(0,I.useRef)(null),[u,d]=(0,I.useState)();(0,I.useLayoutEffect)(()=>{let e=l.current?.offsetWidth;e&&d(t=>t===e?t:e)});let f=typeof t==`string`?t:null,p=n===`cascade`&&f!==null&&!c,m=n===`cascade`?`roll`:n;return(0,K.jsxs)(`span`,{className:k(`relative inline-block overflow-hidden whitespace-nowrap align-bottom`,i),style:{width:u,transition:c?void 0:`width 220ms ${a}`},children:[(0,K.jsx)(`span`,{ref:l,"aria-hidden":!0,className:`invisible inline-block whitespace-nowrap`,children:t}),p?(0,K.jsx)(`span`,{className:`sr-only`,children:f}):null,(0,K.jsx)(o,{initial:!1,children:p?(0,K.jsx)(r.span,{"aria-hidden":!0,initial:`initial`,animate:`animate`,exit:`exit`,className:`absolute left-0 top-0 inline-block whitespace-pre`,children:f.split(``).map((e,t)=>(0,K.jsx)(r.span,{custom:t*he,variants:ge,className:`inline-block whitespace-pre`,children:e},t))},`cascade-${e}`):(0,K.jsx)(r.span,{variants:_e[m],initial:!c&&`initial`,animate:c?{opacity:1,filter:`blur(0px)`,scale:1,y:0}:`animate`,exit:c?void 0:`exit`,className:`absolute left-0 top-0 inline-block`,children:t},`${n}-${e}`)})]})}function ye(e){return(0,K.jsx)(ve,{...e,animation:`roll`})}export{le as a,N as c,ue as i,M as l,de as n,F as o,ce as r,P as s,ye as t};
|
|
@@ -0,0 +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"./button-0At5xSyU.js";import{t as i}from"./createLucideIcon-DwxZHm0M.js";import{i as a,n as o,r as s,t as c}from"./tool-result-C2NvnN32.js";import{t as l}from"./chevron-right-DrJxToLs.js";import{a as u,i as d,r as f}from"./action-swap-roll-DX5o_33Q.js";import{t as p}from"./package-CdcJFPf2.js";import{r as m,t as h}from"./openui-renderer-CCfQqUfE.js";import{n as g}from"./prime-agent-artifacts-C-g1VPiW.js";import{q as _}from"./chat-W-yOMyG_.js";import{t as v}from"./artifacts-utils-N_kUFbz2.js";var y=i(`layout-template`,[[`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`}]]),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-[10px] 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`,[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`?g(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)(f,{open:t,onOpenChange:a,children:[(0,x.jsxs)(u,{render:(0,x.jsx)(r,{variant:`ghost`,size:`sm`,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-[10px] text-foreground/40`,children:[`#`,e.ordinal]})]}),(0,x.jsx)(d,{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)(_,{resetKeys:[e.content],children:(0,x.jsx)(h,{content:e.content,isStreaming:n,messageId:e.blockId,onOpenUIAction:i})})})})]})}function M({messages:e,onOpenUIAction:t,status:n,artifactRuns:r=S,selectedArtifactId:i}){let a=(0,b.useMemo)(()=>v(e),[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]),u=(0,b.useMemo)(()=>l.filter(e=>e.kind===`openui-html`),[l]),d=(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:[u.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-[10px] text-foreground/40`,children:u.length})]}),(0,x.jsx)(`div`,{className:`space-y-1`,children:u.map(e=>(0,x.jsx)(k,{artifact:e,selected:e.id===i},e.id))})]}):null,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)(p,{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-[10px] text-foreground/40`,children:d.length})]}),(0,x.jsx)(`div`,{className:`space-y-1`,children:d.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-[10px] text-foreground/40`,children:a.length>0?`${a.length}`:`none yet`})]}),a.length===0?(0,x.jsx)(`p`,{className:`px-2 pb-1 text-[11px] 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};
|