ripplo 0.14.0 → 0.15.1
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-BQ25IGJS.js → chunk-5JXP37ET.js} +1 -1
- package/dist/{chunk-3ZQRLG7C.js → chunk-5PICILBD.js} +1 -1
- package/dist/{chunk-U4LFIMDP.js → chunk-ANAQCK5G.js} +1 -1
- package/dist/{chunk-ULIHURY6.js → chunk-AUXGLJ3J.js} +1 -1
- package/dist/{chunk-GTB7NYDE.js → chunk-BTIQ5H3K.js} +1 -1
- package/dist/{chunk-R3FZ2JEW.js → chunk-EVEITUJH.js} +1 -1
- package/dist/{chunk-PWDBRLJP.js → chunk-EYILCSW6.js} +1 -1
- package/dist/chunk-F4UCCW7Q.js +83 -0
- package/dist/chunk-IRT6UHD3.js +61 -0
- package/dist/{chunk-AVBTPZUU.js → chunk-IVW5DUE4.js} +1 -1
- package/dist/{chunk-B5HDXHPI.js → chunk-JPXTGKSB.js} +2 -2
- package/dist/{chunk-ZGWV564Y.js → chunk-KL6TIUNF.js} +1 -1
- package/dist/{chunk-NXKOUVSC.js → chunk-KOZTQJBB.js} +18 -18
- package/dist/{chunk-75T33SK5.js → chunk-NUBMOTH6.js} +1 -1
- package/dist/{chunk-6JXOIP2T.js → chunk-O4A5UISQ.js} +1 -1
- package/dist/{chunk-LEYSGMW2.js → chunk-QQ6VKZ6A.js} +1 -1
- package/dist/{chunk-56MARCN3.js → chunk-QSKOYBDO.js} +1 -1
- package/dist/{chunk-EOBWMMVC.js → chunk-RXLDAR2J.js} +1 -1
- package/dist/{chunk-Q7FIZGKZ.js → chunk-XPOOWIRL.js} +1 -1
- package/dist/{cli-error-N7X2CREI.js → cli-error-7LCAN3Z5.js} +1 -1
- package/dist/{compile-write-XMVD5PX2.js → compile-write-Y5III4OM.js} +1 -1
- package/dist/daemon-6UYMYGPI.js +175 -0
- package/dist/{daemon-DARMT5AV.js → daemon-EITBDEP7.js} +1 -1
- package/dist/{dsl-loader-SSXMC5EE.js → dsl-loader-ASNZDV7E.js} +1 -1
- package/dist/hook.js +1 -1
- package/dist/index.js +2 -2
- package/dist/{plan-reminder-K7HOFGJN.js → plan-reminder-6VWOS6HD.js} +1 -1
- package/dist/{post-edit-OI6DDU25.js → post-edit-A5Y26UH5.js} +1 -1
- package/dist/post-edit-analyze-2SBNWX6Y.js +4 -0
- package/dist/{post-edit-flag-stubs-IKIH5DAH.js → post-edit-flag-stubs-I43B5QPO.js} +1 -1
- package/dist/{pre-edit-IOWNUOZY.js → pre-edit-HJVNM7U5.js} +1 -1
- package/dist/{pre-edit-watch-gate-N7FI5HBA.js → pre-edit-watch-gate-G6BVWIDL.js} +1 -1
- package/dist/{prompt-submit-ZU466ET5.js → prompt-submit-OXYVNXHK.js} +1 -1
- package/dist/status-XUIBJXNP.js +4 -0
- package/dist/{stop-enforce-4UUK36YU.js → stop-enforce-BP6IIW3D.js} +1 -1
- package/package.json +5 -5
- package/dist/chunk-NIC2DOQW.js +0 -51
- package/dist/chunk-PVRM4YWS.js +0 -83
- package/dist/daemon-ZUDQ7ERI.js +0 -152
- package/dist/post-edit-analyze-6V5YI3CR.js +0 -4
- package/dist/status-OSHZ3JGU.js +0 -4
|
@@ -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-BTIQ5H3K.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-F4UCCW7Q.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,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{D as i,e as t}from"./chunk-
|
|
4
|
+
import{D as i,e as t}from"./chunk-F4UCCW7Q.js";function f(e){switch(e.kind){case"already-running":return`ripplo daemon: daemon already running (socket ${e.socketPath}).`;case"bind-failed":return`ripplo daemon: failed to bind IPC socket: ${e.message}`}}function g({projectId:e,serverUrl:n}){return[`Project "${e}" (from .ripplo/project.json) was not found on ${n}, or this account does not have access to it.`,"Run `npx ripplo projects list` to see your projects, then update .ripplo/project.json (or re-run `npx ripplo init --project <id>`)."].join(`
|
|
5
5
|
`)}function h(){return"Not signed in. Run `npx ripplo auth login`, then start the daemon again."}function x({devSessionId:e,version:n}){return`ripplo daemon: v${n} ready as local executor for session ${e} (switch with \`npx ripplo executor cloud\` \u2014 Ctrl-C to stop)`}function k({cwd:e,pid:n}){return`ripplo daemon: another daemon is already running for this project${n==null?"":` (pid ${String(n)})`} (cwd ${e}) \u2014 this one is exiting. Run \`npx ripplo daemon status\` to inspect it, or \`npx ripplo daemon stop\` to stop it.`}function w(e){switch(e.kind){case"not-running":return"ripplo daemon: not running.";case"stopped":return`ripplo daemon: stopped (pid ${String(e.pid)}).`;case"timeout":return`ripplo daemon: pid ${String(e.pid)} did not exit within 10s \u2014 it may be finishing a run. Check again with \`npx ripplo daemon status\`.`}}function y(){return"ripplo daemon: lock compromised \u2014 another daemon likely took over this project. Shutting down."}function $(e){if(e.kind==="not-running")return"daemon: not running";if(e.kind==="unresponsive")return`daemon: running but no reply within ${String(e.timeoutMs/1e3)}s \u2014 likely busy executing runs, retry when the batch drains`;let{status:n}=e,r=n.version==null?"version unknown (pre-0.7.8)":`v${n.version}`,s=`${String(n.active)} active, ${String(n.queued)} queued`,a=l(n.explorer,n.exploring),o=`daemon: running (${r} | ${s} | ${a} | ${p(n.progress)})`;if(n.sseHealth!=null&&!n.sseHealth.ok){let d=n.sseHealth.detail==null?"":`: ${n.sseHealth.detail}`;return`${o}
|
|
6
6
|
daemon: cannot subscribe to run dispatch${d} \u2014 server-side, restarting the daemon will not help`}return o}function p(e){return e.attempts===0?"explore: idle":`explore: ${String(e.attempts)} attempts, ${String(e.findings)} findings`}function b(e){let n=e.daemonVersion==null?"an older build":`v${e.daemonVersion}`;return e.kind==="restarted"?`ripplo: daemon was on ${n} \u2014 restarted on the current build`:`ripplo: daemon is on a stale build (${n}) with runs in flight \u2014 rerun once it drains, or npx ripplo daemon restart`}function S(e){switch(e.kind){case"pass":return{kind:"pass"};case"findings":return{findingLines:e.contradictions.map(n=>i({contradiction:n,evidencePath:`.ripplo/debug/${e.runId}/behavior.jsonl`})),kind:"findings"};case"error":return{detail:t(e.error),kind:"error"};case"dispatch-failed":return{kind:"dispatch-error",reason:{detail:e.reason,type:"generic"}}}}function l(e,n){switch(e.kind){case"off":return"explorer: off";case"on":return`explorer: on, ${String(n)} exploring`;case"paused":return`explorer: ${u(e.reason)}`;case"waiting":return"explorer: waiting for more workflow coverage \u2014 run npx ripplo explore analyze";case"blocked":return`explorer: blocked \u2014 ${c(e.reason)}`}}function u(e){return e==="interactive-runs"?"paused while your runs execute \u2014 resumes when they finish":e==="loading"?"paused while the model loads":"paused for a short cooldown \u2014 resumes on its own"}function c(e){switch(e){case"no-lockfile":return"no lockfile found, run npx ripplo compile";case"unstamped":return"lockfile has no compiled checks, run npx ripplo compile";case"dsl-drift":return"workflow sources changed since the last compile, run npx ripplo compile";case"load-failed":return"workflow definitions do not compile, run npx ripplo compile for details";case"model-empty":return"no workflow interactions can be explored, run npx ripplo explore analyze"}}export{f as a,g as b,h as c,x as d,k as e,w as f,y as g,$ as h,p as i,b as j,S as k};
|
|
@@ -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 n}from"./chunk-7WZ3VIUU.js";import{f as r}from"./chunk-KH4QH23U.js";var m=async o=>{if(o.permission_mode!=="plan"||!n(o.cwd)||!r(o.cwd))return;let{loadRipplo:s}=await import("./dsl-loader-
|
|
4
|
+
import{a as n}from"./chunk-7WZ3VIUU.js";import{f as r}from"./chunk-KH4QH23U.js";var m=async o=>{if(o.permission_mode!=="plan"||!n(o.cwd)||!r(o.cwd))return;let{loadRipplo:s}=await import("./dsl-loader-ASNZDV7E.js"),{stubbedWorkflows:a}=await import("./compile-write-Y5III4OM.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};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __ripploCreateRequire } from "node:module";
|
|
3
3
|
const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
|
|
4
|
-
import{g as m}from"./chunk-
|
|
4
|
+
import{g as m}from"./chunk-IRT6UHD3.js";import{a as f,c as k}from"./chunk-NUBMOTH6.js";import{a as h}from"./chunk-OQ6KNYPG.js";import{a as y}from"./chunk-RXLDAR2J.js";import{a as s}from"./chunk-MHNGR6M7.js";import{h as d,i as p}from"./chunk-BTIQ5H3K.js";import{o as u}from"./chunk-F4UCCW7Q.js";import{a as c}from"./chunk-7WZ3VIUU.js";import{f as l}from"./chunk-KH4QH23U.js";import*as a from"zod/mini";var S=a.looseObject({file_path:a.string()}),H=async e=>{let n=S.safeParse(e.tool_input);if(!n.success||!/\/\.ripplo\/.*\.ts$/.test(n.data.file_path))return;let{cwd:o}=e;if(!c(o))return;if(!l(o))return{hookSpecificOutput:{additionalContext:"Ripplo hooks are paused \u2014 DSL compile and lockfile sync did not run for this edit. Resume with `npx ripplo hooks resume` when ready.",hookEventName:"PostToolUse"}};let r=await d(o);if(r.isErr())return{decision:"block",reason:`${y(r.error)}
|
|
5
5
|
${s("create","DSL authoring rules")}`};let t=await b({cwd:o,filePath:n.data.file_path,lockfile:r.value});if("block"in t)return{decision:"block",reason:t.block};let{addedSlugs:i}=await m({cwd:o,editedPath:n.data.file_path,lockfile:r.value,requireHooks:!0,syncFirst:!0});return z(P({addedSlugs:i,elsewhere:t.elsewhere}))};function P({addedSlugs:e,elsewhere:n}){return[...e.length>0?[`Auto-scoped ${e.join(", ")} (dirty tests).`]:[],...n>0?[g(n).trimStart()]:[]]}async function b({cwd:e,filePath:n,lockfile:o}){let r=f({cwd:e,lockfile:o});await p(e,o);let t=A(r,o,n),i=r.length-t.length;return t.length===0?{elsewhere:i}:{block:`${k(t)}${g(i)}
|
|
6
6
|
${s("create")}`}}function A(e,n,o){let r=new Set(u(n).filter(({workflow:t})=>t.sourcePath!=null&&o.endsWith(t.sourcePath)).map(({ref:t})=>t));return r.size===0?e:e.filter(t=>{let i=w(t);return i==null||r.has(i)})}function w(e){return e.kind==="unreachable-interaction"?e.violation.test:e.kind==="redundant-assertion"?e.redundancy.test:e.kind==="undecided-action-consequence"?e.consequence.test:null}function g(e){return e===0?"":`
|
|
7
7
|
${h(e,"finding")} in other files \u2014 \`npx ripplo compile\` for the full list.`}function z(e){if(e.length!==0)return{hookSpecificOutput:{additionalContext:e.join(`
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __ripploCreateRequire } from "node:module";
|
|
3
3
|
const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
|
|
4
|
-
import{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-5JXP37ET.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(`
|
|
@@ -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-5JXP37ET.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,b,c}from"./chunk-
|
|
4
|
+
import{a,b,c}from"./chunk-EYILCSW6.js";import"./chunk-RXLDAR2J.js";import"./chunk-MHNGR6M7.js";import"./chunk-5JXP37ET.js";import"./chunk-KOZTQJBB.js";import"./chunk-KMZ3L5YA.js";export{b as renderCliFailure,c as renderHookCrash,a as renderTopLevelError};
|
|
@@ -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{h as a,i as b,j as c,k as d,l as e,m as f}from"./chunk-
|
|
4
|
+
import{h as a,i as b,j as c,k as d,l as e,m as f}from"./chunk-BTIQ5H3K.js";import"./chunk-F4UCCW7Q.js";import"./chunk-5JXP37ET.js";import"./chunk-KOZTQJBB.js";import"./chunk-NNH3YVVO.js";import"./chunk-KMZ3L5YA.js";export{a as compileAndWrite,f as lockfileModelStatus,c as stampedLockfile,d as stampedLockfileFromDisk,e as stubbedWorkflows,b as writeStampedLockfile};
|
|
@@ -0,0 +1,175 @@
|
|
|
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 rr,C as nr,D as q,H as or,I as tr,J as ir,K as ar,M as sr,N as lr,P as K,Q as H,R as dr,S as cr,T as Q,e as Oe,i as _e,j as Ge,k as Ne,l as ze,m as Be,o as Ke,p as Qe,q as Je,r as Ve,s as Xe,u as A,v as L,w as Ye,x as B,y as Ze,z as er}from"./chunk-IVW5DUE4.js";import{a as We,b as Me,c as $e,d as Ue,e as Fe,g as je}from"./chunk-O4A5UISQ.js";import{d as qe}from"./chunk-ANAQCK5G.js";import{b as He}from"./chunk-EYILCSW6.js";import{a as De,c as Ae,d as Le,e as h}from"./chunk-IRT6UHD3.js";import{a as D}from"./chunk-RXLDAR2J.js";import{c as m}from"./chunk-JS3DLVVI.js";import{a as se}from"./chunk-R4ZTRVDQ.js";import{c as ae}from"./chunk-FEHVIHVA.js";import"./chunk-MHNGR6M7.js";import{j as Ce,k as C}from"./chunk-BTIQ5H3K.js";import{H as ve,J as we,K as xe,N as T,O as be,P as Re,S as Pe,T as Ee,Y as Ie,ba as Te,n as ke}from"./chunk-F4UCCW7Q.js";import{k as S,l as he,m as I}from"./chunk-5JXP37ET.js";import{Ma as Se,U as ye,sa as ge}from"./chunk-KOZTQJBB.js";import{e as me}from"./chunk-KH4QH23U.js";import{e as pe,f as fe}from"./chunk-RIASQHPG.js";import{a as le,c as de,d as p,f as s,g as ce,h as z,i as ue}from"./chunk-C7SV6AR2.js";import"./chunk-HEOMRXZE.js";import"./chunk-NNH3YVVO.js";import"./chunk-KMZ3L5YA.js";import{randomUUID as Ut}from"crypto";import Ft from"path";import{createClient as jt}from"graphql-sse";import _t,{AbortError as Gt}from"p-retry";import{graphql as vn}from"gql.tada";import{graphql as Tn}from"gql.tada";import{print as Cn}from"graphql";async function ur({config:e,cwd:r,headed:n,pool:o,runId:t,signal:i,testSlug:a,workClass:l,workflowSlug:d}){let c=await S(r);if(c.isErr())return await q({config:e,ownerToken:null,reason:`lockfile:${c.error.kind}`,runId:t}),{kind:"dispatch-error",reason:{detail:`lockfile:${c.error.kind}`,type:"generic"}};let u=In(c.value,{testSlug:a,workflowSlug:d});if(u==null)return await q({config:e,ownerToken:null,reason:`no-test:${d}/${a}`,runId:t}),{kind:"dispatch-error",reason:{detail:`no-test:${d}/${a}`,type:"generic"}};let f=await A({headed:n,workClass:l,task:()=>o.execute({headed:n,runId:t,testRef:u},i)});return!f.serverNotified&&f.outcome.kind==="error"&&await q({config:e,ownerToken:null,reason:f.outcome.detail,runId:t}),f.outcome}function In(e,{testSlug:r,workflowSlug:n}){let t=e.workflows.find(i=>Se(i.name)===n)?.tests.find(i=>i.slug===r);return t==null?void 0:ke(t)}var Dn=6e4,An=Tn(`
|
|
5
|
+
subscription RunRequestedWatch($devSessionId: String!) {
|
|
6
|
+
runRequested(devSessionId: $devSessionId) {
|
|
7
|
+
runId
|
|
8
|
+
testSlug
|
|
9
|
+
workflowId
|
|
10
|
+
workflowSlug
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
`);async function pr(e){let r=Math.min(1e3*2**e,Dn)+Wn();await new Promise(n=>setTimeout(n,r))}function fr({claim:e,cwd:r,devSessionId:n,pool:o,sseClient:t,sseHealth:i}){let a=new Set,l=qn(r);return t.subscribe({query:Cn(An),variables:{devSessionId:n}},{complete:Ln,error:d=>{let c=d instanceof Error?d.message:String(d);i.markUnhealthy(c),s.error({err:d},"runRequested subscription failed")},next:d=>{Hn({claim:e,dispatchConfig:l,event:d.data?.runRequested,inFlightRunIds:a,pool:o})}},{connected:()=>{i.onConnected()},connecting:d=>{i.onConnecting(d),d&&s.debug("runRequested SSE reconnecting")}})}function Ln(){}function qn(e){return ae(e),{config:m(e).match(r=>r,r=>{s.error({failure:r},"failed to load env for run dispatch")}),cwd:e}}function Hn({claim:e,dispatchConfig:r,event:n,inFlightRunIds:o,pool:t}){if(n==null)return;if(o.has(n.runId)){s.warn({runId:n.runId,workflowSlug:n.workflowSlug},"duplicate runRequested event; skipping dispatch");return}if(r.config==null){s.error({runId:n.runId},"run dispatch skipped, env failed to load at startup");return}o.add(n.runId),process.stdout.write(`ripplo: run ${n.workflowSlug}
|
|
14
|
+
`);let i=On(e(n.runId),n);i.started(),ur({config:r.config,cwd:r.cwd,headed:i.headed,pool:t,runId:n.runId,signal:i.signal,testSlug:n.testSlug,workClass:i.workClass,workflowSlug:n.workflowSlug}).then(a=>{i.finished(a)}).catch(a=>{s.error({err:a,runId:n.runId,workflowSlug:n.workflowSlug},"run execution failed; daemon continuing"),i.finished({detail:a instanceof Error?a.message:String(a),kind:"error"})}).finally(()=>{o.delete(n.runId)})}function On(e,r){return e==null?(s.debug({runId:r.runId,workflowSlug:r.workflowSlug},"dispatching unclaimed run (externally triggered or replayed)"),{headed:!1,signal:new AbortController().signal,workClass:"p0-ui",finished:()=>{},started:()=>{}}):{headed:e.headed,signal:er(e.token),workClass:"p1-cli",finished:n=>{e.finished(r.runId,n)},started:()=>{e.started(r.runId)}}}function Wn(){return Math.floor(Math.random()*2700)+300}import{graphql as k}from"gql.tada";import{print as mr}from"graphql";import{clearTimeout as $n,setTimeout as Un}from"timers";var Fn=k(`
|
|
15
|
+
subscription TeleportRequestedWatch($devSessionId: String!) {
|
|
16
|
+
teleportRequested(devSessionId: $devSessionId) {
|
|
17
|
+
runId
|
|
18
|
+
stepIndex
|
|
19
|
+
kind
|
|
20
|
+
testSlug
|
|
21
|
+
workflowSlug
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
`),jn=k(`
|
|
25
|
+
subscription DurableTeleportRequestedWatch($devSessionId: String!) {
|
|
26
|
+
durableTeleportRequested(devSessionId: $devSessionId) {
|
|
27
|
+
requestId
|
|
28
|
+
runId
|
|
29
|
+
stepIndex
|
|
30
|
+
kind
|
|
31
|
+
testSlug
|
|
32
|
+
workflowSlug
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
`),_n=k(`
|
|
36
|
+
query TeleportRunRepro($id: String!) {
|
|
37
|
+
run(id: $id) {
|
|
38
|
+
id
|
|
39
|
+
reproJson
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
`),Gn=k(`
|
|
43
|
+
mutation ReportTeleportResult($devSessionId: String!, $runId: String!, $status: String!) {
|
|
44
|
+
reportTeleportResult(devSessionId: $devSessionId, runId: $runId, status: $status)
|
|
45
|
+
}
|
|
46
|
+
`),Nn=k(`
|
|
47
|
+
mutation ClaimTeleportRequest($devSessionId: String!, $requestId: String!) {
|
|
48
|
+
claimTeleportRequest(devSessionId: $devSessionId, requestId: $requestId)
|
|
49
|
+
}
|
|
50
|
+
`),zn=k(`
|
|
51
|
+
mutation ReportDurableTeleportResult(
|
|
52
|
+
$devSessionId: String!
|
|
53
|
+
$requestId: String!
|
|
54
|
+
$status: TeleportOutcome!
|
|
55
|
+
) {
|
|
56
|
+
reportDurableTeleportResult(devSessionId: $devSessionId, requestId: $requestId, status: $status)
|
|
57
|
+
}
|
|
58
|
+
`);function yr({cwd:e,devSessionId:r,sseClient:n}){let o=new Set,t=Bn({cwd:e,devSessionId:r,running:o,sseClient:n}),i=Kn({cwd:e,devSessionId:r,running:o,sseClient:n});return()=>{o.forEach(a=>{a.abort()}),o.clear(),t(),i()}}function Bn({cwd:e,devSessionId:r,running:n,sseClient:o}){return o.subscribe({query:mr(Fn),variables:{devSessionId:r}},{complete:gr,error:t=>{s.error({err:t},"teleportRequested subscription failed")},next:t=>{let i=t.data?.teleportRequested;Sr({cwd:e,devSessionId:r,event:i==null?i:{...i,requestId:void 0},running:n})}})}function gr(){}function Kn({cwd:e,devSessionId:r,running:n,sseClient:o}){return o.subscribe({query:mr(jn),variables:{devSessionId:r}},{complete:gr,error:t=>{s.error({err:t},"durableTeleportRequested subscription failed")},next:t=>{Sr({cwd:e,devSessionId:r,event:t.data?.durableTeleportRequested,running:n})}})}function Sr({cwd:e,devSessionId:r,event:n,running:o}){if(n==null)return;let t=new AbortController;o.add(t),Qn({cwd:e,devSessionId:r,event:n,signal:t.signal}).catch(i=>{s.error({err:i},"teleport failed; daemon continuing")}).finally(()=>{o.delete(t)})}async function Qn({cwd:e,devSessionId:r,event:n,signal:o}){n.requestId!=null&&!await Xn({cwd:e,devSessionId:r,requestId:n.requestId})||await Jn({cwd:e,devSessionId:r,event:n,signal:o})}async function Jn({cwd:e,devSessionId:r,event:n,signal:o}){let t=c=>Vn({cwd:e,devSessionId:r,requestId:n.requestId,runId:n.runId,status:c}),i=oo(o),a=await eo({cwd:e,event:n});if(a==null){i.clear(),s.warn({runId:n.runId},"teleport could not resolve target"),await t("unplannable");return}process.stdout.write(`ripplo: teleport ${no(n)} step ${String(n.stepIndex+1)}
|
|
59
|
+
`);let d=await sr({cwd:e,onReady:()=>{i.clear(),t("opened")},signal:i.signal,step:n.stepIndex+1,target:a});i.clear(),!(d.kind==="done"&&d.result.kind==="handed-over")&&(s.warn({kind:d.kind,runId:n.runId},"teleport could not open"),await t(d.kind==="unplannable"?"unplannable":"error"))}async function Vn({cwd:e,devSessionId:r,requestId:n,runId:o,status:t}){if(n!=null){await Zn({cwd:e,devSessionId:r,requestId:n,status:t});return}await Yn({cwd:e,devSessionId:r,runId:o,status:t})}async function Xn({cwd:e,devSessionId:r,requestId:n}){let o=m(e).match(i=>i,()=>null);return o==null?!1:(await p({config:o,document:Nn,variables:{devSessionId:r,requestId:n}}).catch(()=>null))?.claimTeleportRequest===!0}async function Yn({cwd:e,devSessionId:r,runId:n,status:o}){let t=m(e).match(i=>i,()=>null);t!=null&&await p({config:t,document:Gn,variables:{devSessionId:r,runId:n,status:o}}).catch(()=>null)}async function Zn({cwd:e,devSessionId:r,requestId:n,status:o}){let t=m(e).match(i=>i,()=>null);t!=null&&await p({config:t,document:zn,variables:{devSessionId:r,requestId:n,status:o}}).catch(()=>null)}async function eo({cwd:e,event:r}){if(r.kind==="explore"){let n=await ro({cwd:e,runId:r.runId});return n==null?null:{kind:"explore",repro:n}}return r.testSlug==null||r.workflowSlug==null?null:{kind:"test",ref:`${r.workflowSlug}/${r.testSlug}`}}async function ro({cwd:e,runId:r}){let n=m(e).match(i=>i,()=>null);if(n==null)return null;let o=await p({config:n,document:_n,variables:{id:r}}).catch(()=>null);if(o?.run?.reproJson==null)return null;let t=T(o.run.reproJson);return t.kind==="valid"?t.repro:null}function no(e){return e.kind==="explore"?"explore finding":`${String(e.workflowSlug)}/${String(e.testSlug)}`}function oo(e){let r=new AbortController,n=Un(()=>{r.abort()},3e4);return{signal:AbortSignal.any([e,r.signal]),clear:()=>{$n(n)}}}import O from"fs";import to from"p-retry";import{graphql as b}from"gql.tada";import{print as M}from"graphql";var io=b(`
|
|
60
|
+
query DaemonExploration($devSessionId: String!) {
|
|
61
|
+
exploration(devSessionId: $devSessionId) {
|
|
62
|
+
active
|
|
63
|
+
localWorkers
|
|
64
|
+
maxTrailLength
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
`),ao=b(`
|
|
68
|
+
subscription WatchExplorationChanged($devSessionId: String!) {
|
|
69
|
+
explorationChanged(devSessionId: $devSessionId) {
|
|
70
|
+
exploration {
|
|
71
|
+
active
|
|
72
|
+
localWorkers
|
|
73
|
+
maxTrailLength
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
`);function hr({config:e,devSessionId:r,exploration:n,lifetime:o,sseClient:t}){return to(()=>so({config:e,devSessionId:r,exploration:n,lifetime:o}),{factor:2,minTimeout:500,retries:6}).catch(i=>{s.warn({err:i},"initial exploration state read failed \u2014 explorer stays off")}),t.subscribe({query:M(ao),variables:{devSessionId:r}},{complete:U,error:i=>{$({error:i,stream:"explorationChanged"})},next:i=>{kr(n,i.data?.explorationChanged.exploration)}})}async function so({config:e,devSessionId:r,exploration:n,lifetime:o}){if(W(o))return;let t=await p({config:e,document:io,variables:{devSessionId:r}});W(o)||kr(n,t.exploration)}function kr(e,r){r!=null&&e.setDesired({active:r.active,localWorkers:r.localWorkers,maxTrailLength:r.maxTrailLength})}var lo=b(`
|
|
78
|
+
subscription HooksPausedWatch($projectId: String!) {
|
|
79
|
+
hooksPausedRequested(projectId: $projectId) {
|
|
80
|
+
paused
|
|
81
|
+
projectId
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
`),co=b(`
|
|
85
|
+
subscription WatchLocalConcurrencyChanged {
|
|
86
|
+
myMaxLocalConcurrentRunsChanged
|
|
87
|
+
}
|
|
88
|
+
`);function vr({pool:e,sseClient:r}){return r.subscribe({query:M(co)},{complete:U,error:n=>{$({error:n,stream:"myMaxLocalConcurrentRunsChanged"})},next:n=>{let o=n.data?.myMaxLocalConcurrentRunsChanged;o!=null&&(L(o),e.setSize(o))}})}var uo=b(`
|
|
89
|
+
subscription WatchExecutorChangeRequested($devSessionId: String!) {
|
|
90
|
+
executorChangeRequested(devSessionId: $devSessionId) {
|
|
91
|
+
executor
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
`);function wr({config:e,devSessionId:r,lifetime:n,sseClient:o,switcher:t}){return t.connect(r),po({config:e,lifetime:n,switcher:t}),fo({devSessionId:r,sseClient:o,switcher:t})}async function po({config:e,lifetime:r,switcher:n}){if(W(r))return;let o=await lr(e);if(!W(r)){if(o.isErr()){s.warn({error:o.error},"initial executor fetch failed, staying local");return}n.request(o.value)}}function W(e){return e.aborted}function fo({devSessionId:e,sseClient:r,switcher:n}){return r.subscribe({query:M(uo),variables:{devSessionId:e}},{complete:U,error:o=>{$({error:o,stream:"executorChangeRequested"})},next:o=>{let t=o.data?.executorChangeRequested?.executor;t!=null&&n.request(t)}})}function xr({cwd:e,projectId:r,sseClient:n}){return n.subscribe({query:M(lo),variables:{projectId:r}},{complete:U,error:o=>{$({error:o,stream:"hooksPausedRequested"})},next:o=>{let t=o.data?.hooksPausedRequested?.paused;t!=null&&R({cwd:e,paused:t})}})}function $({error:e,stream:r}){s.error({error:e},"%s subscription failed",r)}function U(){}function R({cwd:e,paused:r}){let n=me(e);if(r&&!O.existsSync(n)){O.writeFileSync(n,"");return}!r&&O.existsSync(n)&&O.unlinkSync(n)}function br({initialId:e,onSynchronized:r,subscribe:n,synchronize:o}){let t=e,i=null,a=!1,l=d();function d(){let f=new AbortController,y=n({devSessionId:t,lifetime:f.signal});return()=>{f.abort(),y()}}async function c(f){let y=await o(f);y==null||a||(l(),t=y.devSessionId,r(y),l=d())}function u(f){return a?Promise.resolve():(i!=null||(i=c(f).finally(()=>{i=null})),i)}return{getId:()=>t,reregister:()=>u("dev session ended server-side"),stop:()=>{a||(a=!0,l())}}}function Rr({claim:e,config:r,devSessionId:n,executorSwitch:o,exploration:t,onSynchronized:i,pool:a,sseClient:l,sseHealth:d}){return br({initialId:n,onSynchronized:c=>{i(c),R({cwd:r.cwd,paused:c.hooksPaused})},subscribe:({devSessionId:c,lifetime:u})=>mo({claim:e,config:r,devSessionId:c,executorSwitch:o,exploration:t,lifetime:u,pool:a,sseClient:l,sseHealth:d}),synchronize:c=>yo({config:r,reason:c,sseHealth:d})})}function mo({claim:e,config:r,devSessionId:n,executorSwitch:o,exploration:t,lifetime:i,pool:a,sseClient:l,sseHealth:d}){let c=[wr({config:r,devSessionId:n,lifetime:i,sseClient:l,switcher:o}),xr({cwd:r.cwd,projectId:r.projectId,sseClient:l}),vr({pool:a,sseClient:l}),hr({config:r,devSessionId:n,exploration:t,lifetime:i,sseClient:l}),fr({claim:e,cwd:r.cwd,devSessionId:n,pool:a,sseClient:l,sseHealth:d}),yr({cwd:r.cwd,devSessionId:n,sseClient:l})];return()=>{c.forEach(u=>{u()})}}async function yo({config:e,reason:r,sseHealth:n}){n.markUnhealthy(r);let o=await I(e.cwd);return o.isErr()?(s.error("re-register: compile failed: %s",D(o.error)),null):Ae({config:e,cwd:e.cwd,lockfile:o.value})}import{createHash as go}from"crypto";import Pr from"fs";function Er(){return J===void 0&&(J=So()),J}var J;function So(){let e=process.argv[1];if(e==null)return null;try{let r=Pr.readFileSync(Pr.realpathSync(e));return go("sha256").update(r).digest("hex")}catch{return null}}import{graphql as Ir}from"gql.tada";var ho=Ir(`
|
|
95
|
+
query OpenFindingsForRetire($projectId: String!) {
|
|
96
|
+
exploreFindings(projectId: $projectId, status: open) {
|
|
97
|
+
signature
|
|
98
|
+
reproRun {
|
|
99
|
+
reproJson
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
`),ko=Ir(`
|
|
104
|
+
mutation RetireStaleFinding($projectId: String!, $signature: String!) {
|
|
105
|
+
retireStaleFinding(projectId: $projectId, signature: $signature)
|
|
106
|
+
}
|
|
107
|
+
`);async function Tr({config:e,cwd:r,lockfile:n}){let t=(await p({config:e,document:ho,variables:{projectId:e.projectId}})).exploreFindings,i=await C(r,n);if(i.isErr())return s.info({block:i.error.kind},"skipping finding retire until next compile"),!1;let a=vo(t,i.value);return a.length===0||(await Promise.all(a.map(l=>xo(e,l))),s.info({count:a.length},"retired findings whose trail no longer replays")),!0}function vo(e,r){return e.map(n=>wo(n,r)?n.signature:null).filter(n=>n!=null)}function wo(e,r){let n=e.reproRun?.reproJson;if(n==null)return!0;let o=T(n);return o.kind==="rejected"?!0:Te(r,o.repro).kind==="unplannable"}function xo(e,r){return p({config:e,document:ko,variables:{projectId:e.projectId,signature:r}})}var bo=6e4;function Cr(e){let r={retiredKey:null,running:!1,stopped:!1},n=async()=>{if(!(r.running||r.stopped)){r.running=!0;try{r.retiredKey=await Ro(e,r.retiredKey)}catch(t){s.warn({err:t},"retire stale findings failed \u2014 retrying on next tick")}finally{r.running=!1}}},o={timer:setTimeout(function t(){n(),r.stopped||(o.timer=setTimeout(t,bo))},0)};return()=>{r.stopped=!0,clearTimeout(o.timer)}}async function Ro({config:e,cwd:r},n){let o=await h(r),t=Er();if(o==null||t==null)return n;let i=`${o}@${t}`;if(i===n)return n;let a=await S(r);return a.isErr()?n:await Tr({config:e,cwd:r,lockfile:a.value})?i:n}import{Agent as Po,fetch as Eo}from"undici";var Io=3e4;function Dr(e=Io){let r=new Po({bodyTimeout:e});return(n,o)=>Eo(n,{...o,dispatcher:r})}function Ar(){let e=!0,r,n=null,o=()=>{n!=null&&(clearTimeout(n),n=null)};return{markUnhealthy:t=>{e=!1,r=t,o()},onConnected:()=>{o(),n=setTimeout(()=>{e=!0,r=void 0,n=null},1e4)},onConnecting:()=>{o()},snapshot:()=>({detail:r,ok:e})}}import To from"fs";import Or from"net";import{err as Wr,ok as Co}from"neverthrow";async function Mr({cwd:e,onConnection:r}){ue(e);let n=qe(e),o=await Lr({onConnection:r,socketPath:n});return o.isOk()||o.error.kind!=="stale-candidate"?o.map(qr(n)).mapErr(Hr(n)):await Do(n)?Wr({kind:"already-running",socketPath:n}):($r(n),(await Lr({onConnection:r,socketPath:n})).map(qr(n)).mapErr(Hr(n)))}function Do(e){return new Promise(r=>{let n=Or.connect(e);n.once("connect",()=>{n.destroy(),r(!0)}),n.once("error",()=>{r(!1)})})}async function Lr(e){let r=await Ao(e);return r.kind==="listening"?Co(r.server):Wr(r.error)}function Ao({onConnection:e,socketPath:r}){return new Promise(n=>{let o=Or.createServer(e);o.once("error",t=>{n({error:t.code==="EADDRINUSE"?{kind:"stale-candidate"}:{kind:"listen-failed",message:t.message},kind:"failed"})}),o.listen(r,()=>{n({kind:"listening",server:o})})})}function qr(e){return r=>({socketPath:e,close:()=>{r.close(),$r(e)}})}function $r(e){To.rmSync(e,{force:!0})}function Hr(e){return r=>r.kind==="stale-candidate"?{kind:"already-running",socketPath:e}:{kind:"bind-failed",message:r.message}}import{randomUUID as No}from"crypto";function Ur(){return{attempts:0,backoffUntil:0,consecutiveErrors:0,coverageWaiting:!1,desired:{active:!1,localWorkers:dr,maxTrailLength:cr},executorLocal:!0,findings:0,lastUnhealthyReportAt:null,loading:!1,lockfile:{kind:"loading"},prevInteractiveActive:0,stopped:!1,trails:new Map}}function Fr(e,r){if(e.stopped)return{effects:[],state:e};switch(r.kind){case"tick":return V(e,r.now,r.queue);case"desired-changed":return V({...e,desired:r.desired},r.now,r.queue);case"executor-changed":return{effects:[],state:{...e,executorLocal:r.local}};case"load-settled":return Wo(e,r.outcome);case"trail-started":return{effects:[],state:{...e,coverageWaiting:!1,trails:new Map([...e.trails,[r.id,{startedAt:r.now}]])}};case"trail-settled":return Mo(e,r);case"stopped":return{effects:[{ids:[...e.trails.keys()],kind:"abort"}],state:{...e,stopped:!0,trails:new Map}}}}function jr(e,r,n){return Q(_r(e),Gr(e,r,n)).health}function V(e,r,n){let o=Oo(e,r,n),t={...e,...o,prevInteractiveActive:n.active},i=Q(_r(t),Gr(t,r,n)),a=t.lockfile.kind!=="ready"&&!t.loading;return{effects:[...Lo(a),...qo(i.abortIds),...Ho({count:i.launchCount,maxTrailLength:t.desired.maxTrailLength})],state:{...t,loading:t.loading||a}}}function Lo(e){return e?[{kind:"load"}]:[]}function qo(e){return e.length>0?[{ids:e,kind:"abort"}]:[]}function Ho({count:e,maxTrailLength:r}){return e>0?[{count:e,kind:"launch",maxTrailLength:r}]:[]}function Oo(e,r,n){return n.active<e.prevInteractiveActive?{backoffUntil:Math.max(e.backoffUntil,r+H)}:{backoffUntil:e.backoffUntil}}function Wo(e,r){return r.kind==="blocked"?{effects:[],state:{...e,loading:!1,lockfile:{kind:"blocked",reason:r.reason}}}:{effects:[],state:{...e,consecutiveErrors:0,coverageWaiting:!1,lastUnhealthyReportAt:null,loading:!1,lockfile:{kind:"ready"}}}}function Mo(e,r){let n=new Map([...e.trails].filter(([i])=>i!==r.id)),o=$o({...e,trails:n},r.settled,r.now),t=V(o.state,r.now,r.queue);return{effects:[...o.effects,...t.effects],state:t.state}}function $o(e,r,n){switch(r.kind){case"aborted":return{effects:[],state:e};case"crashed":return X({now:n,state:e,subject:`exploration ${r.stage} crashed`});case"no-candidate":return{effects:[],state:{...e,backoffUntil:Math.max(e.backoffUntil,n+H),consecutiveErrors:0,coverageWaiting:xe(r.reason)}};case"app-unreachable":return X({now:n,state:e,subject:"app-unreachable"});case"error":return Uo(e,r.error,n);case"done":return jo(e,r.result)}}function Uo(e,r,n){return r.source==="lockfile-stale"?{effects:[{kind:"reload"}],state:{...e,loading:!0,lockfile:{kind:"loading"}}}:be(r)==="trail"?{effects:[],state:{...e,consecutiveErrors:0,lastUnhealthyReportAt:null}}:X({now:n,state:e,subject:Fo(r)})}function Fo(e){switch(e.source){case"transport":case"config":return`${e.source}: ${e.detail}`;case"runtime":return`runtime: ${e.detail}`;case"empty-trail":case"assignment-rejected":case"lockfile-stale":return e.source}}function jo(e,r){let n=r.kind==="finding";return{effects:[{finding:n,kind:"report",result:r}],state:{...e,attempts:e.attempts+1,consecutiveErrors:0,findings:e.findings+(n?1:0),lastUnhealthyReportAt:null}}}var _o=6,Go=2e4;function X({now:e,state:r,subject:n}){let o=r.consecutiveErrors+1,t=Math.max(r.backoffUntil,e+H);if(o<_o)return{effects:[],state:{...r,backoffUntil:t,consecutiveErrors:o}};let i=r.lastUnhealthyReportAt==null||e-r.lastUnhealthyReportAt>=Go;return{effects:i?[{kind:"report-unhealthy",subject:n}]:[],state:{...r,backoffUntil:t,consecutiveErrors:o,lastUnhealthyReportAt:i?e:r.lastUnhealthyReportAt}}}function _r(e){return{enabled:e.desired.active,executorLocal:e.executorLocal,maxTrailLength:e.desired.maxTrailLength,workers:e.desired.localWorkers}}function Gr(e,r,n){return{backoffActive:r<e.backoffUntil,coverageWaiting:e.coverageWaiting,headedActive:n.headedActive>0,interactiveActive:n.active,interactiveQueued:n.queued,lockfile:e.lockfile,poolSize:n.poolSize,trails:[...e.trails.entries()].map(([o,t])=>({ageMs:r-t.startedAt,id:o}))}}function zr(e){let r=zo(e),n=Qo(()=>{r.dispatch(P())});return B(()=>{r.dispatch(P())}),r.dispatch(P()),{notifyQueueChange:()=>{r.dispatch({kind:"executor-changed",local:e.executorIsLocal()}),r.dispatch(P())},setDesired:o=>{r.dispatch({desired:o,kind:"desired-changed",now:Date.now(),queue:F()})},status:()=>Ko(r.current()),stop:()=>{n(),B(null),r.dispatch({kind:"stopped"})}}}function zo(e){let r={draining:!1,planning:Promise.resolve(),queue:[],runtime:Bo(e)},n=a=>{r.runtime=a(r.runtime)},o=a=>{r.queue.push(a),!r.draining&&(r.draining=!0,i(),r.draining=!1)},t=a=>{r.planning=r.planning.then(a,a)},i=()=>{let a=r.queue.shift();if(a==null)return;let l=Fr(r.runtime.state,a);n(d=>({...d,state:l.state})),l.effects.forEach(d=>{Jo({commit:n,dispatch:o,effect:d,params:e,queuePlanning:t,runtime:r.runtime,current:()=>r.runtime})}),i()};return{dispatch:o,current:()=>r.runtime}}function Bo(e){return{controllers:new Map,prepared:null,reservations:new Map,state:{...Ur(),executorLocal:e.executorIsLocal()}}}function Ko(e){return{explorer:jr(e.state,Date.now(),F()),exploring:e.state.trails.size,progress:{attempts:e.state.attempts,findings:e.state.findings}}}function F(){let e=Ye();return{active:e.active,headedActive:e.headedActive,poolSize:e.poolSize,queued:e.queued}}function P(){return{kind:"tick",now:Date.now(),queue:F()}}function Qo(e){let r={timer:setTimeout(function n(){e(),r.timer=setTimeout(n,K)},K)};return()=>{clearTimeout(r.timer)}}function Jo({commit:e,current:r,dispatch:n,effect:o,params:t,queuePlanning:i,runtime:a}){switch(o.kind){case"load":case"reload":{Xo(t.cwd,a.prepared).then(({outcome:l,prepared:d})=>{e(c=>({...c,prepared:d})),n({kind:"load-settled",now:Date.now(),outcome:l}),n(P())});return}case"abort":{o.ids.forEach(l=>{a.controllers.get(l)?.abort()});return}case"launch":{Array.from({length:o.count}).forEach(()=>{let l=Vo({commit:e,dispatch:n});i(()=>Zo({commit:e,controller:l.controller,dispatch:n,id:l.id,maxTrailLength:o.maxTrailLength,params:t,prepared:r().prepared,reservedSignatures:new Set(r().reservations.values())}))});return}case"report":{t.report({attempts:1,findings:o.finding?1:0,result:o.result}),o.finding&&s.info("exploration finding recorded");return}case"report-unhealthy":s.warn("exploration unhealthy after repeated infra errors (last: %s)",o.subject),t.reportUnhealthy()}}function Vo({commit:e,dispatch:r}){let n=`explore:${No()}`,o=new AbortController;return e(t=>({...t,controllers:new Map([...t.controllers,[n,o]])})),r({id:n,kind:"trail-started",now:Date.now()}),{controller:o,id:n}}async function Xo(e,r){try{return await Yo(e,r)}catch(n){return s.warn({err:n},"Explorer couldn't load the model \u2014 retrying on the next tick"),{outcome:{kind:"blocked",reason:"load-failed"},prepared:null}}}async function Yo(e,r){let n=await h(e);if(n==null)return{outcome:{kind:"blocked",reason:"no-lockfile"},prepared:null};if(r?.rawHash===n)return{outcome:{kind:"ready",rawHash:n},prepared:r};let{result:o}=await he(e);if(o.isErr())return{outcome:{kind:"blocked",reason:"load-failed"},prepared:null};let t=await C(e,o.value);if(t.isErr())return{outcome:{kind:"blocked",reason:t.error.kind},prepared:null};let i=Pe(t.value);return i.kind==="model-empty"?{outcome:{kind:"blocked",reason:"model-empty"},prepared:null}:{outcome:{kind:"ready",rawHash:n},prepared:{exploration:i.value,rawHash:n}}}async function Zo({commit:e,controller:r,dispatch:n,id:o,maxTrailLength:t,params:i,prepared:a,reservedSignatures:l}){if(Nr(r.signal)){v({commit:e,dispatch:n,id:o,settled:{kind:"aborted"}});return}if(a==null){v({commit:e,dispatch:n,id:o,settled:{kind:"crashed",stage:"planning"}});return}let d=await et({maxTrailLength:t,params:i,prepared:a,reservedSignatures:l}).catch(u=>(s.warn({err:u},"Explorer couldn't plan a trail \u2014 retrying shortly"),null));if(d==null){v({commit:e,dispatch:n,id:o,settled:{kind:"crashed",stage:"planning"}});return}if(Nr(r.signal)){v({commit:e,dispatch:n,id:o,settled:{kind:"aborted"}});return}if(i.onPlannerTrace?.(d),d.kind==="no-candidate"){v({commit:e,dispatch:n,id:o,settled:{kind:"no-candidate",reason:d.reason}});return}let c=d.assignment;e(u=>({...u,reservations:new Map([...u.reservations,[o,c.coverageSignature]])})),A({headed:!1,workClass:"p3-explore",task:()=>rt({assign:c,params:i,signal:r.signal})}).catch(u=>(s.warn({err:u},"Explorer couldn't run a trail \u2014 retrying shortly"),{kind:"crashed",stage:"execution"})).then(u=>{v({commit:e,dispatch:n,id:o,settled:u})})}function Nr(e){return e.aborted}async function et({maxTrailLength:e,params:r,prepared:n,reservedSignatures:o}){let t=Date.now(),i=await r.leaseOrdinal(),a=await Ee({attemptOrdinal:i,modelHash:n.rawHash,prepared:n.exploration,reservedSignatures:o,strategy:{...ve("even"),maxAttemptLength:e},targetGeneration:r.targetGeneration()});return s.debug({attemptOrdinal:i,beamMs:a.timing.beamMs,candidateMs:a.timing.candidateMs,candidates:a.trace.candidates,envelopesMs:a.timing.envelopesMs,expanded:a.trace.expanded,expansionMs:a.timing.expansionMs,kind:a.kind,planningMs:Date.now()-t,rejectedCycles:a.trace.rejectedCycles,rejectedReplays:a.trace.rejectedReplays,searchMs:a.timing.searchMs,selectionMs:a.timing.selectionMs,selectionTier:a.trace.selectionTier},"explorer planning completed"),a}function v({commit:e,dispatch:r,id:n,settled:o}){e(t=>({...t,controllers:new Map([...t.controllers].filter(([i])=>i!==n)),reservations:new Map([...t.reservations].filter(([i])=>i!==n))})),r({id:n,kind:"trail-settled",now:Date.now(),queue:F(),settled:o})}async function rt({assign:e,params:r,signal:n}){let o=await r.executeTrail(e,n);return o.kind==="aborted"?{kind:"aborted"}:o.kind==="error"?nt(r,o.error):{kind:"done",result:o}}async function nt(e,r){let n=await Oe(e.appUrl);return n!=null?(s.debug("exploration app probe failed: %s",n),{kind:"app-unreachable"}):(s.debug({error:r},"exploration trail error"),{error:r,kind:"error"})}import{graphql as ht}from"gql.tada";import{connect as tt}from"net";import it from"ssh2";import{WebSocket as Kr,createWebSocketStream as at}from"ws";var ot="ripplo-";function Y(e){return Object.entries(e).map(([r,n])=>`${ot}${r}.${n}`)}var{Server:st,utils:Br}=it;function Qr(){let e=Br.generateKeyPairSync("ed25519"),r=Br.parseKey(e.private);if(r instanceof Error)throw r;return{fingerprint:r.getPublicSSH().toString("base64"),privateKey:e.private}}function Jr(e){return new Promise((r,n)=>{let o={closers:new Set,stopped:!1},t=new Kr(e.relayUrl,Y({grant:e.grant,role:"daemon-control"}));t.on("open",()=>{s.info("cloud-executor relay control up"),r({stop:lt(t,o)})}),t.on("message",i=>{dt(e,o,i)}),t.on("close",(i,a)=>{o.stopped||s.warn({code:i,reason:a.toString()},"relay control closed"),St(e,o)}),t.on("error",i=>{n(i instanceof Error?i:new Error(String(i)))})})}function lt(e,r){return()=>(r.stopped=!0,r.closers.forEach(n=>{n()}),e.close(),Promise.resolve())}function dt(e,r,n){let o=ct(n);o!=null&&pt(e,r,o.pipeId)}function ct(e){try{let r=JSON.parse(ut(e));return typeof r=="object"&&r!=null&&"signal"in r&&r.signal==="open-data"&&"pipeId"in r&&typeof r.pipeId=="string"?{pipeId:r.pipeId}:null}catch{return null}}function ut(e){return Buffer.isBuffer(e)?e.toString("utf8"):Array.isArray(e)?Buffer.concat(e).toString("utf8"):Buffer.from(e).toString("utf8")}function pt(e,r,n){if(r.stopped)return;let o=new Kr(e.relayUrl,Y({pipeId:n,role:"daemon-data"}));o.on("open",()=>{ft(e,r,o)}),o.on("error",t=>{s.warn({err:t},"cloud-executor relay data pipe error")})}function ft(e,r,n){let o=at(n);o.on("error",()=>{});let t=new st({hostKeys:[e.hostKey.privateKey]},a=>{a.on("error",l=>{s.warn({err:l},"cloud-executor ssh connection error")}),a.on("authentication",l=>{yt(l,e.secret)}),a.on("ready",()=>{a.on("tcpip",(l,d,c)=>{gt({accept:l,allowedPorts:e.allowedPorts,deny:d,destPort:c.destPort})})})}),i=()=>{n.close()};r.closers.add(i),n.on("close",()=>r.closers.delete(i)),mt(t,o)}function mt(e,r){e.injectSocket(r)}function yt(e,r){if(e.method==="password"&&e.password===r){e.accept();return}if(e.method==="none"){e.reject(["password"]);return}e.reject()}function gt({accept:e,allowedPorts:r,deny:n,destPort:o}){if(!r.includes(o)){s.warn({allowedPorts:r,destPort:o},"cloud-executor relay refused an unexpected port"),n();return}let t=!1,i=tt({autoSelectFamily:!0,host:"localhost",port:o},()=>{t=!0;let a=e();a.on("error",()=>{}),i.pipe(a).pipe(i)});i.on("error",a=>{t||(s.warn({destPort:o,err:a},"cloud-executor relay could not reach the local app"),n())})}function St(e,r){r.stopped||(r.stopped=!0,r.closers.forEach(n=>{n()}),e.onFatal())}var kt=ht(`
|
|
108
|
+
mutation EnterCloudMode(
|
|
109
|
+
$devSessionId: String!
|
|
110
|
+
$localUrl: String!
|
|
111
|
+
$engineUrl: String!
|
|
112
|
+
$hostKeyFingerprint: String!
|
|
113
|
+
) {
|
|
114
|
+
enterCloudMode(
|
|
115
|
+
devSessionId: $devSessionId
|
|
116
|
+
localUrl: $localUrl
|
|
117
|
+
engineUrl: $engineUrl
|
|
118
|
+
hostKeyFingerprint: $hostKeyFingerprint
|
|
119
|
+
) {
|
|
120
|
+
__typename
|
|
121
|
+
... on RelaySession {
|
|
122
|
+
generation
|
|
123
|
+
grant
|
|
124
|
+
relayUrl
|
|
125
|
+
secret
|
|
126
|
+
session
|
|
127
|
+
}
|
|
128
|
+
... on DevSessionEndedError {
|
|
129
|
+
message
|
|
130
|
+
}
|
|
131
|
+
... on TunnelNotConfiguredError {
|
|
132
|
+
message
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
`),j=class extends Error{failure;constructor(r){super(r.kind),this.failure=r}};async function Xr({config:e,devSessionId:r,onFatal:n}){let o=Qr(),i=(await p({config:e,document:kt,variables:{devSessionId:r,engineUrl:e.engineUrl,hostKeyFingerprint:o.fingerprint,localUrl:e.appUrl}})).enterCloudMode;if(i==null)throw new j({kind:"empty-response"});if(i.__typename!=="RelaySession")throw new j({kind:"server-error",typename:i.__typename});let a=await Jr({allowedPorts:[...new Set([Vr(e.appUrl),Vr(e.engineUrl)])],grant:i.grant,hostKey:o,onFatal:n,relayUrl:i.relayUrl,secret:i.secret});return s.info({session:i.session},"cloud-executor relay up"),{stop:a.stop}}function Vr(e){let r=new URL(e);return r.port.length>0?Number(r.port):r.protocol==="https:"?443:80}var Yr=[1e3,3e3,8e3,15e3];function Zr(){return{attempt:0,desired:"local",devSessionId:null,stopped:!1,tunnel:"down"}}function en(e,r){if(e.stopped)return{effects:[],state:e};switch(r.kind){case"requested":return wt(e,r.mode);case"connected":return Z({...e,devSessionId:r.devSessionId},[]);case"tunnel-started":return xt(e);case"tunnel-failed":case"tunnel-fatal":return bt(e);case"retry-due":return e.tunnel==="down"?Z(e,[]):{effects:[],state:e};case"stopped":return{effects:e.tunnel==="down"?[]:[{kind:"stop-tunnel"}],state:{...e,desired:"local",stopped:!0,tunnel:"down"}}}}function vt(e){let r=Math.min(e,Yr.length-1),n=Yr[r];if(n==null)throw new Error("executor retry ladder is empty");return n}function wt(e,r){return r===e.desired?{effects:[],state:e}:Z({...e,attempt:0,desired:r},[{kind:"notify-changed"}])}function Z(e,r){return _(e)&&e.tunnel==="down"&&e.devSessionId!=null?{effects:[...r,{devSessionId:e.devSessionId,kind:"start-tunnel"}],state:{...e,tunnel:"starting"}}:!_(e)&&e.tunnel!=="down"?{effects:[...r,{kind:"stop-tunnel"}],state:{...e,tunnel:"down"}}:{effects:r,state:e}}function _(e){return e.desired==="cloud"&&e.devSessionId!=null&&!e.stopped}function xt(e){return _(e)?{effects:[],state:{...e,attempt:0,tunnel:"up"}}:{effects:[{kind:"stop-tunnel"}],state:{...e,tunnel:"down"}}}function bt(e){let r={...e,tunnel:"down"};return _(r)?{effects:[{delayMs:vt(r.attempt),kind:"schedule-retry"}],state:{...r,attempt:r.attempt+1}}:{effects:[],state:r}}function on(e){let r={draining:!1,io:Promise.resolve(),queue:[],retryTimer:null,state:Zr(),tunnel:null},n=o=>{r.queue.push(o),!r.draining&&(r.draining=!0,tn(r,n,e),r.draining=!1)};return{connect:o=>{n({devSessionId:o,kind:"connected"})},current:()=>r.state.desired,request:o=>{n({kind:"requested",mode:o})},stop:async()=>{n({kind:"stopped"}),await r.io.catch(()=>{})}}}function tn(e,r,n){let o=e.queue.shift();if(o==null)return;let t=en(e.state,o);e.state=t.state,t.effects.forEach(i=>{Rt({cell:e,dispatch:r,effect:i,params:n})}),tn(e,r,n)}function Rt({cell:e,dispatch:r,effect:n,params:o}){switch(n.kind){case"start-tunnel":{rn(e,()=>Pt({cell:e,devSessionId:n.devSessionId,dispatch:r,params:o}));return}case"stop-tunnel":{let t=e.tunnel;e.tunnel=null,nn(e),t!=null&&rn(e,async()=>{await t.stop(),s.info("executor switched to local")});return}case"schedule-retry":{nn(e),s.warn({delayMs:n.delayMs},"cloud tunnel down; retrying \u2014 switch with npx ripplo executor local"),e.retryTimer=setTimeout(()=>{e.retryTimer=null,r({kind:"retry-due"})},n.delayMs);return}case"notify-changed":o.onChanged()}}async function Pt({cell:e,devSessionId:r,dispatch:n,params:o}){try{let t=await Xr({config:o.config,devSessionId:r,onFatal:()=>{e.tunnel=null,n({kind:"tunnel-fatal"})}});e.tunnel=t,s.info("executor switched to cloud"),n({kind:"tunnel-started"})}catch(t){s.warn({err:t},"cloud tunnel failed to start; retrying in background"),n({kind:"tunnel-failed"})}}function rn(e,r){e.io=e.io.then(r).catch(n=>{s.warn({err:n},"executor io failed")})}function nn(e){e.retryTimer!=null&&(clearTimeout(e.retryTimer),e.retryTimer=null)}import{graphql as Et}from"gql.tada";var It=Et(`
|
|
137
|
+
mutation EndDevSessionWatch($projectId: String!, $cwd: String!, $devSessionId: String) {
|
|
138
|
+
endDevSession(projectId: $projectId, cwd: $cwd, devSessionId: $devSessionId) {
|
|
139
|
+
__typename
|
|
140
|
+
... on DevSession {
|
|
141
|
+
id
|
|
142
|
+
}
|
|
143
|
+
... on NoActiveDevSessionError {
|
|
144
|
+
message
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
`);function an(e){let r=async()=>{e.stops.forEach(o=>{o()}),e.exploration.stop(),e.socketHandle.close(),e.session.stop(),await e.pool.close(),await e.executorSwitch.stop(),await e.spanReceiver.stop().catch(()=>{}),await Promise.race([p({config:e.config,document:It,variables:{cwd:e.config.cwd,devSessionId:e.session.getId(),projectId:e.config.projectId}}).catch(()=>{}),new Promise(o=>setTimeout(o,3e3))]),e.releasePid()},n=()=>{r().finally(()=>process.exit(0))};e.shutdownRef.handler=n,process.on("SIGINT",n),process.on("SIGTERM",n),process.on("SIGHUP",n),process.on("SIGBREAK",n)}import{readdir as Tt}from"fs/promises";import{existsSync as sn}from"fs";import ee from"path";async function ln({config:e,cwd:r}){let n=ee.join(r,".ripplo","debug");await(await Tt(n,{withFileTypes:!0}).catch(()=>[])).filter(i=>i.isDirectory()).map(i=>i.name).filter(i=>!i.startsWith("replay-")&&!i.startsWith("explore-")&&!sn(ee.join(n,i,ce))&&sn(ee.join(n,i,"behavior.jsonl"))).reduce((i,a)=>i.then(()=>nr({config:e,debugDir:n,runId:a}).catch(()=>{})),Promise.resolve(void 0))}import{fork as Ct}from"child_process";import dn from"os";import{CancellationTokenSource as cn,ResponseError as un}from"vscode-jsonrpc/node";function pn(e,r){return()=>{let n=Ct(e,["run-worker"],{cwd:r,detached:!0,stdio:["ignore","inherit","inherit","ipc"]});return{connection:Xe(n),kill:()=>{Dt(n)},onExit:o=>{n.once("exit",o)}}}}function fn(e){let r={closed:!1,devSessionId:e.devSessionId,lockfileProvider:e.lockfileProvider,nextId:0,onProgress:e.onProgress,size:e.initialSize,spawn:e.spawn,targetGeneration:e.targetGeneration,waiters:[],workers:[]};return Sn(r),{close:async()=>{r.closed=!0,await Promise.all([...r.workers].map(n=>re(n,r)))},execute:(n,o)=>qt(n,o,r),exploreTrail:(n,o)=>Ot(n,o,r),routeSpan:(n,o)=>{let t=r.workers.find(i=>i.runId===n);t?.worker.connection.sendNotification(Qe,{runId:n,span:o})},setSize:n=>{Mt(n,r)},updateSession:n=>{r.devSessionId=n.devSessionId,r.targetGeneration=n.targetGeneration}}}function Dt(e){let r=e.pid;if(r!=null)try{process.kill(-r,"SIGKILL")}catch{e.kill("SIGKILL")}}var At=1e4,Lt=1e4,mn=-32800;async function qt(e,r,n){let o=await yn(n);if(o.runId=e.runId,!o.alive)return G(o,n),{outcome:{detail:"worker-exit",kind:"error"},serverNotified:!1};let t=new cn,i=()=>{t.cancel()};r.aborted&&t.cancel(),r.addEventListener("abort",i,{once:!0});try{let a=await o.worker.connection.sendRequest(ze,e,t.token),l=Ge.safeParse(a);return l.success?l.data:{outcome:{detail:"bad-outcome-frame",kind:"error"},serverNotified:!1}}catch(a){return Ht(a,o)}finally{r.removeEventListener("abort",i),t.dispose(),G(o,n)}}async function yn(e){let r=e.workers.find(n=>n.alive&&n.runId===void 0);if(r!=null)return r.runId="pending",await r.ready,r;if(e.workers.length<e.size){let n=gn(e);return n.runId="pending",await n.ready,n}return new Promise(n=>{e.waiters.push(o=>{o.runId="pending",n(o)})})}function gn(e){let r=e.spawn(),n={resolve:()=>{}},o={alive:!0,id:e.nextId,ready:new Promise(t=>{n.resolve=t,r.connection.onNotification(Ne,t)}),runId:void 0,worker:r};return e.nextId+=1,r.connection.onRequest(Be,()=>e.lockfileProvider()),r.connection.onNotification(Je,t=>{let i=_e.safeParse(t);i.success&&e.onProgress(i.data.runId,i.data.signal)}),r.onExit(()=>{o.alive=!1,e.workers=e.workers.filter(t=>t!==o),r.connection.dispose(),n.resolve()}),e.workers.push(o),o}function G(e,r){if(e.runId=void 0,!e.alive||r.closed)return;if(r.workers.length>r.size){re(e,r);return}let n=r.waiters.shift();n?.(e)}async function re(e,r){if(r.workers=r.workers.filter(t=>t!==e),!e.alive)return;let n=new Promise(t=>{e.worker.onExit(t)});await e.ready,await e.worker.connection.sendNotification(Ve).catch(()=>{});let o=setTimeout(()=>{e.worker.kill()},At);await n,clearTimeout(o)}function Ht(e,r){return e instanceof un&&e.code===mn?{outcome:{detail:"aborted",kind:"error"},serverNotified:!1}:r.alive?{outcome:{detail:e instanceof Error?e.message:String(e),kind:"error"},serverNotified:!1}:{outcome:{detail:"worker-exit",kind:"error"},serverNotified:!1}}async function Ot(e,r,n){let o=await yn(n);if(o.runId="explore",!o.alive)return G(o,n),{error:{detail:"worker-dead",source:"transport"},kind:"error"};let t=new cn,i={cancel:()=>{}},a=()=>{t.cancel();let l=setTimeout(()=>{o.worker.kill()},Lt);i.cancel=()=>{clearTimeout(l)}};r.aborted&&a(),r.addEventListener("abort",a,{once:!0});try{let l=await o.worker.connection.sendRequest(Ke,{assign:e,currentTargetGeneration:n.targetGeneration,devSessionId:n.devSessionId},t.token),d=Re.safeParse(l);return d.success?d.data:{error:{detail:"bad-result",source:"transport"},kind:"error"}}catch(l){return Wt(l)}finally{i.cancel(),r.removeEventListener("abort",a),t.dispose(),G(o,n)}}function Wt(e){return e instanceof un&&e.code===mn?{kind:"aborted",ranCount:0}:{error:{detail:e instanceof Error?e.message.slice(0,120):"unknown",source:"transport"},kind:"error"}}function Mt(e,r){r.size=e,e>dn.availableParallelism()&&s.warn({cores:dn.availableParallelism(),size:e},"worker pool size exceeds available cores");let n=r.workers.filter(t=>t.alive&&t.runId===void 0),o=r.workers.length-e;n.slice(0,Math.max(0,o)).forEach(t=>{re(t,r)}),Sn(r)}function Sn(e){e.closed||Array.from({length:Math.max(0,e.size-e.workers.length)}).forEach(()=>{gn(e)})}var Nt=6e4,hn=500,zt=15e3,Bt=vn(`
|
|
149
|
+
mutation HeartbeatDevSessionWatch($id: String!, $teleportProtocolVersion: Int!) {
|
|
150
|
+
heartbeatDevSession(id: $id, teleportProtocolVersion: $teleportProtocolVersion) {
|
|
151
|
+
__typename
|
|
152
|
+
... on DevSession {
|
|
153
|
+
id
|
|
154
|
+
}
|
|
155
|
+
... on DevSessionEndedError {
|
|
156
|
+
message
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
`),Kt=vn(`
|
|
161
|
+
query WatchLocalConcurrency {
|
|
162
|
+
currentUser {
|
|
163
|
+
id
|
|
164
|
+
maxLocalConcurrentRuns
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
`);async function Xs({exploreDebug:e}){ci();let r=li(process.cwd()),n=r.cwd,o=Ut(),t=ti(n),i={current:null},a={handler:()=>{}},l=on({config:r,onChanged:()=>{a.handler()}}),d={handler:()=>{}},c=ai(),u=Ar(),f=rr({config:r,cwd:n,executor:l.current,ready:c.promise,explorationStatus:()=>i.current?.status()??Qt(),onShutdownRequest:()=>{d.handler()},sseHealth:()=>u.snapshot()}),y=await si({cwd:n,ipc:f,releasePid:t}),N=await I(n);N.isErr()&&(process.stderr.write(`ripplo: ${D(N.error)}
|
|
168
|
+
`),process.exit(1));let wn=N.value,w=await ei({config:r,synchronize:()=>Le({config:r,cwd:n,lockfile:wn})}),ne=await h(n);ne!=null&&Ze(ne);let g={devSessionId:w.devSessionId,targetGeneration:kn({devSessionId:w.devSessionId,nonce:o})},xn=Cr({config:r,cwd:n});R({cwd:n,paused:w.hooksPaused});let oe=De(n);oe!=null&&s.info("watching branch %s in %s",oe,n);let bn=jt({fetchFn:Dr(),headers:{Authorization:`Bearer ${r.token}`},retry:pr,retryAttempts:1/0,url:`${r.ripploServerUrl}/graphql`});ln({config:r,cwd:n}).catch(()=>{});let x=await ni({config:r,devSessionId:g.devSessionId,ipc:f,targetGeneration:g.targetGeneration}),E=Jt({config:r,exploreDebug:e,pool:x,currentSession:()=>g,executorIsLocal:()=>l.current()==="local"});i.current=E,a.handler=E.notifyQueueChange;let Rn=await Xt({cwd:n,pool:x}),te=Rr({claim:f.claim,config:r,devSessionId:w.devSessionId,executorSwitch:l,exploration:E,pool:x,sseClient:bn,sseHealth:u,onSynchronized:ie=>{g.devSessionId=ie.devSessionId,g.targetGeneration=kn({devSessionId:ie.devSessionId,nonce:o}),x.updateSession(g)}}),Pn=Zt({config:r,session:te}),En=di();c.resolve(),Yt(w.devSessionId),an({config:r,executorSwitch:l,exploration:E,pool:x,releasePid:t,session:te,shutdownRef:d,socketHandle:y,spanReceiver:Rn,stops:[Pn,En,xn]}),await new Promise(()=>{})}function Qt(){return{explorer:{kind:"off"},exploring:0,progress:{attempts:0,findings:0}}}function Jt({config:e,currentSession:r,executorIsLocal:n,exploreDebug:o,pool:t}){return zr({appUrl:e.appUrl,cwd:e.cwd,executorIsLocal:n,onPlannerTrace:o?Vt:void 0,executeTrail:(i,a)=>t.exploreTrail(i,a),leaseOrdinal:()=>ir({config:e,count:1,devSessionId:r().devSessionId}),report:i=>{tr({attempts:i.attempts,config:e,devSessionId:r().devSessionId,findings:i.findings,trail:or(i.result)}).catch(a=>{s.warn({error:a},"exploration progress report failed")})},reportUnhealthy:()=>{ar(e,r().devSessionId).catch(i=>{s.warn({error:i},"exploration unhealthy report failed")})},targetGeneration:()=>r().targetGeneration})}function kn({devSessionId:e,nonce:r}){return{kind:"dev-session",value:`${e}:${r}`}}function Vt(e){we(e.trace).forEach(r=>{s.info({...r,explorerEvent:r.kind},"explorer planner")}),e.kind==="no-candidate"&&s.info({explorerEvent:"no-candidate",reason:e.reason},"explorer planner")}function Xt({cwd:e,pool:r}){return Ie({localDir:Ft.join(e,".ripplo",".local"),writePortFile:!0,onRrwebBatch:()=>{},onSpan:n=>{let o=n.attributes["ripplo.run"];o!=null&&r.routeSpan(o,n)}})}function Yt(e){process.stdout.write(`${Ue({devSessionId:e,version:se()})}
|
|
169
|
+
`)}function Zt({config:e,session:r}){let n=async()=>{try{let t=await p({config:e,document:Bt,variables:{id:r.getId(),teleportProtocolVersion:2}});t.heartbeatDevSession?.__typename==="DevSessionEndedError"&&(s.warn("dev session ended server-side (%s); re-registering",t.heartbeatDevSession.message),await r.reregister())}catch(t){s.warn("heartbeat failed: %s",t instanceof Error?t.message:String(t))}},o=setInterval(()=>{n()},zt);return()=>{clearInterval(o)}}function ei({config:e,synchronize:r}){let n=e.ripploServerUrl.includes("localhost")||e.ripploServerUrl.includes("127.0.0.1");return _t(async()=>{try{return await r()}catch(o){if(ri({config:e,error:o}),!(o instanceof le)){let t=o instanceof Error?o.message:String(o);throw s.error("initial sync failed: %s",t),new Gt(t)}throw o}},{factor:2,maxTimeout:n?2e3:1e4,minTimeout:n?100:1e3,retries:1/0,onFailedAttempt:({attemptNumber:o,error:t})=>{s.warn("initial sync attempt %d failed \u2014 retrying: %s",o,t.message)}})}function ri({config:e,error:r}){let n=de(r);n==="UNAUTHENTICATED"&&(process.stderr.write(`ripplo: ${$e()}
|
|
170
|
+
`),process.exit(1)),n==="FORBIDDEN"&&(process.stderr.write(`ripplo: ${Me({projectId:e.projectId,serverUrl:e.ripploServerUrl})}
|
|
171
|
+
`),process.exit(1))}async function ni({config:e,devSessionId:r,ipc:n,targetGeneration:o}){let t=await pi(e);return oi({cwd:e.cwd,devSessionId:r,initialConcurrency:t,onProgress:n.progress,targetGeneration:o})}function oi({cwd:e,devSessionId:r,initialConcurrency:n,onProgress:o,targetGeneration:t}){return fn({devSessionId:r,initialSize:n,onProgress:o,spawn:pn(fi(),e),targetGeneration:t,lockfileProvider:async()=>{let i=await S(e);if(i.isErr())return{unavailable:`daemon-load-failed:${i.error.kind}`};let a=await Ce(e,i.value);return{lockfileJson:ye(ge,a)}}})}function ti(e){try{return fe({cwd:e,onCompromised:ii})}catch(r){throw r instanceof pe&&(process.stderr.write(`${Fe({cwd:r.cwd,pid:r.pid})}
|
|
172
|
+
`),process.exit(1)),r}}function ii(){s.error("daemon lock compromised; shutting down"),process.stderr.write(`${je()}
|
|
173
|
+
`),process.exit(1)}function ai(){let e={handler:()=>{}};return{promise:new Promise(n=>{e.handler=n}),resolve:()=>{e.handler()}}}async function si({cwd:e,ipc:r,releasePid:n}){return(await Mr({cwd:e,onConnection:r.handleConnection})).match(t=>t,t=>{process.stderr.write(`${We(t)}
|
|
174
|
+
`),n(),process.exit(1)})}function li(e){return m(e).match(r=>r,r=>{process.stderr.write(`${He(r)}
|
|
175
|
+
`),process.exit(1)})}function di(){z({maxRuns:hn});let e=setInterval(()=>{z({maxRuns:hn})},Nt);return()=>{clearInterval(e)}}function ci(){process.on("unhandledRejection",e=>{s.error({err:e},"unhandledRejection in watch; continuing")}),process.on("uncaughtException",e=>{s.error({err:e},"uncaughtException in watch; continuing")})}var ui=4;async function pi(e){try{let n=(await p({config:e,document:Kt,variables:void 0})).currentUser?.maxLocalConcurrentRuns;if(n!=null)return L(n),n}catch(r){s.warn({err:r},"failed to fetch local concurrency setting; using default")}return ui}function fi(){let e=process.argv[1];if(e==null)throw new Error("cli entry unavailable");return e}export{Xs as runDaemon};
|
|
@@ -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,b,c,d,e,f,g,h,i,j,k}from"./chunk-
|
|
4
|
+
import{a,b,c,d,e,f,g,h,i,j,k}from"./chunk-O4A5UISQ.js";import"./chunk-F4UCCW7Q.js";import"./chunk-KOZTQJBB.js";import"./chunk-NNH3YVVO.js";import"./chunk-KMZ3L5YA.js";export{a as renderDaemonBindError,g as renderDaemonLockCompromised,e as renderDaemonLockHeld,d as renderDaemonReady,h as renderDaemonStatus,f as renderDaemonStopResult,j as renderDaemonVersionNote,i as renderExplorationProgress,c as renderNotSignedIn,b as renderProjectAccessDenied,k as wireOutcome};
|
|
@@ -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 a,k as b,l as c,m as d,n as e}from"./chunk-
|
|
4
|
+
import{j as a,k as b,l as c,m as d,n as e}from"./chunk-5JXP37ET.js";import"./chunk-KOZTQJBB.js";import"./chunk-KMZ3L5YA.js";export{a as LOCKFILE_RELATIVE_PATH,d as loadRipplo,b as loadRipploCached,c as loadRipploCachedWithFingerprint,e as ripploFingerprint};
|
package/dist/hook.js
CHANGED
|
@@ -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,c as s}from"./chunk-
|
|
4
|
+
import{a as r,c as s}from"./chunk-JPXTGKSB.js";import{a as i}from"./chunk-R4ZTRVDQ.js";import{c as o}from"./chunk-FEHVIHVA.js";import"./chunk-KOKEEAEF.js";import{b as e}from"./chunk-HEOMRXZE.js";import"./chunk-KMZ3L5YA.js";r();o(process.cwd());e(i());s(process.argv[2]??"").catch(async t=>{let{renderTopLevelError:p}=await import("./cli-error-7LCAN3Z5.js");process.stderr.write(`${p(t)}
|
|
5
5
|
`),process.exit(1)});
|
package/dist/index.js
CHANGED
|
@@ -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 bt}from"./chunk-
|
|
4
|
+
import{a as bt}from"./chunk-AUXGLJ3J.js";import{B as ft,C as Q,E as gt,F as yt,G as ht,L as kt,M as wt,N as vt,O as St,R as xt,S as Ye,a as Zn,b as Xn,c as Yn,d as et,e as Qe,f as rt,g as tt,h as ot,k as it,l as st,m as at,n as lt,o as dt,p as ct,q as ut,r as pt,t as mt,z as Xe}from"./chunk-IVW5DUE4.js";import{j as Ze,k as nt}from"./chunk-O4A5UISQ.js";import{a as $n,b as En,d as Pn,e as In,f as An,g as Tn,h as jn,i as Mn,j as Ln,k as Nn,l as On,m as Fn,n as Wn}from"./chunk-47LLHHJH.js";import{a as Bn,c as Je,d as Hn,e as Vn,f as zn,g as Kn,h as be}from"./chunk-5PICILBD.js";import{b as Dn,c as _n,d as Un,f as qn}from"./chunk-KL6TIUNF.js";import{b as we,c as O}from"./chunk-ANAQCK5G.js";import{a as Jn,b as S}from"./chunk-EYILCSW6.js";import{b as oe,c as vn,e as he,f as Sn}from"./chunk-IRT6UHD3.js";import{a as ye,b as Cn,c as ke}from"./chunk-NUBMOTH6.js";import{a as j}from"./chunk-OQ6KNYPG.js";import{a as J,b as xn,c as Ge,d as Rn}from"./chunk-RXLDAR2J.js";import{a as C,b as bn,c as y}from"./chunk-JS3DLVVI.js";import{a as Ar,b as Gn,c as Qn}from"./chunk-JPXTGKSB.js";import{a as w}from"./chunk-R4ZTRVDQ.js";import{b as Tr,c as ne,d as jr,e as Mr}from"./chunk-FEHVIHVA.js";import{a as R}from"./chunk-MHNGR6M7.js";import"./chunk-KOKEEAEF.js";import{b as hn,h as kn,j as G,m as wn}from"./chunk-BTIQ5H3K.js";import{$ as gn,D as an,E as ln,H as Ke,N as fe,R as dn,S as cn,U as un,W as pn,X as mn,Z as fn,_ as ge,ca as yn,e as z,f as u,g as rn,h as nn,m as ze,o as K,p as tn,q as on,s as sn}from"./chunk-F4UCCW7Q.js";import{f as te,i as en,j as V,l as pe,m as me}from"./chunk-5JXP37ET.js";import{$ as _,Ia as Xr,Ma as Yr,U as Kr,V as N,Z as H,_ as Gr,ca as Jr,ea as Qr,sa as T,t as zr,ta as Zr}from"./chunk-KOZTQJBB.js";import{a as Vr}from"./chunk-7WZ3VIUU.js";import{b as Hr,e as Ve}from"./chunk-KH4QH23U.js";import"./chunk-RIASQHPG.js";import{a as Lr,b as Nr,c as Or,d,f as B,g as Fr,i as Wr,k as P,l as Dr,m as _r,n as He,o as Ur,p as qr,q as Br}from"./chunk-C7SV6AR2.js";import{b as ue}from"./chunk-HEOMRXZE.js";import"./chunk-NNH3YVVO.js";import"./chunk-KMZ3L5YA.js";import wp from"update-notifier";import bp from"yargs";import{hideBin as vp}from"yargs/helpers";function ve({current:e,latest:r}){return r==null?`ripplo v${e} (latest: unknown)`:r===e?`ripplo v${e} (latest)`:`ripplo v${e} (latest: v${r} \u2014 run \`npx ripplo update\`)`}function Rt(){return"Update available {currentVersion} \u2192 {latestVersion}\nRun `npx ripplo update`"}import{graphql as Hs}from"gql.tada";import{exec as Ns}from"child_process";import{createAuthClient as Ms}from"better-auth/client";import{deviceAuthorizationClient as Ls}from"better-auth/client/plugins";function Ct({baseURL:e}){return Ms({baseURL:e,fetchOptions:{headers:{"User-Agent":"Ripplo CLI"}},plugins:[Ls()]})}import{err as $t,ok as Os}from"neverthrow";var Fs=5e3,Et="ripplo-cli";async function Pt({onDeviceCode:e,url:r}){let n=r??bn().RIPPLO_SERVER_URL,t=Ct({baseURL:n}),o=await t.device.code({client_id:Et});if(o.error!=null)return $t({description:o.error.error_description,kind:"oauth-device-code-failed"});let{device_code:i,user_code:s,verification_uri_complete:a}=o.data;return e({userCode:s,verificationUrl:a}),Bs(a),(await Ws({authClient:t,deviceCode:i})).map(c=>(Dr({serverUrl:n,token:c}),c))}async function Ws({authClient:e,deviceCode:r}){for(;;){await Us(Fs);let n=await e.device.token({client_id:Et,device_code:r,grant_type:"urn:ietf:params:oauth:grant-type:device_code"});if(n.data?.access_token!=null)return Os(n.data.access_token);if(n.error==null)continue;if(!_s(n.error.error))return $t({code:n.error.error,description:n.error.error_description,kind:"oauth-authorization-failed"})}}var Ds=new Set(["authorization_pending","slow_down"]);function _s(e){return Ds.has(e)}function Us(e){return new Promise(r=>{setTimeout(r,e)})}function qs(){return process.platform==="darwin"?"open":process.platform==="win32"?"start":"xdg-open"}function Bs(e){let r=qs();Ns(`${r} "${e}"`,()=>{})}function M({serverUrl:e,token:r}){return{appUrl:"",cwd:process.cwd(),engineUrl:"",projectId:"",ripploServerUrl:e,token:r,webhookSecret:""}}var Vs=Hs(`
|
|
5
5
|
query AuthViewer {
|
|
6
6
|
currentUser {
|
|
7
7
|
name
|
|
@@ -367,7 +367,7 @@ ${e.contradictions.map(t=>an({contradiction:t,evidencePath:void 0})).join(`
|
|
|
367
367
|
`);return}Eu(e)}function Eu(e){let r=`ripplo@${e}`,n=bu("npm",["install","-g",r],{stdio:"inherit"});if(n.status!==0){let t=`exit ${String(n.status)}`;process.stderr.write(`${Li(t)}
|
|
368
368
|
`),process.exit(1)}process.stdout.write(`${br({evicted:0,latest:e,mode:"global"})}
|
|
369
369
|
`)}async function Pu(e){if((await qn(e)).kind==="not-running")return;let n=await Un(e);process.stdout.write(`${Ni(n)}
|
|
370
|
-
`)}async function Fi({action:e,exploreDebug:r}){if(e==="status"){let{statusCommand:t}=await import("./status-
|
|
370
|
+
`)}async function Fi({action:e,exploreDebug:r}){if(e==="status"){let{statusCommand:t}=await import("./status-XUIBJXNP.js");await t({format:"summary"});return}if(e==="stop"||e==="restart"){let t=await Iu();(e==="stop"||!t)&&process.exit(t?0:1)}Au();let{runDaemon:n}=await import("./daemon-6UYMYGPI.js");await n({exploreDebug:r})}async function Iu(){let{stopDevDaemon:e}=await import("./daemon-lock-RPKO5SNE.js"),{renderDaemonStopResult:r}=await import("./daemon-EITBDEP7.js"),n=await e(process.cwd());return process.stdout.write(`${r(n)}
|
|
371
371
|
`),n.kind!=="timeout"}function Au(){let e=Y(O());e!=null&&process.stderr.write(`${e}
|
|
372
372
|
`)}function Wi(e){return`executor: ${e}`}function Di(e){return e==="cloud"?"executor set to cloud \u2014 the daemon is bringing the tunnel up, the next run dispatches to the cloud fleet":"executor set to local \u2014 the next run executes on this machine"}function _i(e){switch(e.kind){case"no-session":return"No active dev session for this directory. Start `npx ripplo daemon` first.";case"starting":return"Dev session is still syncing \u2014 the daemon just started. Retry in a moment.";case"session-ended":return"The dev session ended before the switch landed. Check `npx ripplo daemon status` and try again.";case"empty-response":return"The server returned no result for the switch. Try again."}}async function Ui({mode:e}){let r=y(process.cwd()).match(t=>t,t=>{process.stderr.write(`${S(t)}
|
|
373
373
|
`),process.exit(1)});(e==null?await vt(r):await St(r,e)).match(t=>{process.stdout.write(`${e==null?Wi(t):Di(t)}
|
|
@@ -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}from"./chunk-
|
|
4
|
+
import{a}from"./chunk-QQ6VKZ6A.js";import"./chunk-7WZ3VIUU.js";import"./chunk-KH4QH23U.js";import"./chunk-RIASQHPG.js";import"./chunk-C7SV6AR2.js";import"./chunk-HEOMRXZE.js";import"./chunk-NNH3YVVO.js";import"./chunk-KMZ3L5YA.js";export{a as planReminder};
|
|
@@ -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 t}from"./chunk-
|
|
4
|
+
import{a as t}from"./chunk-QSKOYBDO.js";import{a as e}from"./chunk-EVEITUJH.js";import"./chunk-SXVWB7TZ.js";import"./chunk-JJ4QQPAV.js";import"./chunk-IRT6UHD3.js";import"./chunk-NUBMOTH6.js";import"./chunk-OQ6KNYPG.js";import"./chunk-RXLDAR2J.js";import"./chunk-JS3DLVVI.js";import"./chunk-FEHVIHVA.js";import"./chunk-MHNGR6M7.js";import{b as o}from"./chunk-KOKEEAEF.js";import"./chunk-BTIQ5H3K.js";import"./chunk-F4UCCW7Q.js";import"./chunk-5JXP37ET.js";import"./chunk-KOZTQJBB.js";import"./chunk-7WZ3VIUU.js";import"./chunk-KH4QH23U.js";import"./chunk-RIASQHPG.js";import"./chunk-C7SV6AR2.js";import"./chunk-HEOMRXZE.js";import"./chunk-NNH3YVVO.js";import"./chunk-KMZ3L5YA.js";var r=o({event:"PostToolUse",handlers:[t,e],note:i=>({hookSpecificOutput:{additionalContext:i,hookEventName:"PostToolUse"}})});export{r as postEditHook};
|
|
@@ -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}from"./chunk-QSKOYBDO.js";import"./chunk-IRT6UHD3.js";import"./chunk-NUBMOTH6.js";import"./chunk-OQ6KNYPG.js";import"./chunk-RXLDAR2J.js";import"./chunk-JS3DLVVI.js";import"./chunk-FEHVIHVA.js";import"./chunk-MHNGR6M7.js";import"./chunk-BTIQ5H3K.js";import"./chunk-F4UCCW7Q.js";import"./chunk-5JXP37ET.js";import"./chunk-KOZTQJBB.js";import"./chunk-7WZ3VIUU.js";import"./chunk-KH4QH23U.js";import"./chunk-RIASQHPG.js";import"./chunk-C7SV6AR2.js";import"./chunk-HEOMRXZE.js";import"./chunk-NNH3YVVO.js";import"./chunk-KMZ3L5YA.js";export{a as postEditAnalyze};
|
|
@@ -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}from"./chunk-
|
|
4
|
+
import{a}from"./chunk-EVEITUJH.js";import"./chunk-SXVWB7TZ.js";import"./chunk-JJ4QQPAV.js";import"./chunk-BTIQ5H3K.js";import"./chunk-F4UCCW7Q.js";import"./chunk-5JXP37ET.js";import"./chunk-KOZTQJBB.js";import"./chunk-7WZ3VIUU.js";import"./chunk-KH4QH23U.js";import"./chunk-RIASQHPG.js";import"./chunk-C7SV6AR2.js";import"./chunk-HEOMRXZE.js";import"./chunk-NNH3YVVO.js";import"./chunk-KMZ3L5YA.js";export{a as postEditFlagStubs};
|
|
@@ -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 e}from"./chunk-
|
|
4
|
+
import{a as e}from"./chunk-XPOOWIRL.js";import{a as t}from"./chunk-5HFJIZLI.js";import"./chunk-G6J2WIHJ.js";import{a as i}from"./chunk-T6WA2F3S.js";import"./chunk-JJ4QQPAV.js";import"./chunk-JS3DLVVI.js";import"./chunk-FEHVIHVA.js";import"./chunk-MHNGR6M7.js";import{b as o}from"./chunk-KOKEEAEF.js";import"./chunk-5JXP37ET.js";import"./chunk-KOZTQJBB.js";import"./chunk-7WZ3VIUU.js";import"./chunk-KH4QH23U.js";import"./chunk-RIASQHPG.js";import"./chunk-C7SV6AR2.js";import"./chunk-HEOMRXZE.js";import"./chunk-NNH3YVVO.js";import"./chunk-KMZ3L5YA.js";var d=o({event:"PreToolUse",handlers:[e,t,i],note:r=>({hookSpecificOutput:{additionalContext:r,hookEventName:"PreToolUse"}})});export{d as preEditHook};
|
|
@@ -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}from"./chunk-
|
|
4
|
+
import{a}from"./chunk-XPOOWIRL.js";import"./chunk-MHNGR6M7.js";import"./chunk-5JXP37ET.js";import"./chunk-KOZTQJBB.js";import"./chunk-7WZ3VIUU.js";import"./chunk-KH4QH23U.js";import"./chunk-RIASQHPG.js";import"./chunk-C7SV6AR2.js";import"./chunk-HEOMRXZE.js";import"./chunk-NNH3YVVO.js";import"./chunk-KMZ3L5YA.js";export{a as preEditWatchGate};
|
|
@@ -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 e}from"./chunk-PYDYI3AA.js";import{a as r}from"./chunk-AXROBTLA.js";import{a as i}from"./chunk-XAMVRZJH.js";import"./chunk-BGY5F3IU.js";import"./chunk-CI6273ZU.js";import"./chunk-SXVWB7TZ.js";import"./chunk-G6J2WIHJ.js";import"./chunk-JJ4QQPAV.js";import"./chunk-47LLHHJH.js";import"./chunk-OQ6KNYPG.js";import"./chunk-JS3DLVVI.js";import"./chunk-FEHVIHVA.js";import"./chunk-MHNGR6M7.js";import{b as o}from"./chunk-KOKEEAEF.js";import{a as t}from"./chunk-
|
|
4
|
+
import{a as e}from"./chunk-PYDYI3AA.js";import{a as r}from"./chunk-AXROBTLA.js";import{a as i}from"./chunk-XAMVRZJH.js";import"./chunk-BGY5F3IU.js";import"./chunk-CI6273ZU.js";import"./chunk-SXVWB7TZ.js";import"./chunk-G6J2WIHJ.js";import"./chunk-JJ4QQPAV.js";import"./chunk-47LLHHJH.js";import"./chunk-OQ6KNYPG.js";import"./chunk-JS3DLVVI.js";import"./chunk-FEHVIHVA.js";import"./chunk-MHNGR6M7.js";import{b as o}from"./chunk-KOKEEAEF.js";import{a as t}from"./chunk-QQ6VKZ6A.js";import"./chunk-7WZ3VIUU.js";import"./chunk-KH4QH23U.js";import"./chunk-RIASQHPG.js";import"./chunk-C7SV6AR2.js";import"./chunk-HEOMRXZE.js";import"./chunk-NNH3YVVO.js";import"./chunk-KMZ3L5YA.js";var a=o({event:"UserPromptSubmit",handlers:[t,e,r,i],note:m=>({hookSpecificOutput:{additionalContext:m,hookEventName:"UserPromptSubmit"}})});export{a as promptSubmitHook};
|
|
@@ -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}from"./chunk-AUXGLJ3J.js";import"./chunk-O4A5UISQ.js";import"./chunk-KL6TIUNF.js";import"./chunk-ANAQCK5G.js";import"./chunk-RXLDAR2J.js";import"./chunk-R4ZTRVDQ.js";import"./chunk-MHNGR6M7.js";import"./chunk-BTIQ5H3K.js";import"./chunk-F4UCCW7Q.js";import"./chunk-5JXP37ET.js";import"./chunk-KOZTQJBB.js";import"./chunk-C7SV6AR2.js";import"./chunk-HEOMRXZE.js";import"./chunk-NNH3YVVO.js";import"./chunk-KMZ3L5YA.js";export{a as statusCommand};
|
|
@@ -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 P,b as A,c as I}from"./chunk-BGY5F3IU.js";import{a as T,b as O,e as D,f as H,g as q,h}from"./chunk-
|
|
4
|
+
import{a as P,b as A,c as I}from"./chunk-BGY5F3IU.js";import{a as T,b as O,e as D,f as H,g as q,h}from"./chunk-5PICILBD.js";import{a as L,c as N,e as x}from"./chunk-KL6TIUNF.js";import"./chunk-ANAQCK5G.js";import{a as v,c as $}from"./chunk-NUBMOTH6.js";import"./chunk-OQ6KNYPG.js";import{a as C}from"./chunk-RXLDAR2J.js";import{c as k}from"./chunk-JS3DLVVI.js";import"./chunk-R4ZTRVDQ.js";import"./chunk-FEHVIHVA.js";import{a as c}from"./chunk-MHNGR6M7.js";import{c as w}from"./chunk-KOKEEAEF.js";import{h as j,i as E,l as y}from"./chunk-BTIQ5H3K.js";import"./chunk-F4UCCW7Q.js";import"./chunk-5JXP37ET.js";import{Ma as g}from"./chunk-KOZTQJBB.js";import{a as S}from"./chunk-7WZ3VIUU.js";import{f as b}from"./chunk-KH4QH23U.js";import"./chunk-RIASQHPG.js";import{d as m}from"./chunk-C7SV6AR2.js";import"./chunk-HEOMRXZE.js";import"./chunk-NNH3YVVO.js";import"./chunk-KMZ3L5YA.js";import J from"path";import U from"process";import{CancellationTokenSource as _}from"vscode-jsonrpc/node";import{graphql as W}from"gql.tada";function F(n){return`--- Ripplo Run Failures (scope) ---
|
|
5
5
|
${n.join(`
|
|
6
6
|
`)}
|
|
7
7
|
Artifacts: .ripplo/debug/<runId>/. ${c("run")}`}function R({lines:n,retried:e}){let r=e?"Already retried once, still unreachable.":"";return["--- Ripplo Run Not Verified (server unreachable) ---",...n,"Server-side transient \u2014 not the daemon, dev server, or auth (`npx ripplo doctor` is green).",r,"Wait a moment, then stop again to re-verify."].filter(t=>t.length>0).join(`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ripplo",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.1",
|
|
4
4
|
"description": "CLI for Ripplo — AI-powered end-to-end testing",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"homepage": "https://ripplo.ai",
|
|
@@ -65,14 +65,14 @@
|
|
|
65
65
|
"fast-check": "^4.3.0",
|
|
66
66
|
"tsup": "^8.5.1",
|
|
67
67
|
"vitest": "^4.1.4",
|
|
68
|
-
"@ripplo/core": "^0.0.0",
|
|
69
68
|
"@ripplo/eslint-config": "0.0.0",
|
|
69
|
+
"@ripplo/core": "^0.0.0",
|
|
70
|
+
"@ripplo/graphql": "^0.0.0",
|
|
71
|
+
"@ripplo/rrweb-bundle": "0.0.0",
|
|
70
72
|
"@ripplo/run-report": "0.0.0",
|
|
71
73
|
"@ripplo/runtime": "^0.0.0",
|
|
72
74
|
"@ripplo/solver": "^0.0.0",
|
|
73
|
-
"@ripplo/spec": "^0.0.0"
|
|
74
|
-
"@ripplo/rrweb-bundle": "0.0.0",
|
|
75
|
-
"@ripplo/graphql": "^0.0.0"
|
|
75
|
+
"@ripplo/spec": "^0.0.0"
|
|
76
76
|
},
|
|
77
77
|
"scripts": {
|
|
78
78
|
"dev": "tsx watch src/index.ts",
|