ripplo 0.8.0 → 0.8.1

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 (78) hide show
  1. package/dist/chunk-3SCOYB4C.js +16 -0
  2. package/dist/chunk-42LZFMNX.js +4 -0
  3. package/dist/chunk-4AGLYPJ5.js +23 -0
  4. package/dist/chunk-4DXOF4WS.js +55 -0
  5. package/dist/chunk-7WZ3VIUU.js +4 -0
  6. package/dist/chunk-7YPITJA2.js +8 -0
  7. package/dist/chunk-CDPYJKK7.js +9 -0
  8. package/dist/chunk-CJUKILIO.js +4 -0
  9. package/dist/chunk-CLFA4JSB.js +4 -0
  10. package/dist/chunk-EXV2RD7Z.js +6 -0
  11. package/dist/chunk-FCEWYZLQ.js +4 -0
  12. package/dist/chunk-FEHVIHVA.js +5 -0
  13. package/dist/chunk-FZIMQTFG.js +4 -0
  14. package/dist/chunk-G22LPS47.js +4 -0
  15. package/dist/chunk-G7ZQUZ2X.js +242 -0
  16. package/dist/chunk-GD2AESFG.js +5 -0
  17. package/dist/chunk-HGL5SE75.js +4 -0
  18. package/dist/chunk-HYHAOKYP.js +7 -0
  19. package/dist/chunk-IW2P4NKR.js +4 -0
  20. package/dist/chunk-JJ4QQPAV.js +4 -0
  21. package/dist/chunk-KSNZWWHX.js +6 -0
  22. package/dist/chunk-LB2L72ZU.js +48 -0
  23. package/dist/chunk-LB65USNP.js +73 -0
  24. package/dist/chunk-MHNGR6M7.js +4 -0
  25. package/dist/chunk-MOI4L3EX.js +4 -0
  26. package/dist/chunk-NWWET7CM.js +11 -0
  27. package/dist/{chunk-SAYJ5AQK.js → chunk-OAXYJKXD.js} +19 -19
  28. package/dist/chunk-OQ6KNYPG.js +4 -0
  29. package/dist/chunk-OWN4P2K7.js +4 -0
  30. package/dist/chunk-PBL3TBB7.js +6 -0
  31. package/dist/chunk-R4ZTRVDQ.js +4 -0
  32. package/dist/chunk-S7GMY5LS.js +6 -0
  33. package/dist/chunk-TEP6ETHQ.js +7 -0
  34. package/dist/chunk-TPTG6RR4.js +8 -0
  35. package/dist/chunk-U4LC56T3.js +4 -0
  36. package/dist/chunk-VETETUHZ.js +8 -0
  37. package/dist/chunk-VYQ5CDRX.js +9 -0
  38. package/dist/chunk-WK7VO5JE.js +23 -0
  39. package/dist/chunk-WNAVYV4P.js +4 -0
  40. package/dist/{chunk-D6FZ55DP.js → chunk-WOHPPHUD.js} +1 -1
  41. package/dist/chunk-XGMM2RKR.js +5 -0
  42. package/dist/chunk-ZH3HY7BS.js +83 -0
  43. package/dist/cli-error-J7LD2VWZ.js +4 -0
  44. package/dist/compile-write-OKTXD7JL.js +4 -0
  45. package/dist/daemon-JJ6MZPIA.js +4 -0
  46. package/dist/{daemon-MBF7JVEN.js → daemon-O2VR45XP.js} +2 -2
  47. package/dist/daemon-lock-FLZHWM2F.js +4 -0
  48. package/dist/dsl-loader-IOQUYVQH.js +4 -0
  49. package/dist/exit-plan-gate-TTJ7U2AP.js +4 -0
  50. package/dist/hook.js +5 -0
  51. package/dist/index.js +202 -405
  52. package/dist/plan-reminder-Q4A5WM2G.js +4 -0
  53. package/dist/post-edit-PMSJ6CLE.js +4 -0
  54. package/dist/post-edit-analyze-2AJVDFTK.js +4 -0
  55. package/dist/post-edit-flag-stubs-ORFV452V.js +4 -0
  56. package/dist/pre-bash-run-gate-C73XUNRE.js +4 -0
  57. package/dist/pre-edit-H6ZOQSXF.js +4 -0
  58. package/dist/pre-edit-ripplo-skill-gate-63HGCUPG.js +4 -0
  59. package/dist/pre-edit-scope-gate-WIORRC2B.js +4 -0
  60. package/dist/pre-edit-watch-gate-3VSMTCE4.js +4 -0
  61. package/dist/prompt-submit-PSXSUTY3.js +4 -0
  62. package/dist/scope-reminder-TGDQCKLN.js +4 -0
  63. package/dist/session-preamble-HNQKBR27.js +4 -0
  64. package/dist/solve-worker.js +1 -1
  65. package/dist/status-QBBCVTXV.js +4 -0
  66. package/dist/stop-enforce-I27VU4IR.js +64 -0
  67. package/dist/tasks-reminder-A4AIFNQJ.js +4 -0
  68. package/dist/track-skill-load-3IPC45UX.js +4 -0
  69. package/dist/track-skill-prompt-YSB6OOQN.js +4 -0
  70. package/package.json +2 -2
  71. package/dist/chunk-E4AOUQQ7.js +0 -10
  72. package/dist/chunk-GOFUUPKD.js +0 -8
  73. package/dist/chunk-NIKFQP6W.js +0 -301
  74. package/dist/chunk-THHZNLXN.js +0 -48
  75. package/dist/chunk-VGYX2VAS.js +0 -85
  76. package/dist/daemon-VIHSG5KP.js +0 -4
  77. package/dist/daemon-lock-HIZ6UWXO.js +0 -4
  78. package/dist/status-G5OG62JI.js +0 -4
