ripplo 0.10.0 → 0.11.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 (99) hide show
  1. package/README.md +105 -47
  2. package/dist/assets/rrweb-replay.js +1 -1
  3. package/dist/assets/rrweb.js +1 -1
  4. package/dist/capture-worker.js +20 -14
  5. package/dist/chunk-2TA4WDEE.js +4 -0
  6. package/dist/{chunk-5E62BCS7.js → chunk-47LLHHJH.js} +2 -2
  7. package/dist/chunk-4LXIRKM7.js +4 -0
  8. package/dist/chunk-5HFJIZLI.js +4 -0
  9. package/dist/chunk-5HZ2LDFS.js +83 -0
  10. package/dist/chunk-5VXXRMJU.js +354 -0
  11. package/dist/chunk-6U2LNGSV.js +51 -0
  12. package/dist/{chunk-LL4HUOJP.js → chunk-6WFJZ5L6.js} +1 -1
  13. package/dist/chunk-7JKCHASU.js +4 -0
  14. package/dist/{chunk-WNAVYV4P.js → chunk-AXROBTLA.js} +1 -1
  15. package/dist/chunk-BGY5F3IU.js +5 -0
  16. package/dist/{chunk-IPSXNIXC.js → chunk-C7SV6AR2.js} +4 -4
  17. package/dist/chunk-CI6273ZU.js +107 -0
  18. package/dist/chunk-D6TS77JP.js +8 -0
  19. package/dist/{chunk-QAR7FZO3.js → chunk-EEOTA6M4.js} +1 -1
  20. package/dist/{chunk-UDPKOYZT.js → chunk-EQORLKHG.js} +1 -1
  21. package/dist/chunk-F4P36OMG.js +9 -0
  22. package/dist/chunk-G6J2WIHJ.js +4 -0
  23. package/dist/{chunk-LOEAZGYO.js → chunk-HEOMRXZE.js} +1 -1
  24. package/dist/{chunk-7W237JFM.js → chunk-JS3DLVVI.js} +1 -1
  25. package/dist/{chunk-TPHOSZAK.js → chunk-KH4QH23U.js} +1 -1
  26. package/dist/{chunk-43C7VPGA.js → chunk-LWMXGWS2.js} +1 -1
  27. package/dist/{chunk-YQ2RBEOJ.js → chunk-PXXURBGC.js} +2 -2
  28. package/dist/{chunk-OAU4HUD2.js → chunk-PYDYI3AA.js} +2 -2
  29. package/dist/{chunk-R3DZ6JPY.js → chunk-RIASQHPG.js} +1 -1
  30. package/dist/chunk-ROO3KF74.js +6 -0
  31. package/dist/chunk-SXVWB7TZ.js +6 -0
  32. package/dist/{chunk-4OSYMIH6.js → chunk-UC54UNEX.js} +1 -1
  33. package/dist/{chunk-5X4M4MTG.js → chunk-UFXH75WD.js} +3 -3
  34. package/dist/chunk-WAGXAEB4.js +13 -0
  35. package/dist/{chunk-CEVQ5RNC.js → chunk-WCMWNWNM.js} +2 -2
  36. package/dist/{chunk-AGK6XOX2.js → chunk-XAMVRZJH.js} +2 -2
  37. package/dist/chunk-ZHDR7LXB.js +56 -0
  38. package/dist/chunk-ZM2UPFCR.js +7 -0
  39. package/dist/{cli-error-AHNJULLG.js → cli-error-6PUIWNIT.js} +1 -1
  40. package/dist/{compile-write-OLQOR3OK.js → compile-write-N3PWYUKE.js} +1 -1
  41. package/dist/daemon-SAV2CLXD.js +4 -0
  42. package/dist/daemon-X77GWCFM.js +152 -0
  43. package/dist/{daemon-lock-OAARBZ4O.js → daemon-lock-RPKO5SNE.js} +1 -1
  44. package/dist/dsl-loader-WPAKMON7.js +4 -0
  45. package/dist/dsl-typecheck-worker.js +6 -0
  46. package/dist/{exit-plan-gate-CJ3IXWTN.js → exit-plan-gate-44YWEKYS.js} +1 -1
  47. package/dist/hook.js +1 -1
  48. package/dist/index.js +211 -260
  49. package/dist/{plan-reminder-EPCNBFY3.js → plan-reminder-YX375SPX.js} +1 -1
  50. package/dist/post-edit-7W6AHXE6.js +4 -0
  51. package/dist/post-edit-analyze-PO54GIZ3.js +4 -0
  52. package/dist/post-edit-flag-stubs-G3G2FO6Z.js +4 -0
  53. package/dist/pre-bash-run-gate-MIEM2DBB.js +4 -0
  54. package/dist/pre-edit-C4MGURNO.js +4 -0
  55. package/dist/pre-edit-ripplo-skill-gate-A6ETC3QN.js +4 -0
  56. package/dist/pre-edit-scope-gate-M5IQSVGF.js +4 -0
  57. package/dist/{pre-edit-watch-gate-BUFWLXR3.js → pre-edit-watch-gate-ORQP7MSW.js} +1 -1
  58. package/dist/prompt-submit-YOKR2RQN.js +4 -0
  59. package/dist/scope-reminder-A6GVTTVE.js +4 -0
  60. package/dist/session-preamble-IZQPIWST.js +4 -0
  61. package/dist/status-HOJW4C3O.js +4 -0
  62. package/dist/{stop-enforce-4XV6LK7Z.js → stop-enforce-JT3SWBU4.js} +9 -9
  63. package/dist/tasks-reminder-TDWPD3KV.js +4 -0
  64. package/dist/{track-skill-load-CJ74GD3Q.js → track-skill-load-SXSDMHFO.js} +1 -1
  65. package/dist/{track-skill-prompt-YSB6OOQN.js → track-skill-prompt-7N4TQAD2.js} +1 -1
  66. package/package.json +3 -5
  67. package/dist/chunk-26A42N75.js +0 -55
  68. package/dist/chunk-44GHUVW6.js +0 -8
  69. package/dist/chunk-67YR3QHA.js +0 -6
  70. package/dist/chunk-6NKSEWP6.js +0 -224
  71. package/dist/chunk-6TCK75ER.js +0 -83
  72. package/dist/chunk-73TKORK6.js +0 -8
  73. package/dist/chunk-CB74TAUC.js +0 -5
  74. package/dist/chunk-FXCBWBN5.js +0 -4
  75. package/dist/chunk-GOZWOCTE.js +0 -7
  76. package/dist/chunk-IONMYZ3K.js +0 -4
  77. package/dist/chunk-LB65USNP.js +0 -73
  78. package/dist/chunk-M3CXHDFV.js +0 -9
  79. package/dist/chunk-MOI4L3EX.js +0 -4
  80. package/dist/chunk-N2OBRCPQ.js +0 -6
  81. package/dist/chunk-OWN4P2K7.js +0 -4
  82. package/dist/chunk-SNU66GSR.js +0 -4
  83. package/dist/chunk-VDAFHS7J.js +0 -7
  84. package/dist/chunk-VOZOP7MQ.js +0 -55
  85. package/dist/daemon-BJAGK2Q3.js +0 -152
  86. package/dist/daemon-H4P5PCVH.js +0 -4
  87. package/dist/dsl-loader-LXH6PUY5.js +0 -4
  88. package/dist/post-edit-ZVCYZ62V.js +0 -4
  89. package/dist/post-edit-analyze-J2H3I3IO.js +0 -4
  90. package/dist/post-edit-flag-stubs-E22KT2LD.js +0 -4
  91. package/dist/pre-bash-run-gate-B42YNDQF.js +0 -4
  92. package/dist/pre-edit-TEN3AFRK.js +0 -4
  93. package/dist/pre-edit-ripplo-skill-gate-QHUD7QGU.js +0 -4
  94. package/dist/pre-edit-scope-gate-2YIFSEDY.js +0 -4
  95. package/dist/prompt-submit-DJFWNGYC.js +0 -4
  96. package/dist/scope-reminder-DIDCHDAA.js +0 -4
  97. package/dist/session-preamble-ZYVRDSGA.js +0 -4
  98. package/dist/status-FDM2RK37.js +0 -4
  99. package/dist/tasks-reminder-SDS6RNLP.js +0 -4
