ripplo 0.8.1 → 0.8.3

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.
Files changed (71) hide show
  1. package/dist/{chunk-NWWET7CM.js → chunk-2MT2MZJW.js} +1 -1
  2. package/dist/{chunk-GD2AESFG.js → chunk-4FKGHWCC.js} +1 -1
  3. package/dist/{chunk-HGL5SE75.js → chunk-4W6WIT7T.js} +1 -1
  4. package/dist/{chunk-OAXYJKXD.js → chunk-5SM4TCSW.js} +2 -2
  5. package/dist/{chunk-TPTG6RR4.js → chunk-7TYUZIUO.js} +1 -1
  6. package/dist/chunk-7Z7RVHEL.js +7 -0
  7. package/dist/{chunk-WK7VO5JE.js → chunk-A7SHHSB3.js} +1 -1
  8. package/dist/{chunk-KSNZWWHX.js → chunk-AQ3DMGAY.js} +1 -1
  9. package/dist/{chunk-7YPITJA2.js → chunk-AVBP7Q2M.js} +1 -1
  10. package/dist/{chunk-WOHPPHUD.js → chunk-DBIXYJRB.js} +1 -1
  11. package/dist/{chunk-FCEWYZLQ.js → chunk-EGETJKAQ.js} +1 -1
  12. package/dist/chunk-EK6TENV6.js +4 -0
  13. package/dist/{chunk-ZH3HY7BS.js → chunk-ESOXRGIY.js} +1 -1
  14. package/dist/chunk-GD63CZVP.js +242 -0
  15. package/dist/{chunk-4AGLYPJ5.js → chunk-I2M24U3N.js} +2 -2
  16. package/dist/{chunk-PBL3TBB7.js → chunk-I5BHCICM.js} +1 -1
  17. package/dist/chunk-KOKEEAEF.js +6 -0
  18. package/dist/{chunk-CLFA4JSB.js → chunk-L7GWKDGD.js} +1 -1
  19. package/dist/{chunk-42LZFMNX.js → chunk-LEFXRK53.js} +1 -1
  20. package/dist/{chunk-VYQ5CDRX.js → chunk-LKYTQXPR.js} +1 -1
  21. package/dist/{chunk-EXV2RD7Z.js → chunk-M7VQD4VO.js} +1 -1
  22. package/dist/{chunk-G22LPS47.js → chunk-N2B5GZPU.js} +1 -1
  23. package/dist/{chunk-FZIMQTFG.js → chunk-OY6HNCAZ.js} +1 -1
  24. package/dist/chunk-PE5WVWI5.js +48 -0
  25. package/dist/{chunk-TEP6ETHQ.js → chunk-PXZV5X3C.js} +1 -1
  26. package/dist/{chunk-U4LC56T3.js → chunk-SWOTFHBR.js} +1 -1
  27. package/dist/{chunk-XGMM2RKR.js → chunk-T5VLZ43M.js} +1 -1
  28. package/dist/{chunk-4DXOF4WS.js → chunk-UVYCSHOJ.js} +1 -1
  29. package/dist/{chunk-VETETUHZ.js → chunk-XBD3OTIW.js} +1 -1
  30. package/dist/{chunk-3SCOYB4C.js → chunk-XWUIRXMS.js} +1 -1
  31. package/dist/{cli-error-J7LD2VWZ.js → cli-error-SLG6JHK2.js} +1 -1
  32. package/dist/compile-write-7AV66JUA.js +4 -0
  33. package/dist/daemon-EGU25OUV.js +139 -0
  34. package/dist/{daemon-JJ6MZPIA.js → daemon-LFFCR3TB.js} +1 -1
  35. package/dist/{daemon-lock-FLZHWM2F.js → daemon-lock-LTQMLU4Q.js} +1 -1
  36. package/dist/{dsl-loader-IOQUYVQH.js → dsl-loader-H25XGSHJ.js} +1 -1
  37. package/dist/{exit-plan-gate-TTJ7U2AP.js → exit-plan-gate-BNAUL4FC.js} +1 -1
  38. package/dist/hook.js +1 -1
  39. package/dist/index.js +210 -211
  40. package/dist/{plan-reminder-Q4A5WM2G.js → plan-reminder-VMBDQTAP.js} +1 -1
  41. package/dist/post-edit-2VFE6QND.js +4 -0
  42. package/dist/post-edit-analyze-VETPP5Z4.js +4 -0
  43. package/dist/post-edit-flag-stubs-J3MCGLXI.js +4 -0
  44. package/dist/{pre-bash-run-gate-C73XUNRE.js → pre-bash-run-gate-PWLARIYK.js} +1 -1
  45. package/dist/pre-edit-Q4U5LSWG.js +4 -0
  46. package/dist/{pre-edit-ripplo-skill-gate-63HGCUPG.js → pre-edit-ripplo-skill-gate-JD4BDCA3.js} +1 -1
  47. package/dist/{pre-edit-scope-gate-WIORRC2B.js → pre-edit-scope-gate-NZO4HVGT.js} +1 -1
  48. package/dist/{pre-edit-watch-gate-3VSMTCE4.js → pre-edit-watch-gate-EUZGEH2J.js} +1 -1
  49. package/dist/prompt-submit-MPRVCWOI.js +4 -0
  50. package/dist/scope-reminder-CBY4I5SG.js +4 -0
  51. package/dist/{session-preamble-HNQKBR27.js → session-preamble-IHBGHKCW.js} +1 -1
  52. package/dist/solve-worker.js +1 -1
  53. package/dist/status-UBUNHH5O.js +4 -0
  54. package/dist/{stop-enforce-I27VU4IR.js → stop-enforce-UXBQRTFP.js} +1 -1
  55. package/dist/{tasks-reminder-A4AIFNQJ.js → tasks-reminder-LKSUZUFD.js} +1 -1
  56. package/dist/{track-skill-load-3IPC45UX.js → track-skill-load-CJ74GD3Q.js} +1 -1
  57. package/package.json +4 -4
  58. package/dist/chunk-G7ZQUZ2X.js +0 -242
  59. package/dist/chunk-HYHAOKYP.js +0 -7
  60. package/dist/chunk-IW2P4NKR.js +0 -4
  61. package/dist/chunk-LB2L72ZU.js +0 -48
  62. package/dist/chunk-S7GMY5LS.js +0 -6
  63. package/dist/compile-write-OKTXD7JL.js +0 -4
  64. package/dist/daemon-O2VR45XP.js +0 -139
  65. package/dist/post-edit-PMSJ6CLE.js +0 -4
  66. package/dist/post-edit-analyze-2AJVDFTK.js +0 -4
  67. package/dist/post-edit-flag-stubs-ORFV452V.js +0 -4
  68. package/dist/pre-edit-H6ZOQSXF.js +0 -4
  69. package/dist/prompt-submit-PSXSUTY3.js +0 -4
  70. package/dist/scope-reminder-TGDQCKLN.js +0 -4
  71. package/dist/status-QBBCVTXV.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-GD2AESFG.js";import"./chunk-7WZ3VIUU.js";import"./chunk-HGL5SE75.js";import"./chunk-WOHPPHUD.js";import"./chunk-LB2L72ZU.js";import"./chunk-CJUKILIO.js";import"./chunk-NNH3YVVO.js";import"./chunk-KMZ3L5YA.js";export{a as planReminder};