@@ -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-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};
@@ -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-TPTG6RR4.js";import"./chunk-XGMM2RKR.js";import{a as e}from"./chunk-U4LC56T3.js";import"./chunk-PBL3TBB7.js";import"./chunk-JJ4QQPAV.js";import"./chunk-MOI4L3EX.js";import"./chunk-TEP6ETHQ.js";import"./chunk-OQ6KNYPG.js";import"./chunk-4DXOF4WS.js";import"./chunk-42LZFMNX.js";import"./chunk-7WZ3VIUU.js";import"./chunk-HGL5SE75.js";import"./chunk-FEHVIHVA.js";import{b as o}from"./chunk-S7GMY5LS.js";import"./chunk-7YPITJA2.js";import"./chunk-MHNGR6M7.js";import"./chunk-IW2P4NKR.js";import"./chunk-KSNZWWHX.js";import"./chunk-WOHPPHUD.js";import"./chunk-LB2L72ZU.js";import"./chunk-CJUKILIO.js";import"./chunk-ZH3HY7BS.js";import"./chunk-OAXYJKXD.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-TPTG6RR4.js";import"./chunk-XGMM2RKR.js";import"./chunk-MOI4L3EX.js";import"./chunk-TEP6ETHQ.js";import"./chunk-OQ6KNYPG.js";import"./chunk-4DXOF4WS.js";import"./chunk-42LZFMNX.js";import"./chunk-7WZ3VIUU.js";import"./chunk-HGL5SE75.js";import"./chunk-FEHVIHVA.js";import"./chunk-7YPITJA2.js";import"./chunk-MHNGR6M7.js";import"./chunk-IW2P4NKR.js";import"./chunk-KSNZWWHX.js";import"./chunk-WOHPPHUD.js";import"./chunk-LB2L72ZU.js";import"./chunk-CJUKILIO.js";import"./chunk-ZH3HY7BS.js";import"./chunk-OAXYJKXD.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-U4LC56T3.js";import"./chunk-PBL3TBB7.js";import"./chunk-JJ4QQPAV.js";import"./chunk-7WZ3VIUU.js";import"./chunk-HGL5SE75.js";import"./chunk-IW2P4NKR.js";import"./chunk-KSNZWWHX.js";import"./chunk-WOHPPHUD.js";import"./chunk-LB2L72ZU.js";import"./chunk-CJUKILIO.js";import"./chunk-ZH3HY7BS.js";import"./chunk-OAXYJKXD.js";import"./chunk-NNH3YVVO.js";import"./chunk-KMZ3L5YA.js";export{a as postEditFlagStubs};
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __ripploCreateRequire } from "node:module";
3
+ const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
4
+ import{b as h}from"./chunk-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};
@@ -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-G22LPS47.js";import{a as t}from"./chunk-CLFA4JSB.js";import{a as i}from"./chunk-3SCOYB4C.js";import"./chunk-JJ4QQPAV.js";import"./chunk-OWN4P2K7.js";import"./chunk-42LZFMNX.js";import"./chunk-7WZ3VIUU.js";import"./chunk-HGL5SE75.js";import"./chunk-FEHVIHVA.js";import{b as o}from"./chunk-S7GMY5LS.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";var d=o({event:"PreToolUse",handlers:[e,t,i],note:r=>({hookSpecificOutput:{additionalContext:r,hookEventName:"PreToolUse"}})});export{d as preEditHook};
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __ripploCreateRequire } from "node:module";
3
+ const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
4
+ import{a}from"./chunk-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};
@@ -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-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};
@@ -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-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};
@@ -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-4AGLYPJ5.js";import{a as r}from"./chunk-WNAVYV4P.js";import"./chunk-LB65USNP.js";import{a as i}from"./chunk-WK7VO5JE.js";import{a as t}from"./chunk-GD2AESFG.js";import"./chunk-XGMM2RKR.js";import"./chunk-PBL3TBB7.js";import"./chunk-JJ4QQPAV.js";import"./chunk-OWN4P2K7.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{b as o}from"./chunk-S7GMY5LS.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";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-4AGLYPJ5.js";import"./chunk-XGMM2RKR.js";import"./chunk-PBL3TBB7.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 scopeReminder};
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __ripploCreateRequire } from "node:module";
3
+ const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
4
+ import{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};
@@ -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-SAYJ5AQK.js";import"./chunk-KMZ3L5YA.js";r();
4
+ import{Y as r}from"./chunk-OAXYJKXD.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-VETETUHZ.js";import"./chunk-FCEWYZLQ.js";import"./chunk-FZIMQTFG.js";import"./chunk-R4ZTRVDQ.js";import"./chunk-7YPITJA2.js";import"./chunk-MHNGR6M7.js";import"./chunk-IW2P4NKR.js";import"./chunk-KSNZWWHX.js";import"./chunk-LB2L72ZU.js";import"./chunk-CJUKILIO.js";import"./chunk-EXV2RD7Z.js";import"./chunk-ZH3HY7BS.js";import"./chunk-OAXYJKXD.js";import"./chunk-NNH3YVVO.js";import"./chunk-KMZ3L5YA.js";export{a as statusCommand};
@@ -0,0 +1,64 @@
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 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) ---
5
+ ${n.join(`
6
+ `)}
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(`
8
+ `)}function M(n){return["--- Ripplo Run Rejected (server declined) ---",...n,"Not transient \u2014 retrying won't clear it. Resolve the stated cause (plan limit, missing test, repo link)."].join(`
9
+ `)}function B(n){return["--- Open Tasks ---",...n,"Clear each: `npx ripplo tasks resolve <id> --run <runId>`, `clarify <id> <what you need>`, or `dismiss <id>`. Inspect with `tasks show <id>`."].join(`
10
+ `)}function f(n){return`--- Ripplo Run Could Not Execute ---
11
+ ${n}
12
+ Fix the run environment (\`npx ripplo doctor\`) and re-run. ${c("start")}`}var Q=W(`
13
+ query ScopeEnforce($projectId: String!, $cwd: String!) {
14
+ project(id: $projectId) {
15
+ id
16
+ devSession(cwd: $cwd) {
17
+ id
18
+ scopeItems {
19
+ id
20
+ label
21
+ workflow {
22
+ id
23
+ slug
24
+ name
25
+ spec
26
+ }
27
+ }
28
+ }
29
+ }
30
+ }
31
+ `),z=W(`
32
+ query OpenTasks($projectId: String!, $cwd: String!) {
33
+ project(id: $projectId) {
34
+ id
35
+ devSession(cwd: $cwd) {
36
+ id
37
+ tasks(status: open) {
38
+ id
39
+ kind
40
+ title
41
+ messages {
42
+ body
43
+ }
44
+ }
45
+ }
46
+ }
47
+ }
48
+ `),Ie=D("Stop",async n=>{let{cwd:e}=n;if(!b(e)||!C(e)||n.stop_hook_active)return;let r=await ne(e),t=O(e),o=H(e,"stop-enforce")===t?Y:await G(e);q(e,"stop-enforce",t);let i=[...r==null?[]:[r],...o.errors];if(i.length!==0)return{decision:"block",reason:i.join(`
49
+
50
+ `)}}),Y={errors:[]};async function G(n){let e=await E(n);if(e.isErr())return{errors:[`--- Compilation failed ---
51
+ ${w(e.error)}
52
+ ${c("create")}`]};let r=e.value,t=await Z(n,r),s=await K({cwd:n,lockfile:r}),o=X(r),i=t.runnableSlugs.length>0?await re(n):null;return{errors:[s,o,i?.error??null,t.error].filter(d=>d!=null)}}async function K({cwd:n,lockfile:e}){let r=await S({cwd:n,lockfile:e});return await j(n,e),r.length===0?null:`--- Ripplo model analysis ---
53
+ ${v(r)}
54
+ ${c("create")}`}function X(n){let e=y(n);return e.length===0?null:`--- Unimplemented stubs ---
55
+ ${e.join(", ")}
56
+ Implement the stub now with \`workflow("Intent", () => ({ given, steps }))\`. Do not ask the user "implement or defer?" \u2014 that framing is forbidden by /ripplo:create. New scaffolding (entity, world, engine impl) is in-scope, not follow-up.
57
+ ${c("create")}`}async function Z(n,e){let r=new Set(y(e).map(a=>g(a))),t=new Set(e.workflows.map(a=>g(a.name))),s=(a,p)=>t.has(a)?r.has(a):ee(p),o=k(n).unwrapOr(void 0);if(o==null)return{error:`--- Testing Scope (not checked) ---
58
+ No project config \u2014 \`npx ripplo init\` hasn't run here, so scope/stub done-checks are not enforcing. ${c("setup")}`,runnableSlugs:[]};let i=await m({config:o,document:Q,variables:{cwd:o.cwd,projectId:o.projectId}}).catch(()=>null);if(i==null)return{error:`--- Testing Scope (not checked) ---
59
+ Ripplo server unreachable \u2014 scope/stub done-checks are not enforcing. Verify the dev session is live (\`npx ripplo doctor\`, ${c("start")}) before declaring work done.`,runnableSlugs:[]};let l=i.project?.devSession?.scopeItems??[],d=l.flatMap(a=>{let p=a.workflow;return p==null?[` [intent] ${a.label??"(no label)"} \u2014 write a test for this flow`]:s(p.slug,p.spec)?[` [stub] ${p.slug} \u2014 implement \`${p.name}\``]:[]}),u=l.flatMap(a=>a.workflow!=null&&!s(a.workflow.slug,a.workflow.spec)?[a.workflow.slug]:[]);return{error:d.length===0?null:`--- Testing Scope ---
60
+ ${d.join(`
61
+ `)}
62
+ ${c("create")}`,runnableSlugs:u}}function ee(n){return typeof n=="object"&&n!=null&&Reflect.get(n,"stub")===!0}async function ne(n){let e=k(n).unwrapOr(void 0);if(e==null)return null;let r=await m({config:e,document:z,variables:{cwd:e.cwd,projectId:e.projectId}}).catch(()=>null);if(r==null)return null;let s=(r.project?.devSession?.tasks??[]).map(o=>{let i=o.title??o.messages?.[0]?.body??"(no description)";return` [${o.kind}] (${o.id}) ${i}`});return s.length===0?null:B(s)}async function re(n){let e=U.argv[1];if(e==null)return{error:f("CLI entry missing (process.argv[1])"),infra:!1};let r=await L(n);if(r!=null){let o=x(r);return A(r.serverUrl)?{error:f(o),infra:!1}:{error:R({lines:[o],retried:!1}),infra:!0}}let t=await $({cliEntry:e,cwd:n});if(t.isErr())return{error:f(h(t.error)),infra:!1};let s=t.value;try{return await te({connection:s,cwd:n})}finally{s.spawned&&await I(s),s.socket.destroy()}}async function te({connection:n,cwd:e}){let r=await V({connection:n,cwd:e,tests:[]});if(r.kind==="transport")return{error:f(r.message),infra:!1};let t=r.notRun.length>0?await V({connection:n,cwd:e,tests:r.notRun.map(d=>d.id)}):null,s=t==null||t.kind==="transport"?r.notRun:t.notRun,o=t!=null&&t.kind==="done",i=[...r.failedLines,...o?t.failedLines:[]],l=[...r.rejected,...o?t.rejected:[]];return oe({failedLines:i,notRun:s,rejected:l,retried:t!=null})}function oe({failedLines:n,notRun:e,rejected:r,retried:t}){if(n.length===0&&e.length===0&&r.length===0)return{error:null,infra:!1};let s=n.length>0?F(n):null,o=r.length>0?M(r):null,i=e.length>0?R({lines:e.map(l=>l.line),retried:t}):null;return{error:[s,o,i].filter(l=>l!=null).join(`
63
+
64
+ `),infra:s==null}}async function V({connection:n,cwd:e,tests:r}){let t=[],s=[],o=[],i=J.join(e,".ripplo","debug"),l=new _;return(await P({connection:n,request:{all:!1,headed:!1,tests:[...r]},token:l.token,onEvent:u=>{se({debugDir:i,event:u,failedLines:t,notRun:s,rejected:o})}})).match(u=>u.kind==="daemon-error"?{kind:"transport",message:T(u.error)}:{failedLines:t,kind:"done",notRun:s,rejected:o},u=>({kind:"transport",message:h(u)}))}function se({debugDir:n,event:e,failedLines:r,notRun:t,rejected:s}){if(e.kind!=="test-outcome"||e.outcome.kind==="pass")return;let o=N({debugDir:n,event:e})??e.testName;if(e.outcome.kind==="dispatch-error"){s.push(o);return}if(e.outcome.kind==="dispatch-timeout"||e.outcome.kind==="infra-error"){t.push({id:`${e.workflowName}/${e.testName}`,line:o});return}r.push(o)}export{Ie as stopEnforceHook};
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __ripploCreateRequire } from "node:module";
3
+ const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
4
+ import{a}from"./chunk-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};
@@ -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-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};
@@ -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-WNAVYV4P.js";import"./chunk-LB65USNP.js";import"./chunk-OWN4P2K7.js";import"./chunk-7WZ3VIUU.js";import"./chunk-KMZ3L5YA.js";export{a as trackSkillPrompt};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ripplo",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "description": "CLI for Ripplo — AI-powered end-to-end testing",
5
5
  "type": "module",
