ripplo 0.11.2 → 0.13.0
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.
- package/dist/{chunk-22KCYZGP.js → chunk-37NZ5HM2.js} +1 -1
- package/dist/{chunk-UNYR7SAP.js → chunk-4GIORBIH.js} +1 -1
- package/dist/{chunk-7BLJ6357.js → chunk-5JD26R53.js} +1 -1
- package/dist/chunk-7E3AM2KY.js +83 -0
- package/dist/{chunk-GL66NIOQ.js → chunk-BOMK6ZXG.js} +1 -1
- package/dist/{chunk-XJRG46JA.js → chunk-C63HR3XQ.js} +1 -1
- package/dist/{chunk-ISLXOVJF.js → chunk-CAGQ4M2W.js} +1 -1
- package/dist/{chunk-2QZIICHO.js → chunk-D5F6DIXU.js} +1 -1
- package/dist/{chunk-CEUZS5YN.js → chunk-FAYHW72O.js} +1 -1
- package/dist/{chunk-6HGQIP4L.js → chunk-GMOMT4D5.js} +1 -1
- package/dist/{chunk-TROVQD5M.js → chunk-IUEJNPB6.js} +1 -1
- package/dist/{chunk-XA4ZWH7N.js → chunk-JTML352F.js} +2 -2
- package/dist/{chunk-XSO43S23.js → chunk-K4GNKQB5.js} +1 -1
- package/dist/{chunk-WZBHHW7X.js → chunk-KGCLJTPO.js} +21 -21
- package/dist/{chunk-XPPUVBTI.js → chunk-MBQEVGUG.js} +1 -1
- package/dist/{chunk-LFBAW3EA.js → chunk-NAXGHRI7.js} +1 -1
- package/dist/chunk-NRJUY625.js +360 -0
- package/dist/{chunk-LBSM7G4L.js → chunk-TLSVFIET.js} +1 -1
- package/dist/{chunk-TDIT65FZ.js → chunk-XUZZKRZB.js} +1 -1
- package/dist/{cli-error-VML3CZTB.js → cli-error-UKCCFGND.js} +1 -1
- package/dist/{compile-write-AWMMKBY4.js → compile-write-HYPPASGM.js} +1 -1
- package/dist/{daemon-2LB22RRW.js → daemon-FPJC6UTS.js} +1 -1
- package/dist/{daemon-RDOVYYAZ.js → daemon-JCI3PIF2.js} +1 -1
- package/dist/{dsl-loader-GZILSBK5.js → dsl-loader-3PR7GLST.js} +1 -1
- package/dist/hook.js +1 -1
- package/dist/index.js +181 -208
- package/dist/{plan-reminder-V7RZXP37.js → plan-reminder-5IW6CHBL.js} +1 -1
- package/dist/{post-edit-D6EBGSYK.js → post-edit-FXAZHTN6.js} +1 -1
- package/dist/post-edit-analyze-ZSZ6AO3U.js +4 -0
- package/dist/{post-edit-flag-stubs-CGV4LWX2.js → post-edit-flag-stubs-QMRDE3JW.js} +1 -1
- package/dist/pre-bash-run-gate-CDFNAIK3.js +4 -0
- package/dist/{pre-edit-MPV73OUC.js → pre-edit-PGV7XSGT.js} +1 -1
- package/dist/{pre-edit-watch-gate-BXICNZNF.js → pre-edit-watch-gate-DQD7CWGN.js} +1 -1
- package/dist/{prompt-submit-DO3YGL4V.js → prompt-submit-PC4QIGY3.js} +1 -1
- package/dist/status-VQ57DB6M.js +4 -0
- package/dist/{stop-enforce-CEUM4LIV.js → stop-enforce-U7PURAF5.js} +1 -1
- package/package.json +1 -1
- package/dist/chunk-2V4XEAR4.js +0 -360
- package/dist/chunk-6PEFUZNO.js +0 -83
- package/dist/post-edit-analyze-NSUCATEN.js +0 -4
- package/dist/pre-bash-run-gate-MIEM2DBB.js +0 -4
- package/dist/status-4LFECRO4.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{
|
|
4
|
+
import{u as O}from"./chunk-7E3AM2KY.js";import{a as x,b as h,c as f,d as c,e as s,i as w,j as L,m as E}from"./chunk-D5F6DIXU.js";import{Ja as v,Ka as S,Ma as P,Na as b,T as d,U as u,ka as g,ra as n,sa as k}from"./chunk-KGCLJTPO.js";import{readFile as D,writeFile as W}from"fs/promises";import H from"path";import{err as C,ok as q}from"neverthrow";import j from"safe-stable-stringify";function m(e){return{...e,checks:void 0}}function y(e,t){return j(m(e))===j(m(t))}import{z as i}from"zod";function R({cwd:e}){let t=K.safeParse(c({cwd:e,key:p(),kind:"verdicts"}));t.success&&(P(new Map(Object.entries(t.data.cosat))),v(new Map(Object.entries(t.data.subsume))))}function F({cwd:e}){let t=b(),o=S();s({cwd:e,keep:8,key:p(),kind:"verdicts",value:{cosat:Object.fromEntries(t),subsume:Object.fromEntries(o)}})}function Z({cwd:e}){let t=M.safeParse(c({cwd:e,key:p(),kind:"lint-clean"}));return t.success?t.data.cleanLockfile:void 0}function $({cleanLockfileHash:e,cwd:t}){e!=null&&s({cwd:t,keep:8,key:p(),kind:"lint-clean",value:{cleanLockfile:e}})}function ee(e){return x(e)}var K=i.object({cosat:i.record(i.string(),i.boolean()),subsume:i.record(i.string(),i.boolean())}),M=i.object({cleanLockfile:i.string()});function p(){return f(["patterns"])}import I from"safe-stable-stringify";async function de(e){let t=await E(e);return t.isOk()&&await J(e,t.value),t}async function J(e,t){let o=await T(e,t),r=d(n,o);return await W(H.join(e,L),r),w(e,r),o}var A=new WeakMap;function T(e,t){let o=A.get(t);if(o!=null)return o;let r=V(e,t).then(a=>a.match(l=>Promise.resolve(l),()=>_(e,t)));return A.set(t,r),r}function ue(e,t){return V(e,t)}function ke(e){return e.workflows.filter(t=>t.stub).map(t=>t.name)}async function he(e,t){let o=await B(e);return o==null?"missing":o.checks==null?"stale":y(o,t)?"match":"stale"}async function V(e,t){let o=await B(e);return o==null?C({kind:"no-lockfile"}):o.checks==null||o.checks.epoch!==h()?C({kind:"unstamped"}):y(o,t)?q(k(o)):C({kind:"dsl-drift"})}async function B(e){try{let t=await D(H.join(e,L),"utf8");return u(n,t)}catch{return null}}function _(e,t){R({cwd:e});let o={...z(e,t),epoch:h()};F({cwd:e});let r={...t,checks:o};return k(u(n,d(n,r)))}function z(e,t){let o=I(m(t)),r=f(["checks",o]),a=g.safeParse(c({cwd:e,key:r,kind:"checks"}));if(a.success)return a.data;let l=O(t);return s({cwd:e,keep:4,key:r,kind:"checks",value:l}),l}export{m as a,y as b,R as c,F as d,Z as e,$ as f,ee as g,de as h,J as i,T as j,ue as k,ke as l,he as m};
|
|
@@ -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{
|
|
4
|
+
import{V as d}from"./chunk-KGCLJTPO.js";import{j as p}from"./chunk-C7SV6AR2.js";import{spawnSync as k}from"child_process";import{existsSync as c,readdirSync as m,readFileSync as j,realpathSync as f,statSync as g}from"fs";import i from"path";var S=2e3;function x(t){if(t!=null)try{return g(f(t)).mtimeMs}catch{return}}function B(t){return k("pnpm",["turbo","run","build","--filter=ripplo..."],{cwd:t,stdio:"inherit"}).status===0}function X(){let t=process.argv[1];return t==null?{kind:"fresh"}:R({cwd:process.cwd(),scriptPath:f(t)})}function R({cwd:t,scriptPath:n}){let o=l(i.dirname(n));if(o!=null&&u(o))return n.includes(`${i.sep}src${i.sep}`)?{kind:"fresh"}:E({bundlePath:n,root:o});let r=l(t);return r!=null&&u(r)?{kind:"foreign-binary",workspaceRoot:r}:{kind:"fresh"}}function l(t){let n=i.dirname(t);return c(i.join(t,"pnpm-workspace.yaml"))?t:n===t?void 0:l(n)}function u(t){let n=i.join(t,"packages","cli","package.json"),o=w(n);return typeof o=="object"&&o!=null&&"name"in o&&o.name==="ripplo"}function w(t){try{return JSON.parse(j(t,"utf8"))}catch{return}}function E({bundlePath:t,root:n}){let o=x(t),r=i.join(n,"packages");if(o==null||!c(r))return{kind:"fresh"};let a=m(r).map(s=>({name:s,src:i.join(r,s,"src")})).filter(s=>c(s.src)).filter(s=>b(s.src)>o+S).map(s=>s.name);return a.length===0?{kind:"fresh"}:{kind:"stale",packages:a,workspaceRoot:n}}function b(t){let n=g(t);if(!n.isDirectory())return n.mtimeMs;let o=m(t).map(r=>b(i.join(t,r)));return Math.max(n.mtimeMs,...o)}import{createHash as P}from"crypto";import M from"os";import I from"path";import{createMessageConnection as q,NotificationType as y,RequestType as v,RequestType0 as h,SocketMessageReader as A,SocketMessageWriter as N}from"vscode-jsonrpc/node";import{z as e}from"zod";var C="daemon.log";function ee(t){let n=P("sha256").update(t).digest("hex").slice(0,16);return I.join(M.tmpdir(),`ripplo-${n}.sock`)}function te(t){return p(t,C)}function ne(t){return q(new A(t),new N(t))}var oe=e.object({all:e.boolean(),headed:e.boolean(),tests:e.array(e.string())}),re=e.object({jobId:e.string(),total:e.number()}),z=e.enum(["no-lockfile","unstamped","dsl-drift","load-failed","model-empty"]),F=e.discriminatedUnion("kind",[e.object({kind:e.literal("off")}),e.object({kind:e.literal("on")}),e.object({kind:e.literal("paused"),reason:e.enum(["interactive-runs","cooldown","loading"]).optional()}),e.object({kind:e.literal("waiting")}),e.object({kind:e.literal("blocked"),reason:z})]),O=e.object({attempts:e.number(),findings:e.number()}),ie=e.object({active:e.number(),bundleMtimeMs:e.number().optional(),explorer:F,exploring:e.number(),progress:O,queued:e.number(),sseHealth:e.object({detail:e.string().optional(),ok:e.boolean()}).optional(),version:e.string().optional()}),L=e.enum(["MAX_RUNS","OVERAGE_CAP","MAX_AGENTS","MAX_CONCURRENT_RUNS","MAX_PROJECTS","CLOUD_EXECUTOR","REVIEW_QUOTA","MEMBER_CEILING"]),U=e.discriminatedUnion("type",[e.object({code:L,type:e.literal("limit")}),e.object({detail:e.string(),type:e.literal("generic")})]),_=e.discriminatedUnion("kind",[e.object({kind:e.literal("pass")}),e.object({findingLines:e.array(e.string()),kind:e.literal("findings")}),e.object({detail:e.string(),kind:e.literal("error")}),e.object({kind:e.literal("dispatch-error"),reason:U}),e.object({detail:e.string(),kind:e.literal("dispatch-timeout")}),e.object({detail:e.string(),kind:e.literal("infra-error")})]),W=e.discriminatedUnion("kind",[e.object({kind:e.literal("run-progress"),runId:e.string(),signal:d,testName:e.string(),workflowName:e.string()}),e.object({kind:e.literal("test-started"),runId:e.string(),testName:e.string(),workflowName:e.string()}),e.object({kind:e.literal("test-outcome"),outcome:_,runId:e.string(),testName:e.string(),workflowName:e.string()})]),se=e.object({event:W,jobId:e.string()}),ae=e.object({failed:e.number(),jobId:e.string(),notRun:e.number(),passed:e.number()}),ce=e.discriminatedUnion("code",[e.object({code:e.literal("compile-failed"),detail:e.string(),diagnostics:e.array(e.string()).default([])}),e.object({code:e.literal("selection-conflicting-flags")}),e.object({code:e.literal("selection-nothing-selected")}),e.object({code:e.literal("selection-unknown-ids"),known:e.array(e.string()),unknown:e.array(e.string())}),e.object({code:e.literal("scope-failed"),detail:e.string()}),e.object({code:e.literal("app-unreachable"),detail:e.string(),url:e.string()}),e.object({code:e.literal("engine-unreachable"),detail:e.string(),url:e.string()}),e.object({code:e.literal("sync-failed"),detail:e.string()}),e.object({code:e.literal("bad-message")})]),le=new v("ripplo/enqueue"),pe=new h("ripplo/status"),de=new h("ripplo/shutdownIfIdle"),ue=new y("ripplo/jobEvent"),me=new y("ripplo/jobDone");export{x as a,B as b,X as c,ee as d,te as e,ne as f,oe as g,re as h,ie as i,_ as j,se as k,ae as l,ce as m,le as n,pe as o,de as p,ue as q,me as r};
|
|
@@ -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 o}from"./chunk-OQ6KNYPG.js";import{a as r}from"./chunk-MHNGR6M7.js";import{a as h,c as y,d as F,e as k,f as C,g as b}from"./chunk-
|
|
4
|
+
import{a as o}from"./chunk-OQ6KNYPG.js";import{a as r}from"./chunk-MHNGR6M7.js";import{a as h,c as y,d as F,e as k,f as C,g as b}from"./chunk-BOMK6ZXG.js";import{A as p,B as u,C as g,G as S,f as a,t as c,v as d,w as s,x as f,y as l,z as m}from"./chunk-7E3AM2KY.js";import A from"safe-stable-stringify";function z({cwd:i,lockfile:e}){let t=b(A(h(e)));if(k({cwd:i})===t)return[];y({cwd:i});let n=H(e);return F({cwd:i}),C({cleanLockfileHash:n.length===0?t:null,cwd:i}),n}function H(i){let e=c(i),t=d({facts:e.facts});return[...s(i).map(n=>({effect:n,kind:"possible-noop-effect"})),...f(i).map(n=>({consequence:n,kind:"undecided-action-consequence"})),...t.map(n=>({conflict:n,kind:"fact-conflict"})),...l(i).map(n=>({kind:"unreachable-interaction",violation:n})),...m(i).map(n=>({kind:"redundant-assertion",redundancy:n})),...p(i).map(n=>({kind:"unmodeled-surface",surface:n})),...g(i).map(n=>({content:n,kind:"unpinned-surface-content"})),...u(i).map(n=>({binding:n,kind:"stringified-binding"}))]}function q(i){return`${a.good("ok")} \u2014 no static model violations (${o(i,"test")})`}function E(i){let t=i.some(n=>n.kind==="unmodeled-surface")?[`Elements that hide together are one surface. ${r("create","surfaces")}`]:[];return[`${a.bad("fail")} \u2014 ${o(i.length,"static model violation")}:`,...i.map(n=>S(n)),...t].join(`
|
|
5
5
|
|
|
6
6
|
`)}export{z as a,q as b,E as c};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __ripploCreateRequire } from "node:module";
|
|
3
3
|
const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
|
|
4
|
-
import{
|
|
4
|
+
import{Ha as $,T as M,U as _,pa as z,qa as I,ra as g}from"./chunk-KGCLJTPO.js";import w from"fs";import s from"path";import{createHash as ve}from"crypto";import{pathToFileURL as Me}from"url";import{build as _e}from"esbuild";import{err as l,ok as F,ResultAsync as ze}from"neverthrow";import b from"fs";import{execFile as se}from"child_process";import{promisify as ae}from"util";import{fileURLToPath as C}from"url";import{z as L}from"zod";var ce=ae(se),le=L.object({diagnostics:L.array(L.string()),ok:L.boolean()});async function H(e){let r=de(),{stdout:n}=await ce(process.execPath,[...r.args,e],{maxBuffer:10*1024*1024}),t=JSON.parse(n);return le.parse(t)}function de(){let e=C(new URL("dsl-typecheck-worker.js",import.meta.url));if(b.existsSync(e))return{args:[e]};let r=C(new URL("../../dist/dsl-typecheck-worker.js",import.meta.url));if(b.existsSync(r))return{args:[r]};let n=C(new URL("../dsl-typecheck-worker.ts",import.meta.url));if(b.existsSync(n))return{args:["--experimental-strip-types",n]};throw new Error("DSL typecheck worker missing")}import ge from"safe-stable-stringify";import{err as he,ok as K,Result as ke}from"neverthrow";import{z as xe}from"zod";import k from"fs";import U from"path";import{z as u}from"zod";import{createHash as ue}from"crypto";function c(e){return ue("sha256").update(e).digest("base64")}var fe="fd3",pe="fold2";function T(){return`${String(g.currentVersion)}:${fe}:${pe}`}function x(e){return c([T(),...e].join("\0"))}function R({cwd:e,key:r,kind:n}){return D(e,n)?.entries.find(([o])=>o===r)?.[1]}function P({cwd:e,keep:r,key:n,kind:t,value:o}){let p=(D(e,t)?.entries??[]).filter(([a])=>a!==n),S=[n,o],v=[...p,S].slice(-r),y=N(e,t),d={entries:v,epoch:T()};k.mkdirSync(U.dirname(y),{recursive:!0}),k.writeFileSync(y,JSON.stringify(d)),h=new Map([...h,[y,{signature:B(y),store:d}]])}var ye=u.object({entries:u.array(u.tuple([u.string(),u.unknown()])),epoch:u.string()}),h=new Map;function D(e,r){let n=N(e,r),t=B(n),o=h.get(n);if(o!=null&&o.signature===t)return o.store;let i=me({signature:t,storePath:n});return h=new Map([...h,[n,{signature:t,store:i}]]),i}function me({signature:e,storePath:r}){if(e!=null)try{let n=ye.safeParse(JSON.parse(k.readFileSync(r,"utf8")));return!n.success||n.data.epoch!==T()?void 0:n.data}catch{return}}function B(e){if(!k.existsSync(e))return;let r=k.statSync(e);return`${String(r.mtimeMs)}:${String(r.size)}`}function N(e,r){return U.join(e,".ripplo",".local","cache",`${r}.json`)}async function J(e,r){let n=await V({cwd:r,workflows:e.workflows});return ke.combine(n).map(t=>({...e,workflows:[...t]}))}var Ee=xe.array(z),X=4;async function V({cwd:e,workflows:r}){if(r.length===0)return[];let n=r.slice(0,X),t=await Promise.all(n.map(i=>we({cwd:e,workflow:i}))),o=await V({cwd:e,workflows:r.slice(X)});return[...t,...o]}async function we({cwd:e,workflow:r}){let n=x(["expand",Se(r)]),t=Ee.safeParse(R({cwd:e,key:n,kind:"expand"}));if(t.success)return K({...r,tests:t.data});try{let o=await $({workflow:r});return P({cwd:e,keep:2e3,key:n,kind:"expand",value:o.tests}),K(o)}catch(o){let i=o instanceof Error?o.message:String(o);return he({kind:"expand-failed",message:i,workflow:r.name})}}function Se(e){let r=ge({...e,tests:[]});if(r==null)throw new Error("solver: workflow is not serializable");return r}import{createHash as Le}from"crypto";import G from"fs/promises";import j from"path";import{err as f,ok as A,Result as Re}from"neverthrow";var Pe=".ripplo/fixtures",Fe=10*1024*1024,be=50*1024*1024;async function Y(e,r){let n=Ce(r);if(n.length===0)return A({});let t=j.join(e,Pe),o=await Promise.all(n.map(i=>Te({fixturesRoot:t,name:i})));return Re.combine(o).andThen(je)}function Ce(e){let n=e.workflows.flatMap(t=>[...t.steps,...t.tests.flatMap(o=>o.steps)]).flatMap(t=>t.action.kind==="upload"?t.action.files:[]);return[...new Set(n)].toSorted((t,o)=>t.localeCompare(o))}async function Te({fixturesRoot:e,name:r}){if(r.includes("..")||j.isAbsolute(r))return f({kind:"fixture-invalid-name",name:r});let n=j.join(e,r),t=await G.lstat(n).catch(()=>null);if(t==null)return f({kind:"fixture-missing",name:r,path:n});if(t.isSymbolicLink())return f({kind:"fixture-symlink",name:r});if(!t.isFile())return f({kind:"fixture-not-file",name:r});let o=await G.readFile(n);if(o.byteLength>Fe)return f({kind:"fixture-too-large",name:r,size:o.byteLength});let i=Le("sha256").update(o).digest("hex");return A([r,{sha256:i,size:o.byteLength}])}function je(e){let r=e.reduce((n,[,t])=>n+t.size,0);return r>be?f({kind:"fixtures-total-too-large",total:r}):A(Object.fromEntries(e))}import Z from"fs";import Ae from"path";import{z as O}from"zod";function q({cwd:e,fingerprint:r}){let n=ee(e);if(n==null||n.fingerprint!==c(r))return;let t=Ae.join(e,".ripplo","ripplo.lock");if(!Z.existsSync(t))return;let o=Z.readFileSync(t,"utf8");if(c(o)===n.lockfileHash)try{let i=_(g,o);return Oe(i)?void 0:i}catch{return}}function Oe(e){return e.workflows.some(({sourcePath:r})=>r?.startsWith(".local/")===!0)}function Q({cwd:e,fingerprint:r,lockfile:n}){re(e,{fingerprint:c(r),lockfileHash:c(M(g,n))})}function jr(e,r){let n=ee(e);n!=null&&re(e,{...n,lockfileHash:c(r)})}var We=O.object({fingerprint:O.string(),lockfileHash:O.string()});function ee(e){let r=We.safeParse(R({cwd:e,key:x(["load"]),kind:"load"}));return r.success?r.data:void 0}function re(e,r){P({cwd:e,keep:1,key:x(["load"]),kind:"load",value:r})}var Br=".ripplo/ripplo.lock",E;async function Nr(e){let{result:r}=await Ie(e);return r}async function Ie(e){let r=te(s.join(e,".ripplo"));if(E!=null&&E.fingerprint===r&&E.result.isOk())return{fingerprint:r,result:E.result};let n=await $e(e);return E={fingerprint:r,result:n},{fingerprint:r,result:n}}async function $e(e){let r=s.join(e,".ripplo"),n=s.join(r,"index.ts"),t=te(r),o=q({cwd:e,fingerprint:t});if(o!=null)return F(o);let i=Xe(n);i.catch(()=>{});let p=await He(r);if(p.isErr())return l(p.error);let S=p.value;if(!S.ok)return l({diagnostics:S.diagnostics,kind:"typecheck-failed"});let d=await(await Je(n,i)).andThen(a=>Ye({entryPath:n,exported:a})).match(async a=>(await Y(e,a)).map(m=>({...a,fixtures:m})).mapErr(m=>({error:m,kind:"fixture-failed"})).asyncAndThen(m=>new ze(J(m,e)).mapErr(ie=>ie)),a=>Promise.resolve(l(a)));return d.isOk()&&Q({cwd:e,fingerprint:t,lockfile:d.value}),d}async function He(e){try{return F(await H(e))}catch(r){return l(ne(r))}}function ne(e){return Ue(e)?{kind:"authoring-error",message:e.message}:{kind:"load-threw",message:Ge(e)}}function Ue(e){return e instanceof Error&&e.name==="RipploAuthoringError"}var De=new Set([".local",".turbo","debug","node_modules","ripplo.lock"]);function te(e){let r=s.join(e,"..","node_modules","@ripplo","testing");return[...W(e),...Ne(s.join(r,"package.json")),...Ke(r)].toSorted((n,t)=>n.localeCompare(t)).join("|")}function W(e){return Be(e).flatMap(r=>{if(De.has(r.name))return[];let n=s.join(e,r.name);if(r.isDirectory())return W(n);let t=oe(n);return t==null?[]:[`${n}:${String(t.mtimeMs)}:${String(t.size)}`]})}function Be(e){try{return w.readdirSync(e,{withFileTypes:!0})}catch{return[]}}function oe(e){try{return w.statSync(e)}catch{return}}function Ne(e){let r=oe(e);return r==null?[]:[`${e}:${String(r.mtimeMs)}:${String(r.size)}`]}function Ke(e){let r=s.join(e,"src");return w.existsSync(r)?W(r):[]}async function Xe(e){let n=(await _e({bundle:!0,entryPoints:[e],format:"esm",logLevel:"silent",platform:"node",sourcemap:"inline",target:"node22",write:!1})).outputFiles[0];if(n==null)throw new Error("dsl bundle produced no output");return n.text}async function Je(e,r){try{let n=await r;process.setSourceMapsEnabled(!0);let t=await import(Ve(e,n)),o=t!=null&&typeof t=="object"&&"default"in t?Reflect.get(t,"default"):t;return F(o)}catch(n){return l(ne(n))}}function Ve(e,r){let n=s.join(s.dirname(e),".local");w.mkdirSync(n,{recursive:!0});let t=ve("sha256").update(r).digest("hex").slice(0,16),o=s.join(n,`dsl-bundle-${t}.mjs`);return w.writeFileSync(o,r),Me(o).href}function Ge(e){return e instanceof Error?e.message:String(e)}function Ye({entryPath:e,exported:r}){if(r==null||typeof r!="object"||!("lockfile"in r))return l({entryPath:e,kind:"not-ripplo"});let n=I.safeParse(Reflect.get(r,"lockfile"));return n.success?F(n.data):l({issues:n.error.issues.map(t=>`${t.path.join(".")}: ${t.message}`),kind:"invalid-lockfile"})}export{c as a,T as b,x as c,R as d,P as e,Pe as f,Fe as g,be as h,jr as i,Br as j,Nr as k,Ie as l,$e as m,te as n};
|
|
@@ -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 i}from"./chunk-MHNGR6M7.js";import{m as p}from"./chunk-
|
|
4
|
+
import{a as i}from"./chunk-MHNGR6M7.js";import{m as p}from"./chunk-D5F6DIXU.js";import{a}from"./chunk-7WZ3VIUU.js";import{e as s}from"./chunk-KH4QH23U.js";import{c as n}from"./chunk-RIASQHPG.js";import l from"fs";import d from"path";import*as r from"zod/mini";var c=new Set(["Edit","Write","NotebookEdit"]),u=r.looseObject({file_path:r.string()}),D=async t=>{if(!c.has(t.tool_name))return;let e=m(t);if(e==null)return;let{cwd:o}=t;return l.existsSync(s(o))||n(o)?void 0:(await p(o)).isErr()?{hookSpecificOutput:{additionalContext:`\`ripplo daemon\` isn't running and the DSL isn't compiling, so this edit is allowed through without dev-mode guardrails. Run \`npx ripplo compile\` to see the errors, or \`/ripplo:start\` to bring the daemon up. ${i("create","DSL authoring rules")}`,hookEventName:"PreToolUse"}}:{hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"deny",permissionDecisionReason:`\`ripplo daemon\` is not running \u2014 this edit to \`${e}\` won't sync and dev-mode guardrails won't fire. Run \`/ripplo:start\`, then retry (\`npx ripplo doctor\` checks the daemon and dev server). If the daemon can't start, the user can bypass with \`npx ripplo hooks pause\`. ${i("start")}`}}};function m(t){let e=u.safeParse(t.tool_input);if(!e.success||!a(t.cwd))return null;let o=d.relative(t.cwd,e.data.file_path);return o.startsWith("..")||o!==".ripplo"&&!o.startsWith(".ripplo/")?null:o}export{D as a};
|
|
@@ -1,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-
|
|
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-C63HR3XQ.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-
|
|
4
|
+
import{a as t}from"./chunk-MHNGR6M7.js";import{g as o,h as a,j as i}from"./chunk-D5F6DIXU.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-
|
|
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-
|
|
5
|
+
`))}var d={"exit-plan-gate":()=>import("./exit-plan-gate-44YWEKYS.js").then(o=>o.exitPlanGateHook),"plan-reminder":()=>import("./plan-reminder-5IW6CHBL.js").then(o=>t("UserPromptSubmit",o.planReminder)),"post-edit":()=>import("./post-edit-FXAZHTN6.js").then(o=>o.postEditHook),"post-edit-analyze":()=>import("./post-edit-analyze-ZSZ6AO3U.js").then(o=>t("PostToolUse",o.postEditAnalyze)),"post-edit-flag-stubs":()=>import("./post-edit-flag-stubs-QMRDE3JW.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-PGV7XSGT.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-DQD7CWGN.js").then(o=>t("PreToolUse",o.preEditWatchGate)),"prompt-submit":()=>import("./prompt-submit-PC4QIGY3.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-U7PURAF5.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-UKCCFGND.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-
|
|
4
|
+
import{a as o}from"./chunk-IUEJNPB6.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(`
|