ripplo 0.9.4 → 0.9.6

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 (74) hide show
  1. package/dist/{chunk-INURHJF4.js → chunk-36NPGS6X.js} +1 -1
  2. package/dist/chunk-4GA5662U.js +83 -0
  3. package/dist/{chunk-CUXFU3MF.js → chunk-5D6PNHDQ.js} +1 -1
  4. package/dist/{chunk-PLQGRHHV.js → chunk-5DT43ABQ.js} +1 -1
  5. package/dist/{chunk-YR3N73PR.js → chunk-5IMT3SAH.js} +3 -3
  6. package/dist/{chunk-GAOLASGV.js → chunk-6SYRXU4Q.js} +1 -1
  7. package/dist/{chunk-FH2BITRY.js → chunk-A5EBMT2E.js} +1 -1
  8. package/dist/{chunk-3M2E253R.js → chunk-AIIZRQXH.js} +1 -1
  9. package/dist/{chunk-52IE2PAQ.js → chunk-AJXAWZQO.js} +1 -1
  10. package/dist/{chunk-T6NNV7ZO.js → chunk-BDWNZMUM.js} +1 -1
  11. package/dist/chunk-CY5FJBHP.js +55 -0
  12. package/dist/{chunk-KQWFJRIP.js → chunk-DK4NUWRX.js} +1 -1
  13. package/dist/chunk-FJPJDGSS.js +7 -0
  14. package/dist/{chunk-T4GHICK4.js → chunk-GFKK7K6T.js} +1 -1
  15. package/dist/chunk-GKYP7AMJ.js +8 -0
  16. package/dist/{chunk-N45RSC6N.js → chunk-HD7WIBP2.js} +1 -1
  17. package/dist/chunk-L2ZJK7MP.js +6 -0
  18. package/dist/chunk-LOEAZGYO.js +4 -0
  19. package/dist/{chunk-3OI2UH3H.js → chunk-NOKKMFJP.js} +1 -1
  20. package/dist/{chunk-XDK6UCMD.js → chunk-NOT5PEHM.js} +1 -1
  21. package/dist/chunk-RIVHBABX.js +4 -0
  22. package/dist/{chunk-6FU7HD6D.js → chunk-SXDYA2OR.js} +1 -1
  23. package/dist/chunk-T76D4SYI.js +4 -0
  24. package/dist/{chunk-T46B2OPT.js → chunk-TPQIFYHW.js} +1 -1
  25. package/dist/chunk-TQANCEOL.js +224 -0
  26. package/dist/{chunk-G3UFH3WS.js → chunk-V4CLXOCP.js} +1 -1
  27. package/dist/{chunk-O2VP65IR.js → chunk-VCY2CEE2.js} +5 -5
  28. package/dist/chunk-WCSDBWCI.js +4 -0
  29. package/dist/{chunk-SBDRIIVW.js → chunk-XJJDHGK4.js} +19 -19
  30. package/dist/{chunk-3PF5QK56.js → chunk-Z6UPZDW6.js} +1 -1
  31. package/dist/{cli-error-TM2YODR3.js → cli-error-OIG4RO4E.js} +1 -1
  32. package/dist/{compile-write-TTEHFTNY.js → compile-write-OLP4DB4P.js} +1 -1
  33. package/dist/{daemon-6B4OSRBS.js → daemon-WEKGUIRK.js} +1 -1
  34. package/dist/{daemon-5IFFVQEE.js → daemon-ZHTQ472Q.js} +1 -1
  35. package/dist/{daemon-lock-67AFXXED.js → daemon-lock-YRKNXWGO.js} +1 -1
  36. package/dist/{dsl-loader-Z54ZM7C6.js → dsl-loader-IRBKYLNW.js} +1 -1
  37. package/dist/{exit-plan-gate-WPHQII5J.js → exit-plan-gate-X3TX6QWS.js} +1 -1
  38. package/dist/hook.js +1 -1
  39. package/dist/index.js +194 -184
  40. package/dist/{plan-reminder-H2ZU5WZF.js → plan-reminder-AR3TJXLA.js} +1 -1
  41. package/dist/post-edit-VUBL7RDW.js +4 -0
  42. package/dist/post-edit-analyze-ECCVJCPQ.js +4 -0
  43. package/dist/post-edit-flag-stubs-AHP6XA2S.js +4 -0
  44. package/dist/{pre-bash-run-gate-WOGQZARU.js → pre-bash-run-gate-LQK52CAV.js} +1 -1
  45. package/dist/pre-edit-4MNJA3OT.js +4 -0
  46. package/dist/pre-edit-ripplo-skill-gate-XJHLJN2F.js +4 -0
  47. package/dist/pre-edit-scope-gate-K5NYCES7.js +4 -0
  48. package/dist/{pre-edit-watch-gate-OTD6WRUN.js → pre-edit-watch-gate-5YWMODVX.js} +1 -1
  49. package/dist/{prompt-submit-T6GURGAW.js → prompt-submit-PXMO75JB.js} +1 -1
  50. package/dist/scope-reminder-LDBXUQZH.js +4 -0
  51. package/dist/solve-worker.js +1 -1
  52. package/dist/status-2FS6ZFIU.js +4 -0
  53. package/dist/{stop-enforce-32B7BSQK.js → stop-enforce-56SLPUYT.js} +1 -1
  54. package/dist/tasks-reminder-OJEB6HE5.js +4 -0
  55. package/package.json +2 -3
  56. package/dist/chunk-2TBRW5WZ.js +0 -8
  57. package/dist/chunk-3KD2FTEQ.js +0 -229
  58. package/dist/chunk-6Z555TLR.js +0 -55
  59. package/dist/chunk-B6OQ2JE2.js +0 -4
  60. package/dist/chunk-CJUKILIO.js +0 -4
  61. package/dist/chunk-MHXAGRCM.js +0 -4
  62. package/dist/chunk-ML7WCYPY.js +0 -6
  63. package/dist/chunk-PPMW4GUY.js +0 -83
  64. package/dist/chunk-TBCRT6EC.js +0 -7
  65. package/dist/chunk-ZQHKESUR.js +0 -4
  66. package/dist/post-edit-HOYXFYSH.js +0 -4
  67. package/dist/post-edit-analyze-5HS3ZV4G.js +0 -4
  68. package/dist/post-edit-flag-stubs-CDKPTQ2L.js +0 -4
  69. package/dist/pre-edit-TRMRQGTZ.js +0 -4
  70. package/dist/pre-edit-ripplo-skill-gate-FXNQWVME.js +0 -4
  71. package/dist/pre-edit-scope-gate-ADO3NRVS.js +0 -4
  72. package/dist/scope-reminder-XTXZHPLU.js +0 -4
  73. package/dist/status-EM4ASO7T.js +0 -4
  74. package/dist/tasks-reminder-PICFLMC2.js +0 -4
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __ripploCreateRequire } from "node:module";
3
3
  const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
