awaitly-visualizer 2.0.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/devtools.cjs +11 -0
  2. package/dist/devtools.cjs.map +1 -0
  3. package/dist/devtools.d.cts +181 -0
  4. package/dist/devtools.d.ts +181 -0
  5. package/dist/devtools.js +11 -0
  6. package/dist/devtools.js.map +1 -0
  7. package/dist/index.browser.cjs.map +1 -1
  8. package/dist/index.browser.d.cts +4 -4
  9. package/dist/index.browser.d.ts +4 -4
  10. package/dist/index.browser.js.map +1 -1
  11. package/dist/index.cjs.map +1 -1
  12. package/dist/index.d.cts +4 -4
  13. package/dist/index.d.ts +4 -4
  14. package/dist/index.js.map +1 -1
  15. package/dist/kroki/fetch.d.cts +1 -1
  16. package/dist/kroki/fetch.d.ts +1 -1
  17. package/dist/notifiers/discord.cjs.map +1 -1
  18. package/dist/notifiers/discord.d.cts +2 -2
  19. package/dist/notifiers/discord.d.ts +2 -2
  20. package/dist/notifiers/discord.js.map +1 -1
  21. package/dist/notifiers/slack.cjs +13 -13
  22. package/dist/notifiers/slack.cjs.map +1 -1
  23. package/dist/notifiers/slack.d.cts +2 -2
  24. package/dist/notifiers/slack.d.ts +2 -2
  25. package/dist/notifiers/slack.js +13 -13
  26. package/dist/notifiers/slack.js.map +1 -1
  27. package/dist/notifiers/webhook.cjs.map +1 -1
  28. package/dist/notifiers/webhook.d.cts +2 -2
  29. package/dist/notifiers/webhook.d.ts +2 -2
  30. package/dist/notifiers/webhook.js.map +1 -1
  31. package/dist/{performance-analyzer-BNwE4AiO.d.cts → performance-analyzer-BtXTMIuL.d.cts} +2 -2
  32. package/dist/{performance-analyzer-B5VF5b1F.d.ts → performance-analyzer-DH1C_5pd.d.ts} +2 -2
  33. package/dist/{types-BnWc9Wlr.d.cts → types-CgO2me2s.d.cts} +1 -1
  34. package/dist/{types-BIZSmXif.d.ts → types-fuxEig2j.d.ts} +1 -1
  35. package/dist/{url-PkfQz4V5.d.cts → url-BskfOf3W.d.cts} +1 -1
  36. package/dist/{url-PkfQz4V5.d.ts → url-BskfOf3W.d.ts} +1 -1
  37. package/package.json +15 -6
