ripplo 0.3.3 → 0.3.5
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/dist/index.js +119 -108
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var
|
|
3
|
-
`}async function qt({cwd:e}){let t=Mn.join(e,we),n=await Qp(t);return n==null?null:Jd(li,n)}async function me({cwd:e,result:t}){let n=ci(t),r=Mn.join(e,we);await Hn.mkdir(Mn.dirname(r),{recursive:!0}),await Hn.writeFile(r,zn(n),"utf8")}function Ft({compiled:e,existing:t}){if(t==null)return"missing";let n=zn(ci(e)),r=zn(t);return n===r?"match":"stale"}async function Qp(e){try{return await Hn.readFile(e,"utf8")}catch(t){if(Yp(t)&&t.code==="ENOENT")return null;throw t}}function Yp(e){return e instanceof Error&&"code"in e}function Zp(e){return function(n,r){return r===e||!eu(r)?r:Object.fromEntries(Object.entries(r).toSorted(([o],[i])=>o.localeCompare(i)))}}function eu(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Fd,Hd,Md,ii,Kd,Qd,D,St,Yd,Zd,Gn,ep,he,tp,np,x,ni,rp,op,ip,ap,sp,lp,cp,dp,pp,up,mp,fp,yp,gp,hp,kp,Sp,wp,bp,Ap,Rp,Tp,vp,Np,Cp,Lp,xp,Pp,Ep,Op,Ip,_p,Up,jp,$p,Dp,Bp,Vp,Wp,si,qp,Fp,Hp,Mb,Jb,Mp,Jp,we,zp,Xp,Gp,Kp,li,Oe=f(()=>{"use strict";Fd=Wt.object({__codec:Wt.string().min(1),data:Wt.unknown(),version:Wt.number().int().positive()}),Hd=class extends Error{codec;currentVersion;gotVersion;constructor(e){super(`Unsupported ${e.codec} version ${String(e.gotVersion)} (current ${String(e.currentVersion)}). Upgrade Ripplo or rebuild with a compatible CLI.`),this.name="CodecVersionError",this.codec=e.codec,this.currentVersion=e.currentVersion,this.gotVersion=e.gotVersion}},Md=class extends Error{constructor(e){super(`Codec mismatch: expected "${e.expected}", got "${e.got}"`),this.name="CodecMismatchError"}};ii=nt.object({depends:nt.array(nt.string().min(1)).optional().describe("Names of other preconditions that must be satisfied first. Resolved via topological sort; cycles are rejected at validation time."),description:nt.string().min(1).describe("Human-readable description of what this precondition ensures"),returns:nt.array(nt.string().min(1)).optional().describe("Keys that the execute response's data field will contain. e.g. ['projectId', 'workflowId']. These are used for route param interpolation ({{projectId}}) and workflow variables. Declared here so generated types are strongly typed per precondition.")}).describe("A named precondition declared at the graph level. States reference these by name."),Kd=Ee.object({by:Ee.literal("testId"),value:Ee.string().min(1)}),Qd=Ee.object({by:Ee.literal("role"),name:Ee.string().optional(),role:Ee.string().min(1)}),D=Ee.discriminatedUnion("by",[Kd,Qd]),St=ai.enum(["equals","notEquals","contains","startsWith","endsWith","matches"]),Yd=ai.enum(["equals","notEquals","greaterThan","greaterThanOrEqual","lessThan","lessThanOrEqual"]),Zd=z.object({type:z.literal("static"),value:z.union([z.string(),z.number(),z.boolean()])}),Gn=z.object({name:z.string().min(1),type:z.literal("variable")}),ep=z.discriminatedUnion("type",[Zd,Gn]),he=z.discriminatedUnion("type",[z.object({type:z.literal("static"),value:z.string()}),Gn]),tp=z.discriminatedUnion("type",[z.object({type:z.literal("static"),value:z.number().int().nonnegative()}),Gn]),np=se.discriminatedUnion("type",[se.object({default:se.string().optional(),type:se.literal("string")}),se.object({default:se.number().optional(),type:se.literal("number")}),se.object({default:se.boolean().optional(),type:se.literal("boolean")}),se.object({key:se.string().min(1),type:se.literal("env")})]),x={id:y.string().min(1).max(200),label:y.string().max(500).optional(),next:y.string().max(200).optional(),uiOnly:y.boolean().optional()},ni=500,rp=y.object({...x,type:y.literal("goto"),url:he}),op=y.object({...x,locator:D,type:y.literal("click")}),ip=y.object({...x,locator:D,type:y.literal("fill"),value:he}),ap=y.object({...x,locator:D,type:y.literal("select"),value:he}),sp=y.object({...x,locator:D,type:y.literal("hover")}),lp=y.object({...x,key:y.string().min(1),locator:D.optional(),type:y.literal("press")}),cp=y.object({...x,locator:D,type:y.literal("check")}),dp=y.object({...x,locator:D,type:y.literal("uncheck")}),pp=y.object({...x,height:y.number().int().positive(),type:y.literal("setViewport"),width:y.number().int().positive()}),up=y.object({...x,message:y.string().min(1),type:y.literal("fail")}),mp=y.object({...x,type:y.literal("setVariable"),value:ep,variable:y.string().min(1)}),fp=y.object({...x,locator:D,type:y.literal("extractText"),variable:y.string().min(1)}),yp=y.object({...x,files:y.array(y.string()).min(1),locator:D,type:y.literal("upload")}),gp=y.object({...x,locator:D,type:y.literal("dblclick")}),hp=y.object({...x,source:D,target:D,type:y.literal("drag")}),kp=y.object({...x,locator:D,type:y.literal("scrollIntoView")}),Sp=y.object({...x,locator:D,type:y.literal("type"),value:he}),wp=y.object({...x,locator:D,type:y.literal("focus")}),bp=y.object({...x,locator:D,type:y.literal("clear")}),Ap=y.object({...x,locator:D,type:y.literal("rightClick")}),Rp=y.object({...x,action:y.enum(["accept","dismiss"]),promptText:y.string().optional(),type:y.literal("handleDialog")}),Tp=y.object({...x,action:y.enum(["read","write"]),type:y.literal("clipboard"),value:he.optional(),variable:y.string().min(1).optional()}),vp=y.object({...x,permission:y.string().min(1),state:y.enum(["granted","prompt"]),type:y.literal("setPermission")}),Np=y.object({...x,locator:D,type:y.literal("assertVisible")}),Cp=y.object({...x,locator:D,type:y.literal("assertNotVisible")}),Lp=y.object({...x,expected:he,locator:D,operator:St,type:y.literal("assertText")}),xp=y.object({...x,expected:he,operator:St,type:y.literal("assertUrl")}),Pp=y.object({...x,expected:tp,locator:D,operator:Yd,type:y.literal("assertCount")}),Ep=y.object({...x,expected:he,locator:D,operator:St,type:y.literal("assertValue")}),Op=y.object({...x,attribute:y.string().min(1),expected:he,locator:D,operator:St,type:y.literal("assertAttribute")}),Ip=y.object({...x,locator:D,type:y.literal("assertEnabled")}),_p=y.object({...x,locator:D,type:y.literal("assertDisabled")}),Up=y.object({...x,expected:he,operator:St,type:y.literal("assertTitle")}),jp=y.object({...x,locator:D,type:y.literal("assertChecked")}),$p=y.object({...x,locator:D,type:y.literal("assertNotChecked")}),Dp=y.object({...x,locator:D,type:y.literal("assertFocused")}),Bp=y.object({...x,locator:D,type:y.literal("assertNotFocused")}),Vp=y.object({...x,budget:y.enum(["fast","slow","async"]),observer:y.string().min(1).max(200),params:y.record(y.string().max(200),he),type:y.literal("assertObserver")}),Wp=y.discriminatedUnion("type",[rp,op,ip,ap,sp,lp,cp,dp,Np,Cp,Lp,xp,Pp,Ep,Op,Ip,_p,pp,up,mp,fp,yp,gp,hp,kp,Sp,wp,bp,Ap,Rp,Tp,vp,Up,jp,$p,Dp,Bp,Vp]),si=y.object({entryNode:y.string().min(1).max(200),nodes:y.record(y.string().max(200),Wp).refine(e=>Object.keys(e).length<=ni,`Workflow has more than ${String(ni)} nodes`),uiOnly:y.boolean().optional(),variableNamespaces:y.record(y.string().max(200),y.string().max(500)).optional(),variables:y.record(y.string().max(200),np).optional()}),qp=ti.record(ti.string().max(200),ii),Fp={assumedVersion:1,detect:e=>typeof e=="object"&&e!==null&&"entryNode"in e&&"nodes"in e},Hp={assumedVersion:1,detect:e=>typeof e=="object"&&e!==null&&!Array.isArray(e)&&!("__codec"in e)},Mb=Xn("workflow-spec").legacy(Fp).initial(si).build(),Jb=Xn("precondition-map").legacy(Hp).initial(qp).build(),Mp=["fast","slow","async"],Jp=Fn.object({budget:Fn.enum(Mp).describe("Polling budget tier: fast | slow | async"),description:Fn.string().min(1).describe("Human-readable description of what this observer checks")}).describe("A named backend state observer. Tests assert against it with assert.backend(observer, params). Implementation lives on the user's server."),we=".ripplo/ripplo.lock",zp=5e3,Xp=ee.record(ee.string().max(200),ee.string().max(200)),Gp=ee.object({expectedOutcome:ee.string().max(2e3),name:ee.string().max(200),preconditions:ee.array(ee.string().max(200)).max(1e3),requiresKeys:Xp,slug:ee.string().max(200),spec:si}),Kp=ee.object({observers:ee.record(ee.string().max(200),Jp),preconditions:ee.record(ee.string().max(200),ii),tests:ee.array(Gp).max(zp)}),li=Xn("ripplo-lockfile").initial(Kp).build()});function di(e){return e.data}function pi(e){return{as(t){return{data:{label:t,node:e}}}}}var Ht=f(()=>{"use strict"});function Mt(e){let t=e.getPreconditions(),n=e.getObservers(),r=e.getTests();tu(r);let o={};t.forEach(s=>{o[s.name]={depends:[...s.dependsOn],description:s.description,returns:[...s.returns]}});let i={};n.forEach(s=>{i[s.name]={budget:s.budget,description:s.description}});let a=r.map(s=>nu(s,t));return{config:e.getConfig(),observers:i,preconditions:o,tests:a}}function tu(e){let t=new Map;e.forEach(n=>{let r=t.get(n.id);if(r!=null)throw new Error(`Duplicate test id "${n.id}" used by "${r}" and "${n.name}"`);t.set(n.id,n.name)})}function nu(e,t){let n=e.id,{accessedKeys:r,vars:o}=ou(e.requiresKeys),i=e.startsAtFn==null?void 0:e.startsAtFn(o),a=e.stepsFn==null?[]:e.stepsFn(o),s=i==null?a:[ru(i),...a],l=iu(s,r,e.requiresKeys,e.uiOnly),c=[];Object.keys(e.requiresKeys).length>0&&r.size===0&&e.implemented&&c.push("Test requires preconditions but never references their data \u2014 destructure and use precondition data in steps()");let u=su(e.requires,t);return{additionalChecks:[],description:e.description,expectedOutcome:e.expectedOutcome,implemented:e.implemented,name:e.name,preconditions:u,requiresKeys:{...e.requiresKeys},slug:n,spec:l,warnings:c}}function ru(e){return pi({type:"goto",url:{type:"static",value:e}}).as(`navigate to ${e}`)}function ou(e){let t=new Set,n={};return Object.keys(e).forEach(r=>{n[r]=new Proxy({},{get(o,i){if(typeof i=="string"){let a=`${r}.${i}`;return t.add(a),`{{${a}}}`}}})}),{accessedKeys:t,vars:n}}function iu(e,t,n,r){let o={};e.forEach((s,l)=>{let c=`step-${String(l)}`,d=l<e.length-1?`step-${String(l+1)}`:void 0;o[c]=au(s,c,d)});let i={};t.forEach(s=>{i[s]={default:`test-${s}`,type:"string"}});let a={...n};return{entryNode:"step-0",nodes:o,uiOnly:r,variableNamespaces:a,variables:i}}function au(e,t,n){let{label:r,node:o}=di(e);return{...o,id:t,label:r,next:n}}function su(e,t){let n=new Map(t.map(a=>[a.name,a])),r=[],o=new Set;function i(a){o.has(a)||(o.add(a),n.get(a)?.dependsOn.forEach(s=>{i(s)}),r.push(a))}return e.forEach(a=>{i(a)}),r}var Kn=f(()=>{"use strict";Ht()});var ui=f(()=>{"use strict";Kn();Ht()});import lu from"fs";import mi from"path";import{config as cu}from"dotenv";import{createJiti as du}from"jiti";function uu(e){return e==null||typeof e!="object"?!1:pu.every(t=>typeof Reflect.get(e,t)=="function")}function mu(e){return e===null?"null":Array.isArray(e)?"array":typeof e}function fu(e){let t=mi.join(e,".ripplo",".env");lu.existsSync(t)&&cu({override:!0,path:t,quiet:!0})}async function _(e){fu(e);let t=mi.join(e,".ripplo","index.ts");try{let r=await du(import.meta.url,{moduleCache:!1}).import(t),o=r!=null&&typeof r=="object"&&"default"in r?Reflect.get(r,"default"):r;if(!uu(o))return{error:`${t} must default-export a RipploBuilder (got ${mu(o)})`,ok:!1};let i=Mt(o);return{builder:o,ok:!0,result:i}}catch(n){return{error:n instanceof Error?n.message:String(n),ok:!1}}}var pu,Q=f(()=>{"use strict";ui();pu=["getConfig","getObservers","getPreconditions","getTests","getUnimplemented"]});function Yn(e){return typeof e=="function"}function gu(e){return ot(e)?"array":typeof e}function Qn(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function yi(e,t){return e!=null&&typeof e=="object"&&t in e}function hu(e,t){return e!=null&&typeof e!="object"&&e.hasOwnProperty&&e.hasOwnProperty(t)}function Su(e,t){return ku.call(e,t)}function bu(e){return!Su(wu,e)}function Ru(e){return String(e).replace(/[&<>"'`=\/]/g,function(n){return Au[n]})}function Lu(e,t){if(!e)return[];var n=!1,r=[],o=[],i=[],a=!1,s=!1,l="",c=0;function d(){if(a&&!s)for(;i.length;)delete o[i.pop()];else i=[];a=!1,s=!1}var u,p,m;function h(C){if(typeof C=="string"&&(C=C.split(vu,2)),!ot(C)||C.length!==2)throw new Error("Invalid tags: "+C);u=new RegExp(Qn(C[0])+"\\s*"),p=new RegExp("\\s*"+Qn(C[1])),m=new RegExp("\\s*"+Qn("}"+C[1]))}h(t||fe.tags);for(var S=new bt(e),w,k,b,v,L,T;!S.eos();){if(w=S.pos,b=S.scanUntil(u),b)for(var I=0,O=b.length;I<O;++I)v=b.charAt(I),bu(v)?(i.push(o.length),l+=v):(s=!0,n=!0,l+=" "),o.push(["text",v,w,w+1]),w+=1,v===`
|
|
4
|
-
`&&(d(),l="",c=0,n=!1);if(!S.scan(u))break;if(a=!0,k=S.scan(
|
|
2
|
+
var jd=Object.create;var qn=Object.defineProperty;var $d=Object.getOwnPropertyDescriptor;var Dd=Object.getOwnPropertyNames;var Bd=Object.getPrototypeOf,Vd=Object.prototype.hasOwnProperty;var f=(e,t)=>()=>(e&&(t=e(e=0)),t);var Vt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Zo=(e,t)=>{for(var n in t)qn(e,n,{get:t[n],enumerable:!0})},Wd=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Dd(t))!Vd.call(e,o)&&o!==n&&qn(e,o,{get:()=>t[o],enumerable:!(r=$d(t,o))||r.enumerable});return e};var ei=(e,t,n)=>(n=e!=null?jd(Bd(e)):{},Wd(t||!e||!e.__esModule?qn(n,"default",{value:e,enumerable:!0}):n,e));import Hn from"fs/promises";import Mn from"path";import{z as Wt}from"zod";import{z as ti}from"zod";import{z as nt}from"zod";import{z as y}from"zod";import{z as Ee}from"zod";import{z as ai}from"zod";import{z}from"zod";import{z as se}from"zod";import{z as Fn}from"zod";import{z as ee}from"zod";function Xn(e){return ri({legacy:void 0,migrators:[],name:e,schemas:[]})}function Md(e,t){let n=JSON.parse(t);return e.decode(n)}function ri(e){return{initial:t=>Jn(t,{...e,schemas:[t]}),legacy:t=>ri({...e,legacy:t})}}function Jn(e,t){return{build:()=>Jd(e,t),legacy:n=>Jn(e,{...t,legacy:n}),upgrade:(n,r)=>{let o=r;return Jn(n,{...t,migrators:[...t.migrators,o],schemas:[...t.schemas,n]})}}}function Jd(e,t){let n=t.schemas.length;return{currentVersion:n,name:t.name,decode:r=>zd(e,t,r),encode:r=>({__codec:t.name,data:r,version:n})}}function zd(e,t,n){let{data:r,version:o}=Xd(t,n),i=oi(t,r,o);return e.parse(i)}function Xd(e,t){let n=qd.safeParse(t);if(n.success){if(n.data.__codec!==e.name)throw new Hd({expected:e.name,got:n.data.__codec});return{data:n.data.data,version:n.data.version}}if(e.legacy!=null&&e.legacy.detect(t))return{data:t,version:e.legacy.assumedVersion};throw new Error(`Cannot decode "${e.name}": value is not a codec envelope and no legacy detector matched.`)}function oi(e,t,n){let r=e.schemas.length;if(n>r)throw new Fd({codec:e.name,currentVersion:r,gotVersion:n});if(n===r)return t;let o=e.schemas[n-1];if(o==null)throw new Error(`Codec "${e.name}" missing schema for v${String(n)}; cannot migrate.`);let i=o.parse(t),a=e.migrators[n-1];if(a==null)throw new Error(`Codec "${e.name}" missing migrator v${String(n)} \u2192 v${String(n+1)}.`);return oi(e,a(i),n+1)}function ci(e){return{observers:e.observers,preconditions:e.preconditions,tests:e.tests.filter(t=>t.implemented).map(t=>({expectedOutcome:t.expectedOutcome,name:t.name,preconditions:[...t.preconditions],requiresKeys:{...t.requiresKeys},slug:t.slug,spec:t.spec}))}}function zn(e){let t=li.encode(e);return`${JSON.stringify(t,Yp(t),2)}
|
|
3
|
+
`}async function qt({cwd:e}){let t=Mn.join(e,we),n=await Kp(t);return n==null?null:Md(li,n)}async function me({cwd:e,result:t}){let n=ci(t),r=Mn.join(e,we);await Hn.mkdir(Mn.dirname(r),{recursive:!0}),await Hn.writeFile(r,zn(n),"utf8")}function Ft({compiled:e,existing:t}){if(t==null)return"missing";let n=zn(ci(e)),r=zn(t);return n===r?"match":"stale"}async function Kp(e){try{return await Hn.readFile(e,"utf8")}catch(t){if(Qp(t)&&t.code==="ENOENT")return null;throw t}}function Qp(e){return e instanceof Error&&"code"in e}function Yp(e){return function(n,r){return r===e||!Zp(r)?r:Object.fromEntries(Object.entries(r).toSorted(([o],[i])=>o.localeCompare(i)))}}function Zp(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var qd,Fd,Hd,ii,Gd,Kd,D,St,Qd,Yd,Gn,Zd,he,ep,tp,x,ni,np,rp,op,ip,ap,sp,lp,cp,dp,pp,up,mp,fp,yp,gp,hp,kp,Sp,wp,bp,Ap,Rp,Tp,vp,Np,Cp,Lp,xp,Pp,Ep,Op,Ip,_p,Up,jp,$p,Dp,Bp,Vp,si,Wp,qp,Fp,Mb,Jb,Hp,Mp,we,Jp,zp,Xp,Gp,li,Oe=f(()=>{"use strict";qd=Wt.object({__codec:Wt.string().min(1),data:Wt.unknown(),version:Wt.number().int().positive()}),Fd=class extends Error{codec;currentVersion;gotVersion;constructor(e){super(`Unsupported ${e.codec} version ${String(e.gotVersion)} (current ${String(e.currentVersion)}). Upgrade Ripplo or rebuild with a compatible CLI.`),this.name="CodecVersionError",this.codec=e.codec,this.currentVersion=e.currentVersion,this.gotVersion=e.gotVersion}},Hd=class extends Error{constructor(e){super(`Codec mismatch: expected "${e.expected}", got "${e.got}"`),this.name="CodecMismatchError"}};ii=nt.object({depends:nt.array(nt.string().min(1)).optional().describe("Names of other preconditions that must be satisfied first. Resolved via topological sort; cycles are rejected at validation time."),description:nt.string().min(1).describe("Human-readable description of what this precondition ensures"),returns:nt.array(nt.string().min(1)).optional().describe("Keys that the execute response's data field will contain. e.g. ['projectId', 'workflowId']. These are used for route param interpolation ({{projectId}}) and workflow variables. Declared here so generated types are strongly typed per precondition.")}).describe("A named precondition declared at the graph level. States reference these by name."),Gd=Ee.object({by:Ee.literal("testId"),value:Ee.string().min(1)}),Kd=Ee.object({by:Ee.literal("role"),name:Ee.string().optional(),role:Ee.string().min(1)}),D=Ee.discriminatedUnion("by",[Gd,Kd]),St=ai.enum(["equals","notEquals","contains","startsWith","endsWith","matches"]),Qd=ai.enum(["equals","notEquals","greaterThan","greaterThanOrEqual","lessThan","lessThanOrEqual"]),Yd=z.object({type:z.literal("static"),value:z.union([z.string(),z.number(),z.boolean()])}),Gn=z.object({name:z.string().min(1),type:z.literal("variable")}),Zd=z.discriminatedUnion("type",[Yd,Gn]),he=z.discriminatedUnion("type",[z.object({type:z.literal("static"),value:z.string()}),Gn]),ep=z.discriminatedUnion("type",[z.object({type:z.literal("static"),value:z.number().int().nonnegative()}),Gn]),tp=se.discriminatedUnion("type",[se.object({default:se.string().optional(),type:se.literal("string")}),se.object({default:se.number().optional(),type:se.literal("number")}),se.object({default:se.boolean().optional(),type:se.literal("boolean")}),se.object({key:se.string().min(1),type:se.literal("env")})]),x={id:y.string().min(1).max(200),label:y.string().max(500).optional(),next:y.string().max(200).optional(),uiOnly:y.boolean().optional()},ni=500,np=y.object({...x,type:y.literal("goto"),url:he}),rp=y.object({...x,locator:D,type:y.literal("click")}),op=y.object({...x,locator:D,type:y.literal("fill"),value:he}),ip=y.object({...x,locator:D,type:y.literal("select"),value:he}),ap=y.object({...x,locator:D,type:y.literal("hover")}),sp=y.object({...x,key:y.string().min(1),locator:D.optional(),type:y.literal("press")}),lp=y.object({...x,locator:D,type:y.literal("check")}),cp=y.object({...x,locator:D,type:y.literal("uncheck")}),dp=y.object({...x,height:y.number().int().positive(),type:y.literal("setViewport"),width:y.number().int().positive()}),pp=y.object({...x,message:y.string().min(1),type:y.literal("fail")}),up=y.object({...x,type:y.literal("setVariable"),value:Zd,variable:y.string().min(1)}),mp=y.object({...x,locator:D,type:y.literal("extractText"),variable:y.string().min(1)}),fp=y.object({...x,files:y.array(y.string()).min(1),locator:D,type:y.literal("upload")}),yp=y.object({...x,locator:D,type:y.literal("dblclick")}),gp=y.object({...x,source:D,target:D,type:y.literal("drag")}),hp=y.object({...x,locator:D,type:y.literal("scrollIntoView")}),kp=y.object({...x,locator:D,type:y.literal("type"),value:he}),Sp=y.object({...x,locator:D,type:y.literal("focus")}),wp=y.object({...x,locator:D,type:y.literal("clear")}),bp=y.object({...x,locator:D,type:y.literal("rightClick")}),Ap=y.object({...x,action:y.enum(["accept","dismiss"]),promptText:y.string().optional(),type:y.literal("handleDialog")}),Rp=y.object({...x,action:y.enum(["read","write"]),type:y.literal("clipboard"),value:he.optional(),variable:y.string().min(1).optional()}),Tp=y.object({...x,permission:y.string().min(1),state:y.enum(["granted","prompt"]),type:y.literal("setPermission")}),vp=y.object({...x,locator:D,type:y.literal("assertVisible")}),Np=y.object({...x,locator:D,type:y.literal("assertNotVisible")}),Cp=y.object({...x,expected:he,locator:D,operator:St,type:y.literal("assertText")}),Lp=y.object({...x,expected:he,operator:St,type:y.literal("assertUrl")}),xp=y.object({...x,expected:ep,locator:D,operator:Qd,type:y.literal("assertCount")}),Pp=y.object({...x,expected:he,locator:D,operator:St,type:y.literal("assertValue")}),Ep=y.object({...x,attribute:y.string().min(1),expected:he,locator:D,operator:St,type:y.literal("assertAttribute")}),Op=y.object({...x,locator:D,type:y.literal("assertEnabled")}),Ip=y.object({...x,locator:D,type:y.literal("assertDisabled")}),_p=y.object({...x,expected:he,operator:St,type:y.literal("assertTitle")}),Up=y.object({...x,locator:D,type:y.literal("assertChecked")}),jp=y.object({...x,locator:D,type:y.literal("assertNotChecked")}),$p=y.object({...x,locator:D,type:y.literal("assertFocused")}),Dp=y.object({...x,locator:D,type:y.literal("assertNotFocused")}),Bp=y.object({...x,budget:y.enum(["fast","slow","async"]),observer:y.string().min(1).max(200),params:y.record(y.string().max(200),he),type:y.literal("assertObserver")}),Vp=y.discriminatedUnion("type",[np,rp,op,ip,ap,sp,lp,cp,vp,Np,Cp,Lp,xp,Pp,Ep,Op,Ip,dp,pp,up,mp,fp,yp,gp,hp,kp,Sp,wp,bp,Ap,Rp,Tp,_p,Up,jp,$p,Dp,Bp]),si=y.object({entryNode:y.string().min(1).max(200),nodes:y.record(y.string().max(200),Vp).refine(e=>Object.keys(e).length<=ni,`Workflow has more than ${String(ni)} nodes`),uiOnly:y.boolean().optional(),variableNamespaces:y.record(y.string().max(200),y.string().max(500)).optional(),variables:y.record(y.string().max(200),tp).optional()}),Wp=ti.record(ti.string().max(200),ii),qp={assumedVersion:1,detect:e=>typeof e=="object"&&e!==null&&"entryNode"in e&&"nodes"in e},Fp={assumedVersion:1,detect:e=>typeof e=="object"&&e!==null&&!Array.isArray(e)&&!("__codec"in e)},Mb=Xn("workflow-spec").legacy(qp).initial(si).build(),Jb=Xn("precondition-map").legacy(Fp).initial(Wp).build(),Hp=["fast","slow","async"],Mp=Fn.object({budget:Fn.enum(Hp).describe("Polling budget tier: fast | slow | async"),description:Fn.string().min(1).describe("Human-readable description of what this observer checks")}).describe("A named backend state observer. Tests assert against it with assert.backend(observer, params). Implementation lives on the user's server."),we=".ripplo/ripplo.lock",Jp=5e3,zp=ee.record(ee.string().max(200),ee.string().max(200)),Xp=ee.object({expectedOutcome:ee.string().max(2e3),name:ee.string().max(200),preconditions:ee.array(ee.string().max(200)).max(1e3),requiresKeys:zp,slug:ee.string().max(200),spec:si}),Gp=ee.object({observers:ee.record(ee.string().max(200),Mp),preconditions:ee.record(ee.string().max(200),ii),tests:ee.array(Xp).max(Jp)}),li=Xn("ripplo-lockfile").initial(Gp).build()});function di(e){return e.data}function pi(e){return{as(t){return{data:{label:t,node:e}}}}}var Ht=f(()=>{"use strict"});function Mt(e){let t=e.getPreconditions(),n=e.getObservers(),r=e.getTests();eu(r);let o={};t.forEach(s=>{o[s.name]={depends:[...s.dependsOn],description:s.description,returns:[...s.returns]}});let i={};n.forEach(s=>{i[s.name]={budget:s.budget,description:s.description}});let a=r.map(s=>tu(s,t));return{config:e.getConfig(),observers:i,preconditions:o,tests:a}}function eu(e){let t=new Map;e.forEach(n=>{let r=t.get(n.id);if(r!=null)throw new Error(`Duplicate test id "${n.id}" used by "${r}" and "${n.name}"`);t.set(n.id,n.name)})}function tu(e,t){let n=e.id,{accessedKeys:r,vars:o}=ru(e.requiresKeys),i=e.startsAtFn==null?void 0:e.startsAtFn(o),a=e.stepsFn==null?[]:e.stepsFn(o),s=i==null?a:[nu(i),...a],l=ou(s,r,e.requiresKeys,e.uiOnly),c=[];Object.keys(e.requiresKeys).length>0&&r.size===0&&e.implemented&&c.push("Test requires preconditions but never references their data \u2014 destructure and use precondition data in steps()");let u=au(e.requires,t);return{additionalChecks:[],description:e.description,expectedOutcome:e.expectedOutcome,implemented:e.implemented,name:e.name,preconditions:u,requiresKeys:{...e.requiresKeys},slug:n,spec:l,warnings:c}}function nu(e){return pi({type:"goto",url:{type:"static",value:e}}).as(`navigate to ${e}`)}function ru(e){let t=new Set,n={};return Object.keys(e).forEach(r=>{n[r]=new Proxy({},{get(o,i){if(typeof i=="string"){let a=`${r}.${i}`;return t.add(a),`{{${a}}}`}}})}),{accessedKeys:t,vars:n}}function ou(e,t,n,r){let o={};e.forEach((s,l)=>{let c=`step-${String(l)}`,d=l<e.length-1?`step-${String(l+1)}`:void 0;o[c]=iu(s,c,d)});let i={};t.forEach(s=>{i[s]={default:`test-${s}`,type:"string"}});let a={...n};return{entryNode:"step-0",nodes:o,uiOnly:r,variableNamespaces:a,variables:i}}function iu(e,t,n){let{label:r,node:o}=di(e);return{...o,id:t,label:r,next:n}}function au(e,t){let n=new Map(t.map(a=>[a.name,a])),r=[],o=new Set;function i(a){o.has(a)||(o.add(a),n.get(a)?.dependsOn.forEach(s=>{i(s)}),r.push(a))}return e.forEach(a=>{i(a)}),r}var Kn=f(()=>{"use strict";Ht()});var ui=f(()=>{"use strict";Kn();Ht()});import su from"fs";import mi from"path";import{config as lu}from"dotenv";import{createJiti as cu}from"jiti";function pu(e){return e==null||typeof e!="object"?!1:du.every(t=>typeof Reflect.get(e,t)=="function")}function uu(e){return e===null?"null":Array.isArray(e)?"array":typeof e}function mu(e){let t=mi.join(e,".ripplo",".env");su.existsSync(t)&&lu({override:!0,path:t,quiet:!0})}async function _(e){mu(e);let t=mi.join(e,".ripplo","index.ts");try{let r=await cu(import.meta.url,{moduleCache:!1}).import(t),o=r!=null&&typeof r=="object"&&"default"in r?Reflect.get(r,"default"):r;if(!pu(o))return{error:`${t} must default-export a RipploBuilder (got ${uu(o)})`,ok:!1};let i=Mt(o);return{builder:o,ok:!0,result:i}}catch(n){return{error:n instanceof Error?n.message:String(n),ok:!1}}}var du,Q=f(()=>{"use strict";ui();du=["getConfig","getObservers","getPreconditions","getTests","getUnimplemented"]});function Yn(e){return typeof e=="function"}function yu(e){return ot(e)?"array":typeof e}function Qn(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function yi(e,t){return e!=null&&typeof e=="object"&&t in e}function gu(e,t){return e!=null&&typeof e!="object"&&e.hasOwnProperty&&e.hasOwnProperty(t)}function ku(e,t){return hu.call(e,t)}function wu(e){return!ku(Su,e)}function Au(e){return String(e).replace(/[&<>"'`=\/]/g,function(n){return bu[n]})}function Cu(e,t){if(!e)return[];var n=!1,r=[],o=[],i=[],a=!1,s=!1,l="",c=0;function d(){if(a&&!s)for(;i.length;)delete o[i.pop()];else i=[];a=!1,s=!1}var u,p,m;function h(C){if(typeof C=="string"&&(C=C.split(Tu,2)),!ot(C)||C.length!==2)throw new Error("Invalid tags: "+C);u=new RegExp(Qn(C[0])+"\\s*"),p=new RegExp("\\s*"+Qn(C[1])),m=new RegExp("\\s*"+Qn("}"+C[1]))}h(t||fe.tags);for(var S=new bt(e),w,k,b,v,L,T;!S.eos();){if(w=S.pos,b=S.scanUntil(u),b)for(var I=0,O=b.length;I<O;++I)v=b.charAt(I),wu(v)?(i.push(o.length),l+=v):(s=!0,n=!0,l+=" "),o.push(["text",v,w,w+1]),w+=1,v===`
|
|
4
|
+
`&&(d(),l="",c=0,n=!1);if(!S.scan(u))break;if(a=!0,k=S.scan(Nu)||"name",S.scan(Ru),k==="="?(b=S.scanUntil(gi),S.scan(gi),S.scanUntil(p)):k==="{"?(b=S.scanUntil(m),S.scan(vu),S.scanUntil(p),k="&"):b=S.scanUntil(p),!S.scan(p))throw new Error("Unclosed tag at "+S.pos);if(k==">"?L=[k,b,w,S.pos,l,c,n]:L=[k,b,w,S.pos],c++,o.push(L),k==="#"||k==="^")r.push(L);else if(k==="/"){if(T=r.pop(),!T)throw new Error('Unopened section "'+b+'" at '+w);if(T[1]!==b)throw new Error('Unclosed section "'+T[1]+'" at '+w)}else k==="name"||k==="{"||k==="&"?s=!0:k==="="&&h(b)}if(d(),T=r.pop(),T)throw new Error('Unclosed section "'+T[1]+'" at '+S.pos);return xu(Lu(o))}function Lu(e){for(var t=[],n,r,o=0,i=e.length;o<i;++o)n=e[o],n&&(n[0]==="text"&&r&&r[0]==="text"?(r[1]+=n[1],r[3]=n[3]):(t.push(n),r=n));return t}function xu(e){for(var t=[],n=t,r=[],o,i,a=0,s=e.length;a<s;++a)switch(o=e[a],o[0]){case"#":case"^":n.push(o),r.push(o),n=o[4]=[];break;case"/":i=r.pop(),i[5]=o[2],n=r.length>0?r[r.length-1][4]:t;break;default:n.push(o)}return t}function bt(e){this.string=e,this.tail=e,this.pos=0}function rt(e,t){this.view=e,this.cache={".":this.view},this.parent=t}function te(){this.templateCache={_cache:{},set:function(t,n){this._cache[t]=n},get:function(t){return this._cache[t]},clear:function(){this._cache={}}}}var fu,ot,hu,Su,bu,Ru,Tu,gi,vu,Nu,fe,wt,hi,ki=f(()=>{"use strict";fu=Object.prototype.toString,ot=Array.isArray||function(t){return fu.call(t)==="[object Array]"};hu=RegExp.prototype.test;Su=/\S/;bu={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};Ru=/\s*/,Tu=/\s+/,gi=/\s*=/,vu=/\s*\}/,Nu=/#|\^|\/|>|\{|&|=|!/;bt.prototype.eos=function(){return this.tail===""};bt.prototype.scan=function(t){var n=this.tail.match(t);if(!n||n.index!==0)return"";var r=n[0];return this.tail=this.tail.substring(r.length),this.pos+=r.length,r};bt.prototype.scanUntil=function(t){var n=this.tail.search(t),r;switch(n){case-1:r=this.tail,this.tail="";break;case 0:r="";break;default:r=this.tail.substring(0,n),this.tail=this.tail.substring(n)}return this.pos+=r.length,r};rt.prototype.push=function(t){return new rt(t,this)};rt.prototype.lookup=function(t){var n=this.cache,r;if(n.hasOwnProperty(t))r=n[t];else{for(var o=this,i,a,s,l=!1;o;){if(t.indexOf(".")>0)for(i=o.view,a=t.split("."),s=0;i!=null&&s<a.length;)s===a.length-1&&(l=yi(i,a[s])||gu(i,a[s])),i=i[a[s++]];else i=o.view[t],l=yi(o.view,t);if(l){r=i;break}o=o.parent}n[t]=r}return Yn(r)&&(r=r.call(this.view)),r};te.prototype.clearCache=function(){typeof this.templateCache<"u"&&this.templateCache.clear()};te.prototype.parse=function(t,n){var r=this.templateCache,o=t+":"+(n||fe.tags).join(":"),i=typeof r<"u",a=i?r.get(o):void 0;return a==null&&(a=Cu(t,n),i&&r.set(o,a)),a};te.prototype.render=function(t,n,r,o){var i=this.getConfigTags(o),a=this.parse(t,i),s=n instanceof rt?n:new rt(n,void 0);return this.renderTokens(a,s,r,t,o)};te.prototype.renderTokens=function(t,n,r,o,i){for(var a="",s,l,c,d=0,u=t.length;d<u;++d)c=void 0,s=t[d],l=s[0],l==="#"?c=this.renderSection(s,n,r,o,i):l==="^"?c=this.renderInverted(s,n,r,o,i):l===">"?c=this.renderPartial(s,n,r,i):l==="&"?c=this.unescapedValue(s,n):l==="name"?c=this.escapedValue(s,n,i):l==="text"&&(c=this.rawValue(s)),c!==void 0&&(a+=c);return a};te.prototype.renderSection=function(t,n,r,o,i){var a=this,s="",l=n.lookup(t[1]);function c(p){return a.render(p,n,r,i)}if(l){if(ot(l))for(var d=0,u=l.length;d<u;++d)s+=this.renderTokens(t[4],n.push(l[d]),r,o,i);else if(typeof l=="object"||typeof l=="string"||typeof l=="number")s+=this.renderTokens(t[4],n.push(l),r,o,i);else if(Yn(l)){if(typeof o!="string")throw new Error("Cannot use higher-order sections without the original template");l=l.call(n.view,o.slice(t[3],t[5]),c),l!=null&&(s+=l)}else s+=this.renderTokens(t[4],n,r,o,i);return s}};te.prototype.renderInverted=function(t,n,r,o,i){var a=n.lookup(t[1]);if(!a||ot(a)&&a.length===0)return this.renderTokens(t[4],n,r,o,i)};te.prototype.indentPartial=function(t,n,r){for(var o=n.replace(/[^ \t]/g,""),i=t.split(`
|
|
5
5
|
`),a=0;a<i.length;a++)i[a].length&&(a>0||!r)&&(i[a]=o+i[a]);return i.join(`
|
|
6
|
-
`)};te.prototype.renderPartial=function(t,n,r,o){if(r){var i=this.getConfigTags(o),a=Yn(r)?r(t[1]):r[t[1]];if(a!=null){var s=t[6],l=t[5],c=t[4],d=a;l==0&&c&&(d=this.indentPartial(a,c,s));var u=this.parse(d,i);return this.renderTokens(u,n,r,d,o)}}};te.prototype.unescapedValue=function(t,n){var r=n.lookup(t[1]);if(r!=null)return r};te.prototype.escapedValue=function(t,n,r){var o=this.getConfigEscape(r)||fe.escape,i=n.lookup(t[1]);if(i!=null)return typeof i=="number"&&o===fe.escape?String(i):o(i)};te.prototype.rawValue=function(t){return t[1]};te.prototype.getConfigTags=function(t){return ot(t)?t:t&&typeof t=="object"?t.tags:void 0};te.prototype.getConfigEscape=function(t){if(t&&typeof t=="object"&&!ot(t))return t.escape};fe={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(e){wt.templateCache=e},get templateCache(){return wt.templateCache}},wt=new te;fe.clearCache=function(){return wt.clearCache()};fe.parse=function(t,n){return wt.parse(t,n)};fe.render=function(t,n,r,o){if(typeof t!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+
|
|
7
|
-
`):`${e.status}: ${e.title}`;return{specNode:e.specNode,stepResult:o,toolOutput:i}}var j=f(()=>{"use strict";Tt()});import{z as Ni}from"zod";var
|
|
8
|
-
${n.summary}`,verdict:n.verdict};return Promise.resolve(r)}}});import{z as Zi}from"zod";var
|
|
6
|
+
`)};te.prototype.renderPartial=function(t,n,r,o){if(r){var i=this.getConfigTags(o),a=Yn(r)?r(t[1]):r[t[1]];if(a!=null){var s=t[6],l=t[5],c=t[4],d=a;l==0&&c&&(d=this.indentPartial(a,c,s));var u=this.parse(d,i);return this.renderTokens(u,n,r,d,o)}}};te.prototype.unescapedValue=function(t,n){var r=n.lookup(t[1]);if(r!=null)return r};te.prototype.escapedValue=function(t,n,r){var o=this.getConfigEscape(r)||fe.escape,i=n.lookup(t[1]);if(i!=null)return typeof i=="number"&&o===fe.escape?String(i):o(i)};te.prototype.rawValue=function(t){return t[1]};te.prototype.getConfigTags=function(t){return ot(t)?t:t&&typeof t=="object"?t.tags:void 0};te.prototype.getConfigEscape=function(t){if(t&&typeof t=="object"&&!ot(t))return t.escape};fe={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(e){wt.templateCache=e},get templateCache(){return wt.templateCache}},wt=new te;fe.clearCache=function(){return wt.clearCache()};fe.parse=function(t,n){return wt.parse(t,n)};fe.render=function(t,n,r,o){if(typeof t!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+yu(t)+'" was given as the first argument for mustache#render(template, view, partials)');return wt.render(t,n,r,o)};fe.escape=Au;fe.Scanner=bt;fe.Context=rt;fe.Writer=te;hi=fe});function At({defs:e}){return e==null?{}:Object.fromEntries(Object.entries(e).map(([t,n])=>[t,Eu({def:n,name:t})]))}function Eu({def:e,name:t}){if(e.type==="env"){let n=process.env[e.key];if(n==null)throw new Error(`Environment variable "${e.key}" not set for variable "${t}"`);return n}return e.default??Pu[e.type]??""}function Rt({ref:e,variables:t}){if(e.type==="static")return e.value;let n=t[e.name];if(n==null||typeof n=="object")throw new Error(`Variable "${e.name}" is not defined`);return n}function ne({ref:e,variables:t}){let n=String(Rt({ref:e,variables:t}));return Zn({raw:n,variables:t})}function Zn({raw:e,variables:t}){return hi.render(e,t,{},{escape:n=>n})}function er({ref:e,variables:t}){let n=Rt({ref:e,variables:t});if(typeof n=="number")return n;let r=Number(n);if(Number.isNaN(r))throw new TypeError(`Cannot convert "${String(n)}" to number`);return r}function it({name:e,store:t,value:n}){return{...t,[e]:n}}var Pu,Ie=f(()=>{"use strict";ki();Pu={boolean:!1,number:0,string:""}});function F({locator:e,page:t,variables:n}){switch(e.by){case"testId":return t.getByTestId(Si(e.value,n));case"role":return t.getByRole(e.role,{exact:!0,name:e.name==null?void 0:Si(e.name,n)})}}function Si(e,t){return t==null?e:Zn({raw:e,variables:t})}var at=f(()=>{"use strict";Ie()});async function wi({node:e,page:t,timeout:n}){await F({locator:e.source,page:t,variables:void 0}).dragTo(F({locator:e.target,page:t,variables:void 0}),{timeout:n})}async function bi({node:e,page:t,timeout:n}){await F({locator:e.locator,page:t,variables:void 0}).click({button:"right",timeout:n})}function Ai({node:e,page:t,variables:n}){return t.once("dialog",async r=>{e.action==="accept"?await r.accept(e.promptText??void 0):await r.dismiss()}),{variables:n}}async function Ri({node:e,page:t,variables:n}){if(e.action==="write"){if(e.value==null)throw new Error("clipboard write requires a value");let o=ne({ref:e.value,variables:n}),i=JSON.stringify(o);return await t.evaluate(`navigator.clipboard.writeText(${i})`),{variables:n}}if(e.variable==null)throw new Error("clipboard read requires a variable name to store the result");let r=String(await t.evaluate("navigator.clipboard.readText()"));return{variables:it({name:e.variable,store:n,value:r})}}async function Ti({node:e,page:t}){let n=t.context();e.state==="granted"?await n.grantPermissions([e.permission]):await n.clearPermissions()}var vi=f(()=>{"use strict";at();Ie()});async function tr({node:e,page:t,timeout:n,variables:r}){switch(e.type){case"click":case"check":case"uncheck":case"clear":case"dblclick":case"focus":case"hover":case"scrollIntoView":return Iu({node:e,page:t,timeout:n,variables:r});case"rightClick":return await bi({node:e,page:t,timeout:n}),{variables:r};case"goto":{let o=ne({ref:e.url,variables:r});return await t.goto(o,{timeout:n,waitUntil:"domcontentloaded"}),await t.waitForLoadState("load",{timeout:n}),await t.waitForFunction("document.body != null && document.body.childElementCount > 0 && (document.body.textContent?.trim().length ?? 0) > 0",void 0,{timeout:n}),await t.evaluate("new Promise((resolve) => { requestAnimationFrame(() => requestAnimationFrame(() => resolve(undefined))); })"),{variables:r}}case"fill":return Uu({node:e,page:t,timeout:n,variables:r});case"select":return ju({node:e,page:t,timeout:n,variables:r});case"type":return $u({node:e,page:t,timeout:n,variables:r});case"press":return await _u({node:e,page:t,timeout:n}),{variables:r};case"drag":return await wi({node:e,page:t,timeout:n}),{variables:r};case"upload":return Du({node:e,page:t,timeout:n,variables:r});case"extractText":return Bu({node:e,page:t,timeout:n,variables:r});case"setVariable":{let o=Rt({ref:e.value,variables:r});return{variables:it({name:e.variable,store:r,value:o})}}case"fail":throw new Error(e.message);case"setViewport":return await t.setViewportSize({height:e.height,width:e.width}),{variables:r};case"handleDialog":return Ai({node:e,page:t,variables:r});case"clipboard":return Ri({node:e,page:t,variables:r});case"setPermission":return await Ti({node:e,page:t}),{variables:r}}}async function Iu({node:e,page:t,timeout:n,variables:r}){return await F({locator:e.locator,page:t,variables:r})[Ou[e.type]]({timeout:n}),{variables:r}}async function _u({node:e,page:t,timeout:n}){e.locator==null?await t.keyboard.press(e.key):await F({locator:e.locator,page:t,variables:void 0}).press(e.key,{timeout:n})}async function Uu({node:e,page:t,timeout:n,variables:r}){let o=ne({ref:e.value,variables:r});return await F({locator:e.locator,page:t,variables:r}).fill(o,{timeout:n}),{variables:r}}async function ju({node:e,page:t,timeout:n,variables:r}){let o=ne({ref:e.value,variables:r});return await F({locator:e.locator,page:t,variables:r}).selectOption(o,{timeout:n}),{variables:r}}async function $u({node:e,page:t,timeout:n,variables:r}){let o=ne({ref:e.value,variables:r});return await F({locator:e.locator,page:t,variables:r}).pressSequentially(o,{timeout:n}),{variables:r}}async function Du({node:e,page:t,timeout:n,variables:r}){return await F({locator:e.locator,page:t,variables:r}).setInputFiles(e.files,{timeout:n}),{variables:r}}async function Bu({node:e,page:t,timeout:n,variables:r}){let o=await F({locator:e.locator,page:t,variables:r}).textContent({timeout:n});if(o==null)throw new Error("extractText: element had no text content");return{variables:it({name:e.variable,store:r,value:o})}}var Ou,nr=f(()=>{"use strict";vi();at();Ie();Ou={check:"check",clear:"clear",click:"click",dblclick:"dblclick",focus:"focus",hover:"hover",scrollIntoView:"scrollIntoViewIfNeeded",uncheck:"uncheck"}});async function _e({page:e,runStartTime:t,targets:n}){let r=e.viewportSize();if(r==null)throw new Error("Page has no viewport set");let[o,i]=await Promise.all([e.screenshot({type:"png"}),Wu(n)]),a=o.toString("base64");return{annotations:i,screenshotBase64:a,snapshotTimestamp:Math.round(performance.now()-t),url:e.url(),viewportHeight:r.height,viewportWidth:r.width}}function Vu(e){return"locator"in e}async function Wu(e){return(await Promise.all(e.map(n=>qu(n)))).filter(n=>n!=null)}async function qu(e){if(!Vu(e))return{height:0,label:e.label,type:e.type,width:0,x:0,y:0};if(!await e.locator.isVisible().catch(()=>!1))return;let n=await e.locator.boundingBox().catch(()=>null);if(n!=null)return{height:Math.round(n.height),label:e.label,type:e.type,width:Math.round(n.width),x:Math.round(n.x),y:Math.round(n.y)}}function Jt({node:e,page:t}){if(e.type==="assertUrl")return[{label:e.type,type:"urlBar"}];if(e.type==="drag"){let o=F({locator:e.source,page:t,variables:void 0}),i=F({locator:e.target,page:t,variables:void 0});return[{label:"drag-source",locator:o,type:"action"},{label:"drag-target",locator:i,type:"action"}]}if(!Fu(e))return[];let n=e.type.startsWith("assert")?"assertion":"action",r=F({locator:e.locator,page:t,variables:void 0});return[{label:e.type,locator:r,type:n}]}function Fu(e){return"locator"in e&&e.locator!=null}var Tt=f(()=>{"use strict";at()});import{z as Hu}from"zod";function R({description:e,execute:t,name:n,schema:r}){let o=Hu.toJSONSchema(r,{target:"draft-2020-12"});return{anthropicTool:{description:e,input_schema:{...o,type:"object"},name:n},name:n,async execute(i,a){let s=r.parse(a);return{...await Promise.resolve(t(i,s)),kind:"action"}}}}async function N(e){let t=e.specNode==null?[]:Jt({node:e.specNode,page:e.page}),n=await _e({page:e.page,runStartTime:e.runStartTime,targets:t}),r=[...e.assertions],o={annotations:n.annotations,assertions:r,detail:e.detail,duration:Math.round(e.duration),nodeId:`agent-step-${String(e.stepIndex)}`,nodeType:e.nodeType,screenshotBase64:n.screenshotBase64,snapshotTimestamp:n.snapshotTimestamp,status:e.status,stepIndex:e.stepIndex,title:e.title,url:n.url,viewportHeight:n.viewportHeight,viewportWidth:n.viewportWidth},i=r.length>0?r.map(a=>`${a.status}: ${a.description} \u2014 ${a.detail??""}`).join(`
|
|
7
|
+
`):`${e.status}: ${e.title}`;return{specNode:e.specNode,stepResult:o,toolOutput:i}}var j=f(()=>{"use strict";Tt()});import{z as Ni}from"zod";var Mu,Ci,Li=f(()=>{"use strict";j();Mu=Ni.object({selector:Ni.string().describe("CSS selector for the checkbox or radio button")}),Ci=R({description:"Assert that a checkbox or radio button is checked",name:"assert_checked",schema:Mu,execute:async(e,t)=>{let n=performance.now(),r=await e.page.locator(t.selector).isChecked().catch(()=>!1),o=r?"passed":"failed",i=[{description:`Element ${t.selector} is checked`,detail:r?void 0:"Element is not checked",status:o}];return N({assertions:i,detail:r?"Element is checked":"Element is not checked",duration:performance.now()-n,nodeType:"assertChecked",page:e.page,runStartTime:e.runStartTime,specNode:void 0,status:o,stepIndex:e.stepIndex,title:`Assert checked: ${t.selector}`})}})});import{z as xi}from"zod";var Ju,Pi,Ei=f(()=>{"use strict";j();Ju=xi.object({selector:xi.string().describe("CSS selector for the element to check focus on")}),Pi=R({description:"Assert that an element has keyboard focus. Use for accessibility tab-order testing.",name:"assert_focused",schema:Ju,execute:async(e,t)=>{let n=performance.now(),o=!!await e.page.locator(t.selector).evaluate("(el) => document.activeElement === el").catch(()=>!1),i=o?"passed":"failed",a=[{description:`Element ${t.selector} is focused`,detail:o?void 0:"Element does not have focus",status:i}];return N({assertions:a,detail:o?"Element is focused":"Element does not have focus",duration:performance.now()-n,nodeType:"assertFocused",page:e.page,runStartTime:e.runStartTime,specNode:void 0,status:i,stepIndex:e.stepIndex,title:`Assert focused: ${t.selector}`})}})});import{z as rr}from"zod";var zu,Oi,Ii=f(()=>{"use strict";j();zu=rr.object({expected:rr.string().describe("The expected text content"),selector:rr.string().describe("CSS selector for the element to check")}),Oi=R({description:"Assert that an element's text content matches the expected value",name:"assert_text",schema:zu,execute:async(e,t)=>{let n=performance.now(),r=await e.page.locator(t.selector).textContent({timeout:5e3}).catch(()=>null),o=r!=null&&r.includes(t.expected),i=o?"passed":"failed",a=[{description:`Text contains "${t.expected}"`,detail:`Actual: "${r??"(not found)"}"`,status:i}];return N({assertions:a,detail:o?`Text matches: "${t.expected}"`:`Expected "${t.expected}", got "${r??"(not found)"}"`,duration:performance.now()-n,nodeType:"assertText",page:e.page,runStartTime:e.runStartTime,specNode:void 0,status:i,stepIndex:e.stepIndex,title:`Assert text: ${t.selector}`})}})});import{z as or}from"zod";function Gu({actual:e,expected:t,operator:n}){return n==="equals"?e===t:n==="contains"?e.includes(t):n==="startsWith"?e.startsWith(t):n==="endsWith"?e.endsWith(t):!1}var Xu,_i,Ui=f(()=>{"use strict";j();Xu=or.object({expected:or.string().describe("Expected page title or substring"),operator:or.enum(["equals","contains","startsWith","endsWith"]).describe("Comparison operator").default("contains")}),_i=R({description:"Assert that the page title matches an expected value",name:"assert_title",schema:Xu,execute:async(e,t)=>{let n=performance.now(),r=await e.page.title(),o=Gu({actual:r,expected:t.expected,operator:t.operator}),i=o?"passed":"failed",a=[{description:`Title ${t.operator} "${t.expected}"`,detail:o?void 0:`Got: "${r}"`,status:i}],s=`agent-step-${String(e.stepIndex)}`,l={expected:{type:"static",value:t.expected},id:s,operator:t.operator,type:"assertTitle"};return N({assertions:a,detail:o?"Title matches":`Expected title ${t.operator} "${t.expected}", got "${r}"`,duration:performance.now()-n,nodeType:"assertTitle",page:e.page,runStartTime:e.runStartTime,specNode:l,status:i,stepIndex:e.stepIndex,title:`Assert title ${t.operator} "${t.expected}"`})}})});import{z as ji}from"zod";var Ku,$i,Di=f(()=>{"use strict";j();Ku=ji.object({selector:ji.string().describe("CSS selector for the element to check")}),$i=R({description:"Assert that an element matching the selector is visible on the page",name:"assert_visible",schema:Ku,execute:async(e,t)=>{let n=performance.now(),r=await e.page.locator(t.selector).isVisible().catch(()=>!1),o=r?"passed":"failed",i=[{description:`Element ${t.selector} is visible`,detail:r?"Element is visible":"Element is not visible",status:o}];return N({assertions:i,detail:r?"Element is visible":"Element is not visible",duration:performance.now()-n,nodeType:"assertVisible",page:e.page,runStartTime:e.runStartTime,specNode:void 0,status:o,stepIndex:e.stepIndex,title:`Assert visible: ${t.selector}`})}})});import{z as Bi}from"zod";var Qu,Vi,Wi=f(()=>{"use strict";j();Qu=Bi.object({selector:Bi.string().describe("CSS selector for the checkbox to check")}),Vi=R({description:"Check a checkbox matching the CSS selector",name:"check",schema:Qu,execute:async(e,t)=>{let n=performance.now();return await e.page.locator(t.selector).check({timeout:5e3}),N({assertions:[],detail:`Checked ${t.selector}`,duration:performance.now()-n,nodeType:"check",page:e.page,runStartTime:e.runStartTime,specNode:void 0,status:"passed",stepIndex:e.stepIndex,title:`Check ${t.selector}`})}})});import{z as qi}from"zod";var Yu,Fi,Hi=f(()=>{"use strict";j();Yu=qi.object({selector:qi.string().describe("CSS selector for the input to clear")}),Fi=R({description:"Clear the contents of an input field",name:"clear",schema:Yu,execute:async(e,t)=>{let n=performance.now();return await e.page.locator(t.selector).clear({timeout:5e3}),N({assertions:[],detail:`Cleared ${t.selector}`,duration:performance.now()-n,nodeType:"clear",page:e.page,runStartTime:e.runStartTime,specNode:void 0,status:"passed",stepIndex:e.stepIndex,title:`Clear ${t.selector}`})}})});import{z as Mi}from"zod";var Zu,Ji,zi=f(()=>{"use strict";j();Zu=Mi.object({selector:Mi.string().describe("CSS selector for the element to click")}),Ji=R({description:"Click an element matching the CSS selector",name:"click",schema:Zu,execute:async(e,t)=>{let n=performance.now();return await e.page.locator(t.selector).click({timeout:5e3}),N({assertions:[],detail:`Clicked ${t.selector}`,duration:performance.now()-n,nodeType:"click",page:e.page,runStartTime:e.runStartTime,specNode:void 0,status:"passed",stepIndex:e.stepIndex,title:`Click ${t.selector}`})}})});import{z as ir}from"zod";var em,Xi,Gi=f(()=>{"use strict";j();em=ir.object({action:ir.enum(["read","write"]).describe("Whether to read from or write to the clipboard"),value:ir.string().optional().describe("Text to write (required for write action)")}),Xi=R({description:"Read from or write to the browser clipboard. For write, provide the text value. For read, the clipboard contents are returned.",name:"clipboard",schema:em,execute:async(e,t)=>{let n=performance.now(),r=`agent-step-${String(e.stepIndex)}`;if(t.action==="write"){if(t.value==null)throw new Error("clipboard write requires a value");let a=JSON.stringify(t.value);await e.page.evaluate(`navigator.clipboard.writeText(${a})`);let s={action:"write",id:r,type:"clipboard",value:{type:"static",value:t.value}};return N({assertions:[],detail:`Wrote to clipboard: "${t.value}"`,duration:performance.now()-n,nodeType:"clipboard",page:e.page,runStartTime:e.runStartTime,specNode:s,status:"passed",stepIndex:e.stepIndex,title:"Clipboard write"})}let o=String(await e.page.evaluate("navigator.clipboard.readText()")),i={action:"read",id:r,type:"clipboard"};return N({assertions:[],detail:`Clipboard contents: "${o}"`,duration:performance.now()-n,nodeType:"clipboard",page:e.page,runStartTime:e.runStartTime,specNode:i,status:"passed",stepIndex:e.stepIndex,title:"Clipboard read"})}})});import{z as zt}from"zod";var Ki,Qi,Yi=f(()=>{"use strict";Ki=zt.object({summary:zt.string().describe("This is the ONLY output the user sees. If the agent profile specifies an Output format, follow those instructions exactly. Otherwise, provide a summary of your findings."),verdict:zt.enum(["pass","fail"]).describe("Whether the test passed or failed. If the agent profile defines Success Criteria, base this verdict on whether those criteria were met.")}),Qi={anthropicTool:{description:"Call this tool when you have finished your evaluation. If the agent profile defines an Output section, the summary MUST follow those output instructions exactly. Otherwise, summarize your findings.",input_schema:{...zt.toJSONSchema(Ki,{target:"draft-2020-12"}),type:"object"},name:"complete_test"},name:"complete_test",execute(e,t){let n=Ki.parse(t),r={kind:"verdict",summary:n.summary,toolOutput:`Verdict: ${n.verdict}
|
|
8
|
+
${n.summary}`,verdict:n.verdict};return Promise.resolve(r)}}});import{z as Zi}from"zod";var tm,ea,ta=f(()=>{"use strict";j();tm=Zi.object({selector:Zi.string().describe("CSS selector for the element to extract text from")}),ea=R({description:"Extract the text content of an element matching the CSS selector. Returns the text so you can use it in assertions or decisions.",name:"extract_text",schema:tm,execute:async(e,t)=>{let n=performance.now(),o=await e.page.locator(t.selector).textContent({timeout:5e3})??"";return N({assertions:[],detail:`Extracted text: "${o}"`,duration:performance.now()-n,nodeType:"extractText",page:e.page,runStartTime:e.runStartTime,specNode:void 0,status:"passed",stepIndex:e.stepIndex,title:`Extract text from ${t.selector}`})}})});import{z as ar}from"zod";var nm,na,ra=f(()=>{"use strict";j();nm=ar.object({selector:ar.string().describe("CSS selector for the input element"),value:ar.string().describe("The text to type into the element")}),na=R({description:"Clear and type text into an input element matching the CSS selector",name:"fill",schema:nm,execute:async(e,t)=>{let n=performance.now();return await e.page.locator(t.selector).fill(t.value,{timeout:5e3}),N({assertions:[],detail:`Filled ${t.selector} with "${t.value}"`,duration:performance.now()-n,nodeType:"fill",page:e.page,runStartTime:e.runStartTime,specNode:void 0,status:"passed",stepIndex:e.stepIndex,title:`Fill ${t.selector}`})}})});import{z as oa}from"zod";function om(e){let t=e.url.length>0?` (${e.url})`:"";return`[${e.level.toUpperCase()}] ${e.text}${t}`}var rm,ia,aa=f(()=>{"use strict";j();rm=oa.object({level:oa.string().describe("Filter by log level: 'error', 'warning', 'log', 'info', 'debug', or 'all'").default("all")}),ia=R({description:"Get console log messages from the browser. Optionally filter by level (error, warning, log, info, debug, all).",name:"get_console_logs",schema:rm,execute:(e,t)=>{let n=t.level==="all"?e.monitor.consoleEntries:e.monitor.consoleEntries.filter(o=>o.level===t.level);if(n.length===0)return{specNode:void 0,stepResult:void 0,toolOutput:`No console ${t.level==="all"?"messages":t.level+" messages"} recorded.`};let r=n.map(o=>om(o)).join(`
|
|
9
9
|
`);return{specNode:void 0,stepResult:void 0,toolOutput:`${String(n.length)} console messages:
|
|
10
|
-
${r}`}}})});import{z as sa}from"zod";var sr,
|
|
10
|
+
${r}`}}})});import{z as sa}from"zod";var sr,im,la,ca=f(()=>{"use strict";j();sr=50,im=sa.object({urlFilter:sa.string().describe("Optional regex to filter network entries by URL. Omit to see all.").default("")}),la=R({description:"Get a summary of network requests/responses. Shows method, URL, status code, and content type. Optionally filter by URL regex.",name:"get_network_log",schema:im,execute:(e,t)=>{let n=t.urlFilter.length>0?new RegExp(t.urlFilter,"i"):void 0,r=n==null?e.monitor.networkEntries:e.monitor.networkEntries.filter(s=>n.test(s.url));if(r.length===0)return{specNode:void 0,stepResult:void 0,toolOutput:"No network requests recorded."};let o=r.slice(-sr),i=o.map(s=>{let l=s.statusCode==null?"pending":String(s.statusCode),c=s.responseHeaders["content-type"]??"";return`${s.method} ${l} ${s.url} [${c}]`}).join(`
|
|
11
11
|
`),a=r.length>sr?`
|
|
12
12
|
(showing last ${String(sr)} of ${String(r.length)})`:"";return{specNode:void 0,stepResult:void 0,toolOutput:`${String(o.length)} network requests:${a}
|
|
13
|
-
${i}`}}})});import{z as da}from"zod";var
|
|
13
|
+
${i}`}}})});import{z as da}from"zod";var am,pa,ua=f(()=>{"use strict";j();am=da.object({urlPattern:da.string().describe("Regex pattern to match the request URL")}),pa=R({description:"Get the full response body for a specific network request matching the URL pattern. Returns the most recent match.",name:"get_network_response",schema:am,execute:(e,t)=>{let n=new RegExp(t.urlPattern,"i"),r=e.monitor.networkEntries.filter(l=>n.test(l.url));if(r.length===0)return{specNode:void 0,stepResult:void 0,toolOutput:`No network requests matching: ${t.urlPattern}`};let o=r.at(-1);if(o==null)return{specNode:void 0,stepResult:void 0,toolOutput:`No network requests matching: ${t.urlPattern}`};let i=o.statusCode==null?"pending":String(o.statusCode),a=Object.entries(o.responseHeaders).map(([l,c])=>` ${l}: ${c}`).join(`
|
|
14
14
|
`),s=o.responseBody??"(no body captured)";return{specNode:void 0,stepResult:void 0,toolOutput:`${o.method} ${i} ${o.url}
|
|
15
15
|
|
|
16
16
|
Response Headers:
|
|
17
17
|
${a}
|
|
18
18
|
|
|
19
19
|
Body:
|
|
20
|
-
${s}`}}})});import{z as ma}from"zod";var
|
|
20
|
+
${s}`}}})});import{z as ma}from"zod";var sm,fa,ya=f(()=>{"use strict";j();sm=ma.object({selector:ma.string().optional().describe("CSS selector to scope the tree to a subtree (defaults to full page)")}),fa=R({description:"Get the accessibility tree (ARIA snapshot) of the current page or a specific element. Use this to verify ARIA roles, labels, states, and the semantic structure of the page.",name:"get_accessibility_tree",schema:sm,execute:async(e,t)=>{let n=t.selector==null?e.page.locator(":root"):e.page.locator(t.selector);try{return{specNode:void 0,stepResult:void 0,toolOutput:await n.ariaSnapshot()}}catch{return{specNode:void 0,stepResult:void 0,toolOutput:"(unable to capture accessibility tree)"}}}})});import{z as lm}from"zod";var cm,ga,ha=f(()=>{"use strict";j();cm=lm.object({}),ga=R({description:"Get a text representation of the current page content for inspection",name:"get_page_content",schema:cm,execute:async(e,t)=>{let n=await e.page.locator("body").textContent({timeout:5e3}),r=e.page.url(),o=await e.page.title();return{specNode:void 0,stepResult:void 0,toolOutput:`URL: ${r}
|
|
21
21
|
Title: ${o}
|
|
22
22
|
|
|
23
|
-
${n??""}`}}})});import{z as
|
|
23
|
+
${n??""}`}}})});import{z as dm}from"zod";var pm,ka,Sa=f(()=>{"use strict";j();pm=dm.object({}),ka=R({description:"Get uncaught JavaScript exceptions (page errors) that have occurred. These are runtime errors thrown in the browser that were not caught by error handlers.",name:"get_page_errors",schema:pm,execute:(e,t)=>{if(e.monitor.pageErrors.length===0)return{specNode:void 0,stepResult:void 0,toolOutput:"No page errors recorded."};let n=e.monitor.pageErrors.map((r,o)=>`--- Error ${String(o+1)} ---
|
|
24
24
|
${r}`).join(`
|
|
25
25
|
|
|
26
26
|
`);return{specNode:void 0,stepResult:void 0,toolOutput:`${String(e.monitor.pageErrors.length)} page errors:
|
|
27
27
|
|
|
28
|
-
${n}`}}})});import{z as wa}from"zod";async function
|
|
28
|
+
${n}`}}})});import{z as wa}from"zod";async function mm(e){let t=await e.context().cookies();if(t.length===0)return`## Cookies
|
|
29
29
|
(none)`;let n=t.map(r=>` ${r.name}=${r.value} (domain=${r.domain}, httpOnly=${String(r.httpOnly)}, secure=${String(r.secure)}, sameSite=${r.sameSite})`);return`## Cookies (${String(t.length)})
|
|
30
30
|
${n.join(`
|
|
31
31
|
`)}`}async function ba(e,t){let n=await e.evaluate(`JSON.stringify(Object.fromEntries(Object.entries(${t})))`);return`## ${t}
|
|
32
|
-
${String(n)}`}var
|
|
32
|
+
${String(n)}`}var um,Aa,Ra=f(()=>{"use strict";j();um=wa.object({type:wa.enum(["all","cookies","localStorage","sessionStorage"]).describe("Which storage to retrieve").default("all")}),Aa=R({description:"Get browser storage state: cookies (with httpOnly, secure, sameSite flags), localStorage, and/or sessionStorage. Useful for verifying authentication state, security cookie flags, and stored data.",name:"get_storage",schema:um,execute:async(e,t)=>({specNode:void 0,stepResult:void 0,toolOutput:[...t.type==="all"||t.type==="cookies"?[await mm(e.page)]:[],...t.type==="all"||t.type==="localStorage"?[await ba(e.page,"localStorage")]:[],...t.type==="all"||t.type==="sessionStorage"?[await ba(e.page,"sessionStorage")]:[]].join(`
|
|
33
33
|
|
|
34
|
-
`)})})});import{z as lr}from"zod";var
|
|
34
|
+
`)})})});import{z as lr}from"zod";var fm,Ta,va=f(()=>{"use strict";j();fm=lr.object({action:lr.enum(["accept","dismiss"]).describe("Whether to accept or dismiss the dialog"),promptText:lr.string().optional().describe("Text to enter for prompt dialogs")}),Ta=R({description:"Set up a handler for the next browser dialog (alert, confirm, prompt). Call this BEFORE the action that triggers the dialog.",name:"handle_dialog",schema:fm,execute:(e,t)=>{let n=performance.now();e.page.once("dialog",async i=>{t.action==="accept"?await i.accept(t.promptText??void 0):await i.dismiss()});let r=`agent-step-${String(e.stepIndex)}`,o={action:t.action,id:r,type:"handleDialog"};return N({assertions:[],detail:`Dialog handler set: ${t.action}`,duration:performance.now()-n,nodeType:"handleDialog",page:e.page,runStartTime:e.runStartTime,specNode:o,status:"passed",stepIndex:e.stepIndex,title:`Handle dialog: ${t.action}`})}})});import{z as Na}from"zod";var ym,Ca,La=f(()=>{"use strict";j();ym=Na.object({selector:Na.string().describe("CSS selector for the element to hover over")}),Ca=R({description:"Hover over an element matching the CSS selector",name:"hover",schema:ym,execute:async(e,t)=>{let n=performance.now();return await e.page.locator(t.selector).hover({timeout:5e3}),N({assertions:[],detail:`Hovered over ${t.selector}`,duration:performance.now()-n,nodeType:"hover",page:e.page,runStartTime:e.runStartTime,specNode:void 0,status:"passed",stepIndex:e.stepIndex,title:`Hover ${t.selector}`})}})});import{z as cr}from"zod";var gm,xa,Pa=f(()=>{"use strict";j();gm=cr.object({permission:cr.string().describe("Permission name (e.g. geolocation, notifications, camera, clipboard-read)"),state:cr.enum(["granted","prompt"]).describe("Permission state to set")}),xa=R({description:"Set a browser permission state (geolocation, notifications, camera, etc.)",name:"set_permission",schema:gm,execute:async(e,t)=>{let n=performance.now(),r=e.page.context();t.state==="granted"?await r.grantPermissions([t.permission]):await r.clearPermissions();let i={id:`agent-step-${String(e.stepIndex)}`,permission:t.permission,state:t.state,type:"setPermission"};return N({assertions:[],detail:`Set ${t.permission} to ${t.state}`,duration:performance.now()-n,nodeType:"setPermission",page:e.page,runStartTime:e.runStartTime,specNode:i,status:"passed",stepIndex:e.stepIndex,title:`Set permission: ${t.permission} \u2192 ${t.state}`})}})});import{z as Ea}from"zod";var hm,Oa,Ia=f(()=>{"use strict";j();hm=Ea.object({url:Ea.string().describe("The URL to navigate to")}),Oa=R({description:"Navigate the browser to a URL",name:"navigate",schema:hm,execute:async(e,t)=>{let n=performance.now();await e.page.goto(t.url,{waitUntil:"domcontentloaded"});let o={id:`agent-step-${String(e.stepIndex)}`,type:"goto",url:{type:"static",value:t.url}};return N({assertions:[],detail:`Navigated to ${t.url}`,duration:performance.now()-n,nodeType:"goto",page:e.page,runStartTime:e.runStartTime,specNode:o,status:"passed",stepIndex:e.stepIndex,title:`Navigate to ${t.url}`})}})});import{z as _a}from"zod";var km,Ua,ja=f(()=>{"use strict";j();km=_a.object({key:_a.string().describe("Key to press, e.g. 'Enter', 'Tab', 'Escape'")}),Ua=R({description:"Press a keyboard key",name:"press",schema:km,execute:async(e,t)=>{let n=performance.now();await e.page.keyboard.press(t.key);let o={id:`agent-step-${String(e.stepIndex)}`,key:t.key,type:"press"};return N({assertions:[],detail:`Pressed ${t.key}`,duration:performance.now()-n,nodeType:"press",page:e.page,runStartTime:e.runStartTime,specNode:o,status:"passed",stepIndex:e.stepIndex,title:`Press ${t.key}`})}})});import{z as dr}from"zod";var Sm,$a,Da=f(()=>{"use strict";j();Sm=dr.object({height:dr.number().int().positive().describe("Viewport height in pixels"),width:dr.number().int().positive().describe("Viewport width in pixels")}),$a=R({description:"Resize the browser viewport to the specified dimensions. Use this to test responsive layouts at different screen sizes (e.g. mobile: 375x812, tablet: 768x1024, desktop: 1440x900).",name:"resize_viewport",schema:Sm,execute:async(e,t)=>{let n=performance.now();await e.page.setViewportSize({height:t.height,width:t.width});let r=`agent-step-${String(e.stepIndex)}`,o={height:t.height,id:r,type:"setViewport",width:t.width};return N({assertions:[],detail:`Resized viewport to ${String(t.width)}x${String(t.height)}`,duration:performance.now()-n,nodeType:"setViewport",page:e.page,runStartTime:e.runStartTime,specNode:o,status:"passed",stepIndex:e.stepIndex,title:`Resize viewport to ${String(t.width)}x${String(t.height)}`})}})});import{z as Ba}from"zod";var wm,Va,Wa=f(()=>{"use strict";j();wm=Ba.object({selector:Ba.string().describe("CSS selector for the element to right-click")}),Va=R({description:"Right-click an element to open the context menu",name:"right_click",schema:wm,execute:async(e,t)=>{let n=performance.now();return await e.page.locator(t.selector).click({button:"right",timeout:5e3}),N({assertions:[],detail:`Right-clicked ${t.selector}`,duration:performance.now()-n,nodeType:"rightClick",page:e.page,runStartTime:e.runStartTime,specNode:void 0,status:"passed",stepIndex:e.stepIndex,title:`Right-click ${t.selector}`})}})});import{z as qa}from"zod";function Am(e){let t=e.url.length>0?` (${e.url})`:"";return`[${e.level.toUpperCase()}] ${e.text}${t}`}var bm,Fa,Ha=f(()=>{"use strict";j();bm=qa.object({pattern:qa.string().describe("Regex pattern to search console log messages")}),Fa=R({description:"Search console log messages for a regex pattern. Returns matching entries.",name:"search_console",schema:bm,execute:(e,t)=>{let n=new RegExp(t.pattern,"i"),r=e.monitor.consoleEntries.filter(i=>n.test(i.text));if(r.length===0)return{specNode:void 0,stepResult:void 0,toolOutput:`No console messages matching: ${t.pattern}`};let o=r.map(i=>Am(i)).join(`
|
|
35
35
|
`);return{specNode:void 0,stepResult:void 0,toolOutput:`${String(r.length)} matching console messages:
|
|
36
|
-
${o}`}}})});import{z as Ma}from"zod";var
|
|
36
|
+
${o}`}}})});import{z as Ma}from"zod";var Rm,Ja,za=f(()=>{"use strict";j();Rm=Ma.object({pattern:Ma.string().describe("Regex pattern to search across network request URLs and response bodies")}),Ja=R({description:"Search network requests and response bodies for a regex pattern. Useful for finding API calls, tokens, or specific data in responses.",name:"search_network",schema:Rm,execute:(e,t)=>{let n=new RegExp(t.pattern,"i"),r=e.monitor.networkEntries.filter(i=>n.test(i.url)||i.responseBody!=null&&n.test(i.responseBody));if(r.length===0)return{specNode:void 0,stepResult:void 0,toolOutput:`No network entries matching: ${t.pattern}`};let o=r.map(i=>{let a=i.statusCode==null?"pending":String(i.statusCode),s=n.test(i.url)?" [URL match]":"",l=i.responseBody!=null&&n.test(i.responseBody)?" [body match]":"";return`${i.method} ${a} ${i.url}${s}${l}`}).join(`
|
|
37
37
|
`);return{specNode:void 0,stepResult:void 0,toolOutput:`${String(r.length)} matching network entries:
|
|
38
|
-
${o}`}}})});import{z as Xa}from"zod";function
|
|
39
|
-
`);i.push(d)}),i}var vm,Nm,
|
|
40
|
-
`),o=
|
|
38
|
+
${o}`}}})});import{z as Xa}from"zod";function Cm({contextLines:e,lines:t,maxResults:n,pattern:r}){let o=new RegExp(r,"i"),i=[];return t.forEach((a,s)=>{if(i.length>=n||!o.test(a))return;let l=Math.max(0,s-e),c=Math.min(t.length-1,s+e),d=t.slice(l,c+1).map((u,p)=>{let m=l+p+1;return`${l+p===s?">":" "} ${String(m)}: ${u}`}).join(`
|
|
39
|
+
`);i.push(d)}),i}var Tm,vm,Nm,Ga,Ka=f(()=>{"use strict";j();Tm=20,vm=2,Nm=Xa.object({pattern:Xa.string().describe("Regex pattern to search for in the page HTML")}),Ga=R({description:"Search the current page's full HTML/DOM for a regex pattern. Returns matching lines with context. Useful for finding elements, attributes, text content, or hidden data without reading the entire page.",name:"search_page",schema:Nm,execute:async(e,t)=>{let r=(await e.page.content()).split(`
|
|
40
|
+
`),o=Cm({contextLines:vm,lines:r,maxResults:Tm,pattern:t.pattern});return o.length===0?{specNode:void 0,stepResult:void 0,toolOutput:`No matches found for pattern: ${t.pattern}`}:{specNode:void 0,stepResult:void 0,toolOutput:o.join(`
|
|
41
41
|
---
|
|
42
|
-
`)}}})});import{z as pr}from"zod";var
|
|
43
|
-
${u.stack??""}`)}function c(u){let p=u.failure(),m=new Xt(u);m.responseBody=`(request failed: ${p?.errorText??"unknown"})`,n.push(m)}e.on("console",i),e.on("request",a),e.on("response",s),e.on("pageerror",l),e.on("requestfailed",c);function d(){e.off("console",i),e.off("request",a),e.off("response",s),e.off("pageerror",l),e.off("requestfailed",c)}return{consoleEntries:t,detach:d,networkEntries:n,pageErrors:r}}var Xt,ur=f(()=>{"use strict";Xt=class{method;requestHeaders;requestPostData;timestamp;url;responseBody=void 0;responseHeaders={};statusCode=void 0;constructor(t){this.method=t.method(),this.requestHeaders=t.headers(),this.requestPostData=t.postData()??void 0,this.timestamp=Date.now(),this.url=t.url()}applyResponse(t){this.statusCode=t.status(),this.responseHeaders=t.headers(),t.text().then(n=>{this.responseBody=n.length>1e5?`${n.slice(0,1e5)}... (truncated)`:n}).catch(()=>{this.responseBody="(unable to read body)"})}}});async function rs({input:e,monitor:t,name:n,page:r,runStartTime:o,stepIndex:i}){let a=
|
|
44
|
-
`)});import is from"fs";import
|
|
42
|
+
`)}}})});import{z as pr}from"zod";var Lm,Qa,Ya=f(()=>{"use strict";j();Lm=pr.object({selector:pr.string().describe("CSS selector for the select element"),value:pr.string().describe("The option value to select")}),Qa=R({description:"Select an option from a dropdown/select element",name:"select",schema:Lm,execute:async(e,t)=>{let n=performance.now();return await e.page.locator(t.selector).selectOption(t.value,{timeout:5e3}),N({assertions:[],detail:`Selected "${t.value}" in ${t.selector}`,duration:performance.now()-n,nodeType:"select",page:e.page,runStartTime:e.runStartTime,specNode:void 0,status:"passed",stepIndex:e.stepIndex,title:`Select ${t.value}`})}})});import{z as Za}from"zod";var xm,es,ts=f(()=>{"use strict";j();xm=Za.object({selector:Za.string().describe("CSS selector for the checkbox to uncheck")}),es=R({description:"Uncheck a checkbox matching the CSS selector",name:"uncheck",schema:xm,execute:async(e,t)=>{let n=performance.now();return await e.page.locator(t.selector).uncheck({timeout:5e3}),N({assertions:[],detail:`Unchecked ${t.selector}`,duration:performance.now()-n,nodeType:"uncheck",page:e.page,runStartTime:e.runStartTime,specNode:void 0,status:"passed",stepIndex:e.stepIndex,title:`Uncheck ${t.selector}`})}})});function vt(e){let t=[],n=[],r=[],o=new Map;function i(u){t.push({level:u.type(),text:u.text(),timestamp:Date.now(),url:u.location().url})}function a(u){let p=new Xt(u);o.set(u,p),n.push(p)}function s(u){let p=o.get(u.request());p!=null&&(o.delete(u.request()),p.applyResponse(u))}function l(u){r.push(`${u.message}
|
|
43
|
+
${u.stack??""}`)}function c(u){let p=u.failure(),m=new Xt(u);m.responseBody=`(request failed: ${p?.errorText??"unknown"})`,n.push(m)}e.on("console",i),e.on("request",a),e.on("response",s),e.on("pageerror",l),e.on("requestfailed",c);function d(){e.off("console",i),e.off("request",a),e.off("response",s),e.off("pageerror",l),e.off("requestfailed",c)}return{consoleEntries:t,detach:d,networkEntries:n,pageErrors:r}}var Xt,ur=f(()=>{"use strict";Xt=class{method;requestHeaders;requestPostData;timestamp;url;responseBody=void 0;responseHeaders={};statusCode=void 0;constructor(t){this.method=t.method(),this.requestHeaders=t.headers(),this.requestPostData=t.postData()??void 0,this.timestamp=Date.now(),this.url=t.url()}applyResponse(t){this.statusCode=t.status(),this.responseHeaders=t.headers(),t.text().then(n=>{this.responseBody=n.length>1e5?`${n.slice(0,1e5)}... (truncated)`:n}).catch(()=>{this.responseBody="(unable to read body)"})}}});async function rs({input:e,monitor:t,name:n,page:r,runStartTime:o,stepIndex:i}){let a=Pm.get(n);if(a==null)throw new Error(`Unknown agent tool: ${n}`);return a.execute({monitor:t,page:r,runStartTime:o,stepIndex:i},e)}var mr,Pm,fr,ns,os=f(()=>{"use strict";Li();Ei();Ii();Ui();Di();Wi();Hi();zi();Gi();Yi();ta();ra();aa();ca();ua();ya();ha();Sa();Ra();va();La();Pa();Ia();ja();Da();Wa();Ha();za();Ka();Ya();ts();ur();mr=[Oa,Ji,na,Ua,Vi,es,Qa,Ca,ga,Ga,Fi,Va,Ta,Xi,xa,$i,Oi,_i,Ci,Pi,ia,la,pa,ka,fa,Aa,Fa,Ja,$a,ea,Qi],Pm=new Map(mr.map(e=>[e.name,e])),fr=mr.map(e=>e.anthropicTool),ns=mr.map(e=>`- **${e.name}**: ${e.anthropicTool.description??""}`).join(`
|
|
44
|
+
`)});import is from"fs";import Em from"path";import yr from"pino";function gr({filePath:e}){let t=Em.dirname(e);is.mkdirSync(t,{recursive:!0}),is.writeFileSync(e,"");let n=yr.destination({dest:e,sync:!0}),r=yr({level:"info"},n);A.info=r.info.bind(r),A.warn=r.warn.bind(r),A.error=r.error.bind(r),A.debug=r.debug.bind(r),A.fatal=r.fatal.bind(r),A.trace=r.trace.bind(r)}var A,Y=f(()=>{"use strict";A=yr({transport:{options:{ignore:"pid,hostname"},target:"pino-pretty"}})});import Om from"@anthropic-ai/sdk";async function hr({baseUrl:e,executedPreconditions:t,extraVariables:n,onStep:r,page:o,runId:i,serverUrl:a,spec:s,systemPrompt:l,token:c,workflowContext:d}){let u=new Om({apiKey:"ripplo",baseURL:`${a}/api/proxy/anthropic`,defaultHeaders:{Authorization:`Bearer ${c}`,"x-run-id":i}}),p=performance.now(),m=vt(o);await Wm({baseUrl:e,page:o});let h=jm({extraVariables:n,spec:s}),S=Dm({baseUrl:e,executedPreconditions:t,spec:s,systemPrompt:l,variables:h,workflowContext:d}),w=Bm({baseUrl:e,spec:s,variables:h}),b=[{content:Vm({page:o,startUrl:w}),role:"user"}],v=[],L=[],T={findings:"",stepIndex:0,verdict:void 0};T=await _m({client:u,messages:b,monitor:m,onStep:r,page:o,runStartTime:p,specNodes:L,state:T,steps:v,system:S}),T.verdict==null&&(T=await Um({client:u,messages:b,monitor:m,onStep:r,page:o,runStartTime:p,specNodes:L,state:T,steps:v,system:S}));let I=Fm(L);return{findings:T.findings,generatedSpec:I,monitor:m,steps:v,verdict:T.verdict??"fail"}}function ss({result:e,state:t}){return{findings:e.newFindings.length>0?e.newFindings:t.findings,stepIndex:e.nextStepIndex,verdict:e.verdict??t.verdict}}async function _m({client:e,messages:t,monitor:n,onStep:r,page:o,runStartTime:i,specNodes:a,state:s,steps:l,system:c}){let d=s;for(let u=0;u<Im;u++){A.info("Agent iteration %d",u+1);let p=await e.messages.create({max_tokens:as,messages:t,model:"server-controlled",system:c,tools:fr}),m=await ls({messages:t,monitor:n,onStep:r,page:o,response:p,runStartTime:i,specNodes:a,stepIndex:d.stepIndex,steps:l});if(d=ss({result:m,state:d}),!m.continueLoop)break}return d}async function Um({client:e,messages:t,monitor:n,onStep:r,page:o,runStartTime:i,specNodes:a,state:s,steps:l,system:c}){A.warn("Agent exited without calling complete_test \u2014 forcing completion"),t.push({content:"You must call the complete_test tool now with your verdict and summary. Do not perform any more actions \u2014 just call complete_test.",role:"user"});let d=await e.messages.create({max_tokens:as,messages:t,model:"server-controlled",system:c,tool_choice:{name:"complete_test",type:"tool"},tools:fr}),u=await ls({messages:t,monitor:n,onStep:r,page:o,response:d,runStartTime:i,specNodes:a,stepIndex:s.stepIndex,steps:l});return ss({result:u,state:s})}function jm({extraVariables:e,spec:t}){let n=$m(e,t?.variableNamespaces);return{...At({defs:t?.variables}),...n}}function $m(e,t){if(e==null||t==null)return{};let n=new Map;Object.entries(t).forEach(([o,i])=>{n.set(i,o)});let r={};return Object.entries(e).forEach(([o,i])=>{let a=n.get(o);Object.entries(i).forEach(([s,l])=>{r[a==null?s:`${a}.${s}`]=l})}),r}function Dm({baseUrl:e,executedPreconditions:t,spec:n,systemPrompt:r,variables:o,workflowContext:i}){let a=i==null?"":[`
|
|
45
45
|
|
|
46
46
|
## Workflow Under Test`,`**Name:** ${i.name}`,`**Description:** ${i.description}`,`**Expected Outcome:** ${i.expectedOutcome}`,`
|
|
47
47
|
Focus your testing ONLY on this specific workflow. Do not test unrelated parts of the application.`].join(`
|
|
@@ -64,52 +64,52 @@ Do not repeat any of these steps.`,d=Object.entries(o),u=d.map(([m,h])=>`- **${m
|
|
|
64
64
|
${u}`;return[`You are testing the application at: ${e}`,"Use the provided tools to navigate, interact with, and assert things about the page.","Use get_page_content to inspect the page when you need to understand what's on screen.","Follow the workflow steps to complete the task.",`
|
|
65
65
|
## Available Tools`,ns,a,c,s,p,`
|
|
66
66
|
## Agent Profile (HIGHEST PRIORITY \u2014 these instructions override any defaults above)`,r].join(`
|
|
67
|
-
`)}function
|
|
68
|
-
`),nextStepIndex:s,verdict:void 0};let u=[],p=s,m,h;for(let w of d){let k=await
|
|
69
|
-
`);return{continueLoop:m==null&&o.stop_reason==="tool_use",newFindings:S,nextStepIndex:p,verdict:m}}async function
|
|
67
|
+
`)}function Bm({baseUrl:e,spec:t,variables:n}){if(t==null)return e;let r=t.nodes[t.entryNode];if(r==null||r.type!=="goto"||r.url.type!=="static")return e;let i=r.url.value.replaceAll(/\{\{(\w+)\}\}/g,(a,s)=>{let l=n[s];return l==null?`{{${s}}}`:typeof l=="object"?JSON.stringify(l):String(l)});return i.startsWith("http")?i:`${e}${i.startsWith("/")?"":"/"}${i}`}function Vm({page:e,startUrl:t}){let n=e.url();return n!=="about:blank"&&n.length>0?`You are already on the page at ${n}. Begin testing from this page \u2014 do not navigate away unless the workflow requires it.`:`Navigate to ${t} and begin testing.`}async function Wm({baseUrl:e,page:t}){let n=new URL(e).origin;await t.route("**/*",r=>{let o=r.request();return o.isNavigationRequest()&&new URL(o.url()).origin!==n?(A.warn("Blocked navigation to off-origin URL: %s",o.url()),r.abort("blockedbyclient")):r.continue()})}async function ls({messages:e,monitor:t,onStep:n,page:r,response:o,runStartTime:i,specNodes:a,stepIndex:s,steps:l}){let c=o.content.filter(w=>w.type==="text").map(w=>w.text),d=o.content.filter(w=>w.type==="tool_use");if(d.length===0)return{continueLoop:!1,newFindings:c.join(`
|
|
68
|
+
`),nextStepIndex:s,verdict:void 0};let u=[],p=s,m,h;for(let w of d){let k=await qm({block:w,monitor:t,onStep:n,page:r,runStartTime:i,specNodes:a,stepIndex:p,steps:l});u.push(k.toolResult),p=k.nextStepIndex,k.verdict!=null&&(m=k.verdict,h=k.summary)}e.push({content:o.content,role:"assistant"},{content:u,role:"user"});let S=h??c.join(`
|
|
69
|
+
`);return{continueLoop:m==null&&o.stop_reason==="tool_use",newFindings:S,nextStepIndex:p,verdict:m}}async function qm({block:e,monitor:t,onStep:n,page:r,runStartTime:o,specNodes:i,stepIndex:a,steps:s}){try{let l=await rs({input:e.input,monitor:t,name:e.name,page:r,runStartTime:o,stepIndex:a}),c={content:l.toolOutput,tool_use_id:e.id,type:"tool_result"};return l.kind==="verdict"?(A.info(" [%d] %s \u2014 verdict: %s",a,e.name,l.verdict),{nextStepIndex:a,summary:l.summary,toolResult:c,verdict:l.verdict}):(l.specNode!=null&&i.push(l.specNode),l.stepResult!=null?(s.push(l.stepResult),n?.(l.stepResult),A.info(" [%d] %s \u2014 %s",a,e.name,l.stepResult.status),{nextStepIndex:a+1,summary:void 0,toolResult:c,verdict:void 0}):(A.info(" [%d] %s \u2014 info",a,e.name),{nextStepIndex:a,summary:void 0,toolResult:c,verdict:void 0}))}catch(l){let c=l instanceof Error?l.message:"Unknown error";A.error(" [%d] %s \u2014 error: %s",a,e.name,c);let d=await _e({page:r,runStartTime:o,targets:[]}),u={annotations:d.annotations,assertions:[],detail:`Error: ${c}`,duration:0,nodeId:`agent-step-${String(a)}`,nodeType:"click",screenshotBase64:d.screenshotBase64,snapshotTimestamp:d.snapshotTimestamp,status:"failed",stepIndex:a,title:`${e.name} (error)`,url:d.url,viewportHeight:d.viewportHeight,viewportWidth:d.viewportWidth};return s.push(u),n?.(u),{nextStepIndex:a+1,summary:void 0,toolResult:{content:`Error: ${c}`,is_error:!0,tool_use_id:e.id,type:"tool_result"},verdict:void 0}}}function Fm(e){if(e.length===0)return{entryNode:"",nodes:{}};let t={};e.forEach((r,o)=>{let i=e[o+1],a=i==null?r:{...r,next:i.id};t[r.id]=a});let n=e[0];if(n==null)throw new Error("Expected at least one spec node after length check");return{entryNode:n.id,nodes:t}}var Im,as,kr=f(()=>{"use strict";os();Y();Tt();Ie();Im=50,as=16384});function Sr({description:e,output:t,successCriteria:n}){let r=[`## Agent Identity
|
|
70
70
|
${e}`];t!=null&&t.length>0&&r.push(`## Output
|
|
71
71
|
${t}`),n!=null&&n.length>0&&r.push(`## Success Criteria
|
|
72
|
-
${n}`);let o=["## Completing Your Evaluation",'When you finish your evaluation, you MUST call the `complete_test` tool with your verdict ("pass" or "fail") and a `summary` string.',
|
|
72
|
+
${n}`);let o=["## Completing Your Evaluation",'When you finish your evaluation, you MUST call the `complete_test` tool with your verdict ("pass" or "fail") and a `summary` string.',Hm({hasSuccessCriteria:n!=null&&n.length>0}),Mm({hasOutput:t!=null&&t.length>0})];return r.push(o.join(`
|
|
73
73
|
`)),r.join(`
|
|
74
74
|
|
|
75
|
-
`)}function
|
|
75
|
+
`)}function Hm({hasSuccessCriteria:e}){return e?"Base your verdict strictly on the Success Criteria defined above. A test passes ONLY if all success criteria are met, and fails if any criterion is not met. Individual step failures during exploration do not necessarily mean the test failed, but the success criteria are the ultimate authority for your verdict.":"Base your verdict on whether the workflow worked correctly. Individual step failures during exploration do not necessarily mean the test failed."}function Mm({hasOutput:e}){return e?'The `summary` parameter is the ONLY output the user will see. You MUST use the `summary` field for EXACTLY the output described in the "Output" section above \u2014 nothing else. Do not describe what you did, do not list steps, do not add a test summary. The `summary` must contain ONLY what the Output section asks for, word for word if it specifies exact text.':"Include a brief summary of what you found in the `summary` parameter."}var wr=f(()=>{"use strict"});import{execFile as Jm}from"child_process";import{createRequire as zm}from"module";import cs from"fs";import ds from"path";import{chromium as ps}from"playwright";async function Ue({headed:e}){try{return await ps.launch({headless:!e})}catch(t){throw Xm(t)?new Error(`Playwright browsers are not installed. Run:
|
|
76
76
|
|
|
77
77
|
npx playwright install chromium
|
|
78
|
-
`):t}}async function br(){let e=ps.executablePath();if(cs.existsSync(e))return;A.info("Chromium not found. Installing via Playwright...");let t=
|
|
78
|
+
`):t}}async function br(){let e=ps.executablePath();if(cs.existsSync(e))return;A.info("Chromium not found. Installing via Playwright...");let t=zm(import.meta.url),n=ds.dirname(t.resolve("playwright/package.json")),r=ds.join(n,"cli.js");if(await new Promise((o,i)=>{Jm(process.execPath,[r,"install","chromium"],a=>{if(a!=null){i(new Error(`Playwright install failed: ${a.message}`));return}o()})}),!cs.existsSync(e))throw new Error(`Playwright browser installation failed. Try running manually:
|
|
79
79
|
|
|
80
80
|
npx playwright install chromium
|
|
81
|
-
`);A.info("\u2713 Chromium installed")}function
|
|
81
|
+
`);A.info("\u2713 Chromium installed")}function Xm(e){return e instanceof Error?e.message.includes("Executable doesn't exist"):!1}var Nt=f(()=>{"use strict";Y()});import{mkdir as Ar,writeFile as ke}from"fs/promises";import re from"path";async function Gt({context:e,page:t,runId:n,stepIndex:r,stepResult:o}){try{let i=re.join(process.cwd(),".ripplo","debug",n,"steps",String(r));await Ar(i,{recursive:!0});let a={annotations:o.annotations,assertions:o.assertions,detail:o.detail,duration:o.duration,nodeId:o.nodeId,nodeType:o.nodeType,snapshotTimestamp:o.snapshotTimestamp,status:o.status,stepIndex:o.stepIndex,title:o.title,url:o.url,viewportHeight:o.viewportHeight,viewportWidth:o.viewportWidth};await Promise.all([ke(re.join(i,"info.json"),JSON.stringify(a,null,2)),ke(re.join(i,"screenshot.png"),Buffer.from(o.screenshotBase64,"base64")),Gm({context:e,page:t,stepDir:i})])}catch(i){let a=i instanceof Error?i.message:String(i);A.warn("Failed to write step debug data for step %d: %s",r,a)}}async function Gm({context:e,page:t,stepDir:n}){let[r,o,i]=await Promise.all([t.content().catch(()=>"(unable to capture DOM)"),Km(t),Qm({context:e,page:t})]);await Promise.all([ke(re.join(n,"dom.html"),r),ke(re.join(n,"accessibility-tree.txt"),o),ke(re.join(n,"storage.json"),JSON.stringify(i,null,2))])}async function Km(e){try{return await e.locator(":root").ariaSnapshot()}catch{return"(unable to capture accessibility tree)"}}async function Qm({context:e,page:t}){let[n,r]=await Promise.all([t.evaluate(()=>({localStorage:Object.fromEntries(Array.from({length:localStorage.length},(o,i)=>{let a=localStorage.key(i);return a==null?void 0:[a,localStorage.getItem(a)??""]}).filter(o=>o!=null)),sessionStorage:Object.fromEntries(Array.from({length:sessionStorage.length},(o,i)=>{let a=sessionStorage.key(i);return a==null?void 0:[a,sessionStorage.getItem(a)??""]}).filter(o=>o!=null))})).catch(()=>({localStorage:{},sessionStorage:{}})),e.cookies().catch(()=>[])]);return{cookies:r,localStorage:n.localStorage,sessionStorage:n.sessionStorage}}async function Kt({monitor:e,runId:t,steps:n,summary:r}){try{let o=re.join(process.cwd(),".ripplo","debug",t);await Ar(o,{recursive:!0}),await Promise.all([ke(re.join(o,"summary.txt"),Ym({steps:n,summary:r})),ke(re.join(o,"console.log"),Zm(e.consoleEntries)),ke(re.join(o,"network.jsonl"),ef(e.networkEntries)),ke(re.join(o,"page-errors.log"),e.pageErrors.join(`
|
|
82
82
|
---
|
|
83
|
-
`))]),A.info("Debug artifacts written to .ripplo/debug/%s/",t)}catch(o){let i=o instanceof Error?o.message:String(o);A.warn("Failed to write run debug summary: %s",i)}}function
|
|
84
|
-
`)}function
|
|
85
|
-
`)}function
|
|
83
|
+
`))]),A.info("Debug artifacts written to .ripplo/debug/%s/",t)}catch(o){let i=o instanceof Error?o.message:String(o);A.warn("Failed to write run debug summary: %s",i)}}function Ym({steps:e,summary:t}){return[`Run ID: ${t.runId}`,`Workflow: ${t.workflowName}`,`Status: ${t.status}`,`Duration: ${String(t.duration)}ms`,`Passed: ${String(t.passCount)}`,`Failed: ${String(t.failCount)}`,"","Steps:",...e.map(r=>` [${String(r.stepIndex)}] ${r.status==="passed"?"\u2713":"\u2717"} ${r.title} (${String(r.duration)}ms) \u2014 ${r.detail??"ok"}`)].join(`
|
|
84
|
+
`)}function Zm(e){return e.map(t=>`[${new Date(t.timestamp).toISOString()}] [${t.level.toUpperCase()}] (${t.url}) ${t.text}`).join(`
|
|
85
|
+
`)}function ef(e){return e.map(t=>JSON.stringify(t)).join(`
|
|
86
86
|
`)}async function us({error:e,runId:t,stack:n,workflowName:r}){try{let o=re.join(process.cwd(),".ripplo","debug",t);await Ar(o,{recursive:!0});let i=n==null?e:`${e}
|
|
87
87
|
|
|
88
88
|
${n}`,a=[`Run ID: ${t}`,`Workflow: ${r}`,"Status: failed","",`Error: ${e}`,"",n==null?"":`Stack trace:
|
|
89
89
|
${n}`].join(`
|
|
90
90
|
`);await Promise.all([ke(re.join(o,"error.txt"),i),ke(re.join(o,"summary.txt"),a)]),A.info("Debug error artifacts written to .ripplo/debug/%s/",t)}catch(o){let i=o instanceof Error?o.message:String(o);A.warn("Failed to write error debug artifacts: %s",i)}}var Qt=f(()=>{"use strict";Y()});async function Rr({baseUrl:e,cookies:t,executedPreconditions:n,extraVariables:r,headed:o,runId:i,serverUrl:a,spec:s,streaming:l,systemPrompt:c,token:d,workflowContext:u}){let p=await Ue({headed:o}),m=await p.newContext({baseURL:e});t.length>0&&(await m.addCookies([...t]),A.info("Injected %d cookies from preconditions",t.length));let h=await m.newPage();try{let w=function(I){l.enqueueStep(I),l.flushSteps(),Gt({context:m,page:h,runId:i,stepIndex:I.stepIndex,stepResult:I})};var S=w;let k=await hr({baseUrl:e,executedPreconditions:n,extraVariables:r,onStep:w,page:h,runId:i,serverUrl:a,spec:s,systemPrompt:c,token:d,workflowContext:u}),b=k.verdict==="pass"?"passed":"failed";await l.complete({statusOverride:b,steps:k.steps,summary:k.findings});let v=k.steps.filter(I=>I.status==="passed").length,L=k.steps.filter(I=>I.status==="failed").length,T={duration:k.steps.reduce((I,O)=>I+O.duration,0),failCount:L,passCount:v,runId:i,status:b,workflowName:u.name};await Kt({monitor:k.monitor,runId:i,steps:k.steps,summary:T}),A.info("Agent test complete: %d passed, %d failed",v,L),A.info(`
|
|
91
91
|
=== Agent Summary ===
|
|
92
|
-
%s`,k.findings)}finally{await p.close()}}var Tr=f(()=>{"use strict";Nt();kr();Qt();Y()});async function vr({expected:e,locator:t,operator:n,timeout:r}){let o=await t.textContent({timeout:r});return Ct({actual:o??"",expected:e,label:"Text",operator:n})}function Yt({expected:e,operator:t,url:n}){return Ct({actual:n,expected:e,label:"URL",operator:t})}async function Nr({expected:e,locator:t,operator:n}){let r=await t.count();return ws({actual:r,expected:e,label:"Count",operator:n})}async function Cr({expected:e,locator:t,operator:n,timeout:r}){let o=await t.inputValue({timeout:r});return Ct({actual:o,expected:e,label:"Value",operator:n})}async function Lr({locator:e,timeout:t}){try{return await e.waitFor({state:"visible",timeout:t}),{description:"Element is visible",detail:void 0,status:"passed"}}catch{return{description:"Element is visible",detail:"Element not visible",status:"failed"}}}async function xr({locator:e,timeout:t}){try{return await e.waitFor({state:"hidden",timeout:t}),{description:"Element is not visible",detail:void 0,status:"passed"}}catch{return{description:"Element is not visible",detail:"Element still visible",status:"failed"}}}async function ms({attribute:e,expected:t,locator:n,operator:r,timeout:o}){let i=await n.getAttribute(e,{timeout:o});return Ct({actual:i??"",expected:t,label:`Attribute "${e}"`,operator:r})}async function fs({locator:e,timeout:t}){try{return await e.waitFor({state:"visible",timeout:t}),await e.isEnabled()?{description:"Element is enabled",detail:void 0,status:"passed"}:{description:"Element is enabled",detail:"Element is disabled",status:"failed"}}catch{return{description:"Element is enabled",detail:"Element not found",status:"failed"}}}async function ys({locator:e,timeout:t}){try{return await e.waitFor({state:"visible",timeout:t}),await e.isDisabled()?{description:"Element is disabled",detail:void 0,status:"passed"}:{description:"Element is disabled",detail:"Element is enabled",status:"failed"}}catch{return{description:"Element is disabled",detail:"Element not found",status:"failed"}}}async function gs({locator:e,timeout:t}){try{return await e.waitFor({state:"visible",timeout:t}),await e.isChecked()?{description:"Element is checked",detail:void 0,status:"passed"}:{description:"Element is checked",detail:"Element is not checked",status:"failed"}}catch{return{description:"Element is checked",detail:"Element not found",status:"failed"}}}async function hs({locator:e,timeout:t}){try{return await e.waitFor({state:"visible",timeout:t}),await e.isChecked()?{description:"Element is not checked",detail:"Element is checked",status:"failed"}:{description:"Element is not checked",detail:void 0,status:"passed"}}catch{return{description:"Element is not checked",detail:"Element not found",status:"failed"}}}async function ks({locator:e,timeout:t}){try{return await e.waitFor({state:"visible",timeout:t}),!await e.evaluate("(el) => document.activeElement === el")?{description:"Element is focused",detail:"Element is not focused",status:"failed"}:{description:"Element is focused",detail:void 0,status:"passed"}}catch{return{description:"Element is focused",detail:"Element not found",status:"failed"}}}async function Ss({locator:e,timeout:t}){try{return await e.waitFor({state:"visible",timeout:t}),!!await e.evaluate("(el) => document.activeElement === el")?{description:"Element is not focused",detail:"Element is focused",status:"failed"}:{description:"Element is not focused",detail:void 0,status:"passed"}}catch{return{description:"Element is not focused",detail:"Element not found",status:"failed"}}}function Ct(e){let t=`${e.label} ${e.operator} "${e.expected}"`,n=
|
|
92
|
+
%s`,k.findings)}finally{await p.close()}}var Tr=f(()=>{"use strict";Nt();kr();Qt();Y()});async function vr({expected:e,locator:t,operator:n,timeout:r}){let o=await t.textContent({timeout:r});return Ct({actual:o??"",expected:e,label:"Text",operator:n})}function Yt({expected:e,operator:t,url:n}){return Ct({actual:n,expected:e,label:"URL",operator:t})}async function Nr({expected:e,locator:t,operator:n}){let r=await t.count();return ws({actual:r,expected:e,label:"Count",operator:n})}async function Cr({expected:e,locator:t,operator:n,timeout:r}){let o=await t.inputValue({timeout:r});return Ct({actual:o,expected:e,label:"Value",operator:n})}async function Lr({locator:e,timeout:t}){try{return await e.waitFor({state:"visible",timeout:t}),{description:"Element is visible",detail:void 0,status:"passed"}}catch{return{description:"Element is visible",detail:"Element not visible",status:"failed"}}}async function xr({locator:e,timeout:t}){try{return await e.waitFor({state:"hidden",timeout:t}),{description:"Element is not visible",detail:void 0,status:"passed"}}catch{return{description:"Element is not visible",detail:"Element still visible",status:"failed"}}}async function ms({attribute:e,expected:t,locator:n,operator:r,timeout:o}){let i=await n.getAttribute(e,{timeout:o});return Ct({actual:i??"",expected:t,label:`Attribute "${e}"`,operator:r})}async function fs({locator:e,timeout:t}){try{return await e.waitFor({state:"visible",timeout:t}),await e.isEnabled()?{description:"Element is enabled",detail:void 0,status:"passed"}:{description:"Element is enabled",detail:"Element is disabled",status:"failed"}}catch{return{description:"Element is enabled",detail:"Element not found",status:"failed"}}}async function ys({locator:e,timeout:t}){try{return await e.waitFor({state:"visible",timeout:t}),await e.isDisabled()?{description:"Element is disabled",detail:void 0,status:"passed"}:{description:"Element is disabled",detail:"Element is enabled",status:"failed"}}catch{return{description:"Element is disabled",detail:"Element not found",status:"failed"}}}async function gs({locator:e,timeout:t}){try{return await e.waitFor({state:"visible",timeout:t}),await e.isChecked()?{description:"Element is checked",detail:void 0,status:"passed"}:{description:"Element is checked",detail:"Element is not checked",status:"failed"}}catch{return{description:"Element is checked",detail:"Element not found",status:"failed"}}}async function hs({locator:e,timeout:t}){try{return await e.waitFor({state:"visible",timeout:t}),await e.isChecked()?{description:"Element is not checked",detail:"Element is checked",status:"failed"}:{description:"Element is not checked",detail:void 0,status:"passed"}}catch{return{description:"Element is not checked",detail:"Element not found",status:"failed"}}}async function ks({locator:e,timeout:t}){try{return await e.waitFor({state:"visible",timeout:t}),!await e.evaluate("(el) => document.activeElement === el")?{description:"Element is focused",detail:"Element is not focused",status:"failed"}:{description:"Element is focused",detail:void 0,status:"passed"}}catch{return{description:"Element is focused",detail:"Element not found",status:"failed"}}}async function Ss({locator:e,timeout:t}){try{return await e.waitFor({state:"visible",timeout:t}),!!await e.evaluate("(el) => document.activeElement === el")?{description:"Element is not focused",detail:"Element is focused",status:"failed"}:{description:"Element is not focused",detail:void 0,status:"passed"}}catch{return{description:"Element is not focused",detail:"Element not found",status:"failed"}}}function Ct(e){let t=`${e.label} ${e.operator} "${e.expected}"`,n=tf(e),r=n?void 0:`Got: "${e.actual}"`;return{description:t,detail:r,status:n?"passed":"failed"}}function tf({actual:e,expected:t,operator:n}){return n==="equals"?e===t:n==="notEquals"?e!==t:n==="contains"?e.includes(t):n==="startsWith"?e.startsWith(t):n==="endsWith"?e.endsWith(t):new RegExp(t).test(e)}function ws(e){let t=`${e.label} ${e.operator} ${String(e.expected)}`,n=nf(e),r=n?void 0:`Got: ${String(e.actual)}`;return{description:t,detail:r,status:n?"passed":"failed"}}function nf({actual:e,expected:t,operator:n}){return n==="equals"?e===t:n==="notEquals"?e!==t:n==="greaterThan"?e>t:n==="greaterThanOrEqual"?e>=t:n==="lessThan"?e<t:e<=t}var Pr=f(()=>{"use strict"});async function Z({fn:e,label:t}){let n=performance.now(),r=await e();return A.info("%s: %dms",t,Math.round(performance.now()-n)),r}var st=f(()=>{"use strict";Y()});async function Er({headed:e,size:t}){let n=await Z({label:`Prewarmed ${String(t)} browsers`,fn:()=>Promise.all(Array.from({length:t},()=>Ue({headed:e})))}),r=new Set,o=[];function i(){let l=n.pop();return l!=null?(r.add(l),Promise.resolve(l)):new Promise(c=>{o.push(d=>{r.add(d),c(d)})})}function a(l){if(r.delete(l),!l.isConnected()){A.warn("Released browser is disconnected, launching replacement"),Ue({headed:e}).then(d=>{a(d)});return}let c=o.shift();if(c!=null){c(l);return}n.push(l)}async function s(){let l=[...n,...r];n.length=0,r.clear(),await Promise.allSettled(l.map(c=>c.close()))}return{acquire:i,closeAll:s,release:a}}var bs=f(()=>{"use strict";Nt();Y();st()});import{print as rf}from"graphql";async function $(e){let t=rf(e.document),n=JSON.stringify({query:t,variables:e.variables}),r=`${e.config.ripploServerUrl}/graphql`,o;try{o=await fetch(r,{body:n,headers:{Authorization:`Bearer ${e.config.token}`,"Content-Type":"application/json"},method:"POST",signal:AbortSignal.timeout(of)})}catch(a){let s=a instanceof Error?a.message:String(a);throw new Error(`Failed to connect to Ripplo server at ${e.config.ripploServerUrl}. Make sure \`npx ripplo\` is running and your internet connection is active. Details: ${s}`)}let i=await o.json();if(!af(i))throw new Error("Invalid GraphQL response");if(sf(i))throw new Error(i.errors.map(a=>a.message).join(", "));if(i.data==null)throw new Error("No data returned from server");return i.data}function af(e){return typeof e=="object"&&e!=null&&("data"in e||"errors"in e)}function sf(e){return Array.isArray(e.errors)&&e.errors.length>0}var of,Lt=f(()=>{"use strict";of=15e3});import{readdir as lf,rm as cf,stat as df}from"fs/promises";import _v from"os";import Ts from"path";import{graphql as pf}from"gql.tada";async function Or({maxRuns:e}){try{let n=(await lf(As,{withFileTypes:!0})).filter(c=>c.isDirectory()),r=Date.now(),o=await Promise.all(n.map(async c=>{let d=Ts.join(As,c.name),u=await df(d);return{dirPath:d,mtime:u.mtimeMs}})),i=o.filter(c=>r-c.mtime>Rs),s=o.filter(c=>r-c.mtime<=Rs).toSorted((c,d)=>d.mtime-c.mtime).slice(e),l=[...i,...s];if(l.length===0)return;await Promise.allSettled(l.map(c=>cf(c.dirPath,{force:!0,recursive:!0}))),A.info("Pruned %d old debug run(s)",l.length)}catch{A.warn("Debug run pruning failed, ignoring")}}var As,Rs,Bv,vs=f(()=>{"use strict";Lt();Y();As=Ts.join(process.cwd(),".ripplo","debug"),Rs=360*60*1e3,Bv=pf(`
|
|
93
93
|
mutation RevokeCurrentCliToken {
|
|
94
94
|
revokeCurrentCliToken
|
|
95
95
|
}
|
|
96
|
-
`)});async function Ir({appUrl:e}){try{await fetch(e,{method:"HEAD",signal:AbortSignal.timeout(
|
|
97
|
-
`))}}var
|
|
98
|
-
`),t}function be(e,t){return Ur.join(jr(e),t)}var
|
|
99
|
-
`)}var Ns=f(()=>{"use strict";$r()});import{z as en}from"zod";function rn(e){return Cs({legacy:void 0,migrators:[],name:e,schemas:[]})}function Cs(e){return{initial:t=>Vr(t,{...e,schemas:[t]}),legacy:t=>Cs({...e,legacy:t})}}function Vr(e,t){return{build:()=>gf(e,t),legacy:n=>Vr(e,{...t,legacy:n}),upgrade:(n,r)=>{let o=r;return Vr(n,{...t,migrators:[...t.migrators,o],schemas:[...t.schemas,n]})}}}function gf(e,t){let n=t.schemas.length;return{currentVersion:n,name:t.name,decode:r=>hf(e,t,r),encode:r=>({__codec:t.name,data:r,version:n})}}function hf(e,t,n){let{data:r,version:o}=kf(t,n),i=Ls(t,r,o);return e.parse(i)}function kf(e,t){let n=yf.safeParse(t);if(n.success){if(n.data.__codec!==e.name)throw new nn({expected:e.name,got:n.data.__codec});return{data:n.data.data,version:n.data.version}}if(e.legacy!=null&&e.legacy.detect(t))return{data:t,version:e.legacy.assumedVersion};throw new Error(`Cannot decode "${e.name}": value is not a codec envelope and no legacy detector matched.`)}function Ls(e,t,n){let r=e.schemas.length;if(n>r)throw new tn({codec:e.name,currentVersion:r,gotVersion:n});if(n===r)return t;let o=e.schemas[n-1];if(o==null)throw new Error(`Codec "${e.name}" missing schema for v${String(n)}; cannot migrate.`);let i=o.parse(t),a=e.migrators[n-1];if(a==null)throw new Error(`Codec "${e.name}" missing migrator v${String(n)} \u2192 v${String(n+1)}.`);return Ls(e,a(i),n+1)}var yf,tn,nn,Wr=f(()=>{"use strict";yf=en.object({__codec:en.string().min(1),data:en.unknown(),version:en.number().int().positive()}),tn=class extends Error{codec;currentVersion;gotVersion;constructor(t){super(`Unsupported ${t.codec} version ${String(t.gotVersion)} (current ${String(t.currentVersion)}). Upgrade Ripplo or rebuild with a compatible CLI.`),this.name="CodecVersionError",this.codec=t.codec,this.currentVersion=t.currentVersion,this.gotVersion=t.gotVersion}},nn=class extends Error{constructor(t){super(`Codec mismatch: expected "${t.expected}", got "${t.got}"`),this.name="CodecMismatchError"}}});import{z as lt}from"zod";var qr,Fr=f(()=>{"use strict";qr=lt.object({depends:lt.array(lt.string().min(1)).optional().describe("Names of other preconditions that must be satisfied first. Resolved via topological sort; cycles are rejected at validation time."),description:lt.string().min(1).describe("Human-readable description of what this precondition ensures"),returns:lt.array(lt.string().min(1)).optional().describe("Keys that the execute response's data field will contain. e.g. ['projectId', 'workflowId']. These are used for route param interpolation ({{projectId}}) and workflow variables. Declared here so generated types are strongly typed per precondition.")}).describe("A named precondition declared at the graph level. States reference these by name.")});import{z as je}from"zod";var Sf,wf,U,Hr=f(()=>{"use strict";Sf=je.object({by:je.literal("testId"),value:je.string().min(1)}),wf=je.object({by:je.literal("role"),name:je.string().optional(),role:je.string().min(1)}),U=je.discriminatedUnion("by",[Sf,wf])});import{z as xs}from"zod";var $e,on,Mr=f(()=>{"use strict";$e=xs.enum(["equals","notEquals","contains","startsWith","endsWith","matches"]),on=xs.enum(["equals","notEquals","greaterThan","greaterThanOrEqual","lessThan","lessThanOrEqual"])});import{z as X}from"zod";var bf,Jr,an,oe,sn,zr=f(()=>{"use strict";bf=X.object({type:X.literal("static"),value:X.union([X.string(),X.number(),X.boolean()])}),Jr=X.object({name:X.string().min(1),type:X.literal("variable")}),an=X.discriminatedUnion("type",[bf,Jr]),oe=X.discriminatedUnion("type",[X.object({type:X.literal("static"),value:X.string()}),Jr]),sn=X.discriminatedUnion("type",[X.object({type:X.literal("static"),value:X.number().int().nonnegative()}),Jr])});import{z as le}from"zod";var ln,Xr=f(()=>{"use strict";ln=le.discriminatedUnion("type",[le.object({default:le.string().optional(),type:le.literal("string")}),le.object({default:le.number().optional(),type:le.literal("number")}),le.object({default:le.boolean().optional(),type:le.literal("boolean")}),le.object({key:le.string().min(1),type:le.literal("env")})])});import{z as g}from"zod";var E,Ps,Af,Rf,Tf,vf,Nf,Cf,Lf,xf,Pf,Ef,Of,If,_f,Uf,jf,$f,Df,Bf,Vf,Wf,qf,Ff,Hf,Mf,Jf,zf,Xf,Gf,Kf,Qf,Yf,Zf,ey,ty,ny,ry,oy,iy,Es,cn,dn=f(()=>{"use strict";Hr();Mr();zr();Xr();Hr();Mr();zr();Xr();E={id:g.string().min(1).max(200),label:g.string().max(500).optional(),next:g.string().max(200).optional(),uiOnly:g.boolean().optional()},Ps=500,Af=g.object({...E,type:g.literal("goto"),url:oe}),Rf=g.object({...E,locator:U,type:g.literal("click")}),Tf=g.object({...E,locator:U,type:g.literal("fill"),value:oe}),vf=g.object({...E,locator:U,type:g.literal("select"),value:oe}),Nf=g.object({...E,locator:U,type:g.literal("hover")}),Cf=g.object({...E,key:g.string().min(1),locator:U.optional(),type:g.literal("press")}),Lf=g.object({...E,locator:U,type:g.literal("check")}),xf=g.object({...E,locator:U,type:g.literal("uncheck")}),Pf=g.object({...E,height:g.number().int().positive(),type:g.literal("setViewport"),width:g.number().int().positive()}),Ef=g.object({...E,message:g.string().min(1),type:g.literal("fail")}),Of=g.object({...E,type:g.literal("setVariable"),value:an,variable:g.string().min(1)}),If=g.object({...E,locator:U,type:g.literal("extractText"),variable:g.string().min(1)}),_f=g.object({...E,files:g.array(g.string()).min(1),locator:U,type:g.literal("upload")}),Uf=g.object({...E,locator:U,type:g.literal("dblclick")}),jf=g.object({...E,source:U,target:U,type:g.literal("drag")}),$f=g.object({...E,locator:U,type:g.literal("scrollIntoView")}),Df=g.object({...E,locator:U,type:g.literal("type"),value:oe}),Bf=g.object({...E,locator:U,type:g.literal("focus")}),Vf=g.object({...E,locator:U,type:g.literal("clear")}),Wf=g.object({...E,locator:U,type:g.literal("rightClick")}),qf=g.object({...E,action:g.enum(["accept","dismiss"]),promptText:g.string().optional(),type:g.literal("handleDialog")}),Ff=g.object({...E,action:g.enum(["read","write"]),type:g.literal("clipboard"),value:oe.optional(),variable:g.string().min(1).optional()}),Hf=g.object({...E,permission:g.string().min(1),state:g.enum(["granted","prompt"]),type:g.literal("setPermission")}),Mf=g.object({...E,locator:U,type:g.literal("assertVisible")}),Jf=g.object({...E,locator:U,type:g.literal("assertNotVisible")}),zf=g.object({...E,expected:oe,locator:U,operator:$e,type:g.literal("assertText")}),Xf=g.object({...E,expected:oe,operator:$e,type:g.literal("assertUrl")}),Gf=g.object({...E,expected:sn,locator:U,operator:on,type:g.literal("assertCount")}),Kf=g.object({...E,expected:oe,locator:U,operator:$e,type:g.literal("assertValue")}),Qf=g.object({...E,attribute:g.string().min(1),expected:oe,locator:U,operator:$e,type:g.literal("assertAttribute")}),Yf=g.object({...E,locator:U,type:g.literal("assertEnabled")}),Zf=g.object({...E,locator:U,type:g.literal("assertDisabled")}),ey=g.object({...E,expected:oe,operator:$e,type:g.literal("assertTitle")}),ty=g.object({...E,locator:U,type:g.literal("assertChecked")}),ny=g.object({...E,locator:U,type:g.literal("assertNotChecked")}),ry=g.object({...E,locator:U,type:g.literal("assertFocused")}),oy=g.object({...E,locator:U,type:g.literal("assertNotFocused")}),iy=g.object({...E,budget:g.enum(["fast","slow","async"]),observer:g.string().min(1).max(200),params:g.record(g.string().max(200),oe),type:g.literal("assertObserver")}),Es=g.discriminatedUnion("type",[Af,Rf,Tf,vf,Nf,Cf,Lf,xf,Mf,Jf,zf,Xf,Gf,Kf,Qf,Yf,Zf,Pf,Ef,Of,If,_f,Uf,jf,$f,Df,Bf,Vf,Wf,qf,Ff,Hf,ey,ty,ny,ry,oy,iy]),cn=g.object({entryNode:g.string().min(1).max(200),nodes:g.record(g.string().max(200),Es).refine(e=>Object.keys(e).length<=Ps,`Workflow has more than ${String(Ps)} nodes`),uiOnly:g.boolean().optional(),variableNamespaces:g.record(g.string().max(200),g.string().max(500)).optional(),variables:g.record(g.string().max(200),ln).optional()})});import{z as Os}from"zod";var ay,sy,ly,Gr,cy,Is=f(()=>{"use strict";Wr();Fr();dn();ay=Os.record(Os.string().max(200),qr),sy={assumedVersion:1,detect:e=>typeof e=="object"&&e!==null&&"entryNode"in e&&"nodes"in e},ly={assumedVersion:1,detect:e=>typeof e=="object"&&e!==null&&!Array.isArray(e)&&!("__codec"in e)},Gr=rn("workflow-spec").legacy(sy).initial(cn).build(),cy=rn("precondition-map").legacy(ly).initial(ay).build()});import{z as Kr}from"zod";var _s,dy,Us=f(()=>{"use strict";_s=["fast","slow","async"],dy=Kr.object({budget:Kr.enum(_s).describe("Polling budget tier: fast | slow | async"),description:Kr.string().min(1).describe("Human-readable description of what this observer checks")}).describe("A named backend state observer. Tests assert against it with assert.backend(observer, params). Implementation lives on the user's server.")});var js=f(()=>{"use strict";dn()});var $s=f(()=>{"use strict";Wr();Is();Fr();Us();dn();js()});var Bs=Vt(pn=>{"use strict";Object.defineProperty(pn,"__esModule",{value:!0});pn.timingSafeEqual=void 0;function Ds(e,t=""){if(!e)throw new Error(t)}function py(e,t){if(e.byteLength!==t.byteLength)return!1;e instanceof DataView||(e=new DataView(ArrayBuffer.isView(e)?e.buffer:e)),t instanceof DataView||(t=new DataView(ArrayBuffer.isView(t)?t.buffer:t)),Ds(e instanceof DataView),Ds(t instanceof DataView);let n=e.byteLength,r=0,o=-1;for(;++o<n;)r|=e.getUint8(o)^t.getUint8(o);return r===0}pn.timingSafeEqual=py});var qs=Vt(ce=>{"use strict";var uy=ce&&ce.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(ce,"__esModule",{value:!0});var H=256,Qr=(function(){function e(t){t===void 0&&(t="="),this._paddingCharacter=t}return e.prototype.encodedLength=function(t){return this._paddingCharacter?(t+2)/3*4|0:(t*8+5)/6|0},e.prototype.encode=function(t){for(var n="",r=0;r<t.length-2;r+=3){var o=t[r]<<16|t[r+1]<<8|t[r+2];n+=this._encodeByte(o>>>18&63),n+=this._encodeByte(o>>>12&63),n+=this._encodeByte(o>>>6&63),n+=this._encodeByte(o>>>0&63)}var i=t.length-r;if(i>0){var o=t[r]<<16|(i===2?t[r+1]<<8:0);n+=this._encodeByte(o>>>18&63),n+=this._encodeByte(o>>>12&63),i===2?n+=this._encodeByte(o>>>6&63):n+=this._paddingCharacter||"",n+=this._paddingCharacter||""}return n},e.prototype.maxDecodedLength=function(t){return this._paddingCharacter?t/4*3|0:(t*6+7)/8|0},e.prototype.decodedLength=function(t){return this.maxDecodedLength(t.length-this._getPaddingLength(t))},e.prototype.decode=function(t){if(t.length===0)return new Uint8Array(0);for(var n=this._getPaddingLength(t),r=t.length-n,o=new Uint8Array(this.maxDecodedLength(r)),i=0,a=0,s=0,l=0,c=0,d=0,u=0;a<r-4;a+=4)l=this._decodeChar(t.charCodeAt(a+0)),c=this._decodeChar(t.charCodeAt(a+1)),d=this._decodeChar(t.charCodeAt(a+2)),u=this._decodeChar(t.charCodeAt(a+3)),o[i++]=l<<2|c>>>4,o[i++]=c<<4|d>>>2,o[i++]=d<<6|u,s|=l&H,s|=c&H,s|=d&H,s|=u&H;if(a<r-1&&(l=this._decodeChar(t.charCodeAt(a)),c=this._decodeChar(t.charCodeAt(a+1)),o[i++]=l<<2|c>>>4,s|=l&H,s|=c&H),a<r-2&&(d=this._decodeChar(t.charCodeAt(a+2)),o[i++]=c<<4|d>>>2,s|=d&H),a<r-3&&(u=this._decodeChar(t.charCodeAt(a+3)),o[i++]=d<<6|u,s|=u&H),s!==0)throw new Error("Base64Coder: incorrect characters for decoding");return o},e.prototype._encodeByte=function(t){var n=t;return n+=65,n+=25-t>>>8&6,n+=51-t>>>8&-75,n+=61-t>>>8&-15,n+=62-t>>>8&3,String.fromCharCode(n)},e.prototype._decodeChar=function(t){var n=H;return n+=(42-t&t-44)>>>8&-H+t-43+62,n+=(46-t&t-48)>>>8&-H+t-47+63,n+=(47-t&t-58)>>>8&-H+t-48+52,n+=(64-t&t-91)>>>8&-H+t-65+0,n+=(96-t&t-123)>>>8&-H+t-97+26,n},e.prototype._getPaddingLength=function(t){var n=0;if(this._paddingCharacter){for(var r=t.length-1;r>=0&&t[r]===this._paddingCharacter;r--)n++;if(t.length<4||n>2)throw new Error("Base64Coder: incorrect padding")}return n},e})();ce.Coder=Qr;var xt=new Qr;function my(e){return xt.encode(e)}ce.encode=my;function fy(e){return xt.decode(e)}ce.decode=fy;var Vs=(function(e){uy(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype._encodeByte=function(n){var r=n;return r+=65,r+=25-n>>>8&6,r+=51-n>>>8&-75,r+=61-n>>>8&-13,r+=62-n>>>8&49,String.fromCharCode(r)},t.prototype._decodeChar=function(n){var r=H;return r+=(44-n&n-46)>>>8&-H+n-45+62,r+=(94-n&n-96)>>>8&-H+n-95+63,r+=(47-n&n-58)>>>8&-H+n-48+52,r+=(64-n&n-91)>>>8&-H+n-65+0,r+=(96-n&n-123)>>>8&-H+n-97+26,r},t})(Qr);ce.URLSafeCoder=Vs;var Ws=new Vs;function yy(e){return Ws.encode(e)}ce.encodeURLSafe=yy;function gy(e){return Ws.decode(e)}ce.decodeURLSafe=gy;ce.encodedLength=function(e){return xt.encodedLength(e)};ce.maxDecodedLength=function(e){return xt.maxDecodedLength(e)};ce.decodedLength=function(e){return xt.decodedLength(e)}});var Hs=Vt((Fs,un)=>{"use strict";(function(e,t){var n={};t(n);var r=n.default;for(var o in n)r[o]=n[o];typeof un=="object"&&typeof un.exports=="object"?un.exports=r:typeof define=="function"&&define.amd?define(function(){return r}):e.sha256=r})(Fs,function(e){"use strict";e.__esModule=!0,e.digestLength=32,e.blockSize=64;var t=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function n(u,p,m,h,S){for(var w,k,b,v,L,T,I,O,C,V,ze,kt,Bt;S>=64;){for(w=p[0],k=p[1],b=p[2],v=p[3],L=p[4],T=p[5],I=p[6],O=p[7],V=0;V<16;V++)ze=h+V*4,u[V]=(m[ze]&255)<<24|(m[ze+1]&255)<<16|(m[ze+2]&255)<<8|m[ze+3]&255;for(V=16;V<64;V++)C=u[V-2],kt=(C>>>17|C<<15)^(C>>>19|C<<13)^C>>>10,C=u[V-15],Bt=(C>>>7|C<<25)^(C>>>18|C<<14)^C>>>3,u[V]=(kt+u[V-7]|0)+(Bt+u[V-16]|0);for(V=0;V<64;V++)kt=(((L>>>6|L<<26)^(L>>>11|L<<21)^(L>>>25|L<<7))+(L&T^~L&I)|0)+(O+(t[V]+u[V]|0)|0)|0,Bt=((w>>>2|w<<30)^(w>>>13|w<<19)^(w>>>22|w<<10))+(w&k^w&b^k&b)|0,O=I,I=T,T=L,L=v+kt|0,v=b,b=k,k=w,w=kt+Bt|0;p[0]+=w,p[1]+=k,p[2]+=b,p[3]+=v,p[4]+=L,p[5]+=T,p[6]+=I,p[7]+=O,h+=64,S-=64}return h}var r=(function(){function u(){this.digestLength=e.digestLength,this.blockSize=e.blockSize,this.state=new Int32Array(8),this.temp=new Int32Array(64),this.buffer=new Uint8Array(128),this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this.reset()}return u.prototype.reset=function(){return this.state[0]=1779033703,this.state[1]=3144134277,this.state[2]=1013904242,this.state[3]=2773480762,this.state[4]=1359893119,this.state[5]=2600822924,this.state[6]=528734635,this.state[7]=1541459225,this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this},u.prototype.clean=function(){for(var p=0;p<this.buffer.length;p++)this.buffer[p]=0;for(var p=0;p<this.temp.length;p++)this.temp[p]=0;this.reset()},u.prototype.update=function(p,m){if(m===void 0&&(m=p.length),this.finished)throw new Error("SHA256: can't update because hash was finished.");var h=0;if(this.bytesHashed+=m,this.bufferLength>0){for(;this.bufferLength<64&&m>0;)this.buffer[this.bufferLength++]=p[h++],m--;this.bufferLength===64&&(n(this.temp,this.state,this.buffer,0,64),this.bufferLength=0)}for(m>=64&&(h=n(this.temp,this.state,p,h,m),m%=64);m>0;)this.buffer[this.bufferLength++]=p[h++],m--;return this},u.prototype.finish=function(p){if(!this.finished){var m=this.bytesHashed,h=this.bufferLength,S=m/536870912|0,w=m<<3,k=m%64<56?64:128;this.buffer[h]=128;for(var b=h+1;b<k-8;b++)this.buffer[b]=0;this.buffer[k-8]=S>>>24&255,this.buffer[k-7]=S>>>16&255,this.buffer[k-6]=S>>>8&255,this.buffer[k-5]=S>>>0&255,this.buffer[k-4]=w>>>24&255,this.buffer[k-3]=w>>>16&255,this.buffer[k-2]=w>>>8&255,this.buffer[k-1]=w>>>0&255,n(this.temp,this.state,this.buffer,0,k),this.finished=!0}for(var b=0;b<8;b++)p[b*4+0]=this.state[b]>>>24&255,p[b*4+1]=this.state[b]>>>16&255,p[b*4+2]=this.state[b]>>>8&255,p[b*4+3]=this.state[b]>>>0&255;return this},u.prototype.digest=function(){var p=new Uint8Array(this.digestLength);return this.finish(p),p},u.prototype._saveState=function(p){for(var m=0;m<this.state.length;m++)p[m]=this.state[m]},u.prototype._restoreState=function(p,m){for(var h=0;h<this.state.length;h++)this.state[h]=p[h];this.bytesHashed=m,this.finished=!1,this.bufferLength=0},u})();e.Hash=r;var o=(function(){function u(p){this.inner=new r,this.outer=new r,this.blockSize=this.inner.blockSize,this.digestLength=this.inner.digestLength;var m=new Uint8Array(this.blockSize);if(p.length>this.blockSize)new r().update(p).finish(m).clean();else for(var h=0;h<p.length;h++)m[h]=p[h];for(var h=0;h<m.length;h++)m[h]^=54;this.inner.update(m);for(var h=0;h<m.length;h++)m[h]^=106;this.outer.update(m),this.istate=new Uint32Array(8),this.ostate=new Uint32Array(8),this.inner._saveState(this.istate),this.outer._saveState(this.ostate);for(var h=0;h<m.length;h++)m[h]=0}return u.prototype.reset=function(){return this.inner._restoreState(this.istate,this.inner.blockSize),this.outer._restoreState(this.ostate,this.outer.blockSize),this},u.prototype.clean=function(){for(var p=0;p<this.istate.length;p++)this.ostate[p]=this.istate[p]=0;this.inner.clean(),this.outer.clean()},u.prototype.update=function(p){return this.inner.update(p),this},u.prototype.finish=function(p){return this.outer.finished?this.outer.finish(p):(this.inner.finish(p),this.outer.update(p,this.digestLength).finish(p)),this},u.prototype.digest=function(){var p=new Uint8Array(this.digestLength);return this.finish(p),p},u})();e.HMAC=o;function i(u){var p=new r().update(u),m=p.digest();return p.clean(),m}e.hash=i,e.default=i;function a(u,p){var m=new o(u).update(p),h=m.digest();return m.clean(),h}e.hmac=a;function s(u,p,m,h){var S=h[0];if(S===0)throw new Error("hkdf: cannot expand more");p.reset(),S>1&&p.update(u),m&&p.update(m),p.update(h),p.finish(u),h[0]++}var l=new Uint8Array(e.digestLength);function c(u,p,m,h){p===void 0&&(p=l),h===void 0&&(h=32);for(var S=new Uint8Array([1]),w=a(p,u),k=new o(w),b=new Uint8Array(k.digestLength),v=b.length,L=new Uint8Array(h),T=0;T<h;T++)v===b.length&&(s(b,k,m,S),v=0),L[T]=b[v++];return k.clean(),b.fill(0),S.fill(0),L}e.hkdf=c;function d(u,p,m,h){for(var S=new o(u),w=S.digestLength,k=new Uint8Array(4),b=new Uint8Array(w),v=new Uint8Array(w),L=new Uint8Array(h),T=0;T*w<h;T++){var I=T+1;k[0]=I>>>24&255,k[1]=I>>>16&255,k[2]=I>>>8&255,k[3]=I>>>0&255,S.reset(),S.update(p),S.update(k),S.finish(v);for(var O=0;O<w;O++)b[O]=v[O];for(var O=2;O<=m;O++){S.reset(),S.update(v).finish(v);for(var C=0;C<w;C++)b[C]^=v[C]}for(var O=0;O<w&&T*w+O<h;O++)L[T*w+O]=b[O]}for(var T=0;T<w;T++)b[T]=v[T]=0;for(var T=0;T<4;T++)k[T]=0;return S.clean(),L}e.pbkdf2=d})});var Zr=Vt(ct=>{"use strict";Object.defineProperty(ct,"__esModule",{value:!0});ct.Webhook=ct.WebhookVerificationError=void 0;var hy=Bs(),Ms=qs(),ky=Hs(),Js=300,Yr=class e extends Error{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype),this.name="ExtendableError",this.stack=new Error(t).stack}},De=class e extends Yr{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype),this.name="WebhookVerificationError"}};ct.WebhookVerificationError=De;var mn=class e{constructor(t,n){if(!t)throw new Error("Secret can't be empty.");if(n?.format==="raw")t instanceof Uint8Array?this.key=t:this.key=Uint8Array.from(t,r=>r.charCodeAt(0));else{if(typeof t!="string")throw new Error("Expected secret to be of type string");t.startsWith(e.prefix)&&(t=t.substring(e.prefix.length)),this.key=Ms.decode(t)}}verify(t,n){let r={};for(let p of Object.keys(n))r[p.toLowerCase()]=n[p];let o=r["webhook-id"],i=r["webhook-signature"],a=r["webhook-timestamp"];if(!i||!o||!a)throw new De("Missing required headers");let s=this.verifyTimestamp(a),c=this.sign(o,s,t).split(",")[1],d=i.split(" "),u=new globalThis.TextEncoder;for(let p of d){let[m,h]=p.split(",");if(m==="v1"&&(0,hy.timingSafeEqual)(u.encode(h),u.encode(c)))return JSON.parse(t.toString())}throw new De("No matching signature found")}sign(t,n,r){if(typeof r!="string")if(r.constructor.name==="Buffer")r=r.toString();else throw new Error("Expected payload to be of type string or Buffer.");let o=new TextEncoder,i=Math.floor(n.getTime()/1e3),a=o.encode(`${t}.${i}.${r}`);return`v1,${Ms.encode(ky.hmac(this.key,a))}`}verifyTimestamp(t){let n=Math.floor(Date.now()/1e3),r=parseInt(t,10);if(isNaN(r))throw new De("Invalid Signature Headers");if(n-r>Js)throw new De("Message timestamp too old");if(r>n+Js)throw new De("Message timestamp too new");return new Date(r*1e3)}};ct.Webhook=mn;mn.prefix="whsec_"});import zs from"crypto";function Be({body:e,secret:t}){let n=new Xs.Webhook(t),r=`msg_${zs.randomUUID()}`,o=new Date,i=n.sign(r,o,e),a=Math.floor(o.getTime()/1e3);return{"webhook-id":r,"webhook-signature":i,"webhook-timestamp":String(a)}}function eo(){return`whsec_${zs.randomBytes(24).toString("base64")}`}var Xs,fn=f(()=>{"use strict";Xs=ei(Zr(),1)});import{z as ye}from"zod";async function Gs({apiUrl:e,budget:t,observer:n,params:r,webhookSecret:o}){let i=wy[t],a=performance.now(),s={lastReason:void 0,pollCount:0};for(;performance.now()-a<i.timeoutMs;){s.pollCount+=1;let l=await Ty({apiUrl:e,observer:n,params:r,webhookSecret:o}),c=Ry({observer:n,outcome:l,start:a,state:s});if(c!=null)return c;let d=i.timeoutMs-(performance.now()-a);if(d<=0)break;let u=Math.min(vy({backoff:i.backoffMs,pollCount:s.pollCount}),d);await Ny(u)}return{description:`observer "${n}"`,detail:`budget "${t}" exhausted after ${String(s.pollCount)} poll(s) (${Ks(a)}); last: ${s.lastReason??"no retry reason"}
|
|
100
|
-
\u2192 /ripplo:debug \u2014 check .ripplo/debug/<runId>/ artifacts`,status:"failed"}}function
|
|
96
|
+
`)});async function Ir({appUrl:e}){try{await fetch(e,{method:"HEAD",signal:AbortSignal.timeout(uf)})}catch(t){let n=t instanceof Error?t.message:String(t);throw A.debug("App URL reachability check failed: %s",n),new Error([`Could not reach your dev server at ${e}.`,"","Troubleshooting:",` 1. Make sure your app is running at ${e}`," 2. Check the appUrl in your createRipplo() config"," 3. If your app runs on a different port, update appUrl in .ripplo/ripplo.ts"].join(`
|
|
97
|
+
`))}}var uf,_r=f(()=>{"use strict";Y();uf=5e3});import Zt from"fs";import Ur from"path";function jr(e){return Ur.join(e,".ripplo",mf)}function Xe(e){let t=jr(e);Zt.existsSync(t)||Zt.mkdirSync(t,{recursive:!0});let n=Ur.join(t,".gitignore");return Zt.existsSync(n)||Zt.writeFileSync(n,`*
|
|
98
|
+
`),t}function be(e,t){return Ur.join(jr(e),t)}var mf,$r=f(()=>{"use strict";mf=".local"});import Dr from"fs";function Re(e){let t=be(e,"token");if(!Dr.existsSync(t))return null;let n=Dr.readFileSync(t,"utf8").trim();return n.length===0?null:n}function Br(e,t){Xe(e),Dr.writeFileSync(be(e,"token"),t+`
|
|
99
|
+
`)}var Ns=f(()=>{"use strict";$r()});import{z as en}from"zod";function rn(e){return Cs({legacy:void 0,migrators:[],name:e,schemas:[]})}function Cs(e){return{initial:t=>Vr(t,{...e,schemas:[t]}),legacy:t=>Cs({...e,legacy:t})}}function Vr(e,t){return{build:()=>yf(e,t),legacy:n=>Vr(e,{...t,legacy:n}),upgrade:(n,r)=>{let o=r;return Vr(n,{...t,migrators:[...t.migrators,o],schemas:[...t.schemas,n]})}}}function yf(e,t){let n=t.schemas.length;return{currentVersion:n,name:t.name,decode:r=>gf(e,t,r),encode:r=>({__codec:t.name,data:r,version:n})}}function gf(e,t,n){let{data:r,version:o}=hf(t,n),i=Ls(t,r,o);return e.parse(i)}function hf(e,t){let n=ff.safeParse(t);if(n.success){if(n.data.__codec!==e.name)throw new nn({expected:e.name,got:n.data.__codec});return{data:n.data.data,version:n.data.version}}if(e.legacy!=null&&e.legacy.detect(t))return{data:t,version:e.legacy.assumedVersion};throw new Error(`Cannot decode "${e.name}": value is not a codec envelope and no legacy detector matched.`)}function Ls(e,t,n){let r=e.schemas.length;if(n>r)throw new tn({codec:e.name,currentVersion:r,gotVersion:n});if(n===r)return t;let o=e.schemas[n-1];if(o==null)throw new Error(`Codec "${e.name}" missing schema for v${String(n)}; cannot migrate.`);let i=o.parse(t),a=e.migrators[n-1];if(a==null)throw new Error(`Codec "${e.name}" missing migrator v${String(n)} \u2192 v${String(n+1)}.`);return Ls(e,a(i),n+1)}var ff,tn,nn,Wr=f(()=>{"use strict";ff=en.object({__codec:en.string().min(1),data:en.unknown(),version:en.number().int().positive()}),tn=class extends Error{codec;currentVersion;gotVersion;constructor(t){super(`Unsupported ${t.codec} version ${String(t.gotVersion)} (current ${String(t.currentVersion)}). Upgrade Ripplo or rebuild with a compatible CLI.`),this.name="CodecVersionError",this.codec=t.codec,this.currentVersion=t.currentVersion,this.gotVersion=t.gotVersion}},nn=class extends Error{constructor(t){super(`Codec mismatch: expected "${t.expected}", got "${t.got}"`),this.name="CodecMismatchError"}}});import{z as lt}from"zod";var qr,Fr=f(()=>{"use strict";qr=lt.object({depends:lt.array(lt.string().min(1)).optional().describe("Names of other preconditions that must be satisfied first. Resolved via topological sort; cycles are rejected at validation time."),description:lt.string().min(1).describe("Human-readable description of what this precondition ensures"),returns:lt.array(lt.string().min(1)).optional().describe("Keys that the execute response's data field will contain. e.g. ['projectId', 'workflowId']. These are used for route param interpolation ({{projectId}}) and workflow variables. Declared here so generated types are strongly typed per precondition.")}).describe("A named precondition declared at the graph level. States reference these by name.")});import{z as je}from"zod";var kf,Sf,U,Hr=f(()=>{"use strict";kf=je.object({by:je.literal("testId"),value:je.string().min(1)}),Sf=je.object({by:je.literal("role"),name:je.string().optional(),role:je.string().min(1)}),U=je.discriminatedUnion("by",[kf,Sf])});import{z as xs}from"zod";var $e,on,Mr=f(()=>{"use strict";$e=xs.enum(["equals","notEquals","contains","startsWith","endsWith","matches"]),on=xs.enum(["equals","notEquals","greaterThan","greaterThanOrEqual","lessThan","lessThanOrEqual"])});import{z as X}from"zod";var wf,Jr,an,oe,sn,zr=f(()=>{"use strict";wf=X.object({type:X.literal("static"),value:X.union([X.string(),X.number(),X.boolean()])}),Jr=X.object({name:X.string().min(1),type:X.literal("variable")}),an=X.discriminatedUnion("type",[wf,Jr]),oe=X.discriminatedUnion("type",[X.object({type:X.literal("static"),value:X.string()}),Jr]),sn=X.discriminatedUnion("type",[X.object({type:X.literal("static"),value:X.number().int().nonnegative()}),Jr])});import{z as le}from"zod";var ln,Xr=f(()=>{"use strict";ln=le.discriminatedUnion("type",[le.object({default:le.string().optional(),type:le.literal("string")}),le.object({default:le.number().optional(),type:le.literal("number")}),le.object({default:le.boolean().optional(),type:le.literal("boolean")}),le.object({key:le.string().min(1),type:le.literal("env")})])});import{z as g}from"zod";var E,Ps,bf,Af,Rf,Tf,vf,Nf,Cf,Lf,xf,Pf,Ef,Of,If,_f,Uf,jf,$f,Df,Bf,Vf,Wf,qf,Ff,Hf,Mf,Jf,zf,Xf,Gf,Kf,Qf,Yf,Zf,ey,ty,ny,ry,oy,Es,cn,dn=f(()=>{"use strict";Hr();Mr();zr();Xr();Hr();Mr();zr();Xr();E={id:g.string().min(1).max(200),label:g.string().max(500).optional(),next:g.string().max(200).optional(),uiOnly:g.boolean().optional()},Ps=500,bf=g.object({...E,type:g.literal("goto"),url:oe}),Af=g.object({...E,locator:U,type:g.literal("click")}),Rf=g.object({...E,locator:U,type:g.literal("fill"),value:oe}),Tf=g.object({...E,locator:U,type:g.literal("select"),value:oe}),vf=g.object({...E,locator:U,type:g.literal("hover")}),Nf=g.object({...E,key:g.string().min(1),locator:U.optional(),type:g.literal("press")}),Cf=g.object({...E,locator:U,type:g.literal("check")}),Lf=g.object({...E,locator:U,type:g.literal("uncheck")}),xf=g.object({...E,height:g.number().int().positive(),type:g.literal("setViewport"),width:g.number().int().positive()}),Pf=g.object({...E,message:g.string().min(1),type:g.literal("fail")}),Ef=g.object({...E,type:g.literal("setVariable"),value:an,variable:g.string().min(1)}),Of=g.object({...E,locator:U,type:g.literal("extractText"),variable:g.string().min(1)}),If=g.object({...E,files:g.array(g.string()).min(1),locator:U,type:g.literal("upload")}),_f=g.object({...E,locator:U,type:g.literal("dblclick")}),Uf=g.object({...E,source:U,target:U,type:g.literal("drag")}),jf=g.object({...E,locator:U,type:g.literal("scrollIntoView")}),$f=g.object({...E,locator:U,type:g.literal("type"),value:oe}),Df=g.object({...E,locator:U,type:g.literal("focus")}),Bf=g.object({...E,locator:U,type:g.literal("clear")}),Vf=g.object({...E,locator:U,type:g.literal("rightClick")}),Wf=g.object({...E,action:g.enum(["accept","dismiss"]),promptText:g.string().optional(),type:g.literal("handleDialog")}),qf=g.object({...E,action:g.enum(["read","write"]),type:g.literal("clipboard"),value:oe.optional(),variable:g.string().min(1).optional()}),Ff=g.object({...E,permission:g.string().min(1),state:g.enum(["granted","prompt"]),type:g.literal("setPermission")}),Hf=g.object({...E,locator:U,type:g.literal("assertVisible")}),Mf=g.object({...E,locator:U,type:g.literal("assertNotVisible")}),Jf=g.object({...E,expected:oe,locator:U,operator:$e,type:g.literal("assertText")}),zf=g.object({...E,expected:oe,operator:$e,type:g.literal("assertUrl")}),Xf=g.object({...E,expected:sn,locator:U,operator:on,type:g.literal("assertCount")}),Gf=g.object({...E,expected:oe,locator:U,operator:$e,type:g.literal("assertValue")}),Kf=g.object({...E,attribute:g.string().min(1),expected:oe,locator:U,operator:$e,type:g.literal("assertAttribute")}),Qf=g.object({...E,locator:U,type:g.literal("assertEnabled")}),Yf=g.object({...E,locator:U,type:g.literal("assertDisabled")}),Zf=g.object({...E,expected:oe,operator:$e,type:g.literal("assertTitle")}),ey=g.object({...E,locator:U,type:g.literal("assertChecked")}),ty=g.object({...E,locator:U,type:g.literal("assertNotChecked")}),ny=g.object({...E,locator:U,type:g.literal("assertFocused")}),ry=g.object({...E,locator:U,type:g.literal("assertNotFocused")}),oy=g.object({...E,budget:g.enum(["fast","slow","async"]),observer:g.string().min(1).max(200),params:g.record(g.string().max(200),oe),type:g.literal("assertObserver")}),Es=g.discriminatedUnion("type",[bf,Af,Rf,Tf,vf,Nf,Cf,Lf,Hf,Mf,Jf,zf,Xf,Gf,Kf,Qf,Yf,xf,Pf,Ef,Of,If,_f,Uf,jf,$f,Df,Bf,Vf,Wf,qf,Ff,Zf,ey,ty,ny,ry,oy]),cn=g.object({entryNode:g.string().min(1).max(200),nodes:g.record(g.string().max(200),Es).refine(e=>Object.keys(e).length<=Ps,`Workflow has more than ${String(Ps)} nodes`),uiOnly:g.boolean().optional(),variableNamespaces:g.record(g.string().max(200),g.string().max(500)).optional(),variables:g.record(g.string().max(200),ln).optional()})});import{z as Os}from"zod";var iy,ay,sy,Gr,ly,Is=f(()=>{"use strict";Wr();Fr();dn();iy=Os.record(Os.string().max(200),qr),ay={assumedVersion:1,detect:e=>typeof e=="object"&&e!==null&&"entryNode"in e&&"nodes"in e},sy={assumedVersion:1,detect:e=>typeof e=="object"&&e!==null&&!Array.isArray(e)&&!("__codec"in e)},Gr=rn("workflow-spec").legacy(ay).initial(cn).build(),ly=rn("precondition-map").legacy(sy).initial(iy).build()});import{z as Kr}from"zod";var _s,cy,Us=f(()=>{"use strict";_s=["fast","slow","async"],cy=Kr.object({budget:Kr.enum(_s).describe("Polling budget tier: fast | slow | async"),description:Kr.string().min(1).describe("Human-readable description of what this observer checks")}).describe("A named backend state observer. Tests assert against it with assert.backend(observer, params). Implementation lives on the user's server.")});var js=f(()=>{"use strict";dn()});var $s=f(()=>{"use strict";Wr();Is();Fr();Us();dn();js()});var Bs=Vt(pn=>{"use strict";Object.defineProperty(pn,"__esModule",{value:!0});pn.timingSafeEqual=void 0;function Ds(e,t=""){if(!e)throw new Error(t)}function dy(e,t){if(e.byteLength!==t.byteLength)return!1;e instanceof DataView||(e=new DataView(ArrayBuffer.isView(e)?e.buffer:e)),t instanceof DataView||(t=new DataView(ArrayBuffer.isView(t)?t.buffer:t)),Ds(e instanceof DataView),Ds(t instanceof DataView);let n=e.byteLength,r=0,o=-1;for(;++o<n;)r|=e.getUint8(o)^t.getUint8(o);return r===0}pn.timingSafeEqual=dy});var qs=Vt(ce=>{"use strict";var py=ce&&ce.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(ce,"__esModule",{value:!0});var H=256,Qr=(function(){function e(t){t===void 0&&(t="="),this._paddingCharacter=t}return e.prototype.encodedLength=function(t){return this._paddingCharacter?(t+2)/3*4|0:(t*8+5)/6|0},e.prototype.encode=function(t){for(var n="",r=0;r<t.length-2;r+=3){var o=t[r]<<16|t[r+1]<<8|t[r+2];n+=this._encodeByte(o>>>18&63),n+=this._encodeByte(o>>>12&63),n+=this._encodeByte(o>>>6&63),n+=this._encodeByte(o>>>0&63)}var i=t.length-r;if(i>0){var o=t[r]<<16|(i===2?t[r+1]<<8:0);n+=this._encodeByte(o>>>18&63),n+=this._encodeByte(o>>>12&63),i===2?n+=this._encodeByte(o>>>6&63):n+=this._paddingCharacter||"",n+=this._paddingCharacter||""}return n},e.prototype.maxDecodedLength=function(t){return this._paddingCharacter?t/4*3|0:(t*6+7)/8|0},e.prototype.decodedLength=function(t){return this.maxDecodedLength(t.length-this._getPaddingLength(t))},e.prototype.decode=function(t){if(t.length===0)return new Uint8Array(0);for(var n=this._getPaddingLength(t),r=t.length-n,o=new Uint8Array(this.maxDecodedLength(r)),i=0,a=0,s=0,l=0,c=0,d=0,u=0;a<r-4;a+=4)l=this._decodeChar(t.charCodeAt(a+0)),c=this._decodeChar(t.charCodeAt(a+1)),d=this._decodeChar(t.charCodeAt(a+2)),u=this._decodeChar(t.charCodeAt(a+3)),o[i++]=l<<2|c>>>4,o[i++]=c<<4|d>>>2,o[i++]=d<<6|u,s|=l&H,s|=c&H,s|=d&H,s|=u&H;if(a<r-1&&(l=this._decodeChar(t.charCodeAt(a)),c=this._decodeChar(t.charCodeAt(a+1)),o[i++]=l<<2|c>>>4,s|=l&H,s|=c&H),a<r-2&&(d=this._decodeChar(t.charCodeAt(a+2)),o[i++]=c<<4|d>>>2,s|=d&H),a<r-3&&(u=this._decodeChar(t.charCodeAt(a+3)),o[i++]=d<<6|u,s|=u&H),s!==0)throw new Error("Base64Coder: incorrect characters for decoding");return o},e.prototype._encodeByte=function(t){var n=t;return n+=65,n+=25-t>>>8&6,n+=51-t>>>8&-75,n+=61-t>>>8&-15,n+=62-t>>>8&3,String.fromCharCode(n)},e.prototype._decodeChar=function(t){var n=H;return n+=(42-t&t-44)>>>8&-H+t-43+62,n+=(46-t&t-48)>>>8&-H+t-47+63,n+=(47-t&t-58)>>>8&-H+t-48+52,n+=(64-t&t-91)>>>8&-H+t-65+0,n+=(96-t&t-123)>>>8&-H+t-97+26,n},e.prototype._getPaddingLength=function(t){var n=0;if(this._paddingCharacter){for(var r=t.length-1;r>=0&&t[r]===this._paddingCharacter;r--)n++;if(t.length<4||n>2)throw new Error("Base64Coder: incorrect padding")}return n},e})();ce.Coder=Qr;var xt=new Qr;function uy(e){return xt.encode(e)}ce.encode=uy;function my(e){return xt.decode(e)}ce.decode=my;var Vs=(function(e){py(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype._encodeByte=function(n){var r=n;return r+=65,r+=25-n>>>8&6,r+=51-n>>>8&-75,r+=61-n>>>8&-13,r+=62-n>>>8&49,String.fromCharCode(r)},t.prototype._decodeChar=function(n){var r=H;return r+=(44-n&n-46)>>>8&-H+n-45+62,r+=(94-n&n-96)>>>8&-H+n-95+63,r+=(47-n&n-58)>>>8&-H+n-48+52,r+=(64-n&n-91)>>>8&-H+n-65+0,r+=(96-n&n-123)>>>8&-H+n-97+26,r},t})(Qr);ce.URLSafeCoder=Vs;var Ws=new Vs;function fy(e){return Ws.encode(e)}ce.encodeURLSafe=fy;function yy(e){return Ws.decode(e)}ce.decodeURLSafe=yy;ce.encodedLength=function(e){return xt.encodedLength(e)};ce.maxDecodedLength=function(e){return xt.maxDecodedLength(e)};ce.decodedLength=function(e){return xt.decodedLength(e)}});var Hs=Vt((Fs,un)=>{"use strict";(function(e,t){var n={};t(n);var r=n.default;for(var o in n)r[o]=n[o];typeof un=="object"&&typeof un.exports=="object"?un.exports=r:typeof define=="function"&&define.amd?define(function(){return r}):e.sha256=r})(Fs,function(e){"use strict";e.__esModule=!0,e.digestLength=32,e.blockSize=64;var t=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function n(u,p,m,h,S){for(var w,k,b,v,L,T,I,O,C,V,ze,kt,Bt;S>=64;){for(w=p[0],k=p[1],b=p[2],v=p[3],L=p[4],T=p[5],I=p[6],O=p[7],V=0;V<16;V++)ze=h+V*4,u[V]=(m[ze]&255)<<24|(m[ze+1]&255)<<16|(m[ze+2]&255)<<8|m[ze+3]&255;for(V=16;V<64;V++)C=u[V-2],kt=(C>>>17|C<<15)^(C>>>19|C<<13)^C>>>10,C=u[V-15],Bt=(C>>>7|C<<25)^(C>>>18|C<<14)^C>>>3,u[V]=(kt+u[V-7]|0)+(Bt+u[V-16]|0);for(V=0;V<64;V++)kt=(((L>>>6|L<<26)^(L>>>11|L<<21)^(L>>>25|L<<7))+(L&T^~L&I)|0)+(O+(t[V]+u[V]|0)|0)|0,Bt=((w>>>2|w<<30)^(w>>>13|w<<19)^(w>>>22|w<<10))+(w&k^w&b^k&b)|0,O=I,I=T,T=L,L=v+kt|0,v=b,b=k,k=w,w=kt+Bt|0;p[0]+=w,p[1]+=k,p[2]+=b,p[3]+=v,p[4]+=L,p[5]+=T,p[6]+=I,p[7]+=O,h+=64,S-=64}return h}var r=(function(){function u(){this.digestLength=e.digestLength,this.blockSize=e.blockSize,this.state=new Int32Array(8),this.temp=new Int32Array(64),this.buffer=new Uint8Array(128),this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this.reset()}return u.prototype.reset=function(){return this.state[0]=1779033703,this.state[1]=3144134277,this.state[2]=1013904242,this.state[3]=2773480762,this.state[4]=1359893119,this.state[5]=2600822924,this.state[6]=528734635,this.state[7]=1541459225,this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this},u.prototype.clean=function(){for(var p=0;p<this.buffer.length;p++)this.buffer[p]=0;for(var p=0;p<this.temp.length;p++)this.temp[p]=0;this.reset()},u.prototype.update=function(p,m){if(m===void 0&&(m=p.length),this.finished)throw new Error("SHA256: can't update because hash was finished.");var h=0;if(this.bytesHashed+=m,this.bufferLength>0){for(;this.bufferLength<64&&m>0;)this.buffer[this.bufferLength++]=p[h++],m--;this.bufferLength===64&&(n(this.temp,this.state,this.buffer,0,64),this.bufferLength=0)}for(m>=64&&(h=n(this.temp,this.state,p,h,m),m%=64);m>0;)this.buffer[this.bufferLength++]=p[h++],m--;return this},u.prototype.finish=function(p){if(!this.finished){var m=this.bytesHashed,h=this.bufferLength,S=m/536870912|0,w=m<<3,k=m%64<56?64:128;this.buffer[h]=128;for(var b=h+1;b<k-8;b++)this.buffer[b]=0;this.buffer[k-8]=S>>>24&255,this.buffer[k-7]=S>>>16&255,this.buffer[k-6]=S>>>8&255,this.buffer[k-5]=S>>>0&255,this.buffer[k-4]=w>>>24&255,this.buffer[k-3]=w>>>16&255,this.buffer[k-2]=w>>>8&255,this.buffer[k-1]=w>>>0&255,n(this.temp,this.state,this.buffer,0,k),this.finished=!0}for(var b=0;b<8;b++)p[b*4+0]=this.state[b]>>>24&255,p[b*4+1]=this.state[b]>>>16&255,p[b*4+2]=this.state[b]>>>8&255,p[b*4+3]=this.state[b]>>>0&255;return this},u.prototype.digest=function(){var p=new Uint8Array(this.digestLength);return this.finish(p),p},u.prototype._saveState=function(p){for(var m=0;m<this.state.length;m++)p[m]=this.state[m]},u.prototype._restoreState=function(p,m){for(var h=0;h<this.state.length;h++)this.state[h]=p[h];this.bytesHashed=m,this.finished=!1,this.bufferLength=0},u})();e.Hash=r;var o=(function(){function u(p){this.inner=new r,this.outer=new r,this.blockSize=this.inner.blockSize,this.digestLength=this.inner.digestLength;var m=new Uint8Array(this.blockSize);if(p.length>this.blockSize)new r().update(p).finish(m).clean();else for(var h=0;h<p.length;h++)m[h]=p[h];for(var h=0;h<m.length;h++)m[h]^=54;this.inner.update(m);for(var h=0;h<m.length;h++)m[h]^=106;this.outer.update(m),this.istate=new Uint32Array(8),this.ostate=new Uint32Array(8),this.inner._saveState(this.istate),this.outer._saveState(this.ostate);for(var h=0;h<m.length;h++)m[h]=0}return u.prototype.reset=function(){return this.inner._restoreState(this.istate,this.inner.blockSize),this.outer._restoreState(this.ostate,this.outer.blockSize),this},u.prototype.clean=function(){for(var p=0;p<this.istate.length;p++)this.ostate[p]=this.istate[p]=0;this.inner.clean(),this.outer.clean()},u.prototype.update=function(p){return this.inner.update(p),this},u.prototype.finish=function(p){return this.outer.finished?this.outer.finish(p):(this.inner.finish(p),this.outer.update(p,this.digestLength).finish(p)),this},u.prototype.digest=function(){var p=new Uint8Array(this.digestLength);return this.finish(p),p},u})();e.HMAC=o;function i(u){var p=new r().update(u),m=p.digest();return p.clean(),m}e.hash=i,e.default=i;function a(u,p){var m=new o(u).update(p),h=m.digest();return m.clean(),h}e.hmac=a;function s(u,p,m,h){var S=h[0];if(S===0)throw new Error("hkdf: cannot expand more");p.reset(),S>1&&p.update(u),m&&p.update(m),p.update(h),p.finish(u),h[0]++}var l=new Uint8Array(e.digestLength);function c(u,p,m,h){p===void 0&&(p=l),h===void 0&&(h=32);for(var S=new Uint8Array([1]),w=a(p,u),k=new o(w),b=new Uint8Array(k.digestLength),v=b.length,L=new Uint8Array(h),T=0;T<h;T++)v===b.length&&(s(b,k,m,S),v=0),L[T]=b[v++];return k.clean(),b.fill(0),S.fill(0),L}e.hkdf=c;function d(u,p,m,h){for(var S=new o(u),w=S.digestLength,k=new Uint8Array(4),b=new Uint8Array(w),v=new Uint8Array(w),L=new Uint8Array(h),T=0;T*w<h;T++){var I=T+1;k[0]=I>>>24&255,k[1]=I>>>16&255,k[2]=I>>>8&255,k[3]=I>>>0&255,S.reset(),S.update(p),S.update(k),S.finish(v);for(var O=0;O<w;O++)b[O]=v[O];for(var O=2;O<=m;O++){S.reset(),S.update(v).finish(v);for(var C=0;C<w;C++)b[C]^=v[C]}for(var O=0;O<w&&T*w+O<h;O++)L[T*w+O]=b[O]}for(var T=0;T<w;T++)b[T]=v[T]=0;for(var T=0;T<4;T++)k[T]=0;return S.clean(),L}e.pbkdf2=d})});var Zr=Vt(ct=>{"use strict";Object.defineProperty(ct,"__esModule",{value:!0});ct.Webhook=ct.WebhookVerificationError=void 0;var gy=Bs(),Ms=qs(),hy=Hs(),Js=300,Yr=class e extends Error{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype),this.name="ExtendableError",this.stack=new Error(t).stack}},De=class e extends Yr{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype),this.name="WebhookVerificationError"}};ct.WebhookVerificationError=De;var mn=class e{constructor(t,n){if(!t)throw new Error("Secret can't be empty.");if(n?.format==="raw")t instanceof Uint8Array?this.key=t:this.key=Uint8Array.from(t,r=>r.charCodeAt(0));else{if(typeof t!="string")throw new Error("Expected secret to be of type string");t.startsWith(e.prefix)&&(t=t.substring(e.prefix.length)),this.key=Ms.decode(t)}}verify(t,n){let r={};for(let p of Object.keys(n))r[p.toLowerCase()]=n[p];let o=r["webhook-id"],i=r["webhook-signature"],a=r["webhook-timestamp"];if(!i||!o||!a)throw new De("Missing required headers");let s=this.verifyTimestamp(a),c=this.sign(o,s,t).split(",")[1],d=i.split(" "),u=new globalThis.TextEncoder;for(let p of d){let[m,h]=p.split(",");if(m==="v1"&&(0,gy.timingSafeEqual)(u.encode(h),u.encode(c)))return JSON.parse(t.toString())}throw new De("No matching signature found")}sign(t,n,r){if(typeof r!="string")if(r.constructor.name==="Buffer")r=r.toString();else throw new Error("Expected payload to be of type string or Buffer.");let o=new TextEncoder,i=Math.floor(n.getTime()/1e3),a=o.encode(`${t}.${i}.${r}`);return`v1,${Ms.encode(hy.hmac(this.key,a))}`}verifyTimestamp(t){let n=Math.floor(Date.now()/1e3),r=parseInt(t,10);if(isNaN(r))throw new De("Invalid Signature Headers");if(n-r>Js)throw new De("Message timestamp too old");if(r>n+Js)throw new De("Message timestamp too new");return new Date(r*1e3)}};ct.Webhook=mn;mn.prefix="whsec_"});import zs from"crypto";function Be({body:e,secret:t}){let n=new Xs.Webhook(t),r=`msg_${zs.randomUUID()}`,o=new Date,i=n.sign(r,o,e),a=Math.floor(o.getTime()/1e3);return{"webhook-id":r,"webhook-signature":i,"webhook-timestamp":String(a)}}function eo(){return`whsec_${zs.randomBytes(24).toString("base64")}`}var Xs,fn=f(()=>{"use strict";Xs=ei(Zr(),1)});import{z as ye}from"zod";async function Gs({apiUrl:e,budget:t,observer:n,params:r,webhookSecret:o}){let i=Sy[t],a=performance.now(),s={lastReason:void 0,pollCount:0};for(;performance.now()-a<i.timeoutMs;){s.pollCount+=1;let l=await Ry({apiUrl:e,observer:n,params:r,webhookSecret:o}),c=Ay({observer:n,outcome:l,start:a,state:s});if(c!=null)return c;let d=i.timeoutMs-(performance.now()-a);if(d<=0)break;let u=Math.min(Ty({backoff:i.backoffMs,pollCount:s.pollCount}),d);await vy(u)}return{description:`observer "${n}"`,detail:`budget "${t}" exhausted after ${String(s.pollCount)} poll(s) (${Ks(a)}); last: ${s.lastReason??"no retry reason"}
|
|
100
|
+
\u2192 /ripplo:debug \u2014 check .ripplo/debug/<runId>/ artifacts`,status:"failed"}}function Ay({observer:e,outcome:t,start:n,state:r}){return t.kind==="transport-error"?{description:`observer "${e}"`,detail:`transport error after ${String(r.pollCount)} poll(s): ${t.reason}
|
|
101
101
|
\u2192 /ripplo:setup \u2014 engine endpoint mounted? webhook secret matches?`,status:"failed"}:t.kind==="pass"?{description:`observer "${e}"`,detail:r.pollCount>1?`passed after ${String(r.pollCount)} polls (${Ks(n)})`:void 0,status:"passed"}:t.kind==="fail"?{description:`observer "${e}"`,detail:`failed (invariant): ${t.reason} (after ${String(r.pollCount)} poll(s)) \u2014 ctx.fail stops polling immediately and is reserved for invariant violations (wrong shape, contradictory/forbidden state). For transient conditions like "not yet committed", "status not yet X", or "row not found", use ctx.retry(reason) so the runtime keeps polling until the budget expires.
|
|
102
|
-
\u2192 /ripplo:create`,status:"failed"}:(r.lastReason=t.reason,null)}async function Ty({apiUrl:e,observer:t,params:n,webhookSecret:r}){let o=JSON.stringify({observer:t,params:n});try{let i=await fetch(`${e}/execute-observer`,{body:o,headers:{"Content-Type":"application/json",...Be({body:o,secret:r})},method:"PUT",signal:AbortSignal.timeout(Sy)});if(!i.ok){let l=await i.text().catch(()=>"");return{kind:"transport-error",reason:`status ${String(i.status)}: ${l.slice(0,200)}`}}let a=await i.json(),s=Ay.safeParse(a);return s.success?!s.data.success||s.data.outcome==null?{kind:"transport-error",reason:s.data.error??"engine reported failure without outcome"}:s.data.outcome:{kind:"transport-error",reason:`invalid response shape: ${s.error.message}`}}catch(i){let a=i instanceof Error?i.message:String(i);return A.error("observer request failed: %s",a),{kind:"transport-error",reason:a}}}function vy({backoff:e,pollCount:t}){let n=Math.min(t-1,e.length-1);return e[n]??1e3}function Ks(e){return`${String(Math.round(performance.now()-e))}ms`}async function Ny(e){return new Promise(t=>setTimeout(t,e))}var Sy,wy,by,Ay,Qs=f(()=>{"use strict";Y();fn();Sy=15e4,wy={async:{backoffMs:[500,1e3,2e3,5e3],timeoutMs:12e4},fast:{backoffMs:[100,250,500,1e3],timeoutMs:5e3},slow:{backoffMs:[250,500,1e3,2e3],timeoutMs:3e4}},by=ye.discriminatedUnion("kind",[ye.object({kind:ye.literal("pass")}),ye.object({kind:ye.literal("retry"),reason:ye.string()}),ye.object({kind:ye.literal("fail"),reason:ye.string()})]),Ay=ye.object({error:ye.string().optional(),outcome:by.optional(),success:ye.boolean()})});async function to({failFast:e,observerTransport:t,onStep:n,page:r,spec:o,variables:i}){let a=performance.now();return xy({currentId:o.entryNode,failFast:e,observerTransport:t,onStep:n,page:r,runStartTime:a,spec:o,variables:i})}function Ly({onStep:e,steps:t,target:n}){t.forEach(r=>{let o={...r,stepIndex:n.length};n.push(o),e?.(o)})}async function xy({currentId:e,failFast:t,observerTransport:n,onStep:r,page:o,runStartTime:i,spec:a,variables:s}){let l=[],c=s,d=e;for(;d!=null;){let u=a.nodes[d];if(u==null)throw new Error(`Node "${d}" not found in spec`);let p=d,m=u.label??`${u.type} (${d})`;A.info("Executing node: %s [%s]",m,u.type);let h=await Py({node:u,nodeId:p,observerTransport:n,page:o,runStartTime:i,variables:c});if(Ly({onStep:r,steps:[h],target:l}),c=h.variables,t&&h.status==="failed")break;d=u.next}return{steps:l,variables:c}}async function Py({node:e,nodeId:t,observerTransport:n,page:r,runStartTime:o,variables:i}){let a=performance.now(),s=e.label??`${e.type} (${e.id})`,l=Cy,c=Jt({node:e,page:r});try{let d=await Ey({node:e,observerTransport:n,page:r,timeout:l,variables:i}),u=Math.round(performance.now()-a),p=d.assertions.some(h=>h.status==="failed"),m=await Z({label:`Snapshot [${s}]`,fn:()=>_e({page:r,runStartTime:o,targets:c})});return{annotations:m.annotations,assertions:d.assertions,detail:void 0,duration:u,nodeId:t,nodeType:e.type,screenshotBase64:m.screenshotBase64,snapshotTimestamp:m.snapshotTimestamp,status:p?"failed":"passed",stepIndex:0,title:s,url:m.url,variables:d.variables,viewportHeight:m.viewportHeight,viewportWidth:m.viewportWidth}}catch(d){let u=Math.round(performance.now()-a),p=d instanceof Error?d.message:String(d),m=await Z({label:`Snapshot [${s}] (error)`,fn:()=>_e({page:r,runStartTime:o,targets:c})});return{annotations:m.annotations,assertions:[],detail:p,duration:u,nodeId:t,nodeType:e.type,screenshotBase64:m.screenshotBase64,snapshotTimestamp:m.snapshotTimestamp,status:"failed",stepIndex:0,title:s,url:m.url,variables:i,viewportHeight:m.viewportHeight,viewportWidth:m.viewportWidth}}}async function Ey({node:e,observerTransport:t,page:n,timeout:r,variables:o}){if(Oy(e)){let a=await tr({node:e,page:n,timeout:r,variables:o});return{assertions:[],variables:a.variables}}return{assertions:await _y({node:e,observerTransport:t,page:n,timeout:r,variables:o}),variables:o}}function Oy(e){return["goto","click","dblclick","fill","select","hover","press","check","uncheck","clear","rightClick","handleDialog","clipboard","setPermission","setViewport","fail","setVariable","extractText","upload","drag","scrollIntoView","type","focus"].includes(e.type)}function Iy(e){return e.type.startsWith("assert")}async function _y({node:e,observerTransport:t,page:n,timeout:r,variables:o}){if(!Iy(e))throw new Error(`Unknown node type: ${e.type}`);let i=e;switch(i.type){case"assertVisible":case"assertNotVisible":case"assertEnabled":case"assertDisabled":case"assertChecked":case"assertNotChecked":case"assertFocused":case"assertNotFocused":return jy({assertNode:i,page:n,timeout:r,variables:o});case"assertText":{let a=ne({ref:i.expected,variables:o});return[await vr({expected:a,locator:F({locator:i.locator,page:n,variables:o}),operator:i.operator,timeout:r})]}case"assertUrl":{let a=ne({ref:i.expected,variables:o});return[Yt({expected:a,operator:i.operator,url:n.url()})]}case"assertTitle":{let a=ne({ref:i.expected,variables:o});return[Yt({expected:a,operator:i.operator,url:await n.title()})]}case"assertCount":{let a=er({ref:i.expected,variables:o});return[await Nr({expected:a,locator:F({locator:i.locator,page:n,variables:o}),operator:i.operator})]}case"assertValue":{let a=ne({ref:i.expected,variables:o});return[await Cr({expected:a,locator:F({locator:i.locator,page:n,variables:o}),operator:i.operator,timeout:r})]}case"assertAttribute":{let a=ne({ref:i.expected,variables:o});return[await ms({attribute:i.attribute,expected:a,locator:F({locator:i.locator,page:n,variables:o}),operator:i.operator,timeout:r})]}case"assertObserver":{if(t==null)return[{description:`observer "${i.observer}"`,detail:"observer transport not configured \u2014 set engineUrl + webhookSecret in ripplo.config",status:"failed"}];let a={};return Object.entries(i.params).forEach(([s,l])=>{a[s]=ne({ref:l,variables:o})}),[await Gs({apiUrl:t.apiUrl,budget:i.budget,observer:i.observer,params:a,webhookSecret:t.webhookSecret})]}}}async function jy({assertNode:e,page:t,timeout:n,variables:r}){let o=Uy[e.type];return[await o({locator:F({locator:e.locator,page:t,variables:r}),timeout:n})]}var Cy,Uy,no=f(()=>{"use strict";nr();Qs();Pr();at();Y();st();Tt();Ie();Cy=1e4;Uy={assertChecked:gs,assertDisabled:ys,assertEnabled:fs,assertFocused:ks,assertNotChecked:hs,assertNotFocused:Ss,assertNotVisible:xr,assertVisible:Lr}});async function ro({baseUrl:e,browser:t,cookies:n,extraVariables:r,observerTransport:o,onStep:i,runId:a,spec:s}){let l=await t.newContext({baseURL:e});A.info("Browser context created"),n.length>0&&await l.addCookies(n);let c=await l.newPage();A.info("Page created");let d=vt(c),u=[];function p(v){i?.(v),u.push(Gt({context:l,page:c,runId:a,stepIndex:v.stepIndex,stepResult:v}))}let m=$y(r,s.variableNamespaces),h={...At({defs:s.variables}),...m};A.info("Starting graph execution (entry: %s)",s.entryNode);let S=await to({failFast:!0,observerTransport:o,onStep:p,page:c,spec:s,variables:h});await Promise.allSettled(u);let w=S.steps.filter(v=>v.status==="passed").length,k=S.steps.filter(v=>v.status==="failed").length,b={duration:S.steps.reduce((v,L)=>v+L.duration,0),failCount:k,passCount:w,runId:a,status:k>0?"failed":"passed",workflowName:""};return await Kt({monitor:d,runId:a,steps:S.steps,summary:b}),await l.close(),S.steps}function $y(e,t){if(e==null||t==null)return{};let n=new Map;Object.entries(t).forEach(([o,i])=>{n.set(i,o)});let r={};return Object.entries(e).forEach(([o,i])=>{let a=n.get(o);a!=null&&(r[a]={...r[a],...i})}),r}var oo=f(()=>{"use strict";ur();Qt();no();Y();Ie()});import{parseSetCookie as Dy}from"set-cookie-parser";import{z as de}from"zod";async function io({project:e,webhookSecret:t,workflowSlug:n}){let r={apiUrl:void 0,cookies:[],data:{},executed:[]},o=e.workflows.find(s=>s.slug===n);if(o==null)return r;let i=e.engineBaseUrl.length===0?void 0:e.engineBaseUrl,a=o.preconditions;return a.length===0?{...r,apiUrl:i}:i==null?r:Zs({apiUrl:i,preconditionNames:a,webhookSecret:t})}async function ao({apiUrl:e,cookies:t,data:n,executed:r,webhookSecret:o}){if(r.length!==0)try{let i=JSON.stringify({data:n,preconditions:r}),a=await fetch(`${e}/teardown-preconditions`,{body:i,headers:{"Content-Type":"application/json",...Fy({cookies:t}),...Be({body:i,secret:o})},method:"PUT",signal:AbortSignal.timeout(Ys)});a.ok||A.error("Teardown returned %s",String(a.status))}catch{A.error("Teardown request failed")}}async function Zs({apiUrl:e,preconditionNames:t,webhookSecret:n}){let r=performance.now(),o=JSON.stringify({preconditions:t}),i=await fetch(`${e}/execute-preconditions`,{body:o,headers:{"Content-Type":"application/json",...Be({body:o,secret:n})},method:"PUT",signal:AbortSignal.timeout(Ys)});if(!i.ok){let c=await Wy(i);throw new Error(`execute-preconditions returned ${String(i.status)}: ${c}`)}let a=await i.json(),s=By.safeParse(a);if(!s.success)throw new Error(`execute-preconditions response has invalid shape: ${s.error.message}`);if(!s.data.success){let c=s.data.error??"no error detail";throw new Error(`Precondition batch failed: ${c}`)}let l=Hy({domain:new URL(e).hostname,res:i});return A.info("Preconditions resolved: %s (%dms)",s.data.executed.join(", "),Math.round(performance.now()-r)),{apiUrl:e,cookies:l,data:s.data.data,executed:s.data.executed}}async function Wy(e){let t=await e.text().catch(()=>"");if(t.length===0)return"no body";let n=qy(t),r=n==null?null:Vy.safeParse(n);return r!=null&&r.success?r.data.error:t.slice(0,500)}function qy(e){try{return JSON.parse(e)}catch{return null}}function Fy({cookies:e}){return e.length===0?{}:{Cookie:e.map(n=>`${n.name}=${n.value}`).join("; ")}}function Hy({domain:e,res:t}){let n=t.headers.getSetCookie();return Dy(n,{decodeValues:!1}).map(o=>My({cookie:o,domain:e}))}function My({cookie:e,domain:t}){let n={domain:e.domain??t,httpOnly:e.httpOnly??!1,name:e.name,path:e.path??"/",secure:e.secure??!1,value:e.value};return e.sameSite!=null&&(n.sameSite=zy({raw:e.sameSite})),e.expires!=null?n.expires=Math.floor(e.expires.getTime()/1e3):e.maxAge!=null&&(n.expires=Math.floor(Date.now()/1e3)+e.maxAge),n}function zy({raw:e}){return Jy[e.toLowerCase()]??"Lax"}async function so({engineBaseUrl:e,preconditionNames:t,webhookSecret:n}){let r=e.length===0?void 0:e;return r==null||t.length===0?{apiUrl:r,cookies:[],data:{},executed:[]}:Zs({apiUrl:r,preconditionNames:t,webhookSecret:n})}var Ys,By,Vy,Jy,lo=f(()=>{"use strict";Y();fn();Ys=3e4,By=de.object({data:de.record(de.string(),de.record(de.string(),de.string())),error:de.string().optional(),executed:de.array(de.string()),runId:de.string(),success:de.boolean()});Vy=de.object({error:de.string()});Jy={lax:"Lax",none:"None",strict:"Strict"}});import{graphql as co}from"gql.tada";async function po({agentProfileId:e,config:t,runId:n}){let r=await $({config:t,document:Gy,variables:{agentProfileId:e??null,platform:"chromium",runId:n}});if(r.startRun==null)throw new Error("Failed to start run");let o=r.startRun.id,i=[];function a(c){let d=Xy({config:t,runResultId:o,steps:[c]}).catch(u=>{A.error(u,"Failed to submit step %d",c.stepIndex)});i.push(d)}async function s(){await Promise.all(i)}async function l({statusOverride:c,steps:d,summary:u}){await Z({label:`flushSteps (${String(i.length)} steps)`,fn:()=>Promise.all(i)});let p=d.filter(w=>w.status==="passed").length,m=d.filter(w=>w.status==="failed").length,h=d.reduce((w,k)=>w+k.duration,0),S=c??(m>0?"failed":"passed");await Z({label:"completeRun",fn:()=>$({config:t,document:Qy,variables:{duration:h,failCount:m,passCount:p,runResultId:o,status:S,summary:u??null,warnCount:0}})})}return{complete:l,enqueueStep:a,flushSteps:s,runResultId:o}}async function Xy({config:e,runResultId:t,steps:n}){let r=n.map(o=>({annotations:o.annotations.map(i=>({height:i.height,label:i.label,type:i.type,width:i.width,x:i.x,y:i.y})),assertions:o.assertions.map(i=>({description:i.description,detail:i.detail,status:i.status})),detail:o.detail,duration:o.duration,nodeType:o.nodeType,screenshotBase64:o.screenshotBase64,snapshotTimestamp:o.snapshotTimestamp,status:o.status,stepIndex:o.stepIndex,title:o.title,url:o.url,viewportHeight:o.viewportHeight,viewportWidth:o.viewportWidth}));await $({config:e,document:Ky,variables:{runResultId:t,steps:r}})}var Gy,Ky,Qy,uo=f(()=>{"use strict";Lt();Y();st();Gy=co(`
|
|
102
|
+
\u2192 /ripplo:create`,status:"failed"}:(r.lastReason=t.reason,null)}async function Ry({apiUrl:e,observer:t,params:n,webhookSecret:r}){let o=JSON.stringify({observer:t,params:n});try{let i=await fetch(`${e}/execute-observer`,{body:o,headers:{"Content-Type":"application/json",...Be({body:o,secret:r})},method:"PUT",signal:AbortSignal.timeout(ky)});if(!i.ok){let l=await i.text().catch(()=>"");return{kind:"transport-error",reason:`status ${String(i.status)}: ${l.slice(0,200)}`}}let a=await i.json(),s=by.safeParse(a);return s.success?!s.data.success||s.data.outcome==null?{kind:"transport-error",reason:s.data.error??"engine reported failure without outcome"}:s.data.outcome:{kind:"transport-error",reason:`invalid response shape: ${s.error.message}`}}catch(i){let a=i instanceof Error?i.message:String(i);return A.error("observer request failed: %s",a),{kind:"transport-error",reason:a}}}function Ty({backoff:e,pollCount:t}){let n=Math.min(t-1,e.length-1);return e[n]??1e3}function Ks(e){return`${String(Math.round(performance.now()-e))}ms`}async function vy(e){return new Promise(t=>setTimeout(t,e))}var ky,Sy,wy,by,Qs=f(()=>{"use strict";Y();fn();ky=15e4,Sy={async:{backoffMs:[500,1e3,2e3,5e3],timeoutMs:12e4},fast:{backoffMs:[100,250,500,1e3],timeoutMs:5e3},slow:{backoffMs:[250,500,1e3,2e3],timeoutMs:3e4}},wy=ye.discriminatedUnion("kind",[ye.object({kind:ye.literal("pass")}),ye.object({kind:ye.literal("retry"),reason:ye.string()}),ye.object({kind:ye.literal("fail"),reason:ye.string()})]),by=ye.object({error:ye.string().optional(),outcome:wy.optional(),success:ye.boolean()})});async function to({failFast:e,observerTransport:t,onStep:n,page:r,spec:o,variables:i}){let a=performance.now();return Ly({currentId:o.entryNode,failFast:e,observerTransport:t,onStep:n,page:r,runStartTime:a,spec:o,variables:i})}function Cy({onStep:e,steps:t,target:n}){t.forEach(r=>{let o={...r,stepIndex:n.length};n.push(o),e?.(o)})}async function Ly({currentId:e,failFast:t,observerTransport:n,onStep:r,page:o,runStartTime:i,spec:a,variables:s}){let l=[],c=s,d=e;for(;d!=null;){let u=a.nodes[d];if(u==null)throw new Error(`Node "${d}" not found in spec`);let p=d,m=u.label??`${u.type} (${d})`;A.info("Executing node: %s [%s]",m,u.type);let h=await xy({node:u,nodeId:p,observerTransport:n,page:o,runStartTime:i,variables:c});if(Cy({onStep:r,steps:[h],target:l}),c=h.variables,t&&h.status==="failed")break;d=u.next}return{steps:l,variables:c}}async function xy({node:e,nodeId:t,observerTransport:n,page:r,runStartTime:o,variables:i}){let a=performance.now(),s=e.label??`${e.type} (${e.id})`,l=Ny,c=Jt({node:e,page:r});try{let d=await Py({node:e,observerTransport:n,page:r,timeout:l,variables:i}),u=Math.round(performance.now()-a),p=d.assertions.some(h=>h.status==="failed"),m=await Z({label:`Snapshot [${s}]`,fn:()=>_e({page:r,runStartTime:o,targets:c})});return{annotations:m.annotations,assertions:d.assertions,detail:void 0,duration:u,nodeId:t,nodeType:e.type,screenshotBase64:m.screenshotBase64,snapshotTimestamp:m.snapshotTimestamp,status:p?"failed":"passed",stepIndex:0,title:s,url:m.url,variables:d.variables,viewportHeight:m.viewportHeight,viewportWidth:m.viewportWidth}}catch(d){let u=Math.round(performance.now()-a),p=d instanceof Error?d.message:String(d),m=await Z({label:`Snapshot [${s}] (error)`,fn:()=>_e({page:r,runStartTime:o,targets:c})});return{annotations:m.annotations,assertions:[],detail:p,duration:u,nodeId:t,nodeType:e.type,screenshotBase64:m.screenshotBase64,snapshotTimestamp:m.snapshotTimestamp,status:"failed",stepIndex:0,title:s,url:m.url,variables:i,viewportHeight:m.viewportHeight,viewportWidth:m.viewportWidth}}}async function Py({node:e,observerTransport:t,page:n,timeout:r,variables:o}){if(Ey(e)){let a=await tr({node:e,page:n,timeout:r,variables:o});return{assertions:[],variables:a.variables}}return{assertions:await Iy({node:e,observerTransport:t,page:n,timeout:r,variables:o}),variables:o}}function Ey(e){return["goto","click","dblclick","fill","select","hover","press","check","uncheck","clear","rightClick","handleDialog","clipboard","setPermission","setViewport","fail","setVariable","extractText","upload","drag","scrollIntoView","type","focus"].includes(e.type)}function Oy(e){return e.type.startsWith("assert")}async function Iy({node:e,observerTransport:t,page:n,timeout:r,variables:o}){if(!Oy(e))throw new Error(`Unknown node type: ${e.type}`);let i=e;switch(i.type){case"assertVisible":case"assertNotVisible":case"assertEnabled":case"assertDisabled":case"assertChecked":case"assertNotChecked":case"assertFocused":case"assertNotFocused":return Uy({assertNode:i,page:n,timeout:r,variables:o});case"assertText":{let a=ne({ref:i.expected,variables:o});return[await vr({expected:a,locator:F({locator:i.locator,page:n,variables:o}),operator:i.operator,timeout:r})]}case"assertUrl":{let a=ne({ref:i.expected,variables:o});return[Yt({expected:a,operator:i.operator,url:n.url()})]}case"assertTitle":{let a=ne({ref:i.expected,variables:o});return[Yt({expected:a,operator:i.operator,url:await n.title()})]}case"assertCount":{let a=er({ref:i.expected,variables:o});return[await Nr({expected:a,locator:F({locator:i.locator,page:n,variables:o}),operator:i.operator})]}case"assertValue":{let a=ne({ref:i.expected,variables:o});return[await Cr({expected:a,locator:F({locator:i.locator,page:n,variables:o}),operator:i.operator,timeout:r})]}case"assertAttribute":{let a=ne({ref:i.expected,variables:o});return[await ms({attribute:i.attribute,expected:a,locator:F({locator:i.locator,page:n,variables:o}),operator:i.operator,timeout:r})]}case"assertObserver":{if(t==null)return[{description:`observer "${i.observer}"`,detail:"observer transport not configured \u2014 set engineUrl + webhookSecret in ripplo.config",status:"failed"}];let a={};return Object.entries(i.params).forEach(([s,l])=>{a[s]=ne({ref:l,variables:o})}),[await Gs({apiUrl:t.apiUrl,budget:i.budget,observer:i.observer,params:a,webhookSecret:t.webhookSecret})]}}}async function Uy({assertNode:e,page:t,timeout:n,variables:r}){let o=_y[e.type];return[await o({locator:F({locator:e.locator,page:t,variables:r}),timeout:n})]}var Ny,_y,no=f(()=>{"use strict";nr();Qs();Pr();at();Y();st();Tt();Ie();Ny=1e4;_y={assertChecked:gs,assertDisabled:ys,assertEnabled:fs,assertFocused:ks,assertNotChecked:hs,assertNotFocused:Ss,assertNotVisible:xr,assertVisible:Lr}});async function ro({baseUrl:e,browser:t,cookies:n,extraVariables:r,observerTransport:o,onStep:i,runId:a,spec:s}){let l=await t.newContext({baseURL:e});A.info("Browser context created"),n.length>0&&await l.addCookies(n);let c=await l.newPage();A.info("Page created");let d=vt(c),u=[];function p(v){i?.(v),u.push(Gt({context:l,page:c,runId:a,stepIndex:v.stepIndex,stepResult:v}))}let m=jy(r,s.variableNamespaces),h={...At({defs:s.variables}),...m};A.info("Starting graph execution (entry: %s)",s.entryNode);let S=await to({failFast:!0,observerTransport:o,onStep:p,page:c,spec:s,variables:h});await Promise.allSettled(u);let w=S.steps.filter(v=>v.status==="passed").length,k=S.steps.filter(v=>v.status==="failed").length,b={duration:S.steps.reduce((v,L)=>v+L.duration,0),failCount:k,passCount:w,runId:a,status:k>0?"failed":"passed",workflowName:""};return await Kt({monitor:d,runId:a,steps:S.steps,summary:b}),await l.close(),S.steps}function jy(e,t){if(e==null||t==null)return{};let n=new Map;Object.entries(t).forEach(([o,i])=>{n.set(i,o)});let r={};return Object.entries(e).forEach(([o,i])=>{let a=n.get(o);a!=null&&(r[a]={...r[a],...i})}),r}var oo=f(()=>{"use strict";ur();Qt();no();Y();Ie()});import{parseSetCookie as $y}from"set-cookie-parser";import{z as de}from"zod";async function io({project:e,webhookSecret:t,workflowSlug:n}){let r={apiUrl:void 0,cookies:[],data:{},executed:[]},o=e.workflows.find(s=>s.slug===n);if(o==null)return r;let i=e.engineBaseUrl.length===0?void 0:e.engineBaseUrl,a=o.preconditions;return a.length===0?{...r,apiUrl:i}:i==null?r:Zs({apiUrl:i,preconditionNames:a,webhookSecret:t})}async function ao({apiUrl:e,cookies:t,data:n,executed:r,webhookSecret:o}){if(r.length!==0)try{let i=JSON.stringify({data:n,preconditions:r}),a=await fetch(`${e}/teardown-preconditions`,{body:i,headers:{"Content-Type":"application/json",...qy({cookies:t}),...Be({body:i,secret:o})},method:"PUT",signal:AbortSignal.timeout(Ys)});a.ok||A.error("Teardown returned %s",String(a.status))}catch{A.error("Teardown request failed")}}async function Zs({apiUrl:e,preconditionNames:t,webhookSecret:n}){let r=performance.now(),o=JSON.stringify({preconditions:t}),i=await fetch(`${e}/execute-preconditions`,{body:o,headers:{"Content-Type":"application/json",...Be({body:o,secret:n})},method:"PUT",signal:AbortSignal.timeout(Ys)});if(!i.ok){let c=await Vy(i);throw new Error(`execute-preconditions returned ${String(i.status)}: ${c}`)}let a=await i.json(),s=Dy.safeParse(a);if(!s.success)throw new Error(`execute-preconditions response has invalid shape: ${s.error.message}`);if(!s.data.success){let c=s.data.error??"no error detail";throw new Error(`Precondition batch failed: ${c}`)}let l=Fy({domain:new URL(e).hostname,res:i});return A.info("Preconditions resolved: %s (%dms)",s.data.executed.join(", "),Math.round(performance.now()-r)),{apiUrl:e,cookies:l,data:s.data.data,executed:s.data.executed}}async function Vy(e){let t=await e.text().catch(()=>"");if(t.length===0)return"no body";let n=Wy(t),r=n==null?null:By.safeParse(n);return r!=null&&r.success?r.data.error:t.slice(0,500)}function Wy(e){try{return JSON.parse(e)}catch{return null}}function qy({cookies:e}){return e.length===0?{}:{Cookie:e.map(n=>`${n.name}=${n.value}`).join("; ")}}function Fy({domain:e,res:t}){let n=t.headers.getSetCookie();return $y(n,{decodeValues:!1}).map(o=>Hy({cookie:o,domain:e}))}function Hy({cookie:e,domain:t}){let n={domain:e.domain??t,httpOnly:e.httpOnly??!1,name:e.name,path:e.path??"/",secure:e.secure??!1,value:e.value};return e.sameSite!=null&&(n.sameSite=Jy({raw:e.sameSite})),e.expires!=null?n.expires=Math.floor(e.expires.getTime()/1e3):e.maxAge!=null&&(n.expires=Math.floor(Date.now()/1e3)+e.maxAge),n}function Jy({raw:e}){return My[e.toLowerCase()]??"Lax"}async function so({engineBaseUrl:e,preconditionNames:t,webhookSecret:n}){let r=e.length===0?void 0:e;return r==null||t.length===0?{apiUrl:r,cookies:[],data:{},executed:[]}:Zs({apiUrl:r,preconditionNames:t,webhookSecret:n})}var Ys,Dy,By,My,lo=f(()=>{"use strict";Y();fn();Ys=3e4,Dy=de.object({data:de.record(de.string(),de.record(de.string(),de.string())),error:de.string().optional(),executed:de.array(de.string()),runId:de.string(),success:de.boolean()});By=de.object({error:de.string()});My={lax:"Lax",none:"None",strict:"Strict"}});import{graphql as co}from"gql.tada";async function po({agentProfileId:e,config:t,runId:n}){let r=await $({config:t,document:Xy,variables:{agentProfileId:e??null,platform:"chromium",runId:n}});if(r.startRun==null)throw new Error("Failed to start run");let o=r.startRun.id,i=[];function a(c){let d=zy({config:t,runResultId:o,steps:[c]}).catch(u=>{A.error(u,"Failed to submit step %d",c.stepIndex)});i.push(d)}async function s(){await Promise.all(i)}async function l({statusOverride:c,steps:d,summary:u}){await Z({label:`flushSteps (${String(i.length)} steps)`,fn:()=>Promise.all(i)});let p=d.filter(w=>w.status==="passed").length,m=d.filter(w=>w.status==="failed").length,h=d.reduce((w,k)=>w+k.duration,0),S=c??(m>0?"failed":"passed");await Z({label:"completeRun",fn:()=>$({config:t,document:Ky,variables:{duration:h,failCount:m,passCount:p,runResultId:o,status:S,summary:u??null,warnCount:0}})})}return{complete:l,enqueueStep:a,flushSteps:s,runResultId:o}}async function zy({config:e,runResultId:t,steps:n}){let r=n.map(o=>({annotations:o.annotations.map(i=>({height:i.height,label:i.label,type:i.type,width:i.width,x:i.x,y:i.y})),assertions:o.assertions.map(i=>({description:i.description,detail:i.detail,status:i.status})),detail:o.detail,duration:o.duration,nodeType:o.nodeType,screenshotBase64:o.screenshotBase64,snapshotTimestamp:o.snapshotTimestamp,status:o.status,stepIndex:o.stepIndex,title:o.title,url:o.url,viewportHeight:o.viewportHeight,viewportWidth:o.viewportWidth}));await $({config:e,document:Gy,variables:{runResultId:t,steps:r}})}var Xy,Gy,Ky,uo=f(()=>{"use strict";Lt();Y();st();Xy=co(`
|
|
103
103
|
mutation StartRunCLI($runId: String!, $platform: String!, $agentProfileId: String) {
|
|
104
104
|
startRun(runId: $runId, platform: $platform, agentProfileId: $agentProfileId) {
|
|
105
105
|
id
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
|
-
`),
|
|
108
|
+
`),Gy=co(`
|
|
109
109
|
mutation SubmitRunStepsCLI($runResultId: String!, $steps: [StepInput!]!) {
|
|
110
110
|
submitRunSteps(runResultId: $runResultId, steps: $steps)
|
|
111
111
|
}
|
|
112
|
-
`),
|
|
112
|
+
`),Ky=co(`
|
|
113
113
|
mutation CompleteRunCLI(
|
|
114
114
|
$runResultId: String!
|
|
115
115
|
$status: String!
|
|
@@ -132,7 +132,7 @@ ${n}`].join(`
|
|
|
132
132
|
status
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
|
-
`)});import{z as Te}from"zod";import{graphql as hn,readFragment as yn}from"gql.tada";async function mo({agentProfileDescription:e,agentProfileId:t,baseUrl:n,browser:r,config:o,headed:i,preconditionNames:a,runId:s,webhookSecret:l,workflowId:c}){let d="unknown",u,p,m=!1;try{m=r==null,p=
|
|
135
|
+
`)});import{z as Te}from"zod";import{graphql as hn,readFragment as yn}from"gql.tada";async function mo({agentProfileDescription:e,agentProfileId:t,baseUrl:n,browser:r,config:o,headed:i,preconditionNames:a,runId:s,webhookSecret:l,workflowId:c}){let d="unknown",u,p,m=!1;try{m=r==null,p=eg({externalBrowser:r,headed:i});let h=a==null?void 0:Z({label:"Preconditions resolved",fn:()=>so({engineBaseUrl:o.engineUrl,preconditionNames:a,webhookSecret:l})}),[{project:S,workflow:w},k]=await Promise.all([Z({label:"Run context resolved",fn:()=>sg({config:o,workflowId:c})}),Z({label:"Streaming run started",fn:()=>po({agentProfileId:t,config:o,runId:s})}),Ir({appUrl:n})]);d=w.name,u=k;let b=cg(w.spec);A.info("Executing workflow: %s",w.name),await ug(ng({agentProfileDescription:e,agentProfileId:t,baseUrl:n,browserPromise:p,config:o,headed:i,ownsBrowser:m,preconditionPromise:h,project:S,runId:s,specData:b,streaming:u,webhookSecret:l,workflow:w}),pg())}catch(h){throw await tg({browserPromise:p,error:h,ownsBrowser:m,runId:s,streaming:u,workflowName:d}),h}}function eg({externalBrowser:e,headed:t}){return e!=null?Promise.resolve(e):Z({label:"Browser launched",fn:()=>Ue({headed:t})})}async function tg({browserPromise:e,error:t,ownsBrowser:n,runId:r,streaming:o,workflowName:i}){let a=t instanceof Error?t.message:String(t),s=t instanceof Error?t.stack:void 0;await us({error:a,runId:r,stack:s,workflowName:i}),o!=null&&await o.complete({statusOverride:"failed",steps:[],summary:a}).catch(()=>{}),n&&e!=null&&await(await e.catch(()=>{}))?.close()}async function ng({agentProfileDescription:e,agentProfileId:t,baseUrl:n,browserPromise:r,config:o,headed:i,ownsBrowser:a,preconditionPromise:s,project:l,runId:c,specData:d,streaming:u,webhookSecret:p,workflow:m}){let h=s??Z({label:"Preconditions resolved",fn:()=>io({project:ig(l),webhookSecret:p,workflowSlug:m.slug})}),[S,w]=await Promise.all([h,r]);if(t!=null){a&&await w.close(),await rg({agentProfileDescription:e,agentProfileId:t,baseUrl:n,config:o,headed:i,preconditionResult:S,runId:c,specData:d,streaming:u,webhookSecret:p,workflow:m});return}await ag({baseUrl:n,browser:w,preconditionResult:S,runId:c,specData:d,streaming:u,webhookSecret:p})}async function rg({agentProfileDescription:e,agentProfileId:t,baseUrl:n,config:r,headed:o,preconditionResult:i,runId:a,specData:s,streaming:l,webhookSecret:c,workflow:d}){let u=e!=null&&e.length>0?e:await lg({config:r,profileId:t});await Rr({baseUrl:n,cookies:i.cookies,executedPreconditions:i.executed,extraVariables:i.data,headed:o,runId:a,serverUrl:r.ripploServerUrl,spec:s,streaming:l,systemPrompt:u,token:r.token,workflowContext:{description:d.name,expectedOutcome:d.name,name:d.name}}),await tl({preconditionResult:i,webhookSecret:c})}function ig(e){let t=(e.workflows??[]).map(n=>{let r=yn(gn,n);return og.parse(r)});return{engineBaseUrl:e.engineBaseUrl,workflows:t}}async function ag({baseUrl:e,browser:t,preconditionResult:n,runId:r,specData:o,streaming:i,webhookSecret:a}){let s=await Z({label:"Spec executed",fn:()=>ro({baseUrl:e,browser:t,cookies:n.cookies,extraVariables:n.data,observerTransport:n.apiUrl==null?void 0:{apiUrl:n.apiUrl,webhookSecret:a},onStep:i.enqueueStep,runId:r,spec:o})});await tl({preconditionResult:n,webhookSecret:a}),await i.complete({statusOverride:void 0,steps:s,summary:void 0});let l=s.filter(d=>d.status==="passed").length,c=s.filter(d=>d.status==="failed").length;A.info("Run complete: %d passed, %d failed",l,c)}async function tl({preconditionResult:e,webhookSecret:t}){e.apiUrl!=null&&await ao({apiUrl:e.apiUrl,cookies:e.cookies,data:e.data,executed:e.executed,webhookSecret:t})}async function sg({config:e,workflowId:t}){let n=await $({config:e,document:Yy,variables:{projectId:e.projectId}});if(n.project==null)throw new Error("Project not found");let o={...yn(el,n.project),...e.engineUrl.length>0?{engineBaseUrl:e.engineUrl}:{}},a=(o.workflows??[]).find(l=>yn(gn,l).id===t);if(a==null)throw new Error(`Workflow ${t} not found`);let s=yn(gn,a);return{project:o,workflow:s}}async function lg({config:e,profileId:t}){let n=await $({config:e,document:Zy,variables:{id:t}});if(n.agentProfile==null)throw new Error(`Agent profile not found: ${t}`);let r=n.agentProfile,o=r.description;if(o==null||o.length===0)throw new Error(`Agent profile "${r.name}" has no description`);return A.info("Using agent profile: %s",r.name),Sr({description:o,output:r.output??void 0,successCriteria:r.successCriteria??void 0})}function cg(e){if(e==null)throw new Error("Workflow has no spec");return Gr.decode(e)}function pg(){return dg.parse(process.env.RIPPLO_RUN_TIMEOUT_MS)}async function ug(e,t){let n,r=new Promise((o,i)=>{n=setTimeout(()=>{i(new Error(`Run timed out after ${String(t)}ms`))},t)});try{await Promise.race([e,r])}finally{n!=null&&clearTimeout(n)}}var Qy,gn,el,Yy,Zy,og,dg,nl=f(()=>{"use strict";$s();wr();Tr();Nt();_r();Lt();Qt();oo();Y();st();lo();uo();Qy=12e4,gn=hn(`
|
|
136
136
|
fragment WorkflowRun on Workflow {
|
|
137
137
|
id
|
|
138
138
|
slug
|
|
@@ -153,13 +153,13 @@ ${n}`].join(`
|
|
|
153
153
|
...WorkflowRun
|
|
154
154
|
}
|
|
155
155
|
}
|
|
156
|
-
`,[gn]),
|
|
156
|
+
`,[gn]),Yy=hn(`
|
|
157
157
|
query ProjectRun($projectId: String!) {
|
|
158
158
|
project(id: $projectId) {
|
|
159
159
|
...ProjectRun
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
|
-
`,[el]),
|
|
162
|
+
`,[el]),Zy=hn(`
|
|
163
163
|
query AgentProfileRun($id: String!) {
|
|
164
164
|
agentProfile(id: $id) {
|
|
165
165
|
id
|
|
@@ -169,13 +169,13 @@ ${n}`].join(`
|
|
|
169
169
|
successCriteria
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
|
-
`);
|
|
172
|
+
`);og=Te.object({preconditions:Te.array(Te.string()),requiresKeys:Te.array(Te.object({namespace:Te.string(),preconditionName:Te.string()})),slug:Te.string()});dg=Te.coerce.number().int().positive().catch(Qy)});var G=f(()=>{"use strict";nr();kr();wr();Tr();Pr();Nt();bs();vs();_r();Lt();Ns();$r();nl();oo();no();at();Y();st();lo();fn();Tt();uo();Ie()});import mg from"fs";import fg from"path";async function rl(e){let t=fg.join(e,".ripplo","index.ts");if(!mg.existsSync(t))return{appUrl:void 0,config:void 0,engineUrl:void 0,errors:[{message:".ripplo/index.ts not found",path:""}],valid:!1,warnings:[]};let n=await _(e);if(!n.ok)return{appUrl:void 0,config:void 0,engineUrl:void 0,errors:[{message:n.error,path:".ripplo/"}],valid:!1,warnings:[]};let{config:r}=n.result;return{appUrl:r.appUrl,config:r,engineUrl:r.engineUrl,errors:[],valid:!0,warnings:[]}}async function fo(e){try{await fetch(e,{method:"HEAD",signal:AbortSignal.timeout(5e3)});return}catch{return`appUrl (${e}) is not responding. Make sure your dev server is running on that port.`}}async function ol({appUrl:e,engineUrl:t}){let n=t.startsWith("http://")||t.startsWith("https://")?t:`${e}${t}`;try{return(await fetch(`${n}/execute-preconditions`,{body:JSON.stringify({preconditions:[]}),headers:{"Content-Type":"application/json"},method:"PUT",signal:AbortSignal.timeout(5e3)})).ok?"Engine endpoint accepted an unsigned request \u2014 webhook signature verification may be missing.":void 0}catch{return}}var il=f(()=>{"use strict";Q()});import Pt from"fs";import al from"path";import{chromium as yg}from"playwright";function sl(e){switch(e.type){case"settings":return!e.valid;case"token":return!e.exists;case"dev-server":return!e.reachable;case"preconditions":return e.count>0&&!e.configured;case"engine-endpoint":return!e.reachable;case"adapter-enabled":return e.status!=="enabled";case"webhook-verification":return!e.rejectsUnsigned;case"preconditions-validation":return!e.valid;case"workflows":return e.invalidNames.length>0;case"browser":return!e.installed;case"lockfile":return e.status!=="match";case"pre-commit-hook":return!e.installed}}async function kn(e){let t=await kg(e),n=Sg(e),r=wg(),o=await _(e),i=bg(o),a=Tg(o),s=await gg(e,o),l=hg(e),c=await vg(t,o);return[t,n,...c,i,a,s,l,r]}async function gg(e,t){if(!t.ok)return{status:"missing",type:"lockfile"};let n=await qt({cwd:e});return{status:Ft({compiled:t.result,existing:n}),type:"lockfile"}}function hg(e){let t=al.join(e,".git","hooks","pre-commit");return Pt.existsSync(t)?{installed:Pt.readFileSync(t,"utf8").includes("ripplo compile --check"),type:"pre-commit-hook"}:{installed:!1,type:"pre-commit-hook"}}async function kg(e){let t=await rl(e);return t.valid?{missingFields:[],type:"settings",valid:!0}:{missingFields:t.errors.map(r=>r.path).filter(r=>r.length>0),type:"settings",valid:!1}}function Sg(e){let t=al.join(e,".ripplo",".local","token");return Pt.existsSync(t)?{exists:Pt.readFileSync(t,"utf8").trim().length>0,type:"token"}:{exists:!1,type:"token"}}function wg(){let e=yg.executablePath();return{installed:Pt.existsSync(e),type:"browser"}}function bg(e){if(!e.ok)return{errorCount:1,errors:[{message:e.error,path:""}],found:!1,type:"preconditions-validation",valid:!1};let t=Ag(e.result.preconditions,e.result.tests);return{errorCount:t.length,errors:t,found:!0,type:"preconditions-validation",valid:t.length===0}}function Ag(e,t){let n=[],r=new Set(Object.keys(e));return Object.entries(e).forEach(([o,i])=>{(i.depends??[]).forEach(a=>{r.has(a)||n.push({message:`Depends on non-existent precondition "${a}"`,path:`preconditions.${o}.depends`})})}),t.forEach(o=>{Object.entries(o.requiresKeys).forEach(([i,a])=>{r.has(a)||n.push({message:`Test "${o.slug}" requires non-existent precondition "${a}" (as ${i})`,path:`tests.${o.slug}.requiresKeys.${i}`})})}),Rg(e).forEach(o=>{n.push({message:o,path:"preconditions"})}),n}function Rg(e){let t=new Set,n=new Set,r=[];function o(i){if(n.has(i)){r.push(`Precondition "${i}" has a circular dependency`);return}t.has(i)||(t.add(i),n.add(i),(e[i]?.depends??[]).forEach(a=>{o(a)}),n.delete(i))}return Object.keys(e).forEach(i=>{o(i)}),r}function Tg(e){if(!e.ok)return{invalidNames:[],invalidWorkflows:[],total:0,type:"workflows",valid:0};let t=e.result.tests.length;return{invalidNames:[],invalidWorkflows:[],total:t,type:"workflows",valid:t}}async function vg(e,t){if(!e.valid||!t.ok)return[];let{config:n}=t.result,r=[],o=await fo(n.appUrl)==null;r.push({appUrl:n.appUrl,reachable:o,type:"dev-server"});let i=await Ng(n,t);return r.push(...i),r}async function Ng(e,t){let n=t.ok?Object.keys(t.result.preconditions).length:0,r=e.engineUrl.length>0,o={configured:r,count:n,endpointReachable:void 0,type:"preconditions"};if(n===0||!r)return[o];let i=xg(e.appUrl,e.engineUrl);if(i==null)return[o];let a=await fo(i)==null,s=[];if(s.push({configured:!0,count:n,endpointReachable:a,type:"preconditions"}),ll(e.engineUrl)&&s.push({reachable:a,type:"engine-endpoint",url:i}),!a)return s;let l=await ol({appUrl:e.appUrl,engineUrl:e.engineUrl});s.push({rejectsUnsigned:l==null,type:"webhook-verification"});let c=await Cg({engineUrl:i,webhookSecret:e.webhookSecret});return s.push({status:c,type:"adapter-enabled",url:i}),s}async function Cg({engineUrl:e,webhookSecret:t}){if(t.length===0)return"no-secret";let n=JSON.stringify({preconditions:[]});try{let r=await fetch(`${e}/execute-preconditions`,{body:n,headers:{"Content-Type":"application/json",...Be({body:n,secret:t})},method:"PUT",signal:AbortSignal.timeout(5e3)});return r.status===404?"disabled":r.status===401||r.status===403?"bad-secret":"enabled"}catch{return"unreachable"}}function Lg(e){switch(e.status){case"enabled":return`\u2713 Adapter: enabled at ${e.url}`;case"disabled":return"\u2717 Adapter: disabled (handler returned 404). Set ENABLE_RIPPLO_TESTING=true in your app's env (e.g. apps/<app>/.env.local for Next.js) and restart the dev server.";case"bad-secret":return"\u2717 Adapter: webhook signature rejected. RIPPLO_WEBHOOK_SECRET on the dev server does not match the one in .ripplo/ripplo.ts.";case"unreachable":return`\u2717 Adapter: ${e.url} could not be reached for signed probe.`;case"no-secret":return"\u2717 Adapter: webhookSecret is empty in createRipplo() config. Set RIPPLO_WEBHOOK_SECRET in the env that .ripplo/ripplo.ts reads."}}function ll(e){return e.startsWith("http://")||e.startsWith("https://")}function xg(e,t){return ll(t)?t:`${e}${t}`}function cl(e){switch(e.type){case"settings":return Og(e);case"token":return Ig(e);case"dev-server":return _g(e);case"preconditions":return $g(e);case"webhook-verification":return Ug(e);case"preconditions-validation":return Dg(e);case"workflows":return Bg(e);case"browser":return jg(e);case"engine-endpoint":return e.reachable?`\u2713 Engine endpoint: ${e.url} is reachable`:`\u2717 Engine endpoint: ${e.url} is not reachable`;case"adapter-enabled":return Lg(e);case"lockfile":return Pg(e);case"pre-commit-hook":return Eg(e)}}function Pg(e){switch(e.status){case"match":return`\u2713 Lockfile: ${we} is up to date`;case"missing":return`\u2717 Lockfile: ${we} is missing \u2014 run \`ripplo compile\` and commit it`;case"stale":return`\u2717 Lockfile: ${we} is out of date \u2014 run \`ripplo compile\` and commit it`}}function Eg(e){return e.installed?"\u2713 Pre-commit hook: .git/hooks/pre-commit runs `ripplo compile --check`":"! Pre-commit hook: .git/hooks/pre-commit does not run `ripplo compile --check` \u2014 see the setup skill for the snippet"}function Og(e){return e.valid?"\u2713 Settings: Project configured":`\u2717 Settings: Missing fields: ${e.missingFields.join(", ")}`}function Ig(e){return e.exists?"\u2713 Auth: Token found":"\u2717 Auth: No token found. Run `ripplo` to authenticate."}function _g(e){return e.reachable?`\u2713 Dev server: ${e.appUrl} is reachable`:`\u2717 Dev server: ${e.appUrl} is not responding. Make sure your dev server is running.`}function Ug(e){return e.rejectsUnsigned?"\u2713 Webhook verification: Unsigned requests are correctly rejected":"\u2717 Webhook verification: Endpoint accepted an unsigned request \u2014 webhook signature verification may be missing or misconfigured."}function jg(e){return e.installed?"\u2713 Browser: Chromium installed":"\u2717 Browser: Chromium not installed. Run: npx playwright install chromium"}function $g(e){return e.count===0?"! Preconditions: None defined":e.configured?e.endpointReachable===void 0?`! Preconditions: ${String(e.count)} defined (could not verify endpoint)`:`\u2713 Preconditions: ${String(e.count)} defined, endpoint configured`:`\u2717 Preconditions: ${String(e.count)} defined but engineUrl is not set in createRipplo() config`}function Dg(e){if(!e.found)return"\u2717 State graph: DSL compilation failed";if(e.valid)return"\u2713 State graph: Valid";let t=e.errors.map(n=>` - ${n.path===""?"":n.path+": "}${n.message}`);return`\u2717 State graph: ${String(e.errorCount)} validation error${e.errorCount===1?"":"s"}
|
|
173
173
|
${t.join(`
|
|
174
|
-
`)}`}function
|
|
174
|
+
`)}`}function Bg(e){if(e.total===0)return"! Tests: No tests defined";if(e.invalidNames.length===0)return`\u2713 Tests: ${String(e.total)} valid`;let t=e.invalidWorkflows.map(n=>Vg(n));return`\u2717 Tests: ${String(e.invalidNames.length)} invalid
|
|
175
175
|
${t.join(`
|
|
176
|
-
`)}`}function
|
|
176
|
+
`)}`}function Vg(e){let t=e.errors.map(n=>" - "+(n.path===""?"":n.path+": ")+n.message);return" "+e.name+`:
|
|
177
177
|
`+t.join(`
|
|
178
|
-
`)}var yo=f(()=>{"use strict";G();Oe();il();Q()});import{z as fl}from"zod";function Ve(){let e=process.argv.findIndex(o=>o.startsWith("--env"));if(e===-1)return Ot().RIPPLO_SERVER_URL;let t=process.argv[e];if(t==null)return Ot().RIPPLO_SERVER_URL;let n=t.includes("=")?t.split("=")[1]:process.argv[e+1];if(n==null)return Ot().RIPPLO_SERVER_URL;let r=
|
|
178
|
+
`)}var yo=f(()=>{"use strict";G();Oe();il();Q()});import{z as fl}from"zod";function Ve(){let e=process.argv.findIndex(o=>o.startsWith("--env"));if(e===-1)return Ot().RIPPLO_SERVER_URL;let t=process.argv[e];if(t==null)return Ot().RIPPLO_SERVER_URL;let n=t.includes("=")?t.split("=")[1]:process.argv[e+1];if(n==null)return Ot().RIPPLO_SERVER_URL;let r=th[n];if(r==null)throw new Error(`Unknown env "${n}". Use "dev" or "local".`);return r}function Ot(){return yl??=nh.parse(process.env),yl}var Yg,Zg,eh,th,nh,yl,dt=f(()=>{"use strict";Yg="https://ripplo.ai",Zg="https://ripplo-dev.up.railway.app",eh="https://localhost:3001",th={dev:Zg,local:eh};nh=fl.object({RIPPLO_SERVER_URL:fl.string().min(1).default(Yg)})});import _t from"fs";function El(e){return be(e,Fh)}function Ol(e){let t=El(e);if(!_t.existsSync(t))return!1;let n=_t.statSync(t);return Date.now()-n.mtimeMs<=Mh}function Pl(e){Xe(e);let t=El(e),n=new Date;_t.existsSync(t)?_t.utimesSync(t,n,n):_t.writeFileSync(t,"")}function Il(e){Pl(e);let t=setInterval(()=>{Pl(e)},Hh);return()=>{clearInterval(t)}}var Fh,Hh,Mh,bo=f(()=>{"use strict";G();Fh="cli-heartbeat",Hh=2e3,Mh=1e4});var zl={};Zo(zl,{redirectStdioToFile:()=>Sk});import Tn from"fs";import kk from"path";function Sk(e){Tn.mkdirSync(kk.dirname(e),{recursive:!0});let t=Tn.openSync(e,"a"),n=process.stdout.write.bind(process.stdout),r=process.stderr.write.bind(process.stderr);function o(s,l,c){let d=typeof l=="string"?l:void 0,u=typeof s=="string"?Buffer.from(s,d??"utf8"):Buffer.from(s);Tn.writeSync(t,u);let p=typeof l=="function"?l:c;return p?.(),!0}let i=o;process.stdout.write=i,process.stderr.write=i;let a=!1;return function(){a||(a=!0,process.stdout.write=n,process.stderr.write=r,Tn.closeSync(t))}}var Xl=f(()=>{"use strict"});import Gl from"crypto";import To from"fs";import Kl from"path";import{watch as wk}from"chokidar";import{graphql as bk}from"gql.tada";async function Ql(e){return vk(e)}function vo({config:e,cwd:t,devSessionId:n,lastHash:r,onSyncError:o,onSyncSuccess:i}){let a=Kl.join(t,Ak),s=r,l=n,c="",d,u=!1,p=!1,m=wk(a,{depth:2,ignoreInitial:!0,persistent:!0});m.on("all",(k,b)=>{if(b.endsWith(".ts")){if(u){p=!0;return}d!=null&&clearTimeout(d),d=setTimeout(()=>{S()},200)}}),m.on("error",k=>{let b=k instanceof Error?k.message:String(k);A.error("File watcher error: %s",b)});function h(){p=!1,d=setTimeout(()=>{S()},200)}async function S(){u=!0,p=!1;try{await w()}catch(k){let b=k instanceof Error?k.message:"Unknown error";A.error("Sync failed: %s",b),o(b)}finally{u=!1,p&&h()}}async function w(){let k=Tk(a);if(k===c)return;let b=await _(t);if(!b.ok){o(b.error);return}await me({cwd:t,result:b.result});let v={...b.result.config,ripploServerUrl:e.ripploServerUrl,token:e.token},L=Zl(b.result),T=ec(L);if(T===s){c=k,i({config:v,devSessionId:l,hash:T});return}let I=await tc({config:v,payload:L});c=k,s=T,l=I.devSessionId,A.info("Dev session synced (%d test(s))",b.result.tests.length),i({config:v,devSessionId:I.devSessionId,hash:I.hash})}return function(){d!=null&&clearTimeout(d),m.close()}}function Tk(e){let t=Gl.createHash("sha256");return Yl(t,e),t.digest("hex")}function Yl(e,t){if(!To.existsSync(t))return;To.readdirSync(t,{withFileTypes:!0}).toSorted((r,o)=>r.name.localeCompare(o.name)).forEach(r=>{let o=Kl.join(t,r.name);r.isDirectory()?Yl(e,o):r.name.endsWith(".ts")&&(e.update(r.name),e.update(To.readFileSync(o)))})}function Zl(e){return{preconditions:Object.entries(e.preconditions).map(([t,n])=>({depends:[...n.depends??[]],description:n.description,name:t,returns:[...n.returns??[]]})),workflows:e.tests.map(t=>({expectedOutcome:t.expectedOutcome,name:t.name,preconditions:[...t.preconditions],requiresKeys:Object.entries(t.requiresKeys).map(([n,r])=>({namespace:n,preconditionName:r})),slug:t.slug,spec:t.implemented?JSON.stringify(t.spec):null}))}}function ec(e){return Gl.createHash("sha256").update(JSON.stringify(e)).digest("hex")}async function vk(e){let t=await _(e.cwd);if(!t.ok)throw new Error(`DSL compilation failed: ${t.error}`);let n={...t.result.config,ripploServerUrl:e.config.ripploServerUrl,token:e.config.token},r=Zl(t.result);return A.info("Synced %d test(s) + graph to dev session",t.result.tests.length),{...await tc({config:n,payload:r}),config:n}}async function tc({config:e,payload:t}){let n=ec(t),r=await $({config:e,document:Rk,variables:{preconditions:t.preconditions.map(o=>({depends:[...o.depends],description:o.description,name:o.name,returns:[...o.returns]})),projectId:e.projectId,workflows:t.workflows.map(o=>({expectedOutcome:o.expectedOutcome,name:o.name,preconditions:[...o.preconditions],requiresKeys:o.requiresKeys.map(i=>({namespace:i.namespace,preconditionName:i.preconditionName})),slug:o.slug,spec:o.spec??null}))}});if(r.syncDevSession==null)throw new Error("syncDevSession returned null");return{devSessionId:r.syncDevSession.id,hash:n}}function nc(e){return!1}function rc(e){return!1}var Ak,Rk,No=f(()=>{"use strict";Oe();G();Q();Ak=".ripplo",Rk=bk(`
|
|
179
179
|
mutation SyncDevSession(
|
|
180
180
|
$projectId: String!
|
|
181
181
|
$preconditions: [SyncDevPreconditionInput!]!
|
|
@@ -185,7 +185,7 @@ ${t.join(`
|
|
|
185
185
|
id
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
|
-
`)});import{useCallback as Nk,useEffect as vn,useRef as Ck,useState as Lk}from"react";import{availableParallelism as
|
|
188
|
+
`)});import{useCallback as Nk,useEffect as vn,useRef as Ck,useState as Lk}from"react";import{availableParallelism as oc}from"os";import{useSubscription as Co}from"urql";import{graphql as Cn}from"gql.tada";async function ic(){await(await Nn).closeAll()}function ac({config:e,cwd:t,devSessionId:n}){let[r,o]=Lk({activeRunCount:0,browsersReady:!1,connected:!1,maxConcurrency:oc()}),i=e,a=Ck(new Set);vn(()=>{Nn.then(()=>{o(l=>({...l,browsersReady:!0}))})},[]);let s=Nk(l=>{sc({activeRunIds:a.current,baseUrl:i.appUrl,config:i,setState:o,...l})},[i]);return vn(()=>{n!=null&&o(l=>({...l,connected:!0}))},[n]),Co({pause:n==null,query:xk},(l,c)=>{let d=c.runRequested;return d!=null&&s({agentProfileDescription:d.agentProfileDescription??void 0,agentProfileId:d.agentProfileId??void 0,cwd:t,runId:d.runId,workflowId:d.workflowId,workflowSlug:d.workflowSlug}),c}),Co({pause:n==null,query:Ek,variables:{projectId:i.projectId}},(l,c)=>{let d=c.devWorkflowDeleteRequested?.slug;return d!=null&&nc({cwd:t,slug:d}),c}),Co({pause:n==null,query:Ok,variables:{projectId:i.projectId}},(l,c)=>{let d=c.devWorkflowDuplicateRequested;return d!=null&&rc({cwd:t,newSlug:d.newSlug,sourceSlug:d.sourceSlug}),c}),vn(()=>{if(n==null)return;let l=new AbortController;return _k({activeConfig:i,activeRunIds:a.current,devSessionId:n,setState:o,signal:l.signal}),()=>{l.abort()}},[i,n]),vn(()=>()=>{Nn.then(l=>l.closeAll())},[]),r}function sc({activeRunIds:e,agentProfileDescription:t,agentProfileId:n,baseUrl:r,config:o,cwd:i,runId:a,setState:s,workflowId:l,workflowSlug:c}){if(e.has(a))return;e.add(a),s(u=>({...u,activeRunCount:e.size}));function d(){e.delete(a),s(u=>({...u,activeRunCount:e.size}))}Uk({agentProfileDescription:t,agentProfileId:n,baseUrl:r,config:o,cwd:i,runId:a,workflowId:l,workflowSlug:c}).finally(d)}async function _k({activeConfig:e,activeRunIds:t,devSessionId:n,setState:r,signal:o}){for(;!o.aborted;){if(await new Promise(i=>{let a=setTimeout(i,Ik);o.addEventListener("abort",()=>{clearTimeout(a),i()},{once:!0})}),o.aborted)return;try{(await $({config:e,document:Pk,variables:{devSessionId:n}})).pendingDevRuns?.filter(a=>!t.has(a.id)).forEach(a=>{let s=a.workflow?.id;s!=null&&sc({activeRunIds:t,agentProfileDescription:a.agentProfile?.description??void 0,agentProfileId:a.agentProfile?.id??void 0,baseUrl:e.appUrl,config:e,cwd:void 0,runId:a.id,setState:r,workflowId:s,workflowSlug:void 0})})}catch(i){A.error(i,"Runner error")}}}async function Uk({agentProfileDescription:e,agentProfileId:t,baseUrl:n,config:r,cwd:o,runId:i,workflowId:a,workflowSlug:s}){let l=await Nn,c=await l.acquire();try{await Or({maxRuns:100});let d=o!=null&&s!=null?await jk({cwd:o,workflowSlug:s}):void 0;await mo({agentProfileDescription:e,agentProfileId:t,baseUrl:n,browser:c,config:r,headed:!1,preconditionNames:d,runId:i,webhookSecret:r.webhookSecret,workflowId:a})}catch(d){A.error(d,"Runner error")}finally{l.release(c)}}async function jk({cwd:e,workflowSlug:t}){let n=await _(e);if(!n.ok)return;let r=n.result.tests.find(o=>o.slug===t);if(r!=null)return r.preconditions}var xk,Pk,Ek,Ok,Nn,Ik,Lo=f(()=>{"use strict";G();Q();No();xk=Cn(`
|
|
189
189
|
subscription RunRequestedDashboard {
|
|
190
190
|
runRequested {
|
|
191
191
|
agentProfileDescription
|
|
@@ -224,7 +224,7 @@ ${t.join(`
|
|
|
224
224
|
newSlug
|
|
225
225
|
}
|
|
226
226
|
}
|
|
227
|
-
`),Nn=Er({headed:!1,size:ic()});Ik=5e3});import{initGraphQLTada as $k}from"gql.tada";import{readFragment as NE}from"gql.tada";var xo,cc=f(()=>{"use strict";xo=$k()});var Po,Eo=f(()=>{"use strict";Po={__schema:{queryType:{name:"Query",kind:"OBJECT"},mutationType:{name:"Mutation",kind:"OBJECT"},subscriptionType:{name:"Subscription",kind:"OBJECT"},types:[{kind:"OBJECT",name:"AgentProfile",fields:[{name:"createdAt",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"description",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"icon",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"name",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"output",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"sourceTemplateSlug",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"successCriteria",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"updatedAt",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]}],interfaces:[]},{kind:"OBJECT",name:"AgentTemplate",fields:[{name:"createdAt",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"description",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"icon",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"name",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"output",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"slug",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"successCriteria",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"updatedAt",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]}],interfaces:[]},{kind:"OBJECT",name:"BankPaymentMethod",fields:[{name:"bankName",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"last4",type:{kind:"SCALAR",name:"Any"},args:[]}],interfaces:[]},{kind:"OBJECT",name:"BillingSubscription",fields:[{name:"billingInterval",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"cancelAtPeriodEnd",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"periodEnd",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"periodStart",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"plan",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"seats",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"status",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]}],interfaces:[]},{kind:"OBJECT",name:"BranchSnapshot",fields:[{name:"commitMessage",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"commitSha",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"createdAt",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"graphFileHash",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"workflowHashes",type:{kind:"NON_NULL",ofType:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}},args:[]}],interfaces:[]},{kind:"OBJECT",name:"CardPaymentMethod",fields:[{name:"brand",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"last4",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]}],interfaces:[]},{kind:"OBJECT",name:"CliToken",fields:[{name:"createdAt",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"lastUsedAt",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"name",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"revokedAt",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"tokenPrefix",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]}],interfaces:[]},{kind:"OBJECT",name:"DevSession",fields:[{name:"createdAt",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"expiresAt",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"healthChecks",type:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"HealthCheck",ofType:null}}},args:[]},{name:"hooksPaused",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"preconditions",type:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"Precondition",ofType:null}}},args:[]},{name:"scopeItems",type:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"ScopeItem",ofType:null}}},args:[]},{name:"updatedAt",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"workflowDiff",type:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"DevSessionWorkflowDiff",ofType:null}},args:[]},{name:"workflows",type:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"Workflow",ofType:null}}},args:[{name:"where",type:{kind:"SCALAR",name:"Any"}}]}],interfaces:[]},{kind:"OBJECT",name:"DevSessionEvent",fields:[{name:"active",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]}],interfaces:[]},{kind:"OBJECT",name:"DevSessionSyncedEvent",fields:[{name:"devSession",type:{kind:"OBJECT",name:"DevSession",ofType:null},args:[]},{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]}],interfaces:[]},{kind:"OBJECT",name:"DevSessionWorkflowDiff",fields:[{name:"added",type:{kind:"NON_NULL",ofType:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"Workflow",ofType:null}}}},args:[]},{name:"modified",type:{kind:"NON_NULL",ofType:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"Workflow",ofType:null}}}},args:[]},{name:"removed",type:{kind:"NON_NULL",ofType:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"Workflow",ofType:null}}}},args:[]}],interfaces:[]},{kind:"OBJECT",name:"DevWorkflowDeleteRequestedEvent",fields:[{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"slug",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]}],interfaces:[]},{kind:"OBJECT",name:"DevWorkflowDuplicateRequestedEvent",fields:[{name:"newSlug",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"sourceSlug",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]}],interfaces:[]},{kind:"OBJECT",name:"GitHubInstallation",fields:[{name:"accountLogin",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"accountType",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"createdAt",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"installationId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]}],interfaces:[]},{kind:"OBJECT",name:"GithubRepository",fields:[{name:"description",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"fullName",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"installationId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"name",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"updatedAt",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"url",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]}],interfaces:[]},{kind:"OBJECT",name:"HealthCheck",fields:[{name:"detail",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"tone",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"type",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"updatedAt",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]}],interfaces:[]},{kind:"OBJECT",name:"HealthChecksChangedEvent",fields:[{name:"devSession",type:{kind:"OBJECT",name:"DevSession",ofType:null},args:[]},{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"userId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]}],interfaces:[]},{kind:"OBJECT",name:"HooksPausedRequestedEvent",fields:[{name:"paused",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]}],interfaces:[]},{kind:"OBJECT",name:"Invoice",fields:[{name:"date",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"hostedInvoiceUrl",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"status",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"totalCents",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]}],interfaces:[]},{kind:"OBJECT",name:"LinkPaymentMethod",fields:[{name:"email",type:{kind:"SCALAR",name:"Any"},args:[]}],interfaces:[]},{kind:"OBJECT",name:"Mutation",fields:[{name:"addScopeItem",type:{kind:"OBJECT",name:"ScopeItem",ofType:null},args:[{name:"label",type:{kind:"SCALAR",name:"Any"}},{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"source",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"workflowId",type:{kind:"SCALAR",name:"Any"}}]},{name:"cancelAllPendingRuns",type:{kind:"SCALAR",name:"Any"},args:[{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"cancelRun",type:{kind:"OBJECT",name:"Run",ofType:null},args:[{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"cloneAgentTemplate",type:{kind:"OBJECT",name:"AgentProfile",ofType:null},args:[{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"templateSlug",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"completeRun",type:{kind:"OBJECT",name:"RunResult",ofType:null},args:[{name:"duration",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"failCount",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"passCount",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"runResultId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"status",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"summary",type:{kind:"SCALAR",name:"Any"}},{name:"warnCount",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"createAgentProfile",type:{kind:"OBJECT",name:"AgentProfile",ofType:null},args:[{name:"description",type:{kind:"SCALAR",name:"Any"}},{name:"icon",type:{kind:"SCALAR",name:"Any"}},{name:"name",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"createProject",type:{kind:"OBJECT",name:"Project",ofType:null},args:[{name:"cloudBaseUrl",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"installationId",type:{kind:"SCALAR",name:"Any"}},{name:"name",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"organizationId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"provider",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"repoUrl",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"createRun",type:{kind:"OBJECT",name:"Run",ofType:null},args:[{name:"agentProfileDescription",type:{kind:"SCALAR",name:"Any"}},{name:"agentProfileId",type:{kind:"SCALAR",name:"Any"}},{name:"concurrency",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"executor",type:{kind:"SCALAR",name:"Any"}},{name:"isTest",type:{kind:"SCALAR",name:"Any"}},{name:"platforms",type:{kind:"NON_NULL",ofType:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}}},{name:"workflowId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"deleteAgentProfile",type:{kind:"OBJECT",name:"AgentProfile",ofType:null},args:[{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"deleteDevWorkflow",type:{kind:"OBJECT",name:"Workflow",ofType:null},args:[{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"slug",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"deleteProject",type:{kind:"OBJECT",name:"Project",ofType:null},args:[{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"duplicateDevWorkflow",type:{kind:"SCALAR",name:"Any"},args:[{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"slug",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"endDevSession",type:{kind:"OBJECT",name:"DevSession",ofType:null},args:[{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"linkScopeItem",type:{kind:"OBJECT",name:"ScopeItem",ofType:null},args:[{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"workflowId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"pushHealthChecks",type:{kind:"SCALAR",name:"Any"},args:[{name:"checks",type:{kind:"NON_NULL",ofType:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}}},{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"removeGitHubInstallation",type:{kind:"OBJECT",name:"GitHubInstallation",ofType:null},args:[{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"removeScopeItem",type:{kind:"SCALAR",name:"Any"},args:[{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"revokeCurrentCliToken",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"rotateWebhookSecret",type:{kind:"OBJECT",name:"Project",ofType:null},args:[{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"runAllWorkflows",type:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"Run",ofType:null}}},args:[{name:"agentProfileDescription",type:{kind:"SCALAR",name:"Any"}},{name:"agentProfileId",type:{kind:"SCALAR",name:"Any"}},{name:"concurrency",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"executor",type:{kind:"SCALAR",name:"Any"}},{name:"platforms",type:{kind:"NON_NULL",ofType:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}}},{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"workflowIds",type:{kind:"NON_NULL",ofType:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}}}]},{name:"saveGitHubInstallation",type:{kind:"OBJECT",name:"GitHubInstallation",ofType:null},args:[{name:"input",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"setHooksPaused",type:{kind:"SCALAR",name:"Any"},args:[{name:"paused",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"setOverageCap",type:{kind:"SCALAR",name:"Any"},args:[{name:"capCents",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"organizationId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"startRun",type:{kind:"OBJECT",name:"RunResult",ofType:null},args:[{name:"agentProfileId",type:{kind:"SCALAR",name:"Any"}},{name:"platform",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"runId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"submitRunResults",type:{kind:"OBJECT",name:"RunResult",ofType:null},args:[{name:"agentProfileId",type:{kind:"SCALAR",name:"Any"}},{name:"duration",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"failCount",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"passCount",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"platform",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"runId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"status",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"steps",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"warnCount",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"submitRunSteps",type:{kind:"SCALAR",name:"Any"},args:[{name:"runResultId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"steps",type:{kind:"NON_NULL",ofType:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}}}]},{name:"syncBranch",type:{kind:"OBJECT",name:"TrackedBranch",ofType:null},args:[{name:"branchName",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"syncDevSession",type:{kind:"OBJECT",name:"DevSession",ofType:null},args:[{name:"preconditions",type:{kind:"NON_NULL",ofType:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}}},{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"workflows",type:{kind:"NON_NULL",ofType:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}}}]},{name:"trackBranch",type:{kind:"OBJECT",name:"TrackedBranch",ofType:null},args:[{name:"branchName",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"untrackBranch",type:{kind:"OBJECT",name:"TrackedBranch",ofType:null},args:[{name:"branchName",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"updateAgentProfile",type:{kind:"OBJECT",name:"AgentProfile",ofType:null},args:[{name:"description",type:{kind:"SCALAR",name:"Any"}},{name:"icon",type:{kind:"SCALAR",name:"Any"}},{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"name",type:{kind:"SCALAR",name:"Any"}},{name:"output",type:{kind:"SCALAR",name:"Any"}},{name:"successCriteria",type:{kind:"SCALAR",name:"Any"}}]},{name:"updateProject",type:{kind:"OBJECT",name:"Project",ofType:null},args:[{name:"cloudBaseUrl",type:{kind:"SCALAR",name:"Any"}},{name:"engineBaseUrl",type:{kind:"SCALAR",name:"Any"}},{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"logoUrl",type:{kind:"SCALAR",name:"Any"}},{name:"name",type:{kind:"SCALAR",name:"Any"}}]},{name:"updateUsername",type:{kind:"OBJECT",name:"User",ofType:null},args:[{name:"username",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"updateWorkflow",type:{kind:"OBJECT",name:"Workflow",ofType:null},args:[{name:"baseUrl",type:{kind:"SCALAR",name:"Any"}},{name:"codebaseScope",type:{kind:"SCALAR",name:"Any"}},{name:"expectedOutcome",type:{kind:"SCALAR",name:"Any"}},{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"name",type:{kind:"SCALAR",name:"Any"}},{name:"status",type:{kind:"SCALAR",name:"Any"}}]}],interfaces:[]},{kind:"OBJECT",name:"Organization",fields:[{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"limitStatus",type:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"OrganizationLimitStatus",ofType:null}},args:[{name:"projectId",type:{kind:"SCALAR",name:"Any"}}]},{name:"name",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]}],interfaces:[]},{kind:"OBJECT",name:"OrganizationLimitStatus",fields:[{name:"agentCount",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"agentLimitPerProject",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"canCreateAgent",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"canCreateProject",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"canInviteMember",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"memberCount",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"memberLimit",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"planName",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"projectCount",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"projectLimit",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"runCount",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"runLimit",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"runLimitReached",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"tokenBudgetExceeded",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]}],interfaces:[]},{kind:"OBJECT",name:"OrganizationUsage",fields:[{name:"overageCapCents",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"overageSpentCents",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"periodEnd",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"periodStart",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"runCount",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"runLimit",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"runUsagePercent",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"tokenUsagePercent",type:{kind:"SCALAR",name:"Any"},args:[]}],interfaces:[]},{kind:"OBJECT",name:"OtherPaymentMethod",fields:[{name:"type",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]}],interfaces:[]},{kind:"UNION",name:"PaymentMethod",possibleTypes:[{kind:"OBJECT",name:"BankPaymentMethod"},{kind:"OBJECT",name:"CardPaymentMethod"},{kind:"OBJECT",name:"LinkPaymentMethod"},{kind:"OBJECT",name:"OtherPaymentMethod"}]},{kind:"OBJECT",name:"Plan",fields:[{name:"annualPrice",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"limits",type:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"PlanLimits",ofType:null}},args:[]},{name:"monthlyPrice",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"name",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]}],interfaces:[]},{kind:"OBJECT",name:"PlanLimits",fields:[{name:"historyDays",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"maxAgents",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"maxProjects",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"maxRuns",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"maxUsers",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"runOverageCents",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"scheduling",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"tokenBudgetCents",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]}],interfaces:[]},{kind:"OBJECT",name:"Precondition",fields:[{name:"depends",type:{kind:"NON_NULL",ofType:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}},args:[]},{name:"description",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"name",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"returns",type:{kind:"NON_NULL",ofType:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}},args:[]}],interfaces:[]},{kind:"OBJECT",name:"Project",fields:[{name:"agentProfiles",type:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"AgentProfile",ofType:null}}},args:[]},{name:"cloudBaseUrl",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"createdAt",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"defaultBranch",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"devSession",type:{kind:"OBJECT",name:"DevSession",ofType:null},args:[]},{name:"engineBaseUrl",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"limitStatus",type:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"OrganizationLimitStatus",ofType:null}},args:[]},{name:"logoUrl",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"name",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"organization",type:{kind:"OBJECT",name:"Organization",ofType:null},args:[]},{name:"organizationId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"preconditions",type:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"Precondition",ofType:null}}},args:[{name:"branch",type:{kind:"SCALAR",name:"Any"}}]},{name:"provider",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"repoUrl",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"updatedAt",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"webhookSecret",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"workflows",type:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"Workflow",ofType:null}}},args:[{name:"branch",type:{kind:"SCALAR",name:"Any"}}]}],interfaces:[]},{kind:"OBJECT",name:"ProjectRunStatusEvent",fields:[{name:"agentProfileId",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"completedAt",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"createdAt",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"hasFailed",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"runId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"status",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"workflowId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"workflowSlug",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]}],interfaces:[]},{kind:"OBJECT",name:"Query",fields:[{name:"activeSubscription",type:{kind:"OBJECT",name:"BillingSubscription",ofType:null},args:[{name:"organizationId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"agentProfile",type:{kind:"OBJECT",name:"AgentProfile",ofType:null},args:[{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"agentProfiles",type:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"AgentProfile",ofType:null}}},args:[{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"agentTemplates",type:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"AgentTemplate",ofType:null}}},args:[]},{name:"availablePlans",type:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"Plan",ofType:null}}},args:[]},{name:"currentUser",type:{kind:"OBJECT",name:"User",ofType:null},args:[]},{name:"defaultPaymentMethod",type:{kind:"UNION",name:"PaymentMethod",ofType:null},args:[{name:"organizationId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"gitHubAppInstallUrl",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"gitHubInstallations",type:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"GitHubInstallation",ofType:null}}},args:[]},{name:"githubRepositories",type:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"GithubRepository",ofType:null}}},args:[]},{name:"healthcheck",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"invoices",type:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"Invoice",ofType:null}}},args:[{name:"organizationId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"me",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"organizationLimitStatus",type:{kind:"OBJECT",name:"OrganizationLimitStatus",ofType:null},args:[{name:"organizationId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"projectId",type:{kind:"SCALAR",name:"Any"}}]},{name:"organizationUsage",type:{kind:"OBJECT",name:"OrganizationUsage",ofType:null},args:[{name:"organizationId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"pendingDevRuns",type:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"Run",ofType:null}}},args:[{name:"devSessionId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"project",type:{kind:"OBJECT",name:"Project",ofType:null},args:[{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"projectRuns",type:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"Run",ofType:null}}},args:[{name:"cursor",type:{kind:"SCALAR",name:"Any"}},{name:"devSessionId",type:{kind:"SCALAR",name:"Any"}},{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"take",type:{kind:"SCALAR",name:"Any"}}]},{name:"projects",type:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"Project",ofType:null}}},args:[]},{name:"run",type:{kind:"OBJECT",name:"Run",ofType:null},args:[{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"runResult",type:{kind:"OBJECT",name:"RunResult",ofType:null},args:[{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"runs",type:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"Run",ofType:null}}},args:[{name:"take",type:{kind:"SCALAR",name:"Any"}},{name:"workflowId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"trackedBranches",type:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"TrackedBranch",ofType:null}}},args:[{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"workflow",type:{kind:"OBJECT",name:"Workflow",ofType:null},args:[{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"slug",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"workflows",type:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"Workflow",ofType:null}}},args:[{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]}],interfaces:[]},{kind:"OBJECT",name:"Run",fields:[{name:"agentProfile",type:{kind:"OBJECT",name:"AgentProfile",ofType:null},args:[]},{name:"completedAt",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"concurrency",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"createdAt",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"devSessionId",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"executor",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"failureReason",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"isTest",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"platforms",type:{kind:"NON_NULL",ofType:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}},args:[]},{name:"results",type:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"RunResult",ofType:null}}},args:[]},{name:"startedAt",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"status",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"totalRuns",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"updatedAt",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"userId",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"workflow",type:{kind:"OBJECT",name:"Workflow",ofType:null},args:[]}],interfaces:[]},{kind:"UNION",name:"RunProgressEvent",possibleTypes:[{kind:"OBJECT",name:"RunResultUpdated"},{kind:"OBJECT",name:"RunStatusChanged"},{kind:"OBJECT",name:"RunTraceEntryAdded"}]},{kind:"OBJECT",name:"RunRequestedEvent",fields:[{name:"agentProfileDescription",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"agentProfileId",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"executor",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"runId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"workflowId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"workflowSlug",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]}],interfaces:[]},{kind:"OBJECT",name:"RunResult",fields:[{name:"agentProfile",type:{kind:"OBJECT",name:"AgentProfile",ofType:null},args:[]},{name:"createdAt",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"duration",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"failCount",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"passCount",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"perfP50",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"perfP90",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"perfP99",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"perfTotal",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"platform",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"sideEffects",type:{kind:"NON_NULL",ofType:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"SideEffect",ofType:null}}}},args:[]},{name:"status",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"summary",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"traceEntries",type:{kind:"NON_NULL",ofType:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"TraceEntry",ofType:null}}}},args:[]},{name:"updatedAt",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"warnCount",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]}],interfaces:[]},{kind:"OBJECT",name:"RunResultUpdated",fields:[{name:"runResult",type:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"RunResult",ofType:null}},args:[]}],interfaces:[]},{kind:"OBJECT",name:"RunStatusChanged",fields:[{name:"run",type:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"Run",ofType:null}},args:[]}],interfaces:[]},{kind:"OBJECT",name:"RunTraceEntryAdded",fields:[{name:"runResultId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"traceEntry",type:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"TraceEntry",ofType:null}},args:[]}],interfaces:[]},{kind:"OBJECT",name:"ScopeChangedEvent",fields:[{name:"devSession",type:{kind:"OBJECT",name:"DevSession",ofType:null},args:[]},{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"userId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]}],interfaces:[]},{kind:"OBJECT",name:"ScopeItem",fields:[{name:"createdAt",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"label",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"source",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"workflow",type:{kind:"OBJECT",name:"Workflow",ofType:null},args:[]}],interfaces:[]},{kind:"OBJECT",name:"ScreenAnnotation",fields:[{name:"height",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"label",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"type",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"width",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"x",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"y",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]}],interfaces:[]},{kind:"OBJECT",name:"SideEffect",fields:[{name:"detail",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"name",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"status",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]}],interfaces:[]},{kind:"OBJECT",name:"Subscription",fields:[{name:"devSessionChanged",type:{kind:"OBJECT",name:"DevSessionEvent",ofType:null},args:[{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"devSessionSynced",type:{kind:"OBJECT",name:"DevSessionSyncedEvent",ofType:null},args:[{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"devWorkflowDeleteRequested",type:{kind:"OBJECT",name:"DevWorkflowDeleteRequestedEvent",ofType:null},args:[{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"devWorkflowDuplicateRequested",type:{kind:"OBJECT",name:"DevWorkflowDuplicateRequestedEvent",ofType:null},args:[{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"healthChecksChanged",type:{kind:"OBJECT",name:"HealthChecksChangedEvent",ofType:null},args:[{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"hooksPausedRequested",type:{kind:"OBJECT",name:"HooksPausedRequestedEvent",ofType:null},args:[{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"projectRunStatusChanged",type:{kind:"OBJECT",name:"ProjectRunStatusEvent",ofType:null},args:[{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"runProgress",type:{kind:"UNION",name:"RunProgressEvent",ofType:null},args:[{name:"runId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"runRequested",type:{kind:"OBJECT",name:"RunRequestedEvent",ofType:null},args:[]},{name:"scopeChanged",type:{kind:"OBJECT",name:"ScopeChangedEvent",ofType:null},args:[{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]}],interfaces:[]},{kind:"OBJECT",name:"TraceAssertion",fields:[{name:"description",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"detail",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"status",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]}],interfaces:[]},{kind:"OBJECT",name:"TraceEntry",fields:[{name:"annotations",type:{kind:"NON_NULL",ofType:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"ScreenAnnotation",ofType:null}}}},args:[]},{name:"assertions",type:{kind:"NON_NULL",ofType:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"TraceAssertion",ofType:null}}}},args:[]},{name:"createdAt",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"detail",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"duration",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"nodeType",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"pageUrl",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"screenshotUrl",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"status",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"statusCode",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"stepIndex",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"timestamp",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"title",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"viewportHeight",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"viewportWidth",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]}],interfaces:[]},{kind:"OBJECT",name:"TrackedBranch",fields:[{name:"branchName",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"createdAt",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"headCommit",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"preconditions",type:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"Precondition",ofType:null}}},args:[]},{name:"snapshots",type:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"BranchSnapshot",ofType:null}}},args:[]},{name:"syncedAt",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"updatedAt",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"workflows",type:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"Workflow",ofType:null}}},args:[]}],interfaces:[]},{kind:"OBJECT",name:"User",fields:[{name:"email",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"image",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"name",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"username",type:{kind:"SCALAR",name:"Any"},args:[]}],interfaces:[]},{kind:"OBJECT",name:"Workflow",fields:[{name:"additionalChecks",type:{kind:"NON_NULL",ofType:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}},args:[]},{name:"agentProfiles",type:{kind:"NON_NULL",ofType:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"AgentProfile",ofType:null}}}},args:[]},{name:"codebaseScope",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"createdAt",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"devSessionId",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"expectedOutcome",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"isLocalOnly",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"latestRuns",type:{kind:"NON_NULL",ofType:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"Run",ofType:null}}}},args:[]},{name:"name",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"preconditions",type:{kind:"NON_NULL",ofType:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}},args:[]},{name:"project",type:{kind:"OBJECT",name:"Project",ofType:null},args:[]},{name:"requiresKeys",type:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"WorkflowRequiresKey",ofType:null}}},args:[]},{name:"runs",type:{kind:"NON_NULL",ofType:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"Run",ofType:null}}}},args:[]},{name:"slug",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"source",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"spec",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"updatedAt",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]}],interfaces:[]},{kind:"OBJECT",name:"WorkflowRequiresKey",fields:[{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"namespace",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"preconditionName",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]}],interfaces:[]},{kind:"SCALAR",name:"Any"}],directives:[]}}});function W(e,t){e.inspectFields("Query").filter(n=>n.fieldName===t).forEach(n=>{e.invalidate("Query",n.fieldName,n.arguments)})}function pe(e,t,n){e.invalidate({__typename:t,id:n})}function Bk({argMatches:e,cache:t,childKey:n,fieldName:r}){t.inspectFields("Query").filter(o=>o.fieldName===r&&e(o.arguments??null)).forEach(o=>{let i=t.resolve("Query",o.fieldName,o.arguments);if(!Array.isArray(i))return;let a=i.map(s=>typeof s=="string"?s:null);a.includes(n)||t.link("Query",o.fieldName,o.arguments,[n,...a])})}function Oo({cache:e,childId:t,childTypeName:n,fieldName:r,parentId:o,parentTypeName:i}){let a=e.keyOfEntity({__typename:i,id:o});if(a==null)return!1;let s=e.keyOfEntity({__typename:n,id:t});if(s==null)return!1;let l=e.resolve(a,r);if(!Array.isArray(l))return!1;let c=l.map(d=>typeof d=="string"?d:null);return c.includes(s)||e.link(a,r,void 0,[...c,s]),!0}function Vk(e,t){let n=t.traceEntry?.id,r=t.runResultId;if(n==null||r==null)return;Oo({cache:e,childId:n,childTypeName:"TraceEntry",fieldName:"traceEntries",parentId:r,parentTypeName:"RunResult"})||pe(e,"RunResult",r)}function Io(e){return e==="completed"||e==="failed"}function Wk(e,t){if(t.runId==null)return;let n=Io(t.status),r=t.completedAt??(n?new Date().toISOString():null);e.writeFragment(dc,{agentProfile:t.agentProfileId==null?null:{id:t.agentProfileId},completedAt:r,createdAt:t.createdAt??new Date().toISOString(),id:t.runId,status:t.status??"pending"})}function pc(e,t){e.invalidate({__typename:"Run",id:t},"results")}function qk(e,t){e.workflowId==null||e.runId==null||Oo({cache:t,childId:e.runId,childTypeName:"Run",fieldName:"latestRuns",parentId:e.workflowId,parentTypeName:"Workflow"})}function Fk(e,t){let n=e.runId!=null&&t.resolve({__typename:"Run",id:e.runId},"id")==null;Wk(t,e),Io(e.status)&&e.runId!=null&&pc(t,e.runId),n&&(W(t,"run"),Hk(t,e)),qk(e,t)}function Hk(e,t){if(t.runId==null)return;let n=e.keyOfEntity({__typename:"Run",id:t.runId});if(n==null){W(e,"projectRuns");return}Bk({cache:e,childKey:n,fieldName:"projectRuns",argMatches:r=>{if(r?.cursor!=null)return!1;let i=r?.projectId;return!(typeof i=="string"&&i!==t.workflowId)}}),W(e,"projectRuns")}function Mk(e,t,n){let r=e.keyOfEntity({__typename:"Project",id:t});if(r==null)return;let o=e.resolve(r,"devSession");if(typeof o!="string")return;let i=e.resolve(o,"scopeItems");if(!Array.isArray(i))return;let a=i.flatMap(l=>typeof l=="string"?[l]:[]),s=e.keyOfEntity({__typename:"ScopeItem",id:n});s==null||a.includes(s)||e.link(o,"scopeItems",void 0,[...a,{__typename:"ScopeItem",id:n}])}function zk(e,t){e.inspectFields("Query").filter(n=>n.fieldName==="project").forEach(n=>{let r=e.resolve("Query",n.fieldName,n.arguments);if(typeof r!="string")return;let o=e.resolve(r,"devSession");typeof o=="string"&&e.writeFragment(Jk,{hooksPaused:t,id:o.replace(/^DevSession:/,"")})})}function Xk(){return{addScopeItem(e,t,n){let r=e.addScopeItem?.id;r!=null&&Mk(n,t.projectId,r)},cancelAllPendingRuns(e,t,n){W(n,"workflows"),W(n,"projectRuns")},cancelRun(e,t,n){let r=e.cancelRun?.id;r!=null&&pe(n,"Run",r)},cloneAgentTemplate(e,t,n){W(n,"agentProfiles")},createAgentProfile(e,t,n){W(n,"agentProfiles")},createRun(e,t,n){W(n,"run"),W(n,"runs"),W(n,"projectRuns");let r=e.createRun?.id;r!=null&&(n.writeFragment(dc,{agentProfile:t.agentProfileId==null?null:{id:t.agentProfileId},completedAt:null,createdAt:new Date().toISOString(),id:r,status:"pending"}),Oo({cache:n,childId:r,childTypeName:"Run",fieldName:"latestRuns",parentId:t.workflowId,parentTypeName:"Workflow"}))},deleteAgentProfile(e,t,n){let r=e.deleteAgentProfile?.id;r!=null&&pe(n,"AgentProfile",r)},deleteDevWorkflow(e,t,n){let r=e.deleteDevWorkflow?.id;r!=null&&pe(n,"Workflow",r),W(n,"workflows")},deleteProject(e,t,n){let r=e.deleteProject?.id;r!=null&&pe(n,"Project",r),W(n,"projects")},duplicateDevWorkflow(e,t,n){W(n,"workflows")},endDevSession(e,t,n){let r=e.endDevSession?.id;r!=null&&pe(n,"DevSession",r)},linkScopeItem(e,t,n){let r=e.linkScopeItem?.id;r!=null&&pe(n,"ScopeItem",r)},removeScopeItem(e,t,n){pe(n,"ScopeItem",t.id)},runAllWorkflows(e,t,n){W(n,"runs"),W(n,"projectRuns")},setHooksPaused(e,t,n){zk(n,t.paused)},setOverageCap(e,t,n){W(n,"organizationUsage")},updateProject(e,t,n){let r=e.updateProject?.id;r!=null&&pe(n,"Project",r)},updateUsername(e,t,n){let r=e.updateUsername?.id;r!=null&&pe(n,"User",r),W(n,"currentUser")}}}function _o(){return{keys:Dk,optimistic:{addScopeItem:e=>({__typename:"ScopeItem",createdAt:new Date().toISOString(),id:`optimistic_${String(Date.now())}`,label:e.label??null,source:e.source,workflow:null}),removeScopeItem:()=>!0},schema:Po,updates:{Mutation:Xk(),Subscription:{devSessionChanged(e,t,n){let r=e.devSessionChanged;r?.projectId!=null&&pe(n,"Project",r.projectId),r?.active===!1&&(W(n,"workflows"),W(n,"workflow"),W(n,"runs"),W(n,"run"),W(n,"projectRuns"))},devSessionSynced(e,t,n){W(n,"workflow"),W(n,"workflows");let r=e.devSessionSynced?.devSession?.id;r!=null&&n.invalidate({__typename:"DevSession",id:r},"workflowDiff")},projectRunStatusChanged(e,t,n){let r=e.projectRunStatusChanged;r!=null&&Fk(r,n)},runProgress(e,t,n){let r=e.runProgress;r?.__typename==="RunTraceEntryAdded"&&Vk(n,r),r?.__typename==="RunResultUpdated"&&r.runResult?.id!=null&&pe(n,"RunResult",r.runResult.id),r?.__typename==="RunStatusChanged"&&r.run?.id!=null&&Io(r.run.status)&&pc(n,r.run.id)}}}}}var Dk,dc,Jk,uc=f(()=>{"use strict";cc();Eo();Dk={AgentProfile:e=>e.id??null,AgentTemplate:e=>e.id??null,BankPaymentMethod:()=>null,BillingSubscription:e=>e.id??null,BranchSnapshot:e=>e.id??null,CardPaymentMethod:()=>null,CliToken:e=>e.id??null,DevSession:e=>e.id??null,DevSessionEvent:()=>null,DevSessionSyncedEvent:()=>null,DevSessionWorkflowDiff:()=>null,DevWorkflowDeleteRequestedEvent:()=>null,DevWorkflowDuplicateRequestedEvent:()=>null,GitHubInstallation:e=>e.id??null,GithubRepository:()=>null,HealthCheck:e=>e.id??null,HealthChecksChangedEvent:()=>null,HooksPausedRequestedEvent:()=>null,Invoice:e=>e.id??null,LinkPaymentMethod:()=>null,Organization:e=>e.id??null,OrganizationLimitStatus:()=>null,OrganizationUsage:()=>null,OtherPaymentMethod:()=>null,Plan:()=>null,PlanLimits:()=>null,Precondition:e=>e.id??null,Project:e=>e.id??null,ProjectRunStatusEvent:()=>null,Run:e=>e.id??null,RunRequestedEvent:()=>null,RunResult:e=>e.id??null,RunResultUpdated:()=>null,RunStatusChanged:()=>null,RunTraceEntryAdded:()=>null,ScopeChangedEvent:()=>null,ScopeItem:e=>e.id??null,ScreenAnnotation:e=>e.id??null,SideEffect:e=>e.id??null,TraceAssertion:e=>e.id??null,TraceEntry:e=>e.id??null,TrackedBranch:e=>e.id??null,User:e=>e.id??null,Workflow:e=>e.id??null,WorkflowRequiresKey:e=>e.id??null};dc=xo(`
|
|
227
|
+
`),Nn=Er({headed:!1,size:oc()});Ik=5e3});import{initGraphQLTada as $k}from"gql.tada";import{readFragment as NE}from"gql.tada";var xo,lc=f(()=>{"use strict";xo=$k()});var Po,Eo=f(()=>{"use strict";Po={__schema:{queryType:{name:"Query",kind:"OBJECT"},mutationType:{name:"Mutation",kind:"OBJECT"},subscriptionType:{name:"Subscription",kind:"OBJECT"},types:[{kind:"OBJECT",name:"AgentProfile",fields:[{name:"createdAt",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"description",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"icon",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"name",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"output",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"sourceTemplateSlug",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"successCriteria",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"updatedAt",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]}],interfaces:[]},{kind:"OBJECT",name:"AgentTemplate",fields:[{name:"createdAt",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"description",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"icon",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"name",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"output",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"slug",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"successCriteria",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"updatedAt",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]}],interfaces:[]},{kind:"OBJECT",name:"BankPaymentMethod",fields:[{name:"bankName",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"last4",type:{kind:"SCALAR",name:"Any"},args:[]}],interfaces:[]},{kind:"OBJECT",name:"BillingSubscription",fields:[{name:"billingInterval",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"cancelAtPeriodEnd",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"periodEnd",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"periodStart",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"plan",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"seats",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"status",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]}],interfaces:[]},{kind:"OBJECT",name:"BranchSnapshot",fields:[{name:"commitMessage",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"commitSha",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"createdAt",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"graphFileHash",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"workflowHashes",type:{kind:"NON_NULL",ofType:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}},args:[]}],interfaces:[]},{kind:"OBJECT",name:"CardPaymentMethod",fields:[{name:"brand",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"last4",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]}],interfaces:[]},{kind:"OBJECT",name:"CliToken",fields:[{name:"createdAt",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"lastUsedAt",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"name",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"revokedAt",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"tokenPrefix",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]}],interfaces:[]},{kind:"OBJECT",name:"DevSession",fields:[{name:"createdAt",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"expiresAt",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"healthChecks",type:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"HealthCheck",ofType:null}}},args:[]},{name:"hooksPaused",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"preconditions",type:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"Precondition",ofType:null}}},args:[]},{name:"scopeItems",type:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"ScopeItem",ofType:null}}},args:[]},{name:"updatedAt",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"workflowDiff",type:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"DevSessionWorkflowDiff",ofType:null}},args:[]},{name:"workflows",type:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"Workflow",ofType:null}}},args:[{name:"where",type:{kind:"SCALAR",name:"Any"}}]}],interfaces:[]},{kind:"OBJECT",name:"DevSessionEvent",fields:[{name:"active",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]}],interfaces:[]},{kind:"OBJECT",name:"DevSessionSyncedEvent",fields:[{name:"devSession",type:{kind:"OBJECT",name:"DevSession",ofType:null},args:[]},{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]}],interfaces:[]},{kind:"OBJECT",name:"DevSessionWorkflowDiff",fields:[{name:"added",type:{kind:"NON_NULL",ofType:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"Workflow",ofType:null}}}},args:[]},{name:"modified",type:{kind:"NON_NULL",ofType:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"Workflow",ofType:null}}}},args:[]},{name:"removed",type:{kind:"NON_NULL",ofType:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"Workflow",ofType:null}}}},args:[]}],interfaces:[]},{kind:"OBJECT",name:"DevWorkflowDeleteRequestedEvent",fields:[{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"slug",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]}],interfaces:[]},{kind:"OBJECT",name:"DevWorkflowDuplicateRequestedEvent",fields:[{name:"newSlug",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"sourceSlug",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]}],interfaces:[]},{kind:"OBJECT",name:"GitHubInstallation",fields:[{name:"accountLogin",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"accountType",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"createdAt",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"installationId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]}],interfaces:[]},{kind:"OBJECT",name:"GithubRepository",fields:[{name:"description",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"fullName",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"installationId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"name",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"updatedAt",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"url",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]}],interfaces:[]},{kind:"OBJECT",name:"HealthCheck",fields:[{name:"detail",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"tone",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"type",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"updatedAt",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]}],interfaces:[]},{kind:"OBJECT",name:"HealthChecksChangedEvent",fields:[{name:"devSession",type:{kind:"OBJECT",name:"DevSession",ofType:null},args:[]},{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"userId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]}],interfaces:[]},{kind:"OBJECT",name:"HooksPausedRequestedEvent",fields:[{name:"paused",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]}],interfaces:[]},{kind:"OBJECT",name:"Invoice",fields:[{name:"date",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"hostedInvoiceUrl",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"status",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"totalCents",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]}],interfaces:[]},{kind:"OBJECT",name:"LinkPaymentMethod",fields:[{name:"email",type:{kind:"SCALAR",name:"Any"},args:[]}],interfaces:[]},{kind:"OBJECT",name:"Mutation",fields:[{name:"addAgentScopeItems",type:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"ScopeItem",ofType:null}}},args:[{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"workflowSlugs",type:{kind:"NON_NULL",ofType:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}}}]},{name:"addScopeItem",type:{kind:"OBJECT",name:"ScopeItem",ofType:null},args:[{name:"label",type:{kind:"SCALAR",name:"Any"}},{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"source",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"workflowId",type:{kind:"SCALAR",name:"Any"}}]},{name:"cancelAllPendingRuns",type:{kind:"SCALAR",name:"Any"},args:[{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"cancelRun",type:{kind:"OBJECT",name:"Run",ofType:null},args:[{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"cloneAgentTemplate",type:{kind:"OBJECT",name:"AgentProfile",ofType:null},args:[{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"templateSlug",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"completeRun",type:{kind:"OBJECT",name:"RunResult",ofType:null},args:[{name:"duration",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"failCount",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"passCount",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"runResultId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"status",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"summary",type:{kind:"SCALAR",name:"Any"}},{name:"warnCount",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"createAgentProfile",type:{kind:"OBJECT",name:"AgentProfile",ofType:null},args:[{name:"description",type:{kind:"SCALAR",name:"Any"}},{name:"icon",type:{kind:"SCALAR",name:"Any"}},{name:"name",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"createProject",type:{kind:"OBJECT",name:"Project",ofType:null},args:[{name:"cloudBaseUrl",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"installationId",type:{kind:"SCALAR",name:"Any"}},{name:"name",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"organizationId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"provider",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"repoUrl",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"createRun",type:{kind:"OBJECT",name:"Run",ofType:null},args:[{name:"agentProfileDescription",type:{kind:"SCALAR",name:"Any"}},{name:"agentProfileId",type:{kind:"SCALAR",name:"Any"}},{name:"concurrency",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"executor",type:{kind:"SCALAR",name:"Any"}},{name:"isTest",type:{kind:"SCALAR",name:"Any"}},{name:"platforms",type:{kind:"NON_NULL",ofType:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}}},{name:"workflowId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"deleteAgentProfile",type:{kind:"OBJECT",name:"AgentProfile",ofType:null},args:[{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"deleteDevWorkflow",type:{kind:"OBJECT",name:"Workflow",ofType:null},args:[{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"slug",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"deleteProject",type:{kind:"OBJECT",name:"Project",ofType:null},args:[{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"duplicateDevWorkflow",type:{kind:"SCALAR",name:"Any"},args:[{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"slug",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"endDevSession",type:{kind:"OBJECT",name:"DevSession",ofType:null},args:[{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"linkScopeItem",type:{kind:"OBJECT",name:"ScopeItem",ofType:null},args:[{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"workflowId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"pushHealthChecks",type:{kind:"SCALAR",name:"Any"},args:[{name:"checks",type:{kind:"NON_NULL",ofType:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}}},{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"removeGitHubInstallation",type:{kind:"OBJECT",name:"GitHubInstallation",ofType:null},args:[{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"removeScopeItem",type:{kind:"SCALAR",name:"Any"},args:[{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"removeScopeItems",type:{kind:"SCALAR",name:"Any"},args:[{name:"ids",type:{kind:"NON_NULL",ofType:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}}}]},{name:"revokeCurrentCliToken",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"rotateWebhookSecret",type:{kind:"OBJECT",name:"Project",ofType:null},args:[{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"runAllWorkflows",type:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"Run",ofType:null}}},args:[{name:"agentProfileDescription",type:{kind:"SCALAR",name:"Any"}},{name:"agentProfileId",type:{kind:"SCALAR",name:"Any"}},{name:"concurrency",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"executor",type:{kind:"SCALAR",name:"Any"}},{name:"platforms",type:{kind:"NON_NULL",ofType:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}}},{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"workflowIds",type:{kind:"NON_NULL",ofType:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}}}]},{name:"saveGitHubInstallation",type:{kind:"OBJECT",name:"GitHubInstallation",ofType:null},args:[{name:"input",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"setHooksPaused",type:{kind:"SCALAR",name:"Any"},args:[{name:"paused",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"setOverageCap",type:{kind:"SCALAR",name:"Any"},args:[{name:"capCents",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"organizationId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"startRun",type:{kind:"OBJECT",name:"RunResult",ofType:null},args:[{name:"agentProfileId",type:{kind:"SCALAR",name:"Any"}},{name:"platform",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"runId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"submitRunResults",type:{kind:"OBJECT",name:"RunResult",ofType:null},args:[{name:"agentProfileId",type:{kind:"SCALAR",name:"Any"}},{name:"duration",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"failCount",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"passCount",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"platform",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"runId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"status",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"steps",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"warnCount",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"submitRunSteps",type:{kind:"SCALAR",name:"Any"},args:[{name:"runResultId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"steps",type:{kind:"NON_NULL",ofType:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}}}]},{name:"syncBranch",type:{kind:"OBJECT",name:"TrackedBranch",ofType:null},args:[{name:"branchName",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"syncDevSession",type:{kind:"OBJECT",name:"DevSession",ofType:null},args:[{name:"preconditions",type:{kind:"NON_NULL",ofType:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}}},{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"workflows",type:{kind:"NON_NULL",ofType:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}}}]},{name:"trackBranch",type:{kind:"OBJECT",name:"TrackedBranch",ofType:null},args:[{name:"branchName",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"untrackBranch",type:{kind:"OBJECT",name:"TrackedBranch",ofType:null},args:[{name:"branchName",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"updateAgentProfile",type:{kind:"OBJECT",name:"AgentProfile",ofType:null},args:[{name:"description",type:{kind:"SCALAR",name:"Any"}},{name:"icon",type:{kind:"SCALAR",name:"Any"}},{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"name",type:{kind:"SCALAR",name:"Any"}},{name:"output",type:{kind:"SCALAR",name:"Any"}},{name:"successCriteria",type:{kind:"SCALAR",name:"Any"}}]},{name:"updateProject",type:{kind:"OBJECT",name:"Project",ofType:null},args:[{name:"cloudBaseUrl",type:{kind:"SCALAR",name:"Any"}},{name:"engineBaseUrl",type:{kind:"SCALAR",name:"Any"}},{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"logoUrl",type:{kind:"SCALAR",name:"Any"}},{name:"name",type:{kind:"SCALAR",name:"Any"}}]},{name:"updateUsername",type:{kind:"OBJECT",name:"User",ofType:null},args:[{name:"username",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"updateWorkflow",type:{kind:"OBJECT",name:"Workflow",ofType:null},args:[{name:"baseUrl",type:{kind:"SCALAR",name:"Any"}},{name:"codebaseScope",type:{kind:"SCALAR",name:"Any"}},{name:"expectedOutcome",type:{kind:"SCALAR",name:"Any"}},{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"name",type:{kind:"SCALAR",name:"Any"}},{name:"status",type:{kind:"SCALAR",name:"Any"}}]}],interfaces:[]},{kind:"OBJECT",name:"Organization",fields:[{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"limitStatus",type:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"OrganizationLimitStatus",ofType:null}},args:[{name:"projectId",type:{kind:"SCALAR",name:"Any"}}]},{name:"name",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]}],interfaces:[]},{kind:"OBJECT",name:"OrganizationLimitStatus",fields:[{name:"agentCount",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"agentLimitPerProject",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"canCreateAgent",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"canCreateProject",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"canInviteMember",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"memberCount",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"memberLimit",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"planName",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"projectCount",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"projectLimit",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"runCount",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"runLimit",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"runLimitReached",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"tokenBudgetExceeded",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]}],interfaces:[]},{kind:"OBJECT",name:"OrganizationUsage",fields:[{name:"overageCapCents",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"overageSpentCents",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"periodEnd",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"periodStart",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"runCount",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"runLimit",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"runUsagePercent",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"tokenUsagePercent",type:{kind:"SCALAR",name:"Any"},args:[]}],interfaces:[]},{kind:"OBJECT",name:"OtherPaymentMethod",fields:[{name:"type",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]}],interfaces:[]},{kind:"UNION",name:"PaymentMethod",possibleTypes:[{kind:"OBJECT",name:"BankPaymentMethod"},{kind:"OBJECT",name:"CardPaymentMethod"},{kind:"OBJECT",name:"LinkPaymentMethod"},{kind:"OBJECT",name:"OtherPaymentMethod"}]},{kind:"OBJECT",name:"Plan",fields:[{name:"annualPrice",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"limits",type:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"PlanLimits",ofType:null}},args:[]},{name:"monthlyPrice",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"name",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]}],interfaces:[]},{kind:"OBJECT",name:"PlanLimits",fields:[{name:"historyDays",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"maxAgents",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"maxProjects",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"maxRuns",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"maxUsers",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"runOverageCents",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"scheduling",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"tokenBudgetCents",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]}],interfaces:[]},{kind:"OBJECT",name:"Precondition",fields:[{name:"depends",type:{kind:"NON_NULL",ofType:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}},args:[]},{name:"description",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"name",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"returns",type:{kind:"NON_NULL",ofType:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}},args:[]}],interfaces:[]},{kind:"OBJECT",name:"Project",fields:[{name:"agentProfiles",type:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"AgentProfile",ofType:null}}},args:[]},{name:"cloudBaseUrl",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"createdAt",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"defaultBranch",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"devSession",type:{kind:"OBJECT",name:"DevSession",ofType:null},args:[]},{name:"engineBaseUrl",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"limitStatus",type:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"OrganizationLimitStatus",ofType:null}},args:[]},{name:"logoUrl",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"name",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"organization",type:{kind:"OBJECT",name:"Organization",ofType:null},args:[]},{name:"organizationId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"preconditions",type:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"Precondition",ofType:null}}},args:[{name:"branch",type:{kind:"SCALAR",name:"Any"}}]},{name:"provider",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"repoUrl",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"updatedAt",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"webhookSecret",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"workflows",type:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"Workflow",ofType:null}}},args:[{name:"branch",type:{kind:"SCALAR",name:"Any"}}]}],interfaces:[]},{kind:"OBJECT",name:"ProjectRunStatusEvent",fields:[{name:"agentProfileId",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"completedAt",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"createdAt",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"hasFailed",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"runId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"status",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"workflowId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"workflowSlug",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]}],interfaces:[]},{kind:"OBJECT",name:"Query",fields:[{name:"activeSubscription",type:{kind:"OBJECT",name:"BillingSubscription",ofType:null},args:[{name:"organizationId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"agentProfile",type:{kind:"OBJECT",name:"AgentProfile",ofType:null},args:[{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"agentProfiles",type:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"AgentProfile",ofType:null}}},args:[{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"agentTemplates",type:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"AgentTemplate",ofType:null}}},args:[]},{name:"availablePlans",type:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"Plan",ofType:null}}},args:[]},{name:"currentUser",type:{kind:"OBJECT",name:"User",ofType:null},args:[]},{name:"defaultPaymentMethod",type:{kind:"UNION",name:"PaymentMethod",ofType:null},args:[{name:"organizationId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"gitHubAppInstallUrl",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"gitHubInstallations",type:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"GitHubInstallation",ofType:null}}},args:[]},{name:"githubRepositories",type:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"GithubRepository",ofType:null}}},args:[]},{name:"healthcheck",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"invoices",type:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"Invoice",ofType:null}}},args:[{name:"organizationId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"me",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"organizationLimitStatus",type:{kind:"OBJECT",name:"OrganizationLimitStatus",ofType:null},args:[{name:"organizationId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"projectId",type:{kind:"SCALAR",name:"Any"}}]},{name:"organizationUsage",type:{kind:"OBJECT",name:"OrganizationUsage",ofType:null},args:[{name:"organizationId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"pendingDevRuns",type:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"Run",ofType:null}}},args:[{name:"devSessionId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"project",type:{kind:"OBJECT",name:"Project",ofType:null},args:[{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"projectRuns",type:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"Run",ofType:null}}},args:[{name:"cursor",type:{kind:"SCALAR",name:"Any"}},{name:"devSessionId",type:{kind:"SCALAR",name:"Any"}},{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"take",type:{kind:"SCALAR",name:"Any"}}]},{name:"projects",type:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"Project",ofType:null}}},args:[]},{name:"run",type:{kind:"OBJECT",name:"Run",ofType:null},args:[{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"runResult",type:{kind:"OBJECT",name:"RunResult",ofType:null},args:[{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"runs",type:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"Run",ofType:null}}},args:[{name:"take",type:{kind:"SCALAR",name:"Any"}},{name:"workflowId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"trackedBranches",type:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"TrackedBranch",ofType:null}}},args:[{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"workflow",type:{kind:"OBJECT",name:"Workflow",ofType:null},args:[{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}},{name:"slug",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"workflows",type:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"Workflow",ofType:null}}},args:[{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]}],interfaces:[]},{kind:"OBJECT",name:"Run",fields:[{name:"agentProfile",type:{kind:"OBJECT",name:"AgentProfile",ofType:null},args:[]},{name:"completedAt",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"concurrency",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"createdAt",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"devSessionId",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"executor",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"failureReason",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"isTest",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"platforms",type:{kind:"NON_NULL",ofType:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}},args:[]},{name:"results",type:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"RunResult",ofType:null}}},args:[]},{name:"startedAt",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"status",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"totalRuns",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"updatedAt",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"userId",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"workflow",type:{kind:"OBJECT",name:"Workflow",ofType:null},args:[]}],interfaces:[]},{kind:"UNION",name:"RunProgressEvent",possibleTypes:[{kind:"OBJECT",name:"RunResultUpdated"},{kind:"OBJECT",name:"RunStatusChanged"},{kind:"OBJECT",name:"RunTraceEntryAdded"}]},{kind:"OBJECT",name:"RunRequestedEvent",fields:[{name:"agentProfileDescription",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"agentProfileId",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"executor",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"runId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"workflowId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"workflowSlug",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]}],interfaces:[]},{kind:"OBJECT",name:"RunResult",fields:[{name:"agentProfile",type:{kind:"OBJECT",name:"AgentProfile",ofType:null},args:[]},{name:"createdAt",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"duration",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"failCount",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"passCount",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"perfP50",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"perfP90",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"perfP99",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"perfTotal",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"platform",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"sideEffects",type:{kind:"NON_NULL",ofType:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"SideEffect",ofType:null}}}},args:[]},{name:"status",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"summary",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"traceEntries",type:{kind:"NON_NULL",ofType:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"TraceEntry",ofType:null}}}},args:[]},{name:"updatedAt",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"warnCount",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]}],interfaces:[]},{kind:"OBJECT",name:"RunResultUpdated",fields:[{name:"runResult",type:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"RunResult",ofType:null}},args:[]}],interfaces:[]},{kind:"OBJECT",name:"RunStatusChanged",fields:[{name:"run",type:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"Run",ofType:null}},args:[]}],interfaces:[]},{kind:"OBJECT",name:"RunTraceEntryAdded",fields:[{name:"runResultId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"traceEntry",type:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"TraceEntry",ofType:null}},args:[]}],interfaces:[]},{kind:"OBJECT",name:"ScopeChangedEvent",fields:[{name:"devSession",type:{kind:"OBJECT",name:"DevSession",ofType:null},args:[]},{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"userId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]}],interfaces:[]},{kind:"OBJECT",name:"ScopeItem",fields:[{name:"createdAt",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"label",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"source",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"workflow",type:{kind:"OBJECT",name:"Workflow",ofType:null},args:[]}],interfaces:[]},{kind:"OBJECT",name:"ScreenAnnotation",fields:[{name:"height",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"label",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"type",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"width",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"x",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"y",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]}],interfaces:[]},{kind:"OBJECT",name:"SideEffect",fields:[{name:"detail",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"name",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"status",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]}],interfaces:[]},{kind:"OBJECT",name:"Subscription",fields:[{name:"devSessionChanged",type:{kind:"OBJECT",name:"DevSessionEvent",ofType:null},args:[{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"devSessionSynced",type:{kind:"OBJECT",name:"DevSessionSyncedEvent",ofType:null},args:[{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"devWorkflowDeleteRequested",type:{kind:"OBJECT",name:"DevWorkflowDeleteRequestedEvent",ofType:null},args:[{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"devWorkflowDuplicateRequested",type:{kind:"OBJECT",name:"DevWorkflowDuplicateRequestedEvent",ofType:null},args:[{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"healthChecksChanged",type:{kind:"OBJECT",name:"HealthChecksChangedEvent",ofType:null},args:[{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"hooksPausedRequested",type:{kind:"OBJECT",name:"HooksPausedRequestedEvent",ofType:null},args:[{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"projectRunStatusChanged",type:{kind:"OBJECT",name:"ProjectRunStatusEvent",ofType:null},args:[{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"runProgress",type:{kind:"UNION",name:"RunProgressEvent",ofType:null},args:[{name:"runId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]},{name:"runRequested",type:{kind:"OBJECT",name:"RunRequestedEvent",ofType:null},args:[]},{name:"scopeChanged",type:{kind:"OBJECT",name:"ScopeChangedEvent",ofType:null},args:[{name:"projectId",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}]}],interfaces:[]},{kind:"OBJECT",name:"TraceAssertion",fields:[{name:"description",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"detail",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"status",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]}],interfaces:[]},{kind:"OBJECT",name:"TraceEntry",fields:[{name:"annotations",type:{kind:"NON_NULL",ofType:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"ScreenAnnotation",ofType:null}}}},args:[]},{name:"assertions",type:{kind:"NON_NULL",ofType:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"TraceAssertion",ofType:null}}}},args:[]},{name:"createdAt",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"detail",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"duration",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"nodeType",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"pageUrl",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"screenshotUrl",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"status",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"statusCode",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"stepIndex",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"timestamp",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"title",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"viewportHeight",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"viewportWidth",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]}],interfaces:[]},{kind:"OBJECT",name:"TrackedBranch",fields:[{name:"branchName",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"createdAt",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"headCommit",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"preconditions",type:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"Precondition",ofType:null}}},args:[]},{name:"snapshots",type:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"BranchSnapshot",ofType:null}}},args:[]},{name:"syncedAt",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"updatedAt",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"workflows",type:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"Workflow",ofType:null}}},args:[]}],interfaces:[]},{kind:"OBJECT",name:"User",fields:[{name:"email",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"image",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"name",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"username",type:{kind:"SCALAR",name:"Any"},args:[]}],interfaces:[]},{kind:"OBJECT",name:"Workflow",fields:[{name:"additionalChecks",type:{kind:"NON_NULL",ofType:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}},args:[]},{name:"agentProfiles",type:{kind:"NON_NULL",ofType:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"AgentProfile",ofType:null}}}},args:[]},{name:"codebaseScope",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"createdAt",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"devSessionId",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"expectedOutcome",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"isLocalOnly",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"latestRuns",type:{kind:"NON_NULL",ofType:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"Run",ofType:null}}}},args:[]},{name:"name",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"preconditions",type:{kind:"NON_NULL",ofType:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}}}},args:[]},{name:"project",type:{kind:"OBJECT",name:"Project",ofType:null},args:[]},{name:"requiresKeys",type:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"WorkflowRequiresKey",ofType:null}}},args:[]},{name:"runs",type:{kind:"NON_NULL",ofType:{kind:"LIST",ofType:{kind:"NON_NULL",ofType:{kind:"OBJECT",name:"Run",ofType:null}}}},args:[]},{name:"slug",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"source",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"spec",type:{kind:"SCALAR",name:"Any"},args:[]},{name:"updatedAt",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]}],interfaces:[]},{kind:"OBJECT",name:"WorkflowRequiresKey",fields:[{name:"id",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"namespace",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]},{name:"preconditionName",type:{kind:"NON_NULL",ofType:{kind:"SCALAR",name:"Any"}},args:[]}],interfaces:[]},{kind:"SCALAR",name:"Any"}],directives:[]}}});function W(e,t){e.inspectFields("Query").filter(n=>n.fieldName===t).forEach(n=>{e.invalidate("Query",n.fieldName,n.arguments)})}function pe(e,t,n){e.invalidate({__typename:t,id:n})}function Bk({argMatches:e,cache:t,childKey:n,fieldName:r}){t.inspectFields("Query").filter(o=>o.fieldName===r&&e(o.arguments??null)).forEach(o=>{let i=t.resolve("Query",o.fieldName,o.arguments);if(!Array.isArray(i))return;let a=i.map(s=>typeof s=="string"?s:null);a.includes(n)||t.link("Query",o.fieldName,o.arguments,[n,...a])})}function Oo({cache:e,childId:t,childTypeName:n,fieldName:r,parentId:o,parentTypeName:i}){let a=e.keyOfEntity({__typename:i,id:o});if(a==null)return!1;let s=e.keyOfEntity({__typename:n,id:t});if(s==null)return!1;let l=e.resolve(a,r);if(!Array.isArray(l))return!1;let c=l.map(d=>typeof d=="string"?d:null);return c.includes(s)||e.link(a,r,void 0,[...c,s]),!0}function Vk(e,t){let n=t.traceEntry?.id,r=t.runResultId;if(n==null||r==null)return;Oo({cache:e,childId:n,childTypeName:"TraceEntry",fieldName:"traceEntries",parentId:r,parentTypeName:"RunResult"})||pe(e,"RunResult",r)}function Io(e){return e==="completed"||e==="failed"}function Wk(e,t){if(t.runId==null)return;let n=Io(t.status),r=t.completedAt??(n?new Date().toISOString():null);e.writeFragment(cc,{agentProfile:t.agentProfileId==null?null:{id:t.agentProfileId},completedAt:r,createdAt:t.createdAt??new Date().toISOString(),id:t.runId,status:t.status??"pending"})}function dc(e,t){e.invalidate({__typename:"Run",id:t},"results")}function qk(e,t){e.workflowId==null||e.runId==null||Oo({cache:t,childId:e.runId,childTypeName:"Run",fieldName:"latestRuns",parentId:e.workflowId,parentTypeName:"Workflow"})}function Fk(e,t){let n=e.runId!=null&&t.resolve({__typename:"Run",id:e.runId},"id")==null;Wk(t,e),Io(e.status)&&e.runId!=null&&dc(t,e.runId),n&&(W(t,"run"),Hk(t,e)),qk(e,t)}function Hk(e,t){if(t.runId==null)return;let n=e.keyOfEntity({__typename:"Run",id:t.runId});if(n==null){W(e,"projectRuns");return}Bk({cache:e,childKey:n,fieldName:"projectRuns",argMatches:r=>{if(r?.cursor!=null)return!1;let i=r?.projectId;return!(typeof i=="string"&&i!==t.workflowId)}}),W(e,"projectRuns")}function Mk(e,t,n){let r=e.keyOfEntity({__typename:"Project",id:t});if(r==null)return;let o=e.resolve(r,"devSession");if(typeof o!="string")return;let i=e.resolve(o,"scopeItems");if(!Array.isArray(i))return;let a=i.flatMap(l=>typeof l=="string"?[l]:[]),s=e.keyOfEntity({__typename:"ScopeItem",id:n});s==null||a.includes(s)||e.link(o,"scopeItems",void 0,[...a,{__typename:"ScopeItem",id:n}])}function zk(e,t){e.inspectFields("Query").filter(n=>n.fieldName==="project").forEach(n=>{let r=e.resolve("Query",n.fieldName,n.arguments);if(typeof r!="string")return;let o=e.resolve(r,"devSession");typeof o=="string"&&e.writeFragment(Jk,{hooksPaused:t,id:o.replace(/^DevSession:/,"")})})}function Xk(){return{addScopeItem(e,t,n){let r=e.addScopeItem?.id;r!=null&&Mk(n,t.projectId,r)},cancelAllPendingRuns(e,t,n){W(n,"workflows"),W(n,"projectRuns")},cancelRun(e,t,n){let r=e.cancelRun?.id;r!=null&&pe(n,"Run",r)},cloneAgentTemplate(e,t,n){W(n,"agentProfiles")},createAgentProfile(e,t,n){W(n,"agentProfiles")},createRun(e,t,n){W(n,"run"),W(n,"runs"),W(n,"projectRuns");let r=e.createRun?.id;r!=null&&(n.writeFragment(cc,{agentProfile:t.agentProfileId==null?null:{id:t.agentProfileId},completedAt:null,createdAt:new Date().toISOString(),id:r,status:"pending"}),Oo({cache:n,childId:r,childTypeName:"Run",fieldName:"latestRuns",parentId:t.workflowId,parentTypeName:"Workflow"}))},deleteAgentProfile(e,t,n){let r=e.deleteAgentProfile?.id;r!=null&&pe(n,"AgentProfile",r)},deleteDevWorkflow(e,t,n){let r=e.deleteDevWorkflow?.id;r!=null&&pe(n,"Workflow",r),W(n,"workflows")},deleteProject(e,t,n){let r=e.deleteProject?.id;r!=null&&pe(n,"Project",r),W(n,"projects")},duplicateDevWorkflow(e,t,n){W(n,"workflows")},endDevSession(e,t,n){let r=e.endDevSession?.id;r!=null&&pe(n,"DevSession",r)},linkScopeItem(e,t,n){let r=e.linkScopeItem?.id;r!=null&&pe(n,"ScopeItem",r)},removeScopeItem(e,t,n){pe(n,"ScopeItem",t.id)},runAllWorkflows(e,t,n){W(n,"runs"),W(n,"projectRuns")},setHooksPaused(e,t,n){zk(n,t.paused)},setOverageCap(e,t,n){W(n,"organizationUsage")},updateProject(e,t,n){let r=e.updateProject?.id;r!=null&&pe(n,"Project",r)},updateUsername(e,t,n){let r=e.updateUsername?.id;r!=null&&pe(n,"User",r),W(n,"currentUser")}}}function _o(){return{keys:Dk,optimistic:{addScopeItem:e=>({__typename:"ScopeItem",createdAt:new Date().toISOString(),id:`optimistic_${String(Date.now())}`,label:e.label??null,source:e.source,workflow:null}),removeScopeItem:()=>!0},schema:Po,updates:{Mutation:Xk(),Subscription:{devSessionChanged(e,t,n){let r=e.devSessionChanged;r?.projectId!=null&&pe(n,"Project",r.projectId),r?.active===!1&&(W(n,"workflows"),W(n,"workflow"),W(n,"runs"),W(n,"run"),W(n,"projectRuns"))},devSessionSynced(e,t,n){W(n,"workflow"),W(n,"workflows");let r=e.devSessionSynced?.devSession?.id;r!=null&&n.invalidate({__typename:"DevSession",id:r},"workflowDiff")},projectRunStatusChanged(e,t,n){let r=e.projectRunStatusChanged;r!=null&&Fk(r,n)},runProgress(e,t,n){let r=e.runProgress;r?.__typename==="RunTraceEntryAdded"&&Vk(n,r),r?.__typename==="RunResultUpdated"&&r.runResult?.id!=null&&pe(n,"RunResult",r.runResult.id),r?.__typename==="RunStatusChanged"&&r.run?.id!=null&&Io(r.run.status)&&dc(n,r.run.id)}}}}}var Dk,cc,Jk,pc=f(()=>{"use strict";lc();Eo();Dk={AgentProfile:e=>e.id??null,AgentTemplate:e=>e.id??null,BankPaymentMethod:()=>null,BillingSubscription:e=>e.id??null,BranchSnapshot:e=>e.id??null,CardPaymentMethod:()=>null,CliToken:e=>e.id??null,DevSession:e=>e.id??null,DevSessionEvent:()=>null,DevSessionSyncedEvent:()=>null,DevSessionWorkflowDiff:()=>null,DevWorkflowDeleteRequestedEvent:()=>null,DevWorkflowDuplicateRequestedEvent:()=>null,GitHubInstallation:e=>e.id??null,GithubRepository:()=>null,HealthCheck:e=>e.id??null,HealthChecksChangedEvent:()=>null,HooksPausedRequestedEvent:()=>null,Invoice:e=>e.id??null,LinkPaymentMethod:()=>null,Organization:e=>e.id??null,OrganizationLimitStatus:()=>null,OrganizationUsage:()=>null,OtherPaymentMethod:()=>null,Plan:()=>null,PlanLimits:()=>null,Precondition:e=>e.id??null,Project:e=>e.id??null,ProjectRunStatusEvent:()=>null,Run:e=>e.id??null,RunRequestedEvent:()=>null,RunResult:e=>e.id??null,RunResultUpdated:()=>null,RunStatusChanged:()=>null,RunTraceEntryAdded:()=>null,ScopeChangedEvent:()=>null,ScopeItem:e=>e.id??null,ScreenAnnotation:e=>e.id??null,SideEffect:e=>e.id??null,TraceAssertion:e=>e.id??null,TraceEntry:e=>e.id??null,TrackedBranch:e=>e.id??null,User:e=>e.id??null,Workflow:e=>e.id??null,WorkflowRequiresKey:e=>e.id??null};cc=xo(`
|
|
228
228
|
fragment RunCache on Run {
|
|
229
229
|
id
|
|
230
230
|
status
|
|
@@ -239,7 +239,7 @@ ${t.join(`
|
|
|
239
239
|
id
|
|
240
240
|
hooksPaused
|
|
241
241
|
}
|
|
242
|
-
`)});var
|
|
242
|
+
`)});var uc=f(()=>{"use strict";pc();Eo()});import{Client as Gk,fetchExchange as Kk,subscriptionExchange as Qk}from"urql";import{cacheExchange as Yk}from"@urql/exchange-graphcache";import{createClient as Zk}from"graphql-sse";function mc({config:e}){let t=`${e.ripploServerUrl}/graphql`,n={Authorization:`Bearer ${e.token}`},r=Zk({headers:n,retryAttempts:1/0,url:t});return new Gk({exchanges:[Yk(_o()),Qk({forwardSubscription:o=>({subscribe:i=>o.query==null?{unsubscribe:()=>{}}:{unsubscribe:r.subscribe({query:o.query,variables:o.variables},i)}})}),Kk],fetchOptions:{headers:n},requestPolicy:"cache-and-network",url:t})}var fc=f(()=>{"use strict";uc()});import{Box as yc,Text as q,useInput as eS}from"ink";import{jsx as K,jsxs as Le}from"react/jsx-runtime";function gc({deviceCodeInfo:e,error:t,loginStarted:n,startLogin:r}){return eS((o,i)=>{i.return&&!n&&r()}),t!=null?Le(yc,{flexDirection:"column",gap:1,children:[Le(q,{children:[K(q,{color:"red",children:" \u2717 "}),K(q,{children:t})]}),Le(q,{children:[K(q,{color:"cyan",children:" \u2192 "}),K(q,{children:"Press "}),K(q,{bold:!0,children:"Enter"}),K(q,{children:" to try again"})]})]}):e!=null?Le(yc,{flexDirection:"column",gap:1,paddingLeft:2,children:[Le(q,{children:[K(q,{color:"yellow",children:"* "}),K(q,{children:"Your code: "}),K(q,{bold:!0,color:"white",children:e.userCode})]}),Le(q,{children:[K(q,{color:"yellow",children:"* "}),K(q,{children:"Waiting for browser authorization..."})]}),Le(q,{dimColor:!0,children:[" ",e.verificationUrl]})]}):n?Le(q,{children:[K(q,{color:"yellow",children:" * "}),K(q,{children:"Opening browser..."})]}):Le(q,{children:[K(q,{color:"cyan",children:" \u2192 "}),K(q,{children:"Press "}),K(q,{bold:!0,children:"Enter"}),K(q,{children:" to open browser for authentication"})]})}var hc=f(()=>{"use strict"});import{useState as tS}from"react";import{Box as nS,Text as Ln,useInput as rS}from"ink";import{jsx as xn,jsxs as oS}from"react/jsx-runtime";function kc({items:e,onSelect:t}){let[n,r]=tS(0);return rS((o,i)=>{if(i.upArrow&&r(a=>Math.max(0,a-1)),i.downArrow&&r(a=>Math.min(e.length-1,a+1)),i.return){let a=e[n];a!=null&&t(a.value)}}),xn(nS,{flexDirection:"column",children:e.map((o,i)=>oS(Ln,{children:[i===n?xn(Ln,{color:"cyan",children:"> "}):xn(Ln,{children:" "}),xn(Ln,{bold:i===n,children:o.label})]},o.value))})}var Sc=f(()=>{"use strict"});import{Box as iS,Text as We,useInput as aS}from"ink";import{jsx as mt,jsxs as Uo}from"react/jsx-runtime";function wc({reexecute:e,serverUrl:t}){let n=`${t}/connect`;return aS((r,o)=>{o.return&&e()}),Uo(iS,{flexDirection:"column",children:[Uo(We,{children:[mt(We,{color:"cyan",children:" \u2192 "}),mt(We,{children:"No projects found. Create one at: "}),mt(We,{bold:!0,color:"cyan",children:n})]}),Uo(We,{children:[" ",mt(We,{dimColor:!0,children:"Press "}),mt(We,{bold:!0,children:"Enter"}),mt(We,{dimColor:!0,children:" to refresh after creating a project"})]})]})}var bc=f(()=>{"use strict"});import{useEffect as sS,useMemo as lS,useRef as cS}from"react";import{Box as Ac,Text as Ke}from"ink";import{useQuery as dS}from"urql";import{graphql as pS}from"gql.tada";import{jsx as Qe,jsxs as Pn}from"react/jsx-runtime";function Rc({selectProject:e,serverUrl:t}){let[n,r]=dS({query:uS}),o=cS(!1),i=lS(()=>n.data?.projects??[],[n.data?.projects]);if(sS(()=>{let l=i[0];i.length===1&&l!=null&&(l.workflows?.length??0)===0&&!o.current&&(o.current=!0,e({id:l.id,name:l.name}))},[i,e]),n.fetching)return Pn(Ke,{children:[Qe(Ke,{color:"yellow",children:" * "}),Qe(Ke,{children:"Loading projects..."})]});if(n.error!=null)return Pn(Ke,{color:"red",children:[" \u2717 ","Failed to fetch projects: ",n.error.message]});if(i.length===0)return Qe(wc,{reexecute:r,serverUrl:t});let a=i.map(l=>({label:l.name,value:l.id}));function s(l){let c=i.find(d=>d.id===l);c!=null&&e({id:c.id,name:c.name})}return Pn(Ac,{flexDirection:"column",children:[Pn(Ke,{children:[Qe(Ke,{color:"cyan",children:" \u2192 "}),Qe(Ke,{children:"Select a project:"})]}),Qe(Ac,{marginLeft:4,marginTop:1,children:Qe(kc,{items:a,onSelect:s})})]})}var uS,Tc=f(()=>{"use strict";Sc();bc();uS=pS(`
|
|
243
243
|
query SetupProjectSelect {
|
|
244
244
|
projects {
|
|
245
245
|
id
|
|
@@ -249,11 +249,11 @@ ${t.join(`
|
|
|
249
249
|
}
|
|
250
250
|
}
|
|
251
251
|
}
|
|
252
|
-
`)});import{Box as jt,Text as ue,useInput as mS}from"ink";import fS from"ink-spinner";import{jsx as xe,jsxs as Se}from"react/jsx-runtime";function
|
|
252
|
+
`)});import{Box as jt,Text as ue,useInput as mS}from"ink";import fS from"ink-spinner";import{jsx as xe,jsxs as Se}from"react/jsx-runtime";function vc({config:e,error:t,onDismissWarnings:n,scaffoldingStep:r,scaffoldWarnings:o,selectProject:i,stage:a}){return mS((s,l)=>{a==="scaffolding-warnings"&&l.return&&n()}),Se(jt,{flexDirection:"column",padding:1,children:[Se(ue,{bold:!0,children:[" ","ripplo setup"]}),xe(ue,{children:""}),Se(ue,{children:[xe(ue,{color:"green",children:" \u2713 "}),xe(ue,{children:"Authenticated"})]}),yS({config:e,scaffoldingStep:r,scaffoldWarnings:o,selectProject:i,stage:a}),t==null?null:xe(jt,{marginTop:1,children:Se(ue,{color:"red",children:[" ","Error: ",t]})})]})}function yS({config:e,scaffoldingStep:t,scaffoldWarnings:n,selectProject:r,stage:o}){return o==="scaffolding"?Se(ue,{children:[Se(ue,{color:"cyan",children:[" ",xe(fS,{type:"dots"})]}),Se(ue,{children:[" ",t??"Setting up local environment..."]})]}):o==="scaffolding-warnings"?Se(jt,{flexDirection:"column",marginTop:1,children:[xe(ue,{color:"yellow",children:" \u26A0 Setup finished with warnings:"}),n.map((i,a)=>Se(jt,{flexDirection:"column",marginTop:1,children:[Se(ue,{children:[" ",i.message]}),i.manualCommand==null?null:Se(ue,{color:"cyan",children:[" $ ",i.manualCommand]})]},a)),xe(jt,{marginTop:1,children:xe(ue,{dimColor:!0,children:" Press enter to continue to the dashboard."})})]}):xe(Rc,{selectProject:r,serverUrl:e.ripploServerUrl})}var Nc=f(()=>{"use strict";Tc()});import{useEffect as gS,useState as hS}from"react";function ft(){let[e,t]=hS(Cc);return gS(()=>{function n(){t(Cc())}return process.stdout.on("resize",n),()=>{process.stdout.off("resize",n)}},[]),e}function Cc(){return{height:process.stdout.rows,width:process.stdout.columns}}var En=f(()=>{"use strict"});import{useEffect as kS,useRef as SS,useState as wS}from"react";function Lc({config:e,cwd:t}){let[n,r]=wS({config:e,devSessionId:void 0,syncError:void 0,syncing:!0}),o=SS(void 0);return kS(()=>{function i({config:s,devSessionId:l}){r(c=>({...c,config:s,devSessionId:l,syncError:void 0,syncing:!1}))}function a(s){r(l=>({...l,syncError:s,syncing:!1}))}return Ql({config:e,cwd:t}).then(({config:s,devSessionId:l,hash:c})=>{i({config:s,devSessionId:l}),o.current=vo({config:s,cwd:t,devSessionId:l,lastHash:c,onSyncError:a,onSyncSuccess:i})}).catch(s=>{let l=s instanceof Error?s.message:String(s);a(l),o.current=vo({config:e,cwd:t,devSessionId:"",lastHash:"",onSyncError:a,onSyncSuccess:i})}),()=>{o.current?.()}},[e,t]),n}var xc=f(()=>{"use strict";No()});function On(e){return{...bS(e),type:e.type}}function bS(e){switch(e.type){case"settings":return AS(e);case"token":return RS(e.exists);case"dev-server":return TS(e);case"preconditions":return PS(e);case"engine-endpoint":return vS(e);case"adapter-enabled":return OS(e.status);case"webhook-verification":return NS(e.rejectsUnsigned);case"preconditions-validation":return CS(e);case"workflows":return IS(e);case"browser":return LS(e.installed);case"lockfile":return US(e.status);case"pre-commit-hook":return xS(e.installed)}}function AS(e){return e.valid?{detail:"configured",label:"Settings",tone:"ok"}:{detail:`missing ${e.missingFields.join(", ")}`,label:"Settings",tone:"error"}}function RS(e){return e?{detail:"signed in",label:"Auth",tone:"ok"}:{detail:"not signed in",label:"Auth",tone:"error"}}function TS(e){return e.reachable?{detail:e.appUrl,label:"Dev server",tone:"ok"}:{detail:`${e.appUrl} unreachable`,label:"Dev server",tone:"error"}}function vS(e){return e.reachable?{detail:e.url,label:"Endpoint",tone:"ok"}:{detail:`${e.url} unreachable`,label:"Endpoint",tone:"error"}}function NS(e){return e?{detail:"rejects unsigned",label:"Webhook auth",tone:"ok"}:{detail:"accepts unsigned!",label:"Webhook auth",tone:"error"}}function CS(e){if(e.valid)return{detail:"valid",label:"State graph",tone:"ok"};let t=e.errorCount===1?"":"s";return{detail:`${String(e.errorCount)} error${t}`,label:"State graph",tone:"error"}}function LS(e){return e?{detail:"chromium installed",label:"Browser",tone:"ok"}:{detail:"chromium missing",label:"Browser",tone:"error"}}function xS(e){return e?{detail:"installed",label:"Pre-commit",tone:"ok"}:{detail:"not installed",label:"Pre-commit",tone:"warn"}}function PS(e){return e.count===0?{detail:"none defined",label:"Preconditions",tone:"info"}:e.configured?e.endpointReachable===!1?{detail:`${String(e.count)} defined, endpoint unreachable`,label:"Preconditions",tone:"error"}:{detail:`${String(e.count)} defined`,label:"Preconditions",tone:"ok"}:{detail:`${String(e.count)} defined, url unset`,label:"Preconditions",tone:"error"}}function OS(e){let t=ES[e];return t??{detail:"unreachable",label:"Adapter",tone:"error"}}function IS(e){return e.total===0?{detail:"none defined",label:"Tests",tone:"info"}:e.invalidNames.length>0?{detail:`${String(e.invalidNames.length)} invalid of ${String(e.total)}`,label:"Tests",tone:"error"}:{detail:`${String(e.total)} valid`,label:"Tests",tone:"ok"}}function US(e){let t=_S[e];return t??{detail:"stale (run ripplo compile)",label:"Lockfile",tone:"warn"}}var ES,_S,Pc,Ec,jo=f(()=>{"use strict";ES={"bad-secret":{detail:"webhook secret mismatch",label:"Adapter",tone:"error"},disabled:{detail:"disabled (set ENABLE_RIPPLO_TESTING)",label:"Adapter",tone:"error"},enabled:{detail:"enabled",label:"Adapter",tone:"ok"},"no-secret":{detail:"no webhook secret",label:"Adapter",tone:"error"},unreachable:{detail:"unreachable",label:"Adapter",tone:"error"}};_S={match:{detail:"up to date",label:"Lockfile",tone:"ok"},missing:{detail:"missing (run ripplo compile)",label:"Lockfile",tone:"error"},stale:{detail:"stale (run ripplo compile)",label:"Lockfile",tone:"warn"}};Pc={"adapter-enabled":"ADAPTER_ENABLED",browser:"BROWSER","dev-server":"DEV_SERVER","engine-endpoint":"ENGINE_ENDPOINT",lockfile:"LOCKFILE","pre-commit-hook":"PRE_COMMIT_HOOK",preconditions:"PRECONDITIONS","preconditions-validation":"PRECONDITIONS_VALIDATION",settings:"SETTINGS",token:"TOKEN","webhook-verification":"WEBHOOK_VERIFICATION",workflows:"WORKFLOWS"},Ec={error:"ERROR",info:"INFO",ok:"OK",warn:"WARN"}});import{useEffect as jS,useState as $S}from"react";import DS from"path";import{watch as BS}from"chokidar";import{graphql as VS}from"gql.tada";function Oc({config:e,cwd:t}){let[n,r]=$S({checks:[],lastRunAt:void 0,running:!1});return jS(()=>{let o={cancelled:!1,inFlight:!1,lastPushedKey:void 0},i;async function a(){if(!(o.cancelled||o.inFlight)){o.inFlight=!0;try{let c=await kn(t);r({checks:c,lastRunAt:Date.now(),running:!1}),o.lastPushedKey=await FS({checks:c,config:e,lastPushedKey:o.lastPushedKey})}catch(c){A.error(c,"health check tick failed")}finally{o.inFlight=!1}}}function s(){o.cancelled||(i=setTimeout(()=>{a().finally(s)},WS))}a().finally(s);let l=BS(DS.join(t,".ripplo","ripplo.lock"),{ignoreInitial:!0,persistent:!0});return l.on("all",()=>{a()}),()=>{o.cancelled=!0,i!=null&&clearTimeout(i),l.close()}},[e,t]),n}async function FS({checks:e,config:t,lastPushedKey:n}){if(t.projectId.length===0)return n;let r=e.map(i=>{let a=On(i);return{detail:a.detail,tone:Ec[a.tone],type:Pc[a.type]}}),o=JSON.stringify(r);if(o===n)return n;try{return await $({config:t,document:qS,variables:{checks:r,projectId:t.projectId}}),o}catch(i){return A.error(i,"Failed to push health checks"),n}}var WS,qS,Ic=f(()=>{"use strict";G();yo();jo();WS=5e3,qS=VS(`
|
|
253
253
|
mutation PushHealthChecks($projectId: String!, $checks: [HealthCheckInput!]!) {
|
|
254
254
|
pushHealthChecks(projectId: $projectId, checks: $checks)
|
|
255
255
|
}
|
|
256
|
-
`)});import $o from"fs";import{useEffect as HS}from"react";import{useQuery as MS,useSubscription as JS}from"urql";import{graphql as
|
|
256
|
+
`)});import $o from"fs";import{useEffect as HS}from"react";import{useQuery as MS,useSubscription as JS}from"urql";import{graphql as Uc}from"gql.tada";function jc({cwd:e,projectId:t}){let[{data:n}]=MS({query:zS,variables:{projectId:t}});HS(()=>{let r=n?.project?.devSession?.hooksPaused;r!=null&&_c({cwd:e,paused:r})},[e,n]),JS({query:XS,variables:{projectId:t}},(r,o)=>{let i=o.hooksPausedRequested;return i!=null&&_c({cwd:e,paused:i.paused}),o})}function _c({cwd:e,paused:t}){let n=be(e,"hooks-paused");if(t){Xe(e),$o.writeFileSync(n,"");return}$o.existsSync(n)&&$o.unlinkSync(n)}var zS,XS,$c=f(()=>{"use strict";G();zS=Uc(`
|
|
257
257
|
query HooksPausedState($projectId: String!) {
|
|
258
258
|
project(id: $projectId) {
|
|
259
259
|
id
|
|
@@ -263,14 +263,14 @@ ${t.join(`
|
|
|
263
263
|
}
|
|
264
264
|
}
|
|
265
265
|
}
|
|
266
|
-
`),XS=
|
|
266
|
+
`),XS=Uc(`
|
|
267
267
|
subscription HooksPausedRequested($projectId: String!) {
|
|
268
268
|
hooksPausedRequested(projectId: $projectId) {
|
|
269
269
|
paused
|
|
270
270
|
projectId
|
|
271
271
|
}
|
|
272
272
|
}
|
|
273
|
-
`)});import{useEffect as GS,useState as
|
|
273
|
+
`)});import{useEffect as GS,useState as Dc}from"react";import{useQuery as KS,useSubscription as Bc}from"urql";import{graphql as Do}from"gql.tada";function Wc({projectId:e}){let[{data:t}]=KS({query:QS,variables:{projectId:e}}),[n,r]=Dc(),[o,i]=Dc();return GS(()=>{let a=t?.project?.devSession?.hooksPaused;a!=null&&r(a);let s=t?.project?.devSession?.scopeItems;s!=null&&i(s.map(l=>Vc(l)))},[t]),Bc({query:YS,variables:{projectId:e}},(a,s)=>{let l=s.hooksPausedRequested;return l!=null&&r(l.paused),s}),Bc({query:ZS,variables:{projectId:e}},(a,s)=>{let l=s.scopeChanged?.devSession?.scopeItems;return l!=null&&i(l.map(c=>Vc(c))),s}),{paused:n??!1,projectName:t?.project?.name,scope:o??[]}}function Vc(e){let t=e.workflow;return t!=null?{id:e.id,label:t.name}:{id:e.id,label:e.label??"(intent)"}}var QS,YS,ZS,qc=f(()=>{"use strict";QS=Do(`
|
|
274
274
|
query ProjectStateDashboard($projectId: String!) {
|
|
275
275
|
project(id: $projectId) {
|
|
276
276
|
id
|
|
@@ -315,10 +315,10 @@ ${t.join(`
|
|
|
315
315
|
}
|
|
316
316
|
}
|
|
317
317
|
}
|
|
318
|
-
`)});import{Box as ew,Text as Bo}from"ink";import{jsx as Hc,jsxs as Mc}from"react/jsx-runtime";function Jc({activeRunCount:e,browsersReady:t,maxConcurrency:n}){return Mc(ew,{paddingX:1,children:[Hc(Bo,{dimColor:!0,children:"Activity "}),Mc(Bo,{children:[String(e),"/",String(n)," running \xB7 browsers"," "]}),Hc(Bo,{color:t?"green":"yellow",children:t?"ready":"warming"})]})}var zc=f(()=>{"use strict"});import{Box as tw,Text as In}from"ink";import{jsx as _n,jsxs as rw}from"react/jsx-runtime";function Xc({check:e}){let{detail:t,label:n,tone:r}=On(e),o=nw[r];return rw(tw,{children:[_n(In,{color:o,children:r==="info"?"\u25CB":"\u25CF"}),_n(In,{children:" "}),_n(In,{children:n.padEnd(18," ")}),_n(In,{color:o,children:t})]})}var nw,Gc=f(()=>{"use strict";jo();nw={error:"red",info:"gray",ok:"green",warn:"yellow"}});import{Box as ow,Text as Kc}from"ink";import{jsx as Vo,jsxs as iw}from"react/jsx-runtime";function Qc({checks:e}){return iw(ow,{borderColor:"gray",borderStyle:"round",flexDirection:"column",marginTop:1,paddingX:1,children:[Vo(Kc,{bold:!0,children:"Health"}),e.length===0?Vo(Kc,{dimColor:!0,children:"Running first pass..."}):e.map(t=>Vo(Xc,{check:t},t.type))]})}var Yc=f(()=>{"use strict";Gc()});import{Box as Un,Text as yt}from"ink";import{jsx as gt,jsxs as jn}from"react/jsx-runtime";function Zc({appUrl:e,developerUrl:t,projectName:n}){return jn(Un,{borderColor:"gray",borderStyle:"round",flexDirection:"column",paddingX:1,children:[jn(Un,{children:[gt(yt,{dimColor:!0,children:"Project "}),gt(yt,{bold:!0,children:n})]}),jn(Un,{children:[gt(yt,{dimColor:!0,children:"App "}),gt(yt,{color:"cyan",children:e})]}),jn(Un,{children:[gt(yt,{dimColor:!0,children:"Dashboard "}),gt(yt,{color:"cyan",children:t})]})]})}var ed=f(()=>{"use strict"});import{Box as Wo,Text as qe}from"ink";import{jsx as Fe,jsxs as qo}from"react/jsx-runtime";function td({paused:e,scope:t}){return qo(Wo,{borderColor:"gray",borderStyle:"round",flexDirection:"column",marginTop:1,paddingX:1,children:[qo(Wo,{children:[Fe(qe,{bold:!0,children:"Scope"}),Fe(qe,{dimColor:!0,children:` (${String(t.length)})`}),Fe(qe,{children:" "}),Fe(qe,{dimColor:!0,children:"Hooks "}),Fe(qe,{color:e?"yellow":"green",children:e?"paused":"active"})]}),t.length===0?Fe(qe,{dimColor:!0,children:"no scope items \u2014 add from the dashboard or `ripplo scope add`"}):t.map(n=>qo(Wo,{children:[Fe(qe,{color:"cyan",children:"\u2022 "}),Fe(qe,{children:n.label})]},n.id))]})}var nd=f(()=>{"use strict"});import{Box as aw,Text as rd}from"ink";import{jsx as sw,jsxs as od}from"react/jsx-runtime";function id({preconditions:e,workflows:t}){let n=t?.type==="workflows"?t.total:0,r=t?.type==="workflows"?t.invalidNames.length:0,o=e?.type==="preconditions"?e.count:0;return od(aw,{marginTop:1,paddingX:1,children:[sw(rd,{dimColor:!0,children:"Workflows "}),od(rd,{children:[String(n)," tests \xB7 ",String(o)," preconditions",r>0?` \xB7 ${String(r)} invalid`:""]})]})}var ad=f(()=>{"use strict"});import tI from"chalk";import{z as sd}from"zod";async function ld(){let e=new AbortController,t=setTimeout(()=>{e.abort()},3e3);try{let n=await fetch(`https://registry.npmjs.org/${lw}/latest`,{headers:{accept:"application/json"},signal:e.signal});if(!n.ok)return;let r=await n.json();return cw.parse(r).version}catch{return}finally{clearTimeout(t)}}var Fo,lw,cw,cd=f(()=>{"use strict";G();Fo="0.3.3",lw="ripplo",cw=sd.object({version:sd.string()})});import{useEffect as dw,useState as pw}from"react";import{Text as Ye}from"ink";import{jsx as ht,jsxs as yw}from"react/jsx-runtime";function dd({activeRunCount:e,browsersReady:t,connected:n,projectId:r,ripploServerUrl:o,syncError:i,width:a}){let s=fw(),l=s!=null&&s!==Fo,c=uw({connected:n,syncError:i}),d=t?"":" warming up browsers...",u=e>0?` ${String(e)} running`:"",p=`v${Fo}`,m=l?` \u2192 v${s}`:"",h=`project ${r} \xB7 q to quit`,S=` ripplo ${p}${m} | ${o} ${c}${d}${u}`,w=Math.max(0,a-S.length-h.length-1);return yw(Ye,{inverse:!0,children:[ht(Ye,{bold:!0,children:" ripplo "}),ht(Ye,{dimColor:!0,children:p}),l?ht(Ye,{color:"yellow",children:` \u2192 v${s}`}):null,` | ${o} `,ht(Ye,{color:mw({connected:n,syncError:i}),children:c}),t?null:ht(Ye,{color:"yellow",children:d}),u," ".repeat(w),ht(Ye,{dimColor:!0,children:h})," "]})}function uw({connected:e,syncError:t}){return t!=null?"sync failed":e?"connected":"connecting..."}function mw({connected:e,syncError:t}){return t!=null?"red":e?"green":"yellow"}function fw(){let[e,t]=pw();return dw(()=>{ld().then(n=>{n!=null&&t(n)})},[]),e}var pd=f(()=>{"use strict";cd()});import{useEffect as gw}from"react";import{availableParallelism as hw}from"os";import{Box as Ho,Text as kw,useApp as Sw,useInput as ww}from"ink";import{jsx as He,jsxs as ud}from"react/jsx-runtime";function md({config:e,cwd:t}){let n=Sw(),{height:r,width:o}=ft(),{config:i,devSessionId:a,syncError:s}=xc({config:e,cwd:t}),{activeRunCount:l,browsersReady:c,connected:d}=sc({config:i,cwd:t,devSessionId:a}),{checks:u}=Ic({config:i,cwd:t}),{paused:p,projectName:m,scope:h}=qc({projectId:e.projectId});$c({cwd:t,projectId:e.projectId}),gw(()=>_l(t),[t]),ww(T=>{T==="q"&&n.exit()});let S=`${i.ripploServerUrl}/projects/${i.projectId}/developer`,w=u.filter(T=>bw.has(T.type)),k=u.find(T=>T.type==="workflows"),b=u.find(T=>T.type==="preconditions"),v=hw(),L=m??"\u2026";return ud(Ho,{flexDirection:"column",height:r,width:o,children:[He(dd,{activeRunCount:l,browsersReady:c,connected:d,projectId:i.projectId,ripploServerUrl:i.ripploServerUrl,syncError:s,width:o}),ud(Ho,{flexDirection:"column",flexGrow:1,paddingX:1,paddingY:1,children:[He(Zc,{appUrl:i.appUrl,developerUrl:S,projectName:L}),He(td,{paused:p,scope:h}),He(Qc,{checks:w}),He(id,{preconditions:b,workflows:k}),He(Jc,{activeRunCount:l,browsersReady:c,maxConcurrency:v}),He(Ho,{marginTop:1,paddingX:1,children:He(kw,{dimColor:!0,children:"q quit"})})]})]})}var bw,fd=f(()=>{"use strict";bo();En();Pc();_c();Dc();Fc();Lo();zc();Yc();ed();nd();ad();pd();bw=new Set(["dev-server","preconditions","adapter-enabled","webhook-verification","lockfile","pre-commit-hook","browser"])});import{Text as yd}from"ink";import Aw from"ink-spinner";import{jsx as gd,jsxs as Tw}from"react/jsx-runtime";function hd({loading:e}){return e?Tw(yd,{color:Rw,children:[gd(Aw,{type:"dots"})," Starting..."]}):gd(yd,{children:""})}var Rw,kd=f(()=>{"use strict";Rw="#24CFFF"});import{useEffect as vw,useState as $t}from"react";import{Box as Ze,Text as Mo,useInput as Nw}from"ink";import{jsx as Me,jsxs as Jo}from"react/jsx-runtime";function wd({onDismiss:e}){let{height:t,width:n}=ft(),[r,o]=$t(0),[i,a]=$t(!1),[s,l]=$t(!1),[c,d]=$t(!1),[u,p]=$t(!1);Nw(()=>{u&&e()}),vw(()=>{let S=80+$n.length*70+80,w=[...$n.map((k,b)=>setTimeout(()=>{o(b+1)},80+b*70)),setTimeout(()=>{a(!0)},S),setTimeout(()=>{l(!0)},S+200),setTimeout(()=>{d(!0)},S+400),setTimeout(()=>{d(!1),p(!0)},S+2e3),setTimeout(()=>{e()},S+2800)];return()=>{w.forEach(k=>{clearTimeout(k)})}},[e]);let m=$n.length+5,h=Math.max(0,Math.floor((t-m)/2));return Jo(Ze,{flexDirection:"column",height:t,width:n,children:[Me(Ze,{height:h}),Jo(Ze,{alignItems:"flex-start",flexDirection:"row",justifyContent:"center",children:[Me(Ze,{flexDirection:"column",children:$n.map((S,w)=>Me(Mo,{color:Sd,children:w<r?S:""},S))}),Jo(Ze,{flexDirection:"column",paddingLeft:4,paddingTop:5,children:[Me(Mo,{bold:!0,color:Sd,children:i?Cw:""}),Me(Ze,{marginTop:1,children:Me(Mo,{color:"gray",dimColor:!0,children:s?"developer CLI":""})}),Me(Ze,{marginTop:2,children:Me(hd,{loading:c})})]})]})]})}var $n,Sd,Cw,bd=f(()=>{"use strict";En();kd();$n=[" XXXX XXXXXXX "," XX XX X X "," XXX XX XX X X ","XXXXXX XX XX XXXXXXX ","XX XXX XX XX ","XX XXX XX XXXXXXXX "," XX XX XX XX "," XX XX XX XX "," XX XXXXX XX"," XX XX XX XX"," XX XX XXXX "," XXX XX "," XXXXXXXXX XX "," XXX XX "," XXXXXXX "],Sd="#24CFFF",Cw="ripplo"});import{createAuthClient as Lw}from"better-auth/client";import{deviceAuthorizationClient as xw}from"better-auth/client/plugins";function Dn({baseURL:e}){return Lw({baseURL:e,fetchOptions:{headers:{"User-Agent":"Ripplo CLI"}},plugins:[xw()]})}var zo=f(()=>{"use strict"});import{exec as Pw}from"child_process";async function Rd({cwd:e,onDeviceCode:t,url:n}){let r=n??Ot().RIPPLO_SERVER_URL,o=Dn({baseURL:r}),i=await o.device.code({client_id:Ad});if(i.error!=null)throw new Error(`Failed to request device code: ${i.error.error_description}`);let{device_code:a,user_code:s,verification_uri_complete:l}=i.data;t({userCode:s,verificationUrl:l}),$w(l);let c=await Ow({authClient:o,deviceCode:a});return Br(e,c),c}async function Ow({authClient:e,deviceCode:t}){for(;;){await Uw(Ew);let n=await e.device.token({client_id:Ad,device_code:t,grant_type:"urn:ietf:params:oauth:grant-type:device_code"});if(n.data?.access_token!=null)return n.data.access_token;if(n.error==null)continue;if(!_w(n.error.error))throw new Error(`Authorization failed: ${n.error.error_description}`)}}function _w(e){return Iw.has(e)}function Uw(e){return new Promise(t=>{setTimeout(t,e)})}function jw(){return process.platform==="darwin"?"open":process.platform==="win32"?"start":"xdg-open"}function $w(e){let t=jw();Pw(`${t} "${e}"`,()=>{})}var Ew,Ad,Iw,Td=f(()=>{"use strict";G();zo();dt();Ew=5e3,Ad="ripplo-cli";Iw=new Set(["authorization_pending","slow_down"])});import{useCallback as Bn,useEffect as Dw,useState as Je}from"react";import{exec as Bw}from"child_process";import{promisify as Vw}from"util";import J from"fs";import M from"path";function Nd({cwd:e,initialToken:t,serverUrl:n}){let[r,o]=Je(t==null?"login":"validating"),[i,a]=Je(),[s,l]=Je(),[c,d]=Je(t),[u,p]=Je(!1),[m,h]=Je(),[S,w]=Je(),[k,b]=Je([]);Dw(()=>{if(t==null)return;Dn({baseURL:n}).getSession({fetchOptions:{headers:{Authorization:`Bearer ${t}`}}}).then(C=>{if(C.data==null){o("login");return}return Xo({cwd:e,serverUrl:n,token:t})}).then(C=>{if(C==null){o("select-project");return}a(C),o("complete")}).catch(C=>{l(C instanceof Error?C.message:String(C)),o("login")})},[e,t,n]);let v=Bn(()=>{u||(p(!0),l(void 0),Rd({cwd:e,onDeviceCode:h,url:n}).then(O=>(d(O),Xo({cwd:e,serverUrl:n,token:O}))).then(O=>{O==null?o("select-project"):(a(O),o("complete"))}).catch(O=>{p(!1),h(void 0),l(O instanceof Error?O.message:String(O))}))},[e,u,n]),L=Bn(O=>{let C=i?.token??c??t;if(C==null){l("No authentication token available");return}o("scaffolding"),l(void 0),Hw({cwd:e,onStep:w,projectId:O.id}).then(async V=>{b(V);let ze=await Xo({cwd:e,serverUrl:n,token:C});a(ze??Ww({projectId:O.id,serverUrl:n,token:C})),o(V.length>0?"scaffolding-warnings":"complete")}).catch(V=>{l(V instanceof Error?V.message:String(V)),o("select-project")})},[i,e,t,n,c]),T=Bn(()=>{o("complete")},[]),I=Bn(()=>{a(void 0),o("login"),p(!1),h(void 0),l(void 0)},[]);return{config:i,deviceCodeInfo:m,dismissScaffoldWarnings:T,error:s,loginStarted:u,resetToLogin:I,scaffoldingStep:S,scaffoldWarnings:k,selectProject:L,setStage:o,stage:r,startLogin:v,token:c}}function Ww({projectId:e,serverUrl:t,token:n}){return{appUrl:"",engineUrl:"",projectId:e,ripploServerUrl:t,token:n,webhookSecret:""}}async function Xo({cwd:e,serverUrl:t,token:n}){let r=await _(e);if(r.ok)return{...r.result.config,ripploServerUrl:t,token:n}}async function Hw({cwd:e,onStep:t,projectId:n}){t("Scaffolding project files..."),Zw({cwd:e,projectId:n}),t("Updating .gitignore..."),lb(e),t("Marking ripplo.lock as generated..."),Xw(e),t("Installing dependencies...");let r=await Mw(e),o=[];if(r.ok||o.push({manualCommand:r.cmd,message:`Couldn't auto-install dev dependencies (${r.reason}). Run this manually, then re-run \`npx ripplo\`.`}),r.ok){t("Compiling initial lockfile...");let i=await Jw(e);i!=null&&o.push({manualCommand:void 0,message:i})}return t("Setting up browser..."),await br(),o}async function Mw(e){let t=Gw({cwd:e,pm:Yw(e)});A.info("Installing dependencies: %s",t);try{return await Fw(t,{cwd:e}),{ok:!0}}catch(n){let r=n instanceof Error?n.message.split(`
|
|
319
|
-
`)[0]??n.message:String(n);return A.warn("Install failed (%s): %s",t,r),{cmd:t,ok:!1,reason:r}}}async function Jw(e){try{await zw(e);return}catch(t){let n=t instanceof Error?t.message:String(t);return A.warn("Initial lockfile compile failed: %s",n),`Couldn't compile initial lockfile: ${n}. You can run \`npx ripplo\` again after fixing the DSL.`}}async function zw(e){let t=await _(e);if(!t.ok){A.warn("Initial compile failed, skipping lockfile write: %s",t.error);return}await me({cwd:e,result:t.result})}function Xw(e){let t=M.join(e,".gitattributes"),n=J.existsSync(t)?J.readFileSync(t,"utf8"):"";if(n.includes(
|
|
318
|
+
`)});import{Box as ew,Text as Bo}from"ink";import{jsx as Fc,jsxs as Hc}from"react/jsx-runtime";function Mc({activeRunCount:e,browsersReady:t,maxConcurrency:n}){return Hc(ew,{paddingX:1,children:[Fc(Bo,{dimColor:!0,children:"Activity "}),Hc(Bo,{children:[String(e),"/",String(n)," running \xB7 browsers"," "]}),Fc(Bo,{color:t?"green":"yellow",children:t?"ready":"warming"})]})}var Jc=f(()=>{"use strict"});import{Box as tw,Text as In}from"ink";import{jsx as _n,jsxs as rw}from"react/jsx-runtime";function zc({check:e}){let{detail:t,label:n,tone:r}=On(e),o=nw[r];return rw(tw,{children:[_n(In,{color:o,children:r==="info"?"\u25CB":"\u25CF"}),_n(In,{children:" "}),_n(In,{children:n.padEnd(18," ")}),_n(In,{color:o,children:t})]})}var nw,Xc=f(()=>{"use strict";jo();nw={error:"red",info:"gray",ok:"green",warn:"yellow"}});import{Box as ow,Text as Gc}from"ink";import{jsx as Vo,jsxs as iw}from"react/jsx-runtime";function Kc({checks:e}){return iw(ow,{borderColor:"gray",borderStyle:"round",flexDirection:"column",marginTop:1,paddingX:1,children:[Vo(Gc,{bold:!0,children:"Health"}),e.length===0?Vo(Gc,{dimColor:!0,children:"Running first pass..."}):e.map(t=>Vo(zc,{check:t},t.type))]})}var Qc=f(()=>{"use strict";Xc()});import{Box as Un,Text as yt}from"ink";import{jsx as gt,jsxs as jn}from"react/jsx-runtime";function Yc({appUrl:e,developerUrl:t,projectName:n}){return jn(Un,{borderColor:"gray",borderStyle:"round",flexDirection:"column",paddingX:1,children:[jn(Un,{children:[gt(yt,{dimColor:!0,children:"Project "}),gt(yt,{bold:!0,children:n})]}),jn(Un,{children:[gt(yt,{dimColor:!0,children:"App "}),gt(yt,{color:"cyan",children:e})]}),jn(Un,{children:[gt(yt,{dimColor:!0,children:"Dashboard "}),gt(yt,{color:"cyan",children:t})]})]})}var Zc=f(()=>{"use strict"});import{Box as Wo,Text as qe}from"ink";import{jsx as Fe,jsxs as qo}from"react/jsx-runtime";function ed({paused:e,scope:t}){return qo(Wo,{borderColor:"gray",borderStyle:"round",flexDirection:"column",marginTop:1,paddingX:1,children:[qo(Wo,{children:[Fe(qe,{bold:!0,children:"Scope"}),Fe(qe,{dimColor:!0,children:` (${String(t.length)})`}),Fe(qe,{children:" "}),Fe(qe,{dimColor:!0,children:"Hooks "}),Fe(qe,{color:e?"yellow":"green",children:e?"paused":"active"})]}),t.length===0?Fe(qe,{dimColor:!0,children:"no scope items \u2014 add from the dashboard or `ripplo scope add`"}):t.map(n=>qo(Wo,{children:[Fe(qe,{color:"cyan",children:"\u2022 "}),Fe(qe,{children:n.label})]},n.id))]})}var td=f(()=>{"use strict"});import{Box as aw,Text as nd}from"ink";import{jsx as sw,jsxs as rd}from"react/jsx-runtime";function od({preconditions:e,workflows:t}){let n=t?.type==="workflows"?t.total:0,r=t?.type==="workflows"?t.invalidNames.length:0,o=e?.type==="preconditions"?e.count:0;return rd(aw,{marginTop:1,paddingX:1,children:[sw(nd,{dimColor:!0,children:"Workflows "}),rd(nd,{children:[String(n)," tests \xB7 ",String(o)," preconditions",r>0?` \xB7 ${String(r)} invalid`:""]})]})}var id=f(()=>{"use strict"});import tI from"chalk";import{z as ad}from"zod";async function sd(){let e=new AbortController,t=setTimeout(()=>{e.abort()},3e3);try{let n=await fetch(`https://registry.npmjs.org/${lw}/latest`,{headers:{accept:"application/json"},signal:e.signal});if(!n.ok)return;let r=await n.json();return cw.parse(r).version}catch{return}finally{clearTimeout(t)}}var Fo,lw,cw,ld=f(()=>{"use strict";G();Fo="0.3.5",lw="ripplo",cw=ad.object({version:ad.string()})});import{useEffect as dw,useState as pw}from"react";import{Text as Ye}from"ink";import{jsx as ht,jsxs as yw}from"react/jsx-runtime";function cd({activeRunCount:e,browsersReady:t,connected:n,projectId:r,ripploServerUrl:o,syncError:i,width:a}){let s=fw(),l=s!=null&&s!==Fo,c=uw({connected:n,syncError:i}),d=t?"":" warming up browsers...",u=e>0?` ${String(e)} running`:"",p=`v${Fo}`,m=l?` \u2192 v${s}`:"",h=`project ${r} \xB7 q to quit`,S=` ripplo ${p}${m} | ${o} ${c}${d}${u}`,w=Math.max(0,a-S.length-h.length-1);return yw(Ye,{inverse:!0,children:[ht(Ye,{bold:!0,children:" ripplo "}),ht(Ye,{dimColor:!0,children:p}),l?ht(Ye,{color:"yellow",children:` \u2192 v${s}`}):null,` | ${o} `,ht(Ye,{color:mw({connected:n,syncError:i}),children:c}),t?null:ht(Ye,{color:"yellow",children:d}),u," ".repeat(w),ht(Ye,{dimColor:!0,children:h})," "]})}function uw({connected:e,syncError:t}){return t!=null?"sync failed":e?"connected":"connecting..."}function mw({connected:e,syncError:t}){return t!=null?"red":e?"green":"yellow"}function fw(){let[e,t]=pw();return dw(()=>{sd().then(n=>{n!=null&&t(n)})},[]),e}var dd=f(()=>{"use strict";ld()});import{useEffect as gw}from"react";import{availableParallelism as hw}from"os";import{Box as Ho,Text as kw,useApp as Sw,useInput as ww}from"ink";import{jsx as He,jsxs as pd}from"react/jsx-runtime";function ud({config:e,cwd:t}){let n=Sw(),{height:r,width:o}=ft(),{config:i,devSessionId:a,syncError:s}=Lc({config:e,cwd:t}),{activeRunCount:l,browsersReady:c,connected:d}=ac({config:i,cwd:t,devSessionId:a}),{checks:u}=Oc({config:i,cwd:t}),{paused:p,projectName:m,scope:h}=Wc({projectId:e.projectId});jc({cwd:t,projectId:e.projectId}),gw(()=>Il(t),[t]),ww(T=>{T==="q"&&n.exit()});let S=`${i.ripploServerUrl}/projects/${i.projectId}/developer`,w=u.filter(T=>bw.has(T.type)),k=u.find(T=>T.type==="workflows"),b=u.find(T=>T.type==="preconditions"),v=hw(),L=m??"\u2026";return pd(Ho,{flexDirection:"column",height:r,width:o,children:[He(cd,{activeRunCount:l,browsersReady:c,connected:d,projectId:i.projectId,ripploServerUrl:i.ripploServerUrl,syncError:s,width:o}),pd(Ho,{flexDirection:"column",flexGrow:1,paddingX:1,paddingY:1,children:[He(Yc,{appUrl:i.appUrl,developerUrl:S,projectName:L}),He(ed,{paused:p,scope:h}),He(Kc,{checks:w}),He(od,{preconditions:b,workflows:k}),He(Mc,{activeRunCount:l,browsersReady:c,maxConcurrency:v}),He(Ho,{marginTop:1,paddingX:1,children:He(kw,{dimColor:!0,children:"q quit"})})]})]})}var bw,md=f(()=>{"use strict";bo();En();xc();Ic();$c();qc();Lo();Jc();Qc();Zc();td();id();dd();bw=new Set(["dev-server","preconditions","adapter-enabled","webhook-verification","lockfile","pre-commit-hook","browser"])});import{Text as fd}from"ink";import Aw from"ink-spinner";import{jsx as yd,jsxs as Tw}from"react/jsx-runtime";function gd({loading:e}){return e?Tw(fd,{color:Rw,children:[yd(Aw,{type:"dots"})," Starting..."]}):yd(fd,{children:""})}var Rw,hd=f(()=>{"use strict";Rw="#24CFFF"});import{useEffect as vw,useState as $t}from"react";import{Box as Ze,Text as Mo,useInput as Nw}from"ink";import{jsx as Me,jsxs as Jo}from"react/jsx-runtime";function Sd({onDismiss:e}){let{height:t,width:n}=ft(),[r,o]=$t(0),[i,a]=$t(!1),[s,l]=$t(!1),[c,d]=$t(!1),[u,p]=$t(!1);Nw(()=>{u&&e()}),vw(()=>{let S=80+$n.length*70+80,w=[...$n.map((k,b)=>setTimeout(()=>{o(b+1)},80+b*70)),setTimeout(()=>{a(!0)},S),setTimeout(()=>{l(!0)},S+200),setTimeout(()=>{d(!0)},S+400),setTimeout(()=>{d(!1),p(!0)},S+2e3),setTimeout(()=>{e()},S+2800)];return()=>{w.forEach(k=>{clearTimeout(k)})}},[e]);let m=$n.length+5,h=Math.max(0,Math.floor((t-m)/2));return Jo(Ze,{flexDirection:"column",height:t,width:n,children:[Me(Ze,{height:h}),Jo(Ze,{alignItems:"flex-start",flexDirection:"row",justifyContent:"center",children:[Me(Ze,{flexDirection:"column",children:$n.map((S,w)=>Me(Mo,{color:kd,children:w<r?S:""},S))}),Jo(Ze,{flexDirection:"column",paddingLeft:4,paddingTop:5,children:[Me(Mo,{bold:!0,color:kd,children:i?Cw:""}),Me(Ze,{marginTop:1,children:Me(Mo,{color:"gray",dimColor:!0,children:s?"developer CLI":""})}),Me(Ze,{marginTop:2,children:Me(gd,{loading:c})})]})]})]})}var $n,kd,Cw,wd=f(()=>{"use strict";En();hd();$n=[" XXXX XXXXXXX "," XX XX X X "," XXX XX XX X X ","XXXXXX XX XX XXXXXXX ","XX XXX XX XX ","XX XXX XX XXXXXXXX "," XX XX XX XX "," XX XX XX XX "," XX XXXXX XX"," XX XX XX XX"," XX XX XXXX "," XXX XX "," XXXXXXXXX XX "," XXX XX "," XXXXXXX "],kd="#24CFFF",Cw="ripplo"});import{createAuthClient as Lw}from"better-auth/client";import{deviceAuthorizationClient as xw}from"better-auth/client/plugins";function Dn({baseURL:e}){return Lw({baseURL:e,fetchOptions:{headers:{"User-Agent":"Ripplo CLI"}},plugins:[xw()]})}var zo=f(()=>{"use strict"});import{exec as Pw}from"child_process";async function Ad({cwd:e,onDeviceCode:t,url:n}){let r=n??Ot().RIPPLO_SERVER_URL,o=Dn({baseURL:r}),i=await o.device.code({client_id:bd});if(i.error!=null)throw new Error(`Failed to request device code: ${i.error.error_description}`);let{device_code:a,user_code:s,verification_uri_complete:l}=i.data;t({userCode:s,verificationUrl:l}),$w(l);let c=await Ow({authClient:o,deviceCode:a});return Br(e,c),c}async function Ow({authClient:e,deviceCode:t}){for(;;){await Uw(Ew);let n=await e.device.token({client_id:bd,device_code:t,grant_type:"urn:ietf:params:oauth:grant-type:device_code"});if(n.data?.access_token!=null)return n.data.access_token;if(n.error==null)continue;if(!_w(n.error.error))throw new Error(`Authorization failed: ${n.error.error_description}`)}}function _w(e){return Iw.has(e)}function Uw(e){return new Promise(t=>{setTimeout(t,e)})}function jw(){return process.platform==="darwin"?"open":process.platform==="win32"?"start":"xdg-open"}function $w(e){let t=jw();Pw(`${t} "${e}"`,()=>{})}var Ew,bd,Iw,Rd=f(()=>{"use strict";G();zo();dt();Ew=5e3,bd="ripplo-cli";Iw=new Set(["authorization_pending","slow_down"])});import{useCallback as Bn,useEffect as Dw,useState as Je}from"react";import{exec as Bw}from"child_process";import{promisify as Vw}from"util";import J from"fs";import M from"path";function vd({cwd:e,initialToken:t,serverUrl:n}){let[r,o]=Je(t==null?"login":"validating"),[i,a]=Je(),[s,l]=Je(),[c,d]=Je(t),[u,p]=Je(!1),[m,h]=Je(),[S,w]=Je(),[k,b]=Je([]);Dw(()=>{if(t==null)return;Dn({baseURL:n}).getSession({fetchOptions:{headers:{Authorization:`Bearer ${t}`}}}).then(C=>{if(C.data==null){o("login");return}return Xo({cwd:e,serverUrl:n,token:t})}).then(C=>{if(C==null){o("select-project");return}a(C),o("complete")}).catch(C=>{l(C instanceof Error?C.message:String(C)),o("login")})},[e,t,n]);let v=Bn(()=>{u||(p(!0),l(void 0),Ad({cwd:e,onDeviceCode:h,url:n}).then(O=>(d(O),Xo({cwd:e,serverUrl:n,token:O}))).then(O=>{O==null?o("select-project"):(a(O),o("complete"))}).catch(O=>{p(!1),h(void 0),l(O instanceof Error?O.message:String(O))}))},[e,u,n]),L=Bn(O=>{let C=i?.token??c??t;if(C==null){l("No authentication token available");return}o("scaffolding"),l(void 0),Hw({cwd:e,onStep:w,projectId:O.id}).then(async V=>{b(V);let ze=await Xo({cwd:e,serverUrl:n,token:C});a(ze??Ww({projectId:O.id,serverUrl:n,token:C})),o(V.length>0?"scaffolding-warnings":"complete")}).catch(V=>{l(V instanceof Error?V.message:String(V)),o("select-project")})},[i,e,t,n,c]),T=Bn(()=>{o("complete")},[]),I=Bn(()=>{a(void 0),o("login"),p(!1),h(void 0),l(void 0)},[]);return{config:i,deviceCodeInfo:m,dismissScaffoldWarnings:T,error:s,loginStarted:u,resetToLogin:I,scaffoldingStep:S,scaffoldWarnings:k,selectProject:L,setStage:o,stage:r,startLogin:v,token:c}}function Ww({projectId:e,serverUrl:t,token:n}){return{appUrl:"",engineUrl:"",projectId:e,ripploServerUrl:t,token:n,webhookSecret:""}}async function Xo({cwd:e,serverUrl:t,token:n}){let r=await _(e);if(r.ok)return{...r.result.config,ripploServerUrl:t,token:n}}async function Hw({cwd:e,onStep:t,projectId:n}){t("Scaffolding project files..."),Zw({cwd:e,projectId:n}),t("Updating .gitignore..."),lb(e),t("Marking ripplo.lock as generated..."),Xw(e),t("Installing dependencies...");let r=await Mw(e),o=[];if(r.ok||o.push({manualCommand:r.cmd,message:`Couldn't auto-install dev dependencies (${r.reason}). Run this manually, then re-run \`npx ripplo\`.`}),r.ok){t("Compiling initial lockfile...");let i=await Jw(e);i!=null&&o.push({manualCommand:void 0,message:i})}return t("Setting up browser..."),await br(),o}async function Mw(e){let t=Gw({cwd:e,pm:Yw(e)});A.info("Installing dependencies: %s",t);try{return await Fw(t,{cwd:e}),{ok:!0}}catch(n){let r=n instanceof Error?n.message.split(`
|
|
319
|
+
`)[0]??n.message:String(n);return A.warn("Install failed (%s): %s",t,r),{cmd:t,ok:!1,reason:r}}}async function Jw(e){try{await zw(e);return}catch(t){let n=t instanceof Error?t.message:String(t);return A.warn("Initial lockfile compile failed: %s",n),`Couldn't compile initial lockfile: ${n}. You can run \`npx ripplo\` again after fixing the DSL.`}}async function zw(e){let t=await _(e);if(!t.ok){A.warn("Initial compile failed, skipping lockfile write: %s",t.error);return}await me({cwd:e,result:t.result})}function Xw(e){let t=M.join(e,".gitattributes"),n=J.existsSync(t)?J.readFileSync(t,"utf8"):"";if(n.includes(Td))return;let r=n.length===0||n.endsWith(`
|
|
320
320
|
`)?"":`
|
|
321
|
-
`;J.writeFileSync(t,`${n}${r}${
|
|
321
|
+
`;J.writeFileSync(t,`${n}${r}${Td}
|
|
322
322
|
`)}function Gw({cwd:e,pm:t}){let n=qw.join(" ");return t==="pnpm"?Kw(e)?`pnpm add -wD ${n}`:`pnpm add -D ${n}`:t==="yarn"?Qw(e)?`yarn add -WD ${n}`:`yarn add -D ${n}`:t==="bun"?`bun add -d ${n}`:`npm install -D ${n}`}function Kw(e){return J.existsSync(M.join(e,"pnpm-workspace.yaml"))||J.existsSync(M.join(e,"pnpm-workspace.yml"))}function Qw(e){let t=M.join(e,"package.json");if(!J.existsSync(t))return!1;try{let n=JSON.parse(J.readFileSync(t,"utf8"));if(n==null||typeof n!="object"||!("workspaces"in n))return!1;let r=n.workspaces;return Array.isArray(r)||r!=null&&typeof r=="object"}catch{return!1}}function Yw(e){return J.existsSync(M.join(e,"pnpm-lock.yaml"))?"pnpm":J.existsSync(M.join(e,"yarn.lock"))?"yarn":J.existsSync(M.join(e,"bun.lockb"))||J.existsSync(M.join(e,"bun.lock"))?"bun":"npm"}function Zw({cwd:e,projectId:t}){let n=M.join(e,".ripplo"),r=M.join(n,"tests"),o=M.join(n,"preconditions"),i=M.join(n,"observers");J.mkdirSync(r,{recursive:!0}),J.mkdirSync(o,{recursive:!0}),J.mkdirSync(i,{recursive:!0}),et(M.join(n,"ripplo.ts"),eb(t)),et(M.join(n,"index.ts"),nb),et(M.join(o,"index.ts"),rb),et(M.join(i,"index.ts"),ob),et(M.join(r,"index.ts"),ib),et(M.join(n,".env"),tb()),et(M.join(n,"tsconfig.json"),ab)}function et(e,t){J.existsSync(e)||J.writeFileSync(e,t)}function eb(e){return`import { createRipplo } from "@ripplo/testing";
|
|
323
323
|
import { preconditions } from "./preconditions/index.js";
|
|
324
324
|
import { observers } from "./observers/index.js";
|
|
@@ -339,7 +339,7 @@ export default ripplo;
|
|
|
339
339
|
`)?"":`
|
|
340
340
|
`;J.writeFileSync(t,n+o+r.join(`
|
|
341
341
|
`)+`
|
|
342
|
-
`)}var qw,Fw,
|
|
342
|
+
`)}var qw,Fw,Td,nb,rb,ob,ib,ab,sb,Nd=f(()=>{"use strict";G();Oe();Rd();zo();Q();qw=["@ripplo/testing"],Fw=Vw(Bw);Td=".ripplo/ripplo.lock linguist-generated=true";nb=`// Re-exports for CLI / adapter / server imports.
|
|
343
343
|
export { default } from "./ripplo.js";
|
|
344
344
|
export { preconditions } from "./preconditions/index.js";
|
|
345
345
|
export { observers } from "./observers/index.js";
|
|
@@ -395,7 +395,7 @@ export const tests = [] as const;
|
|
|
395
395
|
"include": ["*.ts", "observers/**/*.ts", "preconditions/**/*.ts", "tests/**/*.ts"],
|
|
396
396
|
"exclude": ["node_modules"]
|
|
397
397
|
}
|
|
398
|
-
`,sb=[".ripplo/debug/",".ripplo/.local/",".ripplo/.env"]});import{useCallback as cb,useEffect as db,useMemo as
|
|
398
|
+
`,sb=[".ripplo/debug/",".ripplo/.local/",".ripplo/.env"]});import{useCallback as cb,useEffect as db,useMemo as Cd,useState as pb}from"react";import{Box as Ld,Text as Go}from"ink";import{Provider as ub}from"urql";import{graphql as mb}from"gql.tada";import{jsx as Pe,jsxs as hb}from"react/jsx-runtime";function xd({cwd:e,initialToken:t,serverUrl:n}){let[r,o]=pb(!0),i=vd({cwd:e,initialToken:t,serverUrl:n}),{height:a,width:s}=ft(),l=Cd(()=>yb({serverUrl:n,setup:i}),[i,n]),c=Cd(()=>mc({config:l}),[l]);db(()=>{i.config!=null&&(Ko({client:c,projectId:i.config.projectId}),c.query(fb,{projectId:i.config.projectId}).toPromise())},[c,i.config]);let d=cb(()=>{o(!1)},[]);return Pe(ub,{value:c,children:gb({cwd:e,dismissSplash:d,effectiveConfig:l,height:a,setup:i,showSplash:r,width:s})})}function yb({serverUrl:e,setup:t}){return t.config!=null?t.config:{appUrl:"",engineUrl:"",projectId:"",ripploServerUrl:e,token:t.token??"",webhookSecret:""}}function gb({cwd:e,dismissSplash:t,effectiveConfig:n,height:r,setup:o,showSplash:i,width:a}){return i?Pe(Sd,{onDismiss:t}):o.stage==="validating"?Pe(Ld,{alignItems:"center",height:r,justifyContent:"center",width:a,children:hb(Go,{children:[Pe(Go,{color:"yellow",children:"* "}),Pe(Go,{children:"Validating session..."})]})}):o.stage==="complete"&&o.config!=null?Pe(ud,{config:o.config,cwd:e}):o.stage==="login"||o.token==null?Pe(Ld,{alignItems:"center",height:r,justifyContent:"center",width:a,children:Pe(gc,{deviceCodeInfo:o.deviceCodeInfo,error:o.error,loginStarted:o.loginStarted,startLogin:o.startLogin})}):Pe(vc,{config:o.config??n,error:o.error,scaffoldingStep:o.scaffoldingStep,scaffoldWarnings:o.scaffoldWarnings,selectProject:o.selectProject,stage:o.stage,onDismissWarnings:o.dismissScaffoldWarnings})}var fb,Pd=f(()=>{"use strict";Qo();fc();hc();Nc();md();wd();Nd();En();fb=mb(`
|
|
399
399
|
query PrefetchProjectState($projectId: String!) {
|
|
400
400
|
project(id: $projectId) {
|
|
401
401
|
id
|
|
@@ -415,18 +415,18 @@ export const tests = [] as const;
|
|
|
415
415
|
}
|
|
416
416
|
}
|
|
417
417
|
}
|
|
418
|
-
`)});var
|
|
418
|
+
`)});var Ed={};Zo(Ed,{clearActiveSession:()=>Ab,launchDashboard:()=>Tb,setActiveSession:()=>Ko});import Dt from"fs";import Yo from"path";import kb from"react";import{render as Sb}from"ink";import{graphql as wb}from"gql.tada";function Ko({client:e,projectId:t}){Vn=e,Wn=t}function Ab(){Vn=void 0,Wn=void 0}function Rb(){if(Vn==null||Wn==null)return Promise.resolve();let e=Vn.mutation(bb,{projectId:Wn}).toPromise().then(()=>{}).catch(()=>{}),t=new Promise(n=>{setTimeout(n,3e3)});return Promise.race([e,t])}function Tb({restoreStdio:e}){let t=process.cwd(),n=Yo.join(t,".ripplo","debug"),r=Yo.join(n,"debug.log"),o=Yo.join(n,"last-crash.log");Dt.mkdirSync(n,{recursive:!0}),gr({filePath:r});function i(l){e(),Dt.mkdirSync(n,{recursive:!0});let c=l instanceof Error?l.stack??l.message:String(l);Dt.writeFileSync(o,`${new Date().toISOString()}
|
|
419
419
|
${c}
|
|
420
|
-
`),
|
|
420
|
+
`),ic().finally(()=>{process.exit(1)})}let a;try{let l=Re(t),c=Ve();e(),a=Sb(kb.createElement(xd,{cwd:t,initialToken:l??void 0,serverUrl:c}),{alternateScreen:!0}),a.waitUntilExit().then(()=>Rb()).then(()=>{process.exit(0)})}catch(l){i(l)}let s=!1;process.on("SIGINT",()=>{s||(s=!0,a?.unmount())}),process.on("SIGTERM",()=>{s||(s=!0,a?.unmount())}),process.on("uncaughtException",l=>{i(l)}),process.on("unhandledRejection",l=>{try{Dt.mkdirSync(n,{recursive:!0});let c=l instanceof Error?l.stack??l.message:String(l);Dt.appendFileSync(o,`${new Date().toISOString()} [unhandledRejection]
|
|
421
421
|
${c}
|
|
422
422
|
|
|
423
|
-
`)}catch{}})}var bb,Vn,Wn,Qo=f(()=>{"use strict";Lo();G();
|
|
423
|
+
`)}catch{}})}var bb,Vn,Wn,Qo=f(()=>{"use strict";Lo();G();Pd();dt();bb=wb(`
|
|
424
424
|
mutation EndDevSessionExit($projectId: String!) {
|
|
425
425
|
endDevSession(projectId: $projectId) {
|
|
426
426
|
id
|
|
427
427
|
}
|
|
428
428
|
}
|
|
429
|
-
`)});import{config as
|
|
429
|
+
`)});import{config as Od}from"dotenv";import vb from"fs";import tt from"path";import{fileURLToPath as Nb}from"url";import Cb from"yargs";import{hideBin as Lb}from"yargs/helpers";Oe();Q();function P(e,t){return t==null?`\u2192 /ripplo:${e}`:`\u2192 /ripplo:${e} \u2014 ${t}`}async function fi(e){let t=process.cwd(),n=await _(t);if(n.ok||(process.stderr.write(`Compilation failed: ${n.error}
|
|
430
430
|
`),process.stderr.write(`${P("create","DSL authoring + lint rules")}
|
|
431
431
|
`),process.exit(1)),e.check){let r=await qt({cwd:t}),o=Ft({compiled:n.result,existing:r});if(o==="match"){process.stdout.write(`${we} is up to date
|
|
432
432
|
`);return}let i=o==="missing"?"missing":"out of date";process.stderr.write(`${we} is ${i} \u2014 run \`ripplo compile\` and commit the result
|
|
@@ -434,12 +434,12 @@ ${c}
|
|
|
434
434
|
`),process.exit(1)}await me({cwd:t,result:n.result}),process.stdout.write(`wrote ${we}
|
|
435
435
|
`)}yo();async function dl(){let e=process.cwd(),t=await kn(e),n=t.map(o=>cl(o));process.stdout.write(n.join(`
|
|
436
436
|
`)+`
|
|
437
|
-
`);let r=t.some(o=>sl(o));process.exit(r?1:0)}G();import{graphql as Sn,readFragment as
|
|
437
|
+
`);let r=t.some(o=>sl(o));process.exit(r?1:0)}G();import{graphql as Sn,readFragment as Wg}from"gql.tada";import pl from"figures";var Et={cross:pl.cross,tick:pl.tick};var ml=Sn(`
|
|
438
438
|
fragment WorkflowIdMCP on Workflow {
|
|
439
439
|
id
|
|
440
440
|
slug
|
|
441
441
|
}
|
|
442
|
-
`),
|
|
442
|
+
`),qg=Sn(`
|
|
443
443
|
query ProjectWorkflowIdsMCP($projectId: String!) {
|
|
444
444
|
project(id: $projectId) {
|
|
445
445
|
id
|
|
@@ -451,14 +451,14 @@ ${c}
|
|
|
451
451
|
}
|
|
452
452
|
}
|
|
453
453
|
}
|
|
454
|
-
`,[ml]),
|
|
454
|
+
`,[ml]),Fg=Sn(`
|
|
455
455
|
mutation CreateRunMCP($workflowId: String!, $platforms: [String!]!, $concurrency: Int!) {
|
|
456
456
|
createRun(workflowId: $workflowId, platforms: $platforms, concurrency: $concurrency) {
|
|
457
457
|
id
|
|
458
458
|
status
|
|
459
459
|
}
|
|
460
460
|
}
|
|
461
|
-
`),
|
|
461
|
+
`),Hg=Sn(`
|
|
462
462
|
query RunStatusMCP($id: String!) {
|
|
463
463
|
run(id: $id) {
|
|
464
464
|
id
|
|
@@ -485,8 +485,8 @@ ${c}
|
|
|
485
485
|
}
|
|
486
486
|
}
|
|
487
487
|
}
|
|
488
|
-
`);async function wn({config:e,ids:t}){let n=await
|
|
489
|
-
${P("setup","check auth + config")}`};let{entry:s,runId:l}=a;try{let c=await
|
|
488
|
+
`);async function wn({config:e,ids:t}){let n=await Mg({config:e,ids:t}),r=await Promise.all(n.map(async a=>{try{let s=await zg({config:e,workflowId:a.workflowId});return{entry:a,ok:!0,runId:s}}catch(s){let l=s instanceof Error?s.message:String(s);return{entry:a,message:l,ok:!1}}})),o=await Promise.all(r.map(async a=>{if(!a.ok)return{id:a.entry.id,runId:"",summary:`ERROR creating run: ${a.message}
|
|
489
|
+
${P("setup","check auth + config")}`};let{entry:s,runId:l}=a;try{let c=await Gg({config:e,runId:l}),d=Jg({config:e,id:s.id,runId:l}),u=`.ripplo/debug/${l}/`;return{id:s.id,runId:l,summary:`View run: ${d}
|
|
490
490
|
Debug artifacts: ${u}
|
|
491
491
|
${P("debug","read summary.txt, accessibility-tree, network.jsonl before guessing")}
|
|
492
492
|
|
|
@@ -496,8 +496,8 @@ ${a.summary}`).join(`
|
|
|
496
496
|
|
|
497
497
|
---
|
|
498
498
|
|
|
499
|
-
`);return{results:o,summary:i}}async function
|
|
500
|
-
`)}function
|
|
499
|
+
`);return{results:o,summary:i}}async function Mg({config:e,ids:t}){let n=await $({config:e,document:qg,variables:{projectId:e.projectId}});if(n.project==null)throw new Error("Project not found");if(n.project.devSession==null)throw new Error("No active dev session. Start one by running `ripplo` (or `npx ripplo`) in your terminal, then try again.");let r=(n.project.workflows??[]).map(o=>Wg(ml,o));return t.length===0?r.map(o=>({id:o.slug,workflowId:o.id})):t.map(o=>{let i=r.find(a=>a.slug===o);if(i==null)throw new Error(`Test "${o}" not found on server. Is the dev session running? (It watches .ripplo/ files and syncs them automatically.)`);return{id:o,workflowId:i.id}})}function Jg({config:e,id:t,runId:n}){let r=e.ripploServerUrl.replace(/:3000\b/,":3001"),o=new URL(r.endsWith("/")?r:`${r}/`);return new URL(`projects/${e.projectId}/workflows/${t}/runs/${n}`,o).toString()}async function zg({config:e,workflowId:t}){let n=await $({config:e,document:Fg,variables:{concurrency:1,platforms:["chromium"],workflowId:t}});if(n.createRun==null)throw new Error("Failed to create run");return n.createRun.id}var Xg=2e3,ul=150;async function Gg({config:e,runId:t}){let n=0;for(;n<ul;){await Qg(Xg),n+=1;let o=(await $({config:e,document:Hg,variables:{id:t}})).run;if(o==null)throw new Error(`Run ${t} not found`);if(!(o.status==="pending"||o.status==="running"))return Kg({results:o.results??[],runId:t,status:o.status})}return`Run ${t} timed out after polling ${String(ul)} times.`}function Kg({results:e,runId:t,status:n}){let r=[`Run ${t}: ${n.toUpperCase()}`];return e.forEach(o=>{r.push(` ${o.status}: ${String(o.passCount)} passed, ${String(o.failCount)} failed (${String(o.duration??0)}ms)`),o.summary!=null&&r.push(` Summary: ${o.summary}`),o.traceEntries.forEach(i=>{let a=i.status==="passed"?Et.tick:Et.cross,s=i.detail==null?"":` \u2014 ${i.detail}`;r.push(` ${a} ${i.title} (${String(i.duration)}ms)${s}`),i.assertions.forEach(l=>{let c=l.status==="passed"?Et.tick:Et.cross,d=l.detail==null?"":` \u2014 ${l.detail}`;r.push(` ${c} ${l.description}${d}`)})})}),r.join(`
|
|
500
|
+
`)}function Qg(e){return new Promise(t=>{setTimeout(t,e)})}G();Q();dt();import{graphql as rh}from"gql.tada";var oh=rh(`
|
|
501
501
|
query DevSessionCheckPreflight($projectId: String!) {
|
|
502
502
|
project(id: $projectId) {
|
|
503
503
|
id
|
|
@@ -509,7 +509,7 @@ ${a.summary}`).join(`
|
|
|
509
509
|
`);async function ve(){let e=process.cwd(),t=Re(e);t==null&&(process.stderr.write("Not authenticated. Run `ripplo` to set up your config first.\n"),process.stderr.write(`${P("setup")}
|
|
510
510
|
`),process.exit(1));let n=await _(e);return n.ok||(process.stderr.write(`Failed to compile DSL config: ${n.error}
|
|
511
511
|
`),process.stderr.write(`${P("setup")}
|
|
512
|
-
`),process.exit(1)),{...n.result.config,ripploServerUrl:Ve(),token:t}}async function Ne(e){(await $({config:e,document:
|
|
512
|
+
`),process.exit(1)),{...n.result.config,ripploServerUrl:Ve(),token:t}}async function Ne(e){(await $({config:e,document:oh,variables:{projectId:e.projectId}})).project?.devSession==null&&(process.stderr.write("No active dev session. Start one by running `ripplo` (or `npx ripplo`) in a terminal first.\n"),process.stderr.write(`${P("setup")}
|
|
513
513
|
`),process.exit(1))}async function gl({id:e,runs:t}){let n=await ve();await Ne(n),process.stdout.write(`Running "${e}" ${String(t)} times in parallel...
|
|
514
514
|
`);let r=await Promise.allSettled(Array.from({length:t},()=>wn({config:n,ids:[e]}))),o=0,i=0,a=new Map;r.forEach(l=>{if(l.status==="rejected"){i++;let d=l.reason instanceof Error?l.reason.message:"unknown error";a.set(d,(a.get(d)??0)+1);return}let c=l.value.results[0];if(c==null){i++;return}if(c.summary.includes("FAILED")||c.summary.includes("ERROR")){i++;let d=c.summary.split(`
|
|
515
515
|
`).find(u=>u.includes("FAILED")||u.includes("ERROR"))??"unknown failure";a.set(d,(a.get(d)??0)+1)}else o++});let s=t>0?i/t*100:0;process.stdout.write(`
|
|
@@ -519,7 +519,7 @@ Results: ${String(o)} passed, ${String(i)} failed out of ${String(t)} runs
|
|
|
519
519
|
Failure patterns:
|
|
520
520
|
`),a.forEach((l,c)=>{process.stdout.write(` ${String(l)}x: ${c}
|
|
521
521
|
`)})),i>0&&process.stderr.write(`${P("flake-detect","parallel safety + race conditions")}
|
|
522
|
-
`),process.exit(i>0?1:0)}import wo from"fs";import bl from"path";import*as Al from"remeda";import{z as Ae}from"zod";var go=["src/**","app/**","apps/**","pages/**","routes/**","components/**"],ho=["**/*.gen.*","**/generated/**","**/*.d.ts","**/*.test.*","**/*.spec.*","**/node_modules/**","**/dist/**","**/build/**",".ripplo/**","**/*.md"],
|
|
522
|
+
`),process.exit(i>0?1:0)}import wo from"fs";import bl from"path";import*as Al from"remeda";import{z as Ae}from"zod";var go=["src/**","app/**","apps/**","pages/**","routes/**","components/**"],ho=["**/*.gen.*","**/generated/**","**/*.d.ts","**/*.test.*","**/*.spec.*","**/node_modules/**","**/dist/**","**/build/**",".ripplo/**","**/*.md"],ih=Ae.object({appUrl:Ae.string(),engineUrl:Ae.string(),ignorePaths:Ae.array(Ae.string()).optional(),projectId:Ae.string(),watchPaths:Ae.array(Ae.string()).optional(),webhookSecret:Ae.string()}),ah=ih.extend({webhookSecret:Ae.string().optional()});Kn();Ht();var hl=ei(Zr(),1);import{z as B}from"zod";var VL=B.object({preconditions:B.array(B.string().min(1))}),WL=B.object({data:B.record(B.string(),B.record(B.string(),B.string())),preconditions:B.array(B.string().min(1))}),qL=B.object({observer:B.string().min(1).max(200),params:B.record(B.string().max(200),B.string())}),sh=B.discriminatedUnion("kind",[B.object({kind:B.literal("pass")}),B.object({kind:B.literal("retry"),reason:B.string()}),B.object({kind:B.literal("fail"),reason:B.string()})]),FL=B.object({error:B.string().optional(),outcome:sh.optional(),success:B.boolean()});function pt(e){let t=[];return e.tests.forEach(n=>{let r=lh(n),o=i=>{t.push({...i,test:n.slug})};xh.forEach(i=>{i(r,n,o)})}),{diagnostics:t}}function lh(e){let t=[],n=e.spec.entryNode,r=new Set;for(;n!=null&&!r.has(n);){r.add(n);let o=e.spec.nodes[n];if(o==null)break;t.push(o),n=o.next}return t}function ch(e,t,n){e.forEach(r=>{r.type==="assertText"&&"operator"in r&&r.operator!=="equals"&&n({message:`${r.type} uses operator "${r.operator}" \u2014 only "equals" is allowed for determinism`,rule:"exact-text-match",step:r.label??r.id})})}function dh(e,t,n){Object.keys(t.spec.variables??{}).length>0&&e.forEach(o=>{if(o.type==="fill"&&Sl(o.value)){let i=o.value.value;!wl(i)&&hh(i)&&n({message:`fill() uses hardcoded value "${i}" \u2014 consider using precondition data via {{namespace.key}}`,rule:"no-hardcoded-data",step:o.label??o.id})}})}function ph(e,t,n){if(Object.keys(t.spec.variables??{}).length===0)return;e.some(i=>JSON.stringify(i).includes("{{"))||n({message:"Test requires preconditions but steps() never references precondition data \u2014 destructure and use it",rule:"prefer-precondition-data",step:void 0})}function uh(e,t,n){e.forEach(r=>{(r.label==null||r.label.length===0)&&n({message:`Step "${r.id}" lacks .as("...") label \u2014 every step must be labeled`,rule:"missing-label",step:r.id})})}function mh(e,t,n){let r=new Map;e.forEach(o=>{if(o.label==null)return;let i=r.get(o.label);i==null?r.set(o.label,o.id):n({message:`Duplicate label "${o.label}" \u2014 also used by ${i}`,rule:"no-duplicate-labels",step:o.label})})}function fh(e,t,n){let r=0;e.forEach(o=>{ut(o)?r=0:(r++,r===3&&n({message:"3+ consecutive actions without an assertion \u2014 add verification between actions",rule:"assert-after-action",step:o.label??o.id}))})}function yh(e,t,n){if(e.length===0)return;let r=e.at(-1);r!=null&&!ut(r)&&n({message:"Last step is an action, not an assertion \u2014 expectedOutcome should be verified by assertions at the end",rule:"assert-matches-outcome",step:r.label??r.id})}function gh(e,t,n){t.implemented&&e.length===0&&n({message:"Test has zero steps",rule:"no-empty-steps",step:void 0})}function Sl(e){return!(typeof e!="object"||e==null||!("type"in e)||e.type!=="static"||!("value"in e)||typeof e.value!="string")}function wl(e){return e.includes("{{")}function hh(e){return e.includes("@")||/\b[a-f0-9]{8,}\b/.test(e)||/^(test|ripplo|example|sample|demo)/i.test(e)}function ut(e){return e.type.startsWith("assert")}var kh=new Set(["assertText","assertValue","assertCount","assertUrl","assertNotVisible","assertChecked","assertNotChecked","assertAttribute","assertDisabled","assertEnabled"]);function Sh(e){return kh.has(e.type)}function wh(e,t,n){!t.implemented||e.length===0||e.some(r=>ut(r))||n({message:"Test has zero assertion steps \u2014 cannot verify expectedOutcome. Add assert.* steps.",rule:"no-assertions",step:void 0})}function bh(e,t,n){if(!t.implemented||e.length<=3)return;let r=e.filter(i=>ut(i)).length;if(r===0)return;let o=r/e.length;if(o<.15){let i=Math.round(o*100);n({message:`Only ${String(r)}/${String(e.length)} steps are assertions (${String(i)}%) \u2014 add more verification between actions`,rule:"low-assertion-ratio",step:void 0})}}function ko(e){if(!("locator"in e)||e.locator==null)return;let t=e.locator;return t.by==="role"?`role:${t.role}:${t.name??""}`:`testId:${t.value}`}function Ah(e,t,n){e.forEach((r,o)=>{if(r.type!=="click")return;let i=ko(r);if(i==null)return;let a=e.slice(o+1,o+4);a.find(c=>c.type==="assertVisible"&&ko(c)===i)==null||a.some(c=>Sh(c)||ut(c)&&ko(c)!==i)||n({message:`click "${r.label??r.id}" is followed only by assert.visible on the same locator \u2014 verifies nothing about the click's effect`,rule:"tautological-post-click-assert",step:r.label??r.id})})}var Rh=new Set(["the","is","a","an","and","or","of","to","in","on","at","for","that","this","with","be","are","was","were","it","its","as","by","from","after","before","should","will","can","still","but","not","no","so","if","then","than","user","users","page","view","shows","show","see","click","clicks","clicked","clickable","visible","appears","appear","displayed","stays","remains"]);function So(e){return e.toLowerCase().split(/[^a-z0-9]+/).filter(t=>t.length>=3&&!Rh.has(t))}function Th(e){let t=e.label==null?[]:So(e.label);if(!("locator"in e)||e.locator==null)return t;let n=e.locator,r=n.by==="role"?n.name??"":n.value;return[...t,...So(r)]}function vh(e,t,n){if(!t.implemented||e.length===0)return;let r=new Set(So(t.expectedOutcome));if(r.size===0)return;let o=e.filter(a=>ut(a));if(o.length===0)return;o.some(a=>Th(a).some(s=>r.has(s)))||n({message:`No assertion references any keyword from expectedOutcome (${[...r].join(", ")}) \u2014 the outcome may not actually be verified`,rule:"expected-outcome-keyword-coverage",step:void 0})}var Nh=/save|submit|create|delete|remove|send|invite|update|confirm|publish|apply|pay|subscribe|upgrade|cancel|archive|rename/i;function kl(e){if(e.type==="upload"||e.type==="handleDialog"&&e.action==="accept")return!0;if(e.type!=="click")return!1;let t=e.locator,n=t.by==="role"?t.name??"":t.value;return Nh.test(n)}function Ch(e,t,n){!t.implemented||t.spec.uiOnly===!0||e.forEach((r,o)=>{if(!kl(r)||"uiOnly"in r&&r.uiOnly===!0)return;let i=e.slice(o+1),a=i.findIndex(d=>kl(d)),s=a===-1?i.length:a;i.slice(0,s).some(d=>d.type==="assertObserver")||n({message:`"${r.label??r.id}" looks like it mutates backend state but no assert.backend(...) observer verifies it \u2014 the test can pass while the server is broken. You need to add an observer that checks the persisted result (see .ripplo/observers/ for examples). Only if this action truly does NOT change any server state (pure client-side interaction, presentation toggle, etc.) should you fall back to marking the step { uiOnly: true } to silence this rule.`,rule:"mutation-without-observer-coverage",step:r.label??r.id})})}function Lh(e,t,n){Object.keys(t.spec.variables??{}).length!==0&&e.forEach(o=>{if(o.type!=="assertObserver")return;let i=Object.entries(o.params);i.length===0||i.some(([,s])=>Sl(s)&&wl(s.value))||n({message:`assert.backend "${o.label??o.id}" passes only hardcoded params while the test defines precondition variables \u2014 observer assertions should reference {{namespace.key}} so they match the actual precondition data`,rule:"observer-params-reference-variables",step:o.label??o.id})})}var xh=[ch,dh,ph,uh,mh,fh,yh,gh,wh,bh,Ah,vh,Ch,Lh];Oe();Q();async function Rl(e){let{ids:t,requireImplemented:n}=e,r=process.cwd(),o=await _(r);o.ok||(process.stderr.write(`Compilation failed: ${o.error}
|
|
523
523
|
`),process.stderr.write(`${P("create","DSL authoring + lint rules")}
|
|
524
524
|
`),process.exit(1)),await me({cwd:r,result:o.result});let i=pt(o.result),a=t.length===0?i.diagnostics:i.diagnostics.filter(p=>t.includes(p.test)),s=Al.groupBy(a,p=>p.test);Object.entries(s).forEach(([p,m])=>{process.stderr.write(`
|
|
525
525
|
${p}
|
|
@@ -528,16 +528,17 @@ Failure patterns:
|
|
|
528
528
|
`)})});let l=new Set(o.builder.getUnimplemented().tests),c=n.filter(p=>l.has(p));c.length>0&&(process.stderr.write(`
|
|
529
529
|
not-implemented
|
|
530
530
|
`),c.forEach(p=>{process.stderr.write(` ${p} is still marked .notImplemented()
|
|
531
|
-
`)}));let d=
|
|
531
|
+
`)}));let d=Ih(r);d.length>0&&(process.stderr.write(`
|
|
532
532
|
preconditions
|
|
533
533
|
`),d.forEach(p=>{process.stderr.write(` [hardcoded-identifier] ${p.file}
|
|
534
534
|
`),process.stderr.write(` ${p.message}
|
|
535
535
|
`)}));let u=a.length+c.length+d.length;u>0&&(process.stderr.write(`
|
|
536
536
|
${String(u)} error(s)
|
|
537
|
-
`),
|
|
538
|
-
`))}var
|
|
539
|
-
`);let o=n.some(i=>i.summary.includes("FAILED")||i.summary.includes("ERROR"));o&&process.stderr.write(
|
|
540
|
-
`),process.
|
|
537
|
+
`),Ph({diagnostics:a,hardcodeWarnings:d,stillStubbed:c}),process.exit(1))}function Ph({diagnostics:e,hardcodeWarnings:t,stillStubbed:n}){let r=new Set;(e.length>0||n.length>0)&&r.add("create"),t.length>0&&r.add("explore"),r.forEach(o=>process.stderr.write(`${P(o)}
|
|
538
|
+
`))}var Eh=/['"`][\w.+-]+@[\w.-]+\.[a-z]{2,}['"`]/i,Oh=/['"`][0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}['"`]/i;function Ih(e){let t=bl.join(e,".ripplo","preconditions");return wo.existsSync(t)?wo.readdirSync(t).filter(r=>r.endsWith(".ts")).flatMap(r=>_h(bl.join(t,r))):[]}function _h(e){let t=wo.readFileSync(e,"utf8"),n=t.includes("ctx.uniqueEmail")||t.includes("ctx.uniqueId"),r=[],o=Eh.exec(t);o!=null&&!n&&r.push({file:e,message:`hardcoded email literal ${o[0]} \u2014 use ctx.uniqueEmail() so parallel runs don't collide`});let i=Oh.exec(t);return i!=null&&!n&&r.push({file:e,message:`hardcoded UUID-like literal ${i[0]} \u2014 use ctx.uniqueId() so parallel runs don't collide`}),r}async function Tl(e){let t=await ve();await Ne(t);let{results:n,summary:r}=await wn({config:t,ids:e});process.stdout.write(`${r}
|
|
539
|
+
`);let o=n.some(i=>i.summary.includes("FAILED")||i.summary.includes("ERROR"));o&&(process.stderr.write(`Artifacts for this run are fresh in .ripplo/debug/<runId>/. Read them before re-running \u2014 a rerun takes ~30-60s and almost never reveals more than summary.txt + steps/<failedIndex>/dom.html + accessibility-tree.txt already do. Only re-run after you've made a change you believe will fix the failure.
|
|
540
|
+
`),process.stderr.write(`${P("debug")}
|
|
541
|
+
`)),process.exit(o?1:0)}G();import{graphql as It}from"gql.tada";var Uh=It(`
|
|
541
542
|
query ScopeStatus($projectId: String!) {
|
|
542
543
|
project(id: $projectId) {
|
|
543
544
|
id
|
|
@@ -557,7 +558,7 @@ ${String(u)} error(s)
|
|
|
557
558
|
}
|
|
558
559
|
}
|
|
559
560
|
}
|
|
560
|
-
`)
|
|
561
|
+
`),jh=It(`
|
|
561
562
|
query ScopeWorkflowBySlug($projectId: String!, $slug: String!) {
|
|
562
563
|
project(id: $projectId) {
|
|
563
564
|
id
|
|
@@ -570,45 +571,49 @@ ${String(u)} error(s)
|
|
|
570
571
|
}
|
|
571
572
|
}
|
|
572
573
|
}
|
|
573
|
-
`)
|
|
574
|
-
mutation
|
|
575
|
-
|
|
574
|
+
`),$h=It(`
|
|
575
|
+
mutation ScopeAddAgent($projectId: String!, $workflowSlugs: [String!]!) {
|
|
576
|
+
addAgentScopeItems(projectId: $projectId, workflowSlugs: $workflowSlugs) {
|
|
576
577
|
id
|
|
578
|
+
workflow {
|
|
579
|
+
id
|
|
580
|
+
slug
|
|
581
|
+
}
|
|
577
582
|
}
|
|
578
583
|
}
|
|
579
|
-
`),
|
|
584
|
+
`),Dh=It(`
|
|
580
585
|
mutation ScopeLink($id: ID!, $workflowId: String!) {
|
|
581
586
|
linkScopeItem(id: $id, workflowId: $workflowId) {
|
|
582
587
|
id
|
|
583
588
|
}
|
|
584
589
|
}
|
|
585
|
-
`),
|
|
586
|
-
mutation
|
|
587
|
-
|
|
590
|
+
`),Bh=It(`
|
|
591
|
+
mutation ScopeRemoveMany($ids: [ID!]!) {
|
|
592
|
+
removeScopeItems(ids: $ids)
|
|
588
593
|
}
|
|
589
|
-
`);async function vl(e){let t=await ve();await Ne(t);let r=(await $({config:t,document:
|
|
590
|
-
`);return}if(r.length===0){process.stdout.write("No scope items. Add via `ripplo scope add <test-
|
|
594
|
+
`);async function vl(e){let t=await ve();await Ne(t);let r=(await $({config:t,document:Uh,variables:{projectId:t.projectId}})).project?.devSession?.scopeItems??[];if(e.format==="json"){process.stdout.write(`${JSON.stringify(r,null,2)}
|
|
595
|
+
`);return}if(r.length===0){process.stdout.write("No scope items. Add via `ripplo scope add <test-ids..>` (variadic) or from the dashboard.\n");return}r.forEach(o=>{let i=o.workflow;if(i==null){process.stdout.write(` [intent] (${o.id}) ${o.label??""}
|
|
591
596
|
`);return}let a=i.spec==null?"stub":"implemented";process.stdout.write(` [${a}] (${o.id}) ${i.slug} \u2014 ${i.name}
|
|
592
|
-
`)})}async function Nl({
|
|
593
|
-
`)}async function Cl({id:e,testId:t}){let n=await ve();await Ne(n);let r=await
|
|
594
|
-
`)}async function Ll({
|
|
595
|
-
`)}async function
|
|
597
|
+
`)})}async function Nl({testIds:e}){let t=await ve();await Ne(t),((await $({config:t,document:$h,variables:{projectId:t.projectId,workflowSlugs:[...e]}})).addAgentScopeItems??[]).forEach(o=>{process.stdout.write(`Added scope item ${o.id} (${o.workflow?.slug??"?"})
|
|
598
|
+
`)})}async function Cl({id:e,testId:t}){let n=await ve();await Ne(n);let r=await Vh({cfg:n,slug:t});await $({config:n,document:Dh,variables:{id:e,workflowId:r}}),process.stdout.write(`Linked scope item ${e} to ${t}
|
|
599
|
+
`)}async function Ll({ids:e}){let t=await ve();await Ne(t);let r=(await $({config:t,document:Bh,variables:{ids:[...e]}})).removeScopeItems??0;process.stdout.write(`Removed ${String(r)} scope item(s)
|
|
600
|
+
`)}async function Vh({cfg:e,slug:t}){let r=(await $({config:e,document:jh,variables:{projectId:e.projectId,slug:t}})).project?.devSession?.workflows?.[0];return r==null&&(process.stderr.write(`No workflow found with id "${t}". Create a stub first via the testing DSL.
|
|
596
601
|
`),process.stderr.write(`${P("create")}
|
|
597
|
-
`),process.exit(1)),r.id}Q();async function
|
|
602
|
+
`),process.exit(1)),r.id}Q();async function xl(e){let t=process.cwd(),n=await _(t);n.ok||(process.stderr.write(`Compilation failed: ${n.error}
|
|
598
603
|
`),process.exit(1));let{tests:r}=n.builder.getUnimplemented();if(e.format==="summary"){r.length>0&&process.stdout.write(`tests: ${r.join(", ")}
|
|
599
604
|
`);return}let o={tests:r.map(i=>({id:i,implemented:!1}))};process.stdout.write(`${JSON.stringify(o,null,2)}
|
|
600
|
-
`)}import{z as Ce}from"zod";var Wh=Ce.object({agent_id:Ce.string().optional(),cwd:Ce.string().optional(),hook_event_name:Ce.string().optional(),mode:Ce.string().optional(),session_id:Ce.string().optional(),tool_input:Ce.looseObject({file_path:Ce.string().optional()}).optional(),tool_name:Ce.string().optional()});async function ie(){let e=await qh();if(e.trim()==="")return{};let t=JSON.parse(e);return Wh.parse(t)}function qh(){return new Promise((e,t)=>{if(process.stdin.isTTY){e("");return}let n=[];process.stdin.on("data",r=>n.push(r)),process.stdin.on("end",()=>{e(Buffer.concat(n).toString("utf8"))}),process.stdin.on("error",t)})}bo();G();import Jh from"fs";function zh(e){return be(e,"hooks-paused")}function ae(e){return Jh.existsSync(zh(e))?!1:
|
|
601
|
-
`).filter(n=>n.length>0)}function
|
|
602
|
-
`).filter(r=>r.length>0)}var Kh=Ao.env.GIT_BIN!=null&&Ao.env.GIT_BIN.length>0?Ao.env.GIT_BIN:"git";function Qh(e){if(!(e instanceof Error)||!("status"in e))return null;let t=Reflect.get(e,"status");return typeof t=="number"?t:null}function Yh(e){if(!(e instanceof Error)||!("stderr"in e))return"";let t=Reflect.get(e,"stderr");return typeof t=="string"?t:Buffer.isBuffer(t)?t.toString("utf8"):""}function
|
|
605
|
+
`)}import{z as Ce}from"zod";var Wh=Ce.object({agent_id:Ce.string().optional(),cwd:Ce.string().optional(),hook_event_name:Ce.string().optional(),mode:Ce.string().optional(),session_id:Ce.string().optional(),tool_input:Ce.looseObject({file_path:Ce.string().optional()}).optional(),tool_name:Ce.string().optional()});async function ie(){let e=await qh();if(e.trim()==="")return{};let t=JSON.parse(e);return Wh.parse(t)}function qh(){return new Promise((e,t)=>{if(process.stdin.isTTY){e("");return}let n=[];process.stdin.on("data",r=>n.push(r)),process.stdin.on("end",()=>{e(Buffer.concat(n).toString("utf8"))}),process.stdin.on("error",t)})}bo();G();import Jh from"fs";function zh(e){return be(e,"hooks-paused")}function ae(e){return Jh.existsSync(zh(e))?!1:Ol(e)}import{execFileSync as Xh}from"child_process";import{createHash as Dx}from"crypto";import Ao from"process";import _l from"picomatch";function Gh(e){return jl(["diff","--name-only","HEAD"],e).split(`
|
|
606
|
+
`).filter(n=>n.length>0)}function Ul({cwd:e,ignoreGlobs:t,watchGlobs:n}){let r=_l([...n]),o=_l([...t]);return Gh(e).filter(i=>r(i)&&!o(i))}function bn(e,...t){return jl(["diff","--name-only","HEAD","--",...t],e).split(`
|
|
607
|
+
`).filter(r=>r.length>0)}var Kh=Ao.env.GIT_BIN!=null&&Ao.env.GIT_BIN.length>0?Ao.env.GIT_BIN:"git";function Qh(e){if(!(e instanceof Error)||!("status"in e))return null;let t=Reflect.get(e,"status");return typeof t=="number"?t:null}function Yh(e){if(!(e instanceof Error)||!("stderr"in e))return"";let t=Reflect.get(e,"stderr");return typeof t=="string"?t:Buffer.isBuffer(t)?t.toString("utf8"):""}function jl(e,t){try{return Xh(Kh,[...e],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","pipe"]})}catch(n){let r=Qh(n);if(r==null||r===0)return"";let o=Yh(n).trim();throw new Error(`git ${e.join(" ")} failed (exit ${String(r)}): ${o}`)}}Q();async function An(e){let t=await _(e);if(!t.ok)throw new Error(`resolvePaths: DSL compile failed \u2014 ${t.error}`);let n=t.builder.getConfig();return{ignorePaths:n.ignorePaths??ho,watchPaths:n.watchPaths??go}}import Zh from"fs";import ek from"path";function ge(e){return Zh.existsSync(ek.join(e,".ripplo"))}async function $l(){await ie();let e=process.cwd();if(!ge(e)||!ae(e))return;let{ignorePaths:t,watchPaths:n}=await An(e),r=Ul({cwd:e,ignoreGlobs:t,watchGlobs:n});r.length===0||bn(e,".ripplo/tests",".ripplo/preconditions",".ripplo/observers").length>0||process.stderr.write(`Scope drift: ${String(r.length)} app file(s) changed with no .ripplo/tests updates. Any e2e flow these changes could affect should be in scope \u2014 \`npx ripplo scope add <test-ids..>\` existing test(s) (variadic), or stub new ones via /ripplo:create.
|
|
603
608
|
${P("scope")}
|
|
604
609
|
${P("create")}
|
|
605
|
-
`)}import Ut from"fs";import tk from"os";import
|
|
606
|
-
`),process.exit(2)}async function
|
|
610
|
+
`)}import Ut from"fs";import tk from"os";import Dl from"path";function Ge(e){process.stderr.write(`${e}
|
|
611
|
+
`),process.exit(2)}async function Bl(){if((await ie()).tool_name!=="ExitPlanMode"||!ae(process.cwd()))return;let t=nk();if(t==null)return;let n=128*1024;if(Ut.statSync(t).size>n)return;let o=Ut.readFileSync(t,"utf8");/apps\/web|apps\/server|route|component|user flow/i.test(o)&&(/\.ripplo\/tests|Tests to implement/.test(o)||Ge(`Plan touches user-facing code but cites no .ripplo/tests stubs.
|
|
607
612
|
Add a 'Tests to implement' section listing .notImplemented() test ids, or reference existing .ripplo/tests files.
|
|
608
|
-
${P("explore")}`))}function nk(){let e=
|
|
613
|
+
${P("explore")}`))}function nk(){let e=Dl.join(tk.homedir(),".claude","plans");return Ut.existsSync(e)?Ut.readdirSync(e).filter(n=>n.endsWith(".md")).map(n=>Dl.join(e,n)).map(n=>({full:n,mtime:Ut.statSync(n).mtimeMs})).sort((n,r)=>r.mtime-n.mtime)[0]?.full??null:null}Q();async function Vl(){if((await ie()).mode!=="plan")return;let t=process.cwd();if(!ge(t)||!ae(t))return;let n=await _(t);if(!n.ok)return;let{tests:r}=n.builder.getUnimplemented();process.stderr.write('Scope this plan: identify which user flows it touches, then for each one either\n \u2022 add existing test(s) from .ripplo/tests/ to scope (`npx ripplo scope add <test-ids..>` \u2014 variadic) so Stop validates they still pass, or\n \u2022 stub new `.notImplemented()` test(s) under .ripplo/tests/ and bulk scope-add them.\nList the test ids under a "Tests to implement" section in your plan \u2014 ExitPlanMode blocks otherwise.\n'),r.length>0&&(process.stderr.write(`Existing stubs (already .notImplemented()):
|
|
609
614
|
`),r.forEach(o=>process.stderr.write(` ${o}
|
|
610
|
-
`)))}import rk from"path";import
|
|
611
|
-
`)}Oe();Q();async function
|
|
615
|
+
`)))}import rk from"path";import Wl from"picomatch";Q();async function ql(){let t=(await ie()).tool_input?.file_path;if(t==null)return;let n=process.cwd();if(!ge(n)||!ae(n))return;let r=rk.relative(n,t);if(r.startsWith(".."))return;let{ignorePaths:o,watchPaths:i}=await An(n),a=Wl([...i]),s=Wl([...o]);if(!a(r)||s(r))return;let l=await _(n);if(!l.ok)return;let{tests:c}=l.builder.getUnimplemented();c.length!==0&&process.stderr.write(`Reminder: .notImplemented() stubs still present \u2014 tests: ${c.join(", ")}
|
|
616
|
+
`)}Oe();Q();async function Fl(){let t=(await ie()).tool_input?.file_path;if(t==null||!/\/\.ripplo\/.*\.ts$/.test(t))return;let n=process.cwd();if(!ge(n)||!ae(n))return;let r=await _(n);r.ok||Ge(`Compilation failed: ${r.error}
|
|
612
617
|
${P("create","DSL authoring + lint rules")}`),await me({cwd:n,result:r.result});let{diagnostics:o}=pt(r.result);if(o.length===0)return;let i=o.map(a=>{let s=a.step==null?"":` at "${a.step}"`;return` [${a.rule}]${s} ${a.test}: ${a.message}`});Ge(`${i.join(`
|
|
613
618
|
`)}
|
|
614
619
|
${P("create")}`)}G();Q();dt();import{graphql as ok}from"gql.tada";var ik=ok(`
|
|
@@ -628,14 +633,14 @@ ${P("create")}`)}G();Q();dt();import{graphql as ok}from"gql.tada";var ik=ok(`
|
|
|
628
633
|
}
|
|
629
634
|
}
|
|
630
635
|
}
|
|
631
|
-
`);async function
|
|
632
|
-
`),null});if(o==null)return;let i=o.project?.devSession?.scopeItems??[];if(i.length===0){process.stderr.write(`Testing Scope is empty. Stub
|
|
636
|
+
`);async function Hl(){await ie();let e=process.cwd();if(!ge(e)||!ae(e))return;let t=Re(e);if(t==null)return;let n=await _(e);if(!n.ok)return;let r={...n.result.config,ripploServerUrl:Ve(),token:t},o=await $({config:r,document:ik,variables:{projectId:r.projectId}}).catch(s=>{let l=s instanceof Error?s.message:String(s);return process.stderr.write(`Scope reminder unavailable: ${l}
|
|
637
|
+
`),null});if(o==null)return;let i=o.project?.devSession?.scopeItems??[];if(i.length===0){process.stderr.write(`Testing Scope is empty. Stub tests for any user flows you take on, then \`npx ripplo scope add <test-ids..>\` (variadic \u2014 pass multiple ids in one call).
|
|
633
638
|
${P("create")}
|
|
634
639
|
${P("scope")}
|
|
635
640
|
`);return}let a=i.map(s=>{let l=s.workflow;return l==null?` [intent] (${s.id}) ${s.label??""}`:` [${l.spec==null?"stub":"implemented"}] (${s.id}) ${l.slug}`});process.stderr.write(`Testing Scope (${String(i.length)}):
|
|
636
641
|
${a.join(`
|
|
637
642
|
`)}
|
|
638
|
-
If your next change touches
|
|
643
|
+
If your next change touches existing tests' user flows, \`npx ripplo scope add <test-ids..>\` (variadic) to mark them for Stop validation. If it introduces new flows, stub \`.notImplemented()\` tests and bulk scope-add them. \`scope remove <ids..>\` only for items genuinely out of scope \u2014 not as a Stop-gate shortcut.
|
|
639
644
|
${P("scope")}
|
|
640
645
|
`)}import{execFileSync as ak}from"child_process";import sk from"path";import Ro from"process";Oe();G();import{graphql as lk}from"gql.tada";import{z as Rn}from"zod";Q();dt();var ck=lk(`
|
|
641
646
|
query ScopeEnforce($projectId: String!) {
|
|
@@ -656,7 +661,7 @@ ${P("scope")}
|
|
|
656
661
|
}
|
|
657
662
|
}
|
|
658
663
|
}
|
|
659
|
-
`);async function
|
|
664
|
+
`);async function Jl(){let e=await ie();if(e.agent_id!=null&&e.agent_id.length>0)return;let t=Ro.cwd();if(!ge(t)||!ae(t))return;let n=dk(t),r=await pk(t,n);r.length>0&&Ge(r.join(`
|
|
660
665
|
|
|
661
666
|
`))}function dk(e){return bn(e,".ripplo/tests").filter(t=>t.endsWith(".ts")).map(t=>sk.basename(t,".ts")).filter(t=>t!=="index")}async function pk(e,t){let n=await _(e);if(!n.ok)return[`--- Compilation failed ---
|
|
662
667
|
${n.error}
|
|
@@ -664,20 +669,26 @@ ${P("create")}`];await me({cwd:e,result:n.result});let r=await uk(e,n),o=[...new
|
|
|
664
669
|
${a.join(`
|
|
665
670
|
`)}
|
|
666
671
|
|
|
667
|
-
|
|
672
|
+
Scope is the contract for this session: each item represents a user-facing feature that should work end-to-end. "Done" means the app code delivers the behavior AND a passing test proves it \u2014 authoring a test against broken UI/API doesn't count. Work each item with \`/ripplo:create\` (one at a time is fine; the hook re-checks on stop).
|
|
673
|
+
|
|
674
|
+
Only use \`npx ripplo scope remove <ids..>\` if an item is genuinely out of scope or no longer needed \u2014 not as a shortcut when implementation feels long. If scope itself is wrong, raise it with the user before removing.
|
|
668
675
|
${P("create")}`,scopedSlugsToRun:s}}function mk(e,t){let{diagnostics:n}=pt(e.result),r=new Set(e.builder.getUnimplemented().tests),o=t.filter(s=>r.has(s));if(n.length===0&&o.length===0)return null;let i=n.map(s=>{let l=s.step==null?"":` at "${s.step}"`;return` [${s.rule}]${l} ${s.test}: ${s.message}`}),a=o.map(s=>` [not-implemented] ${s} is still marked .notImplemented()`);return`--- Ripplo Lint ---
|
|
669
676
|
${[...i,...a].join(`
|
|
670
677
|
`)}
|
|
671
678
|
${P("create")}`}function fk(e){let{tests:t}=e.builder.getUnimplemented();return t.length===0?null:`--- Unimplemented stubs remain ---
|
|
672
679
|
tests: ${t.join(", ")}
|
|
680
|
+
|
|
681
|
+
These are the user-facing flows you committed to this session. "Done" means: app code delivers the behavior AND a passing test proves it \u2014 both halves. Implement each with \`/ripplo:create <id>\`; the hook re-checks on stop. Only \`npx ripplo scope remove <ids..>\` items that are genuinely out of scope; don't remove just to clear the gate.
|
|
673
682
|
${P("create")}`}function yk(e,t){if(t.length===0)return null;let n=hk(["run",...t],e);if(n.code===0)return null;let r=n.output.split(`
|
|
674
683
|
`).filter(o=>/FAILED/.test(o)).join(`
|
|
675
684
|
`);return r.length===0?null:`--- Ripplo Run Failures (${t.join(" ")}) ---
|
|
676
685
|
${r}
|
|
677
|
-
|
|
686
|
+
|
|
687
|
+
Artifacts are fresh in .ripplo/debug/<runId>/. Diagnose from those \u2014 don't re-run hoping for a different result. Open summary.txt \u2192 steps/<failedIndex>/{dom.html,accessibility-tree.txt,console.log,network.jsonl}, cite a specific line as evidence, then make ONE targeted fix and re-run.
|
|
688
|
+
${P("debug")}`}var gk=Rn.object({status:Rn.number().nullish(),stderr:Rn.unknown().optional(),stdout:Rn.unknown().optional()});function Ml(e){return e instanceof Buffer?e.toString("utf8"):typeof e=="string"?e:""}function hk(e,t){let n=Ro.argv[1];if(n==null)return{code:1,output:""};try{return{code:0,output:ak(Ro.execPath,[n,...e],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","pipe"]})}}catch(r){let o=gk.safeParse(r);if(!o.success)return{code:1,output:""};let i=`${Ml(o.data.stdout)}${Ml(o.data.stderr)}`;return{code:o.data.status??1,output:i}}}var Id=tt.resolve(tt.dirname(Nb(import.meta.url)),"..");Od({path:tt.join(Id,".env.local"),quiet:!0});Od({path:tt.join(Id,".env"),quiet:!0});Ib();var _d={"coverage-nudge":$l,"exit-plan-gate":Bl,"plan-reminder":Vl,"post-edit-flag-stubs":ql,"post-edit-lint":Fl,"scope-reminder":Hl,"stop-enforce":Jl};async function xb(){await Cb(Lb(process.argv)).scriptName("ripplo").command("$0","Launch the interactive dashboard",()=>{},Pb).command("run [ids..]","Run tests in parallel",e=>{let t=[];return e.positional("ids",{array:!0,default:t,describe:"Test ids to run (all if omitted)",type:"string"})},e=>Tl(e.ids)).command("lint [ids..]","Compile and lint tests (all or specific ids)",e=>{let t=[];return e.positional("ids",{array:!0,default:t,describe:"Test ids to lint (all if omitted)",type:"string"}).option("require-implemented",{array:!0,default:t,describe:"Test ids that must not be .notImplemented() \u2014 fails if any still are",type:"string"})},e=>Rl({ids:e.ids,requireImplemented:e["require-implemented"]})).command("flake-detect <id>","Run a test N times in parallel to detect flakiness",e=>e.positional("id",{demandOption:!0,describe:"Test id to run flake detection against",type:"string"}).option("runs",{default:10,describe:"Number of parallel runs",type:"number"}),e=>gl({id:e.id,runs:e.runs})).command("compile","Compile the DSL and write .ripplo/ripplo.lock",e=>e.option("check",{default:!1,describe:"Exit non-zero if the lockfile is missing or stale (does not write)",type:"boolean"}),e=>fi({check:e.check})).command("doctor","Check project health",()=>{},()=>dl()).command("status","Report unimplemented tests and preconditions",e=>e.option("format",{choices:["json","summary"],default:"json",describe:"Output format"}),e=>xl({format:e.format})).command("scope <subcommand>","Manage testing scope",Ob).command("hook <name>","Internal: run a Claude Code plugin hook",e=>e.positional("name",{choices:Object.keys(_d),demandOption:!0,type:"string"}),e=>Eb(e.name)).option("env",{choices:["dev","local"],describe:"Server environment",type:"string"}).strict().help().parse()}async function Pb(){let{redirectStdioToFile:e}=await Promise.resolve().then(()=>(Xl(),zl)),t=e(tt.join(process.cwd(),".ripplo","debug","debug.log")),{launchDashboard:n}=await Promise.resolve().then(()=>(Qo(),Ed));n({restoreStdio:t})}async function Eb(e){let t=_d[e];t==null&&(process.stderr.write(`Unknown hook: ${e}
|
|
678
689
|
`),process.exit(1)),await t()}xb().catch(e=>{process.stderr.write(`${e instanceof Error?e.message:String(e)}
|
|
679
|
-
`),process.exit(1)});function Ob(e){return e.command("status","Print the current scope",t=>t.option("format",{choices:["json","text"],default:"text",describe:"Output format"}),t=>vl({format:t.format})).command("add <test-
|
|
680
|
-
`))}function
|
|
690
|
+
`),process.exit(1)});function Ob(e){return e.command("status","Print the current scope",t=>t.option("format",{choices:["json","text"],default:"text",describe:"Output format"}),t=>vl({format:t.format})).command("add <test-ids..>","Bind one or more existing tests (stubs or implemented) to scope as agent intent",t=>{let n=[];return t.positional("test-ids",{array:!0,default:n,demandOption:!0,describe:"Slugs of existing workflows",type:"string"})},t=>Nl({testIds:t["test-ids"]})).command("link <id> <test-id>","Link an existing scope item to a test",t=>t.positional("id",{demandOption:!0,describe:"Scope item id",type:"string"}).positional("test-id",{demandOption:!0,describe:"Slug of the workflow to link",type:"string"}),t=>Cl({id:t.id,testId:t["test-id"]})).command("remove <ids..>","Remove one or more scope items by id",t=>{let n=[];return t.positional("ids",{array:!0,default:n,demandOption:!0,describe:"Scope item ids",type:"string"})},t=>Ll({ids:t.ids})).demandCommand(1)}function Ib(){let e=process.cwd(),t=Ud(e);t!=null&&t!==e&&(process.chdir(t),process.stderr.write(`ripplo: resolved .ripplo/ at ${t}
|
|
691
|
+
`))}function Ud(e){let t=tt.dirname(e);return vb.existsSync(tt.join(e,".ripplo"))?e:t===e?null:Ud(t)}export{xb as main};
|
|
681
692
|
/*! Bundled license information:
|
|
682
693
|
|
|
683
694
|
mustache/mustache.mjs:
|