ripplo 0.7.6 → 0.7.7
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{C as T,H as J,K as F,Ka as ce,La as ue,M as K,Ma as pe,N as V,Na as fe,Oa as me,R as X,Sa as w,Ta as x,U as Z,Ua as ye,Va as H,Wa as ke,Ya as q,Za as ge,_a as we,aa as Y,ab as h,b as d,c as L,cb as Se,da as ee,e as U,ea as re,eb as ve,f as P,fa as oe,g as M,ga as A,gb as Re,hb as Pe,ia as ne,ib as xe,jb as he,ka as te,kb as be,lb as Ee,mb as Ie,na as ie,nb as Ce,pa as ae,pb as We,q as B,ra as se,sa as le,t as z,ua as R,v as G,va as de,w as Q,y as f,z as D}from"./chunk-752OI543.js";import Ar from"path";import{createClient as Hr}from"graphql-sse";import qr,{AbortError as jr}from"p-retry";import{graphql as I}from"gql.tada";import{print as Nr}from"graphql";import sr from"fs";import Fe from"net";import{err as Ae,ok as lr}from"neverthrow";async function He({cwd:e,onConnection:o}){M(e);let r=de(e),n=await Le({onConnection:o,socketPath:r});return n.isOk()||n.error.kind!=="stale-candidate"?n.map(De(r)).mapErr(Te(r)):await dr(r)?Ae({kind:"already-running",socketPath:r}):(qe(r),(await Le({onConnection:o,socketPath:r})).map(De(r)).mapErr(Te(r)))}function dr(e){return new Promise(o=>{let r=Fe.connect(e);r.once("connect",()=>{r.destroy(),o(!0)}),r.once("error",()=>{o(!1)})})}async function Le(e){let o=await cr(e);return o.kind==="listening"?lr(o.server):Ae(o.error)}function cr({onConnection:e,socketPath:o}){return new Promise(r=>{let n=Fe.createServer(e);n.once("error",t=>{r({error:t.code==="EADDRINUSE"?{kind:"stale-candidate"}:{kind:"listen-failed",message:t.message},kind:"failed"})}),n.listen(o,()=>{r({kind:"listening",server:n})})})}function De(e){return o=>({socketPath:e,close:()=>{o.close(),qe(e)}})}function qe(e){sr.rmSync(e,{force:!0})}function Te(e){return o=>o.kind==="stale-candidate"?{kind:"already-running",socketPath:e}:{kind:"bind-failed",message:o.message}}function j(e){return{priority:e,next:()=>null,onResult:()=>{}}}function je({config:e,explore:o,exploreConcurrency:r,pool:n}){return ur({appUrl:e.appUrl,cwd:e.cwd,explore:o,exploreConcurrency:r,executeTrail:async(t,i)=>(await n).exploreTrail(t,i)})}function ur({appUrl:e,cwd:o,executeTrail:r,explore:n,exploreConcurrency:t}){let i={notify:()=>{}},a=n?pr({appUrl:e,cwd:o,executeTrail:r,notifyWork:()=>{i.notify()}}):se(),s=We({exploreConcurrency:t,exploreEnabled:n,now:Date.now,probe:fr,setTimer:mr,sources:[j("p0"),j("p1"),a],execute:({job:u,priority:p,signal:c})=>w({headed:!1,workClass:yr(p),task:()=>u.run(c)})});H(()=>{s.notifyQueueChange()}),i.notify=()=>{s.notifyQueueChange()};let l=n?ae({onChange:u=>{s.setExplorerHolder(u)}}):null;return{status:()=>({explorer:kr({explore:n,holder:s.explorerHolder()}),exploring:s.explorationActive(),progress:a.status()}),stop:()=>{l?.stop(),s.stop(),H(null),a.stop()}}}function pr({appUrl:e,cwd:o,executeTrail:r,notifyWork:n}){return le({cwd:o,executeTrail:r,notifyWork:n,loadLockfile:async()=>{let{fingerprint:t,result:i}=await f(o);return i.match(a=>({fingerprint:t,lockfile:a}),()=>null)},probeApp:async()=>await X(e)==null})}function fr(){let e=ye();return{headedActive:e.headedActive,interactiveActive:e.active,interactiveQueued:e.queued,poolSize:e.poolSize}}function mr(e,o){let r=setTimeout(e,o);return()=>{clearTimeout(r)}}function yr(e){switch(e){case"p0":return"p0-ui";case"p1":return"p1-cli";case"p2":return"p2-cover";case"p3":return"p3-explore"}}function kr({explore:e,holder:o}){return e?o?"holder":"standby":"off"}async function Ne({cwd:e,finding:o}){let r={at:new Date().toISOString(),kind:"resolution",signature:o.signature};await A(R(e),[r]).match(()=>{},n=>{d.warn("explore ledger append failed: %s",n.kind)})}async function Oe({cwd:e,finding:o,outcome:r}){let n=r.kind==="clean"?[...r.rows,{at:new Date().toISOString(),kind:"resolution",signature:o.signature}]:r.rows;n.length!==0&&await A(R(e),n).match(()=>{},t=>{d.warn("explore ledger append failed: %s",t.kind)})}function $e({cwd:e,pool:o}){let r={cwd:e,executeTrail:(n,t)=>w({headed:!1,workClass:"p1-cli",task:async()=>(await o).exploreTrail(n,t)}),loadLockfile:async()=>{let n=await f(e);return n.result.match(t=>({fingerprint:n.fingerprint,lockfile:t}),()=>null)}};return(n,t)=>gr(r,{findingId:n,signal:t})}async function gr(e,o){let r=await wr(e.cwd,o.findingId);if("reply"in r)return r.reply;let n=await e.loadLockfile();if(n==null)return{kind:"error",reason:"lockfile-unavailable"};let t=Sr(n,r.finding);if("reply"in t)return t.reply;let i=await e.executeTrail(t.assign,o.signal);return Rr({cwd:e.cwd,finding:r.finding,outcome:i})}async function wr(e,o){return oe(R(e)).match(r=>{let t=[...re(r).findings.entries()].find(([a])=>ee(a)===o);if(t==null)return{reply:{kind:"finding-not-found"}};let[,i]=t;return i.resolvedAt!=null?{reply:{kind:"finding-not-found"}}:{finding:i.latest}},()=>({reply:{kind:"unreplayable",reason:"ledger-unreadable"}}))}function Sr(e,o){let r=te(e.lockfile,{sweep:!1}).find(t=>t.name===o.depot);if(r==null)return{reply:{kind:"unreplayable",reason:"depot-missing"}};let n=vr(e.lockfile,o);return n==null?{reply:{kind:"unreplayable",reason:"transition-missing"}}:{assign:{depotTest:r.test,firings:n,lensId:o.lensId,lockfileFingerprint:e.fingerprint,lockfileHash:ne(e.lockfile),maxLength:n.length,shrinkBudget:0}}}function vr(e,o){let n=Z(e).map(a=>`${a.test}#${String(a.index)}`),i=o.trail.map((a,s)=>{let l=n.indexOf(a),u=o.trailParams[s];return l===-1||u==null?null:{idx:l,params:u}}).flatMap(a=>a==null?[]:[a]);return i.length===o.trail.length?i:null}async function Rr({cwd:e,finding:o,outcome:r}){return r.kind==="aborted"?{kind:"aborted"}:r.kind==="error"?Pr({cwd:e,finding:o,reason:r.reason}):(await Oe({cwd:e,finding:o,outcome:r}),r.kind==="clean"?{kind:"resolved"}:r.kind==="flaky"?{kind:"flaky"}:xr(o,r))}async function Pr({cwd:e,finding:o,reason:r}){return r==="empty-trail"?(await Ne({cwd:e,finding:o}),{kind:"unreachable"}):{kind:"error",reason:r??"trail-error"}}function xr(e,o){let r=o.rows.find(t=>t.kind==="finding"),n=r?.kind==="finding"?r.runId:void 0;return r!=null&&r.signature===e.signature?{kind:"still-failing",runId:n}:{kind:"diverged",runId:n}}async function _e({config:e,cwd:o,headed:r,pool:n,runId:t,signal:i,workClass:a,workflowSlug:s}){let{fingerprint:l,result:u}=await f(o);if(u.isErr())return await h(e,t,`lockfile:${u.error.kind}`),{detail:`lockfile:${u.error.kind}`,kind:"dispatch-error"};if(u.value.tests.find(k=>Q(k.name)===s)==null)return await h(e,t,`no-test:${s}`),{detail:`no-test:${s}`,kind:"dispatch-error"};let c=await w({headed:r,workClass:a,task:()=>n.execute({headed:r,lockfileFingerprint:l,runId:t,workflowSlug:s},i)});return!c.serverNotified&&c.outcome.kind==="error"&&await h(e,t,c.outcome.detail),c.outcome}import{fork as hr}from"child_process";import Ue from"os";import{CancellationTokenSource as Me,ResponseError as Be}from"vscode-jsonrpc/node";function ze(e,o){return()=>{let r=hr(e,["run-worker"],{cwd:o,stdio:["ignore","inherit","inherit","ipc"]});return{connection:Ce(r),kill:()=>{r.kill("SIGKILL")},onExit:n=>{r.once("exit",n)}}}}function Ge(e){let o={closed:!1,lockfileProvider:e.lockfileProvider,nextId:0,size:e.initialSize,spawn:e.spawn,waiters:[],workers:[]};return{close:async()=>{o.closed=!0,await Promise.all([...o.workers].map(r=>N(r,o)))},execute:(r,n)=>Er(r,n,o),exploreTrail:(r,n)=>Wr(r,n,o),routeSpan:(r,n)=>{let t=o.workers.find(i=>i.runId===r);t?.worker.connection.sendNotification(Ee,{runId:r,span:n})},setSize:r=>{Dr(r,o)}}}var br=1e4,Qe=-32800;async function Er(e,o,r){let n=await Je(r);if(n.runId=e.runId,!n.alive)return b(n,r),{outcome:{detail:"worker-exit",kind:"error"},serverNotified:!1};let t=new Me,i=()=>{t.cancel()};o.aborted&&t.cancel(),o.addEventListener("abort",i,{once:!0});try{let a=await n.worker.connection.sendRequest(xe,e,t.token),s=ve.safeParse(a);return s.success?s.data:{outcome:{detail:"bad-outcome-frame",kind:"error"},serverNotified:!1}}catch(a){return Cr(a,n)}finally{o.removeEventListener("abort",i),t.dispose(),b(n,r)}}async function Je(e){let o=e.workers.find(r=>r.alive&&r.runId===void 0);if(o!=null)return o.runId="pending",o;if(e.workers.length<e.size){let r=Ir(e);return r.runId="pending",await r.ready,r}return new Promise(r=>{e.waiters.push(n=>{n.runId="pending",r(n)})})}function Ir(e){let o=e.spawn(),r={resolve:()=>{}},n={alive:!0,id:e.nextId,ready:new Promise(t=>{r.resolve=t,o.connection.onNotification(Pe,t)}),runId:void 0,worker:o};return e.nextId+=1,o.connection.onRequest(he,async t=>{let i=Se.safeParse(t);return i.success?e.lockfileProvider(i.data.fingerprint):{unavailable:"bad-lockfile-request"}}),o.onExit(()=>{n.alive=!1,e.workers=e.workers.filter(t=>t!==n),o.connection.dispose(),r.resolve()}),e.workers.push(n),n}function b(e,o){if(e.runId=void 0,!e.alive||o.closed)return;if(o.workers.length>o.size){N(e,o);return}let r=o.waiters.shift();r?.(e)}async function N(e,o){if(o.workers=o.workers.filter(t=>t!==e),!e.alive)return;let r=new Promise(t=>{e.worker.onExit(t)});await e.worker.connection.sendNotification(Ie).catch(()=>{});let n=setTimeout(()=>{e.worker.kill()},br);await r,clearTimeout(n)}function Cr(e,o){return e instanceof Be&&e.code===Qe?{outcome:{detail:"aborted",kind:"error"},serverNotified:!1}:o.alive?{outcome:{detail:e instanceof Error?e.message:String(e),kind:"error"},serverNotified:!1}:{outcome:{detail:"worker-exit",kind:"error"},serverNotified:!1}}async function Wr(e,o,r){let n=await Je(r);if(n.runId="explore",!n.alive)return b(n,r),{kind:"error",rows:[],trail:[]};let t=new Me,i=()=>{t.cancel()};o.aborted&&t.cancel(),o.addEventListener("abort",i,{once:!0});try{let a=await n.worker.connection.sendRequest(be,e,t.token),s=Re.safeParse(a);return s.success?s.data:{kind:"error",rows:[],trail:[]}}catch(a){return Lr(a)}finally{o.removeEventListener("abort",i),t.dispose(),b(n,r)}}function Lr(e){return e instanceof Be&&e.code===Qe?{kind:"aborted",rows:[],trail:[]}:{kind:"error",reason:`transport:${e instanceof Error?e.message.slice(0,120):"unknown"}`,rows:[],trail:[]}}function Dr(e,o){o.size=e,e>Ue.availableParallelism()&&d.warn({cores:Ue.availableParallelism(),size:e},"worker pool size exceeds available cores");let r=o.workers.filter(t=>t.alive&&t.runId===void 0),n=o.workers.length-e;r.slice(0,Math.max(0,n)).forEach(t=>{N(t,o)})}import E from"fs";import{graphql as Ke}from"gql.tada";import{print as Ve}from"graphql";var Tr=Ke(`
|
|
2
|
+
import{C as T,H as J,K as F,Ka as ce,La as ue,M as K,Ma as pe,N as V,Na as fe,Oa as me,R as X,Sa as w,Ta as x,U as Z,Ua as ye,Va as H,Wa as ke,Ya as q,Za as ge,_a as we,aa as Y,ab as h,b as d,c as L,cb as Se,da as ee,e as U,ea as re,eb as ve,f as P,fa as oe,g as M,ga as A,gb as Re,hb as Pe,ia as ne,ib as xe,jb as he,ka as te,kb as be,lb as Ee,mb as Ie,na as ie,nb as Ce,pa as ae,pb as We,q as B,ra as se,sa as le,t as z,ua as R,v as G,va as de,w as Q,y as f,z as D}from"./chunk-A6RTZMN6.js";import Ar from"path";import{createClient as Hr}from"graphql-sse";import qr,{AbortError as jr}from"p-retry";import{graphql as I}from"gql.tada";import{print as Nr}from"graphql";import sr from"fs";import Fe from"net";import{err as Ae,ok as lr}from"neverthrow";async function He({cwd:e,onConnection:o}){M(e);let r=de(e),n=await Le({onConnection:o,socketPath:r});return n.isOk()||n.error.kind!=="stale-candidate"?n.map(De(r)).mapErr(Te(r)):await dr(r)?Ae({kind:"already-running",socketPath:r}):(qe(r),(await Le({onConnection:o,socketPath:r})).map(De(r)).mapErr(Te(r)))}function dr(e){return new Promise(o=>{let r=Fe.connect(e);r.once("connect",()=>{r.destroy(),o(!0)}),r.once("error",()=>{o(!1)})})}async function Le(e){let o=await cr(e);return o.kind==="listening"?lr(o.server):Ae(o.error)}function cr({onConnection:e,socketPath:o}){return new Promise(r=>{let n=Fe.createServer(e);n.once("error",t=>{r({error:t.code==="EADDRINUSE"?{kind:"stale-candidate"}:{kind:"listen-failed",message:t.message},kind:"failed"})}),n.listen(o,()=>{r({kind:"listening",server:n})})})}function De(e){return o=>({socketPath:e,close:()=>{o.close(),qe(e)}})}function qe(e){sr.rmSync(e,{force:!0})}function Te(e){return o=>o.kind==="stale-candidate"?{kind:"already-running",socketPath:e}:{kind:"bind-failed",message:o.message}}function j(e){return{priority:e,next:()=>null,onResult:()=>{}}}function je({config:e,explore:o,exploreConcurrency:r,pool:n}){return ur({appUrl:e.appUrl,cwd:e.cwd,explore:o,exploreConcurrency:r,executeTrail:async(t,i)=>(await n).exploreTrail(t,i)})}function ur({appUrl:e,cwd:o,executeTrail:r,explore:n,exploreConcurrency:t}){let i={notify:()=>{}},a=n?pr({appUrl:e,cwd:o,executeTrail:r,notifyWork:()=>{i.notify()}}):se(),s=We({exploreConcurrency:t,exploreEnabled:n,now:Date.now,probe:fr,setTimer:mr,sources:[j("p0"),j("p1"),a],execute:({job:u,priority:p,signal:c})=>w({headed:!1,workClass:yr(p),task:()=>u.run(c)})});H(()=>{s.notifyQueueChange()}),i.notify=()=>{s.notifyQueueChange()};let l=n?ae({onChange:u=>{s.setExplorerHolder(u)}}):null;return{status:()=>({explorer:kr({explore:n,holder:s.explorerHolder()}),exploring:s.explorationActive(),progress:a.status()}),stop:()=>{l?.stop(),s.stop(),H(null),a.stop()}}}function pr({appUrl:e,cwd:o,executeTrail:r,notifyWork:n}){return le({cwd:o,executeTrail:r,notifyWork:n,loadLockfile:async()=>{let{fingerprint:t,result:i}=await f(o);return i.match(a=>({fingerprint:t,lockfile:a}),()=>null)},probeApp:async()=>await X(e)==null})}function fr(){let e=ye();return{headedActive:e.headedActive,interactiveActive:e.active,interactiveQueued:e.queued,poolSize:e.poolSize}}function mr(e,o){let r=setTimeout(e,o);return()=>{clearTimeout(r)}}function yr(e){switch(e){case"p0":return"p0-ui";case"p1":return"p1-cli";case"p2":return"p2-cover";case"p3":return"p3-explore"}}function kr({explore:e,holder:o}){return e?o?"holder":"standby":"off"}async function Ne({cwd:e,finding:o}){let r={at:new Date().toISOString(),kind:"resolution",signature:o.signature};await A(R(e),[r]).match(()=>{},n=>{d.warn("explore ledger append failed: %s",n.kind)})}async function Oe({cwd:e,finding:o,outcome:r}){let n=r.kind==="clean"?[...r.rows,{at:new Date().toISOString(),kind:"resolution",signature:o.signature}]:r.rows;n.length!==0&&await A(R(e),n).match(()=>{},t=>{d.warn("explore ledger append failed: %s",t.kind)})}function $e({cwd:e,pool:o}){let r={cwd:e,executeTrail:(n,t)=>w({headed:!1,workClass:"p1-cli",task:async()=>(await o).exploreTrail(n,t)}),loadLockfile:async()=>{let n=await f(e);return n.result.match(t=>({fingerprint:n.fingerprint,lockfile:t}),()=>null)}};return(n,t)=>gr(r,{findingId:n,signal:t})}async function gr(e,o){let r=await wr(e.cwd,o.findingId);if("reply"in r)return r.reply;let n=await e.loadLockfile();if(n==null)return{kind:"error",reason:"lockfile-unavailable"};let t=Sr(n,r.finding);if("reply"in t)return t.reply;let i=await e.executeTrail(t.assign,o.signal);return Rr({cwd:e.cwd,finding:r.finding,outcome:i})}async function wr(e,o){return oe(R(e)).match(r=>{let t=[...re(r).findings.entries()].find(([a])=>ee(a)===o);if(t==null)return{reply:{kind:"finding-not-found"}};let[,i]=t;return i.resolvedAt!=null?{reply:{kind:"finding-not-found"}}:{finding:i.latest}},()=>({reply:{kind:"unreplayable",reason:"ledger-unreadable"}}))}function Sr(e,o){let r=te(e.lockfile,{sweep:!1}).find(t=>t.name===o.depot);if(r==null)return{reply:{kind:"unreplayable",reason:"depot-missing"}};let n=vr(e.lockfile,o);return n==null?{reply:{kind:"unreplayable",reason:"transition-missing"}}:{assign:{depotTest:r.test,firings:n,lensId:o.lensId,lockfileFingerprint:e.fingerprint,lockfileHash:ne(e.lockfile),maxLength:n.length,shrinkBudget:0}}}function vr(e,o){let n=Z(e).map(a=>`${a.test}#${String(a.index)}`),i=o.trail.map((a,s)=>{let l=n.indexOf(a),u=o.trailParams[s];return l===-1||u==null?null:{idx:l,params:u}}).flatMap(a=>a==null?[]:[a]);return i.length===o.trail.length?i:null}async function Rr({cwd:e,finding:o,outcome:r}){return r.kind==="aborted"?{kind:"aborted"}:r.kind==="error"?Pr({cwd:e,finding:o,reason:r.reason}):(await Oe({cwd:e,finding:o,outcome:r}),r.kind==="clean"?{kind:"resolved"}:r.kind==="flaky"?{kind:"flaky"}:xr(o,r))}async function Pr({cwd:e,finding:o,reason:r}){return r==="empty-trail"?(await Ne({cwd:e,finding:o}),{kind:"unreachable"}):{kind:"error",reason:r??"trail-error"}}function xr(e,o){let r=o.rows.find(t=>t.kind==="finding"),n=r?.kind==="finding"?r.runId:void 0;return r!=null&&r.signature===e.signature?{kind:"still-failing",runId:n}:{kind:"diverged",runId:n}}async function _e({config:e,cwd:o,headed:r,pool:n,runId:t,signal:i,workClass:a,workflowSlug:s}){let{fingerprint:l,result:u}=await f(o);if(u.isErr())return await h(e,t,`lockfile:${u.error.kind}`),{detail:`lockfile:${u.error.kind}`,kind:"dispatch-error"};if(u.value.tests.find(k=>Q(k.name)===s)==null)return await h(e,t,`no-test:${s}`),{detail:`no-test:${s}`,kind:"dispatch-error"};let c=await w({headed:r,workClass:a,task:()=>n.execute({headed:r,lockfileFingerprint:l,runId:t,workflowSlug:s},i)});return!c.serverNotified&&c.outcome.kind==="error"&&await h(e,t,c.outcome.detail),c.outcome}import{fork as hr}from"child_process";import Ue from"os";import{CancellationTokenSource as Me,ResponseError as Be}from"vscode-jsonrpc/node";function ze(e,o){return()=>{let r=hr(e,["run-worker"],{cwd:o,stdio:["ignore","inherit","inherit","ipc"]});return{connection:Ce(r),kill:()=>{r.kill("SIGKILL")},onExit:n=>{r.once("exit",n)}}}}function Ge(e){let o={closed:!1,lockfileProvider:e.lockfileProvider,nextId:0,size:e.initialSize,spawn:e.spawn,waiters:[],workers:[]};return{close:async()=>{o.closed=!0,await Promise.all([...o.workers].map(r=>N(r,o)))},execute:(r,n)=>Er(r,n,o),exploreTrail:(r,n)=>Wr(r,n,o),routeSpan:(r,n)=>{let t=o.workers.find(i=>i.runId===r);t?.worker.connection.sendNotification(Ee,{runId:r,span:n})},setSize:r=>{Dr(r,o)}}}var br=1e4,Qe=-32800;async function Er(e,o,r){let n=await Je(r);if(n.runId=e.runId,!n.alive)return b(n,r),{outcome:{detail:"worker-exit",kind:"error"},serverNotified:!1};let t=new Me,i=()=>{t.cancel()};o.aborted&&t.cancel(),o.addEventListener("abort",i,{once:!0});try{let a=await n.worker.connection.sendRequest(xe,e,t.token),s=ve.safeParse(a);return s.success?s.data:{outcome:{detail:"bad-outcome-frame",kind:"error"},serverNotified:!1}}catch(a){return Cr(a,n)}finally{o.removeEventListener("abort",i),t.dispose(),b(n,r)}}async function Je(e){let o=e.workers.find(r=>r.alive&&r.runId===void 0);if(o!=null)return o.runId="pending",o;if(e.workers.length<e.size){let r=Ir(e);return r.runId="pending",await r.ready,r}return new Promise(r=>{e.waiters.push(n=>{n.runId="pending",r(n)})})}function Ir(e){let o=e.spawn(),r={resolve:()=>{}},n={alive:!0,id:e.nextId,ready:new Promise(t=>{r.resolve=t,o.connection.onNotification(Pe,t)}),runId:void 0,worker:o};return e.nextId+=1,o.connection.onRequest(he,async t=>{let i=Se.safeParse(t);return i.success?e.lockfileProvider(i.data.fingerprint):{unavailable:"bad-lockfile-request"}}),o.onExit(()=>{n.alive=!1,e.workers=e.workers.filter(t=>t!==n),o.connection.dispose(),r.resolve()}),e.workers.push(n),n}function b(e,o){if(e.runId=void 0,!e.alive||o.closed)return;if(o.workers.length>o.size){N(e,o);return}let r=o.waiters.shift();r?.(e)}async function N(e,o){if(o.workers=o.workers.filter(t=>t!==e),!e.alive)return;let r=new Promise(t=>{e.worker.onExit(t)});await e.worker.connection.sendNotification(Ie).catch(()=>{});let n=setTimeout(()=>{e.worker.kill()},br);await r,clearTimeout(n)}function Cr(e,o){return e instanceof Be&&e.code===Qe?{outcome:{detail:"aborted",kind:"error"},serverNotified:!1}:o.alive?{outcome:{detail:e instanceof Error?e.message:String(e),kind:"error"},serverNotified:!1}:{outcome:{detail:"worker-exit",kind:"error"},serverNotified:!1}}async function Wr(e,o,r){let n=await Je(r);if(n.runId="explore",!n.alive)return b(n,r),{kind:"error",rows:[],trail:[]};let t=new Me,i=()=>{t.cancel()};o.aborted&&t.cancel(),o.addEventListener("abort",i,{once:!0});try{let a=await n.worker.connection.sendRequest(be,e,t.token),s=Re.safeParse(a);return s.success?s.data:{kind:"error",rows:[],trail:[]}}catch(a){return Lr(a)}finally{o.removeEventListener("abort",i),t.dispose(),b(n,r)}}function Lr(e){return e instanceof Be&&e.code===Qe?{kind:"aborted",rows:[],trail:[]}:{kind:"error",reason:`transport:${e instanceof Error?e.message.slice(0,120):"unknown"}`,rows:[],trail:[]}}function Dr(e,o){o.size=e,e>Ue.availableParallelism()&&d.warn({cores:Ue.availableParallelism(),size:e},"worker pool size exceeds available cores");let r=o.workers.filter(t=>t.alive&&t.runId===void 0),n=o.workers.length-e;r.slice(0,Math.max(0,n)).forEach(t=>{N(t,o)})}import E from"fs";import{graphql as Ke}from"gql.tada";import{print as Ve}from"graphql";var Tr=Ke(`
|
|
3
3
|
subscription HooksPausedWatch($projectId: String!) {
|
|
4
4
|
hooksPausedRequested(projectId: $projectId) {
|
|
5
5
|
paused
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{$ as Rt,$a as Qt,A as d,Aa as Ft,B as dt,Ba as Nt,C as x,Ca as Ut,D as pt,Da as Ht,E as ut,Ea as Mt,F as mt,Fa as Wt,G as ft,Ga as qt,H as E,Ha as Bt,I,Ia as Vt,J as gt,Ja as Gt,K as w,L as de,O as _,P as ht,Pa as Jt,Q as yt,Qa as te,R as Z,Ra as zt,S as kt,T as wt,U as pe,V as vt,W as bt,X as ue,Xa as re,Y as R,Ya as Kt,Z as St,Za as Ne,_ as xt,a as Qe,b as D,ba as Ct,bb as Yt,ca as me,d as Ye,db as Xt,e as Xe,f as p,fb as Zt,g as ce,h as Ze,ha as Pt,hb as er,i as Oe,ib as tr,j as O,ja as Et,jb as rr,k as et,kb as nr,l as tt,la as $t,lb as or,m as rt,ma as It,mb as ir,n as nt,na as ee,o as ot,oa as v,ob as sr,p as it,pa as jt,q as W,qa as At,r as st,s as at,sa as Lt,t as q,ta as Tt,u as lt,v as N,va as _e,w as P,wa as Fe,x as L,xa as Dt,y as ct,ya as Ot,z as S,za as _t}from"./chunk-
|
|
2
|
+
import{$ as Rt,$a as Qt,A as d,Aa as Ft,B as dt,Ba as Nt,C as x,Ca as Ut,D as pt,Da as Ht,E as ut,Ea as Mt,F as mt,Fa as Wt,G as ft,Ga as qt,H as E,Ha as Bt,I,Ia as Vt,J as gt,Ja as Gt,K as w,L as de,O as _,P as ht,Pa as Jt,Q as yt,Qa as te,R as Z,Ra as zt,S as kt,T as wt,U as pe,V as vt,W as bt,X as ue,Xa as re,Y as R,Ya as Kt,Z as St,Za as Ne,_ as xt,a as Qe,b as D,ba as Ct,bb as Yt,ca as me,d as Ye,db as Xt,e as Xe,f as p,fb as Zt,g as ce,h as Ze,ha as Pt,hb as er,i as Oe,ib as tr,j as O,ja as Et,jb as rr,k as et,kb as nr,l as tt,la as $t,lb as or,m as rt,ma as It,mb as ir,n as nt,na as ee,o as ot,oa as v,ob as sr,p as it,pa as jt,q as W,qa as At,r as st,s as at,sa as Lt,t as q,ta as Tt,u as lt,v as N,va as _e,w as P,wa as Fe,x as L,xa as Dt,y as ct,ya as Ot,z as S,za as _t}from"./chunk-A6RTZMN6.js";import Jl from"yargs";import{hideBin as zl}from"yargs/helpers";import{readFileSync as yo}from"fs";import{z as ar}from"zod";var ko=ar.object({version:ar.string()});function lr(){let e=yo(new URL("../package.json",import.meta.url),"utf8");return ko.parse(JSON.parse(e)).version}import{graphql as Lo}from"gql.tada";import{exec as bo}from"child_process";import{createAuthClient as wo}from"better-auth/client";import{deviceAuthorizationClient as vo}from"better-auth/client/plugins";function cr({baseURL:e}){return wo({baseURL:e,fetchOptions:{headers:{"User-Agent":"Ripplo CLI"}},plugins:[vo()]})}import{err as dr,ok as So}from"neverthrow";var xo=5e3,pr="ripplo-cli";async function ur({onDeviceCode:e,url:t}){let r=t??gt().RIPPLO_SERVER_URL,n=cr({baseURL:r}),o=await n.device.code({client_id:pr});if(o.error!=null)return dr({description:o.error.error_description,kind:"oauth-device-code-failed"});let{device_code:i,user_code:a,verification_uri_complete:s}=o.data;return e({userCode:a,verificationUrl:s}),Io(s),(await Ro({authClient:n,deviceCode:i})).map(c=>(et(c),c))}async function Ro({authClient:e,deviceCode:t}){for(;;){await Eo(xo);let r=await e.device.token({client_id:pr,device_code:t,grant_type:"urn:ietf:params:oauth:grant-type:device_code"});if(r.data?.access_token!=null)return So(r.data.access_token);if(r.error==null)continue;if(!Po(r.error.error))return dr({code:r.error.error,description:r.error.error_description,kind:"oauth-authorization-failed"})}}var Co=new Set(["authorization_pending","slow_down"]);function Po(e){return Co.has(e)}function Eo(e){return new Promise(t=>{setTimeout(t,e)})}function $o(){return process.platform==="darwin"?"open":process.platform==="win32"?"start":"xdg-open"}function Io(e){let t=$o();bo(`${t} "${e}"`,()=>{})}function U({serverUrl:e,token:t}){return{appUrl:"",cwd:process.cwd(),engineUrl:"",projectId:"",ripploServerUrl:e,token:t,webhookSecret:""}}import jo from"fs";import Ao from"path";function m(e){return jo.existsSync(Ao.join(e,".ripplo"))}var To=Lo(`
|
|
3
3
|
query AuthViewer {
|
|
4
4
|
currentUser {
|
|
5
5
|
name
|
|
@@ -305,7 +305,7 @@ iframe { border: none; }
|
|
|
305
305
|
`),process.exit(1)}),n=r.lockfile.tests.length,o=r.lockfile.entities.length;process.stdout.write(`synced ${String(n)} tests, ${String(o)} entities to dev session ${r.devSessionId}
|
|
306
306
|
`)}catch(t){let r=t instanceof Error?t.message:String(t);process.stderr.write(`ripplo sync failed: ${r}
|
|
307
307
|
`),process.stderr.write(`${d("setup","verify auth + server reachability")}
|
|
308
|
-
`),process.exit(1)}}async function wn({explore:e,exploreConcurrency:t}){let{runDaemon:r}=await import("./daemon-
|
|
308
|
+
`),process.exit(1)}}async function wn({explore:e,exploreConcurrency:t}){let{runDaemon:r}=await import("./daemon-7Z53WGU3.js");await r({explore:e,exploreConcurrency:t})}import{graphql as Ie}from"gql.tada";function vn(){return"No scope items added \u2014 the matched tests are already in scope (check `ripplo scope status`)."}function bn(e){return[`No test found for: ${e.join(", ")}`,"Pass a test id (kebab-case slug of the test name) or the exact intent string.","List known tests with `ripplo status`; stub a new one first via the testing DSL.",d("create")].join(`
|
|
309
309
|
`)}import{graphql as fa}from"gql.tada";var Sn=fa(`
|
|
310
310
|
query ScopeStatus($projectId: String!, $cwd: String!) {
|
|
311
311
|
project(id: $projectId) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ripplo",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.7",
|
|
4
4
|
"description": "CLI for Ripplo — AI-powered end-to-end testing",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"homepage": "https://ripplo.ai",
|
|
@@ -53,11 +53,11 @@
|
|
|
53
53
|
"eslint-plugin-neverthrow": "^1.1.4",
|
|
54
54
|
"tsup": "^8.5.1",
|
|
55
55
|
"vitest": "^4.1.4",
|
|
56
|
+
"@ripplo/spec": "^0.0.0",
|
|
57
|
+
"@ripplo/runtime": "^0.0.0",
|
|
56
58
|
"@ripplo/core": "^0.0.0",
|
|
57
59
|
"@ripplo/eslint-config": "0.0.0",
|
|
58
|
-
"@ripplo/runtime": "^0.0.0",
|
|
59
60
|
"@ripplo/rrweb-bundle": "0.0.0",
|
|
60
|
-
"@ripplo/spec": "^0.0.0",
|
|
61
61
|
"@ripplo/graphql": "^0.0.0"
|
|
62
62
|
},
|
|
63
63
|
"scripts": {
|