@@ -0,0 +1,11 @@
1
+ "use strict";var gt=Object.create;var pe=Object.defineProperty;var ht=Object.getOwnPropertyDescriptor;var kt=Object.getOwnPropertyNames;var wt=Object.getPrototypeOf,bt=Object.prototype.hasOwnProperty;var yt=(e,t)=>{for(var r in t)pe(e,r,{get:t[r],enumerable:!0})},He=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of kt(t))!bt.call(e,s)&&s!==r&&pe(e,s,{get:()=>t[s],enumerable:!(o=ht(t,s))||o.enumerable});return e};var St=(e,t,r)=>(r=e!=null?gt(wt(e)):{},He(t||!e||!e.__esModule?pe(r,"default",{value:e,enumerable:!0}):r,e)),xt=e=>He(pe({},"__esModule",{value:!0}),e);var Cr={};yt(Cr,{createConsoleLogger:()=>lt,createDevtools:()=>Pe,quickVisualize:()=>ut,renderDiff:()=>ct});module.exports=xt(Cr);function H(e){if(e<1e3)return`${Math.round(e)}ms`;if(e<6e4)return`${(e/1e3).toFixed(1).replace(/\.0$/,"")}s`;let t=Math.floor(e/6e4),r=Math.round(e%6e4/1e3);return r>=60&&(t+=1,r=0),r===0?`${t}m`:`${t}m ${r}s`}function fe(){return`node_${Date.now()}_${Math.random().toString(36).slice(2,8)}`}function Rt(e){for(let t of e)if((t.type==="parallel"||t.type==="race"||t.type==="sequence")&&!t.id.startsWith("detected_")||t.type==="decision")return!0;return!1}function Ae(e,t={}){if(Rt(e))return e;let{minOverlapMs:r=0,maxGapMs:o=5}=t,s=[],n=[];for(let u=0;u<e.length;u++){let d=e[u];d.type==="step"&&d.startTs!==void 0?s.push({node:d,startTs:d.startTs,endTs:d.endTs??d.startTs+(d.durationMs??0),originalIndex:u}):n.push({node:d,originalIndex:u})}if(s.length<=1)return e;s.sort((u,d)=>u.startTs-d.startTs);let i=[],c=[s[0]];for(let u=1;u<s.length;u++){let d=s[u],g=Math.min(...c.map(E=>E.startTs)),m=Math.max(...c.map(E=>E.endTs)),f=d.startTs<=g+o,k=d.startTs<m;if(!f&&!k){i.push(c),c=[d];continue}let b=k?Math.min(d.endTs,m)-d.startTs:0;f||b>=r?c.push(d):(i.push(c),c=[d])}i.push(c);let l=[];for(let u of i){let d=Math.min(...u.map(g=>g.originalIndex));if(u.length===1)l.push({node:u[0].node,position:d});else{let g=u.map(b=>b.node),m=Math.min(...u.map(b=>b.startTs)),f=Math.max(...u.map(b=>b.endTs)),k={type:"parallel",id:`detected_parallel_${m}`,name:`${g.length} parallel steps`,state:$t(g),mode:"all",children:g,startTs:m,endTs:f,durationMs:f-m};l.push({node:k,position:d})}}for(let{node:u,originalIndex:d}of n)l.push({node:u,position:d});return l.sort((u,d)=>u.position-d.position),l.map(u=>u.node)}function $t(e){return e.some(n=>n.state==="error")?"error":e.some(n=>n.state==="running")?"running":e.some(n=>n.state==="pending")?"pending":(e.every(n=>n.state==="success"||n.state==="cached"),"success")}function Fe(e={}){let{detectParallel:t=!0,parallelDetection:r,enableSnapshots:o=!1,maxSnapshots:s=1e3}=e,n=o,i=fe(),c,l,u,d="pending",g,m,f=new Map,k=[],b=[],E=new Map,D=[],S=Date.now(),y=S,C={onAfterStep:new Map},I,R=[],v=0;function O(a){return a.stepId??a.stepKey??a.name??fe()}function L(a){if(k.length>0){k[k.length-1].children.push(a),y=Date.now();return}if(b.length>0){let h=b[b.length-1];for(let p of h.branches.values())if(p.taken){p.children.push(a),y=Date.now();return}h.pendingChildren.push(a),y=Date.now();return}D.push(a),y=Date.now()}function $(a){if(!n)return;let h=De(),p=new Map;for(let[T,B]of f)p.set(T,{id:B.id,name:B.name,key:B.key,startTs:B.startTs,retryCount:B.retryCount,timedOut:B.timedOut,timeoutMs:B.timeoutMs});let U={id:`snapshot_${v}`,eventIndex:v,event:structuredClone(a),ir:structuredClone(h),timestamp:Date.now(),activeSteps:p};R.push(U),R.length>s&&R.shift(),v++}function P(a){switch(a.type){case"workflow_start":{D=[],u=void 0,m=void 0,g=void 0,f.clear(),k.length=0,b.length=0,E.clear(),c=a.workflowId,l=a.ts,d="running",S=Date.now(),y=S,I!==void 0&&I!==a.workflowId&&(C.shouldRun=void 0,C.onBeforeStart=void 0),I=a.workflowId,C.onAfterStep=new Map;break}case"workflow_success":d="success",u=a.ts,m=a.durationMs,y=Date.now();break;case"workflow_error":d="error",u=a.ts,g=a.error,m=a.durationMs,y=Date.now();break;case"workflow_cancelled":d="aborted",u=a.ts,m=a.durationMs,y=Date.now();break;case"step_start":{let h=O(a);f.set(h,{id:h,name:a.name,key:a.stepKey,startTs:a.ts,retryCount:0,timedOut:!1}),y=Date.now();break}case"step_success":{let h=O(a),p=f.get(h);if(p){let U={type:"step",id:p.id,name:p.name,key:p.key,state:"success",startTs:p.startTs,endTs:a.ts,durationMs:a.durationMs,...p.retryCount>0&&{retryCount:p.retryCount},...p.timedOut&&{timedOut:!0,timeoutMs:p.timeoutMs}};L(U),f.delete(h)}break}case"step_error":{let h=O(a),p=f.get(h);if(p){let U={type:"step",id:p.id,name:p.name,key:p.key,state:"error",startTs:p.startTs,endTs:a.ts,durationMs:a.durationMs,error:a.error,...p.retryCount>0&&{retryCount:p.retryCount},...p.timedOut&&{timedOut:!0,timeoutMs:p.timeoutMs}};L(U),f.delete(h)}break}case"step_aborted":{let h=O(a),p=f.get(h);if(p){let U={type:"step",id:p.id,name:p.name,key:p.key,state:"aborted",startTs:p.startTs,endTs:a.ts,durationMs:a.durationMs,...p.retryCount>0&&{retryCount:p.retryCount},...p.timedOut&&{timedOut:!0,timeoutMs:p.timeoutMs}};L(U),f.delete(h)}break}case"step_cache_hit":{let p={type:"step",id:O(a),name:a.name,key:a.stepKey,state:"cached",startTs:a.ts,endTs:a.ts,durationMs:0};L(p);break}case"step_cache_miss":break;case"step_complete":break;case"step_timeout":{let h=O(a),p=f.get(h);p&&(p.timedOut=!0,p.timeoutMs=a.timeoutMs),y=Date.now();break}case"step_retry":{let h=O(a),p=f.get(h);p&&(p.retryCount=(a.attempt??1)-1),y=Date.now();break}case"step_retries_exhausted":y=Date.now();break;case"step_skipped":{let p={type:"step",id:O(a),name:a.name,key:a.stepKey,state:"skipped",startTs:a.ts,endTs:a.ts,durationMs:0};L(p);break}case"hook_should_run":{let h={type:"shouldRun",state:"success",ts:a.ts,durationMs:a.durationMs,context:{result:a.result,skipped:a.skipped}};C.shouldRun=h,I=a.workflowId,y=Date.now();break}case"hook_should_run_error":{let h={type:"shouldRun",state:"error",ts:a.ts,durationMs:a.durationMs,error:a.error};C.shouldRun=h,I=a.workflowId,y=Date.now();break}case"hook_before_start":{let h={type:"onBeforeStart",state:"success",ts:a.ts,durationMs:a.durationMs,context:{result:a.result,skipped:a.skipped}};C.onBeforeStart=h,I=a.workflowId,y=Date.now();break}case"hook_before_start_error":{let h={type:"onBeforeStart",state:"error",ts:a.ts,durationMs:a.durationMs,error:a.error};C.onBeforeStart=h,I=a.workflowId,y=Date.now();break}case"hook_after_step":{let h={type:"onAfterStep",state:"success",ts:a.ts,durationMs:a.durationMs,context:{stepKey:a.stepKey}};C.onAfterStep.set(a.stepKey,h),y=Date.now();break}case"hook_after_step_error":{let h={type:"onAfterStep",state:"error",ts:a.ts,durationMs:a.durationMs,error:a.error,context:{stepKey:a.stepKey}};C.onAfterStep.set(a.stepKey,h),y=Date.now();break}case"stream_created":{let h=`${a.workflowId}:${a.namespace}`;E.set(h,{id:fe(),namespace:a.namespace,startTs:a.ts,writeCount:0,readCount:0,streamState:"active",backpressureOccurred:!1,finalPosition:0}),y=Date.now();break}case"stream_write":{let h=`${a.workflowId}:${a.namespace}`,p=E.get(h);p&&(p.writeCount++,p.finalPosition=Math.max(p.finalPosition,a.position)),y=Date.now();break}case"stream_read":{let h=`${a.workflowId}:${a.namespace}`,p=E.get(h);p&&p.readCount++,y=Date.now();break}case"stream_close":{let h=`${a.workflowId}:${a.namespace}`,p=E.get(h);if(p){p.streamState="closed",p.finalPosition=a.finalPosition;let U={type:"stream",id:p.id,namespace:p.namespace,state:"success",startTs:p.startTs,endTs:a.ts,durationMs:a.ts-p.startTs,writeCount:p.writeCount,readCount:p.readCount,finalPosition:a.finalPosition,streamState:"closed",backpressureOccurred:p.backpressureOccurred};L(U),E.delete(h)}y=Date.now();break}case"stream_error":{let h=`${a.workflowId}:${a.namespace}`,p=E.get(h);if(p){p.streamState="error";let U={type:"stream",id:p.id,namespace:p.namespace,state:"error",error:a.error,startTs:p.startTs,endTs:a.ts,durationMs:a.ts-p.startTs,writeCount:p.writeCount,readCount:p.readCount,finalPosition:a.position,streamState:"error",backpressureOccurred:p.backpressureOccurred};L(U),E.delete(h)}y=Date.now();break}case"stream_backpressure":{let h=`${a.workflowId}:${a.namespace}`,p=E.get(h);p&&(p.backpressureOccurred=!0),y=Date.now();break}}$(a)}function te(a){if(a.type==="scope_start")k.push({id:a.scopeId,name:a.name,type:a.scopeType,startTs:a.ts,children:[]}),y=Date.now();else if(a.type==="scope_end"){let h=k.findIndex(T=>T.id===a.scopeId);if(h===-1)return;for(;k.length>h+1;){let T=k.pop(),B=T.type==="race"?{type:"race",id:T.id,name:T.name,state:M(T.children),startTs:T.startTs,endTs:a.ts,children:T.children}:{type:"parallel",id:T.id,name:T.name,state:M(T.children),startTs:T.startTs,endTs:a.ts,children:T.children,mode:T.type==="allSettled"?"allSettled":"all"};k[k.length-1].children.push(B)}let[p]=k.splice(h,1),U=p.type==="race"?{type:"race",id:p.id,name:p.name,state:M(p.children),startTs:p.startTs,endTs:a.ts,durationMs:a.durationMs,children:p.children,winnerId:a.winnerId}:{type:"parallel",id:p.id,name:p.name,state:M(p.children),startTs:p.startTs,endTs:a.ts,durationMs:a.durationMs,children:p.children,mode:p.type==="allSettled"?"allSettled":"all"};L(U)}}function x(a){if(a.type==="decision_start")b.push({id:a.decisionId,name:a.name,condition:a.condition,decisionValue:a.decisionValue,startTs:a.ts,branches:new Map,pendingChildren:[]}),y=Date.now();else if(a.type==="decision_branch"){let h=b.find(p=>p.id===a.decisionId);if(h){let p=a.branchLabel,U=h.branches.get(p);if(U)U.taken=a.taken,a.taken&&h.pendingChildren.length>0&&(U.children.unshift(...h.pendingChildren),h.pendingChildren=[]);else{let T=a.taken?[...h.pendingChildren]:[];a.taken&&(h.pendingChildren=[]),h.branches.set(p,{label:a.branchLabel,condition:a.condition,taken:a.taken,children:T})}y=Date.now()}}else if(a.type==="decision_end"){let h=b.findIndex(p=>p.id===a.decisionId);if(h!==-1){let[p]=b.splice(h,1),U=b.splice(h),T=Array.from(p.branches.values());T.length===0&&p.pendingChildren.length>0&&(T=[{label:"default",taken:!0,children:[...p.pendingChildren]}]);let B=T.find(de=>de.taken)?.label,mt={type:"decision",id:p.id,name:p.name,state:M(T.flatMap(de=>de.taken?de.children:[])),startTs:p.startTs,endTs:a.ts,durationMs:a.durationMs,condition:p.condition,decisionValue:p.decisionValue,branchTaken:a.branchTaken??B,branches:T};L(mt),b.push(...U),y=Date.now()}}}function M(a){return a.length===0?"success":a.some(T=>T.state==="error")?"error":a.every(T=>T.state==="success"||T.state==="cached")?"success":a.some(T=>T.state==="running")?"running":"pending"}function le(){let a=[...D];for(let[,h]of f)a.push({type:"step",id:h.id,name:h.name,key:h.key,state:"running",startTs:h.startTs,...h.retryCount>0&&{retryCount:h.retryCount},...h.timedOut&&{timedOut:!0,timeoutMs:h.timeoutMs}});for(let[,h]of E)a.push({type:"stream",id:h.id,namespace:h.namespace,state:"running",startTs:h.startTs,writeCount:h.writeCount,readCount:h.readCount,finalPosition:h.finalPosition,streamState:h.streamState,backpressureOccurred:h.backpressureOccurred});return a}function De(){let a=le();t&&(a=Ae(a,r));let h={type:"workflow",id:c??i,workflowId:c??i,state:d,startTs:l,endTs:u,durationMs:m,children:a,error:g},p=C.shouldRun!==void 0||C.onBeforeStart!==void 0||C.onAfterStep.size>0;return{root:h,metadata:{createdAt:S,lastUpdatedAt:y},...p&&{hooks:C}}}function Ue(){c=void 0,l=void 0,u=void 0,d="pending",g=void 0,m=void 0,f.clear(),k.length=0,b.length=0,E.clear(),D=[],S=Date.now(),y=S,C={onAfterStep:new Map},I=void 0,R.length=0,v=0}function se(){return[...R]}function dt(a){return R[a]}function pt(a){return R[a]?.ir}function ft(){R.length=0,v=0}return{handleEvent:P,handleScopeEvent:te,handleDecisionEvent:x,getIR:De,reset:Ue,getSnapshots:se,getSnapshotAt:dt,getIRAt:pt,clearSnapshots:ft,get hasActiveSteps(){return f.size>0},get state(){return d},get snapshotCount(){return R.length},get snapshotsEnabled(){return n},setSnapshotsEnabled(a){n=a}}}var ge=require("awaitly");function K(e){return e.type==="step"}function Be(e){return e.type==="sequence"}function X(e){return e.type==="parallel"}function F(e){return e.type==="race"}function J(e){return e.type==="decision"}function Z(e){return e.type==="stream"}var Ne="\x1B[0m",Et="\x1B[1m",ze="\x1B[2m",Mt="\x1B[31m",It="\x1B[32m",Dt="\x1B[33m",Nt="\x1B[34m",Ke="\x1B[90m",Ot="\x1B[37m";function z(e,t){return t?`${t}${e}${Ne}`:e}function ie(e){return`${Et}${e}${Ne}`}function N(e){return`${ze}${e}${Ne}`}var Q={pending:Ot,running:Dt,success:It,error:Mt,aborted:Ke,cached:Nt,skipped:ze+Ke};function vt(e){switch(e){case"pending":return"\u25CB";case"running":return"\u27F3";case"success":return"\u2713";case"error":return"\u2717";case"aborted":return"\u2298";case"cached":return"\u21BA";case"skipped":return"\u2298"}}function ae(e,t){let r=vt(e);return z(r,t[e])}function me(e,t,r){return z(e,r[t])}function Y(e){return e.replace(/\x1b\[[0-9;]*m/g,"")}var w={topLeft:"\u250C",topRight:"\u2510",bottomLeft:"\u2514",bottomRight:"\u2518",horizontal:"\u2500",vertical:"\u2502",teeRight:"\u251C",teeLeft:"\u2524",teeDown:"\u252C",teeUp:"\u2534",cross:"\u253C"},re={cold:"\x1B[34m",cool:"\x1B[36m",neutral:"",warm:"\x1B[33m",hot:"\x1B[31m",critical:"\x1B[41m"},Tt="\x1B[0m";function Ct(e){return e<.2?re.cold:e<.4?re.cool:e<.6?re.neutral:e<.8?re.warm:e<.95?re.hot:re.critical}function Ge(e,t){let r=Ct(t);return r?`${r}${e}${Tt}`:e}function Wt(e){try{return(0,ge.ok)(JSON.stringify(e,(r,o)=>{if(typeof o!="bigint")return o;let s=Number(o);return Number.isSafeInteger(s)?s:o.toString()}))}catch{return(0,ge.err)("STRINGIFY_ERROR")}}function je(e){let t=Wt(e);return t.ok?t.value:"[unserializable]"}var Ve="\u2581\u2582\u2583\u2584\u2585\u2586\u2587\u2588";function ve(e,t=10){if(e.length===0)return"";let r=e.slice(-t),o=Math.min(...r),n=Math.max(...r)-o||1;return r.map(i=>{let c=(i-o)/n,l=Math.floor(c*(Ve.length-1));return Ve[l]}).join("")}function Oe(e,t){let r=Y(e).length,o=Math.max(0,t-r);return e+" ".repeat(o)}function _t(e,t){if(!t)return w.horizontal.repeat(e);let r=` ${t} `,o=Y(r).length,s=e-o;if(s<4)return w.horizontal.repeat(e);let n=2,i=s-n;return w.horizontal.repeat(n)+r+w.horizontal.repeat(i)}function Ye(e,t,r){let o=e.state==="success"?z("\u2699",r.success):z("\u26A0",r.error),s=e.durationMs!==void 0?N(` [${H(e.durationMs)}]`):"",n="";e.type==="shouldRun"&&e.context?.skipped?n=N(" \u2192 workflow skipped"):e.type==="shouldRun"&&e.context?.result===!0?n=N(" \u2192 proceed"):e.type==="onBeforeStart"&&e.context?.skipped?n=N(" \u2192 workflow skipped"):e.type==="onAfterStep"&&e.context?.stepKey&&(n=N(` (${e.context.stepKey})`));let i=e.state==="error"&&e.error?N(` error: ${String(e.error)}`):"";return`${o} ${N(t)}${n}${s}${i}`}function Lt(e,t){let r=[];return e.shouldRun&&r.push(Ye(e.shouldRun,"shouldRun",t)),e.onBeforeStart&&r.push(Ye(e.onBeforeStart,"onBeforeStart",t)),r.length>0&&r.push(N("\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500")),r}function ce(){return{name:"ascii",supportsLive:!0,render(e,t){let r={...Q,...t.colors},o=Math.max(t.terminalWidth??60,5),s=o-4,n=[],i=e.root.name??"workflow",c=ie(i);if(n.push(`${w.topLeft}${_t(o-2,c)}${w.topRight}`),n.push(`${w.vertical}${" ".repeat(o-2)}${w.vertical}`),e.hooks){let u=Lt(e.hooks,r);for(let d of u)n.push(`${w.vertical} ${Oe(d,s)}${w.vertical}`)}let l=he(e.root.children,t,r,0,e.hooks);for(let u of l)n.push(`${w.vertical} ${Oe(u,s)}${w.vertical}`);if(n.push(`${w.vertical}${" ".repeat(o-2)}${w.vertical}`),e.root.durationMs!==void 0&&t.showTimings){let u=e.root.state==="success"?"Completed":e.root.state==="aborted"?"Cancelled":"Failed",g=`${me(u,e.root.state,r)} in ${H(e.root.durationMs)}`;n.push(`${w.vertical} ${Oe(g,s)}${w.vertical}`),n.push(`${w.vertical}${" ".repeat(o-2)}${w.vertical}`)}return n.push(`${w.bottomLeft}${w.horizontal.repeat(o-2)}${w.bottomRight}`),n.join(`
2
+ `)}}}function he(e,t,r,o,s){let n=[];for(let i of e)K(i)?n.push(Te(i,t,r,s)):X(i)?n.push(...Ut(i,t,r,o,s)):F(i)?n.push(...Ht(i,t,r,o,s)):J(i)?n.push(...At(i,t,r,o,s)):Z(i)&&n.push(Pt(i,t,r));return n}function Te(e,t,r,o){let s=ae(e.state,r),n=e.name??e.key??"step",i=t,c=i.showHeatmap&&i.heatmapData?i.heatmapData.heat.get(e.key??"")??i.heatmapData.heat.get(e.name??"")??i.heatmapData.heat.get(e.id):void 0,l;c!==void 0?l=Ge(n,c):l=me(n,e.state,r);let u=`${s} ${l}`;if(t.showKeys&&e.key&&e.name&&(u+=N(` [key: ${e.key}]`)),e.input!==void 0){let g=typeof e.input=="string"?e.input:je(e.input).slice(0,30);u+=N(` [in: ${g}${g.length>=30?"...":""}]`)}if(e.output!==void 0&&e.state==="success"){let g=typeof e.output=="string"?e.output:je(e.output).slice(0,30);u+=N(` [out: ${g}${g.length>=30?"...":""}]`)}if(t.showTimings&&e.durationMs!==void 0){let g=H(e.durationMs),m=c!==void 0?Ge(`[${g}]`,c):N(`[${g}]`);u+=` ${m}`}if(i.showSparklines&&i.timingHistory){let g=i.timingHistory.get(e.key??"")??i.timingHistory.get(e.name??"")??i.timingHistory.get(e.id);g&&g.length>1&&(u+=` ${N(ve(g))}`)}if(e.retryCount!==void 0&&e.retryCount>0&&(u+=N(` [${e.retryCount} ${e.retryCount===1?"retry":"retries"}]`)),e.timedOut){let g=e.timeoutMs!==void 0?` ${e.timeoutMs}ms`:"";u+=N(` [timeout${g}]`)}let d=e.key??e.id;if(o&&d&&o.onAfterStep.has(d)){let g=o.onAfterStep.get(d),m=g.state==="success"?z("\u2699",r.success):z("\u26A0",r.error),f=g.durationMs!==void 0?N(` ${H(g.durationMs)}`):"";u+=` ${m}${f}`}return u}function Pt(e,t,r){let o=e.streamState==="active"?z("\u27F3",r.running):e.streamState==="closed"?z("\u2713",r.success):z("\u2717",r.error),s=`stream:${e.namespace}`,n=me(s,e.state,r),i=N(`[W:${e.writeCount} R:${e.readCount}]`),c=`${o} ${n} ${i}`;return t.showTimings&&e.durationMs!==void 0&&(c+=` ${N(`[${H(e.durationMs)}]`)}`),e.backpressureOccurred&&(c+=N(" [backpressure]")),e.streamState==="closed"&&(c+=N(` pos:${e.finalPosition}`)),c}function Ut(e,t,r,o,s){let n=[],i=" ".repeat(o),c=ae(e.state,r),l=e.name??"parallel",u=e.mode==="allSettled"?" (allSettled)":"";if(n.push(`${i}${w.teeRight}${w.teeDown}${w.horizontal} ${c} ${ie(l)}${u}`),e.children.length===0)n.push(`${i}${w.vertical} ${N("(operations not individually tracked)")}`),n.push(`${i}${w.vertical} ${N("(wrap each operation with step() to see individual steps)")}`);else for(let d=0;d<e.children.length;d++){let g=e.children[d],f=d===e.children.length-1?`${i}${w.vertical} ${w.bottomLeft}`:`${i}${w.vertical} ${w.teeRight}`;if(K(g))n.push(`${f} ${Te(g,t,r,s)}`);else{let k=he([g],t,r,o+1,s);for(let b of k)n.push(`${i}${w.vertical} ${b}`)}}return t.showTimings&&e.durationMs!==void 0&&n.push(`${i}${w.bottomLeft}${w.horizontal}${w.horizontal} ${N(`[${H(e.durationMs)}]`)}`),n}function Ht(e,t,r,o,s){let n=[],i=" ".repeat(o),c=ae(e.state,r),l=e.name??"race";if(n.push(`${i}${w.teeRight}\u26A1 ${c} ${ie(l)}`),e.children.length===0)n.push(`${i}${w.vertical} ${N("(operations not individually tracked)")}`),n.push(`${i}${w.vertical} ${N("(wrap each operation with step() to see individual steps)")}`);else for(let u=0;u<e.children.length;u++){let d=e.children[u],m=u===e.children.length-1?`${i}${w.vertical} ${w.bottomLeft}`:`${i}${w.vertical} ${w.teeRight}`,k=e.winnerId&&d.id===e.winnerId?N(" (winner)"):"";if(K(d))n.push(`${m} ${Te(d,t,r,s)}${k}`);else{let b=he([d],t,r,o+1,s);for(let E of b)n.push(`${i}${w.vertical} ${E}`)}}return t.showTimings&&e.durationMs!==void 0&&n.push(`${i}${w.bottomLeft}${w.horizontal}${w.horizontal} ${N(`[${H(e.durationMs)}]`)}`),n}function At(e,t,r,o,s){let n=[],i=" ".repeat(o),c=ae(e.state,r),l=e.name??"decision",u=e.condition?N(` (${e.condition})`):"",d=e.decisionValue!==void 0?N(` = ${String(e.decisionValue)}`):"",g=e.branchTaken!==void 0?N(` \u2192 ${String(e.branchTaken)}`):"";n.push(`${i}${w.teeRight}${w.teeDown}${w.horizontal} ${c} ${ie(l)}${u}${d}${g}`);for(let m=0;m<e.branches.length;m++){let f=e.branches[m],b=m===e.branches.length-1?`${i}${w.vertical} ${w.bottomLeft}`:`${i}${w.vertical} ${w.teeRight}`,E=f.taken?"\u2713":"\u2298",D=f.taken?r.success:r.skipped,S=z(`${E} ${f.label}`,D),y=f.condition?N(` (${f.condition})`):"";if(n.push(`${b} ${S}${y}`),f.children.length>0){let C=he(f.children,t,r,o+1,s);for(let I of C)n.push(`${i}${w.vertical} ${I}`)}else f.taken||n.push(`${i}${w.vertical} ${N("(skipped)")}`)}return t.showTimings&&e.durationMs!==void 0&&n.push(`${i}${w.bottomLeft}${w.horizontal}${w.horizontal} ${N(`[${H(e.durationMs)}]`)}`),n}var ye=require("awaitly");function ke(e){return e<.2?"cold":e<.4?"cool":e<.6?"neutral":e<.8?"warm":e<.95?"hot":"critical"}function Ft(){return[" classDef pending fill:#f3f4f6,stroke:#9ca3af,stroke-width:2px,color:#374151"," classDef running fill:#fef3c7,stroke:#f59e0b,stroke-width:3px,color:#92400e"," classDef success fill:#d1fae5,stroke:#10b981,stroke-width:3px,color:#065f46"," classDef error fill:#fee2e2,stroke:#ef4444,stroke-width:3px,color:#991b1b"," classDef aborted fill:#f3f4f6,stroke:#6b7280,stroke-width:2px,color:#4b5563,stroke-dasharray: 5 5"," classDef cached fill:#dbeafe,stroke:#3b82f6,stroke-width:3px,color:#1e40af"," classDef skipped fill:#f9fafb,stroke:#d1d5db,stroke-width:2px,color:#6b7280,stroke-dasharray: 5 5"," classDef stream fill:#ede9fe,stroke:#8b5cf6,stroke-width:3px,color:#5b21b6"," classDef streamActive fill:#ddd6fe,stroke:#7c3aed,stroke-width:3px,color:#4c1d95"," classDef streamError fill:#fce7f3,stroke:#db2777,stroke-width:3px,color:#9d174d"]}function Bt(){return[" classDef heat_cold fill:#dbeafe,stroke:#3b82f6,stroke-width:2px,color:#1e40af"," classDef heat_cool fill:#ccfbf1,stroke:#14b8a6,stroke-width:2px,color:#0f766e"," classDef heat_neutral fill:#f3f4f6,stroke:#6b7280,stroke-width:2px,color:#374151"," classDef heat_warm fill:#fef3c7,stroke:#f59e0b,stroke-width:2px,color:#92400e"," classDef heat_hot fill:#fed7aa,stroke:#f97316,stroke-width:3px,color:#c2410c"," classDef heat_critical fill:#fecaca,stroke:#ef4444,stroke-width:3px,color:#b91c1c"]}function Kt(e){return`heat_${e}`}function zt(){return[" classDef hook_success fill:#e0f2fe,stroke:#0284c7,stroke-width:2px,color:#0c4a6e"," classDef hook_error fill:#fef2f2,stroke:#dc2626,stroke-width:2px,color:#7f1d1d"]}function Gt(e){try{return(0,ye.ok)(JSON.stringify(e,(r,o)=>{if(typeof o!="bigint")return o;let s=Number(o);return Number.isSafeInteger(s)?s:o.toString()}))}catch{return(0,ye.err)("STRINGIFY_ERROR")}}function Xe(e){let t=Gt(e);return t.ok?t.value:"[unserializable]"}function jt(e,t,r){let o;if(e.shouldRun){let s="hook_shouldRun",n=e.shouldRun.state==="success"?"hook_success":"hook_error",i=e.shouldRun.state==="success"?"\u2699":"\u26A0",c=r.showTimings&&e.shouldRun.durationMs!==void 0?` ${H(e.shouldRun.durationMs)}`:"",l=e.shouldRun.context?.skipped?"\\nskipped workflow":e.shouldRun.context?.result===!0?"\\nproceed":"";t.push(` ${s}[["${i} shouldRun${l}${c}"]]:::${n}`),o=s}if(e.onBeforeStart){let s="hook_beforeStart",n=e.onBeforeStart.state==="success"?"hook_success":"hook_error",i=e.onBeforeStart.state==="success"?"\u2699":"\u26A0",c=r.showTimings&&e.onBeforeStart.durationMs!==void 0?` ${H(e.onBeforeStart.durationMs)}`:"",l=e.onBeforeStart.context?.skipped?"\\nskipped workflow":"";t.push(` ${s}[["${i} onBeforeStart${l}${c}"]]:::${n}`),o&&t.push(` ${o} --> ${s}`),o=s}return{lastHookId:o}}var Je=0,we=new Set,be=new Set;function ne(e="node"){return`${e}_${++Je}`}function Vt(){Je=0,we.clear(),be.clear()}function A(e){return e.replace(/"/g,"#quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;").trim()}function qe(e){return A(e).replace(/[{}[\]()]/g,"")}function Ce(){return{name:"mermaid",supportsLive:!1,render(e,t){Vt();let r=[],o=t;r.push("flowchart TD");let s;e.hooks&&(s=jt(e.hooks,r,t).lastHookId);let n="start";r.push(` ${n}(("\u25B6 Start"))`),s&&r.push(` ${s} --> ${n}`);let i=n;for(let l of e.root.children){let u=Se(l,t,r,o,e.hooks);r.push(` ${i} --> ${u.entryId}`),i=u.exitId}if(["success","error","aborted"].includes(e.root.state)){let l="finish",u=e.root.state==="success"?"\u2713":e.root.state==="error"?"\u2717":"\u2298",d=e.root.state==="success"?"Done":e.root.state==="error"?"Failed":"Cancelled",g=`(("${u} ${d}"))`,m=e.root.state==="success"?":::success":e.root.state==="error"?":::error":":::aborted";r.push(` ${l}${g}${m}`),r.push(` ${i} --> ${l}`)}return r.push(""),r.push(...Ft()),o.showHeatmap&&r.push(...Bt()),e.hooks&&r.push(...zt()),r.join(`
3
+ `)}}}function Se(e,t,r,o,s){if(K(e))return Yt(e,t,r,o,s);if(X(e))return Xt(e,t,r,o,s);if(F(e))return Jt(e,t,r,o,s);if(J(e))return qt(e,t,r,o,s);if(Z(e))return Zt(e,t,r);let n=ne("unknown");return r.push(` ${n}["Unknown Node"]`),{entryId:n,exitId:n}}function Yt(e,t,r,o,s){let n=t,i=n.showRetryEdges??!0,c=n.showErrorEdges??!0,l=n.showTimeoutEdges??!0,u=e.key?`step_${e.key.replace(/[^a-zA-Z0-9]/g,"_")}`:ne("step");if(be.has(u)){let R=2;for(;be.has(`${u}_${R}`);)R++;u=`${u}_${R}`}be.add(u);let d=e.name??e.key??"Step",g=t.showKeys&&e.key&&e.name?`${d} [${e.key}]`:d,m=A(g),f=t.showTimings&&e.durationMs!==void 0?` ${H(e.durationMs)}`:"",k="";switch(e.state){case"success":k="\u2713 ";break;case"error":k="\u2717 ";break;case"cached":k="\u{1F4BE} ";break;case"running":k="\u23F3 ";break;case"skipped":k="\u2298 ";break}let b="";if(e.input!==void 0){let R=typeof e.input=="string"?A(e.input):A(Xe(e.input).slice(0,20));b+=`\\nin: ${R}`}if(e.output!==void 0&&e.state==="success"){let R=typeof e.output=="string"?A(e.output):A(Xe(e.output).slice(0,20));b+=`\\nout: ${R}`}let E="",D=e.key??e.id;if(s&&D&&s.onAfterStep.has(D)){let R=s.onAfterStep.get(D),v=R.state==="success"?"\u2699":"\u26A0",O=t.showTimings&&R.durationMs!==void 0?` ${H(R.durationMs)}`:"";E=`\\n${v} hook${O}`}let S=(k+m+b+E+f).trim(),y,C=o?.showHeatmap&&o.heatmapData?o.heatmapData.heat.get(e.key??"")??o.heatmapData.heat.get(e.name??"")??o.heatmapData.heat.get(e.id):void 0;if(C!==void 0){let R=ke(C);y=Kt(R)}else y=e.state;let I;switch(e.state){case"error":I=`{{"${S}"}}`;break;case"cached":I=`[("${S}")]`;break;case"skipped":I=`["${S}"]`;break;default:I=`["${S}"]`}if(r.push(` ${u}${I}:::${y}`),i&&e.retryCount!==void 0&&e.retryCount>0){let R=`\u21BB ${e.retryCount} retr${e.retryCount===1?"y":"ies"}`;r.push(` ${u} -.->|"${R}"| ${u}`)}if(c&&e.state==="error"&&e.error!==void 0){let R=`ERR_${u}`,v=A(String(e.error)).slice(0,30);r.push(` ${R}{{"${v}"}}`),r.push(` ${u} -->|error| ${R}`),r.push(` style ${R} fill:#fee2e2,stroke:#dc2626`)}if(l&&e.timedOut){let R=`TO_${u}`,v=e.timeoutMs!==void 0?`${e.timeoutMs}ms`:"";r.push(` ${R}{{"\u23F1 Timeout ${v}"}}`),r.push(` ${u} -.->|timeout| ${R}`),r.push(` style ${R} fill:#fef3c7,stroke:#f59e0b`)}return{entryId:u,exitId:u}}function Xt(e,t,r,o,s){let n=ne("parallel"),i=`${n}_fork`,c=`${n}_join`,l=qe(e.name??"Parallel"),u=e.mode==="allSettled"?" (allSettled)":"";if(e.children.length===0){let m=n,f=A(`${l}${u}`),k="operations not individually tracked",b=t.showTimings&&e.durationMs!==void 0?` ${H(e.durationMs)}`:"";return r.push(` ${m}["${f}${b}\\n${k}"]:::${e.state}`),{entryId:m,exitId:m}}r.push(` subgraph ${n}["${l}${u}"]`),r.push(" direction TB"),r.push(` ${i}{"\u26A1 Fork"}`);let d=[];for(let m of e.children){let f=Se(m,t,r,o,s);r.push(` ${i} --> ${f.entryId}`),d.push(f.exitId)}r.push(` ${c}{"\u2713 Join"}`);for(let m of d)r.push(` ${m} --> ${c}`);r.push(" end");let g=e.state;return r.push(` class ${n} ${g}`),{entryId:i,exitId:c}}function Jt(e,t,r,o,s){let n=ne("race"),i=`${n}_start`,c=`${n}_end`,l=qe(e.name??"Race");if(e.children.length===0){let m=n,f=A(l),k="operations not individually tracked",b=t.showTimings&&e.durationMs!==void 0?` ${H(e.durationMs)}`:"";return r.push(` ${m}["\u26A1 ${f}${b}\\n${k}"]:::${e.state}`),{entryId:m,exitId:m}}r.push(` subgraph ${n}["\u26A1 ${l}"]`),r.push(" direction TB"),r.push(` ${i}(("\u{1F3C1} Start"))`);let u=[],d;for(let m of e.children){let f=Se(m,t,r,o,s),k=e.winnerId===m.id;r.push(` ${i} --> ${f.entryId}`),k&&(d=f.exitId),u.push({exitId:f.exitId,isWinner:k})}r.push(` ${c}(("\u2713 First"))`);for(let{exitId:m,isWinner:f}of u)f&&d?r.push(` ${m} ==>|\u{1F3C6} Winner| ${c}`):e.winnerId?r.push(` ${m} -. cancelled .-> ${c}`):r.push(` ${m} --> ${c}`);r.push(" end");let g=e.state;return r.push(` class ${n} ${g}`),{entryId:i,exitId:c}}function qt(e,t,r,o,s){let n=e.key?`decision_${e.key.replace(/[^a-zA-Z0-9]/g,"_")}`:ne("decision");if(we.has(n)){let m=2;for(;we.has(`${n}_${m}`);)m++;n=`${n}_${m}`}we.add(n);let i=A(e.condition??"condition"),c=e.decisionValue!==void 0?` = ${A(String(e.decisionValue)).slice(0,30)}`:"",l=`${i}${c}`.trim();r.push(` ${n}{"${l}"}`);let u=[],d,g=new Set;for(let m of e.branches){let f=`${n}_${m.label.replace(/[^a-zA-Z0-9]/g,"_")}`;if(g.has(f)){let S=2;for(;g.has(`${f}_${S}`);)S++;f=`${f}_${S}`}g.add(f);let k=A(m.label),b=m.taken?`${k} \u2713`:`${k} skipped`,E=m.taken?":::success":":::skipped";r.push(` ${f}["${b}"]${E}`);let D=m.condition?`|${A(m.condition).replace(/\|/g,"")}|`:"";if(r.push(` ${n} -->${D} ${f}`),m.children.length>0){let S=f;for(let y of m.children){let C=Se(y,t,r,o,s);r.push(` ${S} --> ${C.entryId}`),S=C.exitId}u.push(S),m.taken&&(d=S)}else u.push(f),m.taken&&(d=f)}return d?{entryId:n,exitId:d}:{entryId:n,exitId:n}}function Zt(e,t,r){let o=`stream_${e.namespace.replace(/[^a-zA-Z0-9]/g,"_")}_${ne("")}`,s=`W:${e.writeCount} R:${e.readCount}`,n="";switch(e.streamState){case"active":n="\u27F3 ";break;case"closed":n="\u2713 ";break;case"error":n="\u2717 ";break}let i=t.showTimings&&e.durationMs!==void 0?` ${H(e.durationMs)}`:"",c=e.backpressureOccurred?"\\nbackpressure":"",l=`${n}stream:${A(e.namespace)}\\n${s}${c}${i}`,u;return e.streamState==="error"?u="streamError":e.streamState==="active"?u="streamActive":u="stream",r.push(` ${o}{{"${l}"}}:::${u}`),{entryId:o,exitId:o}}var W={topLeft:"\u250C",topRight:"\u2510",bottomLeft:"\u2514",bottomRight:"\u2518",horizontal:"\u2500",vertical:"\u2502",teeDown:"\u252C",teeUp:"\u2534",teeRight:"\u251C",teeLeft:"\u2524",cross:"\u253C",arrowDown:"\u25BC",arrowUp:"\u25B2"},Qt={cold:"\x1B[34m",cool:"\x1B[36m",neutral:"",warm:"\x1B[33m",hot:"\x1B[31m",critical:"\x1B[41m"},er="\x1B[0m";function tr(e,t){let r=[],o=[];for(let s=0;s<t;s++)r.push(Array(e).fill(" ")),o.push(Array(e).fill(void 0));return{cells:r,colors:o,width:e,height:t}}function _(e,t,r,o,s){t>=0&&t<e.width&&r>=0&&r<e.height&&(e.cells[r][t]=o,s&&(e.colors[r][t]=s))}function et(e,t,r){return t>=0&&t<e.width&&r>=0&&r<e.height?e.cells[r][t]:" "}function rr(e,t,r,o,s){_(e,t,r,W.topLeft);for(let n=1;n<o-1;n++)_(e,t+n,r,W.horizontal);_(e,t+o-1,r,W.topRight);for(let n=1;n<s-1;n++)_(e,t,r+n,W.vertical),_(e,t+o-1,r+n,W.vertical);_(e,t,r+s-1,W.bottomLeft);for(let n=1;n<o-1;n++)_(e,t+n,r+s-1,W.horizontal);_(e,t+o-1,r+s-1,W.bottomRight)}function Ze(e,t,r,o,s){let n=Y(o).split("");for(let i=0;i<n.length;i++)_(e,t+i,r,n[i],s)}function q(e,t,r,o){let s=Math.min(r,o),n=Math.max(r,o);for(let i=s;i<=n;i++){let c=et(e,t,i);c===W.horizontal?_(e,t,i,W.cross):(c===" "||c===W.vertical)&&_(e,t,i,W.vertical)}}function Qe(e,t,r,o){let s=Math.min(r,o),n=Math.max(r,o);for(let i=s;i<=n;i++){let c=et(e,i,t);c===W.vertical?_(e,i,t,W.cross):(c===" "||c===W.horizontal)&&_(e,i,t,W.horizontal)}}function ee(e,t,r){_(e,t,r,W.arrowDown)}function nr(e){let t=[];for(let r=0;r<e.height;r++){let o="";for(let s=0;s<e.width;s++){let n=e.colors[r][s],i=e.cells[r][s];n?o+=n+i+er:o+=i}t.push(o.trimEnd())}for(;t.length>0&&t[t.length-1]==="";)t.pop();return t.join(`
4
+ `)}var G=11,j=2,oe=2,xe=3;function _e(e,t){if(e.length<=t)return[e];let r=e.split(" "),o=[],s="";for(let n of r)s?s.length+1+n.length<=t?s+=" "+n:(o.push(s),s=n):s=n;if(s&&o.push(s),o.length===0)for(let n=0;n<e.length;n+=t)o.push(e.slice(n,n+t));return o}function tt(e){switch(e){case"success":return"\u2713";case"error":return"\u2717";case"running":return"\u27F3";case"pending":return"\u25CB";case"aborted":case"skipped":return"\u2298";case"cached":return"\u21BA";default:return"\u25CB"}}function or(e,t,r){let o=t.showStartEnd??!0,s=t,n=Math.floor(r/2),i=[],c=0;if(o){let u=Re("start","start",["\u25B6 Start"],"success",n,c);i.push(u),c=u.bottomY+oe}for(let u of e.root.children){let d=$e(u,n,c,r-4,t,s);i.push(d.node),c=d.bottomY+oe}if(o&&["success","error","aborted"].includes(e.root.state)){let u=e.root.state==="success"?"\u2713 Done":e.root.state==="error"?"\u2717 Failed":"\u2298 Cancelled",d=Re("end","end",[u],e.root.state,n,c);i.push(d),c=d.bottomY}return{nodes:i,totalHeight:c+2}}function Re(e,t,r,o,s,n){let i=Math.max(...r.map(d=>Y(d).length)),c=Math.max(G,i+j*2),l=r.length+2,u=s-Math.floor(c/2);return{id:e,type:t,label:r,state:o,x:u,y:n,width:c,height:l,centerX:s,bottomY:n+l-1}}function $e(e,t,r,o,s,n){if(K(e))return sr(e,t,r,o,s,n);if(X(e)||F(e))return ar(e,t,r,o,s,n);if(J(e))return cr(e,t,r,o,s,n);if(Z(e))return ir(e,t,r,o,s,n);let i=Re(e.id,"step",["?"],e.state,t,r);return{node:i,bottomY:i.bottomY}}function sr(e,t,r,o,s,n){let i=e.name??e.key??"step",c=tt(e.state),l=[],u=`${c} ${i}`;s.showKeys&&e.key&&e.name&&(u+=` [${e.key}]`);let d=Math.min(o-j*2,40);if(l.push(..._e(u,d)),s.showTimings&&e.durationMs!==void 0&&l.push(`[${H(e.durationMs)}]`),e.retryCount&&e.retryCount>0&&l.push(`${e.retryCount}x retry`),e.timedOut&&l.push("timeout"),n?.showSparklines&&n.timingHistory){let D=n.timingHistory.get(e.key??"")??n.timingHistory.get(e.name??"")??n.timingHistory.get(e.id);D&&D.length>1&&l.push(ve(D,8))}let g=Math.max(...l.map(D=>Y(D).length)),m=Math.max(G,g+j*2),f=l.length+2,k=t-Math.floor(m/2),b;if(n?.showHeatmap&&n.heatmapData){let D=e.key??e.name??e.id;b=n.heatmapData.heat.get(e.id)??n.heatmapData.heat.get(D)}let E={id:e.id,type:"step",label:l,state:e.state,x:k,y:r,width:m,height:f,centerX:t,bottomY:r+f-1,metadata:b!==void 0?{heat:b}:void 0};return{node:E,bottomY:E.bottomY}}function ir(e,t,r,o,s,n){let i=`stream:${e.namespace}`,c=e.streamState==="active"?"\u27F3":e.streamState==="closed"?"\u2713":"\u2717",l=[],u=`${c} ${i}`,d=Math.min(o-j*2,40);l.push(..._e(u,d)),l.push(`W:${e.writeCount} R:${e.readCount}`),s.showTimings&&e.durationMs!==void 0&&l.push(`[${H(e.durationMs)}]`),e.backpressureOccurred&&l.push("backpressure");let g=Math.max(...l.map(E=>Y(E).length)),m=Math.max(G,g+j*2),f=l.length+2,k=t-Math.floor(m/2),b={id:e.id,type:"stream",label:l,state:e.state,x:k,y:r,width:m,height:f,centerX:t,bottomY:r+f-1,metadata:{streamState:e.streamState,backpressureOccurred:e.backpressureOccurred}};return{node:b,bottomY:b.bottomY}}function ar(e,t,r,o,s,n){let i=F(e),c=e.name??(i?"race":"parallel"),u=`${i?"\u26A1":"\u2AD8"} ${c}`;if(e.children.length===0){let v=[u,"(not tracked)"],O=Re(e.id,i?"race":"parallel",v,e.state,t,r);return{node:O,bottomY:O.bottomY}}let d=Math.floor((o-xe*(e.children.length-1))/e.children.length),g=[];for(let v of e.children){let O=We(v,Math.max(d,G),s,n);g.push(O.width)}let m=g.reduce((v,O)=>v+O,0)+xe*(e.children.length-1),f=m>o&&e.children.length>1,k=Math.max(G,u.length+j*2),b=3,E=t-Math.floor(k/2),D=r;D+=b,D+=1,D+=1;let S=[];if(f)for(let v=0;v<e.children.length;v++){let O=e.children[v],L=$e(O,t,D,o,s,n);i&&F(e)&&e.winnerId===O.id&&(L.node.metadata={...L.node.metadata,isWinner:!0}),S.push(L.node),D=L.bottomY+oe}else{let v=t-Math.floor(m/2);for(let O=0;O<e.children.length;O++){let L=e.children[O],$=v+Math.floor(g[O]/2),P=$e(L,$,D,g[O],s,n);i&&F(e)&&e.winnerId===L.id&&(P.node.metadata={...P.node.metadata,isWinner:!0}),S.push(P.node),v+=g[O]+xe}}let y=Math.max(...S.map(v=>v.bottomY)),I=!f&&S.length>1?y+2:y;return{node:{id:e.id,type:i?"race":"parallel",label:[u],state:e.state,x:E,y:r,width:k,height:b,centerX:t,bottomY:I,children:S,metadata:{verticalLayout:f}},bottomY:I}}function cr(e,t,r,o,s,n){let i=e.name??"decision",c=e.condition?` (${e.condition.slice(0,20)})`:"",l=`\u25C7 ${i}${c}`,u=Math.min(o-j*2,40),d=_e(l,u),g=Math.max(...d.map(I=>Y(I).length)),m=Math.max(G,g+j*2),f=d.length+2,k=t-Math.floor(m/2),b=e.branches.find(I=>I.taken),E=b&&b.children.length>0?b:e.branches.find(I=>I.children.length>0);if(!E||E.children.length===0){let I={id:e.id,type:"decision",label:d,state:e.state,x:k,y:r,width:m,height:f,centerX:t,bottomY:r+f-1};return{node:I,bottomY:I.bottomY}}let D=r+f+oe,S=[];for(let I of E.children){let R=$e(I,t,D,o,s,n);S.push(R.node),D=R.bottomY+oe}let y=S.length>0?S[S.length-1].bottomY:r+f-1;return{node:{id:e.id,type:"decision",label:d,state:e.state,x:k,y:r,width:m,height:f,centerX:t,bottomY:y,children:S},bottomY:y}}function We(e,t,r,o){if(K(e)){let s=e.name??e.key??"step",n=tt(e.state),i=1;r.showTimings&&e.durationMs!==void 0&&i++,e.retryCount&&e.retryCount>0&&i++,e.timedOut&&i++,o?.showSparklines&&(o.timingHistory?.has(e.key??"")||o.timingHistory?.has(e.name??"")||o.timingHistory?.has(e.id))&&i++;let c=`${n} ${s}`;r.showKeys&&e.key&&e.name&&(c+=` [${e.key}]`);let l=Math.min(t,Math.max(G,c.length+j*2)),u=i+2;return{width:l,height:u}}if(X(e)||F(e)){if(e.children.length===0)return{width:G+4,height:4};let s=Math.floor(t/e.children.length),n=0,i=0;for(let c of e.children){let l=We(c,s,r,o);n+=l.width,i=Math.max(i,l.height)}return n+=xe*(e.children.length-1),{width:Math.max(n,G),height:5+i+2}}if(J(e)){let s=e.branches.find(i=>i.taken),n=0;if(s)for(let i of s.children){let c=We(i,t,r,o);n+=c.height+oe}return{width:Math.min(t,30),height:3+n}}if(Z(e)){let s=`stream:${e.namespace}`,n=2;r.showTimings&&e.durationMs!==void 0&&n++,e.backpressureOccurred&&n++;let i=Math.min(t,Math.max(G,s.length+j*2+4)),c=n+2;return{width:i,height:c}}return{width:G,height:3}}function ur(e,t,r){let o={...Q,...r.colors};for(let s=0;s<t.length;s++){let n=t[s],i=s===t.length-1;if(Ee(e,n,o),!i){let c=t[s+1],l=n.centerX,u=n.bottomY+1,d=c.centerX,g=c.y-1;q(e,l,u,g-1),ee(e,d,g)}}}function Ee(e,t,r){let o=t.type!=="start",s=t.type!=="end"&&(!t.children||t.children.length===0);rr(e,t.x,t.y,t.width,t.height),o&&_(e,t.centerX,t.y,W.teeUp),(s||t.children&&t.children.length>0)&&_(e,t.centerX,t.y+t.height-1,W.teeDown);let n=t.width-j*2,i=fr(t,r);for(let c=0;c<t.label.length;c++){let l=t.label[c],u=t.x+1+Math.floor((n-Y(l).length)/2),d=t.y+1+c;Ze(e,u,d,l,i)}t.metadata?.isWinner&&Ze(e,t.x+t.width-2,t.y,"\u{1F3C6}"),t.children&&t.children.length>0&&(t.type==="parallel"||t.type==="race"?lr(e,t,r):dr(e,t,r))}function lr(e,t,r){let o=t.children;if(o.length===0)return;let s=t.y+t.height,n=t.centerX;if(t.metadata?.verticalLayout===!0){let c=o[0];q(e,n,s,c.y-2),ee(e,c.centerX,c.y-1);for(let l=0;l<o.length;l++){let u=o[l];if(Ee(e,u,r),l<o.length-1){let d=o[l+1];q(e,u.centerX,u.bottomY+1,d.y-2),ee(e,d.centerX,d.y-1)}}return}if(o.length===1)q(e,n,s,o[0].y-2),ee(e,o[0].centerX,o[0].y-1);else{let c=o.map(d=>d.centerX),l=Math.min(...c),u=Math.max(...c);q(e,n,s,s+1),Qe(e,s+1,l,u),_(e,n,s+1,W.teeUp);for(let d of o){let g=d.centerX;g===l?_(e,g,s+1,W.topLeft):g===u?_(e,g,s+1,W.topRight):g!==n&&_(e,g,s+1,W.teeDown),q(e,g,s+2,d.y-2),ee(e,g,d.y-1)}}for(let c of o)Ee(e,c,r);if(o.length>1){let c=o.map(f=>f.bottomY),l=Math.max(...c),u=l+1,d=o.map(f=>f.centerX),g=Math.min(...d),m=Math.max(...d);for(let f of o)f.bottomY<l&&q(e,f.centerX,f.bottomY+1,u-1);Qe(e,u,g,m);for(let f of o){let k=f.centerX;k===g?_(e,k,u,W.bottomLeft):k===m?_(e,k,u,W.bottomRight):_(e,k,u,W.teeUp)}_(e,t.centerX,u,W.teeDown),_(e,t.centerX,u+1,W.vertical)}}function dr(e,t,r){let o=t.children;if(o.length===0)return;let s=t.y+t.height,n=o[0];q(e,t.centerX,s,n.y-2),ee(e,n.centerX,n.y-1);for(let i=0;i<o.length;i++){let c=o[i];if(Ee(e,c,r),i<o.length-1){let l=o[i+1];q(e,c.centerX,c.bottomY+1,l.y-2),ee(e,l.centerX,l.y-1)}}}var pr={active:"\x1B[36m",closed:"\x1B[32m",error:"\x1B[31m"};function fr(e,t){if(e.metadata?.heat!==void 0){let r=ke(e.metadata.heat);return Qt[r]||void 0}return e.type==="stream"&&e.metadata?.streamState?pr[e.metadata.streamState]||void 0:t[e.state]||void 0}function ue(){return{name:"flowchart",supportsLive:!1,render(e,t){let r=t.terminalWidth??80,{nodes:o,totalHeight:s}=or(e,t,r),n=tr(r,s);return ur(n,o,t),nr(n)}}}function mr(e){return e.replace(/\x1b\[[0-9;]*m/g,"")}function gr(e){let t=[];function r(o){for(let s of o)if(K(s))t.push(s);else if(Be(s))r(s.children);else if(X(s)||F(s))r(s.children);else if(J(s))for(let n of s.branches)n.taken&&r(n.children)}return r(e),t}function hr(e){let t={id:e.id,name:e.name??e.key??e.id,state:e.state};return e.key&&(t.key=e.key),e.durationMs!==void 0&&(t.durationMs=e.durationMs),e.startTs!==void 0&&(t.startTs=e.startTs),e.endTs!==void 0&&(t.endTs=e.endTs),e.retryCount!==void 0&&e.retryCount>0&&(t.retryCount=e.retryCount),e.timedOut&&(t.timedOut=!0,e.timeoutMs!==void 0&&(t.timeoutMs=e.timeoutMs)),e.error!==void 0&&(t.error=typeof e.error=="string"?e.error:String(e.error)),t}function kr(e){let t=0,r=0,o=0,s=0,n=0,i;for(let c of e)c.state==="success"&&t++,c.state==="error"&&r++,c.state==="cached"&&o++,c.state==="skipped"&&s++,c.retryCount!==void 0&&(n+=c.retryCount),c.durationMs!==void 0&&(!i||c.durationMs>i.durationMs)&&(i={name:c.name??c.key??c.id,durationMs:c.durationMs});return{totalSteps:e.length,successCount:t,errorCount:r,cacheHits:o,skippedCount:s,totalRetries:n,slowestStep:i}}function wr(e){let t={};if(e.shouldRun&&(t.shouldRun={result:e.shouldRun.context?.result,durationMs:e.shouldRun.durationMs},e.shouldRun.error!==void 0&&e.shouldRun.error!==null&&(t.shouldRun.error=String(e.shouldRun.error))),e.onBeforeStart&&(t.onBeforeStart={durationMs:e.onBeforeStart.durationMs},e.onBeforeStart.error!==void 0&&e.onBeforeStart.error!==null&&(t.onBeforeStart.error=String(e.onBeforeStart.error))),e.onAfterStep.size>0){t.onAfterStep=[];for(let[r,o]of e.onAfterStep){let s={stepKey:r};o.durationMs!==void 0&&(s.durationMs=o.durationMs),o.error!==void 0&&o.error!==null&&(s.error=String(o.error)),t.onAfterStep.push(s)}}return t}function br(e,t){let r=e.root,o=gr(r.children),s=t.includeDiagram??!0,n=t.stripAnsiColors??!0,i={workflow:{id:r.workflowId,name:r.name,state:r.state,durationMs:r.durationMs,startedAt:r.startTs,completedAt:r.endTs},steps:o.map(hr),summary:kr(o)};if(e.hooks){let c=wr(e.hooks);Object.keys(c).length>0&&(i.hooks=c)}if(s){let u=((t.diagramFormat??"ascii")==="flowchart"?ue():ce()).render(e,t);n&&(u=mr(u)),i.diagram=u}return i}function Le(){return{name:"logger",supportsLive:!1,render(e,t){let o=br(e,t);return JSON.stringify(o)}}}var V=require("awaitly");var rt=St(require("pako"),1),yr=typeof globalThis<"u"&&"Buffer"in globalThis&&typeof globalThis.Buffer=="function";function Sr(e){let t;if(yr)t=globalThis.Buffer.from(e).toString("base64");else{let r="";for(let o=0;o<e.length;o++)r+=String.fromCharCode(e[o]);t=btoa(r)}return t.replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function Me(e){let r=new TextEncoder().encode(e),o=rt.default.deflate(r);return Sr(o)}var xr="https://kroki.io";function nt(e,t,r,o={}){let s=o.baseUrl??xr,n=Me(r);return`${s}/${e}/${t}/${n}`}var Rr="https://mermaid.ink";function $r(e){return`pako:${Me(e)}`}function Er(e){if("provider"in e){let t=e;return{theme:t.mermaidTheme,bgColor:t.background,scale:t.scale,fit:t.fit,width:t.width,height:t.height,paper:t.paper,imageType:"png"}}return e}function Mr(e,t){let r=[];return t.bgColor&&r.push(`bgColor=${encodeURIComponent(t.bgColor)}`),t.theme&&r.push(`theme=${t.theme}`),t.width!==void 0&&r.push(`width=${t.width}`),t.height!==void 0&&r.push(`height=${t.height}`),t.scale!==void 0&&(t.width!==void 0||t.height!==void 0)&&r.push(`scale=${t.scale}`),e==="img"&&t.imageType&&t.imageType!=="jpeg"&&r.push(`type=${t.imageType}`),e==="pdf"&&(t.fit&&r.push("fit"),t.paper&&!t.fit&&r.push(`paper=${t.paper}`),t.landscape&&!t.fit&&r.push("landscape")),r.length>0?`?${r.join("&")}`:""}function ot(e,t,r={}){let o=Er(r),s=o.baseUrl??Rr,n=$r(t),i=Mr(e,o);return`${s}/${e}/${n}${i}`}function Ir(e,t,r){return e==="mermaid-ink"&&t==="mermaid"?(0,V.ok)(void 0):e==="kroki"&&t==="mermaid"?r==="pdf"?(0,V.err)("UNSUPPORTED_FORMAT"):(0,V.ok)(void 0):(0,V.err)("UNSUPPORTED_FORMAT")}function Dr(e){switch(e){case"mermaid":return"mermaid";case"graphviz":return"graphviz";case"plantuml":return"plantuml"}}function Nr(e){switch(e){case"svg":return"svg";case"png":return"img";case"pdf":return"pdf"}}function Ie(e,t,r,o={}){switch(e.kind){case"mermaid":break;case"graphviz":case"plantuml":return(0,V.err)("UNSUPPORTED_DIAGRAM_KIND");default:{let n=e;return(0,V.err)("UNSUPPORTED_DIAGRAM_KIND")}}let s=Ir(r.provider,e.kind,t);if(!s.ok)return s;switch(r.provider){case"kroki":return(0,V.ok)(nt(Dr(e.kind),t,e.source,r));case"mermaid-ink":return(0,V.ok)(ot(Nr(t),e.source,r));default:{let n=r;return(0,V.err)("UNKNOWN_PROVIDER")}}}function st(e={}){let{workflowName:t,detectParallel:r=!0,showTimings:o=!0,showKeys:s=!1,colors:n,export:i}=e,c=Fe({detectParallel:r}),l=new Set,u=ce(),d=Ce(),g=Le(),m=ue(),f={showTimings:o,showKeys:s,terminalWidth:process.stdout?.columns??80,colors:{...Q,...n}};function k(){if(l.size>0){let x=S();for(let M of l)M(x)}}function b(x){if(x.type==="scope_start"||x.type==="scope_end"){E(x);return}c.handleEvent(x),x.type,k()}function E(x){c.handleScopeEvent(x),k()}function D(x){c.handleDecisionEvent(x),k()}function S(){let x=c.getIR();return t&&!x.root.name&&(x.root.name=t),x}function y(){let x=S();return u.render(x,f)}function C(x){let M=S();switch(x){case"ascii":return u.render(M,f);case"mermaid":return d.render(M,f);case"json":{let le=M.hooks?{...M,hooks:{...M.hooks,onAfterStep:M.hooks.onAfterStep instanceof Map?Object.fromEntries(M.hooks.onAfterStep):M.hooks.onAfterStep??{}}}:M;return JSON.stringify(le,(Ue,se)=>typeof se=="bigint"?se.toString():se,2)}case"logger":return g.render(M,f);case"flowchart":return m.render(M,f);default:throw new Error(`Unknown format: ${x}`)}}function I(){c.reset(),k()}function R(x){return l.add(x),()=>l.delete(x)}function v(x,M){if(x)return x;if(i?.default)return i.default;throw new Error(`${M}(): No export provider configured. Pass { provider: 'kroki' } or { provider: 'mermaid-ink' }, or set export.default in createVisualizer().`)}function O(){let x=S();return{kind:"mermaid",source:d.render(x,f)}}function L(x){let M=Ie(O(),"svg",v(x,"toSvgUrl"),{caller:"toSvgUrl"});if(!M.ok)throw new Error(`toSvgUrl: Export failed - ${M.error}`);return M.value}function $(x){let M=Ie(O(),"png",v(x,"toPngUrl"),{caller:"toPngUrl"});if(!M.ok)throw new Error(`toPngUrl: Export failed - ${M.error}`);return M.value}function P(x){let M=Ie(O(),"pdf",v(x,"toPdfUrl"),{caller:"toPdfUrl"});if(!M.ok)throw new Error(`toPdfUrl: Export failed - ${M.error}`);return M.value}function te(x,M){switch(x){case"svg":return L(M);case"png":return $(M);case"pdf":return P(M);default:return x}}return{handleEvent:b,handleScopeEvent:E,handleDecisionEvent:D,getIR:S,render:y,renderAs:C,reset:I,onUpdate:R,toUrl:te,toSvgUrl:L,toPngUrl:$,toPdfUrl:P}}function Pe(e={}){let{logEvents:t=!1,maxHistory:r=10,logger:o=console.log}=e,s=st(e),n=[],i,c=0;function l($){if(i)for(n.push(i);n.length>r;)n.shift();c=Date.now(),i={id:$,name:e.workflowName,startTime:c,events:[]},s.reset()}function u($,P){i&&(i.endTime=Date.now(),i.durationMs=i.endTime-i.startTime,i.success=$,i.error=P)}function d($){t&&o(`[devtools] ${$.type}: ${JSON.stringify($)}`),$.type==="workflow_start"&&l($.workflowId),i&&i.events.push($),s.handleEvent($),$.type==="workflow_success"?u(!0):$.type==="workflow_error"&&u(!1,$.error)}function g($){t&&o(`[devtools] ${$.type}: ${JSON.stringify($)}`),i&&i.events.push($),s.handleDecisionEvent($)}function m(){return i}function f(){return[...n]}function k($){return i?.id===$?i:n.find(P=>P.id===$)}function b($,P){let te=k($),x=k(P);if(!(!te||!x))return it(te,x)}function E(){if(!i||n.length===0)return;let $=n[n.length-1];return it($,i)}function D(){return s.render()}function S($){return s.renderAs($)}function y(){return s.renderAs("mermaid")}function C(){let $=I();return vr($)}function I(){return i?Or(i.events,c):[]}function R(){n.length=0}function v(){i=void 0,s.reset()}function O($){let P=$?k($):i;return P?JSON.stringify(P,null,2):"{}"}function L($){let P=JSON.parse($);return n.push(P),P}return{handleEvent:d,handleDecisionEvent:g,getCurrentRun:m,getHistory:f,getRun:k,diff:b,diffWithPrevious:E,render:D,renderAs:S,renderMermaid:y,renderTimeline:C,getTimeline:I,clearHistory:R,reset:v,exportRun:O,importRun:L}}function it(e,t){let r=at(e.events),o=at(t.events),s=[],n=[],i=[],c=[];for(let[m,f]of o){let k=r.get(m);k?k.status!==f.status?i.push({step:m,type:"status",from:k.status,to:f.status}):k.durationMs!==f.durationMs?i.push({step:m,type:"duration",from:k.durationMs,to:f.durationMs}):c.push(m):s.push({step:m,type:"added",to:f.status})}for(let[m]of r)o.has(m)||n.push({step:m,type:"removed",from:r.get(m)?.status});let l,u=e.success===void 0?"running":e.success?"success":"error",d=t.success===void 0?"running":t.success?"success":"error";u!==d&&(l={from:u,to:d});let g;return e.durationMs!==void 0&&t.durationMs!==void 0&&(g=t.durationMs-e.durationMs),{added:s,removed:n,changed:i,unchanged:c,statusChange:l,durationChange:g}}function at(e){let t=new Map;for(let r of e)if(r.type==="step_start"){let o=r,s=o.name||o.stepKey||o.stepId;t.set(s,{name:s,key:o.stepKey,status:"running"})}else if(r.type==="step_success"){let o=r,s=o.name||o.stepKey||o.stepId,n=t.get(s);n&&(n.status="success",n.durationMs=o.durationMs)}else if(r.type==="step_error"){let o=r,s=o.name||o.stepKey||o.stepId,n=t.get(s);n&&(n.status="error",n.durationMs=o.durationMs,n.error=o.error)}else if(r.type==="step_cache_hit"){let o=r,s=o.name||o.stepKey;t.set(s,{name:s,key:o.stepKey,status:"cached"})}else if(r.type==="step_skipped"){let o=r,s=o.name||o.stepKey||"unknown";t.set(s,{name:s,key:o.stepKey,status:"skipped"})}return t}function Or(e,t){let r=[],o=new Map;for(let s of e)if(s.type==="step_start"){let n=s,i=n.name||n.stepKey||n.stepId;o.set(i,n.ts),r.push({name:i,key:n.stepKey,startMs:n.ts-t,status:"running"})}else if(s.type==="step_success"){let n=s,i=n.name||n.stepKey||n.stepId,c=r.find(l=>l.name===i&&l.status==="running");c&&(c.endMs=n.ts-t,c.durationMs=n.durationMs,c.status="success")}else if(s.type==="step_error"){let n=s,i=n.name||n.stepKey||n.stepId,c=r.find(l=>l.name===i&&l.status==="running");c&&(c.endMs=n.ts-t,c.durationMs=n.durationMs,c.status="error",c.error=n.error)}else if(s.type==="step_cache_hit"){let n=s,i=n.name||n.stepKey;r.push({name:i,key:n.stepKey,startMs:n.ts-t,endMs:n.ts-t,durationMs:0,status:"cached"})}else if(s.type==="step_skipped"){let n=s,i=n.name||n.stepKey||"unknown";r.push({name:i,key:n.stepKey,startMs:n.ts-t,endMs:n.ts-t,durationMs:0,status:"skipped"})}return r}function vr(e){if(e.length===0)return"No timeline data";let t=[];t.push("Timeline:"),t.push("\u2500".repeat(60));let r=Math.max(...e.map(s=>s.endMs??s.startMs+100)),o=40;for(let s of e){let n=Math.floor(s.startMs/r*o),i=Math.floor((s.endMs??s.startMs+10)/r*o),c=Math.max(1,i-n),l=Tr(s.status),u=" ".repeat(n)+l.repeat(c),d=s.durationMs!==void 0?`${s.durationMs}ms`:"?";t.push(`${s.name.padEnd(20)} |${u.padEnd(o)}| ${d}`)}return t.push("\u2500".repeat(60)),t.join(`
5
+ `)}function Tr(e){switch(e){case"success":return"\u2588";case"error":return"\u2591";case"running":return"\u2592";case"cached":return"\u2593";case"skipped":return"\xB7";default:return"?"}}function ct(e){let t=[];if(e.statusChange&&t.push(`Status: ${e.statusChange.from} \u2192 ${e.statusChange.to}`),e.durationChange!==void 0){let r=e.durationChange>=0?"+":"";t.push(`Duration: ${r}${e.durationChange}ms`)}if(e.added.length>0){t.push(`
6
+ Added steps:`);for(let r of e.added)t.push(` + ${r.step}`)}if(e.removed.length>0){t.push(`
7
+ Removed steps:`);for(let r of e.removed)t.push(` - ${r.step}`)}if(e.changed.length>0){t.push(`
8
+ Changed steps:`);for(let r of e.changed)t.push(` ~ ${r.step}: ${r.from} \u2192 ${r.to}`)}return e.unchanged.length>0&&t.push(`
9
+ Unchanged: ${e.unchanged.length} steps`),t.join(`
10
+ `)}function ut(e,t={}){let r=Pe(t);return e(r.handleEvent).then(()=>r.render())}function lt(e={}){let{prefix:t="[workflow]",colors:r=!0}=e,o=r?{reset:"\x1B[0m",dim:"\x1B[2m",green:"\x1B[32m",red:"\x1B[31m",yellow:"\x1B[33m",blue:"\x1B[34m",cyan:"\x1B[36m"}:{reset:"",dim:"",green:"",red:"",yellow:"",blue:"",cyan:""};return s=>{let n=new Date().toISOString().slice(11,23),i="";switch(s.type){case"workflow_start":i=`${o.blue}\u23F5 Workflow started${o.reset}`;break;case"workflow_success":i=`${o.green}\u2713 Workflow completed${o.reset} ${o.dim}(${s.durationMs}ms)${o.reset}`;break;case"workflow_error":i=`${o.red}\u2717 Workflow failed${o.reset}`;break;case"step_start":i=`${o.cyan}\u2192 ${s.name||s.stepKey||s.stepId}${o.reset}`;break;case"step_success":i=`${o.green}\u2713 ${s.name||s.stepKey||s.stepId}${o.reset} ${o.dim}(${s.durationMs}ms)${o.reset}`;break;case"step_error":i=`${o.red}\u2717 ${s.name||s.stepKey||s.stepId}${o.reset}`;break;case"step_cache_hit":i=`${o.yellow}\u26A1 ${s.name||s.stepKey} (cached)${o.reset}`;break;case"step_retry":i=`${o.yellow}\u21BB ${s.name||s.stepKey||s.stepId} retry ${s.attempt}/${s.maxAttempts}${o.reset}`;break;default:i=`${o.dim}${s.type}${o.reset}`}console.log(`${o.dim}${n}${o.reset} ${t} ${i}`)}}0&&(module.exports={createConsoleLogger,createDevtools,quickVisualize,renderDiff});
11
+ //# sourceMappingURL=devtools.cjs.map