From 369d33e2510ae5382ced89558d7579a88a4668b0 Mon Sep 17 00:00:00 2001 From: Sam Catlow Date: Sun, 18 Oct 2026 13:20:52 +1100 Subject: [PATCH] fix(ui): check step names drop the repeated gate --- ui/dist/assets/index.js | 2 +- ui/src/workflows/workflow-graph.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ui/dist/assets/index.js b/ui/dist/assets/index.js index b074a5f6c..bed8269b4 100644 --- a/ui/dist/assets/index.js +++ b/ui/dist/assets/index.js @@ -127,7 +127,7 @@ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\ `)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(` `,e)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(this.onKeyLine=!1,t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){Qq(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,r=n&&(t.sep||t.explicitKey)&&this.type!==`seq-item-ind`,i=[];if(r&&t.sep&&!t.value){let n=[];for(let r=0;re.indent&&(n.length=0);break;default:n.length=0}}n.length>=2&&(i=t.sep.splice(n[1]))}switch(this.type){case`anchor`:case`tag`:r||t.value?(i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`explicit-key-ind`:!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):r||t.value?(i.push(this.sourceToken),e.items.push({start:i,explicitKey:!0})):this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case`map-value-ind`:if(t.explicitKey){if(!t.sep){if(qq(t.start,`newline`))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=Zq(t.start);this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]})}}else if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(qq(t.sep,`map-value-ind`))this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(Yq(t.key)&&!qq(t.sep,`newline`)){let e=Zq(t.start),n=t.key,r=t.sep;r.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:n,sep:r}]})}else i.length>0?t.sep=t.sep.concat(i,this.sourceToken):t.sep.push(this.sourceToken)}else t.sep?t.value||r?e.items.push({start:i,key:null,sep:[this.sourceToken]}):qq(t.sep,`map-value-ind`)?this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:{let n=this.flowScalar(this.type);r||t.value?(e.items.push({start:i,key:n,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(n):(Object.assign(t,{key:n,sep:[]}),this.onKeyLine=!0);return}default:{let r=this.startBlockValue(e);if(r){if(r.type===`block-seq`){if(!t.explicitKey&&t.sep&&!qq(t.sep,`newline`)){yield*this.pop({type:`error`,offset:this.offset,message:`Unexpected block-seq-ind on same line with key`,source:this.source});return}}else n&&e.items.push({start:i});this.stack.push(r);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){Qq(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case`anchor`:case`tag`:if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case`seq-item-ind`:if(this.indent!==e.indent)break;t.value||qq(t.start,`seq-item-ind`)?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let t=this.startBlockValue(e);if(t){this.stack.push(t);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type===`flow-error-end`){let e;do yield*this.pop(),e=this.peek(1);while(e?.type===`flow-collection`)}else if(e.end.length===0){switch(this.type){case`comma`:case`explicit-key-ind`:!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case`map-value-ind`:!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case`space`:case`comment`:case`newline`:case`anchor`:case`tag`:!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:{let n=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:n,sep:[]}):t.sep?this.stack.push(n):Object.assign(t,{key:n,sep:[]});return}case`flow-map-end`:case`flow-seq-end`:e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let t=this.peek(2);if(t.type===`block-map`&&(this.type===`map-value-ind`&&t.indent===e.indent||this.type===`newline`&&!t.items[t.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type===`map-value-ind`&&t.type!==`flow-collection`){let n=Zq(Xq(t));$q(e);let r=e.end.splice(1,e.end.length);r.push(this.sourceToken);let i={type:`block-map`,offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let e=this.source.indexOf(` `)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(` -`,e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return this.flowScalar(this.type);case`block-scalar-header`:return{type:`block-scalar`,offset:this.offset,indent:this.indent,props:[this.sourceToken],source:``};case`flow-map-start`:case`flow-seq-start`:return{type:`flow-collection`,offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case`seq-item-ind`:return{type:`block-seq`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case`explicit-key-ind`:{this.onKeyLine=!0;let t=Zq(Xq(e));return t.push(this.sourceToken),{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case`map-value-ind`:{this.onKeyLine=!0;let t=Zq(Xq(e));return{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!==`comment`||this.indent<=t?!1:e.every(e=>e.type===`newline`||e.type===`space`)}*documentEnd(e){this.type!==`doc-mode`&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case`comma`:case`doc-start`:case`doc-end`:case`flow-seq-end`:case`flow-map-end`:case`map-value-ind`:yield*this.pop(),yield*this.step();break;case`newline`:this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop())}}};function tJ(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new Kq||null,prettyErrors:t}}function nJ(e,t={}){let{lineCounter:n,prettyErrors:r}=tJ(t),i=new eJ(n?.addNewLine),a=new Mq(t),o=null;for(let t of a.compose(i.parse(e),!0,e.length))if(!o)o=t;else if(o.options.logLevel!==`silent`){o.errors.push(new JK(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return r&&n&&(o.errors.forEach(XK(e,n)),o.warnings.forEach(XK(e,n))),o}function rJ(e,t,n){let r;typeof t==`function`?r=t:n===void 0&&t&&typeof t==`object`&&(n=t);let i=nJ(e,n);if(!i)return null;if(i.warnings.forEach(e=>EG(i.options.logLevel,e)),i.errors.length>0){if(i.options.logLevel!==`silent`)throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:r},n))}function iJ(e,t,n){let r=null;if(typeof t==`function`||Array.isArray(t)?r=t:n===void 0&&t&&(n=t),typeof n==`string`&&(n=n.length),typeof n==`number`){let e=Math.round(n);n=e<1?void 0:e>8?{indent:8}:{indent:e}}if(e===void 0){let{keepUndefined:e}=n??t??{};if(!e)return}return xW(e)&&!r?e.toString(n):new GK(e,r,n).toString(n)}var aJ=e=>typeof e==`object`&&!!e&&!Array.isArray(e),oJ=e=>aJ(e)?Object.entries(e).map(([e,t])=>[e,Array.isArray(t)?t:[]]):[];function sJ(e){if(aJ(e)){if(aJ(e.parallel))return{kind:`parallel`,base:[`parallel`],branches:oJ(e.parallel)};if(aJ(e.switch))return{kind:`switch`,base:[`switch`,`cases`],on:typeof e.switch.on==`string`?e.switch.on:``,branches:oJ(e.switch.cases)}}}function cJ(e){return e.slice(2).includes(`parallel`)}function lJ(e,t){let n=nJ(e).getIn(t,!0);if(SW(n))return n.toJSON()}function uJ(e,t,n){let r=nJ(e);return r.setIn(t,r.createNode(xJ(n))),r.toString()}function dJ(e,t,n){let r=nJ(e),i=t.slice(0,-1),a=cJ(i);if(a&&![`agent.run`,`workflow.call`].includes(n))throw Error(`Branches allow only read-only agents and workflow calls.`);let o=r.getIn(i,!0);if(TW(o)||(r.setIn(i,r.createNode([])),o=r.getIn(i,!0)),!TW(o))return{source:e,path:[]};let s=Math.min(Math.max(Number(t.at(-1))+1,0),o.items.length),c=n===`parallel`?{parallel:{"branch-1":[],"branch-2":[]}}:n===`switch`?{switch:{on:``,cases:{true:[],default:[]}}}:{type:n,...a&&n===`agent.run`?{settings:{read_only:!0}}:{}};return o.items.splice(s,0,r.createNode(c)),{source:r.toString(),path:[...i,s]}}function fJ(e,t){if(t===`switch`){if(!e||e.includes(`/`))throw Error(`A case is the value it matches, without a slash.`)}else if(!/^[a-z][a-z0-9]*(?:[.-][a-z0-9]+)*$/.test(e))throw Error(`Use a lowercase branch name with letters, digits, dots or dashes.`)}function pJ(e,t){let n=e.getIn(t,!0),r=sJ(SW(n)?n.toJSON():void 0),i=r?e.getIn([...t,...r.base],!0):void 0;if(!r||!SW(i))throw Error(`This step has no branches.`);return{kind:r.kind,branches:i}}function mJ(e,t,n){let r=nJ(e),{kind:i,branches:a}=pJ(r,t);if(fJ(n,i),a.has(n))throw Error(`Branch ${n} already exists.`);return a.set(n,r.createNode([])),r.toString()}function hJ(e,t,n,r){let i=nJ(e),{kind:a,branches:o}=pJ(i,t);if(fJ(r,a),n!==r&&o.has(r))throw Error(`Branch ${r} already exists.`);let s=o.items.find(e=>wW(e.key)&&e.key.value===n);if(!s||!wW(s.key))throw Error(`Branch ${n} does not exist.`);return s.key.value=r,i.toString()}function gJ(e,t,n){let r=nJ(e),{kind:i,branches:a}=pJ(r,t);if(i===`parallel`&&a.items.length<=2)throw Error(`Parallel needs at least two branches.`);if(a.items.length<=1)throw Error(`A switch needs at least one case.`);return a.delete(n),r.toString()}function _J(e,t){let n=nJ(e),r=n.getIn(t.slice(0,-1),!0),i=t.at(-1);if(!TW(r)||typeof i!=`number`)return{source:e,path:t};let a=n.createNode(n.getIn(t));return SW(a)&&a.delete(`id`),r.items.splice(i+1,0,a),{source:n.toString(),path:[...t.slice(0,-1),i+1]}}function vJ(e,t){let n=nJ(e);return n.deleteIn(t),n.toString()}function yJ(e,t,n){let r=nJ(e),i=r.getIn(t.slice(0,-1),!0),a=t.at(-1);if(!TW(i)||typeof a!=`number`)return{source:e,path:t};let o=a+n;if(o<0||o>=i.items.length)return{source:e,path:t};let[s]=i.items.splice(a,1);return i.items.splice(o,0,s),{source:r.toString(),path:[...t.slice(0,-1),o]}}function bJ(e,t){let n=nJ(e).toJS(),r=Array.isArray(n?.steps)?n.steps:[],i=typeof t[1]==`number`?t[1]:r.length,a=[],o=e=>{if(typeof e!=`object`||!e)return;let t=e;typeof t.id==`string`&&a.push(t.id);for(let[,e]of sJ(t)?.branches??[])e.forEach(o)};if(r.slice(0,i).forEach(o),t.length>2){let e=t.at(-2);(sJ(r[i])?.branches.find(([t])=>t===e)?.[1])?.slice(0,t.at(-1)).forEach(o)}return a}function xJ(e){if(Array.isArray(e))return e.map(xJ);if(typeof e!=`object`||!e)return e;let t={};for(let[n,r]of Object.entries(e)){if(r===void 0||r===``||r===null)continue;let e=xJ(r);(typeof e!=`object`||!e||Array.isArray(e)||Object.keys(e).length!==0)&&(t[n]=e)}return t}function SJ(e,t){let n=nJ(e).get(t,!0);return n&&typeof n==`object`&&`toJSON`in n?n.toJSON():nJ(e).get(t)}function CJ(e,t,n){let r=nJ(e),i=xJ({[t]:n})[t];return i===void 0?r.delete(t):r.set(t,r.createNode(i)),r.toString()}function wJ(e,t){let n=e=>{try{return nJ(e).toJSON()??{}}catch{return{}}};return T(n(e),n(t),``,!0)}function TJ(e,t){let n=nJ(e),r=Ie(t.path);if(t.before!==void 0)return n.setIn(r,n.createNode(t.before)),n.toString();n.deleteIn(r);for(let e=r.slice(0,-1);e.length>0;e=e.slice(0,-1)){let t=n.getIn(e,!0);if(!SW(t)&&!TW(t)||t.items.length!==0)break;n.deleteIn(e)}return n.toString()}function EJ(e,t){let n=new Map;for(let e of t)n.set(e.name,[...n.get(e.name)??[],e]);return{edges:e.edges,nodes:e.nodes.map(e=>{let{stage:t,occurrence:r}=e.data,i=t===void 0?void 0:n.get(t)?.[r??0];return i?{...e,data:{...e.data,run:i}}:e})}}function DJ(e,t){let n=e=>e.path&&e.path.length>=2?Number(e.path[1]):-1,r=e.nodes.find(e=>JSON.stringify(e.data.path)===JSON.stringify(t))?.data,i=r?.resume??r?.stage;if(!r||!i)return null;let a=Math.max(-1,...e.nodes.filter(e=>e.data.run).map(e=>n(e.data))),o=n(r);if(o<0||o>a)return null;let s=e.nodes.filter(e=>e.data.path?.length===2).sort((e,t)=>n(e.data)-n(t.data)).map(e=>e.data.resume??e.data.stage??``),c=e=>!!e&&s.filter(t=>t===e).length>1;return c(i)||o>0&&c(s[o-1])?{label:`Add an id to resume here`,from:i,blocked:!0}:{label:o===a?`Resume from here`:`Re-run from here`,from:i}}var OJ=140,kJ=280,AJ={parallel:`Parallel`,switch:`Switch`,"agent.run":`Agent`,"command.run":`Run commands`,"repo.prepare":`Prepare worktree`,"repo.commit":`Commit`,"repo.open-pr":`Open pull request`,"gate.repository":`Repository gate`,"gate.diff-size":`Diff size gate`,"gate.diff-rules":`Diff rules gate`,"forge.comment":`Comment`,"forge.close-issue":`Close issue`,"human.approve":`Human approval`,"workflow.call":`Call workflow`,"workflow.handoff":`Hand off`,"workflow.finish":`Finish`,"review.pr":`Review pull request`,"review.start-round":`Start review round`,"review.reply":`Reply to review`};function jJ(e){return AJ[e]??e}var MJ=/\{\{\s*steps\.([A-Za-z0-9_-]+)\.[^}]*\}\}/g;function NJ(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function PJ(e,t){let n=e=>typeof t[e]==`string`?t[e]:``;switch(e){case`agent.run`:return[n(`role`)||`builder`,t.read_only?`read-only`:n(`gate`)?`gated: ${n(`gate`)}`:``].filter(Boolean).join(` · `);case`repo.commit`:return[n(`message`),t.push?`push`:``].filter(Boolean).join(` · `);case`workflow.call`:case`workflow.handoff`:return n(`workflow`);case`workflow.finish`:return n(`status`)||`completed`;case`human.approve`:return n(`then`)?`then ${n(`then`)}`:``;case`gate.repository`:return n(`expect`)===`test-failure`?`tests must fail`:t.repair?`repair if red`:``}return``}function FJ(e){for(let t of[`mission`,`message`,`body`,`plan`,`detail`]){let n=e[t];if(typeof n==`string`&&n.trim())return n.replace(/\{\{\s*([^}]+?)\s*\}\}/g,(e,t)=>`‹${t.replace(/^steps\./,``).replace(/\.result\b/,``)}›`).split(` +`,e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return this.flowScalar(this.type);case`block-scalar-header`:return{type:`block-scalar`,offset:this.offset,indent:this.indent,props:[this.sourceToken],source:``};case`flow-map-start`:case`flow-seq-start`:return{type:`flow-collection`,offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case`seq-item-ind`:return{type:`block-seq`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case`explicit-key-ind`:{this.onKeyLine=!0;let t=Zq(Xq(e));return t.push(this.sourceToken),{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case`map-value-ind`:{this.onKeyLine=!0;let t=Zq(Xq(e));return{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!==`comment`||this.indent<=t?!1:e.every(e=>e.type===`newline`||e.type===`space`)}*documentEnd(e){this.type!==`doc-mode`&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case`comma`:case`doc-start`:case`doc-end`:case`flow-seq-end`:case`flow-map-end`:case`map-value-ind`:yield*this.pop(),yield*this.step();break;case`newline`:this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop())}}};function tJ(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new Kq||null,prettyErrors:t}}function nJ(e,t={}){let{lineCounter:n,prettyErrors:r}=tJ(t),i=new eJ(n?.addNewLine),a=new Mq(t),o=null;for(let t of a.compose(i.parse(e),!0,e.length))if(!o)o=t;else if(o.options.logLevel!==`silent`){o.errors.push(new JK(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return r&&n&&(o.errors.forEach(XK(e,n)),o.warnings.forEach(XK(e,n))),o}function rJ(e,t,n){let r;typeof t==`function`?r=t:n===void 0&&t&&typeof t==`object`&&(n=t);let i=nJ(e,n);if(!i)return null;if(i.warnings.forEach(e=>EG(i.options.logLevel,e)),i.errors.length>0){if(i.options.logLevel!==`silent`)throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:r},n))}function iJ(e,t,n){let r=null;if(typeof t==`function`||Array.isArray(t)?r=t:n===void 0&&t&&(n=t),typeof n==`string`&&(n=n.length),typeof n==`number`){let e=Math.round(n);n=e<1?void 0:e>8?{indent:8}:{indent:e}}if(e===void 0){let{keepUndefined:e}=n??t??{};if(!e)return}return xW(e)&&!r?e.toString(n):new GK(e,r,n).toString(n)}var aJ=e=>typeof e==`object`&&!!e&&!Array.isArray(e),oJ=e=>aJ(e)?Object.entries(e).map(([e,t])=>[e,Array.isArray(t)?t:[]]):[];function sJ(e){if(aJ(e)){if(aJ(e.parallel))return{kind:`parallel`,base:[`parallel`],branches:oJ(e.parallel)};if(aJ(e.switch))return{kind:`switch`,base:[`switch`,`cases`],on:typeof e.switch.on==`string`?e.switch.on:``,branches:oJ(e.switch.cases)}}}function cJ(e){return e.slice(2).includes(`parallel`)}function lJ(e,t){let n=nJ(e).getIn(t,!0);if(SW(n))return n.toJSON()}function uJ(e,t,n){let r=nJ(e);return r.setIn(t,r.createNode(xJ(n))),r.toString()}function dJ(e,t,n){let r=nJ(e),i=t.slice(0,-1),a=cJ(i);if(a&&![`agent.run`,`workflow.call`].includes(n))throw Error(`Branches allow only read-only agents and workflow calls.`);let o=r.getIn(i,!0);if(TW(o)||(r.setIn(i,r.createNode([])),o=r.getIn(i,!0)),!TW(o))return{source:e,path:[]};let s=Math.min(Math.max(Number(t.at(-1))+1,0),o.items.length),c=n===`parallel`?{parallel:{"branch-1":[],"branch-2":[]}}:n===`switch`?{switch:{on:``,cases:{true:[],default:[]}}}:{type:n,...a&&n===`agent.run`?{settings:{read_only:!0}}:{}};return o.items.splice(s,0,r.createNode(c)),{source:r.toString(),path:[...i,s]}}function fJ(e,t){if(t===`switch`){if(!e||e.includes(`/`))throw Error(`A case is the value it matches, without a slash.`)}else if(!/^[a-z][a-z0-9]*(?:[.-][a-z0-9]+)*$/.test(e))throw Error(`Use a lowercase branch name with letters, digits, dots or dashes.`)}function pJ(e,t){let n=e.getIn(t,!0),r=sJ(SW(n)?n.toJSON():void 0),i=r?e.getIn([...t,...r.base],!0):void 0;if(!r||!SW(i))throw Error(`This step has no branches.`);return{kind:r.kind,branches:i}}function mJ(e,t,n){let r=nJ(e),{kind:i,branches:a}=pJ(r,t);if(fJ(n,i),a.has(n))throw Error(`Branch ${n} already exists.`);return a.set(n,r.createNode([])),r.toString()}function hJ(e,t,n,r){let i=nJ(e),{kind:a,branches:o}=pJ(i,t);if(fJ(r,a),n!==r&&o.has(r))throw Error(`Branch ${r} already exists.`);let s=o.items.find(e=>wW(e.key)&&e.key.value===n);if(!s||!wW(s.key))throw Error(`Branch ${n} does not exist.`);return s.key.value=r,i.toString()}function gJ(e,t,n){let r=nJ(e),{kind:i,branches:a}=pJ(r,t);if(i===`parallel`&&a.items.length<=2)throw Error(`Parallel needs at least two branches.`);if(a.items.length<=1)throw Error(`A switch needs at least one case.`);return a.delete(n),r.toString()}function _J(e,t){let n=nJ(e),r=n.getIn(t.slice(0,-1),!0),i=t.at(-1);if(!TW(r)||typeof i!=`number`)return{source:e,path:t};let a=n.createNode(n.getIn(t));return SW(a)&&a.delete(`id`),r.items.splice(i+1,0,a),{source:n.toString(),path:[...t.slice(0,-1),i+1]}}function vJ(e,t){let n=nJ(e);return n.deleteIn(t),n.toString()}function yJ(e,t,n){let r=nJ(e),i=r.getIn(t.slice(0,-1),!0),a=t.at(-1);if(!TW(i)||typeof a!=`number`)return{source:e,path:t};let o=a+n;if(o<0||o>=i.items.length)return{source:e,path:t};let[s]=i.items.splice(a,1);return i.items.splice(o,0,s),{source:r.toString(),path:[...t.slice(0,-1),o]}}function bJ(e,t){let n=nJ(e).toJS(),r=Array.isArray(n?.steps)?n.steps:[],i=typeof t[1]==`number`?t[1]:r.length,a=[],o=e=>{if(typeof e!=`object`||!e)return;let t=e;typeof t.id==`string`&&a.push(t.id);for(let[,e]of sJ(t)?.branches??[])e.forEach(o)};if(r.slice(0,i).forEach(o),t.length>2){let e=t.at(-2);(sJ(r[i])?.branches.find(([t])=>t===e)?.[1])?.slice(0,t.at(-1)).forEach(o)}return a}function xJ(e){if(Array.isArray(e))return e.map(xJ);if(typeof e!=`object`||!e)return e;let t={};for(let[n,r]of Object.entries(e)){if(r===void 0||r===``||r===null)continue;let e=xJ(r);(typeof e!=`object`||!e||Array.isArray(e)||Object.keys(e).length!==0)&&(t[n]=e)}return t}function SJ(e,t){let n=nJ(e).get(t,!0);return n&&typeof n==`object`&&`toJSON`in n?n.toJSON():nJ(e).get(t)}function CJ(e,t,n){let r=nJ(e),i=xJ({[t]:n})[t];return i===void 0?r.delete(t):r.set(t,r.createNode(i)),r.toString()}function wJ(e,t){let n=e=>{try{return nJ(e).toJSON()??{}}catch{return{}}};return T(n(e),n(t),``,!0)}function TJ(e,t){let n=nJ(e),r=Ie(t.path);if(t.before!==void 0)return n.setIn(r,n.createNode(t.before)),n.toString();n.deleteIn(r);for(let e=r.slice(0,-1);e.length>0;e=e.slice(0,-1)){let t=n.getIn(e,!0);if(!SW(t)&&!TW(t)||t.items.length!==0)break;n.deleteIn(e)}return n.toString()}function EJ(e,t){let n=new Map;for(let e of t)n.set(e.name,[...n.get(e.name)??[],e]);return{edges:e.edges,nodes:e.nodes.map(e=>{let{stage:t,occurrence:r}=e.data,i=t===void 0?void 0:n.get(t)?.[r??0];return i?{...e,data:{...e.data,run:i}}:e})}}function DJ(e,t){let n=e=>e.path&&e.path.length>=2?Number(e.path[1]):-1,r=e.nodes.find(e=>JSON.stringify(e.data.path)===JSON.stringify(t))?.data,i=r?.resume??r?.stage;if(!r||!i)return null;let a=Math.max(-1,...e.nodes.filter(e=>e.data.run).map(e=>n(e.data))),o=n(r);if(o<0||o>a)return null;let s=e.nodes.filter(e=>e.data.path?.length===2).sort((e,t)=>n(e.data)-n(t.data)).map(e=>e.data.resume??e.data.stage??``),c=e=>!!e&&s.filter(t=>t===e).length>1;return c(i)||o>0&&c(s[o-1])?{label:`Add an id to resume here`,from:i,blocked:!0}:{label:o===a?`Resume from here`:`Re-run from here`,from:i}}var OJ=140,kJ=280,AJ={parallel:`Parallel`,switch:`Switch`,"agent.run":`Agent`,"command.run":`Run commands`,"repo.prepare":`Prepare worktree`,"repo.commit":`Commit`,"repo.open-pr":`Open pull request`,"gate.repository":`Repository`,"gate.diff-size":`Diff size`,"gate.diff-rules":`Diff rules`,"forge.comment":`Comment`,"forge.close-issue":`Close issue`,"human.approve":`Human approval`,"workflow.call":`Call workflow`,"workflow.handoff":`Hand off`,"workflow.finish":`Finish`,"review.pr":`Review pull request`,"review.start-round":`Start review round`,"review.reply":`Reply to review`};function jJ(e){return AJ[e]??e}var MJ=/\{\{\s*steps\.([A-Za-z0-9_-]+)\.[^}]*\}\}/g;function NJ(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function PJ(e,t){let n=e=>typeof t[e]==`string`?t[e]:``;switch(e){case`agent.run`:return[n(`role`)||`builder`,t.read_only?`read-only`:n(`gate`)?`gated: ${n(`gate`)}`:``].filter(Boolean).join(` · `);case`repo.commit`:return[n(`message`),t.push?`push`:``].filter(Boolean).join(` · `);case`workflow.call`:case`workflow.handoff`:return n(`workflow`);case`workflow.finish`:return n(`status`)||`completed`;case`human.approve`:return n(`then`)?`then ${n(`then`)}`:``;case`gate.repository`:return n(`expect`)===`test-failure`?`tests must fail`:t.repair?`repair if red`:``}return``}function FJ(e){for(let t of[`mission`,`message`,`body`,`plan`,`detail`]){let n=e[t];if(typeof n==`string`&&n.trim())return n.replace(/\{\{\s*([^}]+?)\s*\}\}/g,(e,t)=>`‹${t.replace(/^steps\./,``).replace(/\.result\b/,``)}›`).split(` `).find(e=>e.trim())?.trim()}}function IJ(e,t){let n=JSON.stringify(e??{})+` `+(typeof t==`string`?`{{ ${t.replace(/^!/,``)} }}`:``);return[...new Set([...n.matchAll(MJ)].map(e=>e[1]))]}function LJ(e){let t=nJ(e).toJS(),n=NJ(t)&&Array.isArray(t.steps)?t.steps:[],r=[],i=[],a=new Map,o=[],s=new Set,c=`start`;r.push({id:c,type:`step`,position:{x:0,y:0},data:{kind:`start`,key:`start`,title:`Starts when`,type:``,detail:``}});let l=[c],u=1,d=new Map,f=e=>{let t=d.get(e)??0;return d.set(e,t+1),t},p=(e,t,n,i,s,c,l,u)=>{let d=NJ(e)?e:{},p=sJ(d),m=p?.kind??(typeof d.type==`string`?d.type:``),h=NJ(d.settings)?d.settings:{},g=typeof d.id==`string`?d.id:``,_=`step-${t}`,v=s?`${s}/${g||m}`:g||m;r.push({id:_,type:`step`,position:{x:n,y:i},data:{kind:`step`,key:g||t,name:g||void 0,title:g||jJ(m),type:m,step:l?.length===2?String(Number(l[1])+1).padStart(2,`0`):void 0,detail:p?.on?`on ${p.on.replace(/^steps\./,``)}`:PJ(m,h),summary:FJ(h),when:typeof d.when==`string`?d.when:void 0,retry:NJ(d.retry)&&typeof d.retry.attempts==`number`?d.retry.attempts:void 0,continues:d.on_failure===`continue`,branch:s,lane:u,path:l,stage:v,occurrence:f(v),...c?{resume:c}:{}}}),g&&a.set(g,_);let y=p?.on?`{{ ${p.on} }}`:``;for(let e of IJ([d.settings,y],d.when))o.push({from:e,to:_});return _},m=(e,t,n)=>{e.forEach((r,a)=>i.push({id:`flow-${r}-${t}`,source:r,target:t,kind:`flow`,...s.has(r)?{otherwise:!0}:{},insertAfter:a===e.length-1?n:void 0}))};for(let[e,t]of n.entries()){let n=sJ(t);if(n){let{kind:i,base:a,branches:o}=n,c=p(t,String(e+1),0,u*OJ,void 0,void 0,[`steps`,e]);m(l,c,[`steps`,e-1]),u++;let d=NJ(t)&&typeof t.id==`string`?t.id:i,f=i===`switch`&&!o.some(([e])=>e==="default"),h=o.length+ +!!f,g=[],_=0;o.forEach(([t,n],o)=>{let s=(o-(h-1)/2)*kJ,l=[c],f=[`steps`,e,...a,t];n.forEach((n,r)=>{let a=p(n,`${e+1}-${t}-${r+1}`,s,(u+r)*OJ,t,d,[...f,r],i);m(l,a,[...f,r-1]),l=[a]}),_=Math.max(_,n.length);let v=`add-${e}-${t}`;r.push({id:v,type:`add`,position:{x:s+104,y:(u+n.length)*OJ},data:{kind:`step`,key:v,title:``,type:``,detail:``,branch:t,lane:i,insertAfter:[...f,n.length-1]}}),m(l,v),g.push(v)});let v=(Math.max(_,1)+1)*OJ-24;o.forEach(([t],n)=>{let a=(n-(h-1)/2)*kJ;r.push({id:`lane-${e}-${t}`,type:`lane`,position:{x:a-12,y:u*OJ-40},style:{width:`264px`,height:`${v}px`},zIndex:-1,data:{kind:`step`,key:t,title:t,type:``,detail:``,lane:i}})}),f&&(g.push(c),s.add(c)),l=g,u+=Math.max(_,1)+1;continue}let i=p(t,String(e+1),0,u*OJ,void 0,void 0,[`steps`,e]);m(l,i,[`steps`,e-1]),l=[i],u++}r.push({id:`add-end`,type:`add`,position:{x:104,y:u*OJ-24},data:{kind:`step`,key:`add`,title:``,type:``,detail:``,insertAfter:[`steps`,n.length-1]}}),m(l,`add-end`);for(let{from:e,to:t}of o){let n=a.get(e);n&&(i.some(e=>e.kind===`flow`&&e.source===n&&e.target===t)||i.push({id:`data-${n}-${t}`,source:n,target:t,kind:`data`,label:e,offset:24+14*i.filter(e=>e.kind===`data`).length,sourceHandle:`data-out`,targetHandle:`data-in`}))}return{nodes:r,edges:i}}var RJ=`\0`,zJ=k({inheritAttrs:!1,__name:`OptionSelect`,props:{modelValue:{},options:{},placeholder:{},disabled:{type:Boolean},size:{},class:{}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=t;return(t,r)=>(R(),K(z(Dl),{"model-value":e.modelValue===``&&e.options.some(e=>e.value===``)?RJ:e.modelValue||void 0,disabled:e.disabled,"onUpdate:modelValue":r[0]||=e=>n(`update:modelValue`,e===RJ?``:String(e))},{default:j(()=>[M(z(Pl),H({size:e.size??`sm`,class:t.$props.class},t.$attrs),{default:j(()=>[M(z(Fl),{placeholder:e.placeholder},null,8,[`placeholder`])]),_:1},16,[`size`,`class`]),M(z(Ol),null,{default:j(()=>[(R(!0),W(V,null,G(e.options,e=>(R(),K(z(jl),{key:e.value,value:e.value===``?RJ:e.value,disabled:e.disabled},{default:j(()=>[A(B(e.label),1)]),_:2},1032,[`value`,`disabled`]))),128))]),_:1})]),_:1},8,[`model-value`,`disabled`]))}}),BJ=k({__name:`WorkflowPicker`,props:{value:{},workflows:{},label:{}},emits:[`pick`],setup(e,{emit:t}){let n=t;return(t,r)=>(R(),K(z(Dl),{"model-value":e.value||void 0,"onUpdate:modelValue":r[0]||=e=>n(`pick`,String(e))},{default:j(()=>[M(z(Pl),{"aria-label":e.label},{default:j(()=>[M(z(Fl),{placeholder:`Choose workflow`})]),_:1},8,[`aria-label`]),M(z(Ol),null,{default:j(()=>[e.value&&!e.workflows.some(t=>t.id===e.value)?(R(),K(z(jl),{key:0,value:e.value,disabled:``},{default:j(()=>[A(B(e.value)+` (unavailable)`,1)]),_:1},8,[`value`])):L(``,!0),(R(!0),W(V,null,G(e.workflows,e=>(R(),K(z(jl),{key:e.id,value:e.id},{default:j(()=>[A(B(e.id),1)]),_:2},1032,[`value`]))),128))]),_:1})]),_:1},8,[`model-value`]))}});function VJ(e){return e.ok?`Valid`:e.line?`Line ${e.line}: ${e.message}`:e.message}function HJ(e,t=[]){let n=nJ(e),r=n.errors[0];if(r)return{ok:!1,message:rY(r.message),line:r.linePos?.[0]?.line};let i=n.toJS();if(!iY(i))return{ok:!1,message:`A workflow is a mapping with an id and steps.`};let a=typeof i.id==`string`?i.id.trim():``;if(!a)return{ok:!1,message:`workflow id is required`};let o=i.steps;if(o==null||o===``)return{ok:!1,message:`workflow ${a} has no steps`};if(!Array.isArray(o))return{ok:!1,message:`workflow ${a}: steps must be a list`};if(!o.length)return{ok:!1,message:`workflow ${a} has no steps`};let s=new Map(t.map(e=>[e.name,e])),c=typeof i.repository==`string`&&i.repository.trim()?i.repository.trim():`required`,l=[],u=new Set;for(let[e,t]of o.entries()){let n=`workflow ${a} step ${e+1}`,r=KJ(t);if(r)return{ok:!1,message:`${n}: ${r}`};let i=sJ(t);if(i){if(i.kind===`switch`&&!i.on)return{ok:!1,message:`${n}: switch.on names nothing`};if(i.on&&!u.has(i.on.split(`.`)[1]??``)&&i.on.startsWith(`steps.`))return{ok:!1,message:`${n}: no earlier step has id "${i.on.split(`.`)[1]}"`};for(let[e,t]of i.branches){if(!t.length)return{ok:!1,message:`${n}: ${i.kind===`switch`?`case`:`branch`} ${e} needs a list of steps`};let r=new Set(u);for(let[i,a]of t.entries()){let t=`${n} branch ${e} step ${i+1}`,o=KJ(a)||qJ(a,t,s,c)||WJ(a,t,r);if(o)return{ok:!1,message:o};GJ(a,r)}for(let e of t)GJ(e,u)}GJ(t,u),l.push({index:e+1,type:i.kind});continue}let o=qJ(t,n,s,c)||WJ(t,n,u);if(o)return{ok:!1,message:o};GJ(t,u),l.push({index:e+1,type:t.type.trim()})}return{ok:!0,id:a,steps:l}}var UJ=/steps\.([A-Za-z0-9_-]+)/g;function WJ(e,t,n){if(!iY(e))return``;let r=JSON.stringify(e.settings??{})+` `+(typeof e.when==`string`?e.when:``);for(let[,e]of r.matchAll(UJ))if(!n.has(e))return`${t}: no earlier step has id "${e}"`;return``}function GJ(e,t){iY(e)&&typeof e.id==`string`&&t.add(e.id)}function KJ(e){if(!iY(e))return``;if(e.when!==void 0&&e.when!==``){if(typeof e.when!=`string`)return`when must be a reference`;let t=e.when.includes(`==`)?`==`:e.when.includes(`!=`)?`!=`:``,n=t?e.when.split(t,1)[0].trim():e.when.trim().replace(/^!\s*/,``);if(!/^(task|inputs|steps)\.[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)*$/.test(n))return`when must name a task, inputs or steps field, optionally prefixed with ! or compared using == or !=`}if(e.retry!==void 0){if(!iY(e.retry))return`retry must be a mapping`;let{attempts:t,backoff:n}=e.retry;if(typeof t!=`number`||!Number.isInteger(t)||t<1||t>10)return`retry.attempts must be a whole number from 1 to 10`;if(n!==void 0&&n!==``){let e=typeof n==`string`?ue(n):null;if(e===null||e<0||!Number.isFinite(e))return`retry.backoff must be a non-negative duration, such as 5s or 1m`}}return``}function qJ(e,t,n,r){if(!iY(e)||!aY(e.type))return`${t} needs a type`;let i=e.type.trim(),a=n.get(i);return n.size&&!a?`${t}: unknown step type "${i}"`:a?.needs_repository&&r!==`required`?`${t}: "${i}" needs a repository, but the workflow's repository is ${r}`:!a||e.settings===void 0||e.settings===null?``:a.settings?JJ(e.settings,a.settings,`${t} settings`):`${t}: "${i}" takes no settings`}function JJ(e,t,n){let r=Array.isArray(e)?`array`:e===null?`null`:typeof e;switch(t.type){case`object`:if(!iY(e))return`${n} must be a mapping`;for(let[r,i]of Object.entries(e)){let e=t.properties?.[r]??t.additionalProperties;if(!e)return`${n}: unknown setting "${r}"`;let a=JJ(i,e,`${n}.${r}`);if(a)return a}return``;case`array`:if(!Array.isArray(e))return`${n} must be a list`;for(let[r,i]of e.entries()){let e=t.items?JJ(i,t.items,`${n}[${r}]`):``;if(e)return e}return``;case`string`:return r===`string`?t.enum&&!t.enum.includes(e)&&!e.includes(`{{`)?`${n} must be one of ${t.enum.join(`, `)}`:``:`${n} must be text`;case`boolean`:return r===`boolean`?``:`${n} must be true or false`;case`integer`:case`number`:return r===`number`?``:`${n} must be a number`}return``}function YJ(e){switch(e){case`key`:return`text-fg-muted`;case`string`:return`text-ok`;case`comment`:case`punct`:return`text-fg-subtle`;default:return`text-foreground`}}function XJ(e){return e.split(` `).map((e,t)=>({number:t+1,text:e,tokens:$J(e)}))}var ZJ=/^(\s*)(-\s+)?/,QJ=/^([^:#\s][^:#]*?)(:)(\s*)(.*)$/;function $J(e){let{code:t,comment:n}=eY(e),r=tY(t);return n&&r.push({text:n,kind:`comment`}),r}function eY(e){let t=``;for(let n=0;nlJ(r.yaml,r.path)??{}),o=I(()=>sJ(a.value)),s=I(()=>o.value?.kind??(typeof a.value.type==`string`?a.value.type:``)),c=I(()=>o.value?.branches.map(([e])=>e)??[]),l=I(()=>s.value===`parallel`?2:1);function u(e){i(`update:yaml`,uJ(r.yaml,r.path,{...a.value,switch:{...a.value.switch,on:e}}))}let d=q(``),f=q(``);function p(e,t,n=``){try{let a=e===`add`?mJ(r.yaml,r.path,t):e===`rename`?hJ(r.yaml,r.path,t,n):gJ(r.yaml,r.path,t);i(`update:yaml`,a),d.value=``,f.value=``}catch(e){f.value=String(e.message)}}let m=I(()=>r.vocabulary.find(e=>e.name===s.value)),h=I(()=>typeof a.value.settings==`object`&&a.value.settings!==null?a.value.settings:{}),g=I(()=>bJ(r.yaml,r.path)),_=I(()=>KJ(a.value)),v=I(()=>m.value?.settings&&a.value.settings?JJ(a.value.settings,m.value.settings,`settings`):``),y=[`mission`,`workflow`,`message`,`body`,`plan`,`then`,`status`,`detail`,`run`,`rules`],x=/mission|body|detail|plan|rules/;function S(e,t){return[`workflow.call`,`workflow.handoff`].includes(s.value)&&e===`workflow`||s.value===`human.approve`&&e===`then`?`workflow`:s.value===`agent.run`&&e===`model`?`select`:t.type===`string`?t.enum?`select`:x.test(e)?`text`:`line`:t.type===`boolean`?`boolean`:t.type===`integer`||t.type===`number`?`number`:t.type===`array`&&t.items?.type===`string`?`lines`:`yaml`}let C=I(()=>{let e=Object.entries(m.value?.settings?.properties??{}).filter(([e])=>s.value!==`workflow.call`||![`inputs`,`outputs`].includes(e)).map(([e,t])=>({key:e,schema:t,kind:S(e,t),options:s.value===`agent.run`&&e===`model`?r.modelAliases:t.enum??[]})),t=e.filter(e=>y.includes(e.key)&&e.kind!==`boolean`).sort((e,t)=>y.indexOf(e.key)-y.indexOf(t.key))[0],n=e.filter(e=>e!==t);return{lead:t,compact:n.filter(e=>[`workflow`,`select`,`line`,`number`,`boolean`].includes(e.kind)),long:n.filter(e=>[`text`,`lines`,`yaml`].includes(e.kind))}}),w=q(!C.value.lead&&!o.value),ee=e=>[{value:``,label:`Default`},...e.map(e=>({value:e,label:e}))];function te(e){let{id:t,type:n,...a}=e;i(`update:yaml`,uJ(r.yaml,r.path,{id:t,type:n,...a}))}function T(e,t){te({...a.value,[e]:t})}function E(e){let t={...a.value.retry,...e};T(`retry`,t.attempts===void 0&&!t.backoff?void 0:{...t,attempts:t.attempts??1})}function ne(e,t){let n={...h.value,[e]:t};s.value===`workflow.call`&&e===`wait`&&t!==!0&&delete n.outputs,te({...a.value,settings:n})}function re(e,t){let n={...h.value,[e]:t};s.value===`workflow.call`&&t!==h.value[e]&&(delete n.inputs,delete n.outputs),te({...a.value,settings:n})}let ie=I(()=>r.workflows.find(e=>e.id===h.value.workflow)),ae=I(()=>Object.entries(SJ(ie.value?.yaml??``,`inputs`)??{})),D=I(()=>Object.entries(SJ(ie.value?.yaml??``,`outputs`)??{})),oe=I(()=>Object.entries(SJ(r.yaml,`inputs`)??{})),se=I(()=>Object.entries(SJ(r.yaml,`outputs`)??{})),ce=I(()=>h.value.inputs??{}),O=I(()=>h.value.outputs??{}),le=e=>typeof e==`string`&&e.startsWith(`inputs.`),ue=e=>[`object`,`array`].includes(e.type??``),de=e=>ce.value[e]===void 0?``:String(ce.value[e]);function fe(e,t,n){ne(`inputs`,{...ce.value,[e]:t===``?void 0:le(t)?t:Gv(t,n??`string`)})}let pe=(e,t,n)=>e.filter(([,e])=>e.type===t.type||e.type===`any`||t.type===`any`).map(([e])=>({value:`${n}.${e}`,label:e})),me=q(null);function he(e,t){let n=me.value??C.value.lead?.key;if(!n)return;let r=typeof h.value[n]==`string`?h.value[n]:``,i=`{{ steps.${e}.${t} }}`;ne(n,r?`${r.trimEnd()} ${i}`:i)}let ge=q({});function _e(e,t){try{ne(e,t.trim()?rJ(t):void 0),ge.value={...ge.value,[e]:``}}catch(t){ge.value={...ge.value,[e]:String(t.message).split(` diff --git a/ui/src/workflows/workflow-graph.ts b/ui/src/workflows/workflow-graph.ts index 5f63b12b1..9b37251dd 100644 --- a/ui/src/workflows/workflow-graph.ts +++ b/ui/src/workflows/workflow-graph.ts @@ -154,9 +154,9 @@ const TYPE_TITLES: Record = { "repo.prepare": "Prepare worktree", "repo.commit": "Commit", "repo.open-pr": "Open pull request", - "gate.repository": "Repository gate", - "gate.diff-size": "Diff size gate", - "gate.diff-rules": "Diff rules gate", + "gate.repository": "Repository", + "gate.diff-size": "Diff size", + "gate.diff-rules": "Diff rules", "forge.comment": "Comment", "forge.close-issue": "Close issue", "human.approve": "Human approval",