ripplo 0.9.0 → 0.9.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 (32) hide show
  1. package/dist/{chunk-EA62LNKT.js → chunk-3FF33GCX.js} +1 -1
  2. package/dist/chunk-3LYVTLBJ.js +4 -0
  3. package/dist/{chunk-AYDIXOW2.js → chunk-4KOWK5QE.js} +1 -1
  4. package/dist/{chunk-CDPYJKK7.js → chunk-5E62BCS7.js} +2 -2
  5. package/dist/{chunk-ZDA3E2AS.js → chunk-BMRZGLUF.js} +5 -5
  6. package/dist/chunk-IGPHRN4A.js +83 -0
  7. package/dist/{chunk-QQ7NFPJQ.js → chunk-IL452KDO.js} +1 -1
  8. package/dist/{chunk-V4IQQT44.js → chunk-KYMYKILH.js} +1 -1
  9. package/dist/{chunk-JXGIARTE.js → chunk-SI42TC5O.js} +1 -1
  10. package/dist/{chunk-PRD7P6EF.js → chunk-SWYJTSC3.js} +1 -1
  11. package/dist/{chunk-FR4ENKCT.js → chunk-UDQKJVLD.js} +1 -1
  12. package/dist/{chunk-U27IDW6O.js → chunk-VE6PPIKX.js} +2 -2
  13. package/dist/{chunk-A7SHHSB3.js → chunk-ZNUC2RLT.js} +1 -1
  14. package/dist/compile-write-SRW6FWD2.js +4 -0
  15. package/dist/{daemon-3J3K4BOD.js → daemon-42BG4EKR.js} +1 -1
  16. package/dist/{daemon-AS6IHTHD.js → daemon-4W6BN73Z.js} +1 -1
  17. package/dist/hook.js +1 -1
  18. package/dist/index.js +214 -183
  19. package/dist/{plan-reminder-E6AXT6OB.js → plan-reminder-2GIRATWH.js} +1 -1
  20. package/dist/{post-edit-LUPA46ZO.js → post-edit-T5C6I6ZI.js} +1 -1
  21. package/dist/{post-edit-analyze-XY6C7ZFP.js → post-edit-analyze-326U7L26.js} +1 -1
  22. package/dist/{post-edit-flag-stubs-ZMKN4DJZ.js → post-edit-flag-stubs-EBDTZMDS.js} +1 -1
  23. package/dist/{prompt-submit-U3QOU47D.js → prompt-submit-3SSUX3S2.js} +1 -1
  24. package/dist/{session-preamble-IHBGHKCW.js → session-preamble-ZYVRDSGA.js} +1 -1
  25. package/dist/status-WZG6MDCY.js +4 -0
  26. package/dist/{stop-enforce-ZLQKGMSF.js → stop-enforce-TYUSBDHO.js} +1 -1
  27. package/dist/{tasks-reminder-LKSUZUFD.js → tasks-reminder-VKRJRDNC.js} +1 -1
  28. package/package.json +4 -4
  29. package/dist/chunk-BR7W4UBJ.js +0 -83
  30. package/dist/chunk-XVMIPWJQ.js +0 -4
  31. package/dist/compile-write-H2GLCECO.js +0 -4
  32. package/dist/status-247DEYFK.js +0 -4
