ripplo 0.15.0 → 0.15.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/{chunk-RROQ7ULM.js → chunk-3BPQWAUL.js} +1 -1
  2. package/dist/{chunk-OJP65ZCN.js → chunk-5RKZ44OU.js} +1 -1
  3. package/dist/{chunk-755GNXZM.js → chunk-BFAWQ5U2.js} +1 -1
  4. package/dist/chunk-BIB4JJKD.js +84 -0
  5. package/dist/chunk-HN55QF5N.js +405 -0
  6. package/dist/{chunk-D3X4WMLM.js → chunk-JQ2CRYVX.js} +1 -1
  7. package/dist/{chunk-LKSPG7VE.js → chunk-LCCJPRT5.js} +1 -1
  8. package/dist/{chunk-33X7JOIS.js → chunk-Q2TF5WLS.js} +1 -1
  9. package/dist/{chunk-EJGLDNQQ.js → chunk-QEE4CNMY.js} +1 -1
  10. package/dist/{chunk-TM6CZ34R.js → chunk-RLB66SU3.js} +1 -1
  11. package/dist/{chunk-X7ZHRVMR.js → chunk-TZPYILZK.js} +1 -1
  12. package/dist/{chunk-EWF5XUHE.js → chunk-VHFITVRX.js} +1 -1
  13. package/dist/{chunk-UNNCONOS.js → chunk-W3CXPVVB.js} +2 -2
  14. package/dist/{chunk-66ILXPAB.js → chunk-WB3HHOCG.js} +1 -1
  15. package/dist/{chunk-HOPUAKLV.js → chunk-XA6BMQTW.js} +1 -1
  16. package/dist/{chunk-E52EBMZ6.js → chunk-Y52M43LO.js} +1 -1
  17. package/dist/{chunk-LGXGJCWO.js → chunk-YD4VBOBY.js} +1 -1
  18. package/dist/{chunk-U3542BWK.js → chunk-YRU6BOIP.js} +1 -1
  19. package/dist/{chunk-PSLQ3HRP.js → chunk-ZSD6QDYB.js} +18 -18
  20. package/dist/{cli-error-PMT64ZXX.js → cli-error-UYWIDE4L.js} +1 -1
  21. package/dist/{compile-write-63UB2DA5.js → compile-write-QNV2EA5B.js} +1 -1
  22. package/dist/daemon-D4UCHMHS.js +175 -0
  23. package/dist/{daemon-RKXMF66W.js → daemon-LZTY7W4M.js} +1 -1
  24. package/dist/{dsl-loader-JKBFRYTG.js → dsl-loader-G2CRA252.js} +1 -1
  25. package/dist/hook.js +1 -1
  26. package/dist/index.js +213 -192
  27. package/dist/{plan-reminder-25WKHV6G.js → plan-reminder-EDDIUY43.js} +1 -1
  28. package/dist/{post-edit-NNQDVLZX.js → post-edit-4CM5P2G2.js} +1 -1
  29. package/dist/post-edit-analyze-HKOTNA2H.js +4 -0
  30. package/dist/{post-edit-flag-stubs-OCF5DCCS.js → post-edit-flag-stubs-2HZMK4NQ.js} +1 -1
  31. package/dist/{pre-edit-4BCNZ6ZW.js → pre-edit-JZX36QX6.js} +1 -1
  32. package/dist/{pre-edit-watch-gate-XGPB5GAF.js → pre-edit-watch-gate-T2TWL66C.js} +1 -1
  33. package/dist/{prompt-submit-4ZWKXB6N.js → prompt-submit-GVZHK3CI.js} +1 -1
  34. package/dist/status-CNSPYNYP.js +4 -0
  35. package/dist/{stop-enforce-J4VZOBMW.js → stop-enforce-NKKP2X4U.js} +1 -1
  36. package/package.json +4 -3
  37. package/dist/chunk-ZEZ5O7PZ.js +0 -360
  38. package/dist/chunk-ZPJ6MRKF.js +0 -83
  39. package/dist/daemon-K6OMN2RY.js +0 -175
  40. package/dist/post-edit-analyze-TG4BPWTP.js +0 -4
  41. package/dist/status-LFD3KLZV.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-D3X4WMLM.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};
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-JQ2CRYVX.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,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 t}from"./chunk-MHNGR6M7.js";import{g as o,h as a,j as i}from"./chunk-TM6CZ34R.js";function h(e){return e.kind==="authoring-error"?["Compilation failed",e.message,t("create","DSL authoring rules")].join(`
4
+ import{a as t}from"./chunk-MHNGR6M7.js";import{g as o,h as a,j as i}from"./chunk-RLB66SU3.js";function h(e){return e.kind==="authoring-error"?["Compilation failed",e.message,t("create","DSL authoring rules")].join(`
5
5
 
6
6
  `):[`Compilation failed: ${l(e)}`,t("create","DSL authoring rules")].join(`
7
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(`
@@ -2,6 +2,6 @@
2
2
  import { createRequire as __ripploCreateRequire } from "node:module";
3
3
  const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
4
4
  import{a as p,c as t}from"./chunk-KOKEEAEF.js";import{a as s}from"./chunk-HEOMRXZE.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-44YWEKYS.js").then(o=>o.exitPlanGateHook),"plan-reminder":()=>import("./plan-reminder-25WKHV6G.js").then(o=>t("UserPromptSubmit",o.planReminder)),"post-edit":()=>import("./post-edit-NNQDVLZX.js").then(o=>o.postEditHook),"post-edit-analyze":()=>import("./post-edit-analyze-TG4BPWTP.js").then(o=>t("PostToolUse",o.postEditAnalyze)),"post-edit-flag-stubs":()=>import("./post-edit-flag-stubs-OCF5DCCS.js").then(o=>t("PostToolUse",o.postEditFlagStubs)),"pre-bash-run-gate":()=>import("./pre-bash-run-gate-CDFNAIK3.js").then(o=>o.preBashRunGateHook),"pre-edit":()=>import("./pre-edit-4BCNZ6ZW.js").then(o=>o.preEditHook),"pre-edit-ripplo-skill-gate":()=>import("./pre-edit-ripplo-skill-gate-A6ETC3QN.js").then(o=>t("PreToolUse",o.preEditRipploSkillGate)),"pre-edit-scope-gate":()=>import("./pre-edit-scope-gate-HNIQ7KOQ.js").then(o=>t("PreToolUse",o.preEditScopeGate)),"pre-edit-watch-gate":()=>import("./pre-edit-watch-gate-XGPB5GAF.js").then(o=>t("PreToolUse",o.preEditWatchGate)),"prompt-submit":()=>import("./prompt-submit-4ZWKXB6N.js").then(o=>o.promptSubmitHook),"scope-reminder":()=>import("./scope-reminder-A6GVTTVE.js").then(o=>t("UserPromptSubmit",o.scopeReminder)),"session-preamble":()=>import("./session-preamble-IZQPIWST.js").then(o=>o.sessionPreambleHook),"stop-enforce":()=>import("./stop-enforce-J4VZOBMW.js").then(o=>o.stopEnforceHook),"tasks-reminder":()=>import("./tasks-reminder-TDWPD3KV.js").then(o=>t("UserPromptSubmit",o.tasksReminder)),"tasks-reminder-tool":()=>Promise.resolve(t("PostToolUse",()=>{})),"track-skill-load":()=>import("./track-skill-load-SXSDMHFO.js").then(o=>o.trackSkillLoadHook),"track-skill-prompt":()=>import("./track-skill-prompt-7N4TQAD2.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-PMT64ZXX.js");process.stderr.write(`${a(o,r.error)}
5
+ `))}var d={"exit-plan-gate":()=>import("./exit-plan-gate-44YWEKYS.js").then(o=>o.exitPlanGateHook),"plan-reminder":()=>import("./plan-reminder-EDDIUY43.js").then(o=>t("UserPromptSubmit",o.planReminder)),"post-edit":()=>import("./post-edit-4CM5P2G2.js").then(o=>o.postEditHook),"post-edit-analyze":()=>import("./post-edit-analyze-HKOTNA2H.js").then(o=>t("PostToolUse",o.postEditAnalyze)),"post-edit-flag-stubs":()=>import("./post-edit-flag-stubs-2HZMK4NQ.js").then(o=>t("PostToolUse",o.postEditFlagStubs)),"pre-bash-run-gate":()=>import("./pre-bash-run-gate-CDFNAIK3.js").then(o=>o.preBashRunGateHook),"pre-edit":()=>import("./pre-edit-JZX36QX6.js").then(o=>o.preEditHook),"pre-edit-ripplo-skill-gate":()=>import("./pre-edit-ripplo-skill-gate-A6ETC3QN.js").then(o=>t("PreToolUse",o.preEditRipploSkillGate)),"pre-edit-scope-gate":()=>import("./pre-edit-scope-gate-HNIQ7KOQ.js").then(o=>t("PreToolUse",o.preEditScopeGate)),"pre-edit-watch-gate":()=>import("./pre-edit-watch-gate-T2TWL66C.js").then(o=>t("PreToolUse",o.preEditWatchGate)),"prompt-submit":()=>import("./prompt-submit-GVZHK3CI.js").then(o=>o.promptSubmitHook),"scope-reminder":()=>import("./scope-reminder-A6GVTTVE.js").then(o=>t("UserPromptSubmit",o.scopeReminder)),"session-preamble":()=>import("./session-preamble-IZQPIWST.js").then(o=>o.sessionPreambleHook),"stop-enforce":()=>import("./stop-enforce-NKKP2X4U.js").then(o=>o.stopEnforceHook),"tasks-reminder":()=>import("./tasks-reminder-TDWPD3KV.js").then(o=>t("UserPromptSubmit",o.tasksReminder)),"tasks-reminder-tool":()=>Promise.resolve(t("PostToolUse",()=>{})),"track-skill-load":()=>import("./track-skill-load-SXSDMHFO.js").then(o=>o.trackSkillLoadHook),"track-skill-prompt":()=>import("./track-skill-prompt-7N4TQAD2.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-UYWIDE4L.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,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __ripploCreateRequire } from "node:module";
3
3
  const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
4
- import{a as o}from"./chunk-EWF5XUHE.js";import{a as t}from"./chunk-MHNGR6M7.js";var r=class extends Error{failure;constructor(i){super(i.kind),this.name="CliError",this.failure=i}};function u(e){return e instanceof r?a(e.failure):e instanceof Error?e.message:String(e)}function a(e){switch(e.kind){case"project-file-missing":return[`Missing ${e.path} \u2014 this directory is not a Ripplo project.`,"Run `npx ripplo init` to create it (or cd into the project root).",t("setup")].join(`
4
+ import{a as o}from"./chunk-VHFITVRX.js";import{a as t}from"./chunk-MHNGR6M7.js";var r=class extends Error{failure;constructor(i){super(i.kind),this.name="CliError",this.failure=i}};function u(e){return e instanceof r?a(e.failure):e instanceof Error?e.message:String(e)}function a(e){switch(e.kind){case"project-file-missing":return[`Missing ${e.path} \u2014 this directory is not a Ripplo project.`,"Run `npx ripplo init` to create it (or cd into the project root).",t("setup")].join(`
5
5
  `);case"project-file-invalid":return[`${e.path} is invalid:`,...e.issues.map(i=>` ${i}`),"Fix the file by hand or re-run `npx ripplo init`."].join(`
6
6
  `);case"not-authenticated":return["Not signed in. Run `npx ripplo auth login`.","(Claude Code: run it yourself in the background \u2014 the user just approves in the browser.)"].join(`
7
7
  `);case"env-invalid":return s(e);case"playwright-install-failed":return["Playwright browser install failed \u2014 Chromium is still missing.","Run `npx playwright install chromium` and check its output for network, proxy, or disk-space errors."].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{g as m}from"./chunk-755GNXZM.js";import{a as f,c as k}from"./chunk-EJGLDNQQ.js";import{a as h}from"./chunk-OQ6KNYPG.js";import{a as y}from"./chunk-EWF5XUHE.js";import{a as s}from"./chunk-MHNGR6M7.js";import{h as d,i as p}from"./chunk-OJP65ZCN.js";import{o as u}from"./chunk-ZPJ6MRKF.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)}
4
+ import{g as m}from"./chunk-BFAWQ5U2.js";import{a as f,c as k}from"./chunk-QEE4CNMY.js";import{a as h}from"./chunk-OQ6KNYPG.js";import{a as y}from"./chunk-VHFITVRX.js";import{a as s}from"./chunk-MHNGR6M7.js";import{h as d,i as p}from"./chunk-5RKZ44OU.js";import{o as u}from"./chunk-BIB4JJKD.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
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
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
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(`
@@ -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{h as u}from"./chunk-33X7JOIS.js";import{f as a}from"./chunk-X7ZHRVMR.js";import{a as i}from"./chunk-EWF5XUHE.js";import{l as n}from"./chunk-OJP65ZCN.js";import{m as e}from"./chunk-TM6CZ34R.js";async function x(m){let o=process.cwd(),r=await e(o);r.isErr()&&(process.stderr.write(`${i(r.error)}
4
+ import{h as u}from"./chunk-Q2TF5WLS.js";import{f as a}from"./chunk-TZPYILZK.js";import{a as i}from"./chunk-VHFITVRX.js";import{l as n}from"./chunk-5RKZ44OU.js";import{m as e}from"./chunk-RLB66SU3.js";async function x(m){let o=process.cwd(),r=await e(o);r.isErr()&&(process.stderr.write(`${i(r.error)}
5
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)}
@@ -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-SXVWB7TZ.js";import{a as f}from"./chunk-JJ4QQPAV.js";import{l as c}from"./chunk-OJP65ZCN.js";import{m as p}from"./chunk-TM6CZ34R.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};
4
+ import{b as u}from"./chunk-SXVWB7TZ.js";import{a as f}from"./chunk-JJ4QQPAV.js";import{l as c}from"./chunk-5RKZ44OU.js";import{m as p}from"./chunk-RLB66SU3.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};
@@ -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 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{f as t,k as c}from"./chunk-ZPJ6MRKF.js";import{Ma as l}from"./chunk-PSLQ3HRP.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(`
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{f as t,k as c}from"./chunk-BIB4JJKD.js";import{Ma as l}from"./chunk-ZSD6QDYB.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
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
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
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}