meshy-node 0.6.5 → 0.6.7

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.
@@ -1,4 +1,4 @@
1
- import{c as ye,j as m,H as hl,bb as Fr,T as Or,k as mn,bc as Rr,r as ce,B as bt,C as Re,b as wt,X as Br,bd as ml,s as dl,A as $r,K as gl}from"./index-DRZPNGjF.js";/**
1
+ import{c as ye,j as m,H as hl,bb as Fr,T as Or,k as mn,bc as Rr,r as ce,B as bt,C as Re,b as wt,X as Br,bd as ml,s as dl,A as $r,K as gl}from"./index-Dcj0nR-j.js";/**
2
2
  * @license lucide-react v1.7.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -77,7 +77,7 @@ import{c as ye,j as m,H as hl,bb as Fr,T as Or,k as mn,bc as Rr,r as ce,B as bt,
77
77
  `):""}function Lp(e){const t=e.message;return typeof t=="object"&&t!==null&&Array.isArray(t.content)?t.content:Array.isArray(e.content)?e.content:[]}function Dp(e){return e.flatMap(t=>Lp(t).flatMap(n=>{if(n.type==="thinking"){const r=String(n.thinking??"").trim();return r?[{title:"Thinking",preview:Se(r,112),block:n,kind:"thinking",status:"success"}]:[]}if(n.type==="tool_use")return[{title:`Tool: ${String(n.name??"tool")}`,preview:Ki(n.input),block:n,kind:"tool_use",status:"success"}];if(n.type==="tool_result"){const r=Se(On(n),112);return r?[{title:"Result",preview:r,block:n,kind:"tool_result",status:Qi(n)}]:[]}return[]}))}function Mp({events:e,...t}){const[n,r]=ce.useState(!1),[i,o]=ce.useState(Ke),l=Dp(e);if(l.length===0)return null;const a=l.slice(0,i),s=l.length-a.length;function u(){r(f=>{const c=!f;return c&&o(Ke),c})}return m.jsxs("div",{className:"animate-agent-activity group/activity overflow-hidden py-0.5 text-muted-foreground","data-agent-activity-page-size":Ke,children:[m.jsxs("button",{type:"button",onClick:u,"aria-expanded":n,className:"flex w-full items-start gap-1.5 rounded-sm px-1 py-1 text-left transition-colors hover:bg-muted/18",children:[m.jsx("div",{className:"mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center text-muted-foreground/55 transition-colors group-hover/activity:text-muted-foreground/80",children:m.jsx(dn,{className:"h-3 w-3"})}),m.jsxs("div",{className:"min-w-0 flex-1 space-y-0.5",children:[m.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[m.jsx("span",{className:"text-[9px] font-semibold uppercase tracking-[0.18em] text-muted-foreground/80",children:"Agent activity"}),m.jsxs("span",{className:"font-mono text-[9px] leading-4 text-muted-foreground/55",children:[l.length," ",l.length===1?"item":"items"]})]}),m.jsx("div",{className:"divide-y divide-dashed divide-border/18",children:l.slice(0,4).map((f,c)=>m.jsxs("div",{className:"grid gap-1 py-0.5 text-[9px] leading-3 sm:grid-cols-[0.875rem_4.75rem_minmax(0,1fr)]",children:[m.jsx(Dn,{status:f.status}),m.jsx("span",{className:"truncate font-medium text-muted-foreground/75",children:f.title}),m.jsx("span",{className:"truncate font-mono text-muted-foreground/60",children:f.preview})]},`${f.kind}-${c}`))})]}),m.jsx(Zi,{expanded:n})]}),n&&m.jsxs("div",{className:"animate-agent-activity-expand divide-y divide-dashed divide-border/18 px-3 pb-1 pt-0.5",children:[a.map((f,c)=>{const h=`${f.kind}-${c}`;return f.kind==="thinking"?m.jsx("div",{className:"py-0.5",children:m.jsx(el,{text:String(f.block.thinking??""),status:f.status})},h):f.kind==="tool_use"?m.jsx("div",{className:"py-0.5",children:m.jsx(tl,{block:f.block,status:f.status,...t})},h):m.jsx("div",{className:"py-0.5",children:m.jsx(Fn,{block:f.block,status:f.status,...t})},h)}),s>0&&m.jsxs("button",{type:"button",onClick:()=>o(f=>f+Ke),className:"ml-5 inline-flex rounded-sm px-1.5 py-0.5 text-[9px] font-medium uppercase tracking-[0.14em] text-muted-foreground/62 transition-colors hover:bg-muted/20 hover:text-muted-foreground",children:["Load more ",Math.min(s,Ke)]})]})]})}function Fp(e){return Array.isArray(e)?e.map(t=>{if(typeof t!="object"||t===null)return null;const n=t,r=typeof n.content=="string"?n.content:"";if(!r)return null;const i=typeof n.activeForm=="string"?n.activeForm:r,o=typeof n.status=="string"?n.status:"pending";return{content:r,activeForm:i,status:o==="completed"||o==="in_progress"?o:"pending"}}).filter(t=>t!==null):[]}function Op({todos:e,status:t="success"}){const n=e.filter(o=>o.status==="completed").length,r=e.length,i=e.find(o=>o.status==="in_progress");return m.jsxs("div",{className:"overflow-hidden rounded-sm border border-border/18 bg-muted/16 shadow-none",children:[m.jsxs("div",{className:"flex items-center gap-1.5 border-b border-border/18 px-2 py-1",children:[m.jsx(Dn,{status:t}),m.jsx("div",{className:"flex h-3.5 w-3.5 shrink-0 items-center justify-center rounded-sm border border-border/20 bg-background/36 text-muted-foreground/72",children:m.jsx(Cl,{className:"h-3 w-3"})}),m.jsxs("div",{className:"min-w-0 flex-1",children:[m.jsx("div",{className:"text-[8px] font-semibold uppercase tracking-[0.16em] text-muted-foreground/78",children:"Todos"}),m.jsx("div",{className:"mt-0.5 truncate text-[9px] leading-3 text-muted-foreground/78",children:i?i.activeForm:r===0?"No items":n===r?"All complete":"Up next"})]}),m.jsxs("div",{className:"shrink-0 rounded-sm border border-border/20 bg-background/36 px-1.5 py-0.5 font-mono text-[8px] tracking-wide text-muted-foreground/72",children:[n,"/",r]})]}),m.jsx("ul",{className:"divide-y divide-border/18",children:e.map((o,l)=>m.jsxs("li",{className:"flex items-start gap-1.5 px-2 py-1",children:[m.jsx(Rp,{status:o.status}),m.jsx("span",{className:o.status==="completed"?"text-[11px] leading-4 text-muted-foreground line-through decoration-muted-foreground/60":o.status==="in_progress"?"text-[11px] font-medium leading-4 text-foreground":"text-[11px] leading-4 text-foreground/85",children:o.status==="in_progress"?o.activeForm:o.content})]},`${l}-${o.content}`))})]})}function Rp({status:e}){return e==="completed"?m.jsx("span",{className:"mt-0.5 flex h-3.5 w-3.5 shrink-0 items-center justify-center rounded-full bg-emerald-500/15 text-emerald-500 dark:text-emerald-400",children:m.jsx(Re,{className:"h-2.5 w-2.5"})}):e==="in_progress"?m.jsx("span",{className:"mt-0.5 flex h-3.5 w-3.5 shrink-0 items-center justify-center text-primary",children:m.jsx(El,{className:"h-3 w-3 animate-spin"})}):m.jsx("span",{className:"mt-0.5 flex h-3.5 w-3.5 shrink-0 items-center justify-center text-muted-foreground/60",children:m.jsx(Ur,{className:"h-2.5 w-2.5"})})}function hh({event:e,agent:t,subItems:n=[],questionBypassEnabled:r=!1,onQuestionBypassChange:i,onSubmitQuestionResponse:o,questionResponseDisabled:l=!1}){const a=e.type,s=gn(e),u=at(e);if(s)return m.jsx(tt,{agent:t,children:m.jsx(Pp,{payload:s,onSubmit:o,disabled:l})});if(u)return m.jsx(tt,{agent:t,children:m.jsx(lt,{payload:u,bypassEnabled:r,onBypassChange:i,onSubmit:o,disabled:l})});if(a==="user"){if(e.isMeta===!0||e.isSidechain===!0)return null;const f=Bp(e),c=f.filter(p=>p.type==="tool_result");if(c.length>0&&f.every(p=>p.type==="tool_result"))return m.jsx(tt,{agent:t,children:c.map((p,x)=>m.jsx(Fn,{block:p,questionBypassEnabled:r,onQuestionBypassChange:i,onSubmitQuestionResponse:o,questionResponseDisabled:l},x))});const h=Be(e);return h?m.jsx(Hp,{content:h}):null}return a==="assistant"?m.jsx(Vp,{event:e,agent:t,subItems:n,questionBypassEnabled:r,onQuestionBypassChange:i,onSubmitQuestionResponse:o,questionResponseDisabled:l}):null}function Bp(e){const t=e.message,n=t==null?void 0:t.content;if(Array.isArray(n))return n.filter(i=>typeof i=="object"&&i!==null);const r=e.content;return Array.isArray(r)?r.filter(i=>typeof i=="object"&&i!==null):[]}function Xt(e){var n;const t=e.replace(/\r\n/g,`
78
78
  `).split(`
79
79
  `);for(;t.length>0&&((n=t[0])==null?void 0:n.trim())==="";)t.shift();return t.join(`
80
- `)}function nl({text:e,tone:t="default",className:n=""}){const r=t==="inverted",i=r?"underline decoration-current/45 underline-offset-2 hover:decoration-current":"underline decoration-current/35 underline-offset-2 hover:decoration-current",o=r?"rounded-sm bg-black/15 px-1 py-0.5 font-mono text-[10px] text-primary-foreground":"rounded-sm bg-muted/80 px-1 py-0.5 font-mono text-[10px] text-foreground",l=r?"overflow-x-auto rounded-md border border-primary-foreground/12 bg-black/15 px-3 py-2 font-mono text-[10px] leading-4 text-primary-foreground":"overflow-x-auto rounded-md border border-border/45 bg-muted/50 px-3 py-2 font-mono text-[10px] leading-4 text-foreground",a=r?"w-full border-collapse text-left text-[11px] text-primary-foreground":"w-full border-collapse text-left text-[11px] text-foreground",s=r?"border border-primary-foreground/20 px-2 py-1 align-top":"border border-border/60 px-2 py-1 align-top",u=r?"border-l-2 border-primary-foreground/30 pl-3 italic text-primary-foreground/90":"border-l-2 border-border pl-3 italic text-muted-foreground";return m.jsx("div",{className:["max-w-none break-words text-[11px] leading-[17px] [overflow-wrap:anywhere] [&>*:first-child]:mt-0 [&>*:last-child]:mb-0 [&>*+*]:mt-2 [&_li>p]:my-0",n].filter(Boolean).join(" "),children:m.jsx(dc,{remarkPlugins:[_p,Ac],components:{a:({node:f,...c})=>m.jsx("a",{...c,target:"_blank",rel:"noreferrer noopener",className:i}),blockquote:({node:f,...c})=>m.jsx("blockquote",{...c,className:u}),code:({node:f,className:c,children:h,...p})=>c?m.jsx("code",{...p,className:c,children:h}):m.jsx("code",{...p,className:o,children:h}),h1:({node:f,...c})=>m.jsx("h1",{...c,className:"text-[14px] font-semibold leading-5"}),h2:({node:f,...c})=>m.jsx("h2",{...c,className:"text-[13px] font-semibold leading-5"}),h3:({node:f,...c})=>m.jsx("h3",{...c,className:"text-[12px] font-semibold leading-5"}),h4:({node:f,...c})=>m.jsx("h4",{...c,className:"text-[11px] font-semibold leading-4"}),hr:({node:f,...c})=>m.jsx("hr",{...c,className:r?"border-primary-foreground/20":"border-border"}),img:({node:f,alt:c,src:h})=>h?m.jsx("a",{href:h,target:"_blank",rel:"noreferrer noopener",className:i,children:(c==null?void 0:c.trim())||h}):m.jsx("span",{children:(c==null?void 0:c.trim())||"Image"}),ol:({node:f,...c})=>m.jsx("ol",{...c,className:"list-decimal space-y-0.5 pl-5"}),p:({node:f,...c})=>m.jsx("p",{...c,className:"my-0"}),pre:({node:f,...c})=>m.jsx("pre",{...c,className:l}),table:({node:f,...c})=>m.jsx("table",{...c,className:a}),td:({node:f,...c})=>m.jsx("td",{...c,className:s}),th:({node:f,...c})=>m.jsx("th",{...c,className:`${s} font-semibold`}),ul:({node:f,...c})=>m.jsx("ul",{...c,className:"list-disc space-y-0.5 pl-5"})},children:e})})}function rl({text:e,className:t=""}){const[n,r]=ce.useState(!1);if(!e)return null;const i=async o=>{o.stopPropagation();try{await navigator.clipboard.writeText(e),r(!0),setTimeout(()=>r(!1),1500)}catch{}};return m.jsx("button",{type:"button",onClick:i,"aria-label":n?"Copied":"Copy message",className:`flex h-6 w-6 items-center justify-center rounded-sm border border-border/60 bg-background/86 text-muted-foreground opacity-0 shadow-sm backdrop-blur transition-all hover:-translate-y-px hover:text-foreground group-hover:opacity-100 focus-visible:opacity-100 ${t}`,children:n?m.jsx(Re,{className:"h-3 w-3 text-emerald-500"}):m.jsx($r,{className:"h-3 w-3"})})}async function $p(e){let n=await(await fetch(e)).blob();n.type!=="image/png"&&(n=await Up(n)),await navigator.clipboard.write([new ClipboardItem({[n.type]:n})])}async function Up(e){const t=await createImageBitmap(e),n=document.createElement("canvas");n.width=t.width,n.height=t.height;const r=n.getContext("2d");if(!r)throw new Error("canvas 2d context unavailable");return r.drawImage(t,0,0),await new Promise((i,o)=>{n.toBlob(l=>l?i(l):o(new Error("toBlob failed")),"image/png")})}function qp({dataUrl:e,className:t=""}){const[n,r]=ce.useState(!1),i=async o=>{o.stopPropagation();try{await $p(e),r(!0),setTimeout(()=>r(!1),1500)}catch(l){console.error("copy image failed",l)}};return m.jsx("button",{type:"button",onClick:i,"aria-label":n?"Copied":"Copy image",className:`flex h-6 w-6 items-center justify-center rounded-sm border border-border/60 bg-background/86 text-muted-foreground opacity-0 shadow-sm backdrop-blur transition-all hover:-translate-y-px hover:text-foreground group-hover:opacity-100 focus-visible:opacity-100 ${t}`,children:n?m.jsx(Re,{className:"h-3 w-3 text-emerald-500"}):m.jsx($r,{className:"h-3 w-3"})})}function Hp({content:e}){const t=Ml(e),n=e.filter(r=>r.type==="image");return m.jsx("div",{className:"animate-message-rise flex w-full max-w-full min-w-0 justify-end",children:m.jsxs("div",{className:"group relative flex min-w-0 max-w-[88%] items-start gap-2",children:[m.jsx(rl,{text:t,className:"absolute -left-8 top-5"}),m.jsxs("div",{className:"flex min-w-0 max-w-full flex-col items-end gap-0.5",children:[m.jsx("div",{className:"pr-0.5 text-[8px] font-semibold uppercase tracking-[0.16em] text-muted-foreground/72",children:"You"}),m.jsxs("div",{className:"max-w-full space-y-1 overflow-hidden rounded-lg rounded-br-md bg-primary px-3 py-2 text-[11px] leading-[17px] text-primary-foreground shadow-[0_16px_52px_-38px_hsl(var(--primary)/0.9)]",children:[t&&m.jsx(nl,{text:t,tone:"inverted"}),n.length>0&&m.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:n.map((r,i)=>{const o=Fl(r);return m.jsxs("div",{className:"relative",children:[m.jsx("img",{src:o,alt:r.filename??`attachment ${i+1}`,className:"max-h-72 w-full rounded-2xl border border-primary-foreground/15 object-cover"}),m.jsx(qp,{dataUrl:o,className:"absolute right-2 top-2"})]},`${r.filename??"image"}-${i}`)})})]})]}),m.jsx("div",{className:"mt-4 flex h-6 w-6 shrink-0 items-center justify-center rounded-sm bg-primary/8 text-primary",children:m.jsx(_l,{className:"h-3.5 w-3.5"})})]})})}function tt({agent:e,children:t}){const n=e?Vr(e):"Agent";return m.jsx("div",{className:"animate-message-rise flex w-full max-w-full min-w-0 justify-start",children:m.jsxs("div",{className:"flex min-w-0 max-w-[92%] items-start gap-2",children:[m.jsx("div",{className:"mt-4 flex h-6 w-6 shrink-0 items-center justify-center rounded-sm bg-muted/45 text-muted-foreground/82",children:m.jsx(qr,{agent:e??"",className:"h-3.5 w-3.5"})}),m.jsxs("div",{className:"min-w-0 max-w-full space-y-1",children:[m.jsx("div",{className:"text-[8px] font-semibold uppercase tracking-[0.16em] text-muted-foreground/72","data-agent-speaker-label":n,children:n}),t]})]})})}function Vp({event:e,agent:t,subItems:n=[],questionBypassEnabled:r,onQuestionBypassChange:i,onSubmitQuestionResponse:o,questionResponseDisabled:l}){const a=e.message;if(!a)return null;const s=at(a);if(s)return m.jsx(tt,{agent:t,children:m.jsx(lt,{payload:s,bypassEnabled:r,onBypassChange:i,onSubmit:o,disabled:l})});const u=a.content;if(!u||!Array.isArray(u))return null;const f=new Set,c=u.filter(S=>S.type==="text").map(S=>({...S,text:Xt(String(S.text??"")),questionPayload:st(Xt(String(S.text??"")))})).filter(S=>S.text.length>0||S.questionPayload),h=u.filter(S=>S.type==="thinking").map(S=>Xt(String(S.thinking??""))).filter(Boolean).join(`
80
+ `)}function nl({text:e,tone:t="default",size:n="default",className:r=""}){const i=t==="inverted",o=n==="compact"?"text-[10px] leading-4":"text-[11px] leading-[17px]",l=i?"underline decoration-current/45 underline-offset-2 hover:decoration-current":"underline decoration-current/35 underline-offset-2 hover:decoration-current",a=i?"rounded-sm bg-black/15 px-1 py-0.5 font-mono text-[10px] text-primary-foreground":"rounded-sm bg-muted/80 px-1 py-0.5 font-mono text-[10px] text-foreground",s=i?"overflow-x-auto rounded-md border border-primary-foreground/12 bg-black/15 px-3 py-2 font-mono text-[10px] leading-4 text-primary-foreground":"overflow-x-auto rounded-md border border-border/45 bg-muted/50 px-3 py-2 font-mono text-[10px] leading-4 text-foreground",u=i?"w-full border-collapse text-left text-[11px] text-primary-foreground":"w-full border-collapse text-left text-[11px] text-foreground",f=i?"border border-primary-foreground/20 px-2 py-1 align-top":"border border-border/60 px-2 py-1 align-top",c=i?"border-l-2 border-primary-foreground/30 pl-3 italic text-primary-foreground/90":"border-l-2 border-border pl-3 italic text-muted-foreground";return m.jsx("div",{className:[`max-w-none break-words ${o} [overflow-wrap:anywhere] [&>*:first-child]:mt-0 [&>*:last-child]:mb-0 [&>*+*]:mt-2 [&_li>p]:my-0`,r].filter(Boolean).join(" "),children:m.jsx(dc,{remarkPlugins:[_p,Ac],components:{a:({node:h,...p})=>m.jsx("a",{...p,target:"_blank",rel:"noreferrer noopener",className:l}),blockquote:({node:h,...p})=>m.jsx("blockquote",{...p,className:c}),code:({node:h,className:p,children:x,...b})=>p?m.jsx("code",{...b,className:p,children:x}):m.jsx("code",{...b,className:a,children:x}),h1:({node:h,...p})=>m.jsx("h1",{...p,className:"text-[14px] font-semibold leading-5"}),h2:({node:h,...p})=>m.jsx("h2",{...p,className:"text-[13px] font-semibold leading-5"}),h3:({node:h,...p})=>m.jsx("h3",{...p,className:"text-[12px] font-semibold leading-5"}),h4:({node:h,...p})=>m.jsx("h4",{...p,className:"text-[11px] font-semibold leading-4"}),hr:({node:h,...p})=>m.jsx("hr",{...p,className:i?"border-primary-foreground/20":"border-border"}),img:({node:h,alt:p,src:x})=>x?m.jsx("a",{href:x,target:"_blank",rel:"noreferrer noopener",className:l,children:(p==null?void 0:p.trim())||x}):m.jsx("span",{children:(p==null?void 0:p.trim())||"Image"}),ol:({node:h,...p})=>m.jsx("ol",{...p,className:"list-decimal space-y-0.5 pl-5"}),p:({node:h,...p})=>m.jsx("p",{...p,className:"my-0"}),pre:({node:h,...p})=>m.jsx("pre",{...p,className:s}),table:({node:h,...p})=>m.jsx("table",{...p,className:u}),td:({node:h,...p})=>m.jsx("td",{...p,className:f}),th:({node:h,...p})=>m.jsx("th",{...p,className:`${f} font-semibold`}),ul:({node:h,...p})=>m.jsx("ul",{...p,className:"list-disc space-y-0.5 pl-5"})},children:e})})}function rl({text:e,className:t=""}){const[n,r]=ce.useState(!1);if(!e)return null;const i=async o=>{o.stopPropagation();try{await navigator.clipboard.writeText(e),r(!0),setTimeout(()=>r(!1),1500)}catch{}};return m.jsx("button",{type:"button",onClick:i,"aria-label":n?"Copied":"Copy message",className:`flex h-6 w-6 items-center justify-center rounded-sm border border-border/60 bg-background/86 text-muted-foreground opacity-0 shadow-sm backdrop-blur transition-all hover:-translate-y-px hover:text-foreground group-hover:opacity-100 focus-visible:opacity-100 ${t}`,children:n?m.jsx(Re,{className:"h-3 w-3 text-emerald-500"}):m.jsx($r,{className:"h-3 w-3"})})}async function $p(e){let n=await(await fetch(e)).blob();n.type!=="image/png"&&(n=await Up(n)),await navigator.clipboard.write([new ClipboardItem({[n.type]:n})])}async function Up(e){const t=await createImageBitmap(e),n=document.createElement("canvas");n.width=t.width,n.height=t.height;const r=n.getContext("2d");if(!r)throw new Error("canvas 2d context unavailable");return r.drawImage(t,0,0),await new Promise((i,o)=>{n.toBlob(l=>l?i(l):o(new Error("toBlob failed")),"image/png")})}function qp({dataUrl:e,className:t=""}){const[n,r]=ce.useState(!1),i=async o=>{o.stopPropagation();try{await $p(e),r(!0),setTimeout(()=>r(!1),1500)}catch(l){console.error("copy image failed",l)}};return m.jsx("button",{type:"button",onClick:i,"aria-label":n?"Copied":"Copy image",className:`flex h-6 w-6 items-center justify-center rounded-sm border border-border/60 bg-background/86 text-muted-foreground opacity-0 shadow-sm backdrop-blur transition-all hover:-translate-y-px hover:text-foreground group-hover:opacity-100 focus-visible:opacity-100 ${t}`,children:n?m.jsx(Re,{className:"h-3 w-3 text-emerald-500"}):m.jsx($r,{className:"h-3 w-3"})})}function Hp({content:e}){const t=Ml(e),n=e.filter(r=>r.type==="image");return m.jsx("div",{className:"animate-message-rise flex w-full max-w-full min-w-0 justify-end",children:m.jsxs("div",{className:"group relative flex min-w-0 max-w-[88%] items-start gap-2",children:[m.jsx(rl,{text:t,className:"absolute -left-8 top-5"}),m.jsxs("div",{className:"flex min-w-0 max-w-full flex-col items-end gap-0.5",children:[m.jsx("div",{className:"pr-0.5 text-[8px] font-semibold uppercase tracking-[0.16em] text-muted-foreground/72",children:"You"}),m.jsxs("div",{className:"max-w-full space-y-1 overflow-hidden rounded-lg rounded-br-md bg-primary px-3 py-2 text-[10px] leading-4 text-primary-foreground shadow-[0_16px_52px_-38px_hsl(var(--primary)/0.9)]",children:[t&&m.jsx(nl,{text:t,tone:"inverted",size:"compact"}),n.length>0&&m.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:n.map((r,i)=>{const o=Fl(r);return m.jsxs("div",{className:"relative",children:[m.jsx("img",{src:o,alt:r.filename??`attachment ${i+1}`,className:"max-h-72 w-full rounded-2xl border border-primary-foreground/15 object-cover"}),m.jsx(qp,{dataUrl:o,className:"absolute right-2 top-2"})]},`${r.filename??"image"}-${i}`)})})]})]}),m.jsx("div",{className:"mt-4 flex h-6 w-6 shrink-0 items-center justify-center rounded-sm bg-primary/8 text-primary",children:m.jsx(_l,{className:"h-3.5 w-3.5"})})]})})}function tt({agent:e,children:t}){const n=e?Vr(e):"Agent";return m.jsx("div",{className:"animate-message-rise flex w-full max-w-full min-w-0 justify-start",children:m.jsxs("div",{className:"flex min-w-0 max-w-[92%] items-start gap-2",children:[m.jsx("div",{className:"mt-4 flex h-6 w-6 shrink-0 items-center justify-center rounded-sm bg-muted/45 text-muted-foreground/82",children:m.jsx(qr,{agent:e??"",className:"h-3.5 w-3.5"})}),m.jsxs("div",{className:"min-w-0 max-w-full space-y-1",children:[m.jsx("div",{className:"text-[8px] font-semibold uppercase tracking-[0.16em] text-muted-foreground/72","data-agent-speaker-label":n,children:n}),t]})]})})}function Vp({event:e,agent:t,subItems:n=[],questionBypassEnabled:r,onQuestionBypassChange:i,onSubmitQuestionResponse:o,questionResponseDisabled:l}){const a=e.message;if(!a)return null;const s=at(a);if(s)return m.jsx(tt,{agent:t,children:m.jsx(lt,{payload:s,bypassEnabled:r,onBypassChange:i,onSubmit:o,disabled:l})});const u=a.content;if(!u||!Array.isArray(u))return null;const f=new Set,c=u.filter(S=>S.type==="text").map(S=>({...S,text:Xt(String(S.text??"")),questionPayload:st(Xt(String(S.text??"")))})).filter(S=>S.text.length>0||S.questionPayload),h=u.filter(S=>S.type==="thinking").map(S=>Xt(String(S.thinking??""))).filter(Boolean).join(`
81
81
 
82
82
  `),p=u.filter(S=>S.type==="tool_use"),x=u.filter(S=>S.type==="tool_result"),b=c.length>0,v=b&&(h.length>0||p.length>0||x.length>0)?[{type:"assistant",message:{content:[...h.length>0?[{type:"thinking",thinking:h}]:[],...p,...x]}}]:[];return c.length>0||h.length>0||p.length>0||x.length>0||n.length>0?m.jsxs(tt,{agent:t,children:[c.map((S,E)=>{if(S.questionPayload){const z=$e(S.questionPayload);return f.has(z)?null:(f.add(z),m.jsx(lt,{payload:S.questionPayload,bypassEnabled:r,onBypassChange:i,onSubmit:o,disabled:l},E))}return m.jsxs("div",{className:"group relative max-w-full overflow-hidden rounded-lg rounded-bl-md bg-card/72 px-3 py-2 text-[11px] leading-[17px] text-foreground shadow-[0_14px_48px_-42px_rgba(15,23,42,0.65)] backdrop-blur-sm dark:bg-card/68 dark:shadow-[0_14px_48px_-42px_rgba(0,0,0,0.9)]",children:[m.jsx(rl,{text:S.text,className:"absolute right-2 top-2"}),m.jsx(nl,{text:S.text})]},E)}),(n.length>0||v.length>0)&&m.jsx(Mp,{events:[...v,...n],questionBypassEnabled:r,onQuestionBypassChange:i,onSubmitQuestionResponse:o,questionResponseDisabled:l}),h.length>0&&!b&&m.jsx(el,{text:h}),!b&&p.map((S,E)=>m.jsx(tl,{block:S,renderedQuestionSignatures:f,questionBypassEnabled:r,onQuestionBypassChange:i,onSubmitQuestionResponse:o,questionResponseDisabled:l},E)),!b&&x.map((S,E)=>m.jsx(Fn,{block:S,renderedQuestionSignatures:f,questionBypassEnabled:r,onQuestionBypassChange:i,onSubmitQuestionResponse:o,questionResponseDisabled:l},E))]}):null}function kt(e){return typeof e=="object"&&e!==null}function Wp(e){const t=e.message;return kt(t)&&Array.isArray(t.content)?t.content.filter(kt):Array.isArray(e.content)?e.content.filter(kt):[]}function Jp(e){const t=e.content;return typeof t=="string"?t:Array.isArray(t)?t.filter(kt).map(n=>String(n.text??"")).join(`
83
83
  `):""}function Yp(e){return at(e)?!0:e.type==="tool_result"&&st(Jp(e))!==null}function Xp(e){const t=Wp(e);return t.length===0||t.some(Yp)?!1:e.type==="assistant"?t.every(n=>n.type==="thinking"||n.type==="tool_use"||n.type==="tool_result"):e.type==="user"?t.every(n=>n.type==="tool_result"):!1}function mh(e){const t=[];let n=[];const r=()=>{var o;if(n.length===0)return;const i=typeof((o=n[0])==null?void 0:o.timestamp)=="string"?n[0].timestamp:void 0;t.push({event:{type:"assistant",message:{role:"assistant",content:[]},...i?{timestamp:i}:{}},subItems:n}),n=[]};for(const i of e){if(Xp(i)){n.push(i);continue}r(),t.push({event:i,subItems:[]})}return r(),t}function dh({label:e,value:t}){return m.jsxs("div",{className:"min-w-[4.75rem] flex-1 rounded-sm bg-background/58 px-2 py-1.5 shadow-sm",children:[m.jsx("div",{className:"text-[8px] font-medium uppercase tracking-[0.18em] text-muted-foreground",children:e}),m.jsx("div",{className:"mt-0.5 text-[12px] font-semibold leading-4 tracking-tight text-foreground",children:t})]})}function gh({label:e}){return m.jsx("div",{className:"flex h-64 items-center justify-center text-sm text-muted-foreground",children:e})}function xh({label:e,value:t,mono:n,action:r}){return m.jsxs("div",{className:"grid grid-cols-[3.75rem,minmax(0,1fr)] items-start gap-1.5",children:[m.jsx("span",{className:"pt-px text-[8px] font-medium uppercase tracking-[0.16em] text-muted-foreground",children:e}),m.jsxs("div",{className:"flex min-w-0 items-start gap-1",children:[m.jsx("span",{className:wt("min-w-0 flex-1 break-all text-[10px] leading-4 text-foreground",n&&"font-mono text-[10px]"),children:t}),r]})]})}function yh({label:e,value:t,mono:n}){return m.jsxs("div",{className:"rounded-sm bg-background/62 px-2 py-1.5 shadow-sm",children:[m.jsx("div",{className:"text-[8px] font-medium uppercase tracking-[0.18em] text-muted-foreground",children:e}),m.jsx("div",{className:wt("mt-0.5 text-[10px] font-medium leading-4 text-foreground",n&&"font-mono"),children:t})]})}function kh({capabilities:e,action:t}){return m.jsxs("div",{className:"flex flex-col gap-1.5 sm:flex-row sm:items-start sm:justify-between sm:gap-2",children:[m.jsxs("div",{className:"min-w-0 flex-1 space-y-1",children:[m.jsx("div",{className:"text-[8px] font-medium uppercase tracking-[0.18em] text-muted-foreground",children:"Capabilities"}),m.jsx("div",{className:"flex flex-wrap items-center gap-1 text-[10px]",children:e.length>0?e.map(n=>m.jsx(gl,{variant:"secondary",className:"rounded-sm px-1.5 py-0 text-[9px] leading-4",children:n},n)):m.jsx("span",{className:"text-[10px] text-muted-foreground",children:"None declared"})})]}),t&&m.jsx("div",{className:"shrink-0 self-start",children:t})]})}export{qr as A,hh as C,dh as D,xh as I,El as L,yh as M,gh as T,ch as a,Kp as b,ph as c,uh as d,eh as e,fh as f,Vr as g,mh as h,nh as i,kh as j,lh as k,ih as l,rh as m,Be as n,oh as o,sh as p,Zp as q,th as r,Qp as s,Fl as t,xt as u,ah as v,dc as w};
@@ -0,0 +1,4 @@
1
+ import{r as l,bk as P,be as O,j as e,K as g,b as N,s as $,i as T}from"./index-Dcj0nR-j.js";import{G as R}from"./DashboardPage-CUhdRokR.js";import{F as _}from"./file-BduJ6PU6.js";import{F as B}from"./folder-BMmcfsyZ.js";import"./DashboardShared-BohLaqeo.js";import"./play-Dc8Adtxz.js";function D(r,t){if(!(r!=null&&r.trim()))return[];const s=r.split(`
2
+ `),n=[];let a=[];const d=()=>{if(a.length===0)return;const c=a.join(`
3
+ `).trim();if(!c){a=[];return}const i=J(a);if(!i){a=[];return}n.push({id:`${t}:${i}`,path:i,section:t,patch:c}),a=[]};for(const c of s)c.startsWith("diff --git ")&&a.length>0&&d(),a.push(c);return d(),n}function I(r){const t=[];for(const s of[...r].sort((n,a)=>n.path.localeCompare(a.path))){const n=s.path.split("/").filter(Boolean);let a=t,d="";n.forEach((c,i)=>{d=d?`${d}/${c}`:c;const h=i===n.length-1;let u=a.find(b=>b.name===c);u||(u=h?{type:"file",name:c,path:d,item:s}:{type:"folder",name:c,path:d,children:[]},a.push(u)),h||(u.children??(u.children=[]),a=u.children)})}return t}function G(r){const t=[];let s="";for(const n of r.split("/").filter(Boolean).slice(0,-1))s=s?`${s}/${n}`:n,t.push(s);return t}function A(r){return r.filter(t=>t&&!t.endsWith("/")).map(t=>({id:`untracked:${t}`,path:t,section:"untracked"}))}function J(r){var d,c;const t=(d=r.find(i=>i.startsWith("+++ ")))==null?void 0:d.slice(4).trim();if(t&&t!=="/dev/null")return y(t);const s=(c=r.find(i=>i.startsWith("--- ")))==null?void 0:c.slice(4).trim();if(s&&s!=="/dev/null")return y(s);const n=r.find(i=>i.startsWith("diff --git "));if(!n)return null;const a=n.match(/^diff --git a\/(.+?) b\/(.+)$/);return a?y(a[2]||a[1]||""):null}function y(r){return r.replace(/^[ab]\//,"")}const w={staged:"Staged",unstaged:"Unstaged",untracked:"Untracked"};function se({taskId:r}){const[t,s]=l.useState(null),[n,a]=l.useState(!0),[d,c]=l.useState(null),[i,h]=l.useState(null),[u,b]=l.useState(null),[L,k]=l.useState(!1),[M,v]=l.useState(null),S=l.useCallback(async()=>{a(!0),c(null),s(null);try{const o=await P(r);s(o)}catch(o){c(o instanceof Error?o.message:"Failed to load diff")}finally{a(!1)}},[r]);l.useEffect(()=>{S()},[S]);const F=l.useMemo(()=>D(t==null?void 0:t.staged,"staged"),[t==null?void 0:t.staged]),E=l.useMemo(()=>D(t==null?void 0:t.unstaged,"unstaged"),[t==null?void 0:t.unstaged]),C=l.useMemo(()=>A((t==null?void 0:t.untrackedFiles)??[]),[t==null?void 0:t.untrackedFiles]),j=l.useMemo(()=>[{section:"staged",items:F},{section:"unstaged",items:E},{section:"untracked",items:C}],[F,E,C]),p=l.useMemo(()=>j.flatMap(o=>o.items),[j]),m=l.useMemo(()=>p.find(o=>o.id===i)??p[0]??null,[p,i]);return l.useEffect(()=>{var o;(!i||!p.some(x=>x.id===i))&&h(((o=p[0])==null?void 0:o.id)??null)},[p,i]),l.useEffect(()=>{if(b(null),v(null),k(!1),!m||m.section!=="untracked")return;if(m.path.endsWith("/")){v("This untracked path is a directory. Open the Files tab to inspect its contents.");return}let o=!1;return k(!0),O(r,m.path).then(x=>{o||b(x)}).catch(x=>{o||v(x instanceof Error?x.message:"Failed to load file content")}).finally(()=>{o||k(!1)}),()=>{o=!0}},[m,r]),n?e.jsx(f,{tone:"muted",children:"Loading diff..."}):d?e.jsx(f,{tone:"destructive",children:d}):t!=null&&t.available?p.length>0?e.jsxs("div",{className:"grid h-full min-h-0 grid-cols-1 lg:grid-cols-[16rem_minmax(0,1fr)]",children:[e.jsxs("aside",{className:"flex min-h-0 flex-col border-b border-border/60 bg-background/30 lg:border-b-0 lg:border-r",children:[e.jsxs("div",{className:"shrink-0 border-b border-border/60 px-2.5 py-2",children:[e.jsx("div",{className:"text-[9px] font-medium uppercase tracking-[0.2em] text-muted-foreground",children:"Repository diff"}),e.jsx("div",{className:"mt-1 flex items-start justify-between gap-1.5",children:e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1 text-[10px] font-semibold text-foreground",children:[e.jsx(R,{className:"h-3 w-3 text-muted-foreground"}),e.jsx("span",{className:"truncate",children:t.branch??"detached HEAD"})]}),t.repoRoot&&e.jsx("div",{className:"mt-0.5 truncate font-mono text-[9px] text-muted-foreground",children:t.repoRoot})]})}),e.jsx("div",{className:"mt-1.5 flex flex-wrap gap-1",children:j.map(o=>e.jsxs(g,{variant:"outline",className:"rounded-sm border-border/70 bg-background/60 px-1.5 py-0 text-[9px]",children:[w[o.section]," ",o.items.length]},o.section))})]}),e.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto p-1",children:e.jsx("div",{className:"space-y-1",children:j.map(({section:o,items:x})=>e.jsx(V,{section:o,items:x,selectedId:(m==null?void 0:m.id)??null,onSelect:h},o))})})]}),e.jsx("section",{className:"min-h-0 flex flex-col bg-card/10",children:m?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"shrink-0 border-b border-border/60 px-2.5 py-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx(g,{variant:"outline",className:"rounded-sm border-border/70 bg-background/60 px-1.5 py-0 text-[9px]",children:w[m.section]}),m.section==="untracked"?e.jsx(g,{variant:"secondary",className:"rounded-sm px-1.5 py-0 text-[9px]",children:"File content"}):e.jsx(g,{variant:"secondary",className:"rounded-sm px-1.5 py-0 text-[9px]",children:"Diff patch"})]}),e.jsx("div",{className:"mt-1 break-all font-mono text-[9px] text-muted-foreground",children:m.path})]}),e.jsx("div",{className:"min-h-0 flex-1 overflow-auto p-1.5",children:m.section==="untracked"?e.jsx(K,{loading:L,error:M,content:u}):e.jsx(H,{patch:m.patch??""})})]}):e.jsx(f,{tone:"muted",children:"Select a file to inspect."})})]}):e.jsx(f,{tone:"muted",children:"Working tree is clean."}):e.jsx(f,{tone:"muted",children:"Task working directory is not inside a Git repository."})}function V({section:r,items:t,selectedId:s,onSelect:n}){const a=l.useMemo(()=>I(t),[t]),d=l.useMemo(()=>t.find(u=>u.id===s)??null,[t,s]),c=l.useMemo(()=>new Set(d?G(d.path):[]),[d]),[i,h]=l.useState(!0);return e.jsxs("section",{className:"rounded-sm border border-border/60 bg-background/35",children:[e.jsxs("button",{type:"button",onClick:()=>h(u=>!u),"aria-expanded":i,className:N("flex w-full items-center justify-between gap-1.5 px-2 py-1 text-left transition-colors hover:bg-background/55",i?"border-b border-border/60":""),children:[e.jsxs("div",{className:"flex items-center gap-1",children:[i?e.jsx($,{className:"h-3 w-3 shrink-0 text-muted-foreground"}):e.jsx(T,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),e.jsx("span",{className:"text-[10px] font-medium text-foreground",children:w[r]})]}),e.jsx(g,{variant:"outline",className:"rounded-sm border-border/70 bg-background/60 px-1.5 py-0 text-[9px]",children:t.length})]}),i&&e.jsx("div",{className:"p-1",children:a.length>0?e.jsx("div",{className:"space-y-0.5",children:a.map(u=>e.jsx(U,{node:u,depth:0,selectedId:s,expandedAncestorPaths:c,onSelect:n},`${r}:${u.path}`))}):e.jsx("div",{className:"rounded-sm border border-dashed border-border/70 bg-background/30 px-2 py-1 text-[10px] text-muted-foreground",children:"No files."})})]})}function U({node:r,depth:t,selectedId:s,expandedAncestorPaths:n,onSelect:a}){var d;return r.type==="folder"?e.jsx(z,{node:r,depth:t,selectedId:s,expandedAncestorPaths:n,onSelect:a}):e.jsxs("button",{type:"button",onClick:()=>{r.item&&a(r.item.id)},className:N("flex w-full cursor-pointer items-center gap-1 rounded-sm px-1 py-0.5 text-left transition-colors",((d=r.item)==null?void 0:d.id)===s?"bg-primary/10 text-foreground":"text-foreground/90 hover:bg-background/55"),style:{paddingLeft:`${t*10+5}px`},children:[e.jsx(_,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),e.jsx("span",{className:"truncate text-[10px] leading-4",children:r.name})]})}function z({node:r,depth:t,selectedId:s,expandedAncestorPaths:n,onSelect:a}){const[d,c]=l.useState(!0);return l.useEffect(()=>{n.has(r.path)&&c(!0)},[n,r.path]),e.jsxs("div",{children:[e.jsxs("button",{type:"button",onClick:()=>c(i=>!i),"aria-expanded":d,className:"flex w-full cursor-pointer select-none items-center gap-1 rounded-sm px-1 py-0.5 text-left text-[10px] leading-4 text-muted-foreground transition-colors hover:bg-background/55 hover:text-foreground",style:{paddingLeft:`${t*10+5}px`},children:[d?e.jsx($,{className:"h-3 w-3 shrink-0"}):e.jsx(T,{className:"h-3 w-3 shrink-0"}),e.jsx(B,{className:"h-3 w-3 shrink-0"}),e.jsx("span",{className:"truncate",children:r.name})]}),d&&e.jsx("div",{className:"space-y-0.5",children:(r.children??[]).map(i=>e.jsx(U,{node:i,depth:t+1,selectedId:s,expandedAncestorPaths:n,onSelect:a},i.path))})]})}function H({patch:r}){const t=r.split(`
4
+ `);return e.jsxs("div",{className:"rounded-sm border border-border/60 bg-background/55",children:[e.jsxs("div",{className:"border-b border-border/60 px-2.5 py-1.5",children:[e.jsx("div",{className:"text-[10px] font-medium text-foreground",children:"File diff"}),e.jsxs("div",{className:"mt-0.5 text-[9px] text-muted-foreground",children:[t.length," lines"]})]}),e.jsx("div",{className:"font-mono text-[10px] leading-4",children:t.map((s,n)=>e.jsxs("div",{className:N("grid grid-cols-[36px_minmax(0,1fr)] gap-2 px-2.5 py-px",q(s)),children:[e.jsx("span",{className:"select-none text-right text-muted-foreground/55",children:n+1}),e.jsx("span",{className:"whitespace-pre-wrap break-all text-foreground",children:s||" "})]},`${n}-${s}`))})]})}function K({loading:r,error:t,content:s}){if(r)return e.jsx(f,{tone:"muted",children:"Loading file content..."});if(t)return e.jsx(f,{tone:"destructive",children:t});if(!s)return e.jsx(f,{tone:"muted",children:"Select an untracked file to preview its content."});if(s.kind==="image"){const n=s.content?`data:${s.mimeType};base64,${s.content}`:s.downloadUrl;return n?e.jsx("div",{className:"flex min-h-[18rem] items-center justify-center rounded-sm border border-border/60 bg-background/55 p-3",children:e.jsx("img",{src:n,alt:s.path,className:"max-h-full max-w-full rounded-sm object-contain shadow-[0_24px_90px_-52px_rgba(0,0,0,0.65)]"})}):e.jsx(f,{tone:"muted",children:"Image preview is not available."})}if(s.kind==="pdf"&&s.downloadUrl)return e.jsx("div",{className:"h-full min-h-[22rem] overflow-hidden rounded-sm border border-border/60 bg-background/55",children:e.jsx("iframe",{src:s.downloadUrl,title:s.path,className:"h-full w-full border-0"})});if(s.kind==="json"){let n=s.content;try{n=JSON.stringify(JSON.parse(s.content),null,2)}catch{}return e.jsx(W,{content:n,truncated:s.truncated})}return s.kind==="markdown"||s.kind==="text"||s.kind==="html"?e.jsx(W,{content:s.content,truncated:s.truncated}):e.jsx(f,{tone:"muted",children:"This file cannot be previewed inline."})}function W({content:r,truncated:t}){return e.jsxs("div",{className:"rounded-sm border border-border/60 bg-background/55",children:[e.jsx("pre",{className:"overflow-x-auto whitespace-pre-wrap px-2.5 py-2 font-mono text-[10px] leading-4 text-foreground",children:r}),t&&e.jsx("div",{className:"border-t border-border/60 px-2.5 py-1.5 text-[10px] text-muted-foreground",children:"Content truncated. Open the Files tab to inspect the full artifact."})]})}function f({children:r,tone:t}){return e.jsx("div",{className:N("flex h-full min-h-[10rem] items-center justify-center rounded-sm text-[10px]",t==="muted"?"text-muted-foreground":"text-destructive"),children:r})}function q(r){return r.startsWith("@@")?"bg-sky-500/10":r.startsWith("+")&&!r.startsWith("+++")?"bg-emerald-500/10":r.startsWith("-")&&!r.startsWith("---")?"bg-destructive/10":r.startsWith("diff ")||r.startsWith("index ")||r.startsWith("---")||r.startsWith("+++")?"bg-muted/45":""}export{se as DiffTab};
@@ -1,4 +1,4 @@
1
- import{c as p,r as o,be as P,bf as H,bg as J,j as e,K as j,B as m,i as K,b as x}from"./index-DRZPNGjF.js";import{F as V}from"./folder-4s83uDUg.js";import{F as W}from"./file-DGPntQ15.js";import{w as q}from"./DashboardShared-CTPyyRmo.js";/**
1
+ import{c as p,r as o,be as P,bf as H,bg as J,j as e,K as j,B as m,i as K,b as x}from"./index-Dcj0nR-j.js";import{F as V}from"./folder-BMmcfsyZ.js";import{F as W}from"./file-BduJ6PU6.js";import{w as q}from"./DashboardShared-BohLaqeo.js";/**
2
2
  * @license lucide-react v1.7.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as z,j as e,I as W,B as u,bh as T,ah as B,r as a,bi as X,bg as Y,w as Z,x as ee,y as se,bj as re,K as _}from"./index-DRZPNGjF.js";import{P as te}from"./play-CwRlqpr6.js";/**
1
+ import{c as z,j as e,I as W,B as u,bh as T,ah as B,r as a,bi as X,bg as Y,w as Z,x as ee,y as se,bj as re,K as _}from"./index-Dcj0nR-j.js";import{P as te}from"./play-Dc8Adtxz.js";/**
2
2
  * @license lucide-react v1.7.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,7 +1,7 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/FilesTab-BnDrsKON.js","assets/index-DRZPNGjF.js","assets/index-DfAVj5ZJ.css","assets/folder-4s83uDUg.js","assets/file-DGPntQ15.js","assets/DashboardShared-CTPyyRmo.js","assets/PreviewTab-D37EkfYZ.js","assets/play-CwRlqpr6.js"])))=>i.map(i=>d[i]);
2
- import{c as N,aL as k,r as s,j as e,L as S,P as T,O as C,a5 as P,b5 as M,b6 as _,b7 as j,b8 as E,b9 as L,a0 as w,ba as O}from"./index-DRZPNGjF.js";import{u as A,q as I,p as z,h as F,L as R,C as q,T as v,m as D}from"./DashboardShared-CTPyyRmo.js";/**
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/FilesTab-CYA4YD9M.js","assets/index-Dcj0nR-j.js","assets/index-CXPXpidI.css","assets/folder-BMmcfsyZ.js","assets/file-BduJ6PU6.js","assets/DashboardShared-BohLaqeo.js","assets/PreviewTab-Cz-QrEJn.js","assets/play-Dc8Adtxz.js"])))=>i.map(i=>d[i]);
2
+ import{c as N,aL as k,r as s,j as e,L as S,P as T,O as C,a5 as P,b5 as M,b6 as _,b7 as j,b8 as E,b9 as L,a0 as w,ba as O}from"./index-Dcj0nR-j.js";import{u as A,q as I,p as z,h as F,L as R,C as q,T as v,m as D}from"./DashboardShared-BohLaqeo.js";/**
3
3
  * @license lucide-react v1.7.0 - ISC
4
4
  *
5
5
  * This source code is licensed under the ISC license.
6
6
  * See the LICENSE file in the root directory of this source tree.
7
- */const V=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M7 11h10",key:"1twpyw"}],["path",{d:"M7 15h6",key:"d9of3u"}],["path",{d:"M7 7h8",key:"af5zfr"}]],B=N("message-square-text",V),G=s.lazy(async()=>({default:(await w(()=>import("./FilesTab-BnDrsKON.js"),__vite__mapDeps([0,1,2,3,4,5]))).FilesTab})),H=s.lazy(async()=>({default:(await w(()=>import("./PreviewTab-D37EkfYZ.js"),__vite__mapDeps([6,1,2,7]))).PreviewTab})),U={getOutput:j,getOutputTree:_,getOutputContent:M},W={getOutput:j,createPreviewSession:(t,r)=>O(t,typeof r=="string"?r:r==null?void 0:r.path)};function Q(){const{shareId:t}=k(),[r,d]=s.useState(null),[o,a]=s.useState([]),[x,c]=s.useState(!0),[g,i]=s.useState(null),l=s.useRef(null);return s.useEffect(()=>{if(!t){d(null),a([]),i("Shared conversation not found"),c(!1);return}let u=!1;l.current=t,c(!0),i(null);const h=async n=>{try{const[m,f]=await Promise.all([E(t),L(t)]);if(u||l.current!==t)return;d(m),a(y=>n?f.logs:D(y,f.logs)),i(null)}catch(m){if(u||l.current!==t)return;n&&(d(null),a([]),i(m instanceof Error?m.message:"Failed to load shared conversation"))}finally{!u&&l.current===t&&n&&c(!1)}};h(!0);const p=window.setInterval(()=>{h(!1)},2500);return()=>{u=!0,window.clearInterval(p)}},[t]),e.jsx(Z,{conversation:r,logs:o,loading:x,error:g})}function Z({conversation:t,logs:r,loading:d,error:o}){const[a,x]=s.useState("transcript"),[c,g]=s.useState(!1),i=s.useMemo(()=>{if(!t)return null;const n=A(t.payload.initialMessage);return n.length>0?I(n,new Date(t.createdAt).toISOString()):null},[t]),l=s.useMemo(()=>z([...i?[i]:[],...r]),[i,r]),u=s.useMemo(()=>F(l),[l]),h=(t==null?void 0:t.scope)==="filesPreview",p=e.jsx("section",{className:"min-h-0 flex-1 overflow-y-auto overscroll-contain scroll-pb-16 bg-gradient-to-b from-background/15 via-transparent to-background/35 px-4 py-5 sm:px-6",children:e.jsxs("div",{className:"mx-auto flex max-w-[72rem] flex-col gap-5 pb-16",children:[d&&e.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-border/60 bg-background/60 px-4 py-3 text-sm text-muted-foreground",children:[e.jsx(R,{className:"h-4 w-4 animate-spin"}),"Loading shared conversation..."]}),!d&&o&&e.jsxs("div",{className:"rounded-lg border border-destructive/20 bg-destructive/10 px-5 py-8 text-center text-destructive",children:[e.jsx("div",{className:"text-base font-semibold",children:"Shared conversation unavailable"}),e.jsx("div",{className:"mt-2 text-sm",children:o})]}),!d&&!o&&l.length===0&&e.jsxs("div",{className:"rounded-lg border border-dashed border-border/70 bg-background/35 px-5 py-8 text-center",children:[e.jsx(B,{className:"mx-auto h-6 w-6 text-muted-foreground"}),e.jsx("div",{className:"mt-3 text-sm font-medium text-foreground",children:"No transcript output yet"})]}),!d&&!o&&u.map(({event:n,subItems:m},f)=>e.jsx(q,{event:n,agent:t==null?void 0:t.agent,subItems:m,questionResponseDisabled:!0},`shared-${f}`))]})});return e.jsxs("div",{className:"relative h-full overflow-hidden bg-background text-foreground",children:[e.jsx("div",{className:"mesh-grid pointer-events-none absolute inset-0"}),e.jsxs("div",{className:"relative z-10 flex h-full min-h-0 gap-3 px-3 py-3 sm:px-5 lg:px-6",children:[e.jsxs("aside",{className:"dashboard-panel dashboard-panel-muted animate-panel-settle hidden w-64 shrink-0 flex-col overflow-hidden rounded-xl px-4 py-5 lg:flex xl:w-72",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg border border-border/70 bg-foreground text-xs font-semibold tracking-[0.24em] text-background shadow-sm",children:"M"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"truncate text-sm font-semibold text-foreground",children:"Meshy Workspace"}),e.jsx("div",{className:"text-[10px] font-medium uppercase tracking-[0.24em] text-muted-foreground",children:"Shared view"})]})]}),e.jsx("div",{className:"mt-7 text-[11px] font-medium uppercase tracking-[0.28em] text-muted-foreground",children:"Shared conversation"}),t&&e.jsxs("div",{className:"mt-3 space-y-3",children:[e.jsx("h1",{className:"max-h-28 overflow-hidden break-words text-base font-semibold leading-5 text-foreground [overflow-wrap:anywhere]",title:t.title,children:t.title}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(S,{status:t.status}),e.jsx(T,{priority:t.priority})]}),e.jsxs("div",{className:"space-y-1 text-xs text-muted-foreground",children:[e.jsxs("div",{children:["updated ",C(t.updatedAt)]}),e.jsx("div",{className:"font-mono",children:t.id.slice(0,8)})]})]}),e.jsxs("div",{className:"mt-auto space-y-2 pt-6",children:[c&&e.jsx("div",{className:"rounded-xl border border-border/70 bg-background/80 p-3 font-mono text-[11px] text-foreground shadow-sm",children:"npx -y meshy-node@latest start"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("a",{href:"https://github.com/ai-microsoft/meshy",target:"_blank",rel:"noreferrer","aria-label":"Open Meshy on GitHub",className:"inline-flex h-9 w-9 items-center justify-center rounded-sm border border-border/70 bg-background/70 text-muted-foreground transition-colors hover:text-foreground",children:e.jsx($,{className:"h-4 w-4"})}),e.jsxs("button",{type:"button",onClick:()=>g(n=>!n),"aria-expanded":c,className:"inline-flex h-9 items-center gap-2 rounded-sm border border-border/70 bg-background/70 px-3 text-xs font-medium text-muted-foreground transition-colors hover:text-foreground",children:[e.jsx(P,{className:"h-4 w-4"}),"Try it"]})]})]})]}),e.jsxs("main",{className:"dashboard-panel animate-panel-settle flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden rounded-xl",children:[e.jsxs("header",{className:"shrink-0 border-b border-border/55 bg-card/28 px-4 py-3 sm:px-6",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-sm border border-border/70 bg-foreground text-xs font-semibold tracking-[0.24em] text-background lg:hidden",children:"M"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-[11px] font-medium uppercase tracking-[0.28em] text-muted-foreground",children:"Meshy Workspace"}),e.jsx("div",{className:"truncate text-base font-semibold text-foreground",children:(t==null?void 0:t.title)??"Shared conversation"})]})]}),h&&e.jsxs("div",{className:"mt-3 inline-flex h-auto rounded-sm bg-muted/70 p-0.5 text-muted-foreground",children:[e.jsx("button",{type:"button",onClick:()=>x("transcript"),className:b(a==="transcript"),children:"Transcript"}),e.jsx("button",{type:"button",onClick:()=>x("files"),className:b(a==="files"),children:"Files"}),e.jsx("button",{type:"button",onClick:()=>x("preview"),className:b(a==="preview"),children:"Preview"})]})]}),h&&t?e.jsxs(e.Fragment,{children:[a==="transcript"&&p,a==="files"&&e.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:e.jsx(s.Suspense,{fallback:e.jsx(v,{label:"Loading files..."}),children:e.jsx(G,{taskId:t.shareId,api:U})})}),a==="preview"&&e.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:e.jsx(s.Suspense,{fallback:e.jsx(v,{label:"Loading preview..."}),children:e.jsx(H,{taskId:t.shareId,api:W,allowPortPreview:!1})})})]}):p]})]})]})}function b(t){return t?"inline-flex items-center justify-center whitespace-nowrap rounded-sm bg-background px-2.5 py-0.5 text-[11px] font-medium text-foreground shadow-sm":"inline-flex items-center justify-center whitespace-nowrap rounded-sm px-2.5 py-0.5 text-[11px] font-medium transition-colors hover:text-foreground"}function $({className:t}){return e.jsx("svg",{className:t,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:e.jsx("path",{d:"M12 2C6.48 2 2 6.58 2 12.23c0 4.51 2.87 8.34 6.84 9.7.5.1.68-.22.68-.49 0-.24-.01-.88-.01-1.73-2.78.62-3.37-1.37-3.37-1.37-.45-1.18-1.11-1.49-1.11-1.49-.91-.64.07-.63.07-.63 1 .07 1.53 1.06 1.53 1.06.89 1.56 2.34 1.11 2.91.85.09-.66.35-1.11.63-1.37-2.22-.26-4.55-1.14-4.55-5.05 0-1.12.39-2.03 1.03-2.75-.1-.26-.45-1.31.1-2.71 0 0 .84-.27 2.75 1.05A9.3 9.3 0 0 1 12 6.96c.85 0 1.71.12 2.51.34 1.91-1.32 2.75-1.05 2.75-1.05.55 1.4.2 2.45.1 2.71.64.72 1.03 1.63 1.03 2.75 0 3.92-2.34 4.79-4.57 5.05.36.32.68.94.68 1.9 0 1.37-.01 2.47-.01 2.81 0 .27.18.59.69.49A10.05 10.05 0 0 0 22 12.23C22 6.58 17.52 2 12 2Z"})})}export{Q as SharedConversationPage,Z as SharedConversationView};
7
+ */const V=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M7 11h10",key:"1twpyw"}],["path",{d:"M7 15h6",key:"d9of3u"}],["path",{d:"M7 7h8",key:"af5zfr"}]],B=N("message-square-text",V),G=s.lazy(async()=>({default:(await w(()=>import("./FilesTab-CYA4YD9M.js"),__vite__mapDeps([0,1,2,3,4,5]))).FilesTab})),H=s.lazy(async()=>({default:(await w(()=>import("./PreviewTab-Cz-QrEJn.js"),__vite__mapDeps([6,1,2,7]))).PreviewTab})),U={getOutput:j,getOutputTree:_,getOutputContent:M},W={getOutput:j,createPreviewSession:(t,r)=>O(t,typeof r=="string"?r:r==null?void 0:r.path)};function Q(){const{shareId:t}=k(),[r,d]=s.useState(null),[o,a]=s.useState([]),[x,c]=s.useState(!0),[g,i]=s.useState(null),l=s.useRef(null);return s.useEffect(()=>{if(!t){d(null),a([]),i("Shared conversation not found"),c(!1);return}let u=!1;l.current=t,c(!0),i(null);const h=async n=>{try{const[m,f]=await Promise.all([E(t),L(t)]);if(u||l.current!==t)return;d(m),a(y=>n?f.logs:D(y,f.logs)),i(null)}catch(m){if(u||l.current!==t)return;n&&(d(null),a([]),i(m instanceof Error?m.message:"Failed to load shared conversation"))}finally{!u&&l.current===t&&n&&c(!1)}};h(!0);const p=window.setInterval(()=>{h(!1)},2500);return()=>{u=!0,window.clearInterval(p)}},[t]),e.jsx(Z,{conversation:r,logs:o,loading:x,error:g})}function Z({conversation:t,logs:r,loading:d,error:o}){const[a,x]=s.useState("transcript"),[c,g]=s.useState(!1),i=s.useMemo(()=>{if(!t)return null;const n=A(t.payload.initialMessage);return n.length>0?I(n,new Date(t.createdAt).toISOString()):null},[t]),l=s.useMemo(()=>z([...i?[i]:[],...r]),[i,r]),u=s.useMemo(()=>F(l),[l]),h=(t==null?void 0:t.scope)==="filesPreview",p=e.jsx("section",{className:"min-h-0 flex-1 overflow-y-auto overscroll-contain scroll-pb-16 bg-gradient-to-b from-background/15 via-transparent to-background/35 px-4 py-5 sm:px-6",children:e.jsxs("div",{className:"mx-auto flex max-w-[72rem] flex-col gap-5 pb-16",children:[d&&e.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-border/60 bg-background/60 px-4 py-3 text-sm text-muted-foreground",children:[e.jsx(R,{className:"h-4 w-4 animate-spin"}),"Loading shared conversation..."]}),!d&&o&&e.jsxs("div",{className:"rounded-lg border border-destructive/20 bg-destructive/10 px-5 py-8 text-center text-destructive",children:[e.jsx("div",{className:"text-base font-semibold",children:"Shared conversation unavailable"}),e.jsx("div",{className:"mt-2 text-sm",children:o})]}),!d&&!o&&l.length===0&&e.jsxs("div",{className:"rounded-lg border border-dashed border-border/70 bg-background/35 px-5 py-8 text-center",children:[e.jsx(B,{className:"mx-auto h-6 w-6 text-muted-foreground"}),e.jsx("div",{className:"mt-3 text-sm font-medium text-foreground",children:"No transcript output yet"})]}),!d&&!o&&u.map(({event:n,subItems:m},f)=>e.jsx(q,{event:n,agent:t==null?void 0:t.agent,subItems:m,questionResponseDisabled:!0},`shared-${f}`))]})});return e.jsxs("div",{className:"relative h-full overflow-hidden bg-background text-foreground",children:[e.jsx("div",{className:"mesh-grid pointer-events-none absolute inset-0"}),e.jsxs("div",{className:"relative z-10 flex h-full min-h-0 gap-3 px-3 py-3 sm:px-5 lg:px-6",children:[e.jsxs("aside",{className:"dashboard-panel dashboard-panel-muted animate-panel-settle hidden w-64 shrink-0 flex-col overflow-hidden rounded-xl px-4 py-5 lg:flex xl:w-72",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg border border-border/70 bg-foreground text-xs font-semibold tracking-[0.24em] text-background shadow-sm",children:"M"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"truncate text-sm font-semibold text-foreground",children:"Meshy Workspace"}),e.jsx("div",{className:"text-[10px] font-medium uppercase tracking-[0.24em] text-muted-foreground",children:"Shared view"})]})]}),e.jsx("div",{className:"mt-7 text-[11px] font-medium uppercase tracking-[0.28em] text-muted-foreground",children:"Shared conversation"}),t&&e.jsxs("div",{className:"mt-3 space-y-3",children:[e.jsx("h1",{className:"max-h-28 overflow-hidden break-words text-base font-semibold leading-5 text-foreground [overflow-wrap:anywhere]",title:t.title,children:t.title}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(S,{status:t.status}),e.jsx(T,{priority:t.priority})]}),e.jsxs("div",{className:"space-y-1 text-xs text-muted-foreground",children:[e.jsxs("div",{children:["updated ",C(t.updatedAt)]}),e.jsx("div",{className:"font-mono",children:t.id.slice(0,8)})]})]}),e.jsxs("div",{className:"mt-auto space-y-2 pt-6",children:[c&&e.jsx("div",{className:"rounded-xl border border-border/70 bg-background/80 p-3 font-mono text-[11px] text-foreground shadow-sm",children:"npx -y meshy-node@latest start"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("a",{href:"https://github.com/ai-microsoft/meshy",target:"_blank",rel:"noreferrer","aria-label":"Open Meshy on GitHub",className:"inline-flex h-9 w-9 items-center justify-center rounded-sm border border-border/70 bg-background/70 text-muted-foreground transition-colors hover:text-foreground",children:e.jsx($,{className:"h-4 w-4"})}),e.jsxs("button",{type:"button",onClick:()=>g(n=>!n),"aria-expanded":c,className:"inline-flex h-9 items-center gap-2 rounded-sm border border-border/70 bg-background/70 px-3 text-xs font-medium text-muted-foreground transition-colors hover:text-foreground",children:[e.jsx(P,{className:"h-4 w-4"}),"Try it"]})]})]})]}),e.jsxs("main",{className:"dashboard-panel animate-panel-settle flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden rounded-xl",children:[e.jsxs("header",{className:"shrink-0 border-b border-border/55 bg-card/28 px-4 py-3 sm:px-6",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-sm border border-border/70 bg-foreground text-xs font-semibold tracking-[0.24em] text-background lg:hidden",children:"M"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-[11px] font-medium uppercase tracking-[0.28em] text-muted-foreground",children:"Meshy Workspace"}),e.jsx("div",{className:"truncate text-base font-semibold text-foreground",children:(t==null?void 0:t.title)??"Shared conversation"})]})]}),h&&e.jsxs("div",{className:"mt-3 inline-flex h-auto rounded-sm bg-muted/70 p-0.5 text-muted-foreground",children:[e.jsx("button",{type:"button",onClick:()=>x("transcript"),className:b(a==="transcript"),children:"Transcript"}),e.jsx("button",{type:"button",onClick:()=>x("files"),className:b(a==="files"),children:"Files"}),e.jsx("button",{type:"button",onClick:()=>x("preview"),className:b(a==="preview"),children:"Preview"})]})]}),h&&t?e.jsxs(e.Fragment,{children:[a==="transcript"&&p,a==="files"&&e.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:e.jsx(s.Suspense,{fallback:e.jsx(v,{label:"Loading files..."}),children:e.jsx(G,{taskId:t.shareId,api:U})})}),a==="preview"&&e.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:e.jsx(s.Suspense,{fallback:e.jsx(v,{label:"Loading preview..."}),children:e.jsx(H,{taskId:t.shareId,api:W,allowPortPreview:!1})})})]}):p]})]})]})}function b(t){return t?"inline-flex items-center justify-center whitespace-nowrap rounded-sm bg-background px-2.5 py-0.5 text-[11px] font-medium text-foreground shadow-sm":"inline-flex items-center justify-center whitespace-nowrap rounded-sm px-2.5 py-0.5 text-[11px] font-medium transition-colors hover:text-foreground"}function $({className:t}){return e.jsx("svg",{className:t,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:e.jsx("path",{d:"M12 2C6.48 2 2 6.58 2 12.23c0 4.51 2.87 8.34 6.84 9.7.5.1.68-.22.68-.49 0-.24-.01-.88-.01-1.73-2.78.62-3.37-1.37-3.37-1.37-.45-1.18-1.11-1.49-1.11-1.49-.91-.64.07-.63.07-.63 1 .07 1.53 1.06 1.53 1.06.89 1.56 2.34 1.11 2.91.85.09-.66.35-1.11.63-1.37-2.22-.26-4.55-1.14-4.55-5.05 0-1.12.39-2.03 1.03-2.75-.1-.26-.45-1.31.1-2.71 0 0 .84-.27 2.75 1.05A9.3 9.3 0 0 1 12 6.96c.85 0 1.71.12 2.51.34 1.91-1.32 2.75-1.05 2.75-1.05.55 1.4.2 2.45.1 2.71.64.72 1.03 1.63 1.03 2.75 0 3.92-2.34 4.79-4.57 5.05.36.32.68.94.68 1.9 0 1.37-.01 2.47-.01 2.81 0 .27.18.59.69.49A10.05 10.05 0 0 0 22 12.23C22 6.58 17.52 2 12 2Z"})})}export{Q as SharedConversationPage,Z as SharedConversationView};
@@ -1,4 +1,4 @@
1
- import{c as a}from"./index-DRZPNGjF.js";/**
1
+ import{c as a}from"./index-Dcj0nR-j.js";/**
2
2
  * @license lucide-react v1.7.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as o}from"./index-DRZPNGjF.js";/**
1
+ import{c as o}from"./index-Dcj0nR-j.js";/**
2
2
  * @license lucide-react v1.7.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.