ripplo 0.9.8 → 0.11.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/README.md +105 -47
- package/dist/assets/rrweb-replay.js +1 -1
- package/dist/assets/rrweb.js +1 -1
- package/dist/capture-worker.js +20 -14
- package/dist/chunk-3HAQCJRK.js +4 -0
- package/dist/{chunk-5E62BCS7.js → chunk-47LLHHJH.js} +2 -2
- package/dist/chunk-4YAC72LW.js +7 -0
- package/dist/chunk-5HFJIZLI.js +4 -0
- package/dist/chunk-6U2LNGSV.js +51 -0
- package/dist/{chunk-2GFHB4LD.js → chunk-6WFJZ5L6.js} +1 -1
- package/dist/chunk-7JKCHASU.js +4 -0
- package/dist/{chunk-3UZZBLVA.js → chunk-7RREARGA.js} +2 -2
- package/dist/{chunk-WNAVYV4P.js → chunk-AXROBTLA.js} +1 -1
- package/dist/chunk-BGY5F3IU.js +5 -0
- package/dist/{chunk-IPSXNIXC.js → chunk-C7SV6AR2.js} +4 -4
- package/dist/chunk-CI6273ZU.js +107 -0
- package/dist/chunk-DY7ZW6QZ.js +9 -0
- package/dist/chunk-E6ZBZIIS.js +4 -0
- package/dist/chunk-G6J2WIHJ.js +4 -0
- package/dist/{chunk-64OQXBRG.js → chunk-GYBY7EOO.js} +1 -1
- package/dist/{chunk-LOEAZGYO.js → chunk-HEOMRXZE.js} +1 -1
- package/dist/chunk-IK3ROREL.js +6 -0
- package/dist/{chunk-7W237JFM.js → chunk-JS3DLVVI.js} +1 -1
- package/dist/{chunk-TPHOSZAK.js → chunk-KH4QH23U.js} +1 -1
- package/dist/{chunk-OES7HGNF.js → chunk-LEFODI2H.js} +1 -1
- package/dist/{chunk-7EL64XR6.js → chunk-LWMXGWS2.js} +1 -1
- package/dist/chunk-O45YB6YY.js +354 -0
- package/dist/{chunk-YQ2RBEOJ.js → chunk-PXXURBGC.js} +2 -2
- package/dist/{chunk-OAU4HUD2.js → chunk-PYDYI3AA.js} +2 -2
- package/dist/{chunk-R3DZ6JPY.js → chunk-RIASQHPG.js} +1 -1
- package/dist/chunk-S2K5KILQ.js +8 -0
- package/dist/chunk-SXVWB7TZ.js +6 -0
- package/dist/chunk-UH5CQF5R.js +6 -0
- package/dist/{chunk-GZ3M7PNW.js → chunk-VKAZQPJJ.js} +1 -1
- package/dist/chunk-WAGXAEB4.js +13 -0
- package/dist/chunk-WBKSJU63.js +83 -0
- package/dist/{chunk-AGK6XOX2.js → chunk-XAMVRZJH.js} +2 -2
- package/dist/chunk-ZHDR7LXB.js +56 -0
- package/dist/{cli-error-TS4FNZ6F.js → cli-error-6PUIWNIT.js} +1 -1
- package/dist/{compile-write-BLJH647I.js → compile-write-KUUFWSI4.js} +1 -1
- package/dist/daemon-2ZTZXQW6.js +4 -0
- package/dist/daemon-GP3EIISA.js +152 -0
- package/dist/{daemon-lock-OAARBZ4O.js → daemon-lock-RPKO5SNE.js} +1 -1
- package/dist/dsl-loader-WPAKMON7.js +4 -0
- package/dist/dsl-typecheck-worker.js +6 -0
- package/dist/{exit-plan-gate-HSTV7UO4.js → exit-plan-gate-44YWEKYS.js} +1 -1
- package/dist/hook.js +1 -1
- package/dist/index.js +207 -260
- package/dist/{plan-reminder-RBCRBCKC.js → plan-reminder-PP5DQAQZ.js} +1 -1
- package/dist/post-edit-R7KN424T.js +4 -0
- package/dist/post-edit-analyze-UURDL3AH.js +4 -0
- package/dist/post-edit-flag-stubs-I7AUGN4D.js +4 -0
- package/dist/pre-bash-run-gate-MIEM2DBB.js +4 -0
- package/dist/pre-edit-C4MGURNO.js +4 -0
- package/dist/pre-edit-ripplo-skill-gate-A6ETC3QN.js +4 -0
- package/dist/pre-edit-scope-gate-M5IQSVGF.js +4 -0
- package/dist/{pre-edit-watch-gate-SJ3RCYH5.js → pre-edit-watch-gate-ORQP7MSW.js} +1 -1
- package/dist/prompt-submit-6KNOFK4W.js +4 -0
- package/dist/scope-reminder-A6GVTTVE.js +4 -0
- package/dist/session-preamble-IZQPIWST.js +4 -0
- package/dist/status-PG4EBZRM.js +4 -0
- package/dist/{stop-enforce-VWOM5EZY.js → stop-enforce-CO5GYI3G.js} +9 -9
- package/dist/tasks-reminder-TDWPD3KV.js +4 -0
- package/dist/{track-skill-load-CJ74GD3Q.js → track-skill-load-SXSDMHFO.js} +1 -1
- package/dist/{track-skill-prompt-YSB6OOQN.js → track-skill-prompt-7N4TQAD2.js} +1 -1
- package/package.json +3 -6
- package/dist/chunk-22JUAYHM.js +0 -4
- package/dist/chunk-7IIRERCW.js +0 -8
- package/dist/chunk-7VGCLQGP.js +0 -7
- package/dist/chunk-7YQOAAKF.js +0 -224
- package/dist/chunk-AWPZTNYU.js +0 -6
- package/dist/chunk-CB74TAUC.js +0 -5
- package/dist/chunk-CTTC4KKQ.js +0 -83
- package/dist/chunk-GI65FUDI.js +0 -6
- package/dist/chunk-IDPJESOE.js +0 -9
- package/dist/chunk-IKYR3UCU.js +0 -55
- package/dist/chunk-LB65USNP.js +0 -73
- package/dist/chunk-MOI4L3EX.js +0 -4
- package/dist/chunk-N2OBRCPQ.js +0 -6
- package/dist/chunk-NY6EIQR4.js +0 -4
- package/dist/chunk-OQ4TDIP3.js +0 -55
- package/dist/chunk-OQS63V7U.js +0 -7
- package/dist/chunk-OWN4P2K7.js +0 -4
- package/dist/chunk-SNU66GSR.js +0 -4
- package/dist/chunk-TOBC3SQA.js +0 -8
- package/dist/daemon-QKBWYQJA.js +0 -4
- package/dist/daemon-UMZJZ7BY.js +0 -152
- package/dist/dsl-loader-NGW4V4A3.js +0 -4
- package/dist/post-edit-MVGQGAW4.js +0 -4
- package/dist/post-edit-analyze-XWTZMQCB.js +0 -4
- package/dist/post-edit-flag-stubs-4MQZATJE.js +0 -4
- package/dist/pre-bash-run-gate-B42YNDQF.js +0 -4
- package/dist/pre-edit-YF6WNE6G.js +0 -4
- package/dist/pre-edit-ripplo-skill-gate-QHUD7QGU.js +0 -4
- package/dist/pre-edit-scope-gate-2YIFSEDY.js +0 -4
- package/dist/prompt-submit-YX7GMTC4.js +0 -4
- package/dist/scope-reminder-DIDCHDAA.js +0 -4
- package/dist/session-preamble-ZYVRDSGA.js +0 -4
- package/dist/solve-worker.js +0 -4
- package/dist/status-HPMHJBKH.js +0 -4
- package/dist/tasks-reminder-SDS6RNLP.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-GYBY7EOO.js";import"./chunk-7WZ3VIUU.js";import"./chunk-KH4QH23U.js";import"./chunk-RIASQHPG.js";import"./chunk-C7SV6AR2.js";import"./chunk-HEOMRXZE.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-S2K5KILQ.js";import{a as e}from"./chunk-VKAZQPJJ.js";import"./chunk-SXVWB7TZ.js";import"./chunk-JJ4QQPAV.js";import"./chunk-6U2LNGSV.js";import"./chunk-IK3ROREL.js";import"./chunk-OQ6KNYPG.js";import"./chunk-WAGXAEB4.js";import"./chunk-JS3DLVVI.js";import"./chunk-FEHVIHVA.js";import"./chunk-MHNGR6M7.js";import{b as o}from"./chunk-KOKEEAEF.js";import"./chunk-E6ZBZIIS.js";import"./chunk-WBKSJU63.js";import"./chunk-7JKCHASU.js";import"./chunk-ZHDR7LXB.js";import"./chunk-7WZ3VIUU.js";import"./chunk-KH4QH23U.js";import"./chunk-RIASQHPG.js";import"./chunk-C7SV6AR2.js";import"./chunk-HEOMRXZE.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-S2K5KILQ.js";import"./chunk-6U2LNGSV.js";import"./chunk-IK3ROREL.js";import"./chunk-OQ6KNYPG.js";import"./chunk-WAGXAEB4.js";import"./chunk-JS3DLVVI.js";import"./chunk-FEHVIHVA.js";import"./chunk-MHNGR6M7.js";import"./chunk-E6ZBZIIS.js";import"./chunk-WBKSJU63.js";import"./chunk-7JKCHASU.js";import"./chunk-ZHDR7LXB.js";import"./chunk-7WZ3VIUU.js";import"./chunk-KH4QH23U.js";import"./chunk-RIASQHPG.js";import"./chunk-C7SV6AR2.js";import"./chunk-HEOMRXZE.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-VKAZQPJJ.js";import"./chunk-SXVWB7TZ.js";import"./chunk-JJ4QQPAV.js";import"./chunk-E6ZBZIIS.js";import"./chunk-WBKSJU63.js";import"./chunk-7JKCHASU.js";import"./chunk-ZHDR7LXB.js";import"./chunk-7WZ3VIUU.js";import"./chunk-KH4QH23U.js";import"./chunk-RIASQHPG.js";import"./chunk-C7SV6AR2.js";import"./chunk-HEOMRXZE.js";import"./chunk-NNH3YVVO.js";import"./chunk-KMZ3L5YA.js";export{a as postEditFlagStubs};
|
|
@@ -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{b as h}from"./chunk-G6J2WIHJ.js";import{c}from"./chunk-KOKEEAEF.js";import{a as y}from"./chunk-7WZ3VIUU.js";import{f}from"./chunk-KH4QH23U.js";import"./chunk-RIASQHPG.js";import"./chunk-C7SV6AR2.js";import"./chunk-HEOMRXZE.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=c("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(!y(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-LWMXGWS2.js";import{a as t}from"./chunk-5HFJIZLI.js";import"./chunk-G6J2WIHJ.js";import{a as i}from"./chunk-PXXURBGC.js";import"./chunk-JJ4QQPAV.js";import"./chunk-JS3DLVVI.js";import"./chunk-FEHVIHVA.js";import"./chunk-MHNGR6M7.js";import{b as o}from"./chunk-KOKEEAEF.js";import"./chunk-7JKCHASU.js";import"./chunk-ZHDR7LXB.js";import"./chunk-7WZ3VIUU.js";import"./chunk-KH4QH23U.js";import"./chunk-RIASQHPG.js";import"./chunk-C7SV6AR2.js";import"./chunk-HEOMRXZE.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-5HFJIZLI.js";import"./chunk-G6J2WIHJ.js";import"./chunk-7WZ3VIUU.js";import"./chunk-KH4QH23U.js";import"./chunk-RIASQHPG.js";import"./chunk-C7SV6AR2.js";import"./chunk-HEOMRXZE.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-PXXURBGC.js";import"./chunk-JJ4QQPAV.js";import"./chunk-JS3DLVVI.js";import"./chunk-FEHVIHVA.js";import"./chunk-MHNGR6M7.js";import"./chunk-7WZ3VIUU.js";import"./chunk-KH4QH23U.js";import"./chunk-RIASQHPG.js";import"./chunk-C7SV6AR2.js";import"./chunk-HEOMRXZE.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-LWMXGWS2.js";import"./chunk-MHNGR6M7.js";import"./chunk-7JKCHASU.js";import"./chunk-ZHDR7LXB.js";import"./chunk-7WZ3VIUU.js";import"./chunk-KH4QH23U.js";import"./chunk-RIASQHPG.js";import"./chunk-C7SV6AR2.js";import"./chunk-HEOMRXZE.js";import"./chunk-NNH3YVVO.js";import"./chunk-KMZ3L5YA.js";export{a as preEditWatchGate};
|
|
@@ -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-PYDYI3AA.js";import{a as r}from"./chunk-AXROBTLA.js";import{a as i}from"./chunk-XAMVRZJH.js";import"./chunk-BGY5F3IU.js";import"./chunk-CI6273ZU.js";import"./chunk-SXVWB7TZ.js";import"./chunk-G6J2WIHJ.js";import"./chunk-JJ4QQPAV.js";import"./chunk-47LLHHJH.js";import"./chunk-OQ6KNYPG.js";import"./chunk-JS3DLVVI.js";import"./chunk-FEHVIHVA.js";import"./chunk-MHNGR6M7.js";import{b as o}from"./chunk-KOKEEAEF.js";import{a as t}from"./chunk-GYBY7EOO.js";import"./chunk-7WZ3VIUU.js";import"./chunk-KH4QH23U.js";import"./chunk-RIASQHPG.js";import"./chunk-C7SV6AR2.js";import"./chunk-HEOMRXZE.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-PYDYI3AA.js";import"./chunk-BGY5F3IU.js";import"./chunk-SXVWB7TZ.js";import"./chunk-JJ4QQPAV.js";import"./chunk-JS3DLVVI.js";import"./chunk-FEHVIHVA.js";import"./chunk-MHNGR6M7.js";import"./chunk-7WZ3VIUU.js";import"./chunk-KH4QH23U.js";import"./chunk-RIASQHPG.js";import"./chunk-C7SV6AR2.js";import"./chunk-HEOMRXZE.js";import"./chunk-NNH3YVVO.js";import"./chunk-KMZ3L5YA.js";export{a as scopeReminder};
|
|
@@ -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{c as e}from"./chunk-KOKEEAEF.js";import{a as t}from"./chunk-7WZ3VIUU.js";import"./chunk-KMZ3L5YA.js";var n="# Ripplo \u2014 always-on session context\n\nEvery user-facing change leaves its affected critical journeys covered by passing typed workflows.\n\n## Load the matching skill first\n\nDo not edit `.ripplo/`, run `npx ripplo` commands, or diagnose Ripplo before loading the matching\nskill. The skills contain the current procedures and DSL rules.\n\n- `/ripplo:setup` initializes a project and connects state sources, sign-in, and browser readiness.\n- `/ripplo:discover` maps critical journeys and their state space.\n- `/ripplo:create` authors or strengthens a workflow.\n- `/ripplo:run` runs, diagnoses, scopes, and reports app bugs.\n- `/ripplo:tasks` handles user tasks and explorer findings.\n- `/ripplo:start` starts the app and daemon session.\n\n## Workflow authoring model\n\n- **One workflow, one critical user intent.** Follow the real multi-step click path from its natural\n entry point. Let earlier actions create state that later steps need.\n- **Start as wide as the whole journey allows.** `given` contains only meaningful presence,\n absence, relations, permissions, actor, and viewport preconditions required by every step.\n- **Keep values connected to state.** Use returned record handles and `arbitrary(field)` bindings\n in URLs, locators, inputs, conditions, and effects. Use `exact(value)` only when that concrete\n string or number drives behavior.\n- **Branch without fixing values.** Use `optional()` and named `when` branches when starting\n state changes the outcome but intent and path stay the same. Use another workflow when the intent\n or path differs.\n- **Declare the full transition.** Every mutation step declares its visible result and all\n application-state effects, including cascades. Undeclared observed state changes are frame\n violations.\n- **Every effect must definitely change state.** Use a before/after relation that excludes equality\n or model the real precondition. Do not hardcode a convenient previous value to make proof pass.\n- **Declare reachability.** An earlier durable `visible(...)` must establish every element an\n action touches. Use semantic locators. Add an accessible name to the app when one is missing.\n- **Facts keep their declared conditions.** Workflow assertions carry only under the complete state\n known at that step. Use `fact()` only for true app-wide invariants or permission boundaries.\n\n## Delivery rules\n\n- Run the app dev server and `npx ripplo daemon`. Use `npx ripplo doctor` or `/ripplo:start`.\n- Add every affected journey to Testing Scope. Implement stubs before finishing.\n- Fix app bugs in the app. Strengthen model gaps in the workflow. Do not weaken declarations to\n make a run pass.\n- Diagnose with `npx ripplo explain <runId>` and `.ripplo/debug/<runId>/behavior.jsonl` before\n re-running.\n- Keep the explorer on. Triage findings through `/ripplo:tasks`.\n- Commit `.ripplo/ripplo.lock`. Regenerate it with `npx ripplo compile`. Never edit it by hand.\n- Keep scratch output under `.ripplo/.local/`.\n\n## Key files\n\n- `.ripplo/index.ts` \u2014 `createRipplo` call.\n- `.ripplo/state.ts` \u2014 state schema and workflow handles. `.ripplo/workflows/index.ts` \u2014 workflow registry.\n- `.ripplo/project.json` \u2014 project id + env-file pointers.\n- `<app>/src/test/engine.ts` \u2014 HTTP state source and sign-in implementations, when used.\n- Browser bootstrap \u2014 browser source passed to `connect(engine)`, or `connect()` without browser\n state, followed by `connection.ready()` after the page is interactive.\n- `node_modules/@ripplo/testing/DSL.md` \u2014 full primitive catalog.\n",a=e("SessionStart",o=>{if(t(o.cwd))return{hookSpecificOutput:{additionalContext:n,hookEventName:"SessionStart"}}});export{a as sessionPreambleHook};
|
|
@@ -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-7RREARGA.js";import"./chunk-UH5CQF5R.js";import"./chunk-LEFODI2H.js";import"./chunk-3HAQCJRK.js";import"./chunk-WAGXAEB4.js";import"./chunk-R4ZTRVDQ.js";import"./chunk-MHNGR6M7.js";import"./chunk-E6ZBZIIS.js";import"./chunk-WBKSJU63.js";import"./chunk-7JKCHASU.js";import"./chunk-ZHDR7LXB.js";import"./chunk-C7SV6AR2.js";import"./chunk-HEOMRXZE.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
|
|
4
|
+
import{a as P,b as A,c as I}from"./chunk-BGY5F3IU.js";import{a as T,b as O,e as D,f as H,g as q,h}from"./chunk-DY7ZW6QZ.js";import{a as L,c as N,e as x}from"./chunk-LEFODI2H.js";import"./chunk-3HAQCJRK.js";import{a as v,c as $}from"./chunk-IK3ROREL.js";import"./chunk-OQ6KNYPG.js";import{a as C}from"./chunk-WAGXAEB4.js";import{c as k}from"./chunk-JS3DLVVI.js";import"./chunk-R4ZTRVDQ.js";import"./chunk-FEHVIHVA.js";import{a as c}from"./chunk-MHNGR6M7.js";import{c as w}from"./chunk-KOKEEAEF.js";import{h as j,i as E,l as y}from"./chunk-E6ZBZIIS.js";import"./chunk-WBKSJU63.js";import"./chunk-7JKCHASU.js";import{Ba as g}from"./chunk-ZHDR7LXB.js";import{a as S}from"./chunk-7WZ3VIUU.js";import{f as b}from"./chunk-KH4QH23U.js";import"./chunk-RIASQHPG.js";import{d as m}from"./chunk-C7SV6AR2.js";import"./chunk-HEOMRXZE.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(`
|
|
@@ -45,20 +45,20 @@ Fix the run environment (\`npx ripplo doctor\`) and re-run. ${c("start")}`}var Q
|
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
|
-
`),
|
|
48
|
+
`),Ae=w("Stop",async n=>{let{cwd:e}=n;if(!S(e)||!b(e)||n.stop_hook_active)return;let r=await ne(e),t=P(e),o=A(e,"stop-enforce")===t?Y:await G(e);I(e,"stop-enforce",t);let i=[...r==null?[]:[r],...o.errors];if(i.length!==0)return{decision:"block",reason:i.join(`
|
|
49
49
|
|
|
50
|
-
`)}}),Y={errors:[]};async function G(n){let e=await
|
|
51
|
-
${
|
|
52
|
-
${c("create")}`]};let r=e.value,t=await Z(n,r),s=await K({cwd:n,lockfile:r}),o=X(r),i=t.runnableSlugs.length>0?await re(n):null;return{errors:[s,o,i?.error??null,t.error].filter(d=>d!=null)}}async function K({cwd:n,lockfile:e}){let r=
|
|
53
|
-
${
|
|
50
|
+
`)}}),Y={errors:[]};async function G(n){let e=await j(n);if(e.isErr())return{errors:[`--- Compilation failed ---
|
|
51
|
+
${C(e.error)}
|
|
52
|
+
${c("create")}`]};let r=e.value,t=await Z(n,r),s=await K({cwd:n,lockfile:r}),o=X(r),i=t.runnableSlugs.length>0?await re(n):null;return{errors:[s,o,i?.error??null,t.error].filter(d=>d!=null)}}async function K({cwd:n,lockfile:e}){let r=v({cwd:n,lockfile:e});return await E(n,e),r.length===0?null:`--- Ripplo model analysis ---
|
|
53
|
+
${$(r)}
|
|
54
54
|
${c("create")}`}function X(n){let e=y(n);return e.length===0?null:`--- Unimplemented stubs ---
|
|
55
55
|
${e.join(", ")}
|
|
56
|
-
Implement
|
|
56
|
+
Implement each critical journey with \`workflow("Intent", () => ({ given, steps }))\`. Add any state schema and source setup the journey needs.
|
|
57
57
|
${c("create")}`}async function Z(n,e){let r=new Set(y(e).map(a=>g(a))),t=new Set(e.workflows.map(a=>g(a.name))),s=(a,p)=>t.has(a)?r.has(a):ee(p),o=k(n).unwrapOr(void 0);if(o==null)return{error:`--- Testing Scope (not checked) ---
|
|
58
58
|
No project config \u2014 \`npx ripplo init\` hasn't run here, so scope/stub done-checks are not enforcing. ${c("setup")}`,runnableSlugs:[]};let i=await m({config:o,document:Q,variables:{cwd:o.cwd,projectId:o.projectId}}).catch(()=>null);if(i==null)return{error:`--- Testing Scope (not checked) ---
|
|
59
59
|
Ripplo server unreachable \u2014 scope/stub done-checks are not enforcing. Verify the dev session is live (\`npx ripplo doctor\`, ${c("start")}) before declaring work done.`,runnableSlugs:[]};let l=i.project?.devSession?.scopeItems??[],d=l.flatMap(a=>{let p=a.workflow;return p==null?[` [intent] ${a.label??"(no label)"} \u2014 write a test for this flow`]:s(p.slug,p.spec)?[` [stub] ${p.slug} \u2014 implement \`${p.name}\``]:[]}),u=l.flatMap(a=>a.workflow!=null&&!s(a.workflow.slug,a.workflow.spec)?[a.workflow.slug]:[]);return{error:d.length===0?null:`--- Testing Scope ---
|
|
60
60
|
${d.join(`
|
|
61
61
|
`)}
|
|
62
|
-
${c("create")}`,runnableSlugs:u}}function ee(n){return typeof n=="object"&&n!=null&&Reflect.get(n,"stub")===!0}async function ne(n){let e=k(n).unwrapOr(void 0);if(e==null)return null;let r=await m({config:e,document:z,variables:{cwd:e.cwd,projectId:e.projectId}}).catch(()=>null);if(r==null)return null;let s=(r.project?.devSession?.tasks??[]).map(o=>{let i=o.title??o.messages?.[0]?.body??"(no description)";return` [${o.kind}] (${o.id}) ${i}`});return s.length===0?null:B(s)}async function re(n){let e=U.argv[1];if(e==null)return{error:f("CLI entry missing (process.argv[1])"),infra:!1};let r=await
|
|
62
|
+
${c("create")}`,runnableSlugs:u}}function ee(n){return typeof n=="object"&&n!=null&&Reflect.get(n,"stub")===!0}async function ne(n){let e=k(n).unwrapOr(void 0);if(e==null)return null;let r=await m({config:e,document:z,variables:{cwd:e.cwd,projectId:e.projectId}}).catch(()=>null);if(r==null)return null;let s=(r.project?.devSession?.tasks??[]).map(o=>{let i=o.title??o.messages?.[0]?.body??"(no description)";return` [${o.kind}] (${o.id}) ${i}`});return s.length===0?null:B(s)}async function re(n){let e=U.argv[1];if(e==null)return{error:f("CLI entry missing (process.argv[1])"),infra:!1};let r=await T(n);if(r!=null){let o=H(r);return O(r.serverUrl)?{error:f(o),infra:!1}:{error:R({lines:[o],retried:!1}),infra:!0}}let t=await L({cliEntry:e,cwd:n});if(t.isErr())return{error:f(h(t.error)),infra:!1};let s=t.value;try{return await te({connection:s,cwd:n})}finally{s.spawned&&await x(s),s.socket.destroy()}}async function te({connection:n,cwd:e}){let r=await V({connection:n,cwd:e,tests:[]});if(r.kind==="transport")return{error:f(r.message),infra:!1};let t=r.notRun.length>0?await V({connection:n,cwd:e,tests:r.notRun.map(d=>d.id)}):null,s=t==null||t.kind==="transport"?r.notRun:t.notRun,o=t!=null&&t.kind==="done",i=[...r.failedLines,...o?t.failedLines:[]],l=[...r.rejected,...o?t.rejected:[]];return oe({failedLines:i,notRun:s,rejected:l,retried:t!=null})}function oe({failedLines:n,notRun:e,rejected:r,retried:t}){if(n.length===0&&e.length===0&&r.length===0)return{error:null,infra:!1};let s=n.length>0?F(n):null,o=r.length>0?M(r):null,i=e.length>0?R({lines:e.map(l=>l.line),retried:t}):null;return{error:[s,o,i].filter(l=>l!=null).join(`
|
|
63
63
|
|
|
64
|
-
`),infra:s==null}}async function V({connection:n,cwd:e,tests:r}){let t=[],s=[],o=[],i=J.join(e,".ripplo","debug"),l=new _;return(await
|
|
64
|
+
`),infra:s==null}}async function V({connection:n,cwd:e,tests:r}){let t=[],s=[],o=[],i=J.join(e,".ripplo","debug"),l=new _;return(await N({connection:n,request:{all:!1,headed:!1,tests:[...r]},token:l.token,onEvent:u=>{se({debugDir:i,event:u,failedLines:t,notRun:s,rejected:o})}})).match(u=>u.kind==="daemon-error"?{kind:"transport",message:q(u.error)}:{failedLines:t,kind:"done",notRun:s,rejected:o},u=>({kind:"transport",message:h(u)}))}function se({debugDir:n,event:e,failedLines:r,notRun:t,rejected:s}){if(e.kind!=="test-outcome"||e.outcome.kind==="pass")return;let o=D({debugDir:n,event:e})??e.testName;if(e.outcome.kind==="dispatch-error"){s.push(o);return}if(e.outcome.kind==="dispatch-timeout"||e.outcome.kind==="infra-error"){t.push({id:`${e.workflowName}/${e.testName}`,line:o});return}r.push(o)}export{Ae as stopEnforceHook};
|
|
@@ -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-XAMVRZJH.js";import"./chunk-BGY5F3IU.js";import"./chunk-47LLHHJH.js";import"./chunk-OQ6KNYPG.js";import"./chunk-JS3DLVVI.js";import"./chunk-FEHVIHVA.js";import"./chunk-MHNGR6M7.js";import"./chunk-7WZ3VIUU.js";import"./chunk-KH4QH23U.js";import"./chunk-RIASQHPG.js";import"./chunk-C7SV6AR2.js";import"./chunk-HEOMRXZE.js";import"./chunk-NNH3YVVO.js";import"./chunk-KMZ3L5YA.js";export{a as tasksReminder};
|
|
@@ -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-CI6273ZU.js";import{a as c}from"./chunk-G6J2WIHJ.js";import{c as i}from"./chunk-KOKEEAEF.js";import{a as n}from"./chunk-7WZ3VIUU.js";import"./chunk-KMZ3L5YA.js";import*as e from"zod/mini";var m=e.looseObject({skill:e.string()}),u=i("PostToolUse",o=>{if(o.tool_name!=="Skill")return;let r=m.safeParse(o.tool_input);if(!r.success)return;let t=/^ripplo:(.+)$/.exec(r.data.skill);if(t==null)return;let l=t[1];if(l==null||!n(o.cwd))return;c(o.cwd,o.session_id,l);let s=a(o.cwd,o.session_id);if(s!=null)return{hookSpecificOutput:{additionalContext:s,hookEventName:"PostToolUse"}}});export{u as trackSkillLoadHook};
|
|
@@ -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-AXROBTLA.js";import"./chunk-CI6273ZU.js";import"./chunk-G6J2WIHJ.js";import"./chunk-7WZ3VIUU.js";import"./chunk-KMZ3L5YA.js";export{a as trackSkillPrompt};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ripplo",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "CLI for Ripplo — AI-powered end-to-end testing",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"homepage": "https://ripplo.ai",
|
|
@@ -19,13 +19,12 @@
|
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@anthropic-ai/claude-agent-sdk": "^0.2.119",
|
|
22
|
-
"@eslint-community/regexpp": "^4.12.2",
|
|
23
22
|
"@inquirer/prompts": "^7.5.3",
|
|
24
23
|
"@paralleldrive/cuid2": "^3.3.0",
|
|
25
24
|
"better-auth": "^1.5.6",
|
|
26
25
|
"better-sqlite3": "^12.11.1",
|
|
27
26
|
"dotenv": "^17.3.1",
|
|
28
|
-
"esbuild": "^0.
|
|
27
|
+
"esbuild": "^0.27.0",
|
|
29
28
|
"fuse.js": "^7.4.2",
|
|
30
29
|
"gql.tada": "^1.9.0",
|
|
31
30
|
"graphql": "^16.11.0",
|
|
@@ -49,7 +48,6 @@
|
|
|
49
48
|
"vscode-jsonrpc": "^9.0.0",
|
|
50
49
|
"ws": "^8.20.0",
|
|
51
50
|
"yargs": "^18.0.0",
|
|
52
|
-
"z3-solver": "^4.13.4",
|
|
53
51
|
"zod": "4.3.6"
|
|
54
52
|
},
|
|
55
53
|
"devDependencies": {
|
|
@@ -67,8 +65,8 @@
|
|
|
67
65
|
"fast-check": "^4.3.0",
|
|
68
66
|
"tsup": "^8.5.1",
|
|
69
67
|
"vitest": "^4.1.4",
|
|
70
|
-
"@ripplo/eslint-config": "0.0.0",
|
|
71
68
|
"@ripplo/core": "^0.0.0",
|
|
69
|
+
"@ripplo/eslint-config": "0.0.0",
|
|
72
70
|
"@ripplo/graphql": "^0.0.0",
|
|
73
71
|
"@ripplo/rrweb-bundle": "0.0.0",
|
|
74
72
|
"@ripplo/run-report": "0.0.0",
|
|
@@ -83,7 +81,6 @@
|
|
|
83
81
|
"lint": "eslint src",
|
|
84
82
|
"gql:check": "gql-tada check",
|
|
85
83
|
"gql:generate": "gql-tada generate output",
|
|
86
|
-
"pack": "tsup && pnpm pack",
|
|
87
84
|
"test": "vitest run"
|
|
88
85
|
}
|
|
89
86
|
}
|
package/dist/chunk-22JUAYHM.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 l}from"./chunk-IPSXNIXC.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 h=2e3;function D(t){if(t!=null)try{return m(u(t)).mtimeMs}catch{return}}function W(t){return y("pnpm",["turbo","run","build","--filter=ripplo..."],{cwd:t,stdio:"inherit"}).status===0}function T(){let t=process.argv[1];if(t==null)return{kind:"fresh"};let n=u(t),r=n.includes(`${i.sep}src${i.sep}`),o=c(i.dirname(n));if(o!=null)return r?{kind:"fresh"}:k(o);let a=c(process.cwd());return a!=null&&j(a)?{kind:"foreign-binary",workspaceRoot:a}:{kind:"fresh"}}function c(t){let n=i.dirname(t);return s(i.join(t,"pnpm-workspace.yaml"))?t:n===t?void 0:c(n)}function k(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)+h).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{createHash as x}from"crypto";import S from"os";import R from"path";import{createMessageConnection as E,NotificationType as f,RequestType as w,RequestType0 as b,SocketMessageReader as P,SocketMessageWriter as M}from"vscode-jsonrpc/node";import{z as e}from"zod";var q="daemon.log";function H(t){let n=x("sha256").update(t).digest("hex").slice(0,16);return R.join(S.tmpdir(),`ripplo-${n}.sock`)}function V(t){return l(t,q)}function Q(t){return E(new P(t),new M(t))}var Y=e.object({all:e.boolean(),headed:e.boolean(),tests:e.array(e.string())}),Z=e.object({jobId:e.string(),total:e.number()}),I=e.enum(["no-lockfile","unstamped","expander-newer","dsl-drift","load-failed"]),v=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:I})]),C=e.object({attempts:e.number(),findings:e.number()}),ee=e.object({active:e.number(),bundleMtimeMs:e.number().optional(),explorer:v,exploring:e.number(),progress:C,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","CLOUD_EXECUTOR","REVIEW_QUOTA","MEMBER_CEILING"]),A=e.discriminatedUnion("type",[e.object({code:z,type:e.literal("limit")}),e.object({detail:e.string(),type:e.literal("generic")})]),N=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:A}),e.object({detail:e.string(),kind:e.literal("dispatch-timeout")}),e.object({detail:e.string(),kind:e.literal("infra-error")})]),O=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:N,runId:e.string(),testName:e.string(),workflowName:e.string()})]),te=e.object({event:O,jobId:e.string()}),ne=e.object({failed:e.number(),jobId:e.string(),notRun:e.number(),passed:e.number()}),oe=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")})]),re=new w("ripplo/enqueue"),ie=new b("ripplo/status"),se=new b("ripplo/shutdownIfIdle"),ae=new f("ripplo/jobEvent"),ce=new f("ripplo/jobDone");export{D as a,W as b,T as c,H as d,V as e,Q as f,Y as g,Z as h,ee as i,N as j,te as k,ne as l,oe as m,re as n,ie as o,se as p,ae as q,ce as r};
|
package/dist/chunk-7IIRERCW.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{a as n}from"./chunk-MHNGR6M7.js";import{h as o,i as a,k as i}from"./chunk-AWPZTNYU.js";function c(e){return[`Compilation failed: ${s(e)}`,n("create","DSL authoring rules")].join(`
|
|
5
|
-
`)}function m(){return`${i} is up to date`}function g(e){return[`${i} is ${e==="missing"?"missing":"out of date"} \u2014 run \`npx ripplo compile\` and commit it`,n("setup")].join(`
|
|
6
|
-
`)}function x(){return`Wrote ${i}`}function s(e){switch(e.kind){case"typecheck-failed":return["TypeScript errors in .ripplo/:",...l(e.diagnostics)].join(`
|
|
7
|
-
`);case"not-ripplo":return`${e.entryPath} must default-export createRipplo({ entities, singletons, workflows }).`;case"invalid-lockfile":return["Lockfile failed schema validation (stale or hand-edited .ripplo/ripplo.lock):",...l(e.issues),"Regenerate with `npx ripplo compile`."].join(`
|
|
8
|
-
`);case"load-threw":return`.ripplo/index.ts threw while loading: ${e.message}`;case"fixture-failed":return u(e.error);case"expand-failed":return`Could not resolve tests for workflow "${e.workflow}": ${e.message}`}}function l(e,t=8){return e.length<=t?e:[...e.slice(0,t),`\u2026 and ${String(e.length-t)} more`]}function u(e){switch(e.kind){case"fixture-missing":return`Fixture "${e.name}" not found at ${e.path}.`;case"fixture-invalid-name":return`Invalid fixture name "${e.name}" \u2014 bare name under .ripplo/fixtures/, no .. or absolute paths.`;case"fixture-symlink":return`Fixture "${e.name}" is a symlink \u2014 only regular files allowed.`;case"fixture-not-file":return`Fixture "${e.name}" is not a regular file.`;case"fixture-too-large":return`Fixture "${e.name}" is ${r(e.size)} \u2014 over the ${r(o)} per-file limit.`;case"fixtures-total-too-large":return`Fixtures total ${r(e.total)} \u2014 over the ${r(a)} limit.`}}function r(e){return`${String(Math.round(e/(1024*1024)*10)/10)} MB`}export{c as a,m as b,g as c,x as d};
|
package/dist/chunk-7VGCLQGP.js
DELETED
|
@@ -1,7 +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 r}from"./chunk-OQ6KNYPG.js";import{a as s}from"./chunk-MHNGR6M7.js";import{a as k,b as C,c as F,d as b}from"./chunk-NY6EIQR4.js";import{A as v,E as $,c as u,g as o,q as c,s as f,u as m,v as p,w as g,x as y,y as h,z as S}from"./chunk-CTTC4KKQ.js";import{J as d,Q as l}from"./chunk-IKYR3UCU.js";async function P({cwd:e,lockfile:n}){let i=c(n),a=b(d(l,n));if(C({context:i,cwd:e})===a)return[];k({context:i,cwd:e});let t=await x(n);return F({cleanLockfileHash:t.length===0?a:null,context:i,cwd:e}),t}async function x(e){let n=u(e),i=await f(e),a=await m({context:c(e),facts:i.facts});return[...g(e).map(t=>({kind:"missing-precondition",missing:t})),...p(n,i.dataRules).map(t=>({gap:t,kind:"cascade-gap"})),...a.map(t=>({conflict:t,kind:"fact-conflict"})),...y(e).map(t=>({kind:"unreachable-interaction",violation:t})),...h(e).map(t=>({kind:"redundant-assertion",redundancy:t})),...S(e).map(t=>({kind:"unmodeled-surface",surface:t})),...v(e).map(t=>({content:t,kind:"unpinned-surface-content"}))]}function U(e){return`${o.good("ok")} \u2014 no static model violations (${r(e,"test")})`}function O(e){let i=e.some(a=>a.kind==="unmodeled-surface")?[`Elements that hide together are one surface. ${s("create","surfaces")}`]:[];return[`${o.bad("fail")} \u2014 ${r(e.length,"static model violation")}:`,...e.map(a=>$(a)),...i].join(`
|
|
5
|
-
|
|
6
|
-
`)}function E(e){return[`${o.warn("warn")} \u2014 ${r(e.length,"model coverage gap")} (not blocking):`,...e.map(n=>` ${A(n)}`),`Stub the missing flows. ${s("discover")}`].join(`
|
|
7
|
-
`)}function A(e){switch(e.kind){case"entity-never-given":return`${e.entity} \u2014 declared but no test seeds it`;case"entity-never-mutated":return`${e.entity} \u2014 seeded but never asserted created/updated/deleted`;case"unmatchable-delete-key":return`test ${e.workflow}/${e.testSlug} asserts ${e.entity} deleted with literal ${e.field} but no seeded ${e.entity} sets ${e.field} \u2014 solver treats it as no-match`}}export{P as a,U as b,O as c,E as d};
|
package/dist/chunk-7YQOAAKF.js
DELETED
|
@@ -1,224 +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-22JUAYHM.js";import{c as Qe,e as Je,f as ze}from"./chunk-OQ4TDIP3.js";import{c as O}from"./chunk-7W237JFM.js";import{d as Ue}from"./chunk-TPHOSZAK.js";import{a as $}from"./chunk-R4ZTRVDQ.js";import{d as me}from"./chunk-FEHVIHVA.js";import{b as xe}from"./chunk-2GFHB4LD.js";import{a as ve}from"./chunk-7IIRERCW.js";import{g as Fe}from"./chunk-NY6EIQR4.js";import{g as Re,l as ke,m as Se,n as we}from"./chunk-AWPZTNYU.js";import{c as D}from"./chunk-R3DZ6JPY.js";import{a as ge,d as u,f,g as I}from"./chunk-IPSXNIXC.js";import{D as Ae,G as Me,S as $e,T as je,W as Oe,X as De,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-CTTC4KKQ.js";import{V as M,W as h,i as A,k as G,p as he}from"./chunk-IKYR3UCU.js";import Wn from"p-queue";var Bn=4,Kn={"p0-ui":3,"p1-cli":2,"p2-cover":1,"p3-explore":0},F=new Wn({concurrency:Bn}),k={headedActive:0,interactiveActive:0,interactiveQueued:0},Ge={current:null};function ro({headed:e,task:n,workClass:r}){let t=Kn[r];return r==="p3-explore"?F.add(n,{priority:t}):(k.interactiveQueued+=1,U(),F.add(()=>Vn({headed:e,task:n}),{priority:t}))}function to(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 oo(e){Ge.current=e}async function Vn({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 Qn}from"gql.tada";async function Ze(e,n){let t=(await u({config:e,document:Jn,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 Jn=Qn(`
|
|
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 rn({all:e,ids:n,lockfile:r}){if(e&&n.length>0)return X({kind:"conflicting-flags"});if(e)return en(r.workflows.filter(i=>!i.stub).flatMap(i=>i.tests.map(s=>R(s))));if(n.length===0)return X({kind:"nothing-selected"});let t=n.map(i=>({id:i,refs:Gn(r,i)})),o=t.filter(i=>i.refs.length===0).map(i=>i.id);return o.length>0?X({kind:"unknown-ids",known:zn(r),unknown:o}):en([...new Set(t.flatMap(i=>i.refs))])}function tn(e,n){let r=new Map(T(e).map(t=>[t.ref,{testName:t.test.name,testSlug:t.test.slug,workflowName:t.workflow.name,workflowSlug:h(t.workflow.name)}]));return n.map(t=>{let o=r.get(t);if(o==null)throw new Error(`selectionsFor: ref not in lockfile: ${t}`);return o})}function zn(e){return e.workflows.map(n=>h(n.name))}function Gn(e,n){let r=e.workflows.find(t=>t.name===n||h(t.name)===h(n));return r!=null?r.tests.map(t=>R(t)):T(e).filter(t=>t.ref===n||nn(t.ref)===nn(n)).map(t=>t.ref)}function nn(e){let n=e.lastIndexOf("/");return n===-1?h(e):`${h(e.slice(0,n))}/${h(e.slice(n+1))}`}import{err as Z,ok as on}from"neverthrow";import{graphql as Yn}from"gql.tada";async function an({config:e,cwd:n,lockfile:r}){await ze({cwd:n,editedPath:void 0,lockfile:r,requireHooks:!1,syncFirst:!1});let t=await Zn(e);if(t.isErr())return Z(t.error);let o=new Map(r.workflows.filter(s=>!s.stub).map(s=>[h(s.name),s])),i=[...new Set(t.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=Yn(`
|
|
22
|
-
query ScopeSelection($projectId: String!, $cwd: String!) {
|
|
23
|
-
project(id: $projectId) {
|
|
24
|
-
id
|
|
25
|
-
devSession(cwd: $cwd) {
|
|
26
|
-
id
|
|
27
|
-
scopeItems {
|
|
28
|
-
id
|
|
29
|
-
workflow {
|
|
30
|
-
id
|
|
31
|
-
slug
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
`);async function Zn(e){try{let r=(await u({config:e,document:Xn,variables:{cwd:e.cwd,projectId:e.projectId}})).project?.devSession?.scopeItems??[];return on(r.flatMap(t=>t.workflow==null?[]:[t.workflow.slug]))}catch(n){return Z({detail:n instanceof Error?n.message:String(n),kind:"scope-fetch-failed"})}}var ee=new Set,sn=new Map;function Co(e){ee.add(e)}function er(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 ln({config:e,cwd:n,message:r}){return(await ke(n)).match(o=>nr({config:e,cwd:n,lockfile:o,message:r}),o=>Promise.resolve({error:{code:"compile-failed",detail:o.kind,diagnostics:[...er(o)]},kind:"error"}))}async function nr({config:e,cwd:n,lockfile:r,message:t}){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 tr({config:e,cwd:n,lockfile:r});if(l!=null)return{error:{code:"sync-failed",detail:l},kind:"error"};ee.add(s)}return(await or({config:e,cwd:n,lockfile:r,message:t})).match(async l=>({kind:"ready",lockfileHashValue:s,selections:tn(r,l),targetsByClaimKey:await rr({config:e,cwd:n,hash:s})}),l=>Promise.resolve({error:l,kind:"error"}))}async function rr({config:e,cwd:n,hash:r}){let t=sn.get(r);if(t!=null)return t;let o=await Ze(e,n);return sn.set(r,o),o}async function tr(e){try{return await Qe(e),null}catch(n){return n instanceof Error?n.message:String(n)}}async function or({config:e,cwd:n,lockfile:r,message:t}){return!t.all&&t.tests.length===0?(await an({config:e,cwd:n,lockfile:r})).mapErr(ir):rn({all:t.all,ids:t.tests,lockfile:r}).mapErr(ar)}function ir(e){return e.kind==="scope-empty"?{code:"selection-nothing-selected"}:{code:"scope-failed",detail:e.detail}}function ar(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 hr}from"crypto";import{createId as Rr}from"@paralleldrive/cuid2";import{CancellationTokenSource as Sn,ResponseError as kr}from"vscode-jsonrpc/node";import{graphql as sr}from"gql.tada";var lr=sr(`
|
|
38
|
-
mutation DaemonCreateRun(
|
|
39
|
-
$id: String
|
|
40
|
-
$workflowId: String!
|
|
41
|
-
$testId: String
|
|
42
|
-
$clientVersion: String
|
|
43
|
-
$executor: RunExecutor
|
|
44
|
-
$target: RunTarget
|
|
45
|
-
$lockfileHash: String
|
|
46
|
-
) {
|
|
47
|
-
createRun(
|
|
48
|
-
id: $id
|
|
49
|
-
workflowId: $workflowId
|
|
50
|
-
testId: $testId
|
|
51
|
-
executor: $executor
|
|
52
|
-
target: $target
|
|
53
|
-
clientVersion: $clientVersion
|
|
54
|
-
lockfileHash: $lockfileHash
|
|
55
|
-
) {
|
|
56
|
-
__typename
|
|
57
|
-
... on MutationCreateRunSuccess {
|
|
58
|
-
data {
|
|
59
|
-
id
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
... on LimitExceededError {
|
|
63
|
-
code
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
`);async function dn(e){try{let r=(await u({config:e.config,document:lr,variables:dr(e)})).createRun;return r==null?N({detail:"create-run-null",type:"generic"}):r.__typename==="MutationCreateRunSuccess"?null:r.__typename==="LimitExceededError"?N({code:r.code,type:"limit"}):N({detail:r.__typename,type:"generic"})}catch(n){return cr(n)}}function dr({executor:e,lockfileHash:n,runId:r,target:t}){return{clientVersion:$(),executor:e,id:r,lockfileHash:n,target:e==="cloud"?"tunnel":void 0,testId:t.testId,workflowId:t.workflowId}}function N(e){return{kind:"dispatch-error",reason:e}}function cr(e){return e instanceof ge?{detail:e.message,kind:"infra-error"}:N({detail:e instanceof Error?e.message:String(e),type:"generic"})}function cn(){return new Map}function q(e){return`${e.workflowSlug}/${e.testSlug}`}function ur(e){return`${q(e)}@${e.lockfileHash}@${String(e.headed)}`}function un(e,n){let r=ur(n.identity),t=e.get(r);if(t!=null){let i={...t,jobIds:new Set([...t.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:r,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 re(e,n){let r=[...e.values()].find(o=>o.runId===n&&!o.claimed);if(r==null)return{entry:null,state:e};let t={...r,claimed:!0};return{entry:t,state:ne(e,t)}}function pn(e,n){return new Map([...e].filter(([r])=>r!==n))}function fn(e,n){let r=[...e.values()].filter(a=>a.jobIds.has(n)),t=r.filter(a=>a.jobIds.size===1),o=r.filter(a=>a.jobIds.size>1).map(a=>({...a,jobIds:new Set([...a.jobIds].filter(l=>l!==n))})),i=new Set(t.map(a=>a.inflightKey)),s=new Map([...e].filter(([a])=>!i.has(a)).map(([a,l])=>{let d=o.find(p=>p.inflightKey===a);return[a,d??l]}));return{cancelled:t,state:s}}function yn(e,n){let r=[...e.values()].filter(o=>!o.claimed&&o.deadlineAt<=n),t=new Set(r.map(o=>o.inflightKey));return{expired:r,state:new Map([...e].filter(([o])=>!t.has(o)))}}import{graphql as pr}from"gql.tada";var fr=2e3,yr=pr(`
|
|
68
|
-
query DaemonCloudRunStatus($runId: String!) {
|
|
69
|
-
run(id: $runId) {
|
|
70
|
-
status
|
|
71
|
-
failureReason
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
`);function mn({config:e,onComplete:n,onStarted:r,runId:t,signal:o}){let i=!1,s,a=!1,l=async()=>{if(i||o.aborted)return;let d=await gr(e,t).catch(()=>"unknown");if(!(i||o.aborted)){if(!a&&(d==="running"||gn(d))&&(a=!0,r()),gn(d)){i=!0,n(mr(d));return}s=setTimeout(()=>{l()},fr)}};return l(),{stop:()=>{i=!0,s!=null&&clearTimeout(s)}}}async function gr(e,n){return(await u({config:e,document:yr,variables:{runId:n}})).run?.status??"unknown"}function gn(e){return e==="passed"||e==="failed"||e==="cancelled"||e==="unready"}function mr(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 Sr=Ne(process.argv[1]),hn=12e4,wr=-32099;function vr(e){let n=new AbortController;return e.isCancellationRequested?(n.abort(),n.signal):(e.onCancellationRequested(()=>{n.abort()}),n.signal)}function Go(e){let n={...e,cancellations:new Map,cell:{inflight:cn()},jobs:new Map,timers:new Map};return{claim:r=>Cr(n,r),handleConnection:r=>{xr(n,r)},idle:()=>wn(n)}}function xr(e,n){let r=qe(n);r.onRequest(_e,(t,o)=>Er({connection:r,ctx:e,params:t,token:o})),r.onRequest(We,()=>{let t=Y();return{active:t.active,bundleMtimeMs:Sr,queued:t.queued,sseHealth:e.sseHealth(),version:$(),...e.explorationStatus()}}),r.onRequest(Be,()=>{let t=wn(e);return t&&e.onShutdownRequest(),t}),r.onClose(()=>{Tr(e,r)}),r.onError(t=>{f.warn({err:t},"ipc connection error")}),n.on("error",t=>{f.warn({err:t},"ipc socket error")}),r.listen()}function wn(e){let n=Y();return e.jobs.size===0&&n.active===0&&n.queued===0}async function Er({connection:e,ctx:n,params:r,token:t}){let o=Le.safeParse(r);if(!o.success)throw Rn({code:"bad-message"});await n.ready;let i=await ln({config:n.config,cwd:n.cwd,message:o.data});if(i.kind==="error")throw Rn(i.error);let s=hr(),a=new Sn;return t.onCancellationRequested(()=>{vn(n,s)}),n.jobs.set(s,{cancellation:a,connection:e,failed:0,notRun:0,passed:0,total:i.selections.length}),Pr({ctx:n,headed:o.data.headed,jobId:s,lockfileHashValue:i.lockfileHashValue,selections:i.selections,targetsByClaimKey:i.targetsByClaimKey,token:a.token}).catch(l=>{f.error({err:l},"ipc dispatch failed")}),{jobId:s,total:i.selections.length}}function Rn(e){return new kr(wr,e.code,e)}function vn(e,n){let r=e.jobs.get(n);if(r==null)return;r.cancellation.cancel(),e.jobs.delete(n);let t=fn(e.cell.inflight,n);e.cell.inflight=t.state,t.cancelled.forEach(o=>{P(e,o.inflightKey,"cancel")})}function P(e,n,r){let t=e.timers.get(n);t!=null&&(clearTimeout(t),e.timers.delete(n)),r==="cancel"&&(e.cancellations.get(n)?.cancel(),e.cancellations.delete(n))}function te(e,n,r){e.cell.inflight=pn(e.cell.inflight,n),P(e,n,r),r==="keep"&&e.cancellations.delete(n)}function br(e){let n=yn(e.cell.inflight,Date.now());e.cell.inflight=n.state,n.expired.forEach(r=>{P(e,r.inflightKey,"cancel"),x(e,r,{kind:"test-outcome",outcome:{detail:"dispatch-timeout",kind:"dispatch-timeout"},runId:"",testName:r.testName,workflowName:r.workflowName})})}function x(e,n,r){n.jobIds.forEach(t=>{xn(e,t,r)})}function xn(e,n,r){let t=e.jobs.get(n);t!=null&&(kn(()=>t.connection.sendNotification(Ke,{event:r,jobId:n})),r.kind==="test-outcome"&&(Ir(t,r.outcome.kind),t.passed+t.failed+t.notRun>=t.total&&(kn(()=>t.connection.sendNotification(Ve,{failed:t.failed,jobId:n,notRun:t.notRun,passed:t.passed})),e.jobs.delete(n))))}function kn(e){Promise.resolve().then(e).catch(n=>{f.warn({err:n},"ipc notification failed")})}function Ir(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 Tr(e,n){[...e.jobs.entries()].filter(([,r])=>r.connection===n).forEach(([r])=>{vn(e,r)})}function Cr(e,n){let r=re(e.cell.inflight,n);e.cell.inflight=r.state;let t=r.entry;if(t==null)return null;P(e,t.inflightKey,"keep");let o=e.cancellations.get(t.inflightKey);return o==null?null:{headed:t.headed,token:o.token,finished:(i,s)=>{let a=C(e,t);te(e,t.inflightKey,"keep"),x(e,a,{kind:"test-outcome",outcome:s,runId:t.runId,testName:t.testName,workflowName:t.workflowName})},started:()=>{x(e,C(e,t),{kind:"test-started",runId:t.runId,testName:t.testName,workflowName:t.workflowName})}}}async function Pr(e){await e.selections.reduce((n,r)=>n.then(()=>Ar(e,r)),Promise.resolve())}async function Ar(e,n){let{ctx:r,headed:t,jobId:o,lockfileHashValue:i,targetsByClaimKey:s,token:a}=e;if(a.isCancellationRequested)return;let l=q(n),d=s.get(l);if(d==null){xn(r,o,{kind:"test-outcome",outcome:{kind:"dispatch-error",reason:{detail:"test-not-found",type:"generic"}},runId:"",testName:n.testName,workflowName:n.workflowName});return}let p=un(r.cell.inflight,{deadlineAt:Date.now()+hn,identity:{headed:t,lockfileHash:i,testSlug:n.testSlug,workflowSlug:n.workflowSlug},jobId:o,runId:Rr(),testName:n.testName,workflowName:n.workflowName});if(r.cell.inflight=p.state,p.kind==="joined")return;let c=p.entry;r.cancellations.set(c.inflightKey,new Sn),r.timers.set(c.inflightKey,setTimeout(()=>{br(r)},hn));let y=r.executor(),g=await Mr({ctx:r,entry:c,executor:y,lockfileHashValue:i,target:d});if(g!=null){let w=C(r,c);te(r,c.inflightKey,"cancel"),x(r,w,{kind:"test-outcome",outcome:g,runId:"",testName:n.testName,workflowName:n.workflowName});return}y==="cloud"&&$r(r,c)}function C(e,n){return e.cell.inflight.get(n.inflightKey)??n}function Mr({ctx:e,entry:n,executor:r,lockfileHashValue:t,target:o}){return dn({config:e.config,executor:r,lockfileHash:t,runId:n.runId,target:o})}function $r(e,n){let r=re(e.cell.inflight,n.runId);e.cell.inflight=r.state;let t=r.entry;if(t==null)return;P(e,t.inflightKey,"keep");let o=e.cancellations.get(t.inflightKey);o!=null&&mn({config:e.config,runId:t.runId,signal:vr(o.token),onComplete:i=>{let s=C(e,t);te(e,t.inflightKey,"keep"),x(e,s,{kind:"test-outcome",outcome:i,runId:t.runId,testName:t.testName,workflowName:t.workflowName})},onStarted:()=>{x(e,C(e,t),{kind:"test-started",runId:t.runId,testName:t.testName,workflowName:t.workflowName})}})}import{graphql as E}from"gql.tada";import{gzipSync as Fr}from"zlib";import{appendFileSync as Ur,existsSync as H,readFileSync as In,writeFileSync as bn}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 En(e,n){return{kind:"finding",payload:Or(e),source:"verifier",step:n.step,stepIndex:n.stepIndex,timeNanos:n.timeNanos}}var jr={"no-effect":"noEffect","required-state-unsatisfied":"requiredStateUnsatisfied",unresolvable:"unresolvable"};function Or(e){switch(e.kind){case"unrunnable":return{kind:"unrunnable",reason:jr[e.reason],unmet:e.unmet==null?null:Ce(e.unmet)};case"impossible-action":return{action:Te(e.step.action),kind:"impossibleAction",subject:Dr(e.step.action)};case"lift-visibility":return{declaredIndex:e.declaredIndex,kind:"liftVisibility",subject:G(e.locator),visibleIndex:e.visibleIndex}}}function Dr(e){return e.locator==null?e.url??"":G(e.locator)}function Tn(e){return v(e.event).length>0}function _({config:e,fixturesDir:n,headed:r}){return{baseUrl:e.appUrl,engineUrl:e.engineUrl,fixturesDir:n,generate:A,headed:r,secret:e.webhookSecret}}async function ae(e){let n=W(e);await se({config:e.config,ownerToken:null,records:n,runId:e.runId})}function W({debugDir:e,events:n,recordingOptional:r,runId:t,stepSources:o}){let i=le(n),s=Kr(e,t);if(s==null&&!r)throw new Error("recording-missing");let a=i.map((d,p)=>rt({aliases:[...Jr(n),...zr(i)],generated:Gr(n),generatedSingletons:Yr(n),origin:s==null?Br(i):s.origin,record:d,rrwebEvents:s==null?[]:s.events,sourceTest:o?.[p]??null})),l=i.flatMap(d=>d.event.findings.map(p=>En(p,{step:L(M(d.event.source,d.event.index)),stepIndex:d.event.index,timeNanos:Cn(d)})));return Nr({debugDir:e,events:[...a,...l],runId:t}),i}function Nr({debugDir:e,events:n,runId:r}){if(n.length===0)return;let t=S.join(e,r,"behavior.jsonl");if(!H(t))return;let o=n.map(i=>JSON.stringify(i)).join(`
|
|
75
|
-
`);Ur(t,`${o}
|
|
76
|
-
`)}function Cn(e){return String(BigInt(Math.max(0,Math.round(e.event.endMs)))*1000000n)}async function se({config:e,ownerToken:n,records:r,runId:t}){let o=r.filter(a=>Tn(a)).length,i=r.length-o,s=r.reduce((a,l)=>a+Math.max(0,l.event.endMs-l.event.startMs),0);await u({config:e,document:it,variables:{items:[{duration:s,failCount:o,firstFailedStepTitle:qr(r),ownerToken:n,passCount:i,runId:t,status:o>0?"failed":"passed"}]}})}function qr(e){let n=e.filter(r=>Tn(r)).toSorted((r,t)=>r.event.index-t.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 Pn(e,n){await u({config:e,document:at,variables:{runIds:[n]}})}async function Lr({config:e,debugDir:n,runId:r}){let t=S.join(n,r),o=S.join(t,"behavior.jsonl");if(H(S.join(t,I)))return;if(!H(o)){f.warn({runId:r},"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)),Hr({behaviorPath:o,config:e,runDir:t,runId:r}))),Promise.resolve(!1))}async function Hr({behaviorPath:e,config:n,runDir:r,runId:t}){try{let o=await u({config:n,document:ot,variables:{runId:t}}),i=await fetch(o.debugArtifactUploadUrl,{body:Fr(In(e)),headers:{"content-type":Wr},method:"PUT"});return i.ok?(await Pn(n,t),bn(S.join(r,I),""),!0):(f.warn({runId:t,status:i.status},"behavior upload PUT failed"),!1)}catch(o){return _r(o)?(f.warn({runId:t},"behavior upload refused by server; run unknown \u2014 not retrying"),bn(S.join(r,I),""),!0):(f.warn({error:o,runId:t},"behavior upload failed"),!1)}}function _r(e){if(typeof e!="object"||e==null||!("errors"in e))return!1;let{errors:n}=e;return Array.isArray(n)&&n.some(r=>{if(typeof r!="object"||r==null||!("extensions"in r))return!1;let{extensions:t}=r;return typeof t=="object"&&t!=null&&"code"in t&&t.code==="FORBIDDEN"})}var Wr="application/x-ndjson";function Br(e){return e.reduce((n,r)=>Math.min(n,r.event.startMs),e[0]?.event.startMs??0)}function Kr(e,n){let r=S.join(e,n,"behavior.jsonl");if(!H(r))return null;let t=In(r,"utf8").split(`
|
|
77
|
-
`).filter(i=>i.length>0).map(i=>Vr(i)).flatMap(i=>Qr(i)?[i.event]:[]),o=t[0];return o==null?null:{events:t,origin:o.timestamp}}function Vr(e){return JSON.parse(e)}function Qr(e){return typeof e=="object"&&e!=null&&Reflect.get(e,"kind")==="rrweb"}function Jr(e){return e.flatMap(n=>n.kind==="world"?n.aliases:[])}function zr(e){return e.flatMap(n=>{let r=Xr(n.event.source);return r.flatMap(t=>{let i=r.filter(a=>a.entity===t.entity).indexOf(t),s=n.event.state.rows.filter(a=>a.status==="created"&&a.entity===t.entity).at(i);return s==null?[]:[{alias:t.as,entity:t.entity,key:s.key}]})})}function Gr(e){return new Set(e.flatMap(n=>n.kind==="world"?n.generated.map(r=>An(r)):[]))}function An({entity:e,field:n,key:r}){return`${e} ${r} ${n}`}function Yr(e){return new Set(e.flatMap(n=>n.kind==="world"?n.generatedSingletons:[]))}function Xr(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(r=>oe(r))):[]}var Zr=3,et=0;function nt({endMs:e,rrwebEvents:n,startMs:r}){let t=n.find(o=>o.type===Zr&&o.data?.source===et&&o.timestamp>=r&&o.timestamp<=e);return t==null?r:t.timestamp}function rt({aliases:e,generated:n,generatedSingletons:r,origin:t,record:o,rrwebEvents:i,sourceTest:s}){let{event:a}=o,l=M(a.source,a.index),d=nt({endMs:a.endMs,rrwebEvents:i,startMs:a.startMs});return{duration:Math.max(0,a.endMs-a.startMs),executedBranches:[...a.executedBranches],kind:"step",nodeType:l.kind,pageUrl:a.url,recordingEndMs:Math.max(0,a.endMs-t),recordingStartMs:Math.max(0,d-t),source:"verifier",sourceTest:s,stateRows:a.state.rows.map(p=>tt({aliases:e,generated:n,row:p})),stateSingletons:a.state.singletons.map(p=>({changed:p.changed,generated:r.has(p.name),name:p.name,value:p.value==null?null:String(p.value)})),stepIndex:a.index,timeNanos:Cn(o),title:L(l)}}function tt({aliases:e,generated:n,row:r}){let t=e.find(o=>o.entity===r.entity&&o.key===r.key);return{entity:r.entity,fields:r.fields.map(o=>({changed:o.changed,field:o.field,generated:n.has(An({entity:r.entity,field:o.field,key:r.key})),value:o.value==null?null:String(o.value)})),key:r.key,label:t?.alias??r.key,status:r.status}}var ot=ie(`
|
|
78
|
-
mutation DebugArtifactUploadUrl($runId: String!) {
|
|
79
|
-
debugArtifactUploadUrl(runId: $runId)
|
|
80
|
-
}
|
|
81
|
-
`),it=ie(`
|
|
82
|
-
mutation CompleteRunsBatch($items: [CompleteRunItem!]!) {
|
|
83
|
-
completeRunsBatch(items: $items) {
|
|
84
|
-
id
|
|
85
|
-
status
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
`),at=ie(`
|
|
89
|
-
mutation MarkRunArtifactsUploadedBatch($runIds: [String!]!) {
|
|
90
|
-
markRunArtifactsUploadedBatch(runIds: $runIds)
|
|
91
|
-
}
|
|
92
|
-
`);function st(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:r,debugDir:t,devSessionId:o,events:i,lockfileHash:s,reproJson:a,runId:l,signature:d,spec:p,stepSources:c,summary:y,workflowSlug:g}){await u({config:r,document:pt,variables:{devSessionId:o??null,lockfileHash:s,projectId:r.projectId,reproJson:a,runId:l,spec:p??null,workflowSlug:g??null}}),await ae({config:r,debugDir:t,events:i,recordingOptional:!0,runId:l,stepSources:c}),await u({config:r,document:ft,variables:{baseState:e,category:n,projectId:r.projectId,reproRunId:l,signature:d,summary:y}})}async function B(e,n,r){return(await u({config:e,document:yt,variables:{lockfileHash:r,projectId:e.projectId,signature:n}})).exploreFindingExists}async function lt({attempts:e,config:n,devSessionId:r,findings:t,trail:o}){await u({config:n,document:ct,variables:{attempts:e,devSessionId:r,findings:t,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 dt(e,n){return(await u({config:e,document:ut,variables:{devSessionId:n}}).catch(t=>(f.warn({error:t},"reportExploreUnhealthy failed"),null)))?.reportExploreUnhealthy??!1}var ct=E(`
|
|
93
|
-
mutation RecordExplorationProgress(
|
|
94
|
-
$devSessionId: String!
|
|
95
|
-
$attempts: Int!
|
|
96
|
-
$findings: Int!
|
|
97
|
-
$trail: ExploreTrailInput
|
|
98
|
-
) {
|
|
99
|
-
recordExplorationProgress(
|
|
100
|
-
devSessionId: $devSessionId
|
|
101
|
-
attempts: $attempts
|
|
102
|
-
findings: $findings
|
|
103
|
-
trail: $trail
|
|
104
|
-
)
|
|
105
|
-
}
|
|
106
|
-
`),ut=E(`
|
|
107
|
-
mutation ReportExploreUnhealthy($devSessionId: String!) {
|
|
108
|
-
reportExploreUnhealthy(devSessionId: $devSessionId)
|
|
109
|
-
}
|
|
110
|
-
`),pt=E(`
|
|
111
|
-
mutation CreateExploreRun(
|
|
112
|
-
$projectId: String!
|
|
113
|
-
$runId: String!
|
|
114
|
-
$devSessionId: String
|
|
115
|
-
$lockfileHash: String!
|
|
116
|
-
$spec: String
|
|
117
|
-
$reproJson: String
|
|
118
|
-
$workflowSlug: String
|
|
119
|
-
) {
|
|
120
|
-
createExploreRun(
|
|
121
|
-
projectId: $projectId
|
|
122
|
-
runId: $runId
|
|
123
|
-
devSessionId: $devSessionId
|
|
124
|
-
lockfileHash: $lockfileHash
|
|
125
|
-
spec: $spec
|
|
126
|
-
reproJson: $reproJson
|
|
127
|
-
workflowSlug: $workflowSlug
|
|
128
|
-
) {
|
|
129
|
-
id
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
`),ft=E(`
|
|
133
|
-
mutation SubmitExploreFinding(
|
|
134
|
-
$projectId: String!
|
|
135
|
-
$signature: String!
|
|
136
|
-
$summary: String!
|
|
137
|
-
$baseState: String!
|
|
138
|
-
$category: ExploreFindingCategory!
|
|
139
|
-
$reproRunId: String!
|
|
140
|
-
) {
|
|
141
|
-
submitExploreFinding(
|
|
142
|
-
projectId: $projectId
|
|
143
|
-
signature: $signature
|
|
144
|
-
summary: $summary
|
|
145
|
-
baseState: $baseState
|
|
146
|
-
category: $category
|
|
147
|
-
reproRunId: $reproRunId
|
|
148
|
-
) {
|
|
149
|
-
id
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
`),gi=E(`
|
|
153
|
-
mutation SetExploreFindingStatus(
|
|
154
|
-
$projectId: String!
|
|
155
|
-
$signature: String!
|
|
156
|
-
$status: ExploreFindingStatus!
|
|
157
|
-
) {
|
|
158
|
-
setExploreFindingStatus(projectId: $projectId, signature: $signature, status: $status)
|
|
159
|
-
}
|
|
160
|
-
`),yt=E(`
|
|
161
|
-
query ExploreFindingExists($projectId: String!, $signature: String!, $lockfileHash: String!) {
|
|
162
|
-
exploreFindingExists(projectId: $projectId, signature: $signature, lockfileHash: $lockfileHash)
|
|
163
|
-
}
|
|
164
|
-
`);import ht from"path";import{graphql as Rt}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({config:e,ownerToken:n,reason:r,runId:t}){await u({config:e,document:gt,variables:{ownerToken:n,reason:r,runId:t}}).catch(o=>{f.error(o,"failRun submission failed")})}async function pe({cause:e,config:n,ownerToken:r,runId:t}){await u({config:n,document:mt,variables:{cause:e,ownerToken:r,runId:t}}).catch(o=>{f.error(o,"markRunUnready submission failed")})}var ki=K(`
|
|
165
|
-
mutation ReleaseRun($runId: String!, $ownerToken: String) {
|
|
166
|
-
releaseRun(runId: $runId, ownerToken: $ownerToken)
|
|
167
|
-
}
|
|
168
|
-
`),Si=K(`
|
|
169
|
-
mutation HeartbeatRun($runId: String!) {
|
|
170
|
-
heartbeatRun(runId: $runId)
|
|
171
|
-
}
|
|
172
|
-
`),gt=K(`
|
|
173
|
-
mutation FailRun($runId: String!, $reason: String!, $ownerToken: String) {
|
|
174
|
-
failRun(runId: $runId, reason: $reason, ownerToken: $ownerToken)
|
|
175
|
-
}
|
|
176
|
-
`),mt=K(`
|
|
177
|
-
mutation MarkRunUnready($runId: String!, $cause: RunUnreadyCause!, $ownerToken: String) {
|
|
178
|
-
markRunUnready(runId: $runId, cause: $cause, ownerToken: $ownerToken)
|
|
179
|
-
}
|
|
180
|
-
`);async function kt({config:e,cwd:n,errorSettle:r,fixturesDir:t,headed:o,lockfile:i,onPhase:s,runId:a,session:l,signal:d,test:p}){let c=await wt(e,a);if(c==null)return{outcome:{kind:"dispatch-failed",reason:"already-claimed",runId:a},ownerToken:null,persisted:Promise.resolve()};let y=ht.join(n,".ripplo","debug"),g=[];return(await l.runOnce({capture:!0,lockfile:i,onPhase:s,options:_({config:e,fixturesDir:t,headed:o}),params:void 0,runId:a,sequence:void 0,test:p,onEvent:b=>{g.push(b)}},d)).match(async b=>{let ye=le(g),J=ye.flatMap(_n=>v(_n.event)),z=St(J);if(z!=null)return W({config:e,debugDir:y,events:g,recordingOptional:!0,runId:a,stepSources:void 0}),await Mn({config:e,error:z,errorSettle:r,ownerToken:c,runId:a}),{outcome:{error:z,kind:"error",runId:a},ownerToken:c,persisted:Promise.resolve()};await se({config:e,ownerToken:c,records:ye,runId:a}),W({config:e,debugDir:y,events:g,recordingOptional:!0,runId:a,stepSources:void 0});let Hn=Promise.resolve();return{outcome:J.length>0?{contradictions:J,kind:"findings",runId:a}:{kind:"pass",runId:a},ownerToken:c,persisted:Hn}},async b=>(await Mn({config:e,error:b,errorSettle:r,ownerToken:c,runId:a}),{outcome:{error:b,kind:"error",runId:a},ownerToken:c,persisted:Promise.resolve()}))}async function Mn({config:e,error:n,errorSettle:r,ownerToken:t,runId:o}){if(r==="defer")return;let i=ce(n);if(i!=null){await pe({cause:i,config:e,ownerToken:t,runId:o});return}await ue({config:e,ownerToken:t,reason:j(n),runId:o})}function St(e){let n=e.find(r=>r.kind==="stepError"&&be(r.record.error));return n!=null&&n.kind==="stepError"?n.record.error:void 0}async function wt(e,n){return((await u({config:e,document:vt,variables:{runIds:[n]}})).startRunsBatch??[]).find(o=>o.id===n)?.ownerToken??null}var vt=Rt(`
|
|
181
|
-
mutation StartRunsBatch($runIds: [String!]!) {
|
|
182
|
-
startRunsBatch(runIds: $runIds) {
|
|
183
|
-
id
|
|
184
|
-
ownerToken
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
`);import{randomUUID as xt}from"crypto";async function Et({assign:e,config:n,debugDir:r,devSessionId:t,fixturesDir:o,headed:i,lockfile:s,report:a,session:l,signal:d}){let p=Ee(s);if(e.stepRuns.length===0)return{error:{source:"empty-trail"},kind:"error"};let c=Ot(p,e.stepRuns),y=await Oe({baseState:{name:R(e.baseStateTest),test:e.baseStateTest},corpus:p,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-${xt()}-${String(w)}`},d),g=a?await At({baseStateTest:e.baseStateTest,config:n,debugDir:r,devSessionId:t,lockfileHash:e.lockfileHash,outcome:y,reproJson:Ct(p,e),stepSources:Pt(c)}):!1;return Tt(y,c.length),Dt(y,g,bt(c,e,y))}function bt(e,n,r){if(r.kind==="error"||r.kind==="aborted")return;let t=r.timing.confirm;return{baseLabel:n.baseStateTest.intent,baseState:R(n.baseStateTest),durationMs:Math.round(V(r.timing.detect)+(t==null?0:V(t))),signature:r.kind==="finding"||r.kind==="seen"?r.signature:void 0,steps:It(e.slice(0,r.ranCount))}}function It(e){return e.flatMap(n=>{let r=n.label.split("#")[0]??n.label;return n.actions.map(t=>({test:r,text:t}))})}function V(e){return e.engineMs+e.worldMs+e.browserMs+e.driveMs+e.teardownMs}function Tt(e,n){if(e.kind==="error"){f.info({detail:j(e.error),kind:e.kind,reason:e.error.kind,steps:n},"explore trail");return}if(e.kind==="aborted"||e.kind==="seen"){f.info({kind:e.kind,steps:n},"explore trail");return}let r=e.timing.detect,t=e.timing.confirm;f.info({browserMs:r.browserMs,confirmMs:t==null?void 0:V(t),detectMs:V(r),driveMs:r.driveMs,engineMs:r.engineMs,kind:e.kind,steps:n,teardownMs:r.teardownMs,worldMs:r.worldMs},"explore trail")}function Ct(e,n){let r=n.stepRuns.flatMap(o=>{let i=e[o.idx];return i==null?[]:[{index:i.index,params:o.params,test:i.test}]}),t={baseStateRef:R(n.baseStateTest),steps:r};return JSON.stringify(t)}function Pt(e){return e.flatMap(n=>{let r=n.label.split("#")[0]??n.label;return n.actions.map(()=>r)})}async function At({baseStateTest:e,config:n,debugDir:r,devSessionId:t,lockfileHash:o,outcome:i,reproJson:s,stepSources:a}){return i.kind!=="finding"||i.captureEvents.length===0?!1:await B(n,i.signature,o)?(f.info({devSessionId:t,signature:i.signature},"explore finding already reported, skipping duplicate"),!1):(await de({baseState:i.baseState,category:Mt(i.verifierLayer),config:n,debugDir:r,devSessionId:t,events:i.captureEvents,lockfileHash:o,reproJson:s,runId:i.runId,signature:i.signature,spec:jt(e,i.captureEvents),stepSources:a,summary:$t(i.captureEvents,i.title),workflowSlug:i.sourceTest?.split("/")[0]}).catch(l=>{f.warn({error:l},"explore finding report failed")}),!0)}function Mt(e){return e==="data-rule"?"dataRule":e==="model-drift"?"modelDrift":e}function $t(e,n){let r=e.flatMap(t=>t.kind==="step"?v(t):[]).at(0);if(r!=null)return Ae(r);if(n!=null)return n;throw new Error("explore finding has no findings to summarize")}function jt(e,n){let r=n.flatMap(o=>o.kind==="step"?[o.source]:[]),t={absent:e.absent,actor:e.actor,exclusive:e.exclusive,intent:e.intent,maybe:[],name:e.name,params:e.params,singletons:e.singletons,steps:r,stub:!1,tests:[],viewports:[e.viewport],world:e.world};return JSON.stringify(t)}function Ot(e,n){return n.flatMap(r=>{let t=e[r.idx];return t==null?[]:[{actions:[...t.nav,...t.steps].map(o=>Pe(o.action)),label:`${t.test}#${String(t.index)}`}]})}function Dt(e,n,r){if(e.kind==="aborted")return{kind:"aborted"};if(e.kind==="error")return{error:{category:Ft(e.error.kind),kind:e.error.kind,source:"runtime"},kind:"error"};if(r==null)throw new Error("trail summary missing for completed trail");return e.kind==="finding"?{kind:e.kind,runId:n?e.runId:void 0,trail:r}:{kind:e.kind,trail:r}}function Ft(e){return e==="driver-launch"?"driver":Ie(e)?"infra":"trail"}import Ut from"fs";import Nt from"path";async function Yi(e){let n=Nt.join(e,".ripplo","index.ts");if(!Ut.existsSync(n))return{appUrl:void 0,engineUrl:void 0,errors:[{message:".ripplo/index.ts not found",path:""}],valid:!1,warnings:[]};let r=await we(e);return r.isErr()?{appUrl:void 0,engineUrl:void 0,errors:[{message:ve(r.error),path:".ripplo/"}],valid:!1,warnings:[]}:me().match(t=>({appUrl:t.appUrl,engineUrl:t.engineUrl,errors:[],valid:!0,warnings:[]}),t=>({appUrl:void 0,engineUrl:void 0,errors:[{message:xe(t),path:""}],valid:!1,warnings:[]}))}async function Xi(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 Zi({appUrl:e,engineUrl:n}){let r=n.startsWith("http://")||n.startsWith("https://")?n:`${e}${n}`;try{return(await fetch(`${r}/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 $n,IPCMessageReader as jn,IPCMessageWriter as On,NotificationType as qt,NotificationType0 as Dn,RequestType as Fn,RequestType0 as Lt}from"vscode-jsonrpc/node";import{z as m}from"zod";var ia=m.object({headed:m.boolean(),runId:m.string().min(1),testRef:m.string().min(1)}),aa=m.object({lockfileJson:m.string().optional(),unavailable:m.string().optional()}),sa=m.object({runId:m.string().min(1),span:he}),la=m.object({outcome:He,serverNotified:m.boolean()}),da=new Dn("worker/ready"),ca=new Fn("worker/run"),ua=new Lt("worker/lockfile"),pa=new Fn("worker/exploreTrail"),fa=new qt("worker/span"),ya=new Dn("worker/shutdown");function ga(e){let n=$n(new jn(e),new On(e));return n.listen(),n}function ma(){let e=$n(new jn(process),new On(process));return e.listen(),e}import Ht from"path";import{randomUUID as _t}from"crypto";async function ba({cwd:e,onReady:n,signal:r,step:t,target:o}){let i=O(e).match(c=>({config:c}),c=>({failure:c}));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 Wt(l,o);return d.kind!=="ok"?d:(await $e({lockfile:l,onReady:n,options:Bt(s),runId:`teleport-${_t()}`,sequence:d.sequence,stopAfterStep:t,test:d.test},r)).match(c=>({kind:"done",result:c}),c=>({error:c,kind:"run-failed"}))}async function Wt(e,n){if(n.kind==="explore"){let t=await De(e,n.repro);return t.kind==="unplannable"?{kind:"unplannable"}:{kind:"ok",sequence:t.sequence,test:t.baseTest}}let r=T(e).find(t=>t.ref===n.ref);return r==null?{kind:"no-test",ref:n.ref}:{kind:"ok",sequence:je(e,r.test,void 0),test:r.test}}function Bt(e){return{baseUrl:e.appUrl,engineUrl:e.engineUrl,fixturesDir:Ht.join(e.cwd,Re),generate:A,headed:!0,secret:e.webhookSecret}}var Ca=15e3,Pa=3e4,Aa=2,Ma=12;function $a(e,n){let r=Kt(e,n);if(!e.enabled||!e.executorLocal)return{abortIds:fe(n),health:{kind:"off"},launchCount:0};if(Vt(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:r,health:{kind:"paused"},launchCount:0};let t=Math.min(e.workers,n.poolSize-1),o=n.trails.length-r.length;return{abortIds:r,health:{kind:"on"},launchCount:Math.max(0,t-o)}}function Kt(e,n){let r=Me(e.maxTrailLength);return n.trails.filter(t=>t.ageMs>=r).map(t=>t.id)}function fe(e){return e.trails.map(n=>n.id)}function Vt(e){return e.headedActive||e.interactiveActive>0||e.interactiveQueued>0}import{graphql as Xt}from"gql.tada";import{err as Q,ok as qn}from"neverthrow";import Qt,{AbortError as Jt}from"p-retry";import{graphql as Un}from"gql.tada";var zt=Un(`
|
|
188
|
-
query AwaitDevSession($projectId: String!, $cwd: String!) {
|
|
189
|
-
project(id: $projectId) {
|
|
190
|
-
devSession(cwd: $cwd) {
|
|
191
|
-
id
|
|
192
|
-
executor
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
`);async function Nn(e){return Qt(async()=>{let t=(await u({config:e,document:zt,variables:{cwd:e.cwd,projectId:e.projectId}})).project?.devSession;if(t!=null)return{executor:t.executor,id:t.id,kind:"active"};throw D(e.cwd)?new Error("starting"):new Jt("missing")},{factor:1,maxTimeout:400,minTimeout:400,retries:25}).catch(()=>D(e.cwd)?{kind:"starting"}:{kind:"missing"})}var Gt=Un(`
|
|
197
|
-
query DevSessionCheckHealth($projectId: String!, $cwd: String!) {
|
|
198
|
-
activeDevSessions(projectId: $projectId) {
|
|
199
|
-
id
|
|
200
|
-
cwd
|
|
201
|
-
branch
|
|
202
|
-
}
|
|
203
|
-
project(id: $projectId) {
|
|
204
|
-
id
|
|
205
|
-
devSession(cwd: $cwd) {
|
|
206
|
-
id
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
`);function La(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:",...Yt(e.elsewhere)].join(`
|
|
211
|
-
`)}}}async function Ha(e){let n=D(e),r=Ue(e),t=O(e).unwrapOr(void 0);if(t==null)return{elsewhere:[],gitMidOperation:r,status:n?"starting":"missing",type:"dev-session"};let o=await u({config:t,document:Gt,variables:{cwd:t.cwd,projectId:t.projectId}}).catch(()=>null);return o?.project?.devSession!=null?{elsewhere:[],gitMidOperation:r,status:"active",type:"dev-session"}:{elsewhere:(o?.activeDevSessions??[]).filter(a=>a.cwd!==t.cwd).map(a=>({branch:a.branch,cwd:a.cwd})),gitMidOperation:r,status:n?"starting":"missing",type:"dev-session"}}function Yt(e){return e.map(n=>{let r=n.branch==null?"":` (${n.branch})`;return` - ${n.cwd}${r}`})}var Zt=Xt(`
|
|
212
|
-
mutation SetDevSessionExecutor($devSessionId: String!, $executor: RunExecutor!) {
|
|
213
|
-
setDevSessionExecutor(devSessionId: $devSessionId, executor: $executor) {
|
|
214
|
-
__typename
|
|
215
|
-
... on DevSession {
|
|
216
|
-
id
|
|
217
|
-
executor
|
|
218
|
-
}
|
|
219
|
-
... on DevSessionEndedError {
|
|
220
|
-
message
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
`);async function Qa(e){return(await Ln(e)).map(r=>r.executor)}async function Ja(e,n){let r=await Ln(e);if(r.isErr())return Q(r.error);let o=(await u({config:e,document:Zt,variables:{devSessionId:r.value.id,executor:n}})).setDevSessionExecutor;return o==null?Q({kind:"empty-response"}):o.__typename!=="DevSession"?Q({kind:"session-ended"}):qn(o.executor)}async function Ln(e){let n=await Nn(e);return n.kind==="active"?qn({executor:n.executor,id:n.id}):Q({kind:n.kind==="starting"?"starting":"no-session"})}export{Nn as a,La as b,Ha as c,Yi as d,Xi as e,Zi as f,ia as g,sa as h,la as i,da as j,ca as k,ua as l,pa as m,fa as n,ya as o,ga as p,ma as q,ro as r,to as s,Y as t,oo as u,Co as v,vr as w,Go as x,ae as y,Lr as z,ue as A,kt as B,st as C,lt as D,dt as E,Et as F,ba as G,Ca as H,Pa as I,Aa as J,Ma as K,$a as L,Qa as M,Ja as N};
|