ripplo 0.7.37 → 0.7.38
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{B as Je,V as Ke,W as Qe,Z as Ge,_ as Xe,a as N,b as De,g as _e,i as qe,j as He,k as We,l as g,m as Be,o as Ve,p as ie,q as h,r as F,s as ze,w as I}from"./chunk-
|
|
2
|
+
import{B as Je,V as Ke,W as Qe,Z as Ge,_ as Xe,a as N,b as De,g as _e,i as qe,j as He,k as We,l as g,m as Be,o as Ve,p as ie,q as h,r as F,s as ze,w as I}from"./chunk-FKRW3DWK.js";import{b as Ue,d as f,e as y,g as Oe,h as w,i as Ne}from"./chunk-5VRJXHWH.js";import en from"fs";import W from"path";import{config as kt}from"dotenv";import{z as q}from"zod";import{err as St,ok as nn}from"neverthrow";import _ from"fs";import le from"path";import{err as ae,ok as Ye}from"neverthrow";import{z as D}from"zod";var mt=le.join(".ripplo","project.json"),se=[".env",".env.local"],gt=D.object({envFiles:D.array(D.string().min(1)).optional(),projectId:D.string().min(1)});function Ze(e){return le.join(e,mt)}function de(e){let n=Ze(e);return _.existsSync(n)?ht(n).andThen(t=>{let r=gt.safeParse(t);return r.success?Ye({envFiles:r.data.envFiles??se,projectId:r.data.projectId}):ae({issues:r.error.issues.map(o=>`${o.path.join(".")}: ${o.message}`),kind:"project-file-invalid",path:n})}):ae({kind:"project-file-missing",path:n})}function ce(e){return de(e).match(n=>n,()=>{})}function ht(e){try{return Ye(JSON.parse(_.readFileSync(e,"utf8")))}catch(n){return ae({issues:[n instanceof Error?n.message:String(n)],kind:"project-file-invalid",path:e})}}function zi({cwd:e,envFiles:n,projectId:t}){let r=Ze(e);_.mkdirSync(le.dirname(r),{recursive:!0});let o={projectId:t};n!=null&&!Rt(n)&&(o.envFiles=[...n]),_.writeFileSync(r,JSON.stringify(o,null,2)+`
|
|
3
3
|
`)}function Rt(e){return e.length!==se.length?!1:e.every((n,t)=>n===se[t])}function ea(e){let t=ce(e)?.envFiles??[".env",".env.local"],r=W.join(e,".ripplo");t.forEach(o=>{let i=W.resolve(r,o);en.existsSync(i)&&kt({override:!0,path:i,quiet:!0})}),H=void 0}var xt=q.object({RIPPLO_APP_URL:q.url(),RIPPLO_ENGINE_URL:q.url(),RIPPLO_WEBHOOK_SECRET:q.string().min(1)}),H;function B(){return H!=null?nn(H):bt().map(e=>(H=e,e))}function wt(e){let t=ce(e)?.envFiles??[],r=W.join(e,".ripplo");return t.map(o=>W.resolve(r,o)).filter(o=>!en.existsSync(o))}function bt(){let e=xt.safeParse(process.env);if(!e.success)return St({issues:e.error.issues.map(t=>`${t.path.join(".")}: ${t.message}`),kind:"env-invalid",missingEnvFiles:wt(process.cwd())});let n=e.data;return nn({appUrl:n.RIPPLO_APP_URL,engineUrl:n.RIPPLO_ENGINE_URL,webhookSecret:n.RIPPLO_WEBHOOK_SECRET})}import{readFileSync as Et}from"fs";import{z as tn}from"zod";var vt=tn.object({version:tn.string()});function V(){let e=Et(new URL("../package.json",import.meta.url),"utf8");return vt.parse(JSON.parse(e)).version}import me from"fs";import z from"path";import{createJiti as Lt}from"jiti";import{err as U,ok as sn}from"neverthrow";import It from"fs";import M from"path";import P from"typescript";function rn(e){let n=M.join(e,"index.ts"),t=Tt(e);It.mkdirSync(M.dirname(t.tsBuildInfoFile??""),{recursive:!0});let r=P.createIncrementalCompilerHost(t),o=P.createIncrementalProgram({host:r,options:t,rootNames:[n]}),i=[...o.getSyntacticDiagnostics(),...o.getSemanticDiagnostics()];o.emit();let s=i.filter(d=>Pt(d,e));if(s.length===0)return{diagnostics:[],ok:!0};let l={getCanonicalFileName:d=>d,getCurrentDirectory:()=>M.dirname(e),getNewLine:()=>`
|
|
4
4
|
`};return{diagnostics:P.formatDiagnosticsWithColorAndContext(s,l).split(`
|
|
5
5
|
`).filter(d=>d.length>0),ok:!1}}function Pt(e,n){let t=e.file?.fileName;return t==null?!0:t.startsWith(n)}var Ct=M.join(".local","tsbuildinfo");function Tt(e){return{allowImportingTsExtensions:!0,allowJs:!1,esModuleInterop:!0,incremental:!0,module:P.ModuleKind.Preserve,moduleResolution:P.ModuleResolutionKind.Bundler,noEmit:!0,resolveJsonModule:!0,skipLibCheck:!0,strict:!1,target:P.ScriptTarget.ES2022,tsBuildInfoFile:M.join(e,Ct)}}import{createHash as jt}from"crypto";import on from"fs/promises";import ue from"path";import{err as C,ok as pe,Result as At}from"neverthrow";var $=".ripplo/fixtures",fe=10*1024*1024,ye=50*1024*1024;async function an(e,n){let t=Ft(n);if(t.length===0)return pe({});let r=ue.join(e,$),o=await Promise.all(t.map(i=>Mt({fixturesRoot:r,name:i})));return At.combine(o).andThen($t)}function Ft(e){let t=e.workflows.flatMap(r=>[...r.steps,...r.tests.flatMap(o=>o.steps)]).flatMap(r=>r.action.kind==="upload"?r.action.files:[]);return[...new Set(t)].toSorted((r,o)=>r.localeCompare(o))}async function Mt({fixturesRoot:e,name:n}){if(n.includes("..")||ue.isAbsolute(n))return C({kind:"fixture-invalid-name",name:n});let t=ue.join(e,n),r=await on.lstat(t).catch(()=>null);if(r==null)return C({kind:"fixture-missing",name:n,path:t});if(r.isSymbolicLink())return C({kind:"fixture-symlink",name:n});if(!r.isFile())return C({kind:"fixture-not-file",name:n});let o=await on.readFile(t);if(o.byteLength>fe)return C({kind:"fixture-too-large",name:n,size:o.byteLength});let i=jt("sha256").update(o).digest("hex");return pe([n,{sha256:i,size:o.byteLength}])}function $t(e){let n=e.reduce((t,[,r])=>t+r.size,0);return n>ye?C({kind:"fixtures-total-too-large",total:n}):pe(Object.fromEntries(e))}var T=".ripplo/ripplo.lock",L;async function ln(e){let{result:n}=await ge(e);return n}async function ge(e){let n=Ot(z.join(e,".ripplo"));if(L!=null&&L.fingerprint===n&&L.result.isOk())return{fingerprint:n,result:L.result};let t=await O(e);return L={fingerprint:n,result:t},{fingerprint:n,result:t}}async function O(e){let n=z.join(e,".ripplo"),t=z.join(n,"index.ts"),r=rn(n);return r.ok?(await Nt(t)).andThen(s=>_t({entryPath:t,exported:s})).match(async s=>(await an(e,s)).map(u=>({...s,fixtures:u})).mapErr(u=>({error:u,kind:"fixture-failed"})),s=>Promise.resolve(U(s))):U({diagnostics:r.diagnostics,kind:"typecheck-failed"})}var Ut=new Set([".local","debug","node_modules"]);function Ot(e){return dn(e).toSorted((n,t)=>n.localeCompare(t)).join("|")}function dn(e){return(me.existsSync(e)?me.readdirSync(e,{withFileTypes:!0}):[]).flatMap(t=>{if(Ut.has(t.name))return[];let r=z.join(e,t.name);if(t.isDirectory())return dn(r);let o=me.statSync(r);return[`${r}:${String(o.mtimeMs)}:${String(o.size)}`]})}async function Nt(e){try{let t=await Lt(import.meta.url,{fsCache:!1,moduleCache:!1,sourceMaps:!0}).import(e),r=t!=null&&typeof t=="object"&&"default"in t?Reflect.get(t,"default"):t;return sn(r)}catch(n){return U({kind:"load-threw",message:Dt(n)})}}function Dt(e){return e instanceof Error?e.message:String(e)}function _t({entryPath:e,exported:n}){if(n==null||typeof n!="object"||!("lockfile"in n))return U({entryPath:e,kind:"not-ripplo"});let t=_e.safeParse(Reflect.get(n,"lockfile"));return t.success?sn(t.data):U({issues:t.error.issues.map(r=>`${r.path.join(".")}: ${r.message}`),kind:"invalid-lockfile"})}function j(e,n){return n==null?`Load \`/ripplo:${e}\` skill for instructions.`:`Load \`/ripplo:${e}\` skill for instructions on ${n}.`}function wa(e){return e.length===1?j(e[0]):`Before proceeding, load the ${e.map(t=>`\`/ripplo:${t}\``).join(" and ")} skills \u2014 every one, each carries rules the others don't.`}function K(e){return[`Compilation failed: ${qt(e)}`,j("create","DSL authoring + lint rules")].join(`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{aa as a,ba as b,ca as c,da as d,ea as e,fa as f,ga as g,ha as h,ia as i,ja as j,ka as k}from"./chunk-
|
|
2
|
+
import{aa as a,ba as b,ca as c,da as d,ea as e,fa as f,ga as g,ha as h,ia as i,ja as j,ka as k}from"./chunk-FKRW3DWK.js";import"./chunk-IHSHBPJY.js";import"./chunk-7UWDMECF.js";export{b as renderDaemonBindError,g as renderDaemonLockCompromised,f as renderDaemonLockHeld,e as renderDaemonReady,h as renderDaemonStatus,j as renderDaemonVersionNote,i as renderExplorationProgress,d as renderNotSignedIn,c as renderProjectAccessDenied,a as renderTunnelProvisionFailed,k as wireOutcome};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{$ as Ie,B as ie,D as me,F as ye,U as be,V as xe,W as Pe,X as Re,Y as Ee,Z as Te,_ as Ce,b as K,ba as P,ca as R,da as We,e as Y,ea as M,fa as Ae,h as x,ha as U,i as re,ia as Le,j as H,ja as De,m as _,ma as E,na as He,oa as _e,pa as Me,qa as Ue,r as oe,sa as qe,u as w,w as ne,x as te}from"./chunk-
|
|
2
|
+
import{$ as Ie,B as ie,D as me,F as ye,U as be,V as xe,W as Pe,X as Re,Y as Ee,Z as Te,_ as Ce,b as K,ba as P,ca as R,da as We,e as Y,ea as M,fa as Ae,h as x,ha as U,i as re,ia as Le,j as H,ja as De,m as _,ma as E,na as He,oa as _e,pa as Me,qa as Ue,r as oe,sa as qe,u as w,w as ne,x as te}from"./chunk-Z3BGWZB4.js";import{G as se,I as ce,J as de,K as ue,L as pe,T as fe,ba as ge,ca as Se,da as ke,e as X,ea as ve,fa as we,ga as he,h as Z,i as D,l as ee,n as ae,q as le}from"./chunk-FKRW3DWK.js";import{b as Oe}from"./chunk-RLXQYG7H.js";import{c as G,d as g,e as s,f as L,g as V}from"./chunk-5VRJXHWH.js";import"./chunk-IHSHBPJY.js";import"./chunk-7UWDMECF.js";import Bo from"path";import{createClient as jo}from"graphql-sse";import zo,{AbortError as Jo}from"p-retry";import{graphql as z}from"gql.tada";import{graphql as Ar}from"gql.tada";import{print as Lr}from"graphql";async function Fe({config:e,cwd:r,headed:o,pool:n,runId:t,signal:i,testSlug:a,workClass:l,workflowSlug:c}){let u=await x(r);if(u.isErr())return await E(e,t,`lockfile:${u.error.kind}`),{kind:"dispatch-error",reason:{detail:`lockfile:${u.error.kind}`,type:"generic"}};let p=Wr(u.value,{testSlug:a,workflowSlug:c});if(p==null)return await E(e,t,`no-test:${c}/${a}`),{kind:"dispatch-error",reason:{detail:`no-test:${c}/${a}`,type:"generic"}};let d=await P({headed:o,workClass:l,task:()=>n.execute({headed:o,runId:t,testRef:p},i)});return!d.serverNotified&&d.outcome.kind==="error"&&await E(e,t,d.outcome.detail),d.outcome}function Wr(e,{testSlug:r,workflowSlug:o}){let t=e.workflows.find(i=>ee(i.name)===o)?.tests.find(i=>i.slug===r);return t==null?void 0:le(t)}var Dr=6e4,Hr=Ar(`
|
|
3
3
|
subscription RunRequestedWatch($devSessionId: String!) {
|
|
4
4
|
runRequested(devSessionId: $devSessionId) {
|
|
5
5
|
runId
|