@@ -0,0 +1,107 @@
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 o,d as r}from"./chunk-G6J2WIHJ.js";import{a}from"./chunk-7WZ3VIUU.js";var n=`# How Ripplo thinks
5
+
6
+ This model drives compile errors, run failures, and explorer findings.
7
+
8
+ **Done has two halves.** The app delivers the behavior, and a passing workflow proves the complete
9
+ user journey. Neither half is optional.
10
+
11
+ ## Workflow, test, and run
12
+
13
+ A **workflow** is the authored model of one critical user intent. It follows the real multi-step
14
+ click path from a natural entry point and declares what each action makes true.
15
+
16
+ A **test** is one concrete state synthesized from that workflow for a reachable named \`when\`
17
+ branch. A workflow without branches has one \`main\` test. A **run** executes one test. Authors edit
18
+ workflows, not concrete test state.
19
+
20
+ ## One typed application-state model
21
+
22
+ One root Zod schema defines application state. Each top-level key is a source that returns one
23
+ validated state blob. Sources can be served over HTTP or from the browser without changing workflow
24
+ selectors. Authentication is separate because signing in creates a browser session.
25
+
26
+ Use \`setup.value\`, \`setup.generated\`, and \`setup.record\` only where workflows may create
27
+ starting state. Plain Zod fields remain observable. TypeScript derives each source's setup and read
28
+ contract from the schema.
29
+
30
+ ## Start wide and stay connected
31
+
32
+ \`given\` is not a fixture. It describes the widest set of starting states compatible with the
33
+ entire journey. Add only structural presence, absence, relations, permissions, actor, viewport, and
34
+ other preconditions every step truly needs.
35
+
36
+ Omit irrelevant record fields. Setup generates them from the schema, and returned record handles
37
+ expose their values. Use \`arbitrary(field)\` for a workflow input that can be any schema-valid
38
+ value. Reuse that binding in actions and effects. Use \`exact(value)\` only when the concrete string
39
+ or number drives behavior.
40
+
41
+ State-rendered names, ids, slugs, counts, amounts, inputs, and URLs come from handles or expressions.
42
+ Repeating a setup literal in a locator or action creates drift and narrows the journey.
43
+
44
+ When starting state changes an outcome but the intent and click path stay the same, use
45
+ \`optional()\` and named \`when\` branches. Branch conditions constrain synthesis directly. Use
46
+ another workflow only when the intent or path differs.
47
+
48
+ ## Steps declare complete transitions
49
+
50
+ A step declares the user action, its page result, and every application-state effect. A toast or
51
+ closed dialog does not prove a write persisted. Declare \`created\`, \`updated\`, \`deleted\`,
52
+ \`set\`, or \`transform\` alongside visible evidence.
53
+
54
+ Every effect must definitely change state from what \`given\`, its branch, and earlier steps
55
+ establish. A possible no-op is invalid. Use a before/after relation that excludes equality or model
56
+ the real precondition. Do not hardcode a convenient previous value solely to satisfy the proof.
57
+
58
+ Ripplo applies a frame rule: state persists until a declared effect changes it. Any observed change
59
+ outside the declared effects is a frame violation. Cascades must be declared completely.
60
+
61
+ ## Reachability and page state
62
+
63
+ An action can touch only an element an earlier durable \`visible(...)\` established. Assert the
64
+ surface or control when it first appears. Use semantic roles such as \`button\`, \`textbox\`,
65
+ \`heading\`, and \`link\`. Add an accessible name to the app when one is missing.
66
+
67
+ \`text(locator, "x")\` and \`value(locator, "x")\` are exact. Use \`contains("x")\` or
68
+ \`startsWith("x")\` only when that broader relationship is intended.
69
+
70
+ ## Facts keep their conditions
71
+
72
+ Workflow assertions become facts under the complete application and page state declared at that
73
+ step. They are not generalized beyond those conditions. The explorer reuses those exact facts on
74
+ compatible composed paths.
75
+
76
+ Two facts that disagree on overlapping state are a compile error. Add the missing distinguishing
77
+ state or split the outcome with \`when\`.
78
+
79
+ Use \`fact()\` only for a true app-wide invariant or permission boundary that no journey owns. Do
80
+ not replace a journey, branch, or missing effect with a broad fact.
81
+
82
+ ## What each gate proves
83
+
84
+ - \`npx ripplo compile\` validates authoring, branch reachability, definite effects, fact
85
+ consistency, interaction reachability, and the lockfile.
86
+ - \`npx ripplo run\` compares every declared page and application-state expectation with the live
87
+ app after each step.
88
+ - The explorer composes declared steps and reports contradictions on paths no workflow wrote.
89
+
90
+ On failure, run \`npx ripplo explain <runId>\` and inspect \`behavior.jsonl\` before re-running.
91
+ Form one evidence-backed hypothesis, make one change, then run once.
92
+
93
+ \`.wait("slow")\` gives a page predicate more time. \`consistency.eventual(schema)\` marks a state
94
+ field whose source may legitimately expose intermediate values before converging. A longer wait
95
+ must not hide a wrong value.
96
+
97
+ ## Scope and the prime directive
98
+
99
+ Testing Scope is the set of workflows this session must leave green. Add every affected journey.
100
+ A stub \`workflow("Intent")\` is a promise that must be implemented before finishing.
101
+
102
+ Fix broken behavior in the app. Strengthen an incomplete model in the workflow. Never weaken a
103
+ declaration, replace state-derived values with literals, or narrow starting state merely to turn a
104
+ failure green.
105
+
106
+ \`.ripplo/ripplo.lock\` is committed, regenerated by \`npx ripplo compile\`, and never hand-edited.
107
+ `;function l(e,t){return!a(e)||r(e,t)?null:(o(e,t),n)}export{l 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{g as m}from"./chunk-6U2LNGSV.js";import{a as f,c as k}from"./chunk-ROO3KF74.js";import{a as h}from"./chunk-OQ6KNYPG.js";import{a as y}from"./chunk-WAGXAEB4.js";import{a as s}from"./chunk-MHNGR6M7.js";import{h as d,i as p}from"./chunk-4LXIRKM7.js";import{n as u}from"./chunk-5HZ2LDFS.js";import{a as c}from"./chunk-7WZ3VIUU.js";import{f as l}from"./chunk-KH4QH23U.js";import*as a from"zod/mini";var S=a.looseObject({file_path:a.string()}),H=async e=>{let n=S.safeParse(e.tool_input);if(!n.success||!/\/\.ripplo\/.*\.ts$/.test(n.data.file_path))return;let{cwd:o}=e;if(!c(o))return;if(!l(o))return{hookSpecificOutput:{additionalContext:"Ripplo hooks are paused \u2014 DSL compile and lockfile sync did not run for this edit. Resume with `npx ripplo hooks resume` when ready.",hookEventName:"PostToolUse"}};let r=await d(o);if(r.isErr())return{decision:"block",reason:`${y(r.error)}
5
+ ${s("create","DSL authoring rules")}`};let t=await b({cwd:o,filePath:n.data.file_path,lockfile:r.value});if("block"in t)return{decision:"block",reason:t.block};let{addedSlugs:i}=await m({cwd:o,editedPath:n.data.file_path,lockfile:r.value,requireHooks:!0,syncFirst:!0});return z(P({addedSlugs:i,elsewhere:t.elsewhere}))};function P({addedSlugs:e,elsewhere:n}){return[...e.length>0?[`Auto-scoped ${e.join(", ")} (dirty tests).`]:[],...n>0?[g(n).trimStart()]:[]]}async function b({cwd:e,filePath:n,lockfile:o}){let r=f({cwd:e,lockfile:o});await p(e,o);let t=A(r,o,n),i=r.length-t.length;return t.length===0?{elsewhere:i}:{block:`${k(t)}${g(i)}
6
+ ${s("create")}`}}function A(e,n,o){let r=new Set(u(n).filter(({workflow:t})=>t.sourcePath!=null&&o.endsWith(t.sourcePath)).map(({ref:t})=>t));return r.size===0?e:e.filter(t=>{let i=w(t);return i==null||r.has(i)})}function w(e){return e.kind==="unreachable-interaction"?e.violation.test:e.kind==="redundant-assertion"?e.redundancy.test:e.kind==="undecided-action-consequence"?e.consequence.test:null}function g(e){return e===0?"":`
7
+ ${h(e,"finding")} in other files \u2014 \`npx ripplo compile\` for the full list.`}function z(e){if(e.length!==0)return{hookSpecificOutput:{additionalContext:e.join(`
8
+ `),hookEventName:"PostToolUse"}}}export{H as a};
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __ripploCreateRequire } from "node:module";
3
3
  const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
