ripplo 0.9.4 → 0.9.6
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-INURHJF4.js → chunk-36NPGS6X.js} +1 -1
- package/dist/chunk-4GA5662U.js +83 -0
- package/dist/{chunk-CUXFU3MF.js → chunk-5D6PNHDQ.js} +1 -1
- package/dist/{chunk-PLQGRHHV.js → chunk-5DT43ABQ.js} +1 -1
- package/dist/{chunk-YR3N73PR.js → chunk-5IMT3SAH.js} +3 -3
- package/dist/{chunk-GAOLASGV.js → chunk-6SYRXU4Q.js} +1 -1
- package/dist/{chunk-FH2BITRY.js → chunk-A5EBMT2E.js} +1 -1
- package/dist/{chunk-3M2E253R.js → chunk-AIIZRQXH.js} +1 -1
- package/dist/{chunk-52IE2PAQ.js → chunk-AJXAWZQO.js} +1 -1
- package/dist/{chunk-T6NNV7ZO.js → chunk-BDWNZMUM.js} +1 -1
- package/dist/chunk-CY5FJBHP.js +55 -0
- package/dist/{chunk-KQWFJRIP.js → chunk-DK4NUWRX.js} +1 -1
- package/dist/chunk-FJPJDGSS.js +7 -0
- package/dist/{chunk-T4GHICK4.js → chunk-GFKK7K6T.js} +1 -1
- package/dist/chunk-GKYP7AMJ.js +8 -0
- package/dist/{chunk-N45RSC6N.js → chunk-HD7WIBP2.js} +1 -1
- package/dist/chunk-L2ZJK7MP.js +6 -0
- package/dist/chunk-LOEAZGYO.js +4 -0
- package/dist/{chunk-3OI2UH3H.js → chunk-NOKKMFJP.js} +1 -1
- package/dist/{chunk-XDK6UCMD.js → chunk-NOT5PEHM.js} +1 -1
- package/dist/chunk-RIVHBABX.js +4 -0
- package/dist/{chunk-6FU7HD6D.js → chunk-SXDYA2OR.js} +1 -1
- package/dist/chunk-T76D4SYI.js +4 -0
- package/dist/{chunk-T46B2OPT.js → chunk-TPQIFYHW.js} +1 -1
- package/dist/chunk-TQANCEOL.js +224 -0
- package/dist/{chunk-G3UFH3WS.js → chunk-V4CLXOCP.js} +1 -1
- package/dist/{chunk-O2VP65IR.js → chunk-VCY2CEE2.js} +5 -5
- package/dist/chunk-WCSDBWCI.js +4 -0
- package/dist/{chunk-SBDRIIVW.js → chunk-XJJDHGK4.js} +19 -19
- package/dist/{chunk-3PF5QK56.js → chunk-Z6UPZDW6.js} +1 -1
- package/dist/{cli-error-TM2YODR3.js → cli-error-OIG4RO4E.js} +1 -1
- package/dist/{compile-write-TTEHFTNY.js → compile-write-OLP4DB4P.js} +1 -1
- package/dist/{daemon-6B4OSRBS.js → daemon-WEKGUIRK.js} +1 -1
- package/dist/{daemon-5IFFVQEE.js → daemon-ZHTQ472Q.js} +1 -1
- package/dist/{daemon-lock-67AFXXED.js → daemon-lock-YRKNXWGO.js} +1 -1
- package/dist/{dsl-loader-Z54ZM7C6.js → dsl-loader-IRBKYLNW.js} +1 -1
- package/dist/{exit-plan-gate-WPHQII5J.js → exit-plan-gate-X3TX6QWS.js} +1 -1
- package/dist/hook.js +1 -1
- package/dist/index.js +194 -184
- package/dist/{plan-reminder-H2ZU5WZF.js → plan-reminder-AR3TJXLA.js} +1 -1
- package/dist/post-edit-VUBL7RDW.js +4 -0
- package/dist/post-edit-analyze-ECCVJCPQ.js +4 -0
- package/dist/post-edit-flag-stubs-AHP6XA2S.js +4 -0
- package/dist/{pre-bash-run-gate-WOGQZARU.js → pre-bash-run-gate-LQK52CAV.js} +1 -1
- package/dist/pre-edit-4MNJA3OT.js +4 -0
- package/dist/pre-edit-ripplo-skill-gate-XJHLJN2F.js +4 -0
- package/dist/pre-edit-scope-gate-K5NYCES7.js +4 -0
- package/dist/{pre-edit-watch-gate-OTD6WRUN.js → pre-edit-watch-gate-5YWMODVX.js} +1 -1
- package/dist/{prompt-submit-T6GURGAW.js → prompt-submit-PXMO75JB.js} +1 -1
- package/dist/scope-reminder-LDBXUQZH.js +4 -0
- package/dist/solve-worker.js +1 -1
- package/dist/status-2FS6ZFIU.js +4 -0
- package/dist/{stop-enforce-32B7BSQK.js → stop-enforce-56SLPUYT.js} +1 -1
- package/dist/tasks-reminder-OJEB6HE5.js +4 -0
- package/package.json +2 -3
- package/dist/chunk-2TBRW5WZ.js +0 -8
- package/dist/chunk-3KD2FTEQ.js +0 -229
- package/dist/chunk-6Z555TLR.js +0 -55
- package/dist/chunk-B6OQ2JE2.js +0 -4
- package/dist/chunk-CJUKILIO.js +0 -4
- package/dist/chunk-MHXAGRCM.js +0 -4
- package/dist/chunk-ML7WCYPY.js +0 -6
- package/dist/chunk-PPMW4GUY.js +0 -83
- package/dist/chunk-TBCRT6EC.js +0 -7
- package/dist/chunk-ZQHKESUR.js +0 -4
- package/dist/post-edit-HOYXFYSH.js +0 -4
- package/dist/post-edit-analyze-5HS3ZV4G.js +0 -4
- package/dist/post-edit-flag-stubs-CDKPTQ2L.js +0 -4
- package/dist/pre-edit-TRMRQGTZ.js +0 -4
- package/dist/pre-edit-ripplo-skill-gate-FXNQWVME.js +0 -4
- package/dist/pre-edit-scope-gate-ADO3NRVS.js +0 -4
- package/dist/scope-reminder-XTXZHPLU.js +0 -4
- package/dist/status-EM4ASO7T.js +0 -4
- package/dist/tasks-reminder-PICFLMC2.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{a}from"./chunk-
|
|
4
|
+
import{a}from"./chunk-BDWNZMUM.js";import"./chunk-7WZ3VIUU.js";import"./chunk-AIIZRQXH.js";import"./chunk-36NPGS6X.js";import"./chunk-AJXAWZQO.js";import"./chunk-LOEAZGYO.js";import"./chunk-NNH3YVVO.js";import"./chunk-KMZ3L5YA.js";export{a as planReminder};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __ripploCreateRequire } from "node:module";
|
|
3
|
+
const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
|
|
4
|
+
import{a as t}from"./chunk-GKYP7AMJ.js";import"./chunk-HD7WIBP2.js";import{a as e}from"./chunk-NOT5PEHM.js";import"./chunk-6SYRXU4Q.js";import"./chunk-JJ4QQPAV.js";import"./chunk-MOI4L3EX.js";import"./chunk-FJPJDGSS.js";import"./chunk-OQ6KNYPG.js";import"./chunk-CY5FJBHP.js";import"./chunk-DK4NUWRX.js";import"./chunk-7WZ3VIUU.js";import"./chunk-AIIZRQXH.js";import"./chunk-FEHVIHVA.js";import{b as o}from"./chunk-KOKEEAEF.js";import"./chunk-5DT43ABQ.js";import"./chunk-MHNGR6M7.js";import"./chunk-RIVHBABX.js";import"./chunk-L2ZJK7MP.js";import"./chunk-36NPGS6X.js";import"./chunk-AJXAWZQO.js";import"./chunk-LOEAZGYO.js";import"./chunk-4GA5662U.js";import"./chunk-XJJDHGK4.js";import"./chunk-NNH3YVVO.js";import"./chunk-KMZ3L5YA.js";var r=o({event:"PostToolUse",handlers:[t,e],note:i=>({hookSpecificOutput:{additionalContext:i,hookEventName:"PostToolUse"}})});export{r as postEditHook};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __ripploCreateRequire } from "node:module";
|
|
3
|
+
const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
|
|
4
|
+
import{a}from"./chunk-GKYP7AMJ.js";import"./chunk-HD7WIBP2.js";import"./chunk-MOI4L3EX.js";import"./chunk-FJPJDGSS.js";import"./chunk-OQ6KNYPG.js";import"./chunk-CY5FJBHP.js";import"./chunk-DK4NUWRX.js";import"./chunk-7WZ3VIUU.js";import"./chunk-AIIZRQXH.js";import"./chunk-FEHVIHVA.js";import"./chunk-5DT43ABQ.js";import"./chunk-MHNGR6M7.js";import"./chunk-RIVHBABX.js";import"./chunk-L2ZJK7MP.js";import"./chunk-36NPGS6X.js";import"./chunk-AJXAWZQO.js";import"./chunk-LOEAZGYO.js";import"./chunk-4GA5662U.js";import"./chunk-XJJDHGK4.js";import"./chunk-NNH3YVVO.js";import"./chunk-KMZ3L5YA.js";export{a as postEditAnalyze};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __ripploCreateRequire } from "node:module";
|
|
3
|
+
const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
|
|
4
|
+
import{a}from"./chunk-NOT5PEHM.js";import"./chunk-6SYRXU4Q.js";import"./chunk-JJ4QQPAV.js";import"./chunk-7WZ3VIUU.js";import"./chunk-AIIZRQXH.js";import"./chunk-RIVHBABX.js";import"./chunk-L2ZJK7MP.js";import"./chunk-36NPGS6X.js";import"./chunk-AJXAWZQO.js";import"./chunk-LOEAZGYO.js";import"./chunk-4GA5662U.js";import"./chunk-XJJDHGK4.js";import"./chunk-NNH3YVVO.js";import"./chunk-KMZ3L5YA.js";export{a as postEditFlagStubs};
|
|
@@ -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{b as h}from"./chunk-OWN4P2K7.js";import{a as c}from"./chunk-7WZ3VIUU.js";import{f}from"./chunk-
|
|
4
|
+
import{b as h}from"./chunk-OWN4P2K7.js";import{a as c}from"./chunk-7WZ3VIUU.js";import{f}from"./chunk-AIIZRQXH.js";import{c as y}from"./chunk-KOKEEAEF.js";import"./chunk-36NPGS6X.js";import"./chunk-AJXAWZQO.js";import"./chunk-LOEAZGYO.js";import"./chunk-NNH3YVVO.js";import"./chunk-KMZ3L5YA.js";import{parse as m}from"shell-quote";import*as l from"zod/mini";var R=l.looseObject({command:l.string()}),k="run",S=new Set(["tail","head","less","more","wc","sort","uniq","awk","sed","grep"]),H=y("PreToolUse",e=>{if(e.tool_name!=="Bash")return;let n=R.safeParse(e.tool_input);if(!n.success)return;let r=x(n.data.command),o=b(r),s=g(r,"compile");if(o==null&&s==null)return;let{cwd:t}=e;if(!c(t)||!f(t))return;let a=E({cwd:t,gate:o,pipedCompile:s,sessionId:e.session_id,tokens:r});return a==null?void 0:O(a)});function E({cwd:e,gate:n,pipedCompile:r,sessionId:o,tokens:s}){if(n!=null&&!h(e,o,n.skill))return n.reason;let t=n?.kind==="run"?g(s,"run"):null;return t!=null?`Don't pipe \`ripplo run\` through \`${t}\` \u2014 buffering filters hide live progress, and killing the pipeline mid-run orphans the run on the server. Redirect to a file instead (\`npx ripplo run <id> > /tmp/run.log 2>&1\` and Read it), or use \`run_in_background: true\`.`:r!=null?`Don't pipe \`ripplo compile\` through \`${r}\` \u2014 the piped process holds stdio open and the command hangs long after compile finishes. Run \`npx ripplo compile\` bare, its output is already short.`:null}var P=new Set(["comment","resolve","clarify","dismiss","start"]);function b(e){return v(e)?null:w(e)?{kind:"tasks",reason:"Changing a task with `ripplo tasks` requires the `/ripplo:tasks` skill loaded first. Load `/ripplo:tasks` then retry \u2014 it carries how to route the request and the proof bar for app changes: a run that exercises the broken condition, plus the exact frame and element that prove the fix.",skill:"tasks"}:A(e)?{kind:"replay",reason:"Running `ripplo explore replay` requires the `/ripplo:tasks` skill loaded first. Load `/ripplo:tasks` then retry \u2014 it carries the finding-triage loop and the add-vs-weaken guardrail for resolving findings.",skill:"tasks"}:I(e)?{kind:"run",reason:"Running `ripplo run` requires the `/ripplo:run` skill loaded first. Load `/ripplo:run` then retry \u2014 it carries the artifact-read order, the no-grep-piping guidance, the failure decision tree, and the caught-bug filing contract.",skill:k}:null}function w(e){return e.some((n,r)=>{let o=e[r+2];return n==="ripplo"&&e[r+1]==="tasks"&&typeof o=="string"&&P.has(o)})}function A(e){return e.some((n,r)=>n==="ripplo"&&e[r+1]==="replay")}function I(e){return e.some((n,r)=>n==="ripplo"&&e[r+1]==="run")}var _=new Set(["--help","-h","--version"]);function v(e){return e.some(n=>typeof n=="string"&&_.has(n))}function x(e){try{return m(e)}catch{return[]}}function u(e,n){return typeof e=="object"&&"op"in e&&n.has(e.op)}var D=new Set(["|"]),T=new Set([";","&&","||","&"]),L=new Set([">",">>","&>","1>"]);function g(e,n){let r=e.findIndex((i,p)=>i==="ripplo"&&e[p+1]===n);if(r===-1)return null;let o=e.slice(r+1),s=o.findIndex(i=>u(i,T)),t=s===-1?o:o.slice(0,s);if(t.some(i=>u(i,L)))return null;let a=t.find((i,p)=>{let d=t[p-1];return d!=null&&u(d,D)&&typeof i=="string"&&S.has(i)});return typeof a=="string"?a:null}function O(e){return{hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"deny",permissionDecisionReason:e}}}export{g as bufferingAfter,H as preBashRunGateHook};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __ripploCreateRequire } from "node:module";
|
|
3
|
+
const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
|
|
4
|
+
import{a as e}from"./chunk-T76D4SYI.js";import{a as t}from"./chunk-SXDYA2OR.js";import{a as i}from"./chunk-NOKKMFJP.js";import"./chunk-JJ4QQPAV.js";import"./chunk-OWN4P2K7.js";import"./chunk-DK4NUWRX.js";import"./chunk-7WZ3VIUU.js";import"./chunk-AIIZRQXH.js";import"./chunk-FEHVIHVA.js";import{b as o}from"./chunk-KOKEEAEF.js";import"./chunk-MHNGR6M7.js";import"./chunk-L2ZJK7MP.js";import"./chunk-36NPGS6X.js";import"./chunk-AJXAWZQO.js";import"./chunk-LOEAZGYO.js";import"./chunk-XJJDHGK4.js";import"./chunk-NNH3YVVO.js";import"./chunk-KMZ3L5YA.js";var d=o({event:"PreToolUse",handlers:[e,t,i],note:r=>({hookSpecificOutput:{additionalContext:r,hookEventName:"PreToolUse"}})});export{d as preEditHook};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __ripploCreateRequire } from "node:module";
|
|
3
|
+
const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
|
|
4
|
+
import{a}from"./chunk-SXDYA2OR.js";import"./chunk-OWN4P2K7.js";import"./chunk-7WZ3VIUU.js";import"./chunk-AIIZRQXH.js";import"./chunk-36NPGS6X.js";import"./chunk-AJXAWZQO.js";import"./chunk-LOEAZGYO.js";import"./chunk-NNH3YVVO.js";import"./chunk-KMZ3L5YA.js";export{a as preEditRipploSkillGate};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __ripploCreateRequire } from "node:module";
|
|
3
|
+
const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
|
|
4
|
+
import{a}from"./chunk-NOKKMFJP.js";import"./chunk-JJ4QQPAV.js";import"./chunk-DK4NUWRX.js";import"./chunk-7WZ3VIUU.js";import"./chunk-AIIZRQXH.js";import"./chunk-FEHVIHVA.js";import"./chunk-MHNGR6M7.js";import"./chunk-36NPGS6X.js";import"./chunk-AJXAWZQO.js";import"./chunk-LOEAZGYO.js";import"./chunk-NNH3YVVO.js";import"./chunk-KMZ3L5YA.js";export{a as preEditScopeGate};
|
|
@@ -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{a}from"./chunk-
|
|
4
|
+
import{a}from"./chunk-T76D4SYI.js";import"./chunk-7WZ3VIUU.js";import"./chunk-AIIZRQXH.js";import"./chunk-MHNGR6M7.js";import"./chunk-L2ZJK7MP.js";import"./chunk-36NPGS6X.js";import"./chunk-AJXAWZQO.js";import"./chunk-LOEAZGYO.js";import"./chunk-XJJDHGK4.js";import"./chunk-NNH3YVVO.js";import"./chunk-KMZ3L5YA.js";export{a as preEditWatchGate};
|
|
@@ -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{a as e}from"./chunk-
|
|
4
|
+
import{a as e}from"./chunk-Z6UPZDW6.js";import{a as r}from"./chunk-WNAVYV4P.js";import"./chunk-LB65USNP.js";import{a as i}from"./chunk-TPQIFYHW.js";import{a as t}from"./chunk-BDWNZMUM.js";import"./chunk-HD7WIBP2.js";import"./chunk-6SYRXU4Q.js";import"./chunk-JJ4QQPAV.js";import"./chunk-OWN4P2K7.js";import"./chunk-5E62BCS7.js";import"./chunk-OQ6KNYPG.js";import"./chunk-DK4NUWRX.js";import"./chunk-7WZ3VIUU.js";import"./chunk-AIIZRQXH.js";import"./chunk-FEHVIHVA.js";import{b as o}from"./chunk-KOKEEAEF.js";import"./chunk-MHNGR6M7.js";import"./chunk-36NPGS6X.js";import"./chunk-AJXAWZQO.js";import"./chunk-LOEAZGYO.js";import"./chunk-NNH3YVVO.js";import"./chunk-KMZ3L5YA.js";var a=o({event:"UserPromptSubmit",handlers:[t,e,r,i],note:m=>({hookSpecificOutput:{additionalContext:m,hookEventName:"UserPromptSubmit"}})});export{a as promptSubmitHook};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __ripploCreateRequire } from "node:module";
|
|
3
|
+
const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
|
|
4
|
+
import{a}from"./chunk-Z6UPZDW6.js";import"./chunk-HD7WIBP2.js";import"./chunk-6SYRXU4Q.js";import"./chunk-JJ4QQPAV.js";import"./chunk-DK4NUWRX.js";import"./chunk-7WZ3VIUU.js";import"./chunk-AIIZRQXH.js";import"./chunk-FEHVIHVA.js";import"./chunk-MHNGR6M7.js";import"./chunk-36NPGS6X.js";import"./chunk-AJXAWZQO.js";import"./chunk-LOEAZGYO.js";import"./chunk-NNH3YVVO.js";import"./chunk-KMZ3L5YA.js";export{a as scopeReminder};
|
package/dist/solve-worker.js
CHANGED
|
@@ -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{ga as r}from"./chunk-
|
|
4
|
+
import{ga as r}from"./chunk-XJJDHGK4.js";import"./chunk-KMZ3L5YA.js";r();
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __ripploCreateRequire } from "node:module";
|
|
3
|
+
const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
|
|
4
|
+
import{a}from"./chunk-A5EBMT2E.js";import"./chunk-5D6PNHDQ.js";import"./chunk-WCSDBWCI.js";import"./chunk-R4ZTRVDQ.js";import"./chunk-5DT43ABQ.js";import"./chunk-MHNGR6M7.js";import"./chunk-RIVHBABX.js";import"./chunk-L2ZJK7MP.js";import"./chunk-AJXAWZQO.js";import"./chunk-LOEAZGYO.js";import"./chunk-GFKK7K6T.js";import"./chunk-4GA5662U.js";import"./chunk-XJJDHGK4.js";import"./chunk-NNH3YVVO.js";import"./chunk-KMZ3L5YA.js";export{a as statusCommand};
|
|
@@ -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 O,b as H,c as q}from"./chunk-
|
|
4
|
+
import{a as O,b as H,c as q}from"./chunk-HD7WIBP2.js";import{a as L,b as A,d as N,e as x,f as T,g as h}from"./chunk-VCY2CEE2.js";import{a as $,c as P,e as I}from"./chunk-5D6PNHDQ.js";import"./chunk-WCSDBWCI.js";import{a as S,c as v}from"./chunk-FJPJDGSS.js";import"./chunk-OQ6KNYPG.js";import{c as k}from"./chunk-DK4NUWRX.js";import{a as b}from"./chunk-7WZ3VIUU.js";import{f as C}from"./chunk-AIIZRQXH.js";import"./chunk-R4ZTRVDQ.js";import"./chunk-FEHVIHVA.js";import{c as D}from"./chunk-KOKEEAEF.js";import{a as w}from"./chunk-5DT43ABQ.js";import{a as c}from"./chunk-MHNGR6M7.js";import{e as E,f as j,i as y}from"./chunk-RIVHBABX.js";import"./chunk-L2ZJK7MP.js";import"./chunk-36NPGS6X.js";import{d as m}from"./chunk-AJXAWZQO.js";import"./chunk-LOEAZGYO.js";import"./chunk-4GA5662U.js";import{X as g}from"./chunk-XJJDHGK4.js";import"./chunk-NNH3YVVO.js";import"./chunk-KMZ3L5YA.js";import J from"path";import U from"process";import{CancellationTokenSource as _}from"vscode-jsonrpc/node";import{graphql as W}from"gql.tada";function F(n){return`--- Ripplo Run Failures (scope) ---
|
|
5
5
|
${n.join(`
|
|
6
6
|
`)}
|
|
7
7
|
Artifacts: .ripplo/debug/<runId>/. ${c("run")}`}function R({lines:n,retried:e}){let r=e?"Already retried once, still unreachable.":"";return["--- Ripplo Run Not Verified (server unreachable) ---",...n,"Server-side transient \u2014 not the daemon, dev server, or auth (`npx ripplo doctor` is green).",r,"Wait a moment, then stop again to re-verify."].filter(t=>t.length>0).join(`
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __ripploCreateRequire } from "node:module";
|
|
3
|
+
const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
|
|
4
|
+
import{a}from"./chunk-TPQIFYHW.js";import"./chunk-HD7WIBP2.js";import"./chunk-5E62BCS7.js";import"./chunk-OQ6KNYPG.js";import"./chunk-DK4NUWRX.js";import"./chunk-7WZ3VIUU.js";import"./chunk-AIIZRQXH.js";import"./chunk-FEHVIHVA.js";import"./chunk-MHNGR6M7.js";import"./chunk-36NPGS6X.js";import"./chunk-AJXAWZQO.js";import"./chunk-LOEAZGYO.js";import"./chunk-NNH3YVVO.js";import"./chunk-KMZ3L5YA.js";export{a as tasksReminder};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ripplo",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.6",
|
|
4
4
|
"description": "CLI for Ripplo — AI-powered end-to-end testing",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"homepage": "https://ripplo.ai",
|
|
@@ -39,7 +39,6 @@
|
|
|
39
39
|
"pino-pretty": "^13.1.3",
|
|
40
40
|
"playwright": "1.59.1",
|
|
41
41
|
"proper-lockfile": "^4.1.2",
|
|
42
|
-
"remeda": "^2.33.7",
|
|
43
42
|
"safe-stable-stringify": "^2.5.0",
|
|
44
43
|
"semver": "^7.8.4",
|
|
45
44
|
"shell-quote": "1.8.3",
|
|
@@ -73,8 +72,8 @@
|
|
|
73
72
|
"@ripplo/graphql": "^0.0.0",
|
|
74
73
|
"@ripplo/rrweb-bundle": "0.0.0",
|
|
75
74
|
"@ripplo/run-report": "0.0.0",
|
|
76
|
-
"@ripplo/solver": "^0.0.0",
|
|
77
75
|
"@ripplo/runtime": "^0.0.0",
|
|
76
|
+
"@ripplo/solver": "^0.0.0",
|
|
78
77
|
"@ripplo/spec": "^0.0.0"
|
|
79
78
|
},
|
|
80
79
|
"scripts": {
|
package/dist/chunk-2TBRW5WZ.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __ripploCreateRequire } from "node:module";
|
|
3
|
-
const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
|
|
4
|
-
import{b as w,c as P}from"./chunk-N45RSC6N.js";import{a as m}from"./chunk-MOI4L3EX.js";import{a as u,c as y,d as g}from"./chunk-TBCRT6EC.js";import{a as h}from"./chunk-OQ6KNYPG.js";import{f as S}from"./chunk-6Z555TLR.js";import{a as c}from"./chunk-7WZ3VIUU.js";import{f as k}from"./chunk-3M2E253R.js";import{a as l}from"./chunk-PLQGRHHV.js";import{a as s}from"./chunk-MHNGR6M7.js";import{e as f,f as p}from"./chunk-ZQHKESUR.js";import{b as d}from"./chunk-PPMW4GUY.js";import{createHash as b}from"crypto";import*as a from"zod/mini";var v=a.looseObject({file_path:a.string()}),M=async e=>{let o=v.safeParse(e.tool_input);if(!o.success||!/\/\.ripplo\/.*\.ts$/.test(o.data.file_path))return;let{cwd:t}=e;if(!c(t))return;if(!k(t))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 f(t);if(r.isErr())return{decision:"block",reason:`${l(r.error)}
|
|
5
|
-
${s("create","DSL authoring rules")}`};let n=await N({cwd:t,filePath:o.data.file_path,lockfile:r.value});if("block"in n)return{decision:"block",reason:n.block};let{addedSlugs:i}=await S({cwd:t,editedPath:o.data.file_path,lockfile:r.value});return L(z({addedSlugs:i,cwd:t,elsewhere:n.elsewhere,lockfile:r.value}))};function z({addedSlugs:e,cwd:o,elsewhere:t,lockfile:r}){return[...e.length>0?[`Auto-scoped ${e.join(", ")} (dirty tests).`]:[],...t>0?[A(t).trimStart()]:[],...T(o,r)]}async function N({cwd:e,filePath:o,lockfile:t}){let r=await u({cwd:e,lockfile:t});await p(e,t);let n=R(r,t,o),i=r.length-n.length;return n.length===0?{elsewhere:i}:{block:`${y(n)}${A(i)}
|
|
6
|
-
${s("create")}`}}function R(e,o,t){let r=new Set(d(o).filter(({workflow:n})=>n.sourcePath!=null&&t.endsWith(n.sourcePath)).map(({ref:n})=>n));return r.size===0?e:e.filter(n=>{let i=F(n);return i==null||r.has(i)})}function F(e){return e.kind==="unreachable-interaction"?e.violation.test:e.kind==="redundant-assertion"?e.redundancy.test:e.kind==="missing-precondition"?e.missing.test:null}function A(e){return e===0?"":`
|
|
7
|
-
${h(e,"finding")} in other files \u2014 \`npx ripplo compile\` for the full list.`}function L(e){if(e.length!==0)return{hookSpecificOutput:{additionalContext:e.join(`
|
|
8
|
-
`),hookEventName:"PostToolUse"}}}function T(e,o){let t=m(o),r=b("sha256").update(JSON.stringify(t)).digest("hex");return w(e,"coverage-warn")===r?[]:(P(e,"coverage-warn",r),t.length===0?[]:[g(t)])}export{M as a};
|
package/dist/chunk-3KD2FTEQ.js
DELETED
|
@@ -1,229 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __ripploCreateRequire } from "node:module";
|
|
3
|
-
const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
|
|
4
|
-
import{a as Ne,f as qe,g as Le,j as He,n as _e,o as We,p as Be,q as Ke,r as Ve}from"./chunk-B6OQ2JE2.js";import{c as Qe,e as Je,g as ze}from"./chunk-6Z555TLR.js";import{c as D}from"./chunk-KQWFJRIP.js";import{d as Ue}from"./chunk-3M2E253R.js";import{a as $}from"./chunk-R4ZTRVDQ.js";import{d as ge}from"./chunk-FEHVIHVA.js";import{b as xe}from"./chunk-G3UFH3WS.js";import{a as ve}from"./chunk-PLQGRHHV.js";import{g as Fe}from"./chunk-ZQHKESUR.js";import{e as Re,i as ke,j as Se,k as we}from"./chunk-ML7WCYPY.js";import{c as O}from"./chunk-INURHJF4.js";import{a as me,d as c,f as p,g as I}from"./chunk-52IE2PAQ.js";import{E as Ae,H as Me,R as $e,S as je,V as De,W as Oe,a as R,b as T,c as Ee,d as be,e as Ie,f as j,j as Te,k as Ce,m as Pe,p as v}from"./chunk-PPMW4GUY.js";import{W as M,X as g,i as A,l as G,q as he}from"./chunk-SBDRIIVW.js";import Bn from"p-queue";var Kn=4,Vn={"p0-ui":3,"p1-cli":2,"p2-cover":1,"p3-explore":0},F=new Bn({concurrency:Kn}),k={headedActive:0,interactiveActive:0,interactiveQueued:0},Ge={current:null};function oo({headed:e,task:n,workClass:t}){let r=Vn[t];return t==="p3-explore"?F.add(n,{priority:r}):(k.interactiveQueued+=1,U(),F.add(()=>Qn({headed:e,task:n}),{priority:r}))}function io(e){!Number.isFinite(e)||e<1||(F.concurrency=Math.floor(e),U())}function Y(){return{active:k.interactiveActive,headedActive:k.headedActive,poolSize:F.concurrency,queued:k.interactiveQueued}}function ao(e){Ge.current=e}async function Qn({headed:e,task:n}){k.interactiveQueued-=1,k.interactiveActive+=1,k.headedActive+=e?1:0,U();try{return await n()}finally{k.interactiveActive-=1,k.headedActive-=e?1:0,U()}}function U(){Ge.current?.()}async function Ye(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 Xe(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 Jn}from"gql.tada";async function Ze(e,n){let r=(await c({config:e,document:zn,variables:{cwd:n,projectId:e.projectId}})).project?.devSession?.workflows??[];return new Map(r.flatMap(o=>o.tests.map(i=>[`${o.slug}/${i.slug}`,{testId:i.id,workflowId:o.id}])))}var zn=Jn(`
|
|
5
|
-
query DaemonWorkflows($projectId: String!, $cwd: String!) {
|
|
6
|
-
project(id: $projectId) {
|
|
7
|
-
id
|
|
8
|
-
devSession(cwd: $cwd) {
|
|
9
|
-
id
|
|
10
|
-
workflows {
|
|
11
|
-
id
|
|
12
|
-
slug
|
|
13
|
-
tests {
|
|
14
|
-
id
|
|
15
|
-
slug
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
`);import{err as X,ok as en}from"neverthrow";function tn({all:e,ids:n,lockfile:t}){if(e&&n.length>0)return X({kind:"conflicting-flags"});if(e)return en(t.workflows.filter(i=>!i.stub).flatMap(i=>i.tests.map(s=>R(s))));if(n.length===0)return X({kind:"nothing-selected"});let r=n.map(i=>({id:i,refs:Yn(t,i)})),o=r.filter(i=>i.refs.length===0).map(i=>i.id);return o.length>0?X({kind:"unknown-ids",known:Gn(t),unknown:o}):en([...new Set(r.flatMap(i=>i.refs))])}function rn(e,n){let t=new Map(T(e).map(r=>[r.ref,{testName:r.test.name,testSlug:r.test.slug,workflowName:r.workflow.name,workflowSlug:g(r.workflow.name)}]));return n.map(r=>{let o=t.get(r);if(o==null)throw new Error(`selectionsFor: ref not in lockfile: ${r}`);return o})}function Gn(e){return e.workflows.map(n=>g(n.name))}function Yn(e,n){let t=e.workflows.find(r=>r.name===n||g(r.name)===g(n));return t!=null?t.tests.map(r=>R(r)):T(e).filter(r=>r.ref===n||nn(r.ref)===nn(n)).map(r=>r.ref)}function nn(e){let n=e.lastIndexOf("/");return n===-1?g(e):`${g(e.slice(0,n))}/${g(e.slice(n+1))}`}import{err as Z,ok as on}from"neverthrow";import{graphql as an}from"gql.tada";async function sn({config:e,cwd:n,lockfile:t}){await Zn({config:e,cwd:n,lockfile:t});let r=await nt(e);if(r.isErr())return Z(r.error);let o=new Map(t.workflows.filter(s=>!s.stub).map(s=>[g(s.name),s])),i=[...new Set(r.value)].flatMap(s=>{let a=o.get(s);return a==null?[]:a.tests.map(l=>R(l))});return i.length===0?Z({kind:"scope-empty"}):on(i)}var Xn=an(`
|
|
22
|
-
mutation AddDirtyTestsToScope($projectId: String!, $cwd: String!, $workflowSlugs: [String!]!) {
|
|
23
|
-
addDirtyTestsToScope(projectId: $projectId, cwd: $cwd, workflowSlugs: $workflowSlugs) {
|
|
24
|
-
__typename
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
`);async function Zn({config:e,cwd:n,lockfile:t}){let r=new Set(ze(n)),o=t.workflows.filter(i=>i.sourcePath!=null&&r.has(i.sourcePath)).map(i=>g(i.name));o.length!==0&&await c({config:e,document:Xn,variables:{cwd:e.cwd,projectId:e.projectId,workflowSlugs:o}}).catch(i=>{p.warn({err:i},"auto-scope of dirty tests failed")})}var et=an(`
|
|
28
|
-
query ScopeSelection($projectId: String!, $cwd: String!) {
|
|
29
|
-
project(id: $projectId) {
|
|
30
|
-
id
|
|
31
|
-
devSession(cwd: $cwd) {
|
|
32
|
-
id
|
|
33
|
-
scopeItems {
|
|
34
|
-
id
|
|
35
|
-
workflow {
|
|
36
|
-
id
|
|
37
|
-
slug
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
`);async function nt(e){try{let t=(await c({config:e,document:et,variables:{cwd:e.cwd,projectId:e.projectId}})).project?.devSession?.scopeItems??[];return on(t.flatMap(r=>r.workflow==null?[]:[r.workflow.slug]))}catch(n){return Z({detail:n instanceof Error?n.message:String(n),kind:"scope-fetch-failed"})}}var ee=new Set,ln=new Map;function Ao(e){ee.add(e)}function tt(e){return e.kind==="typecheck-failed"?e.diagnostics.slice(0,5):e.kind==="invalid-lockfile"?e.issues.slice(0,5):e.kind==="load-threw"?[e.message]:[]}async function dn({config:e,cwd:n,message:t}){return(await ke(n)).match(o=>rt({config:e,cwd:n,lockfile:o,message:t}),o=>Promise.resolve({error:{code:"compile-failed",detail:o.kind,diagnostics:[...tt(o)]},kind:"error"}))}async function rt({config:e,cwd:n,lockfile:t,message:r}){let o=await Ye(e.appUrl);if(o!=null)return{error:{code:"app-unreachable",detail:o,url:e.appUrl},kind:"error"};let i=await Xe(e.engineUrl);if(i!=null)return{error:{code:"engine-unreachable",detail:i,url:e.engineUrl},kind:"error"};let s=await Je(n);if(s==null)return{error:{code:"sync-failed",detail:"lockfile-missing"},kind:"error"};if(!ee.has(s)){let l=await it({config:e,cwd:n,lockfile:t});if(l!=null)return{error:{code:"sync-failed",detail:l},kind:"error"};ee.add(s)}return(await at({config:e,cwd:n,lockfile:t,message:r})).match(async l=>({kind:"ready",lockfileHashValue:s,selections:rn(t,l),targetsByClaimKey:await ot({config:e,cwd:n,hash:s})}),l=>Promise.resolve({error:l,kind:"error"}))}async function ot({config:e,cwd:n,hash:t}){let r=ln.get(t);if(r!=null)return r;let o=await Ze(e,n);return ln.set(t,o),o}async function it(e){try{return await Qe(e),null}catch(n){return n instanceof Error?n.message:String(n)}}async function at({config:e,cwd:n,lockfile:t,message:r}){return!r.all&&r.tests.length===0?(await sn({config:e,cwd:n,lockfile:t})).mapErr(st):tn({all:r.all,ids:r.tests,lockfile:t}).mapErr(lt)}function st(e){return e.kind==="scope-empty"?{code:"selection-nothing-selected"}:{code:"scope-failed",detail:e.detail}}function lt(e){switch(e.kind){case"conflicting-flags":return{code:"selection-conflicting-flags"};case"nothing-selected":return{code:"selection-nothing-selected"};case"unknown-ids":return{code:"selection-unknown-ids",known:[...e.known],unknown:[...e.unknown]}}}import{randomUUID as kt}from"crypto";import{createId as St}from"@paralleldrive/cuid2";import{CancellationTokenSource as wn,ResponseError as wt}from"vscode-jsonrpc/node";import{graphql as dt}from"gql.tada";var ct=dt(`
|
|
44
|
-
mutation DaemonCreateRun(
|
|
45
|
-
$id: String
|
|
46
|
-
$workflowId: String!
|
|
47
|
-
$testId: String
|
|
48
|
-
$clientVersion: String
|
|
49
|
-
$executor: RunExecutor
|
|
50
|
-
$target: RunTarget
|
|
51
|
-
$lockfileHash: String
|
|
52
|
-
) {
|
|
53
|
-
createRun(
|
|
54
|
-
id: $id
|
|
55
|
-
workflowId: $workflowId
|
|
56
|
-
testId: $testId
|
|
57
|
-
executor: $executor
|
|
58
|
-
target: $target
|
|
59
|
-
clientVersion: $clientVersion
|
|
60
|
-
lockfileHash: $lockfileHash
|
|
61
|
-
) {
|
|
62
|
-
__typename
|
|
63
|
-
... on MutationCreateRunSuccess {
|
|
64
|
-
data {
|
|
65
|
-
id
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
... on LimitExceededError {
|
|
69
|
-
code
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
`);async function cn(e){try{let t=(await c({config:e.config,document:ct,variables:ut(e)})).createRun;return t==null?N({detail:"create-run-null",type:"generic"}):t.__typename==="MutationCreateRunSuccess"?null:t.__typename==="LimitExceededError"?N({code:t.code,type:"limit"}):N({detail:t.__typename,type:"generic"})}catch(n){return pt(n)}}function ut({executor:e,lockfileHash:n,runId:t,target:r}){return{clientVersion:$(),executor:e,id:t,lockfileHash:n,target:e==="cloud"?"tunnel":void 0,testId:r.testId,workflowId:r.workflowId}}function N(e){return{kind:"dispatch-error",reason:e}}function pt(e){return e instanceof me?{detail:e.message,kind:"infra-error"}:N({detail:e instanceof Error?e.message:String(e),type:"generic"})}function un(){return new Map}function q(e){return`${e.workflowSlug}/${e.testSlug}`}function ft(e){return`${q(e)}@${e.lockfileHash}@${String(e.headed)}`}function pn(e,n){let t=ft(n.identity),r=e.get(t);if(r!=null){let i={...r,jobIds:new Set([...r.jobIds,n.jobId])};return{entry:i,kind:"joined",state:ne(e,i)}}let o={claimed:!1,claimKey:q(n.identity),deadlineAt:n.deadlineAt,headed:n.identity.headed,inflightKey:t,jobIds:new Set([n.jobId]),runId:n.runId,testName:n.testName,workflowName:n.workflowName};return{entry:o,kind:"created",state:ne(e,o)}}function ne(e,n){return new Map([...e,[n.inflightKey,n]])}function te(e,n){let t=[...e.values()].find(o=>o.runId===n&&!o.claimed);if(t==null)return{entry:null,state:e};let r={...t,claimed:!0};return{entry:r,state:ne(e,r)}}function fn(e,n){return new Map([...e].filter(([t])=>t!==n))}function yn(e,n){let t=[...e.values()].filter(a=>a.jobIds.has(n)),r=t.filter(a=>a.jobIds.size===1),o=t.filter(a=>a.jobIds.size>1).map(a=>({...a,jobIds:new Set([...a.jobIds].filter(l=>l!==n))})),i=new Set(r.map(a=>a.inflightKey)),s=new Map([...e].filter(([a])=>!i.has(a)).map(([a,l])=>{let d=o.find(u=>u.inflightKey===a);return[a,d??l]}));return{cancelled:r,state:s}}function mn(e,n){let t=[...e.values()].filter(o=>!o.claimed&&o.deadlineAt<=n),r=new Set(t.map(o=>o.inflightKey));return{expired:t,state:new Map([...e].filter(([o])=>!r.has(o)))}}import{graphql as yt}from"gql.tada";var mt=2e3,gt=yt(`
|
|
74
|
-
query DaemonCloudRunStatus($runId: String!) {
|
|
75
|
-
run(id: $runId) {
|
|
76
|
-
status
|
|
77
|
-
failureReason
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
`);function hn({config:e,onComplete:n,onStarted:t,runId:r,signal:o}){let i=!1,s,a=!1,l=async()=>{if(i||o.aborted)return;let d=await ht(e,r).catch(()=>"unknown");if(!(i||o.aborted)){if(!a&&(d==="running"||gn(d))&&(a=!0,t()),gn(d)){i=!0,n(Rt(d));return}s=setTimeout(()=>{l()},mt)}};return l(),{stop:()=>{i=!0,s!=null&&clearTimeout(s)}}}async function ht(e,n){let r=(await c({config:e,document:gt,variables:{runId:n}})).run?.status;return r??"unknown"}function gn(e){return e==="passed"||e==="failed"||e==="cancelled"||e==="unready"}function Rt(e){return e==="passed"?{kind:"pass"}:e==="failed"?{detail:"failed",kind:"error"}:e==="cancelled"?{detail:"cancelled",kind:"error"}:e==="unready"?{detail:"unready",kind:"error"}:{detail:"unknown",kind:"error"}}var vt=Ne(process.argv[1]),Rn=12e4,xt=-32099;function Et(e){let n=new AbortController;return e.isCancellationRequested?(n.abort(),n.signal):(e.onCancellationRequested(()=>{n.abort()}),n.signal)}function Xo(e){let n={...e,cancellations:new Map,cell:{inflight:un()},jobs:new Map,timers:new Map};return{claim:t=>At(n,t),handleConnection:t=>{bt(n,t)},idle:()=>vn(n)}}function bt(e,n){let t=qe(n);t.onRequest(_e,(r,o)=>It({connection:t,ctx:e,params:r,token:o})),t.onRequest(We,()=>{let r=Y();return{active:r.active,bundleMtimeMs:vt,queued:r.queued,sseHealth:e.sseHealth(),version:$(),...e.explorationStatus()}}),t.onRequest(Be,()=>{let r=vn(e);return r&&e.onShutdownRequest(),r}),t.onClose(()=>{Pt(e,t)}),t.onError(r=>{p.warn({err:r},"ipc connection error")}),n.on("error",r=>{p.warn({err:r},"ipc socket error")}),t.listen()}function vn(e){let n=Y();return e.jobs.size===0&&n.active===0&&n.queued===0}async function It({connection:e,ctx:n,params:t,token:r}){let o=Le.safeParse(t);if(!o.success)throw kn({code:"bad-message"});await n.ready;let i=await dn({config:n.config,cwd:n.cwd,message:o.data});if(i.kind==="error")throw kn(i.error);let s=kt(),a=new wn;return r.onCancellationRequested(()=>{xn(n,s)}),n.jobs.set(s,{cancellation:a,connection:e,failed:0,notRun:0,passed:0,total:i.selections.length}),Mt({ctx:n,headed:o.data.headed,jobId:s,lockfileHashValue:i.lockfileHashValue,selections:i.selections,targetsByClaimKey:i.targetsByClaimKey,token:a.token}).catch(l=>{p.error({err:l},"ipc dispatch failed")}),{jobId:s,total:i.selections.length}}function kn(e){return new wt(xt,e.code,e)}function xn(e,n){let t=e.jobs.get(n);if(t==null)return;t.cancellation.cancel(),e.jobs.delete(n);let r=yn(e.cell.inflight,n);e.cell.inflight=r.state,r.cancelled.forEach(o=>{P(e,o.inflightKey,"cancel")})}function P(e,n,t){let r=e.timers.get(n);r!=null&&(clearTimeout(r),e.timers.delete(n)),t==="cancel"&&(e.cancellations.get(n)?.cancel(),e.cancellations.delete(n))}function re(e,n,t){e.cell.inflight=fn(e.cell.inflight,n),P(e,n,t),t==="keep"&&e.cancellations.delete(n)}function Tt(e){let n=mn(e.cell.inflight,Date.now());e.cell.inflight=n.state,n.expired.forEach(t=>{P(e,t.inflightKey,"cancel"),x(e,t,{kind:"test-outcome",outcome:{detail:"dispatch-timeout",kind:"dispatch-timeout"},runId:"",testName:t.testName,workflowName:t.workflowName})})}function x(e,n,t){n.jobIds.forEach(r=>{En(e,r,t)})}function En(e,n,t){let r=e.jobs.get(n);r!=null&&(Sn(()=>r.connection.sendNotification(Ke,{event:t,jobId:n})),t.kind==="test-outcome"&&(Ct(r,t.outcome.kind),r.passed+r.failed+r.notRun>=r.total&&(Sn(()=>r.connection.sendNotification(Ve,{failed:r.failed,jobId:n,notRun:r.notRun,passed:r.passed})),e.jobs.delete(n))))}function Sn(e){Promise.resolve().then(e).catch(n=>{p.warn({err:n},"ipc notification failed")})}function Ct(e,n){if(n==="pass"){e.passed+=1;return}if(n==="dispatch-error"||n==="dispatch-timeout"||n==="infra-error"){e.notRun+=1;return}e.failed+=1}function Pt(e,n){[...e.jobs.entries()].filter(([,t])=>t.connection===n).forEach(([t])=>{xn(e,t)})}function At(e,n){let t=te(e.cell.inflight,n);e.cell.inflight=t.state;let r=t.entry;if(r==null)return null;P(e,r.inflightKey,"keep");let o=e.cancellations.get(r.inflightKey);return o==null?null:{headed:r.headed,token:o.token,finished:(i,s)=>{let a=C(e,r);re(e,r.inflightKey,"keep"),x(e,a,{kind:"test-outcome",outcome:s,runId:r.runId,testName:r.testName,workflowName:r.workflowName})},started:()=>{x(e,C(e,r),{kind:"test-started",runId:r.runId,testName:r.testName,workflowName:r.workflowName})}}}async function Mt(e){await e.selections.reduce((n,t)=>n.then(()=>$t(e,t)),Promise.resolve())}async function $t(e,n){let{ctx:t,headed:r,jobId:o,lockfileHashValue:i,targetsByClaimKey:s,token:a}=e;if(a.isCancellationRequested)return;let l=q(n),d=s.get(l);if(d==null){En(t,o,{kind:"test-outcome",outcome:{kind:"dispatch-error",reason:{detail:"test-not-found",type:"generic"}},runId:"",testName:n.testName,workflowName:n.workflowName});return}let u=pn(t.cell.inflight,{deadlineAt:Date.now()+Rn,identity:{headed:r,lockfileHash:i,testSlug:n.testSlug,workflowSlug:n.workflowSlug},jobId:o,runId:St(),testName:n.testName,workflowName:n.workflowName});if(t.cell.inflight=u.state,u.kind==="joined")return;let f=u.entry;t.cancellations.set(f.inflightKey,new wn),t.timers.set(f.inflightKey,setTimeout(()=>{Tt(t)},Rn));let y=t.executor(),m=await jt({ctx:t,entry:f,executor:y,lockfileHashValue:i,target:d});if(m!=null){let w=C(t,f);re(t,f.inflightKey,"cancel"),x(t,w,{kind:"test-outcome",outcome:m,runId:"",testName:n.testName,workflowName:n.workflowName});return}y==="cloud"&&Dt(t,f)}function C(e,n){return e.cell.inflight.get(n.inflightKey)??n}function jt({ctx:e,entry:n,executor:t,lockfileHashValue:r,target:o}){return cn({config:e.config,executor:t,lockfileHash:r,runId:n.runId,target:o})}function Dt(e,n){let t=te(e.cell.inflight,n.runId);e.cell.inflight=t.state;let r=t.entry;if(r==null)return;P(e,r.inflightKey,"keep");let o=e.cancellations.get(r.inflightKey);o!=null&&hn({config:e.config,runId:r.runId,signal:Et(o.token),onComplete:i=>{let s=C(e,r);re(e,r.inflightKey,"keep"),x(e,s,{kind:"test-outcome",outcome:i,runId:r.runId,testName:r.testName,workflowName:r.workflowName})},onStarted:()=>{x(e,C(e,r),{kind:"test-started",runId:r.runId,testName:r.testName,workflowName:r.workflowName})}})}import{graphql as E}from"gql.tada";import{gzipSync as Nt}from"zlib";import{appendFileSync as qt,existsSync as H,readFileSync as Tn,writeFileSync as In}from"fs";import S from"path";import{graphql as ie}from"gql.tada";function L(e){return[e.kind,e.target,e.value].filter(n=>n.length>0).join(" ")}function bn(e,n){return{kind:"finding",payload:Ft(e),source:"verifier",step:n.step,stepIndex:n.stepIndex,timeNanos:n.timeNanos}}var Ot={"no-effect":"noEffect","required-state-unsatisfied":"requiredStateUnsatisfied",unresolvable:"unresolvable"};function Ft(e){switch(e.kind){case"unrunnable":return{kind:"unrunnable",reason:Ot[e.reason],unmet:e.unmet==null?null:Ce(e.unmet)};case"impossible-action":return{action:Te(e.step.action),kind:"impossibleAction",subject:Ut(e.step.action)};case"lift-visibility":return{declaredIndex:e.declaredIndex,kind:"liftVisibility",subject:G(e.locator),visibleIndex:e.visibleIndex}}}function Ut(e){return e.locator==null?e.url??"":G(e.locator)}function Cn(e){return v(e.event).length>0}function _({config:e,fixturesDir:n,headed:t}){return{baseUrl:e.appUrl,engineUrl:e.engineUrl,fixturesDir:n,generate:A,headed:t,secret:e.webhookSecret}}async function ae(e){let n=W(e);await se(e.config,e.runId,n)}function W({debugDir:e,events:n,recordingOptional:t,runId:r,stepSources:o}){let i=le(n),s=Qt(e,r);if(s==null&&!t)throw new Error("recording-missing");let a=i.map((d,u)=>or({aliases:[...Gt(n),...Yt(i)],generated:Xt(n),generatedSingletons:Zt(n),origin:s==null?Vt(i):s.origin,record:d,rrwebEvents:s==null?[]:s.events,sourceTest:o?.[u]??null})),l=i.flatMap(d=>d.event.findings.map(u=>bn(u,{step:L(M(d.event.source,d.event.index)),stepIndex:d.event.index,timeNanos:Pn(d)})));return Lt({debugDir:e,events:[...a,...l],runId:r}),i}function Lt({debugDir:e,events:n,runId:t}){if(n.length===0)return;let r=S.join(e,t,"behavior.jsonl");if(!H(r))return;let o=n.map(i=>JSON.stringify(i)).join(`
|
|
81
|
-
`);qt(r,`${o}
|
|
82
|
-
`)}function Pn(e){return String(BigInt(Math.max(0,Math.round(e.event.endMs)))*1000000n)}async function se(e,n,t){let r=t.filter(s=>Cn(s)).length,o=t.length-r,i=t.reduce((s,a)=>s+Math.max(0,a.event.endMs-a.event.startMs),0);await c({config:e,document:sr,variables:{items:[{duration:i,failCount:r,firstFailedStepTitle:Ht(t),passCount:o,runId:n,status:r>0?"failed":"passed"}]}})}function Ht(e){let n=e.filter(t=>Cn(t)).toSorted((t,r)=>t.event.index-r.event.index).at(0);return n==null?null:L(M(n.event.source,n.event.index))}function le(e){return e.flatMap(n=>n.kind==="step"?[{event:n}]:[])}async function An(e,n){await c({config:e,document:lr,variables:{runIds:[n]}})}async function _t({config:e,debugDir:n,runId:t}){let r=S.join(n,t),o=S.join(r,"behavior.jsonl");if(H(S.join(r,I)))return;if(!H(o)){p.warn({runId:t},"behavior upload skipped: behavior.jsonl missing on disk");return}await[0,1e3,3e3].reduce((s,a)=>s.then(async l=>l?!0:(await new Promise(d=>setTimeout(d,a)),Wt({behaviorPath:o,config:e,runDir:r,runId:t}))),Promise.resolve(!1))}async function Wt({behaviorPath:e,config:n,runDir:t,runId:r}){try{let o=await c({config:n,document:ar,variables:{runId:r}}),i=await fetch(o.debugArtifactUploadUrl,{body:Nt(Tn(e)),headers:{"content-type":Kt},method:"PUT"});return i.ok?(await An(n,r),In(S.join(t,I),""),!0):(p.warn({runId:r,status:i.status},"behavior upload PUT failed"),!1)}catch(o){return Bt(o)?(p.warn({runId:r},"behavior upload refused by server; run unknown \u2014 not retrying"),In(S.join(t,I),""),!0):(p.warn({error:o,runId:r},"behavior upload failed"),!1)}}function Bt(e){if(typeof e!="object"||e==null||!("errors"in e))return!1;let{errors:n}=e;return Array.isArray(n)&&n.some(t=>{if(typeof t!="object"||t==null||!("extensions"in t))return!1;let{extensions:r}=t;return typeof r=="object"&&r!=null&&"code"in r&&r.code==="FORBIDDEN"})}var Kt="application/x-ndjson";function Vt(e){return e.reduce((n,t)=>Math.min(n,t.event.startMs),e[0]?.event.startMs??0)}function Qt(e,n){let t=S.join(e,n,"behavior.jsonl");if(!H(t))return null;let r=Tn(t,"utf8").split(`
|
|
83
|
-
`).filter(i=>i.length>0).map(i=>Jt(i)).flatMap(i=>zt(i)?[i.event]:[]),o=r[0];return o==null?null:{events:r,origin:o.timestamp}}function Jt(e){return JSON.parse(e)}function zt(e){return typeof e=="object"&&e!=null&&Reflect.get(e,"kind")==="rrweb"}function Gt(e){return e.flatMap(n=>n.kind==="world"?n.aliases:[])}function Yt(e){return e.flatMap(n=>{let t=er(n.event.source);return t.flatMap(r=>{let i=t.filter(a=>a.entity===r.entity).indexOf(r),s=n.event.state.rows.filter(a=>a.status==="created"&&a.entity===r.entity).at(i);return s==null?[]:[{alias:r.as,entity:r.entity,key:s.key}]})})}function Xt(e){return new Set(e.flatMap(n=>n.kind==="world"?n.generated.map(t=>Mn(t)):[]))}function Mn({entity:e,field:n,key:t}){return`${e} ${t} ${n}`}function Zt(e){return new Set(e.flatMap(n=>n.kind==="world"?n.generatedSingletons:[]))}function er(e){return e==null?[]:e.expect.flatMap(n=>oe(n))}function oe(e){return e.kind==="state"&&e.assertion.kind==="created"?[{as:e.assertion.as,entity:e.entity}]:e.kind==="and"?e.predicates.flatMap(n=>oe(n)):e.kind==="when"?e.branches.flatMap(n=>n.consequence.flatMap(t=>oe(t))):[]}var nr=3,tr=0;function rr({endMs:e,rrwebEvents:n,startMs:t}){let r=n.find(o=>o.type===nr&&o.data?.source===tr&&o.timestamp>=t&&o.timestamp<=e);return r==null?t:r.timestamp}function or({aliases:e,generated:n,generatedSingletons:t,origin:r,record:o,rrwebEvents:i,sourceTest:s}){let{event:a}=o,l=M(a.source,a.index),d=rr({endMs:a.endMs,rrwebEvents:i,startMs:a.startMs});return{duration:Math.max(0,a.endMs-a.startMs),executedBranch:a.executedBranch??null,kind:"step",nodeType:l.kind,pageUrl:a.url,recordingEndMs:Math.max(0,a.endMs-r),recordingStartMs:Math.max(0,d-r),source:"verifier",sourceTest:s,stateRows:a.state.rows.map(u=>ir({aliases:e,generated:n,row:u})),stateSingletons:a.state.singletons.map(u=>({changed:u.changed,generated:t.has(u.name),name:u.name,value:u.value==null?null:String(u.value)})),stepIndex:a.index,timeNanos:Pn(o),title:L(l)}}function ir({aliases:e,generated:n,row:t}){let r=e.find(o=>o.entity===t.entity&&o.key===t.key);return{entity:t.entity,fields:t.fields.map(o=>({changed:o.changed,field:o.field,generated:n.has(Mn({entity:t.entity,field:o.field,key:t.key})),value:o.value==null?null:String(o.value)})),key:t.key,label:r?.alias??t.key,status:t.status}}var ar=ie(`
|
|
84
|
-
mutation DebugArtifactUploadUrl($runId: String!) {
|
|
85
|
-
debugArtifactUploadUrl(runId: $runId)
|
|
86
|
-
}
|
|
87
|
-
`),sr=ie(`
|
|
88
|
-
mutation CompleteRunsBatch($items: [CompleteRunItem!]!) {
|
|
89
|
-
completeRunsBatch(items: $items) {
|
|
90
|
-
id
|
|
91
|
-
status
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
`),lr=ie(`
|
|
95
|
-
mutation MarkRunArtifactsUploadedBatch($runIds: [String!]!) {
|
|
96
|
-
markRunArtifactsUploadedBatch(runIds: $runIds)
|
|
97
|
-
}
|
|
98
|
-
`);function dr(e){if(e.kind!=="clean"&&e.kind!=="flaky"&&e.kind!=="finding")return;let{trail:n}=e;return{baseLabel:n.baseLabel,baseState:n.baseState,durationMs:n.durationMs,outcome:e.kind,runId:e.kind==="finding"?e.runId:void 0,signature:n.signature,steps:n.steps}}async function de({baseState:e,category:n,config:t,debugDir:r,devSessionId:o,events:i,lockfileHash:s,reproJson:a,runId:l,signature:d,spec:u,stepSources:f,summary:y,workflowSlug:m}){await c({config:t,document:yr,variables:{devSessionId:o??null,lockfileHash:s??null,projectId:t.projectId,reproJson:a,runId:l,spec:u??null,workflowSlug:m??null}}),await ae({config:t,debugDir:r,events:i,recordingOptional:!0,runId:l,stepSources:f}),await c({config:t,document:mr,variables:{baseState:e,category:n,projectId:t.projectId,reproRunId:l,signature:d,summary:y}})}async function B(e,n,t){return(await c({config:e,document:gr,variables:{lockfileHash:t,projectId:e.projectId,signature:n}})).exploreFindingExists}async function cr({attempts:e,config:n,devSessionId:t,findings:r,trail:o}){await c({config:n,document:pr,variables:{attempts:e,devSessionId:t,findings:r,trail:o==null?null:{baseLabel:o.baseLabel,baseState:o.baseState,durationMs:o.durationMs,findingRunId:o.runId??null,findingSignature:o.signature??null,outcome:o.outcome,steps:o.steps.map(i=>({test:i.test,text:i.text}))}}})}async function ur(e,n){return(await c({config:e,document:fr,variables:{devSessionId:n}}).catch(r=>(p.warn({error:r},"reportExploreUnhealthy failed"),null)))?.reportExploreUnhealthy??!1}var pr=E(`
|
|
99
|
-
mutation RecordExplorationProgress(
|
|
100
|
-
$devSessionId: String!
|
|
101
|
-
$attempts: Int!
|
|
102
|
-
$findings: Int!
|
|
103
|
-
$trail: ExploreTrailInput
|
|
104
|
-
) {
|
|
105
|
-
recordExplorationProgress(
|
|
106
|
-
devSessionId: $devSessionId
|
|
107
|
-
attempts: $attempts
|
|
108
|
-
findings: $findings
|
|
109
|
-
trail: $trail
|
|
110
|
-
)
|
|
111
|
-
}
|
|
112
|
-
`),fr=E(`
|
|
113
|
-
mutation ReportExploreUnhealthy($devSessionId: String!) {
|
|
114
|
-
reportExploreUnhealthy(devSessionId: $devSessionId)
|
|
115
|
-
}
|
|
116
|
-
`),yr=E(`
|
|
117
|
-
mutation CreateExploreRun(
|
|
118
|
-
$projectId: String!
|
|
119
|
-
$runId: String!
|
|
120
|
-
$devSessionId: String
|
|
121
|
-
$lockfileHash: String
|
|
122
|
-
$spec: String
|
|
123
|
-
$reproJson: String
|
|
124
|
-
$workflowSlug: String
|
|
125
|
-
) {
|
|
126
|
-
createExploreRun(
|
|
127
|
-
projectId: $projectId
|
|
128
|
-
runId: $runId
|
|
129
|
-
devSessionId: $devSessionId
|
|
130
|
-
lockfileHash: $lockfileHash
|
|
131
|
-
spec: $spec
|
|
132
|
-
reproJson: $reproJson
|
|
133
|
-
workflowSlug: $workflowSlug
|
|
134
|
-
) {
|
|
135
|
-
id
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
`),mr=E(`
|
|
139
|
-
mutation SubmitExploreFinding(
|
|
140
|
-
$projectId: String!
|
|
141
|
-
$signature: String!
|
|
142
|
-
$summary: String!
|
|
143
|
-
$baseState: String!
|
|
144
|
-
$category: ExploreFindingCategory!
|
|
145
|
-
$reproRunId: String!
|
|
146
|
-
) {
|
|
147
|
-
submitExploreFinding(
|
|
148
|
-
projectId: $projectId
|
|
149
|
-
signature: $signature
|
|
150
|
-
summary: $summary
|
|
151
|
-
baseState: $baseState
|
|
152
|
-
category: $category
|
|
153
|
-
reproRunId: $reproRunId
|
|
154
|
-
) {
|
|
155
|
-
id
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
`),hi=E(`
|
|
159
|
-
mutation SetExploreFindingStatus(
|
|
160
|
-
$projectId: String!
|
|
161
|
-
$signature: String!
|
|
162
|
-
$status: ExploreFindingStatus!
|
|
163
|
-
) {
|
|
164
|
-
setExploreFindingStatus(projectId: $projectId, signature: $signature, status: $status)
|
|
165
|
-
}
|
|
166
|
-
`),gr=E(`
|
|
167
|
-
query ExploreFindingExists($projectId: String!, $signature: String!, $lockfileHash: String!) {
|
|
168
|
-
exploreFindingExists(projectId: $projectId, signature: $signature, lockfileHash: $lockfileHash)
|
|
169
|
-
}
|
|
170
|
-
`);import kr from"path";import{graphql as Sr}from"gql.tada";import{graphql as K}from"gql.tada";function ce(e){switch(e.kind){case"app-not-ready":return"appNotReady";case"client-mount-missing":return"appNotReady";case"engine-network":case"engine-http":return"backendUnreachable";case"engine-unreachable":return"engineUnreachable";case"engine-decode":case"state-identity":case"setup-missing-row":case"page-read":case"driver-launch":case"action-failed":case"check-failed":case"aborted":return null}}async function ue(e,n,t){await c({config:e,document:hr,variables:{reason:t,runId:n}}).catch(r=>{p.error(r,"failRun submission failed")})}async function pe(e,n,t){await c({config:e,document:Rr,variables:{cause:t,runId:n}}).catch(r=>{p.error(r,"markRunUnready submission failed")})}var wi=K(`
|
|
171
|
-
mutation ReleaseRun($runId: String!) {
|
|
172
|
-
releaseRun(runId: $runId)
|
|
173
|
-
}
|
|
174
|
-
`),vi=K(`
|
|
175
|
-
mutation HeartbeatRun($runId: String!) {
|
|
176
|
-
heartbeatRun(runId: $runId)
|
|
177
|
-
}
|
|
178
|
-
`),hr=K(`
|
|
179
|
-
mutation FailRun($runId: String!, $reason: String!) {
|
|
180
|
-
failRun(runId: $runId, reason: $reason)
|
|
181
|
-
}
|
|
182
|
-
`),Rr=K(`
|
|
183
|
-
mutation MarkRunUnready($runId: String!, $cause: RunUnreadyCause!) {
|
|
184
|
-
markRunUnready(runId: $runId, cause: $cause)
|
|
185
|
-
}
|
|
186
|
-
`);async function wr({config:e,cwd:n,errorSettle:t,fixturesDir:r,headed:o,lockfile:i,onPhase:s,runId:a,session:l,signal:d,test:u}){if(!await xr(e,a))return{outcome:{kind:"dispatch-failed",reason:"already-claimed",runId:a},persisted:Promise.resolve()};let y=kr.join(n,".ripplo","debug"),m=[];return(await l.runOnce({capture:!0,lockfile:i,onPhase:s,options:_({config:e,fixturesDir:r,headed:o}),params:void 0,runId:a,sequence:void 0,test:u,onEvent:b=>{m.push(b)}},d)).match(async b=>{let ye=le(m),J=ye.flatMap(Wn=>v(Wn.event)),z=vr(J);if(z!=null)return W({config:e,debugDir:y,events:m,recordingOptional:!0,runId:a,stepSources:void 0}),await $n({config:e,error:z,errorSettle:t,runId:a}),{outcome:{error:z,kind:"error",runId:a},persisted:Promise.resolve()};await se(e,a,ye),W({config:e,debugDir:y,events:m,recordingOptional:!0,runId:a,stepSources:void 0});let _n=Promise.resolve();return{outcome:J.length>0?{contradictions:J,kind:"findings",runId:a}:{kind:"pass",runId:a},persisted:_n}},async b=>(await $n({config:e,error:b,errorSettle:t,runId:a}),{outcome:{error:b,kind:"error",runId:a},persisted:Promise.resolve()}))}async function $n({config:e,error:n,errorSettle:t,runId:r}){if(t==="defer")return;let o=ce(n);if(o!=null){await pe(e,r,o);return}await ue(e,r,j(n))}function vr(e){let n=e.find(t=>t.kind==="stepError"&&be(t.record.error));return n!=null&&n.kind==="stepError"?n.record.error:void 0}async function xr(e,n){return((await c({config:e,document:Er,variables:{runIds:[n]}})).startRunsBatch??[]).some(r=>r.id===n)}var Er=Sr(`
|
|
187
|
-
mutation StartRunsBatch($runIds: [String!]!) {
|
|
188
|
-
startRunsBatch(runIds: $runIds) {
|
|
189
|
-
id
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
`);import{randomUUID as br}from"crypto";async function Ir({assign:e,config:n,debugDir:t,devSessionId:r,fixturesDir:o,headed:i,lockfile:s,report:a,session:l,signal:d}){let u=Ee(s);if(e.stepRuns.length===0)return{error:{source:"empty-trail"},kind:"error"};let f=Fr(u,e.stepRuns),y=await De({baseState:{name:R(e.baseStateTest),test:e.baseStateTest},corpus:u,lockfile:s,options:_({config:n,fixturesDir:o,headed:i}),seenSignature:a?w=>B(n,w,e.lockfileHash):void 0,session:l,stepRuns:e.stepRuns,runIdFor:w=>`explore-${br()}-${String(w)}`},d),m=a?await $r({baseStateTest:e.baseStateTest,config:n,debugDir:t,devSessionId:r,lockfileHash:e.lockfileHash,outcome:y,reproJson:Ar(u,e),stepSources:Mr(f)}):!1;return Pr(y,f.length),Ur(y,m,Tr(f,e,y))}function Tr(e,n,t){if(t.kind==="error"||t.kind==="aborted")return;let r=t.timing.confirm;return{baseLabel:n.baseStateTest.intent,baseState:R(n.baseStateTest),durationMs:Math.round(V(t.timing.detect)+(r==null?0:V(r))),signature:t.kind==="finding"||t.kind==="seen"?t.signature:void 0,steps:Cr(e.slice(0,t.ranCount))}}function Cr(e){return e.flatMap(n=>{let t=n.label.split("#")[0]??n.label;return n.actions.map(r=>({test:t,text:r}))})}function V(e){return e.engineMs+e.worldMs+e.browserMs+e.driveMs+e.teardownMs}function Pr(e,n){if(e.kind==="error"){p.info({detail:j(e.error),kind:e.kind,reason:e.error.kind,steps:n},"explore trail");return}if(e.kind==="aborted"||e.kind==="seen"){p.info({kind:e.kind,steps:n},"explore trail");return}let t=e.timing.detect,r=e.timing.confirm;p.info({browserMs:t.browserMs,confirmMs:r==null?void 0:V(r),detectMs:V(t),driveMs:t.driveMs,engineMs:t.engineMs,kind:e.kind,steps:n,teardownMs:t.teardownMs,worldMs:t.worldMs},"explore trail")}function Ar(e,n){let t=n.stepRuns.flatMap(o=>{let i=e[o.idx];return i==null?[]:[{index:i.index,params:o.params,test:i.test}]}),r={baseStateRef:R(n.baseStateTest),steps:t};return JSON.stringify(r)}function Mr(e){return e.flatMap(n=>{let t=n.label.split("#")[0]??n.label;return n.actions.map(()=>t)})}async function $r({baseStateTest:e,config:n,debugDir:t,devSessionId:r,lockfileHash:o,outcome:i,reproJson:s,stepSources:a}){return i.kind!=="finding"||i.captureEvents.length===0?!1:await B(n,i.signature,o)?(p.info({devSessionId:r,signature:i.signature},"explore finding already reported, skipping duplicate"),!1):(await de({baseState:i.baseState,category:jr(i.verifierLayer),config:n,debugDir:t,devSessionId:r,events:i.captureEvents,lockfileHash:o,reproJson:s,runId:i.runId,signature:i.signature,spec:Or(e,i.captureEvents),stepSources:a,summary:Dr(i.captureEvents,i.title),workflowSlug:i.sourceTest?.split("/")[0]}).catch(l=>{p.warn({error:l},"explore finding report failed")}),!0)}function jr(e){return e==="data-rule"?"dataRule":e==="model-drift"?"modelDrift":e}function Dr(e,n){let t=e.flatMap(r=>r.kind==="step"?v(r):[]).at(0);if(t!=null)return Ae(t);if(n!=null)return n;throw new Error("explore finding has no findings to summarize")}function Or(e,n){let t=n.flatMap(o=>o.kind==="step"?[o.source]:[]),r={absent:e.absent,actor:e.actor,exclusive:e.exclusive,intent:e.intent,maybe:[],name:e.name,params:e.params,singletons:e.singletons,steps:t,stub:!1,tests:[],viewports:[e.viewport],world:e.world};return JSON.stringify(r)}function Fr(e,n){return n.flatMap(t=>{let r=e[t.idx];return r==null?[]:[{actions:[...r.nav,...r.steps].map(o=>Pe(o.action)),label:`${r.test}#${String(r.index)}`}]})}function Ur(e,n,t){if(e.kind==="aborted")return{kind:"aborted"};if(e.kind==="error")return{error:{category:Nr(e.error.kind),kind:e.error.kind,source:"runtime"},kind:"error"};if(t==null)throw new Error("trail summary missing for completed trail");return e.kind==="finding"?{kind:e.kind,runId:n?e.runId:void 0,trail:t}:{kind:e.kind,trail:t}}function Nr(e){return e==="driver-launch"?"driver":Ie(e)?"infra":"trail"}import qr from"fs";import Lr from"path";async function Zi(e){let n=Lr.join(e,".ripplo","index.ts");if(!qr.existsSync(n))return{appUrl:void 0,engineUrl:void 0,errors:[{message:".ripplo/index.ts not found",path:""}],valid:!1,warnings:[]};let t=await we(e);return t.isErr()?{appUrl:void 0,engineUrl:void 0,errors:[{message:ve(t.error),path:".ripplo/"}],valid:!1,warnings:[]}:ge().match(r=>({appUrl:r.appUrl,engineUrl:r.engineUrl,errors:[],valid:!0,warnings:[]}),r=>({appUrl:void 0,engineUrl:void 0,errors:[{message:xe(r),path:""}],valid:!1,warnings:[]}))}async function ea(e){try{await fetch(e,{method:"HEAD",signal:AbortSignal.timeout(5e3)});return}catch{return`appUrl (${e}) is not responding. Make sure your dev server is running on that port.`}}async function na({appUrl:e,engineUrl:n}){let t=n.startsWith("http://")||n.startsWith("https://")?n:`${e}${n}`;try{return(await fetch(`${t}/setup`,{body:JSON.stringify({}),headers:{"Content-Type":"application/json"},method:"PUT",signal:AbortSignal.timeout(5e3)})).ok?"Engine endpoint accepted an unsigned request \u2014 webhook signature verification may be missing.":void 0}catch{return}}import{createMessageConnection as jn,IPCMessageReader as Dn,IPCMessageWriter as On,NotificationType as Hr,NotificationType0 as Fn,RequestType as Un,RequestType0 as _r}from"vscode-jsonrpc/node";import{z as h}from"zod";var sa=h.object({headed:h.boolean(),runId:h.string().min(1),testRef:h.string().min(1)}),la=h.object({lockfileJson:h.string().optional(),unavailable:h.string().optional()}),da=h.object({runId:h.string().min(1),span:he}),ca=h.object({outcome:He,serverNotified:h.boolean()}),ua=new Fn("worker/ready"),pa=new Un("worker/run"),fa=new _r("worker/lockfile"),ya=new Un("worker/exploreTrail"),ma=new Hr("worker/span"),ga=new Fn("worker/shutdown");function ha(e){let n=jn(new Dn(e),new On(e));return n.listen(),n}function Ra(){let e=jn(new Dn(process),new On(process));return e.listen(),e}import Wr from"path";import{randomUUID as Br}from"crypto";async function Ta({cwd:e,onReady:n,signal:t,step:r,target:o}){let i=D(e).match(f=>({config:f}),f=>({failure:f}));if("failure"in i)return{failure:i.failure,kind:"config-failed"};let s=i.config,a=await Se(e);if(a.result.isErr())return{error:a.result.error,kind:"compile-failed"};let l=await Fe(e,a.result.value),d=await Kr(l,o);return d.kind!=="ok"?d:(await $e({lockfile:l,onReady:n,options:Vr(s),runId:`teleport-${Br()}`,sequence:d.sequence,stopAfterStep:r,test:d.test},t)).match(f=>({kind:"done",result:f}),f=>({error:f,kind:"run-failed"}))}async function Kr(e,n){if(n.kind==="explore"){let r=await Oe(e,n.repro);return r.kind==="unplannable"?{kind:"unplannable"}:{kind:"ok",sequence:r.sequence,test:r.baseTest}}let t=T(e).find(r=>r.ref===n.ref);return t==null?{kind:"no-test",ref:n.ref}:{kind:"ok",sequence:je(e,t.test,void 0),test:t.test}}function Vr(e){return{baseUrl:e.appUrl,engineUrl:e.engineUrl,fixturesDir:Wr.join(e.cwd,Re),generate:A,headed:!0,secret:e.webhookSecret}}var Aa=15e3,Ma=3e4,$a=2,ja=12;function Da(e,n){let t=Qr(e,n);if(!e.enabled||!e.executorLocal)return{abortIds:fe(n),health:{kind:"off"},launchCount:0};if(Jr(n))return{abortIds:fe(n),health:{kind:"paused"},launchCount:0};if(n.lockfile.kind==="blocked")return{abortIds:fe(n),health:{kind:"blocked",reason:n.lockfile.reason},launchCount:0};if(n.backoffActive||n.lockfile.kind==="loading")return{abortIds:t,health:{kind:"paused"},launchCount:0};let r=Math.min(e.workers,n.poolSize-1),o=n.trails.length-t.length;return{abortIds:t,health:{kind:"on"},launchCount:Math.max(0,r-o)}}function Qr(e,n){let t=Me(e.maxTrailLength);return n.trails.filter(r=>r.ageMs>=t).map(r=>r.id)}function fe(e){return e.trails.map(n=>n.id)}function Jr(e){return e.headedActive||e.interactiveActive>0||e.interactiveQueued>0}import{graphql as eo}from"gql.tada";import{err as Q,ok as Ln}from"neverthrow";import zr,{AbortError as Gr}from"p-retry";import{graphql as Nn}from"gql.tada";var Yr=Nn(`
|
|
193
|
-
query AwaitDevSession($projectId: String!, $cwd: String!) {
|
|
194
|
-
project(id: $projectId) {
|
|
195
|
-
devSession(cwd: $cwd) {
|
|
196
|
-
id
|
|
197
|
-
executor
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
`);async function qn(e){return zr(async()=>{let r=(await c({config:e,document:Yr,variables:{cwd:e.cwd,projectId:e.projectId}})).project?.devSession;if(r!=null)return{executor:r.executor,id:r.id,kind:"active"};throw O(e.cwd)?new Error("starting"):new Gr("missing")},{factor:1,maxTimeout:400,minTimeout:400,retries:25}).catch(()=>O(e.cwd)?{kind:"starting"}:{kind:"missing"})}var Xr=Nn(`
|
|
202
|
-
query DevSessionCheckHealth($projectId: String!, $cwd: String!) {
|
|
203
|
-
activeDevSessions(projectId: $projectId) {
|
|
204
|
-
id
|
|
205
|
-
cwd
|
|
206
|
-
branch
|
|
207
|
-
}
|
|
208
|
-
project(id: $projectId) {
|
|
209
|
-
id
|
|
210
|
-
devSession(cwd: $cwd) {
|
|
211
|
-
id
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
`);function _a(e){switch(e.status){case"active":return e.gitMidOperation?"\u2713 Dev session: ripplo daemon is live (hooks auto-paused while git is mid-merge/rebase/cherry-pick \u2014 they resume when the operation ends)":"\u2713 Dev session: ripplo daemon is live for this directory";case"starting":return"! Dev session: the daemon is running locally but hasn't registered with the server yet. Wait a few seconds and re-run `npx ripplo doctor`. If it persists, check the daemon output for auth or network errors.";case"missing":{let n="\u2717 Dev session: no daemon running for this directory. Start `npx ripplo daemon` as a background process (separate from your app's dev server). Without it, `npx ripplo run` refuses to dispatch and scope/coverage hooks won't arm.";return e.elsewhere.length===0?n:[n," A daemon is running for a different directory:",...Zr(e.elsewhere)].join(`
|
|
216
|
-
`)}}}async function Wa(e){let n=O(e),t=Ue(e),r=D(e).unwrapOr(void 0);if(r==null)return{elsewhere:[],gitMidOperation:t,status:n?"starting":"missing",type:"dev-session"};let o=await c({config:r,document:Xr,variables:{cwd:r.cwd,projectId:r.projectId}}).catch(()=>null);return o?.project?.devSession!=null?{elsewhere:[],gitMidOperation:t,status:"active",type:"dev-session"}:{elsewhere:(o?.activeDevSessions??[]).filter(a=>a.cwd!==r.cwd).map(a=>({branch:a.branch,cwd:a.cwd})),gitMidOperation:t,status:n?"starting":"missing",type:"dev-session"}}function Zr(e){return e.map(n=>{let t=n.branch==null?"":` (${n.branch})`;return` - ${n.cwd}${t}`})}var no=eo(`
|
|
217
|
-
mutation SetDevSessionExecutor($devSessionId: String!, $executor: RunExecutor!) {
|
|
218
|
-
setDevSessionExecutor(devSessionId: $devSessionId, executor: $executor) {
|
|
219
|
-
__typename
|
|
220
|
-
... on DevSession {
|
|
221
|
-
id
|
|
222
|
-
executor
|
|
223
|
-
}
|
|
224
|
-
... on DevSessionEndedError {
|
|
225
|
-
message
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
`);async function za(e){return(await Hn(e)).map(t=>t.executor)}async function Ga(e,n){let t=await Hn(e);if(t.isErr())return Q(t.error);let o=(await c({config:e,document:no,variables:{devSessionId:t.value.id,executor:n}})).setDevSessionExecutor;return o==null?Q({kind:"empty-response"}):o.__typename!=="DevSession"?Q({kind:"session-ended"}):Ln(o.executor)}async function Hn(e){let n=await qn(e);return n.kind==="active"?Ln({executor:n.executor,id:n.id}):Q({kind:n.kind==="starting"?"starting":"no-session"})}export{qn as a,_a as b,Wa as c,Zi as d,ea as e,na as f,sa as g,da as h,ca as i,ua as j,pa as k,fa as l,ya as m,ma as n,ga as o,ha as p,Ra as q,oo as r,io as s,Y as t,ao as u,Ao as v,Et as w,Xo as x,ae as y,_t as z,ue as A,wr as B,dr as C,cr as D,ur as E,Ir as F,Ta as G,Aa as H,Ma as I,$a as J,ja as K,Da as L,za as M,Ga as N};
|
package/dist/chunk-6Z555TLR.js
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __ripploCreateRequire } from "node:module";
|
|
3
|
-
const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
|
|
4
|
-
import{c as k}from"./chunk-KQWFJRIP.js";import{a as P,f as I}from"./chunk-3M2E253R.js";import{e as m,h,k as w}from"./chunk-ML7WCYPY.js";import{d as c,f as d}from"./chunk-52IE2PAQ.js";import{V as g,X as S}from"./chunk-SBDRIIVW.js";import u from"fs";import f from"path";function v(e){try{let n=A(e);if(n==null)return;let t=f.join(n,"HEAD"),o=u.readFileSync(t,"utf8").trim(),i="ref: refs/heads/";return o.startsWith(i)?o.slice(i.length):o.length===0?void 0:o.slice(0,7)}catch{return}}function A(e){let n=f.join(e,".git");if(u.statSync(n).isDirectory())return n;let o=u.readFileSync(n,"utf8").trim(),i="gitdir:";if(!o.startsWith(i))return;let s=o.slice(i.length).trim();if(s.length!==0)return f.resolve(e,s)}import b from"crypto";import{readFile as D}from"fs/promises";import x from"path";import{graphql as y}from"gql.tada";import{err as E,ok as L}from"neverthrow";var T=y(`
|
|
5
|
-
mutation SyncDevSession(
|
|
6
|
-
$projectId: String!
|
|
7
|
-
$cwd: String!
|
|
8
|
-
$branch: String
|
|
9
|
-
$lockfileContent: String
|
|
10
|
-
$fixtures: [SyncDevFixtureInput!]
|
|
11
|
-
$entities: [SyncDevEntityInput!]!
|
|
12
|
-
$singletons: [SyncDevSingletonInput!]
|
|
13
|
-
$workflows: [SyncDevWorkflowInput!]!
|
|
14
|
-
) {
|
|
15
|
-
syncDevSession(
|
|
16
|
-
projectId: $projectId
|
|
17
|
-
cwd: $cwd
|
|
18
|
-
branch: $branch
|
|
19
|
-
lockfileContent: $lockfileContent
|
|
20
|
-
fixtures: $fixtures
|
|
21
|
-
entities: $entities
|
|
22
|
-
singletons: $singletons
|
|
23
|
-
workflows: $workflows
|
|
24
|
-
) {
|
|
25
|
-
id
|
|
26
|
-
hooksPaused
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
`);async function oe(e,n){let t=await w(e);if(t.isErr())return E({error:t.error,kind:"compilation-failed"});let o=await l({config:n,cwd:e,lockfile:t.value});return L({devSessionId:o.devSessionId,lockfile:t.value})}async function l(e){let n=g(e.lockfile);return _({config:e.config,cwd:e.cwd,fixtures:e.lockfile.fixtures,payload:n})}var C=y(`
|
|
30
|
-
query DevSessionSyncState($projectId: String!, $cwd: String!) {
|
|
31
|
-
project(id: $projectId) {
|
|
32
|
-
devSession(cwd: $cwd) {
|
|
33
|
-
id
|
|
34
|
-
hooksPaused
|
|
35
|
-
lockfileHash
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
`),F=y(`
|
|
40
|
-
mutation AnnounceDevSessionActive($projectId: String!, $cwd: String!) {
|
|
41
|
-
announceDevSessionActive(projectId: $projectId, cwd: $cwd)
|
|
42
|
-
}
|
|
43
|
-
`);async function re(e){let n=await W(e.cwd);if(n!=null){let o=(await c({config:e.config,document:C,variables:{cwd:e.cwd,projectId:e.config.projectId}}).catch(()=>null))?.project?.devSession;if(o!=null&&o.lockfileHash===n)return await c({config:e.config,document:F,variables:{cwd:e.cwd,projectId:e.config.projectId}}).catch(()=>null),{devSessionId:o.id,hooksPaused:o.hooksPaused}}return l(e)}async function W(e){let n=await R(e);return n==null?null:b.createHash("sha256").update(n).digest("hex")}async function _({config:e,cwd:n,fixtures:t,payload:o}){let i=v(n),s=await R(n),p=await O(n,t),a=await c({config:e,document:T,variables:{branch:i??null,cwd:n,entities:o.entities.map(r=>({description:r.description,name:r.name})),fixtures:p,lockfileContent:s,projectId:e.projectId,singletons:o.singletons.map(r=>({defaultValue:r.defaultValue,description:r.description,name:r.name,type:r.type})),workflows:o.workflows.map(r=>({entities:[...r.entities],expectedOutcome:r.expectedOutcome,name:r.name,slug:r.slug,sourcePath:r.sourcePath,spec:JSON.stringify(r.spec)}))}});if(a.syncDevSession==null)throw new Error("syncDevSession returned null");return{devSessionId:a.syncDevSession.id,hooksPaused:a.syncDevSession.hooksPaused}}async function O(e,n){let t=Object.entries(n);return Promise.all(t.map(async([o,i])=>({contentBase64:(await D(x.join(e,m,o))).toString("base64"),sha256:i.sha256})))}async function R(e){try{return await D(x.join(e,h),"utf8")}catch{return null}}import{graphql as H}from"gql.tada";var q=H(`
|
|
44
|
-
mutation AutoScopeAddDirty($projectId: String!, $cwd: String!, $workflowSlugs: [String!]!) {
|
|
45
|
-
addDirtyTestsToScope(projectId: $projectId, cwd: $cwd, workflowSlugs: $workflowSlugs) {
|
|
46
|
-
__typename
|
|
47
|
-
... on MutationAddDirtyTestsToScopeSuccess {
|
|
48
|
-
data {
|
|
49
|
-
id
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
`);async function ye({cwd:e,editedPath:n,lockfile:t}){if(!I(e))return{addedSlugs:[]};let o=new Set(V(e)),i=t.workflows.filter(r=>r.sourcePath!=null&&M({dirtySet:o,editedPath:n,sourcePath:r.sourcePath})).map(r=>S(r.name));if(i.length===0)return{addedSlugs:[]};let s=k(e).unwrapOr(void 0);return s==null?{addedSlugs:[]}:await l({config:s,cwd:e,lockfile:t}).catch(r=>(d.warn("auto-sync failed: %s",r instanceof Error?r.message:String(r)),null))==null?{addedSlugs:[]}:{addedSlugs:await B({cfg:s,slugs:i})?i:[]}}async function B({cfg:e,slugs:n}){let o=(await c({config:e,document:q,variables:{cwd:e.cwd,projectId:e.projectId,workflowSlugs:[...n]}}).catch(i=>(d.warn("auto-scope failed: %s",i instanceof Error?i.message:String(i)),null)))?.addDirtyTestsToScope;return o?.__typename!=="MutationAddDirtyTestsToScopeSuccess"?!1:o.data.length>0}function M({dirtySet:e,editedPath:n,sourcePath:t}){return e.has(t)||n!=null&&n.endsWith(t)}var $=".ripplo/workflows/",j=" -> ";function V(e){let n;try{n=P(["status","--porcelain","-uall","--",".ripplo/workflows"],e)}catch{return[]}return n.split(`
|
|
55
|
-
`).map(t=>t.slice(3).trim()).map(t=>t.includes(j)?t.split(j)[1]:t).filter(t=>t!=null).filter(t=>t.startsWith($)&&t.endsWith(".ts")).map(t=>t.slice($.length)).filter(t=>t!=="index.ts"&&!t.endsWith("/index.ts"))}export{v as a,oe as b,l as c,re as d,W as e,ye as f,V as g};
|
package/dist/chunk-B6OQ2JE2.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __ripploCreateRequire } from "node:module";
|
|
3
|
-
const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
|
|
4
|
-
import{j as c}from"./chunk-52IE2PAQ.js";import{spawnSync as y}from"child_process";import{existsSync as s,readdirSync as d,readFileSync as g,realpathSync as u,statSync as m}from"fs";import i from"path";var k=2e3;function _(t){if(t!=null)try{return m(u(t)).mtimeMs}catch{return}}function D(t){return y("pnpm",["turbo","run","build","--filter=ripplo..."],{cwd:t,stdio:"inherit"}).status===0}function U(){let t=process.argv[1];if(t==null)return{kind:"fresh"};let n=u(t),r=n.includes(`${i.sep}src${i.sep}`),o=l(i.dirname(n));if(o!=null)return r?{kind:"fresh"}:h(o);let a=l(process.cwd());return a!=null&&j(a)?{kind:"foreign-binary",workspaceRoot:a}:{kind:"fresh"}}function l(t){let n=i.dirname(t);return s(i.join(t,"pnpm-workspace.yaml"))?t:n===t?void 0:l(n)}function h(t){let n=i.join(t,"packages");if(!s(n))return{kind:"fresh"};let r=d(n).map(o=>({dist:i.join(n,o,"dist"),name:o,src:i.join(n,o,"src")})).filter(o=>s(o.src)&&s(o.dist)).filter(o=>p(o.src)>p(o.dist)+k).map(o=>o.name);return r.length===0?{kind:"fresh"}:{kind:"stale",packages:r,workspaceRoot:t}}function p(t){let n=m(t);if(!n.isDirectory())return n.mtimeMs;let r=d(t).map(o=>p(i.join(t,o)));return Math.max(n.mtimeMs,...r)}function j(t){let n=i.join(t,"packages","cli","package.json");if(!s(n))return!1;let r=JSON.parse(g(n,"utf8"));return typeof r=="object"&&r!=null&&"name"in r&&r.name==="ripplo"}import{createMessageConnection as S,NotificationType as f,RequestType as x,RequestType0 as b,SocketMessageReader as R,SocketMessageWriter as w}from"vscode-jsonrpc/node";import{z as e}from"zod";var E="daemon.sock",P="daemon.log";function K(t){return c(t,E)}function B(t){return c(t,P)}function X(t){return S(new R(t),new w(t))}var G=e.object({all:e.boolean(),headed:e.boolean(),tests:e.array(e.string())}),$=e.object({jobId:e.string(),total:e.number()}),M=e.enum(["no-lockfile","unstamped","expander-newer","dsl-drift","load-failed"]),q=e.discriminatedUnion("kind",[e.object({kind:e.literal("off")}),e.object({kind:e.literal("on")}),e.object({kind:e.literal("paused")}),e.object({kind:e.literal("blocked"),reason:M})]),v=e.object({attempts:e.number(),findings:e.number()}),H=e.object({active:e.number(),bundleMtimeMs:e.number().optional(),explorer:q,exploring:e.number(),progress:v,queued:e.number(),sseHealth:e.object({detail:e.string().optional(),ok:e.boolean()}).optional(),version:e.string().optional()}),z=e.enum(["MAX_RUNS","OVERAGE_CAP","MAX_AGENTS","MAX_CONCURRENT_RUNS","MAX_PROJECTS"]),I=e.discriminatedUnion("type",[e.object({code:z,type:e.literal("limit")}),e.object({detail:e.string(),type:e.literal("generic")})]),A=e.discriminatedUnion("kind",[e.object({kind:e.literal("pass")}),e.object({findingLines:e.array(e.string()),kind:e.literal("findings")}),e.object({detail:e.string(),kind:e.literal("error")}),e.object({kind:e.literal("dispatch-error"),reason:I}),e.object({detail:e.string(),kind:e.literal("dispatch-timeout")}),e.object({detail:e.string(),kind:e.literal("infra-error")})]),C=e.discriminatedUnion("kind",[e.object({kind:e.literal("test-started"),runId:e.string(),testName:e.string(),workflowName:e.string()}),e.object({kind:e.literal("test-outcome"),outcome:A,runId:e.string(),testName:e.string(),workflowName:e.string()})]),V=e.object({event:C,jobId:e.string()}),Q=e.object({failed:e.number(),jobId:e.string(),notRun:e.number(),passed:e.number()}),Y=e.discriminatedUnion("code",[e.object({code:e.literal("compile-failed"),detail:e.string(),diagnostics:e.array(e.string()).default([])}),e.object({code:e.literal("selection-conflicting-flags")}),e.object({code:e.literal("selection-nothing-selected")}),e.object({code:e.literal("selection-unknown-ids"),known:e.array(e.string()),unknown:e.array(e.string())}),e.object({code:e.literal("scope-failed"),detail:e.string()}),e.object({code:e.literal("app-unreachable"),detail:e.string(),url:e.string()}),e.object({code:e.literal("engine-unreachable"),detail:e.string(),url:e.string()}),e.object({code:e.literal("sync-failed"),detail:e.string()}),e.object({code:e.literal("bad-message")})]),Z=new x("ripplo/enqueue"),ee=new b("ripplo/status"),te=new b("ripplo/shutdownIfIdle"),ne=new f("ripplo/jobEvent"),oe=new f("ripplo/jobDone");export{_ as a,D as b,U as c,K as d,B as e,X as f,G as g,$ as h,H as i,A as j,V as k,Q as l,Y as m,Z as n,ee as o,te as p,ne as q,oe as r};
|
package/dist/chunk-CJUKILIO.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __ripploCreateRequire } from "node:module";
|
|
3
|
-
const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
|
|
4
|
-
var i=null;function f(n){i=n}function g(){return i==null?{}:{"x-ripplo-client-version":i}}import{execFileSync as l}from"child_process";import u from"fs";import o from"path";function y(n){let r=c(n);return r??e(n)}function e(n){let r=o.dirname(n);return s(o.join(n,".ripplo"))?n:r===n?null:e(r)}function s(n){try{return u.statSync(n).isDirectory()}catch{return!1}}function c(n){let r=p(["rev-parse","--show-toplevel"],n);if(r==null)return null;let t=r.trim();return t.length===0?null:o.isAbsolute(t)?t:o.resolve(n,t)}function p(n,r){try{return l("git",n,{cwd:r,encoding:"utf8",stdio:["ignore","pipe","ignore"]})}catch{return null}}export{f as a,g as b,y as c};
|
package/dist/chunk-MHXAGRCM.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __ripploCreateRequire } from "node:module";
|
|
3
|
-
const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
|
|
4
|
-
import{a as s}from"./chunk-7WZ3VIUU.js";import{e as p}from"./chunk-3M2E253R.js";import{a as i}from"./chunk-MHNGR6M7.js";import{k as n}from"./chunk-ML7WCYPY.js";import{c as a}from"./chunk-INURHJF4.js";import l from"fs";import d from"path";import*as r from"zod/mini";var c=new Set(["Edit","Write","NotebookEdit"]),u=r.looseObject({file_path:r.string()}),D=async t=>{if(!c.has(t.tool_name))return;let e=m(t);if(e==null)return;let{cwd:o}=t;return l.existsSync(p(o))||a(o)?void 0:(await n(o)).isErr()?{hookSpecificOutput:{additionalContext:`\`ripplo daemon\` isn't running and the DSL isn't compiling, so this edit is allowed through without dev-mode guardrails. Run \`npx ripplo compile\` to see the errors, or \`/ripplo:start\` to bring the daemon up. ${i("create","DSL authoring rules")}`,hookEventName:"PreToolUse"}}:{hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"deny",permissionDecisionReason:`\`ripplo daemon\` is not running \u2014 this edit to \`${e}\` won't sync and dev-mode guardrails won't fire. Run \`/ripplo:start\`, then retry (\`npx ripplo doctor\` checks the daemon and dev server). If the daemon can't start, the user can bypass with \`npx ripplo hooks pause\`. ${i("start")}`}}};function m(t){let e=u.safeParse(t.tool_input);if(!e.success||!s(t.cwd))return null;let o=d.relative(t.cwd,e.data.file_path);return o.startsWith("..")||o!==".ripplo"&&!o.startsWith(".ripplo/")?null:o}export{D as a};
|
package/dist/chunk-ML7WCYPY.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __ripploCreateRequire } from "node:module";
|
|
3
|
-
const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
|
|
4
|
-
import{K as v,L,Q as j,R as g,ca as B}from"./chunk-SBDRIIVW.js";import c from"fs";import l from"path";import{createHash as Se}from"crypto";import{pathToFileURL as Re}from"url";import{build as be}from"esbuild";import{err as x,ok as C,ResultAsync as Fe}from"neverthrow";import ee from"fs";import y from"path";import u from"typescript";function A(e){let n=y.join(e,"index.ts"),t=re(e);ee.mkdirSync(y.dirname(t.tsBuildInfoFile??""),{recursive:!0});let r=u.createIncrementalCompilerHost(t),o=u.createIncrementalProgram({host:r,options:t,rootNames:[n]}),i=[...o.getSyntacticDiagnostics(),...o.getSemanticDiagnostics()];o.emit();let s=i.filter(a=>ne(a,e));if(s.length===0)return{diagnostics:[],ok:!0};let T={getCanonicalFileName:a=>a,getCurrentDirectory:()=>y.dirname(e),getNewLine:()=>`
|
|
5
|
-
`};return{diagnostics:u.formatDiagnosticsWithColorAndContext(s,T).split(`
|
|
6
|
-
`).filter(a=>a.length>0),ok:!1}}function ne(e,n){let t=e.file?.fileName;return t==null?!0:t.startsWith(n)}var te=y.join(".local","tsbuildinfo");function re(e){return{allowImportingTsExtensions:!0,allowJs:!1,esModuleInterop:!0,incremental:!0,module:u.ModuleKind.Preserve,moduleResolution:u.ModuleResolutionKind.Bundler,noEmit:!0,resolveJsonModule:!0,skipLibCheck:!0,strict:!1,target:u.ScriptTarget.ES2022,tsBuildInfoFile:y.join(e,te)}}import U from"fs";import R from"safe-stable-stringify";import{err as se,ok as N,Result as ae}from"neverthrow";import M from"safe-stable-stringify";import{createHash as oe}from"crypto";import H from"fs";function h(){return S===void 0&&(S=ie()),S}var S;function ie(){let e=process.argv[1];if(e==null)return null;try{let n=H.readFileSync(H.realpathSync(e));return oe("sha256").update(n).digest("hex")}catch{return null}}function I(e){return{...e,checks:void 0,solved:{cosat:{},subsume:{}}}}function Xe(e,n){return M(I(e))===M(I(n))}function O(e){return _(e.checks?.expanderHash,h())}function _(e,n){return e!=null&&n!=null&&e===n}function W(e){return _(e??void 0,h())}async function D(e,n){let t={entities:e.entities,singletonSchemas:e.singletons,valueSpaces:e.valueSpaces},r=le(n),o=ue(e,r),i=await Promise.all(e.workflows.map(s=>de({context:t,reusable:o,workflow:s})));return ae.combine(i).map(s=>({...e,workflows:[...s]}))}function le(e){let n=ce(e);if(!(n==null||!O(n)))return n}function ce(e){if(U.existsSync(e))try{return L(g,U.readFileSync(e,"utf8"))}catch{return}}async function de({context:e,reusable:n,workflow:t}){let r=n.get($(t));if(r!=null)return N({...t,tests:r.tests});try{return N(await B({context:e,workflow:t}))}catch(o){let i=o instanceof Error?o.message:String(o);return se({kind:"expand-failed",message:i,workflow:t.name})}}function $(e){let n=R({...e,tests:[]});if(n==null)throw new Error("solver: workflow is not serializable");return n}function ue(e,n){return n==null||R(z(n))!==R(z(e))?new Map:new Map(n.workflows.map(t=>[$(t),t]))}function z(e){return{entities:e.entities,singletons:e.singletons,valueSpaces:e.valueSpaces}}import{createHash as fe}from"crypto";import J from"fs/promises";import b from"path";import{err as f,ok as F,Result as pe}from"neverthrow";var me=".ripplo/fixtures",ge=10*1024*1024,ye=50*1024*1024;async function K(e,n){let t=he(n);if(t.length===0)return F({});let r=b.join(e,me),o=await Promise.all(t.map(i=>ke({fixturesRoot:r,name:i})));return pe.combine(o).andThen(xe)}function he(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 ke({fixturesRoot:e,name:n}){if(n.includes("..")||b.isAbsolute(n))return f({kind:"fixture-invalid-name",name:n});let t=b.join(e,n),r=await J.lstat(t).catch(()=>null);if(r==null)return f({kind:"fixture-missing",name:n,path:t});if(r.isSymbolicLink())return f({kind:"fixture-symlink",name:n});if(!r.isFile())return f({kind:"fixture-not-file",name:n});let o=await J.readFile(t);if(o.byteLength>ge)return f({kind:"fixture-too-large",name:n,size:o.byteLength});let i=fe("sha256").update(o).digest("hex");return F([n,{sha256:i,size:o.byteLength}])}function xe(e){let n=e.reduce((t,[,r])=>t+r.size,0);return n>ye?f({kind:"fixtures-total-too-large",total:n}):F(Object.fromEntries(e))}import{createHash as Le}from"crypto";import p from"fs";import P from"path";import{z as w}from"zod";function X({cwd:e,fingerprint:n}){let t=Ee(e);if(t==null||t.fingerprint!==E(n))return;let r=P.join(e,".ripplo","ripplo.lock");if(!p.existsSync(r))return;let o=p.readFileSync(r,"utf8");if(E(o)===t.lockfileHash)try{return L(g,o)}catch{return}}function V({cwd:e,fingerprint:n,lockfile:t}){let r={bundle:h(),fingerprint:E(n),lockfileHash:E(v(g,t))},o=Y(e);p.mkdirSync(P.dirname(o),{recursive:!0}),p.writeFileSync(o,JSON.stringify(r))}var we=w.object({bundle:w.string().nullable(),fingerprint:w.string(),lockfileHash:w.string()});function Ee(e){let n=Y(e);if(p.existsSync(n))try{let t=we.safeParse(JSON.parse(p.readFileSync(n,"utf8")));return!t.success||!W(t.data.bundle)?void 0:t.data}catch{return}}function Y(e){return P.join(e,".ripplo",".local","load-cache.json")}function E(e){return Le("sha256").update(e).digest("base64")}var Pe=".ripplo/ripplo.lock",k;async function Pn(e){let{result:n}=await Ce(e);return n}async function Ce(e){let n=q(l.join(e,".ripplo"));if(k!=null&&k.fingerprint===n&&k.result.isOk())return{fingerprint:n,result:k.result};let t=await Te(e);return k={fingerprint:n,result:t},{fingerprint:n,result:t}}async function Te(e){let n=l.join(e,".ripplo"),t=l.join(n,"index.ts"),r=q(n),o=X({cwd:e,fingerprint:r});if(o!=null)return C(o);let i=Be(t);i.catch(()=>{});let s=A(n);if(!s.ok)return x({diagnostics:s.diagnostics,kind:"typecheck-failed"});let a=await(await Ae(t,i)).andThen(d=>Ie({entryPath:t,exported:d})).match(async d=>(await K(e,d)).map(m=>({...d,fixtures:m})).mapErr(m=>({error:m,kind:"fixture-failed"})).asyncAndThen(m=>new Fe(D(m,l.join(e,Pe))).mapErr(Z=>Z)),d=>Promise.resolve(x(d)));return a.isOk()&&V({cwd:e,fingerprint:r,lockfile:a.value}),a}var ve=new Set([".local","debug","node_modules","ripplo.lock"]);function q(e){let n=l.join(e,"..","node_modules","@ripplo","testing","package.json");return[...G(e),...je(n)].toSorted((t,r)=>t.localeCompare(r)).join("|")}function G(e){return(c.existsSync(e)?c.readdirSync(e,{withFileTypes:!0}):[]).flatMap(t=>{if(ve.has(t.name))return[];let r=l.join(e,t.name);if(t.isDirectory())return G(r);let o=c.statSync(r);return[`${r}:${String(o.mtimeMs)}:${String(o.size)}`]})}function je(e){if(!c.existsSync(e))return[];let n=c.statSync(e);return[`${e}:${String(n.mtimeMs)}:${String(n.size)}`]}async function Be(e){let t=(await be({bundle:!0,entryPoints:[e],format:"esm",logLevel:"silent",platform:"node",sourcemap:"inline",target:"node22",write:!1})).outputFiles[0];if(t==null)throw new Error("dsl bundle produced no output");return t.text}async function Ae(e,n){try{let t=await n;process.setSourceMapsEnabled(!0);let r=await import(He(e,t)),o=r!=null&&typeof r=="object"&&"default"in r?Reflect.get(r,"default"):r;return C(o)}catch(t){return x({kind:"load-threw",message:Me(t)})}}function He(e,n){let t=l.join(l.dirname(e),".local");c.mkdirSync(t,{recursive:!0});let r=Se("sha256").update(n).digest("hex").slice(0,16),o=l.join(t,`dsl-bundle-${r}.mjs`);return c.writeFileSync(o,n),Re(o).href}function Me(e){return e instanceof Error?e.message:String(e)}function Ie({entryPath:e,exported:n}){if(n==null||typeof n!="object"||!("lockfile"in n))return x({entryPath:e,kind:"not-ripplo"});let t=j.safeParse(Reflect.get(n,"lockfile"));return t.success?C(t.data):x({issues:t.error.issues.map(r=>`${r.path.join(".")}: ${r.message}`),kind:"invalid-lockfile"})}export{h as a,Xe as b,O as c,W as d,me as e,ge as f,ye as g,Pe as h,Pn as i,Ce as j,Te as k};
|