ripplo 0.11.2 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-CEUZS5YN.js → chunk-2UJUWE7A.js} +1 -1
- package/dist/{chunk-LFBAW3EA.js → chunk-3FTGPUK3.js} +1 -1
- package/dist/{chunk-LBSM7G4L.js → chunk-3VL4ORWB.js} +1 -1
- package/dist/{chunk-XJRG46JA.js → chunk-6UJNBCPU.js} +1 -1
- package/dist/{chunk-6HGQIP4L.js → chunk-77BRFU6M.js} +1 -1
- package/dist/{chunk-TDIT65FZ.js → chunk-7GY5ANXL.js} +1 -1
- package/dist/{chunk-ISLXOVJF.js → chunk-7JKAV7AT.js} +1 -1
- package/dist/{chunk-TROVQD5M.js → chunk-BTNSUORZ.js} +1 -1
- package/dist/{chunk-UNYR7SAP.js → chunk-JMJXM477.js} +1 -1
- package/dist/{chunk-WZBHHW7X.js → chunk-KAD7UO53.js} +22 -22
- package/dist/{chunk-2QZIICHO.js → chunk-ORWKDV2H.js} +1 -1
- package/dist/{chunk-XA4ZWH7N.js → chunk-QK7AEQ3B.js} +2 -2
- package/dist/{chunk-2V4XEAR4.js → chunk-RJ6MN3PT.js} +2 -2
- package/dist/{chunk-7BLJ6357.js → chunk-RYR5R3FA.js} +1 -1
- package/dist/chunk-SQ4SBMKG.js +83 -0
- package/dist/{chunk-GL66NIOQ.js → chunk-SVM5ORF6.js} +1 -1
- package/dist/{chunk-XPPUVBTI.js → chunk-UAWFWSKD.js} +1 -1
- package/dist/{chunk-XSO43S23.js → chunk-XBAVNTRQ.js} +1 -1
- package/dist/{chunk-22KCYZGP.js → chunk-ZW76MTLE.js} +1 -1
- package/dist/{cli-error-VML3CZTB.js → cli-error-PG24CNXE.js} +1 -1
- package/dist/{compile-write-AWMMKBY4.js → compile-write-LMAPZGYL.js} +1 -1
- package/dist/{daemon-RDOVYYAZ.js → daemon-HTI5DVL2.js} +1 -1
- package/dist/{daemon-2LB22RRW.js → daemon-SIPLLQJP.js} +1 -1
- package/dist/{dsl-loader-GZILSBK5.js → dsl-loader-I6F73IFP.js} +1 -1
- package/dist/hook.js +1 -1
- package/dist/index.js +174 -201
- package/dist/{plan-reminder-V7RZXP37.js → plan-reminder-MR2UFQZE.js} +1 -1
- package/dist/{post-edit-D6EBGSYK.js → post-edit-76WC4SU3.js} +1 -1
- package/dist/post-edit-analyze-5F5VSL4T.js +4 -0
- package/dist/{post-edit-flag-stubs-CGV4LWX2.js → post-edit-flag-stubs-UJ2SZJVQ.js} +1 -1
- package/dist/pre-bash-run-gate-CDFNAIK3.js +4 -0
- package/dist/{pre-edit-MPV73OUC.js → pre-edit-YGDITCNZ.js} +1 -1
- package/dist/{pre-edit-watch-gate-BXICNZNF.js → pre-edit-watch-gate-4V2KYSIF.js} +1 -1
- package/dist/{prompt-submit-DO3YGL4V.js → prompt-submit-ARRJRLMC.js} +1 -1
- package/dist/status-VWZXTEWF.js +4 -0
- package/dist/{stop-enforce-CEUM4LIV.js → stop-enforce-BLX3ZEDG.js} +1 -1
- package/package.json +1 -1
- package/dist/chunk-6PEFUZNO.js +0 -83
- package/dist/post-edit-analyze-NSUCATEN.js +0 -4
- package/dist/pre-bash-run-gate-MIEM2DBB.js +0 -4
- package/dist/status-4LFECRO4.js +0 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __ripploCreateRequire } from "node:module";
|
|
3
3
|
const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
|
|
4
|
-
import{
|
|
4
|
+
import{Da as $,S as M,T as _,ma as z,na as I,oa as g}from"./chunk-KAD7UO53.js";import w from"fs";import s from"path";import{createHash as ve}from"crypto";import{pathToFileURL as Me}from"url";import{build as _e}from"esbuild";import{err as l,ok as F,ResultAsync as ze}from"neverthrow";import b from"fs";import{execFile as se}from"child_process";import{promisify as ae}from"util";import{fileURLToPath as C}from"url";import{z as L}from"zod";var ce=ae(se),le=L.object({diagnostics:L.array(L.string()),ok:L.boolean()});async function H(e){let r=de(),{stdout:n}=await ce(process.execPath,[...r.args,e],{maxBuffer:10*1024*1024}),t=JSON.parse(n);return le.parse(t)}function de(){let e=C(new URL("dsl-typecheck-worker.js",import.meta.url));if(b.existsSync(e))return{args:[e]};let r=C(new URL("../../dist/dsl-typecheck-worker.js",import.meta.url));if(b.existsSync(r))return{args:[r]};let n=C(new URL("../dsl-typecheck-worker.ts",import.meta.url));if(b.existsSync(n))return{args:["--experimental-strip-types",n]};throw new Error("DSL typecheck worker missing")}import ge from"safe-stable-stringify";import{err as he,ok as K,Result as ke}from"neverthrow";import{z as xe}from"zod";import k from"fs";import U from"path";import{z as u}from"zod";import{createHash as ue}from"crypto";function c(e){return ue("sha256").update(e).digest("base64")}var fe="fd3",pe="fold2";function T(){return`${String(g.currentVersion)}:${fe}:${pe}`}function x(e){return c([T(),...e].join("\0"))}function R({cwd:e,key:r,kind:n}){return D(e,n)?.entries.find(([o])=>o===r)?.[1]}function P({cwd:e,keep:r,key:n,kind:t,value:o}){let p=(D(e,t)?.entries??[]).filter(([a])=>a!==n),S=[n,o],v=[...p,S].slice(-r),y=N(e,t),d={entries:v,epoch:T()};k.mkdirSync(U.dirname(y),{recursive:!0}),k.writeFileSync(y,JSON.stringify(d)),h=new Map([...h,[y,{signature:B(y),store:d}]])}var ye=u.object({entries:u.array(u.tuple([u.string(),u.unknown()])),epoch:u.string()}),h=new Map;function D(e,r){let n=N(e,r),t=B(n),o=h.get(n);if(o!=null&&o.signature===t)return o.store;let i=me({signature:t,storePath:n});return h=new Map([...h,[n,{signature:t,store:i}]]),i}function me({signature:e,storePath:r}){if(e!=null)try{let n=ye.safeParse(JSON.parse(k.readFileSync(r,"utf8")));return!n.success||n.data.epoch!==T()?void 0:n.data}catch{return}}function B(e){if(!k.existsSync(e))return;let r=k.statSync(e);return`${String(r.mtimeMs)}:${String(r.size)}`}function N(e,r){return U.join(e,".ripplo",".local","cache",`${r}.json`)}async function J(e,r){let n=await V({cwd:r,workflows:e.workflows});return ke.combine(n).map(t=>({...e,workflows:[...t]}))}var Ee=xe.array(z),X=4;async function V({cwd:e,workflows:r}){if(r.length===0)return[];let n=r.slice(0,X),t=await Promise.all(n.map(i=>we({cwd:e,workflow:i}))),o=await V({cwd:e,workflows:r.slice(X)});return[...t,...o]}async function we({cwd:e,workflow:r}){let n=x(["expand",Se(r)]),t=Ee.safeParse(R({cwd:e,key:n,kind:"expand"}));if(t.success)return K({...r,tests:t.data});try{let o=await $({workflow:r});return P({cwd:e,keep:2e3,key:n,kind:"expand",value:o.tests}),K(o)}catch(o){let i=o instanceof Error?o.message:String(o);return he({kind:"expand-failed",message:i,workflow:r.name})}}function Se(e){let r=ge({...e,tests:[]});if(r==null)throw new Error("solver: workflow is not serializable");return r}import{createHash as Le}from"crypto";import G from"fs/promises";import j from"path";import{err as f,ok as A,Result as Re}from"neverthrow";var Pe=".ripplo/fixtures",Fe=10*1024*1024,be=50*1024*1024;async function Y(e,r){let n=Ce(r);if(n.length===0)return A({});let t=j.join(e,Pe),o=await Promise.all(n.map(i=>Te({fixturesRoot:t,name:i})));return Re.combine(o).andThen(je)}function Ce(e){let n=e.workflows.flatMap(t=>[...t.steps,...t.tests.flatMap(o=>o.steps)]).flatMap(t=>t.action.kind==="upload"?t.action.files:[]);return[...new Set(n)].toSorted((t,o)=>t.localeCompare(o))}async function Te({fixturesRoot:e,name:r}){if(r.includes("..")||j.isAbsolute(r))return f({kind:"fixture-invalid-name",name:r});let n=j.join(e,r),t=await G.lstat(n).catch(()=>null);if(t==null)return f({kind:"fixture-missing",name:r,path:n});if(t.isSymbolicLink())return f({kind:"fixture-symlink",name:r});if(!t.isFile())return f({kind:"fixture-not-file",name:r});let o=await G.readFile(n);if(o.byteLength>Fe)return f({kind:"fixture-too-large",name:r,size:o.byteLength});let i=Le("sha256").update(o).digest("hex");return A([r,{sha256:i,size:o.byteLength}])}function je(e){let r=e.reduce((n,[,t])=>n+t.size,0);return r>be?f({kind:"fixtures-total-too-large",total:r}):A(Object.fromEntries(e))}import Z from"fs";import Ae from"path";import{z as O}from"zod";function q({cwd:e,fingerprint:r}){let n=ee(e);if(n==null||n.fingerprint!==c(r))return;let t=Ae.join(e,".ripplo","ripplo.lock");if(!Z.existsSync(t))return;let o=Z.readFileSync(t,"utf8");if(c(o)===n.lockfileHash)try{let i=_(g,o);return Oe(i)?void 0:i}catch{return}}function Oe(e){return e.workflows.some(({sourcePath:r})=>r?.startsWith(".local/")===!0)}function Q({cwd:e,fingerprint:r,lockfile:n}){re(e,{fingerprint:c(r),lockfileHash:c(M(g,n))})}function jr(e,r){let n=ee(e);n!=null&&re(e,{...n,lockfileHash:c(r)})}var We=O.object({fingerprint:O.string(),lockfileHash:O.string()});function ee(e){let r=We.safeParse(R({cwd:e,key:x(["load"]),kind:"load"}));return r.success?r.data:void 0}function re(e,r){P({cwd:e,keep:1,key:x(["load"]),kind:"load",value:r})}var Br=".ripplo/ripplo.lock",E;async function Nr(e){let{result:r}=await Ie(e);return r}async function Ie(e){let r=te(s.join(e,".ripplo"));if(E!=null&&E.fingerprint===r&&E.result.isOk())return{fingerprint:r,result:E.result};let n=await $e(e);return E={fingerprint:r,result:n},{fingerprint:r,result:n}}async function $e(e){let r=s.join(e,".ripplo"),n=s.join(r,"index.ts"),t=te(r),o=q({cwd:e,fingerprint:t});if(o!=null)return F(o);let i=Xe(n);i.catch(()=>{});let p=await He(r);if(p.isErr())return l(p.error);let S=p.value;if(!S.ok)return l({diagnostics:S.diagnostics,kind:"typecheck-failed"});let d=await(await Je(n,i)).andThen(a=>Ye({entryPath:n,exported:a})).match(async a=>(await Y(e,a)).map(m=>({...a,fixtures:m})).mapErr(m=>({error:m,kind:"fixture-failed"})).asyncAndThen(m=>new ze(J(m,e)).mapErr(ie=>ie)),a=>Promise.resolve(l(a)));return d.isOk()&&Q({cwd:e,fingerprint:t,lockfile:d.value}),d}async function He(e){try{return F(await H(e))}catch(r){return l(ne(r))}}function ne(e){return Ue(e)?{kind:"authoring-error",message:e.message}:{kind:"load-threw",message:Ge(e)}}function Ue(e){return e instanceof Error&&e.name==="RipploAuthoringError"}var De=new Set([".local",".turbo","debug","node_modules","ripplo.lock"]);function te(e){let r=s.join(e,"..","node_modules","@ripplo","testing");return[...W(e),...Ne(s.join(r,"package.json")),...Ke(r)].toSorted((n,t)=>n.localeCompare(t)).join("|")}function W(e){return Be(e).flatMap(r=>{if(De.has(r.name))return[];let n=s.join(e,r.name);if(r.isDirectory())return W(n);let t=oe(n);return t==null?[]:[`${n}:${String(t.mtimeMs)}:${String(t.size)}`]})}function Be(e){try{return w.readdirSync(e,{withFileTypes:!0})}catch{return[]}}function oe(e){try{return w.statSync(e)}catch{return}}function Ne(e){let r=oe(e);return r==null?[]:[`${e}:${String(r.mtimeMs)}:${String(r.size)}`]}function Ke(e){let r=s.join(e,"src");return w.existsSync(r)?W(r):[]}async function Xe(e){let n=(await _e({bundle:!0,entryPoints:[e],format:"esm",logLevel:"silent",platform:"node",sourcemap:"inline",target:"node22",write:!1})).outputFiles[0];if(n==null)throw new Error("dsl bundle produced no output");return n.text}async function Je(e,r){try{let n=await r;process.setSourceMapsEnabled(!0);let t=await import(Ve(e,n)),o=t!=null&&typeof t=="object"&&"default"in t?Reflect.get(t,"default"):t;return F(o)}catch(n){return l(ne(n))}}function Ve(e,r){let n=s.join(s.dirname(e),".local");w.mkdirSync(n,{recursive:!0});let t=ve("sha256").update(r).digest("hex").slice(0,16),o=s.join(n,`dsl-bundle-${t}.mjs`);return w.writeFileSync(o,r),Me(o).href}function Ge(e){return e instanceof Error?e.message:String(e)}function Ye({entryPath:e,exported:r}){if(r==null||typeof r!="object"||!("lockfile"in r))return l({entryPath:e,kind:"not-ripplo"});let n=I.safeParse(Reflect.get(r,"lockfile"));return n.success?F(n.data):l({issues:n.error.issues.map(t=>`${t.path.join(".")}: ${t.message}`),kind:"invalid-lockfile"})}export{c as a,T as b,x as c,R as d,P as e,Pe as f,Fe as g,be as h,jr as i,Br as j,Nr as k,Ie as l,$e as m,te as n};
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
import { createRequire as __ripploCreateRequire } from "node:module";
|
|
3
3
|
const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
|
|
4
4
|
import{a as p,c as t}from"./chunk-KOKEEAEF.js";import{a as s}from"./chunk-HEOMRXZE.js";function l(){let o=process.cwd(),e=s(o);e!=null&&e!==o&&(process.chdir(e),process.stderr.write(`ripplo: resolved .ripplo/ at ${e}
|
|
5
|
-
`))}var d={"exit-plan-gate":()=>import("./exit-plan-gate-44YWEKYS.js").then(o=>o.exitPlanGateHook),"plan-reminder":()=>import("./plan-reminder-
|
|
6
|
-
`),process.exit(1));let i=await m(),r=await p(await e(),i);if(r.kind==="crash"){let{renderHookCrash:a}=await import("./cli-error-
|
|
5
|
+
`))}var d={"exit-plan-gate":()=>import("./exit-plan-gate-44YWEKYS.js").then(o=>o.exitPlanGateHook),"plan-reminder":()=>import("./plan-reminder-MR2UFQZE.js").then(o=>t("UserPromptSubmit",o.planReminder)),"post-edit":()=>import("./post-edit-76WC4SU3.js").then(o=>o.postEditHook),"post-edit-analyze":()=>import("./post-edit-analyze-5F5VSL4T.js").then(o=>t("PostToolUse",o.postEditAnalyze)),"post-edit-flag-stubs":()=>import("./post-edit-flag-stubs-UJ2SZJVQ.js").then(o=>t("PostToolUse",o.postEditFlagStubs)),"pre-bash-run-gate":()=>import("./pre-bash-run-gate-CDFNAIK3.js").then(o=>o.preBashRunGateHook),"pre-edit":()=>import("./pre-edit-YGDITCNZ.js").then(o=>o.preEditHook),"pre-edit-ripplo-skill-gate":()=>import("./pre-edit-ripplo-skill-gate-A6ETC3QN.js").then(o=>t("PreToolUse",o.preEditRipploSkillGate)),"pre-edit-scope-gate":()=>import("./pre-edit-scope-gate-HNIQ7KOQ.js").then(o=>t("PreToolUse",o.preEditScopeGate)),"pre-edit-watch-gate":()=>import("./pre-edit-watch-gate-4V2KYSIF.js").then(o=>t("PreToolUse",o.preEditWatchGate)),"prompt-submit":()=>import("./prompt-submit-ARRJRLMC.js").then(o=>o.promptSubmitHook),"scope-reminder":()=>import("./scope-reminder-A6GVTTVE.js").then(o=>t("UserPromptSubmit",o.scopeReminder)),"session-preamble":()=>import("./session-preamble-IZQPIWST.js").then(o=>o.sessionPreambleHook),"stop-enforce":()=>import("./stop-enforce-BLX3ZEDG.js").then(o=>o.stopEnforceHook),"tasks-reminder":()=>import("./tasks-reminder-TDWPD3KV.js").then(o=>t("UserPromptSubmit",o.tasksReminder)),"tasks-reminder-tool":()=>Promise.resolve(t("PostToolUse",()=>{})),"track-skill-load":()=>import("./track-skill-load-SXSDMHFO.js").then(o=>o.trackSkillLoadHook),"track-skill-prompt":()=>import("./track-skill-prompt-7N4TQAD2.js").then(o=>t("UserPromptSubmit",o.trackSkillPrompt))},n=d;async function P(o){let e=n[o];e==null&&(process.stderr.write(`Unknown hook: ${o}
|
|
6
|
+
`),process.exit(1));let i=await m(),r=await p(await e(),i);if(r.kind==="crash"){let{renderHookCrash:a}=await import("./cli-error-PG24CNXE.js");process.stderr.write(`${a(o,r.error)}
|
|
7
7
|
`),process.exit(0)}r.stdout!=null&&process.stdout.write(r.stdout),process.exit(0)}function m(){return new Promise((o,e)=>{if(process.stdin.isTTY){o("");return}let i=[];process.stdin.on("data",r=>i.push(r)),process.stdin.on("end",()=>{o(Buffer.concat(i).toString("utf8"))}),process.stdin.on("error",e)})}export{l as a,n as b,P as c};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __ripploCreateRequire } from "node:module";
|
|
3
3
|
const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
|
|
4
|
-
import{a as on,f as an,g as sn,j as ln,n as dn,o as un,p as cn,q as pn,r as gn}from"./chunk-
|
|
4
|
+
import{a as on,f as an,g as sn,j as ln,n as dn,o as un,p as cn,q as pn,r as gn}from"./chunk-6UJNBCPU.js";import{b as fn}from"./chunk-XBAVNTRQ.js";import{c as en,e as nn,g as rn}from"./chunk-3FTGPUK3.js";import{a as tn}from"./chunk-BTNSUORZ.js";import{c as H}from"./chunk-JS3DLVVI.js";import{a as U}from"./chunk-R4ZTRVDQ.js";import{d as be}from"./chunk-FEHVIHVA.js";import{i as Ye,j as Ze}from"./chunk-SVM5ORF6.js";import{$ as Ge,E as We,H as oe,K as Ve,L as Ke,P as Je,Q as Qe,U as ze,a as De,aa as Xe,b as qe,c as Ne,d as I,h as Le,i as He,k as _e,m as M,n as O,o as Be,q as C}from"./chunk-SQ4SBMKG.js";import{f as $e,k as Fe,l as je,m as Ue}from"./chunk-ORWKDV2H.js";import{Ba as L,Ca as k,J as Ae,L as te,U as N,V as Te,W as Me,X as Oe,s as q}from"./chunk-KAD7UO53.js";import{d as Ce}from"./chunk-KH4QH23U.js";import{c as D}from"./chunk-RIASQHPG.js";import{a as Ie,d as u,f as g,g as T}from"./chunk-C7SV6AR2.js";import hr from"p-queue";var kr=4,Sr={"p0-ui":3,"p1-cli":2,"p2-cover":1,"p3-explore":0},_=new hr({concurrency:kr}),w={headedActive:0,interactiveActive:0,interactiveQueued:0},yn={current:null};function yi({headed:e,task:n,workClass:r}){let t=Sr[r];return r==="p3-explore"?_.add(n,{priority:t}):(w.interactiveQueued+=1,B(),_.add(()=>wr({headed:e,task:n}),{priority:t}))}function mi(e){!Number.isFinite(e)||e<1||(_.concurrency=Math.floor(e),B())}function ie(){return{active:w.interactiveActive,headedActive:w.headedActive,poolSize:_.concurrency,queued:w.interactiveQueued}}function Ri(e){yn.current=e}async function wr({headed:e,task:n}){w.interactiveQueued-=1,w.interactiveActive+=1,w.headedActive+=e?1:0,B();try{return await n()}finally{w.interactiveActive-=1,w.headedActive-=e?1:0,B()}}function B(){yn.current?.()}async function mn(e){try{return await fetch(e,{method:"HEAD",signal:AbortSignal.timeout(2e3)}),null}catch(n){return n instanceof Error?n.message:String(n)}}async function Rn(e){try{return await fetch(e,{method:"HEAD",signal:AbortSignal.timeout(25e3)}),null}catch(n){return n instanceof Error?n.message:String(n)}}import{graphql as vr}from"gql.tada";async function hn(e,n){let t=(await u({config:e,document:Er,variables:{cwd:n,projectId:e.projectId}})).project?.devSession?.workflows??[];return new Map(t.flatMap(o=>o.tests.map(i=>[`${o.slug}/${i.slug}`,{testId:i.id,workflowId:o.id}])))}var Er=vr(`
|
|
5
5
|
query DaemonWorkflows($projectId: String!, $cwd: String!) {
|
|
6
6
|
project(id: $projectId) {
|
|
7
7
|
id
|
|
@@ -268,7 +268,7 @@ import{a as on,f as an,g as sn,j as ln,n as dn,o as un,p as cn,q as pn,r as gn}f
|
|
|
268
268
|
query ExploreFindingExists($projectId: String!, $signature: String!, $lockfileHash: String!) {
|
|
269
269
|
exploreFindingExists(projectId: $projectId, signature: $signature, lockfileHash: $lockfileHash)
|
|
270
270
|
}
|
|
271
|
-
`);import wo from"path";import{graphql as vo}from"gql.tada";import{graphql as ee}from"gql.tada";import{clearInterval as nr,setInterval as Gt}from"timers";function ke(e){switch(e.kind){case"app-not-ready":return"appNotReady";case"engine-network":return"backendUnreachable";case"engine-unreachable":return"engineUnreachable";case"engine-http":return Ne(e)?"engineSignatureRejected":null;case"engine-decode":case"state-mismatch":case"page-read":case"driver-launch":case"actor-resolution":case"state-effect-reference":case"run-failed":case"workflow-plan":case"action-failed":case"check-failed":case"aborted":return null}}async function Se({config:e,ownerToken:n,reason:r,runId:t}){await u({config:e,document:eo,variables:{ownerToken:n,reason:r,runId:t}}).catch(o=>{g.error(o,"failRun submission failed")})}async function rr({config:e,runId:n}){return u({config:e,document:Zt,variables:{runId:n}}).then(()=>!0).catch(r=>(g.warn({error:r,runId:n},"run heartbeat submission failed; retrying on the next tick"),!1))}var Xt=5;function Yt({config:e,intervalMs:n,runId:r}){let t=!0,o=!1,i=0,s=async()=>{if(!t||o)return;o=!0;let l=await rr({config:e,runId:r});o=!1,i=l?0:i+1,i>=Xt&&(g.warn({consecutiveFailures:i,runId:r},"run heartbeat stopped after repeated submission failures"),t=!1,nr(a))},a=Gt(()=>{s()},n);return()=>{t=!1,nr(a)}}async function we({cause:e,config:n,ownerToken:r,reason:t,runId:o}){await u({config:n,document:no,variables:{cause:e,ownerToken:r,reason:t,runId:o}}).catch(i=>{g.error(i,"markRunUnready submission failed")})}var Ba=ee(`
|
|
271
|
+
`);import wo from"path";import{graphql as vo}from"gql.tada";import{graphql as ee}from"gql.tada";import{clearInterval as nr,setInterval as Gt}from"timers";function ke(e){switch(e.kind){case"app-not-ready":return"appNotReady";case"engine-network":return"backendUnreachable";case"engine-unreachable":return"engineUnreachable";case"engine-http":return Ne(e)?"engineSignatureRejected":null;case"engine-decode":case"state-mismatch":case"page-read":case"driver-launch":case"actor-resolution":case"state-effect-reference":case"run-failed":case"model-preparation":case"workflow-plan":case"action-failed":case"check-failed":case"aborted":return null}}async function Se({config:e,ownerToken:n,reason:r,runId:t}){await u({config:e,document:eo,variables:{ownerToken:n,reason:r,runId:t}}).catch(o=>{g.error(o,"failRun submission failed")})}async function rr({config:e,runId:n}){return u({config:e,document:Zt,variables:{runId:n}}).then(()=>!0).catch(r=>(g.warn({error:r,runId:n},"run heartbeat submission failed; retrying on the next tick"),!1))}var Xt=5;function Yt({config:e,intervalMs:n,runId:r}){let t=!0,o=!1,i=0,s=async()=>{if(!t||o)return;o=!0;let l=await rr({config:e,runId:r});o=!1,i=l?0:i+1,i>=Xt&&(g.warn({consecutiveFailures:i,runId:r},"run heartbeat stopped after repeated submission failures"),t=!1,nr(a))},a=Gt(()=>{s()},n);return()=>{t=!1,nr(a)}}async function we({cause:e,config:n,ownerToken:r,reason:t,runId:o}){await u({config:n,document:no,variables:{cause:e,ownerToken:r,reason:t,runId:o}}).catch(i=>{g.error(i,"markRunUnready submission failed")})}var Ba=ee(`
|
|
272
272
|
mutation ReleaseRun($runId: String!, $ownerToken: String, $retryAttempt: Int, $retryLimit: Int) {
|
|
273
273
|
releaseRun(
|
|
274
274
|
runId: $runId
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __ripploCreateRequire } from "node:module";
|
|
3
3
|
const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
|
|
4
|
-
import{g as m}from"./chunk-
|
|
4
|
+
import{g as m}from"./chunk-3FTGPUK3.js";import{a as f,c as k}from"./chunk-7JKAV7AT.js";import{a as h}from"./chunk-OQ6KNYPG.js";import{a as y}from"./chunk-BTNSUORZ.js";import{a as s}from"./chunk-MHNGR6M7.js";import{h as d,i as p}from"./chunk-SVM5ORF6.js";import{n as u}from"./chunk-SQ4SBMKG.js";import{a as c}from"./chunk-7WZ3VIUU.js";import{f as l}from"./chunk-KH4QH23U.js";import*as a from"zod/mini";var S=a.looseObject({file_path:a.string()}),H=async e=>{let n=S.safeParse(e.tool_input);if(!n.success||!/\/\.ripplo\/.*\.ts$/.test(n.data.file_path))return;let{cwd:o}=e;if(!c(o))return;if(!l(o))return{hookSpecificOutput:{additionalContext:"Ripplo hooks are paused \u2014 DSL compile and lockfile sync did not run for this edit. Resume with `npx ripplo hooks resume` when ready.",hookEventName:"PostToolUse"}};let r=await d(o);if(r.isErr())return{decision:"block",reason:`${y(r.error)}
|
|
5
5
|
${s("create","DSL authoring rules")}`};let t=await b({cwd:o,filePath:n.data.file_path,lockfile:r.value});if("block"in t)return{decision:"block",reason:t.block};let{addedSlugs:i}=await m({cwd:o,editedPath:n.data.file_path,lockfile:r.value,requireHooks:!0,syncFirst:!0});return z(P({addedSlugs:i,elsewhere:t.elsewhere}))};function P({addedSlugs:e,elsewhere:n}){return[...e.length>0?[`Auto-scoped ${e.join(", ")} (dirty tests).`]:[],...n>0?[g(n).trimStart()]:[]]}async function b({cwd:e,filePath:n,lockfile:o}){let r=f({cwd:e,lockfile:o});await p(e,o);let t=A(r,o,n),i=r.length-t.length;return t.length===0?{elsewhere:i}:{block:`${k(t)}${g(i)}
|
|
6
6
|
${s("create")}`}}function A(e,n,o){let r=new Set(u(n).filter(({workflow:t})=>t.sourcePath!=null&&o.endsWith(t.sourcePath)).map(({ref:t})=>t));return r.size===0?e:e.filter(t=>{let i=w(t);return i==null||r.has(i)})}function w(e){return e.kind==="unreachable-interaction"?e.violation.test:e.kind==="redundant-assertion"?e.redundancy.test:e.kind==="undecided-action-consequence"?e.consequence.test:null}function g(e){return e===0?"":`
|
|
7
7
|
${h(e,"finding")} in other files \u2014 \`npx ripplo compile\` for the full list.`}function z(e){if(e.length!==0)return{hookSpecificOutput:{additionalContext:e.join(`
|