4
- import{a as S,d as u,e as y,f as E,h as w,i as C,k as b,l as g,m as R,n as h,o as v,p as m,q as M,r as N}from"./chunk-IONMYZ3K.js";import{a as P}from"./chunk-R4ZTRVDQ.js";import{i as D}from"./chunk-IPSXNIXC.js";import{spawn as L}from"child_process";import q from"fs";import V from"net";import{setTimeout as p}from"timers/promises";import{err as d,ok as f}from"neverthrow";import{ResponseError as j}from"vscode-jsonrpc/node";var I=12e4,_=300,x=5e3;async function an({cliEntry:o,cwd:n}){let e=u(n),t=await s(e);return t!=null?A({cliEntry:o,connection:l(t,!1),cwd:n}):T({cliEntry:o,cwd:n,versionNote:void 0})}async function sn({cliEntry:o,cwd:n}){let e=await s(u(n));return e==null?d({kind:"not-running"}):A({cliEntry:o,connection:l(e,!1),cwd:n})}async function T({cliEntry:o,cwd:n,versionNote:e}){let t=H({cliEntry:o,cwd:n});if(t!=null)return d(t);let r=await Q(u(n));return r==null?d({deadlineMs:I,kind:"connect-timeout",logPath:y(n)}):f({...l(r,!0),versionNote:e})}async function A({cliEntry:o,connection:n,cwd:e}){let t=await O(n);if(t==null||t.version===P()&&!G(t))return f(n);let r={daemonVersion:t.version};return await J(n)?(n.socket.destroy(),await B(u(e))?T({cliEntry:o,cwd:e,versionNote:{...r,kind:"restarted"}}):d({kind:"connection-lost"})):f({...n,versionNote:{...r,kind:"stale-busy"}})}var U=1e3;function G(o){let n=S(process.argv[1]);return n==null||o.bundleMtimeMs==null?!1:n>o.bundleMtimeMs+U}async function J(o){try{return await o.rpc.sendRequest(m)}catch{return!1}}var K=1e4;async function B(o){let n=Date.now()+K,e=await s(o);for(;e!=null&&Date.now()<n;)e.destroy(),await p(_),e=await s(o);return e?.destroy(),e==null}async function cn({connection:o,onEvent:n,request:e,token:t}){let r=await F({connection:o,onEvent:n,request:e,token:t});return r.kind==="transport"?d(r.error):f(r)}async function un(o){let n=await s(u(o));if(n==null)return!1;let e=l(n,!1);try{return await e.rpc.sendRequest(m)}catch{return!1}finally{n.destroy()}}async function dn(o){try{await o.rpc.sendRequest(m)}catch{}}async function ln(o){let n=await s(u(o));if(n==null)return{kind:"not-running"};let e=l(n,!1),t=await Promise.race([O(e),p(x).then(()=>null)]);return n.destroy(),t==null?{kind:"unresponsive",timeoutMs:x}:{kind:"running",status:t}}async function O(o){try{let n=await o.rpc.sendRequest(v),e=C.safeParse(n);return e.success?e.data:null}catch{return null}}function F({connection:o,onEvent:n,request:e,token:t}){let{rpc:r}=o;return new Promise(k=>{let i=a=>{k(a)};r.onNotification(M,a=>{let c=b.safeParse(a);if(!c.success){i({error:{kind:"bad-frame"},kind:"transport"});return}n(c.data.event)}),r.onNotification(N,a=>{let c=g.safeParse(a);if(!c.success){i({error:{kind:"bad-frame"},kind:"transport"});return}i({failed:c.data.failed,kind:"done",notRun:c.data.notRun,passed:c.data.passed})}),r.onClose(()=>{i({error:{kind:"connection-lost"},kind:"transport"})}),r.sendRequest(h,e,t).then(a=>{w.safeParse(a).success||i({error:{kind:"bad-frame"},kind:"transport"})}).catch(a=>{i(z(a))})})}function z(o){if(o instanceof j){let n=R.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=E(o);return e.listen(),{rpc:e,socket:o,spawned:n,versionNote:void 0}}function s(o){return new Promise(n=>{let e=V.connect(o);e.once("connect",()=>{n(e)}),e.once("error",()=>{n(null)})})}function H({cliEntry:o,cwd:n}){try{D(n);let e=q.openSync(y(n),"a");return L(process.execPath,[o,"daemon"],{cwd:n,detached:!0,stdio:["ignore",e,e]}).unref(),q.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()+I,e=await s(o);for(;e==null&&Date.now()<n;)await p(_),e=await s(o);return e}export{an as a,sn as b,cn as c,un as d,dn as e,ln as f};
4
+ import{a as S,d as u,e as y,f as E,h as w,i as C,k as b,l as g,m as R,n as h,o as v,p as m,q as M,r as N}from"./chunk-2TA4WDEE.js";import{a as D}from"./chunk-R4ZTRVDQ.js";import{i as P}from"./chunk-C7SV6AR2.js";import{spawn as L}from"child_process";import q from"fs";import V from"net";import{setTimeout as p}from"timers/promises";import{err as d,ok as f}from"neverthrow";import{ResponseError as j}from"vscode-jsonrpc/node";var I=12e4,_=300,x=5e3;async function an({cliEntry:o,cwd:n}){let e=u(n),t=await s(e);return t!=null?A({cliEntry:o,connection:l(t,!1),cwd:n}):T({cliEntry:o,cwd:n,versionNote:void 0})}async function sn({cliEntry:o,cwd:n}){let e=await s(u(n));return e==null?d({kind:"not-running"}):A({cliEntry:o,connection:l(e,!1),cwd:n})}async function T({cliEntry:o,cwd:n,versionNote:e}){let t=H({cliEntry:o,cwd:n});if(t!=null)return d(t);let r=await Q(u(n));return r==null?d({deadlineMs:I,kind:"connect-timeout",logPath:y(n)}):f({...l(r,!0),versionNote:e})}async function A({cliEntry:o,connection:n,cwd:e}){let t=await O(n);if(t==null||t.version===D()&&!G(t))return f(n);let r={daemonVersion:t.version};return await J(n)?(n.socket.destroy(),await B(u(e))?T({cliEntry:o,cwd:e,versionNote:{...r,kind:"restarted"}}):d({kind:"connection-lost"})):f({...n,versionNote:{...r,kind:"stale-busy"}})}var U=1e3;function G(o){let n=S(process.argv[1]);return n==null||o.bundleMtimeMs==null?!1:n>o.bundleMtimeMs+U}async function J(o){try{return await o.rpc.sendRequest(m)}catch{return!1}}var K=1e4;async function B(o){let n=Date.now()+K,e=await s(o);for(;e!=null&&Date.now()<n;)e.destroy(),await p(_),e=await s(o);return e?.destroy(),e==null}async function cn({connection:o,onEvent:n,request:e,token:t}){let r=await F({connection:o,onEvent:n,request:e,token:t});return r.kind==="transport"?d(r.error):f(r)}async function un(o){let n=await s(u(o));if(n==null)return!1;let e=l(n,!1);try{return await e.rpc.sendRequest(m)}catch{return!1}finally{n.destroy()}}async function dn(o){try{await o.rpc.sendRequest(m)}catch{}}async function ln(o){let n=await s(u(o));if(n==null)return{kind:"not-running"};let e=l(n,!1),t=await Promise.race([O(e),p(x).then(()=>null)]);return n.destroy(),t==null?{kind:"unresponsive",timeoutMs:x}:{kind:"running",status:t}}async function O(o){try{let n=await o.rpc.sendRequest(v),e=C.safeParse(n);return e.success?e.data:null}catch{return null}}function F({connection:o,onEvent:n,request:e,token:t}){let{rpc:r}=o;return new Promise(k=>{let i=a=>{k(a)};r.onNotification(M,a=>{let c=b.safeParse(a);if(!c.success){i({error:{kind:"bad-frame"},kind:"transport"});return}n(c.data.event)}),r.onNotification(N,a=>{let c=g.safeParse(a);if(!c.success){i({error:{kind:"bad-frame"},kind:"transport"});return}i({failed:c.data.failed,kind:"done",notRun:c.data.notRun,passed:c.data.passed})}),r.onClose(()=>{i({error:{kind:"connection-lost"},kind:"transport"})}),r.sendRequest(h,e,t).then(a=>{w.safeParse(a).success||i({error:{kind:"bad-frame"},kind:"transport"})}).catch(a=>{i(z(a))})})}function z(o){if(o instanceof j){let n=R.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=E(o);return e.listen(),{rpc:e,socket:o,spawned:n,versionNote:void 0}}function s(o){return new Promise(n=>{let e=V.connect(o);e.once("connect",()=>{n(e)}),e.once("error",()=>{n(null)})})}function H({cliEntry:o,cwd:n}){try{P(n);let e=q.openSync(y(n),"a");return L(process.execPath,[o,"daemon"],{cwd:n,detached:!0,stdio:["ignore",e,e]}).unref(),q.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()+I,e=await s(o);for(;e==null&&Date.now()<n;)await p(_),e=await s(o);return e}export{an as a,sn as b,cn as c,un as d,dn as e,ln as f};
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __ripploCreateRequire } from "node:module";
3
3
  const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
4
- import{b as u}from"./chunk-N2OBRCPQ.js";import{a as f}from"./chunk-JJ4QQPAV.js";import{a as m}from"./chunk-7WZ3VIUU.js";import{f as c}from"./chunk-TPHOSZAK.js";import{l as p}from"./chunk-FXCBWBN5.js";import{n as l}from"./chunk-67YR3QHA.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};
4
+ import{b as u}from"./chunk-SXVWB7TZ.js";import{a as f}from"./chunk-JJ4QQPAV.js";import{l as c}from"./chunk-4LXIRKM7.js";import{m as p}from"./chunk-7JKCHASU.js";import{a as m}from"./chunk-7WZ3VIUU.js";import{f as l}from"./chunk-KH4QH23U.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)||!l(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 p(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=c(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,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 g}from"./chunk-OQ6KNYPG.js";import{c as d}from"./chunk-JS3DLVVI.js";import{c as u}from"./chunk-FEHVIHVA.js";import{a}from"./chunk-MHNGR6M7.js";import{e as t,j as c}from"./chunk-5HZ2LDFS.js";import{Ba as l}from"./chunk-ZHDR7LXB.js";var f=3e3;async function U(e){u(e);let r=d(e).unwrapOr(void 0);if(r==null)return null;try{return await fetch(`${r.ripploServerUrl}/health`,{signal:AbortSignal.timeout(f)}),null}catch(n){return{detail:n instanceof Error?n.message:String(n),serverUrl:r.ripploServerUrl}}}function p(e){return e.includes("localhost")||e.includes("127.0.0.1")}import C from"fuse.js";function m(e){let r=h(e.activity),n=E(e);return n.length===0?r:`${r} \u2014 ${n}`}function h(e){switch(e.kind){case"waitingForRunner":return $(e);case"settingUpState":{let r=e.activeSources.length===0?"":` from ${e.activeSources.join(", ")}`;return`${S(e.stage)}${r}`}case"signingIn":return"Signing in the test user";case"startingBrowser":return"Starting the test browser";case"executingStep":return`${`Step ${String(e.stepIndex+1)} of ${String(e.stepCount)}`}: ${y(e.stage)}`;case"finishing":return e.stage==="cleaningUp"?"Cleaning up the test state":"Saving the run result";case"uploadingReplay":return"Uploading the replay"}}function $(e){let r=e.capacity==null?"":` (${String(e.capacity.active)} of ${String(e.capacity.limit)} runners active)`;switch(e.reason){case"cloudCapacity":return`Waiting for cloud capacity${r}`;case"runnerStarting":return"Starting a test runner";case"localRunnerBusy":return"Waiting for an available local runner"}}function S(e){switch(e){case"clearing":return"Clearing existing test state";case"materializing":return"Creating the starting state";case"verifying":return"Verifying the starting state"}}function y(e){switch(e.kind){case"performingAction":return k(e.action);case"waitingForApp":return`Waiting for the app at ${e.path}`;case"readingState":return"Reading application state";case"verifyingEffects":return"Verifying the declared state changes";case"checkingExpectations":return w(e.remaining)}}function k(e){switch(e.kind){case"goto":return`Opening ${e.path}`;case"fill":return`Filling ${e.target}`;case"clear":return`Clearing ${e.target}`;case"click":return`Clicking ${e.target}`;case"dblclick":return`Double-clicking ${e.target}`;case"select":return`Selecting an option in ${e.target}`;case"check":return`Checking ${e.target}`;case"uncheck":return`Unchecking ${e.target}`;case"hover":return`Hovering over ${e.target}`;case"upload":return`Uploading a file through ${e.target}`;case"press":return e.target==null?`Pressing ${e.key}`:`Pressing ${e.key} in ${e.target}`;case"drag":return`Dragging ${e.source} to ${e.target}`;case"actor":return"Switching the signed-in user"}}function w(e){if(e.length===0)return"All expectations passed";let r=e.map(n=>R(n)).join("; ");return`Checking ${String(e.length)} ${e.length===1?"expectation":"expectations"}: ${r}`}function R(e){let r=e.negated?"not ":"";return e.kind==="browser"?`${r}${e.subject}`:`${r}${e.check} ${e.target}`}function E(e){let r=b(e.retry);return[e.deadlineAt==null?null:`${String(Math.max(0,Math.ceil((Date.parse(e.deadlineAt)-Date.now())/1e3)))}s until timeout`,r].filter(i=>i!=null).join(", ")}function b(e){return e==null?null:e.limit==null?`attempt ${String(e.attempt)}`:`attempt ${String(e.attempt)} of ${String(e.limit)}`}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 r=e.known,n=e.unknown.flatMap(o=>I(o,r)),i=n.length>0?[`Did you mean: ${[...new Set(n)].join(", ")}`]:[];return[`Unknown ${e.unknown.length===1?"id":"ids"}: ${e.unknown.join(", ")}`,...i,"Pass a workflow slug for all its tests, or workflow/test for one. Known workflows:",...r.map(o=>` ${o}`)].join(`
5
+ `)}}}function W({failed:e,notRun:r,passed:n}){let i=r>0?`, ${String(r)} not run`:"";return`${String(n)} passed, ${String(e)} failed${i} (${String(n+e+r)} total)`}function X({debugDir:e,event:r}){let n=`${r.workflowName} \u2192 ${r.testName}`;if(r.kind==="run-progress")return`${t.dim("progress")} ${n} \u2014 ${m(r.signal)}`;if(r.kind==="test-started")return`${t.dim("run ")} ${n}`;switch(r.outcome.kind){case"pass":return`${t.good("pass")} ${n} ${t.dim(r.runId)}`;case"findings":return[`${t.bad("fail")} ${n} \u2014 ${g(r.outcome.findingLines.length,"finding")}`,...r.outcome.findingLines,c({debugDir:e,runId:r.runId}),`${t.dim("why")} npx ripplo explain ${r.runId}`].join(`
6
+ `);case"error":return`${t.bad("error")} ${n} \u2014 ${P(r.outcome.detail)} ${t.dim(r.runId)}`;case"dispatch-error":return`${t.bad("error")} ${n} \u2014 ${v(r.outcome.reason)}`;case"dispatch-timeout":return`${t.bad("error")} ${n} \u2014 not run: dispatch timed out (transient): ${r.outcome.detail}`;case"infra-error":return`${t.bad("error")} ${n} \u2014 not run: Ripplo server unreachable: ${r.outcome.detail}`}}var x={CLOUD_EXECUTOR:"cloud runs are not included on your plan \u2014 upgrade to run in the cloud",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",MEMBER_CEILING:"member ceiling reached for the target plan \u2014 remove members or pick a bigger plan",OVERAGE_CAP:"overage cap reached \u2014 raise the cap or upgrade",REVIEW_QUOTA:"review quota reached for your plan \u2014 set an overage cap or upgrade"};function J({detail:e,serverUrl:r}){return p(r)?`Ripplo server at ${r} not running (${e}). Start the dev server with \`pnpm dev\`.`:`Ripplo server at ${r} unreachable (${e}) \u2014 server-side, not your local environment.`}function V(e){switch(e.code){case"compile-failed":{let r=e.diagnostics.length===0?[]:["",...e.diagnostics];return[`Compilation failed in the daemon (${e.detail}). Run \`npx ripplo compile\` for full output.`,...r].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 r=/401|unauthor/i.test(e.detail)?"\nAuth failure \u2014 run `npx ripplo auth login`.":"";return`Sync to the Ripplo server failed: ${e.detail}${r}`}case"bad-message":return"Daemon rejected the request \u2014 protocol mismatch, rebuild the CLI and restart the daemon."}}function B(e){switch(e.kind){case"spawn-failed":return`Failed to start \`npx ripplo daemon\`: ${A(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: a stale daemon (`npx ripplo daemon stop`, then start it again), 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 A(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 P(e){return e==="worker-exit"?"run worker exited before reporting \u2014 usually a stale build. Run `pnpm build`, then `npx ripplo daemon stop` and start it again, then rerun.":e}function v(e){return e.type==="limit"?x[e.code]:`failed to dispatch (${e.detail})`}function I(e,r){return new C(r,{includeScore:!0,threshold:.5}).search(l(e)).slice(0,3).map(i=>i.item)}export{U as a,p as b,m as c,W as d,X as e,J as f,V as g,B as h};
@@ -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 l,mkdirSync as g,writeFileSync as c}from"fs";import t from"path";function d(r,n,i){let o=s(r,n,i);g(t.dirname(o),{recursive:!0}),c(o,"")}function a(r,n,i){return l(s(r,n,i))}function p(r,n){d(r,n,e)}function k(r,n){return a(r,n,e)}var e="__model__";function s(r,n,i){return t.join(u(r,n),i)}function u(r,n){return t.join(r,".ripplo",".local","skills-loaded",n)}export{d as a,a as b,p as c,k as d};
@@ -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
- var e=null;function p(n){e=n}function f(){return e==null?{}:{"x-ripplo-client-version":e}}import{execFileSync as l}from"child_process";import u from"fs";import i from"path";function R(n){let r=c(n);return r??o(n)}function o(n){let r=i.dirname(n);return s(i.join(n,".ripplo"))?n:r===n?null:o(r)}function s(n){try{return u.statSync(n).isDirectory()}catch{return!1}}function c(n){let r=g(["rev-parse","--show-toplevel"],n);if(r==null)return null;let t=r.trim();return t.length===0?null:i.isAbsolute(t)?t:i.resolve(n,t)}function g(n,r){try{return l("git",n,{cwd:r,encoding:"utf8",stdio:["ignore","pipe","ignore"]})}catch{return null}}export{p as a,f as b,R as c};
4
+ var e=null;function p(n){e=n}function f(){return e==null?{}:{"x-ripplo-client-version":e}}import{execFileSync as l}from"child_process";import u from"fs";import i from"path";function R(n){let r=c(n);return r??o(n)}function o(n){let r=i.dirname(n);return s(i.join(n,".ripplo"))?n:r===n?null:o(r)}function s(n){try{return u.statSync(n).isDirectory()}catch{return!1}}function c(n){let r=g(["rev-parse","--show-toplevel"],n);if(r==null)return null;let t=r.trim();return t.length===0?null:i.isAbsolute(t)?t:i.resolve(n,t)}function g(n,r){try{return l("git",n,{cwd:r,encoding:"utf8",stdio:["ignore","pipe","ignore"]})}catch{return null}}export{R as a,p as b,f as c};
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __ripploCreateRequire } from "node:module";
3
3
  const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
4
- import{a as c,d as s}from"./chunk-FEHVIHVA.js";import{k as l}from"./chunk-IPSXNIXC.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};
4
+ import{a as l,d as c}from"./chunk-FEHVIHVA.js";import{k as s}from"./chunk-C7SV6AR2.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 l(o).andThen(t=>c().andThen(r=>{let e=a(),p=s(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};
@@ -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{c as o}from"./chunk-R3DZ6JPY.js";import{j as e}from"./chunk-IPSXNIXC.js";import m from"fs";import p from"fs";import i from"path";import{execFileSync as a}from"child_process";var f=256*1024*1024;function n(r,t){return a("git",[...r],{cwd:t,encoding:"utf8",maxBuffer:f,stdio:["ignore","pipe","pipe"]})}function E(r,t){try{return n(r,t)}catch{return""}}var g=["MERGE_HEAD","rebase-merge","rebase-apply","CHERRY_PICK_HEAD","REVERT_HEAD"];function d(r){return u(r)!=null}function s(r){let t=u(r);return t==null?!1:g.some(l=>p.existsSync(i.join(t,l)))}function u(r){try{let t=n(["rev-parse","--git-dir"],r).trim();return t.length===0?null:i.isAbsolute(t)?t:i.resolve(r,t)}catch{return null}}function c(r){return e(r,"hooks-paused")}function v(r){return m.existsSync(c(r))||s(r)?!1:o(r)}export{n as a,E as b,d as c,s as d,c as e,v as f};
4
+ import{c as o}from"./chunk-RIASQHPG.js";import{j as e}from"./chunk-C7SV6AR2.js";import m from"fs";import p from"fs";import i from"path";import{execFileSync as a}from"child_process";var f=256*1024*1024;function n(r,t){return a("git",[...r],{cwd:t,encoding:"utf8",maxBuffer:f,stdio:["ignore","pipe","pipe"]})}function E(r,t){try{return n(r,t)}catch{return""}}var g=["MERGE_HEAD","rebase-merge","rebase-apply","CHERRY_PICK_HEAD","REVERT_HEAD"];function d(r){return u(r)!=null}function s(r){let t=u(r);return t==null?!1:g.some(l=>p.existsSync(i.join(t,l)))}function u(r){try{let t=n(["rev-parse","--git-dir"],r).trim();return t.length===0?null:i.isAbsolute(t)?t:i.resolve(r,t)}catch{return null}}function c(r){return e(r,"hooks-paused")}function v(r){return m.existsSync(c(r))||s(r)?!1:o(r)}export{n as a,E as b,d as c,s as d,c as e,v as f};
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __ripploCreateRequire } from "node:module";
3
3
  const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
4
- import{a as s}from"./chunk-7WZ3VIUU.js";import{e as p}from"./chunk-TPHOSZAK.js";import{c as a}from"./chunk-R3DZ6JPY.js";import{a as i}from"./chunk-MHNGR6M7.js";import{n}from"./chunk-67YR3QHA.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};
4
+ import{a as i}from"./chunk-MHNGR6M7.js";import{m as p}from"./chunk-7JKCHASU.js";import{a}from"./chunk-7WZ3VIUU.js";import{e as s}from"./chunk-KH4QH23U.js";import{c as n}from"./chunk-RIASQHPG.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(s(o))||n(o)?void 0:(await p(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||!a(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};
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __ripploCreateRequire } from "node:module";
3
3
  const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
4
- import{a as l}from"./chunk-JJ4QQPAV.js";import{c}from"./chunk-7W237JFM.js";import{a as p}from"./chunk-7WZ3VIUU.js";import{f as d}from"./chunk-TPHOSZAK.js";import{b as a}from"./chunk-MHNGR6M7.js";import{e as s}from"./chunk-IPSXNIXC.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(`
4
+ import{a as l}from"./chunk-JJ4QQPAV.js";import{c as d}from"./chunk-JS3DLVVI.js";import{b as p}from"./chunk-MHNGR6M7.js";import{a as c}from"./chunk-7WZ3VIUU.js";import{f as a}from"./chunk-KH4QH23U.js";import{e as s}from"./chunk-C7SV6AR2.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
5
  query PreEditScopeGate($projectId: String!, $cwd: String!) {
6
6
  project(id: $projectId) {
7
7
  id
@@ -13,4 +13,4 @@ import{a as l}from"./chunk-JJ4QQPAV.js";import{c}from"./chunk-7W237JFM.js";impor
13
13
  }
14
14
  }
15
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};
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(!c(t)||!a(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). ${p(["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=d(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};
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __ripploCreateRequire } from "node:module";
3
3
  const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
4
- import{a as d,b as f,c as g}from"./chunk-CB74TAUC.js";import{a as w}from"./chunk-N2OBRCPQ.js";import{c as u}from"./chunk-7W237JFM.js";import{a as c}from"./chunk-7WZ3VIUU.js";import{f as m}from"./chunk-TPHOSZAK.js";import{a as i}from"./chunk-MHNGR6M7.js";import{e as a}from"./chunk-IPSXNIXC.js";import{graphql as h}from"gql.tada";var S=h(`
4
+ import{a as f,b as g,c as w}from"./chunk-BGY5F3IU.js";import{a as d}from"./chunk-SXVWB7TZ.js";import{c as m}from"./chunk-JS3DLVVI.js";import{a as i}from"./chunk-MHNGR6M7.js";import{a as u}from"./chunk-7WZ3VIUU.js";import{f as c}from"./chunk-KH4QH23U.js";import{e as a}from"./chunk-C7SV6AR2.js";import{graphql as h}from"gql.tada";var S=h(`
5
5
  query ScopeReminder($projectId: String!, $cwd: String!) {
6
6
  project(id: $projectId) {
7
7
  id
@@ -18,6 +18,6 @@ import{a as d,b as f,c as g}from"./chunk-CB74TAUC.js";import{a as w}from"./chunk
18
18
  }
19
19
  }
20
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)}):
21
+ `),x=async t=>{let{cwd:e}=t;if(!u(e)||!c(e))return;let p=f(e);if(g(e,"scope-reminder")===p)return;let r=m(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);w(e,"scope-reminder",p);let n=s?.project?.devSession?.scopeItems??[];return d({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
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
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};
@@ -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{i as s,j as a}from"./chunk-IPSXNIXC.js";import d from"fs";import{setTimeout as p}from"timers/promises";import{checkSync as m,lockSync as f}from"proper-lockfile";var y="dev.pid",l=15e3,h=1e4,k=250;function g(n){return u(i(n))}async function b(n){let r=g(n);if(r==null||!c(n))return{kind:"not-running"};try{process.kill(r,"SIGTERM")}catch{return{kind:"not-running"}}let e=Date.now()+h;for(;Date.now()<e;){if(!c(n))return{kind:"stopped",pid:r};await p(k)}return{kind:"timeout",pid:r}}function c(n){try{return m(i(n),{realpath:!1,stale:l})}catch{return!1}}function i(n){return a(n,y)}var o=class extends Error{pid;cwd;constructor({cwd:r,pid:e}){super("dev-lock-held"),this.name="DevLockHeldError",this.pid=e,this.cwd=r}};function E({cwd:n,onCompromised:r}){s(n);let e=i(n),t=w({cwd:n,onCompromised:r,path:e});return d.writeFileSync(e,String(process.pid)),()=>{try{t()}catch{}}}function w({cwd:n,onCompromised:r,path:e}){try{return f(e,{realpath:!1,stale:l,onCompromised:()=>{r()}})}catch(t){throw D(t)?new o({cwd:n,pid:u(e)}):t}}function D(n){if(!(n instanceof Error)||!("code"in n))return!1;let{code:r}=n;return r==="ELOCKED"}function u(n){try{let r=d.readFileSync(n,"utf8").trim(),e=Number.parseInt(r,10);return Number.isFinite(e)&&e>0?e:null}catch{return null}}export{g as a,b,c,i as d,o as e,E as f};
4
+ import{i as s,j as a}from"./chunk-C7SV6AR2.js";import d from"fs";import{setTimeout as p}from"timers/promises";import{checkSync as m,lockSync as f}from"proper-lockfile";var y="dev.pid",l=15e3,h=1e4,k=250;function g(n){return u(i(n))}async function b(n){let r=g(n);if(r==null||!c(n))return{kind:"not-running"};try{process.kill(r,"SIGTERM")}catch{return{kind:"not-running"}}let e=Date.now()+h;for(;Date.now()<e;){if(!c(n))return{kind:"stopped",pid:r};await p(k)}return{kind:"timeout",pid:r}}function c(n){try{return m(i(n),{realpath:!1,stale:l})}catch{return!1}}function i(n){return a(n,y)}var o=class extends Error{pid;cwd;constructor({cwd:r,pid:e}){super("dev-lock-held"),this.name="DevLockHeldError",this.pid=e,this.cwd=r}};function E({cwd:n,onCompromised:r}){s(n);let e=i(n),t=w({cwd:n,onCompromised:r,path:e});return d.writeFileSync(e,String(process.pid)),()=>{try{t()}catch{}}}function w({cwd:n,onCompromised:r,path:e}){try{return f(e,{realpath:!1,stale:l,onCompromised:()=>{r()}})}catch(t){throw D(t)?new o({cwd:n,pid:u(e)}):t}}function D(n){if(!(n instanceof Error)||!("code"in n))return!1;let{code:r}=n;return r==="ELOCKED"}function u(n){try{let r=d.readFileSync(n,"utf8").trim(),e=Number.parseInt(r,10);return Number.isFinite(e)&&e>0?e:null}catch{return null}}export{g as a,b,c,i as d,o as e,E as f};
@@ -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 o}from"./chunk-OQ6KNYPG.js";import{a as r}from"./chunk-MHNGR6M7.js";import{a as h,c as y,d as F,e as k,f as C,g as b}from"./chunk-4LXIRKM7.js";import{A as u,B as g,F as S,e as a,s as c,u as d,v as s,w as f,x as l,y as m,z as p}from"./chunk-5HZ2LDFS.js";import A from"safe-stable-stringify";function z({cwd:i,lockfile:e}){let t=b(A(h(e)));if(k({cwd:i})===t)return[];y({cwd:i});let n=H(e);return F({cwd:i}),C({cleanLockfileHash:n.length===0?t:null,cwd:i}),n}function H(i){let e=c(i),t=d({facts:e.facts});return[...s(i).map(n=>({effect:n,kind:"possible-noop-effect"})),...f(i).map(n=>({consequence:n,kind:"undecided-action-consequence"})),...t.map(n=>({conflict:n,kind:"fact-conflict"})),...l(i).map(n=>({kind:"unreachable-interaction",violation:n})),...m(i).map(n=>({kind:"redundant-assertion",redundancy:n})),...p(i).map(n=>({kind:"unmodeled-surface",surface:n})),...g(i).map(n=>({content:n,kind:"unpinned-surface-content"})),...u(i).map(n=>({binding:n,kind:"stringified-binding"}))]}function q(i){return`${a.good("ok")} \u2014 no static model violations (${o(i,"test")})`}function E(i){let t=i.some(n=>n.kind==="unmodeled-surface")?[`Elements that hide together are one surface. ${r("create","surfaces")}`]:[];return[`${a.bad("fail")} \u2014 ${o(i.length,"static model violation")}:`,...i.map(n=>S(n)),...t].join(`
5
+
6
+ `)}export{z as a,q as b,E as c};
@@ -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-KH4QH23U.js";import{j as c}from"./chunk-C7SV6AR2.js";import{createHash as S}from"crypto";import{mkdirSync as b,readFileSync as v,writeFileSync as A}from"fs";import F from"path";import*as e from"zod/mini";import a from"picomatch";function m(t){return l(["diff","--name-only","HEAD"],t).split(`
5
+ `).filter(n=>n.length>0)}function g({cwd:t,ignoreGlobs:n,watchGlobs:r}){let o=a([...r]),i=a([...n]);return m(t).filter(s=>o(s)&&!i(s))}function z(t){return l(["ls-files","--others","--exclude-standard"],t).split(`
6
+ `).filter(n=>n.length>0)}function d({cwd:t,ignoreGlobs:n,watchGlobs:r}){let o=a([...r]),i=a([...n]);return z(t).filter(s=>o(s)&&!i(s))}var x=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()}),k=e.object({changedAppFiles:e.readonly(e.array(e.string())),scope:e.object({available:e.boolean(),items:e.readonly(e.array(x))}),tests:e._default(e.readonly(e.array(C)),[]),untrackedAppFiles:e.readonly(e.array(e.string()))});function O({cwd:t,scope:n}){let r=y(t);u(t,{...f(t),scope:n,tests:r?.tests??[]})}function T({cwd:t,tests:n}){let r=y(t);u(t,{...f(t),scope:r?.scope??{available:!1,items:[]},tests:n??r?.tests??[]})}function y(t){let n=k.safeParse(I(h(t)));return n.success?n.data:null}function I(t){try{return JSON.parse(v(t,"utf8"))}catch{return null}}function h(t){return c(t,"coverage-context.json")}function u(t,n){let r=h(t);b(F.dirname(r),{recursive:!0});let o=S("sha256").update(JSON.stringify(n)).digest("hex");A(r,JSON.stringify({...n,inputHash:o},null,2))}function f(t){let{ignorePaths:n,watchPaths:r}=p(),o={cwd:t,ignoreGlobs:n,watchGlobs:r};return{changedAppFiles:g(o),untrackedAppFiles:d(o)}}export{O as a,T as b};
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __ripploCreateRequire } from "node:module";
3
3
  const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
4
- import{a as r}from"./chunk-7WZ3VIUU.js";import{f as n}from"./chunk-TPHOSZAK.js";var m=async o=>{if(o.permission_mode!=="plan"||!r(o.cwd)||!n(o.cwd))return;let{loadRipplo:s}=await import("./dsl-loader-LXH6PUY5.js"),{stubbedWorkflows:a}=await import("./compile-write-OLQOR3OK.js"),t=await s(o.cwd);if(t.isErr())return;let e=a(t.value),i=['Plan must include "Tests to implement" with a .ripplo/workflows/ file per affected flow (ExitPlanMode blocks otherwise). Stub each with `workflow("Intent")` (no body).'];return e.length>0&&i.push(`Existing stubs: ${e.join(", ")}`),{hookSpecificOutput:{additionalContext:i.join(`
4
+ import{a as n}from"./chunk-7WZ3VIUU.js";import{f as r}from"./chunk-KH4QH23U.js";var m=async o=>{if(o.permission_mode!=="plan"||!n(o.cwd)||!r(o.cwd))return;let{loadRipplo:s}=await import("./dsl-loader-WPAKMON7.js"),{stubbedWorkflows:a}=await import("./compile-write-N3PWYUKE.js"),t=await s(o.cwd);if(t.isErr())return;let e=a(t.value),i=['Plan must include "Tests to implement" with a .ripplo/workflows/ file per affected flow (ExitPlanMode blocks otherwise). Stub each with `workflow("Intent")` (no body).'];return e.length>0&&i.push(`Existing stubs: ${e.join(", ")}`),{hookSpecificOutput:{additionalContext:i.join(`
5
5
  `),hookEventName:"UserPromptSubmit"}}};export{m as a};
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __ripploCreateRequire } from "node:module";
3
3
  const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
4
- import{B as i,f as t}from"./chunk-6TCK75ER.js";function m(e){switch(e.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 (${e.typename}). Run \`npx ripplo doctor\` to check your setup.`}}function g(e){switch(e.kind){case"already-running":return`ripplo daemon: daemon already running (socket ${e.socketPath}).`;case"bind-failed":return`ripplo daemon: failed to bind IPC socket: ${e.message}`}}function f({projectId:e,serverUrl:n}){return[`Project "${e}" (from .ripplo/project.json) was not found on ${n}, 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 h(){return"Not signed in. Run `npx ripplo auth login`, then start the daemon again."}function k({devSessionId:e,version:n}){return`ripplo daemon: v${n} ready as local executor for session ${e} (switch with \`npx ripplo executor cloud\` \u2014 Ctrl-C to stop)`}function x({cwd:e,pid:n}){return`ripplo daemon: another daemon is already running for this project${n==null?"":` (pid ${String(n)})`} (cwd ${e}) \u2014 this one is exiting. Run \`npx ripplo daemon status\` to inspect it, or \`npx ripplo daemon stop\` to stop it.`}function y(e){switch(e.kind){case"not-running":return"ripplo daemon: not running.";case"stopped":return`ripplo daemon: stopped (pid ${String(e.pid)}).`;case"timeout":return`ripplo daemon: pid ${String(e.pid)} did not exit within 10s \u2014 it may be finishing a run. Check again with \`npx ripplo daemon status\`.`}}function $(){return"ripplo daemon: lock compromised \u2014 another daemon likely took over this project. Shutting down."}function w(e){if(e.kind==="not-running")return"daemon: not running";if(e.kind==="unresponsive")return`daemon: running but no reply within ${String(e.timeoutMs/1e3)}s \u2014 likely busy executing runs, retry when the batch drains`;let{status:n}=e,r=n.version==null?"version unknown (pre-0.7.8)":`v${n.version}`,s=`${String(n.active)} active, ${String(n.queued)} queued`,a=l(n.explorer,n.exploring),o=`daemon: running (${r} | ${s} | ${a} | ${p(n.progress)})`;if(n.sseHealth!=null&&!n.sseHealth.ok){let d=n.sseHealth.detail==null?"":`: ${n.sseHealth.detail}`;return`${o}
6
- daemon: cannot subscribe to run dispatch${d} \u2014 server-side, restarting the daemon will not help`}return o}function p(e){return e.attempts===0?"explore: idle":`explore: ${String(e.attempts)} attempts, ${String(e.findings)} findings`}function v(e){let n=e.daemonVersion==null?"an older build":`v${e.daemonVersion}`;return e.kind==="restarted"?`ripplo: daemon was on ${n} \u2014 restarted on the current build`:`ripplo: daemon is on a stale build (${n}) with runs in flight \u2014 rerun once it drains, or npx ripplo daemon restart`}function b(e){switch(e.kind){case"pass":return{kind:"pass"};case"findings":return{findingLines:e.contradictions.map(n=>i({contradiction:n,evidencePath:`.ripplo/debug/${e.runId}/behavior.jsonl`})),kind:"findings"};case"error":return{detail:t(e.error),kind:"error"};case"dispatch-failed":return{kind:"dispatch-error",reason:{detail:e.reason,type:"generic"}}}}function l(e,n){switch(e.kind){case"off":return"explorer: off";case"on":return`explorer: on, ${String(n)} exploring`;case"paused":return"explorer: paused for active runs or a short cooldown \u2014 resumes on its own";case"blocked":return`explorer: blocked \u2014 ${u(e.reason)}`}}function u(e){switch(e){case"no-lockfile":return"no lockfile found, run npx ripplo compile";case"unstamped":return"lockfile has no compiled checks, run npx ripplo compile";case"dsl-drift":return"workflow sources changed since the last compile, run npx ripplo compile";case"load-failed":return"workflow definitions do not compile, run npx ripplo compile for details"}}export{m as a,g as b,f as c,h as d,k as e,x as f,y as g,$ as h,w as i,p as j,v as k,b as l};
4
+ import{C as i,d as t}from"./chunk-5HZ2LDFS.js";function m(e){switch(e.kind){case"already-running":return`ripplo daemon: daemon already running (socket ${e.socketPath}).`;case"bind-failed":return`ripplo daemon: failed to bind IPC socket: ${e.message}`}}function g({projectId:e,serverUrl:n}){return[`Project "${e}" (from .ripplo/project.json) was not found on ${n}, 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 f(){return"Not signed in. Run `npx ripplo auth login`, then start the daemon again."}function h({devSessionId:e,version:n}){return`ripplo daemon: v${n} ready as local executor for session ${e} (switch with \`npx ripplo executor cloud\` \u2014 Ctrl-C to stop)`}function x({cwd:e,pid:n}){return`ripplo daemon: another daemon is already running for this project${n==null?"":` (pid ${String(n)})`} (cwd ${e}) \u2014 this one is exiting. Run \`npx ripplo daemon status\` to inspect it, or \`npx ripplo daemon stop\` to stop it.`}function k(e){switch(e.kind){case"not-running":return"ripplo daemon: not running.";case"stopped":return`ripplo daemon: stopped (pid ${String(e.pid)}).`;case"timeout":return`ripplo daemon: pid ${String(e.pid)} did not exit within 10s \u2014 it may be finishing a run. Check again with \`npx ripplo daemon status\`.`}}function w(){return"ripplo daemon: lock compromised \u2014 another daemon likely took over this project. Shutting down."}function y(e){if(e.kind==="not-running")return"daemon: not running";if(e.kind==="unresponsive")return`daemon: running but no reply within ${String(e.timeoutMs/1e3)}s \u2014 likely busy executing runs, retry when the batch drains`;let{status:n}=e,r=n.version==null?"version unknown (pre-0.7.8)":`v${n.version}`,s=`${String(n.active)} active, ${String(n.queued)} queued`,a=l(n.explorer,n.exploring),o=`daemon: running (${r} | ${s} | ${a} | ${d(n.progress)})`;if(n.sseHealth!=null&&!n.sseHealth.ok){let p=n.sseHealth.detail==null?"":`: ${n.sseHealth.detail}`;return`${o}
6
+ daemon: cannot subscribe to run dispatch${p} \u2014 server-side, restarting the daemon will not help`}return o}function d(e){return e.attempts===0?"explore: idle":`explore: ${String(e.attempts)} attempts, ${String(e.findings)} findings`}function $(e){let n=e.daemonVersion==null?"an older build":`v${e.daemonVersion}`;return e.kind==="restarted"?`ripplo: daemon was on ${n} \u2014 restarted on the current build`:`ripplo: daemon is on a stale build (${n}) with runs in flight \u2014 rerun once it drains, or npx ripplo daemon restart`}function b(e){switch(e.kind){case"pass":return{kind:"pass"};case"findings":return{findingLines:e.contradictions.map(n=>i({contradiction:n,evidencePath:`.ripplo/debug/${e.runId}/behavior.jsonl`})),kind:"findings"};case"error":return{detail:t(e.error),kind:"error"};case"dispatch-failed":return{kind:"dispatch-error",reason:{detail:e.reason,type:"generic"}}}}function l(e,n){switch(e.kind){case"off":return"explorer: off";case"on":return`explorer: on, ${String(n)} exploring`;case"paused":return"explorer: paused for active runs or a short cooldown \u2014 resumes on its own";case"waiting":return"explorer: waiting for more workflow coverage \u2014 run npx ripplo explore analyze";case"blocked":return`explorer: blocked \u2014 ${c(e.reason)}`}}function c(e){switch(e){case"no-lockfile":return"no lockfile found, run npx ripplo compile";case"unstamped":return"lockfile has no compiled checks, run npx ripplo compile";case"dsl-drift":return"workflow sources changed since the last compile, run npx ripplo compile";case"load-failed":return"workflow definitions do not compile, run npx ripplo compile for details";case"model-empty":return"no workflow interactions can be explored, run npx ripplo explore analyze"}}export{m as a,g as b,f as c,h as d,x as e,k as f,w as g,y as h,d as i,$ as j,b as k};
@@ -0,0 +1,13 @@
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-MHNGR6M7.js";import{g as o,h as a,j as i}from"./chunk-7JKCHASU.js";function h(e){return e.kind==="authoring-error"?["Compilation failed",e.message,t("create","DSL authoring rules")].join(`
5
+
6
+ `):[`Compilation failed: ${l(e)}`,t("create","DSL authoring rules")].join(`
7
+ `)}function x(){return`${i} is up to date`}function $(e){return[`${i} is ${e==="missing"?"missing":"out of date"} \u2014 run \`npx ripplo compile\` and commit it`,t("setup")].join(`
8
+ `)}function L(){return`Wrote ${i}`}function l(e){switch(e.kind){case"typecheck-failed":return["TypeScript errors in .ripplo/:",...e.diagnostics].join(`
9
+ `);case"not-ripplo":return`${e.entryPath} must default-export createRipplo({ state, workflows }).`;case"invalid-lockfile":return["Lockfile failed schema validation (stale or hand-edited .ripplo/ripplo.lock):",...e.issues,"Regenerate with `npx ripplo compile`."].join(`
10
+ `);case"load-threw":return u(e.message);case"authoring-error":return e.message;case"fixture-failed":return p(e.error);case"expand-failed":return`Could not resolve tests for workflow "${e.workflow}": ${e.message}`}}var s="state-selection-condition-requires-closed";function u(e){return e===s?["A state condition queries a collection whose full contents are unknown.","Add closed(record) for every collection used by that condition so the solver can prove the result.",`Diagnostic code: ${e}`].join(`
11
+ `):c(e)?["Ripplo rejected the workflow model while loading .ripplo/index.ts.",`${d(e)} Load /ripplo:create for the matching DSL rule.`,`Diagnostic code: ${e}`].join(`
12
+ `):[".ripplo/index.ts could not be loaded:",e].join(`
13
+ `)}function c(e){return/^[a-z][a-z0-9]*(?:-[a-z0-9]+)+$/u.test(e)}function d(e){let r=e.replaceAll("-"," ");return`${r.charAt(0).toUpperCase()}${r.slice(1)}.`}function p(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 ${n(e.size)} \u2014 over the ${n(o)} per-file limit.`;case"fixtures-total-too-large":return`Fixtures total ${n(e.total)} \u2014 over the ${n(a)} limit.`}}function n(e){return`${String(Math.round(e/(1024*1024)*10)/10)} MB`}export{h as a,x as b,$ as c,L as d};
@@ -1,8 +1,8 @@
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{f as a}from"./chunk-QAR7FZO3.js";import{a as n}from"./chunk-73TKORK6.js";import{l as i}from"./chunk-FXCBWBN5.js";import{n as e}from"./chunk-67YR3QHA.js";import{i as u}from"./chunk-5X4M4MTG.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(", ")}
4
+ import{h as u}from"./chunk-UFXH75WD.js";import{f as a}from"./chunk-EEOTA6M4.js";import{a as i}from"./chunk-WAGXAEB4.js";import{l as n}from"./chunk-4LXIRKM7.js";import{m as e}from"./chunk-7JKCHASU.js";async function x(m){let o=process.cwd(),r=await e(o);r.isErr()&&(process.stderr.write(`${i(r.error)}
5
+ `),process.exit(1));let s=n(r.value),t=await a(o);if(m.format==="summary"){s.length>0&&process.stdout.write(`stub workflows: ${s.join(", ")}
6
6
  `),process.stdout.write(`${u(t)}
7
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
8
  `)}export{x as a};
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __ripploCreateRequire } from "node:module";
3
3
  const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
4
- import{b as m,c as p}from"./chunk-CB74TAUC.js";import{c as l}from"./chunk-5E62BCS7.js";import{c as d}from"./chunk-7W237JFM.js";import{a as i}from"./chunk-7WZ3VIUU.js";import{f as u}from"./chunk-TPHOSZAK.js";import{e as a}from"./chunk-IPSXNIXC.js";import{createHash as g}from"crypto";import{graphql as k}from"gql.tada";var c="tasks-reminder",y=k(`
4
+ import{b as l,c as m}from"./chunk-BGY5F3IU.js";import{c as p}from"./chunk-47LLHHJH.js";import{c as u}from"./chunk-JS3DLVVI.js";import{a as d}from"./chunk-7WZ3VIUU.js";import{f as i}from"./chunk-KH4QH23U.js";import{e as a}from"./chunk-C7SV6AR2.js";import{createHash as g}from"crypto";import{graphql as k}from"gql.tada";var c="tasks-reminder",y=k(`
5
5
  query TasksReminder($projectId: String!, $cwd: String!) {
6
6
  project(id: $projectId) {
7
7
  id
@@ -20,4 +20,4 @@ import{b as m,c as p}from"./chunk-CB74TAUC.js";import{c as l}from"./chunk-5E62BC
20
20
  }
21
21
  }
22
22
  }
23
- `),q=async r=>{let t=await h(r.cwd);if(t!=null)return{hookSpecificOutput:{additionalContext:t,hookEventName:"UserPromptSubmit"}}};async function h(r){if(!i(r)||!u(r))return null;let t=d(r).unwrapOr(void 0);if(t==null)return null;let e=await a({config:t,document:y,variables:{cwd:t.cwd,projectId:t.projectId}}).catch(()=>null);if(e==null)return null;let n=e.project?.devSession?.tasks??[],o=S(n);if(m(r,c)===o||(p(r,c,o),n.length===0))return null;let f=n.map(s=>({id:s.id,kind:s.kind,lastMessage:s.messages?.[0]?.body??null,status:s.status,title:s.title}));return l(f)}function S(r){let t=g("sha256");return r.map(e=>`${e.id}:${String(e.updatedAt)}`).toSorted((e,n)=>e.localeCompare(n)).forEach(e=>{t.update(e),t.update("\0")}),t.digest("hex")}export{q as a};
23
+ `),q=async r=>{let t=await h(r.cwd);if(t!=null)return{hookSpecificOutput:{additionalContext:t,hookEventName:"UserPromptSubmit"}}};async function h(r){if(!d(r)||!i(r))return null;let t=u(r).unwrapOr(void 0);if(t==null)return null;let e=await a({config:t,document:y,variables:{cwd:t.cwd,projectId:t.projectId}}).catch(()=>null);if(e==null)return null;let n=e.project?.devSession?.tasks??[],o=S(n);if(l(r,c)===o||(m(r,c,o),n.length===0))return null;let f=n.map(s=>({id:s.id,kind:s.kind,lastMessage:s.messages?.[0]?.body??null,status:s.status,title:s.title}));return p(f)}function S(r){let t=g("sha256");return r.map(e=>`${e.id}:${String(e.updatedAt)}`).toSorted((e,n)=>e.localeCompare(n)).forEach(e=>{t.update(e),t.update("\0")}),t.digest("hex")}export{q as a};