@@ -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{c as s}from"./chunk-CJUKILIO.js";function l(){let o=process.cwd(),e=s(o);e!=null&&e!==o&&(process.chdir(e),process.stderr.write(`ripplo: resolved .ripplo/ at ${e}
5
- `))}var d={"exit-plan-gate":()=>import("./exit-plan-gate-BNAUL4FC.js").then(o=>o.exitPlanGateHook),"plan-reminder":()=>import("./plan-reminder-E6AXT6OB.js").then(o=>t("UserPromptSubmit",o.planReminder)),"post-edit":()=>import("./post-edit-LUPA46ZO.js").then(o=>o.postEditHook),"post-edit-analyze":()=>import("./post-edit-analyze-XY6C7ZFP.js").then(o=>t("PostToolUse",o.postEditAnalyze)),"post-edit-flag-stubs":()=>import("./post-edit-flag-stubs-ZMKN4DJZ.js").then(o=>t("PostToolUse",o.postEditFlagStubs)),"pre-bash-run-gate":()=>import("./pre-bash-run-gate-PWLARIYK.js").then(o=>o.preBashRunGateHook),"pre-edit":()=>import("./pre-edit-EJO3TUNQ.js").then(o=>o.preEditHook),"pre-edit-ripplo-skill-gate":()=>import("./pre-edit-ripplo-skill-gate-JD4BDCA3.js").then(o=>t("PreToolUse",o.preEditRipploSkillGate)),"pre-edit-scope-gate":()=>import("./pre-edit-scope-gate-NZO4HVGT.js").then(o=>t("PreToolUse",o.preEditScopeGate)),"pre-edit-watch-gate":()=>import("./pre-edit-watch-gate-DZHQCMEI.js").then(o=>t("PreToolUse",o.preEditWatchGate)),"prompt-submit":()=>import("./prompt-submit-U3QOU47D.js").then(o=>o.promptSubmitHook),"scope-reminder":()=>import("./scope-reminder-CBY4I5SG.js").then(o=>t("UserPromptSubmit",o.scopeReminder)),"session-preamble":()=>import("./session-preamble-IHBGHKCW.js").then(o=>o.sessionPreambleHook),"stop-enforce":()=>import("./stop-enforce-ZLQKGMSF.js").then(o=>o.stopEnforceHook),"tasks-reminder":()=>import("./tasks-reminder-LKSUZUFD.js").then(o=>t("UserPromptSubmit",o.tasksReminder)),"tasks-reminder-tool":()=>Promise.resolve(t("PostToolUse",()=>{})),"track-skill-load":()=>import("./track-skill-load-CJ74GD3Q.js").then(o=>o.trackSkillLoadHook),"track-skill-prompt":()=>import("./track-skill-prompt-YSB6OOQN.js").then(o=>t("UserPromptSubmit",o.trackSkillPrompt))},n=d;async function P(o){let e=n[o];e==null&&(process.stderr.write(`Unknown hook: ${o}
5
+ `))}var d={"exit-plan-gate":()=>import("./exit-plan-gate-BNAUL4FC.js").then(o=>o.exitPlanGateHook),"plan-reminder":()=>import("./plan-reminder-2GIRATWH.js").then(o=>t("UserPromptSubmit",o.planReminder)),"post-edit":()=>import("./post-edit-T5C6I6ZI.js").then(o=>o.postEditHook),"post-edit-analyze":()=>import("./post-edit-analyze-326U7L26.js").then(o=>t("PostToolUse",o.postEditAnalyze)),"post-edit-flag-stubs":()=>import("./post-edit-flag-stubs-EBDTZMDS.js").then(o=>t("PostToolUse",o.postEditFlagStubs)),"pre-bash-run-gate":()=>import("./pre-bash-run-gate-PWLARIYK.js").then(o=>o.preBashRunGateHook),"pre-edit":()=>import("./pre-edit-EJO3TUNQ.js").then(o=>o.preEditHook),"pre-edit-ripplo-skill-gate":()=>import("./pre-edit-ripplo-skill-gate-JD4BDCA3.js").then(o=>t("PreToolUse",o.preEditRipploSkillGate)),"pre-edit-scope-gate":()=>import("./pre-edit-scope-gate-NZO4HVGT.js").then(o=>t("PreToolUse",o.preEditScopeGate)),"pre-edit-watch-gate":()=>import("./pre-edit-watch-gate-DZHQCMEI.js").then(o=>t("PreToolUse",o.preEditWatchGate)),"prompt-submit":()=>import("./prompt-submit-3SSUX3S2.js").then(o=>o.promptSubmitHook),"scope-reminder":()=>import("./scope-reminder-CBY4I5SG.js").then(o=>t("UserPromptSubmit",o.scopeReminder)),"session-preamble":()=>import("./session-preamble-ZYVRDSGA.js").then(o=>o.sessionPreambleHook),"stop-enforce":()=>import("./stop-enforce-TYUSBDHO.js").then(o=>o.stopEnforceHook),"tasks-reminder":()=>import("./tasks-reminder-VKRJRDNC.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
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-J33JDZET.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};
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __ripploCreateRequire } from "node:module";
3
+ const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
4
+ import{a as c,b as v,c as d,d as C,h as s,k as P}from"./chunk-EVVF662P.js";import{k as w,n as x,o as b,p as F}from"./chunk-IGPHRN4A.js";import{E as k,F as i,L as n,M as h,Z as y,ba as L,ca as g}from"./chunk-4F67XQYS.js";import{readFile as D,writeFile as W}from"fs/promises";import R from"path";import{err as m,ok as K}from"neverthrow";import{createHash as H}from"crypto";import l from"fs";import S from"path";import V from"safe-stable-stringify";import{z as f}from"zod";function B({context:e,cwd:t}){y(e);let o=I(t,u(e));o!=null&&L(e,o)}function ne({context:e,cwd:t}){let o=z(t);if(!(o==null||o.model!==u(e)))return o.cleanLockfile??void 0}function ie({cleanLockfileHash:e,context:t,cwd:o}){let r=E(o);l.mkdirSync(S.dirname(r),{recursive:!0}),l.writeFileSync(r,JSON.stringify({bundle:c(),cleanLockfile:e,model:u(t)}))}function se(e){return H("sha256").update(e).digest("base64")}var J=f.object({bundle:f.string().nullable(),cleanLockfile:f.string().nullable(),model:f.string()});function I(e,t){let o=S.join(e,s),r=_(o);return r==null||!d(r)?null:u({entities:r.entities,singletonSchemas:r.singletons,valueSpaces:r.valueSpaces})===t?r.solved:null}function _(e){try{return i(n,l.readFileSync(e,"utf8"))}catch{return null}}function u(e){let t=V({entities:e.entities,singletons:e.singletonSchemas,valueSpaces:e.valueSpaces});if(t==null)throw new Error("solve-cache: context is not serializable");return H("sha256").update(t).digest("base64")}function z(e){let t=E(e);if(l.existsSync(t))try{let o=J.safeParse(JSON.parse(l.readFileSync(t,"utf8")));return!o.success||!C(o.data.bundle)?void 0:o.data}catch{return}}function E(e){return S.join(e,".ripplo",".local","solve-cache.json")}async function Se(e){let t=await P(e);return t.isOk()&&await N(e,t.value),t}async function N(e,t){let o=await q(e,t);return await W(R.join(e,s),k(n,o)),o}var O=new WeakMap;function q(e,t){let o=O.get(t);if(o!=null)return o;let r=T(e,t).then(a=>a.match(p=>Promise.resolve(p),()=>G(e,t)));return O.set(t,r),r}function ye(e,t){return T(e,t)}function Le(e){return e.workflows.filter(t=>t.stub).map(t=>t.name)}async function ge(e,t){let o=await A(e);return o==null?"missing":o.checks==null?"stale":v(o,t)?"match":"stale"}async function T(e,t){let o=await A(e);return o==null?m({kind:"no-lockfile"}):o.checks==null?m({kind:"unstamped"}):d(o)?v(o,t)?K(h(o)):m({kind:"dsl-drift"}):m({kind:"expander-newer"})}async function A(e){try{let t=await D(R.join(e,s),"utf8");return i(n,t)}catch{return null}}async function G(e,t){let o=w(t);B({context:o,cwd:e});let r=await b(t),a=await x(t);await F({context:o,facts:a.facts});let p=await g(o),j=c(),M={...t,checks:{...r,expanderHash:j??void 0},solved:p};return h(i(n,k(n,M)))}export{B as a,ne as b,ie as c,se as d,Se as e,N as f,q as g,ye as h,Le as i,ge as j};
@@ -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-4W6WIT7T.js";var m=async o=>{if(o.permission_mode!=="plan"||!r(o.cwd)||!n(o.cwd))return;let{loadRipplo:s}=await import("./dsl-loader-5Z2JRKY3.js"),{stubbedWorkflows:a}=await import("./compile-write-H2GLCECO.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-4W6WIT7T.js";var m=async o=>{if(o.permission_mode!=="plan"||!r(o.cwd)||!n(o.cwd))return;let{loadRipplo:s}=await import("./dsl-loader-5Z2JRKY3.js"),{stubbedWorkflows:a}=await import("./compile-write-SRW6FWD2.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};
@@ -4,6 +4,6 @@ const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
4
4
  import{a as o}from"./chunk-OQ6KNYPG.js";import{a as i}from"./chunk-MHNGR6M7.js";function y(n){if(n.length===0)return"No open tasks.";let e=n.map(r=>` [${a(r.status)}] [${r.kind}] (${r.id}) ${l(r)}`);return[`${o(n.length,"open task")}:`,...e].join(`
5
5
  `)}function m(n){let e=`[${a(n.status)}] [${n.kind}] (${n.id}) ${n.title??""}`.trim(),r=n.messages.flatMap(t=>u(t));return[e,...r,"",$()].join(`
6
6
  `)}function x(n){let e=n.map(r=>` [${a(r.status)}] [${r.kind}] (${r.id}) ${l(r)}`);return[`New or updated Ripplo tasks (${o(n.length,"open task")}):`,...e,i("tasks","picking each up")].join(`
7
- `)}function T(n){let{task:e}=n,r=e.title??e.latestMessage??"(no description)",t=i("tasks");return n.type==="new"?`New task [${e.kind}] (${e.id}) ${r} \u2014 ${t}`:n.type==="reopened"?`Reopened task (${e.id}) ${r} \u2014 earlier resolution didn't hold. ${t}`:`User replied on task (${e.id}): ${e.latestMessage??r} \u2014 ${t}`}function b(n){return`No task with id ${n}. List them with \`npx ripplo tasks list\`.`}function w(n){return`Commented on task ${n}.`}function S(){return"Clarification needs a message \u2014 say what's ambiguous and what you need."}function N(n,e){let r=e==null?"an element node's id":`its parent element id ${String(e)}`;return`rrweb id ${String(n)} is a text node \u2014 no box to highlight. Anchor to ${r}.`}function M(n,e){return`rrweb id ${String(n)} is not in run ${e}. Pick an element id from .ripplo/debug/${e}/behavior.jsonl.`}function A(n){return`rrweb id ${String(n)} is not an element node. Anchor to an element so it can be highlighted.`}function R(n){return`Resolved task ${n}.`}function C(n){return`Started task ${n} \u2014 in progress until resolved, dismissed, or sent back for clarification.`}function I(n){return`Marked task ${n} as needing clarification \u2014 the user will follow up.`}function v(n){return`Dismissed task ${n}.`}function a(n){return n==="needsClarification"?"needs clarification":n}function l(n){return n.title??n.lastMessage??"(no description)"}function u(n){let e=n.authorName??n.author;return n.runId==null?[` ${e}: ${n.body}`]:[` ${e} @ ${n.runId}${c(n.frameMs)}: ${n.body}`,...p(n,n.runId)]}function c(n){return n==null?"":` (${String(n)}ms)`}function p(n,e){let r=g(n),t=n.frameMs==null?null:` see it: npx ripplo snapshot ${e} --offset ${String(n.frameMs)}`;return[r,t].filter(s=>s!=null)}function g(n){return n.element!=null?` element: ${f(n.element)}`:n.rrwebId==null?null:` element: rrweb id ${String(n.rrwebId)}`}function f(n){let e=n.role==null?"":`[role=${n.role}]`,r=n.testId==null?"":` testid=${n.testId}`,t=n.ariaName==null?"":` aria="${n.ariaName}"`,s=n.text==null?"":` "${n.text}"`,d=n.selector==null?"":`
8
- selector: ${n.selector}`;return`${n.tagName??"element"}${e}${r}${t}${s}${d}`}function $(){return["Snapshot the frame above and Read the PNG \u2014 the rendered frame is the evidence, not the thread text.","Read the whole run with `npx ripplo explain <runId>` \u2014 auto-pulls a cloud run's stream if not on disk.",i("tasks","picking this up")].join(`
7
+ `)}function T(n){let{task:e}=n,r=e.title??e.latestMessage??"(no description)",t=i("tasks");return n.type==="new"?`New task [${e.kind}] (${e.id}) ${r} \u2014 ${t}`:n.type==="reopened"?`Reopened task (${e.id}) ${r} \u2014 earlier resolution didn't hold. ${t}`:`User replied on task (${e.id}): ${e.latestMessage??r} \u2014 ${t}`}function b(n){return`No task with id ${n}. List them with \`npx ripplo tasks list\`.`}function w(n){return`Commented on task ${n}.`}function S(){return"Clarification needs a message \u2014 say what's ambiguous and what you need."}function N(n,e){let r=e==null?"an element node's id":`its parent element id ${String(e)}`;return`rrweb id ${String(n)} is a text node \u2014 no box to highlight. Anchor to ${r}.`}function M(n,e){return`rrweb id ${String(n)} is not in run ${e}. Pick an element id from .ripplo/debug/${e}/behavior.jsonl.`}function A(n){return`rrweb id ${String(n)} is not an element node. Anchor to an element so it can be highlighted.`}function R(n){return`Resolved task ${n}.`}function C(n){return`Started task ${n} \u2014 in progress until resolved, dismissed, or sent back for clarification.`}function I(n){return`Marked task ${n} as needing clarification \u2014 the user will follow up.`}function v(n){return`Dismissed task ${n}.`}function a(n){return n==="needsClarification"?"needs clarification":n}function l(n){return n.title??n.lastMessage??"(no description)"}function u(n){let e=n.authorName??n.author;return n.runId==null?[` ${e}: ${n.body}`]:[` ${e} @ ${n.runId}${p(n.frameMs)}: ${n.body}`,...c(n,n.runId)]}function p(n){return n==null?"":` (${String(n)}ms)`}function c(n,e){let r=f(n),t=n.frameMs==null?null:` see it: npx ripplo snapshot ${e} --offset ${String(n.frameMs)}`;return[r,t].filter(s=>s!=null)}function f(n){return n.element!=null?` element: ${g(n.element)}`:n.rrwebId==null?null:` element: rrweb id ${String(n.rrwebId)}`}function g(n){let e=n.role==null?"":`[role=${n.role}]`,r=n.testId==null?"":` testid=${n.testId}`,t=n.ariaName==null?"":` aria="${n.ariaName}"`,s=n.text==null?"":` "${n.text}"`,d=n.selector==null?"":`
8
+ selector: ${n.selector}`;return`${n.tagName??"element"}${e}${r}${t}${s}${d}`}function $(){return["Snapshot the frame above and Read the PNG \u2014 the rendered frame is the evidence, not the thread text.","Read the whole run with `npx ripplo explain <runId>` \u2014 auto-pulls a cloud run's stream if not on disk.","Add `--full` for the world the model set up plus a step-by-step timeline of what happened.",i("tasks","picking this up")].join(`
9
9
  `)}export{y as a,m as b,x as c,T as d,b as e,w as f,S as g,N as h,M as i,A as j,R as k,C as l,I as m,v as n};
