@bratsos/workflow-engine-console 1.0.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +464 -0
- package/dist/actions-DOP8plrl.d.ts +52 -0
- package/dist/chunk-4RL6UAMS.js +486 -0
- package/dist/chunk-4RL6UAMS.js.map +1 -0
- package/dist/chunk-HUHLRNNM.js +517 -0
- package/dist/chunk-HUHLRNNM.js.map +1 -0
- package/dist/chunk-RCVZ3AP4.js +62 -0
- package/dist/chunk-RCVZ3AP4.js.map +1 -0
- package/dist/chunk-THOZTVDT.js +85 -0
- package/dist/chunk-THOZTVDT.js.map +1 -0
- package/dist/cli.d.ts +33 -0
- package/dist/cli.js +230 -0
- package/dist/cli.js.map +1 -0
- package/dist/handler-Cq2cVh7p.d.ts +47 -0
- package/dist/index.d.ts +96 -0
- package/dist/index.js +31 -0
- package/dist/index.js.map +1 -0
- package/dist/node.d.ts +15 -0
- package/dist/node.js +3 -0
- package/dist/node.js.map +1 -0
- package/dist/prisma-read-port-GPAHJEVC.js +4 -0
- package/dist/prisma-read-port-GPAHJEVC.js.map +1 -0
- package/dist/read-port-CRmaGAKb.d.ts +257 -0
- package/dist/testing.d.ts +50 -0
- package/dist/testing.js +346 -0
- package/dist/testing.js.map +1 -0
- package/package.json +64 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/generated/ui-bundle.ts","../src/ui-assets.ts","../src/handler.ts"],"names":[],"mappings":";;;AACO,IAAM,UAAA,GAAa,mBAAA;AACnB,IAAM,WAAA,GAAc,oBAAA;AACpB,IAAM,KAAA,GAAQ,io0CAAA;AACd,IAAM,MAAA,GAAS,0wcAAA;;;ACQf,IAAM,SAAA,GAAqC;AAAA,EAChD,CAAC,UAAU,GAAG;AAAA,IACZ,IAAA,EAAM,KAAA;AAAA,IACN,WAAA,EAAa;AAAA,GACf;AAAA,EACA,CAAC,WAAW,GAAG,EAAE,IAAA,EAAM,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C1D;AACA,MAAA,IAAI,iBAAiB,sBAAA,EAAwB;AAC3C,QAAA,OAAO,aAAA,CAAc,aAAA,EAAe,KAAA,CAAM,OAAA,EAAS,GAAG,CAAA;AAAA,MACxD;AACA,MAAA,OAAO,aAAA;AAAA,QACL,gBAAA;AAAA,QACA,KAAA,YAAiB,KAAA,GAAQ,KAAA,CAAM,OAAA,GAAU,2BAAA;AAAA,QACzC;AAAA,OACF;AAAA,IACF;AAAA,EACF,CAAA;AACF","file":"chunk-4RL6UAMS.js","sourcesContent":["// GENERATED by scripts/build-ui.mjs — do not edit, do not commit.\nexport const UI_JS_NAME = \"app.9b10515336.js\";\nexport const UI_CSS_NAME = \"app.acfa97929e.css\";\nexport const UI_JS = \"\\\"use strict\\\";(()=>{var ie,k,De,at,V,Ce,Re,xe,_e,ne,K,Pe,he,pe,fe,lt,oe={},ae=[],it=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ue=Array.isArray;function F(t,n){for(var r in n)t[r]=n[r];return t}function me(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function ut(t,n,r){var o,l,a,i={};for(a in n)a==\\\"key\\\"?o=n[a]:a==\\\"ref\\\"?l=n[a]:i[a]=n[a];if(arguments.length>2&&(i.children=arguments.length>3?ie.call(arguments,2):r),typeof t==\\\"function\\\"&&t.defaultProps!=null)for(a in t.defaultProps)i[a]===void 0&&(i[a]=t.defaultProps[a]);return re(t,i,o,l,null)}function re(t,n,r,o,l){var a={type:t,props:n,key:r,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:l??++De,__i:-1,__u:0};return l==null&&k.vnode!=null&&k.vnode(a),a}function P(t){return t.children}function se(t,n){this.props=t,this.context=n}function B(t,n){if(n==null)return t.__?B(t.__,t.__i+1):null;for(var r;n<t.__k.length;n++)if((r=t.__k[n])!=null&&r.__e!=null)return r.__e;return typeof t.type==\\\"function\\\"?B(t):null}function ct(t){if(t.__P&&t.__d){var n=t.__v,r=n.__e,o=[],l=[],a=F({},n);a.__v=n.__v+1,k.vnode&&k.vnode(a),ve(t.__P,a,n,t.__n,t.__P.namespaceURI,32&n.__u?[r]:null,o,r??B(n),!!(32&n.__u),l),a.__v=n.__v,a.__.__k[a.__i]=a,qe(o,a,l),n.__e=n.__=null,a.__e!=r&&$e(a)}}function $e(t){if((t=t.__)!=null&&t.__c!=null)return t.__e=t.__c.base=null,t.__k.some(function(n){if(n!=null&&n.__e!=null)return t.__e=t.__c.base=n.__e}),$e(t)}function Ee(t){(!t.__d&&(t.__d=!0)&&V.push(t)&&!le.__r++||Ce!=k.debounceRendering)&&((Ce=k.debounceRendering)||Re)(le)}function le(){try{for(var t,n=1;V.length;)V.length>n&&V.sort(xe),t=V.shift(),n=V.length,ct(t)}finally{V.length=le.__r=0}}function Te(t,n,r,o,l,a,i,c,_,u,p){var f,s,h,v,y,b,w=o&&o.__k||ae,g=n.length;for(_=dt(r,n,w,_,g),f=0;f<g;f++)(h=r.__k[f])!=null&&(s=h.__i!=-1&&w[h.__i]||oe,h.__i=f,b=ve(t,h,s,l,a,i,c,_,u,p),v=h.__e,h.ref&&s.ref!=h.ref&&(s.ref&&ge(s.ref,null,h),p.push(h.ref,h.__c||v,h)),y==null&&v!=null&&(y=v),4&h.__u?(_=Le(h,_,t),s.__e&&(s.__e=null)):typeof h.type==\\\"function\\\"&&b!==void 0?_=b:v&&(_=v.nextSibling),h.__u&=-7);return r.__e=y,_}function dt(t,n,r,o,l){var a,i,c,_,u,p=r.length,f=p,s=0;for(t.__k=new Array(l),a=0;a<l;a++)(i=n[a])!=null&&typeof i!=\\\"boolean\\\"&&typeof i!=\\\"function\\\"?(typeof i==\\\"string\\\"||typeof i==\\\"number\\\"||typeof i==\\\"bigint\\\"||i.constructor==String?i=t.__k[a]=re(null,i,null,null,null):ue(i)?i=t.__k[a]=re(P,{children:i},null,null,null):i.constructor===void 0&&i.__b>0?i=t.__k[a]=re(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):t.__k[a]=i,_=a+s,i.__=t,i.__b=t.__b+1,c=null,(u=i.__i=_t(i,r,_,f))!=-1&&(f--,(c=r[u])&&(c.__u|=2)),c==null||c.__v==null?(u==-1&&(l>p?s--:l<p&&s++),typeof i.type!=\\\"function\\\"&&(i.__u|=4)):u!=_&&(u==_-1?s--:u==_+1?s++:(u>_?s--:s++,i.__u|=4))):t.__k[a]=null;if(f)for(a=0;a<p;a++)(c=r[a])!=null&&(2&c.__u)==0&&(c.__e==o&&(o=B(c)),He(c,c));return o}function Le(t,n,r){var o,l;if(typeof t.type==\\\"function\\\"){for(o=t.__k,l=0;o&&l<o.length;l++)o[l]&&(o[l].__=t,n=Le(o[l],n,r));return n}t.__e!=n&&(n&&t.type&&!n.parentNode&&(n=B(t)),n=r.insertBefore(t.__e,n||null));do n=n&&n.nextSibling;while(n!=null&&n.nodeType==8);return n}function _t(t,n,r,o){var l,a,i,c=t.key,_=t.type,u=n[r],p=u!=null&&(2&u.__u)==0;if(u===null&&c==null||p&&c==u.key&&_==u.type)return r;if(o>(p?1:0)){for(l=r-1,a=r+1;l>=0||a<n.length;)if((u=n[i=l>=0?l--:a++])!=null&&(2&u.__u)==0&&c==u.key&&_==u.type)return i}return-1}function Ne(t,n,r){n[0]==\\\"-\\\"?t.setProperty(n,r??\\\"\\\"):t[n]=r==null?\\\"\\\":typeof r!=\\\"number\\\"||it.test(n)?r:r+\\\"px\\\"}function te(t,n,r,o,l){var a,i;e:if(n==\\\"style\\\")if(typeof r==\\\"string\\\")t.style.cssText=r;else{if(typeof o==\\\"string\\\"&&(t.style.cssText=o=\\\"\\\"),o)for(n in o)r&&n in r||Ne(t.style,n,\\\"\\\");if(r)for(n in r)o&&r[n]==o[n]||Ne(t.style,n,r[n])}else if(n[0]==\\\"o\\\"&&n[1]==\\\"n\\\")a=n!=(n=n.replace(Pe,\\\"$1\\\")),i=n.toLowerCase(),n=i in t||n==\\\"onFocusOut\\\"||n==\\\"onFocusIn\\\"?i.slice(2):n.slice(2),t.l||(t.l={}),t.l[n+a]=r,r?o?r[K]=o[K]:(r[K]=he,t.addEventListener(n,a?fe:pe,a)):t.removeEventListener(n,a?fe:pe,a);else{if(l==\\\"http://www.w3.org/2000/svg\\\")n=n.replace(/xlink(H|:h)/,\\\"h\\\").replace(/sName$/,\\\"s\\\");else if(n!=\\\"width\\\"&&n!=\\\"height\\\"&&n!=\\\"href\\\"&&n!=\\\"list\\\"&&n!=\\\"form\\\"&&n!=\\\"tabIndex\\\"&&n!=\\\"download\\\"&&n!=\\\"rowSpan\\\"&&n!=\\\"colSpan\\\"&&n!=\\\"role\\\"&&n!=\\\"popover\\\"&&n in t)try{t[n]=r??\\\"\\\";break e}catch{}typeof r==\\\"function\\\"||(r==null||r===!1&&n[4]!=\\\"-\\\"?t.removeAttribute(n):t.setAttribute(n,n==\\\"popover\\\"&&r==1?\\\"\\\":r))}}function Ae(t){return function(n){if(this.l){var r=this.l[n.type+t];if(n[ne]==null)n[ne]=he++;else if(n[ne]<r[K])return;return r(k.event?k.event(n):n)}}}function ve(t,n,r,o,l,a,i,c,_,u){var p,f,s,h,v,y,b,w,g,C,U,T,O,L,R,H,D=n.type;if(n.constructor!==void 0)return null;128&r.__u&&(_=!!(32&r.__u),a=[c=n.__e=r.__e]),(p=k.__b)&&p(n);e:if(typeof D==\\\"function\\\"){f=i.length;try{if(g=n.props,C=D.prototype&&D.prototype.render,U=(p=D.contextType)&&o[p.__c],T=p?U?U.props.value:p.__:o,r.__c?w=(s=n.__c=r.__c).__=s.__E:(C?n.__c=s=new D(g,T):(n.__c=s=new se(g,T),s.constructor=D,s.render=ft),U&&U.sub(s),s.state||(s.state={}),s.__n=o,h=s.__d=!0,s.__h=[],s._sb=[]),C&&s.__s==null&&(s.__s=s.state),C&&D.getDerivedStateFromProps!=null&&(s.__s==s.state&&(s.__s=F({},s.__s)),F(s.__s,D.getDerivedStateFromProps(g,s.__s))),v=s.props,y=s.state,s.__v=n,h)C&&D.getDerivedStateFromProps==null&&s.componentWillMount!=null&&s.componentWillMount(),C&&s.componentDidMount!=null&&s.__h.push(s.componentDidMount);else{if(C&&D.getDerivedStateFromProps==null&&g!==v&&s.componentWillReceiveProps!=null&&s.componentWillReceiveProps(g,T),n.__v==r.__v||!s.__e&&s.shouldComponentUpdate!=null&&s.shouldComponentUpdate(g,s.__s,T)===!1){n.__v!=r.__v&&(s.props=g,s.state=s.__s,s.__d=!1),n.__e=r.__e,n.__k=r.__k,n.__k.some(function(x){x&&(x.__=n)}),ae.push.apply(s.__h,s._sb),s._sb=[],s.__h.length&&i.push(s),c=B(r);break e}s.componentWillUpdate!=null&&s.componentWillUpdate(g,s.__s,T),C&&s.componentDidUpdate!=null&&s.__h.push(function(){s.componentDidUpdate(v,y,b)})}if(s.context=T,s.props=g,s.__P=t,s.__e=!1,O=k.__r,L=0,C)s.state=s.__s,s.__d=!1,O&&O(n),p=s.render(s.props,s.state,s.context),ae.push.apply(s.__h,s._sb),s._sb=[];else do s.__d=!1,O&&O(n),p=s.render(s.props,s.state,s.context),s.state=s.__s;while(s.__d&&++L<25);s.state=s.__s,s.getChildContext!=null&&(o=F(F({},o),s.getChildContext())),C&&!h&&s.getSnapshotBeforeUpdate!=null&&(b=s.getSnapshotBeforeUpdate(v,y)),R=p!=null&&p.type===P&&p.key==null?Oe(p.props.children):p,c=Te(t,ue(R)?R:[R],n,r,o,l,a,i,c,_,u),s.base=n.__e,n.__u&=-161,s.__h.length&&i.push(s),w&&(s.__E=s.__=null)}catch(x){if(i.length=f,n.__v=null,_||a!=null){if(x.then){for(n.__u|=_?160:128;c&&c.nodeType==8&&c.nextSibling;)c=c.nextSibling;a!=null&&(a[a.indexOf(c)]=null),n.__e=c}else if(a!=null)for(H=a.length;H--;)me(a[H])}else n.__e=r.__e;n.__k==null&&(n.__k=r.__k||[]),x.then||Me(n),k.__e(x,n,r)}}else a==null&&n.__v==r.__v?(n.__k=r.__k,n.__e=r.__e):c=n.__e=pt(r.__e,n,r,o,l,a,i,_,u);return(p=k.diffed)&&p(n),128&n.__u?void 0:c}function Me(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(Me))}function qe(t,n,r){for(var o=0;o<r.length;o++)ge(r[o],r[++o],r[++o]);k.__c&&k.__c(n,t),t.some(function(l){try{t=l.__h,l.__h=[],t.some(function(a){a.call(l)})}catch(a){k.__e(a,l.__v)}})}function Oe(t){return typeof t!=\\\"object\\\"||t==null||t.__b>0?t:ue(t)?t.map(Oe):t.constructor!==void 0?null:F({},t)}function pt(t,n,r,o,l,a,i,c,_){var u,p,f,s,h,v,y,b=r.props||oe,w=n.props,g=n.type;if(g==\\\"svg\\\"?l=\\\"http://www.w3.org/2000/svg\\\":g==\\\"math\\\"?l=\\\"http://www.w3.org/1998/Math/MathML\\\":l||(l=\\\"http://www.w3.org/1999/xhtml\\\"),a!=null){for(u=0;u<a.length;u++)if((h=a[u])&&\\\"setAttribute\\\"in h==!!g&&(g?h.localName==g:h.nodeType==3)){t=h,a[u]=null;break}}if(t==null){if(g==null)return document.createTextNode(w);t=document.createElementNS(l,g,w.is&&w),c&&(k.__m&&k.__m(n,a),c=!1),a=null}if(g==null)b===w||c&&t.data==w||(t.data=w);else{if(a=g==\\\"textarea\\\"&&w.defaultValue!=null?null:a&&ie.call(t.childNodes),!c&&a!=null)for(b={},u=0;u<t.attributes.length;u++)b[(h=t.attributes[u]).name]=h.value;for(u in b)h=b[u],u==\\\"dangerouslySetInnerHTML\\\"?f=h:u==\\\"children\\\"||u in w||u==\\\"value\\\"&&\\\"defaultValue\\\"in w||u==\\\"checked\\\"&&\\\"defaultChecked\\\"in w||te(t,u,null,h,l);for(u in w)h=w[u],u==\\\"children\\\"?s=h:u==\\\"dangerouslySetInnerHTML\\\"?p=h:u==\\\"value\\\"?v=h:u==\\\"checked\\\"?y=h:c&&typeof h!=\\\"function\\\"||b[u]===h||te(t,u,h,b[u],l);if(p)c||f&&(p.__html==f.__html||p.__html==t.innerHTML)||(t.innerHTML=p.__html),n.__k=[];else if(f&&(t.innerHTML=\\\"\\\"),Te(n.type==\\\"template\\\"?t.content:t,ue(s)?s:[s],n,r,o,g==\\\"foreignObject\\\"?\\\"http://www.w3.org/1999/xhtml\\\":l,a,i,a?a[0]:r.__k&&B(r,0),c,_),a!=null)for(u=a.length;u--;)me(a[u]);c&&g!=\\\"textarea\\\"||(u=\\\"value\\\",g==\\\"progress\\\"&&v==null?t.removeAttribute(\\\"value\\\"):v!=null&&(v!==t[u]||g==\\\"progress\\\"&&!v||g==\\\"option\\\"&&v!=b[u])&&te(t,u,v,b[u],l),u=\\\"checked\\\",y!=null&&y!=t[u]&&te(t,u,y,b[u],l))}return t}function ge(t,n,r){try{if(typeof t==\\\"function\\\"){var o=typeof t.__u==\\\"function\\\";o&&t.__u(),o&&n==null||(t.__u=t(n))}else t.current=n}catch(l){k.__e(l,r)}}function He(t,n,r){var o,l;if(k.unmount&&k.unmount(t),(o=t.ref)&&(o.current&&o.current!=t.__e||ge(o,null,n)),(o=t.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(a){k.__e(a,n)}o.base=o.__P=o.__n=null}if(o=t.__k)for(l=0;l<o.length;l++)o[l]&&He(o[l],n,r||typeof t.type!=\\\"function\\\");r||me(t.__e),t.__c=t.__=t.__e=void 0}function ft(t,n,r){return this.constructor(t,r)}function Ue(t,n,r){var o,l,a,i;n==document&&(n=document.documentElement),k.__&&k.__(t,n),l=(o=typeof r==\\\"function\\\")?null:r&&r.__k||n.__k,a=[],i=[],ve(n,t=(!o&&r||n).__k=ut(P,null,[t]),l||oe,oe,n.namespaceURI,!o&&r?[r]:l?null:n.firstChild?ie.call(n.childNodes):null,a,!o&&r?r:l?l.__e:n.firstChild,o,i),qe(a,t,i),t.props.children=null}ie=ae.slice,k={__e:function(t,n,r,o){for(var l,a,i;n=n.__;)if((l=n.__c)&&!l.__)try{if((a=l.constructor)&&a.getDerivedStateFromError!=null&&(l.setState(a.getDerivedStateFromError(t)),i=l.__d),l.componentDidCatch!=null&&(l.componentDidCatch(t,o||{}),i=l.__d),i)return l.__E=l}catch(c){t=c}throw t}},De=0,at=function(t){return t!=null&&t.constructor===void 0},se.prototype.setState=function(t,n){var r;r=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=F({},this.state),typeof t==\\\"function\\\"&&(t=t(F({},r),this.props)),t&&F(r,t),t!=null&&this.__v&&(n&&this._sb.push(n),Ee(this))},se.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Ee(this))},se.prototype.render=P,V=[],Re=typeof Promise==\\\"function\\\"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,xe=function(t,n){return t.__v.__b-n.__v.__b},le.__r=0,_e=Math.random().toString(8),ne=\\\"__d\\\"+_e,K=\\\"__a\\\"+_e,Pe=/(PointerCapture)$|Capture$/i,he=0,pe=Ae(!1),fe=Ae(!0),lt=0;var G,N,be,We,z=0,Ge=[],A=k,Fe=A.__b,Ve=A.__r,je=A.diffed,Be=A.__c,Je=A.unmount,Qe=A.__;function we(t,n){A.__h&&A.__h(N,t,z||n),z=0;var r=N.__H||(N.__H={__:[],__h:[]});return t>=r.__.length&&r.__.push({}),r.__[t]}function S(t){return z=1,ht(Xe,t)}function ht(t,n,r){var o=we(G++,2);if(o.t=t,!o.__c&&(o.__=[r?r(n):Xe(void 0,n),function(c){var _=o.__N?o.__N[0]:o.__[0],u=o.t(_,c);_!==u&&(o.__N=[u,o.__[1]],o.__c.setState({}))}],o.__c=N,!N.__f)){var l=function(c,_,u){if(!o.__c.__H)return!0;var p=!1,f=o.__c.props!==c;if(o.__c.__H.__.some(function(h){if(h.__N){p=!0;var v=h.__[0];h.__=h.__N,h.__N=void 0,v!==h.__[0]&&(f=!0)}}),a){var s=a.call(this,c,_,u);return p?s||f:s}return!p||f};N.__f=!0;var a=N.shouldComponentUpdate,i=N.componentWillUpdate;N.componentWillUpdate=function(c,_,u){if(this.__e){var p=a;a=void 0,l(c,_,u),a=p}i&&i.call(this,c,_,u)},N.shouldComponentUpdate=l}return o.__N||o.__}function Y(t,n){var r=we(G++,3);!A.__s&&Ye(r.__H,n)&&(r.__=t,r.u=n,N.__H.__h.push(r))}function ze(t){return z=5,j(function(){return{current:t}},[])}function j(t,n){var r=we(G++,7);return Ye(r.__H,n)&&(r.__=t(),r.__H=n,r.__h=t),r.__}function J(t,n){return z=8,j(function(){return t},n)}function mt(){for(var t;t=Ge.shift();){var n=t.__H;if(t.__P&&n)try{n.__h.some(ce),n.__h.some(ye),n.__h=[]}catch(r){n.__h=[],A.__e(r,t.__v)}}}A.__b=function(t){N=null,Fe&&Fe(t)},A.__=function(t,n){t&&n.__k&&n.__k.__m&&(t.__m=n.__k.__m),Qe&&Qe(t,n)},A.__r=function(t){Ve&&Ve(t),G=0;var n=(N=t.__c).__H;n&&(be===N?(n.__h=[],N.__h=[],n.__.some(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(n.__h.some(ce),n.__h.some(ye),n.__h=[],G=0)),be=N},A.diffed=function(t){je&&je(t);var n=t.__c;n&&n.__H&&(n.__H.__h.length&&(Ge.push(n)!==1&&We===A.requestAnimationFrame||((We=A.requestAnimationFrame)||vt)(mt)),n.__H.__.some(function(r){r.u&&(r.__H=r.u,r.u=void 0)})),be=N=null},A.__c=function(t,n){n.some(function(r){try{r.__h.some(ce),r.__h=r.__h.filter(function(o){return!o.__||ye(o)})}catch(o){n.some(function(l){l.__h&&(l.__h=[])}),n=[],A.__e(o,r.__v)}}),Be&&Be(t,n)},A.unmount=function(t){Je&&Je(t);var n,r=t.__c;r&&r.__H&&(r.__H.__.some(function(o){try{ce(o)}catch(l){n=l}}),r.__H=void 0,n&&A.__e(n,r.__v))};var Ke=typeof requestAnimationFrame==\\\"function\\\";function vt(t){var n,r=function(){clearTimeout(o),Ke&&cancelAnimationFrame(n),setTimeout(t)},o=setTimeout(r,35);Ke&&(n=requestAnimationFrame(r))}function ce(t){var n=N,r=t.__c;typeof r==\\\"function\\\"&&(t.__c=void 0,r()),N=n}function ye(t){var n=N;t.__c=t.__(),N=n}function Ye(t,n){return!t||t.length!==n.length||n.some(function(r,o){return r!==t[o]})}function Xe(t,n){return typeof n==\\\"function\\\"?n(t):n}var gt=0;function e(t,n,r,o,l,a){n||(n={});var i,c,_=n;if(\\\"ref\\\"in _)for(c in _={},n)c==\\\"ref\\\"?i=n[c]:_[c]=n[c];var u={type:t,props:_,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--gt,__i:-1,__u:0,__source:l,__self:a};if(typeof t==\\\"function\\\"&&(i=t.defaultProps))for(c in i)_[c]===void 0&&(_[c]=i[c]);return k.vnode&&k.vnode(u),u}var ke=class extends Error{code;constructor(n,r){super(r),this.name=\\\"ApiError\\\",this.code=n}};function Q(t){if(!t)return\\\"\\\\u2014\\\";let n=Date.parse(t);if(Number.isNaN(n))return\\\"\\\\u2014\\\";let r=Date.now()-n;if(r>=0){let o=Math.floor(r/1e3);if(o<10)return\\\"just now\\\";if(o<60)return`${o}s ago`;let l=Math.floor(o/60);if(l<60)return`${l}m ago`;let a=Math.floor(l/60);return a<24?`${a}h ago`:`${Math.floor(a/24)}d ago`}else{let o=Math.floor(-r/1e3);if(o<10)return\\\"just now\\\";if(o<60)return`in ${o}s`;let l=Math.floor(o/60);if(l<60)return`in ${l}m`;let a=Math.floor(l/60);return a<24?`in ${a}h`:`in ${Math.floor(a/24)}d`}}function bt(t){if(!t)return\\\"\\\\u2014\\\";let n=Date.parse(t);if(Number.isNaN(n))return\\\"\\\\u2014\\\";let r=Date.now()-n;if(r>0){let o=Math.floor(r/1e3);if(o<60)return`overdue by ${o}s`;let l=Math.floor(o/60);if(l<60)return`overdue by ${l}m`;let a=Math.floor(l/60);return a<24?`overdue by ${a}h`:`overdue by ${Math.floor(a/24)}d`}return Q(t)}function de(t){if(t==null||Number.isNaN(t))return\\\"\\\\u2014\\\";if(t<0)return\\\"0s\\\";if(t<1e3)return`${t}ms`;if(t<1e4)return`${(t/1e3).toFixed(1)}s`;let n=Math.round(t/1e3);if(n<60)return`${n}s`;let r=Math.floor(n/60),o=n%60;if(r<60)return o>0?`${r}m ${o}s`:`${r}m`;let l=Math.floor(r/60),a=r%60;return a>0?`${l}h ${a}m`:`${l}h`}function Se(t){return typeof t!=\\\"number\\\"||Number.isNaN(t)?\\\"$0.0000\\\":`$${t.toFixed(4)}`}function Ie(t){return typeof t!=\\\"number\\\"||Number.isNaN(t)?\\\"0\\\":t.toLocaleString()}function $(t){if(!t)return\\\"\\\\u2014\\\";let n=new Date(t);return Number.isNaN(n.getTime())?\\\"\\\\u2014\\\":n.toLocaleString()}function rt(t){return t?t.length>8?`\\\\u2026${t.slice(-8)}`:t:\\\"\\\\u2014\\\"}async function q(t,n,r){let o=`${t.basePath}/api${n}`,l=new Headers(r?.headers);r?.body&&!l.has(\\\"content-type\\\")&&l.set(\\\"content-type\\\",\\\"application/json\\\");let a=await fetch(o,{credentials:\\\"same-origin\\\",...r,headers:l});if(!a.ok){let i=\\\"unknown\\\",c=`Request failed with status ${a.status}`;try{let _=await a.json();_?.error?.message&&(c=_.error.message,i=_.error.code??\\\"unknown\\\")}catch{}throw new ke(i,c)}return await a.json()}function Z(t,n,r,o){let[l,a]=S(null),[i,c]=S(null),[_,u]=S(!0),[p,f]=S(0),s=ze(t);s.current=t;let h=J(()=>{f(v=>v+1)},[]);return Y(()=>{let v=!0;u(!0);let y=async()=>{try{let C=await s.current();if(!v)return;a(C),c(null)}catch(C){if(!v)return;c(C instanceof Error?C:new Error(String(C)))}finally{v&&u(!1)}};y();let b=null,w=()=>{b&&clearInterval(b),b=null,!o&&r>0&&typeof document<\\\"u\\\"&&!document.hidden&&(b=setInterval(()=>{!o&&!document.hidden&&y()},r))},g=()=>{typeof document<\\\"u\\\"&&!document.hidden&&!o&&r>0?(y(),w()):b&&(clearInterval(b),b=null)};return w(),document.addEventListener(\\\"visibilitychange\\\",g),()=>{v=!1,b&&clearInterval(b),document.removeEventListener(\\\"visibilitychange\\\",g)}},[...n,p,r,o]),{data:l,error:i,loading:_,refresh:h}}function Ze(t){let n=t.startsWith(\\\"#\\\")?t.slice(1):t,o=(n.startsWith(\\\"/\\\")?n.slice(1):n).split(\\\"/\\\").filter(Boolean),l=o[0];if(l===\\\"runs\\\"){let a=o[1];return o.length>=2&&a?{view:\\\"run-detail\\\",runId:decodeURIComponent(o.slice(1).join(\\\"/\\\"))}:{view:\\\"runs\\\"}}return l===\\\"queue\\\"?{view:\\\"queue\\\"}:l===\\\"dead-letters\\\"?{view:\\\"dead-letters\\\"}:l===\\\"costs\\\"?{view:\\\"costs\\\"}:{view:\\\"runs\\\"}}function yt(){let[t,n]=S(()=>Ze(window.location.hash));return Y(()=>{let r=()=>{n(Ze(window.location.hash))};return window.addEventListener(\\\"hashchange\\\",r),()=>window.removeEventListener(\\\"hashchange\\\",r)},[]),t}var st=\\\"workflow-console:poll\\\";function wt(t){try{let n=localStorage.getItem(st);if(n!==null){let r=Number(n);if(Number.isFinite(r)&&[0,2e3,5e3,1e4,3e4,6e4].includes(r))return r}}catch{}return t}function kt(t){try{localStorage.setItem(st,String(t))}catch{}}function X({status:t}){let n=t.toLowerCase(),r=[\\\"pending\\\",\\\"running\\\",\\\"suspended\\\",\\\"completed\\\",\\\"failed\\\",\\\"cancelled\\\",\\\"skipped\\\"].includes(n)?`pill-${n}`:\\\"pill-pending\\\";return e(\\\"span\\\",{class:`pill ${r}`,children:t})}function ee({error:t,onDismiss:n}){if(!t)return null;let r=\\\"code\\\"in t&&t.code===\\\"query_timeout\\\",o=\\\"code\\\"in t&&t.code===\\\"forbidden\\\",l=t.message;return o?l=\\\"You are not permitted to view this.\\\":r&&(l=`${t.message} Narrow the filter and try again.`),e(\\\"div\\\",{class:\\\"banner\\\",role:\\\"status\\\",children:[e(\\\"span\\\",{class:\\\"banner-message\\\",children:l}),e(\\\"button\\\",{type:\\\"button\\\",class:\\\"banner-dismiss\\\",onClick:n,\\\"aria-label\\\":\\\"Dismiss error\\\",children:\\\"\\\\xD7\\\"})]})}var ot=[\\\"PENDING\\\",\\\"RUNNING\\\",\\\"SUSPENDED\\\",\\\"COMPLETED\\\",\\\"FAILED\\\",\\\"CANCELLED\\\",\\\"SKIPPED\\\"];function et(t,n=300){let[r,o]=S(t);return Y(()=>{let l=setTimeout(()=>o(t),n);return()=>clearTimeout(l)},[t,n]),r}function St({config:t,pollInterval:n,paused:r,refreshSignal:o}){let[l,a]=S([]),[i,c]=S(\\\"\\\"),[_,u]=S(\\\"\\\"),[p,f]=S(\\\"\\\"),[s,h]=S(\\\"\\\"),v=et(i),y=et(_),[b,w]=S(void 0),[g,C]=S([]),[U,T]=S(null);Y(()=>{w(void 0),C([])},[l,v,y,p,s]);let O=m=>{a(M=>M.includes(m)?M.filter(W=>W!==m):[...M,m])},L=J(async()=>{let m=new URLSearchParams;for(let W of l)m.append(\\\"status\\\",W);if(v.trim()&&m.set(\\\"workflowId\\\",v.trim()),y.trim()&&m.set(\\\"definitionVersion\\\",y.trim()),p){let W=new Date(p);Number.isNaN(W.getTime())||m.set(\\\"from\\\",W.toISOString())}if(s){let W=new Date(s);Number.isNaN(W.getTime())||m.set(\\\"to\\\",W.toISOString())}b&&m.set(\\\"cursor\\\",b);let M=m.toString();return await q(t,`/runs${M?`?${M}`:\\\"\\\"}`)},[t,l,v,y,p,s,b]),{data:R,error:H,loading:D}=Z(L,[L,o],n,r),x=H===U?null:H,d=x&&\\\"code\\\"in x&&x.code===\\\"forbidden\\\",I=()=>{R?.nextCursor&&(C(m=>[...m,b??\\\"\\\"]),w(R.nextCursor))},E=()=>{if(g.length>0){let m=[...g],M=m.pop();C(m),w(M===\\\"\\\"?void 0:M)}};return e(\\\"div\\\",{children:[e(\\\"div\\\",{class:\\\"filter-bar\\\",children:[e(\\\"div\\\",{class:\\\"filter-row\\\",children:e(\\\"div\\\",{class:\\\"status-toggle-group\\\",children:ot.map(m=>e(\\\"button\\\",{type:\\\"button\\\",class:`status-toggle ${l.includes(m)?\\\"active\\\":\\\"\\\"}`,onClick:()=>O(m),children:m},m))})}),e(\\\"div\\\",{class:\\\"filter-row\\\",children:[e(\\\"label\\\",{class:\\\"sr-only\\\",for:\\\"wc-filter-workflow\\\",children:\\\"Workflow ID\\\"}),e(\\\"input\\\",{id:\\\"wc-filter-workflow\\\",type:\\\"text\\\",placeholder:\\\"Filter workflow ID...\\\",value:i,onInput:m=>c(m.target.value)}),e(\\\"label\\\",{class:\\\"sr-only\\\",for:\\\"wc-filter-version\\\",children:\\\"Definition version\\\"}),e(\\\"input\\\",{id:\\\"wc-filter-version\\\",type:\\\"text\\\",placeholder:\\\"Filter definition version...\\\",value:_,onInput:m=>u(m.target.value)}),e(\\\"label\\\",{class:\\\"sr-only\\\",for:\\\"wc-filter-from\\\",children:\\\"From\\\"}),e(\\\"input\\\",{id:\\\"wc-filter-from\\\",type:\\\"datetime-local\\\",value:p,onChange:m=>f(m.target.value)}),e(\\\"label\\\",{class:\\\"sr-only\\\",for:\\\"wc-filter-to\\\",children:\\\"To\\\"}),e(\\\"input\\\",{id:\\\"wc-filter-to\\\",type:\\\"datetime-local\\\",value:s,onChange:m=>h(m.target.value)})]})]}),e(ee,{error:x,onDismiss:()=>T(H)}),!d&&e(P,{children:[e(\\\"div\\\",{class:\\\"table-container\\\",children:e(\\\"table\\\",{children:[e(\\\"thead\\\",{children:e(\\\"tr\\\",{children:[e(\\\"th\\\",{scope:\\\"col\\\",children:\\\"Status\\\"}),e(\\\"th\\\",{scope:\\\"col\\\",children:\\\"Run ID\\\"}),e(\\\"th\\\",{scope:\\\"col\\\",children:\\\"Workflow\\\"}),e(\\\"th\\\",{scope:\\\"col\\\",children:\\\"Version\\\"}),e(\\\"th\\\",{scope:\\\"col\\\",children:\\\"Started\\\"}),e(\\\"th\\\",{scope:\\\"col\\\",children:\\\"Duration\\\"}),e(\\\"th\\\",{scope:\\\"col\\\",children:\\\"Cost\\\"}),e(\\\"th\\\",{scope:\\\"col\\\",children:\\\"Tokens\\\"})]})}),e(\\\"tbody\\\",{children:[(R?.runs??[]).map(m=>e(\\\"tr\\\",{children:[e(\\\"td\\\",{children:e(X,{status:m.status})}),e(\\\"td\\\",{children:e(\\\"a\\\",{href:`#/runs/${encodeURIComponent(m.id)}`,title:m.id,children:m.id.length>12?`\\\\u2026${m.id.slice(-12)}`:m.id})}),e(\\\"td\\\",{children:m.workflowName||m.workflowId}),e(\\\"td\\\",{title:m.definitionVersion??void 0,children:[rt(m.definitionVersion),m.redriveCount>0&&e(\\\"span\\\",{title:`${m.redriveCount} redrives`,children:` +${m.redriveCount}`})]}),e(\\\"td\\\",{children:Q(m.startedAt)}),e(\\\"td\\\",{children:de(m.duration)}),e(\\\"td\\\",{children:Se(m.totalCost)}),e(\\\"td\\\",{children:Ie(m.totalTokens)})]},m.id)),R&&R.runs.length===0&&e(\\\"tr\\\",{children:e(\\\"td\\\",{colspan:8,class:\\\"empty-state\\\",children:\\\"No workflow runs found.\\\"})})]})]})}),e(\\\"div\\\",{class:\\\"pagination\\\",children:[e(\\\"button\\\",{type:\\\"button\\\",disabled:g.length===0||D,onClick:E,children:\\\"Previous\\\"}),e(\\\"button\\\",{type:\\\"button\\\",disabled:!R?.nextCursor||D,onClick:I,children:\\\"Next\\\"})]})]})]})}function tt({step:t,canSignal:n,busy:r,onSignal:o}){let[l,a]=S(!1),[i,c]=S(\\\"null\\\"),[_,u]=S(null),p=t.kind===\\\"signal\\\"&&t.status===\\\"pending\\\",f=n&&p&&o!==void 0,s=async()=>{let h;try{h=i.trim()===\\\"\\\"?null:JSON.parse(i)}catch(v){u(v instanceof Error?v.message:\\\"Payload must be valid JSON.\\\");return}u(null),await o?.(h),a(!1)};return e(P,{children:[e(\\\"tr\\\",{children:[e(\\\"td\\\",{style:{width:\\\"50px\\\"},children:t.seq}),e(\\\"td\\\",{children:t.stepId}),e(\\\"td\\\",{children:t.kind}),e(\\\"td\\\",{children:[e(X,{status:t.status}),f&&e(\\\"button\\\",{type:\\\"button\\\",class:\\\"btn-sm step-signal-toggle\\\",disabled:r,\\\"aria-expanded\\\":l,onClick:()=>a(h=>!h),children:\\\"Deliver signal\\\"})]}),e(\\\"td\\\",{children:t.attempt}),e(\\\"td\\\",{children:$(t.leaseExpiresAt)}),e(\\\"td\\\",{children:$(t.deadlineAt)}),e(\\\"td\\\",{title:t.externalKey??void 0,children:t.kind===\\\"run\\\"&&t.externalKey?e(\\\"code\\\",{children:t.externalKey}):\\\"\\\\u2014\\\"}),e(\\\"td\\\",{children:t.error||\\\"\\\\u2014\\\"})]}),f&&l&&e(\\\"tr\\\",{class:\\\"step-signal-row\\\",children:e(\\\"td\\\",{colspan:9,children:e(\\\"form\\\",{class:\\\"step-signal-form\\\",onSubmit:h=>{h.preventDefault(),s()},children:[e(\\\"label\\\",{class:\\\"step-signal-label\\\",for:`signal-${t.id}`,children:[\\\"Payload (JSON) for \\\",e(\\\"code\\\",{children:t.stepId})]}),e(\\\"textarea\\\",{id:`signal-${t.id}`,rows:3,spellcheck:!1,value:i,onInput:h=>{c(h.currentTarget.value),_&&u(null)}}),_&&e(\\\"div\\\",{class:\\\"step-signal-error\\\",role:\\\"alert\\\",children:[\\\"Invalid JSON: \\\",_]}),e(\\\"div\\\",{class:\\\"step-signal-actions\\\",children:[e(\\\"button\\\",{type:\\\"submit\\\",class:\\\"btn-sm btn-primary\\\",disabled:r,children:\\\"Send signal\\\"}),e(\\\"button\\\",{type:\\\"button\\\",class:\\\"btn-sm\\\",disabled:r,onClick:()=>{a(!1),u(null)},children:\\\"Cancel\\\"})]})]})})})]})}function It({config:t,runId:n,pollInterval:r,paused:o,refreshSignal:l}){let[a,i]=S(!1),[c,_]=S(null),[u,p]=S(null),f=J(async()=>await q(t,`/runs/${encodeURIComponent(n)}`),[t,n]),{data:s,error:h,refresh:v}=Z(f,[f,l],r,o),y=c??h,b=y===u?null:y,w=b&&\\\"code\\\"in b&&b.code===\\\"forbidden\\\",g=async()=>{if(window.confirm(\\\"Cancel this workflow run?\\\")){i(!0),_(null);try{await q(t,`/runs/${encodeURIComponent(n)}/cancel`,{method:\\\"POST\\\",body:\\\"{}\\\"}),v()}catch(d){_(d instanceof Error?d:new Error(String(d)))}finally{i(!1)}}},C=async(d,I)=>{window.confirm(`Rerun workflow from stage \\\"${I}\\\"?`)&&await O({from:{kind:\\\"stage\\\",stageId:d}})},U=async()=>{window.confirm(\\\"Redrive this run from its last failure on the version this deployment serves?\\\")&&await O({from:{kind:\\\"lastFailure\\\"},definitionVersion:\\\"latest\\\"})},T=async(d,I,E)=>{i(!0),_(null);try{await q(t,`/runs/${encodeURIComponent(n)}/stages/${encodeURIComponent(d)}/steps/${encodeURIComponent(I)}/signal`,{method:\\\"POST\\\",body:JSON.stringify({payload:E})}),v()}catch(m){_(m instanceof Error?m:new Error(String(m)))}finally{i(!1)}},O=async d=>{i(!0),_(null);try{await q(t,`/runs/${encodeURIComponent(n)}/rerun`,{method:\\\"POST\\\",body:JSON.stringify(d)}),v()}catch(I){_(I instanceof Error?I:new Error(String(I)))}finally{i(!1)}},L=j(()=>[...s?.stages??[]].sort((d,I)=>d.stageNumber-I.stageNumber),[s?.stages]),{runStartMs:R,totalDurationMs:H}=j(()=>{if(!s?.run)return{runStartMs:0,totalDurationMs:1};let d=L[0],I=s.run.startedAt?Date.parse(s.run.startedAt):d?.startedAt?Date.parse(d.startedAt):Date.parse(s.run.createdAt),E=s.run.completedAt?Date.parse(s.run.completedAt):Date.now();return{runStartMs:Number.isNaN(I)?0:I,totalDurationMs:Math.max(1,(Number.isNaN(E)?Date.now():E)-I)}},[s?.run,L]),{stepsByStage:D,unassignedSteps:x}=j(()=>{let d=new Map,I=[];for(let E of s?.steps??[])if(E.stageRecordId){let m=d.get(E.stageRecordId);m?m.push(E):d.set(E.stageRecordId,[E])}else I.push(E);return{stepsByStage:d,unassignedSteps:I}},[s?.steps]);return e(\\\"div\\\",{children:[e(ee,{error:b,onDismiss:()=>{p(y),_(null)}}),s&&!w&&e(P,{children:[e(\\\"div\\\",{class:\\\"run-detail-header\\\",children:[e(\\\"div\\\",{class:\\\"run-detail-title-row\\\",children:[e(\\\"div\\\",{class:\\\"run-detail-title-left\\\",children:[e(\\\"a\\\",{href:\\\"#/runs\\\",children:\\\"\\\\u2190 Back to runs\\\"}),e(\\\"h2\\\",{class:\\\"header-title\\\",style:{wordBreak:\\\"break-all\\\"},children:s.run.id}),e(X,{status:s.run.status})]}),!t.readOnly&&e(\\\"div\\\",{class:\\\"run-detail-actions\\\",children:[s.run.definitionVersion&&e(\\\"button\\\",{type:\\\"button\\\",disabled:a,onClick:U,title:\\\"Move this run onto the definition version this deployment serves, then redrive it from its last failure\\\",children:\\\"Redrive on latest version\\\"}),e(\\\"button\\\",{type:\\\"button\\\",class:\\\"btn-danger\\\",disabled:a,onClick:g,children:\\\"Cancel run\\\"})]})]}),e(\\\"div\\\",{class:\\\"run-detail-meta\\\",children:[e(\\\"div\\\",{class:\\\"meta-item\\\",children:[e(\\\"span\\\",{class:\\\"meta-label\\\",children:\\\"Workflow\\\"}),e(\\\"span\\\",{class:\\\"meta-value\\\",children:s.run.workflowName||s.run.workflowId})]}),e(\\\"div\\\",{class:\\\"meta-item\\\",children:[e(\\\"span\\\",{class:\\\"meta-label\\\",children:\\\"Version\\\"}),e(\\\"span\\\",{class:\\\"meta-value\\\",title:s.run.definitionVersion??void 0,children:rt(s.run.definitionVersion)})]}),e(\\\"div\\\",{class:\\\"meta-item\\\",children:[e(\\\"span\\\",{class:\\\"meta-label\\\",children:\\\"Redrives\\\"}),e(\\\"span\\\",{class:\\\"meta-value\\\",children:s.run.redriveCount})]}),e(\\\"div\\\",{class:\\\"meta-item\\\",children:[e(\\\"span\\\",{class:\\\"meta-label\\\",children:\\\"Started\\\"}),e(\\\"span\\\",{class:\\\"meta-value\\\",children:$(s.run.startedAt)})]}),e(\\\"div\\\",{class:\\\"meta-item\\\",children:[e(\\\"span\\\",{class:\\\"meta-label\\\",children:\\\"Completed\\\"}),e(\\\"span\\\",{class:\\\"meta-value\\\",children:$(s.run.completedAt)})]}),e(\\\"div\\\",{class:\\\"meta-item\\\",children:[e(\\\"span\\\",{class:\\\"meta-label\\\",children:\\\"Duration\\\"}),e(\\\"span\\\",{class:\\\"meta-value\\\",children:de(s.run.duration)})]}),e(\\\"div\\\",{class:\\\"meta-item\\\",children:[e(\\\"span\\\",{class:\\\"meta-label\\\",children:\\\"Cost\\\"}),e(\\\"span\\\",{class:\\\"meta-value\\\",children:Se(s.run.totalCost)})]}),e(\\\"div\\\",{class:\\\"meta-item\\\",children:[e(\\\"span\\\",{class:\\\"meta-label\\\",children:\\\"Tokens\\\"}),e(\\\"span\\\",{class:\\\"meta-value\\\",children:Ie(s.run.totalTokens)})]})]})]}),e(\\\"div\\\",{class:\\\"section-header\\\",children:e(\\\"h3\\\",{class:\\\"section-title\\\",children:\\\"Stage timeline\\\"})}),e(\\\"div\\\",{class:\\\"stage-timeline\\\",children:[L.map(d=>{let I=0,E=0;if(d.startedAt&&R>0){let m=Date.parse(d.startedAt),M=d.completedAt?Date.parse(d.completedAt):Date.now();I=Math.max(0,Math.min(100,(m-R)/H*100)),E=Math.max(.5,Math.min(100-I,(M-m)/H*100))}return e(\\\"div\\\",{class:\\\"stage-timeline-row\\\",children:[e(\\\"div\\\",{class:\\\"stage-timeline-meta\\\",children:[e(\\\"div\\\",{class:\\\"stage-timeline-meta-left\\\",children:[e(\\\"span\\\",{class:\\\"stage-num\\\",children:[\\\"#\\\",d.stageNumber]}),e(\\\"span\\\",{class:\\\"stage-name\\\",children:d.stageName}),e(X,{status:d.status}),e(\\\"span\\\",{class:\\\"stage-timings\\\",children:[e(\\\"span\\\",{children:$(d.startedAt)}),e(\\\"span\\\",{children:\\\"\\\\u2192\\\"}),e(\\\"span\\\",{children:$(d.completedAt)}),e(\\\"span\\\",{children:[\\\"(\\\",de(d.duration),\\\")\\\"]})]})]}),!t.readOnly&&e(\\\"button\\\",{type:\\\"button\\\",class:\\\"btn-sm\\\",disabled:a,onClick:()=>C(d.stageId,d.stageName),children:\\\"Rerun from here\\\"})]}),e(\\\"div\\\",{class:\\\"timeline-track\\\",children:e(\\\"div\\\",{class:\\\"timeline-bar\\\",style:{left:`${I}%`,width:`${E}%`}})}),d.errorMessage&&e(\\\"div\\\",{class:\\\"stage-error\\\",children:d.errorMessage})]},d.id)}),L.length===0&&e(\\\"div\\\",{class:\\\"empty-state\\\",children:\\\"No stages recorded.\\\"})]}),e(\\\"div\\\",{class:\\\"section-header\\\",children:e(\\\"h3\\\",{class:\\\"section-title\\\",children:\\\"Step ledger\\\"})}),e(\\\"div\\\",{class:\\\"table-container\\\",children:e(\\\"table\\\",{children:[e(\\\"thead\\\",{children:e(\\\"tr\\\",{children:[e(\\\"th\\\",{scope:\\\"col\\\",children:\\\"Seq\\\"}),e(\\\"th\\\",{scope:\\\"col\\\",children:\\\"Step ID\\\"}),e(\\\"th\\\",{scope:\\\"col\\\",children:\\\"Kind\\\"}),e(\\\"th\\\",{scope:\\\"col\\\",children:\\\"Status\\\"}),e(\\\"th\\\",{scope:\\\"col\\\",children:\\\"Attempt\\\"}),e(\\\"th\\\",{scope:\\\"col\\\",children:\\\"Lease expires\\\"}),e(\\\"th\\\",{scope:\\\"col\\\",children:\\\"Deadline\\\"}),e(\\\"th\\\",{scope:\\\"col\\\",children:\\\"External key\\\"}),e(\\\"th\\\",{scope:\\\"col\\\",children:\\\"Error\\\"})]})}),e(\\\"tbody\\\",{children:[L.map(d=>{let I=(D.get(d.id)??[]).sort((E,m)=>E.seq-m.seq);return I.length===0?null:e(\\\"tr\\\",{children:e(\\\"td\\\",{colspan:9,style:{padding:0},children:e(\\\"table\\\",{style:{width:\\\"100%\\\",margin:0},children:[e(\\\"thead\\\",{children:e(\\\"tr\\\",{class:\\\"table-group-header\\\",children:e(\\\"th\\\",{scope:\\\"colgroup\\\",colspan:9,children:[\\\"Stage #\\\",d.stageNumber,\\\": \\\",d.stageName]})})}),e(\\\"tbody\\\",{children:I.map(E=>e(tt,{step:E,canSignal:!t.readOnly,busy:a,onSignal:m=>T(d.stageId,E.stepId,m)},E.id))})]})})},`group-${d.id}`)}),x.length>0&&e(\\\"tr\\\",{children:e(\\\"td\\\",{colspan:9,style:{padding:0},children:e(\\\"table\\\",{style:{width:\\\"100%\\\",margin:0},children:[e(\\\"thead\\\",{children:e(\\\"tr\\\",{class:\\\"table-group-header\\\",children:e(\\\"th\\\",{scope:\\\"colgroup\\\",colspan:9,children:\\\"Other steps\\\"})})}),e(\\\"tbody\\\",{children:x.map(d=>e(tt,{step:d,canSignal:!1,busy:a},d.id))})]})})}),s.steps.length===0&&e(\\\"tr\\\",{children:e(\\\"td\\\",{colspan:9,class:\\\"empty-state\\\",children:\\\"No steps recorded.\\\"})})]})]})}),s.truncated.steps&&e(\\\"p\\\",{class:\\\"truncated-note\\\",children:[\\\"Showing the first \\\",s.steps.length,\\\" \\\\u2014 there are more.\\\"]}),e(\\\"div\\\",{class:\\\"section-header\\\",children:e(\\\"h3\\\",{class:\\\"section-title\\\",children:\\\"Events\\\"})}),e(\\\"div\\\",{class:\\\"table-container\\\",children:e(\\\"table\\\",{children:[e(\\\"thead\\\",{children:e(\\\"tr\\\",{children:[e(\\\"th\\\",{scope:\\\"col\\\",children:\\\"Sequence\\\"}),e(\\\"th\\\",{scope:\\\"col\\\",children:\\\"Event type\\\"}),e(\\\"th\\\",{scope:\\\"col\\\",children:\\\"Occurred\\\"}),e(\\\"th\\\",{scope:\\\"col\\\",children:\\\"Published\\\"}),e(\\\"th\\\",{scope:\\\"col\\\",children:\\\"Retries\\\"}),e(\\\"th\\\",{scope:\\\"col\\\",children:\\\"Dead-lettered\\\"})]})}),e(\\\"tbody\\\",{children:[s.events.map(d=>e(\\\"tr\\\",{children:[e(\\\"td\\\",{children:d.sequence}),e(\\\"td\\\",{children:d.eventType}),e(\\\"td\\\",{children:$(d.occurredAt)}),e(\\\"td\\\",{children:d.publishedAt?$(d.publishedAt):\\\"pending\\\"}),e(\\\"td\\\",{children:d.retryCount}),e(\\\"td\\\",{children:d.dlqAt?e(\\\"span\\\",{class:\\\"badge badge-dlq\\\",title:`DLQ at ${d.dlqAt}`,children:\\\"Dead-lettered\\\"}):\\\"\\\\u2014\\\"})]},d.id)),s.events.length===0&&e(\\\"tr\\\",{children:e(\\\"td\\\",{colspan:6,class:\\\"empty-state\\\",children:\\\"No events recorded.\\\"})})]})]})}),s.truncated.events&&e(\\\"p\\\",{class:\\\"truncated-note\\\",children:[\\\"Showing the first \\\",s.events.length,\\\" \\\\u2014 there are more.\\\"]}),e(\\\"div\\\",{class:\\\"section-header\\\",children:e(\\\"h3\\\",{class:\\\"section-title\\\",children:\\\"Annotations\\\"})}),e(\\\"div\\\",{class:\\\"table-container\\\",children:e(\\\"table\\\",{children:[e(\\\"thead\\\",{children:e(\\\"tr\\\",{children:[e(\\\"th\\\",{scope:\\\"col\\\",children:\\\"Key\\\"}),e(\\\"th\\\",{scope:\\\"col\\\",children:\\\"Value\\\"}),e(\\\"th\\\",{scope:\\\"col\\\",children:\\\"Scope\\\"}),e(\\\"th\\\",{scope:\\\"col\\\",children:\\\"Actor\\\"}),e(\\\"th\\\",{scope:\\\"col\\\",children:\\\"Attempt\\\"}),e(\\\"th\\\",{scope:\\\"col\\\",children:\\\"Created\\\"})]})}),e(\\\"tbody\\\",{children:[s.annotations.map(d=>e(\\\"tr\\\",{children:[e(\\\"td\\\",{children:d.key}),e(\\\"td\\\",{children:e(\\\"code\\\",{children:typeof d.value==\\\"string\\\"?d.value:JSON.stringify(d.value)})}),e(\\\"td\\\",{children:[d.scope,d.scopeId?` (${d.scopeId})`:\\\"\\\"]}),e(\\\"td\\\",{children:d.actorKind||d.actorId?`${d.actorKind??\\\"\\\"}:${d.actorId??\\\"\\\"}`:\\\"\\\\u2014\\\"}),e(\\\"td\\\",{children:d.attempt}),e(\\\"td\\\",{children:$(d.createdAt)})]},d.id)),s.annotations.length===0&&e(\\\"tr\\\",{children:e(\\\"td\\\",{colspan:6,class:\\\"empty-state\\\",children:\\\"No annotations recorded.\\\"})})]})]})}),s.truncated.annotations&&e(\\\"p\\\",{class:\\\"truncated-note\\\",children:[\\\"Showing the first \\\",s.annotations.length,\\\" \\\\u2014 there are more.\\\"]}),e(\\\"div\\\",{class:\\\"section-header\\\",children:e(\\\"h3\\\",{class:\\\"section-title\\\",children:\\\"Logs\\\"})}),e(\\\"div\\\",{class:\\\"table-container\\\",children:e(\\\"table\\\",{children:[e(\\\"thead\\\",{children:e(\\\"tr\\\",{children:[e(\\\"th\\\",{scope:\\\"col\\\",children:\\\"Time\\\"}),e(\\\"th\\\",{scope:\\\"col\\\",children:\\\"Level\\\"}),e(\\\"th\\\",{scope:\\\"col\\\",children:\\\"Stage\\\"}),e(\\\"th\\\",{scope:\\\"col\\\",children:\\\"Message\\\"})]})}),e(\\\"tbody\\\",{children:[s.logs.map(d=>e(\\\"tr\\\",{children:[e(\\\"td\\\",{children:$(d.createdAt)}),e(\\\"td\\\",{children:e(\\\"span\\\",{class:`pill pill-log-${d.level.toLowerCase()}`,children:d.level})}),e(\\\"td\\\",{children:d.workflowStageId||\\\"\\\\u2014\\\"}),e(\\\"td\\\",{children:d.message})]},d.id)),s.logs.length===0&&e(\\\"tr\\\",{children:e(\\\"td\\\",{colspan:4,class:\\\"empty-state\\\",children:\\\"No logs recorded.\\\"})})]})]})}),s.truncated.logs&&e(\\\"p\\\",{class:\\\"truncated-note\\\",children:[\\\"Showing the first \\\",s.logs.length,\\\" \\\\u2014 there are more.\\\"]}),e(\\\"div\\\",{class:\\\"payload-sections\\\",children:[e(\\\"details\\\",{class:\\\"payload-block\\\",children:[e(\\\"summary\\\",{children:\\\"Input\\\"}),e(\\\"pre\\\",{children:JSON.stringify(s.run.input,null,2)})]}),e(\\\"details\\\",{class:\\\"payload-block\\\",children:[e(\\\"summary\\\",{children:\\\"Output\\\"}),e(\\\"pre\\\",{children:JSON.stringify(s.run.output,null,2)})]}),e(\\\"details\\\",{class:\\\"payload-block\\\",children:[e(\\\"summary\\\",{children:\\\"Config\\\"}),e(\\\"pre\\\",{children:JSON.stringify(s.run.config,null,2)})]}),e(\\\"details\\\",{class:\\\"payload-block\\\",children:[e(\\\"summary\\\",{children:\\\"Metadata\\\"}),e(\\\"pre\\\",{children:JSON.stringify(s.run.metadata,null,2)})]})]})]})]})}function Ct({config:t,pollInterval:n,paused:r,refreshSignal:o}){let[l,a]=S(null),i=J(async()=>{let[f,s,h]=await Promise.all([t.capabilities.queue?q(t,\\\"/queue\\\"):Promise.resolve(null),t.capabilities.suspended?q(t,\\\"/suspended\\\"):Promise.resolve(null),t.capabilities.workers?q(t,\\\"/workers\\\"):Promise.resolve(null)]);return{queue:f,suspended:s,workers:h}},[t]),{data:c,error:_}=Z(i,[i,o],n,r),u=_===l?null:_,p=u&&\\\"code\\\"in u&&u.code===\\\"forbidden\\\";return e(\\\"div\\\",{children:[e(ee,{error:u,onDismiss:()=>a(_)}),c&&!p&&e(P,{children:[t.capabilities.queue&&c.queue&&e(P,{children:[e(\\\"div\\\",{class:\\\"section-header\\\",children:e(\\\"h3\\\",{class:\\\"section-title\\\",children:\\\"Queue health\\\"})}),e(\\\"div\\\",{class:\\\"stat-tiles\\\",children:[ot.map(f=>e(\\\"div\\\",{class:\\\"stat-tile\\\",children:[e(\\\"span\\\",{class:\\\"stat-tile-value\\\",children:c.queue?.countsByStatus[f]??0}),e(\\\"span\\\",{class:\\\"stat-tile-label\\\",children:e(X,{status:f})})]},f)),e(\\\"div\\\",{class:\\\"stat-tile\\\",children:[e(\\\"span\\\",{class:\\\"stat-tile-value\\\",children:Q(c.queue.oldestPendingAt)}),e(\\\"span\\\",{class:\\\"stat-tile-label\\\",children:\\\"Oldest pending\\\"})]}),e(\\\"div\\\",{class:\\\"stat-tile\\\",children:[e(\\\"span\\\",{class:\\\"stat-tile-value\\\",children:Q(c.queue.oldestLeaseAt)}),e(\\\"span\\\",{class:\\\"stat-tile-label\\\",children:\\\"Oldest lease\\\"})]}),e(\\\"div\\\",{class:\\\"stat-tile\\\",children:[e(\\\"span\\\",{class:\\\"stat-tile-value\\\",children:c.queue.overduePolls}),e(\\\"span\\\",{class:\\\"stat-tile-label\\\",children:\\\"Overdue polls\\\"})]})]})]}),t.capabilities.suspended&&c.suspended&&e(P,{children:[e(\\\"div\\\",{class:\\\"section-header\\\",children:e(\\\"h3\\\",{class:\\\"section-title\\\",children:\\\"Suspended stages\\\"})}),e(\\\"div\\\",{class:\\\"table-container\\\",children:e(\\\"table\\\",{children:[e(\\\"thead\\\",{children:e(\\\"tr\\\",{children:[e(\\\"th\\\",{scope:\\\"col\\\",children:\\\"Stage\\\"}),e(\\\"th\\\",{scope:\\\"col\\\",children:\\\"Workflow run\\\"}),e(\\\"th\\\",{scope:\\\"col\\\",children:\\\"Attempt\\\"}),e(\\\"th\\\",{scope:\\\"col\\\",children:\\\"Next poll\\\"}),e(\\\"th\\\",{scope:\\\"col\\\",children:\\\"Poll interval\\\"}),e(\\\"th\\\",{scope:\\\"col\\\",children:\\\"Max wait until\\\"})]})}),e(\\\"tbody\\\",{children:[c.suspended.map(f=>e(\\\"tr\\\",{children:[e(\\\"td\\\",{children:f.stageName}),e(\\\"td\\\",{children:e(\\\"a\\\",{href:`#/runs/${encodeURIComponent(f.workflowRunId)}`,title:f.workflowRunId,children:f.workflowRunId.length>12?`\\\\u2026${f.workflowRunId.slice(-12)}`:f.workflowRunId})}),e(\\\"td\\\",{children:f.attempt}),e(\\\"td\\\",{children:bt(f.nextPollAt)}),e(\\\"td\\\",{children:f.pollInterval?de(f.pollInterval):\\\"\\\\u2014\\\"}),e(\\\"td\\\",{children:$(f.maxWaitUntil)})]},f.id)),c.suspended.length===0&&e(\\\"tr\\\",{children:e(\\\"td\\\",{colspan:6,class:\\\"empty-state\\\",children:\\\"No suspended stages.\\\"})})]})]})})]}),t.capabilities.workers&&c.workers&&e(P,{children:[e(\\\"div\\\",{class:\\\"section-header\\\",children:e(\\\"h3\\\",{class:\\\"section-title\\\",children:\\\"Workers\\\"})}),e(\\\"div\\\",{class:\\\"table-container\\\",children:e(\\\"table\\\",{children:[e(\\\"thead\\\",{children:e(\\\"tr\\\",{children:[e(\\\"th\\\",{scope:\\\"col\\\",children:\\\"Worker ID\\\"}),e(\\\"th\\\",{scope:\\\"col\\\",children:\\\"Running jobs\\\"}),e(\\\"th\\\",{scope:\\\"col\\\",children:\\\"Oldest lease\\\"}),e(\\\"th\\\",{scope:\\\"col\\\",children:\\\"Heartbeat age\\\"})]})}),e(\\\"tbody\\\",{children:[c.workers.map(f=>{let s=f.lastSeenAt?Date.now()-Date.parse(f.lastSeenAt)>6e4:!0;return e(\\\"tr\\\",{class:s?\\\"row-warning\\\":\\\"\\\",children:[e(\\\"td\\\",{children:f.workerId}),e(\\\"td\\\",{children:f.runningJobs}),e(\\\"td\\\",{children:Q(f.oldestLockedAt)}),e(\\\"td\\\",{children:Q(f.lastSeenAt)})]},f.workerId)}),c.workers.length===0&&e(\\\"tr\\\",{children:e(\\\"td\\\",{colspan:4,class:\\\"empty-state\\\",children:\\\"No active workers.\\\"})})]})]})})]})]})]})}function Et({config:t,pollInterval:n,paused:r,refreshSignal:o}){let[l,a]=S(!1),[i,c]=S(null),[_,u]=S(null),p=J(async()=>await q(t,\\\"/dead-letters\\\"),[t]),{data:f,error:s,refresh:h}=Z(p,[p,o],n,r),v=i??s,y=v===_?null:v,b=y&&\\\"code\\\"in y&&y.code===\\\"forbidden\\\",w=async()=>{if(window.confirm(\\\"Replay up to 100 dead letters?\\\")){a(!0),c(null);try{await q(t,\\\"/dead-letters/replay\\\",{method:\\\"POST\\\",body:JSON.stringify({maxEvents:100})}),h()}catch(g){c(g instanceof Error?g:new Error(String(g)))}finally{a(!1)}}};return e(\\\"div\\\",{children:[e(\\\"div\\\",{class:\\\"section-header\\\",style:{marginTop:0},children:[e(\\\"h3\\\",{class:\\\"section-title\\\",children:\\\"Dead letter queue\\\"}),!t.readOnly&&e(\\\"button\\\",{type:\\\"button\\\",class:\\\"btn-primary\\\",disabled:l,onClick:w,children:l?\\\"Replaying...\\\":\\\"Replay dead letters\\\"})]}),e(ee,{error:y,onDismiss:()=>{u(v),c(null)}}),f&&!b&&e(\\\"div\\\",{class:\\\"table-container\\\",children:e(\\\"table\\\",{children:[e(\\\"thead\\\",{children:e(\\\"tr\\\",{children:[e(\\\"th\\\",{scope:\\\"col\\\",children:\\\"Sequence\\\"}),e(\\\"th\\\",{scope:\\\"col\\\",children:\\\"Workflow run\\\"}),e(\\\"th\\\",{scope:\\\"col\\\",children:\\\"Event type\\\"}),e(\\\"th\\\",{scope:\\\"col\\\",children:\\\"Retries\\\"}),e(\\\"th\\\",{scope:\\\"col\\\",children:\\\"Occurred\\\"}),e(\\\"th\\\",{scope:\\\"col\\\",children:\\\"DLQ time\\\"})]})}),e(\\\"tbody\\\",{children:[f.map(g=>e(\\\"tr\\\",{children:[e(\\\"td\\\",{children:g.sequence}),e(\\\"td\\\",{children:e(\\\"a\\\",{href:`#/runs/${encodeURIComponent(g.workflowRunId)}`,title:g.workflowRunId,children:g.workflowRunId.length>12?`\\\\u2026${g.workflowRunId.slice(-12)}`:g.workflowRunId})}),e(\\\"td\\\",{children:g.eventType}),e(\\\"td\\\",{children:g.retryCount}),e(\\\"td\\\",{children:$(g.occurredAt)}),e(\\\"td\\\",{children:$(g.dlqAt)})]},g.id)),f.length===0&&e(\\\"tr\\\",{children:e(\\\"td\\\",{colspan:6,class:\\\"empty-state\\\",children:\\\"No dead letters.\\\"})})]})]})})]})}function Nt({config:t,pollInterval:n,paused:r,refreshSignal:o}){let[l,a]=S(\\\"workflow\\\"),[i,c]=S(null),_=J(async()=>await q(t,`/costs?by=${l}`),[t,l]),{data:u,error:p}=Z(_,[_,o],n,r),f=p===i?null:p,s=f&&\\\"code\\\"in f&&f.code===\\\"forbidden\\\",h=j(()=>Math.max(1e-4,...(u??[]).map(v=>v.cost)),[u]);return e(\\\"div\\\",{children:[e(\\\"div\\\",{class:\\\"section-header\\\",style:{marginTop:0},children:[e(\\\"h3\\\",{class:\\\"section-title\\\",children:\\\"Cost rollups\\\"}),e(\\\"div\\\",{class:\\\"toggle-group\\\",children:[e(\\\"button\\\",{type:\\\"button\\\",class:`btn-toggle ${l===\\\"workflow\\\"?\\\"active\\\":\\\"\\\"}`,onClick:()=>a(\\\"workflow\\\"),children:\\\"By workflow\\\"}),e(\\\"button\\\",{type:\\\"button\\\",class:`btn-toggle ${l===\\\"day\\\"?\\\"active\\\":\\\"\\\"}`,onClick:()=>a(\\\"day\\\"),children:\\\"By day\\\"})]})]}),e(ee,{error:f,onDismiss:()=>c(p)}),u&&!s&&e(\\\"div\\\",{class:\\\"table-container\\\",children:e(\\\"table\\\",{children:[e(\\\"thead\\\",{children:e(\\\"tr\\\",{children:[e(\\\"th\\\",{scope:\\\"col\\\",children:l===\\\"workflow\\\"?\\\"Workflow ID\\\":\\\"Date\\\"}),e(\\\"th\\\",{scope:\\\"col\\\",children:\\\"Runs\\\"}),e(\\\"th\\\",{scope:\\\"col\\\",children:\\\"Cost\\\"}),e(\\\"th\\\",{scope:\\\"col\\\",children:\\\"Tokens\\\"}),e(\\\"th\\\",{scope:\\\"col\\\",style:{width:\\\"30%\\\"},children:\\\"Proportion\\\"})]})}),e(\\\"tbody\\\",{children:[u.map(v=>{let y=Math.min(100,Math.max(.5,v.cost/h*100));return e(\\\"tr\\\",{children:[e(\\\"td\\\",{children:v.key}),e(\\\"td\\\",{children:v.runs.toLocaleString()}),e(\\\"td\\\",{children:Se(v.cost)}),e(\\\"td\\\",{children:Ie(v.tokens)}),e(\\\"td\\\",{children:e(\\\"div\\\",{class:\\\"cost-bar-track\\\",children:e(\\\"div\\\",{class:\\\"cost-bar-fill\\\",style:{width:`${y}%`}})})})]},v.key)}),u.length===0&&e(\\\"tr\\\",{children:e(\\\"td\\\",{colspan:5,class:\\\"empty-state\\\",children:\\\"No cost data available.\\\"})})]})]})})]})}var At=[{label:\\\"Off\\\",value:0},{label:\\\"2s\\\",value:2e3},{label:\\\"5s\\\",value:5e3},{label:\\\"10s\\\",value:1e4},{label:\\\"30s\\\",value:3e4},{label:\\\"60s\\\",value:6e4}];function Dt({config:t}){let n=yt(),[r,o]=S(()=>t.forcePollInterval?t.pollIntervalMs:wt(t.pollIntervalMs)),[l,a]=S(0),i=p=>{o(p),kt(p)},c=()=>{a(p=>p+1)},_=t.capabilities.queue||t.capabilities.suspended||t.capabilities.workers,u=j(()=>n.view===\\\"run-detail\\\"?e(It,{config:t,runId:n.runId,pollInterval:r,paused:r===0,refreshSignal:l}):n.view===\\\"queue\\\"&&_?e(Ct,{config:t,pollInterval:r,paused:r===0,refreshSignal:l}):n.view===\\\"dead-letters\\\"&&t.capabilities.deadLetters?e(Et,{config:t,pollInterval:r,paused:r===0,refreshSignal:l}):n.view===\\\"costs\\\"&&t.capabilities.costs?e(Nt,{config:t,pollInterval:r,paused:r===0,refreshSignal:l}):e(St,{config:t,pollInterval:r,paused:r===0,refreshSignal:l}),[n,t,r,l,_]);return e(\\\"div\\\",{children:[e(\\\"header\\\",{class:\\\"header\\\",children:[e(\\\"div\\\",{class:\\\"header-title-group\\\",children:[e(\\\"h1\\\",{class:\\\"header-title\\\",children:\\\"Workflow console\\\"}),t.readOnly&&e(\\\"span\\\",{class:\\\"badge badge-readonly\\\",children:\\\"Read-only\\\"})]}),e(\\\"div\\\",{class:\\\"header-controls\\\",children:[!t.forcePollInterval&&e(\\\"div\\\",{children:[e(\\\"label\\\",{class:\\\"sr-only\\\",for:\\\"wc-poll-select\\\",children:\\\"Poll interval\\\"}),e(\\\"select\\\",{id:\\\"wc-poll-select\\\",value:r,onChange:p=>i(Number(p.target.value)),children:At.map(p=>e(\\\"option\\\",{value:p.value,children:p.label},p.value))})]}),e(\\\"button\\\",{type:\\\"button\\\",class:\\\"btn-refresh\\\",onClick:c,children:\\\"Refresh now\\\"})]})]}),e(\\\"nav\\\",{class:\\\"nav-tabs\\\",\\\"aria-label\\\":\\\"Console navigation\\\",children:[t.capabilities.runs&&e(\\\"a\\\",{href:\\\"#/runs\\\",class:`nav-tab ${n.view===\\\"runs\\\"||n.view===\\\"run-detail\\\"?\\\"active\\\":\\\"\\\"}`,\\\"aria-current\\\":n.view===\\\"runs\\\"||n.view===\\\"run-detail\\\"?\\\"page\\\":void 0,children:\\\"Runs\\\"}),_&&e(\\\"a\\\",{href:\\\"#/queue\\\",class:`nav-tab ${n.view===\\\"queue\\\"?\\\"active\\\":\\\"\\\"}`,\\\"aria-current\\\":n.view===\\\"queue\\\"?\\\"page\\\":void 0,children:\\\"Queue\\\"}),t.capabilities.deadLetters&&e(\\\"a\\\",{href:\\\"#/dead-letters\\\",class:`nav-tab ${n.view===\\\"dead-letters\\\"?\\\"active\\\":\\\"\\\"}`,\\\"aria-current\\\":n.view===\\\"dead-letters\\\"?\\\"page\\\":void 0,children:\\\"Dead letters\\\"}),t.capabilities.costs&&e(\\\"a\\\",{href:\\\"#/costs\\\",class:`nav-tab ${n.view===\\\"costs\\\"?\\\"active\\\":\\\"\\\"}`,\\\"aria-current\\\":n.view===\\\"costs\\\"?\\\"page\\\":void 0,children:\\\"Costs\\\"})]}),e(\\\"main\\\",{children:u})]})}function nt(){let t=document.getElementById(\\\"workflow-console\\\");if(!t)return;let n=document.getElementById(\\\"workflow-console-config\\\");if(!n||!n.textContent){t.textContent=\\\"Workflow console configuration element missing.\\\";return}let r;try{r=JSON.parse(n.textContent)}catch{t.textContent=\\\"Workflow console configuration is invalid.\\\";return}Ue(e(Dt,{config:r}),t)}document.readyState===\\\"loading\\\"?document.addEventListener(\\\"DOMContentLoaded\\\",nt):nt();})();\\n\";\nexport const UI_CSS = \"#workflow-console{--wc-bg:#ffffff;--wc-text:#111827;--wc-text-muted:#6b7280;--wc-border:#e5e7eb;--wc-border-subtle:#f3f4f6;--wc-surface:#f9fafb;--wc-surface-hover:#f3f4f6;--wc-surface-active:#e5e7eb;--wc-primary:#2563eb;--wc-primary-hover:#1d4ed8;--wc-primary-text:#ffffff;--wc-focus-ring:#3b82f6;--wc-banner-bg:#fef2f2;--wc-banner-border:#fecaca;--wc-banner-text:#991b1b;--wc-status-pending-bg:#f3f4f6;--wc-status-pending-text:#374151;--wc-status-running-bg:#dbeafe;--wc-status-running-text:#1e40af;--wc-status-suspended-bg:#fef3c7;--wc-status-suspended-text:#92400e;--wc-status-completed-bg:#d1fae5;--wc-status-completed-text:#065f46;--wc-status-failed-bg:#fee2e2;--wc-status-failed-text:#991b1b;--wc-status-cancelled-bg:#f3f4f6;--wc-status-cancelled-text:#4b5563;--wc-status-skipped-bg:#f3f4f6;--wc-status-skipped-text:#4b5563;--wc-log-info-bg:#e0f2fe;--wc-log-info-text:#0369a1;--wc-log-warn-bg:#fef3c7;--wc-log-warn-text:#92400e;--wc-log-error-bg:#fee2e2;--wc-log-error-text:#991b1b;--wc-log-debug-bg:#f3f4f6;--wc-log-debug-text:#4b5563;--wc-bar-track:#e5e7eb;--wc-bar-fill:#2563eb;--wc-warning-bg:#fffbeb;--wc-warning-border:#fde68a;--wc-warning-text:#b45309;--wc-transparent:transparent}@media (prefers-color-scheme:dark){#workflow-console{--wc-bg:#111827;--wc-text:#f9fafb;--wc-text-muted:#9ca3af;--wc-border:#374151;--wc-border-subtle:#1f2937;--wc-surface:#1f2937;--wc-surface-hover:#374151;--wc-surface-active:#4b5563;--wc-primary:#3b82f6;--wc-primary-hover:#60a5fa;--wc-primary-text:#ffffff;--wc-focus-ring:#60a5fa;--wc-banner-bg:#450a0a;--wc-banner-border:#7f1d1d;--wc-banner-text:#fca5a5;--wc-status-pending-bg:#374151;--wc-status-pending-text:#e5e7eb;--wc-status-running-bg:#1e3a8a;--wc-status-running-text:#bfdbfe;--wc-status-suspended-bg:#78350f;--wc-status-suspended-text:#fde68a;--wc-status-completed-bg:#064e3b;--wc-status-completed-text:#a7f3d0;--wc-status-failed-bg:#7f1d1d;--wc-status-failed-text:#fecaca;--wc-status-cancelled-bg:#374151;--wc-status-cancelled-text:#9ca3af;--wc-status-skipped-bg:#374151;--wc-status-skipped-text:#9ca3af;--wc-log-info-bg:#075985;--wc-log-info-text:#bae6fd;--wc-log-warn-bg:#78350f;--wc-log-warn-text:#fde68a;--wc-log-error-bg:#7f1d1d;--wc-log-error-text:#fecaca;--wc-log-debug-bg:#374151;--wc-log-debug-text:#9ca3af;--wc-bar-track:#374151;--wc-bar-fill:#60a5fa;--wc-warning-bg:#451a03;--wc-warning-border:#78350f;--wc-warning-text:#fde68a;--wc-transparent:transparent}}#workflow-console{background-color:var(--wc-bg);color:var(--wc-text);font-family:system-ui,-apple-system,BlinkMacSystemFont,\\\"Segoe UI\\\",Roboto,sans-serif;font-size:14px;line-height:1.5;box-sizing:border-box;width:100%;padding:1.5rem}#workflow-console *,#workflow-console *::before,#workflow-console *::after{box-sizing:border-box}#workflow-console a{color:var(--wc-primary);text-decoration:none}#workflow-console a:hover{text-decoration:underline}#workflow-console button{font-family:inherit;font-size:0.875rem;padding:0.375rem 0.75rem;border-radius:4px;border:1px solid var(--wc-border);background-color:var(--wc-surface);color:var(--wc-text);cursor:pointer;display:inline-flex;align-items:center;justify-content:center;gap:0.375rem}#workflow-console button:hover:not(:disabled){background-color:var(--wc-surface-hover)}#workflow-console button:disabled{opacity:0.5;cursor:not-allowed}#workflow-console button:focus-visible,#workflow-console input:focus-visible,#workflow-console select:focus-visible{outline:2px solid var(--wc-focus-ring);outline-offset:1px}#workflow-console .btn-primary{background-color:var(--wc-primary);color:var(--wc-primary-text);border-color:var(--wc-primary)}#workflow-console .btn-primary:hover:not(:disabled){background-color:var(--wc-primary-hover)}#workflow-console .btn-danger{background-color:var(--wc-banner-bg);color:var(--wc-banner-text);border-color:var(--wc-banner-border)}#workflow-console .btn-sm{font-size:0.75rem;padding:0.25rem 0.5rem}#workflow-console input[type=\\\"text\\\"],#workflow-console input[type=\\\"datetime-local\\\"],#workflow-console select{font-family:inherit;font-size:0.875rem;padding:0.375rem 0.5rem;border:1px solid var(--wc-border);border-radius:4px;background-color:var(--wc-bg);color:var(--wc-text)}#workflow-console textarea{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:0.8125rem;padding:0.375rem 0.5rem;border:1px solid var(--wc-border);border-radius:4px;background-color:var(--wc-bg);color:var(--wc-text);width:100%;max-width:40rem;resize:vertical}#workflow-console textarea:focus-visible{outline:2px solid var(--wc-focus-ring);outline-offset:1px}#workflow-console .step-signal-toggle{margin-left:0.5rem}#workflow-console .step-signal-form{display:flex;flex-direction:column;gap:0.375rem;padding:0.25rem 0}#workflow-console .step-signal-label{font-size:0.75rem;color:var(--wc-text-muted)}#workflow-console .step-signal-error{font-size:0.75rem;color:var(--wc-banner-text)}#workflow-console .step-signal-actions{display:flex;gap:0.5rem}#workflow-console .sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}#workflow-console .header{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:1rem;padding-bottom:1rem;border-bottom:1px solid var(--wc-border);margin-bottom:1rem}#workflow-console .header-title-group{display:flex;align-items:center;gap:0.75rem}#workflow-console .header-title{margin:0;font-size:1.25rem;font-weight:700;color:var(--wc-text)}#workflow-console .header-controls{display:flex;align-items:center;gap:0.5rem}#workflow-console .nav-tabs{display:flex;gap:0.25rem;margin-bottom:1.25rem;border-bottom:1px solid var(--wc-border)}#workflow-console .nav-tab{padding:0.5rem 0.875rem;text-decoration:none;color:var(--wc-text-muted);font-weight:500;border-bottom:2px solid var(--wc-transparent);margin-bottom:-1px}#workflow-console .nav-tab:hover{color:var(--wc-text);text-decoration:none}#workflow-console .nav-tab.active{color:var(--wc-primary);border-bottom-color:var(--wc-primary);font-weight:600}#workflow-console .banner{display:flex;align-items:center;justify-content:space-between;gap:0.75rem;padding:0.75rem 1rem;border:1px solid var(--wc-banner-border);background-color:var(--wc-banner-bg);color:var(--wc-banner-text);border-radius:4px;margin-bottom:1rem}#workflow-console .banner-message{font-size:0.875rem}#workflow-console .banner-dismiss{background:var(--wc-transparent);border:none;color:var(--wc-banner-text);font-size:1.25rem;line-height:1;padding:0 0.25rem;cursor:pointer}#workflow-console .filter-bar{display:flex;flex-direction:column;gap:0.75rem;margin-bottom:1rem;padding:0.875rem;background-color:var(--wc-surface);border:1px solid var(--wc-border);border-radius:4px}#workflow-console .filter-row{display:flex;flex-wrap:wrap;align-items:center;gap:0.5rem}#workflow-console .status-toggle-group{display:flex;flex-wrap:wrap;gap:0.25rem}#workflow-console .status-toggle{padding:0.25rem 0.5rem;font-size:0.75rem;border-radius:4px;border:1px solid var(--wc-border);background-color:var(--wc-bg);color:var(--wc-text-muted)}#workflow-console .status-toggle.active{background-color:var(--wc-surface-active);color:var(--wc-text);font-weight:600;border-color:var(--wc-border)}#workflow-console .table-container{overflow-x:auto;max-width:100%;margin-bottom:1rem;border:1px solid var(--wc-border);border-radius:4px}#workflow-console table{width:100%;border-collapse:collapse;white-space:nowrap;font-size:0.875rem}#workflow-console th{background-color:var(--wc-surface);color:var(--wc-text-muted);font-weight:600;text-align:left;padding:0.5rem 0.75rem;border-bottom:1px solid var(--wc-border)}#workflow-console td{padding:0.5rem 0.75rem;border-bottom:1px solid var(--wc-border-subtle);color:var(--wc-text)}#workflow-console tr:last-child td{border-bottom:none}#workflow-console tr:hover td{background-color:var(--wc-surface-hover)}#workflow-console tr.table-group-header th{background-color:var(--wc-surface-active);color:var(--wc-text);font-weight:700;padding:0.5rem 0.75rem}#workflow-console tr.row-warning td{background-color:var(--wc-warning-bg);color:var(--wc-warning-text)}#workflow-console .pagination{display:flex;align-items:center;justify-content:flex-end;gap:0.5rem;margin-top:0.75rem;margin-bottom:1rem}#workflow-console .pill{display:inline-block;padding:0.125rem 0.5rem;border-radius:9999px;font-size:0.75rem;font-weight:600;text-transform:uppercase;letter-spacing:0.025em;line-height:1.2}#workflow-console .pill-pending{background-color:var(--wc-status-pending-bg);color:var(--wc-status-pending-text)}#workflow-console .pill-running{background-color:var(--wc-status-running-bg);color:var(--wc-status-running-text)}#workflow-console .pill-suspended{background-color:var(--wc-status-suspended-bg);color:var(--wc-status-suspended-text)}#workflow-console .pill-completed{background-color:var(--wc-status-completed-bg);color:var(--wc-status-completed-text)}#workflow-console .pill-failed{background-color:var(--wc-status-failed-bg);color:var(--wc-status-failed-text)}#workflow-console .pill-cancelled{background-color:var(--wc-status-cancelled-bg);color:var(--wc-status-cancelled-text)}#workflow-console .pill-skipped{background-color:var(--wc-status-skipped-bg);color:var(--wc-status-skipped-text)}#workflow-console .pill-log-info{background-color:var(--wc-log-info-bg);color:var(--wc-log-info-text)}#workflow-console .pill-log-warn{background-color:var(--wc-log-warn-bg);color:var(--wc-log-warn-text)}#workflow-console .pill-log-error{background-color:var(--wc-log-error-bg);color:var(--wc-log-error-text)}#workflow-console .pill-log-debug{background-color:var(--wc-log-debug-bg);color:var(--wc-log-debug-text)}#workflow-console .badge{display:inline-block;padding:0.125rem 0.375rem;border-radius:4px;font-size:0.75rem;font-weight:600;text-transform:uppercase}#workflow-console .badge-readonly{background-color:var(--wc-status-pending-bg);color:var(--wc-status-pending-text);border:1px solid var(--wc-border)}#workflow-console .badge-dlq{background-color:var(--wc-banner-bg);color:var(--wc-banner-text);border:1px solid var(--wc-banner-border)}#workflow-console .stat-tiles{display:flex;flex-wrap:wrap;gap:0.75rem;margin-bottom:1.5rem}#workflow-console .stat-tile{background-color:var(--wc-surface);border:1px solid var(--wc-border);border-radius:6px;padding:0.75rem 1rem;min-width:130px;display:flex;flex-direction:column}#workflow-console .stat-tile-value{font-size:1.25rem;font-weight:700;color:var(--wc-text)}#workflow-console .stat-tile-label{font-size:0.75rem;color:var(--wc-text-muted);text-transform:uppercase;margin-top:0.25rem}#workflow-console .run-detail-header{display:flex;flex-direction:column;gap:1rem;margin-bottom:1.5rem;padding:1rem;background-color:var(--wc-surface);border:1px solid var(--wc-border);border-radius:4px}#workflow-console .run-detail-title-row{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:0.75rem}#workflow-console .run-detail-title-left{display:flex;align-items:center;flex-wrap:wrap;gap:0.75rem}#workflow-console .run-detail-actions{display:flex;gap:0.5rem}#workflow-console .run-detail-meta{display:flex;flex-wrap:wrap;gap:1.5rem;font-size:0.875rem}#workflow-console .meta-item{display:flex;flex-direction:column}#workflow-console .meta-label{font-size:0.75rem;color:var(--wc-text-muted);text-transform:uppercase}#workflow-console .meta-value{font-weight:600}#workflow-console .section-header{display:flex;align-items:center;justify-content:space-between;margin-top:1.5rem;margin-bottom:0.75rem}#workflow-console .section-title{margin:0;font-size:1rem;font-weight:600;color:var(--wc-text)}#workflow-console .stage-timeline{display:flex;flex-direction:column;gap:0.5rem;margin-bottom:1.5rem}#workflow-console .stage-timeline-row{display:flex;flex-direction:column;gap:0.375rem;padding:0.75rem;border:1px solid var(--wc-border);border-radius:4px;background-color:var(--wc-surface)}#workflow-console .stage-timeline-meta{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:0.5rem}#workflow-console .stage-timeline-meta-left{display:flex;align-items:center;flex-wrap:wrap;gap:0.5rem}#workflow-console .stage-num{font-weight:700;color:var(--wc-text-muted)}#workflow-console .stage-name{font-weight:600}#workflow-console .stage-timings{font-size:0.75rem;color:var(--wc-text-muted);display:inline-flex;gap:0.375rem}#workflow-console .timeline-track{position:relative;height:8px;background-color:var(--wc-bar-track);border-radius:4px;overflow:hidden;width:100%}#workflow-console .timeline-bar{position:absolute;top:0;bottom:0;background-color:var(--wc-bar-fill);border-radius:4px}#workflow-console .stage-error{font-size:0.75rem;color:var(--wc-banner-text);background-color:var(--wc-banner-bg);padding:0.375rem 0.5rem;border-radius:4px;border:1px solid var(--wc-banner-border);margin-top:0.25rem}#workflow-console .cost-bar-track{position:relative;height:10px;background-color:var(--wc-bar-track);border-radius:5px;overflow:hidden;min-width:100px;width:100%}#workflow-console .cost-bar-fill{position:absolute;top:0;bottom:0;left:0;background-color:var(--wc-bar-fill);border-radius:5px}#workflow-console .toggle-group{display:inline-flex;border:1px solid var(--wc-border);border-radius:4px;overflow:hidden}#workflow-console .btn-toggle{border:none;border-radius:0;padding:0.375rem 0.75rem;font-size:0.8125rem;background-color:var(--wc-surface);color:var(--wc-text-muted)}#workflow-console .btn-toggle.active{background-color:var(--wc-surface-active);color:var(--wc-text);font-weight:600}#workflow-console .payload-sections{display:flex;flex-direction:column;gap:0.5rem;margin-top:1rem;margin-bottom:1.5rem}#workflow-console .payload-block{border:1px solid var(--wc-border);border-radius:4px;background-color:var(--wc-surface)}#workflow-console .payload-block summary{padding:0.5rem 0.75rem;cursor:pointer;font-weight:600;font-size:0.875rem}#workflow-console .payload-block pre{margin:0;padding:0.75rem;overflow-x:auto;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:12px;border-top:1px solid var(--wc-border);background-color:var(--wc-bg);color:var(--wc-text)}#workflow-console .truncated-note{font-size:0.75rem;color:var(--wc-text-muted);font-style:italic;margin-top:0.25rem;margin-bottom:1rem}#workflow-console .empty-state{text-align:center;color:var(--wc-text-muted);font-style:italic;padding:1.5rem 0.75rem}#workflow-console code{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:0.8125rem;background-color:var(--wc-surface-active);padding:0.125rem 0.25rem;border-radius:3px}\";\n","import { UI_CSS, UI_CSS_NAME, UI_JS, UI_JS_NAME } from \"./generated/ui-bundle\";\nimport type { ConsoleCapabilities } from \"./read-port\";\n\nexport interface UiAsset {\n body: string;\n contentType: string;\n}\n\n/**\n * The prebuilt UI, keyed by the filename the document asks for. Names carry\n * a content hash, so these are safe to serve `immutable`.\n */\nexport const UI_ASSETS: Record<string, UiAsset> = {\n [UI_JS_NAME]: {\n body: UI_JS,\n contentType: \"application/javascript; charset=utf-8\",\n },\n [UI_CSS_NAME]: { body: UI_CSS, contentType: \"text/css; charset=utf-8\" },\n};\n\nexport interface IndexHtmlOptions {\n basePath: string;\n readOnly: boolean;\n pollIntervalMs: number;\n forcePollInterval: boolean;\n capabilities: ConsoleCapabilities;\n nonce?: string;\n}\n\nconst HTML_ESCAPES: Record<string, string> = {\n \"&\": \"&\",\n \"<\": \"<\",\n \">\": \">\",\n '\"': \""\",\n \"'\": \"'\",\n};\n\nfunction escapeHtml(value: string): string {\n return value.replace(/[&<>\"']/g, (char) => HTML_ESCAPES[char] ?? char);\n}\n\n/**\n * `</script>` inside a JSON island would end the block early; escaping the\n * slash keeps the JSON valid and the document intact.\n */\nfunction escapeJsonForScript(value: string): string {\n return value.replace(/</g, \"\\\\u003c\");\n}\n\n/**\n * The console's entry document.\n *\n * Configuration is embedded in the page rather than fetched, so the SPA\n * boots already knowing its mount path, its read-only state and which views\n * this reader can serve — no round trip, and no flash of a tab that is\n * about to disappear. The mount path is a runtime value on purpose: baking\n * it in at build time, as pg-boss's dashboard does, means a consumer cannot\n * move where the console is mounted without rebuilding it.\n */\nexport function renderIndexHtml(options: IndexHtmlOptions): string {\n const config = escapeJsonForScript(\n JSON.stringify({\n basePath: options.basePath,\n readOnly: options.readOnly,\n pollIntervalMs: options.pollIntervalMs,\n forcePollInterval: options.forcePollInterval,\n capabilities: options.capabilities,\n }),\n );\n const nonce =\n options.nonce === undefined ? \"\" : ` nonce=\"${escapeHtml(options.nonce)}\"`;\n const base = escapeHtml(options.basePath);\n\n return `<!doctype html>\n<html lang=\"en\">\n<head>\n<meta charset=\"utf-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n<meta name=\"color-scheme\" content=\"light dark\">\n<title>Workflow console</title>\n<link rel=\"stylesheet\" href=\"${base}/assets/${UI_CSS_NAME}\">\n</head>\n<body>\n<div id=\"workflow-console\"></div>\n<script type=\"application/json\" id=\"workflow-console-config\"${nonce}>${config}</script>\n<script src=\"${base}/assets/${UI_JS_NAME}\"${nonce} defer></script>\n</body>\n</html>\n`;\n}\n","import {\n type ConsoleAction,\n type ConsoleActionEvent,\n type ConsoleAuthorizeContext,\n type ConsoleKernel,\n} from \"./actions\";\nimport { ConsoleBadRequestError, ConsoleQueryTimeoutError } from \"./errors\";\nimport {\n type ConsoleReadPort,\n type ConsoleStatus,\n clampLimit,\n isConsoleStatus,\n type RunListFilters,\n} from \"./read-port\";\nimport { renderIndexHtml, UI_ASSETS } from \"./ui-assets\";\n\n/**\n * The engine's `RunRedriveFrom`, restated rather than imported: the console\n * types kernel commands structurally (`ConsoleKernel.dispatch`) so it can be\n * mounted against any compatible kernel without a value dependency on one.\n */\ntype RunRedriveFrom =\n | { readonly kind: \"lastFailure\" }\n | { readonly kind: \"start\" }\n | { readonly kind: \"stage\"; readonly stageId: string };\n\n/** The engine's `StepSignalCommand`, restated for the same reason. */\ntype StepSignalCommand = {\n readonly type: \"step.signal\";\n readonly workflowRunId: string;\n readonly stageId: string;\n readonly stepId: string;\n readonly payload: unknown;\n};\n\n/**\n * The kernel reports a signal that cannot land as a thrown `Error` whose\n * message says why. The console answers with the status the reason\n * deserves rather than a 500: an unknown stage is a 404, and a step that\n * is not a pending signal is a 409, because the request was well-formed\n * and the ledger is what refused it.\n */\nfunction signalErrorStatus(error: unknown): number | undefined {\n if (!(error instanceof Error)) return undefined;\n const message = error.message;\n if (/ not found$/.test(message)) return 404;\n if (\n message.includes(\"was previously used as\") ||\n message.includes(\"has failed and cannot receive a signal\") ||\n message.endsWith(\"changed state\")\n ) {\n return 409;\n }\n return undefined;\n}\n\nexport interface WorkflowConsoleOptions {\n /** Reads run on this. It is constructed from the caller's client or transaction; the console never opens one. */\n reader: ConsoleReadPort;\n /**\n * Per-request authorisation. Omit it and every action is denied — a\n * console that shipped with a permissive default would be a way to leak\n * a tenant's runs by forgetting one line of configuration.\n *\n * It runs *after* the host's authentication. Assume \"is this request\n * authenticated?\" is already decided; answer only \"may this principal do\n * this?\". A throw denies, so a bug in the callback fails closed.\n */\n authorize?: (context: ConsoleAuthorizeContext) => boolean | Promise<boolean>;\n /** Required only when `actions` is true. */\n kernel?: ConsoleKernel;\n /** Write actions are off unless this is true. Read-only is the default. */\n actions?: boolean;\n /**\n * Mount path, if the handler cannot work it out. It normally can: the\n * SPA routes on the fragment, so the only paths the server ever sees are\n * the mount root itself, `<root>/api/...` and `<root>/assets/...`.\n */\n basePath?: string;\n /** UI poll interval in ms. Default 5000; the surveyed consoles sit between 1s and 5s and a shared console should be at the slow end. */\n pollIntervalMs?: number;\n /** Fix the poll interval and hide the picker. */\n forcePollInterval?: boolean;\n /** Supply a CSP nonce for the injected config script, for hosts running a strict policy. */\n cspNonce?: (request: Request) => string | undefined;\n /** Called after every allowed write. The audit trail hosts would otherwise have to build themselves. */\n onAction?: (event: ConsoleActionEvent) => void | Promise<void>;\n}\n\nexport type WorkflowConsoleHandler = (request: Request) => Promise<Response>;\n\nconst JSON_HEADERS = { \"content-type\": \"application/json; charset=utf-8\" };\n\nfunction json(body: unknown, status = 200): Response {\n return new Response(JSON.stringify(body, dateReplacer), {\n status,\n headers: JSON_HEADERS,\n });\n}\n\n/** Dates cross the wire as ISO strings; the UI parses them back. */\nfunction dateReplacer(_key: string, value: unknown): unknown {\n return value instanceof Date ? value.toISOString() : value;\n}\n\nfunction errorResponse(\n code: string,\n message: string,\n status: number,\n): Response {\n return json({ error: { code, message } }, status);\n}\n\n/**\n * Work out where this handler is mounted from the request alone.\n *\n * The SPA routes on the URL fragment, which never reaches the server, so\n * the only three shapes that arrive are the mount root, `<root>/api/...`\n * and `<root>/assets/...`. That makes the prefix unambiguous without the\n * caller telling us, and without a build-time base path — pg-boss's\n * dashboard bakes its base path in at build time, which means a consumer\n * cannot change where it is mounted without rebuilding it.\n */\nfunction splitPath(\n pathname: string,\n configuredBase: string | undefined,\n): { basePath: string; route: string } {\n if (configuredBase !== undefined) {\n const base = normaliseBase(configuredBase);\n const route = pathname.startsWith(base)\n ? pathname.slice(base.length)\n : pathname;\n return { basePath: base, route: route === \"\" ? \"/\" : route };\n }\n for (const marker of [\"/api/\", \"/assets/\"] as const) {\n const at = pathname.lastIndexOf(marker);\n if (at !== -1) {\n return {\n basePath: normaliseBase(pathname.slice(0, at)),\n route: pathname.slice(at),\n };\n }\n }\n // Anything else is the mount root, with or without a trailing slash.\n return { basePath: normaliseBase(pathname), route: \"/\" };\n}\n\nfunction normaliseBase(path: string): string {\n const trimmed = path.replace(/\\/+$/, \"\");\n return trimmed === \"\" ? \"\" : trimmed;\n}\n\nfunction parseStatuses(raw: string[]): ConsoleStatus[] {\n const statuses: ConsoleStatus[] = [];\n for (const entry of raw.flatMap((value) => value.split(\",\"))) {\n const candidate = entry.trim().toUpperCase();\n if (candidate === \"\") continue;\n if (!isConsoleStatus(candidate)) {\n throw new ConsoleBadRequestError(`Unknown status \"${entry.trim()}\".`);\n }\n if (!statuses.includes(candidate)) statuses.push(candidate);\n }\n return statuses;\n}\n\nfunction parseDate(raw: string | null, field: string): Date | undefined {\n if (raw === null || raw === \"\") return undefined;\n const parsed = new Date(raw);\n if (Number.isNaN(parsed.getTime())) {\n throw new ConsoleBadRequestError(`Invalid ${field}: \"${raw}\".`);\n }\n return parsed;\n}\n\nfunction parseFilters(params: URLSearchParams): RunListFilters {\n const filters: RunListFilters = {};\n const statuses = parseStatuses(params.getAll(\"status\"));\n if (statuses.length > 0) filters.status = statuses;\n const workflowId = params.get(\"workflowId\");\n if (workflowId) filters.workflowId = workflowId;\n const workflowType = params.get(\"workflowType\");\n if (workflowType) filters.workflowType = workflowType;\n const definitionVersion = params.get(\"definitionVersion\");\n if (definitionVersion) filters.definitionVersion = definitionVersion;\n const after = parseDate(params.get(\"from\"), \"from\");\n if (after) filters.createdAfter = after;\n const before = parseDate(params.get(\"to\"), \"to\");\n if (before) filters.createdBefore = before;\n return filters;\n}\n\nfunction parseLimit(params: URLSearchParams): number | undefined {\n const raw = params.get(\"limit\");\n if (raw === null || raw === \"\") return undefined;\n const parsed = Number(raw);\n if (!Number.isFinite(parsed)) {\n throw new ConsoleBadRequestError(`Invalid limit: \"${raw}\".`);\n }\n return clampLimit(parsed);\n}\n\n/**\n * Build a fetch handler serving the console's JSON API and its prebuilt UI.\n *\n * It opens no connection: every read goes through `reader`, which the caller\n * built over the client or transaction they already had, so the console runs\n * in the caller's security context and inherits their row-level security\n * rather than working around it.\n */\nexport function createWorkflowConsole(\n options: WorkflowConsoleOptions,\n): WorkflowConsoleHandler {\n const {\n reader,\n kernel,\n authorize,\n actions = false,\n basePath,\n pollIntervalMs = 5000,\n forcePollInterval = false,\n cspNonce,\n onAction,\n } = options;\n\n if (actions && !kernel) {\n throw new Error(\n \"createWorkflowConsole: `actions: true` needs a `kernel` to dispatch to. Console writes go through kernel commands, never SQL.\",\n );\n }\n\n const readOnly = !actions;\n\n async function allowed(\n action: ConsoleAction,\n request: Request,\n runId?: string,\n scope?: { stageId: string; stepId: string },\n ): Promise<boolean> {\n if (authorize === undefined) return false;\n try {\n return (await authorize({ action, request, runId, ...scope })) === true;\n } catch {\n // A throw in the host's own authorisation code denies the call rather\n // than allowing it.\n return false;\n }\n }\n\n async function dispatch(\n request: Request,\n action: ConsoleAction,\n command: { readonly type: string; readonly [key: string]: unknown },\n runId?: string,\n scope?: { stageId: string; stepId: string },\n ): Promise<Response> {\n if (readOnly) {\n return errorResponse(\n \"read_only\",\n \"This console is read-only. Construct it with `actions: true` to enable writes.\",\n 405,\n );\n }\n if (!(await allowed(action, request, runId, scope))) {\n return errorResponse(\"forbidden\", \"Not permitted.\", 403);\n }\n const result = await kernel!.dispatch(command);\n if (onAction) {\n await onAction({\n action,\n runId,\n ...scope,\n request,\n result,\n at: new Date(),\n });\n }\n return json({ result });\n }\n\n async function readBody(request: Request): Promise<Record<string, unknown>> {\n const text = await request.text();\n if (text.trim() === \"\") return {};\n try {\n const parsed: unknown = JSON.parse(text);\n if (\n typeof parsed !== \"object\" ||\n parsed === null ||\n Array.isArray(parsed)\n ) {\n throw new ConsoleBadRequestError(\"Body must be a JSON object.\");\n }\n return parsed as Record<string, unknown>;\n } catch (error) {\n if (error instanceof ConsoleBadRequestError) throw error;\n throw new ConsoleBadRequestError(\"Body must be valid JSON.\");\n }\n }\n\n /**\n * Read the optional `from` of a redrive request.\n *\n * Returns `undefined` when the caller sent none, which the legacy\n * `fromStageId` shape then covers. A malformed one is a bad request\n * rather than a silent fall back to the default mode: an operator who\n * asked to restart the whole run must not get a retry of one stage.\n */\n function parseRedriveFrom(value: unknown): RunRedriveFrom | undefined {\n if (value === undefined) return undefined;\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) {\n throw new ConsoleBadRequestError(\"`from` must be an object.\");\n }\n const kind = (value as Record<string, unknown>).kind;\n if (kind === \"lastFailure\" || kind === \"start\") return { kind };\n if (kind === \"stage\") {\n const stageId = (value as Record<string, unknown>).stageId;\n if (typeof stageId !== \"string\" || stageId === \"\") {\n throw new ConsoleBadRequestError(\n '`from.stageId` is required for `from.kind` \"stage\".',\n );\n }\n return { kind: \"stage\", stageId };\n }\n throw new ConsoleBadRequestError(\n '`from.kind` must be \"lastFailure\", \"start\" or \"stage\".',\n );\n }\n\n async function guardedRead(\n request: Request,\n action: ConsoleAction,\n runId: string | undefined,\n produce: () => Promise<unknown>,\n ): Promise<Response> {\n if (!(await allowed(action, request, runId))) {\n return errorResponse(\"forbidden\", \"Not permitted.\", 403);\n }\n return json(await produce());\n }\n\n return async function handle(request: Request): Promise<Response> {\n const url = new URL(request.url);\n const { basePath: base, route } = splitPath(url.pathname, basePath);\n const params = url.searchParams;\n const method = request.method.toUpperCase();\n\n try {\n // ---- static UI -------------------------------------------------\n if (route === \"/\" && (method === \"GET\" || method === \"HEAD\")) {\n const html = renderIndexHtml({\n basePath: base,\n readOnly,\n pollIntervalMs,\n forcePollInterval,\n capabilities: reader.capabilities,\n nonce: cspNonce?.(request),\n });\n return new Response(method === \"HEAD\" ? null : html, {\n headers: {\n \"content-type\": \"text/html; charset=utf-8\",\n // The document carries the mount path and the feature flags, so\n // it must never be cached; the assets it points at are\n // content-hashed and cached forever.\n \"cache-control\": \"no-store\",\n },\n });\n }\n\n if (route.startsWith(\"/assets/\")) {\n if (method !== \"GET\" && method !== \"HEAD\") {\n return errorResponse(\n \"method_not_allowed\",\n \"Method not allowed.\",\n 405,\n );\n }\n const asset = UI_ASSETS[route.slice(\"/assets/\".length)];\n if (!asset) {\n return errorResponse(\"not_found\", \"No such asset.\", 404);\n }\n return new Response(method === \"HEAD\" ? null : asset.body, {\n headers: {\n \"content-type\": asset.contentType,\n \"cache-control\": \"public, max-age=31536000, immutable\",\n },\n });\n }\n\n // ---- JSON API --------------------------------------------------\n if (!route.startsWith(\"/api/\")) {\n return errorResponse(\"not_found\", \"No such route.\", 404);\n }\n const api = route.slice(\"/api\".length);\n\n if (api === \"/meta\" && method === \"GET\") {\n // Deliberately not behind `authorize`: it carries no run data, and\n // the SPA needs it to render the \"you are not permitted\" state at\n // all. It is the same information already embedded in the HTML.\n return json({\n readOnly,\n basePath: base,\n pollIntervalMs,\n forcePollInterval,\n capabilities: reader.capabilities,\n });\n }\n\n if (api === \"/runs\" && method === \"GET\") {\n return await guardedRead(request, \"runs.read\", undefined, () =>\n reader.listRuns({\n filters: parseFilters(params),\n cursor: params.get(\"cursor\") ?? undefined,\n limit: parseLimit(params),\n }),\n );\n }\n\n const runDetail = /^\\/runs\\/([^/]+)$/.exec(api);\n if (runDetail && method === \"GET\") {\n const runId = decodeURIComponent(runDetail[1]!);\n if (!(await allowed(\"run.read\", request, runId))) {\n return errorResponse(\"forbidden\", \"Not permitted.\", 403);\n }\n const detail = await reader.getRunDetail(runId);\n if (detail === null) {\n return errorResponse(\"not_found\", \"No such run.\", 404);\n }\n return json(detail);\n }\n\n const runEvents = /^\\/runs\\/([^/]+)\\/events$/.exec(api);\n if (runEvents && method === \"GET\") {\n const runId = decodeURIComponent(runEvents[1]!);\n const afterRaw = params.get(\"afterSequence\") ?? \"0\";\n const after = Number(afterRaw);\n if (!Number.isFinite(after) || after < 0) {\n throw new ConsoleBadRequestError(\n `Invalid afterSequence: \"${afterRaw}\".`,\n );\n }\n return await guardedRead(request, \"run.read\", runId, () =>\n reader.listRunEvents(runId, Math.floor(after), parseLimit(params)),\n );\n }\n\n if (api === \"/queue\" && method === \"GET\") {\n return await guardedRead(request, \"queue.read\", undefined, () =>\n reader.getQueueHealth(),\n );\n }\n\n if (api === \"/suspended\" && method === \"GET\") {\n return await guardedRead(request, \"suspended.read\", undefined, () =>\n reader.listSuspendedStages(parseLimit(params)),\n );\n }\n\n if (api === \"/dead-letters\" && method === \"GET\") {\n return await guardedRead(request, \"deadLetters.read\", undefined, () =>\n reader.listDeadLetters(parseLimit(params)),\n );\n }\n\n if (api === \"/workers\" && method === \"GET\") {\n return await guardedRead(request, \"workers.read\", undefined, () =>\n reader.listWorkers(),\n );\n }\n\n if (api === \"/costs\" && method === \"GET\") {\n const by = params.get(\"by\") ?? \"workflow\";\n if (by !== \"workflow\" && by !== \"day\") {\n throw new ConsoleBadRequestError(\n `Invalid by: \"${by}\". Expected \"workflow\" or \"day\".`,\n );\n }\n return await guardedRead(request, \"costs.read\", undefined, () =>\n reader.getCosts({\n by,\n from: parseDate(params.get(\"from\"), \"from\"),\n to: parseDate(params.get(\"to\"), \"to\"),\n }),\n );\n }\n\n const cancel = /^\\/runs\\/([^/]+)\\/cancel$/.exec(api);\n if (cancel && method === \"POST\") {\n const runId = decodeURIComponent(cancel[1]!);\n const body = await readBody(request);\n const reason =\n typeof body.reason === \"string\" ? body.reason : undefined;\n return await dispatch(\n request,\n \"run.cancel\",\n { type: \"run.cancel\", workflowRunId: runId, reason },\n runId,\n );\n }\n\n const rerun = /^\\/runs\\/([^/]+)\\/rerun$/.exec(api);\n if (rerun && method === \"POST\") {\n const runId = decodeURIComponent(rerun[1]!);\n const body = await readBody(request);\n\n // Dispatches `run.redrive`, not the deprecated `run.rerunFrom` it\n // used to: the narrower command refuses a CANCELLED run and cannot\n // re-pin the definition version, so an operator had no way to move\n // a run stranded at a version nothing serves -- the case redriving\n // onto `\"latest\"` exists for. The request shape is a superset of\n // the old one: `fromStageId` still means \"rerun from this stage\".\n const fromStageId = body.fromStageId;\n const from = parseRedriveFrom(body.from);\n if (from === undefined) {\n if (typeof fromStageId !== \"string\" || fromStageId === \"\") {\n throw new ConsoleBadRequestError(\n \"`fromStageId` is required and must be a non-empty string, or pass `from`.\",\n );\n }\n }\n const definitionVersion = body.definitionVersion;\n if (\n definitionVersion !== undefined &&\n (typeof definitionVersion !== \"string\" || definitionVersion === \"\")\n ) {\n throw new ConsoleBadRequestError(\n \"`definitionVersion` must be a non-empty string or omitted.\",\n );\n }\n\n return await dispatch(\n request,\n \"run.rerun\",\n {\n type: \"run.redrive\",\n workflowRunId: runId,\n from: from ?? { kind: \"stage\", stageId: fromStageId as string },\n ...(definitionVersion !== undefined ? { definitionVersion } : {}),\n },\n runId,\n );\n }\n\n const signal =\n /^\\/runs\\/([^/]+)\\/stages\\/([^/]+)\\/steps\\/([^/]+)\\/signal$/.exec(api);\n if (signal && method === \"POST\") {\n const runId = decodeURIComponent(signal[1]!);\n const stageId = decodeURIComponent(signal[2]!);\n const stepId = decodeURIComponent(signal[3]!);\n const body = await readBody(request);\n // Any JSON value is a payload; an absent one is `null`, which is\n // what a bare approval carries. `undefined` cannot arrive over JSON.\n const payload = \"payload\" in body ? body.payload : null;\n const command: StepSignalCommand = {\n type: \"step.signal\",\n workflowRunId: runId,\n stageId,\n stepId,\n payload,\n };\n try {\n return await dispatch(request, \"step.signal\", command, runId, {\n stageId,\n stepId,\n });\n } catch (error) {\n const status = signalErrorStatus(error);\n if (status === undefined) throw error;\n return errorResponse(\n status === 404 ? \"not_found\" : \"conflict\",\n (error as Error).message,\n status,\n );\n }\n }\n\n if (api === \"/dead-letters/replay\" && method === \"POST\") {\n const body = await readBody(request);\n const maxEvents =\n typeof body.maxEvents === \"number\" && Number.isFinite(body.maxEvents)\n ? Math.max(1, Math.floor(body.maxEvents))\n : undefined;\n return await dispatch(request, \"deadLetters.replay\", {\n type: \"plugin.replayDLQ\",\n maxEvents,\n });\n }\n\n return errorResponse(\"not_found\", \"No such route.\", 404);\n } catch (error) {\n if (error instanceof ConsoleQueryTimeoutError) {\n // Non-fatal by design: the UI keeps its filter bar interactive and\n // shows this inline, so the operator can narrow the query and retry\n // instead of staring at a spinner.\n return errorResponse(\"query_timeout\", error.message, 504);\n }\n if (error instanceof ConsoleBadRequestError) {\n return errorResponse(\"bad_request\", error.message, 400);\n }\n return errorResponse(\n \"internal_error\",\n error instanceof Error ? error.message : \"Unexpected console error.\",\n 500,\n );\n }\n };\n}\n"]}
|