ripplo 0.1.3 → 0.1.4

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.
Files changed (2) hide show
  1. package/dist/index.js +3 -3
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  var Ys=Object.create;var Mt=Object.defineProperty;var Zs=Object.getOwnPropertyDescriptor;var el=Object.getOwnPropertyNames;var tl=Object.getPrototypeOf,nl=Object.prototype.hasOwnProperty;var y=(e,t)=>()=>(e&&(t=e(e=0)),t);var rt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),rl=(e,t)=>{for(var n in t)Mt(e,n,{get:t[n],enumerable:!0})},ol=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of el(t))!nl.call(e,o)&&o!==n&&Mt(e,o,{get:()=>t[o],enumerable:!(r=Zs(t,o))||r.enumerable});return e};var Mr=(e,t,n)=>(n=e!=null?Ys(tl(e)):{},ol(t||!e||!e.__esModule?Mt(n,"default",{value:e,enumerable:!0}):n,e));function Jr(e){return e.data}function zr(e){return{as(t){return{data:{label:t,node:e}}}}}var ot=y(()=>{"use strict"});function at(e){let t=e.getPreconditions(),n=e.getTests();al(n);let r=n.map(a=>il(a)),o=cl(t,n);return{config:e.getConfig(),graph:o,tests:r}}function al(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 il(e){let t=e.id,{accessedKeys:n,vars:r}=Xr(e.requiresKeys),o=e.startsAtFn==null?void 0:e.startsAtFn(r),a=e.stepsFn==null?[]:e.stepsFn(r),i=o==null?a:[sl(o),...a],l=ll(i,n,e.requiresKeys),s=[];return Object.keys(e.requiresKeys).length>0&&n.size===0&&e.implemented&&s.push("Test requires preconditions but never references their data \u2014 destructure and use precondition data in steps()"),{additionalChecks:[],description:e.description,expectedOutcome:e.expectedOutcome,implemented:e.implemented,name:e.name,slug:t,spec:l,warnings:s}}function sl(e){return zr({type:"goto",url:{type:"static",value:e}}).as(`navigate to ${e}`)}function Xr(e){let t=new Set,n={};return Object.keys(e).forEach(r=>{n[r]=new Proxy({},{get(o,a){if(typeof a=="string"){let i=`${r}.${a}`;return t.add(i),`{{${i}}}`}}})}),{accessedKeys:t,vars:n}}function ll(e,t,n){let r={};e.forEach((i,l)=>{let s=`step-${String(l)}`,d=l<e.length-1?`step-${String(l+1)}`:void 0;r[s]=dl(i,s,d)});let o={};t.forEach(i=>{o[i]={default:`test-${i}`,type:"string"}});let a={...n};return{entryNode:"step-0",nodes:r,variableNamespaces:a,variables:o,version:2}}function dl(e,t,n){let{label:r,node:o}=Jr(e);return{...o,id:t,label:r,next:n}}function cl(e,t){let n={};e.forEach(a=>{n[a.name]={depends:[...a.dependsOn],description:a.description,returns:[...a.returns]}});let r={},o=[];return t.forEach(a=>{if(!a.implemented||a.startsAtFn==null)return;let i=pl(a.requires,e),{vars:l}=Xr(a.requiresKeys),s=a.startsAtFn(l),d=ul(i,s);r[d]={preconditions:[...i],route:s},o.push({from:d,requiresKeys:a.requiresKeys,to:d,workflow:a.id})}),{edges:o,preconditions:n,states:r,version:3}}function pl(e,t){let n=new Map(t.map(i=>[i.name,i])),r=[],o=new Set;function a(i){o.has(i)||(o.add(i),n.get(i)?.dependsOn.forEach(l=>{a(l)}),r.push(i))}return e.forEach(i=>{a(i)}),r}function ul(e,t){let n=e.toSorted((r,o)=>r.localeCompare(o));return ml(`${n.join("-")}-${t}`)}function ml(e){return e.toLowerCase().replaceAll(/[^a-z0-9]+/g,"-").replaceAll(/^-|-$/g,"")}var Jt=y(()=>{"use strict";ot()});var Gr=y(()=>{"use strict";Jt();ot()});import fl from"path";import{createJiti as yl}from"jiti";async function V(e){let t=fl.join(e,".ripplo","index.ts");try{let r=await yl(import.meta.url,{moduleCache:!1}).import(t),a=r!=null&&typeof r=="object"&&"default"in r?r.default:r,i=at(a);return{builder:a,ok:!0,result:i}}catch(n){return{error:n instanceof Error?n.message:String(n),ok:!1}}}var oe=y(()=>{"use strict";Gr()});function Ht(e){return typeof e=="function"}function Bl(e){return Te(e)?"array":typeof e}function Gt(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function no(e,t){return e!=null&&typeof e=="object"&&t in e}function Dl(e,t){return e!=null&&typeof e!="object"&&e.hasOwnProperty&&e.hasOwnProperty(t)}function Wl(e,t){return Vl.call(e,t)}function Fl(e){return!Wl(ql,e)}function Jl(e){return String(e).replace(/[&<>"'`=\/]/g,function(n){return Ml[n]})}function Kl(e,t){if(!e)return[];var n=!1,r=[],o=[],a=[],i=!1,l=!1,s="",d=0;function c(){if(i&&!l)for(;a.length;)delete o[a.pop()];else a=[];i=!1,l=!1}var u,p,m;function g(P){if(typeof P=="string"&&(P=P.split(Xl,2)),!Te(P)||P.length!==2)throw new Error("Invalid tags: "+P);u=new RegExp(Gt(P[0])+"\\s*"),p=new RegExp("\\s*"+Gt(P[1])),m=new RegExp("\\s*"+Gt("}"+P[1]))}g(t||Y.tags);for(var k=new De(e),h,A,S,N,C,T;!k.eos();){if(h=k.pos,S=k.scanUntil(u),S)for(var O=0,I=S.length;O<I;++O)N=S.charAt(O),Fl(N)?(a.push(o.length),s+=N):(l=!0,n=!0,s+=" "),o.push(["text",N,h,h+1]),h+=1,N===`
3
3
  `&&(c(),s="",d=0,n=!1);if(!k.scan(u))break;if(i=!0,A=k.scan(Hl)||"name",k.scan(zl),A==="="?(S=k.scanUntil(ro),k.scan(ro),k.scanUntil(p)):A==="{"?(S=k.scanUntil(m),k.scan(Gl),k.scanUntil(p),A="&"):S=k.scanUntil(p),!k.scan(p))throw new Error("Unclosed tag at "+k.pos);if(A==">"?C=[A,S,h,k.pos,s,d,n]:C=[A,S,h,k.pos],d++,o.push(C),A==="#"||A==="^")r.push(C);else if(A==="/"){if(T=r.pop(),!T)throw new Error('Unopened section "'+S+'" at '+h);if(T[1]!==S)throw new Error('Unclosed section "'+T[1]+'" at '+h)}else A==="name"||A==="{"||A==="&"?l=!0:A==="="&&g(S)}if(c(),T=r.pop(),T)throw new Error('Unclosed section "'+T[1]+'" at '+k.pos);return Yl(Ql(o))}function Ql(e){for(var t=[],n,r,o=0,a=e.length;o<a;++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 Yl(e){for(var t=[],n=t,r=[],o,a,i=0,l=e.length;i<l;++i)switch(o=e[i],o[0]){case"#":case"^":n.push(o),r.push(o),n=o[4]=[];break;case"/":a=r.pop(),a[5]=o[2],n=r.length>0?r[r.length-1][4]:t;break;default:n.push(o)}return t}function De(e){this.string=e,this.tail=e,this.pos=0}function Ne(e,t){this.view=e,this.cache={".":this.view},this.parent=t}function F(){this.templateCache={_cache:{},set:function(t,n){this._cache[t]=n},get:function(t){return this._cache[t]},clear:function(){this._cache={}}}}var $l,Te,Vl,ql,Ml,zl,Xl,ro,Gl,Hl,Y,Be,oo,ao=y(()=>{"use strict";$l=Object.prototype.toString,Te=Array.isArray||function(t){return $l.call(t)==="[object Array]"};Vl=RegExp.prototype.test;ql=/\S/;Ml={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"};zl=/\s*/,Xl=/\s+/,ro=/\s*=/,Gl=/\s*\}/,Hl=/#|\^|\/|>|\{|&|=|!/;De.prototype.eos=function(){return this.tail===""};De.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};De.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};Ne.prototype.push=function(t){return new Ne(t,this)};Ne.prototype.lookup=function(t){var n=this.cache,r;if(n.hasOwnProperty(t))r=n[t];else{for(var o=this,a,i,l,s=!1;o;){if(t.indexOf(".")>0)for(a=o.view,i=t.split("."),l=0;a!=null&&l<i.length;)l===i.length-1&&(s=no(a,i[l])||Dl(a,i[l])),a=a[i[l++]];else a=o.view[t],s=no(o.view,t);if(s){r=a;break}o=o.parent}n[t]=r}return Ht(r)&&(r=r.call(this.view)),r};F.prototype.clearCache=function(){typeof this.templateCache<"u"&&this.templateCache.clear()};F.prototype.parse=function(t,n){var r=this.templateCache,o=t+":"+(n||Y.tags).join(":"),a=typeof r<"u",i=a?r.get(o):void 0;return i==null&&(i=Kl(t,n),a&&r.set(o,i)),i};F.prototype.render=function(t,n,r,o){var a=this.getConfigTags(o),i=this.parse(t,a),l=n instanceof Ne?n:new Ne(n,void 0);return this.renderTokens(i,l,r,t,o)};F.prototype.renderTokens=function(t,n,r,o,a){for(var i="",l,s,d,c=0,u=t.length;c<u;++c)d=void 0,l=t[c],s=l[0],s==="#"?d=this.renderSection(l,n,r,o,a):s==="^"?d=this.renderInverted(l,n,r,o,a):s===">"?d=this.renderPartial(l,n,r,a):s==="&"?d=this.unescapedValue(l,n):s==="name"?d=this.escapedValue(l,n,a):s==="text"&&(d=this.rawValue(l)),d!==void 0&&(i+=d);return i};F.prototype.renderSection=function(t,n,r,o,a){var i=this,l="",s=n.lookup(t[1]);function d(p){return i.render(p,n,r,a)}if(s){if(Te(s))for(var c=0,u=s.length;c<u;++c)l+=this.renderTokens(t[4],n.push(s[c]),r,o,a);else if(typeof s=="object"||typeof s=="string"||typeof s=="number")l+=this.renderTokens(t[4],n.push(s),r,o,a);else if(Ht(s)){if(typeof o!="string")throw new Error("Cannot use higher-order sections without the original template");s=s.call(n.view,o.slice(t[3],t[5]),d),s!=null&&(l+=s)}else l+=this.renderTokens(t[4],n,r,o,a);return l}};F.prototype.renderInverted=function(t,n,r,o,a){var i=n.lookup(t[1]);if(!i||Te(i)&&i.length===0)return this.renderTokens(t[4],n,r,o,a)};F.prototype.indentPartial=function(t,n,r){for(var o=n.replace(/[^ \t]/g,""),a=t.split(`
4
4
  `),i=0;i<a.length;i++)a[i].length&&(i>0||!r)&&(a[i]=o+a[i]);return a.join(`
5
- `)};F.prototype.renderPartial=function(t,n,r,o){if(r){var a=this.getConfigTags(o),i=Ht(r)?r(t[1]):r[t[1]];if(i!=null){var l=t[6],s=t[5],d=t[4],c=i;s==0&&d&&(c=this.indentPartial(i,d,l));var u=this.parse(c,a);return this.renderTokens(u,n,r,c,o)}}};F.prototype.unescapedValue=function(t,n){var r=n.lookup(t[1]);if(r!=null)return r};F.prototype.escapedValue=function(t,n,r){var o=this.getConfigEscape(r)||Y.escape,a=n.lookup(t[1]);if(a!=null)return typeof a=="number"&&o===Y.escape?String(a):o(a)};F.prototype.rawValue=function(t){return t[1]};F.prototype.getConfigTags=function(t){return Te(t)?t:t&&typeof t=="object"?t.tags:void 0};F.prototype.getConfigEscape=function(t){if(t&&typeof t=="object"&&!Te(t))return t.escape};Y={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){Be.templateCache=e},get templateCache(){return Be.templateCache}},Be=new F;Y.clearCache=function(){return Be.clearCache()};Y.parse=function(t,n){return Be.parse(t,n)};Y.render=function(t,n,r,o){if(typeof t!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+Bl(t)+'" was given as the first argument for mustache#render(template, view, partials)');return Be.render(t,n,r,o)};Y.escape=Jl;Y.Scanner=De;Y.Context=Ne;Y.Writer=F;oo=Y});function Ve({defs:e}){return e==null?{}:Object.fromEntries(Object.entries(e).map(([t,n])=>[t,ed({def:n,name:t})]))}function ed({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??Zl[e.type]??""}function We({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 J({ref:e,variables:t}){let n=String(We({ref:e,variables:t}));return Kt({raw:n,variables:t})}function Kt({raw:e,variables:t}){return oo.render(e,t,{},{escape:n=>n})}function Qt({ref:e,variables:t}){let n=We({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 Le({name:e,store:t,value:n}){return{...t,[e]:n}}var Zl,le=y(()=>{"use strict";ao();Zl={boolean:!1,number:0,string:""}});function _({locator:e,page:t,variables:n}){switch(e.by){case"testId":return t.getByTestId(io(e.value,n));case"role":return t.getByRole(e.role,{exact:!0,name:e.name==null?void 0:io(e.name,n)})}}function io(e,t){return t==null?e:Kt({raw:e,variables:t})}var be=y(()=>{"use strict";le()});async function so({node:e,page:t,timeout:n}){await _({locator:e.source,page:t,variables:void 0}).dragTo(_({locator:e.target,page:t,variables:void 0}),{timeout:n})}async function lo({node:e,page:t,timeout:n}){await _({locator:e.locator,page:t,variables:void 0}).click({button:"right",timeout:n})}function co({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 po({node:e,page:t,variables:n}){if(e.action==="write"){if(e.value==null)throw new Error("clipboard write requires a value");let o=J({ref:e.value,variables:n}),a=JSON.stringify(o);return await t.evaluate(`navigator.clipboard.writeText(${a})`),{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:Le({name:e.variable,store:n,value:r})}}async function uo({node:e,page:t}){let n=t.context();e.state==="granted"?await n.grantPermissions([e.permission]):await n.clearPermissions()}var mo=y(()=>{"use strict";be();le()});async function Yt({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 nd({node:e,page:t,timeout:n,variables:r});case"rightClick":return await lo({node:e,page:t,timeout:n}),{variables:r};case"goto":{let o=J({ref:e.url,variables:r});return await t.goto(o,{timeout:n,waitUntil:"domcontentloaded"}),e.waitForReady===!0&&await t.waitForFunction("(document.body?.textContent?.trim().length ?? 0) > 0",{timeout:n}),{variables:r}}case"fill":return od({node:e,page:t,timeout:n,variables:r});case"select":return ad({node:e,page:t,timeout:n,variables:r});case"type":return id({node:e,page:t,timeout:n,variables:r});case"press":return await rd({node:e,page:t,timeout:n}),{variables:r};case"drag":return await so({node:e,page:t,timeout:n}),{variables:r};case"upload":return sd({node:e,page:t,timeout:n,variables:r});case"extractText":return ld({node:e,page:t,timeout:n,variables:r});case"setVariable":{let o=We({ref:e.value,variables:r});return{variables:Le({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 co({node:e,page:t,variables:r});case"clipboard":return po({node:e,page:t,variables:r});case"setPermission":return await uo({node:e,page:t}),{variables:r}}}async function nd({node:e,page:t,timeout:n,variables:r}){return await _({locator:e.locator,page:t,variables:r})[td[e.type]]({timeout:n}),{variables:r}}async function rd({node:e,page:t,timeout:n}){e.locator==null?await t.keyboard.press(e.key):await _({locator:e.locator,page:t,variables:void 0}).press(e.key,{timeout:n})}async function od({node:e,page:t,timeout:n,variables:r}){let o=J({ref:e.value,variables:r});return await _({locator:e.locator,page:t,variables:r}).fill(o,{timeout:n}),{variables:r}}async function ad({node:e,page:t,timeout:n,variables:r}){let o=J({ref:e.value,variables:r});return await _({locator:e.locator,page:t,variables:r}).selectOption(o,{timeout:n}),{variables:r}}async function id({node:e,page:t,timeout:n,variables:r}){let o=J({ref:e.value,variables:r});return await _({locator:e.locator,page:t,variables:r}).pressSequentially(o,{timeout:n}),{variables:r}}async function sd({node:e,page:t,timeout:n,variables:r}){return await _({locator:e.locator,page:t,variables:r}).setInputFiles(e.files,{timeout:n}),{variables:r}}async function ld({node:e,page:t,timeout:n,variables:r}){let o=await _({locator:e.locator,page:t,variables:r}).textContent({timeout:n});if(o==null)throw new Error("extractText: element had no text content");return{variables:Le({name:e.variable,store:r,value:o})}}var td,Zt=y(()=>{"use strict";mo();be();le();td={check:"check",clear:"clear",click:"click",dblclick:"dblclick",focus:"focus",hover:"hover",scrollIntoView:"scrollIntoViewIfNeeded",uncheck:"uncheck"}});async function de({page:e,runStartTime:t,targets:n}){let r=e.viewportSize();if(r==null)throw new Error("Page has no viewport set");let[o,a]=await Promise.all([e.screenshot({type:"png"}),cd(n)]),i=o.toString("base64");return{annotations:a,screenshotBase64:i,snapshotTimestamp:Math.round(performance.now()-t),url:e.url(),viewportHeight:r.height,viewportWidth:r.width}}function dd(e){return"locator"in e}async function cd(e){return(await Promise.all(e.map(n=>pd(n)))).filter(n=>n!=null)}async function pd(e){if(!dd(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 it({node:e,page:t}){if(e.type==="assertUrl")return[{label:e.type,type:"urlBar"}];if(e.type==="drag"){let o=_({locator:e.source,page:t,variables:void 0}),a=_({locator:e.target,page:t,variables:void 0});return[{label:"drag-source",locator:o,type:"action"},{label:"drag-target",locator:a,type:"action"}]}if(!ud(e))return[];let n=e.type.startsWith("assert")?"assertion":"action",r=_({locator:e.locator,page:t,variables:void 0});return[{label:e.type,locator:r,type:n}]}function ud(e){return"locator"in e&&e.locator!=null}var qe=y(()=>{"use strict";be()});import{z as md}from"zod";function R({description:e,execute:t,name:n,schema:r}){let o=md.toJSONSchema(r,{target:"draft-2020-12"});return{anthropicTool:{description:e,input_schema:{...o,type:"object"},name:n},name:n,async execute(a,i){let l=r.parse(i);return{...await Promise.resolve(t(a,l)),kind:"action"}}}}async function L(e){let t=e.specNode==null?[]:it({node:e.specNode,page:e.page}),n=await de({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},a=r.length>0?r.map(i=>`${i.status}: ${i.description} \u2014 ${i.detail??""}`).join(`
5
+ `)};F.prototype.renderPartial=function(t,n,r,o){if(r){var a=this.getConfigTags(o),i=Ht(r)?r(t[1]):r[t[1]];if(i!=null){var l=t[6],s=t[5],d=t[4],c=i;s==0&&d&&(c=this.indentPartial(i,d,l));var u=this.parse(c,a);return this.renderTokens(u,n,r,c,o)}}};F.prototype.unescapedValue=function(t,n){var r=n.lookup(t[1]);if(r!=null)return r};F.prototype.escapedValue=function(t,n,r){var o=this.getConfigEscape(r)||Y.escape,a=n.lookup(t[1]);if(a!=null)return typeof a=="number"&&o===Y.escape?String(a):o(a)};F.prototype.rawValue=function(t){return t[1]};F.prototype.getConfigTags=function(t){return Te(t)?t:t&&typeof t=="object"?t.tags:void 0};F.prototype.getConfigEscape=function(t){if(t&&typeof t=="object"&&!Te(t))return t.escape};Y={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){Be.templateCache=e},get templateCache(){return Be.templateCache}},Be=new F;Y.clearCache=function(){return Be.clearCache()};Y.parse=function(t,n){return Be.parse(t,n)};Y.render=function(t,n,r,o){if(typeof t!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+Bl(t)+'" was given as the first argument for mustache#render(template, view, partials)');return Be.render(t,n,r,o)};Y.escape=Jl;Y.Scanner=De;Y.Context=Ne;Y.Writer=F;oo=Y});function Ve({defs:e}){return e==null?{}:Object.fromEntries(Object.entries(e).map(([t,n])=>[t,ed({def:n,name:t})]))}function ed({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??Zl[e.type]??""}function We({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 J({ref:e,variables:t}){let n=String(We({ref:e,variables:t}));return Kt({raw:n,variables:t})}function Kt({raw:e,variables:t}){return oo.render(e,t,{},{escape:n=>n})}function Qt({ref:e,variables:t}){let n=We({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 Le({name:e,store:t,value:n}){return{...t,[e]:n}}var Zl,le=y(()=>{"use strict";ao();Zl={boolean:!1,number:0,string:""}});function _({locator:e,page:t,variables:n}){switch(e.by){case"testId":return t.getByTestId(io(e.value,n));case"role":return t.getByRole(e.role,{exact:!0,name:e.name==null?void 0:io(e.name,n)})}}function io(e,t){return t==null?e:Kt({raw:e,variables:t})}var be=y(()=>{"use strict";le()});async function so({node:e,page:t,timeout:n}){await _({locator:e.source,page:t,variables:void 0}).dragTo(_({locator:e.target,page:t,variables:void 0}),{timeout:n})}async function lo({node:e,page:t,timeout:n}){await _({locator:e.locator,page:t,variables:void 0}).click({button:"right",timeout:n})}function co({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 po({node:e,page:t,variables:n}){if(e.action==="write"){if(e.value==null)throw new Error("clipboard write requires a value");let o=J({ref:e.value,variables:n}),a=JSON.stringify(o);return await t.evaluate(`navigator.clipboard.writeText(${a})`),{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:Le({name:e.variable,store:n,value:r})}}async function uo({node:e,page:t}){let n=t.context();e.state==="granted"?await n.grantPermissions([e.permission]):await n.clearPermissions()}var mo=y(()=>{"use strict";be();le()});async function Yt({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 nd({node:e,page:t,timeout:n,variables:r});case"rightClick":return await lo({node:e,page:t,timeout:n}),{variables:r};case"goto":{let o=J({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 od({node:e,page:t,timeout:n,variables:r});case"select":return ad({node:e,page:t,timeout:n,variables:r});case"type":return id({node:e,page:t,timeout:n,variables:r});case"press":return await rd({node:e,page:t,timeout:n}),{variables:r};case"drag":return await so({node:e,page:t,timeout:n}),{variables:r};case"upload":return sd({node:e,page:t,timeout:n,variables:r});case"extractText":return ld({node:e,page:t,timeout:n,variables:r});case"setVariable":{let o=We({ref:e.value,variables:r});return{variables:Le({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 co({node:e,page:t,variables:r});case"clipboard":return po({node:e,page:t,variables:r});case"setPermission":return await uo({node:e,page:t}),{variables:r}}}async function nd({node:e,page:t,timeout:n,variables:r}){return await _({locator:e.locator,page:t,variables:r})[td[e.type]]({timeout:n}),{variables:r}}async function rd({node:e,page:t,timeout:n}){e.locator==null?await t.keyboard.press(e.key):await _({locator:e.locator,page:t,variables:void 0}).press(e.key,{timeout:n})}async function od({node:e,page:t,timeout:n,variables:r}){let o=J({ref:e.value,variables:r});return await _({locator:e.locator,page:t,variables:r}).fill(o,{timeout:n}),{variables:r}}async function ad({node:e,page:t,timeout:n,variables:r}){let o=J({ref:e.value,variables:r});return await _({locator:e.locator,page:t,variables:r}).selectOption(o,{timeout:n}),{variables:r}}async function id({node:e,page:t,timeout:n,variables:r}){let o=J({ref:e.value,variables:r});return await _({locator:e.locator,page:t,variables:r}).pressSequentially(o,{timeout:n}),{variables:r}}async function sd({node:e,page:t,timeout:n,variables:r}){return await _({locator:e.locator,page:t,variables:r}).setInputFiles(e.files,{timeout:n}),{variables:r}}async function ld({node:e,page:t,timeout:n,variables:r}){let o=await _({locator:e.locator,page:t,variables:r}).textContent({timeout:n});if(o==null)throw new Error("extractText: element had no text content");return{variables:Le({name:e.variable,store:r,value:o})}}var td,Zt=y(()=>{"use strict";mo();be();le();td={check:"check",clear:"clear",click:"click",dblclick:"dblclick",focus:"focus",hover:"hover",scrollIntoView:"scrollIntoViewIfNeeded",uncheck:"uncheck"}});async function de({page:e,runStartTime:t,targets:n}){let r=e.viewportSize();if(r==null)throw new Error("Page has no viewport set");let[o,a]=await Promise.all([e.screenshot({type:"png"}),cd(n)]),i=o.toString("base64");return{annotations:a,screenshotBase64:i,snapshotTimestamp:Math.round(performance.now()-t),url:e.url(),viewportHeight:r.height,viewportWidth:r.width}}function dd(e){return"locator"in e}async function cd(e){return(await Promise.all(e.map(n=>pd(n)))).filter(n=>n!=null)}async function pd(e){if(!dd(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 it({node:e,page:t}){if(e.type==="assertUrl")return[{label:e.type,type:"urlBar"}];if(e.type==="drag"){let o=_({locator:e.source,page:t,variables:void 0}),a=_({locator:e.target,page:t,variables:void 0});return[{label:"drag-source",locator:o,type:"action"},{label:"drag-target",locator:a,type:"action"}]}if(!ud(e))return[];let n=e.type.startsWith("assert")?"assertion":"action",r=_({locator:e.locator,page:t,variables:void 0});return[{label:e.type,locator:r,type:n}]}function ud(e){return"locator"in e&&e.locator!=null}var qe=y(()=>{"use strict";be()});import{z as md}from"zod";function R({description:e,execute:t,name:n,schema:r}){let o=md.toJSONSchema(r,{target:"draft-2020-12"});return{anthropicTool:{description:e,input_schema:{...o,type:"object"},name:n},name:n,async execute(a,i){let l=r.parse(i);return{...await Promise.resolve(t(a,l)),kind:"action"}}}}async function L(e){let t=e.specNode==null?[]:it({node:e.specNode,page:e.page}),n=await de({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},a=r.length>0?r.map(i=>`${i.status}: ${i.description} \u2014 ${i.detail??""}`).join(`
6
6
  `):`${e.status}: ${e.title}`;return{specNode:e.specNode,stepResult:o,toolOutput:a}}var x=y(()=>{"use strict";qe()});import{z as fo}from"zod";var fd,yo,go=y(()=>{"use strict";x();fd=fo.object({selector:fo.string().describe("CSS selector for the checkbox or radio button")}),yo=R({description:"Assert that a checkbox or radio button is checked",name:"assert_checked",schema:fd,execute:async(e,t)=>{let n=performance.now(),r=await e.page.locator(t.selector).isChecked().catch(()=>!1),o=r?"passed":"failed",a=[{description:`Element ${t.selector} is checked`,detail:r?void 0:"Element is not checked",status:o}];return L({assertions:a,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 ho}from"zod";var yd,So,ko=y(()=>{"use strict";x();yd=ho.object({selector:ho.string().describe("CSS selector for the element to check focus on")}),So=R({description:"Assert that an element has keyboard focus. Use for accessibility tab-order testing.",name:"assert_focused",schema:yd,execute:async(e,t)=>{let n=performance.now(),o=!!await e.page.locator(t.selector).evaluate("(el) => document.activeElement === el").catch(()=>!1),a=o?"passed":"failed",i=[{description:`Element ${t.selector} is focused`,detail:o?void 0:"Element does not have focus",status:a}];return L({assertions:i,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:a,stepIndex:e.stepIndex,title:`Assert focused: ${t.selector}`})}})});import{z as en}from"zod";var gd,Ao,wo=y(()=>{"use strict";x();gd=en.object({expected:en.string().describe("The expected text content"),selector:en.string().describe("CSS selector for the element to check")}),Ao=R({description:"Assert that an element's text content matches the expected value",name:"assert_text",schema:gd,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),a=o?"passed":"failed",i=[{description:`Text contains "${t.expected}"`,detail:`Actual: "${r??"(not found)"}"`,status:a}];return L({assertions:i,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:a,stepIndex:e.stepIndex,title:`Assert text: ${t.selector}`})}})});import{z as tn}from"zod";function Sd({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 hd,Ro,No=y(()=>{"use strict";x();hd=tn.object({expected:tn.string().describe("Expected page title or substring"),operator:tn.enum(["equals","contains","startsWith","endsWith"]).describe("Comparison operator").default("contains")}),Ro=R({description:"Assert that the page title matches an expected value",name:"assert_title",schema:hd,execute:async(e,t)=>{let n=performance.now(),r=await e.page.title(),o=Sd({actual:r,expected:t.expected,operator:t.operator}),a=o?"passed":"failed",i=[{description:`Title ${t.operator} "${t.expected}"`,detail:o?void 0:`Got: "${r}"`,status:a}],l=`agent-step-${String(e.stepIndex)}`,s={expected:{type:"static",value:t.expected},id:l,operator:t.operator,type:"assertTitle"};return L({assertions:i,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:s,status:a,stepIndex:e.stepIndex,title:`Assert title ${t.operator} "${t.expected}"`})}})});import{z as To}from"zod";var kd,Lo,bo=y(()=>{"use strict";x();kd=To.object({selector:To.string().describe("CSS selector for the element to check")}),Lo=R({description:"Assert that an element matching the selector is visible on the page",name:"assert_visible",schema:kd,execute:async(e,t)=>{let n=performance.now(),r=await e.page.locator(t.selector).isVisible().catch(()=>!1),o=r?"passed":"failed",a=[{description:`Element ${t.selector} is visible`,detail:r?"Element is visible":"Element is not visible",status:o}];return L({assertions:a,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 Co}from"zod";var Ad,vo,xo=y(()=>{"use strict";x();Ad=Co.object({selector:Co.string().describe("CSS selector for the checkbox to check")}),vo=R({description:"Check a checkbox matching the CSS selector",name:"check",schema:Ad,execute:async(e,t)=>{let n=performance.now();return await e.page.locator(t.selector).check({timeout:5e3}),L({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 Po}from"zod";var wd,Eo,Oo=y(()=>{"use strict";x();wd=Po.object({selector:Po.string().describe("CSS selector for the input to clear")}),Eo=R({description:"Clear the contents of an input field",name:"clear",schema:wd,execute:async(e,t)=>{let n=performance.now();return await e.page.locator(t.selector).clear({timeout:5e3}),L({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 Uo}from"zod";var Rd,_o,Io=y(()=>{"use strict";x();Rd=Uo.object({selector:Uo.string().describe("CSS selector for the element to click")}),_o=R({description:"Click an element matching the CSS selector",name:"click",schema:Rd,execute:async(e,t)=>{let n=performance.now();return await e.page.locator(t.selector).click({timeout:5e3}),L({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 nn}from"zod";var Nd,jo,$o=y(()=>{"use strict";x();Nd=nn.object({action:nn.enum(["read","write"]).describe("Whether to read from or write to the clipboard"),value:nn.string().optional().describe("Text to write (required for write action)")}),jo=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:Nd,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 i=JSON.stringify(t.value);await e.page.evaluate(`navigator.clipboard.writeText(${i})`);let l={action:"write",id:r,type:"clipboard",value:{type:"static",value:t.value}};return L({assertions:[],detail:`Wrote to clipboard: "${t.value}"`,duration:performance.now()-n,nodeType:"clipboard",page:e.page,runStartTime:e.runStartTime,specNode:l,status:"passed",stepIndex:e.stepIndex,title:"Clipboard write"})}let o=String(await e.page.evaluate("navigator.clipboard.readText()")),a={action:"read",id:r,type:"clipboard"};return L({assertions:[],detail:`Clipboard contents: "${o}"`,duration:performance.now()-n,nodeType:"clipboard",page:e.page,runStartTime:e.runStartTime,specNode:a,status:"passed",stepIndex:e.stepIndex,title:"Clipboard read"})}})});import{z as st}from"zod";var Bo,Do,Vo=y(()=>{"use strict";Bo=st.object({summary:st.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:st.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.")}),Do={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:{...st.toJSONSchema(Bo,{target:"draft-2020-12"}),type:"object"},name:"complete_test"},name:"complete_test",execute(e,t){let n=Bo.parse(t),r={kind:"verdict",summary:n.summary,toolOutput:`Verdict: ${n.verdict}
7
7
  ${n.summary}`,verdict:n.verdict};return Promise.resolve(r)}}});import{z as Wo}from"zod";var Td,qo,Fo=y(()=>{"use strict";x();Td=Wo.object({selector:Wo.string().describe("CSS selector for the element to extract text from")}),qo=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:Td,execute:async(e,t)=>{let n=performance.now(),o=await e.page.locator(t.selector).textContent({timeout:5e3})??"";return L({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 rn}from"zod";var Ld,Mo,Jo=y(()=>{"use strict";x();Ld=rn.object({selector:rn.string().describe("CSS selector for the input element"),value:rn.string().describe("The text to type into the element")}),Mo=R({description:"Clear and type text into an input element matching the CSS selector",name:"fill",schema:Ld,execute:async(e,t)=>{let n=performance.now();return await e.page.locator(t.selector).fill(t.value,{timeout:5e3}),L({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 zo}from"zod";function Cd(e){let t=e.url.length>0?` (${e.url})`:"";return`[${e.level.toUpperCase()}] ${e.text}${t}`}var bd,Xo,Go=y(()=>{"use strict";x();bd=zo.object({level:zo.string().describe("Filter by log level: 'error', 'warning', 'log', 'info', 'debug', or 'all'").default("all")}),Xo=R({description:"Get console log messages from the browser. Optionally filter by level (error, warning, log, info, debug, all).",name:"get_console_logs",schema:bd,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=>Cd(o)).join(`
8
8
  `);return{specNode:void 0,stepResult:void 0,toolOutput:`${String(n.length)} console messages:
@@ -94,7 +94,7 @@ ${n}`].join(`
94
94
  }
95
95
  `)});async function On({appUrl:e}){try{await fetch(e,{method:"HEAD",signal:AbortSignal.timeout(_c)})}catch(t){let n=t instanceof Error?t.message:String(t);throw w.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(`
96
96
  `))}}var _c,Un=y(()=>{"use strict";M();_c=5e3});import Xe from"fs";import _n from"path";function Ge(e){let t=_n.join(e,".ripplo",".token");if(!Xe.existsSync(t))return null;let n=Xe.readFileSync(t,"utf8").trim();return n.length===0?null:n}function In(e,t){let n=_n.join(e,".ripplo");Xe.existsSync(n)||Xe.mkdirSync(n,{recursive:!0}),Xe.writeFileSync(_n.join(n,".token"),t+`
97
- `)}var mi=y(()=>{"use strict"});import{z as ge}from"zod";var jn,$n=y(()=>{"use strict";jn=ge.object({from:ge.string().min(1).describe("Key of the source state in the states record"),requiresKeys:ge.record(ge.string(),ge.string()).optional().describe("Maps workflow variable namespace to precondition name. Used by the runtime to namespace batch precondition data into dot-namespaced variables (e.g. { project: 'data:project' } maps projectId \u2192 project.projectId)."),to:ge.string().min(1).describe("Key of the target state in the states record"),workflow:ge.string().min(1).describe("Filename (without .json) of the workflow in .ripplo/workflows/ that executes this edge")}).describe("A directed edge between two states, executed by a workflow")});import{z as ve}from"zod";var Bn,Dn=y(()=>{"use strict";Bn=ve.object({depends:ve.array(ve.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:ve.string().min(1).describe("Human-readable description of what this precondition ensures"),returns:ve.array(ve.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 mt}from"zod";var Vn,Wn=y(()=>{"use strict";Vn=mt.object({preconditions:mt.array(mt.string().min(1)).describe("Ordered list of precondition names to satisfy before entering this state"),route:mt.string().min(1).describe("URL pattern with {{placeholders}} for dynamic segments, e.g. '/projects/{{projectId}}/settings'")}).describe("A distinct application state \u2014 a unique combination of location, auth context, and data conditions")});import{z as he}from"zod";var fi,qn=y(()=>{"use strict";$n();Dn();Wn();fi=he.object({edges:he.array(jn).describe("Directed edges between states, each executed by a workflow"),preconditions:he.record(he.string(),Bn).describe("Named preconditions keyed by name (e.g. 'auth:admin', 'data:three-projects'). States reference these by name."),states:he.record(he.string(),Vn).describe("States keyed by stable ID (kebab-case)"),version:he.literal(3).describe("Schema version, always 3")}).describe("Ripplo State Graph v3 \u2014 models application states, edges, and executable preconditions")});var yi=y(()=>{"use strict";qn()});import{z as pe}from"zod";var Ic,jc,v,Fn=y(()=>{"use strict";Ic=pe.object({by:pe.literal("testId"),value:pe.string().min(1)}),jc=pe.object({by:pe.literal("role"),name:pe.string().optional(),role:pe.string().min(1)}),v=pe.discriminatedUnion("by",[Ic,jc])});import{z as gi}from"zod";var ue,ft,Mn=y(()=>{"use strict";ue=gi.enum(["equals","notEquals","contains","startsWith","endsWith","matches"]),ft=gi.enum(["equals","notEquals","greaterThan","greaterThanOrEqual","lessThan","lessThanOrEqual"])});import{z as D}from"zod";var $c,Jn,yt,G,gt,zn=y(()=>{"use strict";$c=D.object({type:D.literal("static"),value:D.union([D.string(),D.number(),D.boolean()])}),Jn=D.object({name:D.string().min(1),type:D.literal("variable")}),yt=D.discriminatedUnion("type",[$c,Jn]),G=D.discriminatedUnion("type",[D.object({type:D.literal("static"),value:D.string()}),Jn]),gt=D.discriminatedUnion("type",[D.object({type:D.literal("static"),value:D.number().int().nonnegative()}),Jn])});import{z as H}from"zod";var ht,Xn=y(()=>{"use strict";ht=H.discriminatedUnion("type",[H.object({default:H.string().optional(),type:H.literal("string")}),H.object({default:H.number().optional(),type:H.literal("number")}),H.object({default:H.boolean().optional(),type:H.literal("boolean")}),H.object({key:H.string().min(1),type:H.literal("env")})])});import{z as f}from"zod";var b,Bc,Dc,Vc,Wc,qc,Fc,Mc,Jc,zc,Xc,Gc,Hc,Kc,Qc,Yc,Zc,ep,tp,np,rp,op,ap,ip,sp,lp,dp,cp,pp,up,mp,fp,yp,gp,hp,Sp,kp,Ap,hi,Gn,Hn=y(()=>{"use strict";Fn();Mn();zn();Xn();Fn();Mn();zn();Xn();b={comment:f.string().optional(),id:f.string().min(1),label:f.string().optional(),next:f.string().optional(),timeout:f.number().int().positive().optional()},Bc=f.object({...b,type:f.literal("goto"),url:G,waitForReady:f.boolean().optional()}),Dc=f.object({...b,locator:v,type:f.literal("click")}),Vc=f.object({...b,locator:v,type:f.literal("fill"),value:G}),Wc=f.object({...b,locator:v,type:f.literal("select"),value:G}),qc=f.object({...b,locator:v,type:f.literal("hover")}),Fc=f.object({...b,key:f.string().min(1),locator:v.optional(),type:f.literal("press")}),Mc=f.object({...b,locator:v,type:f.literal("check")}),Jc=f.object({...b,locator:v,type:f.literal("uncheck")}),zc=f.object({...b,height:f.number().int().positive(),type:f.literal("setViewport"),width:f.number().int().positive()}),Xc=f.object({...b,message:f.string().min(1),type:f.literal("fail")}),Gc=f.object({...b,type:f.literal("setVariable"),value:yt,variable:f.string().min(1)}),Hc=f.object({...b,locator:v,type:f.literal("extractText"),variable:f.string().min(1)}),Kc=f.object({...b,files:f.array(f.string()).min(1),locator:v,type:f.literal("upload")}),Qc=f.object({...b,locator:v,type:f.literal("dblclick")}),Yc=f.object({...b,source:v,target:v,type:f.literal("drag")}),Zc=f.object({...b,locator:v,type:f.literal("scrollIntoView")}),ep=f.object({...b,locator:v,type:f.literal("type"),value:G}),tp=f.object({...b,locator:v,type:f.literal("focus")}),np=f.object({...b,locator:v,type:f.literal("clear")}),rp=f.object({...b,locator:v,type:f.literal("rightClick")}),op=f.object({...b,action:f.enum(["accept","dismiss"]),promptText:f.string().optional(),type:f.literal("handleDialog")}),ap=f.object({...b,action:f.enum(["read","write"]),type:f.literal("clipboard"),value:G.optional(),variable:f.string().min(1).optional()}),ip=f.object({...b,permission:f.string().min(1),state:f.enum(["granted","prompt"]),type:f.literal("setPermission")}),sp=f.object({...b,locator:v,type:f.literal("assertVisible")}),lp=f.object({...b,locator:v,type:f.literal("assertNotVisible")}),dp=f.object({...b,expected:G,locator:v,operator:ue,type:f.literal("assertText")}),cp=f.object({...b,expected:G,operator:ue,type:f.literal("assertUrl")}),pp=f.object({...b,expected:gt,locator:v,operator:ft,type:f.literal("assertCount")}),up=f.object({...b,expected:G,locator:v,operator:ue,type:f.literal("assertValue")}),mp=f.object({...b,attribute:f.string().min(1),expected:G,locator:v,operator:ue,type:f.literal("assertAttribute")}),fp=f.object({...b,locator:v,type:f.literal("assertEnabled")}),yp=f.object({...b,locator:v,type:f.literal("assertDisabled")}),gp=f.object({...b,expected:G,operator:ue,type:f.literal("assertTitle")}),hp=f.object({...b,locator:v,type:f.literal("assertChecked")}),Sp=f.object({...b,locator:v,type:f.literal("assertNotChecked")}),kp=f.object({...b,locator:v,type:f.literal("assertFocused")}),Ap=f.object({...b,locator:v,type:f.literal("assertNotFocused")}),hi=f.discriminatedUnion("type",[Bc,Dc,Vc,Wc,qc,Fc,Mc,Jc,sp,lp,dp,cp,pp,up,mp,fp,yp,zc,Xc,Gc,Hc,Kc,Qc,Yc,Zc,ep,tp,np,rp,op,ap,ip,gp,hp,Sp,kp,Ap]),Gn=f.object({entryNode:f.string().min(1),nodes:f.record(f.string(),hi),variableNamespaces:f.record(f.string(),f.string()).optional(),variables:f.record(f.string(),ht).optional(),version:f.literal(2)})});function Kn(e){let t=Gn.safeParse(e);return t.success?{data:t.data,success:!0}:{errors:t.error.issues.map(n=>({message:n.message,path:n.path.join(".")})),success:!1}}var Si=y(()=>{"use strict";Hn()});var ki=y(()=>{"use strict";$n();qn();yi();Dn();Hn();Wn();Si()});async function Qn({failFast:e,onStep:t,page:n,spec:r,variables:o}){let a=performance.now();return Np({currentId:r.entryNode,failFast:e,onStep:t,page:n,runStartTime:a,spec:r,variables:o})}function Rp({onStep:e,steps:t,target:n}){t.forEach(r=>{let o={...r,stepIndex:n.length};n.push(o),e?.(o)})}async function Np({currentId:e,failFast:t,onStep:n,page:r,runStartTime:o,spec:a,variables:i}){let l=[],s=i,d=e;for(;d!=null;){let c=a.nodes[d];if(c==null)throw new Error(`Node "${d}" not found in spec`);let u=d,p=c.label??`${c.type} (${d})`;w.info("Executing node: %s [%s]",p,c.type);let m=await Tp({node:c,nodeId:u,page:r,runStartTime:o,variables:s});if(Rp({onStep:n,steps:[m],target:l}),s=m.variables,t&&m.status==="failed")break;d=c.next}return{steps:l,variables:s}}async function Tp({node:e,nodeId:t,page:n,runStartTime:r,variables:o}){let a=performance.now(),i=e.label??`${e.type} (${e.id})`,l=e.timeout??wp,s=it({node:e,page:n});try{let d=await Lp({node:e,page:n,timeout:l,variables:o}),c=Math.round(performance.now()-a),u=d.assertions.some(m=>m.status==="failed"),p=await q({label:`Snapshot [${i}]`,fn:()=>de({page:n,runStartTime:r,targets:s})});return{annotations:p.annotations,assertions:d.assertions,detail:void 0,duration:c,nodeId:t,nodeType:e.type,screenshotBase64:p.screenshotBase64,snapshotTimestamp:p.snapshotTimestamp,status:u?"failed":"passed",stepIndex:0,title:i,url:p.url,variables:d.variables,viewportHeight:p.viewportHeight,viewportWidth:p.viewportWidth}}catch(d){let c=Math.round(performance.now()-a),u=d instanceof Error?d.message:String(d),p=await q({label:`Snapshot [${i}] (error)`,fn:()=>de({page:n,runStartTime:r,targets:s})});return{annotations:p.annotations,assertions:[],detail:u,duration:c,nodeId:t,nodeType:e.type,screenshotBase64:p.screenshotBase64,snapshotTimestamp:p.snapshotTimestamp,status:"failed",stepIndex:0,title:i,url:p.url,variables:o,viewportHeight:p.viewportHeight,viewportWidth:p.viewportWidth}}}async function Lp({node:e,page:t,timeout:n,variables:r}){if(bp(e)){let a=await Yt({node:e,page:t,timeout:n,variables:r});return{assertions:[],variables:a.variables}}return{assertions:await vp({node:e,page:t,timeout:n,variables:r}),variables:r}}function bp(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 Cp(e){return e.type.startsWith("assert")}async function vp({node:e,page:t,timeout:n,variables:r}){if(!Cp(e))throw new Error(`Unknown node type: ${e.type}`);let o=e;switch(o.type){case"assertVisible":case"assertNotVisible":case"assertEnabled":case"assertDisabled":case"assertChecked":case"assertNotChecked":case"assertFocused":case"assertNotFocused":return Pp({assertNode:o,page:t,timeout:n,variables:r});case"assertText":{let a=J({ref:o.expected,variables:r});return[await Tn({expected:a,locator:_({locator:o.locator,page:t,variables:r}),operator:o.operator,timeout:n})]}case"assertUrl":{let a=J({ref:o.expected,variables:r});return[ut({expected:a,operator:o.operator,url:t.url()})]}case"assertTitle":{let a=J({ref:o.expected,variables:r});return[ut({expected:a,operator:o.operator,url:await t.title()})]}case"assertCount":{let a=Qt({ref:o.expected,variables:r});return[await Ln({expected:a,locator:_({locator:o.locator,page:t,variables:r}),operator:o.operator})]}case"assertValue":{let a=J({ref:o.expected,variables:r});return[await bn({expected:a,locator:_({locator:o.locator,page:t,variables:r}),operator:o.operator,timeout:n})]}case"assertAttribute":{let a=J({ref:o.expected,variables:r});return[await ei({attribute:o.attribute,expected:a,locator:_({locator:o.locator,page:t,variables:r}),operator:o.operator,timeout:n})]}}}async function Pp({assertNode:e,page:t,timeout:n,variables:r}){let o=xp[e.type];return[await o({locator:_({locator:e.locator,page:t,variables:r}),timeout:n})]}var wp,xp,Yn=y(()=>{"use strict";Zt();xn();be();M();Ce();qe();le();wp=1e4;xp={assertChecked:ri,assertDisabled:ni,assertEnabled:ti,assertFocused:ai,assertNotChecked:oi,assertNotFocused:ii,assertNotVisible:vn,assertVisible:Cn}});async function Zn({baseUrl:e,browser:t,cookies:n,extraVariables:r,onStep:o,runId:a,spec:i}){let l=await t.newContext({baseURL:e});w.info("Browser context created"),n.length>0&&await l.addCookies(n);let s=await l.newPage();w.info("Page created");let d=Fe(s),c=[];function u(S){o?.(S),c.push(dt({context:l,page:s,runId:a,stepIndex:S.stepIndex,stepResult:S}))}let p=Ep(r,i.variableNamespaces),m={...Ve({defs:i.variables}),...p};w.info("Starting graph execution (entry: %s)",i.entryNode);let g=await Qn({failFast:!0,onStep:u,page:s,spec:i,variables:m});await Promise.allSettled(c);let k=g.steps.filter(S=>S.status==="passed").length,h=g.steps.filter(S=>S.status==="failed").length,A={duration:g.steps.reduce((S,N)=>S+N.duration,0),failCount:h,passCount:k,runId:a,status:h>0?"failed":"passed",workflowName:""};return await ct({monitor:d,runId:a,steps:g.steps,summary:A}),await l.close(),g.steps}function Ep(e,t){if(e==null||t==null)return{};let n=new Map;Object.entries(t).forEach(([o,a])=>{n.set(a,o)});let r={};return Object.entries(e).forEach(([o,a])=>{let i=n.get(o);i!=null&&(r[i]={...r[i],...a})}),r}var er=y(()=>{"use strict";cn();pt();Yn();M();le()});var wi=rt(St=>{"use strict";Object.defineProperty(St,"__esModule",{value:!0});St.timingSafeEqual=void 0;function Ai(e,t=""){if(!e)throw new Error(t)}function Op(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)),Ai(e instanceof DataView),Ai(t instanceof DataView);let n=e.byteLength,r=0,o=-1;for(;++o<n;)r|=e.getUint8(o)^t.getUint8(o);return r===0}St.timingSafeEqual=Op});var Ti=rt(K=>{"use strict";var Up=K&&K.__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 a in o)o.hasOwnProperty(a)&&(r[a]=o[a])},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(K,"__esModule",{value:!0});var j=256,tr=(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 a=t.length-r;if(a>0){var o=t[r]<<16|(a===2?t[r+1]<<8:0);n+=this._encodeByte(o>>>18&63),n+=this._encodeByte(o>>>12&63),a===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)),a=0,i=0,l=0,s=0,d=0,c=0,u=0;i<r-4;i+=4)s=this._decodeChar(t.charCodeAt(i+0)),d=this._decodeChar(t.charCodeAt(i+1)),c=this._decodeChar(t.charCodeAt(i+2)),u=this._decodeChar(t.charCodeAt(i+3)),o[a++]=s<<2|d>>>4,o[a++]=d<<4|c>>>2,o[a++]=c<<6|u,l|=s&j,l|=d&j,l|=c&j,l|=u&j;if(i<r-1&&(s=this._decodeChar(t.charCodeAt(i)),d=this._decodeChar(t.charCodeAt(i+1)),o[a++]=s<<2|d>>>4,l|=s&j,l|=d&j),i<r-2&&(c=this._decodeChar(t.charCodeAt(i+2)),o[a++]=d<<4|c>>>2,l|=c&j),i<r-3&&(u=this._decodeChar(t.charCodeAt(i+3)),o[a++]=c<<6|u,l|=u&j),l!==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=j;return n+=(42-t&t-44)>>>8&-j+t-43+62,n+=(46-t&t-48)>>>8&-j+t-47+63,n+=(47-t&t-58)>>>8&-j+t-48+52,n+=(64-t&t-91)>>>8&-j+t-65+0,n+=(96-t&t-123)>>>8&-j+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})();K.Coder=tr;var He=new tr;function _p(e){return He.encode(e)}K.encode=_p;function Ip(e){return He.decode(e)}K.decode=Ip;var Ri=(function(e){Up(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=j;return r+=(44-n&n-46)>>>8&-j+n-45+62,r+=(94-n&n-96)>>>8&-j+n-95+63,r+=(47-n&n-58)>>>8&-j+n-48+52,r+=(64-n&n-91)>>>8&-j+n-65+0,r+=(96-n&n-123)>>>8&-j+n-97+26,r},t})(tr);K.URLSafeCoder=Ri;var Ni=new Ri;function jp(e){return Ni.encode(e)}K.encodeURLSafe=jp;function $p(e){return Ni.decode(e)}K.decodeURLSafe=$p;K.encodedLength=function(e){return He.encodedLength(e)};K.maxDecodedLength=function(e){return He.maxDecodedLength(e)};K.decodedLength=function(e){return He.decodedLength(e)}});var bi=rt((Li,kt)=>{"use strict";(function(e,t){var n={};t(n);var r=n.default;for(var o in n)r[o]=n[o];typeof kt=="object"&&typeof kt.exports=="object"?kt.exports=r:typeof define=="function"&&define.amd?define(function(){return r}):e.sha256=r})(Li,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,g,k){for(var h,A,S,N,C,T,O,I,P,B,je,$e,nt;k>=64;){for(h=p[0],A=p[1],S=p[2],N=p[3],C=p[4],T=p[5],O=p[6],I=p[7],B=0;B<16;B++)je=g+B*4,u[B]=(m[je]&255)<<24|(m[je+1]&255)<<16|(m[je+2]&255)<<8|m[je+3]&255;for(B=16;B<64;B++)P=u[B-2],$e=(P>>>17|P<<15)^(P>>>19|P<<13)^P>>>10,P=u[B-15],nt=(P>>>7|P<<25)^(P>>>18|P<<14)^P>>>3,u[B]=($e+u[B-7]|0)+(nt+u[B-16]|0);for(B=0;B<64;B++)$e=(((C>>>6|C<<26)^(C>>>11|C<<21)^(C>>>25|C<<7))+(C&T^~C&O)|0)+(I+(t[B]+u[B]|0)|0)|0,nt=((h>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10))+(h&A^h&S^A&S)|0,I=O,O=T,T=C,C=N+$e|0,N=S,S=A,A=h,h=$e+nt|0;p[0]+=h,p[1]+=A,p[2]+=S,p[3]+=N,p[4]+=C,p[5]+=T,p[6]+=O,p[7]+=I,g+=64,k-=64}return g}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 g=0;if(this.bytesHashed+=m,this.bufferLength>0){for(;this.bufferLength<64&&m>0;)this.buffer[this.bufferLength++]=p[g++],m--;this.bufferLength===64&&(n(this.temp,this.state,this.buffer,0,64),this.bufferLength=0)}for(m>=64&&(g=n(this.temp,this.state,p,g,m),m%=64);m>0;)this.buffer[this.bufferLength++]=p[g++],m--;return this},u.prototype.finish=function(p){if(!this.finished){var m=this.bytesHashed,g=this.bufferLength,k=m/536870912|0,h=m<<3,A=m%64<56?64:128;this.buffer[g]=128;for(var S=g+1;S<A-8;S++)this.buffer[S]=0;this.buffer[A-8]=k>>>24&255,this.buffer[A-7]=k>>>16&255,this.buffer[A-6]=k>>>8&255,this.buffer[A-5]=k>>>0&255,this.buffer[A-4]=h>>>24&255,this.buffer[A-3]=h>>>16&255,this.buffer[A-2]=h>>>8&255,this.buffer[A-1]=h>>>0&255,n(this.temp,this.state,this.buffer,0,A),this.finished=!0}for(var S=0;S<8;S++)p[S*4+0]=this.state[S]>>>24&255,p[S*4+1]=this.state[S]>>>16&255,p[S*4+2]=this.state[S]>>>8&255,p[S*4+3]=this.state[S]>>>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 g=0;g<this.state.length;g++)this.state[g]=p[g];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 g=0;g<p.length;g++)m[g]=p[g];for(var g=0;g<m.length;g++)m[g]^=54;this.inner.update(m);for(var g=0;g<m.length;g++)m[g]^=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 g=0;g<m.length;g++)m[g]=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 a(u){var p=new r().update(u),m=p.digest();return p.clean(),m}e.hash=a,e.default=a;function i(u,p){var m=new o(u).update(p),g=m.digest();return m.clean(),g}e.hmac=i;function l(u,p,m,g){var k=g[0];if(k===0)throw new Error("hkdf: cannot expand more");p.reset(),k>1&&p.update(u),m&&p.update(m),p.update(g),p.finish(u),g[0]++}var s=new Uint8Array(e.digestLength);function d(u,p,m,g){p===void 0&&(p=s),g===void 0&&(g=32);for(var k=new Uint8Array([1]),h=i(p,u),A=new o(h),S=new Uint8Array(A.digestLength),N=S.length,C=new Uint8Array(g),T=0;T<g;T++)N===S.length&&(l(S,A,m,k),N=0),C[T]=S[N++];return A.clean(),S.fill(0),k.fill(0),C}e.hkdf=d;function c(u,p,m,g){for(var k=new o(u),h=k.digestLength,A=new Uint8Array(4),S=new Uint8Array(h),N=new Uint8Array(h),C=new Uint8Array(g),T=0;T*h<g;T++){var O=T+1;A[0]=O>>>24&255,A[1]=O>>>16&255,A[2]=O>>>8&255,A[3]=O>>>0&255,k.reset(),k.update(p),k.update(A),k.finish(N);for(var I=0;I<h;I++)S[I]=N[I];for(var I=2;I<=m;I++){k.reset(),k.update(N).finish(N);for(var P=0;P<h;P++)S[P]^=N[P]}for(var I=0;I<h&&T*h+I<g;I++)C[T*h+I]=S[I]}for(var T=0;T<h;T++)S[T]=N[T]=0;for(var T=0;T<4;T++)A[T]=0;return k.clean(),C}e.pbkdf2=c})});var rr=rt(xe=>{"use strict";Object.defineProperty(xe,"__esModule",{value:!0});xe.Webhook=xe.WebhookVerificationError=void 0;var Bp=wi(),Ci=Ti(),Dp=bi(),vi=300,nr=class e extends Error{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype),this.name="ExtendableError",this.stack=new Error(t).stack}},me=class e extends nr{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype),this.name="WebhookVerificationError"}};xe.WebhookVerificationError=me;var At=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=Ci.decode(t)}}verify(t,n){let r={};for(let p of Object.keys(n))r[p.toLowerCase()]=n[p];let o=r["webhook-id"],a=r["webhook-signature"],i=r["webhook-timestamp"];if(!a||!o||!i)throw new me("Missing required headers");let l=this.verifyTimestamp(i),d=this.sign(o,l,t).split(",")[1],c=a.split(" "),u=new globalThis.TextEncoder;for(let p of c){let[m,g]=p.split(",");if(m==="v1"&&(0,Bp.timingSafeEqual)(u.encode(g),u.encode(d)))return JSON.parse(t.toString())}throw new me("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,a=Math.floor(n.getTime()/1e3),i=o.encode(`${t}.${a}.${r}`);return`v1,${Ci.encode(Dp.hmac(this.key,i))}`}verifyTimestamp(t){let n=Math.floor(Date.now()/1e3),r=parseInt(t,10);if(isNaN(r))throw new me("Invalid Signature Headers");if(n-r>vi)throw new me("Message timestamp too old");if(r>n+vi)throw new me("Message timestamp too new");return new Date(r*1e3)}};xe.Webhook=At;At.prefix="whsec_"});import xi from"crypto";function or({body:e,secret:t}){let n=new Pi.Webhook(t),r=`msg_${xi.randomUUID()}`,o=new Date,a=n.sign(r,o,e),i=Math.floor(o.getTime()/1e3);return{"webhook-id":r,"webhook-signature":a,"webhook-timestamp":String(i)}}function ar(){return`whsec_${xi.randomBytes(24).toString("base64")}`}var Pi,ir=y(()=>{"use strict";Pi=Mr(rr(),1)});import{parseSetCookie as Vp}from"set-cookie-parser";import{z as te}from"zod";async function sr({baseUrl:e,project:t,webhookSecret:n,workflowSlug:r}){let o={apiUrl:void 0,cookies:[],data:{},executed:[]},a=t.stateGraph;if(a==null)return o;let i=(a.edges??[]).find(d=>d.workflowSlug===r);if(i?.sourceState==null)return o;let l=Ui({baseUrl:e,preconditionApiPath:t.preconditionApiPath}),s=i.sourceState.preconditions;return s.length===0?{...o,apiUrl:l}:l==null?o:Oi({apiUrl:l,preconditionNames:s,webhookSecret:n})}async function lr({apiUrl:e,cookies:t,data:n,executed:r,webhookSecret:o}){if(r.length!==0)try{let a=JSON.stringify({data:n,preconditions:r}),i=await fetch(`${e}/teardown`,{body:a,headers:{"Content-Type":"application/json",...qp({cookies:t}),...or({body:a,secret:o})},method:"PUT",signal:AbortSignal.timeout(Ei)});i.ok||w.error("Teardown returned %s",String(i.status))}catch{w.error("Teardown request failed")}}async function Oi({apiUrl:e,preconditionNames:t,webhookSecret:n}){let r=performance.now(),o=JSON.stringify({preconditions:t}),a=await fetch(`${e}/execute-batch`,{body:o,headers:{"Content-Type":"application/json",...or({body:o,secret:n})},method:"PUT",signal:AbortSignal.timeout(Ei)});if(!a.ok)throw new Error(`execute-batch returned ${String(a.status)}`);let i=await a.json(),l=Wp.safeParse(i);if(!l.success)throw new Error(`execute-batch response has invalid shape: ${l.error.message}`);if(!l.data.success){let d=l.data.error??"no error detail";throw new Error(`Precondition batch failed: ${d}`)}let s=Fp({domain:new URL(e).hostname,res:a});return w.info("Preconditions resolved: %s (%dms)",l.data.executed.join(", "),Math.round(performance.now()-r)),{apiUrl:e,cookies:s,data:l.data.data,executed:l.data.executed}}function qp({cookies:e}){return e.length===0?{}:{Cookie:e.map(n=>`${n.name}=${n.value}`).join("; ")}}function Fp({domain:e,res:t}){let n=t.headers.getSetCookie();return Vp(n,{decodeValues:!1}).map(o=>Mp({cookie:o,domain:e}))}function Mp({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=zp({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 zp({raw:e}){return Jp[e.toLowerCase()]??"Lax"}async function dr({baseUrl:e,preconditionApiPath:t,preconditionNames:n,webhookSecret:r}){let o=Ui({baseUrl:e,preconditionApiPath:t});return o==null||n.length===0?{apiUrl:o,cookies:[],data:{},executed:[]}:Oi({apiUrl:o,preconditionNames:n,webhookSecret:r})}function Ui({baseUrl:e,preconditionApiPath:t}){if(t.length!==0)return t.startsWith("http://")||t.startsWith("https://")?t:`${e}${t}`}var Ei,Wp,Jp,cr=y(()=>{"use strict";M();ir();Ei=3e4,Wp=te.object({data:te.record(te.string(),te.record(te.string(),te.string())),error:te.string().optional(),executed:te.array(te.string()),runId:te.string(),success:te.boolean()});Jp={lax:"Lax",none:"None",strict:"Strict"}});import{graphql as pr}from"gql.tada";async function ur({agentProfileId:e,config:t,runId:n}){let r=await $({config:t,document:Gp,variables:{agentProfileId:e??null,platform:"chromium",runId:n}});if(r.startRun==null)throw new Error("Failed to start run");let o=r.startRun.id,a=[];function i(d){let c=Xp({config:t,runResultId:o,steps:[d]}).catch(u=>{w.error(u,"Failed to submit step %d",d.stepIndex)});a.push(c)}async function l(){await Promise.all(a)}async function s({statusOverride:d,steps:c,summary:u}){await q({label:`flushSteps (${String(a.length)} steps)`,fn:()=>Promise.all(a)});let p=c.filter(h=>h.status==="passed").length,m=c.filter(h=>h.status==="failed").length,g=c.reduce((h,A)=>h+A.duration,0),k=d??(m>0?"failed":"passed");await q({label:"completeRun",fn:()=>$({config:t,document:Kp,variables:{duration:g,failCount:m,passCount:p,runResultId:o,status:k,summary:u??null,warnCount:0}})})}return{complete:s,enqueueStep:i,flushSteps:l,runResultId:o}}async function Xp({config:e,runResultId:t,steps:n}){let r=n.map(o=>({annotations:o.annotations.map(a=>({height:a.height,label:a.label,type:a.type,width:a.width,x:a.x,y:a.y})),assertions:o.assertions.map(a=>({description:a.description,detail:a.detail,status:a.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:Hp,variables:{runResultId:t,steps:r}})}var Gp,Hp,Kp,mr=y(()=>{"use strict";ze();M();Ce();Gp=pr(`
97
+ `)}var mi=y(()=>{"use strict"});import{z as ge}from"zod";var jn,$n=y(()=>{"use strict";jn=ge.object({from:ge.string().min(1).describe("Key of the source state in the states record"),requiresKeys:ge.record(ge.string(),ge.string()).optional().describe("Maps workflow variable namespace to precondition name. Used by the runtime to namespace batch precondition data into dot-namespaced variables (e.g. { project: 'data:project' } maps projectId \u2192 project.projectId)."),to:ge.string().min(1).describe("Key of the target state in the states record"),workflow:ge.string().min(1).describe("Filename (without .json) of the workflow in .ripplo/workflows/ that executes this edge")}).describe("A directed edge between two states, executed by a workflow")});import{z as ve}from"zod";var Bn,Dn=y(()=>{"use strict";Bn=ve.object({depends:ve.array(ve.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:ve.string().min(1).describe("Human-readable description of what this precondition ensures"),returns:ve.array(ve.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 mt}from"zod";var Vn,Wn=y(()=>{"use strict";Vn=mt.object({preconditions:mt.array(mt.string().min(1)).describe("Ordered list of precondition names to satisfy before entering this state"),route:mt.string().min(1).describe("URL pattern with {{placeholders}} for dynamic segments, e.g. '/projects/{{projectId}}/settings'")}).describe("A distinct application state \u2014 a unique combination of location, auth context, and data conditions")});import{z as he}from"zod";var fi,qn=y(()=>{"use strict";$n();Dn();Wn();fi=he.object({edges:he.array(jn).describe("Directed edges between states, each executed by a workflow"),preconditions:he.record(he.string(),Bn).describe("Named preconditions keyed by name (e.g. 'auth:admin', 'data:three-projects'). States reference these by name."),states:he.record(he.string(),Vn).describe("States keyed by stable ID (kebab-case)"),version:he.literal(3).describe("Schema version, always 3")}).describe("Ripplo State Graph v3 \u2014 models application states, edges, and executable preconditions")});var yi=y(()=>{"use strict";qn()});import{z as pe}from"zod";var Ic,jc,v,Fn=y(()=>{"use strict";Ic=pe.object({by:pe.literal("testId"),value:pe.string().min(1)}),jc=pe.object({by:pe.literal("role"),name:pe.string().optional(),role:pe.string().min(1)}),v=pe.discriminatedUnion("by",[Ic,jc])});import{z as gi}from"zod";var ue,ft,Mn=y(()=>{"use strict";ue=gi.enum(["equals","notEquals","contains","startsWith","endsWith","matches"]),ft=gi.enum(["equals","notEquals","greaterThan","greaterThanOrEqual","lessThan","lessThanOrEqual"])});import{z as D}from"zod";var $c,Jn,yt,G,gt,zn=y(()=>{"use strict";$c=D.object({type:D.literal("static"),value:D.union([D.string(),D.number(),D.boolean()])}),Jn=D.object({name:D.string().min(1),type:D.literal("variable")}),yt=D.discriminatedUnion("type",[$c,Jn]),G=D.discriminatedUnion("type",[D.object({type:D.literal("static"),value:D.string()}),Jn]),gt=D.discriminatedUnion("type",[D.object({type:D.literal("static"),value:D.number().int().nonnegative()}),Jn])});import{z as H}from"zod";var ht,Xn=y(()=>{"use strict";ht=H.discriminatedUnion("type",[H.object({default:H.string().optional(),type:H.literal("string")}),H.object({default:H.number().optional(),type:H.literal("number")}),H.object({default:H.boolean().optional(),type:H.literal("boolean")}),H.object({key:H.string().min(1),type:H.literal("env")})])});import{z as f}from"zod";var b,Bc,Dc,Vc,Wc,qc,Fc,Mc,Jc,zc,Xc,Gc,Hc,Kc,Qc,Yc,Zc,ep,tp,np,rp,op,ap,ip,sp,lp,dp,cp,pp,up,mp,fp,yp,gp,hp,Sp,kp,Ap,hi,Gn,Hn=y(()=>{"use strict";Fn();Mn();zn();Xn();Fn();Mn();zn();Xn();b={comment:f.string().optional(),id:f.string().min(1),label:f.string().optional(),next:f.string().optional(),timeout:f.number().int().positive().optional()},Bc=f.object({...b,type:f.literal("goto"),url:G}),Dc=f.object({...b,locator:v,type:f.literal("click")}),Vc=f.object({...b,locator:v,type:f.literal("fill"),value:G}),Wc=f.object({...b,locator:v,type:f.literal("select"),value:G}),qc=f.object({...b,locator:v,type:f.literal("hover")}),Fc=f.object({...b,key:f.string().min(1),locator:v.optional(),type:f.literal("press")}),Mc=f.object({...b,locator:v,type:f.literal("check")}),Jc=f.object({...b,locator:v,type:f.literal("uncheck")}),zc=f.object({...b,height:f.number().int().positive(),type:f.literal("setViewport"),width:f.number().int().positive()}),Xc=f.object({...b,message:f.string().min(1),type:f.literal("fail")}),Gc=f.object({...b,type:f.literal("setVariable"),value:yt,variable:f.string().min(1)}),Hc=f.object({...b,locator:v,type:f.literal("extractText"),variable:f.string().min(1)}),Kc=f.object({...b,files:f.array(f.string()).min(1),locator:v,type:f.literal("upload")}),Qc=f.object({...b,locator:v,type:f.literal("dblclick")}),Yc=f.object({...b,source:v,target:v,type:f.literal("drag")}),Zc=f.object({...b,locator:v,type:f.literal("scrollIntoView")}),ep=f.object({...b,locator:v,type:f.literal("type"),value:G}),tp=f.object({...b,locator:v,type:f.literal("focus")}),np=f.object({...b,locator:v,type:f.literal("clear")}),rp=f.object({...b,locator:v,type:f.literal("rightClick")}),op=f.object({...b,action:f.enum(["accept","dismiss"]),promptText:f.string().optional(),type:f.literal("handleDialog")}),ap=f.object({...b,action:f.enum(["read","write"]),type:f.literal("clipboard"),value:G.optional(),variable:f.string().min(1).optional()}),ip=f.object({...b,permission:f.string().min(1),state:f.enum(["granted","prompt"]),type:f.literal("setPermission")}),sp=f.object({...b,locator:v,type:f.literal("assertVisible")}),lp=f.object({...b,locator:v,type:f.literal("assertNotVisible")}),dp=f.object({...b,expected:G,locator:v,operator:ue,type:f.literal("assertText")}),cp=f.object({...b,expected:G,operator:ue,type:f.literal("assertUrl")}),pp=f.object({...b,expected:gt,locator:v,operator:ft,type:f.literal("assertCount")}),up=f.object({...b,expected:G,locator:v,operator:ue,type:f.literal("assertValue")}),mp=f.object({...b,attribute:f.string().min(1),expected:G,locator:v,operator:ue,type:f.literal("assertAttribute")}),fp=f.object({...b,locator:v,type:f.literal("assertEnabled")}),yp=f.object({...b,locator:v,type:f.literal("assertDisabled")}),gp=f.object({...b,expected:G,operator:ue,type:f.literal("assertTitle")}),hp=f.object({...b,locator:v,type:f.literal("assertChecked")}),Sp=f.object({...b,locator:v,type:f.literal("assertNotChecked")}),kp=f.object({...b,locator:v,type:f.literal("assertFocused")}),Ap=f.object({...b,locator:v,type:f.literal("assertNotFocused")}),hi=f.discriminatedUnion("type",[Bc,Dc,Vc,Wc,qc,Fc,Mc,Jc,sp,lp,dp,cp,pp,up,mp,fp,yp,zc,Xc,Gc,Hc,Kc,Qc,Yc,Zc,ep,tp,np,rp,op,ap,ip,gp,hp,Sp,kp,Ap]),Gn=f.object({entryNode:f.string().min(1),nodes:f.record(f.string(),hi),variableNamespaces:f.record(f.string(),f.string()).optional(),variables:f.record(f.string(),ht).optional(),version:f.literal(2)})});function Kn(e){let t=Gn.safeParse(e);return t.success?{data:t.data,success:!0}:{errors:t.error.issues.map(n=>({message:n.message,path:n.path.join(".")})),success:!1}}var Si=y(()=>{"use strict";Hn()});var ki=y(()=>{"use strict";$n();qn();yi();Dn();Hn();Wn();Si()});async function Qn({failFast:e,onStep:t,page:n,spec:r,variables:o}){let a=performance.now();return Np({currentId:r.entryNode,failFast:e,onStep:t,page:n,runStartTime:a,spec:r,variables:o})}function Rp({onStep:e,steps:t,target:n}){t.forEach(r=>{let o={...r,stepIndex:n.length};n.push(o),e?.(o)})}async function Np({currentId:e,failFast:t,onStep:n,page:r,runStartTime:o,spec:a,variables:i}){let l=[],s=i,d=e;for(;d!=null;){let c=a.nodes[d];if(c==null)throw new Error(`Node "${d}" not found in spec`);let u=d,p=c.label??`${c.type} (${d})`;w.info("Executing node: %s [%s]",p,c.type);let m=await Tp({node:c,nodeId:u,page:r,runStartTime:o,variables:s});if(Rp({onStep:n,steps:[m],target:l}),s=m.variables,t&&m.status==="failed")break;d=c.next}return{steps:l,variables:s}}async function Tp({node:e,nodeId:t,page:n,runStartTime:r,variables:o}){let a=performance.now(),i=e.label??`${e.type} (${e.id})`,l=e.timeout??wp,s=it({node:e,page:n});try{let d=await Lp({node:e,page:n,timeout:l,variables:o}),c=Math.round(performance.now()-a),u=d.assertions.some(m=>m.status==="failed"),p=await q({label:`Snapshot [${i}]`,fn:()=>de({page:n,runStartTime:r,targets:s})});return{annotations:p.annotations,assertions:d.assertions,detail:void 0,duration:c,nodeId:t,nodeType:e.type,screenshotBase64:p.screenshotBase64,snapshotTimestamp:p.snapshotTimestamp,status:u?"failed":"passed",stepIndex:0,title:i,url:p.url,variables:d.variables,viewportHeight:p.viewportHeight,viewportWidth:p.viewportWidth}}catch(d){let c=Math.round(performance.now()-a),u=d instanceof Error?d.message:String(d),p=await q({label:`Snapshot [${i}] (error)`,fn:()=>de({page:n,runStartTime:r,targets:s})});return{annotations:p.annotations,assertions:[],detail:u,duration:c,nodeId:t,nodeType:e.type,screenshotBase64:p.screenshotBase64,snapshotTimestamp:p.snapshotTimestamp,status:"failed",stepIndex:0,title:i,url:p.url,variables:o,viewportHeight:p.viewportHeight,viewportWidth:p.viewportWidth}}}async function Lp({node:e,page:t,timeout:n,variables:r}){if(bp(e)){let a=await Yt({node:e,page:t,timeout:n,variables:r});return{assertions:[],variables:a.variables}}return{assertions:await vp({node:e,page:t,timeout:n,variables:r}),variables:r}}function bp(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 Cp(e){return e.type.startsWith("assert")}async function vp({node:e,page:t,timeout:n,variables:r}){if(!Cp(e))throw new Error(`Unknown node type: ${e.type}`);let o=e;switch(o.type){case"assertVisible":case"assertNotVisible":case"assertEnabled":case"assertDisabled":case"assertChecked":case"assertNotChecked":case"assertFocused":case"assertNotFocused":return Pp({assertNode:o,page:t,timeout:n,variables:r});case"assertText":{let a=J({ref:o.expected,variables:r});return[await Tn({expected:a,locator:_({locator:o.locator,page:t,variables:r}),operator:o.operator,timeout:n})]}case"assertUrl":{let a=J({ref:o.expected,variables:r});return[ut({expected:a,operator:o.operator,url:t.url()})]}case"assertTitle":{let a=J({ref:o.expected,variables:r});return[ut({expected:a,operator:o.operator,url:await t.title()})]}case"assertCount":{let a=Qt({ref:o.expected,variables:r});return[await Ln({expected:a,locator:_({locator:o.locator,page:t,variables:r}),operator:o.operator})]}case"assertValue":{let a=J({ref:o.expected,variables:r});return[await bn({expected:a,locator:_({locator:o.locator,page:t,variables:r}),operator:o.operator,timeout:n})]}case"assertAttribute":{let a=J({ref:o.expected,variables:r});return[await ei({attribute:o.attribute,expected:a,locator:_({locator:o.locator,page:t,variables:r}),operator:o.operator,timeout:n})]}}}async function Pp({assertNode:e,page:t,timeout:n,variables:r}){let o=xp[e.type];return[await o({locator:_({locator:e.locator,page:t,variables:r}),timeout:n})]}var wp,xp,Yn=y(()=>{"use strict";Zt();xn();be();M();Ce();qe();le();wp=1e4;xp={assertChecked:ri,assertDisabled:ni,assertEnabled:ti,assertFocused:ai,assertNotChecked:oi,assertNotFocused:ii,assertNotVisible:vn,assertVisible:Cn}});async function Zn({baseUrl:e,browser:t,cookies:n,extraVariables:r,onStep:o,runId:a,spec:i}){let l=await t.newContext({baseURL:e});w.info("Browser context created"),n.length>0&&await l.addCookies(n);let s=await l.newPage();w.info("Page created");let d=Fe(s),c=[];function u(S){o?.(S),c.push(dt({context:l,page:s,runId:a,stepIndex:S.stepIndex,stepResult:S}))}let p=Ep(r,i.variableNamespaces),m={...Ve({defs:i.variables}),...p};w.info("Starting graph execution (entry: %s)",i.entryNode);let g=await Qn({failFast:!0,onStep:u,page:s,spec:i,variables:m});await Promise.allSettled(c);let k=g.steps.filter(S=>S.status==="passed").length,h=g.steps.filter(S=>S.status==="failed").length,A={duration:g.steps.reduce((S,N)=>S+N.duration,0),failCount:h,passCount:k,runId:a,status:h>0?"failed":"passed",workflowName:""};return await ct({monitor:d,runId:a,steps:g.steps,summary:A}),await l.close(),g.steps}function Ep(e,t){if(e==null||t==null)return{};let n=new Map;Object.entries(t).forEach(([o,a])=>{n.set(a,o)});let r={};return Object.entries(e).forEach(([o,a])=>{let i=n.get(o);i!=null&&(r[i]={...r[i],...a})}),r}var er=y(()=>{"use strict";cn();pt();Yn();M();le()});var wi=rt(St=>{"use strict";Object.defineProperty(St,"__esModule",{value:!0});St.timingSafeEqual=void 0;function Ai(e,t=""){if(!e)throw new Error(t)}function Op(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)),Ai(e instanceof DataView),Ai(t instanceof DataView);let n=e.byteLength,r=0,o=-1;for(;++o<n;)r|=e.getUint8(o)^t.getUint8(o);return r===0}St.timingSafeEqual=Op});var Ti=rt(K=>{"use strict";var Up=K&&K.__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 a in o)o.hasOwnProperty(a)&&(r[a]=o[a])},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(K,"__esModule",{value:!0});var j=256,tr=(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 a=t.length-r;if(a>0){var o=t[r]<<16|(a===2?t[r+1]<<8:0);n+=this._encodeByte(o>>>18&63),n+=this._encodeByte(o>>>12&63),a===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)),a=0,i=0,l=0,s=0,d=0,c=0,u=0;i<r-4;i+=4)s=this._decodeChar(t.charCodeAt(i+0)),d=this._decodeChar(t.charCodeAt(i+1)),c=this._decodeChar(t.charCodeAt(i+2)),u=this._decodeChar(t.charCodeAt(i+3)),o[a++]=s<<2|d>>>4,o[a++]=d<<4|c>>>2,o[a++]=c<<6|u,l|=s&j,l|=d&j,l|=c&j,l|=u&j;if(i<r-1&&(s=this._decodeChar(t.charCodeAt(i)),d=this._decodeChar(t.charCodeAt(i+1)),o[a++]=s<<2|d>>>4,l|=s&j,l|=d&j),i<r-2&&(c=this._decodeChar(t.charCodeAt(i+2)),o[a++]=d<<4|c>>>2,l|=c&j),i<r-3&&(u=this._decodeChar(t.charCodeAt(i+3)),o[a++]=c<<6|u,l|=u&j),l!==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=j;return n+=(42-t&t-44)>>>8&-j+t-43+62,n+=(46-t&t-48)>>>8&-j+t-47+63,n+=(47-t&t-58)>>>8&-j+t-48+52,n+=(64-t&t-91)>>>8&-j+t-65+0,n+=(96-t&t-123)>>>8&-j+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})();K.Coder=tr;var He=new tr;function _p(e){return He.encode(e)}K.encode=_p;function Ip(e){return He.decode(e)}K.decode=Ip;var Ri=(function(e){Up(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=j;return r+=(44-n&n-46)>>>8&-j+n-45+62,r+=(94-n&n-96)>>>8&-j+n-95+63,r+=(47-n&n-58)>>>8&-j+n-48+52,r+=(64-n&n-91)>>>8&-j+n-65+0,r+=(96-n&n-123)>>>8&-j+n-97+26,r},t})(tr);K.URLSafeCoder=Ri;var Ni=new Ri;function jp(e){return Ni.encode(e)}K.encodeURLSafe=jp;function $p(e){return Ni.decode(e)}K.decodeURLSafe=$p;K.encodedLength=function(e){return He.encodedLength(e)};K.maxDecodedLength=function(e){return He.maxDecodedLength(e)};K.decodedLength=function(e){return He.decodedLength(e)}});var bi=rt((Li,kt)=>{"use strict";(function(e,t){var n={};t(n);var r=n.default;for(var o in n)r[o]=n[o];typeof kt=="object"&&typeof kt.exports=="object"?kt.exports=r:typeof define=="function"&&define.amd?define(function(){return r}):e.sha256=r})(Li,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,g,k){for(var h,A,S,N,C,T,O,I,P,B,je,$e,nt;k>=64;){for(h=p[0],A=p[1],S=p[2],N=p[3],C=p[4],T=p[5],O=p[6],I=p[7],B=0;B<16;B++)je=g+B*4,u[B]=(m[je]&255)<<24|(m[je+1]&255)<<16|(m[je+2]&255)<<8|m[je+3]&255;for(B=16;B<64;B++)P=u[B-2],$e=(P>>>17|P<<15)^(P>>>19|P<<13)^P>>>10,P=u[B-15],nt=(P>>>7|P<<25)^(P>>>18|P<<14)^P>>>3,u[B]=($e+u[B-7]|0)+(nt+u[B-16]|0);for(B=0;B<64;B++)$e=(((C>>>6|C<<26)^(C>>>11|C<<21)^(C>>>25|C<<7))+(C&T^~C&O)|0)+(I+(t[B]+u[B]|0)|0)|0,nt=((h>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10))+(h&A^h&S^A&S)|0,I=O,O=T,T=C,C=N+$e|0,N=S,S=A,A=h,h=$e+nt|0;p[0]+=h,p[1]+=A,p[2]+=S,p[3]+=N,p[4]+=C,p[5]+=T,p[6]+=O,p[7]+=I,g+=64,k-=64}return g}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 g=0;if(this.bytesHashed+=m,this.bufferLength>0){for(;this.bufferLength<64&&m>0;)this.buffer[this.bufferLength++]=p[g++],m--;this.bufferLength===64&&(n(this.temp,this.state,this.buffer,0,64),this.bufferLength=0)}for(m>=64&&(g=n(this.temp,this.state,p,g,m),m%=64);m>0;)this.buffer[this.bufferLength++]=p[g++],m--;return this},u.prototype.finish=function(p){if(!this.finished){var m=this.bytesHashed,g=this.bufferLength,k=m/536870912|0,h=m<<3,A=m%64<56?64:128;this.buffer[g]=128;for(var S=g+1;S<A-8;S++)this.buffer[S]=0;this.buffer[A-8]=k>>>24&255,this.buffer[A-7]=k>>>16&255,this.buffer[A-6]=k>>>8&255,this.buffer[A-5]=k>>>0&255,this.buffer[A-4]=h>>>24&255,this.buffer[A-3]=h>>>16&255,this.buffer[A-2]=h>>>8&255,this.buffer[A-1]=h>>>0&255,n(this.temp,this.state,this.buffer,0,A),this.finished=!0}for(var S=0;S<8;S++)p[S*4+0]=this.state[S]>>>24&255,p[S*4+1]=this.state[S]>>>16&255,p[S*4+2]=this.state[S]>>>8&255,p[S*4+3]=this.state[S]>>>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 g=0;g<this.state.length;g++)this.state[g]=p[g];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 g=0;g<p.length;g++)m[g]=p[g];for(var g=0;g<m.length;g++)m[g]^=54;this.inner.update(m);for(var g=0;g<m.length;g++)m[g]^=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 g=0;g<m.length;g++)m[g]=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 a(u){var p=new r().update(u),m=p.digest();return p.clean(),m}e.hash=a,e.default=a;function i(u,p){var m=new o(u).update(p),g=m.digest();return m.clean(),g}e.hmac=i;function l(u,p,m,g){var k=g[0];if(k===0)throw new Error("hkdf: cannot expand more");p.reset(),k>1&&p.update(u),m&&p.update(m),p.update(g),p.finish(u),g[0]++}var s=new Uint8Array(e.digestLength);function d(u,p,m,g){p===void 0&&(p=s),g===void 0&&(g=32);for(var k=new Uint8Array([1]),h=i(p,u),A=new o(h),S=new Uint8Array(A.digestLength),N=S.length,C=new Uint8Array(g),T=0;T<g;T++)N===S.length&&(l(S,A,m,k),N=0),C[T]=S[N++];return A.clean(),S.fill(0),k.fill(0),C}e.hkdf=d;function c(u,p,m,g){for(var k=new o(u),h=k.digestLength,A=new Uint8Array(4),S=new Uint8Array(h),N=new Uint8Array(h),C=new Uint8Array(g),T=0;T*h<g;T++){var O=T+1;A[0]=O>>>24&255,A[1]=O>>>16&255,A[2]=O>>>8&255,A[3]=O>>>0&255,k.reset(),k.update(p),k.update(A),k.finish(N);for(var I=0;I<h;I++)S[I]=N[I];for(var I=2;I<=m;I++){k.reset(),k.update(N).finish(N);for(var P=0;P<h;P++)S[P]^=N[P]}for(var I=0;I<h&&T*h+I<g;I++)C[T*h+I]=S[I]}for(var T=0;T<h;T++)S[T]=N[T]=0;for(var T=0;T<4;T++)A[T]=0;return k.clean(),C}e.pbkdf2=c})});var rr=rt(xe=>{"use strict";Object.defineProperty(xe,"__esModule",{value:!0});xe.Webhook=xe.WebhookVerificationError=void 0;var Bp=wi(),Ci=Ti(),Dp=bi(),vi=300,nr=class e extends Error{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype),this.name="ExtendableError",this.stack=new Error(t).stack}},me=class e extends nr{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype),this.name="WebhookVerificationError"}};xe.WebhookVerificationError=me;var At=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=Ci.decode(t)}}verify(t,n){let r={};for(let p of Object.keys(n))r[p.toLowerCase()]=n[p];let o=r["webhook-id"],a=r["webhook-signature"],i=r["webhook-timestamp"];if(!a||!o||!i)throw new me("Missing required headers");let l=this.verifyTimestamp(i),d=this.sign(o,l,t).split(",")[1],c=a.split(" "),u=new globalThis.TextEncoder;for(let p of c){let[m,g]=p.split(",");if(m==="v1"&&(0,Bp.timingSafeEqual)(u.encode(g),u.encode(d)))return JSON.parse(t.toString())}throw new me("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,a=Math.floor(n.getTime()/1e3),i=o.encode(`${t}.${a}.${r}`);return`v1,${Ci.encode(Dp.hmac(this.key,i))}`}verifyTimestamp(t){let n=Math.floor(Date.now()/1e3),r=parseInt(t,10);if(isNaN(r))throw new me("Invalid Signature Headers");if(n-r>vi)throw new me("Message timestamp too old");if(r>n+vi)throw new me("Message timestamp too new");return new Date(r*1e3)}};xe.Webhook=At;At.prefix="whsec_"});import xi from"crypto";function or({body:e,secret:t}){let n=new Pi.Webhook(t),r=`msg_${xi.randomUUID()}`,o=new Date,a=n.sign(r,o,e),i=Math.floor(o.getTime()/1e3);return{"webhook-id":r,"webhook-signature":a,"webhook-timestamp":String(i)}}function ar(){return`whsec_${xi.randomBytes(24).toString("base64")}`}var Pi,ir=y(()=>{"use strict";Pi=Mr(rr(),1)});import{parseSetCookie as Vp}from"set-cookie-parser";import{z as te}from"zod";async function sr({baseUrl:e,project:t,webhookSecret:n,workflowSlug:r}){let o={apiUrl:void 0,cookies:[],data:{},executed:[]},a=t.stateGraph;if(a==null)return o;let i=(a.edges??[]).find(d=>d.workflowSlug===r);if(i?.sourceState==null)return o;let l=Ui({baseUrl:e,preconditionApiPath:t.preconditionApiPath}),s=i.sourceState.preconditions;return s.length===0?{...o,apiUrl:l}:l==null?o:Oi({apiUrl:l,preconditionNames:s,webhookSecret:n})}async function lr({apiUrl:e,cookies:t,data:n,executed:r,webhookSecret:o}){if(r.length!==0)try{let a=JSON.stringify({data:n,preconditions:r}),i=await fetch(`${e}/teardown`,{body:a,headers:{"Content-Type":"application/json",...qp({cookies:t}),...or({body:a,secret:o})},method:"PUT",signal:AbortSignal.timeout(Ei)});i.ok||w.error("Teardown returned %s",String(i.status))}catch{w.error("Teardown request failed")}}async function Oi({apiUrl:e,preconditionNames:t,webhookSecret:n}){let r=performance.now(),o=JSON.stringify({preconditions:t}),a=await fetch(`${e}/execute-batch`,{body:o,headers:{"Content-Type":"application/json",...or({body:o,secret:n})},method:"PUT",signal:AbortSignal.timeout(Ei)});if(!a.ok)throw new Error(`execute-batch returned ${String(a.status)}`);let i=await a.json(),l=Wp.safeParse(i);if(!l.success)throw new Error(`execute-batch response has invalid shape: ${l.error.message}`);if(!l.data.success){let d=l.data.error??"no error detail";throw new Error(`Precondition batch failed: ${d}`)}let s=Fp({domain:new URL(e).hostname,res:a});return w.info("Preconditions resolved: %s (%dms)",l.data.executed.join(", "),Math.round(performance.now()-r)),{apiUrl:e,cookies:s,data:l.data.data,executed:l.data.executed}}function qp({cookies:e}){return e.length===0?{}:{Cookie:e.map(n=>`${n.name}=${n.value}`).join("; ")}}function Fp({domain:e,res:t}){let n=t.headers.getSetCookie();return Vp(n,{decodeValues:!1}).map(o=>Mp({cookie:o,domain:e}))}function Mp({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=zp({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 zp({raw:e}){return Jp[e.toLowerCase()]??"Lax"}async function dr({baseUrl:e,preconditionApiPath:t,preconditionNames:n,webhookSecret:r}){let o=Ui({baseUrl:e,preconditionApiPath:t});return o==null||n.length===0?{apiUrl:o,cookies:[],data:{},executed:[]}:Oi({apiUrl:o,preconditionNames:n,webhookSecret:r})}function Ui({baseUrl:e,preconditionApiPath:t}){if(t.length!==0)return t.startsWith("http://")||t.startsWith("https://")?t:`${e}${t}`}var Ei,Wp,Jp,cr=y(()=>{"use strict";M();ir();Ei=3e4,Wp=te.object({data:te.record(te.string(),te.record(te.string(),te.string())),error:te.string().optional(),executed:te.array(te.string()),runId:te.string(),success:te.boolean()});Jp={lax:"Lax",none:"None",strict:"Strict"}});import{graphql as pr}from"gql.tada";async function ur({agentProfileId:e,config:t,runId:n}){let r=await $({config:t,document:Gp,variables:{agentProfileId:e??null,platform:"chromium",runId:n}});if(r.startRun==null)throw new Error("Failed to start run");let o=r.startRun.id,a=[];function i(d){let c=Xp({config:t,runResultId:o,steps:[d]}).catch(u=>{w.error(u,"Failed to submit step %d",d.stepIndex)});a.push(c)}async function l(){await Promise.all(a)}async function s({statusOverride:d,steps:c,summary:u}){await q({label:`flushSteps (${String(a.length)} steps)`,fn:()=>Promise.all(a)});let p=c.filter(h=>h.status==="passed").length,m=c.filter(h=>h.status==="failed").length,g=c.reduce((h,A)=>h+A.duration,0),k=d??(m>0?"failed":"passed");await q({label:"completeRun",fn:()=>$({config:t,document:Kp,variables:{duration:g,failCount:m,passCount:p,runResultId:o,status:k,summary:u??null,warnCount:0}})})}return{complete:s,enqueueStep:i,flushSteps:l,runResultId:o}}async function Xp({config:e,runResultId:t,steps:n}){let r=n.map(o=>({annotations:o.annotations.map(a=>({height:a.height,label:a.label,type:a.type,width:a.width,x:a.x,y:a.y})),assertions:o.assertions.map(a=>({description:a.description,detail:a.detail,status:a.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:Hp,variables:{runResultId:t,steps:r}})}var Gp,Hp,Kp,mr=y(()=>{"use strict";ze();M();Ce();Gp=pr(`
98
98
  mutation StartRunCLI($runId: String!, $platform: String!, $agentProfileId: String) {
99
99
  startRun(runId: $runId, platform: $platform, agentProfileId: $agentProfileId) {
100
100
  id
@@ -238,7 +238,7 @@ ${n}`].join(`
238
238
  }
239
239
  }
240
240
  }
241
- `)});import{Box as Rs,Text as se}from"ink";import{jsx as Ae,jsxs as Ze}from"react/jsx-runtime";function Er({config:e,error:t,selectProject:n,stage:r}){return Ze(Rs,{flexDirection:"column",padding:1,children:[Ze(se,{bold:!0,children:[" ","ripplo setup"]}),Ae(se,{children:""}),Ze(se,{children:[Ae(se,{color:"green",children:" \u2713 "}),Ae(se,{children:"Authenticated"})]}),r==="scaffolding"?Ze(se,{children:[Ae(se,{color:"yellow",children:" * "}),Ae(se,{children:"Setting up local environment..."})]}):Ae(As,{selectProject:n,serverUrl:e.ripploServerUrl}),t==null?null:Ae(Rs,{marginTop:1,children:Ze(se,{color:"red",children:[" ","Error: ",t]})})]})}var Ns=y(()=>{"use strict";ws()});import{useEffect as Dm,useState as Vm}from"react";function Oe(){let[e,t]=Vm(Ts);return Dm(()=>{function n(){t(Ts())}return process.stdout.on("resize",n),()=>{process.stdout.off("resize",n)}},[]),e}function Ts(){return{height:process.stdout.rows,width:process.stdout.columns}}var _t=y(()=>{"use strict"});import{useEffect as Wm,useRef as qm,useState as Fm}from"react";function Ls({config:e,cwd:t}){let[n,r]=Fm({config:e,devSessionId:void 0,syncError:void 0,syncing:!0}),o=qm(void 0);return Wm(()=>{function a({devSessionId:l}){r(s=>({...s,devSessionId:l,syncError:void 0,syncing:!1}))}function i(l){r(s=>({...s,syncError:l,syncing:!1}))}return Ki({config:e,cwd:t}).then(({devSessionId:l,hash:s})=>{a({devSessionId:l}),o.current=Ar({config:e,cwd:t,lastHash:s,onSyncError:i,onSyncSuccess:a})}).catch(l=>{let s=l instanceof Error?l.message:String(l);i(s),o.current=Ar({config:e,cwd:t,lastHash:"",onSyncError:i,onSyncSuccess:a})}),()=>{o.current?.()}},[e,t]),n}var bs=y(()=>{"use strict";wr()});import VR from"chalk";import{z as Cs}from"zod";async function vs(){let e=new AbortController,t=setTimeout(()=>{e.abort()},3e3);try{let n=await fetch(`https://registry.npmjs.org/${Mm}/latest`,{headers:{accept:"application/json"},signal:e.signal});if(!n.ok)return;let r=await n.json();return Jm.parse(r).version}catch{return}finally{clearTimeout(t)}}var Or,Mm,Jm,xs=y(()=>{"use strict";ae();Or="0.1.3",Mm="ripplo",Jm=Cs.object({version:Cs.string()})});import{useEffect as zm,useState as Xm}from"react";import{Text as we}from"ink";import{jsx as Ue,jsxs as Qm}from"react/jsx-runtime";function Ps({activeRunCount:e,browsersReady:t,connected:n,ripploServerUrl:r,syncError:o,width:a}){let i=Km(),l=i!=null&&i!==Or,s=Gm({connected:n,syncError:o}),d=t?"":" warming up browsers...",c=e>0?` ${String(e)} running`:"",u=`v${Or}`,p=l?` \u2192 v${i}`:"",m="q to quit",g=` ripplo ${u}${p} | ${r} ${s}${d}${c}`,k=Math.max(0,a-g.length-m.length-1);return Qm(we,{inverse:!0,children:[Ue(we,{bold:!0,children:" ripplo "}),Ue(we,{dimColor:!0,children:u}),l?Ue(we,{color:"yellow",children:` \u2192 v${i}`}):null,` | ${r} `,Ue(we,{color:Hm({connected:n,syncError:o}),children:s}),t?null:Ue(we,{color:"yellow",children:d}),c," ".repeat(k),Ue(we,{dimColor:!0,children:m})," "]})}function Gm({connected:e,syncError:t}){return t!=null?"sync failed":e?"connected":"connecting..."}function Hm({connected:e,syncError:t}){return t!=null?"red":e?"green":"yellow"}function Km(){let[e,t]=Xm();return zm(()=>{vs().then(n=>{n!=null&&t(n)})},[]),e}var Es=y(()=>{"use strict";xs()});import{Box as It,Text as et,useApp as Ym,useInput as Zm}from"ink";import{jsx as _e,jsxs as jt}from"react/jsx-runtime";function Os({config:e,cwd:t}){let n=Ym(),{height:r,width:o}=Oe(),{config:a,devSessionId:i,syncError:l}=Ls({config:e,cwd:t}),{activeRunCount:s,browsersReady:d,connected:c}=as({config:a,cwd:t,devSessionId:i});Zm(p=>{p==="q"&&n.exit()});let u=`${a.ripploServerUrl}/projects/${a.projectId}/developer`;return jt(It,{flexDirection:"column",height:r,width:o,children:[_e(Ps,{activeRunCount:s,browsersReady:d,connected:c,ripploServerUrl:a.ripploServerUrl,syncError:l,width:o}),jt(It,{flexDirection:"column",flexGrow:1,padding:1,children:[jt(It,{children:[_e(et,{children:"Developer dashboard: "}),_e(et,{color:"cyan",children:u})]}),jt(It,{marginTop:1,children:[_e(et,{dimColor:!0,children:"Run "}),_e(et,{color:"yellow",children:"ripplo doctor"}),_e(et,{dimColor:!0,children:" for health checks"})]})]})]})}var Us=y(()=>{"use strict";_t();bs();Nr();Es()});import{Text as _s}from"ink";import ef from"ink-spinner";import{jsx as Is,jsxs as nf}from"react/jsx-runtime";function js({loading:e}){return e?nf(_s,{color:tf,children:[Is(ef,{type:"dots"})," Starting..."]}):Is(_s,{children:""})}var tf,$s=y(()=>{"use strict";tf="#24CFFF"});import{useEffect as rf,useState as tt}from"react";import{Box as Re,Text as Ur,useInput as of}from"ink";import{jsx as ye,jsxs as _r}from"react/jsx-runtime";function Ds({onDismiss:e}){let{height:t,width:n}=Oe(),[r,o]=tt(0),[a,i]=tt(!1),[l,s]=tt(!1),[d,c]=tt(!1),[u,p]=tt(!1);of(()=>{u&&e()}),rf(()=>{let k=80+$t.length*70+80,h=[...$t.map((A,S)=>setTimeout(()=>{o(S+1)},80+S*70)),setTimeout(()=>{i(!0)},k),setTimeout(()=>{s(!0)},k+200),setTimeout(()=>{c(!0)},k+400),setTimeout(()=>{c(!1),p(!0)},k+2e3),setTimeout(()=>{e()},k+2800)];return()=>{h.forEach(A=>{clearTimeout(A)})}},[e]);let m=$t.length+5,g=Math.max(0,Math.floor((t-m)/2));return _r(Re,{flexDirection:"column",height:t,width:n,children:[ye(Re,{height:g}),_r(Re,{alignItems:"flex-start",flexDirection:"row",justifyContent:"center",children:[ye(Re,{flexDirection:"column",children:$t.map((k,h)=>ye(Ur,{color:Bs,children:h<r?k:""},k))}),_r(Re,{flexDirection:"column",paddingLeft:4,paddingTop:5,children:[ye(Ur,{bold:!0,color:Bs,children:a?af:""}),ye(Re,{marginTop:1,children:ye(Ur,{color:"gray",dimColor:!0,children:l?"developer CLI":""})}),ye(Re,{marginTop:2,children:ye(js,{loading:d})})]})]})]})}var $t,Bs,af,Vs=y(()=>{"use strict";_t();$s();$t=[" 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 "],Bs="#24CFFF",af="ripplo"});import{createAuthClient as sf}from"better-auth/client";import{deviceAuthorizationClient as lf}from"better-auth/client/plugins";function Bt({baseURL:e}){return sf({baseURL:e,fetchOptions:{headers:{"User-Agent":"Ripplo CLI"}},plugins:[lf()]})}var Ir=y(()=>{"use strict"});import{exec as df}from"child_process";async function qs({cwd:e,onDeviceCode:t,url:n}){let r=n??Qe().RIPPLO_SERVER_URL,o=Bt({baseURL:r}),a=await o.device.code({client_id:Ws});if(a.error!=null)throw new Error(`Failed to request device code: ${a.error.error_description}`);let{device_code:i,user_code:l,verification_uri_complete:s}=a.data;t({userCode:l,verificationUrl:s}),gf(s);let d=await pf({authClient:o,deviceCode:i});return In(e,d),d}async function pf({authClient:e,deviceCode:t}){for(;;){await ff(cf);let n=await e.device.token({client_id:Ws,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(!mf(n.error.error))throw new Error(`Authorization failed: ${n.error.error_description}`)}}function mf(e){return uf.has(e)}function ff(e){return new Promise(t=>{setTimeout(t,e)})}function yf(){return process.platform==="darwin"?"open":process.platform==="win32"?"start":"xdg-open"}function gf(e){let t=yf();df(`${t} "${e}"`,()=>{})}var cf,Ws,uf,Fs=y(()=>{"use strict";ae();Ir();Lt();cf=5e3,Ws="ripplo-cli";uf=new Set(["authorization_pending","slow_down"])});import{useCallback as jr,useEffect as hf,useState as Ie}from"react";import{execSync as Sf}from"child_process";import re from"fs";import Z from"path";function Js({cwd:e,initialToken:t,serverUrl:n}){let[r,o]=Ie(t==null?"login":"validating"),[a,i]=Ie(),[l,s]=Ie(),[d,c]=Ie(t),[u,p]=Ie(!1),[m,g]=Ie();hf(()=>{if(t==null)return;Bt({baseURL:n}).getSession({fetchOptions:{headers:{Authorization:`Bearer ${t}`}}}).then(N=>{if(N.data==null){o("login");return}return $r({cwd:e,serverUrl:n,token:t})}).then(N=>{if(N==null){o("select-project");return}i(N),o("complete")}).catch(N=>{s(N instanceof Error?N.message:String(N)),o("login")})},[e,t,n]);let k=jr(()=>{u||(p(!0),s(void 0),qs({cwd:e,onDeviceCode:g,url:n}).then(S=>(c(S),$r({cwd:e,serverUrl:n,token:S}))).then(S=>{S==null?o("select-project"):(i(S),o("complete"))}).catch(S=>{p(!1),g(void 0),s(S instanceof Error?S.message:String(S))}))},[e,u,n]),h=jr(S=>{let N=a?.token??d??t;if(N==null){s("No authentication token available");return}o("scaffolding"),s(void 0),kf({cwd:e,projectId:S.id}).then(()=>$r({cwd:e,serverUrl:n,token:N})).then(C=>{i(C??{appUrl:"",preconditionsUrl:"",projectId:S.id,ripploServerUrl:n,token:N,webhookSecret:""}),o("complete")}).catch(C=>{s(C instanceof Error?C.message:String(C)),o("select-project")})},[a,e,t,n,d]),A=jr(()=>{i(void 0),o("login"),p(!1),g(void 0),s(void 0)},[]);return{config:a,deviceCodeInfo:m,error:l,loginStarted:u,resetToLogin:A,selectProject:h,setStage:o,stage:r,startLogin:k,token:d}}async function $r({cwd:e,serverUrl:t,token:n}){let r=await V(e);if(r.ok)return{...r.result.config,ripploServerUrl:t,token:n}}async function kf({cwd:e,projectId:t}){Rf({cwd:e,projectId:t}),vf(e),Af(e),await An()}function Af(e){let t=wf(e),n=t==="yarn"?`yarn add -D ${Ms.join(" ")}`:`${t} add -D ${Ms.join(" ")}`;w.info("Installing dependencies: %s",n),Sf(n,{cwd:e,stdio:"pipe"})}function wf(e){return re.existsSync(Z.join(e,"pnpm-lock.yaml"))?"pnpm":re.existsSync(Z.join(e,"yarn.lock"))?"yarn":re.existsSync(Z.join(e,"bun.lockb"))||re.existsSync(Z.join(e,"bun.lock"))?"bun":"npm"}function Rf({cwd:e,projectId:t}){let n=Z.join(e,".ripplo"),r=Z.join(n,"tests"),o=Z.join(n,"preconditions");re.mkdirSync(r,{recursive:!0}),re.mkdirSync(o,{recursive:!0}),Dt(Z.join(n,"ripplo.ts"),Nf(t)),Dt(Z.join(n,"index.ts"),Lf),Dt(Z.join(n,".env"),Tf()),Dt(Z.join(n,"tsconfig.json"),bf)}function Dt(e,t){re.existsSync(e)||re.writeFileSync(e,t)}function Nf(e){return`import { config } from "dotenv";
241
+ `)});import{Box as Rs,Text as se}from"ink";import{jsx as Ae,jsxs as Ze}from"react/jsx-runtime";function Er({config:e,error:t,selectProject:n,stage:r}){return Ze(Rs,{flexDirection:"column",padding:1,children:[Ze(se,{bold:!0,children:[" ","ripplo setup"]}),Ae(se,{children:""}),Ze(se,{children:[Ae(se,{color:"green",children:" \u2713 "}),Ae(se,{children:"Authenticated"})]}),r==="scaffolding"?Ze(se,{children:[Ae(se,{color:"yellow",children:" * "}),Ae(se,{children:"Setting up local environment..."})]}):Ae(As,{selectProject:n,serverUrl:e.ripploServerUrl}),t==null?null:Ae(Rs,{marginTop:1,children:Ze(se,{color:"red",children:[" ","Error: ",t]})})]})}var Ns=y(()=>{"use strict";ws()});import{useEffect as Dm,useState as Vm}from"react";function Oe(){let[e,t]=Vm(Ts);return Dm(()=>{function n(){t(Ts())}return process.stdout.on("resize",n),()=>{process.stdout.off("resize",n)}},[]),e}function Ts(){return{height:process.stdout.rows,width:process.stdout.columns}}var _t=y(()=>{"use strict"});import{useEffect as Wm,useRef as qm,useState as Fm}from"react";function Ls({config:e,cwd:t}){let[n,r]=Fm({config:e,devSessionId:void 0,syncError:void 0,syncing:!0}),o=qm(void 0);return Wm(()=>{function a({devSessionId:l}){r(s=>({...s,devSessionId:l,syncError:void 0,syncing:!1}))}function i(l){r(s=>({...s,syncError:l,syncing:!1}))}return Ki({config:e,cwd:t}).then(({devSessionId:l,hash:s})=>{a({devSessionId:l}),o.current=Ar({config:e,cwd:t,lastHash:s,onSyncError:i,onSyncSuccess:a})}).catch(l=>{let s=l instanceof Error?l.message:String(l);i(s),o.current=Ar({config:e,cwd:t,lastHash:"",onSyncError:i,onSyncSuccess:a})}),()=>{o.current?.()}},[e,t]),n}var bs=y(()=>{"use strict";wr()});import VR from"chalk";import{z as Cs}from"zod";async function vs(){let e=new AbortController,t=setTimeout(()=>{e.abort()},3e3);try{let n=await fetch(`https://registry.npmjs.org/${Mm}/latest`,{headers:{accept:"application/json"},signal:e.signal});if(!n.ok)return;let r=await n.json();return Jm.parse(r).version}catch{return}finally{clearTimeout(t)}}var Or,Mm,Jm,xs=y(()=>{"use strict";ae();Or="0.1.4",Mm="ripplo",Jm=Cs.object({version:Cs.string()})});import{useEffect as zm,useState as Xm}from"react";import{Text as we}from"ink";import{jsx as Ue,jsxs as Qm}from"react/jsx-runtime";function Ps({activeRunCount:e,browsersReady:t,connected:n,ripploServerUrl:r,syncError:o,width:a}){let i=Km(),l=i!=null&&i!==Or,s=Gm({connected:n,syncError:o}),d=t?"":" warming up browsers...",c=e>0?` ${String(e)} running`:"",u=`v${Or}`,p=l?` \u2192 v${i}`:"",m="q to quit",g=` ripplo ${u}${p} | ${r} ${s}${d}${c}`,k=Math.max(0,a-g.length-m.length-1);return Qm(we,{inverse:!0,children:[Ue(we,{bold:!0,children:" ripplo "}),Ue(we,{dimColor:!0,children:u}),l?Ue(we,{color:"yellow",children:` \u2192 v${i}`}):null,` | ${r} `,Ue(we,{color:Hm({connected:n,syncError:o}),children:s}),t?null:Ue(we,{color:"yellow",children:d}),c," ".repeat(k),Ue(we,{dimColor:!0,children:m})," "]})}function Gm({connected:e,syncError:t}){return t!=null?"sync failed":e?"connected":"connecting..."}function Hm({connected:e,syncError:t}){return t!=null?"red":e?"green":"yellow"}function Km(){let[e,t]=Xm();return zm(()=>{vs().then(n=>{n!=null&&t(n)})},[]),e}var Es=y(()=>{"use strict";xs()});import{Box as It,Text as et,useApp as Ym,useInput as Zm}from"ink";import{jsx as _e,jsxs as jt}from"react/jsx-runtime";function Os({config:e,cwd:t}){let n=Ym(),{height:r,width:o}=Oe(),{config:a,devSessionId:i,syncError:l}=Ls({config:e,cwd:t}),{activeRunCount:s,browsersReady:d,connected:c}=as({config:a,cwd:t,devSessionId:i});Zm(p=>{p==="q"&&n.exit()});let u=`${a.ripploServerUrl}/projects/${a.projectId}/developer`;return jt(It,{flexDirection:"column",height:r,width:o,children:[_e(Ps,{activeRunCount:s,browsersReady:d,connected:c,ripploServerUrl:a.ripploServerUrl,syncError:l,width:o}),jt(It,{flexDirection:"column",flexGrow:1,padding:1,children:[jt(It,{children:[_e(et,{children:"Developer dashboard: "}),_e(et,{color:"cyan",children:u})]}),jt(It,{marginTop:1,children:[_e(et,{dimColor:!0,children:"Run "}),_e(et,{color:"yellow",children:"ripplo doctor"}),_e(et,{dimColor:!0,children:" for health checks"})]})]})]})}var Us=y(()=>{"use strict";_t();bs();Nr();Es()});import{Text as _s}from"ink";import ef from"ink-spinner";import{jsx as Is,jsxs as nf}from"react/jsx-runtime";function js({loading:e}){return e?nf(_s,{color:tf,children:[Is(ef,{type:"dots"})," Starting..."]}):Is(_s,{children:""})}var tf,$s=y(()=>{"use strict";tf="#24CFFF"});import{useEffect as rf,useState as tt}from"react";import{Box as Re,Text as Ur,useInput as of}from"ink";import{jsx as ye,jsxs as _r}from"react/jsx-runtime";function Ds({onDismiss:e}){let{height:t,width:n}=Oe(),[r,o]=tt(0),[a,i]=tt(!1),[l,s]=tt(!1),[d,c]=tt(!1),[u,p]=tt(!1);of(()=>{u&&e()}),rf(()=>{let k=80+$t.length*70+80,h=[...$t.map((A,S)=>setTimeout(()=>{o(S+1)},80+S*70)),setTimeout(()=>{i(!0)},k),setTimeout(()=>{s(!0)},k+200),setTimeout(()=>{c(!0)},k+400),setTimeout(()=>{c(!1),p(!0)},k+2e3),setTimeout(()=>{e()},k+2800)];return()=>{h.forEach(A=>{clearTimeout(A)})}},[e]);let m=$t.length+5,g=Math.max(0,Math.floor((t-m)/2));return _r(Re,{flexDirection:"column",height:t,width:n,children:[ye(Re,{height:g}),_r(Re,{alignItems:"flex-start",flexDirection:"row",justifyContent:"center",children:[ye(Re,{flexDirection:"column",children:$t.map((k,h)=>ye(Ur,{color:Bs,children:h<r?k:""},k))}),_r(Re,{flexDirection:"column",paddingLeft:4,paddingTop:5,children:[ye(Ur,{bold:!0,color:Bs,children:a?af:""}),ye(Re,{marginTop:1,children:ye(Ur,{color:"gray",dimColor:!0,children:l?"developer CLI":""})}),ye(Re,{marginTop:2,children:ye(js,{loading:d})})]})]})]})}var $t,Bs,af,Vs=y(()=>{"use strict";_t();$s();$t=[" 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 "],Bs="#24CFFF",af="ripplo"});import{createAuthClient as sf}from"better-auth/client";import{deviceAuthorizationClient as lf}from"better-auth/client/plugins";function Bt({baseURL:e}){return sf({baseURL:e,fetchOptions:{headers:{"User-Agent":"Ripplo CLI"}},plugins:[lf()]})}var Ir=y(()=>{"use strict"});import{exec as df}from"child_process";async function qs({cwd:e,onDeviceCode:t,url:n}){let r=n??Qe().RIPPLO_SERVER_URL,o=Bt({baseURL:r}),a=await o.device.code({client_id:Ws});if(a.error!=null)throw new Error(`Failed to request device code: ${a.error.error_description}`);let{device_code:i,user_code:l,verification_uri_complete:s}=a.data;t({userCode:l,verificationUrl:s}),gf(s);let d=await pf({authClient:o,deviceCode:i});return In(e,d),d}async function pf({authClient:e,deviceCode:t}){for(;;){await ff(cf);let n=await e.device.token({client_id:Ws,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(!mf(n.error.error))throw new Error(`Authorization failed: ${n.error.error_description}`)}}function mf(e){return uf.has(e)}function ff(e){return new Promise(t=>{setTimeout(t,e)})}function yf(){return process.platform==="darwin"?"open":process.platform==="win32"?"start":"xdg-open"}function gf(e){let t=yf();df(`${t} "${e}"`,()=>{})}var cf,Ws,uf,Fs=y(()=>{"use strict";ae();Ir();Lt();cf=5e3,Ws="ripplo-cli";uf=new Set(["authorization_pending","slow_down"])});import{useCallback as jr,useEffect as hf,useState as Ie}from"react";import{execSync as Sf}from"child_process";import re from"fs";import Z from"path";function Js({cwd:e,initialToken:t,serverUrl:n}){let[r,o]=Ie(t==null?"login":"validating"),[a,i]=Ie(),[l,s]=Ie(),[d,c]=Ie(t),[u,p]=Ie(!1),[m,g]=Ie();hf(()=>{if(t==null)return;Bt({baseURL:n}).getSession({fetchOptions:{headers:{Authorization:`Bearer ${t}`}}}).then(N=>{if(N.data==null){o("login");return}return $r({cwd:e,serverUrl:n,token:t})}).then(N=>{if(N==null){o("select-project");return}i(N),o("complete")}).catch(N=>{s(N instanceof Error?N.message:String(N)),o("login")})},[e,t,n]);let k=jr(()=>{u||(p(!0),s(void 0),qs({cwd:e,onDeviceCode:g,url:n}).then(S=>(c(S),$r({cwd:e,serverUrl:n,token:S}))).then(S=>{S==null?o("select-project"):(i(S),o("complete"))}).catch(S=>{p(!1),g(void 0),s(S instanceof Error?S.message:String(S))}))},[e,u,n]),h=jr(S=>{let N=a?.token??d??t;if(N==null){s("No authentication token available");return}o("scaffolding"),s(void 0),kf({cwd:e,projectId:S.id}).then(()=>$r({cwd:e,serverUrl:n,token:N})).then(C=>{i(C??{appUrl:"",preconditionsUrl:"",projectId:S.id,ripploServerUrl:n,token:N,webhookSecret:""}),o("complete")}).catch(C=>{s(C instanceof Error?C.message:String(C)),o("select-project")})},[a,e,t,n,d]),A=jr(()=>{i(void 0),o("login"),p(!1),g(void 0),s(void 0)},[]);return{config:a,deviceCodeInfo:m,error:l,loginStarted:u,resetToLogin:A,selectProject:h,setStage:o,stage:r,startLogin:k,token:d}}async function $r({cwd:e,serverUrl:t,token:n}){let r=await V(e);if(r.ok)return{...r.result.config,ripploServerUrl:t,token:n}}async function kf({cwd:e,projectId:t}){Rf({cwd:e,projectId:t}),vf(e),Af(e),await An()}function Af(e){let t=wf(e),n=t==="yarn"?`yarn add -D ${Ms.join(" ")}`:`${t} add -D ${Ms.join(" ")}`;w.info("Installing dependencies: %s",n),Sf(n,{cwd:e,stdio:"pipe"})}function wf(e){return re.existsSync(Z.join(e,"pnpm-lock.yaml"))?"pnpm":re.existsSync(Z.join(e,"yarn.lock"))?"yarn":re.existsSync(Z.join(e,"bun.lockb"))||re.existsSync(Z.join(e,"bun.lock"))?"bun":"npm"}function Rf({cwd:e,projectId:t}){let n=Z.join(e,".ripplo"),r=Z.join(n,"tests"),o=Z.join(n,"preconditions");re.mkdirSync(r,{recursive:!0}),re.mkdirSync(o,{recursive:!0}),Dt(Z.join(n,"ripplo.ts"),Nf(t)),Dt(Z.join(n,"index.ts"),Lf),Dt(Z.join(n,".env"),Tf()),Dt(Z.join(n,"tsconfig.json"),bf)}function Dt(e,t){re.existsSync(e)||re.writeFileSync(e,t)}function Nf(e){return`import { config } from "dotenv";
242
242
  import { createRipplo } from "@ripplo/testing";
243
243
  import { z } from "zod";
244
244
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ripplo",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "CLI for Ripplo — AI-powered end-to-end testing",
5
5
  "type": "module",
6
6
  "homepage": "https://ripplo.ai",
@@ -53,10 +53,10 @@
53
53
  "eslint-plugin-react-hooks": "^5.0.0",
54
54
  "tsup": "^8.5.1",
55
55
  "typescript": "^5.9.3",
56
- "@ripplo/testing": "^0.0.4",
57
56
  "@ripplo/eslint-config": "0.0.0",
58
57
  "@ripplo/graphql": "^0.0.0",
59
58
  "@ripplo/runtime": "^0.0.0",
59
+ "@ripplo/testing": "^0.0.4",
60
60
  "@ripplo/spec": "^0.0.0"
61
61
  },
62
62
  "scripts": {