@workflow/web 4.0.1-beta.21 → 4.0.1-beta.22
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/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +2 -2
- package/.next/fallback-build-manifest.json +2 -2
- package/.next/prerender-manifest.json +3 -3
- package/.next/server/app/_global-error.html +2 -2
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page/server-reference-manifest.json +36 -21
- package/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/page/server-reference-manifest.json +37 -22
- package/.next/server/app/page.js.nft.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/run/[runId]/page/server-reference-manifest.json +37 -22
- package/.next/server/app/run/[runId]/page.js.nft.json +1 -1
- package/.next/server/app/run/[runId]/page_client-reference-manifest.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__1365a866._.js +3 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__1365a866._.js.map +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__2168651f._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__2168651f._.js.map +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__25c4ca9a._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__25c4ca9a._.js.map +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__d416fa5e._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__d416fa5e._.js.map +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__e576a2e1._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__e576a2e1._.js.map +1 -1
- package/.next/server/chunks/ssr/_af28dabd._.js +1 -1
- package/.next/server/chunks/ssr/_af28dabd._.js.map +1 -1
- package/.next/server/chunks/ssr/_bff7cae2._.js +1 -1
- package/.next/server/chunks/ssr/_bff7cae2._.js.map +1 -1
- package/.next/server/chunks/ssr/_c8bf1458._.js +1 -1
- package/.next/server/chunks/ssr/_c8bf1458._.js.map +1 -1
- package/.next/server/chunks/ssr/packages_web_src_19bb3951._.js +3 -0
- package/.next/server/chunks/ssr/packages_web_src_19bb3951._.js.map +1 -0
- package/.next/server/chunks/ssr/packages_web_src_app_page_tsx_cd282e82._.js +2 -2
- package/.next/server/chunks/ssr/packages_web_src_app_page_tsx_cd282e82._.js.map +1 -1
- package/.next/server/chunks/ssr/packages_web_src_app_run_[runId]_page_tsx_c7d0b139._.js +1 -1
- package/.next/server/chunks/ssr/packages_web_src_app_run_[runId]_page_tsx_c7d0b139._.js.map +1 -1
- package/.next/server/pages/500.html +2 -2
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +56 -27
- package/.next/static/chunks/{d3781b000675e89a.js → 36a636d76f662255.js} +1 -1
- package/.next/static/chunks/{1633a4677cb7eacd.js → 5cc4b7d8f173d21f.js} +1 -1
- package/.next/static/chunks/8d32c2bf0f991bbb.js +1 -0
- package/.next/static/chunks/8f6413f9323a44e5.js +14 -0
- package/.next/static/chunks/{a2fdd31ef7d1ed50.js → affb91574db5b135.js} +3 -3
- package/.next/static/chunks/c72c95cb5a7775b3.js +5 -0
- package/.next/static/chunks/f71c82ee950bb628.js +60 -0
- package/.next/trace +1 -1
- package/.next/trace-build +1 -1
- package/package.json +2 -1
- package/.next/server/chunks/ssr/packages_web_src_components_ui_select_tsx_7c5238ef._.js +0 -3
- package/.next/server/chunks/ssr/packages_web_src_components_ui_select_tsx_7c5238ef._.js.map +0 -1
- package/.next/static/chunks/7993564ea9cd3862.js +0 -60
- package/.next/static/chunks/915c48af605695f8.js +0 -5
- package/.next/static/chunks/ebaf4c277606b4fc.js +0 -14
- /package/.next/static/{1Gd0u_mHFXgTr2DR4OTNR → ieavtosUwWbQ98kcW2Cp7}/_buildManifest.js +0 -0
- /package/.next/static/{1Gd0u_mHFXgTr2DR4OTNR → ieavtosUwWbQ98kcW2Cp7}/_clientMiddlewareManifest.json +0 -0
- /package/.next/static/{1Gd0u_mHFXgTr2DR4OTNR → ieavtosUwWbQ98kcW2Cp7}/_ssgManifest.js +0 -0
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,330997,e=>{"use strict";var s=e.i(666426);e.i(169764);var t=e.i(545030),r=e.i(868924),a=e.i(531875),o=e.i(932671),l=e.i(504295),n=e.i(687602),i=e.i(886288);let d=(0,i.default)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);var c=e.i(524914),u=e.i(495566);let h=(0,i.default)("RefreshCw",[["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"}]]);var m=e.i(846220),x=e.i(811735),f=e.i(686107),p=e.i(806746),g=e.i(456944),j=e.i(260218),w=e.i(949245);let b=f.forwardRef(({className:e,...t},r)=>(0,s.jsx)("div",{ref:r,className:(0,w.cn)("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));b.displayName="Card",f.forwardRef(({className:e,...t},r)=>(0,s.jsx)("div",{ref:r,className:(0,w.cn)("flex flex-col space-y-1.5 p-6",e),...t})).displayName="CardHeader",f.forwardRef(({className:e,...t},r)=>(0,s.jsx)("div",{ref:r,className:(0,w.cn)("text-2xl font-semibold leading-none tracking-tight",e),...t})).displayName="CardTitle",f.forwardRef(({className:e,...t},r)=>(0,s.jsx)("div",{ref:r,className:(0,w.cn)("text-sm text-muted-foreground",e),...t})).displayName="CardDescription";let k=f.forwardRef(({className:e,...t},r)=>(0,s.jsx)("div",{ref:r,className:(0,w.cn)("p-6 pt-0",e),...t}));k.displayName="CardContent",f.forwardRef(({className:e,...t},r)=>(0,s.jsx)("div",{ref:r,className:(0,w.cn)("flex items-center p-6 pt-0",e),...t})).displayName="CardFooter";var N=e.i(414576);let v=f.forwardRef(({className:e,href:t,children:r,...a},o)=>{let l=t.startsWith("http")?t:`https://useworkflow.dev/docs/${t.replace(/^\//,"")}`;return(0,s.jsx)(N.default,{href:l,className:(0,w.cn)("font-medium underline underline-offset-4 transition-colors",e),style:{color:"var(--ds-blue-600)"},target:"_blank",rel:"noopener noreferrer",ref:o,...a,children:r})});v.displayName="DocsLink";var y=e.i(917955);let C=f.forwardRef(({className:e,...t},r)=>(0,s.jsx)("div",{className:"relative w-full overflow-auto",children:(0,s.jsx)("table",{ref:r,className:(0,w.cn)("w-full caption-bottom text-sm",e),...t})}));C.displayName="Table";let S=f.forwardRef(({className:e,...t},r)=>(0,s.jsx)("thead",{ref:r,className:(0,w.cn)("[&_tr]:border-b",e),...t}));S.displayName="TableHeader";let R=f.forwardRef(({className:e,...t},r)=>(0,s.jsx)("tbody",{ref:r,className:(0,w.cn)("[&_tr:last-child]:border-0",e),...t}));R.displayName="TableBody",f.forwardRef(({className:e,...t},r)=>(0,s.jsx)("tfoot",{ref:r,className:(0,w.cn)("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t})).displayName="TableFooter";let T=f.forwardRef(({className:e,...t},r)=>(0,s.jsx)("tr",{ref:r,className:(0,w.cn)("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));T.displayName="TableRow";let I=f.forwardRef(({className:e,...t},r)=>(0,s.jsx)("th",{ref:r,className:(0,w.cn)("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));I.displayName="TableHead";let D=f.forwardRef(({className:e,...t},r)=>(0,s.jsx)("td",{ref:r,className:(0,w.cn)("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));D.displayName="TableCell",f.forwardRef(({className:e,...t},r)=>(0,s.jsx)("caption",{ref:r,className:(0,w.cn)("mt-4 text-sm text-muted-foreground",e),...t})).displayName="TableCaption";var M=e.i(638322),A=e.i(620486),P=e.i(241245),E=e.i(719402),_=e.i(613087);function F({rows:e=w.DEFAULT_PAGE_SIZE,variant:t="runs"}){return(0,s.jsx)(b,{className:"overflow-hidden mt-4 bg-background",children:(0,s.jsxs)(k,{className:"p-0",children:[(()=>{switch(t){case"runs":return(0,s.jsxs)("div",{className:"grid grid-cols-[1fr_1.5fr_0.8fr_1fr_1fr_40px] items-center gap-4 py-3 px-4 border-b",children:[(0,s.jsx)(_.Skeleton,{className:"h-4 w-20"}),(0,s.jsx)(_.Skeleton,{className:"h-4 w-14"}),(0,s.jsx)(_.Skeleton,{className:"h-4 w-12"}),(0,s.jsx)(_.Skeleton,{className:"h-4 w-14"}),(0,s.jsx)(_.Skeleton,{className:"h-4 w-20"}),(0,s.jsx)("div",{className:"w-6"})]});case"hooks":return(0,s.jsxs)("div",{className:"grid grid-cols-[1.2fr_1.2fr_0.8fr_1fr_0.5fr_40px] items-center gap-4 py-3 px-4 border-b",children:[(0,s.jsx)(_.Skeleton,{className:"h-4 w-16"}),(0,s.jsx)(_.Skeleton,{className:"h-4 w-14"}),(0,s.jsx)(_.Skeleton,{className:"h-4 w-12"}),(0,s.jsx)(_.Skeleton,{className:"h-4 w-14"}),(0,s.jsx)(_.Skeleton,{className:"h-4 w-20"}),(0,s.jsx)("div",{className:"w-6"})]});case"workflows":return(0,s.jsxs)("div",{className:"grid grid-cols-[1fr_1.5fr_0.5fr] items-center gap-4 py-3 px-4 border-b",children:[(0,s.jsx)(_.Skeleton,{className:"h-4 w-20"}),(0,s.jsx)(_.Skeleton,{className:"h-4 w-10"}),(0,s.jsx)(_.Skeleton,{className:"h-4 w-12 mx-auto"})]});default:return null}})(),Array.from({length:e},(e,r)=>(e=>{switch(t){case"runs":return(0,s.jsxs)("div",{className:"grid grid-cols-[1fr_1.5fr_0.8fr_1fr_1fr_40px] items-center gap-4 py-3 px-4",children:[(0,s.jsx)(_.Skeleton,{className:"h-4 w-3/4"}),(0,s.jsx)(_.Skeleton,{className:"h-4 w-4/5"}),(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)(_.Skeleton,{className:"h-3 w-14"}),(0,s.jsx)(_.Skeleton,{className:"h-2 w-8"})]}),(0,s.jsx)(_.Skeleton,{className:"h-3 w-3/4"}),(0,s.jsx)(_.Skeleton,{className:"h-3 w-3/4"}),(0,s.jsx)(_.Skeleton,{className:"h-6 w-6 rounded"})]},`skeleton-row-${e}`);case"hooks":return(0,s.jsxs)("div",{className:"grid grid-cols-[1.2fr_1.2fr_0.8fr_1fr_0.5fr_40px] items-center gap-4 py-3 px-4",children:[(0,s.jsx)(_.Skeleton,{className:"h-4 w-4/5"}),(0,s.jsx)(_.Skeleton,{className:"h-4 w-4/5"}),(0,s.jsx)(_.Skeleton,{className:"h-4 w-3/4"}),(0,s.jsx)(_.Skeleton,{className:"h-3 w-3/4"}),(0,s.jsx)(_.Skeleton,{className:"h-4 w-8"}),(0,s.jsx)(_.Skeleton,{className:"h-6 w-6 rounded"})]},`skeleton-row-${e}`);case"workflows":return(0,s.jsxs)("div",{className:"grid grid-cols-[1fr_1.5fr_0.5fr] items-center gap-4 py-3 px-4",children:[(0,s.jsx)(_.Skeleton,{className:"h-4 w-3/4"}),(0,s.jsx)(_.Skeleton,{className:"h-4 w-4/5"}),(0,s.jsx)(_.Skeleton,{className:"h-5 w-16 rounded-full mx-auto"})]},`skeleton-row-${e}`);default:return null}})(r))]})})}function z({config:e,runId:t,onHookClick:r,selectedHookId:i}){let[w,N]=(0,f.useState)(()=>new Date),_=(0,f.useMemo)(()=>(0,A.worldConfigToEnvMap)(e),[e]),{data:z,error:O,nextPage:W,previousPage:B,hasNextPage:H,hasPreviousPage:$,reload:L,pageInfo:U}=(0,a.useWorkflowHooks)(_,{runId:t,sortOrder:"desc"}),V=(0,o.useHookActions)({env:_,callbacks:{onSuccess:L}}),G=z.isLoading,K=z.data??[],[Z,q]=(0,f.useState)(new Map);return(0,f.useEffect)(()=>{K.length&&(async()=>{let e=new Map;for(let s of K)e.set(s.hookId,{count:0,hasMore:!1,loading:!0});q(e);let s=await Promise.allSettled(K.map(async e=>{try{let s=await (0,l.fetchEventsByCorrelationId)(_,e.hookId,{sortOrder:"asc",limit:100});if(!s.success)return{hookId:e.hookId,count:Error(s.error?.message||"Failed to fetch events"),hasMore:!1};let t=s.data,r=t.data.filter(e=>"hook_received"===e.eventType).length;return{hookId:e.hookId,count:r,hasMore:t.hasMore}}catch(s){return{hookId:e.hookId,count:s,hasMore:!1}}}));q(e=>{let t=new Map(e);for(let e=0;e<s.length;e++){let r=s[e],a=K[e].hookId;"fulfilled"===r.status?t.set(r.value.hookId,{count:r.value.count,hasMore:r.value.hasMore,loading:!1}):t.set(a,{count:0,hasMore:!1,loading:!1})}return t})})()},[K,_]),(0,s.jsxs)("div",{children:[(0,s.jsx)(o.HookResolveModalWrapper,{hookActions:V}),(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex items-end gap-2",children:[(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"Last refreshed"}),w&&(0,s.jsx)(E.RelativeTime,{date:w,className:"text-sm text-muted-foreground",type:"distance"})]}),(0,s.jsx)("div",{className:"flex items-center gap-4",children:(0,s.jsxs)(M.Tooltip,{children:[(0,s.jsx)(M.TooltipTrigger,{asChild:!0,children:(0,s.jsxs)(j.Button,{variant:"outline",size:"sm",onClick:()=>{N(()=>new Date),L()},disabled:G,children:[(0,s.jsx)(h,{className:G?"animate-spin":""}),"Refresh"]})}),(0,s.jsx)(M.TooltipContent,{children:"Note that this resets pages"})]})})]}),O?(0,s.jsxs)(g.Alert,{variant:"destructive",children:[(0,s.jsx)(n.AlertCircle,{className:"h-4 w-4"}),(0,s.jsx)(g.AlertTitle,{children:"Error loading hooks"}),(0,s.jsx)(g.AlertDescription,{children:(0,a.getErrorMessage)(O)})]}):G||K&&0!==K.length?G&&!z?.data?(0,s.jsx)(F,{variant:"hooks"}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(b,{className:"overflow-hidden mt-4 bg-background",children:(0,s.jsx)(k,{className:"p-0 max-h-[calc(100vh-280px)] overflow-auto",children:(0,s.jsxs)(C,{children:[(0,s.jsx)(S,{children:(0,s.jsxs)(T,{children:[(0,s.jsx)(I,{className:"sticky top-0 bg-background z-10 border-b shadow-sm h-10",children:"Hook ID"}),(0,s.jsx)(I,{className:"sticky top-0 bg-background z-10 border-b shadow-sm h-10",children:"Run ID"}),(0,s.jsx)(I,{className:"sticky top-0 bg-background z-10 border-b shadow-sm h-10",children:"Token"}),(0,s.jsx)(I,{className:"sticky top-0 bg-background z-10 border-b shadow-sm h-10",children:"Created"}),(0,s.jsx)(I,{className:"sticky top-0 bg-background z-10 border-b shadow-sm h-10",children:"Invocations"}),(0,s.jsx)(I,{className:"sticky top-0 bg-background z-10 border-b shadow-sm h-10 w-10"})]})}),(0,s.jsx)(R,{children:K.map(e=>(0,s.jsxs)(T,{className:"cursor-pointer group relative",onClick:()=>r(e.hookId,e.runId),"data-selected":e.hookId===i,children:[(0,s.jsx)(D,{className:"font-mono text-xs py-2",children:(0,s.jsx)(P.CopyableText,{text:e.hookId,overlay:!0,children:e.hookId})}),(0,s.jsx)(D,{className:"font-mono text-xs py-2",children:(0,s.jsx)(P.CopyableText,{text:e.runId,overlay:!0,children:e.runId})}),(0,s.jsx)(D,{className:"font-mono text-xs py-2",children:(0,s.jsx)(P.CopyableText,{text:e.token,overlay:!0,children:(0,s.jsx)("span",{className:"text-muted-foreground",children:"••••••••••••"})})}),(0,s.jsx)(D,{className:"py-2 text-muted-foreground text-xs",children:e.createdAt?(0,s.jsx)(E.RelativeTime,{date:e.createdAt}):"-"}),(0,s.jsx)(D,{className:"py-2",children:(e=>{let t=Z.get(e.hookId);if(!t||t.loading)return(0,s.jsx)("span",{className:"text-muted-foreground text-xs",children:"..."});if(t.count instanceof Error)return(0,s.jsx)("span",{className:"text-muted-foreground",children:"Error"});if(0===t.count)return(0,s.jsx)("span",{className:"text-muted-foreground",children:"0"});let r=t.hasMore?`${t.count}+`:`${t.count}`;return t.hasMore?(0,s.jsxs)(M.Tooltip,{children:[(0,s.jsx)(M.TooltipTrigger,{asChild:!0,children:(0,s.jsx)("span",{className:"font-semibold cursor-help",children:r})}),(0,s.jsx)(M.TooltipContent,{className:"max-w-xs",children:(0,s.jsx)("div",{className:"text-xs",children:"Showing first 100 invocations. There may be more."})})]}):(0,s.jsx)("span",{className:"font-semibold",children:r})})(e)}),(0,s.jsx)(D,{className:"py-2",children:(0,s.jsxs)(y.DropdownMenu,{children:[(0,s.jsx)(y.DropdownMenuTrigger,{asChild:!0,children:(0,s.jsx)(j.Button,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:e=>e.stopPropagation(),children:(0,s.jsx)(u.MoreHorizontal,{className:"h-4 w-4"})})}),(0,s.jsxs)(y.DropdownMenuContent,{align:"end",children:[(0,s.jsx)(o.ResolveHookDropdownItem,{hook:e,stopPropagation:!0,onResolveClick:V.openResolveModal,DropdownMenuItem:y.DropdownMenuItem}),(0,s.jsxs)(y.DropdownMenuItem,{onClick:async s=>{s.stopPropagation();try{let s=await (0,a.recreateRun)(_,e.runId);p.toast.success("New run started",{description:`Run ID: ${s}`}),L()}catch(e){p.toast.error("Failed to re-run",{description:e instanceof Error?e.message:"Unknown error"})}},children:[(0,s.jsx)(m.RotateCw,{className:"h-4 w-4 mr-2"}),"Replay Run"]}),(0,s.jsxs)(y.DropdownMenuItem,{onClick:async s=>{s.stopPropagation();try{await (0,a.cancelRun)(_,e.runId),p.toast.success("Run cancelled"),L()}catch(e){p.toast.error("Failed to cancel",{description:e instanceof Error?e.message:"Unknown error"})}},children:[(0,s.jsx)(x.XCircle,{className:"h-4 w-4 mr-2"}),"Cancel"]})]})]})})]},e.hookId))})]})})}),(0,s.jsxs)("div",{className:"flex items-center justify-between mt-4",children:[(0,s.jsx)("div",{className:"text-sm text-muted-foreground",children:U}),(0,s.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,s.jsxs)(j.Button,{variant:"outline",size:"sm",onClick:B,disabled:!$,children:[(0,s.jsx)(d,{}),"Previous"]}),(0,s.jsxs)(j.Button,{variant:"outline",size:"sm",onClick:W,disabled:!H,children:["Next",(0,s.jsx)(c.ChevronRight,{})]})]})]})]}):(0,s.jsxs)("div",{className:"text-center py-8 text-muted-foreground",children:["No active hooks found. ",(0,s.jsx)("br",{}),(0,s.jsx)(v,{href:"https://useworkflow.dev/docs/api-reference/workflow/create-hook",children:"Learn how to create a hook"})]})]})}var O=e.i(360088),W=e.i(413862),B=e.i(384405);let H=(0,i.default)("ArrowDownAZ",[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 20V4",key:"1yoxec"}],["path",{d:"M20 8h-5",key:"1vsyxs"}],["path",{d:"M15 10V6.5a2.5 2.5 0 0 1 5 0V10",key:"ag13bf"}],["path",{d:"M15 14h5l-5 6h5",key:"ur5jdg"}]]),$=(0,i.default)("ArrowUpAZ",[["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}],["path",{d:"M20 8h-5",key:"1vsyxs"}],["path",{d:"M15 10V6.5a2.5 2.5 0 0 1 5 0V10",key:"ag13bf"}],["path",{d:"M15 14h5l-5 6h5",key:"ur5jdg"}]]);var L=e.i(346131),U=e.i(451675),V=e.i(708341);function G({env:e,runId:t,runStatus:r,onSuccess:a,showDebugActions:o}){let[l,n]=(0,f.useState)(void 0),[i,d]=(0,f.useState)(!0),[c,u]=(0,f.useState)(void 0),h=c?.status||r;return(0,f.useEffect)(()=>{d(!0),Promise.all([(0,B.fetchRun)(e,t,"none"),(0,W.fetchEvents)(e,t,{limit:1e3,sortOrder:"desc"})]).then(([e,s])=>{e.success&&u(e.data),s.success&&n(s.data.data)}).catch(e=>{console.error("Failed to fetch run or events:",e)}).finally(()=>{d(!1)})},[e,t]),(0,s.jsx)(V.RunActionsDropdownItems,{env:e,runId:t,runStatus:h,events:l,eventsLoading:i,stopPropagation:!0,callbacks:{onSuccess:a},showDebugActions:o})}function K({env:e,runId:t,runStatus:r,onSuccess:a,showDebugActions:o}){let[l,n]=(0,f.useState)(!1);return(0,s.jsxs)(y.DropdownMenu,{open:l,onOpenChange:n,children:[(0,s.jsx)(y.DropdownMenuTrigger,{asChild:!0,children:(0,s.jsx)(j.Button,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:e=>e.stopPropagation(),children:(0,s.jsx)(u.MoreHorizontal,{className:"h-4 w-4"})})}),l&&(0,s.jsx)(y.DropdownMenuContent,{align:"end",children:(0,s.jsx)(G,{env:e,runId:t,runStatus:r,onSuccess:a,showDebugActions:o})})]})}let Z={pending:{label:"Pending",color:"bg-neutral-600 dark:bg-neutral-400"},running:{label:"Running",color:"bg-blue-600 dark:bg-blue-400"},completed:{label:"Completed",color:"bg-green-600 dark:bg-green-400"},failed:{label:"Failed",color:"bg-red-600 dark:bg-red-400"},paused:{label:"Paused",color:"bg-yellow-600 dark:bg-yellow-400"},cancelled:{label:"Cancelled",color:"bg-gray-600 dark:bg-gray-400"}};function q({workflowNameFilter:e,status:t,seenWorkflowNames:r,sortOrder:a,loading:o,statusFilterRequiresWorkflowNameFilter:l,onWorkflowChange:n,onStatusChange:i,onSortToggle:d,onRefresh:c,lastRefreshTime:u}){return(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex items-end gap-2",children:[(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"Last refreshed"}),u&&(0,s.jsx)(E.RelativeTime,{date:u,className:"text-sm text-muted-foreground",type:"distance"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-4",children:[(0,s.jsxs)(L.Select,{value:e??"all",onValueChange:n,disabled:o,children:[(0,s.jsx)(L.SelectTrigger,{className:"w-[180px] h-9",children:(0,s.jsx)(L.SelectValue,{placeholder:"Filter by workflow"})}),(0,s.jsxs)(L.SelectContent,{children:[(0,s.jsx)(L.SelectItem,{value:"all",children:"All Workflows"}),Array.from(r).sort().map(e=>(0,s.jsx)(L.SelectItem,{value:e,children:(0,O.parseWorkflowName)(e)?.shortName||e},e))]})]}),(0,s.jsxs)(M.Tooltip,{children:[(0,s.jsx)(M.TooltipTrigger,{asChild:!0,children:(0,s.jsx)("div",{children:(0,s.jsxs)(L.Select,{value:t||"all",onValueChange:i,disabled:o||l&&!e,children:[(0,s.jsx)(L.SelectTrigger,{className:"w-[140px] h-9",children:(0,s.jsx)(L.SelectValue,{placeholder:"Filter by status"})}),(0,s.jsxs)(L.SelectContent,{children:[(0,s.jsx)(L.SelectItem,{value:"all",children:"Any status"}),Object.entries(Z).map(([e,{label:t,color:r}])=>(0,s.jsx)(L.SelectItem,{value:e,children:(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)("span",{className:`${r} size-1.5 rounded-full mr-2`}),t]})},e))]})]})})}),(0,s.jsx)(M.TooltipContent,{children:l&&"all"===e?"Select a workflow first to filter by status":"Filter runs by status"})]}),(0,s.jsxs)(M.Tooltip,{children:[(0,s.jsx)(M.TooltipTrigger,{asChild:!0,children:(0,s.jsxs)(j.Button,{variant:"outline",size:"sm",onClick:d,disabled:o,children:["desc"===a?(0,s.jsx)(H,{className:"h-4 w-4"}):(0,s.jsx)($,{className:"h-4 w-4"}),"desc"===a?"Newest":"Oldest"]})}),(0,s.jsx)(M.TooltipContent,{children:"desc"===a?"Showing newest first":"Showing oldest first"})]}),(0,s.jsxs)(M.Tooltip,{children:[(0,s.jsx)(M.TooltipTrigger,{asChild:!0,children:(0,s.jsxs)(j.Button,{variant:"outline",size:"sm",onClick:c,disabled:o,children:[(0,s.jsx)(h,{className:o?"animate-spin":""}),"Refresh"]})}),(0,s.jsx)(M.TooltipContent,{children:"Note that this resets pages"})]})]})]})}function Q({config:e,onRunClick:t}){let o,l,i,u,h,m,x=(0,r.useSearchParams)(),p=(o=(0,r.useRouter)(),l=(0,r.usePathname)(),i=(0,r.useSearchParams)(),(0,f.useCallback)(e=>{let s=new URLSearchParams(i.toString());"all"===e?(s.delete("workflow"),s.delete("status")):s.set("workflow",e),o.push(`${l}?${s.toString()}`)},[o,l,i])),w=(u=(0,r.useRouter)(),h=(0,r.usePathname)(),m=(0,r.useSearchParams)(),(0,f.useCallback)(e=>{let s=new URLSearchParams(m.toString());"all"===e?s.delete("status"):s.set("status",e),u.push(`${h}?${s.toString()}`)},[u,h,m])),N=x.get("status"),y=Object.keys(Z),M="all"===N||N&&y.includes(N)?N:void 0,_=x.get("workflow"),z="1"===x.get("debug"),[W,B]=(0,f.useState)("desc"),[H,$]=(0,f.useState)(()=>new Date),L=(0,f.useMemo)(()=>(0,A.worldConfigToEnvMap)(e),[e]),V=e.backend?.includes("vercel")||!1,[G,Q]=(0,f.useState)(new Set),{data:X,error:J,nextPage:Y,previousPage:ee,hasNextPage:es,hasPreviousPage:et,reload:er,pageInfo:ea}=(0,a.useWorkflowRuns)(L,{sortOrder:W,workflowName:"all"===_?void 0:_,status:"all"===M?void 0:M});(0,f.useEffect)(()=>{if(X.data&&X.data.length>0){let e=new Set(X.data.map(e=>e.workflowName));Q(s=>{let t=new Set(s);for(let s of e)t.add(s);return t})}},[X.data]);let eo=X.isLoading;return(0,s.jsxs)("div",{children:[(0,s.jsx)(q,{workflowNameFilter:_,status:M,seenWorkflowNames:G,sortOrder:W,loading:eo,statusFilterRequiresWorkflowNameFilter:V,onWorkflowChange:p,onStatusChange:w,onSortToggle:()=>{B(e=>"desc"===e?"asc":"desc")},onRefresh:()=>{$(()=>new Date),er()},lastRefreshTime:H}),J?(0,s.jsxs)(g.Alert,{variant:"destructive",children:[(0,s.jsx)(n.AlertCircle,{className:"h-4 w-4"}),(0,s.jsx)(g.AlertTitle,{children:"Error loading runs"}),(0,s.jsx)(g.AlertDescription,{children:(0,a.getErrorMessage)(J)})]}):eo&&!X?.data?(0,s.jsx)(F,{}):eo||X.data&&0!==X.data.length?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(b,{className:"overflow-hidden mt-4 bg-background",children:(0,s.jsx)(k,{className:"p-0 max-h-[calc(100vh-280px)] overflow-auto",children:(0,s.jsxs)(C,{children:[(0,s.jsx)(S,{children:(0,s.jsxs)(T,{children:[(0,s.jsx)(I,{className:"sticky top-0 bg-background z-10 border-b shadow-sm h-10",children:"Workflow"}),(0,s.jsx)(I,{className:"sticky top-0 bg-background z-10 border-b shadow-sm h-10",children:"Run ID"}),(0,s.jsx)(I,{className:"sticky top-0 bg-background z-10 border-b shadow-sm h-10",children:"Status"}),(0,s.jsx)(I,{className:"sticky top-0 bg-background z-10 border-b shadow-sm h-10",children:"Started"}),(0,s.jsx)(I,{className:"sticky top-0 bg-background z-10 border-b shadow-sm h-10",children:"Completed"}),(0,s.jsx)(I,{className:"sticky top-0 bg-background z-10 border-b shadow-sm h-10 w-10"})]})}),(0,s.jsx)(R,{children:X.data?.map(e=>(0,s.jsxs)(T,{className:"cursor-pointer group relative",onClick:()=>t(e.runId),children:[(0,s.jsx)(D,{className:"py-2",children:(0,s.jsx)(P.CopyableText,{text:e.workflowName,overlay:!0,children:(0,O.parseWorkflowName)(e.workflowName)?.shortName||"?"})}),(0,s.jsx)(D,{className:"font-mono text-xs py-2",children:(0,s.jsx)(P.CopyableText,{text:e.runId,overlay:!0,children:e.runId})}),(0,s.jsx)(D,{className:"py-2",children:(0,s.jsx)(U.StatusBadge,{status:e.status,context:e,durationMs:e.startedAt?(e.completedAt?new Date(e.completedAt).getTime():Date.now())-new Date(e.startedAt).getTime():void 0})}),(0,s.jsx)(D,{className:"py-2 text-muted-foreground text-xs",children:e.startedAt?(0,s.jsx)(E.RelativeTime,{date:e.startedAt}):"-"}),(0,s.jsx)(D,{className:"py-2 text-muted-foreground text-xs",children:e.completedAt?(0,s.jsx)(E.RelativeTime,{date:e.completedAt}):"-"}),(0,s.jsx)(D,{className:"py-2",children:(0,s.jsx)(K,{env:L,runId:e.runId,runStatus:e.status,onSuccess:er,showDebugActions:z})})]},e.runId))})]})})}),(0,s.jsxs)("div",{className:"flex items-center justify-between mt-4",children:[(0,s.jsx)("div",{className:"text-sm text-muted-foreground",children:ea}),(0,s.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,s.jsxs)(j.Button,{variant:"outline",size:"sm",onClick:ee,disabled:!et,children:[(0,s.jsx)(d,{}),"Previous"]}),(0,s.jsxs)(j.Button,{variant:"outline",size:"sm",onClick:Y,disabled:!es,children:["Next",(0,s.jsx)(c.ChevronRight,{})]})]})]})]}):(0,s.jsxs)("div",{className:"text-center py-8 text-muted-foreground",children:["No workflow runs found. ",(0,s.jsx)("br",{}),(0,s.jsx)(v,{href:"https://useworkflow.dev/docs/foundations/workflows-and-steps",children:"Learn how to create a workflow"})]})]})}var X=e.i(889840),J=e.i(400138);let Y=(0,i.default)("Workflow",[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]]);var ee=e.i(93698),es=e.i(562918),et=e.i(291967),er=e.i(221588),ea=e.i(810096),eo=e.i(244107),el=e.i(802313),en=e.i(975287),ei=e.i(376268),ed=e.i(153840),ec=e.i(110515),eu=e.i(692792),eh=e.i(345594),em=e.i(891246),ex=e.i(73772),ef=e.i(545136),ep="Dialog",[eg,ej]=(0,ea.createContextScope)(ep),[ew,eb]=eg(ep),ek=e=>{let{__scopeDialog:t,children:r,open:a,defaultOpen:o,onOpenChange:l,modal:n=!0}=e,i=f.useRef(null),d=f.useRef(null),[c,u]=(0,el.useControllableState)({prop:a,defaultProp:o??!1,onChange:l,caller:ep});return(0,s.jsx)(ew,{scope:t,triggerRef:i,contentRef:d,contentId:(0,eo.useId)(),titleId:(0,eo.useId)(),descriptionId:(0,eo.useId)(),open:c,onOpenChange:u,onOpenToggle:f.useCallback(()=>u(e=>!e),[u]),modal:n,children:r})};ek.displayName=ep;var eN="DialogTrigger";f.forwardRef((e,t)=>{let{__scopeDialog:r,...a}=e,o=eb(eN,r),l=(0,er.useComposedRefs)(t,o.triggerRef);return(0,s.jsx)(eu.Primitive.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":e$(o.open),...a,ref:l,onClick:(0,et.composeEventHandlers)(e.onClick,o.onOpenToggle)})}).displayName=eN;var ev="DialogPortal",[ey,eC]=eg(ev,{forceMount:void 0}),eS=e=>{let{__scopeDialog:t,forceMount:r,children:a,container:o}=e,l=eb(ev,t);return(0,s.jsx)(ey,{scope:t,forceMount:r,children:f.Children.map(a,e=>(0,s.jsx)(ec.Presence,{present:r||l.open,children:(0,s.jsx)(ed.Portal,{asChild:!0,container:o,children:e})}))})};eS.displayName=ev;var eR="DialogOverlay",eT=f.forwardRef((e,t)=>{let r=eC(eR,e.__scopeDialog),{forceMount:a=r.forceMount,...o}=e,l=eb(eR,e.__scopeDialog);return l.modal?(0,s.jsx)(ec.Presence,{present:a||l.open,children:(0,s.jsx)(eD,{...o,ref:t})}):null});eT.displayName=eR;var eI=(0,ef.createSlot)("DialogOverlay.RemoveScroll"),eD=f.forwardRef((e,t)=>{let{__scopeDialog:r,...a}=e,o=eb(eR,r);return(0,s.jsx)(em.RemoveScroll,{as:eI,allowPinchZoom:!0,shards:[o.contentRef],children:(0,s.jsx)(eu.Primitive.div,{"data-state":e$(o.open),...a,ref:t,style:{pointerEvents:"auto",...a.style}})})}),eM="DialogContent",eA=f.forwardRef((e,t)=>{let r=eC(eM,e.__scopeDialog),{forceMount:a=r.forceMount,...o}=e,l=eb(eM,e.__scopeDialog);return(0,s.jsx)(ec.Presence,{present:a||l.open,children:l.modal?(0,s.jsx)(eP,{...o,ref:t}):(0,s.jsx)(eE,{...o,ref:t})})});eA.displayName=eM;var eP=f.forwardRef((e,t)=>{let r=eb(eM,e.__scopeDialog),a=f.useRef(null),o=(0,er.useComposedRefs)(t,r.contentRef,a);return f.useEffect(()=>{let e=a.current;if(e)return(0,ex.hideOthers)(e)},[]),(0,s.jsx)(e_,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,et.composeEventHandlers)(e.onCloseAutoFocus,e=>{e.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:(0,et.composeEventHandlers)(e.onPointerDownOutside,e=>{let s=e.detail.originalEvent,t=0===s.button&&!0===s.ctrlKey;(2===s.button||t)&&e.preventDefault()}),onFocusOutside:(0,et.composeEventHandlers)(e.onFocusOutside,e=>e.preventDefault())})}),eE=f.forwardRef((e,t)=>{let r=eb(eM,e.__scopeDialog),a=f.useRef(!1),o=f.useRef(!1);return(0,s.jsx)(e_,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(a.current||r.triggerRef.current?.focus(),s.preventDefault()),a.current=!1,o.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(a.current=!0,"pointerdown"===s.detail.originalEvent.type&&(o.current=!0));let t=s.target;r.triggerRef.current?.contains(t)&&s.preventDefault(),"focusin"===s.detail.originalEvent.type&&o.current&&s.preventDefault()}})}),e_=f.forwardRef((e,t)=>{let{__scopeDialog:r,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:l,...n}=e,i=eb(eM,r),d=f.useRef(null),c=(0,er.useComposedRefs)(t,d);return(0,eh.useFocusGuards)(),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(ei.FocusScope,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:o,onUnmountAutoFocus:l,children:(0,s.jsx)(en.DismissableLayer,{role:"dialog",id:i.contentId,"aria-describedby":i.descriptionId,"aria-labelledby":i.titleId,"data-state":e$(i.open),...n,ref:c,onDismiss:()=>i.onOpenChange(!1)})}),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(eG,{titleId:i.titleId}),(0,s.jsx)(eK,{contentRef:d,descriptionId:i.descriptionId})]})]})}),eF="DialogTitle",ez=f.forwardRef((e,t)=>{let{__scopeDialog:r,...a}=e,o=eb(eF,r);return(0,s.jsx)(eu.Primitive.h2,{id:o.titleId,...a,ref:t})});ez.displayName=eF;var eO="DialogDescription",eW=f.forwardRef((e,t)=>{let{__scopeDialog:r,...a}=e,o=eb(eO,r);return(0,s.jsx)(eu.Primitive.p,{id:o.descriptionId,...a,ref:t})});eW.displayName=eO;var eB="DialogClose",eH=f.forwardRef((e,t)=>{let{__scopeDialog:r,...a}=e,o=eb(eB,r);return(0,s.jsx)(eu.Primitive.button,{type:"button",...a,ref:t,onClick:(0,et.composeEventHandlers)(e.onClick,()=>o.onOpenChange(!1))})});function e$(e){return e?"open":"closed"}eH.displayName=eB;var eL="DialogTitleWarning",[eU,eV]=(0,ea.createContext)(eL,{contentName:eM,titleName:eF,docsSlug:"dialog"}),eG=({titleId:e})=>{let s=eV(eL),t=`\`${s.contentName}\` requires a \`${s.titleName}\` for the component to be accessible for screen reader users.
|
|
2
|
-
|
|
3
|
-
If you want to hide the \`${s.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
4
|
-
|
|
5
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${s.docsSlug}`;return f.useEffect(()=>{e&&(document.getElementById(e)||console.error(t))},[t,e]),null},eK=({contentRef:e,descriptionId:s})=>{let t=eV("DialogDescriptionWarning"),r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${t.contentName}}.`;return f.useEffect(()=>{let t=e.current?.getAttribute("aria-describedby");s&&t&&(document.getElementById(s)||console.warn(r))},[r,e,s]),null},eZ=e.i(897884),eZ=eZ;function eq({...e}){return(0,s.jsx)(ek,{"data-slot":"sheet",...e})}function eQ({...e}){return(0,s.jsx)(eS,{"data-slot":"sheet-portal",...e})}function eX({className:e,...t}){return(0,s.jsx)(eT,{"data-slot":"sheet-overlay",className:(0,w.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function eJ({className:e,children:t,side:r="right",...a}){return(0,s.jsxs)(eQ,{children:[(0,s.jsx)(eX,{}),(0,s.jsxs)(eA,{"data-slot":"sheet-content",className:(0,w.cn)("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500","right"===r&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm","left"===r&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm","top"===r&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b","bottom"===r&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",e),...a,children:[t,(0,s.jsxs)(eH,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[(0,s.jsx)(eZ.default,{className:"size-4"}),(0,s.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}function eY({className:e,...t}){return(0,s.jsx)("div",{"data-slot":"sheet-header",className:(0,w.cn)("flex flex-col gap-1.5 p-4",e),...t})}function e0({className:e,...t}){return(0,s.jsx)(ez,{"data-slot":"sheet-title",className:(0,w.cn)("text-foreground font-semibold",e),...t})}function e1({className:e,...t}){return(0,s.jsx)(eW,{"data-slot":"sheet-description",className:(0,w.cn)("text-muted-foreground text-sm",e),...t})}var e4=e.i(479823);function e2({config:e,onWorkflowSelect:t}){let[r,a]=(0,f.useState)(!1),[o,l]=(0,f.useState)(null),{manifest:i,loading:d,error:c}=(0,e4.useWorkflowGraphManifest)(e),u=i?Object.values(i.workflows):[],h=(0,f.useMemo)(()=>[...u].sort((e,s)=>e.workflowName.localeCompare(s.workflowName)),[u]);return d?(0,s.jsx)(F,{variant:"workflows",rows:6}):c?(0,s.jsxs)(g.Alert,{variant:"destructive",children:[(0,s.jsx)(n.AlertCircle,{className:"h-4 w-4"}),(0,s.jsx)(g.AlertTitle,{children:"Error Loading Workflows"}),(0,s.jsx)(g.AlertDescription,{children:c.message})]}):0===u.length?(0,s.jsx)(b,{children:(0,s.jsxs)(k,{className:"p-12 text-center",children:[(0,s.jsx)(Y,{className:"mx-auto h-12 w-12 text-muted-foreground mb-4"}),(0,s.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No Workflows Found"}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"No workflow definitions were found in the graph manifest."})]})}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(b,{className:"overflow-hidden bg-background",children:(0,s.jsx)(k,{className:"p-0 max-h-[calc(100vh-200px)] overflow-auto",children:(0,s.jsxs)(C,{children:[(0,s.jsx)(S,{children:(0,s.jsxs)(T,{children:[(0,s.jsx)(I,{className:"sticky top-0 bg-background z-10 border-b shadow-sm h-10",children:"Workflow"}),(0,s.jsx)(I,{className:"sticky top-0 bg-background z-10 border-b shadow-sm h-10",children:"File"}),(0,s.jsx)(I,{className:"text-center sticky top-0 bg-background z-10 border-b shadow-sm h-10",children:"Steps"})]})}),(0,s.jsx)(R,{children:h.map(e=>{let r=e.nodes.filter(e=>"step"===e.data.nodeKind).length;return(0,s.jsxs)(T,{className:"cursor-pointer",onClick:()=>{l(e),a(!0),t?.(e.workflowName)},children:[(0,s.jsx)(D,{className:"py-2",children:(0,s.jsx)("span",{className:"font-medium",children:e.workflowName})}),(0,s.jsx)(D,{className:"py-2",children:(0,s.jsx)("code",{className:"text-xs text-muted-foreground",children:e.filePath})}),(0,s.jsx)(D,{className:"text-center py-2",children:(0,s.jsxs)(es.Badge,{variant:"secondary",className:"gap-1",children:[(0,s.jsx)(J.GitBranch,{className:"h-3 w-3"}),r," ",1===r?"step":"steps"]})})]},e.workflowId)})})]})})}),(0,s.jsx)(eq,{open:r,onOpenChange:a,children:(0,s.jsxs)(eJ,{side:"right",className:"w-[75vw] max-w-[75vw] sm:max-w-[75vw]",children:[(0,s.jsxs)(eY,{children:[(0,s.jsxs)(e0,{className:"flex items-center gap-2",children:[(0,s.jsx)(Y,{className:"h-5 w-5"}),o?.workflowName]}),o&&(0,s.jsx)(e1,{asChild:!0,children:(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("code",{className:"text-xs",children:o.filePath}),(0,s.jsx)("div",{children:(0,s.jsxs)(es.Badge,{variant:"outline",className:"gap-1",children:[(0,s.jsx)(J.GitBranch,{className:"h-3 w-3"}),o.nodes.filter(e=>"step"===e.data.nodeKind).length," ",1===o.nodes.filter(e=>"step"===e.data.nodeKind).length?"step":"steps"]})})]})})]}),(0,s.jsx)("div",{className:"mt-6 h-[calc(100vh-180px)]",children:o&&(0,s.jsx)(ee.WorkflowGraphViewer,{workflow:o})})]})})]})}var e5=e.i(480462);function e6(){let e=(0,r.useRouter)(),a=(0,A.useQueryParamConfig)(),[o]=(0,e5.useSidebarState)(),[l]=(0,e5.useHookIdState)(),[n,i]=(0,e5.useTabState)(),d="local"===a.backend;return(0,s.jsx)("div",{className:"max-w-7xl mx-auto px-4",children:(0,s.jsxs)(X.Tabs,{value:n,onValueChange:i,className:"w-full",children:[(0,s.jsxs)(X.TabsList,{className:"mb-4",children:[(0,s.jsx)(X.TabsTrigger,{value:"runs",children:"Runs"}),(0,s.jsx)(X.TabsTrigger,{value:"hooks",children:"Hooks"}),d&&(0,s.jsx)(X.TabsTrigger,{value:"workflows",children:"Workflows"})]}),(0,s.jsx)(X.TabsContent,{value:"runs",children:(0,s.jsx)(t.ErrorBoundary,{title:"Runs Error",description:"Failed to load workflow runs. Please try refreshing the page.",children:(0,s.jsx)(Q,{config:a,onRunClick:(s,t)=>{t?e.push((0,A.buildUrlWithConfig)(`/run/${s}/streams/${t}`,a)):e.push((0,A.buildUrlWithConfig)(`/run/${s}`,a))}})})}),(0,s.jsx)(X.TabsContent,{value:"hooks",children:(0,s.jsx)(t.ErrorBoundary,{title:"Hooks Error",description:"Failed to load hooks. Please try refreshing the page.",children:(0,s.jsx)(z,{config:a,onHookClick:(s,t)=>{s?e.push((0,A.buildUrlWithConfig)(`/run/${t}`,a,{sidebar:"hook",hookId:s})):e.push((0,A.buildUrlWithConfig)(`/run/${t}`,a))},selectedHookId:"hook"===o&&l?l:void 0})})}),d&&(0,s.jsx)(X.TabsContent,{value:"workflows",children:(0,s.jsx)(t.ErrorBoundary,{title:"Workflows Error",description:"Failed to load workflow graph data. Please try refreshing the page.",children:(0,s.jsx)(e2,{config:a})})})]})})}e.s(["default",()=>e6],330997)}]);
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,721969,e=>{"use strict";let t;var a,s=e.i(666426);e.i(169764);var r=e.i(545030),n=e.i(868924),o=e.i(360088),l=e.i(531875),d=e.i(742334),i=e.i(195547),c=e.i(687602),u=e.i(400138),p=e.i(886288);let m=(0,p.default)("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),f=(0,p.default)("List",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]]);var x=e.i(857812),h=e.i(414576),g=e.i(686107),b=e.i(806746),v=e.i(456944),j=e.i(961612),y=e.i(652773),N=e.i(178896),w=e.i(873350),k=e.i(676977),S=e.i(571577),A=e.i(68206),C=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce((e,t)=>{let a=g.forwardRef((e,a)=>{let{asChild:r,...n}=e,o=r?A.Slot:t;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,s.jsx)(o,{...n,ref:a})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{}),I=e.i(448297),E=e.i(25749),D="dismissableLayer.update",T=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),R=g.forwardRef((e,t)=>{let{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:o,onFocusOutside:l,onInteractOutside:d,onDismiss:i,...c}=e,u=g.useContext(T),[p,m]=g.useState(null),f=p?.ownerDocument??globalThis?.document,[,x]=g.useState({}),h=(0,y.useComposedRefs)(t,e=>m(e)),b=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),j=b.indexOf(v),w=p?b.indexOf(p):-1,k=u.layersWithOutsidePointerEventsDisabled.size>0,S=w>=j,A=function(e,t=globalThis?.document){let a=(0,I.useCallbackRef)(e),s=g.useRef(!1),r=g.useRef(()=>{});return g.useEffect(()=>{let e=e=>{if(e.target&&!s.current){let s=function(){P("dismissableLayer.pointerDownOutside",a,n,{discrete:!0})},n={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",r.current),r.current=s,t.addEventListener("click",r.current,{once:!0})):s()}else t.removeEventListener("click",r.current);s.current=!1},n=window.setTimeout(()=>{t.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(n),t.removeEventListener("pointerdown",e),t.removeEventListener("click",r.current)}},[t,a]),{onPointerDownCapture:()=>s.current=!0}}(e=>{let t=e.target,a=[...u.branches].some(e=>e.contains(t));S&&!a&&(o?.(e),d?.(e),e.defaultPrevented||i?.())},f),R=function(e,t=globalThis?.document){let a=(0,I.useCallbackRef)(e),s=g.useRef(!1);return g.useEffect(()=>{let e=e=>{e.target&&!s.current&&P("dismissableLayer.focusOutside",a,{originalEvent:e},{discrete:!1})};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,a]),{onFocusCapture:()=>s.current=!0,onBlurCapture:()=>s.current=!1}}(e=>{let t=e.target;![...u.branches].some(e=>e.contains(t))&&(l?.(e),d?.(e),e.defaultPrevented||i?.())},f);return(0,E.useEscapeKeydown)(e=>{w===u.layers.size-1&&(n?.(e),!e.defaultPrevented&&i&&(e.preventDefault(),i()))},f),g.useEffect(()=>{if(p)return r&&(0===u.layersWithOutsidePointerEventsDisabled.size&&(a=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(p)),u.layers.add(p),O(),()=>{r&&1===u.layersWithOutsidePointerEventsDisabled.size&&(f.body.style.pointerEvents=a)}},[p,f,r,u]),g.useEffect(()=>()=>{p&&(u.layers.delete(p),u.layersWithOutsidePointerEventsDisabled.delete(p),O())},[p,u]),g.useEffect(()=>{let e=()=>x({});return document.addEventListener(D,e),()=>document.removeEventListener(D,e)},[]),(0,s.jsx)(C.div,{...c,ref:h,style:{pointerEvents:k?S?"auto":"none":void 0,...e.style},onFocusCapture:(0,N.composeEventHandlers)(e.onFocusCapture,R.onFocusCapture),onBlurCapture:(0,N.composeEventHandlers)(e.onBlurCapture,R.onBlurCapture),onPointerDownCapture:(0,N.composeEventHandlers)(e.onPointerDownCapture,A.onPointerDownCapture)})});function O(){let e=new CustomEvent(D);document.dispatchEvent(e)}function P(e,t,a,{discrete:s}){let r=a.originalEvent.target,n=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:a});if(t&&r.addEventListener(e,t,{once:!0}),s)r&&S.flushSync(()=>r.dispatchEvent(n));else r.dispatchEvent(n)}R.displayName="DismissableLayer",g.forwardRef((e,t)=>{let a=g.useContext(T),r=g.useRef(null),n=(0,y.useComposedRefs)(t,r);return g.useEffect(()=>{let e=r.current;if(e)return a.branches.add(e),()=>{a.branches.delete(e)}},[a.branches]),(0,s.jsx)(C.div,{...e,ref:n})}).displayName="DismissableLayerBranch";var L="focusScope.autoFocusOnMount",M="focusScope.autoFocusOnUnmount",F={bubbles:!1,cancelable:!0},_=g.forwardRef((e,t)=>{let{loop:a=!1,trapped:r=!1,onMountAutoFocus:n,onUnmountAutoFocus:o,...l}=e,[d,i]=g.useState(null),c=(0,I.useCallbackRef)(n),u=(0,I.useCallbackRef)(o),p=g.useRef(null),m=(0,y.useComposedRefs)(t,e=>i(e)),f=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect(()=>{if(r){let e=function(e){if(f.paused||!d)return;let t=e.target;d.contains(t)?p.current=t:$(p.current,{select:!0})},t=function(e){if(f.paused||!d)return;let t=e.relatedTarget;null!==t&&(d.contains(t)||$(p.current,{select:!0}))};document.addEventListener("focusin",e),document.addEventListener("focusout",t);let a=new MutationObserver(function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&$(d)});return d&&a.observe(d,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),a.disconnect()}}},[r,d,f.paused]),g.useEffect(()=>{if(d){H.add(f);let e=document.activeElement;if(!d.contains(e)){let t=new CustomEvent(L,F);d.addEventListener(L,c),d.dispatchEvent(t),t.defaultPrevented||(function(e,{select:t=!1}={}){let a=document.activeElement;for(let s of e)if($(s,{select:t}),document.activeElement!==a)return}(W(d).filter(e=>"A"!==e.tagName),{select:!0}),document.activeElement===e&&$(d))}return()=>{d.removeEventListener(L,c),setTimeout(()=>{let t=new CustomEvent(M,F);d.addEventListener(M,u),d.dispatchEvent(t),t.defaultPrevented||$(e??document.body,{select:!0}),d.removeEventListener(M,u),H.remove(f)},0)}}},[d,c,u,f]);let x=g.useCallback(e=>{if(!a&&!r||f.paused)return;let t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,s=document.activeElement;if(t&&s){var n;let t,r=e.currentTarget,[o,l]=[B(t=W(n=r),n),B(t.reverse(),n)];o&&l?e.shiftKey||s!==l?e.shiftKey&&s===o&&(e.preventDefault(),a&&$(l,{select:!0})):(e.preventDefault(),a&&$(o,{select:!0})):s===r&&e.preventDefault()}},[a,r,f.paused]);return(0,s.jsx)(C.div,{tabIndex:-1,...l,ref:m,onKeyDown:x})});function W(e){let t=[],a=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;a.nextNode();)t.push(a.currentNode);return t}function B(e,t){for(let a of e)if(!function(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e&&(void 0===t||e!==t);){if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}(a,{upTo:t}))return a}function $(e,{select:t=!1}={}){if(e&&e.focus){var a;let s=document.activeElement;e.focus({preventScroll:!0}),e!==s&&(a=e)instanceof HTMLInputElement&&"select"in a&&t&&e.select()}}_.displayName="FocusScope";var H=(t=[],{add(e){let a=t[0];e!==a&&a?.pause(),(t=K(t,e)).unshift(e)},remove(e){t=K(t,e),t[0]?.resume()}});function K(e,t){let a=[...e],s=a.indexOf(t);return -1!==s&&a.splice(s,1),a}var z=e.i(664019),G=g.forwardRef((e,t)=>{let{container:a,...r}=e,[n,o]=g.useState(!1);(0,z.useLayoutEffect)(()=>o(!0),[]);let l=a||n&&globalThis?.document?.body;return l?S.default.createPortal((0,s.jsx)(C.div,{...r,ref:t}),l):null});G.displayName="Portal";var V=e.i(224285),U=e.i(648502),q=e.i(891246),J=e.i(73772),Z="Dialog",[Q,Y]=(0,j.createContextScope)(Z),[X,ee]=Q(Z),et=e=>{let{__scopeDialog:t,children:a,open:r,defaultOpen:n,onOpenChange:o,modal:l=!0}=e,d=g.useRef(null),i=g.useRef(null),[c=!1,u]=(0,k.useControllableState)({prop:r,defaultProp:n,onChange:o});return(0,s.jsx)(X,{scope:t,triggerRef:d,contentRef:i,contentId:(0,w.useId)(),titleId:(0,w.useId)(),descriptionId:(0,w.useId)(),open:c,onOpenChange:u,onOpenToggle:g.useCallback(()=>u(e=>!e),[u]),modal:l,children:a})};et.displayName=Z;var ea="DialogTrigger",es=g.forwardRef((e,t)=>{let{__scopeDialog:a,...r}=e,n=ee(ea,a),o=(0,y.useComposedRefs)(t,n.triggerRef);return(0,s.jsx)(C.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":eN(n.open),...r,ref:o,onClick:(0,N.composeEventHandlers)(e.onClick,n.onOpenToggle)})});es.displayName=ea;var er="DialogPortal",[en,eo]=Q(er,{forceMount:void 0}),el=e=>{let{__scopeDialog:t,forceMount:a,children:r,container:n}=e,o=ee(er,t);return(0,s.jsx)(en,{scope:t,forceMount:a,children:g.Children.map(r,e=>(0,s.jsx)(V.Presence,{present:a||o.open,children:(0,s.jsx)(G,{asChild:!0,container:n,children:e})}))})};el.displayName=er;var ed="DialogOverlay",ei=g.forwardRef((e,t)=>{let a=eo(ed,e.__scopeDialog),{forceMount:r=a.forceMount,...n}=e,o=ee(ed,e.__scopeDialog);return o.modal?(0,s.jsx)(V.Presence,{present:r||o.open,children:(0,s.jsx)(ec,{...n,ref:t})}):null});ei.displayName=ed;var ec=g.forwardRef((e,t)=>{let{__scopeDialog:a,...r}=e,n=ee(ed,a);return(0,s.jsx)(q.RemoveScroll,{as:A.Slot,allowPinchZoom:!0,shards:[n.contentRef],children:(0,s.jsx)(C.div,{"data-state":eN(n.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),eu="DialogContent",ep=g.forwardRef((e,t)=>{let a=eo(eu,e.__scopeDialog),{forceMount:r=a.forceMount,...n}=e,o=ee(eu,e.__scopeDialog);return(0,s.jsx)(V.Presence,{present:r||o.open,children:o.modal?(0,s.jsx)(em,{...n,ref:t}):(0,s.jsx)(ef,{...n,ref:t})})});ep.displayName=eu;var em=g.forwardRef((e,t)=>{let a=ee(eu,e.__scopeDialog),r=g.useRef(null),n=(0,y.useComposedRefs)(t,a.contentRef,r);return g.useEffect(()=>{let e=r.current;if(e)return(0,J.hideOthers)(e)},[]),(0,s.jsx)(ex,{...e,ref:n,trapFocus:a.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,N.composeEventHandlers)(e.onCloseAutoFocus,e=>{e.preventDefault(),a.triggerRef.current?.focus()}),onPointerDownOutside:(0,N.composeEventHandlers)(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,a=0===t.button&&!0===t.ctrlKey;(2===t.button||a)&&e.preventDefault()}),onFocusOutside:(0,N.composeEventHandlers)(e.onFocusOutside,e=>e.preventDefault())})}),ef=g.forwardRef((e,t)=>{let a=ee(eu,e.__scopeDialog),r=g.useRef(!1),n=g.useRef(!1);return(0,s.jsx)(ex,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||a.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,n.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,"pointerdown"===t.detail.originalEvent.type&&(n.current=!0));let s=t.target;a.triggerRef.current?.contains(s)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&n.current&&t.preventDefault()}})}),ex=g.forwardRef((e,t)=>{let{__scopeDialog:a,trapFocus:r,onOpenAutoFocus:n,onCloseAutoFocus:o,...l}=e,d=ee(eu,a),i=g.useRef(null),c=(0,y.useComposedRefs)(t,i);return(0,U.useFocusGuards)(),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(_,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:n,onUnmountAutoFocus:o,children:(0,s.jsx)(R,{role:"dialog",id:d.contentId,"aria-describedby":d.descriptionId,"aria-labelledby":d.titleId,"data-state":eN(d.open),...l,ref:c,onDismiss:()=>d.onOpenChange(!1)})}),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(eA,{titleId:d.titleId}),(0,s.jsx)(eC,{contentRef:i,descriptionId:d.descriptionId})]})]})}),eh="DialogTitle",eg=g.forwardRef((e,t)=>{let{__scopeDialog:a,...r}=e,n=ee(eh,a);return(0,s.jsx)(C.h2,{id:n.titleId,...r,ref:t})});eg.displayName=eh;var eb="DialogDescription",ev=g.forwardRef((e,t)=>{let{__scopeDialog:a,...r}=e,n=ee(eb,a);return(0,s.jsx)(C.p,{id:n.descriptionId,...r,ref:t})});ev.displayName=eb;var ej="DialogClose",ey=g.forwardRef((e,t)=>{let{__scopeDialog:a,...r}=e,n=ee(ej,a);return(0,s.jsx)(C.button,{type:"button",...r,ref:t,onClick:(0,N.composeEventHandlers)(e.onClick,()=>n.onOpenChange(!1))})});function eN(e){return e?"open":"closed"}ey.displayName=ej;var ew="DialogTitleWarning",[ek,eS]=(0,j.createContext)(ew,{contentName:eu,titleName:eh,docsSlug:"dialog"}),eA=({titleId:e})=>{let t=eS(ew),a=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
2
|
-
|
|
3
|
-
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
4
|
-
|
|
5
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return g.useEffect(()=>{e&&(document.getElementById(e)||console.error(a))},[a,e]),null},eC=({contentRef:e,descriptionId:t})=>{let a=eS("DialogDescriptionWarning"),s=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${a.contentName}}.`;return g.useEffect(()=>{let a=e.current?.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(s))},[s,e,t]),null},eI="AlertDialog",[eE,eD]=(0,j.createContextScope)(eI,[Y]),eT=Y(),eR=e=>{let{__scopeAlertDialog:t,...a}=e,r=eT(t);return(0,s.jsx)(et,{...r,...a,modal:!0})};eR.displayName=eI,g.forwardRef((e,t)=>{let{__scopeAlertDialog:a,...r}=e,n=eT(a);return(0,s.jsx)(es,{...n,...r,ref:t})}).displayName="AlertDialogTrigger";var eO=e=>{let{__scopeAlertDialog:t,...a}=e,r=eT(t);return(0,s.jsx)(el,{...r,...a})};eO.displayName="AlertDialogPortal";var eP=g.forwardRef((e,t)=>{let{__scopeAlertDialog:a,...r}=e,n=eT(a);return(0,s.jsx)(ei,{...n,...r,ref:t})});eP.displayName="AlertDialogOverlay";var eL="AlertDialogContent",[eM,eF]=eE(eL),e_=g.forwardRef((e,t)=>{let{__scopeAlertDialog:a,children:r,...n}=e,o=eT(a),l=g.useRef(null),d=(0,y.useComposedRefs)(t,l),i=g.useRef(null);return(0,s.jsx)(ek,{contentName:eL,titleName:eW,docsSlug:"alert-dialog",children:(0,s.jsx)(eM,{scope:a,cancelRef:i,children:(0,s.jsxs)(ep,{role:"alertdialog",...o,...n,ref:d,onOpenAutoFocus:(0,N.composeEventHandlers)(n.onOpenAutoFocus,e=>{e.preventDefault(),i.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[(0,s.jsx)(A.Slottable,{children:r}),(0,s.jsx)(eV,{contentRef:l})]})})})});e_.displayName=eL;var eW="AlertDialogTitle",eB=g.forwardRef((e,t)=>{let{__scopeAlertDialog:a,...r}=e,n=eT(a);return(0,s.jsx)(eg,{...n,...r,ref:t})});eB.displayName=eW;var e$="AlertDialogDescription",eH=g.forwardRef((e,t)=>{let{__scopeAlertDialog:a,...r}=e,n=eT(a);return(0,s.jsx)(ev,{...n,...r,ref:t})});eH.displayName=e$;var eK=g.forwardRef((e,t)=>{let{__scopeAlertDialog:a,...r}=e,n=eT(a);return(0,s.jsx)(ey,{...n,...r,ref:t})});eK.displayName="AlertDialogAction";var ez="AlertDialogCancel",eG=g.forwardRef((e,t)=>{let{__scopeAlertDialog:a,...r}=e,{cancelRef:n}=eF(ez,a),o=eT(a),l=(0,y.useComposedRefs)(t,n);return(0,s.jsx)(ey,{...o,...r,ref:l})});eG.displayName=ez;var eV=({contentRef:e})=>{let t=`\`${eL}\` requires a description for the component to be accessible for screen reader users.
|
|
6
|
-
|
|
7
|
-
You can add a description to the \`${eL}\` by passing a \`${e$}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
8
|
-
|
|
9
|
-
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${eL}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
|
|
10
|
-
|
|
11
|
-
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return g.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},eU=e.i(260218),eq=e.i(949245);function eJ({...e}){return(0,s.jsx)(eR,{"data-slot":"alert-dialog",...e})}function eZ({...e}){return(0,s.jsx)(eO,{"data-slot":"alert-dialog-portal",...e})}function eQ({className:e,...t}){return(0,s.jsx)(eP,{"data-slot":"alert-dialog-overlay",className:(0,eq.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function eY({className:e,...t}){return(0,s.jsxs)(eZ,{children:[(0,s.jsx)(eQ,{}),(0,s.jsx)(e_,{"data-slot":"alert-dialog-content",className:(0,eq.cn)("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...t})]})}function eX({className:e,...t}){return(0,s.jsx)("div",{"data-slot":"alert-dialog-header",className:(0,eq.cn)("flex flex-col gap-2 text-center sm:text-left",e),...t})}function e0({className:e,...t}){return(0,s.jsx)("div",{"data-slot":"alert-dialog-footer",className:(0,eq.cn)("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function e1({className:e,...t}){return(0,s.jsx)(eB,{"data-slot":"alert-dialog-title",className:(0,eq.cn)("text-lg font-semibold",e),...t})}function e2({className:e,...t}){return(0,s.jsx)(eH,{"data-slot":"alert-dialog-description",className:(0,eq.cn)("text-muted-foreground text-sm",e),...t})}function e5({className:e,...t}){return(0,s.jsx)(eK,{className:(0,eq.cn)((0,eU.buttonVariants)(),e),...t})}function e3({className:e,...t}){return(0,s.jsx)(eG,{className:(0,eq.cn)((0,eU.buttonVariants)({variant:"outline"}),e),...t})}var e4=e.i(524914);function e6({...e}){return(0,s.jsx)("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...e})}function e8({className:e,...t}){return(0,s.jsx)("ol",{"data-slot":"breadcrumb-list",className:(0,eq.cn)("text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",e),...t})}function e9({className:e,...t}){return(0,s.jsx)("li",{"data-slot":"breadcrumb-item",className:(0,eq.cn)("inline-flex items-center gap-1.5",e),...t})}function e7({asChild:e,className:t,...a}){let r=e?A.Slot:"a";return(0,s.jsx)(r,{"data-slot":"breadcrumb-link",className:(0,eq.cn)("hover:text-foreground transition-colors",t),...a})}function te({className:e,...t}){return(0,s.jsx)("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:(0,eq.cn)("text-foreground font-normal",e),...t})}function tt({children:e,className:t,...a}){return(0,s.jsx)("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:(0,eq.cn)("[&>svg]:size-3.5",t),...a,children:e??(0,s.jsx)(e4.ChevronRight,{})})}e.i(495566);var ta=e.i(889840),ts=e.i(638322),tr=e.i(620486);let tn="sleep";function to(e){return e.replace(/\/\/\.\.\//g,"//")}function tl(e){let t=e.split("//");return t.length>=3?t[t.length-1]:null}var td=e.i(479823),ti=e.i(241245);function tc({hasError:e,errorMessage:t}){return(0,s.jsx)("div",{className:"flex items-center gap-2",children:(0,s.jsxs)(ts.Tooltip,{children:[(0,s.jsx)(ts.TooltipTrigger,{asChild:!0,children:(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,s.jsx)("div",{className:`w-2 h-2 rounded-full ${e?"bg-red-500":"bg-green-500 animate-pulse"}`}),(0,s.jsx)("span",{className:`text-xs $
|
|
12
|
-
hasError
|
|
13
|
-
? 'text-red-600 dark:text-red-400'
|
|
14
|
-
: 'text-muted-foreground'`,children:e?"Error":"Live"})]})}),(0,s.jsx)(ts.TooltipContent,{children:(0,s.jsx)("p",{children:e?`Error updating data: ${t}`:`Content updates every ${eq.LIVE_UPDATE_INTERVAL_MS/1e3} seconds`})})]})})}var tu=e.i(719402),tp=e.i(451675),tm=e.i(330974),tf=e.i(280998),tx=e.i(259280),th=e.i(356089),tg=e.i(562918),tb=e.i(93698);function tv(e){return"retrying"===e?"running":e}let tj={loopNode:function({data:e,selected:t}){return(0,s.jsxs)("div",{className:`relative ${e.className||""}`,style:{borderWidth:e.nodeStyle?.borderWidth??2,borderRadius:8,padding:12,width:220,borderStyle:"solid",backgroundColor:e.nodeStyle?.backgroundColor,borderColor:e.nodeStyle?.borderColor??"#9ca3af",opacity:e.nodeStyle?.opacity,boxShadow:t?"0 0 0 2px rgba(168, 85, 247, 0.5)":void 0},children:[e.label,(0,s.jsx)(tm.Handle,{type:"target",position:tf.Position.Top,className:"!bg-purple-500"}),(0,s.jsx)(tm.Handle,{type:"source",position:tf.Position.Bottom,className:"!bg-purple-500"}),(0,s.jsx)(tm.Handle,{type:"source",position:tf.Position.Left,id:"loop-out",className:"!bg-purple-500 !-left-1 !w-[6px] !h-[6px] !min-w-0 !min-h-0",style:{top:"30%"}}),(0,s.jsx)(tm.Handle,{type:"target",position:tf.Position.Left,id:"loop-in",className:"!bg-purple-500 !-left-1 !w-[6px] !h-[6px] !min-w-0 !min-h-0",style:{top:"70%"}})]})},parallelGroup:tb.ParallelGroupComponent,executionNode:function({data:e,selected:t}){let a="workflow_start"===e.nodeKind,r="workflow_end"===e.nodeKind;return(0,s.jsxs)("div",{className:`relative ${e.className||""}`,style:{borderWidth:e.nodeStyle?.borderWidth??2,borderRadius:8,padding:12,width:220,borderStyle:"solid",backgroundColor:e.nodeStyle?.backgroundColor,borderColor:e.nodeStyle?.borderColor??"#9ca3af",opacity:e.nodeStyle?.opacity,boxShadow:t?"0 0 0 2px rgba(59, 130, 246, 0.35)":void 0},children:[e.label,!a&&(0,s.jsx)(tm.Handle,{type:"target",position:tf.Position.Top,className:"!bg-muted"}),!r&&(0,s.jsx)(tm.Handle,{type:"source",position:tf.Position.Bottom,className:"!bg-muted"})]})},diamondNode:function({data:e,selected:t}){return(0,s.jsxs)("div",{className:`relative flex items-center justify-center ${e.className||""}`,style:{width:160,height:160},children:[(0,s.jsx)("div",{style:{width:112,height:112,transform:"rotate(45deg)",borderWidth:2,borderStyle:"solid",borderRadius:4,backgroundColor:e.nodeStyle?.backgroundColor,borderColor:e.nodeStyle?.borderColor??"#ef4444",opacity:e.nodeStyle?.opacity,boxShadow:t?"0 0 0 2px rgba(239, 68, 68, 0.5)":void 0}}),(0,s.jsx)("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-auto",style:{fontSize:11,fontWeight:600,padding:40},title:"string"==typeof e.label?e.label:void 0,children:(0,s.jsx)("span",{className:"text-center line-clamp-3 overflow-hidden",children:e.label})}),(0,s.jsx)(tm.Handle,{type:"target",position:tf.Position.Top,className:"!bg-red-500"}),(0,s.jsx)(tm.Handle,{type:"source",position:tf.Position.Bottom,id:"bottom",className:"!bg-red-500"}),(0,s.jsx)(tm.Handle,{type:"source",position:tf.Position.Left,id:"left",className:"!bg-red-500"}),(0,s.jsx)(tm.Handle,{type:"source",position:tf.Position.Right,id:"right",className:"!bg-red-500"})]})}},ty=(0,tb.createEdgeTypes)(tb.executionSelfLoopStyle);function tN(e,t,a){let r=(0,s.jsxs)("div",{className:"flex items-start gap-2 w-full overflow-hidden",children:[(0,s.jsx)("div",{className:"flex-shrink-0",children:(0,tb.getNodeIcon)(e.nodeKind,e.label)}),(0,s.jsx)("span",{className:"text-sm font-medium break-words whitespace-normal leading-tight flex-1 min-w-0",children:e.label})]});if(!a||0===a.length)return r;let n=a[a.length-1],o=a.length,l=o>1;return l||n.duration&&n.duration>0?(0,s.jsxs)("div",{className:"flex flex-col gap-1.5 w-full",children:[r,(0,s.jsxs)("div",{className:"flex flex-wrap gap-1 text-xs",children:[l&&(0,s.jsxs)(tg.Badge,{variant:"outline",className:"text-xs px-1.5 py-0 border-orange-500 text-orange-700 dark:text-orange-300",children:["↻ ",o,"x"]}),n.duration&&n.duration>0&&(0,s.jsxs)(tg.Badge,{variant:"secondary",className:"text-xs px-1.5 py-0 bg-black/10 dark:bg-white/15 border-0",children:["⏱ ",(0,th.formatDuration)(n.duration,!0)]})]})]}):r}let tw={...tb.LAYOUT,VERTICAL_SPACING:320};function tk(e,t){let{nodes:a,groupNodes:s}=(0,tb.calculateEnhancedLayout)(e,tw),r=new Map,n=new Map;for(let e of s)e.id.startsWith("group_")&&n.set(e.id,e.position);for(let e of a){let t=e.metadata?.parallelGroupId?`group_${e.metadata.parallelGroupId}`:null;t&&n.has(t)&&r.set(e.id,t)}let o=[];for(let e of s.filter(e=>e.id.startsWith("group_")))o.push({id:e.id,type:"parallelGroup",position:e.position,style:{...e.style,cursor:"grab",zIndex:-1},data:e.data,selectable:!0,draggable:!0});for(let e of a){let a=t?.nodeExecutions.get(e.id),s=function(e,t){let a=(0,tb.getNodeBackgroundColor)(e);if(!t||0===t.length)return{color:"hsl(var(--card-foreground))",backgroundColor:a,borderColor:"#9ca3af",opacity:.4};let s=t[t.length-1],r="#9ca3af",n=2;switch(s.status){case"completed":r="#22c55e";break;case"failed":r="#ef4444",n=3;break;case"running":r="#3b82f6",n=2;break;case"retrying":r="#f97316";break;case"cancelled":r="#eab308";break;case"pending":r="#9ca3af"}return{color:"hsl(var(--card-foreground))",backgroundColor:a,borderColor:r,borderWidth:n}}(e.data.nodeKind,a),l=t?.currentNode===e.id,d=!!e.metadata?.loopId,i=!!e.metadata?.loopIsAwait,c="conditional"===e.data.nodeKind,u=c?"diamondNode":d?"loopNode":"executionNode",p=r.get(e.id),m=e.position;if(p){let t=n.get(p);t&&(m={x:e.position.x-t.x,y:e.position.y-t.y})}let f=l?"animate-pulse-subtle":"";d?o.push({id:e.id,type:u,position:m,parentId:p,extent:p?"parent":void 0,expandParent:!0,data:{...e.data,label:tN(e.data,e.metadata,a),executions:a,isLoopNode:!0,isAwaitLoop:i,nodeStyle:s,className:f}}):c?o.push({id:e.id,type:u,position:m,parentId:p,extent:p?"parent":void 0,expandParent:!0,data:{...e.data,label:e.data.label,executions:a,nodeStyle:s,className:f}}):o.push({id:e.id,type:u,position:m,parentId:p,extent:p?"parent":void 0,expandParent:!0,data:{...e.data,label:tN(e.data,e.metadata,a),executions:a,nodeStyle:s,className:f},style:{width:220}})}return o}function tS(e,t){let{additionalEdges:a}=(0,tb.calculateEnhancedLayout)(e,tw),r=[...e.edges.map(e=>"loop"===e.type?{...e,id:`loop_back_${e.source}_${e.target}`,isOriginal:!0}:{...e,isOriginal:!0}),...a.map(e=>({...e,isOriginal:!1}))];return(0,tb.consolidateEdges)(r,e.nodes).map(e=>{let a;if("selfLoop"===e.type)return{id:e.id,source:e.source,target:e.target,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle,type:"selfLoop",label:e.label,markerEnd:{type:tf.MarkerType.ArrowClosed,width:12,height:12,color:"#a855f7"}};let r=t?.edgeTraversals.get(e.id);if(!r&&e.isConsolidated&&e.originalEdgeIds)for(let a of e.originalEdgeIds){let e=t?.edgeTraversals.get(a);if(e&&e.traversalCount>0){r=e;break}}let n=r&&r.traversalCount>0,o=!!t,l=r?.timings.length?r.timings.reduce((e,t)=>e+t,0)/r.timings.length:void 0,d="bezier",i=e.label,c=!1;switch(e.type){case"parallel":d="smoothstep",a="4,4",i=void 0;break;case"loop":d="step",a="8,4";break;case"conditional":d="smoothstep",a="8,4",c=!0;break;default:d="bezier"}let u=n?"#22c55e":"#6b7280",p=n?void 0:a,m=c?"#ffffff":"#6b7280",f=c?"#374151":"#f3f4f6",x=c?"#4b5563":"#d1d5db";return{id:e.id,source:e.source,target:e.target,type:d,animated:n&&t?.status==="running",label:r&&r.traversalCount>1?(0,s.jsxs)("div",{className:"flex flex-col items-center gap-0.5",children:[(0,s.jsxs)(tg.Badge,{variant:"secondary",className:"text-xs px-1.5 py-0",children:[r.traversalCount,"×"]}),l&&l>0&&(0,s.jsxs)("span",{className:"text-[10px] text-muted-foreground",children:["~",(0,th.formatDuration)(l,!0)]})]}):i,labelStyle:{fill:m,fontWeight:500,fontSize:"11px"},labelBgStyle:{fill:f,fillOpacity:.95,stroke:x,strokeWidth:1},labelBgPadding:[4,6],labelBgBorderRadius:4,markerEnd:{type:tf.MarkerType.ArrowClosed,width:n?14:10,height:n?14:10,color:u},style:{strokeWidth:n?2.5:1,stroke:u,opacity:o&&!n?.35:1,strokeDasharray:p}}})}function tA({selectedNode:e,env:t,onClose:a}){let{node:r,executions:n,stepId:o,runId:d}=e,i=n[n.length-1],c=n.length>1,{data:u,loading:p}=(0,l.useWorkflowResourceData)(t??{},"step",o??"",{runId:d}),m=u?.input??i?.input,f=u?.output??i?.output,h=u?.error??i?.error;return(0,s.jsxs)("div",{className:"h-full flex flex-col bg-background border-l",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-2 px-3 py-2 border-b flex-none",children:[(0,s.jsx)("span",{className:"text-xs font-medium truncate flex-1",title:r.data.label,children:r.data.label}),(0,s.jsxs)("div",{className:"flex items-center gap-2 flex-none",children:[i?.duration!==void 0&&i.duration>0&&(0,s.jsx)("span",{className:"text-[10px] font-mono text-muted-foreground bg-muted px-1.5 py-0.5 rounded",children:(0,th.formatDuration)(i.duration)}),(0,s.jsx)("div",{className:"w-px h-4 bg-border"}),(0,s.jsx)("button",{type:"button",onClick:a,className:"p-1 rounded hover:bg-muted transition-colors","aria-label":"Close panel",children:(0,s.jsx)(tx.X,{className:"h-4 w-4 text-muted-foreground"})})]})]}),(0,s.jsxs)("div",{className:"flex-1 overflow-y-auto p-3 min-h-0",children:[(0,s.jsxs)("div",{className:"flex flex-col divide-y rounded-lg border overflow-hidden mb-3",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between px-2.5 py-1.5",children:[(0,s.jsx)("span",{className:"text-[11px] font-medium text-muted-foreground",children:"type"}),(0,s.jsx)("span",{className:"text-[11px] font-mono",children:r.data.nodeKind})]}),i&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between px-2.5 py-1.5",children:[(0,s.jsx)("span",{className:"text-[11px] font-medium text-muted-foreground",children:"status"}),(0,s.jsx)(tp.StatusBadge,{status:tv(i.status)})]}),void 0!==i.duration&&i.duration>0&&(0,s.jsxs)("div",{className:"flex items-center justify-between px-2.5 py-1.5",children:[(0,s.jsx)("span",{className:"text-[11px] font-medium text-muted-foreground",children:"duration"}),(0,s.jsx)("span",{className:"text-[11px] font-mono",children:(0,th.formatDuration)(i.duration)})]}),c&&(0,s.jsxs)("div",{className:"flex items-center justify-between px-2.5 py-1.5",children:[(0,s.jsx)("span",{className:"text-[11px] font-medium text-muted-foreground",children:"attempts"}),(0,s.jsx)("span",{className:"text-[11px] font-mono",children:n.length})]}),i.startedAt&&(0,s.jsxs)("div",{className:"flex items-center justify-between px-2.5 py-1.5",children:[(0,s.jsx)("span",{className:"text-[11px] font-medium text-muted-foreground",children:"startedAt"}),(0,s.jsx)("span",{className:"text-[11px] font-mono",children:new Date(i.startedAt).toLocaleString()})]}),i.completedAt&&(0,s.jsxs)("div",{className:"flex items-center justify-between px-2.5 py-1.5",children:[(0,s.jsx)("span",{className:"text-[11px] font-medium text-muted-foreground",children:"completedAt"}),(0,s.jsx)("span",{className:"text-[11px] font-mono",children:new Date(i.completedAt).toLocaleString()})]})]})]}),p&&o&&(0,s.jsxs)("div",{className:"flex items-center gap-2 text-xs text-muted-foreground mb-3",children:[(0,s.jsx)(x.Loader2,{className:"h-3 w-3 animate-spin"}),(0,s.jsx)("span",{children:"Loading step data..."})]}),void 0!==m&&(0,s.jsxs)("details",{className:"group mb-3",children:[(0,s.jsxs)("summary",{className:"cursor-pointer rounded-md border px-2.5 py-1.5 text-xs hover:brightness-95 bg-muted/50",children:[(0,s.jsx)("span",{className:"font-medium",children:"Input"}),(0,s.jsxs)("span",{className:"text-muted-foreground ml-1",children:["(",Array.isArray(m)?m.length:1," args)"]})]}),(0,s.jsxs)("div",{className:"relative pl-6 mt-3",children:[(0,s.jsx)("div",{className:"absolute left-3 -top-3 w-px h-3 bg-border"}),(0,s.jsx)("div",{className:"absolute left-3 top-0 w-3 h-3 border-l border-b rounded-bl-lg border-border"}),(0,s.jsx)("pre",{className:"text-[11px] overflow-x-auto rounded-md border p-2.5 bg-muted/30 max-h-64 overflow-y-auto",children:(0,s.jsx)("code",{children:JSON.stringify(m,null,2)})})]})]}),void 0!==f&&(0,s.jsxs)("details",{className:"group mb-3",children:[(0,s.jsx)("summary",{className:"cursor-pointer rounded-md border px-2.5 py-1.5 text-xs hover:brightness-95 bg-muted/50",children:(0,s.jsx)("span",{className:"font-medium",children:"Output"})}),(0,s.jsxs)("div",{className:"relative pl-6 mt-3",children:[(0,s.jsx)("div",{className:"absolute left-3 -top-3 w-px h-3 bg-border"}),(0,s.jsx)("div",{className:"absolute left-3 top-0 w-3 h-3 border-l border-b rounded-bl-lg border-border"}),(0,s.jsx)("pre",{className:"text-[11px] overflow-x-auto rounded-md border p-2.5 bg-muted/30 max-h-64 overflow-y-auto",children:(0,s.jsx)("code",{children:JSON.stringify(f,null,2)})})]})]}),h&&(0,s.jsxs)("details",{className:"group mb-3",open:!0,children:[(0,s.jsx)("summary",{className:"cursor-pointer rounded-md border border-red-300 bg-red-50 dark:bg-red-950/20 px-2.5 py-1.5 text-xs hover:brightness-95",children:(0,s.jsx)("span",{className:"font-medium text-red-600 dark:text-red-400",children:"Error"})}),(0,s.jsxs)("div",{className:"relative pl-6 mt-3",children:[(0,s.jsx)("div",{className:"absolute left-3 -top-3 w-px h-3 bg-red-300"}),(0,s.jsx)("div",{className:"absolute left-3 top-0 w-3 h-3 border-l border-b rounded-bl-lg border-red-300"}),(0,s.jsx)("pre",{className:"text-[11px] overflow-x-auto rounded-md border border-red-200 p-2.5 bg-red-50 dark:bg-red-950/20 text-red-700 dark:text-red-300 whitespace-pre-wrap max-h-64 overflow-y-auto",children:(0,s.jsx)("code",{children:"object"==typeof h?JSON.stringify(h,null,2):String(h)})})]})]}),c&&(0,s.jsxs)("details",{className:"group",children:[(0,s.jsxs)("summary",{className:"cursor-pointer rounded-md border px-2.5 py-1.5 text-xs hover:brightness-95 bg-muted/50",children:[(0,s.jsx)("span",{className:"font-medium",children:"Attempt History"}),(0,s.jsxs)("span",{className:"text-muted-foreground ml-1",children:["(",n.length," attempts)"]})]}),(0,s.jsxs)("div",{className:"relative pl-6 mt-3",children:[(0,s.jsx)("div",{className:"absolute left-3 -top-3 w-px h-3 bg-border"}),(0,s.jsx)("div",{className:"absolute left-3 top-0 w-3 h-3 border-l border-b rounded-bl-lg border-border"}),(0,s.jsx)("div",{className:"flex flex-col divide-y rounded-md border overflow-hidden",children:n.map(e=>(0,s.jsxs)("div",{className:"flex items-center justify-between px-2.5 py-1.5 text-[11px]",children:[(0,s.jsxs)("span",{className:"text-muted-foreground",children:["Attempt ",e.attemptNumber]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(tp.StatusBadge,{status:tv(e.status)}),void 0!==e.duration&&e.duration>0&&(0,s.jsx)("span",{className:"font-mono text-muted-foreground",children:(0,th.formatDuration)(e.duration)})]})]},e.attemptNumber))})]})]})]})]})}function tC({workflow:e,execution:t,env:a,onNodeClick:r}){let[n,o]=(0,g.useState)(null),l=(0,g.useMemo)(()=>tk(e,t),[e,t]),d=(0,g.useMemo)(()=>tS(e,t),[e,t]),[i,c,u]=(0,tm.useNodesState)(l),[p,m,f]=(0,tm.useEdgesState)(d);(0,g.useEffect)(()=>{c(a=>{let s=tk(e,t),r=new Map(a.map(e=>[e.id,e.position]));return s.map(e=>({...e,position:r.get(e.id)??e.position}))}),m(tS(e,t))},[e,t,c,m]);let x=(0,g.useCallback)((a,s)=>{let n=e.nodes.find(e=>e.id===s.id);if(n){let e=s.data.executions||[],a=e[e.length-1];o({nodeId:s.id,node:n,executions:e,stepId:a?.stepId,runId:t?.runId}),r&&e.length>0&&r(s.id,e)}},[e.nodes,t?.runId,r]),h=(0,g.useCallback)(()=>{o(null)},[]);return(0,s.jsxs)("div",{className:"h-full w-full border rounded-lg bg-background relative overflow-hidden flex",children:[(0,s.jsx)("div",{className:"h-full flex-1 min-w-0",style:{width:n?"calc(100% - 320px)":"100%"},children:(0,s.jsxs)(tm.ReactFlow,{nodes:i,edges:p,onNodesChange:u,onEdgesChange:f,onNodeClick:x,nodeTypes:tj,edgeTypes:ty,fitView:!0,minZoom:.1,maxZoom:2,defaultViewport:{x:0,y:0,zoom:1},proOptions:{hideAttribution:!0},children:[(0,s.jsx)(tm.Background,{}),(0,s.jsx)(tm.Controls,{}),(0,s.jsx)(tm.Panel,{position:"top-left",className:"bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60 border rounded-lg p-2 text-xs",children:(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)("div",{className:"font-semibold text-[10px] text-muted-foreground mb-1",children:"Status"}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("div",{className:"w-6 h-4 rounded border-2 border-green-500 bg-background"}),(0,s.jsx)("span",{children:"Completed"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("div",{className:"w-6 h-4 rounded border-2 border-red-500 bg-background"}),(0,s.jsx)("span",{children:"Failed"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("div",{className:"w-6 h-4 rounded border-2 border-blue-500 bg-background"}),(0,s.jsx)("span",{children:"Running"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("div",{className:"w-6 h-4 rounded border-2 border-yellow-500 bg-background"}),(0,s.jsx)("span",{children:"Cancelled"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2 opacity-50",children:[(0,s.jsx)("div",{className:"w-6 h-4 rounded border-2 border-gray-400 bg-background"}),(0,s.jsx)("span",{children:"Pending"})]})]})}),t&&(0,s.jsxs)(tm.Panel,{position:"top-right",className:"bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60 border rounded-lg p-3 text-xs space-y-1.5",children:[(0,s.jsx)("div",{className:"font-semibold text-sm",children:"Execution"}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:"Status:"}),(0,s.jsx)(tg.Badge,{variant:"completed"===t.status?"default":"failed"===t.status?"destructive":"cancelled"===t.status?"outline":"secondary",className:"text-xs",children:t.status})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:"Progress:"}),(0,s.jsxs)("span",{className:"font-mono",children:[t.executionPath.length," / ",e.nodes.length]})]})]})]})}),n&&(0,s.jsx)("div",{className:"h-full flex-none",style:{width:320},children:(0,s.jsx)(tA,{selectedNode:n,env:a,onClose:h})})]})}var tI=e.i(708341),tE=e.i(613087);function tD({config:e,run:t,allSteps:a,allEvents:r,env:n}){let{manifest:o,loading:l,error:d}=(0,td.useWorkflowGraphManifest)(e),i=(0,g.useMemo)(()=>o&&t.workflowName?o.workflows[t.workflowName]??null:null,[o,t.workflowName]),u=(0,g.useMemo)(()=>i&&t.runId?function(e,t,a,s){let r,n,o=new Map,l=[];console.log("[Graph Mapper] Mapping run to execution:",{runId:e.runId,workflowName:e.workflowName,graphNodes:s.nodes.length,stepsCount:t.length}),(n=s.nodes.find(e=>"workflow_start"===e.data.nodeKind))&&(l.push(n.id),o.set(n.id,[{nodeId:n.id,attemptNumber:1,status:"completed",startedAt:e.startedAt?new Date(e.startedAt).toISOString():void 0,completedAt:e.startedAt?new Date(e.startedAt).toISOString():void 0}]));let d=[...t].sort((e,t)=>new Date(e.createdAt).getTime()-new Date(t.createdAt).getTime());console.log("[Graph Mapper] Sorted steps:",d.map(e=>({stepId:e.stepId,stepName:e.stepName,attempt:e.attempt,status:e.status,createdAt:e.createdAt})));let{byStepId:i,byFunctionName:c,primitivesByLabel:u,agentNodes:p,toolNodes:m}=function(e){let t=new Map,a=new Map,s=new Map,r=[],n=new Map;for(let o of e){if(o.data.stepId){let e=to(o.data.stepId),s=t.get(e)||[];s.push(o),t.set(e,s);let r=tl(e);if(r){let e=a.get(r)||[];e.push(o),a.set(r,e)}}if("primitive"===o.data.nodeKind){let e=o.data.label,t=s.get(e)||[];t.push(o),s.set(e,t)}if("agent"===o.data.nodeKind&&r.push(o),"tool"===o.data.nodeKind){let e=o.data.label.replace(/ \(tool\)$/,""),t=n.get(e)||[];if(t.push(o),n.set(e,t),o.data.stepId){let e=tl(to(o.data.stepId));if(e){let t=n.get(e)||[];t.includes(o)||(t.push(o),n.set(e,t))}}}}return{byStepId:t,byFunctionName:a,primitivesByLabel:s,agentNodes:r,toolNodes:n}}(s.nodes);console.log("[Graph Mapper] Graph nodes by stepId:",{allGraphNodes:s.nodes.map(e=>({id:e.id,stepId:e.data.stepId,normalizedStepId:e.data.stepId?to(e.data.stepId):void 0,nodeKind:e.data.nodeKind})),nodesByStepId:Array.from(i.entries()).map(([e,t])=>({stepId:e,nodeIds:t.map(e=>e.id)}))});let f=new Map,x=[],h=null,g=null;for(let e=0;e<=d.length;e++){let t=d[e];if(t&&t.stepId===h)x.push(t);else{if(x.length>0&&g){let e=function(e,t,a,s,r,n,o){let l=to(t),d=r.get(l)||0;r.set(l,d+1);let i=a.get(l)||[],c="step-id";if(0===i.length){let e=tl(l);e&&(i=s.get(e)||[],c="function-name")}let u=1===i.length?i[0]:i[d];if(console.log("[Graph Mapper] Processing step group:",{stepName:t,normalizedStepName:l,attempts:e.length,occurrenceIndex:d,totalNodesWithStepId:i.length,selectedNode:u?.id,allNodesWithStepId:i.map(e=>e.id),matchStrategy:c,strategy:1===i.length?"single-node-multiple-invocations":"occurrence-based"}),!u)return;let p=e.map((t,a)=>(function(e,t,a,s){let r;switch(e.status){case"completed":r="completed";break;case"failed":r=a<s-1?"retrying":"failed";break;case"running":r="running";break;case"cancelled":r="cancelled";break;default:r="pending"}let n=e.completedAt&&e.startedAt?new Date(e.completedAt).getTime()-new Date(e.startedAt).getTime():void 0;return{nodeId:t,stepId:e.stepId,attemptNumber:e.attempt,status:r,startedAt:e.startedAt?new Date(e.startedAt).toISOString():void 0,completedAt:e.completedAt?new Date(e.completedAt).toISOString():void 0,duration:n,input:e.input,output:e.output,error:e.error?{message:e.error.message,stack:e.error.stack||""}:void 0}})(t,u.id,a,e.length));if(1===i.length){let e=n.get(u.id)||[];n.set(u.id,[...e,...p])}else n.set(u.id,p);return o.includes(u.id)||o.push(u.id),"running"===p[p.length-1].status?u.id:void 0}(x,g,i,c,f,o,l);e&&(r=e)}t&&(x=[t],h=t.stepId,g=t.stepName)}}let b=function(e,t,a,s){let r,n=new Map,o=new Map;for(let t of e){if(!t.correlationId)continue;let e=o.get(t.correlationId)||[];e.push(t),o.set(t.correlationId,e)}let l=t.get(tn)||[],d=new Set;for(let t of e)"wait_created"===t.eventType&&t.correlationId&&d.add(t.correlationId);for(let e of Array.from(d).sort((e,t)=>{let a=o.get(e)||[],s=o.get(t)||[],r=a.find(e=>"wait_created"===e.eventType)?.createdAt,n=s.find(e=>"wait_created"===e.eventType)?.createdAt;return r&&n?new Date(r).getTime()-new Date(n).getTime():0})){let t=o.get(e)||[],d=t.find(e=>"wait_created"===e.eventType),i=t.find(e=>"wait_completed"===e.eventType);if(!d)continue;let c=n.get(tn)||0;n.set(tn,c+1);let u=1===l.length?l[0]:l[c];if(!u)continue;let p="running";i&&(p="completed");let m=new Date(d.createdAt).toISOString(),f=i?new Date(i.createdAt).toISOString():void 0,x=i?new Date(i.createdAt).getTime()-new Date(d.createdAt).getTime():void 0,h={nodeId:u.id,attemptNumber:1,status:p,startedAt:m,completedAt:f,duration:x},g=a.get(u.id)||[];a.set(u.id,[...g,h]),s.includes(u.id)||s.push(u.id),"running"===p&&(r=u.id)}let i=[...t.get("createHook")||[],...t.get("createWebhook")||[]],c=new Set;for(let t of e)"hook_created"===t.eventType&&t.correlationId&&c.add(t.correlationId);let u=Array.from(c).sort((e,t)=>{let a=o.get(e)||[],s=o.get(t)||[],r=a.find(e=>"hook_created"===e.eventType)?.createdAt,n=s.find(e=>"hook_created"===e.eventType)?.createdAt;return r&&n?new Date(r).getTime()-new Date(n).getTime():0}),p=0;for(let e of u){let t=(o.get(e)||[]).find(e=>"hook_created"===e.eventType);if(!t)continue;let r=1===i.length?i[0]:i[p];if(p++,!r)continue;let n=new Date(t.createdAt).toISOString(),l=new Date(t.createdAt).toISOString(),d={nodeId:r.id,attemptNumber:1,status:"completed",startedAt:n,completedAt:l,duration:0},c=a.get(r.id)||[];a.set(r.id,[...c,d]),s.includes(r.id)||s.push(r.id)}let m=t.get("awaitWebhook")||[],f=new Set;for(let t of e)"hook_received"===t.eventType&&t.correlationId&&f.add(t.correlationId);let x=0;for(let e of u){let t,r,n,l=1===m.length?m[0]:m[x];if(x++,!l)continue;let d=o.get(e)||[],i=d.find(e=>"hook_created"===e.eventType),c=d.find(e=>"hook_received"===e.eventType),u=0;c?(t="completed",r=i?new Date(i.createdAt).toISOString():new Date(c.createdAt).toISOString(),u=new Date(n=new Date(c.createdAt).toISOString()).getTime()-new Date(r).getTime()):i?(t="running",r=new Date(i.createdAt).toISOString()):t="pending";let p={nodeId:l.id,attemptNumber:1,status:t,startedAt:r,completedAt:n,duration:u},f=a.get(l.id)||[];a.set(l.id,[...f,p]),s.includes(l.id)||s.push(l.id)}return r}(a,u,o,l);b&&(r=b),function(e,t,a,s,r,n,o){let l="pending";for(let t of("completed"===e.status?l="completed":"failed"===e.status?l="failed":"running"===e.status&&(l="running"),a)){let a={nodeId:t.id,attemptNumber:1,status:l,startedAt:e.startedAt?new Date(e.startedAt).toISOString():void 0,completedAt:e.completedAt&&("completed"===l||"failed"===l)?new Date(e.completedAt).toISOString():void 0};r.set(t.id,[a]),n.includes(t.id)||n.push(t.id)}for(let e of t){let t,a=tl(e.stepName);if(!a)continue;let o=s.get(a);if(!o||0===o.length)continue;let l=o[0];switch(e.status){case"completed":t="completed";break;case"failed":t="failed";break;case"running":t="running";break;case"cancelled":t="cancelled";break;default:t="pending"}let d=e.completedAt&&e.startedAt?new Date(e.completedAt).getTime()-new Date(e.startedAt).getTime():void 0,i={nodeId:l.id,stepId:e.stepId,attemptNumber:e.attempt,status:t,startedAt:e.startedAt?new Date(e.startedAt).toISOString():void 0,completedAt:e.completedAt?new Date(e.completedAt).toISOString():void 0,duration:d,input:e.input,output:e.output,error:e.error},c=r.get(l.id)||[];r.set(l.id,[...c,i]),n.includes(l.id)||n.push(l.id)}for(let t of o){let a=t.metadata?.isToolsCollection===!0;if("tool"===t.data.nodeKind&&a&&!r.has(t.id)){let a={nodeId:t.id,attemptNumber:1,status:l,startedAt:e.startedAt?new Date(e.startedAt).toISOString():void 0,completedAt:e.completedAt&&("completed"===l||"failed"===l)?new Date(e.completedAt).toISOString():void 0};r.set(t.id,[a]),n.includes(t.id)||n.push(t.id)}}}(e,d,p,m,o,l,s.nodes),function(e,t,a,s){let r=e.nodes.filter(e=>"conditional"===e.data.nodeKind),n=new Map;for(let t of e.nodes){let e=t.metadata?.conditionalId;if(e){let a=n.get(e)||{thenNodes:[],elseNodes:[]};t.metadata?.conditionalBranch==="Then"?a.thenNodes.push(t):t.metadata?.conditionalBranch==="Else"&&a.elseNodes.push(t),n.set(e,a)}}for(let e of r){let r=e.id.match(/^(cond_\d+)_node$/);if(!r)continue;let o=r[1],l=n.get(o);if(!l)continue;let d=l.thenNodes.some(e=>t.has(e.id)),i=l.elseNodes.some(e=>t.has(e.id));if(d||i){let r=[...l.thenNodes,...l.elseNodes];if(!t.has(e.id)){let a;for(let e of r){let s=t.get(e.id);if(s&&s.length>0){let e=s[0];e.startedAt&&(!a||e.startedAt<a)&&(a=e.startedAt)}}let n=s.startedAt?new Date(s.startedAt).toISOString():void 0,o={nodeId:e.id,attemptNumber:1,status:"completed",startedAt:a||n,completedAt:a||n};t.set(e.id,[o])}if(!a.includes(e.id)){let t=r.map(e=>a.indexOf(e.id)).filter(e=>e>=0);if(t.length>0){let s=Math.min(...t);s>=0&&s<a.length?a.splice(s,0,e.id):a.push(e.id)}else a.push(e.id)}}}}(s,o,l,e),function(e,t,a,s){let r,n=t.nodes.find(e=>"workflow_end"===e.data.nodeKind);if(!(!n||a.includes(n.id))){switch(e.status){case"completed":r="completed";break;case"failed":r="failed";break;case"cancelled":r="cancelled";break;case"running":r="running";break;case"paused":r="pending";break;default:return}a.push(n.id),s.set(n.id,[{nodeId:n.id,attemptNumber:1,status:r,startedAt:e.completedAt?new Date(e.completedAt).toISOString():void 0,completedAt:e.completedAt?new Date(e.completedAt).toISOString():void 0}])}}(e,s,l,o);let v=function(e,t,a){let s=new Map,r=new Set(e),n=new Map;for(let e of t.nodes){let t=e.metadata?.parallelGroupId;if(t){let a=n.get(t)||{nodes:[]};a.nodes.push(e),a.method=e.metadata?.parallelMethod,n.set(t,a)}}let o=new Map;for(let[e,t]of n)if("race"===t.method){let s,r;for(let e of t.nodes){let t=a.get(e.id);if(t){for(let a of t)if("completed"===a.status&&a.completedAt){let t=new Date(a.completedAt);(!r||t<r)&&(r=t,s=e.id)}}}s&&o.set(e,s)}let l=e=>{let t=s.get(e.id);t?t.traversalCount++:s.set(e.id,{edgeId:e.id,traversalCount:1,timings:[]})};for(let e of t.edges){let a=t.nodes.find(t=>t.id===e.source),s=t.nodes.find(t=>t.id===e.target);if(!a||!s)continue;let n=r.has(e.source),d=r.has(e.target);if(!n&&!d)continue;if("conditional"===e.type){n&&d&&l(e);continue}let i=a.metadata?.parallelGroupId,c=a.metadata?.parallelMethod;i&&"race"===c?o.get(i)===e.source&&d&&l(e):n&&d?l(e):n&&"parallel"===e.type&&d&&l(e)}return s}(l,s,o),j={runId:e.runId,status:e.status,nodeExecutions:o,edgeTraversals:v,currentNode:r,executionPath:l};return console.log("[Graph Mapper] Mapping complete:",{executionPath:l,nodeExecutionsCount:o.size,nodeExecutions:Array.from(o.entries()).map(([e,t])=>({nodeId:e,executionCount:t.length,latestStatus:t[t.length-1]?.status}))}),j}(t,a||[],r||[],i):null,[i,t,a,r]);return l?(0,s.jsxs)("div",{className:"flex items-center justify-center w-full h-full",children:[(0,s.jsx)(x.Loader2,{className:"h-8 w-8 animate-spin text-muted-foreground"}),(0,s.jsx)("span",{className:"ml-4 text-muted-foreground",children:"Loading workflow graph..."})]}):d?(0,s.jsx)("div",{className:"flex items-center justify-center w-full h-full p-4",children:(0,s.jsxs)(v.Alert,{variant:"destructive",className:"max-w-lg",children:[(0,s.jsx)(c.AlertCircle,{className:"h-4 w-4"}),(0,s.jsx)(v.AlertTitle,{children:"Error Loading Workflow Graph"}),(0,s.jsx)(v.AlertDescription,{children:d.message})]})}):i?(0,s.jsx)(tC,{workflow:i,execution:u||void 0,env:n}):(0,s.jsx)("div",{className:"flex items-center justify-center w-full h-full",children:(0,s.jsxs)(v.Alert,{className:"max-w-lg",children:[(0,s.jsx)(c.AlertCircle,{className:"h-4 w-4"}),(0,s.jsx)(v.AlertTitle,{children:"Workflow Graph Not Found"}),(0,s.jsx)(v.AlertDescription,{children:"Could not find the workflow graph for this run. The workflow may have been deleted or the graph manifest may need to be regenerated."})]})})}function tT({config:e,runId:t,selectedId:a}){let r=(0,n.useRouter)(),p=(0,n.useSearchParams)(),[j,y]=(0,g.useState)(!1),[N,w]=(0,g.useState)(!1),[k,S]=(0,g.useState)(!1),[A,C]=(0,g.useState)(!1),I=(0,g.useMemo)(()=>(0,tr.worldConfigToEnvMap)(e),[e]),E=p.get("tab")||"trace",D=p.get("streamId"),T="1"===p.get("debug"),R=(0,g.useCallback)(e=>{let t=new URLSearchParams(p.toString());for(let[a,s]of Object.entries(e))null===s?t.delete(a):t.set(a,s);r.push(`?${t.toString()}`,{scroll:!1})},[r,p]),O=(0,g.useCallback)(e=>{"trace"===e||"graph"===e?R({tab:e,streamId:null}):R({tab:e})},[R]),P=(0,g.useCallback)(e=>{R({streamId:e})},[R]),L=(0,g.useCallback)(e=>{R({tab:"streams",streamId:e})},[R]),M="local"===e.backend,{run:F,steps:_,hooks:W,events:B,loading:$,auxiliaryDataLoading:H,error:K,update:z}=(0,l.useWorkflowTraceViewerData)(I,t,{live:!0}),G=F??{},{streams:V,loading:U,error:q}=(0,l.useWorkflowStreams)(I,t),J=async()=>{if(!j)try{y(!0),S(!1),await (0,l.cancelRun)(I,t),await z(),b.toast.success("Run cancelled successfully")}catch(e){console.error("Failed to cancel run:",e),b.toast.error("Failed to cancel run",{description:e instanceof Error?e.message:"An unknown error occurred"})}finally{y(!1)}},Z=async()=>{if(!N)try{w(!0),C(!1);let t=await (0,l.recreateRun)(I,G.runId);b.toast.success("New run started successfully",{description:`Run ID: ${t}`}),r.push((0,tr.buildUrlWithConfig)(`/run/${t}`,e))}catch(e){console.error("Failed to re-run workflow:",e),b.toast.error("Failed to start new run",{description:e instanceof Error?e.message:"An unknown error occurred"})}finally{w(!1),C(!1)}};if(K&&!F)return(0,s.jsxs)(v.Alert,{variant:"destructive",className:"m-4",children:[(0,s.jsx)(c.AlertCircle,{className:"h-4 w-4"}),(0,s.jsx)(v.AlertTitle,{children:"Error loading workflow run"}),(0,s.jsx)(v.AlertDescription,{children:K.message})]});let Q=(0,o.parseWorkflowName)(G.workflowName)?.shortName;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(eJ,{open:k,onOpenChange:S,children:(0,s.jsxs)(eY,{children:[(0,s.jsxs)(eX,{children:[(0,s.jsx)(e1,{children:"Cancel Workflow Run?"}),(0,s.jsx)(e2,{children:"This will stop the workflow execution immediately, and no further steps will be executed. Partial workflow execution may occur. Are you sure you want to cancel the run?"})]}),(0,s.jsxs)(e0,{children:[(0,s.jsx)(e3,{children:"Keep Running"}),(0,s.jsx)(e5,{onClick:J,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Cancel Run"})]})]})}),(0,s.jsx)(eJ,{open:A,onOpenChange:C,children:(0,s.jsxs)(eY,{children:[(0,s.jsxs)(eX,{children:[(0,s.jsx)(e1,{children:"Replay Run?"}),(0,s.jsx)(e2,{children:"This can potentially re-run code that is meant to only execute once. Are you sure you want to replay the workflow run?"})]}),(0,s.jsxs)(e0,{children:[(0,s.jsx)(e3,{children:"Cancel"}),(0,s.jsx)(e5,{onClick:Z,children:"Replay Run"})]})]})}),(0,s.jsxs)("div",{className:"flex flex-col h-[calc(100vh-97px)]",children:[(0,s.jsxs)("div",{className:"flex-none space-y-4",children:[(0,s.jsx)(e6,{children:(0,s.jsxs)(e8,{children:[(0,s.jsx)(e9,{children:(0,s.jsx)(e7,{asChild:!0,children:(0,s.jsx)(h.default,{href:(0,tr.buildUrlWithConfig)("/",e),children:"Runs"})})}),(0,s.jsx)(tt,{}),(0,s.jsx)(e9,{children:(0,s.jsx)(te,{className:"font-mono text-xs",children:t})})]})}),(0,s.jsxs)("div",{className:"space-y-4 p-6 border rounded-lg",children:[(0,s.jsxs)("div",{className:"flex items-start justify-between",children:[(0,s.jsx)("div",{className:"mb-4",children:(0,s.jsx)("h1",{className:"text-xl font-semibold",children:Q||(0,s.jsx)(tE.Skeleton,{className:"w-[260px] h-[28px]"})})}),(0,s.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,s.jsx)(tc,{hasError:!1,errorMessage:""}),(0,s.jsx)(tI.RunActionsButtons,{env:I,runId:t,runStatus:G.status,events:B,eventsLoading:H,loading:$,onRerunClick:()=>{C(!0)},onCancelClick:()=>{S(!0)},callbacks:{onSuccess:z},showDebugActions:T})]})]}),(0,s.jsxs)("div",{className:"flex items-start gap-8",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)("div",{className:"text-xs text-muted-foreground",children:"Status"}),G.status?(0,s.jsx)(tp.StatusBadge,{status:G.status,context:G}):(0,s.jsx)(tE.Skeleton,{className:"w-[55px] h-[24px]"})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)("div",{className:"text-xs text-muted-foreground",children:"Duration"}),(0,s.jsx)("div",{className:"text-xs",children:G.runId?G.startedAt?(()=>{let e=Math.floor(((G.completedAt?new Date(G.completedAt).getTime():Date.now())-new Date(G.startedAt).getTime())/1e3);if(e<60)return`${e}s`;let t=Math.floor(e/60),a=e%60;if(t<60)return a>0?`${t}m ${a}s`:`${t}m`;let s=Math.floor(t/60),r=t%60;return r>0?`${s}h ${r}m`:`${s}h`})():"-":(0,s.jsx)(tE.Skeleton,{className:"w-[60px] h-[20px]"})})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)("div",{className:"text-xs text-muted-foreground",children:"Run ID"}),G.runId?(0,s.jsx)(ti.CopyableText,{text:G.runId,children:(0,s.jsx)("div",{className:"text-xs mt-0.5 font-mono",children:G.runId})}):(0,s.jsx)(tE.Skeleton,{className:"w-[280px] h-[20px]"})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)("div",{className:"text-xs text-muted-foreground",children:"Queued"}),G.createdAt?(0,s.jsx)("div",{className:"text-xs",children:(0,s.jsx)(tu.RelativeTime,{date:G.createdAt})}):(0,s.jsx)(tE.Skeleton,{className:"w-[110px] h-[20px]"})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)("div",{className:"text-xs text-muted-foreground",children:"Started"}),(0,s.jsx)("div",{className:"text-xs",children:G.runId?G.startedAt?(0,s.jsx)(tu.RelativeTime,{date:G.startedAt}):"-":(0,s.jsx)(tE.Skeleton,{className:"w-[110px] h-[20px]"})})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)("div",{className:"text-xs text-muted-foreground",children:"Completed"}),(0,s.jsx)("div",{className:"text-xs",children:G.runId?G.completedAt?(0,s.jsx)(tu.RelativeTime,{date:G.completedAt}):"-":(0,s.jsx)(tE.Skeleton,{className:"w-[110px] h-[20px]"})})]}),null!=G.expiredAt&&(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsxs)(ts.Tooltip,{children:[(0,s.jsx)(ts.TooltipTrigger,{asChild:!0,children:(0,s.jsxs)("div",{className:"text-xs text-muted-foreground cursor-help flex items-center gap-1",children:["Expired",(0,s.jsx)(m,{className:"w-3 h-3"})]})}),(0,s.jsx)(ts.TooltipContent,{children:(0,s.jsx)("p",{children:"The storage data for this run has expired and is no longer available."})})]}),(0,s.jsx)("div",{className:"text-xs",children:(0,s.jsx)(tu.RelativeTime,{date:G.expiredAt})})]})]})]})]}),(0,s.jsxs)("div",{className:"mt-4 flex-1 flex flex-col min-h-0",children:[(0,s.jsxs)(ta.Tabs,{value:E,onValueChange:e=>O(e),className:"flex-1 flex flex-col min-h-0",children:[(0,s.jsxs)(ta.TabsList,{className:"mb-4 flex-none",children:[(0,s.jsxs)(ta.TabsTrigger,{value:"trace",className:"gap-2",children:[(0,s.jsx)(f,{className:"h-4 w-4"}),"Trace"]}),M&&(0,s.jsxs)(ta.TabsTrigger,{value:"graph",className:"gap-2",children:[(0,s.jsx)(u.GitBranch,{className:"h-4 w-4"}),"Graph"]}),(0,s.jsxs)(ta.TabsTrigger,{value:"streams",className:"gap-2",children:[(0,s.jsx)(f,{className:"h-4 w-4"}),"Streams"]})]}),(0,s.jsx)(ta.TabsContent,{value:"trace",className:"mt-0 flex-1 min-h-0",children:(0,s.jsx)("div",{className:"h-full",children:(0,s.jsx)(i.WorkflowTraceViewer,{error:K,steps:_,events:B,hooks:W,env:I,run:G,isLoading:$,onStreamClick:L})})}),(0,s.jsx)(ta.TabsContent,{value:"streams",className:"mt-0 flex-1 min-h-0",children:(0,s.jsxs)("div",{className:"h-full flex gap-4",children:[(0,s.jsxs)("div",{className:"w-64 flex-shrink-0 border rounded-lg overflow-hidden",style:{borderColor:"var(--ds-gray-300)",backgroundColor:"var(--ds-background-100)"},children:[(0,s.jsxs)("div",{className:"px-3 py-2 border-b text-xs font-medium",style:{borderColor:"var(--ds-gray-300)",color:"var(--ds-gray-900)"},children:["Streams (",V.length,")"]}),(0,s.jsx)("div",{className:"overflow-auto max-h-[calc(100vh-400px)]",children:U?(0,s.jsx)("div",{className:"p-4 flex items-center justify-center",children:(0,s.jsx)(x.Loader2,{className:"h-4 w-4 animate-spin text-muted-foreground"})}):q?(0,s.jsx)("div",{className:"p-4 text-xs text-destructive",children:q.message}):0===V.length?(0,s.jsx)("div",{className:"p-4 text-xs",style:{color:"var(--ds-gray-600)"},children:"No streams found for this run"}):V.map(e=>(0,s.jsx)("button",{type:"button",onClick:()=>P(e),className:"w-full text-left px-3 py-2 text-xs font-mono truncate hover:bg-accent transition-colors",style:{backgroundColor:D===e?"var(--ds-gray-200)":"transparent",color:"var(--ds-gray-1000)"},title:e,children:e},e))})]}),(0,s.jsx)("div",{className:"flex-1 min-w-0",children:D?(0,s.jsx)(d.StreamViewer,{env:I,streamId:D}):(0,s.jsx)("div",{className:"h-full flex items-center justify-center rounded-lg border",style:{borderColor:"var(--ds-gray-300)",backgroundColor:"var(--ds-gray-100)"},children:(0,s.jsx)("div",{className:"text-sm",style:{color:"var(--ds-gray-600)"},children:V.length>0?"Select a stream to view its data":"No streams available"})})})]})}),M&&(0,s.jsx)(ta.TabsContent,{value:"graph",className:"mt-0 flex-1 min-h-0",children:(0,s.jsx)("div",{className:"h-full min-h-[500px]",children:(0,s.jsx)(tD,{config:e,run:G,allSteps:_,allEvents:B,env:I})})})]}),H&&(0,s.jsxs)("div",{className:"fixed flex items-center gap-2 left-8 bottom-8 bg-background border rounded-md px-4 py-2 shadow-lg",children:[(0,s.jsx)(x.Loader2,{className:"size-4 animate-spin"}),(0,s.jsx)("span",{className:"text-sm",children:"Fetching data..."})]})]})]})]})}var tR=e.i(480462);function tO(){let e=(0,n.useParams)(),t=(0,tr.useQueryParamConfig)(),[a]=(0,tR.useStepIdState)(),[o]=(0,tR.useEventIdState)(),[l]=(0,tR.useHookIdState)(),d=e.runId;return(0,s.jsx)(r.ErrorBoundary,{title:"Run Detail Error",description:"Failed to load run details. Please try navigating back to the home page.",children:(0,s.jsx)(tT,{config:t,runId:d,selectedId:a||o||l||void 0})})}e.s(["default",()=>tO],721969)}]);
|
|
File without changes
|
/package/.next/static/{1Gd0u_mHFXgTr2DR4OTNR → ieavtosUwWbQ98kcW2Cp7}/_clientMiddlewareManifest.json
RENAMED
|
File without changes
|
|
File without changes
|