ripplo 0.8.0 → 0.8.2

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 (79) hide show
  1. package/dist/chunk-2MT2MZJW.js +11 -0
  2. package/dist/chunk-4FKGHWCC.js +5 -0
  3. package/dist/chunk-4W6WIT7T.js +4 -0
  4. package/dist/{chunk-SAYJ5AQK.js → chunk-5SM4TCSW.js} +19 -19
  5. package/dist/chunk-7TYUZIUO.js +8 -0
  6. package/dist/chunk-7WZ3VIUU.js +4 -0
  7. package/dist/chunk-A7SHHSB3.js +23 -0
  8. package/dist/chunk-AQ3DMGAY.js +6 -0
  9. package/dist/chunk-AVBP7Q2M.js +8 -0
  10. package/dist/chunk-CDPYJKK7.js +9 -0
  11. package/dist/chunk-CJUKILIO.js +4 -0
  12. package/dist/chunk-CRELTIU2.js +242 -0
  13. package/dist/{chunk-D6FZ55DP.js → chunk-DBIXYJRB.js} +1 -1
  14. package/dist/chunk-EGETJKAQ.js +4 -0
  15. package/dist/chunk-EK6TENV6.js +4 -0
  16. package/dist/chunk-ESOXRGIY.js +83 -0
  17. package/dist/chunk-FEHVIHVA.js +5 -0
  18. package/dist/chunk-I2M24U3N.js +23 -0
  19. package/dist/chunk-I5BHCICM.js +6 -0
  20. package/dist/chunk-JJ4QQPAV.js +4 -0
  21. package/dist/chunk-KOKEEAEF.js +6 -0
  22. package/dist/chunk-L7GWKDGD.js +4 -0
  23. package/dist/chunk-LB65USNP.js +73 -0
  24. package/dist/chunk-LEFXRK53.js +4 -0
  25. package/dist/chunk-LKYTQXPR.js +9 -0
  26. package/dist/chunk-M7VQD4VO.js +6 -0
  27. package/dist/chunk-MHNGR6M7.js +4 -0
  28. package/dist/chunk-MOI4L3EX.js +4 -0
  29. package/dist/chunk-N2B5GZPU.js +4 -0
  30. package/dist/chunk-OQ6KNYPG.js +4 -0
  31. package/dist/chunk-OWN4P2K7.js +4 -0
  32. package/dist/chunk-OY6HNCAZ.js +4 -0
  33. package/dist/chunk-PE5WVWI5.js +48 -0
  34. package/dist/chunk-PXZV5X3C.js +7 -0
  35. package/dist/chunk-R4ZTRVDQ.js +4 -0
  36. package/dist/chunk-SWOTFHBR.js +4 -0
  37. package/dist/chunk-T5VLZ43M.js +5 -0
  38. package/dist/chunk-UVYCSHOJ.js +55 -0
  39. package/dist/chunk-WHSQBXWO.js +7 -0
  40. package/dist/chunk-WNAVYV4P.js +4 -0
  41. package/dist/chunk-XBD3OTIW.js +8 -0
  42. package/dist/chunk-XWUIRXMS.js +16 -0
  43. package/dist/cli-error-SLG6JHK2.js +4 -0
  44. package/dist/compile-write-7AV66JUA.js +4 -0
  45. package/dist/daemon-BN42ZNCJ.js +139 -0
  46. package/dist/daemon-LFFCR3TB.js +4 -0
  47. package/dist/daemon-lock-LTQMLU4Q.js +4 -0
  48. package/dist/dsl-loader-H25XGSHJ.js +4 -0
  49. package/dist/exit-plan-gate-BNAUL4FC.js +4 -0
  50. package/dist/hook.js +5 -0
  51. package/dist/index.js +202 -405
  52. package/dist/plan-reminder-VMBDQTAP.js +4 -0
  53. package/dist/post-edit-2VFE6QND.js +4 -0
  54. package/dist/post-edit-analyze-VETPP5Z4.js +4 -0
  55. package/dist/post-edit-flag-stubs-J3MCGLXI.js +4 -0
  56. package/dist/pre-bash-run-gate-PWLARIYK.js +4 -0
  57. package/dist/pre-edit-Q4U5LSWG.js +4 -0
  58. package/dist/pre-edit-ripplo-skill-gate-JD4BDCA3.js +4 -0
  59. package/dist/pre-edit-scope-gate-NZO4HVGT.js +4 -0
  60. package/dist/pre-edit-watch-gate-EUZGEH2J.js +4 -0
  61. package/dist/prompt-submit-MPRVCWOI.js +4 -0
  62. package/dist/scope-reminder-CBY4I5SG.js +4 -0
  63. package/dist/session-preamble-RJ4WNGJN.js +4 -0
  64. package/dist/solve-worker.js +1 -1
  65. package/dist/status-UBUNHH5O.js +4 -0
  66. package/dist/stop-enforce-UXBQRTFP.js +64 -0
  67. package/dist/tasks-reminder-LKSUZUFD.js +4 -0
  68. package/dist/track-skill-load-CJ74GD3Q.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-MBF7JVEN.js +0 -139
  77. package/dist/daemon-VIHSG5KP.js +0 -4
  78. package/dist/daemon-lock-HIZ6UWXO.js +0 -4
  79. package/dist/status-G5OG62JI.js +0 -4
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __ripploCreateRequire } from "node:module";
3
+ const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
4
+ import g from"fs";import a from"path";import{config as I}from"dotenv";import*as s from"zod/mini";import{err as L,ok as v}from"neverthrow";import c from"fs";import f from"path";import{err as p,ok as m}from"neverthrow";import*as n from"zod/mini";var F=f.join(".ripplo","project.json"),u=[".env",".env.local"],y=n.object({envFiles:n.optional(n.array(n.string().check(n.minLength(1)))),projectId:n.string().check(n.minLength(1))});function P(e){return f.join(e,F)}function h(e){let r=P(e);return c.existsSync(r)?E(r).andThen(t=>{let i=y.safeParse(t);return i.success?m({envFiles:i.data.envFiles??u,projectId:i.data.projectId}):p({issues:i.error.issues.map(o=>`${o.path.join(".")}: ${o.message}`),kind:"project-file-invalid",path:r})}):p({kind:"project-file-missing",path:r})}function d(e){return h(e).match(r=>r,()=>{})}function E(e){try{return m(JSON.parse(c.readFileSync(e,"utf8")))}catch(r){return p({issues:[r instanceof Error?r.message:String(r)],kind:"project-file-invalid",path:e})}}function C({cwd:e,envFiles:r,projectId:t}){let i=P(e);c.mkdirSync(f.dirname(i),{recursive:!0});let o={projectId:t};r!=null&&!R(r)&&(o.envFiles=[...r]),c.writeFileSync(i,JSON.stringify(o,null,2)+`
5
+ `)}function R(e){return e.length!==u.length?!1:e.every((r,t)=>r===u[t])}function T(e){let t=d(e)?.envFiles??[".env",".env.local"],i=a.join(e,".ripplo");t.forEach(o=>{let j=a.resolve(i,o);g.existsSync(j)&&I({override:!0,path:j,quiet:!0})}),l=void 0}var S=s.object({RIPPLO_APP_URL:s.url(),RIPPLO_ENGINE_URL:s.url(),RIPPLO_WEBHOOK_SECRET:s.string().check(s.minLength(1))}),l;function J(){return l!=null?v(l):z().map(e=>(l=e,e))}function _(e){let t=d(e)?.envFiles??[],i=a.join(e,".ripplo");return t.map(o=>a.resolve(i,o)).filter(o=>!g.existsSync(o))}function z(){let e=S.safeParse(process.env);if(!e.success)return L({issues:e.error.issues.map(t=>`${t.path.join(".")}: ${t.message}`),kind:"env-invalid",missingEnvFiles:_(process.cwd())});let r=e.data;return v({appUrl:r.RIPPLO_APP_URL,engineUrl:r.RIPPLO_ENGINE_URL,webhookSecret:r.RIPPLO_WEBHOOK_SECRET})}export{h as a,C as b,T as c,J as d,_ as e};
@@ -0,0 +1,23 @@
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 d,b as f,c as g}from"./chunk-T5VLZ43M.js";import{a as w}from"./chunk-I5BHCICM.js";import{c as u}from"./chunk-LEFXRK53.js";import{a as c}from"./chunk-7WZ3VIUU.js";import{f as m}from"./chunk-4W6WIT7T.js";import{a as i}from"./chunk-MHNGR6M7.js";import{e as a}from"./chunk-PE5WVWI5.js";import{graphql as h}from"gql.tada";var S=h(`
5
+ query ScopeReminder($projectId: String!, $cwd: String!) {
6
+ project(id: $projectId) {
7
+ id
8
+ devSession(cwd: $cwd) {
9
+ id
10
+ scopeItems {
11
+ id
12
+ label
13
+ workflow {
14
+ slug
15
+ spec
16
+ }
17
+ }
18
+ }
19
+ }
20
+ }
21
+ `),x=async t=>{let{cwd:e}=t;if(!c(e)||!m(e))return;let p=d(e);if(f(e,"scope-reminder")===p)return;let r=u(e).unwrapOr(void 0);if(r==null)return;let s=await a({config:r,document:S,variables:{cwd:r.cwd,projectId:r.projectId}}).catch(()=>null);g(e,"scope-reminder",p);let n=s?.project?.devSession?.scopeItems??[];return w({cwd:e,scope:{available:s!=null,items:n.map(o=>b(o))}}),s==null?{hookSpecificOutput:{additionalContext:`Ripplo scope: unknown \u2014 server unreachable, scope guardrails are not enforcing. Check the dev session (\`npx ripplo doctor\`). ${i("start")}`,hookEventName:"UserPromptSubmit"}}:{hookSpecificOutput:{additionalContext:n.length===0?`Ripplo scope: empty. ${i("run")}`:`Ripplo scope (${String(n.length)}):
22
+ ${n.map(o=>{let l=o.workflow;return l==null?` [intent] (${o.id}) ${o.label??""}`:` [${l.spec==null?"stub":"implemented"}] (${o.id}) ${l.slug}`}).join(`
23
+ `)}`,hookEventName:"UserPromptSubmit"}}};function b(t){let e=t.workflow;return e==null?{label:t.label,slug:null,status:"intent"}:{label:t.label,slug:e.slug,status:e.spec==null?"stub":"implemented"}}export{x as a};
@@ -0,0 +1,6 @@
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}from"./chunk-JJ4QQPAV.js";import{b as l}from"./chunk-4W6WIT7T.js";import{i as c}from"./chunk-PE5WVWI5.js";import{createHash as S}from"crypto";import{mkdirSync as b,readFileSync as v,writeFileSync as A}from"fs";import x from"path";import*as e from"zod/mini";import{createHash as P}from"crypto";import a from"picomatch";function m(t){return l(["diff","--name-only","HEAD"],t).split(`
5
+ `).filter(r=>r.length>0)}function g({cwd:t,ignoreGlobs:r,watchGlobs:n}){let o=a([...n]),i=a([...r]);return m(t).filter(s=>o(s)&&!i(s))}function z(t){return l(["ls-files","--others","--exclude-standard"],t).split(`
6
+ `).filter(r=>r.length>0)}function d({cwd:t,ignoreGlobs:r,watchGlobs:n}){let o=a([...n]),i=a([...r]);return z(t).filter(s=>o(s)&&!i(s))}var F=e.object({label:e.nullable(e.string()),slug:e.nullable(e.string()),status:e.enum(["intent","stub","implemented"])}),C=e.object({intent:e.string(),name:e.string(),sourcePath:e.nullable(e.string()),stub:e.boolean()}),R=e.object({changedAppFiles:e.readonly(e.array(e.string())),scope:e.object({available:e.boolean(),items:e.readonly(e.array(F))}),tests:e._default(e.readonly(e.array(C)),[]),untrackedAppFiles:e.readonly(e.array(e.string()))});function O({cwd:t,scope:r}){let n=h(t);u(t,{...f(t),scope:r,tests:n?.tests??[]})}function T({cwd:t,tests:r}){let n=h(t);u(t,{...f(t),scope:n?.scope??{available:!1,items:[]},tests:r??n?.tests??[]})}function h(t){let r=R.safeParse(k(y(t)));return r.success?r.data:null}function k(t){try{return JSON.parse(v(t,"utf8"))}catch{return null}}function y(t){return c(t,"coverage-context.json")}function u(t,r){let n=y(t);b(x.dirname(n),{recursive:!0});let o=S("sha256").update(JSON.stringify(r)).digest("hex");A(n,JSON.stringify({...r,inputHash:o},null,2))}function f(t){let{ignorePaths:r,watchPaths:n}=p(),o={cwd:t,ignoreGlobs:r,watchGlobs:n};return{changedAppFiles:g(o),untrackedAppFiles:d(o)}}export{O as a,T as b};
@@ -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
+ var s=["**/src/**","**/app/**","**/apps/**","**/pages/**","**/routes/**","**/components/**","**/server/**","**/api/**","**/backend/**","**/features/**","**/modules/**","**/views/**","**/ui/**","**/hooks/**","**/contexts/**","**/providers/**","**/controllers/**","**/handlers/**","**/resolvers/**","**/services/**","**/middleware/**","**/lib/**"],e=["**/*.gen.*","**/generated/**","**/*.d.ts","**/*.test.*","**/*.spec.*","**/node_modules/**","**/dist/**","**/build/**",".ripplo/**","**/*.md","**/.next/**","**/.turbo/**","**/.vercel/**","**/.svelte-kit/**","**/.nuxt/**","**/.astro/**","**/coverage/**","**/storybook-static/**","**/*.stories.*","**/*.story.*","**/cli/**","**/scripts/**","**/tools/**","**/__tests__/**","**/__mocks__/**","**/__fixtures__/**","**/*.config.*","**/*.setup.*","**/public/**","**/static/**","**/assets/**","**/migrations/**","**/prisma/migrations/**"];function t(){return{ignorePaths:e,watchPaths:s}}export{t as a};
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __ripploCreateRequire } from "node:module";
3
+ const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
4
+ async function y(o,n){try{let t=n.trim()===""?{}:JSON.parse(n),u=await o.run(t);return{kind:"output",stdout:u==null?void 0:JSON.stringify(u)}}catch(t){return{error:t,kind:"crash"}}}function O({event:o,handlers:n,note:t}){return l(o,async u=>{let r=n.map(async e=>e(u)),s=Promise.all(r),k=r.map(async e=>{let i=await e;return i!=null&&H(i)?i:f()}),a=await Promise.race([s.then(()=>null),...k]);if(a!=null)return a;let c=(await s).filter(e=>e!=null).flatMap(e=>{let i=e.hookSpecificOutput,p=i!=null&&"additionalContext"in i?i.additionalContext:null;return p==null?[]:[p]});if(c.length!==0)return t(c.join(`
5
+
6
+ `))})}function l(o,n){return{event:o,run:async t=>{if(!d(o,t))throw new Error(`hook input is not a ${o} payload`);return await n(t)??void 0}}}function d(o,n){return typeof n=="object"&&n!==null&&"hook_event_name"in n&&n.hook_event_name===o}function H(o){if(o.decision==="block")return!0;let n=o.hookSpecificOutput;return n!=null&&"permissionDecision"in n&&n.permissionDecision==="deny"}function f(){return new Promise(()=>{})}export{y as a,O as b,l as c};
@@ -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 a}from"./chunk-OWN4P2K7.js";import{a as s}from"./chunk-7WZ3VIUU.js";import{f as l}from"./chunk-4W6WIT7T.js";import p from"path";import*as t from"zod/mini";var n=new Set(["Edit","Write","NotebookEdit"]),d=t.looseObject({file_path:t.string()}),c="create",k=e=>{if(!n.has(e.tool_name))return;let i=d.safeParse(e.tool_input);if(!i.success)return;let{cwd:o}=e;if(!s(o)||!l(o))return;let r=p.relative(o,i.data.file_path);if(!(r.startsWith("..")||r!==".ripplo"&&!r.startsWith(".ripplo/"))&&!a(o,e.session_id,c))return{hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"deny",permissionDecisionReason:`Editing \`.ripplo/\` files (${r}) requires the \`/ripplo:create\` skill loaded first. Load \`/ripplo:create\` then retry \u2014 it carries the DSL builder shape, model rules, and the parallelization guidance you'll need.`}}};export{k as a};
@@ -0,0 +1,73 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __ripploCreateRequire } from "node:module";
3
+ const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
4
+ import{c as a,d as s}from"./chunk-OWN4P2K7.js";import{a as o}from"./chunk-7WZ3VIUU.js";var n=`# How Ripplo thinks
5
+
6
+ The mental model behind every Ripplo skill. Read this once and the compile errors, run findings, and explorer behavior all follow from it. Every skill assumes it.
7
+
8
+ **Done means both halves.** An app change without a passing workflow that proves it isn't done, and a workflow written against broken app behavior isn't done either. Every user-facing change ships with the workflow that demonstrates it working end to end.
9
+
10
+ ## A workflow is a declaration, not a script
11
+
12
+ A workflow step says two things: what the user does, and what becomes true afterward. "Click Save, and now the success heading is visible, the url is /projects/123, and a project row exists in the database." Ripplo checks all of it \u2014 it doesn't just replay clicks and hope.
13
+
14
+ Because steps declare state instead of scripting waits and retries, Ripplo can do things a script runner can't: predict what every step should produce, compare that prediction against the live app, and reuse what one workflow proved inside every other workflow.
15
+
16
+ One vocabulary rule: you author **workflows**. A **test** is a workflow with its input parameters pinned \u2014 the compiler derives one test per \`when\` branch (or a single "main" test when there are none). Runs execute tests; you edit workflows.
17
+
18
+ A workflow is also a **user journey**: one thing the user set out to accomplish, traced as the real click path from a natural entry point, with as many mutations as the intent takes. Depth pays twice. Every step's declarations become facts, so a journey teaches Ripplo far more of the app than a goto-and-click snippet \u2014 and the explorer can only compose paths from what workflows have declared. Shallow workflows starve the model.
19
+
20
+ ## Two kinds of state
21
+
22
+ - **Data** \u2014 rows in your app: users, projects, invoices. Declared as entities, seeded by worlds, asserted with \`Entity.created / updated / deleted\`. Ripplo reads your app's real state through the engine and compares.
23
+ - **Page state** \u2014 what's on screen right now: the url, what's visible or enabled, what a field contains, and global variables (declared with \`singleton(...)\` in the DSL, shown as "Global variables" in the dashboard \u2014 one concept, and it can live in the backend or the browser). Asserted with \`visible(...)\`, \`url.path.is(...)\`, \`text(...)\`, and friends. Locators are semantic \u2014 \`button("Save")\`, \`textbox("Email")\` \u2014 because they assert accessibility too; \`testId\` is a last resort for elements with no ARIA role.
24
+
25
+ New backend state to assert means a new \`entity(...)\` declaration plus a matching engine impl in the app \u2014 the type system flags the missing half. This is the **two-funnel** rule: all definitions flow through one \`createRipplo(...)\` in \`.ripplo/index.ts\`, all implementations through one \`createEngine(...)\` in the app \u2014 never a second call site of either.
26
+
27
+ Every assertion pins one piece of one of these. A mutation step with only page-state assertions ships the "toast said saved, DB didn't" bug as green \u2014 that's why backend assertions on mutations are mandatory.
28
+
29
+ ## You can only touch what you've shown exists
30
+
31
+ A step cannot click a button no earlier step declared visible. Compile enforces this before anything runs.
32
+
33
+ This is not pedantry. Declarations are how Ripplo learns what's reachable from where \u2014 which is what lets the explorer compose paths no workflow author wrote and still know what should be on the page when it gets there. An undeclared button is invisible to the model even when it renders fine; the fix is one \`visible(...)\` on the step that first shows it.
34
+
35
+ Corollary: when the same page can show a thing or not (a collapsed group, a toggled panel), the two states need a distinguishing declaration \u2014 assert \`expanded(...)\` on the toggle, not just the disappearance. Otherwise the model sees one page asserting two contradictory things.
36
+
37
+ ## Assertions become facts
38
+
39
+ What one workflow proves about a page becomes a fact \u2014 something Ripplo now knows about that page and enforces everywhere. If the settings workflow shows "at /settings, the Save button is visible," every other workflow that reaches /settings inherits that fact \u2014 and so does the explorer, on paths nobody wrote. Negations count too: "the spinner is not visible" is a fact just like "the heading is visible."
40
+
41
+ Two workflows asserting opposite things about the same page under the same conditions is a contradiction, and compile reports it before any run. One of them is wrong \u2014 usually the page has a state dimension neither workflow declared.
42
+
43
+ Facts come in three tiers, one promotion pipeline. A single workflow's assertion is **inferred**. The same consequence asserted by two or more workflows **generalizes** to a **learned** fact \u2014 the model keeps only the conditions they share, so a claim made on two URLs drops the URL and holds app-wide. Above both sits the **declared** fact: an app-wide rule you author directly with \`fact(...)\` in \`.ripplo/facts.ts\` (an invariant like "the crash screen never shows," or a permission boundary), always enforced without any workflow producing it. A more specific fact overrides a more general one. \`/ripplo:create\` covers authoring all three.
44
+
45
+ Two practical notes:
46
+
47
+ - \`text(locator, "x")\` means _contains_ \u2014 several \`text(...)\` assertions on one element can all be true at once.
48
+ - Exact-value checks (\`value(...)\`, \`url.query\`) are exact. A stray difference is a finding, not noise.
49
+
50
+ ## What is enforced where
51
+
52
+ | Gate | When | Catches |
53
+ | ----------------- | ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
54
+ | \`npx ripplo compile\` | before any run | structure, unreachable interactions, contradicting facts, unreachable \`when\` branches, stale lockfile |
55
+ | \`npx ripplo run\` | live, per step | every declared expectation vs the real app \u2014 page state and backend rows, with a wait window that tolerates propagation lag but fails on wrong values |
56
+ | explorer | in the background | learned facts and backend state on composed paths no workflow author wrote |
57
+
58
+ A failed check is a **finding** \u2014 the unit every red run and every explorer catch produces. If compile is red, the model is inconsistent \u2014 fix the declarations, don't run around it. If a run is red, read the artifacts first (\`npx ripplo explain <runId>\`, then raw \`behavior.jsonl\`), form one hypothesis, make one change, re-run once \u2014 never re-run hoping.
59
+
60
+ The explorer is not optional \u2014 it is the third gate, always running. It walks composed paths no workflow author wrote and catches bugs that only appear when actions combine, so keep it on for the whole session. A green \`npx ripplo run\` turns it on for you; \`npx ripplo explore\` shows or toggles it by hand. Its findings arrive as tasks \u2014 triage them with \`/ripplo:tasks\`, and an open finding blocks the session end just like any other task. The only real off switch is \`npx ripplo hooks pause\`.
61
+
62
+ Two different timing knobs, often confused: \`.wait("slow")\` on an assertion lengthens _how long_ Ripplo polls before calling it failed (slow page, long job). \`consistency: "eventual"\` on a field or variable tolerates _wrong in-between values_ while converging (a flickering redirect, a denormalized counter). Slow is not the same as flickering \u2014 reach for \`.wait\` first.
63
+
64
+ \`.ripplo/ripplo.lock\` is the compiled model \u2014 committed, regenerated by \`ripplo compile\`, never hand-edited.
65
+
66
+ ## Scope and stubs
67
+
68
+ **Testing Scope** is the session's contract: the set of workflows this session is responsible for leaving green. Any change that could affect a flow adds its workflow to scope; a flow with no workflow yet gets a **stub** \u2014 \`workflow("Intent")\` with no body \u2014 which is a gated promise: hooks won't let the session end with it unimplemented. Scope items are removed only when genuinely out of scope, never because they're work.
69
+
70
+ ## The prime directive
71
+
72
+ Never weaken a workflow to make it pass. No swapping exact text for contains, no deleting assertions, no fabricated locators, no \`testId()\` because the accessible name is missing \u2014 add the accessible name to the app. A weakened declaration doesn't just soften one workflow; it teaches Ripplo a weaker fact everywhere.
73
+ `;function l(e,t){return!o(e)||s(e,t)?null:(a(e,t),n)}export{l as a};
@@ -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 c,d as s}from"./chunk-FEHVIHVA.js";import{j as l}from"./chunk-PE5WVWI5.js";import{err as h,ok as P}from"neverthrow";import{z as n}from"zod";var g="https://ripplo.ai";function a(){return u().RIPPLO_SERVER_URL}function m(){return u().RIPPLO_PROJECT_ID}var v=n.object({RIPPLO_PROJECT_ID:n.string().min(1).optional(),RIPPLO_SERVER_URL:n.string().min(1).default(g)}),f;function u(){return f??=v.parse(process.env),f}import d from"fs";import i from"path";function R(o){let t=d.realpathSync(o),r=t,e=i.dirname(r);for(;e!==r;){if(d.existsSync(i.join(r,".git")))return r;r=e,e=i.dirname(r)}return t}function x(o){return c(o).andThen(t=>s().andThen(r=>{let e=a(),p=l(e);return p==null?h({kind:"not-authenticated"}):P({appUrl:r.appUrl,cwd:R(o),engineUrl:r.engineUrl,projectId:m()??t.projectId,ripploServerUrl:e,token:p,webhookSecret:r.webhookSecret})}))}export{a,u as b,x as c};
@@ -0,0 +1,9 @@
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 c}from"./chunk-OQ6KNYPG.js";import{c as p}from"./chunk-LEFXRK53.js";import{c as l}from"./chunk-FEHVIHVA.js";import{a}from"./chunk-MHNGR6M7.js";import{I as u,w as t}from"./chunk-ESOXRGIY.js";import{N as d}from"./chunk-5SM4TCSW.js";var f=3e3;async function S(e){l(e);let n=p(e).unwrapOr(void 0);if(n==null)return null;try{return await fetch(`${n.ripploServerUrl}/health`,{signal:AbortSignal.timeout(f)}),null}catch(r){return{detail:r instanceof Error?r.message:String(r),serverUrl:n.ripploServerUrl}}}function m(e){return e.includes("localhost")||e.includes("127.0.0.1")}import g from"fuse.js";function s(e){switch(e.kind){case"conflicting-flags":return"Pass either --all or test ids, not both.";case"nothing-selected":return`No tests selected \u2014 scope empty, no dirty .ripplo/workflows files. Pass test ids, add to scope (${a("run")}), or use --all.`;case"unknown-ids":{let n=e.known,r=e.unknown.flatMap(i=>y(i,n)),o=r.length>0?[`Did you mean: ${[...new Set(r)].join(", ")}`]:[];return[`Unknown ${e.unknown.length===1?"id":"ids"}: ${e.unknown.join(", ")}`,...o,"Pass a workflow slug for all its tests, or workflow/test for one. Known workflows:",...n.map(i=>` ${i}`)].join(`
5
+ `)}}}function L({failed:e,notRun:n,passed:r}){let o=n>0?`, ${String(n)} not run`:"";return`${String(r)} passed, ${String(e)} failed${o} (${String(r+e+n)} total)`}function A({debugDir:e,event:n}){let r=`${n.workflowName} \u2192 ${n.testName}`;if(n.kind==="test-started")return`${t.dim("run ")} ${r}`;switch(n.outcome.kind){case"pass":return`${t.good("pass")} ${r} ${t.dim(n.runId)}`;case"findings":return[`${t.bad("fail")} ${r} \u2014 ${c(n.outcome.findingLines.length,"finding")}`,...n.outcome.findingLines,u({debugDir:e,runId:n.runId}),`${t.dim("why")} npx ripplo explain ${n.runId}`].join(`
6
+ `);case"error":return`${t.bad("error")} ${r} \u2014 ${n.outcome.detail} ${t.dim(n.runId)}`;case"dispatch-error":return`${t.bad("error")} ${r} \u2014 ${w(n.outcome.reason)}`;case"dispatch-timeout":return`${t.bad("error")} ${r} \u2014 not run: dispatch timed out (transient): ${n.outcome.detail}`;case"infra-error":return`${t.bad("error")} ${r} \u2014 not run: Ripplo server unreachable: ${n.outcome.detail}`}}var h={MAX_AGENTS:"agent limit reached for your plan \u2014 upgrade to add more",MAX_CONCURRENT_RUNS:"concurrent run limit reached for your plan \u2014 upgrade or wait for runs to finish",MAX_PROJECTS:"project limit reached for your plan \u2014 upgrade to add more",MAX_RUNS:"run limit reached for your plan \u2014 enable overage or upgrade",OVERAGE_CAP:"overage cap reached \u2014 raise the cap or upgrade"};function j({detail:e,serverUrl:n}){return m(n)?`Ripplo server at ${n} not running (${e}). Start the dev server with \`pnpm dev\`.`:`Ripplo server at ${n} unreachable (${e}) \u2014 server-side, not your local environment.`}function N(e){switch(e.code){case"compile-failed":{let n=e.diagnostics.length===0?[]:["",...e.diagnostics];return[`Compilation failed in the daemon (${e.detail}). Run \`npx ripplo compile\` for full output.`,...n].join(`
7
+ `)}case"selection-conflicting-flags":return s({kind:"conflicting-flags"});case"selection-nothing-selected":return s({kind:"nothing-selected"});case"selection-unknown-ids":return s({kind:"unknown-ids",known:e.known,unknown:e.unknown});case"app-unreachable":return`Your dev server not responding at ${e.url} (${e.detail}) \u2014 your local environment, not the Ripplo server.`;case"engine-unreachable":return`Ripplo engine not responding at ${e.url} (${e.detail}) \u2014 adapter unmounted, behind a build error, or RIPPLO_ENGINE_URL points at the wrong path.`;case"scope-failed":return`Could not resolve the dev-session scope: ${e.detail}
8
+ Check the dev session is live (\`npx ripplo doctor\`, ${a("start")}), or pass test ids / --all.`;case"sync-failed":{let n=/401|unauthor/i.test(e.detail)?"\nAuth failure \u2014 run `npx ripplo auth login`.":"";return`Sync to the Ripplo server failed: ${e.detail}${n}`}case"bad-message":return"Daemon rejected the request \u2014 protocol mismatch, rebuild the CLI and restart the daemon."}}function M(e){switch(e.kind){case"spawn-failed":return`Failed to start \`npx ripplo daemon\`: ${$(e.message)}`;case"connect-timeout":return[`Daemon did not come up within ${String(Math.round(e.deadlineMs/1e3))}s.`,`Check ${e.logPath} for startup errors.`,"Common causes: stale socket (`rm .ripplo/.local/daemon.sock`), another daemon holding the dev lock, or the Ripplo server unreachable."].join(`
9
+ `);case"connection-lost":return"Lost the daemon connection mid-run \u2014 it crashed or was killed. Check .ripplo/.local/daemon.log, restart `npx ripplo daemon`.";case"not-running":return"No ripplo daemon running for this directory. Start it with `npx ripplo daemon` as a background process, separate from your app's dev server.";case"bad-frame":return"Malformed frame from the daemon \u2014 version mismatch, rebuild the CLI and restart the daemon."}}function $(e){return e.includes("ENOENT")?`${e} \u2014 node or the CLI entry not found on PATH.`:e.includes("EACCES")?`${e} \u2014 permission denied executing the CLI entry.`:e}function w(e){return e.type==="limit"?h[e.code]:`failed to dispatch (${e.detail})`}function y(e,n){return new g(n,{includeScore:!0,threshold:.5}).search(d(e)).slice(0,3).map(o=>o.item)}export{S as a,m as b,L as c,A as d,j as e,N as f,M as g};
@@ -0,0 +1,6 @@
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 i,C as s,F as d,i as o}from"./chunk-ESOXRGIY.js";function y(n){switch(n.kind){case"empty-response":return"ripplo daemon: cloud tunnel provisioning returned no result. Check server logs and retry.";case"server-error":return`ripplo daemon: cloud tunnel provisioning failed (${n.typename}). Run \`npx ripplo doctor\` to check your setup.`}}function x(n){switch(n.kind){case"already-running":return`ripplo daemon: daemon already running (socket ${n.socketPath}).`;case"bind-failed":return`ripplo daemon: failed to bind IPC socket: ${n.message}`}}function $({projectId:n,serverUrl:e}){return[`Project "${n}" (from .ripplo/project.json) was not found on ${e}, or this account does not have access to it.`,"Run `npx ripplo projects list` to see your projects, then update .ripplo/project.json (or re-run `npx ripplo init --project <id>`)."].join(`
5
+ `)}function b(){return"Not signed in. Run `npx ripplo auth login`, then start the daemon again."}function v({devSessionId:n,version:e}){return`ripplo daemon: v${e} ready as local executor for session ${n} (switch with \`npx ripplo executor cloud\` \u2014 Ctrl-C to stop)`}function S({cwd:n,pid:e}){return`ripplo daemon: another daemon is already running for this project${e==null?"":` (pid ${String(e)})`} (cwd ${n}) \u2014 this one is exiting. Run \`npx ripplo daemon status\` to inspect it, or \`npx ripplo daemon stop\` to stop it.`}function w(n){switch(n.kind){case"not-running":return"ripplo daemon: not running.";case"stopped":return`ripplo daemon: stopped (pid ${String(n.pid)}).`;case"timeout":return`ripplo daemon: pid ${String(n.pid)} did not exit within 10s \u2014 it may be finishing a run. Check again with \`npx ripplo daemon status\`.`}}function j(){return"ripplo daemon: lock compromised \u2014 another daemon likely took over this project. Shutting down."}function R(n){if(n.kind==="not-running")return"daemon: not running";if(n.kind==="unresponsive")return`daemon: running but no reply within ${String(n.timeoutMs/1e3)}s \u2014 likely busy executing runs, retry when the batch drains`;let{status:e}=n,r=e.version==null?"version unknown (pre-0.7.8)":`v${e.version}`,p=`${String(e.active)} active, ${String(e.queued)} queued`,u=m(e.explorer,e.exploring),t=`daemon: running (${r} | ${p} | ${u} | ${c(e.progress)})`;if(e.sseHealth!=null&&!e.sseHealth.ok){let l=e.sseHealth.detail==null?"":`: ${e.sseHealth.detail}`;return`${t}
6
+ daemon: cannot subscribe to run dispatch${l} \u2014 server-side, restarting the daemon will not help`}return t}function c(n){return n.attempts===0?"explore: idle":`explore: ${String(n.attempts)} attempts, ${String(n.findings)} findings`}function P(n){let e=n.daemonVersion==null?"an older build":`v${n.daemonVersion}`;return n.kind==="restarted"?`ripplo: daemon was on ${e} \u2014 restarted on the current build`:`ripplo: daemon is on a stale build (${e}) with runs in flight \u2014 rerun once it drains, or npx ripplo daemon restart`}function D(n){switch(n.kind){case"pass":return{kind:"pass"};case"findings":return{findingLines:g(n.findings).map(e=>d({evidencePath:`.ripplo/debug/${n.runId}/behavior.jsonl`,finding:e})),kind:"findings"};case"error":return{detail:o(n.error),kind:"error"};case"dispatch-failed":return{kind:"dispatch-error",reason:{detail:n.reason,type:"generic"}}}}function m(n,e){return n==="stalled"?"explorer: stalled \u2014 a wedged trail is restarting on its own, no action needed":`explorer: ${n}, ${String(e)} exploring`}function g(n){let e=new Set(n.flatMap(r=>h(r)?[a(r)]:[]));return n.filter(r=>!(f(r)&&e.has(a(r))))}function h(n){return n.kind==="pending-check"&&n.source.kind==="step"}function a(n){return n.kind!=="pending-check"||n.source.kind==="data-rule"?"":`${i(n.source.check)}|${s(n.step)}`}function f(n){return n.kind==="pending-check"&&n.source.kind==="fact"}export{y as a,x as b,$ as c,b as d,v as e,S as f,w as g,j as h,R as i,c as j,P as k,D as l};
@@ -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
+ function n(r,t){return t==null?`Load \`/ripplo:${r}\` skill for instructions.`:`Load \`/ripplo:${r}\` skill for instructions on ${t}.`}function e(r){return r.length===1?n(r[0]):`Before proceeding, load the ${r.map(i=>`\`/ripplo:${i}\``).join(" and ")} skills \u2014 every one, each carries rules the others don't.`}export{n as a,e as b};
@@ -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
+ function p(e){let t=e.workflows.filter(n=>!n.stub);if(t.length===0)return[];let a=new Set(t.flatMap(n=>s(n))),r=new Set(t.flatMap(n=>o(n)));return[...e.entities.filter(n=>!a.has(n.name)).map(n=>({entity:n.name,kind:"entity-never-given"})),...e.entities.filter(n=>a.has(n.name)&&!r.has(n.name)).map(n=>({entity:n.name,kind:"entity-never-mutated"})),...t.flatMap(n=>n.tests.flatMap(l=>y(l)))]}function s(e){return[...e.world,...e.maybe].map(t=>t.entity)}function o(e){return e.steps.flatMap(t=>t.expect.flatMap(a=>i(a))).map(t=>t.entity)}function y(e){let t=e.steps.flatMap(a=>a.expect.flatMap(r=>i(r)));return d({states:t,test:e})}function d({states:e,test:t}){let a=e.filter(r=>r.assertion.kind==="deleted").flatMap(r=>f({predicate:r,test:t})).map(({entity:r,field:n})=>({entity:r,field:n,kind:"unmatchable-delete-key",testSlug:t.slug,workflow:t.workflow}));return c(a)}function f({predicate:e,test:t}){let a=t.world.filter(r=>r.entity===e.entity);return a.length===0?[]:Object.entries(e.key).filter(([r,n])=>g(n)&&!u({field:r,setups:a})).map(([r])=>({entity:e.entity,field:r}))}function u({field:e,setups:t}){return t.some(a=>Object.keys(a.set).includes(e))}function g(e){return e===null||typeof e!="object"}function c(e){return e.filter((t,a)=>e.findIndex(r=>JSON.stringify(r)===JSON.stringify(t))===a)}function i(e){return e.kind==="state"?[e]:e.kind==="not"?i(e.predicate):e.kind==="and"?e.predicates.flatMap(t=>i(t)):e.kind==="when"?e.branches.flatMap(t=>t.consequence.flatMap(a=>i(a))):[]}export{p as a};
@@ -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 s}from"./chunk-7WZ3VIUU.js";import{e as p}from"./chunk-4W6WIT7T.js";import{a as i}from"./chunk-MHNGR6M7.js";import{h as n}from"./chunk-AQ3DMGAY.js";import{c as a}from"./chunk-DBIXYJRB.js";import l from"fs";import d from"path";import*as r from"zod/mini";var c=new Set(["Edit","Write","NotebookEdit"]),u=r.looseObject({file_path:r.string()}),D=async t=>{if(!c.has(t.tool_name))return;let e=m(t);if(e==null)return;let{cwd:o}=t;return l.existsSync(p(o))||a(o)?void 0:(await n(o)).isErr()?{hookSpecificOutput:{additionalContext:`\`ripplo daemon\` isn't running and the DSL isn't compiling, so this edit is allowed through without dev-mode guardrails. Run \`npx ripplo compile\` to see the errors, or \`/ripplo:start\` to bring the daemon up. ${i("create","DSL authoring rules")}`,hookEventName:"PreToolUse"}}:{hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"deny",permissionDecisionReason:`\`ripplo daemon\` is not running \u2014 this edit to \`${e}\` won't sync and dev-mode guardrails won't fire. Run \`/ripplo:start\`, then retry (\`npx ripplo doctor\` checks the daemon and dev server). If the daemon can't start, the user can bypass with \`npx ripplo hooks pause\`. ${i("start")}`}}};function m(t){let e=u.safeParse(t.tool_input);if(!e.success||!s(t.cwd))return null;let o=d.relative(t.cwd,e.data.file_path);return o.startsWith("..")||o!==".ripplo"&&!o.startsWith(".ripplo/")?null:o}export{D as a};
@@ -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
+ function o(r,t,n){let i=r===1?t:n??`${t}s`;return`${String(r)} ${i}`}export{o as a};
@@ -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{existsSync as c,mkdirSync as g,rmSync as f,writeFileSync as l}from"fs";import t from"path";function d(r,n,i){let e=s(r,n,i);g(t.dirname(e),{recursive:!0}),l(e,"")}function u(r,n,i){return c(s(r,n,i))}function k(r,n){d(r,n,o)}function S(r,n){return u(r,n,o)}var o="__model__";function s(r,n,i){return t.join(a(r,n),i)}function a(r,n){return t.join(r,".ripplo",".local","skills-loaded",n)}export{d as a,u as b,k as c,S as d};
@@ -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{i as c}from"./chunk-PE5WVWI5.js";import{spawnSync as y}from"child_process";import{existsSync as s,readdirSync as d,readFileSync as g,realpathSync as u,statSync as m}from"fs";import i from"path";var h=2e3;function L(t){if(t!=null)try{return m(u(t)).mtimeMs}catch{return}}function _(t){return y("pnpm",["turbo","run","build","--filter=ripplo..."],{cwd:t,stdio:"inherit"}).status===0}function D(){let t=process.argv[1];if(t==null)return{kind:"fresh"};let n=u(t),r=n.includes(`${i.sep}src${i.sep}`),o=p(i.dirname(n));if(o!=null)return r?{kind:"fresh"}:j(o);let a=p(process.cwd());return a!=null&&k(a)?{kind:"foreign-binary",workspaceRoot:a}:{kind:"fresh"}}function p(t){let n=i.dirname(t);return s(i.join(t,"pnpm-workspace.yaml"))?t:n===t?void 0:p(n)}function j(t){let n=i.join(t,"packages");if(!s(n))return{kind:"fresh"};let r=d(n).map(o=>({dist:i.join(n,o,"dist"),name:o,src:i.join(n,o,"src")})).filter(o=>s(o.src)&&s(o.dist)).filter(o=>l(o.src)>l(o.dist)+h).map(o=>o.name);return r.length===0?{kind:"fresh"}:{kind:"stale",packages:r,workspaceRoot:t}}function l(t){let n=m(t);if(!n.isDirectory())return n.mtimeMs;let r=d(t).map(o=>l(i.join(t,o)));return Math.max(n.mtimeMs,...r)}function k(t){let n=i.join(t,"packages","cli","package.json");if(!s(n))return!1;let r=JSON.parse(g(n,"utf8"));return typeof r=="object"&&r!=null&&"name"in r&&r.name==="ripplo"}import{createMessageConnection as S,NotificationType as f,RequestType as x,RequestType0 as b,SocketMessageReader as R,SocketMessageWriter as w}from"vscode-jsonrpc/node";import{z as e}from"zod";var E="daemon.sock",P="daemon.log";function J(t){return c(t,E)}function X(t){return c(t,P)}function G(t){return S(new R(t),new w(t))}var K=e.object({all:e.boolean(),headed:e.boolean(),tests:e.array(e.string())}),$=e.object({jobId:e.string(),total:e.number()}),M=e.enum(["on","off","stalled"]),q=e.object({attempts:e.number(),findings:e.number()}),B=e.object({active:e.number(),bundleMtimeMs:e.number().optional(),explorer:M,exploring:e.number(),progress:q,queued:e.number(),sseHealth:e.object({detail:e.string().optional(),ok:e.boolean()}).optional(),version:e.string().optional()}),v=e.enum(["MAX_RUNS","OVERAGE_CAP","MAX_AGENTS","MAX_CONCURRENT_RUNS","MAX_PROJECTS"]),I=e.discriminatedUnion("type",[e.object({code:v,type:e.literal("limit")}),e.object({detail:e.string(),type:e.literal("generic")})]),z=e.discriminatedUnion("kind",[e.object({kind:e.literal("pass")}),e.object({findingLines:e.array(e.string()),kind:e.literal("findings")}),e.object({detail:e.string(),kind:e.literal("error")}),e.object({kind:e.literal("dispatch-error"),reason:I}),e.object({detail:e.string(),kind:e.literal("dispatch-timeout")}),e.object({detail:e.string(),kind:e.literal("infra-error")})]),A=e.discriminatedUnion("kind",[e.object({kind:e.literal("test-started"),runId:e.string(),testName:e.string(),workflowName:e.string()}),e.object({kind:e.literal("test-outcome"),outcome:z,runId:e.string(),testName:e.string(),workflowName:e.string()})]),H=e.object({event:A,jobId:e.string()}),V=e.object({failed:e.number(),jobId:e.string(),notRun:e.number(),passed:e.number()}),Q=e.discriminatedUnion("code",[e.object({code:e.literal("compile-failed"),detail:e.string(),diagnostics:e.array(e.string()).default([])}),e.object({code:e.literal("selection-conflicting-flags")}),e.object({code:e.literal("selection-nothing-selected")}),e.object({code:e.literal("selection-unknown-ids"),known:e.array(e.string()),unknown:e.array(e.string())}),e.object({code:e.literal("scope-failed"),detail:e.string()}),e.object({code:e.literal("app-unreachable"),detail:e.string(),url:e.string()}),e.object({code:e.literal("engine-unreachable"),detail:e.string(),url:e.string()}),e.object({code:e.literal("sync-failed"),detail:e.string()}),e.object({code:e.literal("bad-message")})]),Y=new x("ripplo/enqueue"),Z=new b("ripplo/status"),ee=new b("ripplo/shutdownIfIdle"),te=new f("ripplo/jobEvent"),ne=new f("ripplo/jobDone");export{L as a,_ as b,D as c,J as d,X as e,G as f,K as g,$ as h,B as i,z as j,H as k,V as l,Q as m,Y as n,Z as o,ee as p,te as q,ne as r};
@@ -0,0 +1,48 @@
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 T}from"./chunk-CJUKILIO.js";import{a as F}from"./chunk-NNH3YVVO.js";import{b as $}from"./chunk-KMZ3L5YA.js";var G=15e3,O=3,U=300,f=class extends Error{detail;serverUrl;constructor({detail:r,serverUrl:t}){super(`Failed to connect to Ripplo server at ${t}. Check the server is running and reachable. Details: ${r}`),this.name="GqlConnectionError",this.detail=r,this.serverUrl=t}},c=class extends Error{errors;constructor(r){super(r.map(t=>t.message).join(", ")),this.name="GqlRequestError",this.errors=r}};function N(e){if(e instanceof c)return e.errors[0]?.extensions?.code}var L={attempts:O,timeoutMs:G},V={attempts:1,timeoutMs:3e3};async function A(e){return E(e,L)}async function j(e){return E(e,V)}async function E(e,r){let{print:t}=await import("graphql"),n=t(e.document),o=JSON.stringify({query:n,variables:e.variables}),i=`${e.config.ripploServerUrl}/graphql`,g=await W({init:{body:o,headers:{Authorization:`Bearer ${e.config.token}`,"Content-Type":"application/json",...T()},method:"POST"},policy:r,serverUrl:e.config.ripploServerUrl,url:i}),s=await J({res:g,url:i});if(!Q(s))throw new Error("Invalid GraphQL response");if(K(s))throw new c(s.errors);if(s.data==null)throw new Error("No data returned from server");return s.data}async function W({init:e,policy:r,serverUrl:t,url:n}){let o=1,i=await b({init:e,timeoutMs:r.timeoutMs,url:n});for(;i.retryable&&o<r.attempts;)await H(B(o)),o+=1,i=await b({init:e,timeoutMs:r.timeoutMs,url:n});if(i.response!=null)return i.response;throw new f({detail:i.detail,serverUrl:t})}async function b({init:e,timeoutMs:r,url:t}){try{let n=await fetch(t,{...e,signal:AbortSignal.timeout(r)});return{detail:"",response:n,retryable:n.status>=500}}catch(n){return{detail:n instanceof Error?n.message:String(n),response:void 0,retryable:!0}}}function B(e){return U*3**(e-1)*(.5+Math.random())}function H(e){return new Promise(r=>{setTimeout(r,e)})}async function J({res:e,url:r}){let t=await e.text();if(t.length===0)throw new Error(`Empty response from Ripplo server at ${r} (status ${String(e.status)}). The server may have restarted or the request was rejected before a body was sent.`);try{return JSON.parse(t)}catch{throw new Error(`Non-JSON response from Ripplo server at ${r} (status ${String(e.status)}): ${t.slice(0,200)}`)}}function Q(e){return typeof e=="object"&&e!=null&&("data"in e||"errors"in e)}function K(e){return Array.isArray(e.errors)&&e.errors.length>0}import X from"pino";import Y from"pino-pretty";var y=X({level:process.env.LOG_LEVEL??"info"},Y({ignore:"pid,hostname"}));import{readdir as z,rm as Z,stat as ee}from"fs/promises";import C from"path";var x=C.join(process.cwd(),".ripplo","debug"),k=360*60*1e3;async function re({maxRuns:e}){try{let t=(await z(x,{withFileTypes:!0})).filter(a=>a.isDirectory()),n=Date.now(),o=await Promise.all(t.map(async a=>{let p=C.join(x,a.name),M=await ee(p);return{dirPath:p,mtime:M.mtimeMs}})),i=o.filter(a=>n-a.mtime>k),s=o.filter(a=>n-a.mtime<=k).toSorted((a,p)=>p.mtime-a.mtime).slice(e),v=[...i,...s];if(v.length===0)return;await Promise.allSettled(v.map(a=>Z(a.dirPath,{force:!0,recursive:!0}))),y.debug("Pruned %d old debug run(s)",v.length)}catch{y.warn("Debug run pruning failed, ignoring")}}import l from"fs";import te from"os";import m from"path";var ne=".local",oe=".ripplo";function R(e){return m.join(e,".ripplo",ne)}function ie(e){let r=R(e);l.existsSync(r)||l.mkdirSync(r,{recursive:!0});let t=m.join(r,".gitignore");return l.existsSync(t)||l.writeFileSync(t,`*
5
+ `),r}function ae(e,r){return m.join(R(e),r)}function h(){return m.join(te.homedir(),oe)}function P(){let e=h();return l.existsSync(e)?l.chmodSync(e,448):l.mkdirSync(e,{mode:448,recursive:!0}),e}function S(e){return m.join(h(),e)}import{Agent as se,RetryAgent as le,setGlobalDispatcher as de}from"undici";var ce=1500,me=4e3,ue=3,ge=50,pe=100,I=!1;function fe(){if(I)return;I=!0;let e=new se({connections:pe,keepAliveMaxTimeout:me,keepAliveTimeout:ce}),r=new le(e,{errorCodes:["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT","UND_ERR_REQ_CONTENT_LENGTH_MISMATCH","UND_ERR_SOCKET"],maxRetries:ue,methods:["GET","POST","HEAD","OPTIONS","PUT","DELETE"],minTimeout:ge});de(r)}import{graphql as u}from"gql.tada";var Ue=u(`
6
+ query AgentReviewContextWorker($reviewId: String!) {
7
+ agentReview(id: $reviewId) {
8
+ id
9
+ runId
10
+ agentProfile {
11
+ id
12
+ name
13
+ description
14
+ output
15
+ successCriteria
16
+ }
17
+ }
18
+ }
19
+ `);var Ne=u(`
20
+ mutation StartAgentReviewWorker($reviewId: String!) {
21
+ startAgentReview(reviewId: $reviewId)
22
+ }
23
+ `);var Le=u(`
24
+ mutation CompleteAgentReviewWorker(
25
+ $reviewId: String!
26
+ $markdown: String!
27
+ $shortSummary: String!
28
+ $verdict: AgentReviewVerdict!
29
+ $comments: [AgentReviewCommentInput!]!
30
+ ) {
31
+ completeAgentReview(
32
+ reviewId: $reviewId
33
+ markdown: $markdown
34
+ shortSummary: $shortSummary
35
+ verdict: $verdict
36
+ comments: $comments
37
+ )
38
+ }
39
+ `);var Ve=u(`
40
+ mutation UpdateAgentReviewProgressWorker($reviewId: String!, $text: String!) {
41
+ updateAgentReviewProgress(reviewId: $reviewId, text: $text)
42
+ }
43
+ `);var je=u(`
44
+ mutation FailAgentReviewWorker($reviewId: String!, $reason: String!) {
45
+ failAgentReview(reviewId: $reviewId, reason: $reason)
46
+ }
47
+ `);import d from"fs";import D from"path";function ye(e){let r=process.env.RIPPLO_TOKEN;if(r!=null&&r.trim().length>0)return r.trim();let t=w(e);if(!d.existsSync(t))return null;let n=d.readFileSync(t,"utf8").trim();return n.length===0?null:n}function we({serverUrl:e,token:r}){P();let t=w(e);d.mkdirSync(D.dirname(t),{mode:448,recursive:!0}),d.writeFileSync(t,r+`
48
+ `,{mode:384})}function ve(e){let r=w(e);return d.existsSync(r)?(d.unlinkSync(r),!0):!1}function w(e){return S(D.join("tokens",Re(e)))}function Re(e){return new URL(e).host.replaceAll(/[^a-zA-Z0-9.]/g,"_")}var q=$(F(),1);import _ from"crypto";function he({body:e,secret:r}){let t=new q.Webhook(r),n=`msg_${_.randomUUID()}`,o=new Date,i=t.sign(n,o,e),g=Math.floor(o.getTime()/1e3);return{"webhook-id":n,"webhook-signature":i,"webhook-timestamp":String(g)}}function Pe(){return`whsec_${_.randomBytes(24).toString("base64")}`}export{f as a,c as b,N as c,A as d,j as e,y as f,re as g,ie as h,ae as i,ye as j,we as k,ve as l,w as m,fe as n,he as o,Pe as p};
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __ripploCreateRequire } from "node:module";
3
+ const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
4
+ import{a as r}from"./chunk-OQ6KNYPG.js";import{a as s}from"./chunk-MHNGR6M7.js";import{a as k,b as C,c as F,d as b}from"./chunk-EK6TENV6.js";import{L as $,f as u,k as c,n as f,p as m,q as p,r as g,s as y,t as h,u as S,v,w as o}from"./chunk-ESOXRGIY.js";import{A as d,H as l}from"./chunk-5SM4TCSW.js";async function P({cwd:e,lockfile:n}){let i=c(n),a=b(d(l,n));if(C({context:i,cwd:e})===a)return[];k({context:i,cwd:e});let t=await x(n);return F({cleanLockfileHash:t.length===0?a:null,context:i,cwd:e}),t}async function x(e){let n=u(e),i=await f(e),a=await m({context:c(e),facts:i.facts});return[...g(e).map(t=>({kind:"missing-precondition",missing:t})),...p(n,i.dataRules).map(t=>({gap:t,kind:"cascade-gap"})),...a.map(t=>({conflict:t,kind:"fact-conflict"})),...y(e).map(t=>({kind:"unreachable-interaction",violation:t})),...h(e).map(t=>({kind:"redundant-assertion",redundancy:t})),...S(e).map(t=>({kind:"unmodeled-surface",surface:t})),...v(e).map(t=>({content:t,kind:"unpinned-surface-content"}))]}function U(e){return`${o.good("ok")} \u2014 no static model violations (${r(e,"test")})`}function O(e){let i=e.some(a=>a.kind==="unmodeled-surface")?[`Elements that hide together are one surface. ${s("create","surfaces")}`]:[];return[`${o.bad("fail")} \u2014 ${r(e.length,"static model violation")}:`,...e.map(a=>$(a)),...i].join(`
5
+
6
+ `)}function E(e){return[`${o.warn("warn")} \u2014 ${r(e.length,"model coverage gap")} (not blocking):`,...e.map(n=>` ${A(n)}`),`Stub the missing flows. ${s("discover")}`].join(`
7
+ `)}function A(e){switch(e.kind){case"entity-never-given":return`${e.entity} \u2014 declared but no test seeds it`;case"entity-never-mutated":return`${e.entity} \u2014 seeded but never asserted created/updated/deleted`;case"unmatchable-delete-key":return`test ${e.workflow}/${e.testSlug} asserts ${e.entity} deleted with literal ${e.field} but no seeded ${e.entity} sets ${e.field} \u2014 solver treats it as no-match`}}export{P as a,U as b,O as c,E as d};
@@ -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{readFileSync as o}from"fs";import*as r from"zod/mini";var n=r.object({version:r.string()});function s(){let e=o(new URL("../package.json",import.meta.url),"utf8");return n.parse(JSON.parse(e)).version}export{s as a};
@@ -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 u}from"./chunk-I5BHCICM.js";import{a as f}from"./chunk-JJ4QQPAV.js";import{a as m}from"./chunk-7WZ3VIUU.js";import{f as c}from"./chunk-4W6WIT7T.js";import{i as p}from"./chunk-EK6TENV6.js";import{h as l}from"./chunk-AQ3DMGAY.js";import v from"path";import h from"picomatch";import*as s from"zod/mini";var w=s.looseObject({file_path:s.string()}),R=async n=>{let i=w.safeParse(n.tool_input);if(!i.success)return;let d=i.data.file_path,{cwd:t}=n;if(!m(t)||!c(t))return;let r=v.relative(t,d);if(r.startsWith(".."))return;let{ignorePaths:b,watchPaths:k}=f(),P=h([...k]),g=h([...b]);if(!P(r)||g(r))return;let o=await l(t);if(u({cwd:t,tests:o.isOk()?o.value.workflows.map(e=>({intent:e.intent,name:e.name,sourcePath:e.sourcePath??null,stub:e.stub})):void 0}),o.isErr())return;let a=p(o.value);if(a.length!==0)return{hookSpecificOutput:{additionalContext:`Reminder: stub workflows still unimplemented \u2014 ${a.join(", ")}. Implement with \`workflow("Intent", () => ({ given, steps }))\`.`,hookEventName:"PostToolUse"}}};export{R as a};
@@ -0,0 +1,5 @@
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 s,c as u}from"./chunk-4W6WIT7T.js";import{createHash as d}from"crypto";import{mkdirSync as h,readdirSync as g,readFileSync as p,writeFileSync as m}from"fs";import i from"path";var l=[".ts",".tsx",".js",".jsx"],y=new Set([".local","debug"]);function v(r){let t=d("sha256");return u(r)?(t.update(s(["rev-parse","HEAD"],r)),t.update("\0"),t.update(s(["diff","HEAD"],r)),t.update("\0"),s(["ls-files","--others","--exclude-standard"],r).split(`
5
+ `).filter(e=>e.length>0).filter(e=>l.some(n=>e.endsWith(n))).toSorted((e,n)=>e.localeCompare(n)).forEach(e=>{t.update(e),t.update("\0"),t.update(c(i.join(r,e))),t.update("\0")}),t.digest("hex")):S(r,t)}function A(r,t){try{return p(f(r,t),"utf8").trim()}catch{return null}}function D(r,t,o){let e=f(r,t);h(i.dirname(e),{recursive:!0}),m(e,o)}function S(r,t){let o=i.join(r,".ripplo");return x(o).filter(n=>l.some(a=>n.endsWith(a))).filter(n=>!y.has(n.split(i.sep)[0]??"")).toSorted((n,a)=>n.localeCompare(a)).forEach(n=>{t.update(n),t.update("\0"),t.update(c(i.join(o,n))),t.update("\0")}),t.digest("hex")}function x(r){try{return g(r,{recursive:!0}).filter(t=>typeof t=="string")}catch{return[]}}function c(r){try{return p(r)}catch{return Buffer.alloc(0)}}function f(r,t){return i.join(r,".ripplo",".local",`${t}.hash`)}export{v as a,A as b,D as c};
@@ -0,0 +1,55 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __ripploCreateRequire } from "node:module";
3
+ const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
4
+ import{c as k}from"./chunk-LEFXRK53.js";import{a as P,f as I}from"./chunk-4W6WIT7T.js";import{b as m,e as h,h as w}from"./chunk-AQ3DMGAY.js";import{d as c,f as d}from"./chunk-PE5WVWI5.js";import{L as g,N as S}from"./chunk-5SM4TCSW.js";import u from"fs";import f from"path";function v(e){try{let n=A(e);if(n==null)return;let t=f.join(n,"HEAD"),o=u.readFileSync(t,"utf8").trim(),i="ref: refs/heads/";return o.startsWith(i)?o.slice(i.length):o.length===0?void 0:o.slice(0,7)}catch{return}}function A(e){let n=f.join(e,".git");if(u.statSync(n).isDirectory())return n;let o=u.readFileSync(n,"utf8").trim(),i="gitdir:";if(!o.startsWith(i))return;let s=o.slice(i.length).trim();if(s.length!==0)return f.resolve(e,s)}import b from"crypto";import{readFile as D}from"fs/promises";import x from"path";import{graphql as y}from"gql.tada";import{err as E,ok as L}from"neverthrow";var T=y(`
5
+ mutation SyncDevSession(
6
+ $projectId: String!
7
+ $cwd: String!
8
+ $branch: String
9
+ $lockfileContent: String
10
+ $fixtures: [SyncDevFixtureInput!]
11
+ $entities: [SyncDevEntityInput!]!
12
+ $singletons: [SyncDevSingletonInput!]
13
+ $workflows: [SyncDevWorkflowInput!]!
14
+ ) {
15
+ syncDevSession(
16
+ projectId: $projectId
17
+ cwd: $cwd
18
+ branch: $branch
19
+ lockfileContent: $lockfileContent
20
+ fixtures: $fixtures
21
+ entities: $entities
22
+ singletons: $singletons
23
+ workflows: $workflows
24
+ ) {
25
+ id
26
+ hooksPaused
27
+ }
28
+ }
29
+ `);async function oe(e,n){let t=await w(e);if(t.isErr())return E({error:t.error,kind:"compilation-failed"});let o=await l({config:n,cwd:e,lockfile:t.value});return L({devSessionId:o.devSessionId,lockfile:t.value})}async function l(e){let n=g(e.lockfile);return _({config:e.config,cwd:e.cwd,fixtures:e.lockfile.fixtures,payload:n})}var C=y(`
30
+ query DevSessionSyncState($projectId: String!, $cwd: String!) {
31
+ project(id: $projectId) {
32
+ devSession(cwd: $cwd) {
33
+ id
34
+ hooksPaused
35
+ lockfileHash
36
+ }
37
+ }
38
+ }
39
+ `),F=y(`
40
+ mutation AnnounceDevSessionActive($projectId: String!, $cwd: String!) {
41
+ announceDevSessionActive(projectId: $projectId, cwd: $cwd)
42
+ }
43
+ `);async function re(e){let n=await W(e.cwd);if(n!=null){let o=(await c({config:e.config,document:C,variables:{cwd:e.cwd,projectId:e.config.projectId}}).catch(()=>null))?.project?.devSession;if(o!=null&&o.lockfileHash===n)return await c({config:e.config,document:F,variables:{cwd:e.cwd,projectId:e.config.projectId}}).catch(()=>null),{devSessionId:o.id,hooksPaused:o.hooksPaused}}return l(e)}async function W(e){let n=await R(e);return n==null?null:b.createHash("sha256").update(n).digest("hex")}async function _({config:e,cwd:n,fixtures:t,payload:o}){let i=v(n),s=await R(n),p=await O(n,t),a=await c({config:e,document:T,variables:{branch:i??null,cwd:n,entities:o.entities.map(r=>({description:r.description,name:r.name})),fixtures:p,lockfileContent:s,projectId:e.projectId,singletons:o.singletons.map(r=>({defaultValue:r.defaultValue,description:r.description,name:r.name,type:r.type})),workflows:o.workflows.map(r=>({entities:[...r.entities],expectedOutcome:r.expectedOutcome,name:r.name,slug:r.slug,sourcePath:r.sourcePath,spec:JSON.stringify(r.spec)}))}});if(a.syncDevSession==null)throw new Error("syncDevSession returned null");return{devSessionId:a.syncDevSession.id,hooksPaused:a.syncDevSession.hooksPaused}}async function O(e,n){let t=Object.entries(n);return Promise.all(t.map(async([o,i])=>({contentBase64:(await D(x.join(e,m,o))).toString("base64"),sha256:i.sha256})))}async function R(e){try{return await D(x.join(e,h),"utf8")}catch{return null}}import{graphql as H}from"gql.tada";var q=H(`
44
+ mutation AutoScopeAddDirty($projectId: String!, $cwd: String!, $workflowSlugs: [String!]!) {
45
+ addDirtyTestsToScope(projectId: $projectId, cwd: $cwd, workflowSlugs: $workflowSlugs) {
46
+ __typename
47
+ ... on MutationAddDirtyTestsToScopeSuccess {
48
+ data {
49
+ id
50
+ }
51
+ }
52
+ }
53
+ }
54
+ `);async function ye({cwd:e,editedPath:n,lockfile:t}){if(!I(e))return{addedSlugs:[]};let o=new Set(V(e)),i=t.workflows.filter(r=>r.sourcePath!=null&&M({dirtySet:o,editedPath:n,sourcePath:r.sourcePath})).map(r=>S(r.name));if(i.length===0)return{addedSlugs:[]};let s=k(e).unwrapOr(void 0);return s==null?{addedSlugs:[]}:await l({config:s,cwd:e,lockfile:t}).catch(r=>(d.warn("auto-sync failed: %s",r instanceof Error?r.message:String(r)),null))==null?{addedSlugs:[]}:{addedSlugs:await B({cfg:s,slugs:i})?i:[]}}async function B({cfg:e,slugs:n}){let o=(await c({config:e,document:q,variables:{cwd:e.cwd,projectId:e.projectId,workflowSlugs:[...n]}}).catch(i=>(d.warn("auto-scope failed: %s",i instanceof Error?i.message:String(i)),null)))?.addDirtyTestsToScope;return o?.__typename!=="MutationAddDirtyTestsToScopeSuccess"?!1:o.data.length>0}function M({dirtySet:e,editedPath:n,sourcePath:t}){return e.has(t)||n!=null&&n.endsWith(t)}var $=".ripplo/workflows/",j=" -> ";function V(e){let n;try{n=P(["status","--porcelain","-uall","--",".ripplo/workflows"],e)}catch{return[]}return n.split(`
55
+ `).map(t=>t.slice(3).trim()).map(t=>t.includes(j)?t.split(j)[1]:t).filter(t=>t!=null).filter(t=>t.startsWith($)&&t.endsWith(".ts")).map(t=>t.slice($.length)).filter(t=>t!=="index.ts"&&!t.endsWith("/index.ts"))}export{v as a,oe as b,l as c,re as d,W as e,ye as f,V as g};
@@ -0,0 +1,7 @@
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-KOKEEAEF.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-BNAUL4FC.js").then(o=>o.exitPlanGateHook),"plan-reminder":()=>import("./plan-reminder-VMBDQTAP.js").then(o=>t("UserPromptSubmit",o.planReminder)),"post-edit":()=>import("./post-edit-2VFE6QND.js").then(o=>o.postEditHook),"post-edit-analyze":()=>import("./post-edit-analyze-VETPP5Z4.js").then(o=>t("PostToolUse",o.postEditAnalyze)),"post-edit-flag-stubs":()=>import("./post-edit-flag-stubs-J3MCGLXI.js").then(o=>t("PostToolUse",o.postEditFlagStubs)),"pre-bash-run-gate":()=>import("./pre-bash-run-gate-PWLARIYK.js").then(o=>o.preBashRunGateHook),"pre-edit":()=>import("./pre-edit-Q4U5LSWG.js").then(o=>o.preEditHook),"pre-edit-ripplo-skill-gate":()=>import("./pre-edit-ripplo-skill-gate-JD4BDCA3.js").then(o=>t("PreToolUse",o.preEditRipploSkillGate)),"pre-edit-scope-gate":()=>import("./pre-edit-scope-gate-NZO4HVGT.js").then(o=>t("PreToolUse",o.preEditScopeGate)),"pre-edit-watch-gate":()=>import("./pre-edit-watch-gate-EUZGEH2J.js").then(o=>t("PreToolUse",o.preEditWatchGate)),"prompt-submit":()=>import("./prompt-submit-MPRVCWOI.js").then(o=>o.promptSubmitHook),"scope-reminder":()=>import("./scope-reminder-CBY4I5SG.js").then(o=>t("UserPromptSubmit",o.scopeReminder)),"session-preamble":()=>import("./session-preamble-RJ4WNGJN.js").then(o=>o.sessionPreambleHook),"stop-enforce":()=>import("./stop-enforce-UXBQRTFP.js").then(o=>o.stopEnforceHook),"tasks-reminder":()=>import("./tasks-reminder-LKSUZUFD.js").then(o=>t("UserPromptSubmit",o.tasksReminder)),"tasks-reminder-tool":()=>Promise.resolve(t("PostToolUse",()=>{})),"track-skill-load":()=>import("./track-skill-load-CJ74GD3Q.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-SLG6JHK2.js");process.stderr.write(`${a(o,r.error)}
7
+ `),process.exit(0)}r.stdout!=null&&process.stdout.write(r.stdout),process.exit(0)}function m(){return new Promise((o,e)=>{if(process.stdin.isTTY){o("");return}let i=[];process.stdin.on("data",r=>i.push(r)),process.stdin.on("end",()=>{o(Buffer.concat(i).toString("utf8"))}),process.stdin.on("error",e)})}export{l as a,n as b,P as c};
@@ -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 l}from"./chunk-LB65USNP.js";import{a as i}from"./chunk-OWN4P2K7.js";import{a as m}from"./chunk-7WZ3VIUU.js";var s=/(?:^|\s)\/ripplo:([a-z][a-z0-9-]*)\b/gi,c=o=>{if(!m(o.cwd))return;let t=[...o.prompt.matchAll(s)].map(r=>r[1]).filter(r=>r!=null);if(t.forEach(r=>{i(o.cwd,o.session_id,r)}),t.length===0)return;let e=l(o.cwd,o.session_id);if(e!=null)return{hookSpecificOutput:{additionalContext:e,hookEventName:"UserPromptSubmit"}}};export{c as a};
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __ripploCreateRequire } from "node:module";
3
+ const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
4
+ import{f as a}from"./chunk-EGETJKAQ.js";import{a as n}from"./chunk-AVBP7Q2M.js";import{i}from"./chunk-EK6TENV6.js";import{h as e}from"./chunk-AQ3DMGAY.js";import{i as u}from"./chunk-M7VQD4VO.js";async function x(m){let o=process.cwd(),r=await e(o);r.isErr()&&(process.stderr.write(`${n(r.error)}
5
+ `),process.exit(1));let s=i(r.value),t=await a(o);if(m.format==="summary"){s.length>0&&process.stdout.write(`stub workflows: ${s.join(", ")}
6
+ `),process.stdout.write(`${u(t)}
7
+ `);return}let p={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:s.map(d=>({id:d,implemented:!1}))};process.stdout.write(`${JSON.stringify(p,null,2)}
8
+ `)}export{x as a};
@@ -0,0 +1,16 @@
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}from"./chunk-JJ4QQPAV.js";import{c}from"./chunk-LEFXRK53.js";import{a as p}from"./chunk-7WZ3VIUU.js";import{f as d}from"./chunk-4W6WIT7T.js";import{b as a}from"./chunk-MHNGR6M7.js";import{e as s}from"./chunk-PE5WVWI5.js";import f from"path";import u from"picomatch";import{graphql as m}from"gql.tada";import*as n from"zod/mini";var h=new Set(["Edit","Write","NotebookEdit"]),g=n.looseObject({file_path:n.string()}),S=m(`
5
+ query PreEditScopeGate($projectId: String!, $cwd: String!) {
6
+ project(id: $projectId) {
7
+ id
8
+ devSession(cwd: $cwd) {
9
+ id
10
+ scopeItems {
11
+ id
12
+ }
13
+ }
14
+ }
15
+ }
16
+ `),O=async o=>{if(!h.has(o.tool_name))return;let e=g.safeParse(o.tool_input);if(!e.success)return;let{cwd:t}=o;if(!p(t)||!d(t))return;let r=f.relative(t,e.data.file_path);if(r.startsWith("..")||r===".ripplo"||r.startsWith(".ripplo/")||b(r)||!k(r))return;let i=await w(t);return i.populated?i.degradedReason!=null?{hookSpecificOutput:{additionalContext:`Scope check skipped (${i.degradedReason}) \u2014 edit allowed through, but the scope guardrail isn't enforcing on this edit.`,hookEventName:"PreToolUse"}}:void 0:{hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"deny",permissionDecisionReason:`Scope is empty but this edit touches app code (${r}). Stub a test or \`scope add\` an existing one before proceeding \u2014 or acknowledge "no user-facing behavior" if pure refactor. Hook re-fires until scope is populated (or hooks paused via the web UI). ${a(["run","create"])}`}}};function b(o){let e=o.split(f.sep);return e.includes("test")||e.includes("ripplo")}function k(o){let{ignorePaths:e,watchPaths:t}=l(),r=u([...t]),i=u([...e]);return r(o)&&!i(o)}async function w(o){let e=c(o).unwrapOr(void 0);if(e==null)return{degradedReason:"no project config \u2014 `npx ripplo init` not run here",populated:!0};let t=await s({config:e,document:S,variables:{cwd:e.cwd,projectId:e.projectId}}).catch(()=>null);return t==null?{degradedReason:"server unreachable",populated:!0}:{degradedReason:null,populated:(t.project?.devSession?.scopeItems??[]).length>0}}export{O as a};
@@ -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,b,c}from"./chunk-2MT2MZJW.js";import"./chunk-AVBP7Q2M.js";import"./chunk-MHNGR6M7.js";import"./chunk-AQ3DMGAY.js";import"./chunk-5SM4TCSW.js";import"./chunk-KMZ3L5YA.js";export{b as renderCliFailure,c as renderHookCrash,a as renderTopLevelError};
@@ -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{e as a,f as b,g as c,h as d,i as e}from"./chunk-EK6TENV6.js";import"./chunk-AQ3DMGAY.js";import"./chunk-ESOXRGIY.js";import"./chunk-5SM4TCSW.js";import"./chunk-NNH3YVVO.js";import"./chunk-KMZ3L5YA.js";export{a as compileAndWrite,c as stampedLockfile,d as stampedLockfileFromDisk,e as stubbedWorkflows,b as writeStampedLockfile};