fix(workflows): callees of a test run inherit the test source

This commit is contained in:
sam committed 2026-10-13 12:46:48 +11:00
1 parent 2a066f6d4f
commit 25face6d04
4 files changed
+10 -6

No files matched your search

@@ -36,7 +36,8 @@ SELECT
caller.owner,
caller.repo,
number.last_number,
$2, $3, 'chat', $4, 'chat', $5,
$2, $3, 'chat', $4,
CASE WHEN caller.source = 'test' THEN 'test' ELSE 'chat' END, $5,
caller.org_id, caller.workspace_id, $6,
caller.id, caller.call_depth + 1, $7
FROM caller, number
@@ -69,7 +70,8 @@ type EnqueueCallTaskParams struct {
// InsertChatTask. The callee is started by the identity the caller's
// workflow declares, read from its pinned definition: a callee never inherits the
// identity that started its caller, and runs as the one its own workflow
// declares.
// declares. A callee of a test run is a test run too, so it cannot write to a
// forge either.
func (q *Queries) EnqueueCallTask(ctx context.Context, arg EnqueueCallTaskParams) (Task, error) {
row := q.db.QueryRow(ctx, enqueueCallTask,
arg.ID,
@@ -11,7 +11,8 @@
-- InsertChatTask. The callee is started by the identity the caller's
-- workflow declares, read from its pinned definition: a callee never inherits the
-- identity that started its caller, and runs as the one its own workflow
-- declares.
-- declares. A callee of a test run is a test run too, so it cannot write to a
-- forge either.
WITH caller AS (
SELECT t.* FROM tasks t WHERE t.id = $1 FOR UPDATE
), number AS (
@@ -25,7 +26,8 @@ SELECT
caller.owner,
caller.repo,
number.last_number,
sqlc.arg(title), sqlc.arg(body), 'chat', sqlc.arg(workflow), 'chat', sqlc.arg(identity),
sqlc.arg(title), sqlc.arg(body), 'chat', sqlc.arg(workflow),
CASE WHEN caller.source = 'test' THEN 'test' ELSE 'chat' END, sqlc.arg(identity),
caller.org_id, caller.workspace_id, sqlc.arg(inputs),
caller.id, caller.call_depth + 1, sqlc.arg('call_key')
FROM caller, number
+1 -1
View File
@@ -122,7 +122,7 @@ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\
`)[0]?.trim()||`invalid YAML`}function rH(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function iH(e){return typeof e==`string`&&e.trim()!==``}var aH={class:`flex h-full w-[24rem] flex-col border-l border-border bg-card shadow-xl`},oH={class:`flex items-center gap-2.5 border-b border-border px-4 py-3`},sH={class:`flex size-8 shrink-0 items-center justify-center rounded-md bg-secondary text-primary`},cH={class:`min-w-0 flex-1`},lH={class:`truncate font-mono text-[11px] text-fg-subtle`},uH={class:`flex-1 space-y-5 overflow-y-auto px-4 py-4`},dH={key:0,class:`rounded-md bg-danger/10 px-2.5 py-1.5 text-xs text-danger`,role:`alert`},fH={key:1,class:`space-y-3`},pH={key:0,class:`block space-y-1.5`},mH={id:`switch-on`},hH=[`value`],gH={class:`text-xs font-medium text-muted-foreground`},_H={class:`flex items-center gap-2`},vH={key:1,role:`alert`,class:`text-xs text-danger`},yH={key:2,class:`space-y-1.5`},bH=[`title`],xH={key:4,class:`flex flex-wrap items-center gap-1 pt-0.5`},SH={key:3,class:`divide-y divide-border rounded-md border border-border`},CH=[`title`],wH={key:0,class:`space-y-3`},TH={class:`text-[13px]`},EH={key:0,class:`text-danger`},DH={class:`ml-2 text-xs text-fg-subtle`},OH={key:1,class:`space-y-3`},kH={class:`text-[13px]`},AH={class:`ml-2 text-xs text-fg-subtle`},jH=[`title`],MH={key:0,class:`text-xs text-danger`},NH={class:`space-y-2`},PH={class:`divide-y divide-border rounded-md border border-border`},FH={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},IH={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},LH={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},RH={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},zH={class:`flex items-center border-t border-border px-4 py-2.5`},BH=A({__name:`StepEditor`,props:{yaml:{},path:{},vocabulary:{},workflows:{},modelAliases:{}},emits:[`update:yaml`,`close`,`remove`],setup(e,{emit:t}){let n=e,r=t,i=L(()=>iV(n.yaml,n.path)??{}),a=L(()=>nV(i.value)),o=L(()=>a.value?.kind??(typeof i.value.type==`string`?i.value.type:``)),s=L(()=>a.value?.branches.map(([e])=>e)??[]),c=L(()=>o.value===`parallel`?2:1);function l(e){r(`update:yaml`,aV(n.yaml,n.path,{...i.value,switch:{...i.value.switch,on:e}}))}let u=Y(``),d=Y(``);function f(e,t,i=``){try{let a=e===`add`?lV(n.yaml,n.path,t):e===`rename`?uV(n.yaml,n.path,t,i):dV(n.yaml,n.path,t);r(`update:yaml`,a),u.value=``,d.value=``}catch(e){d.value=String(e.message)}}let p=L(()=>n.vocabulary.find(e=>e.name===o.value)),m=L(()=>typeof i.value.settings==`object`&&i.value.settings!==null?i.value.settings:{}),h=L(()=>hV(n.yaml,n.path)),g=L(()=>p.value?.settings&&i.value.settings?qV(i.value.settings,p.value.settings,`settings`):``),_=[`mission`,`workflow`,`message`,`body`,`plan`,`then`,`status`,`detail`,`run`,`rules`],v=/mission|body|detail|plan|rules/;function y(e,t){return[`workflow.call`,`workflow.handoff`].includes(o.value)&&e===`workflow`||o.value===`human.approve`&&e===`then`?`workflow`:o.value===`agent.run`&&e===`model`?`select`:t.type===`string`?t.enum?`select`:v.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 b=L(()=>{let e=Object.entries(p.value?.settings?.properties??{}).filter(([e])=>o.value!==`workflow.call`||![`inputs`,`outputs`].includes(e)).map(([e,t])=>({key:e,schema:t,kind:y(e,t),options:o.value===`agent.run`&&e===`model`?n.modelAliases:t.enum??[]})),t=e.filter(e=>_.includes(e.key)&&e.kind!==`boolean`).sort((e,t)=>_.indexOf(e.key)-_.indexOf(t.key))[0],r=e.filter(e=>e!==t);return{lead:t,compact:r.filter(e=>[`workflow`,`select`,`line`,`number`,`boolean`].includes(e.kind)),long:r.filter(e=>[`text`,`lines`,`yaml`].includes(e.kind))}});function x(e){let{id:t,type:i,...a}=e;r(`update:yaml`,aV(n.yaml,n.path,{id:t,type:i,...a}))}function S(e,t){x({...i.value,[e]:t})}function C(e){S(`retry`,{...i.value.retry,...e})}function w(e,t){let n={...m.value,[e]:t};o.value===`workflow.call`&&e===`wait`&&t!==!0&&delete n.outputs,x({...i.value,settings:n})}function ee(e,t){let n={...m.value,[e]:t};o.value===`workflow.call`&&t!==m.value[e]&&(delete n.inputs,delete n.outputs),x({...i.value,settings:n})}let T=L(()=>n.workflows.find(e=>e.id===m.value.workflow)),te=L(()=>Object.entries(_V(T.value?.yaml??``,`inputs`)??{})),E=L(()=>Object.entries(_V(T.value?.yaml??``,`outputs`)??{})),ne=L(()=>Object.entries(_V(n.yaml,`inputs`)??{})),D=L(()=>Object.entries(_V(n.yaml,`outputs`)??{})),re=L(()=>m.value.inputs??{}),O=L(()=>m.value.outputs??{}),ie=e=>typeof e==`string`&&e.startsWith(`inputs.`),ae=e=>re.value[e]===void 0?``:String(re.value[e]);function oe(e,t,n){w(`inputs`,{...re.value,[e]:t===``?void 0:ie(t)?t:RV(t,n??`string`)})}let se=Y(null);function ce(e,t){let n=se.value??b.value.lead?.key;if(!n)return;let r=typeof m.value[n]==`string`?m.value[n]:``,i=`{{ steps.${e}.${t} }}`;w(n,r?`${r.trimEnd()} ${i}`:i)}let le=Y({});function ue(e,t){try{w(e,t.trim()?QB(t):void 0),le.value={...le.value,[e]:``}}catch(t){le.valu Line truncated
`)[0]}}}let de=e=>e===void 0?``:$B(e).trimEnd(),fe=(e,t)=>t.title??e.replaceAll(`_`,` `).replace(/^./,e=>e.toUpperCase()),pe=e=>typeof m.value[e]==`string`?m.value[e]:``;return(t,n)=>(z(),K(`aside`,aH,[G(`header`,oH,[G(`span`,sH,[(z(),J(He(B(PV)(o.value)),{class:`size-4`}))]),G(`div`,cH,[N(B(k),{"model-value":i.value.id??``,class:`h-7 truncate border-transparent px-1 font-medium shadow-none hover:border-input dark:bg-transparent`,placeholder:B(TV)(o.value),"aria-label":`Step id`,"onUpdate:modelValue":n[0]||=e=>S(`id`,String(e))},null,8,[`model-value`,`placeholder`]),G(`div`,lH,H(o.value),1)]),N(B(X),{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Close`,onClick:n[1]||=e=>r(`close`)},{default:M(()=>[N(B(Jn))]),_:1})]),G(`div`,uH,[g.value?(z(),K(`p`,dH,H(g.value),1)):R(``,!0),a.value?(z(),K(`section`,fH,[o.value===`switch`?(z(),K(`label`,pH,[n[18]||=G(`span`,{class:`text-xs font-medium text-muted-foreground`,title:`The value whose case runs; a case named default runs when none matches`},`Switch on`,-1),N(B(k),{"model-value":a.value.on,class:`font-mono`,placeholder:`steps.assess.result.fit`,list:`switch-on`,onChange:n[2]||=e=>l(e.target.value.trim())},null,8,[`model-value`]),G(`datalist`,mH,[(z(!0),K(U,null,q(h.value,e=>(z(),K(`option`,{key:e,value:`steps.${e}.result.`},null,8,hH))),128))])])):R(``,!0),G(`div`,gH,H(o.value===`switch`?`Cases`:`Branches`),1),(z(!0),K(U,null,q(s.value,e=>(z(),K(`div`,{key:e,class:`flex items-center gap-2`},[N(B(k),{"model-value":e,class:P(o.value===`switch`&&`font-mono`),"aria-label":`${o.value===`switch`?`Case`:`Branch`} ${e}`,onChange:t=>f(`rename`,e,t.target.value.trim())},null,8,[`model-value`,`class`,`aria-label`,`onChange`]),N(B(X),{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Remove ${e}`,disabled:s.value.length<=c.value,onClick:t=>f(`delete`,e)},{default:M(()=>[N(B(Bn))]),_:1},8,[`aria-label`,`disabled`,`onClick`])]))),128)),G(`div`,_H,[N(B(k),{modelValue:u.value,"onUpdate:modelValue":n[3]||=e=>u.value=e,"aria-label":o.value===`switch`?`New case value`:`New branch name`,placeholder:o.value===`switch`?`Value, or default`:`Branch name`,onKeydown:n[4]||=vt(St(e=>f(`add`,u.value.trim()),[`prevent`]),[`enter`])},null,8,[`modelValue`,`aria-label`,`placeholder`]),N(B(X),{type:`button`,size:`icon-sm`,variant:`outline`,"aria-label":o.value===`switch`?`Add case`:`Add branch`,disabled:!u.value.trim(),onClick:n[5]||=e=>f(`add`,u.value.trim())},{default:M(()=>[N(B(Dn))]),_:1},8,[`aria-label`,`disabled`])]),d.value?(z(),K(`p`,vH,H(d.value),1)):R(``,!0)])):R(``,!0),b.value.lead?(z(),K(`section`,yH,[G(`div`,{class:`flex items-center gap-1 text-xs font-medium text-muted-foreground`,title:b.value.lead.schema.description},[j(H(fe(b.value.lead.key,b.value.lead.schema))+` `,1),b.value.lead.schema.description?(z(),J(B(an),{key:0,class:`size-3 text-fg-subtle`})):R(``,!0)],8,bH),b.value.lead.kind===`workflow`?(z(),J(BV,{key:0,value:pe(b.value.lead.key),workflows:e.workflows,label:fe(b.value.lead.key,b.value.lead.schema),onPick:n[6]||=e=>ee(b.value.lead.key,e)},null,8,[`value`,`workflows`,`label`])):b.value.lead.kind===`select`?(z(),J(B(MI),{key:1,size:`sm`,class:`w-full`,"model-value":pe(b.value.lead.key),"onUpdate:modelValue":n[7]||=e=>w(b.value.lead.key,String(e)||void 0)},{default:M(()=>[N(B(NI),{value:``},{default:M(()=>[...n[19]||=[j(`Default`,-1)]]),_:1}),(z(!0),K(U,null,q(b.value.lead.options,e=>(z(),J(B(NI),{key:e,value:e},{default:M(()=>[j(H(e),1)]),_:2},1032,[`value`]))),128))]),_:1},8,[`model-value`])):b.value.lead.kind===`text`?(z(),J(B(iu),{key:2,"model-value":pe(b.value.lead.key),class:`min-h-40 text-[13px] leading-relaxed`,onFocus:n[8]||=e=>se.value=b.value.lead.key,"onUpdate:modelValue":n[9]||=e=>w(b.value.lead.key,String(e))},null,8,[`model-value`])):(z(),J(B(k),{key:3,"model-value":pe(b.value.lead.key),onFocus:n[10]||=e=>se.value=b.value.lead.key,"onUpdate:modelValue":n[11]||=e=>w(b.value.lead.key,String(e))},null,8,[`model-value`])),h.value.length&&b.value.lead.kind!==`select`?(z(),K(`div`,xH,[n[20]||=G(`span`,{class:`text-[11px] text-fg-subtle`},`Insert`,-1),(z(!0),K(U,null,q(h.value,e=>(z(),K(U,{key:e},[N(B(X),{type:`button`,variant:`outline`,size:`xs`,class:`font-mono`,onClick:t=>ce(e,`summary`)},{default:M(()=>[j(H(e),1)]),_:2},1032,[`onClick`]),N(B(X),{type:`button`,variant:`outline`,size:`xs`,class:`font-mono`,onClick:t=>ce(e,`result`)},{default:M(()=>[j(H(e)+`.result`,1)]),_:2},1032,[`onClick`])],64))),128))])):R(``,!0)])):R(``,!0),b.value.compact.length?(z(),K(`section`,SH,[(z(!0),K(U,null,q(b.value.compact,t=>(z(),K(`div`,{key:t.key,class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},[G(`span`,{class:`flex flex-1 items-center gap-1 text-[13px]`,title:t.schema.description},[j(H(fe(t.key,t.schema))+` `,1),t.schema.description?(z(),J(B(an),{key:0,class:`size-3 text-fg-subtle`})):R(``,!0)],8,CH),t.kind===`workflow`?(z(),J(BV,{key:0,class:`max-w-48`,value:pe(t.key),workflows:e.workflows,label:fe(t.key,t.schema),onPick:e=>ee(t.key,e)},null,8,[`vLine truncated
`):``,class:`min-h-16 font-mono text-xs`,placeholder:`One per line`,"onUpdate:modelValue":t=>w(e.key,String(t).split(`
`).filter(Boolean))},null,8,[`model-value`,`onUpdate:modelValue`])):(z(),K(U,{key:2},[N(B(iu),{"model-value":de(m.value[e.key]),class:`min-h-24 font-mono text-xs`,placeholder:`YAML`,onChange:t=>ue(e.key,t.target.value)},null,8,[`model-value`,`onChange`]),le.value[e.key]?(z(),K(`span`,MH,H(le.value[e.key]),1)):R(``,!0)],64))]))),128)),G(`section`,NH,[n[37]||=G(`div`,{class:`text-xs font-medium text-muted-foreground`},`Flow`,-1),G(`div`,PH,[G(`label`,FH,[n[31]||=G(`span`,{class:`flex-1 text-[13px]`},`Run only when`,-1),N(B(k),{class:`h-7 w-48 font-mono text-xs`,placeholder:`always`,"model-value":i.value.when??``,"onUpdate:modelValue":n[12]||=e=>S(`when`,String(e))},null,8,[`model-value`])]),G(`label`,IH,[n[34]||=G(`span`,{class:`flex-1 text-[13px]`},`If it fails`,-1),N(B(MI),{size:`sm`,"model-value":i.value.on_failure??``,"onUpdate:modelValue":n[13]||=e=>S(`on_failure`,String(e)||void 0)},{default:M(()=>[N(B(NI),{value:``},{default:M(()=>[...n[32]||=[j(`Park the task`,-1)]]),_:1}),N(B(NI),{value:`continue`},{default:M(()=>[...n[33]||=[j(`Continue`,-1)]]),_:1})]),_:1},8,[`model-value`])]),G(`label`,LH,[n[35]||=G(`span`,{class:`flex-1 text-[13px]`},`Attempts`,-1),N(B(k),{type:`number`,min:`1`,max:`10`,placeholder:`1`,class:`h-7 w-20 text-right text-[13px]`,"model-value":i.value.retry?.attempts??``,"onUpdate:modelValue":n[14]||=e=>C({attempts:String(e)===``?void 0:Number(String(e))})},null,8,[`model-value`])]),G(`label`,RH,[n[36]||=G(`span`,{class:`flex-1 text-[13px]`},`Retry backoff`,-1),N(B(wh),{"model-value":i.value.retry?.backoff??``,units:[`s`,`m`,`h`],"onUpdate:modelValue":n[15]||=e=>C({backoff:e||void 0})},null,8,[`model-value`])])])])]),G(`footer`,zH,[N(B(X),{type:`button`,variant:`ghost`,size:`sm`,class:`text-danger`,onClick:n[16]||=e=>r(`remove`)},{default:M(()=>[N(B(Bn)),n[38]||=j(`Delete step`,-1)]),_:1}),N(B(X),{type:`button`,size:`sm`,class:`ml-auto`,onClick:n[17]||=e=>r(`close`)},{default:M(()=>[...n[39]||=[j(`Done`,-1)]]),_:1})])]))}}),VH=`repository_path`;function HH(e,t,n){let r=[];for(let[n,i]of e){let e=t[n];e?.from===`path`&&e.path.trim()&&r.push({name:n,path:e.path.trim(),type:i.type??`string`,required:i.required===!0})}return n.trim()&&r.push({name:VH,path:n.trim(),type:`string`,required:!0}),r}function UH(e){return Array.isArray(e)?`array`:e===null?`null`:typeof e==`boolean`?`bool`:typeof e==`object`?`object`:typeof e}function WH(e,t,n){let r=[];for(let[i,a]of e){let e=t[i],o=a.type??`string`;if(!(e&&(e.from===`path`?e.path.trim():e.value!==``))){a.required&&r.push(`${i} is required`);continue}if(e.from===`path`){let e=n?.failures?.find(e=>e.field_name===i);e&&r.push(`${i}: ${e.reason}`);continue}let s=UH(ob(e.value,o));o!==`any`&&s!==o&&r.push(`${i} is ${o}, but ${JSON.stringify(e.value)} is not`)}return n?.failures?.some(e=>e.field_name===`repository_path`)&&r.push(`the repository path does not resolve`),r}function GH(e,t){let n={};for(let[r,i]of e){let e=t[r];e?.from===`path`&&e.path.trim()?n[r]={param:r}:e?.from===`value`&&e.value!==``&&(n[r]={value:ob(e.value,i.type??`string`)})}return n}function KH(e,t){let n=e=>t.find(t=>t.name===e)?.path??``,r={};for(let[t,i]of Object.entries(e.inputs??{}))r[t]=i.param?{from:`path`,path:n(i.param),value:``}:{from:`value`,path:``,value:typeof i.value==`string`?i.value:JSON.stringify(i.value)};return{rows:r,repositoryPath:n(e.repo_param)}}function qH(e,t=``){return Array.isArray(e)?e.slice(0,3).flatMap((e,n)=>{let r=`${t}[${n}]`;return[r,...qH(e,r)]}):e&&typeof e==`object`?Object.entries(e).flatMap(([e,n])=>{let r=t?`${t}.${e}`:e;return[r,...qH(n,r)]}):[]}function JH(e){try{return e?.body?JSON.parse(e.body):null}catch{return null}}function YH(e){try{let t=JSON.parse(e.headers??`{}`);return Object.fromEntries(Object.entries(t).map(([e,t])=>[e,Array.isArray(t)?t.join(`, `):String(t)]))}catch{return{}}}function XH(e){let t=typeof e==`string`?e:JSON.stringify(e);return t.length>80?`${t.slice(0,80)}…`:t}var ZH={class:`flex h-full flex-col`},QH={class:`flex items-center gap-2 border-b border-border px-4 py-3`},$H={class:`min-w-0 flex-1 truncate text-sm font-medium`},eU={key:0,class:`flex flex-1 items-center justify-center`},tU={class:`space-y-1.5`},nU={key:1,class:`space-y-1.5`},rU=[`title`],iU={class:`space-y-1.5`},aU={id:`bind-paths`},oU=[`value`],sU={class:`divide-y divide-border rounded-md border border-border`},cU={class:`flex items-center gap-1.5 text-xs`},lU={class:`font-mono`},uU={class:`text-fg-subtle`},dU={key:0,class:`text-danger`,title:`Required`},fU={key:2,class:`text-xs text-danger`},pU=[`title`],mU={key:0,class:`space-y-1 px-3 py-2`},hU={key:0,class:`text-xs text-danger`},gU={key:1,class:`truncate font-mono text-xs text-success`},_U={key:1,class:`px-3 py-2 text-xs text-fg-subtle`},vU={class:`space-y-2`},yU={key:0,role:`alert`,class:`text-xs text-danger`},bU={key:1,class:`text-xs text-fg-subtle`},xU={class:`flex gap-2`},SU=`__new__`,CU=A({__name:`BindEvent`,props:{yaml:{},binding:{}},emits:[`back`,`saved`],setup(e,{emit:t}){let n=e,r=t,i= Line truncated
`).filter(Boolean))},null,8,[`model-value`,`onUpdate:modelValue`])):(z(),K(U,{key:2},[N(B(iu),{"model-value":de(m.value[e.key]),class:`min-h-24 font-mono text-xs`,placeholder:`YAML`,onChange:t=>ue(e.key,t.target.value)},null,8,[`model-value`,`onChange`]),le.value[e.key]?(z(),K(`span`,MH,H(le.value[e.key]),1)):R(``,!0)],64))]))),128)),G(`section`,NH,[n[37]||=G(`div`,{class:`text-xs font-medium text-muted-foreground`},`Flow`,-1),G(`div`,PH,[G(`label`,FH,[n[31]||=G(`span`,{class:`flex-1 text-[13px]`},`Run only when`,-1),N(B(k),{class:`h-7 w-48 font-mono text-xs`,placeholder:`always`,"model-value":i.value.when??``,"onUpdate:modelValue":n[12]||=e=>S(`when`,String(e))},null,8,[`model-value`])]),G(`label`,IH,[n[34]||=G(`span`,{class:`flex-1 text-[13px]`},`If it fails`,-1),N(B(MI),{size:`sm`,"model-value":i.value.on_failure??``,"onUpdate:modelValue":n[13]||=e=>S(`on_failure`,String(e)||void 0)},{default:M(()=>[N(B(NI),{value:``},{default:M(()=>[...n[32]||=[j(`Park the task`,-1)]]),_:1}),N(B(NI),{value:`continue`},{default:M(()=>[...n[33]||=[j(`Continue`,-1)]]),_:1})]),_:1},8,[`model-value`])]),G(`label`,LH,[n[35]||=G(`span`,{class:`flex-1 text-[13px]`},`Attempts`,-1),N(B(k),{type:`number`,min:`1`,max:`10`,placeholder:`1`,class:`h-7 w-20 text-right text-[13px]`,"model-value":i.value.retry?.attempts??``,"onUpdate:modelValue":n[14]||=e=>C({attempts:String(e)===``?void 0:Number(String(e))})},null,8,[`model-value`])]),G(`label`,RH,[n[36]||=G(`span`,{class:`flex-1 text-[13px]`},`Retry backoff`,-1),N(B(wh),{"model-value":i.value.retry?.backoff??``,units:[`s`,`m`,`h`],"onUpdate:modelValue":n[15]||=e=>C({backoff:e||void 0})},null,8,[`model-value`])])])])]),G(`footer`,zH,[N(B(X),{type:`button`,variant:`ghost`,size:`sm`,class:`text-danger`,onClick:n[16]||=e=>r(`remove`)},{default:M(()=>[N(B(Bn)),n[38]||=j(`Delete step`,-1)]),_:1}),N(B(X),{type:`button`,size:`sm`,class:`ml-auto`,onClick:n[17]||=e=>r(`close`)},{default:M(()=>[...n[39]||=[j(`Done`,-1)]]),_:1})])]))}}),VH=`repository_path`;function HH(e,t,n){let r=[];for(let[n,i]of e){let e=t[n];e?.from===`path`&&e.path.trim()&&r.push({name:n,path:e.path.trim(),type:i.type??`string`,required:i.required===!0})}return n.trim()&&r.push({name:VH,path:n.trim(),type:`string`,required:!0}),r}function UH(e){return Array.isArray(e)?`array`:e===null?`null`:typeof e==`boolean`?`bool`:typeof e==`object`?`object`:typeof e}function WH(e,t,n){let r=[];for(let[i,a]of e){let e=t[i],o=a.type??`string`;if(!(e&&(e.from===`path`?e.path.trim():e.value!==``))){a.required&&r.push(`${i} is required`);continue}if(e.from===`path`){let e=n?.failures?.find(e=>e.field_name===i);e&&r.push(`${i}: ${e.reason}`);continue}let s=UH(ob(e.value,o));o!==`any`&&s!==o&&r.push(`${i} is ${o}, but ${JSON.stringify(e.value)} is not`)}return n?.failures?.some(e=>e.field_name===`repository_path`)&&r.push(`the repository path does not resolve`),r}function GH(e,t){let n={};for(let[r,i]of e){let e=t[r];e?.from===`path`&&e.path.trim()?n[r]={param:r}:e?.from===`value`&&e.value!==``&&(n[r]={value:ob(e.value,i.type??`string`)})}return n}function KH(e,t){let n=e=>t.find(t=>t.name===e)?.path??``,r={};for(let[t,i]of Object.entries(e.inputs??{}))r[t]=i.param?{from:`path`,path:n(i.param),value:``}:{from:`value`,path:``,value:typeof i.value==`string`?i.value:JSON.stringify(i.value)};return{rows:r,repositoryPath:n(e.repo_param)}}function qH(e,t=``){return Array.isArray(e)?e.slice(0,3).flatMap((e,n)=>{let r=`${t}[${n}]`;return[r,...qH(e,r)]}):e&&typeof e==`object`?Object.entries(e).flatMap(([e,n])=>{let r=t?`${t}.${e}`:e;return[r,...qH(n,r)]}):[]}function JH(e){try{return e?.body?JSON.parse(e.body):null}catch{return null}}function YH(e){try{let t=JSON.parse(e.headers??`{}`);return Object.fromEntries(Object.entries(t).map(([e,t])=>[e,Array.isArray(t)?t.join(`, `):String(t)]))}catch{return{}}}function XH(e){let t=typeof e==`string`?e:JSON.stringify(e);return t.length>80?`${t.slice(0,80)}…`:t}var ZH={class:`flex h-full flex-col`},QH={class:`flex items-center gap-2 border-b border-border px-4 py-3`},$H={class:`min-w-0 flex-1 truncate text-sm font-medium`},eU={key:0,class:`flex flex-1 items-center justify-center`},tU={class:`space-y-1.5`},nU={key:1,class:`space-y-1.5`},rU=[`title`],iU={class:`space-y-1.5`},aU={id:`bind-paths`},oU=[`value`],sU={class:`divide-y divide-border rounded-md border border-border`},cU={class:`flex items-center gap-1.5 text-xs`},lU={class:`font-mono`},uU={class:`text-fg-subtle`},dU={key:0,class:`text-danger`,title:`Required`},fU={key:2,class:`text-xs text-danger`},pU=[`title`],mU={key:0,class:`space-y-1 px-3 py-2`},hU={key:0,class:`text-xs text-danger`},gU={key:1,class:`truncate font-mono text-xs text-success`},_U={key:1,class:`px-3 py-2 text-xs text-fg-subtle`},vU={class:`space-y-2`},yU={key:0,role:`alert`,class:`text-xs text-danger`},bU={key:1,class:`text-xs text-fg-subtle`},xU={class:`flex gap-2`},SU=`__new__`,CU=A({__name:`BindEvent`,props:{yaml:{},binding:{}},emits:[`back`,`saved`],setup(e,{emit:t}){let n=e,r=t,i= Line truncated
`).replace(`
`,`
+1 -1
View File
@@ -29,7 +29,7 @@ function started(taskId: number): void {
size="sm"
variant="outline"
:disabled="disabled"
:title="draft !== undefined ? 'Run this draft once without touching the forge' : disabled ? 'Save your changes first' : undefined"
:title="draft !== undefined ? 'Runs this draft once. Forge writes and pushes are skipped, including in called workflows; commands and tools still run' : disabled ? 'Save your changes first' : undefined"
>
<component :is="draft !== undefined ? FlaskConical : Play" data-icon="inline-start" /> {{ draft !== undefined ? "Test" : "Run" }}</Button>
</DialogTrigger>