tubeless 0.2.14 → 0.2.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/core/pipeline-validation.js +1 -1
- package/dist/core/pipeline-validation.js.map +1 -1
- package/dist/studio/run-store-ui-client-browser.js +2 -2
- package/dist/studio/run-store-ui-client-transport.d.ts +3 -1
- package/dist/studio/run-store-ui-client-transport.js +65 -29
- package/dist/studio/run-store-ui-client-transport.js.map +1 -1
- package/dist/studio/run-store-ui-client.d.ts +10 -3
- package/dist/studio/run-store-ui-client.js +165 -52
- package/dist/studio/run-store-ui-client.js.map +1 -1
- package/dist/studio/run-store-ui-data-controller.d.ts +2 -1
- package/dist/studio/run-store-ui-data-controller.js +31 -9
- package/dist/studio/run-store-ui-data-controller.js.map +1 -1
- package/dist/studio/run-store-ui-debugging.d.ts +13 -0
- package/dist/studio/run-store-ui-debugging.js +48 -0
- package/dist/studio/run-store-ui-debugging.js.map +1 -0
- package/dist/studio/run-store-ui-hosting.d.ts +18 -0
- package/dist/studio/run-store-ui-hosting.js +88 -0
- package/dist/studio/run-store-ui-hosting.js.map +1 -0
- package/dist/studio/run-store-ui-http.d.ts +1 -1
- package/dist/studio/run-store-ui-http.js +2 -2
- package/dist/studio/run-store-ui-http.js.map +1 -1
- package/dist/studio/run-store-ui-page.d.ts +2 -0
- package/dist/studio/run-store-ui-page.js +44 -3
- package/dist/studio/run-store-ui-page.js.map +1 -1
- package/dist/studio/run-store-ui.d.ts +2 -0
- package/dist/studio/run-store-ui.js +45 -9
- package/dist/studio/run-store-ui.js.map +1 -1
- package/dist/workbench/workbench-ui.js +18 -7
- package/dist/workbench/workbench-ui.js.map +1 -1
- package/docs/README.md +1 -1
- package/docs/agent-guide.md +8 -2
- package/docs/cli.md +11 -0
- package/docs/llms.txt +2 -0
- package/docs/recipes.md +10 -0
- package/docs/studio.md +160 -17
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@ cycling kind of tubeless: no inner tube, and no extra runtime to keep the work r
|
|
|
21
21
|
|
|
22
22
|
Pipelines run in your process with no runtime dependencies. You can preview
|
|
23
23
|
execution, select a target and its dependencies, compose child pipelines, and
|
|
24
|
-
track progress.
|
|
24
|
+
track progress. The optional CLI and [Studio](./docs/studio.md) run locally or behind your authenticated admin gateway.
|
|
25
25
|
For scheduling or crash recovery, pair it with a [queue or workflow engine](./docs/comparison.md).
|
|
26
26
|
|
|
27
27
|
## Installation
|
|
@@ -7,7 +7,7 @@ export class PipelineBoundaryValidationError extends Error {
|
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
9
|
function normalizeValidationPath(path) {
|
|
10
|
-
if (!path
|
|
10
|
+
if (!path)
|
|
11
11
|
return undefined;
|
|
12
12
|
return path.map((segment) => {
|
|
13
13
|
const key = typeof segment === "object" && segment !== null ? segment.key : segment;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline-validation.js","sourceRoot":"","sources":["../../src/core/pipeline-validation.ts"],"names":[],"mappings":"AAQA,MAAM,OAAO,+BAAgC,SAAQ,KAAK;IAG7C,MAAM;IAFjB,YACE,OAAe,EACN,MAA0C,EACnD,KAAe;QAEf,KAAK,CAAC,OAAO,EAAE,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;sBAHnD,MAAM;QAIf,IAAI,CAAC,IAAI,GAAG,iCAAiC,CAAC;IAChD,CAAC;CACF;AAED,SAAS,uBAAuB,CAC9B,IAAmC;IAEnC,IAAI,CAAC,IAAI
|
|
1
|
+
{"version":3,"file":"pipeline-validation.js","sourceRoot":"","sources":["../../src/core/pipeline-validation.ts"],"names":[],"mappings":"AAQA,MAAM,OAAO,+BAAgC,SAAQ,KAAK;IAG7C,MAAM;IAFjB,YACE,OAAe,EACN,MAA0C,EACnD,KAAe;QAEf,KAAK,CAAC,OAAO,EAAE,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;sBAHnD,MAAM;QAIf,IAAI,CAAC,IAAI,GAAG,iCAAiC,CAAC;IAChD,CAAC;CACF;AAED,SAAS,uBAAuB,CAC9B,IAAmC;IAEnC,IAAI,CAAC,IAAI;QAAE,OAAO,SAAS,CAAC;IAC5B,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE;QAC1B,MAAM,GAAG,GAAG,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC;QACpF,OAAO,OAAO,GAAG,KAAK,QAAQ,IAAI,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IAChF,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,qBAAqB,CAAC,KAA8B;IAC3D,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACnD,OAAO,QAAQ,CAAC,CAAC,CAAC,GAAG,QAAQ,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC;AACpE,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,MAAe,EACf,KAAc,EACd,QAAgB;IAEhB,IAAI,MAA0D,CAAC;IAC/D,IAAI,CAAC;QACH,MAAM,GAAG,MAAM,MAAM,CAAC,WAAW,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACrD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,+BAA+B,CACvC,GAAG,QAAQ,YAAY,MAAM,CAAC,WAAW,CAAC,CAAC,MAAM,0BAA0B,EAC3E,EAAE,EACF,KAAK,CACN,CAAC;IACJ,CAAC;IACD,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;QAClB,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;YACzC,MAAM,IAAI,GAAG,uBAAuB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YACjD,MAAM,UAAU,GAA4B,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC;YACvE,IAAI,IAAI;gBAAE,UAAU,CAAC,IAAI,GAAG,IAAI,CAAC;YACjC,OAAO,UAAU,CAAC;QACpB,CAAC,CAAC,CAAC;QACH,MAAM,IAAI,+BAA+B,CACvC,GAAG,QAAQ,uBAAuB,MAAM,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAChF,MAAM,CACP,CAAC;IACJ,CAAC;IACD,OAAO,MAAM,CAAC,KAAK,CAAC;AACtB,CAAC","sourcesContent":["import type {\n InferSchemaOutput,\n PipelineValidationIssue,\n StandardSchemaV1,\n StandardSchemaV1Issue,\n StandardSchemaV1Result,\n} from \"./pipeline-types.js\";\n\nexport class PipelineBoundaryValidationError extends Error {\n constructor(\n message: string,\n readonly issues: readonly PipelineValidationIssue[],\n cause?: unknown\n ) {\n super(message, cause === undefined ? undefined : { cause });\n this.name = \"PipelineBoundaryValidationError\";\n }\n}\n\nfunction normalizeValidationPath(\n path: StandardSchemaV1Issue[\"path\"]\n): readonly (number | string)[] | undefined {\n if (!path) return undefined;\n return path.map((segment) => {\n const key = typeof segment === \"object\" && segment !== null ? segment.key : segment;\n return typeof key === \"number\" || typeof key === \"string\" ? key : String(key);\n });\n}\n\nfunction renderValidationIssue(issue: PipelineValidationIssue): string {\n const location = issue.path?.map(String).join(\".\");\n return location ? `${location}: ${issue.message}` : issue.message;\n}\n\nexport async function validateStandardSchema<TSchema extends StandardSchemaV1>(\n schema: TSchema,\n value: unknown,\n boundary: string\n): Promise<InferSchemaOutput<TSchema>> {\n let result: StandardSchemaV1Result<InferSchemaOutput<TSchema>>;\n try {\n result = await schema[\"~standard\"].validate(value);\n } catch (error) {\n throw new PipelineBoundaryValidationError(\n `${boundary} schema (${schema[\"~standard\"].vendor}) threw while validating`,\n [],\n error\n );\n }\n if (result.issues) {\n const issues = result.issues.map((issue) => {\n const path = normalizeValidationPath(issue.path);\n const normalized: PipelineValidationIssue = { message: issue.message };\n if (path) normalized.path = path;\n return normalized;\n });\n throw new PipelineBoundaryValidationError(\n `${boundary} validation failed: ${issues.map(renderValidationIssue).join(\"; \")}`,\n issues\n );\n }\n return result.value;\n}\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var x0,T,x1,p2,W0,D1,h1,m1,$1,y0,b0,v1,X1,K1,Z1,o2,j0={},V0=[],i2=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,h0=Array.isArray;function $0(G,$){for(var K in $)G[K]=$[K];return G}function W1(G){G&&G.parentNode&&G.parentNode.removeChild(G)}function l2(G,$,K){var X,Q,z,W={};for(z in $)z=="key"?X=$[z]:z=="ref"?Q=$[z]:W[z]=$[z];if(arguments.length>2&&(W.children=arguments.length>3?x0.call(arguments,2):K),typeof G=="function"&&G.defaultProps!=null)for(z in G.defaultProps)W[z]===void 0&&(W[z]=G.defaultProps[z]);return I0(G,W,X,Q,null)}function I0(G,$,K,X,Q){var z={type:G,props:$,key:K,ref:X,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:Q==null?++x1:Q,__i:-1,__u:0};return Q==null&&T.vnode!=null&&T.vnode(z),z}function g(G){return G.children}function D0(G,$){this.props=G,this.context=$}function N0(G,$){if($==null)return G.__?N0(G.__,G.__i+1):null;for(var K;$<G.__k.length;$++)if((K=G.__k[$])!=null&&K.__e!=null)return K.__e;return typeof G.type=="function"?N0(G):null}function u2(G){if(G.__P&&G.__d){var $=G.__v,K=$.__e,X=[],Q=[],z=$0({},$);z.__v=$.__v+1,T.vnode&&T.vnode(z),z1(G.__P,z,$,G.__n,G.__P.namespaceURI,32&$.__u?[K]:null,X,K==null?N0($):K,!!(32&$.__u),Q),z.__v=$.__v,z.__.__k[z.__i]=z,i1(X,z,Q),$.__e=$.__=null,z.__e!=K&&c1(z)}}function c1(G){if((G=G.__)!=null&&G.__c!=null)return G.__e=G.__c.base=null,G.__k.some(function($){if($!=null&&$.__e!=null)return G.__e=G.__c.base=$.__e}),c1(G)}function j1(G){(!G.__d&&(G.__d=!0)&&W0.push(G)&&!E0.__r++||D1!=T.debounceRendering)&&((D1=T.debounceRendering)||h1)(E0)}function E0(){try{for(var G,$=1;W0.length;)W0.length>$&&W0.sort(m1),G=W0.shift(),$=W0.length,u2(G)}finally{W0.length=E0.__r=0}}function d1(G,$,K,X,Q,z,W,U,A,J,H){var M,Y,N,q,P,O,L=X&&X.__k||V0,B=$.length;for(A=r2(K,$,L,A,B),M=0;M<B;M++)(N=K.__k[M])!=null&&(Y=N.__i!=-1&&L[N.__i]||j0,N.__i=M,O=z1(G,N,Y,Q,z,W,U,A,J,H),q=N.__e,N.ref&&Y.ref!=N.ref&&(Y.ref&&Q1(Y.ref,null,N),H.push(N.ref,N.__c||q,N)),P==null&&q!=null&&(P=q),4&N.__u?(A=p1(N,A,G),Y.__e&&(Y.__e=null)):typeof N.type=="function"&&O!==void 0?A=O:q&&(A=q.nextSibling),N.__u&=-7);return K.__e=P,A}function r2(G,$,K,X,Q){var z,W,U,A,J,H=K.length,M=H,Y=0;for(G.__k=Array(Q),z=0;z<Q;z++)(W=$[z])!=null&&typeof W!="boolean"&&typeof W!="function"?(typeof W=="string"||typeof W=="number"||typeof W=="bigint"||W.constructor==String?W=G.__k[z]=I0(null,W,null,null,null):h0(W)?W=G.__k[z]=I0(g,{children:W},null,null,null):W.constructor===void 0&&W.__b>0?W=G.__k[z]=I0(W.type,W.props,W.key,W.ref?W.ref:null,W.__v):G.__k[z]=W,A=z+Y,W.__=G,W.__b=G.__b+1,U=null,(J=W.__i=s2(W,K,A,M))!=-1&&(M--,(U=K[J])&&(U.__u|=2)),U==null||U.__v==null?(J==-1&&(Q>H?Y--:Q<H&&Y++),typeof W.type!="function"&&(W.__u|=4)):J!=A&&(J==A-1?Y--:J==A+1?Y++:(J>A?Y--:Y++,W.__u|=4))):G.__k[z]=null;if(M)for(z=0;z<H;z++)(U=K[z])!=null&&(2&U.__u)==0&&(U.__e==X&&(X=N0(U)),u1(U,U));return X}function p1(G,$,K){var X,Q;if(typeof G.type=="function"){for(X=G.__k,Q=0;X&&Q<X.length;Q++)X[Q]&&(X[Q].__=G,$=p1(X[Q],$,K));return $}G.__e!=$&&($&&G.type&&!$.parentNode&&($=N0(G)),$=K.insertBefore(G.__e,$||null));do $=$&&$.nextSibling;while($!=null&&$.nodeType==8);return $}function s2(G,$,K,X){var Q,z,W,U=G.key,A=G.type,J=$[K],H=J!=null&&(2&J.__u)==0;if(J===null&&U==null||H&&U==J.key&&A==J.type)return K;if(X>(H?1:0)){for(Q=K-1,z=K+1;Q>=0||z<$.length;)if((J=$[W=Q>=0?Q--:z++])!=null&&(2&J.__u)==0&&U==J.key&&A==J.type)return W}return-1}function V1(G,$,K){$[0]=="-"?G.setProperty($,K==null?"":K):G[$]=K==null?"":typeof K!="number"||i2.test($)?K:K+"px"}function S0(G,$,K,X,Q){var z,W;G:if($=="style")if(typeof K=="string")G.style.cssText=K;else{if(typeof X=="string"&&(G.style.cssText=X=""),X)for($ in X)K&&$ in K||V1(G.style,$,"");if(K)for($ in K)X&&K[$]==X[$]||V1(G.style,$,K[$])}else if($[0]=="o"&&$[1]=="n")z=$!=($=$.replace(v1,"$1")),W=$.toLowerCase(),$=W in G||$=="onFocusOut"||$=="onFocusIn"?W.slice(2):$.slice(2),G.l||(G.l={}),G.l[$+z]=K,K?X?K[b0]=X[b0]:(K[b0]=X1,G.addEventListener($,z?Z1:K1,z)):G.removeEventListener($,z?Z1:K1,z);else{if(Q=="http://www.w3.org/2000/svg")$=$.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if($!="width"&&$!="height"&&$!="href"&&$!="list"&&$!="form"&&$!="tabIndex"&&$!="download"&&$!="rowSpan"&&$!="colSpan"&&$!="role"&&$!="popover"&&$ in G)try{G[$]=K==null?"":K;break G}catch(U){}typeof K=="function"||(K==null||K===!1&&$[4]!="-"?G.removeAttribute($):G.setAttribute($,$=="popover"&&K==1?"":K))}}function E1(G){return function($){if(this.l){var K=this.l[$.type+G];if($[y0]==null)$[y0]=X1++;else if($[y0]<K[b0])return;return K(T.event?T.event($):$)}}}function z1(G,$,K,X,Q,z,W,U,A,J){var H,M,Y,N,q,P,O,L,B,k,x,h,n,G0,X0,b,C=$.type;if($.constructor!==void 0)return null;128&K.__u&&(A=!!(32&K.__u),z=[U=$.__e=K.__e]),(H=T.__b)&&H($);G:if(typeof C=="function"){M=W.length;try{if(B=$.props,k=C.prototype&&C.prototype.render,x=(H=C.contextType)&&X[H.__c],h=H?x?x.props.value:H.__:X,K.__c?L=(Y=$.__c=K.__c).__=Y.__E:(k?$.__c=Y=new C(B,h):($.__c=Y=new D0(B,h),Y.constructor=C,Y.render=n2),x&&x.sub(Y),Y.state||(Y.state={}),Y.__n=X,N=Y.__d=!0,Y.__h=[],Y._sb=[]),k&&Y.__s==null&&(Y.__s=Y.state),k&&C.getDerivedStateFromProps!=null&&(Y.__s==Y.state&&(Y.__s=$0({},Y.__s)),$0(Y.__s,C.getDerivedStateFromProps(B,Y.__s))),q=Y.props,P=Y.state,Y.__v=$,N)k&&C.getDerivedStateFromProps==null&&Y.componentWillMount!=null&&Y.componentWillMount(),k&&Y.componentDidMount!=null&&Y.__h.push(Y.componentDidMount);else{if(k&&C.getDerivedStateFromProps==null&&B!==q&&Y.componentWillReceiveProps!=null&&Y.componentWillReceiveProps(B,h),$.__v==K.__v||!Y.__e&&Y.shouldComponentUpdate!=null&&Y.shouldComponentUpdate(B,Y.__s,h)===!1){$.__v!=K.__v&&(Y.props=B,Y.state=Y.__s,Y.__d=!1),$.__e=K.__e,$.__k=K.__k,$.__k.some(function(d){d&&(d.__=$)}),V0.push.apply(Y.__h,Y._sb),Y._sb=[],Y.__h.length&&W.push(Y),U=N0(K);break G}Y.componentWillUpdate!=null&&Y.componentWillUpdate(B,Y.__s,h),k&&Y.componentDidUpdate!=null&&Y.__h.push(function(){Y.componentDidUpdate(q,P,O)})}if(Y.context=h,Y.props=B,Y.__P=G,Y.__e=!1,n=T.__r,G0=0,k)Y.state=Y.__s,Y.__d=!1,n&&n($),H=Y.render(Y.props,Y.state,Y.context),V0.push.apply(Y.__h,Y._sb),Y._sb=[];else do Y.__d=!1,n&&n($),H=Y.render(Y.props,Y.state,Y.context),Y.state=Y.__s;while(Y.__d&&++G0<25);Y.state=Y.__s,Y.getChildContext!=null&&(X=$0($0({},X),Y.getChildContext())),k&&!N&&Y.getSnapshotBeforeUpdate!=null&&(O=Y.getSnapshotBeforeUpdate(q,P)),X0=H!=null&&H.type===g&&H.key==null?l1(H.props.children):H,U=d1(G,h0(X0)?X0:[X0],$,K,X,Q,z,W,U,A,J),Y.base=$.__e,$.__u&=-161,Y.__h.length&&W.push(Y),L&&(Y.__E=Y.__=null)}catch(d){if(W.length=M,$.__v=null,A||z!=null){if(d.then){for($.__u|=A?160:128;U&&U.nodeType==8&&U.nextSibling;)U=U.nextSibling;z!=null&&(z[z.indexOf(U)]=null),$.__e=U}else if(z!=null)for(b=z.length;b--;)W1(z[b])}else $.__e=K.__e;$.__k==null&&($.__k=K.__k||[]),d.then||o1($),T.__e(d,$,K)}}else z==null&&$.__v==K.__v?($.__k=K.__k,$.__e=K.__e):U=$.__e=t2(K.__e,$,K,X,Q,z,W,A,J);return(H=T.diffed)&&H($),128&$.__u?void 0:U}function o1(G){G&&(G.__c&&(G.__c.__e=!0),G.__k&&G.__k.some(o1))}function i1(G,$,K){for(var X=0;X<K.length;X++)Q1(K[X],K[++X],K[++X]);T.__c&&T.__c($,G),G.some(function(Q){try{G=Q.__h,Q.__h=[],G.some(function(z){z.call(Q)})}catch(z){T.__e(z,Q.__v)}})}function l1(G){return typeof G!="object"||G==null||G.__b>0?G:h0(G)?G.map(l1):G.constructor!==void 0?null:$0({},G)}function t2(G,$,K,X,Q,z,W,U,A){var J,H,M,Y,N,q,P,O=K.props||j0,L=$.props,B=$.type;if(B=="svg"?Q="http://www.w3.org/2000/svg":B=="math"?Q="http://www.w3.org/1998/Math/MathML":Q||(Q="http://www.w3.org/1999/xhtml"),z!=null){for(J=0;J<z.length;J++)if((N=z[J])&&"setAttribute"in N==!!B&&(B?N.localName==B:N.nodeType==3)){G=N,z[J]=null;break}}if(G==null){if(B==null)return document.createTextNode(L);G=document.createElementNS(Q,B,L.is&&L),U&&(T.__m&&T.__m($,z),U=!1),z=null}if(B==null)O===L||U&&G.data==L||(G.data=L);else{if(z=B=="textarea"&&L.defaultValue!=null?null:z&&x0.call(G.childNodes),!U&&z!=null)for(O={},J=0;J<G.attributes.length;J++)O[(N=G.attributes[J]).name]=N.value;for(J in O)N=O[J],J=="dangerouslySetInnerHTML"?M=N:J=="children"||(J in L)||J=="value"&&("defaultValue"in L)||J=="checked"&&("defaultChecked"in L)||S0(G,J,null,N,Q);for(J in L)N=L[J],J=="children"?Y=N:J=="dangerouslySetInnerHTML"?H=N:J=="value"?q=N:J=="checked"?P=N:U&&typeof N!="function"||O[J]===N||S0(G,J,N,O[J],Q);if(H)U||M&&(H.__html==M.__html||H.__html==G.innerHTML)||(G.innerHTML=H.__html),$.__k=[];else if(M&&(G.innerHTML=""),d1($.type=="template"?G.content:G,h0(Y)?Y:[Y],$,K,X,B=="foreignObject"?"http://www.w3.org/1999/xhtml":Q,z,W,z?z[0]:K.__k&&N0(K,0),U,A),z!=null)for(J=z.length;J--;)W1(z[J]);U&&B!="textarea"||(J="value",B=="progress"&&q==null?G.removeAttribute("value"):q!=null&&(q!==G[J]||B=="progress"&&!q||B=="option"&&q!=O[J])&&S0(G,J,q,O[J],Q),J="checked",P!=null&&P!=G[J]&&S0(G,J,P,O[J],Q))}return G}function Q1(G,$,K){try{if(typeof G=="function"){var X=typeof G.__u=="function";X&&G.__u(),X&&$==null||(G.__u=G($))}else G.current=$}catch(Q){T.__e(Q,K)}}function u1(G,$,K){var X,Q;if(T.unmount&&T.unmount(G),(X=G.ref)&&(X.current&&X.current!=G.__e||Q1(X,null,$)),(X=G.__c)!=null){if(X.componentWillUnmount)try{X.componentWillUnmount()}catch(z){T.__e(z,$)}X.base=X.__P=X.__n=null}if(X=G.__k)for(Q=0;Q<X.length;Q++)X[Q]&&u1(X[Q],$,K||typeof G.type!="function");K||W1(G.__e),G.__c=G.__=G.__e=void 0}function n2(G,$,K){return this.constructor(G,K)}function r1(G,$,K){var X,Q,z,W;$==document&&($=document.documentElement),T.__&&T.__(G,$),Q=(X=typeof K=="function")?null:K&&K.__k||$.__k,z=[],W=[],z1($,G=(!X&&K||$).__k=l2(g,null,[G]),Q||j0,j0,$.namespaceURI,!X&&K?[K]:Q?null:$.firstChild?x0.call($.childNodes):null,z,!X&&K?K:Q?Q.__e:$.firstChild,X,W),i1(z,G,W),G.props.children=null}x0=V0.slice,T={__e:function(G,$,K,X){for(var Q,z,W;$=$.__;)if((Q=$.__c)&&!Q.__)try{if((z=Q.constructor)&&z.getDerivedStateFromError!=null&&(Q.setState(z.getDerivedStateFromError(G)),W=Q.__d),Q.componentDidCatch!=null&&(Q.componentDidCatch(G,X||{}),W=Q.__d),W)return Q.__E=Q}catch(U){G=U}throw G}},x1=0,p2=function(G){return G!=null&&G.constructor===void 0},D0.prototype.setState=function(G,$){var K;K=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=$0({},this.state),typeof G=="function"&&(G=G($0({},K),this.props)),G&&$0(K,G),G!=null&&this.__v&&($&&this._sb.push($),j1(this))},D0.prototype.forceUpdate=function(G){this.__v&&(this.__e=!0,G&&this.__h.push(G),j1(this))},D0.prototype.render=g,W0=[],h1=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,m1=function(G,$){return G.__v.__b-$.__v.__b},E0.__r=0,$1=Math.random().toString(8),y0="__d"+$1,b0="__a"+$1,v1=/(PointerCapture)$|Capture$/i,X1=0,K1=E1(!1),Z1=E1(!0),o2=0;var k0,I,U1,s1,v0=0,Z2=[],D=T,t1=D.__b,n1=D.__r,a1=D.diffed,e1=D.__c,G2=D.unmount,$2=D.__;function J1(G,$){D.__h&&D.__h(I,G,v0||$),v0=0;var K=I.__H||(I.__H={__:[],__h:[]});return G>=K.__.length&&K.__.push({}),K.__[G]}function R(G){return v0=1,a2(W2,G)}function a2(G,$,K){var X=J1(k0++,2);if(X.t=G,!X.__c&&(X.__=[K?K($):W2(void 0,$),function(U){var A=X.__N?X.__N[0]:X.__[0],J=X.t(A,U);A!==J&&(X.__N=[J,X.__[1]],X.__c.setState({}))}],X.__c=I,!I.__f)){var Q=function(U,A,J){if(!X.__c.__H)return!0;var H=!1,M=X.__c.props!==U;if(X.__c.__H.__.some(function(N){if(N.__N){H=!0;var q=N.__[0];N.__=N.__N,N.__N=void 0,q!==N.__[0]&&(M=!0)}}),z){var Y=z.call(this,U,A,J);return H?Y||M:Y}return!H||M};I.__f=!0;var{shouldComponentUpdate:z,componentWillUpdate:W}=I;I.componentWillUpdate=function(U,A,J){if(this.__e){var H=z;z=void 0,Q(U,A,J),z=H}W&&W.call(this,U,A,J)},I.shouldComponentUpdate=Q}return X.__N||X.__}function s(G,$){var K=J1(k0++,3);!D.__s&&X2(K.__H,$)&&(K.__=G,K.u=$,I.__H.__h.push(K))}function w0(G){return v0=5,c0(function(){return{current:G}},[])}function c0(G,$){var K=J1(k0++,7);return X2(K.__H,$)&&(K.__=G(),K.__H=$,K.__h=G),K.__}function e2(){for(var G;G=Z2.shift();){var $=G.__H;if(G.__P&&$)try{$.__h.some(m0),$.__h.some(Y1),$.__h=[]}catch(K){$.__h=[],D.__e(K,G.__v)}}}D.__b=function(G){I=null,t1&&t1(G)},D.__=function(G,$){G&&$.__k&&$.__k.__m&&(G.__m=$.__k.__m),$2&&$2(G,$)},D.__r=function(G){n1&&n1(G),k0=0;var $=(I=G.__c).__H;$&&(U1===I?($.__h=[],I.__h=[],$.__.some(function(K){K.__N&&(K.__=K.__N),K.u=K.__N=void 0})):($.__h.some(m0),$.__h.some(Y1),$.__h=[],k0=0)),U1=I},D.diffed=function(G){a1&&a1(G);var $=G.__c;$&&$.__H&&($.__H.__h.length&&(Z2.push($)!==1&&s1===D.requestAnimationFrame||((s1=D.requestAnimationFrame)||G4)(e2)),$.__H.__.some(function(K){K.u&&(K.__H=K.u,K.u=void 0)})),U1=I=null},D.__c=function(G,$){$.some(function(K){try{K.__h.some(m0),K.__h=K.__h.filter(function(X){return!X.__||Y1(X)})}catch(X){$.some(function(Q){Q.__h&&(Q.__h=[])}),$=[],D.__e(X,K.__v)}}),e1&&e1(G,$)},D.unmount=function(G){G2&&G2(G);var $,K=G.__c;K&&K.__H&&(K.__H.__.some(function(X){try{m0(X)}catch(Q){$=Q}}),K.__H=void 0,$&&D.__e($,K.__v))};var K2=typeof requestAnimationFrame=="function";function G4(G){var $,K=function(){clearTimeout(X),K2&&cancelAnimationFrame($),setTimeout(G)},X=setTimeout(K,35);K2&&($=requestAnimationFrame(K))}function m0(G){var $=I,K=G.__c;typeof K=="function"&&(G.__c=void 0,K()),I=$}function Y1(G){var $=I;G.__c=G.__(),I=$}function X2(G,$){return!G||G.length!==$.length||$.some(function(K,X){return K!==G[X]})}function W2(G,$){return typeof $=="function"?$(G):$}var $4=0;function Z(G,$,K,X,Q,z){$||($={});var W,U,A=$;if("ref"in A)for(U in A={},$)U=="ref"?W=$[U]:A[U]=$[U];var J={type:G,props:A,key:K,ref:W,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--$4,__i:-1,__u:0,__source:Q,__self:z};if(typeof G=="function"&&(W=G.defaultProps))for(U in W)A[U]===void 0&&(A[U]=W[U]);return T.vnode&&T.vnode(J),J}function B0({metadata:G}){if(!G)return null;return Z("details",{class:"step-metadata",children:[Z("summary",{children:[G.owner,G.domain,...G.tags??[]].filter(Boolean).join(" · ")||"Metadata"},void 0,!1,void 0,this),Z("pre",{children:JSON.stringify(G,null,2)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function K4(G,$,K){let X=new Map,Q=$.trim().toLowerCase();for(let z of G){if(!`${z.id} ${JSON.stringify(z.metadata??{})}`.toLowerCase().includes(Q))continue;let W=K==="none"?"Steps":z.metadata?.[K],U=X.get(W)??[];U.push(z),X.set(W,U)}return X}function d0({steps:G}){let[$,K]=R(""),[X,Q]=R("none"),z=K4(G,$,X);return Z("details",{children:[Z("summary",{children:["Explore steps (",G.length,")"]},void 0,!0,void 0,this),Z("label",{class:"field",children:["Search steps and metadata",Z("input",{type:"search",value:$,onInput:(W)=>K(W.currentTarget.value)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z("label",{class:"field",children:["Group steps",Z("select",{value:X,onChange:(W)=>{let U=W.currentTarget.value;if(U==="owner"||U==="domain"||U==="none")Q(U)},children:[Z("option",{value:"none",children:"Execution order"},void 0,!1,void 0,this),Z("option",{value:"owner",children:"Owner"},void 0,!1,void 0,this),Z("option",{value:"domain",children:"Domain"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),z.size===0&&Z("p",{children:"No matching steps."},void 0,!1,void 0,this),[...z].map(([W,U])=>Z("section",{children:[Z("h4",{children:W??"Unassigned"},void 0,!1,void 0,this),W===void 0&&Z("small",{children:["No ",X," specified"]},void 0,!0,void 0,this),Z("ul",{children:U.map((A)=>Z("li",{children:[Z("code",{children:A.id},void 0,!1,void 0,this),Z(B0,{metadata:A.metadata},void 0,!1,void 0,this)]},A.id,!0,void 0,this))},void 0,!1,void 0,this)]},JSON.stringify([W]),!0,void 0,this))]},void 0,!0,void 0,this)}function A1(G){let $=G.metadata?.tubelessCache;if(!$||typeof $!=="object"||Array.isArray($)||!("implementationVersion"in $)||typeof $.implementationVersion!=="string"||!("createdAtMs"in $)||typeof $.createdAtMs!=="number"||!Number.isFinite($.createdAtMs)||!("ageMs"in $)||typeof $.ageMs!=="number"||!Number.isFinite($.ageMs))return;return{implementationVersion:$.implementationVersion,createdAtMs:$.createdAtMs,ageMs:$.ageMs}}function z2({artifacts:G,stepId:$}){let[K,X]=R("all"),Q=G.filter((W)=>A1(W.artifact)),z=Q.length>0&&Q.length<G.length;return Z(g,{children:[z&&Z("label",{class:"artifact-filter",children:["Artifacts for ",$," ",Z("select",{value:K,onChange:(W)=>X(W.currentTarget.value),children:[Z("option",{value:"all",children:"All artifacts"},void 0,!1,void 0,this),Z("option",{value:"cache",children:"Cached outputs"},void 0,!1,void 0,this),Z("option",{value:"application",children:"Application artifacts"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),G.map((W,U)=>{let A=A1(W.artifact);if(z&&(K==="cache"&&!A||K==="application"&&A))return null;let J=A?new Date(A.createdAtMs):void 0;return Z("details",{class:"artifact-detail",children:[Z("summary",{children:[A?"Cached output ":W.preview?"Preview ":"Artifact ",W.operation,!A&&`: ${W.artifact.id||W.artifact.uri}`]},void 0,!0,void 0,this),A&&Z("div",{class:"artifact-info",children:[Z("div",{children:["Created:"," ",J&&Number.isFinite(J.getTime())?J.toISOString():String(A.createdAtMs)]},void 0,!0,void 0,this),Z("div",{children:["Age at ",W.operation,": ",A.ageMs," ms"]},void 0,!0,void 0,this),W.artifact.uri&&Z("div",{children:["Location: ",W.artifact.uri]},void 0,!0,void 0,this),W.artifact.byteSize!==void 0&&Z("div",{children:["Size: ",W.artifact.byteSize," bytes"]},void 0,!0,void 0,this),Z("p",{class:"artifact-note",children:"Recorded operation; current cache availability is not checked."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),A?Z("details",{class:"artifact-receipt",children:[Z("summary",{children:"Receipt metadata"},void 0,!1,void 0,this),Z("pre",{children:JSON.stringify(W.artifact,null,2)},void 0,!1,void 0,this)]},void 0,!0,void 0,this):Z("pre",{children:JSON.stringify(W.artifact,null,2)},void 0,!1,void 0,this)]},U,!0,void 0,this)})]},void 0,!0,void 0,this)}function _0(G){if(Array.isArray(G))return G.map(_0);if(G!==null&&typeof G==="object")return Object.fromEntries(Object.entries(G).sort(([$],[K])=>$<K?-1:$>K?1:0).map(([$,K])=>[$,_0(K)]));return G}var Q2={dependencies:"Required edges",optionalDependencies:"Optional edges",skipAfterFailureOf:"Failure gates",dryRun:"Dry-run policy",runtimeSkipPossible:"Skip policy",outputValidated:"Output validation",cache:"Cache settings",nestedPipeline:"Child pipeline",remote:"Remote adapter"};function U2(G,$){let K=[],X=(W,U,A,J)=>{let H=JSON.stringify(U),M=JSON.stringify(A);if(H!==M)K.push({field:W,before:H,after:M,...J?{stepId:J}:{}})};X("Implementation version",G.identity.implementationVersion,$.identity.implementationVersion),X("Execution order",G.steps.map(({id:W})=>W),$.steps.map(({id:W})=>W)),X("Metadata",_0(G.metadata),_0($.metadata)),X("Targets",G.targetIds,$.targetIds),X("Required finalizer steps",G.requiredFinalizerStepIds,$.requiredFinalizerStepIds),X("Options validation",G.optionsValidated,$.optionsValidated),X("Result validation",G.resultValidated,$.resultValidated);let Q=new Map(G.steps.map((W)=>[W.id,W])),z=new Map($.steps.map((W)=>[W.id,W]));for(let W of G.steps)if(!z.has(W.id))K.push({stepId:W.id,field:"Removed step"});for(let W of $.steps){let U=Q.get(W.id);if(!U){K.push({stepId:W.id,field:"Added step"});continue}X("Metadata",_0(U.metadata),_0(W.metadata),W.id);for(let A of Object.keys(Q2)){let J=A;X(Q2[J],U[J],W[J],W.id)}}return K}function a(G){return JSON.stringify([G.pipelineId,G.identity?.definitionId??null])}function Y2(G){let $=G.identity;return`${G.pipelineId} · ${$?$.definitionId.slice(7,19):"Legacy (identity not recorded)"} · ${$?.implementationVersion??"implementation unknown"} · ${G.runCount} ${G.runCount===1?"run":"runs"}`}function J2({definitions:G,runs:$,onSelect:K}){let[X,Q]=R(""),[z,W]=R(""),U=G.find((Y)=>a(Y)===X)??G[0];if(!U)return null;let A=G.filter((Y)=>Y.pipelineId===U.pipelineId&&a(Y)!==a(U)),J=A.find((Y)=>a(Y)===z)??A[0],H=$.filter((Y)=>Y.pipelineId===U.pipelineId&&Y.definitionIdentity?.definitionId===U.identity?.definitionId),M=J?.snapshot&&U.snapshot?U2(J.snapshot,U.snapshot):void 0;return Z("section",{class:"sheet definition-history",children:[Z("div",{class:"sheet-head",children:Z("div",{children:[Z("div",{class:"sheet-title",children:"Observed definitions"},void 0,!1,void 0,this),Z("div",{class:"sheet-subtitle",children:"Graph fingerprints do not verify handler code. Implementation versions are supplied by the application."},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),Z("div",{class:"definition-body",children:[Z("label",{class:"field",children:["Definition"," ",Z("select",{"aria-label":"Definition",value:a(U),onChange:(Y)=>{Q(Y.currentTarget.value),W("")},children:G.map((Y)=>Z("option",{value:a(Y),children:Y2(Y)},a(Y),!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),U.identity&&Z("p",{class:"definition-identity",children:["Structural fingerprint: ",Z("code",{children:U.identity.structuralFingerprint},void 0,!1,void 0,this),Z("br",{},void 0,!1,void 0,this),"Definition ID: ",Z("code",{children:U.identity.definitionId},void 0,!1,void 0,this)]},void 0,!0,void 0,this),U.snapshot&&Z(g,{children:[Z(B0,{metadata:U.snapshot.metadata},void 0,!1,void 0,this),Z(d0,{steps:U.snapshot.steps},a(U),!1,void 0,this)]},void 0,!0,void 0,this),Z("details",{children:[Z("summary",{children:["Runs with this definition (",H.length,")"]},void 0,!0,void 0,this),Z("ul",{children:H.map((Y)=>Z("li",{children:Z("button",{type:"button",onClick:()=>K(Y.runId),children:[Y.status," · ",new Date(Y.startedAtMs).toLocaleString()," · ",Y.runId]},void 0,!0,void 0,this)},Y.runId,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),J?Z(g,{children:[Z("label",{class:"field",children:["Compare from"," ",Z("select",{"aria-label":"Compare from",value:a(J),onChange:(Y)=>W(Y.currentTarget.value),children:A.map((Y)=>Z("option",{value:a(Y),children:Y2(Y)},a(Y),!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z("p",{class:"sheet-subtitle",children:"Changes from the comparison definition to the selected definition."},void 0,!1,void 0,this),M?M.length?Z("ul",{class:"definition-changes",children:M.map((Y,N)=>Z("li",{children:[Z("strong",{children:[Y.stepId?`${Y.stepId}: `:"",Y.field]},void 0,!0,void 0,this),(Y.before!==void 0||Y.after!==void 0)&&Z("div",{children:[Z("code",{children:Y.before??"not supplied"},void 0,!1,void 0,this)," →"," ",Z("code",{children:Y.after??"not supplied"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},N,!0,void 0,this))},void 0,!1,void 0,this):Z("p",{children:"No recorded semantic changes."},void 0,!1,void 0,this):Z("p",{children:"A complete comparison is unavailable: a legacy recording has no identity, or a definition snapshot exceeded recording limits."},void 0,!1,void 0,this)]},void 0,!0,void 0,this):Z("p",{class:"sheet-subtitle",children:"Record another version of this pipeline to compare definitions."},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}var CG=Symbol("tubeless.wire-schema.type");function m(G,$,K={}){return{decode:$,jsonSchema:G,optionalInput:K.optionalInput??!1,optionalOutput:K.optionalOutput??!1}}function Z4(G,$){return G.length===0?$:`${G}.${$}`}function V(){return m({type:"boolean"},(G,$)=>{if(typeof G!=="boolean")throw Error(`${$} must be a boolean`);return G})}function M0(G={}){let $={type:G.integer?"integer":"number"};if(G.minimum!==void 0)$.minimum=G.minimum;return m($,(K,X)=>{if(typeof K!=="number"||!Number.isFinite(K))throw Error(`${X} must be a finite number`);if(G.integer&&(!Number.isSafeInteger(K)||K<(G.minimum??-1/0))){if(G.minimum===0)throw Error(`${X} must be a nonnegative safe integer`);throw Error(`${X} must be a safe integer`)}if(G.minimum!==void 0&&K<G.minimum)throw Error(`${X} must be at least ${G.minimum}`);return K})}function v(G={}){let $={type:"string"};if(G.allowEmpty!==!0)$.minLength=1;if(G.maxLength!==void 0)$.maxLength=G.maxLength;return m($,(K,X)=>{if(typeof K!=="string"||G.allowEmpty!==!0&&K.length===0)throw Error(G.allowEmpty===!0?`${X} must be a string`:`${X} must be a non-empty string`);if(G.maxLength!==void 0&&K.length>G.maxLength)throw Error(`${X} exceeds ${G.maxLength} code units`);return K})}function f(G,$){return m({const:G,type:typeof G},(K,X)=>{if(K!==G)throw Error($?.(X)??`${X} must be ${String(G)}`);return G})}function y(G,$=(K)=>`${K} is unsupported`){let K=new Set(G);return m({enum:G,type:"string"},(X,Q)=>{if(typeof X!=="string"||!K.has(X))throw Error($(Q));return X})}function _(G){return m(G.jsonSchema,($,K)=>$===void 0?void 0:G.decode($,K),{optionalInput:!0,optionalOutput:!0})}function H1(G,$){return m(G.jsonSchema,(K,X)=>K===void 0?$:G.decode(K,X),{optionalInput:!0})}function z0(G,$={}){let K={items:G.jsonSchema,type:"array"};if($.maxItems!==void 0)K.maxItems=$.maxItems;return m(K,(X,Q)=>{if(!Array.isArray(X)||$.maxItems!==void 0&&X.length>$.maxItems){let z=$.maxItems===void 0?"":` of at most ${$.maxItems}${$.noun?` ${$.noun}`:""}`;throw Error(`${Q} must be an array${z}`)}return X.map((z,W)=>G.decode(z,`${Q}[${W}]`))})}function F(G){let $=Object.entries(G).filter(([,X])=>!X.optionalOutput).map(([X])=>X),K=Object.fromEntries(Object.entries(G).map(([X,Q])=>[X,Q.jsonSchema]));return m({additionalProperties:!1,properties:K,...$.length>0?{required:$}:{},type:"object"},(X,Q)=>{if(X===null||typeof X!=="object"||Array.isArray(X))throw Error(`${Q} must be an object`);let z=X,W={};for(let[U,A]of Object.entries(G)){let J=A.decode(z[U],Z4(Q,U));if(J!==void 0)W[U]=J}return W})}function A2(G,$){return m({additionalProperties:G.jsonSchema,type:"object"},(K,X)=>{if(K===null||typeof K!=="object"||Array.isArray(K))throw Error(`${X} must be an object`);let Q={};for(let[z,W]of Object.entries(K))try{Q[z]=G.decode(W,`${X}.${z}`)}catch{throw Error($?.(X)??`${X} contains an unsupported value`)}return Q})}function T0(G,$){return m({oneOf:G.map((K)=>K.jsonSchema)},(K,X)=>{for(let Q of G)try{return Q.decode(K,X)}catch{}throw Error($?.(X)??`${X} is unsupported`)})}function t(G,$,K=G.jsonSchema){return m(K,(X,Q)=>{let z=G.decode(X,Q);return $(z,Q),z},{optionalInput:G.optionalInput,optionalOutput:G.optionalOutput})}function H2(G,$){return m(G.jsonSchema,(K,X)=>$(G.decode(K,X)),{optionalInput:G.optionalInput,optionalOutput:G.optionalOutput})}function e(G,$){return m(G,$)}function q1(G,$){return m({oneOf:Object.entries($).map(([K,X])=>({allOf:[X.jsonSchema,{properties:{[G]:{const:K,type:"string"}},required:[G],type:"object"}]}))},(K,X)=>{if(K===null||typeof K!=="object"||Array.isArray(K))throw Error(`${X} must be an object`);let Q=K[G];if(typeof Q!=="string"||!(Q in $))throw Error(`${G} is unsupported`);return $[Q].decode(K,X)})}var O0=16384,q2=new TextEncoder;function N1(G,$){let K=0,X=0,Q=(U)=>{if(U.length>O0)throw Error(`${$} exceeds ${O0} bytes`);if(X+=q2.encode(JSON.stringify(U)).byteLength,X>O0)throw Error(`${$} exceeds ${O0} bytes`)},z=(U,A)=>{if(++K>256||A>8)throw Error(`${$} exceeds metadata complexity limits`);if(U===null||typeof U==="boolean")return U;if(typeof U==="number"&&Number.isFinite(U))return U;if(typeof U==="string")return Q(U),U;if(typeof U!=="object"||U===null)throw Error(`${$} must be JSON-safe`);let J=Array.isArray(U),H=Object.getPrototypeOf(U);if(!J&&H!==Object.prototype&&H!==null)throw Error(`${$} must contain only plain JSON objects`);let M=Reflect.ownKeys(U);if(M.length>256)throw Error(`${$} exceeds metadata complexity limits`);let Y=[];for(let N of M){if(J&&N==="length")continue;if(typeof N!=="string")throw Error(`${$} must be JSON-safe`);let q=Object.getOwnPropertyDescriptor(U,N);if(!("value"in q)||!q.enumerable)throw Error(`${$} must contain only enumerable data properties`);Q(N),Y.push([N,z(q.value,A+1)])}if(J){if(Y.length!==U.length||Y.some(([N],q)=>N!==String(q)))throw Error(`${$} must contain only dense JSON arrays`);return Y.map(([,N])=>N)}return Object.fromEntries(Y)},W=z(G,0);if(q2.encode(JSON.stringify(W)).byteLength>O0)throw Error(`${$} exceeds ${O0} bytes`);return W}var P0=v({maxLength:4096}),N2=F({id:_(P0),uri:_(P0),mediaType:_(P0),checksum:_(P0),version:_(P0),byteSize:_(M0({integer:!0,minimum:0})),schemaVersion:_(P0),metadata:_(e({type:"object",additionalProperties:!0},(G,$)=>{if(!G||typeof G!=="object"||Array.isArray(G))throw Error(`${$} must be an object`);return G}))}),_1=e({...N2.jsonSchema,anyOf:[{required:["id"]},{required:["uri"]}]},(G,$)=>{let K=N1(G,$),X=N2.decode(K,$);if(!X.id&&!X.uri)throw Error(`${$} requires id or uri`);let Q=["id","uri","mediaType","checksum","version","byteSize","schemaVersion","metadata"];if(Object.keys(K).some((z)=>!Q.includes(z)))throw Error(`${$} has unknown fields; use metadata for application fields`);return X.id?{...X,id:X.id}:{...X,uri:X.uri}}),L1=y(["read","write","reuse"]),_2=F({operation:L1,artifact:_1});function L2(G){if(G!==null&&typeof G==="object"){for(let $ of Object.values(G))L2($);Object.freeze(G)}return G}var B1=e({type:"object",additionalProperties:!1,properties:{tags:{type:"array",maxItems:64,items:{type:"string",minLength:1,maxLength:256}},owner:{type:"string",minLength:1,maxLength:256},domain:{type:"string",minLength:1,maxLength:256},annotations:{type:"object",additionalProperties:!0}}},(G,$)=>{let K=N1(G,$);if(!K||typeof K!=="object"||Array.isArray(K))throw TypeError(`${$} must be an object`);let X=(Q)=>typeof Q==="string"&&Q.trim().length>0&&Q.length<=256;for(let[Q,z]of Object.entries(K))if(Q==="tags"){if(!Array.isArray(z)||z.length>64||!z.every(X))throw TypeError(`${$}.tags must contain at most 64 nonblank strings of at most 256 characters`)}else if(Q==="owner"||Q==="domain"){if(!X(z))throw TypeError(`${$}.${Q} must be a nonblank string of at most 256 characters`)}else if(Q==="annotations"){if(!z||typeof z!=="object"||Array.isArray(z))throw TypeError(`${$}.annotations must be an object`)}else throw TypeError(`${$}.${Q} is unknown; use annotations for application fields`);return L2(K)});var B2=3,K0=128,Q0=4096,M1=262144;var X4=["TUBELESS_CHILD_FAILED","TUBELESS_DEFINITION_CACHE_INVALID","TUBELESS_DEFINITION_DEPENDENCY_CONTRADICTORY","TUBELESS_DEFINITION_DEPENDENCY_CYCLE","TUBELESS_DEFINITION_DEPENDENCY_DUPLICATE","TUBELESS_DEFINITION_DEPENDENCY_NOT_IN_STEPS","TUBELESS_DEFINITION_DEPENDENCY_SELF_REFERENCE","TUBELESS_DEFINITION_FINALIZER_STEP_NOT_IN_STEPS","TUBELESS_DEFINITION_IMPLEMENTATION_VERSION_INVALID","TUBELESS_DEFINITION_OPTIONS_SCHEMA_CONFLICT","TUBELESS_DEFINITION_PIPELINE_DESCRIPTION_BLANK","TUBELESS_DEFINITION_PIPELINE_ID_BLANK","TUBELESS_DEFINITION_PIPELINE_NAME_BLANK","TUBELESS_DEFINITION_STEP_CACHE_INVALID","TUBELESS_DEFINITION_STEP_ID_BLANK","TUBELESS_DEFINITION_STEP_ID_RESERVED","TUBELESS_DEFINITION_STEP_IDS_DUPLICATE","TUBELESS_DEFINITION_STEP_NAME_BLANK","TUBELESS_DEFINITION_TARGET_FINALIZER_MISMATCH","TUBELESS_DEFINITION_TARGET_NOT_IN_STEPS","TUBELESS_DEFINITION_TARGETS_DUPLICATE","TUBELESS_FINALIZATION_CANCELLED","TUBELESS_FINALIZATION_FAILED","TUBELESS_FINAL_RESULT_VALIDATION_FAILED","TUBELESS_OPTIONS_VALIDATION_FAILED","TUBELESS_PLANNING_SELECTION_CONFLICT","TUBELESS_PLANNING_STEP_SELECTION_DUPLICATE","TUBELESS_PLANNING_STEP_SELECTION_EMPTY","TUBELESS_PLANNING_STEP_UNKNOWN","TUBELESS_PLANNING_TARGET_SELECTION_DUPLICATE","TUBELESS_PLANNING_TARGET_SELECTION_EMPTY","TUBELESS_PLANNING_TARGET_UNDECLARED","TUBELESS_PLANNING_TARGET_UNKNOWN","TUBELESS_RUN_CANCELLED","TUBELESS_RUN_CONCURRENCY_INVALID","TUBELESS_RUN_CACHE_INVALID","TUBELESS_STEP_OUTPUT_VALIDATION_FAILED","TUBELESS_STEP_FAILED"],W4=["cancellation","child","definition","finalization","selection","step","validation"],z4=["definition","execution","finalization","planning"],Q4=["cancelled","completed","failed"],U4=["dry-run","failed-dependency","fail-fast","filtered","policy","unmet-dependency"],Y4=["cancelled","completed","failed","pending","running","skipped"],E=v({allowEmpty:!0}),o=v(),F1=v({allowEmpty:!0,maxLength:Q0}),J0=M0({integer:!0,minimum:0}),c=M0(),p0=z0(o),J4=z0(o,{maxItems:K0,noun:"strings"});function w1(G,$,K,X){if(G===null||typeof G!=="object"||Array.isArray(G))throw Error(`${$} must be an object`);if(!X&&K>=16||X&&K>8)throw Error(X?"error.fanOut cause exceeds its depth limit":"error.cause exceeds 16 levels");let Q=G,z=(J)=>{let H=Q[J];if(H===void 0)return;if(typeof H!=="string")throw Error(`${$}.${J} must be a string`);return H},W={message:z("message")??""},U=z("name"),A=z("sourceCode");if(U!==void 0)W.name=U;if(A!==void 0)W.sourceCode=A;if(X&&[W.message,W.name,W.sourceCode].some((J)=>J!==void 0&&J.length>1024))throw Error("error.fanOut cause strings exceed 1024 code units");if(Q.cause!==void 0)W.cause=w1(Q.cause,$,K+1,X);return W}var O2={additionalProperties:!1,properties:{cause:{$ref:"#/components/schemas/PipelineErrorCause"},message:{type:"string"},name:{type:"string"},sourceCode:{type:"string"}},required:["message"],type:"object"},A4=e(O2,(G,$)=>w1(G,$,0,!1)),P2=e({$ref:"#/components/schemas/PipelineErrorCause"},(G,$)=>w1(G,$,0,!0)),H4=e({items:{oneOf:[{type:"number"},{type:"string",maxLength:Q0}]},maxItems:K0,type:"array"},(G,$)=>{if(!Array.isArray(G)||G.length>K0||!G.every((K)=>typeof K==="string"||typeof K==="number"&&Number.isFinite(K)))throw Error(`${$} must contain strings or finite numbers`);if(G.some((K)=>typeof K==="string"&&K.length>Q0))throw Error(`${$} string exceeds ${Q0} code units`);return G}),b1=F({message:v({maxLength:Q0}),path:_(H4)}),q4=e({items:b1.jsonSchema,maxItems:K0,type:"array"},(G,$)=>{if(!Array.isArray(G))throw Error(`${$} must be an array`);if(G.length>K0)throw Error(`${$} must contain at most ${K0} entries`);return G.map((K,X)=>b1.decode(K,`${$}[${X}]`))}),F2=F({cancelled:V(),error:P2,index:J0,key:v({allowEmpty:!0,maxLength:1024}),keyTruncated:V()}),b2=t(F({failureCount:J0,failures:z0(F2,{maxItems:32,noun:"entries"}),omittedFailureCount:J0,schedulerError:_(P2)}),(G)=>{if(G.failureCount-G.failures.length!==G.omittedFailureCount)throw Error("error.fanOut counts do not match failures");let $=-1;for(let K of G.failures){if(K.index<=$)throw Error("error.fanOut indices must be in input order");$=K.index}}),l0=F({cause:_(t(A4,()=>{return},{$ref:"#/components/schemas/PipelineErrorCause"})),code:y(X4),fanOut:_(t(b2,()=>{return},{$ref:"#/components/schemas/PipelineFanOutDiagnostics"})),issues:_(q4),kind:y(W4),message:H1(E,""),phase:y(z4),sourceCode:_(E),stack:_(E)}),o0=t(l0,()=>{return},{$ref:"#/components/schemas/PipelineError"}),k2=F({outputSource:_(y(["override","cache"])),completed:_(c),depth:_(c),id:v({maxLength:Q0}),label:_(F1),name:_(F1),status:_(y(Y4)),total:_(c)}),N4=t(z0(k2,{maxItems:K0,noun:"details"}),(G,$)=>{if(new TextEncoder().encode(JSON.stringify(G)).byteLength>M1)throw Error(`${$} exceeds the ${M1}-byte limit`)}),_4=H2(t(F({completed:c,detailCount:_(J0),details:_(N4),message:_(E),total:_(c)}),(G)=>{if(G.details!==void 0&&G.detailCount!==void 0&&G.detailCount<G.details.length)throw Error("payload.progress.detailCount must be at least the retained details length")}),(G)=>G.details!==void 0&&G.detailCount===void 0?{...G,detailCount:G.details.length}:G),T1=M0({integer:!0,minimum:1}),w2=["for-each","single","iterate"],L4=t(F({mode:y(w2),maxIterations:_(T1),pipelineId:o,stepCount:J0,stepIds:J4}),(G,$)=>{if(G.mode==="iterate"!==(G.maxIterations!==void 0))throw Error(`${$}: only iterate requires maxIterations`);if(G.stepCount<G.stepIds.length)throw Error(`${$}.stepCount must be at least the retained stepIds length`)}),T2=F({engine:v({maxLength:Q0}),target:_(F1)}),R0=t(F({version:T0([f(1),f(2),f(3)]),definitionId:v({maxLength:80}),structuralFingerprint:v({maxLength:80}),implementationVersion:_(v({maxLength:256}))}),(G,$)=>{if(![G.definitionId,G.structuralFingerprint].every((K)=>/^sha256:[a-f0-9]{64}$/.test(K)))throw Error(`${$} must contain SHA-256 fingerprints`);if(G.implementationVersion!==void 0&&G.implementationVersion.trim().length===0)throw Error(`${$}.implementationVersion must not be blank`)}),k1=v({maxLength:4096}),Y0=z0(k1,{maxItems:4096}),B4=F({cache:_(y(["use","recompute","bypass"])),dryRun:_(V()),continueOnError:_(V()),maxConcurrency:_(c),targets:_(Y0),stepIds:_(Y0)}),M4=F({metadata:_(B1),id:k1,dependencies:Y0,optionalDependencies:Y0,skipAfterFailureOf:Y0,dryRun:y(["custom","run","skip"]),runtimeSkipPossible:V(),outputValidated:V(),cache:_(F({version:v({maxLength:256}),maxAgeMs:_(c),policy:y(["use","recompute","bypass","dynamic"])})),nestedPipeline:_(F({pipelineId:k1,mode:y(w2),maxIterations:_(T1),controls:_(B4),identity:_(R0),stepIds:Y0,concurrency:_(T0([c,f("dynamic")]))})),remote:_(T2)}),C1=t(F({identity:R0,metadata:_(B1),steps:z0(M4,{maxItems:4096}),targetIds:Y0,requiredFinalizerStepIds:_(Y0),optionsValidated:V(),resultValidated:V()}),(G,$)=>{if(G.identity.version!==3&&(G.metadata!==void 0||G.steps.some((K)=>K.metadata!==void 0||K.nestedPipeline?.identity?.version===3)))throw Error(`${$}: metadata requires identity version 3`);for(let K of G.steps){let X=K.nestedPipeline;if(!X)continue;if(X.mode==="iterate"!==(X.maxIterations!==void 0)||X.controls!==void 0&&X.mode!=="iterate")throw Error(`${$}: invalid iteration metadata`);if(G.identity.version===1&&(X.mode==="iterate"||X.identity?.version===2))throw Error(`${$}: iteration requires identity version 2`)}if(new TextEncoder().encode(JSON.stringify(G)).byteLength>262144)throw Error(`${$} exceeds the 262144-byte definition limit`)}),i0=F({kind:y(["all","exact","not-selected","outside-target-closure"])}),O4=F({kind:f("target"),targetId:o}),O1=F({dependentId:o,kind:y(["failure-gate","optional-only","required-dependency"]),targetId:o}),P4=q1("kind",{all:i0,exact:i0,"failure-gate":O1,"not-selected":i0,"optional-only":O1,"outside-target-closure":i0,"required-dependency":O1,target:O4}),F4=z0(P4,{maxItems:K0,noun:"reasons"}),b4=A2(T0([V(),c,E]),(G)=>`${G} values must be booleans, finite numbers, or strings`),p={correlationId:_(E),itemKey:_(E),parentRunId:_(E),pipelineId:o,runId:o,timestampMs:c,version:T0([f(2),f(B2)]),iteration:_(F({runId:o,stepId:o,attemptId:o,index:T1}))},C0={attemptId:_(E),durationMs:_(c)},U0={stepId:o},P1=F({}),C2={"step.artifact":F({...p,...U0,attemptId:o,name:f("step.artifact"),payload:F({operation:L1,preview:V(),artifact:_1})}),"pipeline.completed":F({...p,durationMs:_(c),error:_(o0),name:f("pipeline.completed"),payload:F({dryRun:V(),errorCount:J0,finalized:V(),status:y(Q4,(G)=>`${G} must be cancelled, completed, or failed`),stepCount:J0})}),"pipeline.finalize.completed":F({...p,durationMs:c,name:f("pipeline.finalize.completed"),payload:P1}),"pipeline.finalize.failed":F({...p,durationMs:c,error:o0,name:f("pipeline.finalize.failed"),payload:P1}),"pipeline.finalize.started":F({...p,name:f("pipeline.finalize.started"),payload:P1}),"pipeline.log":F({...p,attemptId:_(E),name:f("pipeline.log"),payload:F({level:y(["error","log","warn"],(G)=>`${G} must be error, log, or warn`),message:H1(E,"")}),stepId:_(E)}),"pipeline.started":F({...p,name:f("pipeline.started"),payload:t(F({definitionIdentity:_(R0),definitionSnapshot:_(C1),dryRun:V(),planOk:V(),stepCount:J0,targetIds:p0}),(G)=>{if(G.definitionSnapshot&&JSON.stringify(G.definitionSnapshot.identity)!==JSON.stringify(G.definitionIdentity))throw Error("Definition snapshot must match the run definition identity")})}),"step.attempted":F({...p,...C0,...U0,name:f("step.attempted"),payload:F({attempt:c,attributes:b4})}),"step.cancelled":F({...p,...C0,...U0,error:o0,name:f("step.cancelled"),payload:F({status:f("cancelled"),outputSource:_(y(["override","cache"]))})}),"step.complete":F({...p,...C0,...U0,name:f("step.complete"),payload:F({status:f("completed"),outputSource:_(y(["override","cache"]))})}),"step.failed":F({...p,...C0,...U0,error:o0,name:f("step.failed"),payload:F({status:f("failed"),outputSource:_(y(["override","cache"]))})}),"step.planned":F({...p,...U0,name:f("step.planned"),payload:F({dependencies:p0,description:_(E),dryRun:y(["custom","run","skip"],(G)=>`${G} must be custom, run, or skip`),name:_(E),nestedPipeline:_(L4),optionalDependencies:p0,remote:_(T2),runtimeSkipPossible:V(),selected:V(),selectionReasons:F4,skipAfterFailureOf:p0})}),"step.running":F({...p,...U0,attemptId:o,name:f("step.running"),payload:F({progress:_(_4),outputSource:_(y(["override","cache"]))})}),"step.skipped":F({...p,...C0,...U0,name:f("step.skipped"),payload:F({dependencyId:_(E),message:_(E),reason:y(U4),status:f("skipped"),outputSource:_(y(["override","cache"]))})})},R2={if:{properties:{version:{const:2}},required:["version"]},then:{properties:{iteration:!1,payload:{properties:{definitionIdentity:{properties:{version:{const:1}}},nestedPipeline:{properties:{mode:{enum:["single","for-each"]},maxIterations:!1}}}}}}},M2=q1("name",C2),k4=t(M2,(G)=>{if(G.iteration!==void 0&&G.iteration.runId!==G.parentRunId)throw Error("iteration.runId must match parentRunId");if(G.version!==2)return;if(G.iteration!==void 0||G.name==="step.planned"&&G.payload.nestedPipeline?.mode==="iterate")throw Error("Iteration metadata requires trace version 3");if(G.name==="pipeline.started"&&G.payload.definitionIdentity!==void 0&&G.payload.definitionIdentity.version!==1)throw Error("Trace version 2 requires identity version 1")},{...M2.jsonSchema,...R2}),hG={PipelineError:l0.jsonSchema,PipelineErrorCause:O2,PipelineFanOutDiagnostics:b2.jsonSchema,PipelineFanOutFailure:F2.jsonSchema,PipelineProgressDetail:k2.jsonSchema,PipelineValidationIssue:b1.jsonSchema,StoredPipelineEvent:{oneOf:Object.values(C2).map((G)=>{let $=G.jsonSchema;return{...$,...R2,properties:{...$.properties,id:{minimum:0,type:"integer"}},required:[...$.required,"id"]}})}};function g2(G){return l0.decode(G,"error")}function R1(G){try{return R0.decode(G,"identity"),!0}catch{return!1}}function f2(G){try{return C1.decode(G,"snapshot"),!0}catch{return!1}}function S2(G){try{return g2(G),!0}catch{return!1}}function y2(G){try{return _2.decode(G,"artifact record"),!0}catch{return!1}}function I2(G){if(typeof G!=="object"||G===null)return!1;let $=G;if(typeof $.key!=="string"||$.key.length===0||typeof $.flag!=="string"||$.flag.length===0||typeof $.multiple!=="boolean"||typeof $.positional!=="boolean"||typeof $.required!=="boolean"||!["boolean","number","path","string"].includes(String($.type)))return!1;if($.choices!==void 0&&(!Array.isArray($.choices)||!$.choices.every((K)=>typeof K==="string")))return!1;if($.default!==void 0&&typeof $.default!==($.type==="boolean"?"boolean":$.type==="number"?"number":"string"))return!1;if($.group!==void 0&&$.group!=="execution")return!1;if($.exclusive!==void 0&&$.exclusive!==!0)return!1;return!0}function S(G){return typeof G==="object"&&G!==null&&!Array.isArray(G)}function j(G){return typeof G==="number"&&Number.isFinite(G)}function i(G){return G===void 0||typeof G==="string"}function Z0(G){return G===void 0||j(G)}function u0(G){return Array.isArray(G)&&G.every(($)=>typeof $==="string")}function w4(G){if(!S(G))return!1;return j(G.id)&&(G.level==="error"||G.level==="log"||G.level==="warn")&&typeof G.message==="string"&&j(G.timestampMs)&&i(G.attemptId)&&i(G.stepId)}function T4(G){if(!S(G))return!1;if(typeof G.id!=="string"||G.outputSource!==void 0&&G.outputSource!=="override"&&G.outputSource!=="cache"||!["cancelled","completed","failed","planned","running","skipped"].includes(String(G.status))||!i(G.description)||!i(G.name)||!Z0(G.durationMs)||!Z0(G.finishedAtMs)||!Z0(G.startedAtMs))return!1;if(G.attempt!==void 0){if(!S(G.attempt)||typeof G.attempt.attemptId!=="string"||!Z0(G.attempt.durationMs)||!Z0(G.attempt.finishedAtMs)||!Array.isArray(G.attempt.retries)||!G.attempt.retries.every(j)||!j(G.attempt.startedAtMs)||G.attempt.outputSource!==void 0&&G.attempt.outputSource!=="override"&&G.attempt.outputSource!=="cache"||!["cancelled","completed","failed","running","skipped"].includes(String(G.attempt.status)))return!1}if(G.artifacts!==void 0&&(!Array.isArray(G.artifacts)||!G.artifacts.every(($)=>S($)&&typeof $.attemptId==="string"&&j($.timestampMs)&&typeof $.preview==="boolean"&&y2($))))return!1;if(G.progress!==void 0){if(!S(G.progress)||!j(G.progress.completed))return!1;if(!Z0(G.progress.detailCount)||!i(G.progress.message)||!Z0(G.progress.total))return!1;if(G.progress.details!==void 0&&(!Array.isArray(G.progress.details)||!G.progress.details.every(($)=>S($)&&typeof $.id==="string"&&i($.label)&&i($.status)&&($.outputSource===void 0||$.outputSource==="override"||$.outputSource==="cache"))))return!1}if(G.nestedPipeline!==void 0){if(!S(G.nestedPipeline)||!["single","for-each","iterate"].includes(String(G.nestedPipeline.mode))||G.nestedPipeline.mode==="iterate"&&(!Number.isSafeInteger(G.nestedPipeline.maxIterations)||Number(G.nestedPipeline.maxIterations)<1)||typeof G.nestedPipeline.pipelineId!=="string"||!j(G.nestedPipeline.stepCount)||!u0(G.nestedPipeline.stepIds))return!1}if(G.remote!==void 0){if(!S(G.remote)||typeof G.remote.engine!=="string"||!i(G.remote.target))return!1}return!0}function D2(G){if(!S(G))return!1;return(G.definitionIdentity===void 0||R1(G.definitionIdentity))&&typeof G.dryRun==="boolean"&&j(G.eventCount)&&j(G.logCount)&&Array.isArray(G.logs)&&G.logs.every(w4)&&typeof G.pipelineId==="string"&&typeof G.runId==="string"&&j(G.startedAtMs)&&Z0(G.durationMs)&&Z0(G.finishedAtMs)&&["cancelled","completed","failed","running"].includes(String(G.status))&&Array.isArray(G.steps)&&G.steps.every(T4)&&j(G.version)&&i(G.correlationId)&&i(G.parentRunId)&&(G.iteration===void 0||S(G.iteration)&&typeof G.iteration.runId==="string"&&typeof G.iteration.stepId==="string"&&typeof G.iteration.attemptId==="string"&&Number.isSafeInteger(G.iteration.index)&&Number(G.iteration.index)>0)&&(G.error===void 0||S2(G.error))}function C4(G){if(!S(G))return!1;if(!j(G.activeRunCount)||!j(G.completedRunCount)||!Array.isArray(G.definitions)||!G.definitions.every(($)=>S($)&&typeof $.pipelineId==="string"&&j($.runCount)&&($.identity===void 0||R1($.identity))&&($.snapshot===void 0||f2($.snapshot)))||!j(G.failedRunCount)||!j(G.generatedAtMs)||!j(G.lastEventId)||!Array.isArray(G.runs)||!G.runs.every(D2)||G.liveRunIds!==void 0&&!u0(G.liveRunIds))return!1;return!0}function R4(G){return C4(G)?G:void 0}function g4(G){return S(G)&&typeof G.canPlan==="boolean"&&typeof G.id==="string"&&typeof G.name==="string"&&i(G.description)&&Array.isArray(G.parameters)&&G.parameters.every(I2)}function f4(G){if(!S(G)||!Array.isArray(G.commands)||!G.commands.every(g4))return;return G.commands}function S4(G){if(!S(G)||!S(G.plan))return!1;let $=G.plan;if(typeof $.dryRun!=="boolean"||!Array.isArray($.errors)||!$.errors.every((K)=>S(K)&&typeof K.message==="string")||typeof $.ok!=="boolean"||typeof $.pipelineId!=="string"||!Array.isArray($.steps))return!1;for(let K of $.steps){if(!S(K)||typeof K.id!=="string"||!u0(K.dependencies)||typeof K.selected!=="boolean"||!i(K.description)||!i(K.name))return!1;if(K.nestedPipeline!==void 0&&(!S(K.nestedPipeline)||!["single","for-each","iterate"].includes(String(K.nestedPipeline.mode))||K.nestedPipeline.mode==="iterate"&&(!Number.isSafeInteger(K.nestedPipeline.maxIterations)||Number(K.nestedPipeline.maxIterations)<1)||typeof K.nestedPipeline.pipelineId!=="string"||!u0(K.nestedPipeline.stepIds)))return!1;if(K.remote!==void 0&&(!S(K.remote)||typeof K.remote.engine!=="string"||!i(K.remote.target)))return!1}return!0}function y4(G){return S4(G)?G.plan:void 0}function A0(G,$){if(!S(G))return Error($);if(Array.isArray(G.errors)&&G.errors.every((K)=>typeof K==="string"))return Error(G.errors.join(`
|
|
2
|
-
`));return Error(typeof G.message==="string"?G.message:$)}async function H0(G){try{return await G.json()}catch{throw Error("Studio API returned invalid JSON.")}}function q0(G){return Error(`Studio API returned an invalid response for ${G}.`)}function j2(G=fetch){return{async loadSnapshot(){let $=await G("/api/snapshot",{cache:"no-store"}),K=await H0($);if(!$.ok)throw A0(K,"Snapshot request failed.");let X=R4(K);if(!X)throw q0("snapshot");return X},async loadRunDetail($){let K=await G("/api/runs/"+encodeURIComponent($),{cache:"no-store"}),X=await H0(K);if(K.status===404)return null;if(!K.ok)throw A0(X,"Run detail request failed.");if(!S(X)||!D2(X.run))throw q0("run detail");return{run:X.run}},async loadCommands(){let $=await G("/api/commands",{cache:"no-store"}),K=await H0($);if(!$.ok)throw A0(K,"Commands request failed.");let X=f4(K);if(!X)throw q0("commands");return X},async loadCapabilities(){let $=await G("/api/capabilities",{cache:"no-store"}),K=await H0($);if(!$.ok||!S(K)||typeof K.canCancel!=="boolean"||typeof K.canClearHistory!=="boolean"){if(!$.ok)throw A0(K,"Capabilities request failed.");throw q0("capabilities")}return{canCancel:K.canCancel,canClearHistory:K.canClearHistory}},async clearHistory(){let $=await G("/api/history",{method:"DELETE",headers:{"x-tubeless-studio-clear-history":"1"}}),K=await H0($);if(!$.ok)throw A0(K,"History could not be cleared.");if(!S(K)||K.cleared!==!0||!j(K.eventCount))throw q0("clear history");return{eventCount:K.eventCount}},async previewPlan($,K){let X=await G("/api/commands/"+encodeURIComponent($)+"/plan",{method:"POST",headers:{"content-type":"application/json","x-tubeless-studio-plan":"1"},body:JSON.stringify(K)}),Q=await H0(X);if(!X.ok)throw A0(Q,"Plan request failed.");let z=y4(Q);if(!z)throw q0("plan");return z},async cancelRun($){let K=await G("/api/runs/"+encodeURIComponent($)+"/cancel",{method:"POST",headers:{"x-tubeless-studio-cancel":"1"}}),X=await H0(K);if(!K.ok)throw A0(X,"Run could not be cancelled.");if(!S(X)||X.cancelled!==!0||X.runId!==$)throw q0("cancel run")},async launch($,K){let X=await G("/api/commands/"+encodeURIComponent($)+"/runs",{method:"POST",headers:{"content-type":"application/json","x-tubeless-studio-launch":"1"},body:JSON.stringify({values:K})}),Q=await H0(X);if(!X.ok)throw A0(Q,"Launch failed.");if(!S(Q)||Q.accepted!==!0||typeof Q.runId!=="string"||Q.runId.length===0)throw q0("launch");return Q.runId}}}function I4(G){return{...G,activeRunCount:0,completedRunCount:0,definitions:[],failedRunCount:0,lastEventId:0,liveRunIds:[],runs:[]}}class g1{#A;#_;#J=new Set;#X=null;#G;#K={fingerprint:null,runId:null};#W=0;#$=!1;#z;#H=!1;#U=0;#q=!1;#N=!1;#Z={connected:!0,detail:null,manualRefreshing:!1,snapshot:null};constructor(G,$=1200){this.#A=G,this.#_=$}getState(){return this.#Z}subscribe(G){return this.#J.add(G),()=>this.#J.delete(G)}refresh(G=!1){if(this.#$)return;if(G)this.#H=!0,this.#Q({manualRefreshing:!0});if(this.#q){if(G)this.#N=!0;return}this.#L()}invalidate({delayMs:G=0,resetHistory:$=!1}={}){if(this.#$)return;if(this.#U+=1,$)this.#O(),this.#Q({detail:null,snapshot:this.#Z.snapshot?I4(this.#Z.snapshot):null});else this.#P(G);if(this.#z)clearTimeout(this.#z);if(this.#z=void 0,G>0){this.#z=setTimeout(()=>{this.#z=void 0,this.refresh(!0)},G);return}this.refresh(!0)}selectRun(G,$){if(this.#$)return;if(this.#K.runId===G&&this.#K.fingerprint===$)return;if(this.#K.runId!==G||!$)this.#O(),this.#Q({detail:null});if(this.#K={fingerprint:$,runId:G},G&&$)this.#Y(this.#W)}dispose(){if(this.#$)return;if(this.#$=!0,this.#U+=1,this.#W+=1,this.#X=null,this.#G)clearTimeout(this.#G);if(this.#z)clearTimeout(this.#z);this.#G=void 0,this.#z=void 0,this.#J.clear()}#L(){if(this.#$)return;this.#q=!0;let G=this.#U;this.#H=!1,this.#A.loadSnapshot().then(($)=>{if(this.#$||G!==this.#U)return;this.#Q({connected:!0,snapshot:$})}).catch(()=>{if(this.#$||G!==this.#U)return;this.#Q({connected:!1})}).finally(()=>{if(this.#$)return;if(this.#q=!1,this.#N){this.#N=!1,this.#L();return}if(!this.#H)this.#Q({manualRefreshing:!1})})}#Y(G){let{fingerprint:$,runId:K}=this.#K;if(this.#$||this.#X!==null||this.#G!==void 0||!K||!$||G!==this.#W)return;let X={};this.#X=X,this.#A.loadRunDetail(K).then((Q)=>{if(!this.#B(X,G))return;if(this.#X=null,Q){if(this.#Q({detail:Q}),$!==this.#K.fingerprint)this.#Y(G);return}this.#M(G)}).catch(()=>{if(!this.#B(X,G))return;this.#X=null,this.#M(G)})}#B(G,$){return!this.#$&&this.#X===G&&this.#W===$}#M(G){if(this.#$||G!==this.#W)return;if(this.#G)clearTimeout(this.#G);this.#G=setTimeout(()=>{this.#G=void 0,this.#Y(G)},this.#_)}#P(G){if(this.#W+=1,this.#X=null,this.#G)clearTimeout(this.#G);this.#G=void 0,this.#Q({detail:null});let $=this.#W;if(!this.#K.runId||!this.#K.fingerprint)return;if(G>0){this.#G=setTimeout(()=>{this.#G=void 0,this.#Y($)},G);return}this.#Y($)}#O(){if(this.#W+=1,this.#X=null,this.#K={fingerprint:null,runId:null},this.#G)clearTimeout(this.#G);this.#G=void 0}#Q(G){let $={...this.#Z,...G};if($.connected===this.#Z.connected&&$.detail===this.#Z.detail&&$.manualRefreshing===this.#Z.manualRefreshing&&$.snapshot===this.#Z.snapshot)return;this.#Z=$;for(let K of this.#J)K($)}}var f1=[];function D4(G){let $=new Map,K=new Map,X=new Map;for(let q of G){if(!$.has(q.runId))$.set(q.runId,q);let P=q.parentRunId;if(!X.has(q.runId))X.set(q.runId,P)}let Q=new Set;for(let q of G){if(Q.has(q.runId))continue;let P=[],O=new Set,L=q.runId;while(L&&$.has(L)&&!Q.has(L)){if(O.has(L)){X.set(L,void 0);break}O.add(L),P.push(L),L=X.get(L)}for(let B of P)Q.add(B)}for(let q of G){let P=X.get(q.runId);if(!P)continue;let O=K.get(P);if(O)O.push(q);else K.set(P,[q])}for(let q of K.values())q.sort((P,O)=>O.startedAtMs-P.startedAtMs);let z=[],W=new Set;for(let q of G){let P=X.get(q.runId);if(P&&$.has(P))continue;z.push(q),W.add(q.runId)}let U=new Map;for(let q of G){if(U.has(q.runId))continue;let P=[],O=new Set,L=q.runId,B;while(L){if(U.has(L)){B=U.get(L);break}if(W.has(L)){B=L;break}if(O.has(L)){B=void 0;break}O.add(L),P.push(L);let k=X.get(L);if(!k||!$.has(k)){B=L;break}L=k}if(B!==void 0)U.set(B,B);for(let k of P)U.set(k,B)}let A=new Map,J=new Map;for(let q of G){if(A.has(q.runId))continue;let P=[{exiting:!1,id:q.runId}],O=new Set;while(P.length>0){let L=P.pop();if(!L)break;if(L.exiting){O.delete(L.id);let B=0,k=$.get(L.id)?.status==="running";for(let x of K.get(L.id)??f1){let h=A.get(x.runId);if(h===void 0)continue;B+=1+h,k=k||J.get(x.runId)===!0}A.set(L.id,B),J.set(L.id,k);continue}if(A.has(L.id)||O.has(L.id))continue;O.add(L.id),P.push({exiting:!0,id:L.id});for(let B of K.get(L.id)??f1)if(!A.has(B.runId)&&!O.has(B.runId))P.push({exiting:!1,id:B.runId})}}function H(q){return q==null?void 0:$.get(q)}function M(q){return K.get(q)??f1}function Y(q){let P=[],O=new Set,L=H(q);while(L){let B=X.get(L.runId);if(!B||O.has(B))break;O.add(B);let k=$.get(B);if(!k)break;P.unshift(k),L=k}return P}function N(q){let P=q.toLowerCase(),O=new Set;if(!P){for(let L of z)O.add(L.runId);return O}for(let L of G){if(!L.pipelineId.toLowerCase().includes(P)&&!L.runId.toLowerCase().includes(P)&&!L.correlationId?.toLowerCase().includes(P))continue;let B=U.get(L.runId);if(B)O.add(B)}return O}return{roots:z,ancestorsOf:Y,childrenOf:M,descendantCount(q){return A.get(q)??0},matchingRootIds:N,rootRunId(q){return q==null?q:U.get(q)??q},runById:H,subtreeIsRunning(q){return J.get(q)===!0}}}function j4(G){return G.parameters.map(($)=>{if($.type==="boolean")return[Boolean($.default)];if($.multiple)return $.choices?[]:[""];return $.default===void 0?[""]:[$.default]})}function V4(G,$){let K={};return G.parameters.forEach((X,Q)=>{let z=$(X,Q);if(X.type==="boolean"){let U=z[0];if(U!==Boolean(X.default))K[X.key]=U;return}if(X.multiple){K[X.key]=X.type==="number"?z.filter((U)=>typeof U==="number"):z.filter((U)=>typeof U==="string");return}let W=z[0];if(W!==""&&W!==void 0)K[X.key]=W}),K}function E4(G,$){let K={};return G.parameters.forEach((X,Q)=>{if(X.group!=="execution")return;let z=$(X,Q);if(X.type==="boolean"){if(z[0]===!0)K[X.key]=!0;return}if(X.multiple&&z.length)K[X.key]=z.filter((W)=>typeof W==="string")}),K}var r0=(G)=>G.length>24?G.slice(0,12)+"…"+G.slice(-7):G;function s0(G){return G==null?"—":G<1000?Math.max(0,Math.round(G))+" ms":G<60000?(G/1000).toFixed(G<1e4?1:0)+" s":Math.floor(G/60000)+"m "+Math.round(G%60000/1000)+"s"}function x4(G){if(!Number.isFinite(G)||Math.abs(G)>8640000000000000)return"";return new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(G)}function V2(G){if(!Number.isFinite(G)||Math.abs(G)>8640000000000000)return"";return new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"medium"}).format(G)}function E2(G){if(!Number.isFinite(G)||Math.abs(G)>8640000000000000)return"";return new Date(G).toISOString()}function x2(G,$){let K=Math.max(0,$-G);if(K<60000)return Math.floor(K/1000)+"s ago";if(K<3600000)return Math.floor(K/60000)+"m ago";if(K<86400000)return Math.floor(K/3600000)+"h ago";return Math.floor(K/86400000)+"d ago"}function h4(G){return G==="completed"?"✓":G==="skipped"?"×":G==="cancelled"?"■":G==="failed"?"!":G==="planned"?"…":""}function t0({value:G,outputSource:$}){return Z("span",{class:`status ${G}`,children:[Z("i",{class:"status-mark","aria-hidden":"true",children:h4(G)},void 0,!1,void 0,this),G,$==="override"&&" (overridden)",$==="cache"&&" (cached)"]},void 0,!0,void 0,this)}function n0({copy:G,title:$}){return Z("div",{class:"empty",children:Z("div",{children:[Z("div",{class:"empty-icon",children:Z("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.4",children:Z("path",{d:"M4 5.5h12M4 10h12M4 14.5h8"},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),Z("strong",{children:$},void 0,!1,void 0,this),Z("p",{children:G},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}function a0({children:G,label:$,secondary:K,stepIds:X}){return Z("div",{class:"plan-nested",children:[Z("strong",{children:$},void 0,!1,void 0,this),K&&Z("span",{children:K},void 0,!1,void 0,this),X?.map((Q)=>Z("code",{children:Q},Q,!1,void 0,this)),G]},void 0,!0,void 0,this)}function S1(G){return G.description||"Run this typed pipeline command."}function m4(G){return G.key.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[-_]+/g," ").replace(/\b\w/g,($)=>$.toUpperCase())}function v4(G){let $=[];if(G.description)$.push(G.description);if(G.environment)$.push("Environment fallback: "+G.environment);if(G.multiple)$.push(G.choices?"Choose one or more values.":"Enter one value per line.");if(G.mustExist)$.push("Must be an existing "+(G.pathKind||"path")+".");return $.join(" ")}function c4({index:G,onChange:$,parameter:K,values:X}){let Q="run-param-"+G,z=v4(K),W=m4(K);if(K.type==="boolean")return Z("label",{class:"boolean-field",for:Q,children:[Z("span",{children:[Z("strong",{children:W},void 0,!1,void 0,this),Z("small",{children:z||"Enable this option."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z("input",{id:Q,type:"checkbox",checked:X[0]===!0,onChange:(J)=>$(G,[J.currentTarget.checked])},void 0,!1,void 0,this)]},void 0,!0,void 0,this);let U=Z("label",{for:Q,children:[W,K.required&&Z("span",{class:"required-mark",children:"required"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),A;if(K.choices){let J=X.filter((H)=>typeof H==="string");A=Z("select",{id:Q,multiple:K.multiple,required:K.required,value:K.multiple?void 0:J[0]??"",onChange:(H)=>$(G,K.multiple?Array.from(H.currentTarget.selectedOptions,(M)=>M.value):[H.currentTarget.value]),children:[!K.multiple&&!K.required&&Z("option",{value:"",children:"Use default or leave unset"},void 0,!1,void 0,this),K.choices.map((H)=>Z("option",{value:H,selected:K.multiple?J.includes(H):void 0,children:H},H,!1,void 0,this))]},void 0,!0,void 0,this)}else if(K.multiple)A=Z("textarea",{id:Q,spellcheck:!1,placeholder:"One value per line",value:String(X[0]??""),onInput:(J)=>$(G,[J.currentTarget.value])},void 0,!1,void 0,this);else{let J=X[0]??"";A=Z("input",{id:Q,type:K.type==="number"?"number":"text",value:String(J),placeholder:K.type==="path"?K.pathKind==="directory"?"./directory":"./file":"",step:K.type==="number"?K.integer?"1":"any":void 0,min:K.type==="number"?K.min:void 0,max:K.type==="number"?K.max:void 0,required:K.required,onInput:(H)=>$(G,K.type==="number"&&H.currentTarget.value!==""?[Number(H.currentTarget.value)]:[H.currentTarget.value])},void 0,!1,void 0,this)}return Z("div",{class:"field",children:[U,A,z&&Z("div",{class:"field-hint",children:z},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function d4({command:G,onChange:$,values:K}){let X=(z,W,U)=>{let A=G.parameters.map((J,H)=>({index:H,parameter:J})).filter(({parameter:J})=>J.group==="execution"===z);if(!A.length)return null;return Z("section",{class:"form-section",children:[Z("div",{class:"form-section-head",children:[Z("strong",{children:W},void 0,!1,void 0,this),Z("span",{children:U},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z("div",{class:"parameter-grid",children:A.map(({index:J,parameter:H})=>Z(c4,{index:J,onChange:$,parameter:H,values:K[J]??[]},H.key,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},Q=G.parameters.filter((z)=>z.group!=="execution").length;return Z("div",{class:"parameter-fields",id:"parameterFields",children:[X(!1,"Pipeline inputs",Q+" parameter"+(Q===1?"":"s")),X(!0,"Execution controls","Built into Tubeless")]},void 0,!0,void 0,this)}function p4({commands:G,onConfigure:$}){if(!G.length)return Z("div",{class:"sheet",children:Z(n0,{title:"No pipelines found",copy:"Try a different pipeline name or description."},void 0,!1,void 0,this)},void 0,!1,void 0,this);return Z("section",{class:"sheet",children:[Z("div",{class:"sheet-head",children:[Z("div",{children:[Z("div",{class:"sheet-title",children:"Available pipelines"},void 0,!1,void 0,this),Z("div",{class:"sheet-subtitle",children:"Available in this Studio session"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z("span",{class:"sheet-subtitle",children:[G.length," shown"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Z("div",{class:"catalog",children:G.map((K)=>Z("article",{class:"catalog-card",children:[Z("h3",{children:K.name},void 0,!1,void 0,this),Z("p",{children:S1(K)},void 0,!1,void 0,this),Z("div",{class:"catalog-actions",children:Z("button",{class:"primary-button",onClick:()=>$(K.id),children:"Configure"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},K.id,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function o4({plan:G}){let $=G.steps.filter((K)=>K.selected&&!K.skipReason).length;return Z(g,{children:[G.errors.length>0&&Z("div",{class:"launch-error",children:G.errors.map((K)=>Z("div",{children:K.message},K.message,!1,void 0,this))},void 0,!1,void 0,this),Z("div",{class:"plan-summary",children:[Z("strong",{children:G.pipelineId},void 0,!1,void 0,this),Z("span",{children:[$," of ",G.steps.length," steps will run",G.dryRun?" · dry run":""]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Z(B0,{metadata:G.definition?.metadata},void 0,!1,void 0,this),Z(d0,{steps:G.steps},void 0,!1,void 0,this),Z("div",{class:"plan-steps",children:G.steps.map((K)=>{let X=!K.selected?"Not selected":K.skipReason==="dry-run"?"Dry-run skip":K.skipReason?"Skipped":"Will run",Q=K.description||(K.dependencies.length?"After "+K.dependencies.join(", "):"No required dependencies"),z=K.nestedPipeline,W=K.remote,U=W?"Remote step":z?z.mode==="iterate"?"Pipeline iteration":z.mode==="for-each"?"Pipeline fan-out":"Nested pipeline":"Step";return Z("div",{class:"plan-step",children:[Z("div",{class:"plan-step-title",children:[Z("strong",{children:K.name||K.id},void 0,!1,void 0,this),Z("span",{class:`plan-kind${z?" pipeline":""}`,children:U},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z("small",{children:Q},void 0,!1,void 0,this),Z(B0,{metadata:K.metadata},void 0,!1,void 0,this),Z("span",{class:`plan-disposition${X==="Will run"?"":" skipped"}`,children:X},void 0,!1,void 0,this),z&&Z(a0,{label:z.pipelineId,secondary:`${z.stepIds.length} declared steps${z.mode==="iterate"?` per iteration, at most ${z.maxIterations} iterations`:z.mode==="for-each"?" per runtime item":""}`,stepIds:z.stepIds},void 0,!1,void 0,this),W&&Z(a0,{label:W.engine,secondary:W.target},void 0,!1,void 0,this)]},K.id,!0,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function i4({commandCount:G,snapshot:$}){let K=$.completedRunCount+$.failedRunCount,X=K?Math.round($.completedRunCount/K*100):0,Q=G||new Set($.definitions.map(({pipelineId:W})=>W)).size,z=[["Active now",$.activeRunCount,$.activeRunCount?"Live execution in progress":"No work in flight"],["Recorded runs",$.runs.length,"Append-only local history"],["Success rate",X+"%",K+" terminal runs"],["Pipelines",Q,G?"Available to configure":"Observed in run history"]];return Z(g,{children:z.map(([W,U,A])=>Z("article",{class:"metric",children:[Z("div",{class:"metric-label",children:W},void 0,!1,void 0,this),Z("div",{class:"metric-value",children:U},void 0,!1,void 0,this),Z("div",{class:"metric-note",children:A},void 0,!1,void 0,this)]},W,!0,void 0,this))},void 0,!1,void 0,this)}function l4({nowMs:G,onSelect:$,run:K,runIndex:X,selectedRunId:Q}){let z=K.steps.filter((A)=>A.status==="running"),W=z[0],U=X.descendantCount(K.runId);return Z("button",{class:`run-row ${K.status} ${X.rootRunId(Q)===K.runId?"selected":""}`,"data-run-id":K.runId,onClick:()=>$(K.runId),children:[Z("div",{class:"run-primary",children:[Z(t0,{value:K.status},void 0,!1,void 0,this),Z("strong",{children:K.pipelineId},void 0,!1,void 0,this),Z("time",{class:"run-time",datetime:E2(K.startedAtMs),title:V2(K.startedAtMs),children:x2(K.startedAtMs,G)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z("div",{class:"run-secondary",children:[Z("code",{children:r0(K.runId)},void 0,!1,void 0,this),Z("i",{class:"dot"},void 0,!1,void 0,this),K.correlationId&&Z(g,{children:[Z("span",{children:["correlation ",K.correlationId]},void 0,!0,void 0,this),Z("i",{class:"dot"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z("span",{children:s0(K.durationMs)},void 0,!1,void 0,this),Z("i",{class:"dot"},void 0,!1,void 0,this),Z("span",{children:[K.steps.length," steps"]},void 0,!0,void 0,this),U>0&&Z(g,{children:[Z("i",{class:"dot"},void 0,!1,void 0,this),Z("span",{children:[U," nested run",U===1?"":"s"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),K.dryRun&&Z(g,{children:[Z("i",{class:"dot"},void 0,!1,void 0,this),Z("span",{children:"dry run"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),K.status==="running"&&Z("div",{class:"run-activity",children:[Z("strong",{children:z.length>1?`${z.length} steps running`:W?.name||W?.id||"Starting"},void 0,!1,void 0,this),Z("span",{children:z.length>1?`${z.slice(0,3).map((A)=>A.name||A.id).join(", ")}${z.length>3?` +${z.length-3} more`:""}`:W?.progress?.message||"Execution in progress"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function u4({value:G}){let $=G.charAt(0).toUpperCase()+G.slice(1),K=G==="completed"?Z("svg",{viewBox:"0 0 12 12",children:Z("path",{d:"m2 6 2.4 2.4L10 3"},void 0,!1,void 0,this)},void 0,!1,void 0,this):G==="running"?Z("i",{},void 0,!1,void 0,this):G==="skipped"?Z("svg",{viewBox:"0 0 12 12",children:Z("path",{d:"m3 3 6 6M9 3 3 9"},void 0,!1,void 0,this)},void 0,!1,void 0,this):G==="cancelled"?Z("svg",{viewBox:"0 0 12 12",children:Z("rect",{x:"3",y:"3",width:"6",height:"6",rx:"1",fill:"currentColor",stroke:"none"},void 0,!1,void 0,this)},void 0,!1,void 0,this):G==="failed"?"!":"…";return Z("span",{class:`step-status-icon ${G}`,role:"img","aria-label":$,title:$,children:K},void 0,!1,void 0,this)}function r4({step:G}){let $=G.progress?.total,K=$?Math.max(0,Math.min(100,(G.progress?.completed??0)/$*100)):G.status==="completed"?100:18,X=G.nestedPipeline,Q=X?X.stepCount??X.stepIds.length:0,z=X&&X.stepIds.length<Q?X.stepIds.length+" of "+Q+" declared steps":Q+" declared steps",W=G.progress?.detailCount;return Z("article",{class:`step ${G.status}`,children:[Z(u4,{value:G.status},void 0,!1,void 0,this),Z("div",{class:"step-head",children:[Z("strong",{children:G.name||G.id},void 0,!1,void 0,this),G.outputSource&&Z(t0,{value:G.status,outputSource:G.outputSource},void 0,!1,void 0,this),G.name&&Z("code",{children:G.id},void 0,!1,void 0,this),Z("span",{class:"step-duration",children:s0(G.durationMs)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),G.description&&Z("div",{class:"step-description",children:G.description},void 0,!1,void 0,this),X&&Z(a0,{label:X.pipelineId,secondary:`${z}${X.mode==="iterate"?` per iteration, at most ${X.maxIterations} iterations`:X.mode==="for-each"?" per runtime item":""}`,stepIds:X.stepIds},void 0,!1,void 0,this),G.remote&&Z(a0,{label:G.remote.engine,secondary:G.remote.target},void 0,!1,void 0,this),G.attempt&&Z("div",{class:"execution",children:Z("span",{class:"execution-summary",title:G.attempt.attemptId,children:[Z("b",{children:G.attempt.outputSource==="override"?"Override validation":G.attempt.outputSource==="cache"?"Cache validation":"Execution"},void 0,!1,void 0,this)," ","· ",r0(G.attempt.attemptId),G.attempt.retries.length>0&&` · ${G.attempt.retries.length} retr${G.attempt.retries.length===1?"y":"ies"}`]},void 0,!0,void 0,this)},void 0,!1,void 0,this),G.artifacts&&Z(z2,{artifacts:G.artifacts,stepId:G.id},void 0,!1,void 0,this),G.progress&&Z(g,{children:[Z("div",{class:"progress",children:Z("i",{class:`w${Math.round(K)}`},void 0,!1,void 0,this)},void 0,!1,void 0,this),Z("div",{class:"progress-copy",children:G.progress.message||G.progress.completed+($?" / "+$:"")+" complete"},void 0,!1,void 0,this),G.progress.details&&G.progress.details.length>0&&Z("div",{class:"progress-details",children:[G.progress.details.map((U)=>Z("div",{class:`progress-detail ${U.status||"running"}`,children:[Z("b",{children:U.id},void 0,!1,void 0,this),U.label&&Z("span",{children:U.label},void 0,!1,void 0,this),U.outputSource==="override"&&Z("span",{children:"(overridden)"},void 0,!1,void 0,this),U.outputSource==="cache"&&Z("span",{children:"(cached)"},void 0,!1,void 0,this)]},U.id,!0,void 0,this)),W&&G.progress.details.length<W?Z("div",{class:"progress-detail-truncated",children:["Showing ",G.progress.details.length," of ",W," items"]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function s4(G){return["running","failed","cancelled","skipped","completed","planned"].map((K)=>[K,G.steps.filter((X)=>X.status===K).length]).filter(([,K])=>K).map(([K,X])=>X+" "+K).join(" · ")||"No steps"}function t4({canCancel:G,cancelling:$,liveRunIds:K,nowMs:X,onCancel:Q,onSelect:z,run:W,runIndex:U}){if(!W)return Z("div",{class:"sheet detail",children:Z(n0,{title:"Select a run",copy:"Choose a run from the history to inspect its steps, retry telemetry, logs, and errors."},void 0,!1,void 0,this)},void 0,!1,void 0,this);let A=U.ancestorsOf(W.runId),J=U.childrenOf(W.runId);return Z("article",{class:"sheet detail",children:Z("div",{class:"detail-body",children:[A.length>0&&Z("div",{class:"run-parentage",children:[A.map((H)=>Z("span",{children:[Z("button",{type:"button",onClick:()=>z(H.runId),children:H.pipelineId},void 0,!1,void 0,this),Z("span",{children:" / "},void 0,!1,void 0,this)]},H.runId,!0,void 0,this)),Z("span",{children:W.pipelineId},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z("div",{class:"detail-heading",children:[Z("div",{class:"detail-heading-copy",children:[Z("div",{class:"detail-kicker",children:[W.parentRunId?"Nested run":"Top-level run"," ·"," ",x2(W.startedAtMs,X)]},void 0,!0,void 0,this),Z("h2",{children:W.pipelineId},void 0,!1,void 0,this),Z("p",{class:"definition-identity",children:["Definition:"," ",Z("code",{children:W.definitionIdentity?.definitionId??"Not recorded (legacy trace)"},void 0,!1,void 0,this),Z("br",{},void 0,!1,void 0,this),"Implementation: ",W.definitionIdentity?.implementationVersion??"Unknown"]},void 0,!0,void 0,this),Z("div",{class:"run-id",children:W.runId},void 0,!1,void 0,this),W.correlationId&&Z("div",{class:"run-id",children:["Correlation: ",W.correlationId]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Z("div",{class:"detail-heading-actions",children:[Z(t0,{value:W.status},void 0,!1,void 0,this),G&&W.status==="running"&&!W.parentRunId&&K.includes(W.runId)&&Z("button",{class:"danger-button",type:"button",disabled:$,onClick:()=>Q(W.runId),children:"Cancel run"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Z("div",{class:"detail-meta",children:[Z("div",{children:[Z("label",{children:"Started"},void 0,!1,void 0,this),Z("span",{title:E2(W.startedAtMs),children:V2(W.startedAtMs)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z("div",{children:[Z("label",{children:"Duration"},void 0,!1,void 0,this),Z("span",{children:s0(W.durationMs)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z("div",{children:[Z("label",{children:"Steps"},void 0,!1,void 0,this),Z("span",{children:W.steps.length},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z("div",{children:[Z("label",{children:"Events"},void 0,!1,void 0,this),Z("span",{children:W.eventCount},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),J.length>0&&Z(g,{children:[Z("div",{class:"section-title",children:[Z("span",{children:"Nested runs"},void 0,!1,void 0,this),Z("span",{children:[J.length," direct · ",U.descendantCount(W.runId)," total"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Z("div",{class:"nested-runs",children:J.map((H)=>{let M=U.descendantCount(H.runId);return Z("button",{class:"nested-run",type:"button",onClick:()=>z(H.runId),children:[Z(t0,{value:H.status},void 0,!1,void 0,this),Z("strong",{children:H.pipelineId},void 0,!1,void 0,this),Z("small",{children:[s0(H.durationMs)," · ",H.steps.length," steps",M?" · "+M+" nested":""]},void 0,!0,void 0,this)]},H.runId,!0,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z("div",{class:"section-title",children:[Z("span",{children:"Step timeline"},void 0,!1,void 0,this),Z("span",{children:s4(W)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),W.steps.length?Z("div",{class:"step-list",children:W.steps.map((H)=>Z(r4,{step:H},H.id,!1,void 0,this))},void 0,!1,void 0,this):Z(n0,{title:"No planned steps",copy:"This run ended before a step plan was recorded."},void 0,!1,void 0,this),W.error&&Z(g,{children:[Z("div",{class:"section-title",children:Z("span",{children:"Error"},void 0,!1,void 0,this)},void 0,!1,void 0,this),Z("div",{class:"error-card",children:[Z("div",{class:"error-code",children:[W.error.code," · ",W.error.phase]},void 0,!0,void 0,this),Z("div",{class:"error-message",children:W.error.message},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),W.logs.length>0&&Z(g,{children:[Z("div",{class:"section-title",children:[Z("span",{children:"Logs"},void 0,!1,void 0,this),Z("span",{children:W.logs.length},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z("div",{class:"logs",children:W.logs.map((H)=>Z("div",{class:"log-line",children:[Z("time",{class:"log-time",children:x4(H.timestampMs)},void 0,!1,void 0,this),Z("span",{class:`log-level ${H.level}`,children:H.level},void 0,!1,void 0,this),Z("span",{class:"log-message",children:[H.stepId&&Z(g,{children:[Z("b",{children:H.stepId},void 0,!1,void 0,this)," ·"," "]},void 0,!0,void 0,this),H.message]},void 0,!0,void 0,this)]},H.id,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}function n4(G){let $=G.roots.filter((Q)=>G.runIndex.subtreeIsRunning(Q.runId)),K=G.roots.filter((Q)=>!G.runIndex.subtreeIsRunning(Q.runId)),X=(Q,z)=>z.length?Z(g,{children:[Z("div",{class:"run-group",children:[Q," · ",z.length]},void 0,!0,void 0,this),z.map((W)=>Z(l4,{nowMs:G.nowMs,onSelect:G.onSelect,run:W,runIndex:G.runIndex,selectedRunId:G.selectedRunId},W.runId,!1,void 0,this))]},void 0,!0,void 0,this):null;return Z(g,{children:[Z(J2,{definitions:G.definitions??[],runs:G.runs??[],onSelect:G.onSelect},void 0,!1,void 0,this),Z("div",{class:"content-grid",children:[Z("section",{class:"sheet",children:[Z("div",{class:"sheet-head",children:[Z("div",{children:[Z("div",{class:"sheet-title",children:"Pipeline runs"},void 0,!1,void 0,this),Z("div",{class:"sheet-subtitle",children:"Top-level runs · nested work stays with its parent"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z("span",{class:"sheet-subtitle",children:[G.roots.length," top-level · ",G.totalRunCount," total"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Z("div",{class:"run-list",children:G.roots.length?Z(g,{children:[X("Running now",$),X("Recent",K)]},void 0,!0,void 0,this):Z(n0,{title:"No recorded runs",copy:"Choose Pipelines to start a run and create local history."},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z(t4,{...G,run:G.selectedRun},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function e0(G){return G instanceof Error?G.message||String(G):String(G)}function a4({api:G,commands:$,commandId:K,onClose:X,onLaunched:Q}){let[z,W]=R(K??$[0]?.id??""),U=$.find((b)=>b.id===z),[A,J]=R([]),[H,M]=R(null),[Y,N]=R(""),[q,P]=R(!1),[O,L]=R(!1),B=w0(null),k=w0(0);if(s(()=>{W(K??$[0]?.id??"")},[K,$]),s(()=>{k.current+=1,J(U?j4(U):[]),M(null),N(""),requestAnimationFrame(()=>B.current?.querySelector("input, select, textarea")?.focus())},[U]),s(()=>{if(K===null)return;let b=(C)=>{if(C.key==="Escape"&&!q&&!O)X()};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[K,q,X,O]),K===null)return null;let x=()=>{if(!q&&!O)X()},h=(b,C)=>{if(!U)return;k.current+=1,J((d)=>d.map((u,r)=>{if(r===b)return C;let F0=U.parameters[r];return U.parameters[b]?.exclusive&&U.parameters[b]?.multiple&&C.length>0&&F0?.exclusive&&F0.multiple?[]:u})),M(null)},n=(b,C)=>{let d=A[C]??[];if(!b.multiple||b.choices)return d;return String(d[0]??"").split(/\r?\n/).map((u)=>u.trim()).filter(Boolean).map((u)=>b.type==="number"?Number(u):u)},G0=async()=>{if(!U?.canPlan||O)return;let b=k.current;L(!0),N("");try{let C=await G.previewPlan(U.id,E4(U,n));if(k.current===b)M(C)}catch(C){if(k.current===b)N(e0(C))}finally{L(!1)}},X0=async(b)=>{if(b.preventDefault(),!U||q)return;P(!0),N("");try{Q(await G.launch(U.id,V4(U,n)))}catch(C){N(e0(C))}finally{P(!1)}};return Z("div",{class:"modal-backdrop",role:"dialog","aria-modal":"true","aria-labelledby":"launchTitle",onClick:(b)=>b.target===b.currentTarget&&x(),children:Z("div",{class:"modal",children:[Z("div",{class:"modal-head",children:[Z("div",{children:[Z("div",{class:"detail-kicker",children:"Configure pipeline"},void 0,!1,void 0,this),Z("h2",{id:"launchTitle",children:U?.name||"Run a pipeline"},void 0,!1,void 0,this),Z("p",{children:U?S1(U):"Choose a declared pipeline and provide its inputs."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z("button",{class:"close-button",type:"button","aria-label":"Close",onClick:x,children:"×"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z("form",{class:"launch-form",onSubmit:X0,children:[Z("div",{class:"field",children:[Z("label",{for:"launchCommand",children:"Pipeline command"},void 0,!1,void 0,this),Z("select",{id:"launchCommand",value:z,onChange:(b)=>{k.current+=1,M(null),N(""),W(b.currentTarget.value)},children:$.map((b)=>Z("option",{value:b.id,children:b.name},b.id,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z("div",{ref:B,children:U&&Z(d4,{command:U,onChange:h,values:A},void 0,!1,void 0,this)},void 0,!1,void 0,this),H&&Z("div",{class:"plan-result","aria-live":"polite",children:Z(o4,{plan:H},void 0,!1,void 0,this)},void 0,!1,void 0,this),Y&&Z("div",{class:"launch-error",children:Y},void 0,!1,void 0,this),Z("div",{class:"modal-actions",children:[Z("button",{class:"secondary-button",type:"button",onClick:x,children:"Cancel"},void 0,!1,void 0,this),U?.canPlan&&Z("button",{class:"secondary-button",type:"button",disabled:O||q,onClick:()=>void G0(),children:O?"Planning…":"Preview plan"},void 0,!1,void 0,this),Z("button",{class:"primary-button",type:"submit",disabled:q||O,children:q?"Starting…":"Run"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}function e4({api:G,onCleared:$,onClose:K,snapshot:X}){let[Q,z]=R(!1),[W,U]=R(""),A=w0(null);s(()=>A.current?.focus(),[]),s(()=>{let N=(q)=>{if(q.key==="Escape"&&!Q)K()};return document.addEventListener("keydown",N),()=>document.removeEventListener("keydown",N)},[Q,K]);let J=X.runs.length,H=X.runs.reduce((N,q)=>N+q.eventCount,0),M=()=>{if(!Q)K()},Y=async()=>{if(Q)return;z(!0),U("");try{$((await G.clearHistory()).eventCount)}catch(N){U(e0(N))}finally{z(!1)}};return Z("div",{class:"modal-backdrop",role:"dialog","aria-modal":"true","aria-labelledby":"clearHistoryTitle",onClick:(N)=>N.target===N.currentTarget&&M(),children:Z("div",{class:"modal confirm-modal",children:[Z("div",{class:"modal-head",children:[Z("div",{children:[Z("div",{class:"detail-kicker",children:"Local maintenance"},void 0,!1,void 0,this),Z("h2",{id:"clearHistoryTitle",children:"Clear run history?"},void 0,!1,void 0,this),Z("p",{children:"This permanently resets the local studio history."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z("button",{class:"close-button",type:"button","aria-label":"Close",onClick:M,children:"×"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z("div",{class:"confirm-body",children:[Z("p",{class:"confirm-copy",children:["Remove ",J," recorded run",J===1?"":"s"," and ",H," event",H===1?"":"s"," from this SQLite store.",X.activeRunCount?` ${X.activeRunCount} recorded run${X.activeRunCount===1?" is":"s are"} still marked active; continue only if no external process is writing to this store.`:""]},void 0,!0,void 0,this),Z("div",{class:"confirm-warning",children:"This cannot be undone. Pipeline definitions and execution remain unchanged; only recorded local events are removed."},void 0,!1,void 0,this),W&&Z("div",{class:"launch-error",children:W},void 0,!1,void 0,this),Z("div",{class:"confirm-actions",children:[Z("button",{class:"secondary-button",type:"button",onClick:M,children:"Cancel"},void 0,!1,void 0,this),Z("button",{ref:A,class:"danger-button",type:"button",disabled:Q,onClick:()=>void Y(),children:Q?"Clearing…":"Clear history"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}var GG=j2();function $G(G){return{className:`pulse${G?"":" lost"}`,label:G?"Connected · local":"Connection lost"}}function KG(G,$,K,X){if(G&&G===$&&!X.runById(G))return G;if(!G||!K.some((Q)=>Q.runId===X.rootRunId(G)))return K[0]?.runId??null;return G}function ZG({api:G=GG}){let $=c0(()=>new g1(G),[G]),[K,X]=R(()=>$.getState()),{connected:Q,detail:z,manualRefreshing:W,snapshot:U}=K,[A,J]=R([]),[H,M]=R("runs"),[Y,N]=R(""),[q,P]=R(null),[O,L]=R(!1),[B,k]=R(!1),[x,h]=R(!1),[n,G0]=R(null),[X0,b]=R(!1),[C,d]=R(""),u=w0(null),r=c0(()=>D4(U?.runs??[]),[U]);s(()=>{return X($.getState()),$.subscribe(X)},[$]),s(()=>()=>$.dispose(),[$]),s(()=>{G.loadCommands().then((l)=>{if(J(l),l.length)M("pipelines")}).catch(()=>{}),G.loadCapabilities().then((l)=>{L(l.canCancel),k(l.canClearHistory)}).catch(()=>{}),$.refresh();let w=setInterval(()=>$.refresh(),1200);return()=>clearInterval(w)},[G,$]),s(()=>{if(!C)return;let w=setTimeout(()=>d(""),4200);return()=>clearTimeout(w)},[C]);let F0=Y?r.matchingRootIds(Y):null,G1=r.roots.filter((w)=>!F0||F0.has(w.runId)).sort((w,l)=>Number(r.subtreeIsRunning(l.runId))-Number(r.subtreeIsRunning(w.runId))||l.startedAtMs-w.startedAtMs);s(()=>{let w=u.current,l=KG(q,w,G1,r);if(w&&r.runById(w))u.current=null;if(l!==q)P(l)},[G1,r,q]);let g0=r.runById(q),y1=g0?[g0.runId,g0.eventCount,g0.status].join(":"):null;s(()=>{$.selectRun(q,y1)},[$,y1,q]);let f0=(w)=>d(w),m2=(w)=>{u.current=null,P(w)},v2=async(w)=>{if(!O||x)return;h(!0);try{await G.cancelRun(w),f0("Run cancelled · "+r0(w)),$.invalidate({delayMs:80})}catch(l){f0(e0(l))}finally{h(!1)}},c2=A.filter((w)=>!Y||w.name.toLowerCase().includes(Y.toLowerCase())||S1(w).toLowerCase().includes(Y.toLowerCase())),L0=H==="pipelines",d2=z?.run.runId===q?z.run:null,I1=$G(Q);return Z(g,{children:[Z("div",{class:"shell",children:[Z("aside",{class:"rail",children:[Z("div",{class:"brand",children:[Z("div",{class:"mark","aria-hidden":"true",children:Z("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:[Z("path",{d:"M3 4.5h6a3 3 0 0 1 3 3v6",stroke:"#f7f8f3",strokeWidth:"1.5"},void 0,!1,void 0,this),Z("circle",{cx:"3",cy:"4.5",r:"2",fill:"#7396ff"},void 0,!1,void 0,this),Z("circle",{cx:"12",cy:"13.5",r:"2",fill:"#63d297"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),Z("div",{class:"brand-copy",children:[Z("strong",{children:"Tubeless"},void 0,!1,void 0,this),Z("small",{children:"Local studio"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Z("div",{class:"rail-label",children:"Workspace"},void 0,!1,void 0,this),Z("nav",{class:"nav","aria-label":"Studio sections",children:[A.length>0&&Z("button",{class:L0?"active":"",type:"button",title:"Pipelines",onClick:()=>M("pipelines"),children:[Z("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[Z("path",{d:"M4 5h7M4 10h12M9 15h7"},void 0,!1,void 0,this),Z("circle",{cx:"14.5",cy:"5",r:"1.5"},void 0,!1,void 0,this),Z("circle",{cx:"5.5",cy:"15",r:"1.5"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z("span",{children:"Pipelines"},void 0,!1,void 0,this),Z("b",{class:"nav-count",children:A.length},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z("button",{class:L0?"":"active",type:"button",title:"Runs",onClick:()=>M("runs"),children:[Z("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[Z("path",{d:"M10 3v4l2.5 1.5M17 10a7 7 0 1 1-2.05-4.95"},void 0,!1,void 0,this),Z("path",{d:"M14.5 2.8v3.5H18"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z("span",{children:"Runs"},void 0,!1,void 0,this),Z("b",{class:"nav-count",children:U?.runs.length??0},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Z("div",{class:"rail-foot",children:[Z("div",{class:"connection",children:[Z("i",{class:I1.className},void 0,!1,void 0,this),Z("span",{children:I1.label},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z("div",{class:"database",children:"append-only SQLite"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Z("main",{class:"workspace",children:[Z("header",{class:"topbar",children:[Z("div",{children:[Z("div",{class:"eyebrow",children:"Execution workspace"},void 0,!1,void 0,this),Z("h1",{children:L0?"Pipelines":"Runs"},void 0,!1,void 0,this),Z("p",{class:"lede",children:L0?"Choose a declared workflow to configure and run.":"Live work and durable history in one place."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z("div",{class:"toolbar",children:[Z("input",{class:"search",type:"search",value:Y,placeholder:L0?"Filter pipelines":"Filter runs or IDs","aria-label":"Filter",onInput:(w)=>N(w.currentTarget.value.trim())},void 0,!1,void 0,this),A.length>0&&Z("button",{class:"primary-button",onClick:()=>G0(A[0]?.id??""),children:"Run pipeline"},void 0,!1,void 0,this),B&&Z("button",{class:"danger-button",id:"clearHistoryButton",type:"button",disabled:!U?.runs.length,title:U?.activeRunCount?"Clear history, including runs left active by an interrupted process":"Clear history",onClick:()=>b(!0),children:[Z("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.4","aria-hidden":"true",children:Z("path",{d:"M3 4.5h10M6 2.5h4M5 4.5l.5 9h5l.5-9M7 7v4M9 7v4"},void 0,!1,void 0,this)},void 0,!1,void 0,this),Z("span",{children:"Clear history"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z("button",{class:`icon-button${W?" spinning":""}`,type:"button",title:"Refresh now","aria-label":"Refresh now",onClick:()=>$.refresh(!0),children:Z("svg",{width:"16",height:"16",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[Z("path",{d:"M16.5 7A7 7 0 1 0 17 11"},void 0,!1,void 0,this),Z("path",{d:"M16.5 3v4h-4"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),U&&Z(g,{children:[Z("section",{class:"metrics",children:Z(i4,{commandCount:A.length,snapshot:U},void 0,!1,void 0,this)},void 0,!1,void 0,this),Z("section",{children:L0?Z(p4,{commands:c2,onConfigure:G0},void 0,!1,void 0,this):Z(n4,{definitions:U.definitions,runs:U.runs,canCancel:O,cancelling:x,liveRunIds:U.liveRunIds??[],nowMs:Date.now(),onCancel:(w)=>void v2(w),onSelect:m2,roots:G1,runIndex:r,selectedRun:d2,selectedRunId:q,totalRunCount:U.runs.length},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),n!==null&&Z(a4,{api:G,commands:A,commandId:n,onClose:()=>G0(null),onLaunched:(w)=>{u.current=w,P(w),M("runs"),N(""),G0(null),f0("Run accepted · "+r0(w)),$.invalidate({delayMs:80})}},void 0,!1,void 0,this),X0&&U&&Z(e4,{api:G,snapshot:U,onClose:()=>b(!1),onCleared:(w)=>{u.current=null,P(null),b(!1),f0("Cleared "+w+" recorded event"+(w===1?"":"s")),$.invalidate({resetHistory:!0})}},void 0,!1,void 0,this),C&&Z("div",{class:"toast",role:"status",children:C},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function h2(){let G=document.querySelector("#studio-root");if(!(G instanceof HTMLElement))throw Error("Missing #studio-root");r1(Z(ZG,{},void 0,!1,void 0,this),G)}h2();
|
|
1
|
+
var v$,C,o0,a1,W$,m0,i0,l0,Z0,h$,g$,u0,z0,W0,X0,e1,V$={},E$=[],$2=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,m$=Array.isArray;function $$($,G){for(var Z in G)$[Z]=G[Z];return $}function Q0($){$&&$.parentNode&&$.parentNode.removeChild($)}function G2($,G,Z){var W,z,Q,Y={};for(Q in G)Q=="key"?W=G[Q]:Q=="ref"?z=G[Q]:Y[Q]=G[Q];if(arguments.length>2&&(Y.children=arguments.length>3?v$.call(arguments,2):Z),typeof $=="function"&&$.defaultProps!=null)for(Q in $.defaultProps)Y[Q]===void 0&&(Y[Q]=$.defaultProps[Q]);return j$($,Y,W,z,null)}function j$($,G,Z,W,z){var Q={type:$,props:G,key:Z,ref:W,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:z==null?++o0:z,__i:-1,__u:0};return z==null&&C.vnode!=null&&C.vnode(Q),Q}function f($){return $.children}function D$($,G){this.props=$,this.context=G}function q$($,G){if(G==null)return $.__?q$($.__,$.__i+1):null;for(var Z;G<$.__k.length;G++)if((Z=$.__k[G])!=null&&Z.__e!=null)return Z.__e;return typeof $.type=="function"?q$($):null}function K2($){if($.__P&&$.__d){var G=$.__v,Z=G.__e,W=[],z=[],Q=$$({},G);Q.__v=G.__v+1,C.vnode&&C.vnode(Q),Y0($.__P,Q,G,$.__n,$.__P.namespaceURI,32&G.__u?[Z]:null,W,Z==null?q$(G):Z,!!(32&G.__u),z),Q.__v=G.__v,Q.__.__k[Q.__i]=Q,a0(W,Q,z),G.__e=G.__=null,Q.__e!=Z&&r0(Q)}}function r0($){if(($=$.__)!=null&&$.__c!=null)return $.__e=$.__c.base=null,$.__k.some(function(G){if(G!=null&&G.__e!=null)return $.__e=$.__c.base=G.__e}),r0($)}function c0($){(!$.__d&&($.__d=!0)&&W$.push($)&&!x$.__r++||m0!=C.debounceRendering)&&((m0=C.debounceRendering)||i0)(x$)}function x$(){try{for(var $,G=1;W$.length;)W$.length>G&&W$.sort(l0),$=W$.shift(),G=W$.length,K2($)}finally{W$.length=x$.__r=0}}function s0($,G,Z,W,z,Q,Y,X,A,J,L){var O,U,N,H,M,B,q=W&&W.__k||E$,_=G.length;for(A=Z2(Z,G,q,A,_),O=0;O<_;O++)(N=Z.__k[O])!=null&&(U=N.__i!=-1&&q[N.__i]||V$,N.__i=O,B=Y0($,N,U,z,Q,Y,X,A,J,L),H=N.__e,N.ref&&U.ref!=N.ref&&(U.ref&&J0(U.ref,null,N),L.push(N.ref,N.__c||H,N)),M==null&&H!=null&&(M=H),4&N.__u?(A=n0(N,A,$),U.__e&&(U.__e=null)):typeof N.type=="function"&&B!==void 0?A=B:H&&(A=H.nextSibling),N.__u&=-7);return Z.__e=M,A}function Z2($,G,Z,W,z){var Q,Y,X,A,J,L=Z.length,O=L,U=0;for($.__k=Array(z),Q=0;Q<z;Q++)(Y=G[Q])!=null&&typeof Y!="boolean"&&typeof Y!="function"?(typeof Y=="string"||typeof Y=="number"||typeof Y=="bigint"||Y.constructor==String?Y=$.__k[Q]=j$(null,Y,null,null,null):m$(Y)?Y=$.__k[Q]=j$(f,{children:Y},null,null,null):Y.constructor===void 0&&Y.__b>0?Y=$.__k[Q]=j$(Y.type,Y.props,Y.key,Y.ref?Y.ref:null,Y.__v):$.__k[Q]=Y,A=Q+U,Y.__=$,Y.__b=$.__b+1,X=null,(J=Y.__i=W2(Y,Z,A,O))!=-1&&(O--,(X=Z[J])&&(X.__u|=2)),X==null||X.__v==null?(J==-1&&(z>L?U--:z<L&&U++),typeof Y.type!="function"&&(Y.__u|=4)):J!=A&&(J==A-1?U--:J==A+1?U++:(J>A?U--:U++,Y.__u|=4))):$.__k[Q]=null;if(O)for(Q=0;Q<L;Q++)(X=Z[Q])!=null&&(2&X.__u)==0&&(X.__e==W&&(W=q$(X)),$1(X,X));return W}function n0($,G,Z){var W,z;if(typeof $.type=="function"){for(W=$.__k,z=0;W&&z<W.length;z++)W[z]&&(W[z].__=$,G=n0(W[z],G,Z));return G}$.__e!=G&&(G&&$.type&&!G.parentNode&&(G=q$($)),G=Z.insertBefore($.__e,G||null));do G=G&&G.nextSibling;while(G!=null&&G.nodeType==8);return G}function W2($,G,Z,W){var z,Q,Y,X=$.key,A=$.type,J=G[Z],L=J!=null&&(2&J.__u)==0;if(J===null&&X==null||L&&X==J.key&&A==J.type)return Z;if(W>(L?1:0)){for(z=Z-1,Q=Z+1;z>=0||Q<G.length;)if((J=G[Y=z>=0?z--:Q++])!=null&&(2&J.__u)==0&&X==J.key&&A==J.type)return Y}return-1}function d0($,G,Z){G[0]=="-"?$.setProperty(G,Z==null?"":Z):$[G]=Z==null?"":typeof Z!="number"||$2.test(G)?Z:Z+"px"}function I$($,G,Z,W,z){var Q,Y;$:if(G=="style")if(typeof Z=="string")$.style.cssText=Z;else{if(typeof W=="string"&&($.style.cssText=W=""),W)for(G in W)Z&&G in Z||d0($.style,G,"");if(Z)for(G in Z)W&&Z[G]==W[G]||d0($.style,G,Z[G])}else if(G[0]=="o"&&G[1]=="n")Q=G!=(G=G.replace(u0,"$1")),Y=G.toLowerCase(),G=Y in $||G=="onFocusOut"||G=="onFocusIn"?Y.slice(2):G.slice(2),$.l||($.l={}),$.l[G+Q]=Z,Z?W?Z[g$]=W[g$]:(Z[g$]=z0,$.addEventListener(G,Q?X0:W0,Q)):$.removeEventListener(G,Q?X0:W0,Q);else{if(z=="http://www.w3.org/2000/svg")G=G.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(G!="width"&&G!="height"&&G!="href"&&G!="list"&&G!="form"&&G!="tabIndex"&&G!="download"&&G!="rowSpan"&&G!="colSpan"&&G!="role"&&G!="popover"&&G in $)try{$[G]=Z==null?"":Z;break $}catch(X){}typeof Z=="function"||(Z==null||Z===!1&&G[4]!="-"?$.removeAttribute(G):$.setAttribute(G,G=="popover"&&Z==1?"":Z))}}function p0($){return function(G){if(this.l){var Z=this.l[G.type+$];if(G[h$]==null)G[h$]=z0++;else if(G[h$]<Z[g$])return;return Z(C.event?C.event(G):G)}}}function Y0($,G,Z,W,z,Q,Y,X,A,J){var L,O,U,N,H,M,B,q,_,k,x,d,s,L$,e,w,g=G.type;if(G.constructor!==void 0)return null;128&Z.__u&&(A=!!(32&Z.__u),Q=[X=G.__e=Z.__e]),(L=C.__b)&&L(G);$:if(typeof g=="function"){O=Y.length;try{if(_=G.props,k=g.prototype&&g.prototype.render,x=(L=g.contextType)&&W[L.__c],d=L?x?x.props.value:L.__:W,Z.__c?q=(U=G.__c=Z.__c).__=U.__E:(k?G.__c=U=new g(_,d):(G.__c=U=new D$(_,d),U.constructor=g,U.render=z2),x&&x.sub(U),U.state||(U.state={}),U.__n=W,N=U.__d=!0,U.__h=[],U._sb=[]),k&&U.__s==null&&(U.__s=U.state),k&&g.getDerivedStateFromProps!=null&&(U.__s==U.state&&(U.__s=$$({},U.__s)),$$(U.__s,g.getDerivedStateFromProps(_,U.__s))),H=U.props,M=U.state,U.__v=G,N)k&&g.getDerivedStateFromProps==null&&U.componentWillMount!=null&&U.componentWillMount(),k&&U.componentDidMount!=null&&U.__h.push(U.componentDidMount);else{if(k&&g.getDerivedStateFromProps==null&&_!==H&&U.componentWillReceiveProps!=null&&U.componentWillReceiveProps(_,d),G.__v==Z.__v||!U.__e&&U.shouldComponentUpdate!=null&&U.shouldComponentUpdate(_,U.__s,d)===!1){G.__v!=Z.__v&&(U.props=_,U.state=U.__s,U.__d=!1),G.__e=Z.__e,G.__k=Z.__k,G.__k.some(function(l){l&&(l.__=G)}),E$.push.apply(U.__h,U._sb),U._sb=[],U.__h.length&&Y.push(U),X=q$(Z);break $}U.componentWillUpdate!=null&&U.componentWillUpdate(_,U.__s,d),k&&U.componentDidUpdate!=null&&U.__h.push(function(){U.componentDidUpdate(H,M,B)})}if(U.context=d,U.props=_,U.__P=$,U.__e=!1,s=C.__r,L$=0,k)U.state=U.__s,U.__d=!1,s&&s(G),L=U.render(U.props,U.state,U.context),E$.push.apply(U.__h,U._sb),U._sb=[];else do U.__d=!1,s&&s(G),L=U.render(U.props,U.state,U.context),U.state=U.__s;while(U.__d&&++L$<25);U.state=U.__s,U.getChildContext!=null&&(W=$$($$({},W),U.getChildContext())),k&&!N&&U.getSnapshotBeforeUpdate!=null&&(B=U.getSnapshotBeforeUpdate(H,M)),e=L!=null&&L.type===f&&L.key==null?e0(L.props.children):L,X=s0($,m$(e)?e:[e],G,Z,W,z,Q,Y,X,A,J),U.base=G.__e,G.__u&=-161,U.__h.length&&Y.push(U),q&&(U.__E=U.__=null)}catch(l){if(Y.length=O,G.__v=null,A||Q!=null){if(l.then){for(G.__u|=A?160:128;X&&X.nodeType==8&&X.nextSibling;)X=X.nextSibling;Q!=null&&(Q[Q.indexOf(X)]=null),G.__e=X}else if(Q!=null)for(w=Q.length;w--;)Q0(Q[w])}else G.__e=Z.__e;G.__k==null&&(G.__k=Z.__k||[]),l.then||t0(G),C.__e(l,G,Z)}}else Q==null&&G.__v==Z.__v?(G.__k=Z.__k,G.__e=Z.__e):X=G.__e=X2(Z.__e,G,Z,W,z,Q,Y,A,J);return(L=C.diffed)&&L(G),128&G.__u?void 0:X}function t0($){$&&($.__c&&($.__c.__e=!0),$.__k&&$.__k.some(t0))}function a0($,G,Z){for(var W=0;W<Z.length;W++)J0(Z[W],Z[++W],Z[++W]);C.__c&&C.__c(G,$),$.some(function(z){try{$=z.__h,z.__h=[],$.some(function(Q){Q.call(z)})}catch(Q){C.__e(Q,z.__v)}})}function e0($){return typeof $!="object"||$==null||$.__b>0?$:m$($)?$.map(e0):$.constructor!==void 0?null:$$({},$)}function X2($,G,Z,W,z,Q,Y,X,A){var J,L,O,U,N,H,M,B=Z.props||V$,q=G.props,_=G.type;if(_=="svg"?z="http://www.w3.org/2000/svg":_=="math"?z="http://www.w3.org/1998/Math/MathML":z||(z="http://www.w3.org/1999/xhtml"),Q!=null){for(J=0;J<Q.length;J++)if((N=Q[J])&&"setAttribute"in N==!!_&&(_?N.localName==_:N.nodeType==3)){$=N,Q[J]=null;break}}if($==null){if(_==null)return document.createTextNode(q);$=document.createElementNS(z,_,q.is&&q),X&&(C.__m&&C.__m(G,Q),X=!1),Q=null}if(_==null)B===q||X&&$.data==q||($.data=q);else{if(Q=_=="textarea"&&q.defaultValue!=null?null:Q&&v$.call($.childNodes),!X&&Q!=null)for(B={},J=0;J<$.attributes.length;J++)B[(N=$.attributes[J]).name]=N.value;for(J in B)N=B[J],J=="dangerouslySetInnerHTML"?O=N:J=="children"||(J in q)||J=="value"&&("defaultValue"in q)||J=="checked"&&("defaultChecked"in q)||I$($,J,null,N,z);for(J in q)N=q[J],J=="children"?U=N:J=="dangerouslySetInnerHTML"?L=N:J=="value"?H=N:J=="checked"?M=N:X&&typeof N!="function"||B[J]===N||I$($,J,N,B[J],z);if(L)X||O&&(L.__html==O.__html||L.__html==$.innerHTML)||($.innerHTML=L.__html),G.__k=[];else if(O&&($.innerHTML=""),s0(G.type=="template"?$.content:$,m$(U)?U:[U],G,Z,W,_=="foreignObject"?"http://www.w3.org/1999/xhtml":z,Q,Y,Q?Q[0]:Z.__k&&q$(Z,0),X,A),Q!=null)for(J=Q.length;J--;)Q0(Q[J]);X&&_!="textarea"||(J="value",_=="progress"&&H==null?$.removeAttribute("value"):H!=null&&(H!==$[J]||_=="progress"&&!H||_=="option"&&H!=B[J])&&I$($,J,H,B[J],z),J="checked",M!=null&&M!=$[J]&&I$($,J,M,B[J],z))}return $}function J0($,G,Z){try{if(typeof $=="function"){var W=typeof $.__u=="function";W&&$.__u(),W&&G==null||($.__u=$(G))}else $.current=G}catch(z){C.__e(z,Z)}}function $1($,G,Z){var W,z;if(C.unmount&&C.unmount($),(W=$.ref)&&(W.current&&W.current!=$.__e||J0(W,null,G)),(W=$.__c)!=null){if(W.componentWillUnmount)try{W.componentWillUnmount()}catch(Q){C.__e(Q,G)}W.base=W.__P=W.__n=null}if(W=$.__k)for(z=0;z<W.length;z++)W[z]&&$1(W[z],G,Z||typeof $.type!="function");Z||Q0($.__e),$.__c=$.__=$.__e=void 0}function z2($,G,Z){return this.constructor($,Z)}function G1($,G,Z){var W,z,Q,Y;G==document&&(G=document.documentElement),C.__&&C.__($,G),z=(W=typeof Z=="function")?null:Z&&Z.__k||G.__k,Q=[],Y=[],Y0(G,$=(!W&&Z||G).__k=G2(f,null,[$]),z||V$,V$,G.namespaceURI,!W&&Z?[Z]:z?null:G.firstChild?v$.call(G.childNodes):null,Q,!W&&Z?Z:z?z.__e:G.firstChild,W,Y),a0(Q,$,Y),$.props.children=null}v$=E$.slice,C={__e:function($,G,Z,W){for(var z,Q,Y;G=G.__;)if((z=G.__c)&&!z.__)try{if((Q=z.constructor)&&Q.getDerivedStateFromError!=null&&(z.setState(Q.getDerivedStateFromError($)),Y=z.__d),z.componentDidCatch!=null&&(z.componentDidCatch($,W||{}),Y=z.__d),Y)return z.__E=z}catch(X){$=X}throw $}},o0=0,a1=function($){return $!=null&&$.constructor===void 0},D$.prototype.setState=function($,G){var Z;Z=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=$$({},this.state),typeof $=="function"&&($=$($$({},Z),this.props)),$&&$$(Z,$),$!=null&&this.__v&&(G&&this._sb.push(G),c0(this))},D$.prototype.forceUpdate=function($){this.__v&&(this.__e=!0,$&&this.__h.push($),c0(this))},D$.prototype.render=f,W$=[],i0=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,l0=function($,G){return $.__v.__b-G.__v.__b},x$.__r=0,Z0=Math.random().toString(8),h$="__d"+Z0,g$="__a"+Z0,u0=/(PointerCapture)$|Capture$/i,z0=0,W0=p0(!1),X0=p0(!0),e1=0;var C$,I,U0,K1,d$=0,U1=[],h=C,Z1=h.__b,W1=h.__r,X1=h.diffed,z1=h.__c,Q1=h.unmount,Y1=h.__;function L0($,G){h.__h&&h.__h(I,$,d$||G),d$=0;var Z=I.__H||(I.__H={__:[],__h:[]});return $>=Z.__.length&&Z.__.push({}),Z.__[$]}function T($){return d$=1,Q2(L1,$)}function Q2($,G,Z){var W=L0(C$++,2);if(W.t=$,!W.__c&&(W.__=[Z?Z(G):L1(void 0,G),function(X){var A=W.__N?W.__N[0]:W.__[0],J=W.t(A,X);A!==J&&(W.__N=[J,W.__[1]],W.__c.setState({}))}],W.__c=I,!I.__f)){var z=function(X,A,J){if(!W.__c.__H)return!0;var L=!1,O=W.__c.props!==X;if(W.__c.__H.__.some(function(N){if(N.__N){L=!0;var H=N.__[0];N.__=N.__N,N.__N=void 0,H!==N.__[0]&&(O=!0)}}),Q){var U=Q.call(this,X,A,J);return L?U||O:U}return!L||O};I.__f=!0;var{shouldComponentUpdate:Q,componentWillUpdate:Y}=I;I.componentWillUpdate=function(X,A,J){if(this.__e){var L=Q;Q=void 0,z(X,A,J),Q=L}Y&&Y.call(this,X,A,J)},I.shouldComponentUpdate=z}return W.__N||W.__}function u($,G){var Z=L0(C$++,3);!h.__s&&A1(Z.__H,G)&&(Z.__=$,Z.u=G,I.__H.__h.push(Z))}function p$($){return d$=5,o$(function(){return{current:$}},[])}function o$($,G){var Z=L0(C$++,7);return A1(Z.__H,G)&&(Z.__=$(),Z.__H=G,Z.__h=$),Z.__}function Y2(){for(var $;$=U1.shift();){var G=$.__H;if($.__P&&G)try{G.__h.some(c$),G.__h.some(A0),G.__h=[]}catch(Z){G.__h=[],h.__e(Z,$.__v)}}}h.__b=function($){I=null,Z1&&Z1($)},h.__=function($,G){$&&G.__k&&G.__k.__m&&($.__m=G.__k.__m),Y1&&Y1($,G)},h.__r=function($){W1&&W1($),C$=0;var G=(I=$.__c).__H;G&&(U0===I?(G.__h=[],I.__h=[],G.__.some(function(Z){Z.__N&&(Z.__=Z.__N),Z.u=Z.__N=void 0})):(G.__h.some(c$),G.__h.some(A0),G.__h=[],C$=0)),U0=I},h.diffed=function($){X1&&X1($);var G=$.__c;G&&G.__H&&(G.__H.__h.length&&(U1.push(G)!==1&&K1===h.requestAnimationFrame||((K1=h.requestAnimationFrame)||J2)(Y2)),G.__H.__.some(function(Z){Z.u&&(Z.__H=Z.u,Z.u=void 0)})),U0=I=null},h.__c=function($,G){G.some(function(Z){try{Z.__h.some(c$),Z.__h=Z.__h.filter(function(W){return!W.__||A0(W)})}catch(W){G.some(function(z){z.__h&&(z.__h=[])}),G=[],h.__e(W,Z.__v)}}),z1&&z1($,G)},h.unmount=function($){Q1&&Q1($);var G,Z=$.__c;Z&&Z.__H&&(Z.__H.__.some(function(W){try{c$(W)}catch(z){G=z}}),Z.__H=void 0,G&&h.__e(G,Z.__v))};var J1=typeof requestAnimationFrame=="function";function J2($){var G,Z=function(){clearTimeout(W),J1&&cancelAnimationFrame(G),setTimeout($)},W=setTimeout(Z,35);J1&&(G=requestAnimationFrame(Z))}function c$($){var G=I,Z=$.__c;typeof Z=="function"&&($.__c=void 0,Z()),I=G}function A0($){var G=I;$.__c=$.__(),I=G}function A1($,G){return!$||$.length!==G.length||G.some(function(Z,W){return Z!==$[W]})}function L1($,G){return typeof G=="function"?G($):G}var U2=0;function K($,G,Z,W,z,Q){G||(G={});var Y,X,A=G;if("ref"in A)for(X in A={},G)X=="ref"?Y=G[X]:A[X]=G[X];var J={type:$,props:A,key:Z,ref:Y,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--U2,__i:-1,__u:0,__source:z,__self:Q};if(typeof $=="function"&&(Y=$.defaultProps))for(X in Y)A[X]===void 0&&(A[X]=Y[X]);return C.vnode&&C.vnode(J),J}function B$({metadata:$}){if(!$)return null;return K("details",{class:"step-metadata",children:[K("summary",{children:[$.owner,$.domain,...$.tags??[]].filter(Boolean).join(" · ")||"Metadata"},void 0,!1,void 0,this),K("pre",{children:JSON.stringify($,null,2)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function A2($,G,Z){let W=new Map,z=G.trim().toLowerCase();for(let Q of $){if(!`${Q.id} ${JSON.stringify(Q.metadata??{})}`.toLowerCase().includes(z))continue;let Y=Z==="none"?"Steps":Q.metadata?.[Z],X=W.get(Y)??[];X.push(Q),W.set(Y,X)}return W}function i$({steps:$}){let[G,Z]=T(""),[W,z]=T("none"),Q=A2($,G,W);return K("details",{children:[K("summary",{children:["Explore steps (",$.length,")"]},void 0,!0,void 0,this),K("label",{class:"field",children:["Search steps and metadata",K("input",{type:"search",value:G,onInput:(Y)=>Z(Y.currentTarget.value)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),K("label",{class:"field",children:["Group steps",K("select",{value:W,onChange:(Y)=>{let X=Y.currentTarget.value;if(X==="owner"||X==="domain"||X==="none")z(X)},children:[K("option",{value:"none",children:"Execution order"},void 0,!1,void 0,this),K("option",{value:"owner",children:"Owner"},void 0,!1,void 0,this),K("option",{value:"domain",children:"Domain"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Q.size===0&&K("p",{children:"No matching steps."},void 0,!1,void 0,this),[...Q].map(([Y,X])=>K("section",{children:[K("h4",{children:Y??"Unassigned"},void 0,!1,void 0,this),Y===void 0&&K("small",{children:["No ",W," specified"]},void 0,!0,void 0,this),K("ul",{children:X.map((A)=>K("li",{children:[K("code",{children:A.id},void 0,!1,void 0,this),K(B$,{metadata:A.metadata},void 0,!1,void 0,this)]},A.id,!0,void 0,this))},void 0,!1,void 0,this)]},JSON.stringify([Y]),!0,void 0,this))]},void 0,!0,void 0,this)}function H0($){let G=$.metadata?.tubelessCache;if(!G||typeof G!=="object"||Array.isArray(G)||!("implementationVersion"in G)||typeof G.implementationVersion!=="string"||!("createdAtMs"in G)||typeof G.createdAtMs!=="number"||!Number.isFinite(G.createdAtMs)||!("ageMs"in G)||typeof G.ageMs!=="number"||!Number.isFinite(G.ageMs))return;return{implementationVersion:G.implementationVersion,createdAtMs:G.createdAtMs,ageMs:G.ageMs}}function H1({artifacts:$,stepId:G}){let[Z,W]=T("all"),z=$.filter((Y)=>H0(Y.artifact)),Q=z.length>0&&z.length<$.length;return K(f,{children:[Q&&K("label",{class:"artifact-filter",children:["Artifacts for ",G," ",K("select",{value:Z,onChange:(Y)=>W(Y.currentTarget.value),children:[K("option",{value:"all",children:"All artifacts"},void 0,!1,void 0,this),K("option",{value:"cache",children:"Cached outputs"},void 0,!1,void 0,this),K("option",{value:"application",children:"Application artifacts"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.map((Y,X)=>{let A=H0(Y.artifact);if(Q&&(Z==="cache"&&!A||Z==="application"&&A))return null;let J=A?new Date(A.createdAtMs):void 0;return K("details",{class:"artifact-detail",children:[K("summary",{children:[A?"Cached output ":Y.preview?"Preview ":"Artifact ",Y.operation,!A&&`: ${Y.artifact.id||Y.artifact.uri}`]},void 0,!0,void 0,this),A&&K("div",{class:"artifact-info",children:[K("div",{children:["Created:"," ",J&&Number.isFinite(J.getTime())?J.toISOString():String(A.createdAtMs)]},void 0,!0,void 0,this),K("div",{children:["Age at ",Y.operation,": ",A.ageMs," ms"]},void 0,!0,void 0,this),Y.artifact.uri&&K("div",{children:["Location: ",Y.artifact.uri]},void 0,!0,void 0,this),Y.artifact.byteSize!==void 0&&K("div",{children:["Size: ",Y.artifact.byteSize," bytes"]},void 0,!0,void 0,this),K("p",{class:"artifact-note",children:"Recorded operation; current cache availability is not checked."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),A?K("details",{class:"artifact-receipt",children:[K("summary",{children:"Receipt metadata"},void 0,!1,void 0,this),K("pre",{children:JSON.stringify(Y.artifact,null,2)},void 0,!1,void 0,this)]},void 0,!0,void 0,this):K("pre",{children:JSON.stringify(Y.artifact,null,2)},void 0,!1,void 0,this)]},X,!0,void 0,this)})]},void 0,!0,void 0,this)}function b$($){if(Array.isArray($))return $.map(b$);if($!==null&&typeof $==="object")return Object.fromEntries(Object.entries($).sort(([G],[Z])=>G<Z?-1:G>Z?1:0).map(([G,Z])=>[G,b$(Z)]));return $}var N1={dependencies:"Required edges",optionalDependencies:"Optional edges",skipAfterFailureOf:"Failure gates",dryRun:"Dry-run policy",runtimeSkipPossible:"Skip policy",outputValidated:"Output validation",cache:"Cache settings",nestedPipeline:"Child pipeline",remote:"Remote adapter"};function q1($,G){let Z=[],W=(Y,X,A,J)=>{let L=JSON.stringify(X),O=JSON.stringify(A);if(L!==O)Z.push({field:Y,before:L,after:O,...J?{stepId:J}:{}})};W("Implementation version",$.identity.implementationVersion,G.identity.implementationVersion),W("Execution order",$.steps.map(({id:Y})=>Y),G.steps.map(({id:Y})=>Y)),W("Metadata",b$($.metadata),b$(G.metadata)),W("Targets",$.targetIds,G.targetIds),W("Required finalizer steps",$.requiredFinalizerStepIds,G.requiredFinalizerStepIds),W("Options validation",$.optionsValidated,G.optionsValidated),W("Result validation",$.resultValidated,G.resultValidated);let z=new Map($.steps.map((Y)=>[Y.id,Y])),Q=new Map(G.steps.map((Y)=>[Y.id,Y]));for(let Y of $.steps)if(!Q.has(Y.id))Z.push({stepId:Y.id,field:"Removed step"});for(let Y of G.steps){let X=z.get(Y.id);if(!X){Z.push({stepId:Y.id,field:"Added step"});continue}W("Metadata",b$(X.metadata),b$(Y.metadata),Y.id);for(let A of Object.keys(N1)){let J=A;W(N1[J],X[J],Y[J],Y.id)}}return Z}function t($){return JSON.stringify([$.pipelineId,$.identity?.definitionId??null])}function b1($){let G=$.identity;return`${$.pipelineId} · ${G?G.definitionId.slice(7,19):"Legacy (identity not recorded)"} · ${G?.implementationVersion??"implementation unknown"} · ${$.runCount} ${$.runCount===1?"run":"runs"}`}function _1({definitions:$,runs:G,onSelect:Z}){let[W,z]=T(""),[Q,Y]=T(""),X=$.find((U)=>t(U)===W)??$[0];if(!X)return null;let A=$.filter((U)=>U.pipelineId===X.pipelineId&&t(U)!==t(X)),J=A.find((U)=>t(U)===Q)??A[0],L=G.filter((U)=>U.pipelineId===X.pipelineId&&U.definitionIdentity?.definitionId===X.identity?.definitionId),O=J?.snapshot&&X.snapshot?q1(J.snapshot,X.snapshot):void 0;return K("section",{class:"sheet definition-history",children:[K("div",{class:"sheet-head",children:K("div",{children:[K("div",{class:"sheet-title",children:"Observed definitions"},void 0,!1,void 0,this),K("div",{class:"sheet-subtitle",children:"Graph fingerprints do not verify handler code. Implementation versions are supplied by the application."},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),K("div",{class:"definition-body",children:[K("label",{class:"field",children:["Definition"," ",K("select",{"aria-label":"Definition",value:t(X),onChange:(U)=>{z(U.currentTarget.value),Y("")},children:$.map((U)=>K("option",{value:t(U),children:b1(U)},t(U),!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),X.identity&&K("p",{class:"definition-identity",children:["Structural fingerprint: ",K("code",{children:X.identity.structuralFingerprint},void 0,!1,void 0,this),K("br",{},void 0,!1,void 0,this),"Definition ID: ",K("code",{children:X.identity.definitionId},void 0,!1,void 0,this)]},void 0,!0,void 0,this),X.snapshot&&K(f,{children:[K(B$,{metadata:X.snapshot.metadata},void 0,!1,void 0,this),K(i$,{steps:X.snapshot.steps},t(X),!1,void 0,this)]},void 0,!0,void 0,this),K("details",{children:[K("summary",{children:["Runs with this definition (",L.length,")"]},void 0,!0,void 0,this),K("ul",{children:L.map((U)=>K("li",{children:K("button",{type:"button",onClick:()=>Z(U.runId),children:[U.status," · ",new Date(U.startedAtMs).toLocaleString()," · ",U.runId]},void 0,!0,void 0,this)},U.runId,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),J?K(f,{children:[K("label",{class:"field",children:["Compare from"," ",K("select",{"aria-label":"Compare from",value:t(J),onChange:(U)=>Y(U.currentTarget.value),children:A.map((U)=>K("option",{value:t(U),children:b1(U)},t(U),!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),K("p",{class:"sheet-subtitle",children:"Changes from the comparison definition to the selected definition."},void 0,!1,void 0,this),O?O.length?K("ul",{class:"definition-changes",children:O.map((U,N)=>K("li",{children:[K("strong",{children:[U.stepId?`${U.stepId}: `:"",U.field]},void 0,!0,void 0,this),(U.before!==void 0||U.after!==void 0)&&K("div",{children:[K("code",{children:U.before??"not supplied"},void 0,!1,void 0,this)," →"," ",K("code",{children:U.after??"not supplied"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},N,!0,void 0,this))},void 0,!1,void 0,this):K("p",{children:"No recorded semantic changes."},void 0,!1,void 0,this):K("p",{children:"A complete comparison is unavailable: a legacy recording has no identity, or a definition snapshot exceeded recording limits."},void 0,!1,void 0,this)]},void 0,!0,void 0,this):K("p",{class:"sheet-subtitle",children:"Record another version of this pipeline to compare definitions."},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function L2($){if($===void 0)return"Path unavailable";return $.reduce((G,Z)=>G+(typeof Z==="number"?`[${Z}]`:/^[A-Za-z_$][\w$]*$/.test(Z)?`.${Z}`:`[${JSON.stringify(Z)}]`),"$")}function H2($,G,Z,W){let z=G.trim().toLowerCase();return $.filter((Q)=>(Z==="all"||Q.level===Z)&&(W==="all"||(W==="unattributed"?!Q.stepId:Q.stepId===W.slice(5)))&&(!z||Q.message.toLowerCase().includes(z)))}function l$({cause:$,label:G="Cause"}){return K("details",{class:"debug-cause",children:[K("summary",{children:[G,": ",$.name&&`${$.name}: `,$.message||"No message"]},void 0,!0,void 0,this),K("div",{class:"debug-cause-body",children:[$.sourceCode&&K("div",{children:["Source code: ",$.sourceCode]},void 0,!0,void 0,this),$.cause&&K(l$,{cause:$.cause},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function O1({error:$}){let G=$.fanOut;return K("section",{"aria-label":"Run diagnostics",class:"error-card",children:[K("div",{class:"error-code",children:[$.code," · ",$.phase," · ",$.kind,$.sourceCode&&` · ${$.sourceCode}`]},void 0,!0,void 0,this),K("div",{class:"error-message",children:$.message},void 0,!1,void 0,this),$.issues&&$.issues.length>0&&K("div",{class:"debug-group",children:[K("strong",{children:["Validation issues · ",$.issues.length]},void 0,!0,void 0,this),K("ul",{class:"debug-issues",children:$.issues.map((Z,W)=>K("li",{children:[K("code",{children:L2(Z.path)},void 0,!1,void 0,this),K("span",{children:Z.message},void 0,!1,void 0,this)]},W,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.cause&&K("div",{class:"debug-group",children:K(l$,{cause:$.cause},void 0,!1,void 0,this)},void 0,!1,void 0,this),G&&K("div",{class:"debug-group",children:[K("strong",{children:["Failed fan-out items · ",G.failureCount]},void 0,!0,void 0,this),G.failures.map((Z)=>K("details",{class:"debug-cause",children:[K("summary",{children:["#",Z.index+1," · ",Z.key,Z.keyTruncated&&" (key truncated)"," ·"," ",Z.cancelled?"cancelled":"failed"," · ",Z.error.message]},void 0,!0,void 0,this),K("div",{class:"debug-cause-body",children:[Z.error.name&&K("div",{children:["Type: ",Z.error.name]},void 0,!0,void 0,this),Z.error.sourceCode&&K("div",{children:["Source code: ",Z.error.sourceCode]},void 0,!0,void 0,this),Z.error.cause&&K(l$,{cause:Z.error.cause},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},Z.index,!0,void 0,this)),G.omittedFailureCount>0&&K("div",{class:"debug-note",children:[G.omittedFailureCount," more failures omitted from the recording"]},void 0,!0,void 0,this),G.schedulerError&&K(l$,{cause:G.schedulerError,label:"Scheduler error"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function N2($){if(!Number.isFinite($)||Math.abs($)>8640000000000000)return"";return new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"}).format($)}function B1({logs:$}){let[G,Z]=T(""),[W,z]=T("all"),[Q,Y]=T("all"),X=[...new Set($.flatMap((J)=>J.stepId?[J.stepId]:[]))].sort(),A=H2($,G,W,Q);return K("section",{"aria-label":"Run logs",children:[K("div",{class:"section-title",children:[K("span",{children:"Logs"},void 0,!1,void 0,this),K("span",{children:A.length===$.length?$.length:`${A.length} of ${$.length}`},void 0,!1,void 0,this)]},void 0,!0,void 0,this),K("div",{class:"log-filters",children:[K("label",{children:[K("span",{children:"Search text"},void 0,!1,void 0,this),K("input",{type:"search",value:G,onInput:(J)=>Z(J.currentTarget.value),placeholder:"Search log messages"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),K("label",{children:[K("span",{children:"Level"},void 0,!1,void 0,this),K("select",{value:W,onChange:(J)=>z(J.currentTarget.value),children:[K("option",{value:"all",children:"All levels"},void 0,!1,void 0,this),K("option",{value:"error",children:"Error"},void 0,!1,void 0,this),K("option",{value:"warn",children:"Warn"},void 0,!1,void 0,this),K("option",{value:"log",children:"Log"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),K("label",{children:[K("span",{children:"Step"},void 0,!1,void 0,this),K("select",{value:Q,onChange:(J)=>Y(J.currentTarget.value),children:[K("option",{value:"all",children:"All steps"},void 0,!1,void 0,this),$.some((J)=>!J.stepId)&&K("option",{value:"unattributed",children:"No step"},void 0,!1,void 0,this),X.map((J)=>K("option",{value:`step:${J}`,children:J},J,!1,void 0,this))]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),A.length?K("div",{class:"logs",children:A.map((J)=>K("div",{class:"log-line",children:[K("time",{class:"log-time",children:N2(J.timestampMs)},void 0,!1,void 0,this),K("span",{class:`log-level ${J.level}`,children:J.level},void 0,!1,void 0,this),K("span",{class:"log-message",children:[J.stepId&&K(f,{children:[K("b",{children:J.stepId},void 0,!1,void 0,this)," ·"," "]},void 0,!0,void 0,this),J.message]},void 0,!0,void 0,this)]},J.id,!0,void 0,this))},void 0,!1,void 0,this):K("div",{class:"log-empty",children:"No logs match these filters."},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var o4=Symbol("tubeless.wire-schema.type");function v($,G,Z={}){return{decode:G,jsonSchema:$,optionalInput:Z.optionalInput??!1,optionalOutput:Z.optionalOutput??!1}}function q2($,G){return $.length===0?G:`${$}.${G}`}function D(){return v({type:"boolean"},($,G)=>{if(typeof $!=="boolean")throw Error(`${G} must be a boolean`);return $})}function M$($={}){let G={type:$.integer?"integer":"number"};if($.minimum!==void 0)G.minimum=$.minimum;return v(G,(Z,W)=>{if(typeof Z!=="number"||!Number.isFinite(Z))throw Error(`${W} must be a finite number`);if($.integer&&(!Number.isSafeInteger(Z)||Z<($.minimum??-1/0))){if($.minimum===0)throw Error(`${W} must be a nonnegative safe integer`);throw Error(`${W} must be a safe integer`)}if($.minimum!==void 0&&Z<$.minimum)throw Error(`${W} must be at least ${$.minimum}`);return Z})}function m($={}){let G={type:"string"};if($.allowEmpty!==!0)G.minLength=1;if($.maxLength!==void 0)G.maxLength=$.maxLength;return v(G,(Z,W)=>{if(typeof Z!=="string"||$.allowEmpty!==!0&&Z.length===0)throw Error($.allowEmpty===!0?`${W} must be a string`:`${W} must be a non-empty string`);if($.maxLength!==void 0&&Z.length>$.maxLength)throw Error(`${W} exceeds ${$.maxLength} code units`);return Z})}function R($,G){return v({const:$,type:typeof $},(Z,W)=>{if(Z!==$)throw Error(G?.(W)??`${W} must be ${String($)}`);return $})}function y($,G=(Z)=>`${Z} is unsupported`){let Z=new Set($);return v({enum:$,type:"string"},(W,z)=>{if(typeof W!=="string"||!Z.has(W))throw Error(G(z));return W})}function b($){return v($.jsonSchema,(G,Z)=>G===void 0?void 0:$.decode(G,Z),{optionalInput:!0,optionalOutput:!0})}function N0($,G){return v($.jsonSchema,(Z,W)=>Z===void 0?G:$.decode(Z,W),{optionalInput:!0})}function X$($,G={}){let Z={items:$.jsonSchema,type:"array"};if(G.maxItems!==void 0)Z.maxItems=G.maxItems;return v(Z,(W,z)=>{if(!Array.isArray(W)||G.maxItems!==void 0&&W.length>G.maxItems){let Q=G.maxItems===void 0?"":` of at most ${G.maxItems}${G.noun?` ${G.noun}`:""}`;throw Error(`${z} must be an array${Q}`)}return W.map((Q,Y)=>$.decode(Q,`${z}[${Y}]`))})}function P($){let G=Object.entries($).filter(([,W])=>!W.optionalOutput).map(([W])=>W),Z=Object.fromEntries(Object.entries($).map(([W,z])=>[W,z.jsonSchema]));return v({additionalProperties:!1,properties:Z,...G.length>0?{required:G}:{},type:"object"},(W,z)=>{if(W===null||typeof W!=="object"||Array.isArray(W))throw Error(`${z} must be an object`);let Q=W,Y={};for(let[X,A]of Object.entries($)){let J=A.decode(Q[X],q2(z,X));if(J!==void 0)Y[X]=J}return Y})}function M1($,G){return v({additionalProperties:$.jsonSchema,type:"object"},(Z,W)=>{if(Z===null||typeof Z!=="object"||Array.isArray(Z))throw Error(`${W} must be an object`);let z={};for(let[Q,Y]of Object.entries(Z))try{z[Q]=$.decode(Y,`${W}.${Q}`)}catch{throw Error(G?.(W)??`${W} contains an unsupported value`)}return z})}function f$($,G){return v({oneOf:$.map((Z)=>Z.jsonSchema)},(Z,W)=>{for(let z of $)try{return z.decode(Z,W)}catch{}throw Error(G?.(W)??`${W} is unsupported`)})}function r($,G,Z=$.jsonSchema){return v(Z,(W,z)=>{let Q=$.decode(W,z);return G(Q,z),Q},{optionalInput:$.optionalInput,optionalOutput:$.optionalOutput})}function P1($,G){return v($.jsonSchema,(Z,W)=>G($.decode(Z,W)),{optionalInput:$.optionalInput,optionalOutput:$.optionalOutput})}function a($,G){return v($,G)}function q0($,G){return v({oneOf:Object.entries(G).map(([Z,W])=>({allOf:[W.jsonSchema,{properties:{[$]:{const:Z,type:"string"}},required:[$],type:"object"}]}))},(Z,W)=>{if(Z===null||typeof Z!=="object"||Array.isArray(Z))throw Error(`${W} must be an object`);let z=Z[$];if(typeof z!=="string"||!(z in G))throw Error(`${$} is unsupported`);return G[z].decode(Z,W)})}var P$=16384,F1=new TextEncoder;function b0($,G){let Z=0,W=0,z=(X)=>{if(X.length>P$)throw Error(`${G} exceeds ${P$} bytes`);if(W+=F1.encode(JSON.stringify(X)).byteLength,W>P$)throw Error(`${G} exceeds ${P$} bytes`)},Q=(X,A)=>{if(++Z>256||A>8)throw Error(`${G} exceeds metadata complexity limits`);if(X===null||typeof X==="boolean")return X;if(typeof X==="number"&&Number.isFinite(X))return X;if(typeof X==="string")return z(X),X;if(typeof X!=="object"||X===null)throw Error(`${G} must be JSON-safe`);let J=Array.isArray(X),L=Object.getPrototypeOf(X);if(!J&&L!==Object.prototype&&L!==null)throw Error(`${G} must contain only plain JSON objects`);let O=Reflect.ownKeys(X);if(O.length>256)throw Error(`${G} exceeds metadata complexity limits`);let U=[];for(let N of O){if(J&&N==="length")continue;if(typeof N!=="string")throw Error(`${G} must be JSON-safe`);let H=Object.getOwnPropertyDescriptor(X,N);if(!("value"in H)||!H.enumerable)throw Error(`${G} must contain only enumerable data properties`);z(N),U.push([N,Q(H.value,A+1)])}if(J){if(U.length!==X.length||U.some(([N],H)=>N!==String(H)))throw Error(`${G} must contain only dense JSON arrays`);return U.map(([,N])=>N)}return Object.fromEntries(U)},Y=Q($,0);if(F1.encode(JSON.stringify(Y)).byteLength>P$)throw Error(`${G} exceeds ${P$} bytes`);return Y}var F$=m({maxLength:4096}),k1=P({id:b(F$),uri:b(F$),mediaType:b(F$),checksum:b(F$),version:b(F$),byteSize:b(M$({integer:!0,minimum:0})),schemaVersion:b(F$),metadata:b(a({type:"object",additionalProperties:!0},($,G)=>{if(!$||typeof $!=="object"||Array.isArray($))throw Error(`${G} must be an object`);return $}))}),_0=a({...k1.jsonSchema,anyOf:[{required:["id"]},{required:["uri"]}]},($,G)=>{let Z=b0($,G),W=k1.decode(Z,G);if(!W.id&&!W.uri)throw Error(`${G} requires id or uri`);let z=["id","uri","mediaType","checksum","version","byteSize","schemaVersion","metadata"];if(Object.keys(Z).some((Q)=>!z.includes(Q)))throw Error(`${G} has unknown fields; use metadata for application fields`);return W.id?{...W,id:W.id}:{...W,uri:W.uri}}),O0=y(["read","write","reuse"]),w1=P({operation:O0,artifact:_0});function T1($){if($!==null&&typeof $==="object"){for(let G of Object.values($))T1(G);Object.freeze($)}return $}var B0=a({type:"object",additionalProperties:!1,properties:{tags:{type:"array",maxItems:64,items:{type:"string",minLength:1,maxLength:256}},owner:{type:"string",minLength:1,maxLength:256},domain:{type:"string",minLength:1,maxLength:256},annotations:{type:"object",additionalProperties:!0}}},($,G)=>{let Z=b0($,G);if(!Z||typeof Z!=="object"||Array.isArray(Z))throw TypeError(`${G} must be an object`);let W=(z)=>typeof z==="string"&&z.trim().length>0&&z.length<=256;for(let[z,Q]of Object.entries(Z))if(z==="tags"){if(!Array.isArray(Q)||Q.length>64||!Q.every(W))throw TypeError(`${G}.tags must contain at most 64 nonblank strings of at most 256 characters`)}else if(z==="owner"||z==="domain"){if(!W(Q))throw TypeError(`${G}.${z} must be a nonblank string of at most 256 characters`)}else if(z==="annotations"){if(!Q||typeof Q!=="object"||Array.isArray(Q))throw TypeError(`${G}.annotations must be an object`)}else throw TypeError(`${G}.${z} is unknown; use annotations for application fields`);return T1(Z)});var g1=3,G$=128,z$=4096,M0=262144;var b2=["TUBELESS_CHILD_FAILED","TUBELESS_DEFINITION_CACHE_INVALID","TUBELESS_DEFINITION_DEPENDENCY_CONTRADICTORY","TUBELESS_DEFINITION_DEPENDENCY_CYCLE","TUBELESS_DEFINITION_DEPENDENCY_DUPLICATE","TUBELESS_DEFINITION_DEPENDENCY_NOT_IN_STEPS","TUBELESS_DEFINITION_DEPENDENCY_SELF_REFERENCE","TUBELESS_DEFINITION_FINALIZER_STEP_NOT_IN_STEPS","TUBELESS_DEFINITION_IMPLEMENTATION_VERSION_INVALID","TUBELESS_DEFINITION_OPTIONS_SCHEMA_CONFLICT","TUBELESS_DEFINITION_PIPELINE_DESCRIPTION_BLANK","TUBELESS_DEFINITION_PIPELINE_ID_BLANK","TUBELESS_DEFINITION_PIPELINE_NAME_BLANK","TUBELESS_DEFINITION_STEP_CACHE_INVALID","TUBELESS_DEFINITION_STEP_ID_BLANK","TUBELESS_DEFINITION_STEP_ID_RESERVED","TUBELESS_DEFINITION_STEP_IDS_DUPLICATE","TUBELESS_DEFINITION_STEP_NAME_BLANK","TUBELESS_DEFINITION_TARGET_FINALIZER_MISMATCH","TUBELESS_DEFINITION_TARGET_NOT_IN_STEPS","TUBELESS_DEFINITION_TARGETS_DUPLICATE","TUBELESS_FINALIZATION_CANCELLED","TUBELESS_FINALIZATION_FAILED","TUBELESS_FINAL_RESULT_VALIDATION_FAILED","TUBELESS_OPTIONS_VALIDATION_FAILED","TUBELESS_PLANNING_SELECTION_CONFLICT","TUBELESS_PLANNING_STEP_SELECTION_DUPLICATE","TUBELESS_PLANNING_STEP_SELECTION_EMPTY","TUBELESS_PLANNING_STEP_UNKNOWN","TUBELESS_PLANNING_TARGET_SELECTION_DUPLICATE","TUBELESS_PLANNING_TARGET_SELECTION_EMPTY","TUBELESS_PLANNING_TARGET_UNDECLARED","TUBELESS_PLANNING_TARGET_UNKNOWN","TUBELESS_RUN_CANCELLED","TUBELESS_RUN_CONCURRENCY_INVALID","TUBELESS_RUN_CACHE_INVALID","TUBELESS_STEP_OUTPUT_VALIDATION_FAILED","TUBELESS_STEP_FAILED"],_2=["cancellation","child","definition","finalization","selection","step","validation"],O2=["definition","execution","finalization","planning"],B2=["cancelled","completed","failed"],M2=["dry-run","failed-dependency","fail-fast","filtered","policy","unmet-dependency"],P2=["cancelled","completed","failed","pending","running","skipped"],E=m({allowEmpty:!0}),o=m(),k0=m({allowEmpty:!0,maxLength:z$}),J$=M$({integer:!0,minimum:0}),c=M$(),u$=X$(o),F2=X$(o,{maxItems:G$,noun:"strings"});function g0($,G,Z,W){if($===null||typeof $!=="object"||Array.isArray($))throw Error(`${G} must be an object`);if(!W&&Z>=16||W&&Z>8)throw Error(W?"error.fanOut cause exceeds its depth limit":"error.cause exceeds 16 levels");let z=$,Q=(J)=>{let L=z[J];if(L===void 0)return;if(typeof L!=="string")throw Error(`${G}.${J} must be a string`);return L},Y={message:Q("message")??""},X=Q("name"),A=Q("sourceCode");if(X!==void 0)Y.name=X;if(A!==void 0)Y.sourceCode=A;if(W&&[Y.message,Y.name,Y.sourceCode].some((J)=>J!==void 0&&J.length>1024))throw Error("error.fanOut cause strings exceed 1024 code units");if(z.cause!==void 0)Y.cause=g0(z.cause,G,Z+1,W);return Y}var f1={additionalProperties:!1,properties:{cause:{$ref:"#/components/schemas/PipelineErrorCause"},message:{type:"string"},name:{type:"string"},sourceCode:{type:"string"}},required:["message"],type:"object"},k2=a(f1,($,G)=>g0($,G,0,!1)),R1=a({$ref:"#/components/schemas/PipelineErrorCause"},($,G)=>g0($,G,0,!0)),w2=a({items:{oneOf:[{type:"number"},{type:"string",maxLength:z$}]},maxItems:G$,type:"array"},($,G)=>{if(!Array.isArray($)||$.length>G$||!$.every((Z)=>typeof Z==="string"||typeof Z==="number"&&Number.isFinite(Z)))throw Error(`${G} must contain strings or finite numbers`);if($.some((Z)=>typeof Z==="string"&&Z.length>z$))throw Error(`${G} string exceeds ${z$} code units`);return $}),w0=P({message:m({maxLength:z$}),path:b(w2)}),T2=a({items:w0.jsonSchema,maxItems:G$,type:"array"},($,G)=>{if(!Array.isArray($))throw Error(`${G} must be an array`);if($.length>G$)throw Error(`${G} must contain at most ${G$} entries`);return $.map((Z,W)=>w0.decode(Z,`${G}[${W}]`))}),S1=P({cancelled:D(),error:R1,index:J$,key:m({allowEmpty:!0,maxLength:1024}),keyTruncated:D()}),y1=r(P({failureCount:J$,failures:X$(S1,{maxItems:32,noun:"entries"}),omittedFailureCount:J$,schedulerError:b(R1)}),($)=>{if($.failureCount-$.failures.length!==$.omittedFailureCount)throw Error("error.fanOut counts do not match failures");let G=-1;for(let Z of $.failures){if(Z.index<=G)throw Error("error.fanOut indices must be in input order");G=Z.index}}),n$=P({cause:b(r(k2,()=>{return},{$ref:"#/components/schemas/PipelineErrorCause"})),code:y(b2),fanOut:b(r(y1,()=>{return},{$ref:"#/components/schemas/PipelineFanOutDiagnostics"})),issues:b(T2),kind:y(_2),message:N0(E,""),phase:y(O2),sourceCode:b(E),stack:b(E)}),r$=r(n$,()=>{return},{$ref:"#/components/schemas/PipelineError"}),I1=P({outputSource:b(y(["override","cache"])),completed:b(c),depth:b(c),id:m({maxLength:z$}),label:b(k0),name:b(k0),status:b(y(P2)),total:b(c)}),g2=r(X$(I1,{maxItems:G$,noun:"details"}),($,G)=>{if(new TextEncoder().encode(JSON.stringify($)).byteLength>M0)throw Error(`${G} exceeds the ${M0}-byte limit`)}),C2=P1(r(P({completed:c,detailCount:b(J$),details:b(g2),message:b(E),total:b(c)}),($)=>{if($.details!==void 0&&$.detailCount!==void 0&&$.detailCount<$.details.length)throw Error("payload.progress.detailCount must be at least the retained details length")}),($)=>$.details!==void 0&&$.detailCount===void 0?{...$,detailCount:$.details.length}:$),C0=M$({integer:!0,minimum:1}),h1=["for-each","single","iterate"],f2=r(P({mode:y(h1),maxIterations:b(C0),pipelineId:o,stepCount:J$,stepIds:F2}),($,G)=>{if($.mode==="iterate"!==($.maxIterations!==void 0))throw Error(`${G}: only iterate requires maxIterations`);if($.stepCount<$.stepIds.length)throw Error(`${G}.stepCount must be at least the retained stepIds length`)}),j1=P({engine:m({maxLength:z$}),target:b(k0)}),S$=r(P({version:f$([R(1),R(2),R(3)]),definitionId:m({maxLength:80}),structuralFingerprint:m({maxLength:80}),implementationVersion:b(m({maxLength:256}))}),($,G)=>{if(![$.definitionId,$.structuralFingerprint].every((Z)=>/^sha256:[a-f0-9]{64}$/.test(Z)))throw Error(`${G} must contain SHA-256 fingerprints`);if($.implementationVersion!==void 0&&$.implementationVersion.trim().length===0)throw Error(`${G}.implementationVersion must not be blank`)}),T0=m({maxLength:4096}),Y$=X$(T0,{maxItems:4096}),R2=P({cache:b(y(["use","recompute","bypass"])),dryRun:b(D()),continueOnError:b(D()),maxConcurrency:b(c),targets:b(Y$),stepIds:b(Y$)}),S2=P({metadata:b(B0),id:T0,dependencies:Y$,optionalDependencies:Y$,skipAfterFailureOf:Y$,dryRun:y(["custom","run","skip"]),runtimeSkipPossible:D(),outputValidated:D(),cache:b(P({version:m({maxLength:256}),maxAgeMs:b(c),policy:y(["use","recompute","bypass","dynamic"])})),nestedPipeline:b(P({pipelineId:T0,mode:y(h1),maxIterations:b(C0),controls:b(R2),identity:b(S$),stepIds:Y$,concurrency:b(f$([c,R("dynamic")]))})),remote:b(j1)}),f0=r(P({identity:S$,metadata:b(B0),steps:X$(S2,{maxItems:4096}),targetIds:Y$,requiredFinalizerStepIds:b(Y$),optionsValidated:D(),resultValidated:D()}),($,G)=>{if($.identity.version!==3&&($.metadata!==void 0||$.steps.some((Z)=>Z.metadata!==void 0||Z.nestedPipeline?.identity?.version===3)))throw Error(`${G}: metadata requires identity version 3`);for(let Z of $.steps){let W=Z.nestedPipeline;if(!W)continue;if(W.mode==="iterate"!==(W.maxIterations!==void 0)||W.controls!==void 0&&W.mode!=="iterate")throw Error(`${G}: invalid iteration metadata`);if($.identity.version===1&&(W.mode==="iterate"||W.identity?.version===2))throw Error(`${G}: iteration requires identity version 2`)}if(new TextEncoder().encode(JSON.stringify($)).byteLength>262144)throw Error(`${G} exceeds the 262144-byte definition limit`)}),s$=P({kind:y(["all","exact","not-selected","outside-target-closure"])}),y2=P({kind:R("target"),targetId:o}),P0=P({dependentId:o,kind:y(["failure-gate","optional-only","required-dependency"]),targetId:o}),I2=q0("kind",{all:s$,exact:s$,"failure-gate":P0,"not-selected":s$,"optional-only":P0,"outside-target-closure":s$,"required-dependency":P0,target:y2}),h2=X$(I2,{maxItems:G$,noun:"reasons"}),j2=M1(f$([D(),c,E]),($)=>`${$} values must be booleans, finite numbers, or strings`),p={correlationId:b(E),itemKey:b(E),parentRunId:b(E),pipelineId:o,runId:o,timestampMs:c,version:f$([R(2),R(g1)]),iteration:b(P({runId:o,stepId:o,attemptId:o,index:C0}))},R$={attemptId:b(E),durationMs:b(c)},Q$={stepId:o},F0=P({}),D1={"step.artifact":P({...p,...Q$,attemptId:o,name:R("step.artifact"),payload:P({operation:O0,preview:D(),artifact:_0})}),"pipeline.completed":P({...p,durationMs:b(c),error:b(r$),name:R("pipeline.completed"),payload:P({dryRun:D(),errorCount:J$,finalized:D(),status:y(B2,($)=>`${$} must be cancelled, completed, or failed`),stepCount:J$})}),"pipeline.finalize.completed":P({...p,durationMs:c,name:R("pipeline.finalize.completed"),payload:F0}),"pipeline.finalize.failed":P({...p,durationMs:c,error:r$,name:R("pipeline.finalize.failed"),payload:F0}),"pipeline.finalize.started":P({...p,name:R("pipeline.finalize.started"),payload:F0}),"pipeline.log":P({...p,attemptId:b(E),name:R("pipeline.log"),payload:P({level:y(["error","log","warn"],($)=>`${$} must be error, log, or warn`),message:N0(E,"")}),stepId:b(E)}),"pipeline.started":P({...p,name:R("pipeline.started"),payload:r(P({definitionIdentity:b(S$),definitionSnapshot:b(f0),dryRun:D(),planOk:D(),stepCount:J$,targetIds:u$}),($)=>{if($.definitionSnapshot&&JSON.stringify($.definitionSnapshot.identity)!==JSON.stringify($.definitionIdentity))throw Error("Definition snapshot must match the run definition identity")})}),"step.attempted":P({...p,...R$,...Q$,name:R("step.attempted"),payload:P({attempt:c,attributes:j2})}),"step.cancelled":P({...p,...R$,...Q$,error:r$,name:R("step.cancelled"),payload:P({status:R("cancelled"),outputSource:b(y(["override","cache"]))})}),"step.complete":P({...p,...R$,...Q$,name:R("step.complete"),payload:P({status:R("completed"),outputSource:b(y(["override","cache"]))})}),"step.failed":P({...p,...R$,...Q$,error:r$,name:R("step.failed"),payload:P({status:R("failed"),outputSource:b(y(["override","cache"]))})}),"step.planned":P({...p,...Q$,name:R("step.planned"),payload:P({dependencies:u$,description:b(E),dryRun:y(["custom","run","skip"],($)=>`${$} must be custom, run, or skip`),name:b(E),nestedPipeline:b(f2),optionalDependencies:u$,remote:b(j1),runtimeSkipPossible:D(),selected:D(),selectionReasons:h2,skipAfterFailureOf:u$})}),"step.running":P({...p,...Q$,attemptId:o,name:R("step.running"),payload:P({progress:b(C2),outputSource:b(y(["override","cache"]))})}),"step.skipped":P({...p,...R$,...Q$,name:R("step.skipped"),payload:P({dependencyId:b(E),message:b(E),reason:y(M2),status:R("skipped"),outputSource:b(y(["override","cache"]))})})},V1={if:{properties:{version:{const:2}},required:["version"]},then:{properties:{iteration:!1,payload:{properties:{definitionIdentity:{properties:{version:{const:1}}},nestedPipeline:{properties:{mode:{enum:["single","for-each"]},maxIterations:!1}}}}}}},C1=q0("name",D1),D2=r(C1,($)=>{if($.iteration!==void 0&&$.iteration.runId!==$.parentRunId)throw Error("iteration.runId must match parentRunId");if($.version!==2)return;if($.iteration!==void 0||$.name==="step.planned"&&$.payload.nestedPipeline?.mode==="iterate")throw Error("Iteration metadata requires trace version 3");if($.name==="pipeline.started"&&$.payload.definitionIdentity!==void 0&&$.payload.definitionIdentity.version!==1)throw Error("Trace version 2 requires identity version 1")},{...C1.jsonSchema,...V1}),KG={PipelineError:n$.jsonSchema,PipelineErrorCause:f1,PipelineFanOutDiagnostics:y1.jsonSchema,PipelineFanOutFailure:S1.jsonSchema,PipelineProgressDetail:I1.jsonSchema,PipelineValidationIssue:w0.jsonSchema,StoredPipelineEvent:{oneOf:Object.values(D1).map(($)=>{let G=$.jsonSchema;return{...G,...V1,properties:{...G.properties,id:{minimum:0,type:"integer"}},required:[...G.required,"id"]}})}};function E1($){return n$.decode($,"error")}function R0($){try{return S$.decode($,"identity"),!0}catch{return!1}}function x1($){try{return f0.decode($,"snapshot"),!0}catch{return!1}}function v1($){try{return E1($),!0}catch{return!1}}function m1($){try{return w1.decode($,"artifact record"),!0}catch{return!1}}function c1($){if(typeof $!=="object"||$===null)return!1;let G=$;if(typeof G.key!=="string"||G.key.length===0||typeof G.flag!=="string"||G.flag.length===0||typeof G.multiple!=="boolean"||typeof G.positional!=="boolean"||typeof G.required!=="boolean"||!["boolean","number","path","string"].includes(String(G.type)))return!1;if(G.choices!==void 0&&(!Array.isArray(G.choices)||!G.choices.every((Z)=>typeof Z==="string")))return!1;if(G.default!==void 0&&typeof G.default!==(G.type==="boolean"?"boolean":G.type==="number"?"number":"string"))return!1;if(G.group!==void 0&&G.group!=="execution")return!1;if(G.exclusive!==void 0&&G.exclusive!==!0)return!1;return!0}class k$ extends Error{status;constructor($,G){super(G);this.status=$}}function S($){return typeof $==="object"&&$!==null&&!Array.isArray($)}function j($){return typeof $==="number"&&Number.isFinite($)}function i($){return $===void 0||typeof $==="string"}function K$($){return $===void 0||j($)}function t$($){return Array.isArray($)&&$.every((G)=>typeof G==="string")}function V2($){if(!S($))return!1;return j($.id)&&($.level==="error"||$.level==="log"||$.level==="warn")&&typeof $.message==="string"&&j($.timestampMs)&&i($.attemptId)&&i($.stepId)}function E2($){if(!S($))return!1;if(typeof $.id!=="string"||$.outputSource!==void 0&&$.outputSource!=="override"&&$.outputSource!=="cache"||!["cancelled","completed","failed","planned","running","skipped"].includes(String($.status))||!i($.description)||!i($.name)||!K$($.durationMs)||!K$($.finishedAtMs)||!K$($.startedAtMs))return!1;if($.attempt!==void 0){if(!S($.attempt)||typeof $.attempt.attemptId!=="string"||!K$($.attempt.durationMs)||!K$($.attempt.finishedAtMs)||!Array.isArray($.attempt.retries)||!$.attempt.retries.every(j)||!j($.attempt.startedAtMs)||$.attempt.outputSource!==void 0&&$.attempt.outputSource!=="override"&&$.attempt.outputSource!=="cache"||!["cancelled","completed","failed","running","skipped"].includes(String($.attempt.status)))return!1}if($.artifacts!==void 0&&(!Array.isArray($.artifacts)||!$.artifacts.every((G)=>S(G)&&typeof G.attemptId==="string"&&j(G.timestampMs)&&typeof G.preview==="boolean"&&m1(G))))return!1;if($.progress!==void 0){if(!S($.progress)||!j($.progress.completed))return!1;if(!K$($.progress.detailCount)||!i($.progress.message)||!K$($.progress.total))return!1;if($.progress.details!==void 0&&(!Array.isArray($.progress.details)||!$.progress.details.every((G)=>S(G)&&typeof G.id==="string"&&i(G.label)&&i(G.status)&&(G.outputSource===void 0||G.outputSource==="override"||G.outputSource==="cache"))))return!1}if($.nestedPipeline!==void 0){if(!S($.nestedPipeline)||!["single","for-each","iterate"].includes(String($.nestedPipeline.mode))||$.nestedPipeline.mode==="iterate"&&(!Number.isSafeInteger($.nestedPipeline.maxIterations)||Number($.nestedPipeline.maxIterations)<1)||typeof $.nestedPipeline.pipelineId!=="string"||!j($.nestedPipeline.stepCount)||!t$($.nestedPipeline.stepIds))return!1}if($.remote!==void 0){if(!S($.remote)||typeof $.remote.engine!=="string"||!i($.remote.target))return!1}return!0}function d1($){if(!S($))return!1;return($.definitionIdentity===void 0||R0($.definitionIdentity))&&typeof $.dryRun==="boolean"&&j($.eventCount)&&j($.logCount)&&Array.isArray($.logs)&&$.logs.every(V2)&&typeof $.pipelineId==="string"&&typeof $.runId==="string"&&j($.startedAtMs)&&K$($.durationMs)&&K$($.finishedAtMs)&&["cancelled","completed","failed","running"].includes(String($.status))&&Array.isArray($.steps)&&$.steps.every(E2)&&j($.version)&&i($.correlationId)&&i($.parentRunId)&&($.iteration===void 0||S($.iteration)&&typeof $.iteration.runId==="string"&&typeof $.iteration.stepId==="string"&&typeof $.iteration.attemptId==="string"&&Number.isSafeInteger($.iteration.index)&&Number($.iteration.index)>0)&&($.error===void 0||v1($.error))}function x2($){if(!S($))return!1;if(!j($.activeRunCount)||!j($.completedRunCount)||!Array.isArray($.definitions)||!$.definitions.every((G)=>S(G)&&typeof G.pipelineId==="string"&&j(G.runCount)&&(G.identity===void 0||R0(G.identity))&&(G.snapshot===void 0||x1(G.snapshot)))||!j($.failedRunCount)||!j($.generatedAtMs)||!j($.lastEventId)||!Array.isArray($.runs)||!$.runs.every(d1)||$.liveRunIds!==void 0&&!t$($.liveRunIds))return!1;return!0}function v2($){return x2($)?$:void 0}function m2($){return S($)&&typeof $.canPlan==="boolean"&&typeof $.id==="string"&&typeof $.name==="string"&&i($.description)&&Array.isArray($.parameters)&&$.parameters.every(c1)}function c2($){if(!S($)||!Array.isArray($.commands)||!$.commands.every(m2))return;return $.commands}function d2($){if(!S($)||!S($.plan))return!1;let G=$.plan;if(typeof G.dryRun!=="boolean"||!Array.isArray(G.errors)||!G.errors.every((Z)=>S(Z)&&typeof Z.message==="string")||typeof G.ok!=="boolean"||typeof G.pipelineId!=="string"||!Array.isArray(G.steps))return!1;for(let Z of G.steps){if(!S(Z)||typeof Z.id!=="string"||!t$(Z.dependencies)||typeof Z.selected!=="boolean"||!i(Z.description)||!i(Z.name))return!1;if(Z.nestedPipeline!==void 0&&(!S(Z.nestedPipeline)||!["single","for-each","iterate"].includes(String(Z.nestedPipeline.mode))||Z.nestedPipeline.mode==="iterate"&&(!Number.isSafeInteger(Z.nestedPipeline.maxIterations)||Number(Z.nestedPipeline.maxIterations)<1)||typeof Z.nestedPipeline.pipelineId!=="string"||!t$(Z.nestedPipeline.stepIds)))return!1;if(Z.remote!==void 0&&(!S(Z.remote)||typeof Z.remote.engine!=="string"||!i(Z.remote.target)))return!1}return!0}function p2($){return d2($)?$.plan:void 0}function U$($,G,Z){if(!S($))return new k$(Z,G);if(Array.isArray($.errors)&&$.errors.every((W)=>typeof W==="string"))return new k$(Z,$.errors.join(`
|
|
2
|
+
`));return new k$(Z,typeof $.message==="string"?$.message:G)}function A$($){return Error(`Studio API returned an invalid response for ${$}.`)}function p1($=fetch,G=""){let Z=new Set,W,z=()=>{if(W)throw new k$(W,W===401?"Sign in to continue.":"Access denied.")},Q=async(X,A)=>{z();let J=await $(G+String(X),A);if(!W&&(J.status===401||J.status===403)){W=J.status;for(let L of Z)L(W)}return z(),J},Y=async(X)=>{let A;try{A=await X.json()}catch{throw z(),new k$(X.status,"Studio API returned invalid JSON.")}return z(),A};return{subscribeAccessDenied(X){if(Z.add(X),W)X(W);return()=>{Z.delete(X)}},async loadSnapshot(){let X=await Q("/api/snapshot",{cache:"no-store"}),A=await Y(X);if(!X.ok)throw U$(A,"Snapshot request failed.",X.status);let J=v2(A);if(!J)throw A$("snapshot");return J},async loadRunDetail(X){let A=await Q("/api/runs/"+encodeURIComponent(X),{cache:"no-store"}),J=await Y(A);if(A.status===404)return null;if(!A.ok)throw U$(J,"Run detail request failed.",A.status);if(!S(J)||!d1(J.run))throw A$("run detail");return{run:J.run}},async loadCommands(){let X=await Q("/api/commands",{cache:"no-store"}),A=await Y(X);if(!X.ok)throw U$(A,"Commands request failed.",X.status);let J=c2(A);if(!J)throw A$("commands");return J},async loadCapabilities(){let X=await Q("/api/capabilities",{cache:"no-store"}),A=await Y(X);if(!X.ok||!S(A)||typeof A.canCancel!=="boolean"||typeof A.canClearHistory!=="boolean"){if(!X.ok)throw U$(A,"Capabilities request failed.",X.status);throw A$("capabilities")}return{canCancel:A.canCancel,canClearHistory:A.canClearHistory}},async clearHistory(){let X=await Q("/api/history",{method:"DELETE",headers:{"x-tubeless-studio-clear-history":"1"}}),A=await Y(X);if(!X.ok)throw U$(A,"History could not be cleared.",X.status);if(!S(A)||A.cleared!==!0||!j(A.eventCount))throw A$("clear history");return{eventCount:A.eventCount}},async previewPlan(X,A){let J=await Q("/api/commands/"+encodeURIComponent(X)+"/plan",{method:"POST",headers:{"content-type":"application/json","x-tubeless-studio-plan":"1"},body:JSON.stringify(A)}),L=await Y(J);if(!J.ok)throw U$(L,"Plan request failed.",J.status);let O=p2(L);if(!O)throw A$("plan");return O},async cancelRun(X){let A=await Q("/api/runs/"+encodeURIComponent(X)+"/cancel",{method:"POST",headers:{"x-tubeless-studio-cancel":"1"}}),J=await Y(A);if(!A.ok)throw U$(J,"Run could not be cancelled.",A.status);if(!S(J)||J.cancelled!==!0||J.runId!==X)throw A$("cancel run")},async launch(X,A){let J=await Q("/api/commands/"+encodeURIComponent(X)+"/runs",{method:"POST",headers:{"content-type":"application/json","x-tubeless-studio-launch":"1"},body:JSON.stringify({values:A})}),L=await Y(J);if(!J.ok)throw U$(L,"Launch failed.",J.status);if(!S(L)||L.accepted!==!0||typeof L.runId!=="string"||L.runId.length===0)throw A$("launch");return L.runId}}}function o2($){return{...$,activeRunCount:0,completedRunCount:0,definitions:[],failedRunCount:0,lastEventId:0,liveRunIds:[],runs:[]}}class S0{#L;#b;#_;#U=new Set;#z=null;#G;#W={fingerprint:null,runId:null};#Q=0;#K=!1;#Z;#H=!1;#Y=0;#N=!1;#A=!1;#$={connected:!0,detail:null,manualRefreshing:!1,snapshot:null};constructor($,G=1200){this.#L=$,this.#_=G,this.#b=$.subscribeAccessDenied?.((Z)=>{if(this.#Y+=1,this.#q(),this.#Z)clearTimeout(this.#Z);this.#Z=void 0,this.#A=!1,this.#X({accessDenied:Z,connected:!1,snapshot:null,detail:null,manualRefreshing:!1})})}getState(){return this.#$}subscribe($){return this.#U.add($),()=>this.#U.delete($)}refresh($=!1){if(this.#K||this.#$.accessDenied)return;if($)this.#H=!0,this.#X({manualRefreshing:!0});if(this.#N){if($)this.#A=!0;return}this.#O()}invalidate({delayMs:$=0,resetHistory:G=!1}={}){if(this.#K||this.#$.accessDenied)return;if(this.#Y+=1,G)this.#q(),this.#X({detail:null,snapshot:this.#$.snapshot?o2(this.#$.snapshot):null});else this.#P($);if(this.#Z)clearTimeout(this.#Z);if(this.#Z=void 0,$>0){this.#Z=setTimeout(()=>{this.#Z=void 0,this.refresh(!0)},$);return}this.refresh(!0)}selectRun($,G){if(this.#K||this.#$.accessDenied)return;if(this.#W.runId===$&&this.#W.fingerprint===G)return;if(this.#W.runId!==$||!G)this.#q(),this.#X({detail:null});if(this.#W={fingerprint:G,runId:$},$&&G)this.#J(this.#Q)}dispose(){if(this.#K)return;if(this.#b?.(),this.#K=!0,this.#Y+=1,this.#Q+=1,this.#z=null,this.#G)clearTimeout(this.#G);if(this.#Z)clearTimeout(this.#Z);this.#G=void 0,this.#Z=void 0,this.#U.clear()}#O(){if(this.#K||this.#$.accessDenied)return;this.#N=!0;let $=this.#Y;this.#H=!1,this.#L.loadSnapshot().then((G)=>{if(this.#K||this.#$.accessDenied||$!==this.#Y)return;this.#X({connected:!0,snapshot:G})}).catch(()=>{if(this.#K||this.#$.accessDenied||$!==this.#Y)return;this.#X({connected:!1})}).finally(()=>{if(this.#K||this.#$.accessDenied)return;if(this.#N=!1,this.#A){this.#A=!1,this.#O();return}if(!this.#H)this.#X({manualRefreshing:!1})})}#J($){let{fingerprint:G,runId:Z}=this.#W;if(this.#K||this.#$.accessDenied||this.#z!==null||this.#G!==void 0||!Z||!G||$!==this.#Q)return;let W={};this.#z=W,this.#L.loadRunDetail(Z).then((z)=>{if(!this.#B(W,$))return;if(this.#z=null,z){if(this.#X({detail:z}),G!==this.#W.fingerprint)this.#J($);return}this.#M($)}).catch(()=>{if(!this.#B(W,$))return;this.#z=null,this.#M($)})}#B($,G){return!this.#K&&!this.#$.accessDenied&&this.#z===$&&this.#Q===G}#M($){if(this.#K||this.#$.accessDenied||$!==this.#Q)return;if(this.#G)clearTimeout(this.#G);this.#G=setTimeout(()=>{this.#G=void 0,this.#J($)},this.#_)}#P($){if(this.#Q+=1,this.#z=null,this.#G)clearTimeout(this.#G);this.#G=void 0,this.#X({detail:null});let G=this.#Q;if(!this.#W.runId||!this.#W.fingerprint)return;if($>0){this.#G=setTimeout(()=>{this.#G=void 0,this.#J(G)},$);return}this.#J(G)}#q(){if(this.#Q+=1,this.#z=null,this.#W={fingerprint:null,runId:null},this.#G)clearTimeout(this.#G);this.#G=void 0}#X($){let G={...this.#$,...$};if(G.accessDenied===this.#$.accessDenied&&G.connected===this.#$.connected&&G.detail===this.#$.detail&&G.manualRefreshing===this.#$.manualRefreshing&&G.snapshot===this.#$.snapshot)return;this.#$=G;for(let Z of this.#U)Z(G)}}var y0=[];function i2($){let G=new Map,Z=new Map,W=new Map;for(let H of $){if(!G.has(H.runId))G.set(H.runId,H);let M=H.parentRunId;if(!W.has(H.runId))W.set(H.runId,M)}let z=new Set;for(let H of $){if(z.has(H.runId))continue;let M=[],B=new Set,q=H.runId;while(q&&G.has(q)&&!z.has(q)){if(B.has(q)){W.set(q,void 0);break}B.add(q),M.push(q),q=W.get(q)}for(let _ of M)z.add(_)}for(let H of $){let M=W.get(H.runId);if(!M)continue;let B=Z.get(M);if(B)B.push(H);else Z.set(M,[H])}for(let H of Z.values())H.sort((M,B)=>B.startedAtMs-M.startedAtMs);let Q=[],Y=new Set;for(let H of $){let M=W.get(H.runId);if(M&&G.has(M))continue;Q.push(H),Y.add(H.runId)}let X=new Map;for(let H of $){if(X.has(H.runId))continue;let M=[],B=new Set,q=H.runId,_;while(q){if(X.has(q)){_=X.get(q);break}if(Y.has(q)){_=q;break}if(B.has(q)){_=void 0;break}B.add(q),M.push(q);let k=W.get(q);if(!k||!G.has(k)){_=q;break}q=k}if(_!==void 0)X.set(_,_);for(let k of M)X.set(k,_)}let A=new Map,J=new Map;for(let H of $){if(A.has(H.runId))continue;let M=[{exiting:!1,id:H.runId}],B=new Set;while(M.length>0){let q=M.pop();if(!q)break;if(q.exiting){B.delete(q.id);let _=0,k=G.get(q.id)?.status==="running";for(let x of Z.get(q.id)??y0){let d=A.get(x.runId);if(d===void 0)continue;_+=1+d,k=k||J.get(x.runId)===!0}A.set(q.id,_),J.set(q.id,k);continue}if(A.has(q.id)||B.has(q.id))continue;B.add(q.id),M.push({exiting:!0,id:q.id});for(let _ of Z.get(q.id)??y0)if(!A.has(_.runId)&&!B.has(_.runId))M.push({exiting:!1,id:_.runId})}}function L(H){return H==null?void 0:G.get(H)}function O(H){return Z.get(H)??y0}function U(H){let M=[],B=new Set,q=L(H);while(q){let _=W.get(q.runId);if(!_||B.has(_))break;B.add(_);let k=G.get(_);if(!k)break;M.unshift(k),q=k}return M}function N(H){let M=H.toLowerCase(),B=new Set;if(!M){for(let q of Q)B.add(q.runId);return B}for(let q of $){if(!q.pipelineId.toLowerCase().includes(M)&&!q.runId.toLowerCase().includes(M)&&!q.correlationId?.toLowerCase().includes(M))continue;let _=X.get(q.runId);if(_)B.add(_)}return B}return{roots:Q,ancestorsOf:U,childrenOf:O,descendantCount(H){return A.get(H)??0},matchingRootIds:N,rootRunId(H){return H==null?H:X.get(H)??H},runById:L,subtreeIsRunning(H){return J.get(H)===!0}}}function l2($){return $.parameters.map((G)=>{if(G.type==="boolean")return[Boolean(G.default)];if(G.multiple)return G.choices?[]:[""];return G.default===void 0?[""]:[G.default]})}function u2($,G){let Z={};return $.parameters.forEach((W,z)=>{let Q=G(W,z);if(W.type==="boolean"){let X=Q[0];if(X!==Boolean(W.default))Z[W.key]=X;return}if(W.multiple){Z[W.key]=W.type==="number"?Q.filter((X)=>typeof X==="number"):Q.filter((X)=>typeof X==="string");return}let Y=Q[0];if(Y!==""&&Y!==void 0)Z[W.key]=Y}),Z}function r2($,G){let Z={};return $.parameters.forEach((W,z)=>{if(W.group!=="execution")return;let Q=G(W,z);if(W.type==="boolean"){if(Q[0]===!0)Z[W.key]=!0;return}if(W.multiple&&Q.length)Z[W.key]=Q.filter((Y)=>typeof Y==="string")}),Z}var a$=($)=>$.length>24?$.slice(0,12)+"…"+$.slice(-7):$;function e$($){return $==null?"—":$<1000?Math.max(0,Math.round($))+" ms":$<60000?($/1000).toFixed($<1e4?1:0)+" s":Math.floor($/60000)+"m "+Math.round($%60000/1000)+"s"}function o1($){if(!Number.isFinite($)||Math.abs($)>8640000000000000)return"";return new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"medium"}).format($)}function i1($){if(!Number.isFinite($)||Math.abs($)>8640000000000000)return"";return new Date($).toISOString()}function l1($,G){let Z=Math.max(0,G-$);if(Z<60000)return Math.floor(Z/1000)+"s ago";if(Z<3600000)return Math.floor(Z/60000)+"m ago";if(Z<86400000)return Math.floor(Z/3600000)+"h ago";return Math.floor(Z/86400000)+"d ago"}function s2($){return $==="completed"?"✓":$==="skipped"?"×":$==="cancelled"?"■":$==="failed"?"!":$==="planned"?"…":""}function $0({value:$,outputSource:G}){return K("span",{class:`status ${$}`,children:[K("i",{class:"status-mark","aria-hidden":"true",children:s2($)},void 0,!1,void 0,this),$,G==="override"&&" (overridden)",G==="cache"&&" (cached)"]},void 0,!0,void 0,this)}function G0({copy:$,title:G}){return K("div",{class:"empty",children:K("div",{children:[K("div",{class:"empty-icon",children:K("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.4",children:K("path",{d:"M4 5.5h12M4 10h12M4 14.5h8"},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),K("strong",{children:G},void 0,!1,void 0,this),K("p",{children:$},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}function K0({children:$,label:G,secondary:Z,stepIds:W}){return K("div",{class:"plan-nested",children:[K("strong",{children:G},void 0,!1,void 0,this),Z&&K("span",{children:Z},void 0,!1,void 0,this),W?.map((z)=>K("code",{children:z},z,!1,void 0,this)),$]},void 0,!0,void 0,this)}function D0($){return $.description||"Run this typed pipeline command."}function n2($){return $.key.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[-_]+/g," ").replace(/\b\w/g,(G)=>G.toUpperCase())}function t2($){let G=[];if($.description)G.push($.description);if($.environment)G.push("Environment fallback: "+$.environment);if($.multiple)G.push($.choices?"Choose one or more values.":"Enter one value per line.");if($.mustExist)G.push("Must be an existing "+($.pathKind||"path")+".");return G.join(" ")}function a2({index:$,onChange:G,parameter:Z,values:W}){let z="run-param-"+$,Q=t2(Z),Y=n2(Z);if(Z.type==="boolean")return K("label",{class:"boolean-field",for:z,children:[K("span",{children:[K("strong",{children:Y},void 0,!1,void 0,this),K("small",{children:Q||"Enable this option."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),K("input",{id:z,type:"checkbox",checked:W[0]===!0,onChange:(J)=>G($,[J.currentTarget.checked])},void 0,!1,void 0,this)]},void 0,!0,void 0,this);let X=K("label",{for:z,children:[Y,Z.required&&K("span",{class:"required-mark",children:"required"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),A;if(Z.choices){let J=W.filter((L)=>typeof L==="string");A=K("select",{id:z,multiple:Z.multiple,required:Z.required,value:Z.multiple?void 0:J[0]??"",onChange:(L)=>G($,Z.multiple?Array.from(L.currentTarget.selectedOptions,(O)=>O.value):[L.currentTarget.value]),children:[!Z.multiple&&!Z.required&&K("option",{value:"",children:"Use default or leave unset"},void 0,!1,void 0,this),Z.choices.map((L)=>K("option",{value:L,selected:Z.multiple?J.includes(L):void 0,children:L},L,!1,void 0,this))]},void 0,!0,void 0,this)}else if(Z.multiple)A=K("textarea",{id:z,spellcheck:!1,placeholder:"One value per line",value:String(W[0]??""),onInput:(J)=>G($,[J.currentTarget.value])},void 0,!1,void 0,this);else{let J=W[0]??"";A=K("input",{id:z,type:Z.type==="number"?"number":"text",value:String(J),placeholder:Z.type==="path"?Z.pathKind==="directory"?"./directory":"./file":"",step:Z.type==="number"?Z.integer?"1":"any":void 0,min:Z.type==="number"?Z.min:void 0,max:Z.type==="number"?Z.max:void 0,required:Z.required,onInput:(L)=>G($,Z.type==="number"&&L.currentTarget.value!==""?[Number(L.currentTarget.value)]:[L.currentTarget.value])},void 0,!1,void 0,this)}return K("div",{class:"field",children:[X,A,Q&&K("div",{class:"field-hint",children:Q},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function e2({command:$,onChange:G,values:Z}){let W=(Q,Y,X)=>{let A=$.parameters.map((J,L)=>({index:L,parameter:J})).filter(({parameter:J})=>J.group==="execution"===Q);if(!A.length)return null;return K("section",{class:"form-section",children:[K("div",{class:"form-section-head",children:[K("strong",{children:Y},void 0,!1,void 0,this),K("span",{children:X},void 0,!1,void 0,this)]},void 0,!0,void 0,this),K("div",{class:"parameter-grid",children:A.map(({index:J,parameter:L})=>K(a2,{index:J,onChange:G,parameter:L,values:Z[J]??[]},L.key,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},z=$.parameters.filter((Q)=>Q.group!=="execution").length;return K("div",{class:"parameter-fields",id:"parameterFields",children:[W(!1,"Pipeline inputs",z+" parameter"+(z===1?"":"s")),W(!0,"Execution controls","Built into Tubeless")]},void 0,!0,void 0,this)}function $4({commands:$,onConfigure:G}){if(!$.length)return K("div",{class:"sheet",children:K(G0,{title:"No pipelines found",copy:"Try a different pipeline name or description."},void 0,!1,void 0,this)},void 0,!1,void 0,this);return K("section",{class:"sheet",children:[K("div",{class:"sheet-head",children:[K("div",{children:[K("div",{class:"sheet-title",children:"Available pipelines"},void 0,!1,void 0,this),K("div",{class:"sheet-subtitle",children:"Available in this Studio session"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),K("span",{class:"sheet-subtitle",children:[$.length," shown"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),K("div",{class:"catalog",children:$.map((Z)=>K("article",{class:"catalog-card",children:[K("h3",{children:Z.name},void 0,!1,void 0,this),K("p",{children:D0(Z)},void 0,!1,void 0,this),K("div",{class:"catalog-actions",children:K("button",{class:"primary-button",onClick:()=>G(Z.id),children:"Configure"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},Z.id,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function G4($){switch($.kind){case"all":return"Included because no step or target filter was set.";case"exact":return"Explicitly listed in the exact step selection.";case"target":return`Requested target “${$.targetId}”.`;case"required-dependency":return`Required input for “${$.dependentId}” on the path to target “${$.targetId}”.`;case"failure-gate":return`Failure gate for “${$.dependentId}” on the path to target “${$.targetId}”.`;case"optional-only":return`Optional input for “${$.dependentId}” on the path to target “${$.targetId}”; this link does not select it.`;case"outside-target-closure":return"Outside the selected targets and their prerequisite paths.";case"not-selected":return"Not listed in the exact step selection."}}function K4($){switch($){case"dry-run":return"Its dry-run policy skips this step.";case"unmet-dependency":return"A required input is unavailable in this selection or dry run.";case"failed-dependency":return"A failure gate failed or was cancelled.";case"fail-fast":return"Execution stops after an earlier failure.";case"policy":return"Its runtime skip policy omits this step.";case"filtered":return"Excluded by the selection filter."}}function I0({ids:$,stepsById:G}){return K("span",{class:"plan-references",children:$.map((Z)=>K("span",{children:[K("code",{children:Z},void 0,!1,void 0,this),G.get(Z)?.selected===!1&&" (not selected)"]},Z,!0,void 0,this))},void 0,!1,void 0,this)}function Z4({plan:$}){let G=$.steps.filter((z)=>z.selected&&!z.skipReason).length,Z=new Map($.steps.map((z)=>[z.id,z])),W=$.steps.some((z)=>z.selectionReasons.some((Q)=>Q.kind==="target"))?{title:"Targets with prerequisites",detail:"Targets include required inputs and failure gates recursively. Optional inputs are not added unless selected for another reason."}:$.steps.some((z)=>z.selectionReasons.some((Q)=>Q.kind==="exact"||Q.kind==="not-selected"))?{title:"Exact steps",detail:"Only listed steps are selected. Required inputs and failure gates are not added automatically, so missing required inputs can skip a selected step."}:{title:"All steps",detail:"No selection filter is set; every declared step is selected."};return K(f,{children:[$.errors.length>0&&K("div",{class:"launch-error",children:$.errors.map((z)=>K("div",{children:z.message},z.message,!1,void 0,this))},void 0,!1,void 0,this),K("div",{class:"plan-summary",children:[K("strong",{children:$.pipelineId},void 0,!1,void 0,this),K("span",{children:[G," of ",$.steps.length," steps planned to run",$.dryRun?" · dry run":""]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.steps.length>0&&K("div",{class:"plan-selection-mode",children:[K("strong",{children:W.title},void 0,!1,void 0,this),K("span",{children:W.detail},void 0,!1,void 0,this)]},void 0,!0,void 0,this),K(B$,{metadata:$.definition?.metadata},void 0,!1,void 0,this),K(i$,{steps:$.steps},void 0,!1,void 0,this),K("div",{class:"plan-steps",children:$.steps.map((z)=>{let Q=!z.selected?"Not selected":z.skipReason==="dry-run"?"Dry-run skip":z.skipReason?"Skipped":"Will run",Y=z.nestedPipeline,X=z.remote,A=X?"Remote step":Y?Y.mode==="iterate"?"Pipeline iteration":Y.mode==="for-each"?"Pipeline fan-out":"Nested pipeline":"Step";return K("div",{class:"plan-step",children:[K("div",{class:"plan-step-title",children:[K("strong",{children:z.name||z.id},void 0,!1,void 0,this),z.name&&z.name!==z.id&&K("code",{class:"plan-step-id",children:z.id},void 0,!1,void 0,this),K("span",{class:`plan-kind${Y?" pipeline":""}`,children:A},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z.description&&K("small",{children:z.description},void 0,!1,void 0,this),K(B$,{metadata:z.metadata},void 0,!1,void 0,this),K("span",{class:`plan-disposition${Q==="Will run"?"":" skipped"}`,children:Q},void 0,!1,void 0,this),K("ul",{class:"plan-explanation",children:[z.selectionReasons.map((J,L)=>K("li",{children:[K("strong",{children:z.selected?"Selected":"Omitted"},void 0,!1,void 0,this),K("span",{children:G4(J)},void 0,!1,void 0,this)]},L,!0,void 0,this)),K("li",{children:[K("strong",{children:"Required inputs"},void 0,!1,void 0,this),z.dependencies.length>0?K("span",{children:[K(I0,{ids:z.dependencies,stepsById:Z},void 0,!1,void 0,this)," — unavailable inputs skip this step."]},void 0,!0,void 0,this):K("span",{children:"No required inputs."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z.optionalDependencies.length>0&&K("li",{children:[K("strong",{children:"Optional inputs"},void 0,!1,void 0,this),K("span",{children:[K(I0,{ids:z.optionalDependencies,stepsById:Z},void 0,!1,void 0,this)," — unavailable inputs do not block it."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),z.skipAfterFailureOf.length>0&&K("li",{children:[K("strong",{children:"Failure gates"},void 0,!1,void 0,this),K("span",{children:[K(I0,{ids:z.skipAfterFailureOf,stepsById:Z},void 0,!1,void 0,this)," — failure or cancellation skips this step."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),z.selected&&z.skipReason&&K("li",{children:[K("strong",{children:"Planned skip"},void 0,!1,void 0,this),K("span",{children:K4(z.skipReason)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z.selected&&!z.skipReason&&z.runtimeSkipPossible&&K("li",{children:[K("strong",{children:"Runtime policy"},void 0,!1,void 0,this),K("span",{children:"This step may still skip when it runs."},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Y&&K(K0,{label:Y.pipelineId,secondary:`${Y.stepIds.length} declared steps${Y.mode==="iterate"?` per iteration, at most ${Y.maxIterations} iterations`:Y.mode==="for-each"?" per runtime item":""}`,stepIds:Y.stepIds},void 0,!1,void 0,this),X&&K(K0,{label:X.engine,secondary:X.target},void 0,!1,void 0,this)]},z.id,!0,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function W4({commandCount:$,snapshot:G}){let Z=G.completedRunCount+G.failedRunCount,W=Z?Math.round(G.completedRunCount/Z*100):0,z=$||new Set(G.definitions.map(({pipelineId:Y})=>Y)).size,Q=[["Active now",G.activeRunCount,G.activeRunCount?"Live execution in progress":"No work in flight"],["Recorded runs",G.runs.length,"Append-only local history"],["Success rate",W+"%",Z+" terminal runs"],["Pipelines",z,$?"Available to configure":"Observed in run history"]];return K(f,{children:Q.map(([Y,X,A])=>K("article",{class:"metric",children:[K("div",{class:"metric-label",children:Y},void 0,!1,void 0,this),K("div",{class:"metric-value",children:X},void 0,!1,void 0,this),K("div",{class:"metric-note",children:A},void 0,!1,void 0,this)]},Y,!0,void 0,this))},void 0,!1,void 0,this)}function X4({nowMs:$,onSelect:G,run:Z,runIndex:W,selectedRunId:z}){let Q=Z.steps.filter((A)=>A.status==="running"),Y=Q[0],X=W.descendantCount(Z.runId);return K("button",{class:`run-row ${Z.status} ${W.rootRunId(z)===Z.runId?"selected":""}`,"data-run-id":Z.runId,onClick:()=>G(Z.runId),children:[K("div",{class:"run-primary",children:[K($0,{value:Z.status},void 0,!1,void 0,this),K("strong",{children:Z.pipelineId},void 0,!1,void 0,this),K("time",{class:"run-time",datetime:i1(Z.startedAtMs),title:o1(Z.startedAtMs),children:l1(Z.startedAtMs,$)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),K("div",{class:"run-secondary",children:[K("code",{children:a$(Z.runId)},void 0,!1,void 0,this),K("i",{class:"dot"},void 0,!1,void 0,this),Z.correlationId&&K(f,{children:[K("span",{children:["correlation ",Z.correlationId]},void 0,!0,void 0,this),K("i",{class:"dot"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),K("span",{children:e$(Z.durationMs)},void 0,!1,void 0,this),K("i",{class:"dot"},void 0,!1,void 0,this),K("span",{children:[Z.steps.length," steps"]},void 0,!0,void 0,this),X>0&&K(f,{children:[K("i",{class:"dot"},void 0,!1,void 0,this),K("span",{children:[X," nested run",X===1?"":"s"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Z.dryRun&&K(f,{children:[K("i",{class:"dot"},void 0,!1,void 0,this),K("span",{children:"dry run"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Z.status==="running"&&K("div",{class:"run-activity",children:[K("strong",{children:Q.length>1?`${Q.length} steps running`:Y?.name||Y?.id||"Starting"},void 0,!1,void 0,this),K("span",{children:Q.length>1?`${Q.slice(0,3).map((A)=>A.name||A.id).join(", ")}${Q.length>3?` +${Q.length-3} more`:""}`:Y?.progress?.message||"Execution in progress"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function z4({value:$}){let G=$.charAt(0).toUpperCase()+$.slice(1),Z=$==="completed"?K("svg",{viewBox:"0 0 12 12",children:K("path",{d:"m2 6 2.4 2.4L10 3"},void 0,!1,void 0,this)},void 0,!1,void 0,this):$==="running"?K("i",{},void 0,!1,void 0,this):$==="skipped"?K("svg",{viewBox:"0 0 12 12",children:K("path",{d:"m3 3 6 6M9 3 3 9"},void 0,!1,void 0,this)},void 0,!1,void 0,this):$==="cancelled"?K("svg",{viewBox:"0 0 12 12",children:K("rect",{x:"3",y:"3",width:"6",height:"6",rx:"1",fill:"currentColor",stroke:"none"},void 0,!1,void 0,this)},void 0,!1,void 0,this):$==="failed"?"!":"…";return K("span",{class:`step-status-icon ${$}`,role:"img","aria-label":G,title:G,children:Z},void 0,!1,void 0,this)}function Q4({step:$}){let G=$.progress?.total,Z=G?Math.max(0,Math.min(100,($.progress?.completed??0)/G*100)):$.status==="completed"?100:18,W=$.nestedPipeline,z=W?W.stepCount??W.stepIds.length:0,Q=W&&W.stepIds.length<z?W.stepIds.length+" of "+z+" declared steps":z+" declared steps",Y=$.progress?.detailCount;return K("article",{class:`step ${$.status}`,children:[K(z4,{value:$.status},void 0,!1,void 0,this),K("div",{class:"step-head",children:[K("strong",{children:$.name||$.id},void 0,!1,void 0,this),$.outputSource&&K($0,{value:$.status,outputSource:$.outputSource},void 0,!1,void 0,this),$.name&&K("code",{children:$.id},void 0,!1,void 0,this),K("span",{class:"step-duration",children:e$($.durationMs)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.description&&K("div",{class:"step-description",children:$.description},void 0,!1,void 0,this),W&&K(K0,{label:W.pipelineId,secondary:`${Q}${W.mode==="iterate"?` per iteration, at most ${W.maxIterations} iterations`:W.mode==="for-each"?" per runtime item":""}`,stepIds:W.stepIds},void 0,!1,void 0,this),$.remote&&K(K0,{label:$.remote.engine,secondary:$.remote.target},void 0,!1,void 0,this),$.attempt&&K("div",{class:"execution",children:K("span",{class:"execution-summary",title:$.attempt.attemptId,children:[K("b",{children:$.attempt.outputSource==="override"?"Override validation":$.attempt.outputSource==="cache"?"Cache validation":"Execution"},void 0,!1,void 0,this)," ","· ",a$($.attempt.attemptId),$.attempt.retries.length>0&&` · ${$.attempt.retries.length} retr${$.attempt.retries.length===1?"y":"ies"}`]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.artifacts&&K(H1,{artifacts:$.artifacts,stepId:$.id},void 0,!1,void 0,this),$.progress&&K(f,{children:[K("div",{class:"progress",children:K("i",{class:`w${Math.round(Z)}`},void 0,!1,void 0,this)},void 0,!1,void 0,this),K("div",{class:"progress-copy",children:$.progress.message||$.progress.completed+(G?" / "+G:"")+" complete"},void 0,!1,void 0,this),$.progress.details&&$.progress.details.length>0&&K("div",{class:"progress-details",children:[$.progress.details.map((X)=>K("div",{class:`progress-detail ${X.status||"running"}`,children:[K("b",{children:X.id},void 0,!1,void 0,this),X.label&&K("span",{children:X.label},void 0,!1,void 0,this),X.outputSource==="override"&&K("span",{children:"(overridden)"},void 0,!1,void 0,this),X.outputSource==="cache"&&K("span",{children:"(cached)"},void 0,!1,void 0,this)]},X.id,!0,void 0,this)),Y&&$.progress.details.length<Y?K("div",{class:"progress-detail-truncated",children:["Showing ",$.progress.details.length," of ",Y," items"]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function Y4($){return["running","failed","cancelled","skipped","completed","planned"].map((Z)=>[Z,$.steps.filter((W)=>W.status===Z).length]).filter(([,Z])=>Z).map(([Z,W])=>W+" "+Z).join(" · ")||"No steps"}function J4({canCancel:$,cancelling:G,liveRunIds:Z,nowMs:W,onCancel:z,onCopyLink:Q,onSelect:Y,run:X,runIndex:A,selectedRunId:J}){if(!X){if(J&&!A.runById(J)){let U=A.roots[0];return K("div",{class:"sheet detail",children:K("div",{class:"unavailable-run",children:[K("strong",{children:"Run unavailable"},void 0,!1,void 0,this),K("p",{children:"This run is not in this Studio history. It may have been deleted, or this link may refer to another local store."},void 0,!1,void 0,this),K("code",{children:J},void 0,!1,void 0,this),U&&K("button",{class:"secondary-button",type:"button",onClick:()=>Y(U.runId),children:"Select latest run"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}return K("div",{class:"sheet detail",children:K(G0,{title:J?"Loading run":"Select a run",copy:J?"Loading this run's recorded details.":"Choose a run from the history to inspect its steps, retry telemetry, logs, and errors."},void 0,!1,void 0,this)},void 0,!1,void 0,this)}let L=A.ancestorsOf(X.runId),O=A.childrenOf(X.runId);return K("article",{class:"sheet detail",children:K("div",{class:"detail-body",children:[L.length>0&&K("div",{class:"run-parentage",children:[L.map((U)=>K("span",{children:[K("button",{type:"button",onClick:()=>Y(U.runId),children:U.pipelineId},void 0,!1,void 0,this),K("span",{children:" / "},void 0,!1,void 0,this)]},U.runId,!0,void 0,this)),K("span",{children:X.pipelineId},void 0,!1,void 0,this)]},void 0,!0,void 0,this),K("div",{class:"detail-heading",children:[K("div",{class:"detail-heading-copy",children:[K("div",{class:"detail-kicker",children:[X.parentRunId?"Nested run":"Top-level run"," ·"," ",l1(X.startedAtMs,W)]},void 0,!0,void 0,this),K("h2",{children:X.pipelineId},void 0,!1,void 0,this),K("p",{class:"definition-identity",children:["Definition:"," ",K("code",{children:X.definitionIdentity?.definitionId??"Not recorded (legacy trace)"},void 0,!1,void 0,this),K("br",{},void 0,!1,void 0,this),"Implementation: ",X.definitionIdentity?.implementationVersion??"Unknown"]},void 0,!0,void 0,this),K("div",{class:"run-id",children:X.runId},void 0,!1,void 0,this),X.correlationId&&K("div",{class:"run-id",children:["Correlation: ",X.correlationId]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),K("div",{class:"detail-heading-actions",children:[K($0,{value:X.status},void 0,!1,void 0,this),K("button",{class:"icon-button",type:"button",title:"Copy run link","aria-label":"Copy run link",onClick:()=>Q(X.runId),children:K("svg",{width:"16",height:"16",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:[K("rect",{x:"7",y:"5",width:"10",height:"12",rx:"2"},void 0,!1,void 0,this),K("path",{d:"M13 5V4a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h2"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$&&X.status==="running"&&!X.parentRunId&&Z.includes(X.runId)&&K("button",{class:"danger-button",type:"button",disabled:G,onClick:()=>z(X.runId),children:"Cancel run"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),K("div",{class:"detail-meta",children:[K("div",{children:[K("label",{children:"Started"},void 0,!1,void 0,this),K("span",{title:i1(X.startedAtMs),children:o1(X.startedAtMs)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),K("div",{children:[K("label",{children:"Duration"},void 0,!1,void 0,this),K("span",{children:e$(X.durationMs)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),K("div",{children:[K("label",{children:"Steps"},void 0,!1,void 0,this),K("span",{children:X.steps.length},void 0,!1,void 0,this)]},void 0,!0,void 0,this),K("div",{children:[K("label",{children:"Events"},void 0,!1,void 0,this),K("span",{children:X.eventCount},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),O.length>0&&K(f,{children:[K("div",{class:"section-title",children:[K("span",{children:"Nested runs"},void 0,!1,void 0,this),K("span",{children:[O.length," direct · ",A.descendantCount(X.runId)," total"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),K("div",{class:"nested-runs",children:O.map((U)=>{let N=A.descendantCount(U.runId);return K("button",{class:"nested-run",type:"button",onClick:()=>Y(U.runId),children:[K($0,{value:U.status},void 0,!1,void 0,this),K("strong",{children:U.pipelineId},void 0,!1,void 0,this),K("small",{children:[e$(U.durationMs)," · ",U.steps.length," steps",N?" · "+N+" nested":""]},void 0,!0,void 0,this)]},U.runId,!0,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this),X.error&&K(f,{children:[K("div",{class:"section-title",children:K("span",{children:"Error diagnostics"},void 0,!1,void 0,this)},void 0,!1,void 0,this),K(O1,{error:X.error},void 0,!1,void 0,this)]},void 0,!0,void 0,this),X.logs.length>0&&K(B1,{logs:X.logs},X.runId,!1,void 0,this),K("div",{class:"section-title",children:[K("span",{children:"Step timeline"},void 0,!1,void 0,this),K("span",{children:Y4(X)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),X.steps.length?K("div",{class:"step-list",children:X.steps.map((U)=>K(Q4,{step:U},U.id,!1,void 0,this))},void 0,!1,void 0,this):K(G0,{title:"No planned steps",copy:"This run ended before a step plan was recorded."},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}function U4($){let G=$.roots.filter((z)=>$.runIndex.subtreeIsRunning(z.runId)),Z=$.roots.filter((z)=>!$.runIndex.subtreeIsRunning(z.runId)),W=(z,Q)=>Q.length?K(f,{children:[K("div",{class:"run-group",children:[z," · ",Q.length]},void 0,!0,void 0,this),Q.map((Y)=>K(X4,{nowMs:$.nowMs,onSelect:$.onSelect,run:Y,runIndex:$.runIndex,selectedRunId:$.selectedRunId},Y.runId,!1,void 0,this))]},void 0,!0,void 0,this):null;return K(f,{children:[K(_1,{definitions:$.definitions??[],runs:$.runs??[],onSelect:$.onSelect},void 0,!1,void 0,this),K("div",{class:"content-grid",children:[K("section",{class:"sheet",children:[K("div",{class:"sheet-head",children:[K("div",{children:[K("div",{class:"sheet-title",children:"Pipeline runs"},void 0,!1,void 0,this),K("div",{class:"sheet-subtitle",children:"Top-level runs · nested work stays with its parent"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),K("span",{class:"sheet-subtitle",children:[$.roots.length," top-level · ",$.totalRunCount," total"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),K("div",{class:"run-list",children:$.roots.length?K(f,{children:[W("Running now",G),W("Recent",Z)]},void 0,!0,void 0,this):K(G0,{title:"No recorded runs",copy:"Choose Pipelines to start a run and create local history."},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),K(J4,{...$,run:$.selectedRun},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function w$($){return $ instanceof Error?$.message||String($):String($)}function A4({api:$,commands:G,commandId:Z,onClose:W,onLaunched:z}){let[Q,Y]=T(Z??G[0]?.id??""),X=G.find((w)=>w.id===Q),[A,J]=T([]),[L,O]=T(null),[U,N]=T(""),[H,M]=T(!1),[B,q]=T(!1),_=p$(null),k=p$(0);if(u(()=>{Y(Z??G[0]?.id??"")},[Z,G]),u(()=>{k.current+=1,J(X?l2(X):[]),O(null),N(""),requestAnimationFrame(()=>_.current?.querySelector("input, select, textarea")?.focus())},[X]),u(()=>{if(Z===null)return;let w=(g)=>{if(g.key==="Escape"&&!H&&!B)W()};return document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)},[Z,H,W,B]),Z===null)return null;let x=()=>{if(!H&&!B)W()},d=(w,g)=>{if(!X)return;k.current+=1,J((l)=>l.map((n,H$)=>{if(H$===w)return g;let Z$=X.parameters[H$];return X.parameters[w]?.exclusive&&X.parameters[w]?.multiple&&g.length>0&&Z$?.exclusive&&Z$.multiple?[]:n})),O(null)},s=(w,g)=>{let l=A[g]??[];if(!w.multiple||w.choices)return l;return String(l[0]??"").split(/\r?\n/).map((n)=>n.trim()).filter(Boolean).map((n)=>w.type==="number"?Number(n):n)},L$=async()=>{if(!X?.canPlan||B)return;let w=k.current;q(!0),N("");try{let g=await $.previewPlan(X.id,r2(X,s));if(k.current===w)O(g)}catch(g){if(k.current===w)N(w$(g))}finally{q(!1)}},e=async(w)=>{if(w.preventDefault(),!X||H)return;M(!0),N("");try{z(await $.launch(X.id,u2(X,s)))}catch(g){N(w$(g))}finally{M(!1)}};return K("div",{class:"modal-backdrop",role:"dialog","aria-modal":"true","aria-labelledby":"launchTitle",onClick:(w)=>w.target===w.currentTarget&&x(),children:K("div",{class:"modal",children:[K("div",{class:"modal-head",children:[K("div",{children:[K("div",{class:"detail-kicker",children:"Configure pipeline"},void 0,!1,void 0,this),K("h2",{id:"launchTitle",children:X?.name||"Run a pipeline"},void 0,!1,void 0,this),K("p",{children:X?D0(X):"Choose a declared pipeline and provide its inputs."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),K("button",{class:"close-button",type:"button","aria-label":"Close",onClick:x,children:"×"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),K("form",{class:"launch-form",onSubmit:e,children:[K("div",{class:"field",children:[K("label",{for:"launchCommand",children:"Pipeline command"},void 0,!1,void 0,this),K("select",{id:"launchCommand",value:Q,onChange:(w)=>{k.current+=1,O(null),N(""),Y(w.currentTarget.value)},children:G.map((w)=>K("option",{value:w.id,children:w.name},w.id,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),K("div",{ref:_,children:X&&K(e2,{command:X,onChange:d,values:A},void 0,!1,void 0,this)},void 0,!1,void 0,this),L&&K("div",{class:"plan-result","aria-live":"polite",children:K(Z4,{plan:L},void 0,!1,void 0,this)},void 0,!1,void 0,this),U&&K("div",{class:"launch-error",children:U},void 0,!1,void 0,this),K("div",{class:"modal-actions",children:[K("button",{class:"secondary-button",type:"button",onClick:x,children:"Cancel"},void 0,!1,void 0,this),X?.canPlan&&K("button",{class:"secondary-button",type:"button",disabled:B||H,onClick:()=>void L$(),children:B?"Planning…":"Preview plan"},void 0,!1,void 0,this),K("button",{class:"primary-button",type:"submit",disabled:H||B,children:H?"Starting…":"Run"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}function L4({api:$,onCleared:G,onClose:Z,snapshot:W}){let[z,Q]=T(!1),[Y,X]=T(""),A=p$(null);u(()=>A.current?.focus(),[]),u(()=>{let N=(H)=>{if(H.key==="Escape"&&!z)Z()};return document.addEventListener("keydown",N),()=>document.removeEventListener("keydown",N)},[z,Z]);let J=W.runs.length,L=W.runs.reduce((N,H)=>N+H.eventCount,0),O=()=>{if(!z)Z()},U=async()=>{if(z)return;Q(!0),X("");try{G((await $.clearHistory()).eventCount)}catch(N){X(w$(N))}finally{Q(!1)}};return K("div",{class:"modal-backdrop",role:"dialog","aria-modal":"true","aria-labelledby":"clearHistoryTitle",onClick:(N)=>N.target===N.currentTarget&&O(),children:K("div",{class:"modal confirm-modal",children:[K("div",{class:"modal-head",children:[K("div",{children:[K("div",{class:"detail-kicker",children:"Local maintenance"},void 0,!1,void 0,this),K("h2",{id:"clearHistoryTitle",children:"Clear run history?"},void 0,!1,void 0,this),K("p",{children:"This permanently resets the local studio history."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),K("button",{class:"close-button",type:"button","aria-label":"Close",onClick:O,children:"×"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),K("div",{class:"confirm-body",children:[K("p",{class:"confirm-copy",children:["Remove ",J," recorded run",J===1?"":"s"," and ",L," event",L===1?"":"s"," from this SQLite store.",W.activeRunCount?` ${W.activeRunCount} recorded run${W.activeRunCount===1?" is":"s are"} still marked active; continue only if no external process is writing to this store.`:""]},void 0,!0,void 0,this),K("div",{class:"confirm-warning",children:"This cannot be undone. Pipeline definitions and execution remain unchanged; only recorded local events are removed."},void 0,!1,void 0,this),Y&&K("div",{class:"launch-error",children:Y},void 0,!1,void 0,this),K("div",{class:"confirm-actions",children:[K("button",{class:"secondary-button",type:"button",onClick:O,children:"Cancel"},void 0,!1,void 0,this),K("button",{ref:A,class:"danger-button",type:"button",disabled:z,onClick:()=>void U(),children:z?"Clearing…":"Clear history"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}var H4=typeof document>"u"?"":document.querySelector('meta[name="tubeless-studio-mount"]')?.content??"",N4=p1(fetch,H4);function q4($){return{className:`pulse${$?"":" lost"}`,label:$?"Connected · local":"Connection lost"}}function h0($){return new URL($).searchParams.get("run")||null}function j0($,G){let Z=new URL($);return Z.searchParams.set("run",G),Z.href}function b4($,G){return $??G[0]?.runId??null}function _4({status:$,href:G}){return K("main",{class:"workspace",role:"alert",children:[K("h1",{children:$===401?"Sign in to continue":"Access denied"},void 0,!1,void 0,this),K("p",{children:$===401?"Your access has expired. Open Studio again to sign in through your application.":"Your account cannot access this Studio. Open Studio again after your access is restored."},void 0,!1,void 0,this),K("a",{href:G,children:"Open Studio again"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function O4({api:$=N4}){let G=o$(()=>new S0($),[$]),[Z,W]=T(()=>G.getState()),{accessDenied:z,connected:Q,detail:Y,manualRefreshing:X,snapshot:A}=Z,[J,L]=T([]),[O,U]=T(!1),[N,H]=T("runs"),[M,B]=T(""),[q,_]=T(()=>h0(window.location.href)),[k,x]=T(!1),[d,s]=T(!1),[L$,e]=T(!1),[w,g]=T(null),[l,n]=T(!1),[H$,Z$]=T(""),N$=o$(()=>i2(A?.runs??[]),[A]);u(()=>{return W(G.getState()),G.subscribe(W)},[G]),u(()=>()=>G.dispose(),[G]),u(()=>{if(z){L([]),x(!1),s(!1),g(null),n(!1),Z$("");return}$.loadCommands().then((V)=>{if(G.getState().accessDenied)return;if(L(V),V.length&&!h0(window.location.href))H("pipelines")}).catch((V)=>{if(!G.getState().accessDenied)Z$(w$(V))}).finally(()=>{if(!G.getState().accessDenied)U(!0)}),$.loadCapabilities().then((V)=>{if(G.getState().accessDenied)return;x(V.canCancel),s(V.canClearHistory)}).catch((V)=>{if(!G.getState().accessDenied)Z$(w$(V))}),G.refresh();let F=setInterval(()=>G.refresh(),1200);return()=>clearInterval(F)},[z,$,G]),u(()=>{let F=()=>{_(h0(window.location.href)),H("runs"),B("")};return window.addEventListener("popstate",F),()=>window.removeEventListener("popstate",F)},[]),u(()=>{if(!H$)return;let F=setTimeout(()=>Z$(""),4200);return()=>clearTimeout(F)},[H$]);let V0=M?N$.matchingRootIds(M):null,y$=N$.roots.filter((F)=>!V0||V0.has(F.runId)).sort((F,V)=>Number(N$.subtreeIsRunning(V.runId))-Number(N$.subtreeIsRunning(F.runId))||V.startedAtMs-F.startedAtMs);u(()=>{if(!A||!O||N!=="runs"||q)return;let F=b4(q,y$);if(!F)return;window.history.replaceState(null,"",j0(window.location.href,F)),_(F)},[O,y$,q,A,N]);let T$=N$.runById(q),E0=T$?[T$.runId,T$.eventCount,T$.status].join(":"):null;u(()=>{G.selectRun(q,E0)},[G,E0,q]);let _$=(F)=>{if(!G.getState().accessDenied)Z$(F)},x0=(F)=>{if(G.getState().accessDenied)return;if(F!==q)window.history.pushState(null,"",j0(window.location.href,F));if(_(F),!y$.some((V)=>V.runId===N$.rootRunId(F)))B("");H("runs")},r1=async(F)=>{try{await navigator.clipboard.writeText(j0(window.location.href,F)),_$("Run link copied")}catch{_$("Could not copy run link. Copy the address from your browser instead.")}},s1=async(F)=>{if(G.getState().accessDenied||!k||L$)return;e(!0);try{await $.cancelRun(F),_$("Run cancelled · "+a$(F)),G.invalidate({delayMs:80})}catch(V){_$(w$(V))}finally{e(!1)}},n1=J.filter((F)=>!M||F.name.toLowerCase().includes(M.toLowerCase())||D0(F).toLowerCase().includes(M.toLowerCase())),O$=N==="pipelines";if(z)return K(_4,{status:z,href:window.location.href},void 0,!1,void 0,this);let t1=T$&&Y?.run.runId===q?Y.run:null,v0=q4(Q);return K(f,{children:[K("div",{class:"shell",children:[K("aside",{class:"rail",children:[K("div",{class:"brand",children:[K("div",{class:"mark","aria-hidden":"true",children:K("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:[K("path",{d:"M3 4.5h6a3 3 0 0 1 3 3v6",stroke:"#f7f8f3",strokeWidth:"1.5"},void 0,!1,void 0,this),K("circle",{cx:"3",cy:"4.5",r:"2",fill:"#7396ff"},void 0,!1,void 0,this),K("circle",{cx:"12",cy:"13.5",r:"2",fill:"#63d297"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),K("div",{class:"brand-copy",children:[K("strong",{children:"Tubeless"},void 0,!1,void 0,this),K("small",{children:"Local studio"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),K("div",{class:"rail-label",children:"Workspace"},void 0,!1,void 0,this),K("nav",{class:"nav","aria-label":"Studio sections",children:[J.length>0&&K("button",{class:O$?"active":"",type:"button",title:"Pipelines",onClick:()=>H("pipelines"),children:[K("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[K("path",{d:"M4 5h7M4 10h12M9 15h7"},void 0,!1,void 0,this),K("circle",{cx:"14.5",cy:"5",r:"1.5"},void 0,!1,void 0,this),K("circle",{cx:"5.5",cy:"15",r:"1.5"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),K("span",{children:"Pipelines"},void 0,!1,void 0,this),K("b",{class:"nav-count",children:J.length},void 0,!1,void 0,this)]},void 0,!0,void 0,this),K("button",{class:O$?"":"active",type:"button",title:"Runs",onClick:()=>H("runs"),children:[K("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[K("path",{d:"M10 3v4l2.5 1.5M17 10a7 7 0 1 1-2.05-4.95"},void 0,!1,void 0,this),K("path",{d:"M14.5 2.8v3.5H18"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),K("span",{children:"Runs"},void 0,!1,void 0,this),K("b",{class:"nav-count",children:A?.runs.length??0},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),K("div",{class:"rail-foot",children:[K("div",{class:"connection",children:[K("i",{class:v0.className},void 0,!1,void 0,this),K("span",{children:v0.label},void 0,!1,void 0,this)]},void 0,!0,void 0,this),K("div",{class:"database",children:"append-only SQLite"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),K("main",{class:"workspace",children:[K("header",{class:"topbar",children:[K("div",{children:[K("div",{class:"eyebrow",children:"Execution workspace"},void 0,!1,void 0,this),K("h1",{children:O$?"Pipelines":"Runs"},void 0,!1,void 0,this),K("p",{class:"lede",children:O$?"Choose a declared workflow to configure and run.":"Live work and durable history in one place."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),K("div",{class:"toolbar",children:[K("input",{class:"search",type:"search",value:M,placeholder:O$?"Filter pipelines":"Filter runs or IDs","aria-label":"Filter",onInput:(F)=>B(F.currentTarget.value.trim())},void 0,!1,void 0,this),J.length>0&&K("button",{class:"primary-button",onClick:()=>g(J[0]?.id??""),children:"Run pipeline"},void 0,!1,void 0,this),d&&K("button",{class:"danger-button",id:"clearHistoryButton",type:"button",disabled:!A?.runs.length,title:A?.activeRunCount?"Clear history, including runs left active by an interrupted process":"Clear history",onClick:()=>n(!0),children:[K("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.4","aria-hidden":"true",children:K("path",{d:"M3 4.5h10M6 2.5h4M5 4.5l.5 9h5l.5-9M7 7v4M9 7v4"},void 0,!1,void 0,this)},void 0,!1,void 0,this),K("span",{children:"Clear history"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),K("button",{class:`icon-button${X?" spinning":""}`,type:"button",title:"Refresh now","aria-label":"Refresh now",onClick:()=>G.refresh(!0),children:K("svg",{width:"16",height:"16",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[K("path",{d:"M16.5 7A7 7 0 1 0 17 11"},void 0,!1,void 0,this),K("path",{d:"M16.5 3v4h-4"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),A&&K(f,{children:[K("section",{class:"metrics",children:K(W4,{commandCount:J.length,snapshot:A},void 0,!1,void 0,this)},void 0,!1,void 0,this),K("section",{children:O$?K($4,{commands:n1,onConfigure:g},void 0,!1,void 0,this):K(U4,{definitions:A.definitions,runs:A.runs,canCancel:k,cancelling:L$,liveRunIds:A.liveRunIds??[],nowMs:Date.now(),onCancel:(F)=>void s1(F),onCopyLink:(F)=>void r1(F),onSelect:x0,roots:y$,runIndex:N$,selectedRun:t1,selectedRunId:q,totalRunCount:A.runs.length},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),w!==null&&K(A4,{api:$,commands:J,commandId:w,onClose:()=>g(null),onLaunched:(F)=>{if(G.getState().accessDenied)return;x0(F),B(""),g(null),_$("Run accepted · "+a$(F)),G.invalidate({delayMs:80})}},void 0,!1,void 0,this),l&&A&&K(L4,{api:$,snapshot:A,onClose:()=>n(!1),onCleared:(F)=>{if(G.getState().accessDenied)return;n(!1),_$("Cleared "+F+" recorded event"+(F===1?"":"s")),G.invalidate({resetHistory:!0})}},void 0,!1,void 0,this),H$&&K("div",{class:"toast",role:"status",children:H$},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function u1(){let $=document.querySelector("#studio-root");if(!($ instanceof HTMLElement))throw Error("Missing #studio-root");G1(K(O4,{},void 0,!1,void 0,this),$)}u1();
|
|
@@ -14,7 +14,9 @@ interface StudioCapabilities {
|
|
|
14
14
|
interface StudioClearResult {
|
|
15
15
|
eventCount: number;
|
|
16
16
|
}
|
|
17
|
+
export type StudioAccessDenied = 401 | 403;
|
|
17
18
|
export interface StudioApi {
|
|
19
|
+
subscribeAccessDenied?(listener: (status: StudioAccessDenied) => void): () => void;
|
|
18
20
|
cancelRun(runId: string): Promise<void>;
|
|
19
21
|
clearHistory(): Promise<StudioClearResult>;
|
|
20
22
|
loadCapabilities(): Promise<StudioCapabilities>;
|
|
@@ -27,5 +29,5 @@ export interface StudioApi {
|
|
|
27
29
|
export declare function parseStudioSnapshot(value: unknown): StudioSnapshot | undefined;
|
|
28
30
|
export declare function parseStudioCommands(value: unknown): PipelineRunStudioCommand[] | undefined;
|
|
29
31
|
/** Same-origin Studio transport. Every successful payload is validated before use. */
|
|
30
|
-
export declare function createStudioApi(fetcher?: typeof fetch): StudioApi;
|
|
32
|
+
export declare function createStudioApi(fetcher?: typeof fetch, mount?: string): StudioApi;
|
|
31
33
|
export {};
|