ripplo 0.9.5 → 0.9.7

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 (76) hide show
  1. package/dist/chunk-22JUAYHM.js +4 -0
  2. package/dist/{chunk-ZYDCN5K2.js → chunk-2Q7VXQYN.js} +1 -1
  3. package/dist/chunk-4GA5662U.js +83 -0
  4. package/dist/{chunk-NBSDY7QG.js → chunk-5DT43ABQ.js} +1 -1
  5. package/dist/{chunk-74ZADYZC.js → chunk-6VUSLPQD.js} +3 -3
  6. package/dist/chunk-7CELUIVK.js +55 -0
  7. package/dist/{chunk-KQWFJRIP.js → chunk-7W237JFM.js} +1 -1
  8. package/dist/{chunk-T46B2OPT.js → chunk-AGK6XOX2.js} +1 -1
  9. package/dist/chunk-BJWGAKKD.js +224 -0
  10. package/dist/{chunk-VXJACUXK.js → chunk-BNMS3N54.js} +1 -1
  11. package/dist/{chunk-IDPYM454.js → chunk-CAS7MBA7.js} +5 -5
  12. package/dist/{chunk-N45RSC6N.js → chunk-CB74TAUC.js} +1 -1
  13. package/dist/chunk-FJPJDGSS.js +7 -0
  14. package/dist/{chunk-2A6KSSUD.js → chunk-GFKK7K6T.js} +1 -1
  15. package/dist/chunk-GZPE7I7U.js +8 -0
  16. package/dist/{chunk-TRQDCBKV.js → chunk-IG7J452B.js} +1 -1
  17. package/dist/chunk-IPSXNIXC.js +48 -0
  18. package/dist/chunk-L2ZJK7MP.js +6 -0
  19. package/dist/chunk-LOEAZGYO.js +4 -0
  20. package/dist/{chunk-GAOLASGV.js → chunk-N2OBRCPQ.js} +1 -1
  21. package/dist/{chunk-3PF5QK56.js → chunk-OAU4HUD2.js} +1 -1
  22. package/dist/{chunk-CUXFU3MF.js → chunk-OES7HGNF.js} +1 -1
  23. package/dist/{chunk-INURHJF4.js → chunk-R3DZ6JPY.js} +1 -1
  24. package/dist/chunk-RIVHBABX.js +4 -0
  25. package/dist/{chunk-6FU7HD6D.js → chunk-SNU66GSR.js} +1 -1
  26. package/dist/chunk-TPCKMDWU.js +4 -0
  27. package/dist/{chunk-3M2E253R.js → chunk-TPHOSZAK.js} +1 -1
  28. package/dist/{chunk-QIXJ7Z2L.js → chunk-V4CLXOCP.js} +1 -1
  29. package/dist/{chunk-JNLHZVZJ.js → chunk-XJJDHGK4.js} +19 -19
  30. package/dist/{chunk-3OI2UH3H.js → chunk-YQ2RBEOJ.js} +1 -1
  31. package/dist/{cli-error-MEC67EVT.js → cli-error-OIG4RO4E.js} +1 -1
  32. package/dist/{compile-write-F7D273JN.js → compile-write-OLP4DB4P.js} +1 -1
  33. package/dist/daemon-3IWI7VQT.js +152 -0
  34. package/dist/{daemon-QRMX6RPX.js → daemon-WEKGUIRK.js} +1 -1
  35. package/dist/{daemon-lock-67AFXXED.js → daemon-lock-OAARBZ4O.js} +1 -1
  36. package/dist/{dsl-loader-A2EMKCRL.js → dsl-loader-IRBKYLNW.js} +1 -1
  37. package/dist/{exit-plan-gate-WPHQII5J.js → exit-plan-gate-HSTV7UO4.js} +1 -1
  38. package/dist/hook.js +1 -1
  39. package/dist/index.js +174 -174
  40. package/dist/{plan-reminder-6E4CHEAZ.js → plan-reminder-FZSSUVNB.js} +1 -1
  41. package/dist/post-edit-333UCJ6G.js +4 -0
  42. package/dist/post-edit-analyze-JFWA223C.js +4 -0
  43. package/dist/post-edit-flag-stubs-IZSAIM4O.js +4 -0
  44. package/dist/{pre-bash-run-gate-WOGQZARU.js → pre-bash-run-gate-B42YNDQF.js} +1 -1
  45. package/dist/pre-edit-WZJVD3J4.js +4 -0
  46. package/dist/pre-edit-ripplo-skill-gate-QHUD7QGU.js +4 -0
  47. package/dist/pre-edit-scope-gate-2YIFSEDY.js +4 -0
  48. package/dist/{pre-edit-watch-gate-6MMET2NZ.js → pre-edit-watch-gate-GQZYMDOC.js} +1 -1
  49. package/dist/{prompt-submit-WMYBXZQN.js → prompt-submit-LE5LR62B.js} +1 -1
  50. package/dist/scope-reminder-DIDCHDAA.js +4 -0
  51. package/dist/solve-worker.js +1 -1
  52. package/dist/status-H5WYYH4J.js +4 -0
  53. package/dist/{stop-enforce-56SKN4RO.js → stop-enforce-EH2SC7ND.js} +1 -1
  54. package/dist/tasks-reminder-SDS6RNLP.js +4 -0
  55. package/package.json +2 -3
  56. package/dist/chunk-52IE2PAQ.js +0 -48
  57. package/dist/chunk-77DJHICC.js +0 -83
  58. package/dist/chunk-B6OQ2JE2.js +0 -4
  59. package/dist/chunk-CJUKILIO.js +0 -4
  60. package/dist/chunk-ESTPIODD.js +0 -7
  61. package/dist/chunk-GYH4P7SC.js +0 -4
  62. package/dist/chunk-IA7TU3WW.js +0 -4
  63. package/dist/chunk-JIMLVUPS.js +0 -229
  64. package/dist/chunk-NJFCO7FT.js +0 -8
  65. package/dist/chunk-PPB7QGV2.js +0 -55
  66. package/dist/chunk-XBN6AJVQ.js +0 -6
  67. package/dist/daemon-3CCSJNDP.js +0 -152
  68. package/dist/post-edit-VHZDDVV5.js +0 -4
  69. package/dist/post-edit-analyze-YAVEMK4O.js +0 -4
  70. package/dist/post-edit-flag-stubs-PMMITC7F.js +0 -4
  71. package/dist/pre-edit-R77BLLLQ.js +0 -4
  72. package/dist/pre-edit-ripplo-skill-gate-FXNQWVME.js +0 -4
  73. package/dist/pre-edit-scope-gate-ADO3NRVS.js +0 -4
  74. package/dist/scope-reminder-XTXZHPLU.js +0 -4
  75. package/dist/status-PUV7KG33.js +0 -4
  76. package/dist/tasks-reminder-PICFLMC2.js +0 -4
