meshy-node 0.2.4 → 0.2.6
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/README.md +1 -1
- package/dashboard/assets/DashboardPage-DeFE8aKR.js +120 -0
- package/dashboard/assets/DashboardShared-B08ZGEU3.js +59 -0
- package/dashboard/assets/{DiffTab-DZflzi04.js → DiffTab-D6XXV_vj.js} +3 -3
- package/dashboard/assets/{FilesTab-Ju38uner.js → FilesTab-DUebfVJo.js} +12 -12
- package/dashboard/assets/PreviewTab-CfNP0Ll3.js +16 -0
- package/dashboard/assets/SharedConversationPage-D2ncPenP.js +7 -0
- package/dashboard/assets/{file-Bp-JAQYC.js → file-C-p99c1E.js} +1 -1
- package/dashboard/assets/folder-C0oopt2q.js +11 -0
- package/dashboard/assets/{index-CxdvKkO7.js → index-B7PaE6U7.js} +26 -25
- package/dashboard/assets/index-CxJE8HAC.css +1 -0
- package/dashboard/index.html +2 -2
- package/main.cjs +489 -39
- package/package.json +1 -1
- package/runtime-metadata.json +5 -5
- package/dashboard/assets/DashboardPage-3CEGtmWK.js +0 -183
- package/dashboard/assets/PreviewTab-B0KcnZfd.js +0 -16
- package/dashboard/assets/index-Dl1FKoUn.css +0 -1
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import{c as b,r as n,aB as O,aA as L,j as e,i as o,a0 as P,B as C,J as _,D,g as A,aC as F}from"./index-B7PaE6U7.js";/**
|
|
2
|
+
* @license lucide-react v1.7.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const H=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],R=b("maximize-2",H);/**
|
|
7
|
+
* @license lucide-react v1.7.0 - ISC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the ISC license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/const $=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],B=b("minimize-2",$);/**
|
|
12
|
+
* @license lucide-react v1.7.0 - ISC
|
|
13
|
+
*
|
|
14
|
+
* This source code is licensed under the ISC license.
|
|
15
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
+
*/const U=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],g=b("refresh-cw",U),q={getOutput:L,createPreviewSession:O};function J({taskId:i,api:l=q}){var E;const[r,x]=n.useState(null),[t,v]=n.useState(null),[f,j]=n.useState(null),[S,w]=n.useState(!0),[N,p]=n.useState(null),[z,y]=n.useState(!1),k=n.useCallback(async()=>{w(!0),p(null),x(null),v(null),j(null);try{const s=await l.getOutput(i);x(s),w(!1)}catch(s){p(s instanceof Error?s.message:"Failed to load output"),w(!1)}},[l,i]);n.useEffect(()=>{k()},[k]);const d=n.useCallback(async s=>{p(null);try{const a=await l.createPreviewSession(i,s);v(a),j(a.entryPath)}catch(a){p(a instanceof Error?a.message:"Failed to create preview session")}},[l,i]);n.useEffect(()=>{var a,u;if(!(r!=null&&r.available)||!((a=r.summary)!=null&&a.htmlEntries.length)||t)return;const s=f??((u=r.summary.htmlEntries[0])==null?void 0:u.path);s&&d(s)},[r,f,t,d]);const c=n.useCallback(()=>{var a,u;v(null);const s=(t==null?void 0:t.entryPath)??f??((u=(a=r==null?void 0:r.summary)==null?void 0:a.htmlEntries[0])==null?void 0:u.path);s&&d(s)},[r,f,t,d]);if(n.useEffect(()=>{if(!t)return;const s=t.expiresAt-Date.now()-5e3;if(s<=0){c();return}const a=window.setTimeout(c,s);return()=>window.clearTimeout(a)},[c,t]),S)return e.jsx(m,{children:"Loading preview..."});if(!(r!=null&&r.available))return e.jsx(m,{children:"Task output is not available yet."});const h=((E=r.summary)==null?void 0:E.htmlEntries)??[];if(h.length===0)return e.jsx(m,{children:"No HTML files were found in this task output."});if(N)return e.jsx(m,{children:e.jsxs("div",{className:"space-y-4 text-center",children:[e.jsx("div",{className:"text-sm text-destructive",children:N}),e.jsx("div",{className:"flex justify-center",children:e.jsxs(o,{variant:"outline",size:"sm",onClick:c,className:"rounded-full",children:[e.jsx(g,{className:"h-3.5 w-3.5"}),"Retry"]})})]})});if(!t)return e.jsx(m,{children:"Starting preview session..."});const T=e.jsx("iframe",{src:t.previewUrl,className:"h-full w-full border-0",sandbox:"allow-scripts allow-same-origin",title:"HTML Preview"});return e.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[e.jsxs("div",{className:"shrink-0 border-b border-border/60 px-4 py-2.5",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[e.jsx("span",{className:"truncate text-sm font-semibold text-foreground",children:t.entryPath}),e.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:M(t.expiresAt)})]}),e.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[e.jsx(o,{variant:"ghost",size:"icon",className:"h-7 w-7 rounded-full",onClick:c,title:"Refresh",children:e.jsx(g,{className:"h-3.5 w-3.5"})}),e.jsx(o,{variant:"ghost",size:"icon",className:"h-7 w-7 rounded-full",asChild:!0,title:"Open in new tab",children:e.jsx("a",{href:t.previewUrl,target:"_blank",rel:"noopener noreferrer",children:e.jsx(P,{className:"h-3.5 w-3.5"})})}),e.jsx(o,{variant:"ghost",size:"icon",className:"h-7 w-7 rounded-full",onClick:()=>y(!0),title:"Fullscreen",children:e.jsx(R,{className:"h-3.5 w-3.5"})})]})]}),h.length>1&&e.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:h.map(s=>e.jsx("button",{type:"button",onClick:()=>{j(s.path),d(s.path)},className:t.entryPath===s.path?"rounded-full border border-primary/40 bg-primary/10 px-3 py-1 text-xs font-medium text-primary":"rounded-full border border-border/70 bg-background/55 px-3 py-1 text-xs text-muted-foreground transition-colors hover:text-foreground",children:s.label},s.path))}),e.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[e.jsxs(C,{variant:"outline",className:"rounded-full border-border/70 bg-background/60",children:[h.length," ",h.length===1?"entry":"entries"]}),e.jsx(C,{variant:"outline",className:"rounded-full border-border/70 bg-background/60",children:"Sandboxed iframe"})]})]}),e.jsx("div",{className:"min-h-0 flex-1 p-2",children:e.jsx("div",{className:"h-full overflow-hidden rounded-2xl border border-border/60 bg-white shadow-sm",children:T})}),e.jsx(_,{open:z,onOpenChange:y,children:e.jsxs(D,{className:"flex h-[95vh] max-w-[95vw] flex-col gap-0 overflow-hidden p-0",children:[e.jsxs(A,{className:"sr-only",children:["Preview: ",t.entryPath]}),e.jsxs("div",{className:"flex shrink-0 items-center justify-between border-b border-border/60 px-4 py-2",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm font-semibold text-foreground",children:t.entryPath}),e.jsx("span",{className:"text-xs text-muted-foreground",children:M(t.expiresAt)})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(o,{variant:"ghost",size:"icon",className:"h-7 w-7 rounded-full",onClick:c,title:"Refresh",children:e.jsx(g,{className:"h-3.5 w-3.5"})}),e.jsx(o,{variant:"ghost",size:"icon",className:"h-7 w-7 rounded-full",asChild:!0,title:"Open in new tab",children:e.jsx("a",{href:t.previewUrl,target:"_blank",rel:"noopener noreferrer",children:e.jsx(P,{className:"h-3.5 w-3.5"})})}),e.jsx(F,{asChild:!0,children:e.jsxs(o,{variant:"outline",size:"sm",className:"rounded-full",title:"Exit fullscreen",children:[e.jsx(B,{className:"h-3.5 w-3.5"}),"Exit fullscreen"]})})]})]}),e.jsx("div",{className:"min-h-0 flex-1",children:e.jsx("iframe",{src:t.previewUrl,className:"h-full w-full border-0",sandbox:"allow-scripts allow-same-origin",title:"HTML Preview Fullscreen"})})]})})]})}function m({children:i}){return e.jsx("div",{className:"flex h-64 items-center justify-center text-muted-foreground",children:i})}function M(i){const l=Math.max(0,Math.round((i-Date.now())/1e3));if(l<60)return`${l}s`;const r=Math.floor(l/60),x=l%60;return`${r}m ${x}s`}export{J as PreviewTab};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/FilesTab-DUebfVJo.js","assets/index-B7PaE6U7.js","assets/index-CxJE8HAC.css","assets/folder-C0oopt2q.js","assets/file-C-p99c1E.js","assets/PreviewTab-CfNP0Ll3.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{c as b,aa as j,r as s,ar as v,as as w,j as e,M as N,N as y,at as k,au as S,av as f,aw as T,_ as g}from"./index-B7PaE6U7.js";import{K as P,H as C,G as _,L as M,g as E,f as L,i as p}from"./DashboardShared-B08ZGEU3.js";/**
|
|
3
|
+
* @license lucide-react v1.7.0 - ISC
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the ISC license.
|
|
6
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/const O=[["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"}]],A=b("message-square-text",O),I=s.lazy(async()=>({default:(await g(()=>import("./FilesTab-DUebfVJo.js"),__vite__mapDeps([0,1,2,3,4]))).FilesTab})),F=s.lazy(async()=>({default:(await g(()=>import("./PreviewTab-CfNP0Ll3.js"),__vite__mapDeps([5,1,2]))).PreviewTab})),R={getOutput:f,getOutputTree:S,getOutputContent:k},z={getOutput:f,createPreviewSession:T};function B(){const{shareId:t}=j(),[u,d]=s.useState(null),[o,r]=s.useState([]),[c,n]=s.useState(!0),[m,i]=s.useState(null),l=s.useRef(null);return s.useEffect(()=>{if(!t){d(null),r([]),i("Shared conversation not found"),n(!1);return}l.current=t,n(!0),i(null),Promise.all([v(t),w(t)]).then(([a,x])=>{l.current===t&&(d(a),r(x.logs),i(null))}).catch(a=>{l.current===t&&(d(null),r([]),i(a instanceof Error?a.message:"Failed to load shared conversation"))}).finally(()=>{l.current===t&&n(!1)})},[t]),e.jsx(D,{conversation:u,logs:o,loading:c,error:m})}function D({conversation:t,logs:u,loading:d,error:o}){const[r,c]=s.useState("transcript"),n=s.useMemo(()=>{if(!t)return null;const a=P(t.payload.initialMessage);return a.length>0?C(a,new Date(t.createdAt).toISOString()):null},[t]),m=s.useMemo(()=>_([...n?[n]:[],...u]),[n,u]),i=(t==null?void 0:t.scope)==="filesPreview",l=e.jsx("section",{className:"min-h-0 flex-1 overflow-y-auto overscroll-contain scroll-pb-16 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(M,{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&&m.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(A,{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&&m.map((a,x)=>e.jsx(E,{event:a,questionResponseDisabled:!0},`shared-${x}`))]})});return e.jsxs("div",{className:"relative flex h-full min-h-0 overflow-hidden bg-background text-foreground",children:[e.jsxs("aside",{className:"hidden w-72 shrink-0 border-r border-border/60 bg-background/85 px-5 py-5 lg:block",children:[e.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-md border border-border/70 bg-foreground text-xs font-semibold tracking-[0.24em] text-background",children:"M"}),e.jsx("div",{className:"mt-6 text-xs font-medium uppercase tracking-[0.28em] text-muted-foreground",children:"Shared conversation"}),t&&e.jsxs("div",{className:"mt-4 space-y-3",children:[e.jsx("h1",{className:"text-lg font-semibold leading-6 text-foreground",children:t.title}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(N,{status:t.status}),e.jsx(y,{priority:t.priority})]}),e.jsxs("div",{className:"space-y-1 text-xs text-muted-foreground",children:[e.jsxs("div",{children:["updated ",L(t.updatedAt)]}),e.jsx("div",{className:"font-mono",children:t.id.slice(0,8)})]})]})]}),e.jsxs("main",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:[e.jsxs("header",{className:"shrink-0 border-b border-border/60 bg-background/85 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 items-center justify-center rounded-md 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:"Shared conversation"}),e.jsx("div",{className:"truncate text-base font-semibold text-foreground",children:(t==null?void 0:t.title)??"Meshy"})]})]}),i&&e.jsxs("div",{className:"mt-3 inline-flex h-auto rounded-full bg-muted/70 p-1 text-muted-foreground",children:[e.jsx("button",{type:"button",onClick:()=>c("transcript"),className:h(r==="transcript"),children:"Transcript"}),e.jsx("button",{type:"button",onClick:()=>c("files"),className:h(r==="files"),children:"Files"}),e.jsx("button",{type:"button",onClick:()=>c("preview"),className:h(r==="preview"),children:"Preview"})]})]}),i&&t?e.jsxs(e.Fragment,{children:[r==="transcript"&&l,r==="files"&&e.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:e.jsx(s.Suspense,{fallback:e.jsx(p,{label:"Loading files..."}),children:e.jsx(I,{taskId:t.shareId,api:R})})}),r==="preview"&&e.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:e.jsx(s.Suspense,{fallback:e.jsx(p,{label:"Loading preview..."}),children:e.jsx(F,{taskId:t.shareId,api:z})})})]}):l]})]})}function h(t){return t?"inline-flex items-center justify-center whitespace-nowrap rounded-full bg-background px-3 py-1.5 text-sm font-medium text-foreground shadow-sm":"inline-flex items-center justify-center whitespace-nowrap rounded-full px-3 py-1.5 text-sm font-medium transition-colors hover:text-foreground"}export{B as SharedConversationPage,D as SharedConversationView};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{c as o}from"./index-B7PaE6U7.js";/**
|
|
2
|
+
* @license lucide-react v1.7.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const t=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],c=o("chevron-right",t);/**
|
|
7
|
+
* @license lucide-react v1.7.0 - ISC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the ISC license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/const e=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],h=o("folder",e);export{c as C,h as F};
|