ripplo 0.9.6 → 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.
- package/dist/{chunk-WCSDBWCI.js → chunk-22JUAYHM.js} +1 -1
- package/dist/{chunk-BDWNZMUM.js → chunk-2Q7VXQYN.js} +1 -1
- package/dist/{chunk-5IMT3SAH.js → chunk-6VUSLPQD.js} +1 -1
- package/dist/{chunk-CY5FJBHP.js → chunk-7CELUIVK.js} +1 -1
- package/dist/{chunk-DK4NUWRX.js → chunk-7W237JFM.js} +1 -1
- package/dist/{chunk-TPQIFYHW.js → chunk-AGK6XOX2.js} +1 -1
- package/dist/{chunk-TQANCEOL.js → chunk-BJWGAKKD.js} +3 -3
- package/dist/{chunk-NOT5PEHM.js → chunk-BNMS3N54.js} +1 -1
- package/dist/{chunk-VCY2CEE2.js → chunk-CAS7MBA7.js} +1 -1
- package/dist/{chunk-HD7WIBP2.js → chunk-CB74TAUC.js} +1 -1
- package/dist/{chunk-GKYP7AMJ.js → chunk-GZPE7I7U.js} +1 -1
- package/dist/{chunk-A5EBMT2E.js → chunk-IG7J452B.js} +1 -1
- package/dist/chunk-IPSXNIXC.js +48 -0
- package/dist/{chunk-6SYRXU4Q.js → chunk-N2OBRCPQ.js} +1 -1
- package/dist/{chunk-Z6UPZDW6.js → chunk-OAU4HUD2.js} +1 -1
- package/dist/{chunk-5D6PNHDQ.js → chunk-OES7HGNF.js} +1 -1
- package/dist/{chunk-36NPGS6X.js → chunk-R3DZ6JPY.js} +1 -1
- package/dist/{chunk-SXDYA2OR.js → chunk-SNU66GSR.js} +1 -1
- package/dist/{chunk-T76D4SYI.js → chunk-TPCKMDWU.js} +1 -1
- package/dist/{chunk-AIIZRQXH.js → chunk-TPHOSZAK.js} +1 -1
- package/dist/{chunk-NOKKMFJP.js → chunk-YQ2RBEOJ.js} +1 -1
- package/dist/daemon-3IWI7VQT.js +152 -0
- package/dist/{daemon-lock-YRKNXWGO.js → daemon-lock-OAARBZ4O.js} +1 -1
- package/dist/{exit-plan-gate-X3TX6QWS.js → exit-plan-gate-HSTV7UO4.js} +1 -1
- package/dist/hook.js +1 -1
- package/dist/index.js +2 -2
- package/dist/{plan-reminder-AR3TJXLA.js → plan-reminder-FZSSUVNB.js} +1 -1
- package/dist/{post-edit-VUBL7RDW.js → post-edit-333UCJ6G.js} +1 -1
- package/dist/{post-edit-analyze-ECCVJCPQ.js → post-edit-analyze-JFWA223C.js} +1 -1
- package/dist/{post-edit-flag-stubs-AHP6XA2S.js → post-edit-flag-stubs-IZSAIM4O.js} +1 -1
- package/dist/{pre-bash-run-gate-LQK52CAV.js → pre-bash-run-gate-B42YNDQF.js} +1 -1
- package/dist/{pre-edit-4MNJA3OT.js → pre-edit-WZJVD3J4.js} +1 -1
- package/dist/{pre-edit-ripplo-skill-gate-XJHLJN2F.js → pre-edit-ripplo-skill-gate-QHUD7QGU.js} +1 -1
- package/dist/{pre-edit-scope-gate-K5NYCES7.js → pre-edit-scope-gate-2YIFSEDY.js} +1 -1
- package/dist/{pre-edit-watch-gate-5YWMODVX.js → pre-edit-watch-gate-GQZYMDOC.js} +1 -1
- package/dist/{prompt-submit-PXMO75JB.js → prompt-submit-LE5LR62B.js} +1 -1
- package/dist/scope-reminder-DIDCHDAA.js +4 -0
- package/dist/{status-2FS6ZFIU.js → status-H5WYYH4J.js} +1 -1
- package/dist/{stop-enforce-56SLPUYT.js → stop-enforce-EH2SC7ND.js} +1 -1
- package/dist/{tasks-reminder-OJEB6HE5.js → tasks-reminder-SDS6RNLP.js} +1 -1
- package/package.json +2 -2
- package/dist/chunk-AJXAWZQO.js +0 -48
- package/dist/daemon-ZHTQ472Q.js +0 -152
- package/dist/scope-reminder-LDBXUQZH.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{j as l}from"./chunk-
|
|
4
|
+
import{j as l}from"./chunk-IPSXNIXC.js";import{spawnSync as y}from"child_process";import{existsSync as s,readdirSync as d,readFileSync as g,realpathSync as u,statSync as m}from"fs";import i from"path";var h=2e3;function D(t){if(t!=null)try{return m(u(t)).mtimeMs}catch{return}}function W(t){return y("pnpm",["turbo","run","build","--filter=ripplo..."],{cwd:t,stdio:"inherit"}).status===0}function T(){let t=process.argv[1];if(t==null)return{kind:"fresh"};let n=u(t),r=n.includes(`${i.sep}src${i.sep}`),o=c(i.dirname(n));if(o!=null)return r?{kind:"fresh"}:k(o);let a=c(process.cwd());return a!=null&&j(a)?{kind:"foreign-binary",workspaceRoot:a}:{kind:"fresh"}}function c(t){let n=i.dirname(t);return s(i.join(t,"pnpm-workspace.yaml"))?t:n===t?void 0:c(n)}function k(t){let n=i.join(t,"packages");if(!s(n))return{kind:"fresh"};let r=d(n).map(o=>({dist:i.join(n,o,"dist"),name:o,src:i.join(n,o,"src")})).filter(o=>s(o.src)&&s(o.dist)).filter(o=>p(o.src)>p(o.dist)+h).map(o=>o.name);return r.length===0?{kind:"fresh"}:{kind:"stale",packages:r,workspaceRoot:t}}function p(t){let n=m(t);if(!n.isDirectory())return n.mtimeMs;let r=d(t).map(o=>p(i.join(t,o)));return Math.max(n.mtimeMs,...r)}function j(t){let n=i.join(t,"packages","cli","package.json");if(!s(n))return!1;let r=JSON.parse(g(n,"utf8"));return typeof r=="object"&&r!=null&&"name"in r&&r.name==="ripplo"}import{createHash as x}from"crypto";import S from"os";import R from"path";import{createMessageConnection as E,NotificationType as f,RequestType as w,RequestType0 as b,SocketMessageReader as P,SocketMessageWriter as M}from"vscode-jsonrpc/node";import{z as e}from"zod";var q="daemon.log";function H(t){let n=x("sha256").update(t).digest("hex").slice(0,16);return R.join(S.tmpdir(),`ripplo-${n}.sock`)}function V(t){return l(t,q)}function Q(t){return E(new P(t),new M(t))}var Y=e.object({all:e.boolean(),headed:e.boolean(),tests:e.array(e.string())}),Z=e.object({jobId:e.string(),total:e.number()}),I=e.enum(["no-lockfile","unstamped","expander-newer","dsl-drift","load-failed"]),v=e.discriminatedUnion("kind",[e.object({kind:e.literal("off")}),e.object({kind:e.literal("on")}),e.object({kind:e.literal("paused")}),e.object({kind:e.literal("blocked"),reason:I})]),C=e.object({attempts:e.number(),findings:e.number()}),ee=e.object({active:e.number(),bundleMtimeMs:e.number().optional(),explorer:v,exploring:e.number(),progress:C,queued:e.number(),sseHealth:e.object({detail:e.string().optional(),ok:e.boolean()}).optional(),version:e.string().optional()}),z=e.enum(["MAX_RUNS","OVERAGE_CAP","MAX_AGENTS","MAX_CONCURRENT_RUNS","MAX_PROJECTS","CLOUD_EXECUTOR","REVIEW_QUOTA","MEMBER_CEILING"]),A=e.discriminatedUnion("type",[e.object({code:z,type:e.literal("limit")}),e.object({detail:e.string(),type:e.literal("generic")})]),N=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:A}),e.object({detail:e.string(),kind:e.literal("dispatch-timeout")}),e.object({detail:e.string(),kind:e.literal("infra-error")})]),O=e.discriminatedUnion("kind",[e.object({kind:e.literal("test-started"),runId:e.string(),testName:e.string(),workflowName:e.string()}),e.object({kind:e.literal("test-outcome"),outcome:N,runId:e.string(),testName:e.string(),workflowName:e.string()})]),te=e.object({event:O,jobId:e.string()}),ne=e.object({failed:e.number(),jobId:e.string(),notRun:e.number(),passed:e.number()}),oe=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")})]),re=new w("ripplo/enqueue"),ie=new b("ripplo/status"),se=new b("ripplo/shutdownIfIdle"),ae=new f("ripplo/jobEvent"),ce=new f("ripplo/jobDone");export{D as a,W as b,T as c,H as d,V as e,Q as f,Y as g,Z as h,ee as i,N as j,te as k,ne as l,oe as m,re as n,ie as o,se as p,ae as q,ce as r};
|
|
@@ -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-
|
|
4
|
+
import{a as r}from"./chunk-7WZ3VIUU.js";import{f as n}from"./chunk-TPHOSZAK.js";var m=async o=>{if(o.permission_mode!=="plan"||!r(o.cwd)||!n(o.cwd))return;let{loadRipplo:s}=await import("./dsl-loader-IRBKYLNW.js"),{stubbedWorkflows:a}=await import("./compile-write-OLP4DB4P.js"),t=await s(o.cwd);if(t.isErr())return;let e=a(t.value),i=['Plan must include "Tests to implement" with a .ripplo/workflows/ file per affected flow (ExitPlanMode blocks otherwise). Stub each with `workflow("Intent")` (no body).'];return e.length>0&&i.push(`Existing stubs: ${e.join(", ")}`),{hookSpecificOutput:{additionalContext:i.join(`
|
|
5
5
|
`),hookEventName:"UserPromptSubmit"}}};export{m as a};
|
|
@@ -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-LOEAZGYO.js";function l(){let o=process.cwd(),e=s(o);e!=null&&e!==o&&(process.chdir(e),process.stderr.write(`ripplo: resolved .ripplo/ at ${e}
|
|
5
|
-
`))}var d={"exit-plan-gate":()=>import("./exit-plan-gate-
|
|
5
|
+
`))}var d={"exit-plan-gate":()=>import("./exit-plan-gate-HSTV7UO4.js").then(o=>o.exitPlanGateHook),"plan-reminder":()=>import("./plan-reminder-FZSSUVNB.js").then(o=>t("UserPromptSubmit",o.planReminder)),"post-edit":()=>import("./post-edit-333UCJ6G.js").then(o=>o.postEditHook),"post-edit-analyze":()=>import("./post-edit-analyze-JFWA223C.js").then(o=>t("PostToolUse",o.postEditAnalyze)),"post-edit-flag-stubs":()=>import("./post-edit-flag-stubs-IZSAIM4O.js").then(o=>t("PostToolUse",o.postEditFlagStubs)),"pre-bash-run-gate":()=>import("./pre-bash-run-gate-B42YNDQF.js").then(o=>o.preBashRunGateHook),"pre-edit":()=>import("./pre-edit-WZJVD3J4.js").then(o=>o.preEditHook),"pre-edit-ripplo-skill-gate":()=>import("./pre-edit-ripplo-skill-gate-QHUD7QGU.js").then(o=>t("PreToolUse",o.preEditRipploSkillGate)),"pre-edit-scope-gate":()=>import("./pre-edit-scope-gate-2YIFSEDY.js").then(o=>t("PreToolUse",o.preEditScopeGate)),"pre-edit-watch-gate":()=>import("./pre-edit-watch-gate-GQZYMDOC.js").then(o=>t("PreToolUse",o.preEditWatchGate)),"prompt-submit":()=>import("./prompt-submit-LE5LR62B.js").then(o=>o.promptSubmitHook),"scope-reminder":()=>import("./scope-reminder-DIDCHDAA.js").then(o=>t("UserPromptSubmit",o.scopeReminder)),"session-preamble":()=>import("./session-preamble-ZYVRDSGA.js").then(o=>o.sessionPreambleHook),"stop-enforce":()=>import("./stop-enforce-EH2SC7ND.js").then(o=>o.stopEnforceHook),"tasks-reminder":()=>import("./tasks-reminder-SDS6RNLP.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-OIG4RO4E.js");process.stderr.write(`${a(o,r.error)}
|
|
7
7
|
`),process.exit(0)}r.stdout!=null&&process.stdout.write(r.stdout),process.exit(0)}function m(){return new Promise((o,e)=>{if(process.stdin.isTTY){o("");return}let i=[];process.stdin.on("data",r=>i.push(r)),process.stdin.on("end",()=>{o(Buffer.concat(i).toString("utf8"))}),process.stdin.on("error",e)})}export{l as a,n as b,P as c};
|
|
@@ -1,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{c as P}from"./chunk-
|
|
4
|
+
import{c as P}from"./chunk-7W237JFM.js";import{a as I,f as v}from"./chunk-TPHOSZAK.js";import{g as h,k as w,n as k}from"./chunk-L2ZJK7MP.js";import{d as a,f}from"./chunk-IPSXNIXC.js";import{V as S,X as m}from"./chunk-XJJDHGK4.js";import y from"fs";import p from"path";function D(e){try{let n=A(e);if(n==null)return;let t=p.join(n,"HEAD"),o=y.readFileSync(t,"utf8").trim(),r="ref: refs/heads/";return o.startsWith(r)?o.slice(r.length):o.length===0?void 0:o.slice(0,7)}catch{return}}function A(e){let n=p.join(e,".git");if(y.statSync(n).isDirectory())return n;let o=y.readFileSync(n,"utf8").trim(),r="gitdir:";if(!o.startsWith(r))return;let s=o.slice(r.length).trim();if(s.length!==0)return p.resolve(e,s)}import E from"crypto";import{readFile as R}from"fs/promises";import x from"path";import{graphql as g}from"gql.tada";import{err as L,ok as T}from"neverthrow";var C=g(`
|
|
5
5
|
mutation SyncDevSession(
|
|
6
6
|
$projectId: String!
|
|
7
7
|
$cwd: String!
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __ripploCreateRequire } from "node:module";
|
|
3
3
|
const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
|
|
4
|
-
import{a as c,d as s}from"./chunk-FEHVIHVA.js";import{k as l}from"./chunk-
|
|
4
|
+
import{a as c,d as s}from"./chunk-FEHVIHVA.js";import{k as l}from"./chunk-IPSXNIXC.js";import{err as h,ok as P}from"neverthrow";import{z as n}from"zod";var g="https://ripplo.ai";function a(){return u().RIPPLO_SERVER_URL}function m(){return u().RIPPLO_PROJECT_ID}var v=n.object({RIPPLO_PROJECT_ID:n.string().min(1).optional(),RIPPLO_SERVER_URL:n.string().min(1).default(g)}),f;function u(){return f??=v.parse(process.env),f}import d from"fs";import i from"path";function R(o){let t=d.realpathSync(o),r=t,e=i.dirname(r);for(;e!==r;){if(d.existsSync(i.join(r,".git")))return r;r=e,e=i.dirname(r)}return t}function x(o){return c(o).andThen(t=>s().andThen(r=>{let e=a(),p=l(e);return p==null?h({kind:"not-authenticated"}):P({appUrl:r.appUrl,cwd:R(o),engineUrl:r.engineUrl,projectId:m()??t.projectId,ripploServerUrl:e,token:p,webhookSecret:r.webhookSecret})}))}export{a,u as b,x as c};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __ripploCreateRequire } from "node:module";
|
|
3
3
|
const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
|
|
4
|
-
import{b as m,c as p}from"./chunk-
|
|
4
|
+
import{b as m,c as p}from"./chunk-CB74TAUC.js";import{c as l}from"./chunk-5E62BCS7.js";import{c as d}from"./chunk-7W237JFM.js";import{a as i}from"./chunk-7WZ3VIUU.js";import{f as u}from"./chunk-TPHOSZAK.js";import{e as a}from"./chunk-IPSXNIXC.js";import{createHash as g}from"crypto";import{graphql as k}from"gql.tada";var c="tasks-reminder",y=k(`
|
|
5
5
|
query TasksReminder($projectId: String!, $cwd: String!) {
|
|
6
6
|
project(id: $projectId) {
|
|
7
7
|
id
|
|
@@ -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 Ne,f as qe,g as Le,j as He,n as _e,o as We,p as Be,q as Ke,r as Ve}from"./chunk-
|
|
4
|
+
import{a as Ne,f as qe,g as Le,j as He,n as _e,o as We,p as Be,q as Ke,r as Ve}from"./chunk-22JUAYHM.js";import{c as Qe,e as Je,f as ze}from"./chunk-7CELUIVK.js";import{c as O}from"./chunk-7W237JFM.js";import{d as Ue}from"./chunk-TPHOSZAK.js";import{a as $}from"./chunk-R4ZTRVDQ.js";import{d as me}from"./chunk-FEHVIHVA.js";import{b as xe}from"./chunk-V4CLXOCP.js";import{a as ve}from"./chunk-5DT43ABQ.js";import{g as Fe}from"./chunk-RIVHBABX.js";import{g as Re,l as ke,m as Se,n as we}from"./chunk-L2ZJK7MP.js";import{c as D}from"./chunk-R3DZ6JPY.js";import{a as ge,d as u,f,g as I}from"./chunk-IPSXNIXC.js";import{D as Ae,G as Me,S as $e,T as je,W as Oe,X as De,a as R,b as T,c as Ee,d as be,e as Ie,f as j,j as Te,k as Ce,m as Pe,p as v}from"./chunk-4GA5662U.js";import{W as M,X as h,i as A,l as G,q as he}from"./chunk-XJJDHGK4.js";import Wn from"p-queue";var Bn=4,Kn={"p0-ui":3,"p1-cli":2,"p2-cover":1,"p3-explore":0},F=new Wn({concurrency:Bn}),k={headedActive:0,interactiveActive:0,interactiveQueued:0},Ge={current:null};function ro({headed:e,task:n,workClass:r}){let t=Kn[r];return r==="p3-explore"?F.add(n,{priority:t}):(k.interactiveQueued+=1,U(),F.add(()=>Vn({headed:e,task:n}),{priority:t}))}function to(e){!Number.isFinite(e)||e<1||(F.concurrency=Math.floor(e),U())}function Y(){return{active:k.interactiveActive,headedActive:k.headedActive,poolSize:F.concurrency,queued:k.interactiveQueued}}function oo(e){Ge.current=e}async function Vn({headed:e,task:n}){k.interactiveQueued-=1,k.interactiveActive+=1,k.headedActive+=e?1:0,U();try{return await n()}finally{k.interactiveActive-=1,k.headedActive-=e?1:0,U()}}function U(){Ge.current?.()}async function Ye(e){try{return await fetch(e,{method:"HEAD",signal:AbortSignal.timeout(2e3)}),null}catch(n){return n instanceof Error?n.message:String(n)}}async function Xe(e){try{return await fetch(e,{method:"HEAD",signal:AbortSignal.timeout(25e3)}),null}catch(n){return n instanceof Error?n.message:String(n)}}import{graphql as Qn}from"gql.tada";async function Ze(e,n){let t=(await u({config:e,document:Jn,variables:{cwd:n,projectId:e.projectId}})).project?.devSession?.workflows??[];return new Map(t.flatMap(o=>o.tests.map(i=>[`${o.slug}/${i.slug}`,{testId:i.id,workflowId:o.id}])))}var Jn=Qn(`
|
|
5
5
|
query DaemonWorkflows($projectId: String!, $cwd: String!) {
|
|
6
6
|
project(id: $projectId) {
|
|
7
7
|
id
|
|
@@ -162,7 +162,7 @@ import{a as Ne,f as qe,g as Le,j as He,n as _e,o as We,p as Be,q as Ke,r as Ve}f
|
|
|
162
162
|
exploreFindingExists(projectId: $projectId, signature: $signature, lockfileHash: $lockfileHash)
|
|
163
163
|
}
|
|
164
164
|
`);import ht from"path";import{graphql as Rt}from"gql.tada";import{graphql as K}from"gql.tada";function ce(e){switch(e.kind){case"app-not-ready":return"appNotReady";case"client-mount-missing":return"appNotReady";case"engine-network":case"engine-http":return"backendUnreachable";case"engine-unreachable":return"engineUnreachable";case"engine-decode":case"state-identity":case"setup-missing-row":case"page-read":case"driver-launch":case"action-failed":case"check-failed":case"aborted":return null}}async function ue({config:e,ownerToken:n,reason:r,runId:t}){await u({config:e,document:gt,variables:{ownerToken:n,reason:r,runId:t}}).catch(o=>{f.error(o,"failRun submission failed")})}async function pe({cause:e,config:n,ownerToken:r,runId:t}){await u({config:n,document:mt,variables:{cause:e,ownerToken:r,runId:t}}).catch(o=>{f.error(o,"markRunUnready submission failed")})}var ki=K(`
|
|
165
|
-
mutation ReleaseRun($runId: String!, $ownerToken: String
|
|
165
|
+
mutation ReleaseRun($runId: String!, $ownerToken: String) {
|
|
166
166
|
releaseRun(runId: $runId, ownerToken: $ownerToken)
|
|
167
167
|
}
|
|
168
168
|
`),Si=K(`
|
|
@@ -174,7 +174,7 @@ import{a as Ne,f as qe,g as Le,j as He,n as _e,o as We,p as Be,q as Ke,r as Ve}f
|
|
|
174
174
|
failRun(runId: $runId, reason: $reason, ownerToken: $ownerToken)
|
|
175
175
|
}
|
|
176
176
|
`),mt=K(`
|
|
177
|
-
mutation MarkRunUnready($runId: String!, $cause: RunUnreadyCause!, $ownerToken: String
|
|
177
|
+
mutation MarkRunUnready($runId: String!, $cause: RunUnreadyCause!, $ownerToken: String) {
|
|
178
178
|
markRunUnready(runId: $runId, cause: $cause, ownerToken: $ownerToken)
|
|
179
179
|
}
|
|
180
180
|
`);async function kt({config:e,cwd:n,errorSettle:r,fixturesDir:t,headed:o,lockfile:i,onPhase:s,runId:a,session:l,signal:d,test:p}){let c=await wt(e,a);if(c==null)return{outcome:{kind:"dispatch-failed",reason:"already-claimed",runId:a},ownerToken:null,persisted:Promise.resolve()};let y=ht.join(n,".ripplo","debug"),g=[];return(await l.runOnce({capture:!0,lockfile:i,onPhase:s,options:_({config:e,fixturesDir:t,headed:o}),params:void 0,runId:a,sequence:void 0,test:p,onEvent:b=>{g.push(b)}},d)).match(async b=>{let ye=le(g),J=ye.flatMap(_n=>v(_n.event)),z=St(J);if(z!=null)return W({config:e,debugDir:y,events:g,recordingOptional:!0,runId:a,stepSources:void 0}),await Mn({config:e,error:z,errorSettle:r,ownerToken:c,runId:a}),{outcome:{error:z,kind:"error",runId:a},ownerToken:c,persisted:Promise.resolve()};await se({config:e,ownerToken:c,records:ye,runId:a}),W({config:e,debugDir:y,events:g,recordingOptional:!0,runId:a,stepSources:void 0});let Hn=Promise.resolve();return{outcome:J.length>0?{contradictions:J,kind:"findings",runId:a}:{kind:"pass",runId:a},ownerToken:c,persisted:Hn}},async b=>(await Mn({config:e,error:b,errorSettle:r,ownerToken:c,runId:a}),{outcome:{error:b,kind:"error",runId:a},ownerToken:c,persisted:Promise.resolve()}))}async function Mn({config:e,error:n,errorSettle:r,ownerToken:t,runId:o}){if(r==="defer")return;let i=ce(n);if(i!=null){await pe({cause:i,config:e,ownerToken:t,runId:o});return}await ue({config:e,ownerToken:t,reason:j(n),runId:o})}function St(e){let n=e.find(r=>r.kind==="stepError"&&be(r.record.error));return n!=null&&n.kind==="stepError"?n.record.error:void 0}async function wt(e,n){return((await u({config:e,document:vt,variables:{runIds:[n]}})).startRunsBatch??[]).find(o=>o.id===n)?.ownerToken??null}var vt=Rt(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __ripploCreateRequire } from "node:module";
|
|
3
3
|
const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
|
|
4
|
-
import{b as u}from"./chunk-
|
|
4
|
+
import{b as u}from"./chunk-N2OBRCPQ.js";import{a as f}from"./chunk-JJ4QQPAV.js";import{a as m}from"./chunk-7WZ3VIUU.js";import{f as c}from"./chunk-TPHOSZAK.js";import{i as p}from"./chunk-RIVHBABX.js";import{n as l}from"./chunk-L2ZJK7MP.js";import v from"path";import h from"picomatch";import*as s from"zod/mini";var w=s.looseObject({file_path:s.string()}),R=async n=>{let i=w.safeParse(n.tool_input);if(!i.success)return;let d=i.data.file_path,{cwd:t}=n;if(!m(t)||!c(t))return;let r=v.relative(t,d);if(r.startsWith(".."))return;let{ignorePaths:b,watchPaths:k}=f(),P=h([...k]),g=h([...b]);if(!P(r)||g(r))return;let o=await l(t);if(u({cwd:t,tests:o.isOk()?o.value.workflows.map(e=>({intent:e.intent,name:e.name,sourcePath:e.sourcePath??null,stub:e.stub})):void 0}),o.isErr())return;let a=p(o.value);if(a.length!==0)return{hookSpecificOutput:{additionalContext:`Reminder: stub workflows still unimplemented \u2014 ${a.join(", ")}. Implement with \`workflow("Intent", () => ({ given, steps }))\`.`,hookEventName:"PostToolUse"}}};export{R as a};
|
|
@@ -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 c}from"./chunk-OQ6KNYPG.js";import{c as p}from"./chunk-
|
|
4
|
+
import{a as c}from"./chunk-OQ6KNYPG.js";import{c as p}from"./chunk-7W237JFM.js";import{c as l}from"./chunk-FEHVIHVA.js";import{a}from"./chunk-MHNGR6M7.js";import{g as t,l as u}from"./chunk-4GA5662U.js";import{X as d}from"./chunk-XJJDHGK4.js";var g=3e3;async function R(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(g)}),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 f 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
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 N({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
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={CLOUD_EXECUTOR:"cloud runs are not included on your plan \u2014 upgrade to run in the cloud",MAX_AGENTS:"agent limit reached for your plan \u2014 upgrade to add more",MAX_CONCURRENT_RUNS:"concurrent run limit reached for your plan \u2014 upgrade or wait for runs to finish",MAX_PROJECTS:"project limit reached for your plan \u2014 upgrade to add more",MAX_RUNS:"run limit reached for your plan \u2014 enable overage or upgrade",MEMBER_CEILING:"member ceiling reached for the target plan \u2014 remove members or pick a bigger plan",OVERAGE_CAP:"overage cap reached \u2014 raise the cap or upgrade",REVIEW_QUOTA:"review quota reached for your plan \u2014 set an overage cap or upgrade"};function j({detail:e,serverUrl: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 _(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}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __ripploCreateRequire } from "node:module";
|
|
3
3
|
const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
|
|
4
|
-
import{b as s,c as u}from"./chunk-
|
|
4
|
+
import{b as s,c as u}from"./chunk-TPHOSZAK.js";import{createHash as d}from"crypto";import{mkdirSync as h,readdirSync as g,readFileSync as p,writeFileSync as m}from"fs";import i from"path";var l=[".ts",".tsx",".js",".jsx"],y=new Set([".local","debug"]);function v(r){let t=d("sha256");return u(r)?(t.update(s(["rev-parse","HEAD"],r)),t.update("\0"),t.update(s(["diff","HEAD"],r)),t.update("\0"),s(["ls-files","--others","--exclude-standard"],r).split(`
|
|
5
5
|
`).filter(e=>e.length>0).filter(e=>l.some(n=>e.endsWith(n))).toSorted((e,n)=>e.localeCompare(n)).forEach(e=>{t.update(e),t.update("\0"),t.update(c(i.join(r,e))),t.update("\0")}),t.digest("hex")):S(r,t)}function A(r,t){try{return p(f(r,t),"utf8").trim()}catch{return null}}function D(r,t,o){let e=f(r,t);h(i.dirname(e),{recursive:!0}),m(e,o)}function S(r,t){let o=i.join(r,".ripplo");return x(o).filter(n=>l.some(a=>n.endsWith(a))).filter(n=>!y.has(n.split(i.sep)[0]??"")).toSorted((n,a)=>n.localeCompare(a)).forEach(n=>{t.update(n),t.update("\0"),t.update(c(i.join(o,n))),t.update("\0")}),t.digest("hex")}function x(r){try{return g(r,{recursive:!0}).filter(t=>typeof t=="string")}catch{return[]}}function c(r){try{return p(r)}catch{return Buffer.alloc(0)}}function f(r,t){return i.join(r,".ripplo",".local",`${t}.hash`)}export{v as a,A as b,D as c};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __ripploCreateRequire } from "node:module";
|
|
3
3
|
const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
|
|
4
|
-
import{b as w,c as P}from"./chunk-
|
|
4
|
+
import{b as w,c as P}from"./chunk-CB74TAUC.js";import{a as m}from"./chunk-MOI4L3EX.js";import{a as u,c as y,d as g}from"./chunk-FJPJDGSS.js";import{a as h}from"./chunk-OQ6KNYPG.js";import{f as S}from"./chunk-7CELUIVK.js";import{a as c}from"./chunk-7WZ3VIUU.js";import{f as k}from"./chunk-TPHOSZAK.js";import{a as l}from"./chunk-5DT43ABQ.js";import{a as s}from"./chunk-MHNGR6M7.js";import{e as f,f as p}from"./chunk-RIVHBABX.js";import{b as d}from"./chunk-4GA5662U.js";import{createHash as b}from"crypto";import*as a from"zod/mini";var v=a.looseObject({file_path:a.string()}),J=async e=>{let o=v.safeParse(e.tool_input);if(!o.success||!/\/\.ripplo\/.*\.ts$/.test(o.data.file_path))return;let{cwd:t}=e;if(!c(t))return;if(!k(t))return{hookSpecificOutput:{additionalContext:"Ripplo hooks are paused \u2014 DSL compile and lockfile sync did not run for this edit. Resume with `npx ripplo hooks resume` when ready.",hookEventName:"PostToolUse"}};let r=await f(t);if(r.isErr())return{decision:"block",reason:`${l(r.error)}
|
|
5
5
|
${s("create","DSL authoring rules")}`};let n=await F({cwd:t,filePath:o.data.file_path,lockfile:r.value});if("block"in n)return{decision:"block",reason:n.block};let{addedSlugs:i}=await S({cwd:t,editedPath:o.data.file_path,lockfile:r.value,requireHooks:!0,syncFirst:!0});return L(z({addedSlugs:i,cwd:t,elsewhere:n.elsewhere,lockfile:r.value}))};function z({addedSlugs:e,cwd:o,elsewhere:t,lockfile:r}){return[...e.length>0?[`Auto-scoped ${e.join(", ")} (dirty tests).`]:[],...t>0?[A(t).trimStart()]:[],...H(o,r)]}async function F({cwd:e,filePath:o,lockfile:t}){let r=await u({cwd:e,lockfile:t});await p(e,t);let n=N(r,t,o),i=r.length-n.length;return n.length===0?{elsewhere:i}:{block:`${y(n)}${A(i)}
|
|
6
6
|
${s("create")}`}}function N(e,o,t){let r=new Set(d(o).filter(({workflow:n})=>n.sourcePath!=null&&t.endsWith(n.sourcePath)).map(({ref:n})=>n));return r.size===0?e:e.filter(n=>{let i=R(n);return i==null||r.has(i)})}function R(e){return e.kind==="unreachable-interaction"?e.violation.test:e.kind==="redundant-assertion"?e.redundancy.test:e.kind==="missing-precondition"?e.missing.test:null}function A(e){return e===0?"":`
|
|
7
7
|
${h(e,"finding")} in other files \u2014 \`npx ripplo compile\` for the full list.`}function L(e){if(e.length!==0)return{hookSpecificOutput:{additionalContext:e.join(`
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __ripploCreateRequire } from "node:module";
|
|
3
3
|
const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
|
|
4
|
-
import{f as a}from"./chunk-
|
|
4
|
+
import{f as a}from"./chunk-OES7HGNF.js";import{a as n}from"./chunk-5DT43ABQ.js";import{i}from"./chunk-RIVHBABX.js";import{n as e}from"./chunk-L2ZJK7MP.js";import{i as u}from"./chunk-GFKK7K6T.js";async function x(m){let o=process.cwd(),r=await e(o);r.isErr()&&(process.stderr.write(`${n(r.error)}
|
|
5
5
|
`),process.exit(1));let s=i(r.value),t=await a(o);if(m.format==="summary"){s.length>0&&process.stdout.write(`stub workflows: ${s.join(", ")}
|
|
6
6
|
`),process.stdout.write(`${u(t)}
|
|
7
7
|
`);return}let p={daemon:t.kind==="running"?{active:t.status.active,explorer:t.status.explorer,exploring:t.status.exploring,progress:t.status.progress,queued:t.status.queued,running:!0}:{running:t.kind==="unresponsive",state:t.kind},tests:s.map(d=>({id:d,implemented:!1}))};process.stdout.write(`${JSON.stringify(p,null,2)}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __ripploCreateRequire } from "node:module";
|
|
3
|
+
const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
|
|
4
|
+
import{b as E}from"./chunk-LOEAZGYO.js";import{a as U}from"./chunk-NNH3YVVO.js";import{b as $}from"./chunk-KMZ3L5YA.js";var F=15e3,G=3,L=300,f=class extends Error{detail;serverUrl;constructor({detail:r,serverUrl:t}){super(`Failed to connect to Ripplo server at ${t}. Check the server is running and reachable. Details: ${r}`),this.name="GqlConnectionError",this.detail=r,this.serverUrl=t}},u=class extends Error{errors;constructor(r){super(r.map(t=>t.message).join(", ")),this.name="GqlRequestError",this.errors=r}};function N(e){if(e instanceof u)return e.errors[0]?.extensions?.code}var j={attempts:G,timeoutMs:F},V={attempts:1,timeoutMs:3e3};async function x(e){return T(e,j)}async function W(e){return T(e,V)}async function T(e,r){let{print:t}=await import("graphql"),n=t(e.document),o=JSON.stringify({query:n,variables:e.variables}),a=`${e.config.ripploServerUrl}/graphql`,s=await B({init:{body:o,headers:{Authorization:`Bearer ${e.config.token}`,"Content-Type":"application/json",...E()},method:"POST"},policy:r,serverUrl:e.config.ripploServerUrl,url:a}),l=await J({res:s,url:a});if(!Q(l))throw new Error("Invalid GraphQL response");if(X(l))throw new u(l.errors);if(l.data==null)throw new Error("No data returned from server");return l.data}async function B({init:e,policy:r,serverUrl:t,url:n}){let o=1,a=await b({init:e,timeoutMs:r.timeoutMs,url:n});for(;a.retryable&&o<r.attempts;)await K(H(o)),o+=1,a=await b({init:e,timeoutMs:r.timeoutMs,url:n});let{response:s}=a;if(s!=null&&s.status<500)return s;throw new f({detail:s==null?a.detail:`server returned status ${String(s.status)}`,serverUrl:t})}async function b({init:e,timeoutMs:r,url:t}){try{let n=await fetch(t,{...e,signal:AbortSignal.timeout(r)});return{detail:"",response:n,retryable:n.status>=500}}catch(n){return{detail:n instanceof Error?n.message:String(n),response:void 0,retryable:!0}}}function H(e){return L*3**(e-1)*(.5+Math.random())}function K(e){return new Promise(r=>{setTimeout(r,e)})}async function J({res:e,url:r}){let t=await e.text();if(t.length===0)throw new Error(`Empty response from Ripplo server at ${r} (status ${String(e.status)}). The server may have restarted or the request was rejected before a body was sent.`);try{return JSON.parse(t)}catch{throw new Error(`Non-JSON response from Ripplo server at ${r} (status ${String(e.status)}): ${t.slice(0,200)}`)}}function Q(e){return typeof e=="object"&&e!=null&&("data"in e||"errors"in e)}function X(e){return Array.isArray(e.errors)&&e.errors.length>0}import Y from"pino";import z from"pino-pretty";var y=Y({level:process.env.LOG_LEVEL??"info"},z({ignore:"pid,hostname"}));import{readdir as Z,rm as ee,stat as re}from"fs/promises";import{existsSync as k}from"fs";import w from"path";var v=".uploaded";var C=w.join(process.cwd(),".ripplo","debug"),D=360*60*1e3;async function te({maxRuns:e}){try{let t=(await Z(C,{withFileTypes:!0})).filter(i=>i.isDirectory()),n=Date.now(),o=await Promise.all(t.map(async i=>{let m=w.join(C,i.name),O=await re(m);return{dirPath:m,mtime:O.mtimeMs,pendingUpload:ne(m)}})),a=o.filter(i=>n-i.mtime>D),s=o.filter(i=>n-i.mtime<=D&&!i.pendingUpload).toSorted((i,m)=>m.mtime-i.mtime).slice(e),l=[...a,...s];if(l.length===0)return;await Promise.allSettled(l.map(i=>ee(i.dirPath,{force:!0,recursive:!0}))),y.debug("Pruned %d old debug run(s)",l.length)}catch{y.warn("Debug run pruning failed, ignoring")}}function ne(e){return k(w.join(e,"behavior.jsonl"))&&!k(w.join(e,v))}import d from"fs";import oe from"os";import g from"path";var ie=".local",ae=".ripplo";function h(e){return g.join(e,".ripplo",ie)}function se(e){let r=h(e);d.existsSync(r)||d.mkdirSync(r,{recursive:!0});let t=g.join(r,".gitignore");return d.existsSync(t)||d.writeFileSync(t,`*
|
|
5
|
+
`),r}function le(e,r){return g.join(h(e),r)}function P(){return g.join(oe.homedir(),ae)}function S(){let e=P();return d.existsSync(e)?d.chmodSync(e,448):d.mkdirSync(e,{mode:448,recursive:!0}),e}function A(e){return g.join(P(),e)}import{Agent as de,RetryAgent as ce,setGlobalDispatcher as me}from"undici";var ue=1500,ge=4e3,pe=3,fe=50,ye=100,I=!1;function we(){if(I)return;I=!0;let e=new de({connections:ye,keepAliveMaxTimeout:ge,keepAliveTimeout:ue}),r=new ce(e,{errorCodes:["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT","UND_ERR_REQ_CONTENT_LENGTH_MISMATCH","UND_ERR_SOCKET"],maxRetries:pe,methods:["GET","POST","HEAD","OPTIONS","PUT","DELETE"],minTimeout:fe});me(r)}import{graphql as p}from"gql.tada";var We=p(`
|
|
6
|
+
query AgentReviewContextWorker($reviewId: String!) {
|
|
7
|
+
agentReview(id: $reviewId) {
|
|
8
|
+
id
|
|
9
|
+
runId
|
|
10
|
+
agentProfile {
|
|
11
|
+
id
|
|
12
|
+
name
|
|
13
|
+
description
|
|
14
|
+
output
|
|
15
|
+
successCriteria
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
`);var Be=p(`
|
|
20
|
+
mutation StartAgentReviewWorker($reviewId: String!) {
|
|
21
|
+
startAgentReview(reviewId: $reviewId)
|
|
22
|
+
}
|
|
23
|
+
`);var He=p(`
|
|
24
|
+
mutation CompleteAgentReviewWorker(
|
|
25
|
+
$reviewId: String!
|
|
26
|
+
$markdown: String!
|
|
27
|
+
$shortSummary: String!
|
|
28
|
+
$verdict: AgentReviewVerdict!
|
|
29
|
+
$comments: [AgentReviewCommentInput!]!
|
|
30
|
+
) {
|
|
31
|
+
completeAgentReview(
|
|
32
|
+
reviewId: $reviewId
|
|
33
|
+
markdown: $markdown
|
|
34
|
+
shortSummary: $shortSummary
|
|
35
|
+
verdict: $verdict
|
|
36
|
+
comments: $comments
|
|
37
|
+
)
|
|
38
|
+
}
|
|
39
|
+
`);var Ke=p(`
|
|
40
|
+
mutation UpdateAgentReviewProgressWorker($reviewId: String!, $text: String!) {
|
|
41
|
+
updateAgentReviewProgress(reviewId: $reviewId, text: $text)
|
|
42
|
+
}
|
|
43
|
+
`);var Je=p(`
|
|
44
|
+
mutation FailAgentReviewWorker($reviewId: String!, $reason: String!) {
|
|
45
|
+
failAgentReview(reviewId: $reviewId, reason: $reason)
|
|
46
|
+
}
|
|
47
|
+
`);import c from"fs";import _ from"path";function Re(e){let r=process.env.RIPPLO_TOKEN;if(r!=null&&r.trim().length>0)return r.trim();let t=R(e);if(!c.existsSync(t))return null;let n=c.readFileSync(t,"utf8").trim();return n.length===0?null:n}function ve({serverUrl:e,token:r}){S();let t=R(e);c.mkdirSync(_.dirname(t),{mode:448,recursive:!0}),c.writeFileSync(t,r+`
|
|
48
|
+
`,{mode:384})}function he(e){let r=R(e);return c.existsSync(r)?(c.unlinkSync(r),!0):!1}function R(e){return A(_.join("tokens",Pe(e)))}function Pe(e){return new URL(e).host.replaceAll(/[^a-zA-Z0-9.]/g,"_")}var M=$(U(),1);import q from"crypto";function Se({body:e,secret:r}){let t=new M.Webhook(r),n=`msg_${q.randomUUID()}`,o=new Date,a=t.sign(n,o,e),s=Math.floor(o.getTime()/1e3);return{"webhook-id":n,"webhook-signature":a,"webhook-timestamp":String(s)}}function Ae(){return`whsec_${q.randomBytes(24).toString("base64")}`}export{f as a,u as b,N as c,x as d,W as e,y as f,v as g,te as h,se as i,le as j,Re as k,ve as l,he as m,R as n,we as o,Se as p,Ae as q};
|
|
@@ -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-
|
|
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-
|
|
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-
|
|
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-
|
|
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};
|
|
@@ -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-
|
|
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};
|
|
@@ -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}from"./chunk-7WZ3VIUU.js";import{e as p}from"./chunk-
|
|
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-
|
|
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 l}from"./chunk-JJ4QQPAV.js";import{c}from"./chunk-
|
|
4
|
+
import{a as l}from"./chunk-JJ4QQPAV.js";import{c}from"./chunk-7W237JFM.js";import{a as p}from"./chunk-7WZ3VIUU.js";import{f as d}from"./chunk-TPHOSZAK.js";import{b as a}from"./chunk-MHNGR6M7.js";import{e as s}from"./chunk-IPSXNIXC.js";import f from"path";import u from"picomatch";import{graphql as m}from"gql.tada";import*as n from"zod/mini";var h=new Set(["Edit","Write","NotebookEdit"]),g=n.looseObject({file_path:n.string()}),S=m(`
|
|
5
5
|
query PreEditScopeGate($projectId: String!, $cwd: String!) {
|
|
6
6
|
project(id: $projectId) {
|
|
7
7
|
id
|