@@ -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,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-TPHOSZAK.js";import{j as c}from"./chunk-IPSXNIXC.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{a as d,b as f,c as g}from"./chunk-N45RSC6N.js";import{a as w}from"./chunk-GAOLASGV.js";import{c as u}from"./chunk-KQWFJRIP.js";import{a as c}from"./chunk-7WZ3VIUU.js";import{f as m}from"./chunk-3M2E253R.js";import{a as i}from"./chunk-MHNGR6M7.js";import{e as a}from"./chunk-52IE2PAQ.js";import{graphql as h}from"gql.tada";var S=h(`
4
+ import{a as d,b as f,c as g}from"./chunk-CB74TAUC.js";import{a as w}from"./chunk-N2OBRCPQ.js";import{c as u}from"./chunk-7W237JFM.js";import{a as c}from"./chunk-7WZ3VIUU.js";import{f as m}from"./chunk-TPHOSZAK.js";import{a as i}from"./chunk-MHNGR6M7.js";import{e as a}from"./chunk-IPSXNIXC.js";import{graphql as h}from"gql.tada";var S=h(`
5
5
  query ScopeReminder($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{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-22JUAYHM.js";import{a as P}from"./chunk-R4ZTRVDQ.js";import{i as D}from"./chunk-IPSXNIXC.js";import{spawn as L}from"child_process";import q from"fs";import V from"net";import{setTimeout as p}from"timers/promises";import{err as d,ok as f}from"neverthrow";import{ResponseError as j}from"vscode-jsonrpc/node";var I=12e4,_=300,x=5e3;async function an({cliEntry:o,cwd:n}){let e=u(n),t=await s(e);return t!=null?A({cliEntry:o,connection:l(t,!1),cwd:n}):T({cliEntry:o,cwd:n,versionNote:void 0})}async function sn({cliEntry:o,cwd:n}){let e=await s(u(n));return e==null?d({kind:"not-running"}):A({cliEntry:o,connection:l(e,!1),cwd:n})}async function T({cliEntry:o,cwd:n,versionNote:e}){let t=H({cliEntry:o,cwd:n});if(t!=null)return d(t);let r=await Q(u(n));return r==null?d({deadlineMs:I,kind:"connect-timeout",logPath:y(n)}):f({...l(r,!0),versionNote:e})}async function A({cliEntry:o,connection:n,cwd:e}){let t=await O(n);if(t==null||t.version===P()&&!G(t))return f(n);let r={daemonVersion:t.version};return await J(n)?(n.socket.destroy(),await B(u(e))?T({cliEntry:o,cwd:e,versionNote:{...r,kind:"restarted"}}):d({kind:"connection-lost"})):f({...n,versionNote:{...r,kind:"stale-busy"}})}var U=1e3;function G(o){let n=S(process.argv[1]);return n==null||o.bundleMtimeMs==null?!1:n>o.bundleMtimeMs+U}async function J(o){try{return await o.rpc.sendRequest(m)}catch{return!1}}var K=1e4;async function B(o){let n=Date.now()+K,e=await s(o);for(;e!=null&&Date.now()<n;)e.destroy(),await p(_),e=await s(o);return e?.destroy(),e==null}async function cn({connection:o,onEvent:n,request:e,token:t}){let r=await F({connection:o,onEvent:n,request:e,token:t});return r.kind==="transport"?d(r.error):f(r)}async function un(o){let n=await s(u(o));if(n==null)return!1;let e=l(n,!1);try{return await e.rpc.sendRequest(m)}catch{return!1}finally{n.destroy()}}async function dn(o){try{await o.rpc.sendRequest(m)}catch{}}async function ln(o){let n=await s(u(o));if(n==null)return{kind:"not-running"};let e=l(n,!1),t=await Promise.race([O(e),p(x).then(()=>null)]);return n.destroy(),t==null?{kind:"unresponsive",timeoutMs:x}:{kind:"running",status:t}}async function O(o){try{let n=await o.rpc.sendRequest(v),e=C.safeParse(n);return e.success?e.data:null}catch{return null}}function F({connection:o,onEvent:n,request:e,token:t}){let{rpc:r}=o;return new Promise(k=>{let i=a=>{k(a)};r.onNotification(M,a=>{let c=b.safeParse(a);if(!c.success){i({error:{kind:"bad-frame"},kind:"transport"});return}n(c.data.event)}),r.onNotification(N,a=>{let c=g.safeParse(a);if(!c.success){i({error:{kind:"bad-frame"},kind:"transport"});return}i({failed:c.data.failed,kind:"done",notRun:c.data.notRun,passed:c.data.passed})}),r.onClose(()=>{i({error:{kind:"connection-lost"},kind:"transport"})}),r.sendRequest(h,e,t).then(a=>{w.safeParse(a).success||i({error:{kind:"bad-frame"},kind:"transport"})}).catch(a=>{i(z(a))})})}function z(o){if(o instanceof j){let n=R.safeParse(o.data);return n.success?{error:n.data,kind:"daemon-error"}:{error:{kind:"bad-frame"},kind:"transport"}}return{error:{kind:"connection-lost"},kind:"transport"}}function l(o,n){let e=E(o);return e.listen(),{rpc:e,socket:o,spawned:n,versionNote:void 0}}function s(o){return new Promise(n=>{let e=V.connect(o);e.once("connect",()=>{n(e)}),e.once("error",()=>{n(null)})})}function H({cliEntry:o,cwd:n}){try{D(n);let e=q.openSync(y(n),"a");return L(process.execPath,[o,"daemon"],{cwd:n,detached:!0,stdio:["ignore",e,e]}).unref(),q.closeSync(e),null}catch(e){return{kind:"spawn-failed",message:e instanceof Error?e.message:String(e)}}}async function Q(o){let n=Date.now()+I,e=await s(o);for(;e==null&&Date.now()<n;)await p(_),e=await s(o);return e}export{an as a,sn as b,cn as c,un as d,dn as e,ln as f};
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __ripploCreateRequire } from "node:module";
3
3
  const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
4
- import{i as s,j as a}from"./chunk-52IE2PAQ.js";import d from"fs";import{setTimeout as p}from"timers/promises";import{checkSync as m,lockSync as f}from"proper-lockfile";var y="dev.pid",l=15e3,h=1e4,k=250;function g(n){return u(i(n))}async function b(n){let r=g(n);if(r==null||!c(n))return{kind:"not-running"};try{process.kill(r,"SIGTERM")}catch{return{kind:"not-running"}}let e=Date.now()+h;for(;Date.now()<e;){if(!c(n))return{kind:"stopped",pid:r};await p(k)}return{kind:"timeout",pid:r}}function c(n){try{return m(i(n),{realpath:!1,stale:l})}catch{return!1}}function i(n){return a(n,y)}var o=class extends Error{pid;cwd;constructor({cwd:r,pid:e}){super("dev-lock-held"),this.name="DevLockHeldError",this.pid=e,this.cwd=r}};function E({cwd:n,onCompromised:r}){s(n);let e=i(n),t=w({cwd:n,onCompromised:r,path:e});return d.writeFileSync(e,String(process.pid)),()=>{try{t()}catch{}}}function w({cwd:n,onCompromised:r,path:e}){try{return f(e,{realpath:!1,stale:l,onCompromised:()=>{r()}})}catch(t){throw D(t)?new o({cwd:n,pid:u(e)}):t}}function D(n){if(!(n instanceof Error)||!("code"in n))return!1;let{code:r}=n;return r==="ELOCKED"}function u(n){try{let r=d.readFileSync(n,"utf8").trim(),e=Number.parseInt(r,10);return Number.isFinite(e)&&e>0?e:null}catch{return null}}export{g as a,b,c,i as d,o as e,E as f};
4
+ import{i as s,j as a}from"./chunk-IPSXNIXC.js";import d from"fs";import{setTimeout as p}from"timers/promises";import{checkSync as m,lockSync as f}from"proper-lockfile";var y="dev.pid",l=15e3,h=1e4,k=250;function g(n){return u(i(n))}async function b(n){let r=g(n);if(r==null||!c(n))return{kind:"not-running"};try{process.kill(r,"SIGTERM")}catch{return{kind:"not-running"}}let e=Date.now()+h;for(;Date.now()<e;){if(!c(n))return{kind:"stopped",pid:r};await p(k)}return{kind:"timeout",pid:r}}function c(n){try{return m(i(n),{realpath:!1,stale:l})}catch{return!1}}function i(n){return a(n,y)}var o=class extends Error{pid;cwd;constructor({cwd:r,pid:e}){super("dev-lock-held"),this.name="DevLockHeldError",this.pid=e,this.cwd=r}};function E({cwd:n,onCompromised:r}){s(n);let e=i(n),t=w({cwd:n,onCompromised:r,path:e});return d.writeFileSync(e,String(process.pid)),()=>{try{t()}catch{}}}function w({cwd:n,onCompromised:r,path:e}){try{return f(e,{realpath:!1,stale:l,onCompromised:()=>{r()}})}catch(t){throw D(t)?new o({cwd:n,pid:u(e)}):t}}function D(n){if(!(n instanceof Error)||!("code"in n))return!1;let{code:r}=n;return r==="ELOCKED"}function u(n){try{let r=d.readFileSync(n,"utf8").trim(),e=Number.parseInt(r,10);return Number.isFinite(e)&&e>0?e:null}catch{return null}}export{g as a,b,c,i as d,o as e,E as f};
@@ -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-TPHOSZAK.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-TPHOSZAK.js";import{a as i}from"./chunk-MHNGR6M7.js";import{n}from"./chunk-L2ZJK7MP.js";import{c as a}from"./chunk-R3DZ6JPY.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,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-R3DZ6JPY.js";import{j as e}from"./chunk-IPSXNIXC.js";import m from"fs";import p from"fs";import i from"path";import{execFileSync as a}from"child_process";var f=256*1024*1024;function n(r,t){return a("git",[...r],{cwd:t,encoding:"utf8",maxBuffer:f,stdio:["ignore","pipe","pipe"]})}function E(r,t){try{return n(r,t)}catch{return""}}var g=["MERGE_HEAD","rebase-merge","rebase-apply","CHERRY_PICK_HEAD","REVERT_HEAD"];function d(r){return u(r)!=null}function s(r){let t=u(r);return t==null?!1:g.some(l=>p.existsSync(i.join(t,l)))}function u(r){try{let t=n(["rev-parse","--git-dir"],r).trim();return t.length===0?null:i.isAbsolute(t)?t:i.resolve(r,t)}catch{return null}}function c(r){return e(r,"hooks-paused")}function v(r){return m.existsSync(c(r))||s(r)?!1:o(r)}export{n as a,E as b,d as c,s as d,c as e,v as f};
@@ -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-NBSDY7QG.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-5DT43ABQ.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(`