@@ -1,9 +1,9 @@
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}from"./chunk-OQ6KNYPG.js";import{c as p}from"./chunk-LEFXRK53.js";import{c as l}from"./chunk-FEHVIHVA.js";import{a}from"./chunk-MHNGR6M7.js";import{I as u,w as t}from"./chunk-BR7W4UBJ.js";import{R as d}from"./chunk-4F67XQYS.js";var f=3e3;async function S(e){l(e);let n=p(e).unwrapOr(void 0);if(n==null)return null;try{return await fetch(`${n.ripploServerUrl}/health`,{signal:AbortSignal.timeout(f)}),null}catch(r){return{detail:r instanceof Error?r.message:String(r),serverUrl:n.ripploServerUrl}}}function m(e){return e.includes("localhost")||e.includes("127.0.0.1")}import g from"fuse.js";function s(e){switch(e.kind){case"conflicting-flags":return"Pass either --all or test ids, not both.";case"nothing-selected":return`No tests selected \u2014 scope empty, no dirty .ripplo/workflows files. Pass test ids, add to scope (${a("run")}), or use --all.`;case"unknown-ids":{let n=e.known,r=e.unknown.flatMap(i=>y(i,n)),o=r.length>0?[`Did you mean: ${[...new Set(r)].join(", ")}`]:[];return[`Unknown ${e.unknown.length===1?"id":"ids"}: ${e.unknown.join(", ")}`,...o,"Pass a workflow slug for all its tests, or workflow/test for one. Known workflows:",...n.map(i=>` ${i}`)].join(`
5
- `)}}}function L({failed:e,notRun:n,passed:r}){let o=n>0?`, ${String(n)} not run`:"";return`${String(r)} passed, ${String(e)} failed${o} (${String(r+e+n)} total)`}function A({debugDir:e,event:n}){let r=`${n.workflowName} \u2192 ${n.testName}`;if(n.kind==="test-started")return`${t.dim("run ")} ${r}`;switch(n.outcome.kind){case"pass":return`${t.good("pass")} ${r} ${t.dim(n.runId)}`;case"findings":return[`${t.bad("fail")} ${r} \u2014 ${c(n.outcome.findingLines.length,"finding")}`,...n.outcome.findingLines,u({debugDir:e,runId:n.runId}),`${t.dim("why")} npx ripplo explain ${n.runId}`].join(`
6
- `);case"error":return`${t.bad("error")} ${r} \u2014 ${n.outcome.detail} ${t.dim(n.runId)}`;case"dispatch-error":return`${t.bad("error")} ${r} \u2014 ${w(n.outcome.reason)}`;case"dispatch-timeout":return`${t.bad("error")} ${r} \u2014 not run: dispatch timed out (transient): ${n.outcome.detail}`;case"infra-error":return`${t.bad("error")} ${r} \u2014 not run: Ripplo server unreachable: ${n.outcome.detail}`}}var h={MAX_AGENTS:"agent limit reached for your plan \u2014 upgrade to add more",MAX_CONCURRENT_RUNS:"concurrent run limit reached for your plan \u2014 upgrade or wait for runs to finish",MAX_PROJECTS:"project limit reached for your plan \u2014 upgrade to add more",MAX_RUNS:"run limit reached for your plan \u2014 enable overage or upgrade",OVERAGE_CAP:"overage cap reached \u2014 raise the cap or upgrade"};function j({detail:e,serverUrl:n}){return m(n)?`Ripplo server at ${n} not running (${e}). Start the dev server with \`pnpm dev\`.`:`Ripplo server at ${n} unreachable (${e}) \u2014 server-side, not your local environment.`}function N(e){switch(e.code){case"compile-failed":{let n=e.diagnostics.length===0?[]:["",...e.diagnostics];return[`Compilation failed in the daemon (${e.detail}). Run \`npx ripplo compile\` for full output.`,...n].join(`
4
+ import{a as c}from"./chunk-OQ6KNYPG.js";import{c as p}from"./chunk-LEFXRK53.js";import{c as l}from"./chunk-FEHVIHVA.js";import{a}from"./chunk-MHNGR6M7.js";import{I as u,w as t}from"./chunk-IGPHRN4A.js";import{R as d}from"./chunk-4F67XQYS.js";var f=3e3;async function S(e){l(e);let n=p(e).unwrapOr(void 0);if(n==null)return null;try{return await fetch(`${n.ripploServerUrl}/health`,{signal:AbortSignal.timeout(f)}),null}catch(r){return{detail:r instanceof Error?r.message:String(r),serverUrl:n.ripploServerUrl}}}function m(e){return e.includes("localhost")||e.includes("127.0.0.1")}import g from"fuse.js";function s(e){switch(e.kind){case"conflicting-flags":return"Pass either --all or test ids, not both.";case"nothing-selected":return`No tests selected \u2014 scope empty, no dirty .ripplo/workflows files. Pass test ids, add to scope (${a("run")}), or use --all.`;case"unknown-ids":{let n=e.known,r=e.unknown.flatMap(i=>b(i,n)),o=r.length>0?[`Did you mean: ${[...new Set(r)].join(", ")}`]:[];return[`Unknown ${e.unknown.length===1?"id":"ids"}: ${e.unknown.join(", ")}`,...o,"Pass a workflow slug for all its tests, or workflow/test for one. Known workflows:",...n.map(i=>` ${i}`)].join(`
5
+ `)}}}function A({failed:e,notRun:n,passed:r}){let o=n>0?`, ${String(n)} not run`:"";return`${String(r)} passed, ${String(e)} failed${o} (${String(r+e+n)} total)`}function j({debugDir:e,event:n}){let r=`${n.workflowName} \u2192 ${n.testName}`;if(n.kind==="test-started")return`${t.dim("run ")} ${r}`;switch(n.outcome.kind){case"pass":return`${t.good("pass")} ${r} ${t.dim(n.runId)}`;case"findings":return[`${t.bad("fail")} ${r} \u2014 ${c(n.outcome.findingLines.length,"finding")}`,...n.outcome.findingLines,u({debugDir:e,runId:n.runId}),`${t.dim("why")} npx ripplo explain ${n.runId}`].join(`
6
+ `);case"error":return`${t.bad("error")} ${r} \u2014 ${w(n.outcome.detail)} ${t.dim(n.runId)}`;case"dispatch-error":return`${t.bad("error")} ${r} \u2014 ${y(n.outcome.reason)}`;case"dispatch-timeout":return`${t.bad("error")} ${r} \u2014 not run: dispatch timed out (transient): ${n.outcome.detail}`;case"infra-error":return`${t.bad("error")} ${r} \u2014 not run: Ripplo server unreachable: ${n.outcome.detail}`}}var h={MAX_AGENTS:"agent limit reached for your plan \u2014 upgrade to add more",MAX_CONCURRENT_RUNS:"concurrent run limit reached for your plan \u2014 upgrade or wait for runs to finish",MAX_PROJECTS:"project limit reached for your plan \u2014 upgrade to add more",MAX_RUNS:"run limit reached for your plan \u2014 enable overage or upgrade",OVERAGE_CAP:"overage cap reached \u2014 raise the cap or upgrade"};function N({detail:e,serverUrl:n}){return m(n)?`Ripplo server at ${n} not running (${e}). Start the dev server with \`pnpm dev\`.`:`Ripplo server at ${n} unreachable (${e}) \u2014 server-side, not your local environment.`}function M(e){switch(e.code){case"compile-failed":{let n=e.diagnostics.length===0?[]:["",...e.diagnostics];return[`Compilation failed in the daemon (${e.detail}). Run \`npx ripplo compile\` for full output.`,...n].join(`
7
7
  `)}case"selection-conflicting-flags":return s({kind:"conflicting-flags"});case"selection-nothing-selected":return s({kind:"nothing-selected"});case"selection-unknown-ids":return s({kind:"unknown-ids",known:e.known,unknown:e.unknown});case"app-unreachable":return`Your dev server not responding at ${e.url} (${e.detail}) \u2014 your local environment, not the Ripplo server.`;case"engine-unreachable":return`Ripplo engine not responding at ${e.url} (${e.detail}) \u2014 adapter unmounted, behind a build error, or RIPPLO_ENGINE_URL points at the wrong path.`;case"scope-failed":return`Could not resolve the dev-session scope: ${e.detail}
8
- Check the dev session is live (\`npx ripplo doctor\`, ${a("start")}), or pass test ids / --all.`;case"sync-failed":{let n=/401|unauthor/i.test(e.detail)?"\nAuth failure \u2014 run `npx ripplo auth login`.":"";return`Sync to the Ripplo server failed: ${e.detail}${n}`}case"bad-message":return"Daemon rejected the request \u2014 protocol mismatch, rebuild the CLI and restart the daemon."}}function M(e){switch(e.kind){case"spawn-failed":return`Failed to start \`npx ripplo daemon\`: ${$(e.message)}`;case"connect-timeout":return[`Daemon did not come up within ${String(Math.round(e.deadlineMs/1e3))}s.`,`Check ${e.logPath} for startup errors.`,"Common causes: stale socket (`rm .ripplo/.local/daemon.sock`), another daemon holding the dev lock, or the Ripplo server unreachable."].join(`
9
- `);case"connection-lost":return"Lost the daemon connection mid-run \u2014 it crashed or was killed. Check .ripplo/.local/daemon.log, restart `npx ripplo daemon`.";case"not-running":return"No ripplo daemon running for this directory. Start it with `npx ripplo daemon` as a background process, separate from your app's dev server.";case"bad-frame":return"Malformed frame from the daemon \u2014 version mismatch, rebuild the CLI and restart the daemon."}}function $(e){return e.includes("ENOENT")?`${e} \u2014 node or the CLI entry not found on PATH.`:e.includes("EACCES")?`${e} \u2014 permission denied executing the CLI entry.`:e}function w(e){return e.type==="limit"?h[e.code]:`failed to dispatch (${e.detail})`}function y(e,n){return new g(n,{includeScore:!0,threshold:.5}).search(d(e)).slice(0,3).map(o=>o.item)}export{S as a,m as b,L as c,A as d,j as e,N as f,M as g};
8
+ Check the dev session is live (\`npx ripplo doctor\`, ${a("start")}), or pass test ids / --all.`;case"sync-failed":{let n=/401|unauthor/i.test(e.detail)?"\nAuth failure \u2014 run `npx ripplo auth login`.":"";return`Sync to the Ripplo server failed: ${e.detail}${n}`}case"bad-message":return"Daemon rejected the request \u2014 protocol mismatch, rebuild the CLI and restart the daemon."}}function _(e){switch(e.kind){case"spawn-failed":return`Failed to start \`npx ripplo daemon\`: ${$(e.message)}`;case"connect-timeout":return[`Daemon did not come up within ${String(Math.round(e.deadlineMs/1e3))}s.`,`Check ${e.logPath} for startup errors.`,"Common causes: stale socket (`rm .ripplo/.local/daemon.sock`), another daemon holding the dev lock, or the Ripplo server unreachable."].join(`
9
+ `);case"connection-lost":return"Lost the daemon connection mid-run \u2014 it crashed or was killed. Check .ripplo/.local/daemon.log, restart `npx ripplo daemon`.";case"not-running":return"No ripplo daemon running for this directory. Start it with `npx ripplo daemon` as a background process, separate from your app's dev server.";case"bad-frame":return"Malformed frame from the daemon \u2014 version mismatch, rebuild the CLI and restart the daemon."}}function $(e){return e.includes("ENOENT")?`${e} \u2014 node or the CLI entry not found on PATH.`:e.includes("EACCES")?`${e} \u2014 permission denied executing the CLI entry.`:e}function w(e){return e==="worker-exit"?"run worker exited before reporting \u2014 usually a stale build. Run `pnpm build`, then `npx ripplo daemon stop` and start it again, then rerun.":e}function y(e){return e.type==="limit"?h[e.code]:`failed to dispatch (${e.detail})`}function b(e,n){return new g(n,{includeScore:!0,threshold:.5}).search(d(e)).slice(0,3).map(o=>o.item)}export{S as a,m as b,A as c,j as d,N as e,M as f,_ as g};