4
+ import{a}from"./chunk-4FKGHWCC.js";import"./chunk-7WZ3VIUU.js";import"./chunk-4W6WIT7T.js";import"./chunk-DBIXYJRB.js";import"./chunk-PE5WVWI5.js";import"./chunk-CJUKILIO.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-7TYUZIUO.js";import"./chunk-T5VLZ43M.js";import{a as e}from"./chunk-SWOTFHBR.js";import"./chunk-I5BHCICM.js";import"./chunk-JJ4QQPAV.js";import"./chunk-MOI4L3EX.js";import"./chunk-PXZV5X3C.js";import"./chunk-OQ6KNYPG.js";import"./chunk-UVYCSHOJ.js";import"./chunk-LEFXRK53.js";import"./chunk-7WZ3VIUU.js";import"./chunk-4W6WIT7T.js";import"./chunk-FEHVIHVA.js";import{b as o}from"./chunk-KOKEEAEF.js";import"./chunk-AVBP7Q2M.js";import"./chunk-MHNGR6M7.js";import"./chunk-EK6TENV6.js";import"./chunk-AQ3DMGAY.js";import"./chunk-DBIXYJRB.js";import"./chunk-PE5WVWI5.js";import"./chunk-CJUKILIO.js";import"./chunk-ESOXRGIY.js";import"./chunk-5SM4TCSW.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-7TYUZIUO.js";import"./chunk-T5VLZ43M.js";import"./chunk-MOI4L3EX.js";import"./chunk-PXZV5X3C.js";import"./chunk-OQ6KNYPG.js";import"./chunk-UVYCSHOJ.js";import"./chunk-LEFXRK53.js";import"./chunk-7WZ3VIUU.js";import"./chunk-4W6WIT7T.js";import"./chunk-FEHVIHVA.js";import"./chunk-AVBP7Q2M.js";import"./chunk-MHNGR6M7.js";import"./chunk-EK6TENV6.js";import"./chunk-AQ3DMGAY.js";import"./chunk-DBIXYJRB.js";import"./chunk-PE5WVWI5.js";import"./chunk-CJUKILIO.js";import"./chunk-ESOXRGIY.js";import"./chunk-5SM4TCSW.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-SWOTFHBR.js";import"./chunk-I5BHCICM.js";import"./chunk-JJ4QQPAV.js";import"./chunk-7WZ3VIUU.js";import"./chunk-4W6WIT7T.js";import"./chunk-EK6TENV6.js";import"./chunk-AQ3DMGAY.js";import"./chunk-DBIXYJRB.js";import"./chunk-PE5WVWI5.js";import"./chunk-CJUKILIO.js";import"./chunk-ESOXRGIY.js";import"./chunk-5SM4TCSW.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-HGL5SE75.js";import{c as y}from"./chunk-S7GMY5LS.js";import"./chunk-WOHPPHUD.js";import"./chunk-LB2L72ZU.js";import"./chunk-CJUKILIO.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};
4
+ import{b as h}from"./chunk-OWN4P2K7.js";import{a as c}from"./chunk-7WZ3VIUU.js";import{f}from"./chunk-4W6WIT7T.js";import{c as y}from"./chunk-KOKEEAEF.js";import"./chunk-DBIXYJRB.js";import"./chunk-PE5WVWI5.js";import"./chunk-CJUKILIO.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-N2B5GZPU.js";import{a as t}from"./chunk-L7GWKDGD.js";import{a as i}from"./chunk-XWUIRXMS.js";import"./chunk-JJ4QQPAV.js";import"./chunk-OWN4P2K7.js";import"./chunk-LEFXRK53.js";import"./chunk-7WZ3VIUU.js";import"./chunk-4W6WIT7T.js";import"./chunk-FEHVIHVA.js";import{b as o}from"./chunk-KOKEEAEF.js";import"./chunk-MHNGR6M7.js";import"./chunk-AQ3DMGAY.js";import"./chunk-DBIXYJRB.js";import"./chunk-PE5WVWI5.js";import"./chunk-CJUKILIO.js";import"./chunk-5SM4TCSW.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};
@@ -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-CLFA4JSB.js";import"./chunk-OWN4P2K7.js";import"./chunk-7WZ3VIUU.js";import"./chunk-HGL5SE75.js";import"./chunk-WOHPPHUD.js";import"./chunk-LB2L72ZU.js";import"./chunk-CJUKILIO.js";import"./chunk-NNH3YVVO.js";import"./chunk-KMZ3L5YA.js";export{a as preEditRipploSkillGate};
4
+ import{a}from"./chunk-L7GWKDGD.js";import"./chunk-OWN4P2K7.js";import"./chunk-7WZ3VIUU.js";import"./chunk-4W6WIT7T.js";import"./chunk-DBIXYJRB.js";import"./chunk-PE5WVWI5.js";import"./chunk-CJUKILIO.js";import"./chunk-NNH3YVVO.js";import"./chunk-KMZ3L5YA.js";export{a as preEditRipploSkillGate};
@@ -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-3SCOYB4C.js";import"./chunk-JJ4QQPAV.js";import"./chunk-42LZFMNX.js";import"./chunk-7WZ3VIUU.js";import"./chunk-HGL5SE75.js";import"./chunk-FEHVIHVA.js";import"./chunk-MHNGR6M7.js";import"./chunk-WOHPPHUD.js";import"./chunk-LB2L72ZU.js";import"./chunk-CJUKILIO.js";import"./chunk-NNH3YVVO.js";import"./chunk-KMZ3L5YA.js";export{a as preEditScopeGate};
4
+ import{a}from"./chunk-XWUIRXMS.js";import"./chunk-JJ4QQPAV.js";import"./chunk-LEFXRK53.js";import"./chunk-7WZ3VIUU.js";import"./chunk-4W6WIT7T.js";import"./chunk-FEHVIHVA.js";import"./chunk-MHNGR6M7.js";import"./chunk-DBIXYJRB.js";import"./chunk-PE5WVWI5.js";import"./chunk-CJUKILIO.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-G22LPS47.js";import"./chunk-7WZ3VIUU.js";import"./chunk-HGL5SE75.js";import"./chunk-MHNGR6M7.js";import"./chunk-KSNZWWHX.js";import"./chunk-WOHPPHUD.js";import"./chunk-LB2L72ZU.js";import"./chunk-CJUKILIO.js";import"./chunk-OAXYJKXD.js";import"./chunk-NNH3YVVO.js";import"./chunk-KMZ3L5YA.js";export{a as preEditWatchGate};
4
+ import{a}from"./chunk-N2B5GZPU.js";import"./chunk-7WZ3VIUU.js";import"./chunk-4W6WIT7T.js";import"./chunk-MHNGR6M7.js";import"./chunk-AQ3DMGAY.js";import"./chunk-DBIXYJRB.js";import"./chunk-PE5WVWI5.js";import"./chunk-CJUKILIO.js";import"./chunk-5SM4TCSW.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-I2M24U3N.js";import{a as r}from"./chunk-WNAVYV4P.js";import"./chunk-LB65USNP.js";import{a as i}from"./chunk-A7SHHSB3.js";import{a as t}from"./chunk-4FKGHWCC.js";import"./chunk-T5VLZ43M.js";import"./chunk-I5BHCICM.js";import"./chunk-JJ4QQPAV.js";import"./chunk-OWN4P2K7.js";import"./chunk-CDPYJKK7.js";import"./chunk-OQ6KNYPG.js";import"./chunk-LEFXRK53.js";import"./chunk-7WZ3VIUU.js";import"./chunk-4W6WIT7T.js";import"./chunk-FEHVIHVA.js";import{b as o}from"./chunk-KOKEEAEF.js";import"./chunk-MHNGR6M7.js";import"./chunk-DBIXYJRB.js";import"./chunk-PE5WVWI5.js";import"./chunk-CJUKILIO.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-I2M24U3N.js";import"./chunk-T5VLZ43M.js";import"./chunk-I5BHCICM.js";import"./chunk-JJ4QQPAV.js";import"./chunk-LEFXRK53.js";import"./chunk-7WZ3VIUU.js";import"./chunk-4W6WIT7T.js";import"./chunk-FEHVIHVA.js";import"./chunk-MHNGR6M7.js";import"./chunk-DBIXYJRB.js";import"./chunk-PE5WVWI5.js";import"./chunk-CJUKILIO.js";import"./chunk-NNH3YVVO.js";import"./chunk-KMZ3L5YA.js";export{a as scopeReminder};
@@ -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-7WZ3VIUU.js";import{c as t}from"./chunk-S7GMY5LS.js";import"./chunk-KMZ3L5YA.js";var s="# Ripplo \u2014 always-on session context\n\nEvery user-facing change in this repo ships with a deterministic, backend-aware test that proves it works end-to-end.\n\n## Load the right skill before acting \u2014 this is critical\n\nThe skills below carry the procedural detail you need to do Ripplo work correctly: entity/given modeling, parallel-isolation in engine impls, backend state assertions, scope discipline, artifact-read order on failures, parallelization patterns. **None of that is reproduced in this preamble** \u2014 only the always-on guardrails are. If you act on a Ripplo task without loading the matching skill, you will skip rules that exist to prevent specific past failure modes (cross-run data leakage, \"passing\" tests that never asserted backend state, etc.).\n\nMatch the task to a skill from the triage table \u2014 if unsure between two, load both. If completely unsure, load `/ripplo:discover` or `/ripplo:create`. Loading is cheap. Acting under-informed is not.\n\n**This is a hard requirement, not a suggestion.** Do NOT run `npx ripplo` commands, edit `.ripplo/` files, or reason about how Ripplo behaves before loading the matching skill. Agents that skip this consistently misuse the CLI, invent flags that don't exist, and hold wrong expectations about compile, run, facts, scope, and the explorer \u2014 every one of those failure modes traces back to acting without the skill loaded. The skill is the source of truth for its area. When in doubt, load it first.\n\nThe skills share one mental model \u2014 how Ripplo thinks (workflows declare state, facts carry across workflows, what compile/run/explorer each enforce), and the rules below are consequences of it. It loads automatically the first time you load a Ripplo skill this session, so load a skill before acting.\n\n## Skill triage\n\n- Load `/ripplo:setup` skill for instructions on initializing Ripplo in a project; `npx ripplo doctor` reports the engine endpoint missing.\n- Load `/ripplo:discover` skill for instructions on planning/stubbing test coverage for a new project or new feature area.\n- Load `/ripplo:create` skill for instructions on authoring a single workflow for a user flow.\n- Load `/ripplo:run` skill for instructions on executing tests, managing the testing scope this session is responsible for, diagnosing a failed run (read artifacts in `.ripplo/debug/<runId>/` before re-running), and filing caught app bugs.\n- Load `/ripplo:tasks` skill for instructions on picking up tasks \u2014 open-ended requests users anchor to a replay frame and element (fix a bug, change behavior, extend or write a workflow, ask a question) and background-explorer findings, which arrive as tasks of their own. It routes the request, lets you ask the user back with `clarify`, and for app changes enforces proof with an exact run, frame, and element. Load it whenever a tasks reminder fires, the user points you at a task or finding, or before any `npx ripplo tasks` command.\n\n## Universal rules\n\n- **Two background processes must be running before feature work.** (1) The app's dev server, so the app is reachable; (2) `npx ripplo daemon` (run `/ripplo:start` to spawn it, or invoke it directly via Bash with `run_in_background`), so the dev session is live. Without the daemon, dev-mode hooks don't arm (`ripplo run` will auto-start one if absent). Without the dev server, runs fail when they try to hit the app. `npx ripplo doctor` reports both. Manage the daemon with `npx ripplo daemon status` and `npx ripplo daemon stop` (stale holder, CLI update). Switch executor live with `npx ripplo executor <local|cloud>` \u2014 no restart. Don't use `daemon restart` as an agent \u2014 the start half never returns; stop, then respawn in the background.\n- **Two funnels.** Definitions \u2192 `createRipplo({ entities, singletons, workflows })` in `.ripplo/index.ts`. Implementations \u2192 `createEngine(ripplo, { entities: impls, singletons })` in your app server's `test/engine.ts` \u2014 one `seed`/`read` impl per entity. Never call either elsewhere. TS enforces exhaustiveness across both.\n- **\"Done\" = app code delivers the behavior AND a passing test proves it.** Both halves. Shipping without a test isn't done; writing a test against broken UI/API isn't done.\n- **Scope is your job.** For any non-trivial change, enumerate every flow it could affect and either `scope add` existing workflows or stub new ones with `workflow(\"Intent\")` (no body). Don't wait to be told.\n- **`scope remove` is never for size/effort.** Valid only when an item is genuinely out of scope (wrong flow, duplicate, user said \"not this session,\" feature cut). \"Too many stubs\" \u2192 parallelize with subagents. Don't present \"implement vs. remove\" as a neutral A/B.\n- **Stub gates are not a question.** When `stop-enforce` blocks on unimplemented stubs, implement them \u2014 don't ask the user \"implement or defer?\", don't pause hooks to skip them. The fix isn't done until the test is. New scaffolding (entity, given, engine impl) is in-scope work, not follow-up.\n- **You control the hooks \u2014 use it for rapid iteration, never to dodge work.** `npx ripplo hooks pause` silences pre-edit gates and stop-enforce, `npx ripplo hooks resume` re-arms them. Pause when a user asks you to iterate fast on a feature and the checks are noise mid-loop. When you pause, say so, and before you call the work done, resume and run the full check clean. Pausing to escape a failing test or an unimplemented stub is the one thing it's not for.\n- **Keep the explorer running all session.** The background explorer walks composed paths no workflow author wrote \u2014 it fills coverage gaps and catches bugs that only surface when actions combine. It is the third gate, not an extra. A green `npx ripplo run` auto-enables it; check or toggle by hand with `npx ripplo explore [on|off]` (`--trail` sets path depth, `--workers` sets concurrency). Findings arrive as tasks \u2014 triage with `/ripplo:tasks`, and an open finding blocks the session end like any task. Leave it on \u2014 the only real off switch is `npx ripplo hooks pause`.\n- **A workflow is a user journey, not a single-mutation snippet.** One user intent, the real click path from a natural entry point, as many mutations as the intent takes \u2014 with `when` branches wherever seeded state changes an outcome along the path. Authoring method lives in `/ripplo:create`.\n- **Backend assertions are mandatory on mutations.** Every mutation step carries an `Entity.created/updated/deleted` in its `.expect(...)` \u2014 Ripplo checks your app's state against what the test expected. A UI-only check on a mutation ships the bug as green.\n- **Never weaken a test to make it pass.** No `contains`/regex for exact text, no removed assertions, no fabricated locators. App lacks an accessible name \u2192 add one to the app, don't fall back to `testId()`. App bug \u2192 report with evidence.\n- **Artifacts first, re-run last.** Failed runs write `.ripplo/debug/<runId>/behavior.jsonl` \u2014 a causal stream of actions, assertions, rrweb DOM, console, network, and server spans \u2014 and the run output renders the findings. Read them. Never pipe `ripplo run` through `grep`/`tail`/`head`. Form a hypothesis citing an event, make one change, re-run once.\n- **`.ripplo/ripplo.lock` is committed, never hand-edited.** `ripplo compile` regenerates it. Pre-commit runs `ripplo compile --check`.\n- **Scratch files live in `.ripplo/.local/`.** Never loose in `.ripplo/`.\n- **Worktrees are self-contained.** Each worktree has its own `.ripplo/` checkout, DevSession, scope, and debug artifacts. Auth and projectId are shared globally. Env files (typically gitignored) won't carry over to a fresh worktree \u2014 copy from main or point at a shared file. **If sibling worktrees run dev servers on different ports, the worktree's env file must update both `RIPPLO_APP_URL` and `RIPPLO_ENGINE_URL` to match the port that worktree's dev server is bound to** (e.g. main on `:3000`, this worktree on `:3001` \u2192 set `RIPPLO_APP_URL=http://localhost:3001` and `RIPPLO_ENGINE_URL=http://localhost:3001/ripplo` in the worktree's env file). Mismatched ports = `npx ripplo daemon` talks to the wrong server, runs silently fail or hit the sibling worktree's app.\n- **DSL locators are semantic.** Use `role`/`button`/`textbox`/`heading`/`link`; `testId` only when no ARIA role exists.\n- **New backend state?** Add an `entity(...)` in `.ripplo/entities/` and a `seed`/`read` impl in your app's engine funnel (TS flags the missing impl).\n- **Tasks demand exact proof, never hand-waving.** Resolving a task (`npx ripplo tasks resolve`) requires a run that exercises the broken condition plus a frame and element that show the fix \u2014 a red\u2192green assertion or before/after snapshots you Read, anchored on the resolving comment. Never conclude \"fixed\" from the diff, a toast, or a log string. If a run can't yet reach the broken condition, extend or write the workflow that does \u2014 don't resolve without proof. Load `/ripplo:tasks` for the loop.\n- **Know the task lifecycle.** A task is **open** (needs you), **needs clarification** (waiting on the user after your `clarify` \u2014 not your move), **resolved**, or **dismissed**. The task watcher (armed by `/ripplo:start`) wakes you live on a new task, a reopen, or a user reply, even while idle. A **reopen** means your earlier fix didn't hold \u2014 revisit it, don't treat it as a fresh request. If the user resolves or dismisses a task you were working, it's no longer relevant \u2014 stop working it (you find out at your next stop, not via a wake). While hooks are on, you cannot end the session with a task open \u2014 clear each with resolve, clarify, or dismiss. Load `/ripplo:tasks` for the loop.\n\n## Key files\n\n- `.ripplo/index.ts` \u2014 `createRipplo` call.\n- `.ripplo/{entities,singletons,workflows}/index.ts` \u2014 registry aggregators. `.ripplo/givens.ts` + feature `givens.ts` \u2014 given builders.\n- `.ripplo/project.json` \u2014 project id + env-file pointers.\n- `<app>/src/test/engine.ts` \u2014 single impl funnel via `createEngine`.\n- `/ripplo:create` skill \u2014 DSL reference (entities, givens, workflows, backend assertions). Full primitive catalog at `node_modules/@ripplo/testing/DSL.md`.\n",i=t("SessionStart",o=>{if(e(o.cwd))return{hookSpecificOutput:{additionalContext:s,hookEventName:"SessionStart"}}});export{i as sessionPreambleHook};
4
+ import{a as e}from"./chunk-7WZ3VIUU.js";import{c as t}from"./chunk-KOKEEAEF.js";import"./chunk-KMZ3L5YA.js";var s="# Ripplo \u2014 always-on session context\n\nEvery user-facing change in this repo ships with a deterministic, backend-aware test that proves it works end-to-end.\n\n## Load the right skill before acting \u2014 this is critical\n\nThe skills below carry the procedural detail you need to do Ripplo work correctly: entity/given modeling, parallel-isolation in engine impls, backend state assertions, scope discipline, artifact-read order on failures, parallelization patterns. **None of that is reproduced in this preamble** \u2014 only the always-on guardrails are. If you act on a Ripplo task without loading the matching skill, you will skip rules that exist to prevent specific past failure modes (cross-run data leakage, \"passing\" tests that never asserted backend state, etc.).\n\nMatch the task to a skill from the triage table \u2014 if unsure between two, load both. If completely unsure, load `/ripplo:discover` or `/ripplo:create`. Loading is cheap. Acting under-informed is not.\n\n**This is a hard requirement, not a suggestion.** Do NOT run `npx ripplo` commands, edit `.ripplo/` files, or reason about how Ripplo behaves before loading the matching skill. Agents that skip this consistently misuse the CLI, invent flags that don't exist, and hold wrong expectations about compile, run, facts, scope, and the explorer \u2014 every one of those failure modes traces back to acting without the skill loaded. The skill is the source of truth for its area. When in doubt, load it first.\n\nThe skills share one mental model \u2014 how Ripplo thinks (workflows declare state, facts carry across workflows, what compile/run/explorer each enforce), and the rules below are consequences of it. It loads automatically the first time you load a Ripplo skill this session, so load a skill before acting.\n\n## Skill triage\n\n- Load `/ripplo:setup` skill for instructions on initializing Ripplo in a project; `npx ripplo doctor` reports the engine endpoint missing.\n- Load `/ripplo:discover` skill for instructions on planning/stubbing test coverage for a new project or new feature area.\n- Load `/ripplo:create` skill for instructions on authoring a single workflow for a user flow.\n- Load `/ripplo:run` skill for instructions on executing tests, managing the testing scope this session is responsible for, diagnosing a failed run (read artifacts in `.ripplo/debug/<runId>/` before re-running), and filing caught app bugs.\n- Load `/ripplo:tasks` skill for instructions on picking up tasks \u2014 open-ended requests users anchor to a replay frame and element (fix a bug, change behavior, extend or write a workflow, ask a question) and background-explorer findings, which arrive as tasks of their own. It routes the request, lets you ask the user back with `clarify`, and for app changes enforces proof with an exact run, frame, and element. Load it whenever a tasks reminder fires, the user points you at a task or finding, or before any `npx ripplo tasks` command.\n\n## Universal rules\n\n- **Two background processes must be running before feature work.** (1) The app's dev server, so the app is reachable; (2) `npx ripplo daemon` (run `/ripplo:start` to spawn it, or invoke it directly via Bash with `run_in_background`), so the dev session is live. Without the daemon, dev-mode hooks don't arm (`ripplo run` will auto-start one if absent). Without the dev server, runs fail when they try to hit the app. `npx ripplo doctor` reports both. Manage the daemon with `npx ripplo daemon status` and `npx ripplo daemon stop` (stale holder, CLI update). Switch executor live with `npx ripplo executor <local|cloud>` \u2014 no restart. Don't use `daemon restart` as an agent \u2014 the start half never returns; stop, then respawn in the background.\n- **Two funnels.** Definitions \u2192 `createRipplo({ entities, singletons, workflows })` in `.ripplo/index.ts`. Implementations \u2192 `createEngine(ripplo, { entities: impls, singletons })` in your app server's `test/engine.ts` \u2014 one `seed`/`read` impl per entity. Never call either elsewhere. TS enforces exhaustiveness across both.\n- **\"Done\" = app code delivers the behavior AND a passing test proves it.** Both halves. Shipping without a test isn't done; writing a test against broken UI/API isn't done.\n- **Scope is your job.** For any non-trivial change, enumerate every flow it could affect and either `scope add` existing workflows or stub new ones with `workflow(\"Intent\")` (no body). Don't wait to be told.\n- **`scope remove` is never for size/effort.** Valid only when an item is genuinely out of scope (wrong flow, duplicate, user said \"not this session,\" feature cut). \"Too many stubs\" \u2192 parallelize with subagents. Don't present \"implement vs. remove\" as a neutral A/B.\n- **Stub gates are not a question.** When `stop-enforce` blocks on unimplemented stubs, implement them \u2014 don't ask the user \"implement or defer?\", don't pause hooks to skip them. The fix isn't done until the test is. New scaffolding (entity, given, engine impl) is in-scope work, not follow-up.\n- **You control the hooks \u2014 use it for rapid iteration, never to dodge work.** `npx ripplo hooks pause` silences pre-edit gates and stop-enforce, `npx ripplo hooks resume` re-arms them. Pause when a user asks you to iterate fast on a feature and the checks are noise mid-loop. When you pause, say so, and before you call the work done, resume and run the full check clean. Pausing to escape a failing test or an unimplemented stub is the one thing it's not for.\n- **Keep the explorer running all session.** The background explorer walks composed paths no workflow author wrote \u2014 it fills coverage gaps and catches bugs that only surface when actions combine. It is the third gate, not an extra. Check or toggle it with `npx ripplo explore [on|off]` (`--trail` sets path depth, `--workers` sets concurrency). Findings arrive as tasks \u2014 triage with `/ripplo:tasks`, and an open finding blocks the session end like any task. Leave it on.\n- **A workflow is a user journey, not a single-mutation snippet.** One user intent, the real click path from a natural entry point, as many mutations as the intent takes \u2014 with `when` branches wherever seeded state changes an outcome along the path. Authoring method lives in `/ripplo:create`.\n- **Backend assertions are mandatory on mutations.** Every mutation step carries an `Entity.created/updated/deleted` in its `.expect(...)` \u2014 Ripplo checks your app's state against what the test expected. A UI-only check on a mutation ships the bug as green.\n- **Never weaken a test to make it pass.** No `contains`/regex for exact text, no removed assertions, no fabricated locators. App lacks an accessible name \u2192 add one to the app, don't fall back to `testId()`. App bug \u2192 report with evidence.\n- **Artifacts first, re-run last.** Failed runs write `.ripplo/debug/<runId>/behavior.jsonl` \u2014 a causal stream of actions, assertions, rrweb DOM, console, network, and server spans \u2014 and the run output renders the findings. Read them. Never pipe `ripplo run` through `grep`/`tail`/`head`. Form a hypothesis citing an event, make one change, re-run once.\n- **`.ripplo/ripplo.lock` is committed, never hand-edited.** `ripplo compile` regenerates it. Pre-commit runs `ripplo compile --check`.\n- **Scratch files live in `.ripplo/.local/`.** Never loose in `.ripplo/`.\n- **Worktrees are self-contained.** Each worktree has its own `.ripplo/` checkout, DevSession, scope, and debug artifacts. Auth and projectId are shared globally. Env files (typically gitignored) won't carry over to a fresh worktree \u2014 copy from main or point at a shared file. **If sibling worktrees run dev servers on different ports, the worktree's env file must update both `RIPPLO_APP_URL` and `RIPPLO_ENGINE_URL` to match the port that worktree's dev server is bound to** (e.g. main on `:3000`, this worktree on `:3001` \u2192 set `RIPPLO_APP_URL=http://localhost:3001` and `RIPPLO_ENGINE_URL=http://localhost:3001/ripplo` in the worktree's env file). Mismatched ports = `npx ripplo daemon` talks to the wrong server, runs silently fail or hit the sibling worktree's app.\n- **DSL locators are semantic.** Use `role`/`button`/`textbox`/`heading`/`link`; `testId` only when no ARIA role exists.\n- **New backend state?** Add an `entity(...)` in `.ripplo/entities/` and a `seed`/`read` impl in your app's engine funnel (TS flags the missing impl).\n- **Tasks demand exact proof, never hand-waving.** Resolving a task (`npx ripplo tasks resolve`) requires a run that exercises the broken condition plus a frame and element that show the fix \u2014 a red\u2192green assertion or before/after snapshots you Read, anchored on the resolving comment. Never conclude \"fixed\" from the diff, a toast, or a log string. If a run can't yet reach the broken condition, extend or write the workflow that does \u2014 don't resolve without proof. Load `/ripplo:tasks` for the loop.\n- **Know the task lifecycle.** A task is **open** (needs you), **needs clarification** (waiting on the user after your `clarify` \u2014 not your move), **resolved**, or **dismissed**. The task watcher (armed by `/ripplo:start`) wakes you live on a new task, a reopen, or a user reply, even while idle. A **reopen** means your earlier fix didn't hold \u2014 revisit it, don't treat it as a fresh request. If the user resolves or dismisses a task you were working, it's no longer relevant \u2014 stop working it (you find out at your next stop, not via a wake). While hooks are on, you cannot end the session with a task open \u2014 clear each with resolve, clarify, or dismiss. Load `/ripplo:tasks` for the loop.\n\n## Key files\n\n- `.ripplo/index.ts` \u2014 `createRipplo` call.\n- `.ripplo/{entities,singletons,workflows}/index.ts` \u2014 registry aggregators. `.ripplo/givens.ts` + feature `givens.ts` \u2014 given builders.\n- `.ripplo/project.json` \u2014 project id + env-file pointers.\n- `<app>/src/test/engine.ts` \u2014 single impl funnel via `createEngine`.\n- `/ripplo:create` skill \u2014 DSL reference (entities, givens, workflows, backend assertions). Full primitive catalog at `node_modules/@ripplo/testing/DSL.md`.\n",r=t("SessionStart",o=>{if(e(o.cwd))return{hookSpecificOutput:{additionalContext:s,hookEventName:"SessionStart"}}});export{r as sessionPreambleHook};
@@ -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{Y as r}from"./chunk-OAXYJKXD.js";import"./chunk-KMZ3L5YA.js";r();
4
+ import{Y as r}from"./chunk-5SM4TCSW.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-XBD3OTIW.js";import"./chunk-EGETJKAQ.js";import"./chunk-OY6HNCAZ.js";import"./chunk-R4ZTRVDQ.js";import"./chunk-AVBP7Q2M.js";import"./chunk-MHNGR6M7.js";import"./chunk-EK6TENV6.js";import"./chunk-AQ3DMGAY.js";import"./chunk-PE5WVWI5.js";import"./chunk-CJUKILIO.js";import"./chunk-M7VQD4VO.js";import"./chunk-ESOXRGIY.js";import"./chunk-5SM4TCSW.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-XGMM2RKR.js";import{a as L,b as A,d as N,e as x,f as T,g as h}from"./chunk-VYQ5CDRX.js";import{a as $,c as P,e as I}from"./chunk-FCEWYZLQ.js";import"./chunk-FZIMQTFG.js";import{a as S,c as v}from"./chunk-TEP6ETHQ.js";import"./chunk-OQ6KNYPG.js";import{c as k}from"./chunk-42LZFMNX.js";import{a as b}from"./chunk-7WZ3VIUU.js";import{f as C}from"./chunk-HGL5SE75.js";import"./chunk-R4ZTRVDQ.js";import"./chunk-FEHVIHVA.js";import{c as D}from"./chunk-S7GMY5LS.js";import{a as w}from"./chunk-7YPITJA2.js";import{a as c}from"./chunk-MHNGR6M7.js";import{e as E,f as j,h as y}from"./chunk-IW2P4NKR.js";import"./chunk-KSNZWWHX.js";import"./chunk-WOHPPHUD.js";import{d as m}from"./chunk-LB2L72ZU.js";import"./chunk-CJUKILIO.js";import"./chunk-ZH3HY7BS.js";import{N as g}from"./chunk-OAXYJKXD.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) ---
4
+ import{a as O,b as H,c as q}from"./chunk-T5VLZ43M.js";import{a as L,b as A,d as N,e as x,f as T,g as h}from"./chunk-LKYTQXPR.js";import{a as $,c as P,e as I}from"./chunk-EGETJKAQ.js";import"./chunk-OY6HNCAZ.js";import{a as S,c as v}from"./chunk-PXZV5X3C.js";import"./chunk-OQ6KNYPG.js";import{c as k}from"./chunk-LEFXRK53.js";import{a as b}from"./chunk-7WZ3VIUU.js";import{f as C}from"./chunk-4W6WIT7T.js";import"./chunk-R4ZTRVDQ.js";import"./chunk-FEHVIHVA.js";import{c as D}from"./chunk-KOKEEAEF.js";import{a as w}from"./chunk-AVBP7Q2M.js";import{a as c}from"./chunk-MHNGR6M7.js";import{e as E,f as j,i as y}from"./chunk-EK6TENV6.js";import"./chunk-AQ3DMGAY.js";import"./chunk-DBIXYJRB.js";import{d as m}from"./chunk-PE5WVWI5.js";import"./chunk-CJUKILIO.js";import"./chunk-ESOXRGIY.js";import{N as g}from"./chunk-5SM4TCSW.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(`
@@ -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-WK7VO5JE.js";import"./chunk-XGMM2RKR.js";import"./chunk-CDPYJKK7.js";import"./chunk-OQ6KNYPG.js";import"./chunk-42LZFMNX.js";import"./chunk-7WZ3VIUU.js";import"./chunk-HGL5SE75.js";import"./chunk-FEHVIHVA.js";import"./chunk-MHNGR6M7.js";import"./chunk-WOHPPHUD.js";import"./chunk-LB2L72ZU.js";import"./chunk-CJUKILIO.js";import"./chunk-NNH3YVVO.js";import"./chunk-KMZ3L5YA.js";export{a as tasksReminder};
4
+ import{a}from"./chunk-A7SHHSB3.js";import"./chunk-T5VLZ43M.js";import"./chunk-CDPYJKK7.js";import"./chunk-OQ6KNYPG.js";import"./chunk-LEFXRK53.js";import"./chunk-7WZ3VIUU.js";import"./chunk-4W6WIT7T.js";import"./chunk-FEHVIHVA.js";import"./chunk-MHNGR6M7.js";import"./chunk-DBIXYJRB.js";import"./chunk-PE5WVWI5.js";import"./chunk-CJUKILIO.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-LB65USNP.js";import{a as c}from"./chunk-OWN4P2K7.js";import{a as i}from"./chunk-7WZ3VIUU.js";import{c as n}from"./chunk-S7GMY5LS.js";import"./chunk-KMZ3L5YA.js";import*as e from"zod/mini";var m=e.looseObject({skill:e.string()}),u=n("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||!i(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};
4
+ import{a}from"./chunk-LB65USNP.js";import{a as c}from"./chunk-OWN4P2K7.js";import{a as i}from"./chunk-7WZ3VIUU.js";import{c as n}from"./chunk-KOKEEAEF.js";import"./chunk-KMZ3L5YA.js";import*as e from"zod/mini";var m=e.looseObject({skill:e.string()}),u=n("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||!i(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};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ripplo",
3
- "version": "0.8.1",
3
+ "version": "0.8.3",
4
4
  "description": "CLI for Ripplo — AI-powered end-to-end testing",
5
5
  "type": "module",
6
6
  "homepage": "https://ripplo.ai",
@@ -67,11 +67,11 @@
67
67
  "eslint-plugin-neverthrow": "^1.1.4",
68
68
  "tsup": "^8.5.1",
69
69
  "vitest": "^4.1.4",
70
- "@ripplo/eslint-config": "0.0.0",
71
- "@ripplo/graphql": "^0.0.0",
72
70
  "@ripplo/core": "^0.0.0",
73
- "@ripplo/rrweb-bundle": "0.0.0",
71
+ "@ripplo/graphql": "^0.0.0",
72
+ "@ripplo/eslint-config": "0.0.0",
74
73
  "@ripplo/run-report": "0.0.0",
74
+ "@ripplo/rrweb-bundle": "0.0.0",
75
75
  "@ripplo/runtime": "^0.0.0",
76
76
  "@ripplo/solver": "^0.0.0",
77
77
  "@ripplo/spec": "^0.0.0"
@@ -1,242 +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 qe,f as We,g as Le,j as _e,n as He,o as Be,p as Ve,q as Ke,r as Je}from"./chunk-FZIMQTFG.js";import{c as Qe,e as ze,g as Ge}from"./chunk-4DXOF4WS.js";import{c as j}from"./chunk-42LZFMNX.js";import{d as Ne}from"./chunk-HGL5SE75.js";import{a as T}from"./chunk-R4ZTRVDQ.js";import{d as ge}from"./chunk-FEHVIHVA.js";import{b as be}from"./chunk-NWWET7CM.js";import{a as we}from"./chunk-7YPITJA2.js";import{g as F}from"./chunk-IW2P4NKR.js";import{b as ke,f as he,g as Se,h as ve}from"./chunk-KSNZWWHX.js";import{c as O}from"./chunk-WOHPPHUD.js";import{a as me,d as c,e as p}from"./chunk-LB2L72ZU.js";import{B as Ae,D as v,E as Te,G as Me,H as $e,J as Fe,O as je,U as Oe,V as De,Y as Ue,Z as $,a as xe,b as Ee,c as X,d as k,e as I,f as Ie,g as Pe,i as M,z as Ce}from"./chunk-ZH3HY7BS.js";import{M as A,N as g,i as C,l as E,m as Re}from"./chunk-OAXYJKXD.js";import Qn from"p-retry";import{graphql as Ye}from"gql.tada";var zn=Ye(`
5
- query OpenFindingsForRetire($projectId: String!) {
6
- exploreFindings(projectId: $projectId, status: open) {
7
- signature
8
- reproRun {
9
- reproJson
10
- }
11
- }
12
- }
13
- `),Gn=Ye(`
14
- mutation RetireStaleFinding($projectId: String!, $signature: String!) {
15
- retireStaleFinding(projectId: $projectId, signature: $signature)
16
- }
17
- `);function Xe(e){Qn(()=>Yn(e),{factor:2,minTimeout:200,retries:10}).catch(n=>{p.warn({err:n},"retire stale findings failed")})}async function Yn({config:e,cwd:n,lockfile:r}){let o=(await c({config:e,document:zn,variables:{projectId:e.projectId}})).exploreFindings,i=await Xn(o,await F(n,r));i.length!==0&&(await Promise.all(i.map(a=>er(e,a))),p.info({count:i.length},"retired findings whose trail no longer replays"))}async function Xn(e,n){return(await Promise.all(e.map(async t=>await Zn(t,n)?t.signature:null))).filter(t=>t!=null)}async function Zn(e,n){let r=e.reproRun?.reproJson;if(r==null)return!1;let t=je.safeParse(JSON.parse(r));return t.success?(await $(n,t.data)).kind==="unplannable":!1}function er(e,n){return c({config:e,document:Gn,variables:{projectId:e.projectId,signature:n}})}import nr from"p-queue";var rr=4,tr={"p0-ui":3,"p1-cli":2,"p2-cover":1,"p3-explore":0},D=new nr({concurrency:rr}),h={headedActive:0,interactiveActive:0,interactiveQueued:0},Ze={current:null};function jo({headed:e,task:n,workClass:r}){let t=tr[r];return r==="p3-explore"?D.add(n,{priority:t}):(h.interactiveQueued+=1,U(),D.add(()=>or({headed:e,task:n}),{priority:t}))}function Oo(e){!Number.isFinite(e)||e<1||(D.concurrency=Math.floor(e),U())}function Z(){return{active:h.interactiveActive,headedActive:h.headedActive,poolSize:D.concurrency,queued:h.interactiveQueued}}function Do(e){Ze.current=e}async function or({headed:e,task:n}){h.interactiveQueued-=1,h.interactiveActive+=1,h.headedActive+=e?1:0,U();try{return await n()}finally{h.interactiveActive-=1,h.headedActive-=e?1:0,U()}}function U(){Ze.current?.()}import{randomUUID as br}from"crypto";import{createId as xr}from"@paralleldrive/cuid2";import{CancellationTokenSource as Er,ResponseError as Ir}from"vscode-jsonrpc/node";async function en(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 nn(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 ir}from"gql.tada";var ar=ir(`
18
- mutation DaemonCreateRun(
19
- $id: String
20
- $workflowId: String!
21
- $testId: String
22
- $clientVersion: String
23
- $executor: RunExecutor
24
- $target: RunTarget
25
- $lockfileHash: String
26
- ) {
27
- createRun(
28
- id: $id
29
- workflowId: $workflowId
30
- testId: $testId
31
- executor: $executor
32
- target: $target
33
- clientVersion: $clientVersion
34
- lockfileHash: $lockfileHash
35
- ) {
36
- __typename
37
- ... on MutationCreateRunSuccess {
38
- data {
39
- id
40
- }
41
- }
42
- ... on LimitExceededError {
43
- code
44
- }
45
- }
46
- }
47
- `);async function rn(e){try{let r=(await c({config:e.config,document:ar,variables:sr(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 lr(n)}}function sr({executor:e,lockfileHash:n,runId:r,target:t}){return{clientVersion:T(),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 lr(e){return e instanceof me?{detail:e.message,kind:"infra-error"}:N({detail:e instanceof Error?e.message:String(e),type:"generic"})}import{graphql as dr}from"gql.tada";async function tn(e,n){let t=(await c({config:e,document:ur,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 ur=dr(`
48
- query DaemonWorkflows($projectId: String!, $cwd: String!) {
49
- project(id: $projectId) {
50
- id
51
- devSession(cwd: $cwd) {
52
- id
53
- workflows {
54
- id
55
- slug
56
- tests {
57
- id
58
- slug
59
- }
60
- }
61
- }
62
- }
63
- }
64
- `);import{CancellationTokenSource as cr}from"vscode-jsonrpc/node";function ee(e){return`${e.workflowSlug}/${e.testSlug}`}function on(e){let{headed:n,inflight:r,jobId:t,lockfileHashValue:o,onExpire:i,runId:a,selection:s,timeoutMs:d}=e,u=ee(s),l=`${u}@${o}@${String(n)}`,f=r.get(l);if(f!=null)return f.jobIds.add(t),null;let y={cancellation:new cr,claimed:!1,claimKey:u,headed:n,inflightKey:l,jobIds:new Set([t]),runId:a,testName:s.testName,timer:null,workflowName:s.workflowName};return y.timer=setTimeout(()=>{q(r,y),i(y)},d),r.set(l,y),y}function q(e,n){n.timer!=null&&(clearTimeout(n.timer),n.timer=null),e.delete(n.inflightKey)}function ne(e,n){let r=[...e.values()].find(t=>t.runId===n&&!t.claimed);return r==null?null:(r.claimed=!0,r.timer!=null&&(clearTimeout(r.timer),r.timer=null),r)}function an(e,n){[...e.values()].filter(r=>r.jobIds.has(n)).forEach(r=>{r.jobIds.delete(n),r.jobIds.size===0&&(q(e,r),r.cancellation.cancel())})}import{err as re,ok as sn}from"neverthrow";function dn({all:e,ids:n,lockfile:r}){if(e&&n.length>0)return re({kind:"conflicting-flags"});if(e)return sn(r.workflows.filter(i=>!i.stub).flatMap(i=>i.tests.map(a=>k(a))));if(n.length===0)return re({kind:"nothing-selected"});let t=n.map(i=>({id:i,refs:fr(r,i)})),o=t.filter(i=>i.refs.length===0).map(i=>i.id);return o.length>0?re({kind:"unknown-ids",known:pr(r),unknown:o}):sn([...new Set(t.flatMap(i=>i.refs))])}function un(e,n){let r=new Map(I(e).map(t=>[t.ref,{testName:t.test.name,testSlug:t.test.slug,workflowName:t.workflow.name,workflowSlug:g(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 pr(e){return e.workflows.map(n=>g(n.name))}function fr(e,n){let r=e.workflows.find(t=>t.name===n||g(t.name)===g(n));return r!=null?r.tests.map(t=>k(t)):I(e).filter(t=>t.ref===n||ln(t.ref)===ln(n)).map(t=>t.ref)}function ln(e){let n=e.lastIndexOf("/");return n===-1?g(e):`${g(e.slice(0,n))}/${g(e.slice(n+1))}`}import{err as te,ok as cn}from"neverthrow";import{graphql as pn}from"gql.tada";async function fn({config:e,cwd:n,lockfile:r}){await mr({config:e,cwd:n,lockfile:r});let t=await Rr(e);if(t.isErr())return te(t.error);let o=new Map(r.workflows.filter(a=>!a.stub).map(a=>[g(a.name),a])),i=[...new Set(t.value)].flatMap(a=>{let s=o.get(a);return s==null?[]:s.tests.map(d=>k(d))});return i.length===0?te({kind:"scope-empty"}):cn(i)}var yr=pn(`
65
- mutation AddDirtyTestsToScope($projectId: String!, $cwd: String!, $workflowSlugs: [String!]!) {
66
- addDirtyTestsToScope(projectId: $projectId, cwd: $cwd, workflowSlugs: $workflowSlugs) {
67
- __typename
68
- }
69
- }
70
- `);async function mr({config:e,cwd:n,lockfile:r}){let t=new Set(Ge(n)),o=r.workflows.filter(i=>i.sourcePath!=null&&t.has(i.sourcePath)).map(i=>g(i.name));o.length!==0&&await c({config:e,document:yr,variables:{cwd:e.cwd,projectId:e.projectId,workflowSlugs:o}}).catch(i=>{p.warn({err:i},"auto-scope of dirty tests failed")})}var gr=pn(`
71
- query ScopeSelection($projectId: String!, $cwd: String!) {
72
- project(id: $projectId) {
73
- id
74
- devSession(cwd: $cwd) {
75
- id
76
- scopeItems {
77
- id
78
- workflow {
79
- id
80
- slug
81
- }
82
- }
83
- }
84
- }
85
- }
86
- `);async function Rr(e){try{let r=(await c({config:e,document:gr,variables:{cwd:e.cwd,projectId:e.projectId}})).project?.devSession?.scopeItems??[];return cn(r.flatMap(t=>t.workflow==null?[]:[t.workflow.slug]))}catch(n){return te({detail:n instanceof Error?n.message:String(n),kind:"scope-fetch-failed"})}}import{graphql as kr}from"gql.tada";var hr=2e3,Sr=kr(`
87
- query DaemonCloudRunStatus($runId: String!) {
88
- run(id: $runId) {
89
- status
90
- failureReason
91
- }
92
- }
93
- `);function mn({config:e,onComplete:n,onStarted:r,runId:t,signal:o}){let i=!1,a,s=!1,d=async()=>{if(i||o.aborted)return;let u=await vr(e,t).catch(()=>"unknown");if(!(i||o.aborted)){if(!s&&(u==="running"||yn(u))&&(s=!0,r()),yn(u)){i=!0,n(wr(u));return}a=setTimeout(()=>{d()},hr)}};return d(),{stop:()=>{i=!0,a!=null&&clearTimeout(a)}}}async function vr(e,n){let t=(await c({config:e,document:Sr,variables:{runId:n}})).run?.status;return t??"unknown"}function yn(e){return e==="passed"||e==="failed"||e==="cancelled"||e==="unready"}function wr(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 Pr=qe(process.argv[1]),Cr=12e4,Ar=-32099,oe=new Set,gn=new Map;function Ii(e){oe.add(e)}function Tr(e){let n=new AbortController;return e.isCancellationRequested?(n.abort(),n.signal):(e.onCancellationRequested(()=>{n.abort()}),n.signal)}function Pi(e){let n={...e,inflight:new Map,jobs:new Map};return{claim:r=>Or(n,r),handleConnection:r=>{Mr(n,r)},idle:()=>hn(n)}}function Mr(e,n){let r=We(n);r.onRequest(He,(t,o)=>$r({connection:r,ctx:e,params:t,token:o})),r.onRequest(Be,()=>{let t=Z();return{active:t.active,bundleMtimeMs:Pr,queued:t.queued,sseHealth:e.sseHealth(),version:T(),...e.explorationStatus()}}),r.onRequest(Ve,()=>{let t=hn(e);return t&&e.onShutdownRequest(),t}),r.onClose(()=>{Fr(e,r)}),r.onError(t=>{p.warn({err:t},"ipc connection error")}),n.on("error",t=>{p.warn({err:t},"ipc socket error")}),r.listen()}function hn(e){let n=Z();return e.jobs.size===0&&n.active===0&&n.queued===0}async function $r({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 Ur({config:n.config,cwd:n.cwd,message:o.data});if(i.kind==="error")throw Rn(i.error);let a=br(),s=new Er;return t.onCancellationRequested(()=>{Sn(n,a)}),n.jobs.set(a,{cancellation:s,connection:e,failed:0,notRun:0,passed:0,total:i.selections.length}),Br({ctx:n,headed:o.data.headed,jobId:a,lockfileHashValue:i.lockfileHashValue,selections:i.selections,targetsByClaimKey:i.targetsByClaimKey,token:s.token}).catch(d=>{p.error({err:d},"ipc dispatch failed")}),{jobId:a,total:i.selections.length}}function Rn(e){return new Ir(Ar,e.code,e)}function Sn(e,n){let r=e.jobs.get(n);r!=null&&(r.cancellation.cancel(),e.jobs.delete(n),an(e.inflight,n))}function Fr(e,n){[...e.jobs.entries()].filter(([,r])=>r.connection===n).forEach(([r])=>{Sn(e,r)})}function vn(e,n,r){let t=e.jobs.get(n);t!=null&&(kn(()=>t.connection.sendNotification(Ke,{event:r,jobId:n})),r.kind==="test-outcome"&&(jr(t,r.outcome.kind),t.passed+t.failed+t.notRun>=t.total&&(kn(()=>t.connection.sendNotification(Je,{failed:t.failed,jobId:n,notRun:t.notRun,passed:t.passed})),e.jobs.delete(n))))}function kn(e){Promise.resolve().then(e).catch(n=>{p.warn({err:n},"ipc notification failed")})}function jr(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 w(e,n,r){n.jobIds.forEach(t=>{vn(e,t,r)})}function Or(e,n){let r=ne(e.inflight,n);return r==null?null:{headed:r.headed,token:r.cancellation.token,finished:(t,o)=>{e.inflight.delete(r.inflightKey),w(e,r,{kind:"test-outcome",outcome:o,runId:r.runId,testName:r.testName,workflowName:r.workflowName})},started:()=>{w(e,r,{kind:"test-started",runId:r.runId,testName:r.testName,workflowName:r.workflowName})}}}function Dr(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 Ur({config:e,cwd:n,message:r}){return(await he(n)).match(o=>Nr({config:e,cwd:n,lockfile:o,message:r}),o=>Promise.resolve({error:{code:"compile-failed",detail:o.kind,diagnostics:[...Dr(o)]},kind:"error"}))}async function Nr({config:e,cwd:n,lockfile:r,message:t}){let o=await en(e.appUrl);if(o!=null)return{error:{code:"app-unreachable",detail:o,url:e.appUrl},kind:"error"};let i=await nn(e.engineUrl);if(i!=null)return{error:{code:"engine-unreachable",detail:i,url:e.engineUrl},kind:"error"};let a=await ze(n);if(a==null)return{error:{code:"sync-failed",detail:"lockfile-missing"},kind:"error"};if(!oe.has(a)){let d=await Wr({config:e,cwd:n,lockfile:r});if(d!=null)return{error:{code:"sync-failed",detail:d},kind:"error"};oe.add(a),Xe({config:e,cwd:n,lockfile:r})}return(await Lr({config:e,cwd:n,lockfile:r,message:t})).match(async d=>({kind:"ready",lockfileHashValue:a,selections:un(r,d),targetsByClaimKey:await qr({config:e,cwd:n,hash:a})}),d=>Promise.resolve({error:d,kind:"error"}))}async function qr({config:e,cwd:n,hash:r}){let t=gn.get(r);if(t!=null)return t;let o=await tn(e,n);return gn.set(r,o),o}async function Wr(e){try{return await Qe(e),null}catch(n){return n instanceof Error?n.message:String(n)}}async function Lr({config:e,cwd:n,lockfile:r,message:t}){return!t.all&&t.tests.length===0?(await fn({config:e,cwd:n,lockfile:r})).mapErr(_r):dn({all:t.all,ids:t.tests,lockfile:r}).mapErr(Hr)}function _r(e){return e.kind==="scope-empty"?{code:"selection-nothing-selected"}:{code:"scope-failed",detail:e.detail}}function Hr(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]}}}async function Br(e){await e.selections.reduce((n,r)=>n.then(()=>Vr(e,r)),Promise.resolve())}async function Vr(e,n){let{ctx:r,headed:t,jobId:o,lockfileHashValue:i,targetsByClaimKey:a,token:s}=e;if(s.isCancellationRequested)return;let d=ee(n),u=a.get(d);if(u==null){vn(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 l=on({headed:t,inflight:r.inflight,jobId:o,lockfileHashValue:i,runId:xr(),selection:n,timeoutMs:Cr,onExpire:m=>{w(r,m,{kind:"test-outcome",outcome:{detail:"dispatch-timeout",kind:"dispatch-timeout"},runId:"",testName:m.testName,workflowName:m.workflowName})}});if(l==null)return;let f=r.executor(),y=await Kr({ctx:r,executor:f,lockfileHashValue:i,run:l,target:u});if(y!=null){q(r.inflight,l),w(r,l,{kind:"test-outcome",outcome:y,runId:"",testName:n.testName,workflowName:n.workflowName});return}f==="cloud"&&Jr(r,l)}function Kr({ctx:e,executor:n,lockfileHashValue:r,run:t,target:o}){return rn({config:e.config,executor:n,lockfileHash:r,runId:t.runId,target:o})}function Jr(e,n){let r=ne(e.inflight,n.runId);r!=null&&mn({config:e.config,runId:r.runId,signal:Tr(r.cancellation.token),onComplete:t=>{e.inflight.delete(r.inflightKey),w(e,r,{kind:"test-outcome",outcome:t,runId:r.runId,testName:r.testName,workflowName:r.workflowName})},onStarted:()=>{w(e,r,{kind:"test-started",runId:r.runId,testName:r.testName,workflowName:r.workflowName})}})}import Qr from"fs";import zr from"path";async function Oi(e){let n=zr.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 r=await ve(e);return r.isErr()?{appUrl:void 0,engineUrl:void 0,errors:[{message:we(r.error),path:".ripplo/"}],valid:!1,warnings:[]}:ge().match(t=>({appUrl:t.appUrl,engineUrl:t.engineUrl,errors:[],valid:!0,warnings:[]}),t=>({appUrl:void 0,engineUrl:void 0,errors:[{message:be(t),path:""}],valid:!1,warnings:[]}))}async function Di(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 Ui({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}}function Gr(e){let{backoffActive:n,exploreEnabled:r,headedActive:t,interactiveActive:o,interactiveQueued:i}=e,{explorationActive:a,exploreConcurrency:s,poolSize:d}=e;if(!r||t||o>0||i>0)return{abortCount:a,refillCount:0};if(n)return{abortCount:0,refillCount:0};let u=Math.min(s,d-1);return{abortCount:0,refillCount:Math.max(0,u-a)}}function qi(e){let n={active:new Map,backoffUntil:0,cancelBackoffTimer:null,cancelHeartbeat:null,prevInteractiveActive:e.probe().interactiveActive,stopped:!1};return xn(n,e),{explorationActive:()=>n.active.size,notifyQueueChange:()=>{Xr(n,e)},stalled:()=>et(n,e),stop:()=>{n.stopped=!0,n.cancelBackoffTimer?.(),n.cancelBackoffTimer=null,n.cancelHeartbeat?.(),n.cancelHeartbeat=null,In(n,n.active.size)}}}function xn(e,n){e.stopped||(e.cancelHeartbeat=n.setTimer(()=>{W(e,n),xn(e,n)},15e3))}function W(e,n){if(e.stopped)return;Yr(e,n);let r=n.probe(),t=Gr({backoffActive:n.now()<e.backoffUntil,explorationActive:e.active.size,exploreConcurrency:n.exploreConcurrency(),exploreEnabled:n.exploreEnabled(),headedActive:r.headedActive>0,interactiveActive:r.interactiveActive,interactiveQueued:r.interactiveQueued,poolSize:r.poolSize});In(e,t.abortCount),Pn({count:t.refillCount,params:n,state:e})}function Yr(e,n){En(e,n).forEach(({controller:r})=>{r.abort()})}function En(e,n){let r=n.now()-9e4;return[...e.active.values()].filter(t=>t.startedAt<=r)}function In(e,n){[...e.active.values()].slice(0,n).forEach(({controller:r})=>{r.abort()})}function Xr(e,n){let r=n.probe();r.interactiveActive<e.prevInteractiveActive&&Zr(e,n),e.prevInteractiveActive=r.interactiveActive,W(e,n)}function Zr(e,n){e.backoffUntil=n.now()+3e4,e.cancelBackoffTimer?.(),e.cancelBackoffTimer=n.setTimer(()=>{e.cancelBackoffTimer=null,W(e,n)},3e4)}function et(e,n){return En(e,n).length}function Pn({count:e,params:n,state:r}){if(e<=0)return;let t=nt(n.sources);t!=null&&(rt({params:n,pulled:t,state:r}),Pn({count:e-1,params:n,state:r}))}function nt(e){return e.reduce((n,r)=>{if(n!=null)return n;let t=r.next();return t==null?null:{job:t,source:r}},null)}function rt({params:e,pulled:n,state:r}){let{job:t,source:o}=n,i=new AbortController;r.active.set(t.id,{controller:i,job:t,source:o,startedAt:e.now()}),e.execute({job:t,priority:o.priority,signal:i.signal}).then(()=>{bn({job:t,outcome:wn(i.signal,null),params:e,source:o,state:r})}).catch(a=>{bn({job:t,outcome:wn(i.signal,{error:a}),params:e,source:o,state:r})})}function wn(e,n){return e.aborted?{kind:"aborted"}:n==null?{kind:"completed"}:{error:n.error,kind:"error"}}function bn({job:e,outcome:n,params:r,source:t,state:o}){o.active.delete(e.id),t.onResult(e,n),W(o,r)}import{createMessageConnection as Cn,IPCMessageReader as An,IPCMessageWriter as Tn,NotificationType as tt,NotificationType0 as Mn,RequestType as $n,RequestType0 as ot}from"vscode-jsonrpc/node";import{z as R}from"zod";var Vi=R.object({headed:R.boolean(),runId:R.string().min(1),testRef:R.string().min(1)}),Ki=R.object({lockfileJson:R.string().optional(),unavailable:R.string().optional()}),Ji=R.object({runId:R.string().min(1),span:Re}),Qi=R.object({outcome:_e,serverNotified:R.boolean()}),zi=new Mn("worker/ready"),Gi=new $n("worker/run"),Yi=new ot("worker/lockfile"),Xi=new $n("worker/exploreTrail"),Zi=new tt("worker/span"),ea=new Mn("worker/shutdown");function na(e){let n=Cn(new An(e),new Tn(e));return n.listen(),n}function ra(){let e=Cn(new An(process),new Tn(process));return e.listen(),e}import{gzipSync as ft}from"zlib";import{appendFileSync as yt,existsSync as _,readFileSync as Un,writeFileSync as Dn}from"fs";import S from"path";import{graphql as ae}from"gql.tada";function L(e){return[e.kind,e.target,e.value].filter(n=>n.length>0).join(" ")}function Fn(e,n){return{kind:"finding",payload:lt(e),source:"verifier",step:n.step,stepIndex:n.stepIndex,timeNanos:n.timeNanos}}var it={"no-effect":"noEffect","required-state-unsatisfied":"requiredStateUnsatisfied",unresolvable:"unresolvable"},at={"data-rule":"dataRule",fact:"fact",step:"step"},st={aborted:"aborted","action-failed":"actionFailed","app-not-ready":"appNotReady","check-failed":"checkFailed","client-mount-missing":"clientMountMissing","conflicting-sessions":"conflictingSessions","driver-launch":"driverLaunch","engine-decode":"engineDecode","engine-http":"engineHttp","engine-network":"engineNetwork","engine-unreachable":"engineUnreachable","setup-missing-row":"setupMissingRow","state-identity":"stateIdentity"};function lt(e){return e.kind==="consistency"?{kind:"mismatch",mismatch:pt(e.mismatch),pending:e.pending,wait:e.budget,waitMs:X[e.budget]}:e.kind==="pending-check"?{...dt(e.source),kind:"pendingCheck",source:at[e.source.kind],wait:e.budget,waitMs:X[e.budget]}:e.kind==="unrunnable"?{kind:"unrunnable",reason:it[e.reason],unmet:e.unmet==null?void 0:$e(e.unmet)}:e.kind==="impossible-action"?{action:ut(e.step.action),kind:"impossibleAction",subject:On(e.step.action)}:e.kind==="lift-visibility"?{declaredIndex:e.declaredIndex,kind:"liftVisibility",subject:E(e.locator),visibleIndex:e.visibleIndex}:{errorKind:st[e.error.kind],kind:"driverError",message:ct(e.error)}}function dt(e){return"check"in e?jn(e.check,!1):{checkKind:null,expected:null,negated:!1,subject:Ae(e.dataRule)}}function jn(e,n){return e.kind==="not"?jn(e.inner,!n):e.kind==="browser"?{checkKind:"browser",expected:e.value??null,negated:n,subject:xe(e.key)}:e.kind==="value"||e.kind==="text"?{checkKind:e.kind,expected:e.value,negated:n,subject:E(e.locator)}:{checkKind:e.kind,expected:null,negated:n,subject:E(e.locator)}}function ut(e){return`${e.kind} ${On(e)}`.trim()}function On(e){return e.locator==null?e.url??"":E(e.locator)}function ct(e){return"message"in e?e.message:"detail"in e?e.detail:null}function pt(e){if(e.kind==="wrong-value")return{actual:v(e.sut),entity:e.entity,expected:v(e.snapshot),field:e.field,key:e.key,kind:"wrongValue"};if(e.kind==="expected-change"){let n=e.direction==null?"change":e.direction.replace(/d$/,"");return{actual:v(e.value),entity:e.entity,expected:`${n} from ${v(e.from)}`,field:e.field,key:e.key,kind:"expectedChange"}}return e.kind==="scalar-mismatch"?{actual:v(e.sut),expected:Te(e.want),kind:"scalarMismatch",subject:Ce(e.subject),subjectKey:Ee(e.subject)}:e.kind==="missing-row"?{entity:e.entity,key:e.key,kind:"missingRow"}:{entity:e.entity,key:e.key,kind:"unexpectedRow"}}function B({config:e,fixturesDir:n,headed:r}){return{baseUrl:e.appUrl,engineUrl:e.engineUrl,fixturesDir:n,generate:C,headed:r,secret:e.webhookSecret}}async function se(e){let n=V(e);await le(e.config,e.runId,n)}function V({debugDir:e,events:n,recordingOptional:r,runId:t,stepSources:o}){let i=de(n),a=wt(e,t);if(a==null&&!r)throw new Error("recording-missing");let s=i.map((u,l)=>Ft({aliases:[...Et(n),...It(i)],generated:Pt(n),generatedSingletons:Ct(n),origin:a==null?vt(i):a.origin,record:u,rrwebEvents:a==null?[]:a.events,sourceTest:o?.[l]??null})),d=i.flatMap(u=>u.findings.map(l=>Fn(l,{step:L(A(u.source,u.index)),stepIndex:u.index,timeNanos:Nn(u)})));return mt({debugDir:e,events:[...s,...d],runId:t}),i}function mt({debugDir:e,events:n,runId:r}){if(n.length===0)return;let t=S.join(e,r,"behavior.jsonl");if(!_(t))return;let o=n.map(i=>JSON.stringify(i)).join(`
94
- `);yt(t,`${o}
95
- `)}function Nn(e){return String(BigInt(Math.max(0,Math.round(e.endMs)))*1000000n)}async function le(e,n,r){let t=r.filter(a=>a.findings.length>0).length,o=r.length-t,i=r.reduce((a,s)=>a+Math.max(0,s.endMs-s.startMs),0);await c({config:e,document:Dt,variables:{items:[{duration:i,failCount:t,firstFailedStepTitle:gt(r),passCount:o,runId:n,status:t>0?"failed":"passed"}]}})}function gt(e){let n=e.filter(r=>r.findings.length>0).toSorted((r,t)=>r.index-t.index).at(0);return n==null?null:L(A(n.source,n.index))}function de(e){return e.flatMap(n=>n.kind==="step"?[{annotations:n.annotations,endMs:n.endMs,findings:n.findings,index:n.index,source:n.source,startMs:n.startMs,state:n.state,url:n.url}]:[])}async function qn(e,n){await c({config:e,document:Ut,variables:{runIds:[n]}})}var H=".uploaded";async function Rt({config:e,debugDir:n,runId:r}){let t=S.join(n,r),o=S.join(t,"behavior.jsonl");if(_(S.join(t,H)))return;if(!_(o)){p.warn({runId:r},"behavior upload skipped: behavior.jsonl missing on disk");return}await[0,1e3,3e3].reduce((a,s)=>a.then(async d=>d?!0:(await new Promise(u=>setTimeout(u,s)),kt({behaviorPath:o,config:e,runDir:t,runId:r}))),Promise.resolve(!1))}async function kt({behaviorPath:e,config:n,runDir:r,runId:t}){try{let o=await c({config:n,document:Ot,variables:{runId:t}}),i=await fetch(o.debugArtifactUploadUrl,{body:ft(Un(e)),headers:{"content-type":St},method:"PUT"});return i.ok?(await qn(n,t),Dn(S.join(r,H),""),!0):(p.warn({runId:t,status:i.status},"behavior upload PUT failed"),!1)}catch(o){return ht(o)?(p.warn({runId:t},"behavior upload refused by server; run unknown \u2014 not retrying"),Dn(S.join(r,H),""),!0):(p.warn({error:o,runId:t},"behavior upload failed"),!1)}}function ht(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 St="application/x-ndjson";function vt(e){return e.reduce((n,r)=>Math.min(n,r.startMs),e[0]?.startMs??0)}function wt(e,n){let r=S.join(e,n,"behavior.jsonl");if(!_(r))return null;let t=Un(r,"utf8").split(`
96
- `).filter(i=>i.length>0).map(i=>bt(i)).flatMap(i=>xt(i)?[i.event]:[]),o=t[0];return o==null?null:{events:t,origin:o.timestamp}}function bt(e){return JSON.parse(e)}function xt(e){return typeof e=="object"&&e!=null&&Reflect.get(e,"kind")==="rrweb"}function Et(e){return e.flatMap(n=>n.kind==="world"?n.aliases:[])}function It(e){return e.flatMap(n=>{let r=At(n.source);return r.flatMap(t=>{let i=r.filter(s=>s.entity===t.entity).indexOf(t),a=n.state.rows.filter(s=>s.status==="created"&&s.entity===t.entity).at(i);return a==null?[]:[{alias:t.as,entity:t.entity,key:a.key}]})})}function Pt(e){return new Set(e.flatMap(n=>n.kind==="world"?n.generated.map(r=>Wn(r)):[]))}function Wn({entity:e,field:n,key:r}){return`${e} ${r} ${n}`}function Ct(e){return new Set(e.flatMap(n=>n.kind==="world"?n.generatedSingletons:[]))}function At(e){return e==null?[]:e.expect.flatMap(n=>ie(n))}function ie(e){return e.kind==="state"&&e.assertion.kind==="created"?[{as:e.assertion.as,entity:e.entity}]:e.kind==="and"?e.predicates.flatMap(n=>ie(n)):e.kind==="when"?e.branches.flatMap(n=>n.consequence.flatMap(r=>ie(r))):[]}var Tt=3,Mt=0;function $t({endMs:e,rrwebEvents:n,startMs:r}){let t=n.find(o=>o.type===Tt&&o.data?.source===Mt&&o.timestamp>=r&&o.timestamp<=e);return t==null?r:t.timestamp}function Ft({aliases:e,generated:n,generatedSingletons:r,origin:t,record:o,rrwebEvents:i,sourceTest:a}){let s=A(o.source,o.index),d=$t({endMs:o.endMs,rrwebEvents:i,startMs:o.startMs});return{annotations:[...o.annotations.map(l=>({ephemeral:l.ephemeral,kind:l.kind,label:l.label,outcome:l.outcome,recordingStartMs:Math.max(0,(l.kind==="action"?d:l.atMs)-t),rrwebIds:[...l.rrwebIds],url:l.url,value:l.value??null}))],duration:Math.max(0,o.endMs-o.startMs),kind:"step",nodeType:s.kind,pageUrl:o.url,recordingEndMs:Math.max(0,o.endMs-t),recordingStartMs:Math.max(0,d-t),source:"verifier",sourceTest:a,stateRows:o.state.rows.map(l=>jt({aliases:e,generated:n,row:l})),stateSingletons:o.state.singletons.map(l=>({changed:l.changed,generated:r.has(l.name),name:l.name,value:l.value==null?null:String(l.value)})),stepIndex:o.index,timeNanos:Nn(o),title:L(s)}}function jt({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(Wn({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=ae(`
97
- mutation DebugArtifactUploadUrl($runId: String!) {
98
- debugArtifactUploadUrl(runId: $runId)
99
- }
100
- `),Dt=ae(`
101
- mutation CompleteRunsBatch($items: [CompleteRunItem!]!) {
102
- completeRunsBatch(items: $items) {
103
- id
104
- status
105
- }
106
- }
107
- `),Ut=ae(`
108
- mutation MarkRunArtifactsUploadedBatch($runIds: [String!]!) {
109
- markRunArtifactsUploadedBatch(runIds: $runIds)
110
- }
111
- `);import{graphql as b}from"gql.tada";function Nt(e){let n=e.trail;if(!(n==null||!qt(e.kind)))return{baseLabel:n.baseLabel,baseState:n.baseState,durationMs:n.durationMs,outcome:e.kind,runId:e.runId,signature:n.signature,steps:n.steps}}function qt(e){return e==="clean"||e==="flaky"||e==="finding"}async function ue({baseState:e,category:n,config:r,debugDir:t,devSessionId:o,events:i,lockfileHash:a,reproJson:s,runId:d,signature:u,spec:l,stepSources:f,summary:y,workflowSlug:m}){await c({config:r,document:Bt,variables:{devSessionId:o??null,lockfileHash:a??null,projectId:r.projectId,reproJson:s,runId:d,spec:l??null,workflowSlug:m??null}}),await se({config:r,debugDir:t,events:i,recordingOptional:!0,runId:d,stepSources:f}),await c({config:r,document:Vt,variables:{baseState:e,category:n,projectId:r.projectId,reproRunId:d,signature:u,summary:y}})}async function K(e,n,r){return(await c({config:e,document:Kt,variables:{lockfileHash:r,projectId:e.projectId,signature:n}})).exploreFindingExists}async function Wt({attempts:e,config:n,devSessionId:r,findings:t,trail:o}){await c({config:n,document:_t,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 Lt(e,n){return(await c({config:e,document:Ht,variables:{devSessionId:n}}).catch(t=>(p.warn({error:t},"reportExploreUnhealthy failed"),null)))?.reportExploreUnhealthy??!1}var _t=b(`
112
- mutation RecordExplorationProgress(
113
- $devSessionId: String!
114
- $attempts: Int!
115
- $findings: Int!
116
- $trail: ExploreTrailInput
117
- ) {
118
- recordExplorationProgress(
119
- devSessionId: $devSessionId
120
- attempts: $attempts
121
- findings: $findings
122
- trail: $trail
123
- )
124
- }
125
- `),Ht=b(`
126
- mutation ReportExploreUnhealthy($devSessionId: String!) {
127
- reportExploreUnhealthy(devSessionId: $devSessionId)
128
- }
129
- `),Bt=b(`
130
- mutation CreateExploreRun(
131
- $projectId: String!
132
- $runId: String!
133
- $devSessionId: String
134
- $lockfileHash: String
135
- $spec: String
136
- $reproJson: String
137
- $workflowSlug: String
138
- ) {
139
- createExploreRun(
140
- projectId: $projectId
141
- runId: $runId
142
- devSessionId: $devSessionId
143
- lockfileHash: $lockfileHash
144
- spec: $spec
145
- reproJson: $reproJson
146
- workflowSlug: $workflowSlug
147
- ) {
148
- id
149
- }
150
- }
151
- `),Vt=b(`
152
- mutation SubmitExploreFinding(
153
- $projectId: String!
154
- $signature: String!
155
- $summary: String!
156
- $baseState: String!
157
- $category: ExploreFindingCategory!
158
- $reproRunId: String!
159
- ) {
160
- submitExploreFinding(
161
- projectId: $projectId
162
- signature: $signature
163
- summary: $summary
164
- baseState: $baseState
165
- category: $category
166
- reproRunId: $reproRunId
167
- ) {
168
- id
169
- }
170
- }
171
- `),va=b(`
172
- mutation SetExploreFindingStatus(
173
- $projectId: String!
174
- $signature: String!
175
- $status: ExploreFindingStatus!
176
- ) {
177
- setExploreFindingStatus(projectId: $projectId, signature: $signature, status: $status)
178
- }
179
- `),Kt=b(`
180
- query ExploreFindingExists($projectId: String!, $signature: String!, $lockfileHash: String!) {
181
- exploreFindingExists(projectId: $projectId, signature: $signature, lockfileHash: $lockfileHash)
182
- }
183
- `);import zt from"path";import{graphql as Gt}from"gql.tada";import{graphql as J}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"conflicting-sessions":case"driver-launch":case"action-failed":case"check-failed":case"aborted":return null}}async function pe(e,n,r){await c({config:e,document:Jt,variables:{reason:r,runId:n}}).catch(t=>{p.error(t,"failRun submission failed")})}async function fe(e,n,r){await c({config:e,document:Qt,variables:{cause:r,runId:n}}).catch(t=>{p.error(t,"markRunUnready submission failed")})}var Ea=J(`
184
- mutation ReleaseRun($runId: String!) {
185
- releaseRun(runId: $runId)
186
- }
187
- `),Ia=J(`
188
- mutation HeartbeatRun($runId: String!) {
189
- heartbeatRun(runId: $runId)
190
- }
191
- `),Jt=J(`
192
- mutation FailRun($runId: String!, $reason: String!) {
193
- failRun(runId: $runId, reason: $reason)
194
- }
195
- `),Qt=J(`
196
- mutation MarkRunUnready($runId: String!, $cause: RunUnreadyCause!) {
197
- markRunUnready(runId: $runId, cause: $cause)
198
- }
199
- `);async function Yt({config:e,cwd:n,errorSettle:r,fixturesDir:t,headed:o,lockfile:i,onPhase:a,runId:s,session:d,signal:u,test:l}){if(!await Zt(e,s))return{outcome:{kind:"dispatch-failed",reason:"already-claimed",runId:s},persisted:Promise.resolve()};let y=zt.join(n,".ripplo","debug"),m=[];return(await d.runOnce({capture:!0,lockfile:i,onPhase:a,options:B({config:e,fixturesDir:t,headed:o}),params:void 0,runId:s,sequence:void 0,test:l,onEvent:x=>{m.push(x)}},u)).match(async x=>{let ye=de(m),G=ye.flatMap(Jn=>Jn.findings),Y=Xt(G);if(Y!=null)return V({config:e,debugDir:y,events:m,recordingOptional:!0,runId:s,stepSources:void 0}),await Ln({config:e,error:Y,errorSettle:r,runId:s}),{outcome:{error:Y,kind:"error",runId:s},persisted:Promise.resolve()};await le(e,s,ye),V({config:e,debugDir:y,events:m,recordingOptional:!0,runId:s,stepSources:void 0});let Kn=Promise.resolve();return{outcome:G.length>0?{findings:G,kind:"findings",runId:s}:{kind:"pass",runId:s},persisted:Kn}},async x=>(await Ln({config:e,error:x,errorSettle:r,runId:s}),{outcome:{error:x,kind:"error",runId:s},persisted:Promise.resolve()}))}async function Ln({config:e,error:n,errorSettle:r,runId:t}){if(r==="defer")return;let o=ce(n);if(o!=null){await fe(e,t,o);return}await pe(e,t,M(n))}function Xt(e){let n=e.find(r=>r.kind==="driver-error"&&Pe(r.error));return n!=null&&n.kind==="driver-error"?n.error:void 0}async function Zt(e,n){return((await c({config:e,document:eo,variables:{runIds:[n]}})).startRunsBatch??[]).some(t=>t.id===n)}var eo=Gt(`
200
- mutation StartRunsBatch($runIds: [String!]!) {
201
- startRunsBatch(runIds: $runIds) {
202
- id
203
- }
204
- }
205
- `);import{randomUUID as no}from"crypto";async function ro({assign:e,config:n,debugDir:r,devSessionId:t,fixturesDir:o,headed:i,lockfile:a,report:s,session:d,signal:u}){let l=Ie(a);if(e.stepRuns.length===0)return{kind:"error",reason:"empty-trail"};let f=fo(l,e.stepRuns),y=await Ue({baseState:{name:k(e.baseStateTest),test:e.baseStateTest},corpus:l,lockfile:a,options:B({config:n,fixturesDir:o,headed:i}),seenSignature:s?P=>K(n,P,e.lockfileHash):void 0,session:d,stepRuns:e.stepRuns,runIdFor:P=>`explore-${no()}-${String(P)}`},u),m=s?await lo({baseStateTest:e.baseStateTest,config:n,debugDir:r,devSessionId:t,lockfileHash:e.lockfileHash,outcome:y,reproJson:ao(l,e),stepSources:so(f)}):!1;return io(y,f.length),yo(y,m,to(f,e,y))}function to(e,n,r){if(r.kind==="error"||r.kind==="aborted")return;let t=r.timing.confirm;return{baseLabel:n.baseStateTest.intent,baseState:k(n.baseStateTest),durationMs:Math.round(Q(r.timing.detect)+(t==null?0:Q(t))),signature:r.kind==="finding"||r.kind==="seen"?r.signature:void 0,steps:oo(e.slice(0,r.ranCount))}}function oo(e){return e.flatMap(n=>{let r=n.label.split("#")[0]??n.label;return n.actions.map(t=>({test:r,text:t}))})}function Q(e){return e.engineMs+e.worldMs+e.browserMs+e.driveMs+e.teardownMs}function io(e,n){if(e.kind==="error"){p.info({detail:M(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 r=e.timing.detect,t=e.timing.confirm;p.info({browserMs:r.browserMs,confirmMs:t==null?void 0:Q(t),detectMs:Q(r),driveMs:r.driveMs,engineMs:r.engineMs,kind:e.kind,steps:n,teardownMs:r.teardownMs,worldMs:r.worldMs},"explore trail")}function ao(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:k(n.baseStateTest),steps:r};return JSON.stringify(t)}function so(e){return e.flatMap(n=>{let r=n.label.split("#")[0]??n.label;return n.actions.map(()=>r)})}async function lo({baseStateTest:e,config:n,debugDir:r,devSessionId:t,lockfileHash:o,outcome:i,reproJson:a,stepSources:s}){return i.kind!=="finding"||i.captureEvents.length===0?!1:await K(n,i.signature,o)?(p.info({devSessionId:t,signature:i.signature},"explore finding already reported, skipping duplicate"),!1):(await ue({baseState:i.baseState,category:uo(i.verifierLayer),config:n,debugDir:r,devSessionId:t,events:i.captureEvents,lockfileHash:o,reproJson:a,runId:i.runId,signature:i.signature,spec:po(e,i.captureEvents),stepSources:s,summary:co(i.captureEvents,i.title),workflowSlug:i.sourceTest?.split("/")[0]}).catch(d=>{p.warn({error:d},"explore finding report failed")}),!0)}function uo(e){return e==="data-rule"?"dataRule":e==="model-drift"?"modelDrift":e}function co(e,n){let r=e.flatMap(t=>t.kind==="step"?[...t.findings]:[]).at(0);if(r!=null)return Me(r);if(n!=null)return n;throw new Error("explore finding has no findings to summarize")}function po(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 fo(e,n){return n.flatMap(r=>{let t=e[r.idx];return t==null?[]:[{actions:[...t.nav,...t.steps].map(o=>Fe(o.action)),label:`${t.test}#${String(t.index)}`}]})}function yo(e,n,r){return e.kind==="error"?{kind:e.kind,reason:`runtime:${e.error.kind}`}:e.kind==="finding"?{kind:e.kind,runId:n?e.runId:void 0,trail:r}:{kind:e.kind,trail:r}}import mo from"path";import{randomUUID as go}from"crypto";async function ts({cwd:e,onReady:n,signal:r,step:t,target:o}){let i=j(e).match(f=>({config:f}),f=>({failure:f}));if("failure"in i)return{failure:i.failure,kind:"config-failed"};let a=i.config,s=await Se(e);if(s.result.isErr())return{error:s.result.error,kind:"compile-failed"};let d=await F(e,s.result.value),u=await Ro(d,o);return u.kind!=="ok"?u:(await Oe({lockfile:d,onReady:n,options:ko(a),runId:`teleport-${go()}`,sequence:u.sequence,stopAfterStep:t,test:u.test},r)).match(f=>({kind:"done",result:f}),f=>({error:f,kind:"run-failed"}))}async function Ro(e,n){if(n.kind==="explore"){let t=await $(e,n.repro);return t.kind==="unplannable"?{kind:"unplannable"}:{kind:"ok",sequence:t.sequence,test:t.baseTest}}let r=I(e).find(t=>t.ref===n.ref);return r==null?{kind:"no-test",ref:n.ref}:{kind:"ok",sequence:De(e,r.test,void 0),test:r.test}}function ko(e){return{baseUrl:e.appUrl,engineUrl:e.engineUrl,fixturesDir:mo.join(e.cwd,ke),generate:C,headed:!0,secret:e.webhookSecret}}import{graphql as xo}from"gql.tada";import{err as z,ok as Bn}from"neverthrow";import ho,{AbortError as So}from"p-retry";import{graphql as _n}from"gql.tada";var vo=_n(`
206
- query AwaitDevSession($projectId: String!, $cwd: String!) {
207
- project(id: $projectId) {
208
- devSession(cwd: $cwd) {
209
- id
210
- executor
211
- }
212
- }
213
- }
214
- `);async function Hn(e){return ho(async()=>{let t=(await c({config:e,document:vo,variables:{cwd:e.cwd,projectId:e.projectId}})).project?.devSession;if(t!=null)return{executor:t.executor,id:t.id,kind:"active"};throw O(e.cwd)?new Error("starting"):new So("missing")},{factor:1,maxTimeout:400,minTimeout:400,retries:25}).catch(()=>O(e.cwd)?{kind:"starting"}:{kind:"missing"})}var wo=_n(`
215
- query DevSessionCheckHealth($projectId: String!, $cwd: String!) {
216
- activeDevSessions(projectId: $projectId) {
217
- id
218
- cwd
219
- branch
220
- }
221
- project(id: $projectId) {
222
- id
223
- devSession(cwd: $cwd) {
224
- id
225
- }
226
- }
227
- }
228
- `);function cs(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:",...bo(e.elsewhere)].join(`
229
- `)}}}async function ps(e){let n=O(e),r=Ne(e),t=j(e).unwrapOr(void 0);if(t==null)return{elsewhere:[],gitMidOperation:r,status:n?"starting":"missing",type:"dev-session"};let o=await c({config:t,document:wo,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(s=>s.cwd!==t.cwd).map(s=>({branch:s.branch,cwd:s.cwd})),gitMidOperation:r,status:n?"starting":"missing",type:"dev-session"}}function bo(e){return e.map(n=>{let r=n.branch==null?"":` (${n.branch})`;return` - ${n.cwd}${r}`})}var Eo=xo(`
230
- mutation SetDevSessionExecutor($devSessionId: String!, $executor: RunExecutor!) {
231
- setDevSessionExecutor(devSessionId: $devSessionId, executor: $executor) {
232
- __typename
233
- ... on DevSession {
234
- id
235
- executor
236
- }
237
- ... on DevSessionEndedError {
238
- message
239
- }
240
- }
241
- }
242
- `);async function ks(e){return(await Vn(e)).map(r=>r.executor)}async function hs(e,n){let r=await Vn(e);if(r.isErr())return z(r.error);let o=(await c({config:e,document:Eo,variables:{devSessionId:r.value.id,executor:n}})).setDevSessionExecutor;return o==null?z({kind:"empty-response"}):o.__typename!=="DevSession"?z({kind:"session-ended"}):Bn(o.executor)}async function Vn(e){let n=await Hn(e);return n.kind==="active"?Bn({executor:n.executor,id:n.id}):z({kind:n.kind==="starting"?"starting":"no-session"})}export{Hn as a,cs as b,ps as c,Oi as d,Di as e,Ui as f,qi as g,Vi as h,Ji as i,Qi as j,zi as k,Gi as l,Yi as m,Xi as n,Zi as o,ea as p,na as q,ra as r,Xe as s,jo as t,Oo as u,Z as v,Do as w,Ii as x,Tr as y,Pi as z,H as A,Rt as B,pe as C,Yt as D,Nt as E,Wt as F,Lt as G,ro as H,ts as I,ks as J,hs as K};
@@ -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 p,c as t}from"./chunk-S7GMY5LS.js";import{c as s}from"./chunk-CJUKILIO.js";function l(){let o=process.cwd(),e=s(o);e!=null&&e!==o&&(process.chdir(e),process.stderr.write(`ripplo: resolved .ripplo/ at ${e}
5
- `))}var d={"exit-plan-gate":()=>import("./exit-plan-gate-TTJ7U2AP.js").then(o=>o.exitPlanGateHook),"plan-reminder":()=>import("./plan-reminder-Q4A5WM2G.js").then(o=>t("UserPromptSubmit",o.planReminder)),"post-edit":()=>import("./post-edit-PMSJ6CLE.js").then(o=>o.postEditHook),"post-edit-analyze":()=>import("./post-edit-analyze-2AJVDFTK.js").then(o=>t("PostToolUse",o.postEditAnalyze)),"post-edit-flag-stubs":()=>import("./post-edit-flag-stubs-ORFV452V.js").then(o=>t("PostToolUse",o.postEditFlagStubs)),"pre-bash-run-gate":()=>import("./pre-bash-run-gate-C73XUNRE.js").then(o=>o.preBashRunGateHook),"pre-edit":()=>import("./pre-edit-H6ZOQSXF.js").then(o=>o.preEditHook),"pre-edit-ripplo-skill-gate":()=>import("./pre-edit-ripplo-skill-gate-63HGCUPG.js").then(o=>t("PreToolUse",o.preEditRipploSkillGate)),"pre-edit-scope-gate":()=>import("./pre-edit-scope-gate-WIORRC2B.js").then(o=>t("PreToolUse",o.preEditScopeGate)),"pre-edit-watch-gate":()=>import("./pre-edit-watch-gate-3VSMTCE4.js").then(o=>t("PreToolUse",o.preEditWatchGate)),"prompt-submit":()=>import("./prompt-submit-PSXSUTY3.js").then(o=>o.promptSubmitHook),"scope-reminder":()=>import("./scope-reminder-TGDQCKLN.js").then(o=>t("UserPromptSubmit",o.scopeReminder)),"session-preamble":()=>import("./session-preamble-HNQKBR27.js").then(o=>o.sessionPreambleHook),"stop-enforce":()=>import("./stop-enforce-I27VU4IR.js").then(o=>o.stopEnforceHook),"tasks-reminder":()=>import("./tasks-reminder-A4AIFNQJ.js").then(o=>t("UserPromptSubmit",o.tasksReminder)),"tasks-reminder-tool":()=>Promise.resolve(t("PostToolUse",()=>{})),"track-skill-load":()=>import("./track-skill-load-3IPC45UX.js").then(o=>o.trackSkillLoadHook),"track-skill-prompt":()=>import("./track-skill-prompt-YSB6OOQN.js").then(o=>t("UserPromptSubmit",o.trackSkillPrompt))},n=d;async function P(o){let e=n[o];e==null&&(process.stderr.write(`Unknown hook: ${o}
6
- `),process.exit(1));let i=await m(),r=await p(await e(),i);if(r.kind==="crash"){let{renderHookCrash:a}=await import("./cli-error-J7LD2VWZ.js");process.stderr.write(`${a(o,r.error)}
7
- `),process.exit(0)}r.stdout!=null&&process.stdout.write(r.stdout)}function m(){return new Promise((o,e)=>{if(process.stdin.isTTY){o("");return}let i=[];process.stdin.on("data",r=>i.push(r)),process.stdin.on("end",()=>{o(Buffer.concat(i).toString("utf8"))}),process.stdin.on("error",e)})}export{l as a,n as b,P as c};
@@ -1,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 l,e as i,h as L}from"./chunk-KSNZWWHX.js";import{k as g,n as y,o as C,p as P}from"./chunk-ZH3HY7BS.js";import{A as u,B as c,H as n,I as m,V as k,Z as v,_ as S}from"./chunk-OAXYJKXD.js";import{readFile as M,writeFile as I}from"fs/promises";import h from"path";import E from"safe-stable-stringify";import{createHash as w}from"crypto";import s from"fs";import p from"path";import H from"safe-stable-stringify";import{z as d}from"zod";function x({context:e,cwd:t}){k(e);let o=T(t,f(e));o!=null&&v(e,o)}function $({context:e,cwd:t}){let o=J(t);if(!(o==null||o.model!==f(e)))return o.cleanLockfile??void 0}function ee({cleanLockfileHash:e,context:t,cwd:o}){let r=b(o);s.mkdirSync(p.dirname(r),{recursive:!0}),s.writeFileSync(r,JSON.stringify({cleanLockfile:e,model:f(t)}))}function te(e){return w("sha256").update(e).digest("base64")}var R=d.object({cleanLockfile:d.string().nullable(),model:d.string()});function T(e,t){let o=p.join(e,i);if(!s.existsSync(o)||l(o))return null;let r=V(o);return r==null?null:f({entities:r.entities,singletonSchemas:r.singletons,valueSpaces:r.valueSpaces})===t?r.solved:null}function V(e){try{return c(n,s.readFileSync(e,"utf8"))}catch{return null}}function f(e){let t=H({entities:e.entities,singletons:e.singletonSchemas,valueSpaces:e.valueSpaces});if(t==null)throw new Error("solve-cache: context is not serializable");return w("sha256").update(t).digest("base64")}function J(e){let t=b(e);if(!(!s.existsSync(t)||l(t)))try{let o=R.safeParse(JSON.parse(s.readFileSync(t,"utf8")));return o.success?o.data:void 0}catch{return}}function b(e){return p.join(e,".ripplo",".local","solve-cache.json")}async function me(e){let t=await L(e);return t.isOk()&&await N(e,t.value),t}async function N(e,t){let o=await _(e,t);return await I(h.join(e,i),u(n,o)),o}var F=new WeakMap;function _(e,t){let o=F.get(t);if(o!=null)return o;let r=z(e,t).then(a=>a??D(e,t));return F.set(t,r),r}function de(e){return e.workflows.filter(t=>t.stub).map(t=>t.name)}async function z(e,t){if(l(h.join(e,i)))return null;let o=await W(e);return o?.checks==null?null:E(O(o))===E(O(t))?m(o):null}async function W(e){try{let t=await M(h.join(e,i),"utf8");return c(n,t)}catch{return null}}function O(e){return{...e,checks:void 0,solved:{cosat:{},subsume:{}}}}async function D(e,t){let o=g(t);x({context:o,cwd:e});let r=await C(t),a=await y(t);await P({context:o,facts:a.facts});let j=await S(o),A={...t,checks:r,solved:j};return m(c(n,u(n,A)))}export{x as a,$ as b,ee as c,te as d,me as e,N as f,_ as g,de as h};