4
- import{a 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-B6OQ2JE2.js";import{a as P}from"./chunk-R4ZTRVDQ.js";import{i as D}from"./chunk-52IE2PAQ.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-WCSDBWCI.js";import{a as P}from"./chunk-R4ZTRVDQ.js";import{i as D}from"./chunk-AJXAWZQO.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};
@@ -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 n}from"./chunk-MHNGR6M7.js";import{f as o,g as a,h as i}from"./chunk-ML7WCYPY.js";function c(e){return[`Compilation failed: ${s(e)}`,n("create","DSL authoring rules")].join(`
4
+ import{a as n}from"./chunk-MHNGR6M7.js";import{h as o,i as a,k as i}from"./chunk-L2ZJK7MP.js";function c(e){return[`Compilation failed: ${s(e)}`,n("create","DSL authoring rules")].join(`
5
5
  `)}function m(){return`${i} is up to date`}function g(e){return[`${i} is ${e==="missing"?"missing":"out of date"} \u2014 run \`npx ripplo compile\` and commit it`,n("setup")].join(`
6
6
  `)}function x(){return`Wrote ${i}`}function s(e){switch(e.kind){case"typecheck-failed":return["TypeScript errors in .ripplo/:",...l(e.diagnostics)].join(`
7
7
  `);case"not-ripplo":return`${e.entryPath} must default-export createRipplo({ entities, singletons, workflows }).`;case"invalid-lockfile":return["Lockfile failed schema validation (stale or hand-edited .ripplo/ripplo.lock):",...l(e.issues),"Regenerate with `npx ripplo compile`."].join(`
@@ -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 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-WPHQII5J.js").then(o=>o.exitPlanGateHook),"plan-reminder":()=>import("./plan-reminder-H2ZU5WZF.js").then(o=>t("UserPromptSubmit",o.planReminder)),"post-edit":()=>import("./post-edit-HOYXFYSH.js").then(o=>o.postEditHook),"post-edit-analyze":()=>import("./post-edit-analyze-5HS3ZV4G.js").then(o=>t("PostToolUse",o.postEditAnalyze)),"post-edit-flag-stubs":()=>import("./post-edit-flag-stubs-CDKPTQ2L.js").then(o=>t("PostToolUse",o.postEditFlagStubs)),"pre-bash-run-gate":()=>import("./pre-bash-run-gate-WOGQZARU.js").then(o=>o.preBashRunGateHook),"pre-edit":()=>import("./pre-edit-TRMRQGTZ.js").then(o=>o.preEditHook),"pre-edit-ripplo-skill-gate":()=>import("./pre-edit-ripplo-skill-gate-FXNQWVME.js").then(o=>t("PreToolUse",o.preEditRipploSkillGate)),"pre-edit-scope-gate":()=>import("./pre-edit-scope-gate-ADO3NRVS.js").then(o=>t("PreToolUse",o.preEditScopeGate)),"pre-edit-watch-gate":()=>import("./pre-edit-watch-gate-OTD6WRUN.js").then(o=>t("PreToolUse",o.preEditWatchGate)),"prompt-submit":()=>import("./prompt-submit-T6GURGAW.js").then(o=>o.promptSubmitHook),"scope-reminder":()=>import("./scope-reminder-XTXZHPLU.js").then(o=>t("UserPromptSubmit",o.scopeReminder)),"session-preamble":()=>import("./session-preamble-ZYVRDSGA.js").then(o=>o.sessionPreambleHook),"stop-enforce":()=>import("./stop-enforce-32B7BSQK.js").then(o=>o.stopEnforceHook),"tasks-reminder":()=>import("./tasks-reminder-PICFLMC2.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-TM2YODR3.js");process.stderr.write(`${a(o,r.error)}
4
+ import{a as p,c as t}from"./chunk-KOKEEAEF.js";import{c as s}from"./chunk-LOEAZGYO.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-X3TX6QWS.js").then(o=>o.exitPlanGateHook),"plan-reminder":()=>import("./plan-reminder-AR3TJXLA.js").then(o=>t("UserPromptSubmit",o.planReminder)),"post-edit":()=>import("./post-edit-VUBL7RDW.js").then(o=>o.postEditHook),"post-edit-analyze":()=>import("./post-edit-analyze-ECCVJCPQ.js").then(o=>t("PostToolUse",o.postEditAnalyze)),"post-edit-flag-stubs":()=>import("./post-edit-flag-stubs-AHP6XA2S.js").then(o=>t("PostToolUse",o.postEditFlagStubs)),"pre-bash-run-gate":()=>import("./pre-bash-run-gate-LQK52CAV.js").then(o=>o.preBashRunGateHook),"pre-edit":()=>import("./pre-edit-4MNJA3OT.js").then(o=>o.preEditHook),"pre-edit-ripplo-skill-gate":()=>import("./pre-edit-ripplo-skill-gate-XJHLJN2F.js").then(o=>t("PreToolUse",o.preEditRipploSkillGate)),"pre-edit-scope-gate":()=>import("./pre-edit-scope-gate-K5NYCES7.js").then(o=>t("PreToolUse",o.preEditScopeGate)),"pre-edit-watch-gate":()=>import("./pre-edit-watch-gate-5YWMODVX.js").then(o=>t("PreToolUse",o.preEditWatchGate)),"prompt-submit":()=>import("./prompt-submit-PXMO75JB.js").then(o=>o.promptSubmitHook),"scope-reminder":()=>import("./scope-reminder-LDBXUQZH.js").then(o=>t("UserPromptSubmit",o.scopeReminder)),"session-preamble":()=>import("./session-preamble-ZYVRDSGA.js").then(o=>o.sessionPreambleHook),"stop-enforce":()=>import("./stop-enforce-56SLPUYT.js").then(o=>o.stopEnforceHook),"tasks-reminder":()=>import("./tasks-reminder-OJEB6HE5.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-OIG4RO4E.js");process.stderr.write(`${a(o,r.error)}
7
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};
@@ -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{a as p}from"./chunk-JJ4QQPAV.js";import{b as l}from"./chunk-3M2E253R.js";import{j as c}from"./chunk-52IE2PAQ.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(`
4
+ import{a as p}from"./chunk-JJ4QQPAV.js";import{b as l}from"./chunk-AIIZRQXH.js";import{j as c}from"./chunk-AJXAWZQO.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
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
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};
@@ -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{f as a}from"./chunk-CUXFU3MF.js";import{a as n}from"./chunk-PLQGRHHV.js";import{i}from"./chunk-ZQHKESUR.js";import{k as e}from"./chunk-ML7WCYPY.js";import{i as u}from"./chunk-T4GHICK4.js";async function x(m){let o=process.cwd(),r=await e(o);r.isErr()&&(process.stderr.write(`${n(r.error)}
4
+ import{f as a}from"./chunk-5D6PNHDQ.js";import{a as n}from"./chunk-5DT43ABQ.js";import{i}from"./chunk-RIVHBABX.js";import{n as e}from"./chunk-L2ZJK7MP.js";import{i as u}from"./chunk-GFKK7K6T.js";async function x(m){let o=process.cwd(),r=await e(o);r.isErr()&&(process.stderr.write(`${n(r.error)}
5
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
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)}
@@ -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-INURHJF4.js";import{j as e}from"./chunk-52IE2PAQ.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-36NPGS6X.js";import{j as e}from"./chunk-AJXAWZQO.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,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 E}from"./chunk-CJUKILIO.js";import{a as $}from"./chunk-NNH3YVVO.js";import{b as U}from"./chunk-KMZ3L5YA.js";var F=15e3,G=3,L=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}},u=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 u)return e.errors[0]?.extensions?.code}var j={attempts:G,timeoutMs:F},V={attempts:1,timeoutMs:3e3};async function x(e){return T(e,j)}async function W(e){return T(e,V)}async function T(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`,c=await B({init:{body:o,headers:{Authorization:`Bearer ${e.config.token}`,"Content-Type":"application/json",...E()},method:"POST"},policy:r,serverUrl:e.config.ripploServerUrl,url:i}),s=await J({res:c,url:i});if(!Q(s))throw new Error("Invalid GraphQL response");if(X(s))throw new u(s.errors);if(s.data==null)throw new Error("No data returned from server");return s.data}async function B({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 K(H(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 H(e){return L*3**(e-1)*(.5+Math.random())}function K(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 X(e){return Array.isArray(e.errors)&&e.errors.length>0}import Y from"pino";import z from"pino-pretty";var y=Y({level:process.env.LOG_LEVEL??"info"},z({ignore:"pid,hostname"}));import{readdir as Z,rm as ee,stat as re}from"fs/promises";import{existsSync as k}from"fs";import w from"path";var v=".uploaded";var C=w.join(process.cwd(),".ripplo","debug"),D=360*60*1e3;async function te({maxRuns:e}){try{let t=(await Z(C,{withFileTypes:!0})).filter(a=>a.isDirectory()),n=Date.now(),o=await Promise.all(t.map(async a=>{let m=w.join(C,a.name),O=await re(m);return{dirPath:m,mtime:O.mtimeMs,pendingUpload:ne(m)}})),i=o.filter(a=>n-a.mtime>D),c=o.filter(a=>n-a.mtime<=D&&!a.pendingUpload).toSorted((a,m)=>m.mtime-a.mtime).slice(e),s=[...i,...c];if(s.length===0)return;await Promise.allSettled(s.map(a=>ee(a.dirPath,{force:!0,recursive:!0}))),y.debug("Pruned %d old debug run(s)",s.length)}catch{y.warn("Debug run pruning failed, ignoring")}}function ne(e){return k(w.join(e,"behavior.jsonl"))&&!k(w.join(e,v))}import l from"fs";import oe from"os";import g from"path";var ie=".local",ae=".ripplo";function h(e){return g.join(e,".ripplo",ie)}function se(e){let r=h(e);l.existsSync(r)||l.mkdirSync(r,{recursive:!0});let t=g.join(r,".gitignore");return l.existsSync(t)||l.writeFileSync(t,`*
4
+ import{b as E}from"./chunk-LOEAZGYO.js";import{a as $}from"./chunk-NNH3YVVO.js";import{b as U}from"./chunk-KMZ3L5YA.js";var F=15e3,G=3,L=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}},u=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 u)return e.errors[0]?.extensions?.code}var j={attempts:G,timeoutMs:F},V={attempts:1,timeoutMs:3e3};async function x(e){return T(e,j)}async function W(e){return T(e,V)}async function T(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`,c=await B({init:{body:o,headers:{Authorization:`Bearer ${e.config.token}`,"Content-Type":"application/json",...E()},method:"POST"},policy:r,serverUrl:e.config.ripploServerUrl,url:i}),s=await J({res:c,url:i});if(!Q(s))throw new Error("Invalid GraphQL response");if(X(s))throw new u(s.errors);if(s.data==null)throw new Error("No data returned from server");return s.data}async function B({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 K(H(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 H(e){return L*3**(e-1)*(.5+Math.random())}function K(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 X(e){return Array.isArray(e.errors)&&e.errors.length>0}import Y from"pino";import z from"pino-pretty";var y=Y({level:process.env.LOG_LEVEL??"info"},z({ignore:"pid,hostname"}));import{readdir as Z,rm as ee,stat as re}from"fs/promises";import{existsSync as k}from"fs";import w from"path";var v=".uploaded";var C=w.join(process.cwd(),".ripplo","debug"),D=360*60*1e3;async function te({maxRuns:e}){try{let t=(await Z(C,{withFileTypes:!0})).filter(a=>a.isDirectory()),n=Date.now(),o=await Promise.all(t.map(async a=>{let m=w.join(C,a.name),O=await re(m);return{dirPath:m,mtime:O.mtimeMs,pendingUpload:ne(m)}})),i=o.filter(a=>n-a.mtime>D),c=o.filter(a=>n-a.mtime<=D&&!a.pendingUpload).toSorted((a,m)=>m.mtime-a.mtime).slice(e),s=[...i,...c];if(s.length===0)return;await Promise.allSettled(s.map(a=>ee(a.dirPath,{force:!0,recursive:!0}))),y.debug("Pruned %d old debug run(s)",s.length)}catch{y.warn("Debug run pruning failed, ignoring")}}function ne(e){return k(w.join(e,"behavior.jsonl"))&&!k(w.join(e,v))}import l from"fs";import oe from"os";import g from"path";var ie=".local",ae=".ripplo";function h(e){return g.join(e,".ripplo",ie)}function se(e){let r=h(e);l.existsSync(r)||l.mkdirSync(r,{recursive:!0});let t=g.join(r,".gitignore");return l.existsSync(t)||l.writeFileSync(t,`*
5
5
  `),r}function le(e,r){return g.join(h(e),r)}function P(){return g.join(oe.homedir(),ae)}function S(){let e=P();return l.existsSync(e)?l.chmodSync(e,448):l.mkdirSync(e,{mode:448,recursive:!0}),e}function A(e){return g.join(P(),e)}import{Agent as de,RetryAgent as ce,setGlobalDispatcher as me}from"undici";var ue=1500,ge=4e3,pe=3,fe=50,ye=100,I=!1;function we(){if(I)return;I=!0;let e=new de({connections:ye,keepAliveMaxTimeout:ge,keepAliveTimeout:ue}),r=new ce(e,{errorCodes:["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT","UND_ERR_REQ_CONTENT_LENGTH_MISMATCH","UND_ERR_SOCKET"],maxRetries:pe,methods:["GET","POST","HEAD","OPTIONS","PUT","DELETE"],minTimeout:fe});me(r)}import{graphql as p}from"gql.tada";var We=p(`
6
6
  query AgentReviewContextWorker($reviewId: String!) {
7
7
  agentReview(id: $reviewId) {
@@ -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-3M2E253R.js";var m=async o=>{if(o.permission_mode!=="plan"||!r(o.cwd)||!n(o.cwd))return;let{loadRipplo:s}=await import("./dsl-loader-Z54ZM7C6.js"),{stubbedWorkflows:a}=await import("./compile-write-TTEHFTNY.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 r}from"./chunk-7WZ3VIUU.js";import{f as n}from"./chunk-AIIZRQXH.js";var m=async o=>{if(o.permission_mode!=="plan"||!r(o.cwd)||!n(o.cwd))return;let{loadRipplo:s}=await import("./dsl-loader-IRBKYLNW.js"),{stubbedWorkflows:a}=await import("./compile-write-OLP4DB4P.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};
@@ -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 P}from"./chunk-DK4NUWRX.js";import{a as I,f as v}from"./chunk-AIIZRQXH.js";import{g as h,k as w,n as k}from"./chunk-L2ZJK7MP.js";import{d as a,f}from"./chunk-AJXAWZQO.js";import{V as S,X as m}from"./chunk-XJJDHGK4.js";import y from"fs";import p from"path";function D(e){try{let n=A(e);if(n==null)return;let t=p.join(n,"HEAD"),o=y.readFileSync(t,"utf8").trim(),r="ref: refs/heads/";return o.startsWith(r)?o.slice(r.length):o.length===0?void 0:o.slice(0,7)}catch{return}}function A(e){let n=p.join(e,".git");if(y.statSync(n).isDirectory())return n;let o=y.readFileSync(n,"utf8").trim(),r="gitdir:";if(!o.startsWith(r))return;let s=o.slice(r.length).trim();if(s.length!==0)return p.resolve(e,s)}import E from"crypto";import{readFile as R}from"fs/promises";import x from"path";import{graphql as g}from"gql.tada";import{err as L,ok as T}from"neverthrow";var C=g(`
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 ie(e,n){let t=await k(e);if(t.isErr())return L({error:t.error,kind:"compilation-failed"});let o=await u({config:n,cwd:e,lockfile:t.value});return T({devSessionId:o.devSessionId,lockfile:t.value})}async function u(e){let n=S(e.lockfile);return _({config:e.config,cwd:e.cwd,fixtures:e.lockfile.fixtures,payload:n})}var F=g(`
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
+ `),W=g(`
40
+ mutation AnnounceDevSessionActive($projectId: String!, $cwd: String!) {
41
+ announceDevSessionActive(projectId: $projectId, cwd: $cwd)
42
+ }
43
+ `);async function se(e){let n=await O(e.cwd);if(n!=null){let o=(await a({config:e.config,document:F,variables:{cwd:e.cwd,projectId:e.config.projectId}}).catch(()=>null))?.project?.devSession;if(o!=null&&o.lockfileHash===n)return await a({config:e.config,document:W,variables:{cwd:e.cwd,projectId:e.config.projectId}}).catch(()=>null),{devSessionId:o.id,hooksPaused:o.hooksPaused}}return u(e)}async function O(e){let n=await $(e);return n==null?null:E.createHash("sha256").update(n).digest("hex")}async function _({config:e,cwd:n,fixtures:t,payload:o}){let r=D(n),s=await $(n),l=await H(n,t),c=await a({config:e,document:C,variables:{branch:r??null,cwd:n,entities:o.entities.map(i=>({description:i.description,name:i.name})),fixtures:l,lockfileContent:s,projectId:e.projectId,singletons:o.singletons.map(i=>({defaultValue:i.defaultValue,description:i.description,name:i.name,type:i.type})),workflows:o.workflows.map(i=>({entities:[...i.entities],expectedOutcome:i.expectedOutcome,name:i.name,slug:i.slug,sourcePath:i.sourcePath,spec:JSON.stringify(i.spec)}))}});if(c.syncDevSession==null)throw new Error("syncDevSession returned null");return{devSessionId:c.syncDevSession.id,hooksPaused:c.syncDevSession.hooksPaused}}async function H(e,n){let t=Object.entries(n);return Promise.all(t.map(async([o,r])=>({contentBase64:(await R(x.join(e,h,o))).toString("base64"),sha256:r.sha256})))}async function $(e){try{return await R(x.join(e,w),"utf8")}catch{return null}}import{graphql as q}from"gql.tada";var B=q(`
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 ge({cwd:e,editedPath:n,lockfile:t,requireHooks:o,syncFirst:r}){if(o&&!v(e))return{addedSlugs:[]};let s=new Set(X(e)),l=t.workflows.filter(d=>d.sourcePath!=null&&G({dirtySet:s,editedPath:n,sourcePath:d.sourcePath})).map(d=>m(d.name));if(l.length===0)return{addedSlugs:[]};let c=P(e).unwrapOr(void 0);return c==null?{addedSlugs:[]}:r&&!await M({cfg:c,cwd:e,lockfile:t})?{addedSlugs:[]}:{addedSlugs:await V({cfg:c,slugs:l})?l:[]}}async function M({cfg:e,cwd:n,lockfile:t}){return await u({config:e,cwd:n,lockfile:t}).catch(r=>(f.warn("auto-sync failed: %s",r instanceof Error?r.message:String(r)),null))!=null}async function V({cfg:e,slugs:n}){let o=(await a({config:e,document:B,variables:{cwd:e.cwd,projectId:e.projectId,workflowSlugs:[...n]}}).catch(r=>(f.warn("auto-scope failed: %s",r instanceof Error?r.message:String(r)),null)))?.addDirtyTestsToScope;return o?.__typename!=="MutationAddDirtyTestsToScopeSuccess"?!1:o.data.length>0}function G({dirtySet:e,editedPath:n,sourcePath:t}){return e.has(t)||n!=null&&n.endsWith(t)}var j=".ripplo/workflows/",b=" -> ";function X(e){let n;try{n=I(["status","--porcelain","-uall","--",".ripplo/workflows"],e)}catch{return[]}return n.split(`
55
+ `).map(t=>t.slice(3).trim()).map(t=>t.includes(b)?t.split(b)[1]:t).filter(t=>t!=null).filter(t=>t.startsWith(j)&&t.endsWith(".ts")).map(t=>t.slice(j.length)).filter(t=>t!=="index.ts"&&!t.endsWith("/index.ts"))}export{D as a,ie as b,u as c,se as d,O as e,ge 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 c,d as s}from"./chunk-FEHVIHVA.js";import{k as l}from"./chunk-52IE2PAQ.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 c,d as s}from"./chunk-FEHVIHVA.js";import{k as l}from"./chunk-AJXAWZQO.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,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-RIVHBABX.js";import{A as v,E as $,c as u,g as o,q as c,s as f,u as m,v as p,w as g,x as y,y as h,z as S}from"./chunk-4GA5662U.js";import{K as d,R as l}from"./chunk-XJJDHGK4.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};
@@ -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{C as i,f as t}from"./chunk-PPMW4GUY.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(`
4
+ import{B as i,f as t}from"./chunk-4GA5662U.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
5
  `)}function h(){return"Not signed in. Run `npx ripplo auth login`, then start the daemon again."}function x({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 k({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`,p=l(n.explorer,n.exploring),o=`daemon: running (${r} | ${s} | ${p} | ${d(n.progress)})`;if(n.sseHealth!=null&&!n.sseHealth.ok){let a=n.sseHealth.detail==null?"":`: ${n.sseHealth.detail}`;return`${o}
6
6
  daemon: cannot subscribe to run dispatch${a} \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 b(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 v(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"expander-newer":return"lockfile predates the current CLI build, 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,x as e,k as f,y as g,$ as h,w as i,d as j,b as k,v as l};
@@ -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{b as w,c as P}from"./chunk-HD7WIBP2.js";import{a as m}from"./chunk-MOI4L3EX.js";import{a as u,c as y,d as g}from"./chunk-FJPJDGSS.js";import{a as h}from"./chunk-OQ6KNYPG.js";import{f as S}from"./chunk-CY5FJBHP.js";import{a as c}from"./chunk-7WZ3VIUU.js";import{f as k}from"./chunk-AIIZRQXH.js";import{a as l}from"./chunk-5DT43ABQ.js";import{a as s}from"./chunk-MHNGR6M7.js";import{e as f,f as p}from"./chunk-RIVHBABX.js";import{b as d}from"./chunk-4GA5662U.js";import{createHash as b}from"crypto";import*as a from"zod/mini";var v=a.looseObject({file_path:a.string()}),J=async e=>{let o=v.safeParse(e.tool_input);if(!o.success||!/\/\.ripplo\/.*\.ts$/.test(o.data.file_path))return;let{cwd:t}=e;if(!c(t))return;if(!k(t))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 f(t);if(r.isErr())return{decision:"block",reason:`${l(r.error)}
5
+ ${s("create","DSL authoring rules")}`};let n=await F({cwd:t,filePath:o.data.file_path,lockfile:r.value});if("block"in n)return{decision:"block",reason:n.block};let{addedSlugs:i}=await S({cwd:t,editedPath:o.data.file_path,lockfile:r.value,requireHooks:!0,syncFirst:!0});return L(z({addedSlugs:i,cwd:t,elsewhere:n.elsewhere,lockfile:r.value}))};function z({addedSlugs:e,cwd:o,elsewhere:t,lockfile:r}){return[...e.length>0?[`Auto-scoped ${e.join(", ")} (dirty tests).`]:[],...t>0?[A(t).trimStart()]:[],...H(o,r)]}async function F({cwd:e,filePath:o,lockfile:t}){let r=await u({cwd:e,lockfile:t});await p(e,t);let n=N(r,t,o),i=r.length-n.length;return n.length===0?{elsewhere:i}:{block:`${y(n)}${A(i)}
6
+ ${s("create")}`}}function N(e,o,t){let r=new Set(d(o).filter(({workflow:n})=>n.sourcePath!=null&&t.endsWith(n.sourcePath)).map(({ref:n})=>n));return r.size===0?e:e.filter(n=>{let i=R(n);return i==null||r.has(i)})}function R(e){return e.kind==="unreachable-interaction"?e.violation.test:e.kind==="redundant-assertion"?e.redundancy.test:e.kind==="missing-precondition"?e.missing.test:null}function A(e){return e===0?"":`
7
+ ${h(e,"finding")} in other files \u2014 \`npx ripplo compile\` for the full list.`}function L(e){if(e.length!==0)return{hookSpecificOutput:{additionalContext:e.join(`
8
+ `),hookEventName:"PostToolUse"}}}function H(e,o){let t=m(o),r=b("sha256").update(JSON.stringify(t)).digest("hex");return w(e,"coverage-warn")===r?[]:(P(e,"coverage-warn",r),t.length===0?[]:[g(t)])}export{J as a};
@@ -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{b as s,c as u}from"./chunk-3M2E253R.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(`
4
+ import{b as s,c as u}from"./chunk-AIIZRQXH.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
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,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{K as T,L as S,Q as j,R as g,ca as B}from"./chunk-XJJDHGK4.js";import c from"fs";import l from"path";import{createHash as be}from"crypto";import{pathToFileURL as Fe}from"url";import{build as Pe}from"esbuild";import{err as L,ok as v,ResultAsync as ve}from"neverthrow";import ee from"fs";import y from"path";import u from"typescript";function M(e){let n=y.join(e,"index.ts"),t=re(e);ee.mkdirSync(y.dirname(t.tsBuildInfoFile??""),{recursive:!0});let r=u.createIncrementalCompilerHost(t),o=u.createIncrementalProgram({host:r,options:t,rootNames:[n]}),i=[...o.getSyntacticDiagnostics(),...o.getSemanticDiagnostics()];o.emit();let s=i.filter(a=>ne(a,e));if(s.length===0)return{diagnostics:[],ok:!0};let C={getCanonicalFileName:a=>a,getCurrentDirectory:()=>y.dirname(e),getNewLine:()=>`
5
+ `};return{diagnostics:u.formatDiagnosticsWithColorAndContext(s,C).split(`
6
+ `).filter(a=>a.length>0),ok:!1}}function ne(e,n){let t=e.file?.fileName;return t==null?!0:t.startsWith(n)}var te=y.join(".local","tsbuildinfo");function re(e){return{allowImportingTsExtensions:!0,allowJs:!1,esModuleInterop:!0,incremental:!0,module:u.ModuleKind.Preserve,moduleResolution:u.ModuleResolutionKind.Bundler,noEmit:!0,resolveJsonModule:!0,skipLibCheck:!0,strict:!1,target:u.ScriptTarget.ES2022,tsBuildInfoFile:y.join(e,te)}}import z from"fs";import ae from"safe-stable-stringify";import{err as le,ok as N,Result as ce}from"neverthrow";import H from"safe-stable-stringify";import{createHash as oe}from"crypto";import A from"fs";function h(){return E===void 0&&(E=ie()),E}var E;function ie(){let e=process.argv[1];if(e==null)return null;try{let n=A.readFileSync(A.realpathSync(e));return oe("sha256").update(n).digest("hex")}catch{return null}}function I(e){return{...e,checks:void 0,solved:{cosat:{},subsume:{}}}}function Ye(e,n){return H(I(e))===H(I(n))}function O(e){return _(e.checks?.expanderHash,h())}function _(e,n){return e!=null&&n!=null&&e===n}function W(e){return _(e??void 0,h())}import se from"safe-stable-stringify";function R(e){return U(e.entities,e.singletons,e.valueSpaces)}function Qe(e){return U(e.entities,e.singletonSchemas,e.valueSpaces)}function U(e,n,t){let r=se({entities:e,singletons:n,valueSpaces:t});if(r==null)throw new Error("solve-model: model is not serializable");return r}async function D(e,n){let t={entities:e.entities,singletonSchemas:e.singletons,valueSpaces:e.valueSpaces},r=de(n),o=pe(e,r),i=await Promise.all(e.workflows.map(s=>fe({context:t,reusable:o,workflow:s})));return ce.combine(i).map(s=>({...e,workflows:[...s]}))}function de(e){let n=ue(e);if(!(n==null||!O(n)))return n}function ue(e){if(z.existsSync(e))try{return S(g,z.readFileSync(e,"utf8"))}catch{return}}async function fe({context:e,reusable:n,workflow:t}){let r=n.get($(t));if(r!=null)return N({...t,tests:r.tests});try{return N(await B({context:e,workflow:t}))}catch(o){let i=o instanceof Error?o.message:String(o);return le({kind:"expand-failed",message:i,workflow:t.name})}}function $(e){let n=ae({...e,tests:[]});if(n==null)throw new Error("solver: workflow is not serializable");return n}function pe(e,n){return n==null||R(n)!==R(e)?new Map:new Map(n.workflows.map(t=>[$(t),t]))}import{createHash as me}from"crypto";import J from"fs/promises";import b from"path";import{err as f,ok as F,Result as ge}from"neverthrow";var ye=".ripplo/fixtures",he=10*1024*1024,ke=50*1024*1024;async function K(e,n){let t=xe(n);if(t.length===0)return F({});let r=b.join(e,ye),o=await Promise.all(t.map(i=>Le({fixturesRoot:r,name:i})));return ge.combine(o).andThen(Se)}function xe(e){let t=e.workflows.flatMap(r=>[...r.steps,...r.tests.flatMap(o=>o.steps)]).flatMap(r=>r.action.kind==="upload"?r.action.files:[]);return[...new Set(t)].toSorted((r,o)=>r.localeCompare(o))}async function Le({fixturesRoot:e,name:n}){if(n.includes("..")||b.isAbsolute(n))return f({kind:"fixture-invalid-name",name:n});let t=b.join(e,n),r=await J.lstat(t).catch(()=>null);if(r==null)return f({kind:"fixture-missing",name:n,path:t});if(r.isSymbolicLink())return f({kind:"fixture-symlink",name:n});if(!r.isFile())return f({kind:"fixture-not-file",name:n});let o=await J.readFile(t);if(o.byteLength>he)return f({kind:"fixture-too-large",name:n,size:o.byteLength});let i=me("sha256").update(o).digest("hex");return F([n,{sha256:i,size:o.byteLength}])}function Se(e){let n=e.reduce((t,[,r])=>t+r.size,0);return n>ke?f({kind:"fixtures-total-too-large",total:n}):F(Object.fromEntries(e))}import{createHash as we}from"crypto";function k(e){return we("sha256").update(e).digest("base64")}import p from"fs";import P from"path";import{z as w}from"zod";function X({cwd:e,fingerprint:n}){let t=Re(e);if(t==null||t.fingerprint!==k(n))return;let r=P.join(e,".ripplo","ripplo.lock");if(!p.existsSync(r))return;let o=p.readFileSync(r,"utf8");if(k(o)===t.lockfileHash)try{return S(g,o)}catch{return}}function V({cwd:e,fingerprint:n,lockfile:t}){let r={bundle:h(),fingerprint:k(n),lockfileHash:k(T(g,t))},o=Y(e);p.mkdirSync(P.dirname(o),{recursive:!0}),p.writeFileSync(o,JSON.stringify(r))}var Ee=w.object({bundle:w.string().nullable(),fingerprint:w.string(),lockfileHash:w.string()});function Re(e){let n=Y(e);if(p.existsSync(n))try{let t=Ee.safeParse(JSON.parse(p.readFileSync(n,"utf8")));return!t.success||!W(t.data.bundle)?void 0:t.data}catch{return}}function Y(e){return P.join(e,".ripplo",".local","load-cache.json")}var Ce=".ripplo/ripplo.lock",x;async function Hn(e){let{result:n}=await Te(e);return n}async function Te(e){let n=q(l.join(e,".ripplo"));if(x!=null&&x.fingerprint===n&&x.result.isOk())return{fingerprint:n,result:x.result};let t=await je(e);return x={fingerprint:n,result:t},{fingerprint:n,result:t}}async function je(e){let n=l.join(e,".ripplo"),t=l.join(n,"index.ts"),r=q(n),o=X({cwd:e,fingerprint:r});if(o!=null)return v(o);let i=Ae(t);i.catch(()=>{});let s=M(n);if(!s.ok)return L({diagnostics:s.diagnostics,kind:"typecheck-failed"});let a=await(await He(t,i)).andThen(d=>_e({entryPath:t,exported:d})).match(async d=>(await K(e,d)).map(m=>({...d,fixtures:m})).mapErr(m=>({error:m,kind:"fixture-failed"})).asyncAndThen(m=>new ve(D(m,l.join(e,Ce))).mapErr(Z=>Z)),d=>Promise.resolve(L(d)));return a.isOk()&&V({cwd:e,fingerprint:r,lockfile:a.value}),a}var Be=new Set([".local","debug","node_modules","ripplo.lock"]);function q(e){let n=l.join(e,"..","node_modules","@ripplo","testing","package.json");return[...G(e),...Me(n)].toSorted((t,r)=>t.localeCompare(r)).join("|")}function G(e){return(c.existsSync(e)?c.readdirSync(e,{withFileTypes:!0}):[]).flatMap(t=>{if(Be.has(t.name))return[];let r=l.join(e,t.name);if(t.isDirectory())return G(r);let o=c.statSync(r);return[`${r}:${String(o.mtimeMs)}:${String(o.size)}`]})}function Me(e){if(!c.existsSync(e))return[];let n=c.statSync(e);return[`${e}:${String(n.mtimeMs)}:${String(n.size)}`]}async function Ae(e){let t=(await Pe({bundle:!0,entryPoints:[e],format:"esm",logLevel:"silent",platform:"node",sourcemap:"inline",target:"node22",write:!1})).outputFiles[0];if(t==null)throw new Error("dsl bundle produced no output");return t.text}async function He(e,n){try{let t=await n;process.setSourceMapsEnabled(!0);let r=await import(Ie(e,t)),o=r!=null&&typeof r=="object"&&"default"in r?Reflect.get(r,"default"):r;return v(o)}catch(t){return L({kind:"load-threw",message:Oe(t)})}}function Ie(e,n){let t=l.join(l.dirname(e),".local");c.mkdirSync(t,{recursive:!0});let r=be("sha256").update(n).digest("hex").slice(0,16),o=l.join(t,`dsl-bundle-${r}.mjs`);return c.writeFileSync(o,n),Fe(o).href}function Oe(e){return e instanceof Error?e.message:String(e)}function _e({entryPath:e,exported:n}){if(n==null||typeof n!="object"||!("lockfile"in n))return L({entryPath:e,kind:"not-ripplo"});let t=j.safeParse(Reflect.get(n,"lockfile"));return t.success?v(t.data):L({issues:t.error.issues.map(r=>`${r.path.join(".")}: ${r.message}`),kind:"invalid-lockfile"})}export{h as a,Ye as b,O as c,W as d,R as e,Qe as f,ye as g,he as h,ke as i,k as j,Ce as k,Hn as l,Te as m,je as n};
@@ -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 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};
@@ -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-KQWFJRIP.js";import{a as p}from"./chunk-7WZ3VIUU.js";import{f as d}from"./chunk-3M2E253R.js";import{b as a}from"./chunk-MHNGR6M7.js";import{e as s}from"./chunk-52IE2PAQ.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}from"./chunk-DK4NUWRX.js";import{a as p}from"./chunk-7WZ3VIUU.js";import{f as d}from"./chunk-AIIZRQXH.js";import{b as a}from"./chunk-MHNGR6M7.js";import{e as s}from"./chunk-AJXAWZQO.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
@@ -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-GAOLASGV.js";import{a as f}from"./chunk-JJ4QQPAV.js";import{a as m}from"./chunk-7WZ3VIUU.js";import{f as c}from"./chunk-3M2E253R.js";import{i as p}from"./chunk-ZQHKESUR.js";import{k as l}from"./chunk-ML7WCYPY.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-6SYRXU4Q.js";import{a as f}from"./chunk-JJ4QQPAV.js";import{a as m}from"./chunk-7WZ3VIUU.js";import{f as c}from"./chunk-AIIZRQXH.js";import{i as p}from"./chunk-RIVHBABX.js";import{n as l}from"./chunk-L2ZJK7MP.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,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 as y,c as d,d as P,e as x,f as w,j as f,k as l,n as B}from"./chunk-L2ZJK7MP.js";import{q as F,s as b,t as H,u as E}from"./chunk-4GA5662U.js";import{K as k,L as i,R as n,S as h,da as S,ha as C,ia as g}from"./chunk-XJJDHGK4.js";import{readFile as W,writeFile as z}from"fs/promises";import T from"path";import{err as u,ok as N}from"neverthrow";import s from"fs";import v from"path";import{z as m}from"zod";function O({context:e,cwd:o}){S(e);let r=K(o,L(e));r!=null&&C(e,r)}function ie({context:e,cwd:o}){let r=D(o);if(!(r==null||r.model!==L(e)))return r.cleanLockfile??void 0}function le({cleanLockfileHash:e,context:o,cwd:r}){let t=R(r);s.mkdirSync(v.dirname(t),{recursive:!0}),s.writeFileSync(t,JSON.stringify({bundle:a(),cleanLockfile:e,model:L(o)}))}function se(e){return f(e)}var I=m.object({bundle:m.string().nullable(),cleanLockfile:m.string().nullable(),model:m.string()});function K(e,o){let r=v.join(e,l),t=_(r);return t==null||!d(t)?null:f(x(t))===o?t.solved:null}function _(e){try{return i(n,s.readFileSync(e,"utf8"))}catch{return null}}function L(e){return f(w(e))}function D(e){let o=R(e);if(s.existsSync(o))try{let r=I.safeParse(JSON.parse(s.readFileSync(o,"utf8")));return!r.success||!P(r.data.bundle)?void 0:r.data}catch{return}}function R(e){return v.join(e,".ripplo",".local","solve-cache.json")}async function Le(e){let o=await B(e);return o.isOk()&&await q(e,o.value),o}async function q(e,o){let r=await G(e,o);return await z(T.join(e,l),k(n,r)),r}var M=new WeakMap;function G(e,o){let r=M.get(o);if(r!=null)return r;let t=A(e,o).then(c=>c.match(p=>Promise.resolve(p),()=>Q(e,o)));return M.set(o,t),t}function Se(e,o){return A(e,o)}function Ce(e){return e.workflows.filter(o=>o.stub).map(o=>o.name)}async function ge(e,o){let r=await j(e);return r==null?"missing":r.checks==null?"stale":y(r,o)?"match":"stale"}async function A(e,o){let r=await j(e);return r==null?u({kind:"no-lockfile"}):r.checks==null?u({kind:"unstamped"}):d(r)?y(r,o)?N(h(r)):u({kind:"dsl-drift"}):u({kind:"expander-newer"})}async function j(e){try{let o=await W(T.join(e,l),"utf8");return i(n,o)}catch{return null}}async function Q(e,o){let r=F(o);O({context:r,cwd:e});let t=await H(o),c=await b(o);await E({context:r,facts:c.facts});let p=await g(r),V=a(),J={...o,checks:{...t,expanderHash:V??void 0},solved:p};return h(i(n,k(n,J)))}export{O as a,ie as b,le as c,se as d,Le as e,q as f,G as g,Se as h,Ce as i,ge as j};
@@ -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 a}from"./chunk-OWN4P2K7.js";import{a as s}from"./chunk-7WZ3VIUU.js";import{f as l}from"./chunk-3M2E253R.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};
4
+ import{b as a}from"./chunk-OWN4P2K7.js";import{a as s}from"./chunk-7WZ3VIUU.js";import{f as l}from"./chunk-AIIZRQXH.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,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-AIIZRQXH.js";import{a as i}from"./chunk-MHNGR6M7.js";import{n}from"./chunk-L2ZJK7MP.js";import{c as a}from"./chunk-36NPGS6X.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};
@@ -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-N45RSC6N.js";import{c as l}from"./chunk-5E62BCS7.js";import{c as d}from"./chunk-KQWFJRIP.js";import{a as i}from"./chunk-7WZ3VIUU.js";import{f as u}from"./chunk-3M2E253R.js";import{e as a}from"./chunk-52IE2PAQ.js";import{createHash as g}from"crypto";import{graphql as k}from"gql.tada";var c="tasks-reminder",y=k(`
4
+ import{b as m,c as p}from"./chunk-HD7WIBP2.js";import{c as l}from"./chunk-5E62BCS7.js";import{c as d}from"./chunk-DK4NUWRX.js";import{a as i}from"./chunk-7WZ3VIUU.js";import{f as u}from"./chunk-AIIZRQXH.js";import{e as a}from"./chunk-AJXAWZQO.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