6
6
  "homepage": "https://ripplo.ai",
@@ -67,9 +67,9 @@
67
67
  "eslint-plugin-neverthrow": "^1.1.4",
68
68
  "tsup": "^8.5.1",
69
69
  "vitest": "^4.1.4",
70
- "@ripplo/core": "^0.0.0",
71
70
  "@ripplo/eslint-config": "0.0.0",
72
71
  "@ripplo/graphql": "^0.0.0",
72
+ "@ripplo/core": "^0.0.0",
73
73
  "@ripplo/rrweb-bundle": "0.0.0",
74
74
  "@ripplo/run-report": "0.0.0",
75
75
  "@ripplo/runtime": "^0.0.0",
@@ -1,10 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire as __ripploCreateRequire } from "node:module";
3
- const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
4
- import{j as F}from"./chunk-THHZNLXN.js";import{k as G,n as Y,o as Q,p as Z}from"./chunk-VGYX2VAS.js";import{A as L,B as u,G as q,H as a,I as T,U as X,V,Z as B,_ as K}from"./chunk-SAYJ5AQK.js";import{readFileSync as Ee}from"fs";import{z as ee}from"zod";var ve=ee.object({version:ee.string()});function Tt(){let e=Ee(new URL("../package.json",import.meta.url),"utf8");return ve.parse(JSON.parse(e)).version}import m from"fs";import p from"path";import{createHash as We}from"crypto";import{pathToFileURL as qe}from"url";import{build as Xe}from"esbuild";import{err as v,ok as z,ResultAsync as Ve}from"neverthrow";import Re from"fs";import b from"path";import y from"typescript";function te(e){let t=b.join(e,"index.ts"),r=Ce(e);Re.mkdirSync(b.dirname(r.tsBuildInfoFile??""),{recursive:!0});let o=y.createIncrementalCompilerHost(r),i=y.createIncrementalProgram({host:o,options:r,rootNames:[t]}),s=[...i.getSyntacticDiagnostics(),...i.getSemanticDiagnostics()];i.emit();let l=s.filter(d=>Pe(d,e));if(l.length===0)return{diagnostics:[],ok:!0};let W={getCanonicalFileName:d=>d,getCurrentDirectory:()=>b.dirname(e),getNewLine:()=>`
5
- `};return{diagnostics:y.formatDiagnosticsWithColorAndContext(l,W).split(`
6
- `).filter(d=>d.length>0),ok:!1}}function Pe(e,t){let r=e.file?.fileName;return r==null?!0:r.startsWith(t)}var je=b.join(".local","tsbuildinfo");function Ce(e){return{allowImportingTsExtensions:!0,allowJs:!1,esModuleInterop:!0,incremental:!0,module:y.ModuleKind.Preserve,moduleResolution:y.ModuleResolutionKind.Bundler,noEmit:!0,resolveJsonModule:!0,skipLibCheck:!0,strict:!1,target:y.ScriptTarget.ES2022,tsBuildInfoFile:b.join(e,je)}}import w from"fs";import A from"safe-stable-stringify";import{err as Fe,ok as re,Result as Te}from"neverthrow";async function oe(e,t){let r={entities:e.entities,singletonSchemas:e.singletons,valueSpaces:e.valueSpaces},o=f(t)?void 0:Oe(t),i=Ie(e,o),s=await Promise.all(e.workflows.map(l=>Ae({context:r,reusable:i,workflow:l})));return Te.combine(s).map(l=>({...e,workflows:[...l]}))}function f(e){let t=process.argv[1];if(t==null||!w.existsSync(e))return!1;try{return w.statSync(t).mtimeMs>w.statSync(e).mtimeMs}catch{return!1}}async function Ae({context:e,reusable:t,workflow:r}){let o=t.get(ie(r));if(o!=null)return re({...r,tests:o.tests});try{return re(await X({context:e,workflow:r}))}catch(i){let s=i instanceof Error?i.message:String(i);return Fe({kind:"expand-failed",message:s,workflow:r.name})}}function ie(e){let t=A({...e,tests:[]});if(t==null)throw new Error("solver: workflow is not serializable");return t}function Ie(e,t){return t==null||A(ne(t))!==A(ne(e))?new Map:new Map(t.workflows.map(r=>[ie(r),r]))}function ne(e){return{entities:e.entities,singletons:e.singletons,valueSpaces:e.valueSpaces}}function Oe(e){if(w.existsSync(e))try{return u(a,w.readFileSync(e,"utf8"))}catch{return}}import{createHash as Me}from"crypto";import se from"fs/promises";import I from"path";import{err as h,ok as O,Result as $e}from"neverthrow";var _e=".ripplo/fixtures",M=10*1024*1024,$=50*1024*1024;async function ae(e,t){let r=Ne(t);if(r.length===0)return O({});let o=I.join(e,_e),i=await Promise.all(r.map(s=>ze({fixturesRoot:o,name:s})));return $e.combine(i).andThen(He)}function Ne(e){let r=e.workflows.flatMap(o=>[...o.steps,...o.tests.flatMap(i=>i.steps)]).flatMap(o=>o.action.kind==="upload"?o.action.files:[]);return[...new Set(r)].toSorted((o,i)=>o.localeCompare(i))}async function ze({fixturesRoot:e,name:t}){if(t.includes("..")||I.isAbsolute(t))return h({kind:"fixture-invalid-name",name:t});let r=I.join(e,t),o=await se.lstat(r).catch(()=>null);if(o==null)return h({kind:"fixture-missing",name:t,path:r});if(o.isSymbolicLink())return h({kind:"fixture-symlink",name:t});if(!o.isFile())return h({kind:"fixture-not-file",name:t});let i=await se.readFile(r);if(i.byteLength>M)return h({kind:"fixture-too-large",name:t,size:i.byteLength});let s=Me("sha256").update(i).digest("hex");return O([t,{sha256:s,size:i.byteLength}])}function He(e){let t=e.reduce((r,[,o])=>r+o.size,0);return t>$?h({kind:"fixtures-total-too-large",total:t}):O(Object.fromEntries(e))}import{createHash as Ue}from"crypto";import k from"fs";import N from"path";import{z as _}from"zod";function le({cwd:e,fingerprint:t}){let r=De(e);if(r==null||r.fingerprint!==R(t))return;let o=N.join(e,".ripplo","ripplo.lock");if(!k.existsSync(o))return;let i=k.readFileSync(o,"utf8");if(R(i)===r.lockfileHash)try{return u(a,i)}catch{return}}function ce({cwd:e,fingerprint:t,lockfile:r}){let o={fingerprint:R(t),lockfileHash:R(L(a,r))},i=de(e);k.mkdirSync(N.dirname(i),{recursive:!0}),k.writeFileSync(i,JSON.stringify(o))}var Je=_.object({fingerprint:_.string(),lockfileHash:_.string()});function De(e){let t=de(e);if(!(!k.existsSync(t)||f(t)))try{let r=Je.safeParse(JSON.parse(k.readFileSync(t,"utf8")));return r.success?r.data:void 0}catch{return}}function de(e){return N.join(e,".ripplo",".local","load-cache.json")}function R(e){return Ue("sha256").update(e).digest("base64")}var c=".ripplo/ripplo.lock",E;async function pr(e){let{result:t}=await Be(e);return t}async function Be(e){let t=ue(p.join(e,".ripplo"));if(E!=null&&E.fingerprint===t&&E.result.isOk())return{fingerprint:t,result:E.result};let r=await H(e);return E={fingerprint:t,result:r},{fingerprint:t,result:r}}async function H(e){let t=p.join(e,".ripplo"),r=p.join(t,"index.ts"),o=ue(t),i=le({cwd:e,fingerprint:o});if(i!=null)return z(i);let s=Ye(r);s.catch(()=>{});let l=te(t);if(!l.ok)return v({diagnostics:l.diagnostics,kind:"typecheck-failed"});let d=await(await Qe(r,s)).andThen(g=>tt({entryPath:r,exported:g})).match(async g=>(await ae(e,g)).map(S=>({...g,fixtures:S})).mapErr(S=>({error:S,kind:"fixture-failed"})).asyncAndThen(S=>new Ve(oe(S,p.join(e,c))).mapErr(we=>we)),g=>Promise.resolve(v(g)));return d.isOk()&&ce({cwd:e,fingerprint:o,lockfile:d.value}),d}var Ke=new Set([".local","debug","node_modules","ripplo.lock"]);function ue(e){let t=p.join(e,"..","node_modules","@ripplo","testing","package.json");return[...pe(e),...Ge(t)].toSorted((r,o)=>r.localeCompare(o)).join("|")}function pe(e){return(m.existsSync(e)?m.readdirSync(e,{withFileTypes:!0}):[]).flatMap(r=>{if(Ke.has(r.name))return[];let o=p.join(e,r.name);if(r.isDirectory())return pe(o);let i=m.statSync(o);return[`${o}:${String(i.mtimeMs)}:${String(i.size)}`]})}function Ge(e){if(!m.existsSync(e))return[];let t=m.statSync(e);return[`${e}:${String(t.mtimeMs)}:${String(t.size)}`]}async function Ye(e){let r=(await Xe({bundle:!0,entryPoints:[e],format:"esm",logLevel:"silent",platform:"node",sourcemap:"inline",target:"node22",write:!1})).outputFiles[0];if(r==null)throw new Error("dsl bundle produced no output");return r.text}async function Qe(e,t){try{let r=await t;process.setSourceMapsEnabled(!0);let o=await import(Ze(e,r)),i=o!=null&&typeof o=="object"&&"default"in o?Reflect.get(o,"default"):o;return z(i)}catch(r){return v({kind:"load-threw",message:et(r)})}}function Ze(e,t){let r=p.join(p.dirname(e),".local");m.mkdirSync(r,{recursive:!0});let o=We("sha256").update(t).digest("hex").slice(0,16),i=p.join(r,`dsl-bundle-${o}.mjs`);return m.writeFileSync(i,t),qe(i).href}function et(e){return e instanceof Error?e.message:String(e)}function tt({entryPath:e,exported:t}){if(t==null||typeof t!="object"||!("lockfile"in t))return v({entryPath:e,kind:"not-ripplo"});let r=q.safeParse(Reflect.get(t,"lockfile"));return r.success?z(r.data):v({issues:r.error.issues.map(o=>`${o.path.join(".")}: ${o.message}`),kind:"invalid-lockfile"})}function P(e,t){return t==null?`Load \`/ripplo:${e}\` skill for instructions.`:`Load \`/ripplo:${e}\` skill for instructions on ${t}.`}function mr(e){return e.length===1?P(e[0]):`Before proceeding, load the ${e.map(r=>`\`/ripplo:${r}\``).join(" and ")} skills \u2014 every one, each carries rules the others don't.`}function xr(e){return[`Compilation failed: ${rt(e)}`,P("create","DSL authoring rules")].join(`
7
- `)}function Sr(){return`${c} is up to date`}function Lr(e){return[`${c} is ${e==="missing"?"missing":"out of date"} \u2014 run \`npx ripplo compile\` and commit it`,P("setup")].join(`
8
- `)}function br(){return`Wrote ${c}`}function rt(e){switch(e.kind){case"typecheck-failed":return["TypeScript errors in .ripplo/:",...fe(e.diagnostics)].join(`
9
- `);case"not-ripplo":return`${e.entryPath} must default-export createRipplo({ entities, singletons, workflows }).`;case"invalid-lockfile":return["Lockfile failed schema validation (stale or hand-edited .ripplo/ripplo.lock):",...fe(e.issues),"Regenerate with `npx ripplo compile`."].join(`
10
- `);case"load-threw":return`.ripplo/index.ts threw while loading: ${e.message}`;case"fixture-failed":return nt(e.error);case"expand-failed":return`Could not resolve tests for workflow "${e.workflow}": ${e.message}`}}function fe(e,t=8){return e.length<=t?e:[...e.slice(0,t),`\u2026 and ${String(e.length-t)} more`]}function nt(e){switch(e.kind){case"fixture-missing":return`Fixture "${e.name}" not found at ${e.path}.`;case"fixture-invalid-name":return`Invalid fixture name "${e.name}" \u2014 bare name under .ripplo/fixtures/, no .. or absolute paths.`;case"fixture-symlink":return`Fixture "${e.name}" is a symlink \u2014 only regular files allowed.`;case"fixture-not-file":return`Fixture "${e.name}" is not a regular file.`;case"fixture-too-large":return`Fixture "${e.name}" is ${j(e.size)} \u2014 over the ${j(M)} per-file limit.`;case"fixtures-total-too-large":return`Fixtures total ${j(e.total)} \u2014 over the ${j($)} limit.`}}function j(e){return`${String(Math.round(e/(1024*1024)*10)/10)} MB`}import{readFile as ct,writeFile as dt}from"fs/promises";import D from"path";import he from"safe-stable-stringify";import{createHash as me}from"crypto";import x from"fs";import J from"path";import ot from"safe-stable-stringify";import{z as U}from"zod";function ge({context:e,cwd:t}){V(e);let r=st(t,C(e));r!=null&&B(e,r)}function Ir({context:e,cwd:t}){let r=lt(t);if(!(r==null||r.model!==C(e)))return r.cleanLockfile??void 0}function Or({cleanLockfileHash:e,context:t,cwd:r}){let o=ye(r);x.mkdirSync(J.dirname(o),{recursive:!0}),x.writeFileSync(o,JSON.stringify({cleanLockfile:e,model:C(t)}))}function Mr(e){return me("sha256").update(e).digest("base64")}var it=U.object({cleanLockfile:U.string().nullable(),model:U.string()});function st(e,t){let r=J.join(e,c);if(!x.existsSync(r)||f(r))return null;let o=at(r);return o==null?null:C({entities:o.entities,singletonSchemas:o.singletons,valueSpaces:o.valueSpaces})===t?o.solved:null}function at(e){try{return u(a,x.readFileSync(e,"utf8"))}catch{return null}}function C(e){let t=ot({entities:e.entities,singletons:e.singletonSchemas,valueSpaces:e.valueSpaces});if(t==null)throw new Error("solve-cache: context is not serializable");return me("sha256").update(t).digest("base64")}function lt(e){let t=ye(e);if(!(!x.existsSync(t)||f(t)))try{let r=it.safeParse(JSON.parse(x.readFileSync(t,"utf8")));return r.success?r.data:void 0}catch{return}}function ye(e){return J.join(e,".ripplo",".local","solve-cache.json")}async function Xr(e){let t=await H(e);return t.isOk()&&await ut(e,t.value),t}async function ut(e,t){let r=await pt(e,t);return await dt(D.join(e,c),L(a,r)),r}var ke=new WeakMap;function pt(e,t){let r=ke.get(t);if(r!=null)return r;let o=ft(e,t).then(i=>i??gt(e,t));return ke.set(t,o),o}function Vr(e){return e.workflows.filter(t=>t.stub).map(t=>t.name)}async function ft(e,t){if(f(D.join(e,c)))return null;let r=await mt(e);return r?.checks==null?null:he(xe(r))===he(xe(t))?T(r):null}async function mt(e){try{let t=await ct(D.join(e,c),"utf8");return u(a,t)}catch{return null}}function xe(e){return{...e,checks:void 0,solved:{cosat:{},subsume:{}}}}async function gt(e,t){let r=G(t);ge({context:r,cwd:e});let o=await Q(t),i=await Y(t);await Z({context:r,facts:i.facts});let s=await K(r),l={...t,checks:o,solved:s};return T(u(a,L(a,l)))}import{createMessageConnection as yt,NotificationType as Se,RequestType as ht,RequestType0 as Le,SocketMessageReader as kt,SocketMessageWriter as xt}from"vscode-jsonrpc/node";import{z as n}from"zod";var St="daemon.sock",Lt="daemon.log";function Qr(e){return F(e,St)}function Zr(e){return F(e,Lt)}function en(e){return yt(new kt(e),new xt(e))}var tn=n.object({all:n.boolean(),headed:n.boolean(),tests:n.array(n.string())}),rn=n.object({jobId:n.string(),total:n.number()}),bt=n.enum(["on","off","stalled"]),wt=n.object({attempts:n.number(),findings:n.number()}),nn=n.object({active:n.number(),explorer:bt,exploring:n.number(),progress:wt,queued:n.number(),sseHealth:n.object({detail:n.string().optional(),ok:n.boolean()}).optional(),version:n.string().optional()}),Et=n.enum(["MAX_RUNS","OVERAGE_CAP","MAX_AGENTS","MAX_CONCURRENT_RUNS","MAX_PROJECTS"]),vt=n.discriminatedUnion("type",[n.object({code:Et,type:n.literal("limit")}),n.object({detail:n.string(),type:n.literal("generic")})]),Rt=n.discriminatedUnion("kind",[n.object({kind:n.literal("pass")}),n.object({findingLines:n.array(n.string()),kind:n.literal("findings")}),n.object({detail:n.string(),kind:n.literal("error")}),n.object({kind:n.literal("dispatch-error"),reason:vt}),n.object({detail:n.string(),kind:n.literal("dispatch-timeout")}),n.object({detail:n.string(),kind:n.literal("infra-error")})]),Pt=n.discriminatedUnion("kind",[n.object({kind:n.literal("test-started"),runId:n.string(),testName:n.string(),workflowName:n.string()}),n.object({kind:n.literal("test-outcome"),outcome:Rt,runId:n.string(),testName:n.string(),workflowName:n.string()})]),on=n.object({event:Pt,jobId:n.string()}),sn=n.object({failed:n.number(),jobId:n.string(),notRun:n.number(),passed:n.number()}),an=n.discriminatedUnion("code",[n.object({code:n.literal("compile-failed"),detail:n.string(),diagnostics:n.array(n.string()).default([])}),n.object({code:n.literal("selection-conflicting-flags")}),n.object({code:n.literal("selection-nothing-selected")}),n.object({code:n.literal("selection-unknown-ids"),known:n.array(n.string()),unknown:n.array(n.string())}),n.object({code:n.literal("scope-failed"),detail:n.string()}),n.object({code:n.literal("app-unreachable"),detail:n.string(),url:n.string()}),n.object({code:n.literal("engine-unreachable"),detail:n.string(),url:n.string()}),n.object({code:n.literal("sync-failed"),detail:n.string()}),n.object({code:n.literal("bad-message")})]),ln=new ht("ripplo/enqueue"),cn=new Le("ripplo/status"),dn=new Le("ripplo/shutdownIfIdle"),un=new Se("ripplo/jobEvent"),pn=new Se("ripplo/jobDone");export{Tt as a,_e as b,c,pr as d,Be as e,H as f,P as g,mr as h,xr as i,Sr as j,Lr as k,br as l,ge as m,Ir as n,Or as o,Mr as p,Xr as q,ut as r,pt as s,Vr as t,Qr as u,Zr as v,en as w,tn as x,rn as y,nn as z,Rt as A,on as B,sn as C,an as D,ln as E,cn as F,dn as G,un as H,pn as I};
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire as __ripploCreateRequire } from "node:module";
3
- const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
4
- import{B as R,C as h,D as v,E as x,F as q,G as p,H as N,I as O,a as w,f as S,i as P,t as g,u,v as y,w as C,y as E,z as b}from"./chunk-E4AOUQQ7.js";import{i as D}from"./chunk-THHZNLXN.js";import{fa as I}from"./chunk-VGYX2VAS.js";import{spawn as J}from"child_process";import A from"fs";import F from"net";import{setTimeout as k}from"timers/promises";import{err as d,ok as f}from"neverthrow";import{ResponseError as G}from"vscode-jsonrpc/node";var T=12e4,_=300,M=5e3;async function sn({cliEntry:o,cwd:n}){let e=u(n),r=await i(e);return r!=null?j({cliEntry:o,connection:l(r,!1),cwd:n}):V({cliEntry:o,cwd:n,versionNote:void 0})}async function cn({cliEntry:o,cwd:n}){let e=await i(u(n));return e==null?d({kind:"not-running"}):j({cliEntry:o,connection:l(e,!1),cwd:n})}async function V({cliEntry:o,cwd:n,versionNote:e}){let r=H({cliEntry:o,cwd:n});if(r!=null)return d(r);let t=await Q(u(n));return t==null?d({deadlineMs:T,kind:"connect-timeout",logPath:y(n)}):f({...l(t,!0),versionNote:e})}async function j({cliEntry:o,connection:n,cwd:e}){let r=await $(n);if(r==null||r.version===w())return f(n);let t={daemonVersion:r.version};return await U(n)?(n.socket.destroy(),await W(u(e))?V({cliEntry:o,cwd:e,versionNote:{...t,kind:"restarted"}}):d({kind:"connection-lost"})):f({...n,versionNote:{...t,kind:"stale-busy"}})}async function U(o){try{return await o.rpc.sendRequest(p)}catch{return!1}}var K=1e4;async function W(o){let n=Date.now()+K,e=await i(o);for(;e!=null&&Date.now()<n;)e.destroy(),await k(_),e=await i(o);return e?.destroy(),e==null}async function un({connection:o,onEvent:n,request:e,token:r}){let t=await z({connection:o,onEvent:n,request:e,token:r});return t.kind==="transport"?d(t.error):f(t)}async function dn(o){let n=await i(u(o));if(n==null)return!1;let e=l(n,!1);try{return await e.rpc.sendRequest(p)}catch{return!1}finally{n.destroy()}}async function ln(o){try{await o.rpc.sendRequest(p)}catch{}}async function L(o){let n=await i(u(o));if(n==null)return{kind:"not-running"};let e=l(n,!1),r=await Promise.race([$(e),k(M).then(()=>null)]);return n.destroy(),r==null?{kind:"unresponsive",timeoutMs:M}:{kind:"running",status:r}}async function $(o){try{let n=await o.rpc.sendRequest(q),e=b.safeParse(n);return e.success?e.data:null}catch{return null}}function z({connection:o,onEvent:n,request:e,token:r}){let{rpc:t}=o;return new Promise(m=>{let a=s=>{m(s)};t.onNotification(N,s=>{let c=R.safeParse(s);if(!c.success){a({error:{kind:"bad-frame"},kind:"transport"});return}n(c.data.event)}),t.onNotification(O,s=>{let c=h.safeParse(s);if(!c.success){a({error:{kind:"bad-frame"},kind:"transport"});return}a({failed:c.data.failed,kind:"done",notRun:c.data.notRun,passed:c.data.passed})}),t.onClose(()=>{a({error:{kind:"connection-lost"},kind:"transport"})}),t.sendRequest(x,e,r).then(s=>{E.safeParse(s).success||a({error:{kind:"bad-frame"},kind:"transport"})}).catch(s=>{a(B(s))})})}function B(o){if(o instanceof G){let n=v.safeParse(o.data);return n.success?{error:n.data,kind:"daemon-error"}:{error:{kind:"bad-frame"},kind:"transport"}}return{error:{kind:"connection-lost"},kind:"transport"}}function l(o,n){let e=C(o);return e.listen(),{rpc:e,socket:o,spawned:n,versionNote:void 0}}function i(o){return new Promise(n=>{let e=F.connect(o);e.once("connect",()=>{n(e)}),e.once("error",()=>{n(null)})})}function H({cliEntry:o,cwd:n}){try{D(n);let e=A.openSync(y(n),"a");return J(process.execPath,[o,"daemon"],{cwd:n,detached:!0,stdio:["ignore",e,e]}).unref(),A.closeSync(e),null}catch(e){return{kind:"spawn-failed",message:e instanceof Error?e.message:String(e)}}}async function Q(o){let n=Date.now()+T,e=await i(o);for(;e==null&&Date.now()<n;)await k(_),e=await i(o);return e}async function wn(o){let n=process.cwd(),e=await S(n);e.isErr()&&(process.stderr.write(`${P(e.error)}
5
- `),process.exit(1));let r=g(e.value),t=await L(n);if(o.format==="summary"){r.length>0&&process.stdout.write(`stub workflows: ${r.join(", ")}
6
- `),process.stdout.write(`${I(t)}
7
- `);return}let m={daemon:t.kind==="running"?{active:t.status.active,explorer:t.status.explorer,exploring:t.status.exploring,progress:t.status.progress,queued:t.status.queued,running:!0}:{running:t.kind==="unresponsive",state:t.kind},tests:r.map(a=>({id:a,implemented:!1}))};process.stdout.write(`${JSON.stringify(m,null,2)}
8
- `)}export{sn as a,cn as b,un as c,dn as d,ln as e,L as f,wn as g};