ripplo 0.10.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +105 -47
- package/dist/assets/rrweb-replay.js +1 -1
- package/dist/assets/rrweb.js +1 -1
- package/dist/capture-worker.js +20 -14
- package/dist/chunk-3HAQCJRK.js +4 -0
- package/dist/{chunk-5E62BCS7.js → chunk-47LLHHJH.js} +2 -2
- package/dist/chunk-4YAC72LW.js +7 -0
- package/dist/chunk-5HFJIZLI.js +4 -0
- package/dist/chunk-6U2LNGSV.js +51 -0
- package/dist/{chunk-LL4HUOJP.js → chunk-6WFJZ5L6.js} +1 -1
- package/dist/chunk-7JKCHASU.js +4 -0
- package/dist/{chunk-CEVQ5RNC.js → chunk-7RREARGA.js} +2 -2
- package/dist/{chunk-WNAVYV4P.js → chunk-AXROBTLA.js} +1 -1
- package/dist/chunk-BGY5F3IU.js +5 -0
- package/dist/{chunk-IPSXNIXC.js → chunk-C7SV6AR2.js} +4 -4
- package/dist/chunk-CI6273ZU.js +107 -0
- package/dist/chunk-DY7ZW6QZ.js +9 -0
- package/dist/chunk-E6ZBZIIS.js +4 -0
- package/dist/chunk-G6J2WIHJ.js +4 -0
- package/dist/{chunk-4OSYMIH6.js → chunk-GYBY7EOO.js} +1 -1
- package/dist/{chunk-LOEAZGYO.js → chunk-HEOMRXZE.js} +1 -1
- package/dist/chunk-IK3ROREL.js +6 -0
- package/dist/{chunk-7W237JFM.js → chunk-JS3DLVVI.js} +1 -1
- package/dist/{chunk-TPHOSZAK.js → chunk-KH4QH23U.js} +1 -1
- package/dist/{chunk-QAR7FZO3.js → chunk-LEFODI2H.js} +1 -1
- package/dist/{chunk-43C7VPGA.js → chunk-LWMXGWS2.js} +1 -1
- package/dist/chunk-O45YB6YY.js +354 -0
- package/dist/{chunk-YQ2RBEOJ.js → chunk-PXXURBGC.js} +2 -2
- package/dist/{chunk-OAU4HUD2.js → chunk-PYDYI3AA.js} +2 -2
- package/dist/{chunk-R3DZ6JPY.js → chunk-RIASQHPG.js} +1 -1
- package/dist/chunk-S2K5KILQ.js +8 -0
- package/dist/chunk-SXVWB7TZ.js +6 -0
- package/dist/{chunk-5X4M4MTG.js → chunk-UH5CQF5R.js} +3 -3
- package/dist/{chunk-UDPKOYZT.js → chunk-VKAZQPJJ.js} +1 -1
- package/dist/chunk-WAGXAEB4.js +13 -0
- package/dist/chunk-WBKSJU63.js +83 -0
- package/dist/{chunk-AGK6XOX2.js → chunk-XAMVRZJH.js} +2 -2
- package/dist/chunk-ZHDR7LXB.js +56 -0
- package/dist/{cli-error-AHNJULLG.js → cli-error-6PUIWNIT.js} +1 -1
- package/dist/{compile-write-OLQOR3OK.js → compile-write-KUUFWSI4.js} +1 -1
- package/dist/daemon-2ZTZXQW6.js +4 -0
- package/dist/daemon-GP3EIISA.js +152 -0
- package/dist/{daemon-lock-OAARBZ4O.js → daemon-lock-RPKO5SNE.js} +1 -1
- package/dist/dsl-loader-WPAKMON7.js +4 -0
- package/dist/dsl-typecheck-worker.js +6 -0
- package/dist/{exit-plan-gate-CJ3IXWTN.js → exit-plan-gate-44YWEKYS.js} +1 -1
- package/dist/hook.js +1 -1
- package/dist/index.js +207 -260
- package/dist/{plan-reminder-EPCNBFY3.js → plan-reminder-PP5DQAQZ.js} +1 -1
- package/dist/post-edit-R7KN424T.js +4 -0
- package/dist/post-edit-analyze-UURDL3AH.js +4 -0
- package/dist/post-edit-flag-stubs-I7AUGN4D.js +4 -0
- package/dist/pre-bash-run-gate-MIEM2DBB.js +4 -0
- package/dist/pre-edit-C4MGURNO.js +4 -0
- package/dist/pre-edit-ripplo-skill-gate-A6ETC3QN.js +4 -0
- package/dist/pre-edit-scope-gate-M5IQSVGF.js +4 -0
- package/dist/{pre-edit-watch-gate-BUFWLXR3.js → pre-edit-watch-gate-ORQP7MSW.js} +1 -1
- package/dist/prompt-submit-6KNOFK4W.js +4 -0
- package/dist/scope-reminder-A6GVTTVE.js +4 -0
- package/dist/session-preamble-IZQPIWST.js +4 -0
- package/dist/status-PG4EBZRM.js +4 -0
- package/dist/{stop-enforce-4XV6LK7Z.js → stop-enforce-CO5GYI3G.js} +9 -9
- package/dist/tasks-reminder-TDWPD3KV.js +4 -0
- package/dist/{track-skill-load-CJ74GD3Q.js → track-skill-load-SXSDMHFO.js} +1 -1
- package/dist/{track-skill-prompt-YSB6OOQN.js → track-skill-prompt-7N4TQAD2.js} +1 -1
- package/package.json +2 -4
- package/dist/chunk-26A42N75.js +0 -55
- package/dist/chunk-44GHUVW6.js +0 -8
- package/dist/chunk-67YR3QHA.js +0 -6
- package/dist/chunk-6NKSEWP6.js +0 -224
- package/dist/chunk-6TCK75ER.js +0 -83
- package/dist/chunk-73TKORK6.js +0 -8
- package/dist/chunk-CB74TAUC.js +0 -5
- package/dist/chunk-FXCBWBN5.js +0 -4
- package/dist/chunk-GOZWOCTE.js +0 -7
- package/dist/chunk-IONMYZ3K.js +0 -4
- package/dist/chunk-LB65USNP.js +0 -73
- package/dist/chunk-M3CXHDFV.js +0 -9
- package/dist/chunk-MOI4L3EX.js +0 -4
- package/dist/chunk-N2OBRCPQ.js +0 -6
- package/dist/chunk-OWN4P2K7.js +0 -4
- package/dist/chunk-SNU66GSR.js +0 -4
- package/dist/chunk-VDAFHS7J.js +0 -7
- package/dist/chunk-VOZOP7MQ.js +0 -55
- package/dist/daemon-BJAGK2Q3.js +0 -152
- package/dist/daemon-H4P5PCVH.js +0 -4
- package/dist/dsl-loader-LXH6PUY5.js +0 -4
- package/dist/post-edit-ZVCYZ62V.js +0 -4
- package/dist/post-edit-analyze-J2H3I3IO.js +0 -4
- package/dist/post-edit-flag-stubs-E22KT2LD.js +0 -4
- package/dist/pre-bash-run-gate-B42YNDQF.js +0 -4
- package/dist/pre-edit-TEN3AFRK.js +0 -4
- package/dist/pre-edit-ripplo-skill-gate-QHUD7QGU.js +0 -4
- package/dist/pre-edit-scope-gate-2YIFSEDY.js +0 -4
- package/dist/prompt-submit-DJFWNGYC.js +0 -4
- package/dist/scope-reminder-DIDCHDAA.js +0 -4
- package/dist/session-preamble-ZYVRDSGA.js +0 -4
- package/dist/status-FDM2RK37.js +0 -4
- package/dist/tasks-reminder-SDS6RNLP.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{a,b,c}from"./chunk-
|
|
4
|
+
import{a,b,c}from"./chunk-6WFJZ5L6.js";import"./chunk-WAGXAEB4.js";import"./chunk-MHNGR6M7.js";import"./chunk-7JKCHASU.js";import"./chunk-ZHDR7LXB.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-E6ZBZIIS.js";import"./chunk-WBKSJU63.js";import"./chunk-7JKCHASU.js";import"./chunk-ZHDR7LXB.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,4 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __ripploCreateRequire } from "node:module";
|
|
3
|
+
const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
|
|
4
|
+
import{a,b,c,d,e,f,g,h,i,j,k}from"./chunk-UH5CQF5R.js";import"./chunk-WBKSJU63.js";import"./chunk-ZHDR7LXB.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};
|
|
@@ -0,0 +1,152 @@
|
|
|
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 L,H as or,I as tr,J as ir,K as ar,M as sr,N as lr,P as B,Q as q,R as dr,S as cr,T as K,e as We,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 D,w as Ye,x as z,y as Ze,z as er}from"./chunk-O45YB6YY.js";import{a as Me,b as Oe,c as Ue,d as $e,e as je,g as Fe}from"./chunk-UH5CQF5R.js";import{d as qe}from"./chunk-3HAQCJRK.js";import{b as He}from"./chunk-6WFJZ5L6.js";import{a as Ae,c as De,d as Le,e as h}from"./chunk-6U2LNGSV.js";import{a as C}from"./chunk-WAGXAEB4.js";import{c as y}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 T}from"./chunk-E6ZBZIIS.js";import{$ as Te,F as ve,H as we,I as xe,L as I,M as be,N as Re,Q as Ee,R as Pe,W as Ie,l as ke}from"./chunk-WBKSJU63.js";import{k as S,l as he,m as P}from"./chunk-7JKCHASU.js";import{Ba as Se,S as ye,oa as ge}from"./chunk-ZHDR7LXB.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 f,f as s,g as ce,h as N,i as ue}from"./chunk-C7SV6AR2.js";import"./chunk-HEOMRXZE.js";import"./chunk-NNH3YVVO.js";import"./chunk-KMZ3L5YA.js";import{randomUUID as Rt}from"crypto";import Et from"path";import{createClient as Pt}from"graphql-sse";import It,{AbortError as Tt}from"p-retry";import{graphql as Sn}from"gql.tada";import{graphql as En}from"gql.tada";import{print as Pn}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 L({config:e,ownerToken:null,reason:`lockfile:${c.error.kind}`,runId:t}),{kind:"dispatch-error",reason:{detail:`lockfile:${c.error.kind}`,type:"generic"}};let u=Rn(c.value,{testSlug:a,workflowSlug:d});if(u==null)return await L({config:e,ownerToken:null,reason:`no-test:${d}/${a}`,runId:t}),{kind:"dispatch-error",reason:{detail:`no-test:${d}/${a}`,type:"generic"}};let p=await A({headed:n,workClass:l,task:()=>o.execute({headed:n,runId:t,testRef:u},i)});return!p.serverNotified&&p.outcome.kind==="error"&&await L({config:e,ownerToken:null,reason:p.outcome.detail,runId:t}),p.outcome}function Rn(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 In=6e4,Tn=En(`
|
|
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,In)+qn();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=An(r);return t.subscribe({query:Pn(Tn),variables:{devSessionId:n}},{complete:Cn,error:d=>{let c=d instanceof Error?d.message:String(d);i.markUnhealthy(c),s.error({err:d},"runRequested subscription failed")},next:d=>{Dn({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 Cn(){}function An(e){return ae(e),{config:y(e).match(r=>r,r=>{s.error({failure:r},"failed to load env for run dispatch")}),cwd:e}}function Dn({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=Ln(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 Ln(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 qn(){return Math.floor(Math.random()*2700)+300}import{graphql as Q}from"gql.tada";import{print as Hn}from"graphql";var Wn=Q(`
|
|
15
|
+
subscription TeleportRequestedWatch($devSessionId: String!) {
|
|
16
|
+
teleportRequested(devSessionId: $devSessionId) {
|
|
17
|
+
runId
|
|
18
|
+
stepIndex
|
|
19
|
+
kind
|
|
20
|
+
testSlug
|
|
21
|
+
workflowSlug
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
`),Mn=Q(`
|
|
25
|
+
query TeleportRunRepro($id: String!) {
|
|
26
|
+
run(id: $id) {
|
|
27
|
+
id
|
|
28
|
+
reproJson
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
`),On=Q(`
|
|
32
|
+
mutation ReportTeleportResult($devSessionId: String!, $runId: String!, $status: String!) {
|
|
33
|
+
reportTeleportResult(devSessionId: $devSessionId, runId: $runId, status: $status)
|
|
34
|
+
}
|
|
35
|
+
`);function mr({cwd:e,devSessionId:r,sseClient:n}){let o=new Set,t=n.subscribe({query:Hn(Wn),variables:{devSessionId:r}},{complete:Un,error:i=>{s.error({err:i},"teleportRequested subscription failed")},next:i=>{$n({cwd:e,devSessionId:r,event:i.data?.teleportRequested,running:o})}});return()=>{o.forEach(i=>{i.abort()}),o.clear(),t()}}function Un(){}function $n({cwd:e,devSessionId:r,event:n,running:o}){if(n==null)return;let t=new AbortController;o.add(t),jn({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 jn({cwd:e,devSessionId:r,event:n,signal:o}){let t=d=>Fn({cwd:e,devSessionId:r,runId:n.runId,status:d}),i=await _n(e,n);if(i==null){s.warn({runId:n.runId},"teleport could not resolve target"),await t("unplannable");return}process.stdout.write(`ripplo: teleport ${Nn(n)} step ${String(n.stepIndex+1)}
|
|
36
|
+
`);let l=await sr({cwd:e,onReady:()=>{t("opened")},signal:o,step:n.stepIndex+1,target:i});l.kind==="done"&&l.result.kind==="handed-over"||(s.warn({kind:l.kind,runId:n.runId},"teleport could not open"),await t(l.kind==="unplannable"?"unplannable":"error"))}async function Fn({cwd:e,devSessionId:r,runId:n,status:o}){let t=y(e).match(i=>i,()=>null);t!=null&&await f({config:t,document:On,variables:{devSessionId:r,runId:n,status:o}}).catch(()=>null)}async function _n(e,r){if(r.kind==="explore"){let n=await Gn(e,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 Gn(e,r){let n=y(e).match(i=>i,()=>null);if(n==null)return null;let o=await f({config:n,document:Mn,variables:{id:r}}).catch(()=>null);if(o?.run?.reproJson==null)return null;let t=I(o.run.reproJson);return t.kind==="valid"?t.repro:null}function Nn(e){return e.kind==="explore"?"explore finding":`${String(e.workflowSlug)}/${String(e.testSlug)}`}import H from"fs";import zn from"p-retry";import{graphql as x}from"gql.tada";import{print as M}from"graphql";var Bn=x(`
|
|
37
|
+
query DaemonExploration($devSessionId: String!) {
|
|
38
|
+
exploration(devSessionId: $devSessionId) {
|
|
39
|
+
active
|
|
40
|
+
localWorkers
|
|
41
|
+
maxTrailLength
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
`),Kn=x(`
|
|
45
|
+
subscription WatchExplorationChanged($devSessionId: String!) {
|
|
46
|
+
explorationChanged(devSessionId: $devSessionId) {
|
|
47
|
+
exploration {
|
|
48
|
+
active
|
|
49
|
+
localWorkers
|
|
50
|
+
maxTrailLength
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
`);function yr({config:e,devSessionId:r,exploration:n,lifetime:o,sseClient:t}){return zn(()=>Qn({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(Kn),variables:{devSessionId:r}},{complete:U,error:i=>{O({error:i,stream:"explorationChanged"})},next:i=>{gr(n,i.data?.explorationChanged.exploration)}})}async function Qn({config:e,devSessionId:r,exploration:n,lifetime:o}){if(W(o))return;let t=await f({config:e,document:Bn,variables:{devSessionId:r}});W(o)||gr(n,t.exploration)}function gr(e,r){r!=null&&e.setDesired({active:r.active,localWorkers:r.localWorkers,maxTrailLength:r.maxTrailLength})}var Jn=x(`
|
|
55
|
+
subscription HooksPausedWatch($projectId: String!) {
|
|
56
|
+
hooksPausedRequested(projectId: $projectId) {
|
|
57
|
+
paused
|
|
58
|
+
projectId
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
`),Vn=x(`
|
|
62
|
+
subscription WatchLocalConcurrencyChanged {
|
|
63
|
+
myMaxLocalConcurrentRunsChanged
|
|
64
|
+
}
|
|
65
|
+
`);function Sr({pool:e,sseClient:r}){return r.subscribe({query:M(Vn)},{complete:U,error:n=>{O({error:n,stream:"myMaxLocalConcurrentRunsChanged"})},next:n=>{let o=n.data?.myMaxLocalConcurrentRunsChanged;o!=null&&(D(o),e.setSize(o))}})}var Xn=x(`
|
|
66
|
+
subscription WatchExecutorChangeRequested($devSessionId: String!) {
|
|
67
|
+
executorChangeRequested(devSessionId: $devSessionId) {
|
|
68
|
+
executor
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
`);function hr({config:e,devSessionId:r,lifetime:n,sseClient:o,switcher:t}){return t.connect(r),Yn({config:e,lifetime:n,switcher:t}),Zn({devSessionId:r,sseClient:o,switcher:t})}async function Yn({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 Zn({devSessionId:e,sseClient:r,switcher:n}){return r.subscribe({query:M(Xn),variables:{devSessionId:e}},{complete:U,error:o=>{O({error:o,stream:"executorChangeRequested"})},next:o=>{let t=o.data?.executorChangeRequested?.executor;t!=null&&n.request(t)}})}function kr({cwd:e,projectId:r,sseClient:n}){return n.subscribe({query:M(Jn),variables:{projectId:r}},{complete:U,error:o=>{O({error:o,stream:"hooksPausedRequested"})},next:o=>{let t=o.data?.hooksPausedRequested?.paused;t!=null&&b({cwd:e,paused:t})}})}function O({error:e,stream:r}){s.error({error:e},"%s subscription failed",r)}function U(){}function b({cwd:e,paused:r}){let n=me(e);if(r&&!H.existsSync(n)){H.writeFileSync(n,"");return}!r&&H.existsSync(n)&&H.unlinkSync(n)}function vr({initialId:e,onSynchronized:r,subscribe:n,synchronize:o}){let t=e,i=null,a=!1,l=d();function d(){let p=new AbortController,m=n({devSessionId:t,lifetime:p.signal});return()=>{p.abort(),m()}}async function c(p){let m=await o(p);m==null||a||(l(),t=m.devSessionId,r(m),l=d())}function u(p){return a?Promise.resolve():(i!=null||(i=c(p).finally(()=>{i=null})),i)}return{getId:()=>t,reregister:()=>u("dev session ended server-side"),stop:()=>{a||(a=!0,l())}}}function wr({claim:e,config:r,devSessionId:n,executorSwitch:o,exploration:t,onSynchronized:i,pool:a,sseClient:l,sseHealth:d}){return vr({initialId:n,onSynchronized:c=>{i(c),b({cwd:r.cwd,paused:c.hooksPaused})},subscribe:({devSessionId:c,lifetime:u})=>eo({claim:e,config:r,devSessionId:c,executorSwitch:o,exploration:t,lifetime:u,pool:a,sseClient:l,sseHealth:d}),synchronize:c=>ro({config:r,reason:c,sseHealth:d})})}function eo({claim:e,config:r,devSessionId:n,executorSwitch:o,exploration:t,lifetime:i,pool:a,sseClient:l,sseHealth:d}){let c=[hr({config:r,devSessionId:n,lifetime:i,sseClient:l,switcher:o}),kr({cwd:r.cwd,projectId:r.projectId,sseClient:l}),Sr({pool:a,sseClient:l}),yr({config:r,devSessionId:n,exploration:t,lifetime:i,sseClient:l}),fr({claim:e,cwd:r.cwd,devSessionId:n,pool:a,sseClient:l,sseHealth:d}),mr({cwd:r.cwd,devSessionId:n,sseClient:l})];return()=>{c.forEach(u=>{u()})}}async function ro({config:e,reason:r,sseHealth:n}){n.markUnhealthy(r);let o=await P(e.cwd);return o.isErr()?(s.error("re-register: compile failed: %s",C(o.error)),null):De({config:e,cwd:e.cwd,lockfile:o.value})}import{createHash as no}from"crypto";import xr from"fs";function br(){return J===void 0&&(J=oo()),J}var J;function oo(){let e=process.argv[1];if(e==null)return null;try{let r=xr.readFileSync(xr.realpathSync(e));return no("sha256").update(r).digest("hex")}catch{return null}}import{graphql as Rr}from"gql.tada";var to=Rr(`
|
|
72
|
+
query OpenFindingsForRetire($projectId: String!) {
|
|
73
|
+
exploreFindings(projectId: $projectId, status: open) {
|
|
74
|
+
signature
|
|
75
|
+
reproRun {
|
|
76
|
+
reproJson
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
`),io=Rr(`
|
|
81
|
+
mutation RetireStaleFinding($projectId: String!, $signature: String!) {
|
|
82
|
+
retireStaleFinding(projectId: $projectId, signature: $signature)
|
|
83
|
+
}
|
|
84
|
+
`);async function Er({config:e,cwd:r,lockfile:n}){let t=(await f({config:e,document:to,variables:{projectId:e.projectId}})).exploreFindings,i=await T(r,n);if(i.isErr())return s.info({block:i.error.kind},"skipping finding retire until next compile"),!1;let a=ao(t,i.value);return a.length===0||(await Promise.all(a.map(l=>lo(e,l))),s.info({count:a.length},"retired findings whose trail no longer replays")),!0}function ao(e,r){return e.map(n=>so(n,r)?n.signature:null).filter(n=>n!=null)}function so(e,r){let n=e.reproRun?.reproJson;if(n==null)return!0;let o=I(n);return o.kind==="rejected"?!0:Te(r,o.repro).kind==="unplannable"}function lo(e,r){return f({config:e,document:io,variables:{projectId:e.projectId,signature:r}})}var co=6e4;function Pr(e){let r={retiredKey:null,running:!1,stopped:!1},n=async()=>{if(!(r.running||r.stopped)){r.running=!0;try{r.retiredKey=await uo(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,co))},0)};return()=>{r.stopped=!0,clearTimeout(o.timer)}}async function uo({config:e,cwd:r},n){let o=await h(r),t=br();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 Er({config:e,cwd:r,lockfile:a.value})?i:n}import{Agent as po,fetch as fo}from"undici";var mo=3e4;function Ir(e=mo){let r=new po({bodyTimeout:e});return(n,o)=>fo(n,{...o,dispatcher:r})}function Tr(){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 yo from"fs";import Lr from"net";import{err as qr,ok as go}from"neverthrow";async function Hr({cwd:e,onConnection:r}){ue(e);let n=qe(e),o=await Cr({onConnection:r,socketPath:n});return o.isOk()||o.error.kind!=="stale-candidate"?o.map(Ar(n)).mapErr(Dr(n)):await So(n)?qr({kind:"already-running",socketPath:n}):(Wr(n),(await Cr({onConnection:r,socketPath:n})).map(Ar(n)).mapErr(Dr(n)))}function So(e){return new Promise(r=>{let n=Lr.connect(e);n.once("connect",()=>{n.destroy(),r(!0)}),n.once("error",()=>{r(!1)})})}async function Cr(e){let r=await ho(e);return r.kind==="listening"?go(r.server):qr(r.error)}function ho({onConnection:e,socketPath:r}){return new Promise(n=>{let o=Lr.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 Ar(e){return r=>({socketPath:e,close:()=>{r.close(),Wr(e)}})}function Wr(e){yo.rmSync(e,{force:!0})}function Dr(e){return r=>r.kind==="stale-candidate"?{kind:"already-running",socketPath:e}:{kind:"bind-failed",message:r.message}}import{randomUUID as Do}from"crypto";function Mr(){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 Or(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 bo(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 Ro(e,r);case"stopped":return{effects:[{ids:[...e.trails.keys()],kind:"abort"}],state:{...e,stopped:!0,trails:new Map}}}}function Ur(e,r,n){return K($r(e),jr(e,r,n)).health}function V(e,r,n){let o=xo(e,r,n),t={...e,...o,prevInteractiveActive:n.active},i=K($r(t),jr(t,r,n)),a=t.lockfile.kind!=="ready"&&!t.loading;return{effects:[...ko(a),...vo(i.abortIds),...wo({count:i.launchCount,maxTrailLength:t.desired.maxTrailLength})],state:{...t,loading:t.loading||a}}}function ko(e){return e?[{kind:"load"}]:[]}function vo(e){return e.length>0?[{ids:e,kind:"abort"}]:[]}function wo({count:e,maxTrailLength:r}){return e>0?[{count:e,kind:"launch",maxTrailLength:r}]:[]}function xo(e,r,n){return n.active<e.prevInteractiveActive?{backoffUntil:Math.max(e.backoffUntil,r+q)}:{backoffUntil:e.backoffUntil}}function bo(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 Ro(e,r){let n=new Map([...e.trails].filter(([i])=>i!==r.id)),o=Eo({...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 Eo(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+q),consecutiveErrors:0,coverageWaiting:xe(r.reason)}};case"app-unreachable":return X({now:n,state:e,subject:"app-unreachable"});case"error":return Po(e,r.error,n);case"done":return To(e,r.result)}}function Po(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:Io(r)})}function Io(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 To(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 Co=6,Ao=2e4;function X({now:e,state:r,subject:n}){let o=r.consecutiveErrors+1,t=Math.max(r.backoffUntil,e+q);if(o<Co)return{effects:[],state:{...r,backoffUntil:t,consecutiveErrors:o}};let i=r.lastUnhealthyReportAt==null||e-r.lastUnhealthyReportAt>=Ao;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 jr(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 _r(e){let r=Lo(e),n=Wo(()=>{r.dispatch(R())});return z(()=>{r.dispatch(R())}),r.dispatch(R()),{notifyQueueChange:()=>{r.dispatch({kind:"executor-changed",local:e.executorIsLocal()}),r.dispatch(R())},setDesired:o=>{r.dispatch({desired:o,kind:"desired-changed",now:Date.now(),queue:$()})},status:()=>Ho(r.current()),stop:()=>{n(),z(null),r.dispatch({kind:"stopped"})}}}function Lo(e){let r={draining:!1,planning:Promise.resolve(),queue:[],runtime:qo(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=Or(r.runtime.state,a);n(d=>({...d,state:l.state})),l.effects.forEach(d=>{Mo({commit:n,dispatch:o,effect:d,params:e,queuePlanning:t,runtime:r.runtime,current:()=>r.runtime})}),i()};return{dispatch:o,current:()=>r.runtime}}function qo(e){return{controllers:new Map,prepared:null,reservations:new Map,state:{...Mr(),executorLocal:e.executorIsLocal()}}}function Ho(e){return{explorer:Ur(e.state,Date.now(),$()),exploring:e.state.trails.size,progress:{attempts:e.state.attempts,findings:e.state.findings}}}function $(){let e=Ye();return{active:e.active,headedActive:e.headedActive,poolSize:e.poolSize,queued:e.queued}}function R(){return{kind:"tick",now:Date.now(),queue:$()}}function Wo(e){let r={timer:setTimeout(function n(){e(),r.timer=setTimeout(n,B)},B)};return()=>{clearTimeout(r.timer)}}function Mo({commit:e,current:r,dispatch:n,effect:o,params:t,queuePlanning:i,runtime:a}){switch(o.kind){case"load":case"reload":{Uo(t.cwd,a.prepared).then(({outcome:l,prepared:d})=>{e(c=>({...c,prepared:d})),n({kind:"load-settled",now:Date.now(),outcome:l}),n(R())});return}case"abort":{o.ids.forEach(l=>{a.controllers.get(l)?.abort()});return}case"launch":{Array.from({length:o.count}).forEach(()=>{let l=Oo({commit:e,dispatch:n});i(()=>$o({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 Oo({commit:e,dispatch:r}){let n=`explore:${Do()}`,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 Uo(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 T(e,o.value);if(t.isErr())return{outcome:{kind:"blocked",reason:t.error.kind},prepared:null};let i=Ee(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 $o({commit:e,controller:r,dispatch:n,id:o,maxTrailLength:t,params:i,prepared:a,reservedSignatures:l}){if(Fr(r.signal)){k({commit:e,dispatch:n,id:o,settled:{kind:"aborted"}});return}if(a==null){k({commit:e,dispatch:n,id:o,settled:{kind:"crashed",stage:"planning"}});return}let d=await jo({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){k({commit:e,dispatch:n,id:o,settled:{kind:"crashed",stage:"planning"}});return}if(Fr(r.signal)){k({commit:e,dispatch:n,id:o,settled:{kind:"aborted"}});return}if(i.onPlannerTrace?.(d),d.kind==="no-candidate"){k({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:()=>Fo({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=>{k({commit:e,dispatch:n,id:o,settled:u})})}function Fr(e){return e.aborted}async function jo({maxTrailLength:e,params:r,prepared:n,reservedSignatures:o}){let t=Date.now(),i=await r.leaseOrdinal(),a=await Pe({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 k({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:$(),settled:o})}async function Fo({assign:e,params:r,signal:n}){let o=await r.executeTrail(e,n);return o.kind==="aborted"?{kind:"aborted"}:o.kind==="error"?_o(r,o.error):{kind:"done",result:o}}async function _o(e,r){let n=await We(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 tt}from"gql.tada";import{connect as No}from"net";import zo from"ssh2";import{WebSocket as Nr,createWebSocketStream as Bo}from"ws";var Go="ripplo-";function Y(e){return Object.entries(e).map(([r,n])=>`${Go}${r}.${n}`)}var{Server:Ko,utils:Gr}=zo;function zr(){let e=Gr.generateKeyPairSync("ed25519"),r=Gr.parseKey(e.private);if(r instanceof Error)throw r;return{fingerprint:r.getPublicSSH().toString("base64"),privateKey:e.private}}function Br(e){return new Promise((r,n)=>{let o={closers:new Set,stopped:!1},t=new Nr(e.relayUrl,Y({grant:e.grant,role:"daemon-control"}));t.on("open",()=>{s.info("cloud-executor relay control up"),r({stop:Qo(t,o)})}),t.on("message",i=>{Jo(e,o,i)}),t.on("close",(i,a)=>{o.stopped||s.warn({code:i,reason:a.toString()},"relay control closed"),ot(e,o)}),t.on("error",i=>{n(i instanceof Error?i:new Error(String(i)))})})}function Qo(e,r){return()=>(r.stopped=!0,r.closers.forEach(n=>{n()}),e.close(),Promise.resolve())}function Jo(e,r,n){let o=Vo(n);o!=null&&Yo(e,r,o.pipeId)}function Vo(e){try{let r=JSON.parse(Xo(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 Xo(e){return Buffer.isBuffer(e)?e.toString("utf8"):Array.isArray(e)?Buffer.concat(e).toString("utf8"):Buffer.from(e).toString("utf8")}function Yo(e,r,n){if(r.stopped)return;let o=new Nr(e.relayUrl,Y({pipeId:n,role:"daemon-data"}));o.on("open",()=>{Zo(e,r,o)}),o.on("error",t=>{s.warn({err:t},"cloud-executor relay data pipe error")})}function Zo(e,r,n){let o=Bo(n);o.on("error",()=>{});let t=new Ko({hostKeys:[e.hostKey.privateKey]},a=>{a.on("error",l=>{s.warn({err:l},"cloud-executor ssh connection error")}),a.on("authentication",l=>{rt(l,e.secret)}),a.on("ready",()=>{a.on("tcpip",(l,d,c)=>{nt({accept:l,allowedPorts:e.allowedPorts,deny:d,destPort:c.destPort})})})}),i=()=>{n.close()};r.closers.add(i),n.on("close",()=>r.closers.delete(i)),et(t,o)}function et(e,r){e.injectSocket(r)}function rt(e,r){if(e.method==="password"&&e.password===r){e.accept();return}if(e.method==="none"){e.reject(["password"]);return}e.reject()}function nt({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=No({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 ot(e,r){r.stopped||(r.stopped=!0,r.closers.forEach(n=>{n()}),e.onFatal())}var it=tt(`
|
|
85
|
+
mutation EnterCloudMode(
|
|
86
|
+
$devSessionId: String!
|
|
87
|
+
$localUrl: String!
|
|
88
|
+
$engineUrl: String!
|
|
89
|
+
$hostKeyFingerprint: String!
|
|
90
|
+
) {
|
|
91
|
+
enterCloudMode(
|
|
92
|
+
devSessionId: $devSessionId
|
|
93
|
+
localUrl: $localUrl
|
|
94
|
+
engineUrl: $engineUrl
|
|
95
|
+
hostKeyFingerprint: $hostKeyFingerprint
|
|
96
|
+
) {
|
|
97
|
+
__typename
|
|
98
|
+
... on RelaySession {
|
|
99
|
+
generation
|
|
100
|
+
grant
|
|
101
|
+
relayUrl
|
|
102
|
+
secret
|
|
103
|
+
session
|
|
104
|
+
}
|
|
105
|
+
... on DevSessionEndedError {
|
|
106
|
+
message
|
|
107
|
+
}
|
|
108
|
+
... on TunnelNotConfiguredError {
|
|
109
|
+
message
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
`),j=class extends Error{failure;constructor(r){super(r.kind),this.failure=r}};async function Qr({config:e,devSessionId:r,onFatal:n}){let o=zr(),i=(await f({config:e,document:it,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 Br({allowedPorts:[...new Set([Kr(e.appUrl),Kr(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 Kr(e){let r=new URL(e);return r.port.length>0?Number(r.port):r.protocol==="https:"?443:80}var Jr=[1e3,3e3,8e3,15e3];function Vr(){return{attempt:0,desired:"local",devSessionId:null,stopped:!1,tunnel:"down"}}function Xr(e,r){if(e.stopped)return{effects:[],state:e};switch(r.kind){case"requested":return st(e,r.mode);case"connected":return Z({...e,devSessionId:r.devSessionId},[]);case"tunnel-started":return lt(e);case"tunnel-failed":case"tunnel-fatal":return dt(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 at(e){let r=Math.min(e,Jr.length-1),n=Jr[r];if(n==null)throw new Error("executor retry ladder is empty");return n}function st(e,r){return r===e.desired?{effects:[],state:e}:Z({...e,attempt:0,desired:r},[{kind:"notify-changed"}])}function Z(e,r){return F(e)&&e.tunnel==="down"&&e.devSessionId!=null?{effects:[...r,{devSessionId:e.devSessionId,kind:"start-tunnel"}],state:{...e,tunnel:"starting"}}:!F(e)&&e.tunnel!=="down"?{effects:[...r,{kind:"stop-tunnel"}],state:{...e,tunnel:"down"}}:{effects:r,state:e}}function F(e){return e.desired==="cloud"&&e.devSessionId!=null&&!e.stopped}function lt(e){return F(e)?{effects:[],state:{...e,attempt:0,tunnel:"up"}}:{effects:[{kind:"stop-tunnel"}],state:{...e,tunnel:"down"}}}function dt(e){let r={...e,tunnel:"down"};return F(r)?{effects:[{delayMs:at(r.attempt),kind:"schedule-retry"}],state:{...r,attempt:r.attempt+1}}:{effects:[],state:r}}function en(e){let r={draining:!1,io:Promise.resolve(),queue:[],retryTimer:null,state:Vr(),tunnel:null},n=o=>{r.queue.push(o),!r.draining&&(r.draining=!0,rn(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 rn(e,r,n){let o=e.queue.shift();if(o==null)return;let t=Xr(e.state,o);e.state=t.state,t.effects.forEach(i=>{ct({cell:e,dispatch:r,effect:i,params:n})}),rn(e,r,n)}function ct({cell:e,dispatch:r,effect:n,params:o}){switch(n.kind){case"start-tunnel":{Yr(e,()=>ut({cell:e,devSessionId:n.devSessionId,dispatch:r,params:o}));return}case"stop-tunnel":{let t=e.tunnel;e.tunnel=null,Zr(e),t!=null&&Yr(e,async()=>{await t.stop(),s.info("executor switched to local")});return}case"schedule-retry":{Zr(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 ut({cell:e,devSessionId:r,dispatch:n,params:o}){try{let t=await Qr({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 Yr(e,r){e.io=e.io.then(r).catch(n=>{s.warn({err:n},"executor io failed")})}function Zr(e){e.retryTimer!=null&&(clearTimeout(e.retryTimer),e.retryTimer=null)}import{graphql as pt}from"gql.tada";var ft=pt(`
|
|
114
|
+
mutation EndDevSessionWatch($projectId: String!, $cwd: String!, $devSessionId: String) {
|
|
115
|
+
endDevSession(projectId: $projectId, cwd: $cwd, devSessionId: $devSessionId) {
|
|
116
|
+
__typename
|
|
117
|
+
... on DevSession {
|
|
118
|
+
id
|
|
119
|
+
}
|
|
120
|
+
... on NoActiveDevSessionError {
|
|
121
|
+
message
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
`);function nn(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([f({config:e.config,document:ft,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 mt}from"fs/promises";import{existsSync as on}from"fs";import ee from"path";async function tn({config:e,cwd:r}){let n=ee.join(r,".ripplo","debug");await(await mt(n,{withFileTypes:!0}).catch(()=>[])).filter(i=>i.isDirectory()).map(i=>i.name).filter(i=>!i.startsWith("replay-")&&!i.startsWith("explore-")&&!on(ee.join(n,i,ce))&&on(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 yt}from"child_process";import an from"os";import{CancellationTokenSource as sn,ResponseError as ln}from"vscode-jsonrpc/node";function dn(e,r){return()=>{let n=yt(e,["run-worker"],{cwd:r,detached:!0,stdio:["ignore","inherit","inherit","ipc"]});return{connection:Xe(n),kill:()=>{gt(n)},onExit:o=>{n.once("exit",o)}}}}function cn(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 mn(r),{close:async()=>{r.closed=!0,await Promise.all([...r.workers].map(n=>re(n,r)))},execute:(n,o)=>kt(n,o,r),exploreTrail:(n,o)=>wt(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=>{bt(n,r)},updateSession:n=>{r.devSessionId=n.devSessionId,r.targetGeneration=n.targetGeneration}}}function gt(e){let r=e.pid;if(r!=null)try{process.kill(-r,"SIGKILL")}catch{e.kill("SIGKILL")}}var St=1e4,ht=1e4,un=-32800;async function kt(e,r,n){let o=await pn(n);if(o.runId=e.runId,!o.alive)return _(o,n),{outcome:{detail:"worker-exit",kind:"error"},serverNotified:!1};let t=new sn,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 vt(a,o)}finally{r.removeEventListener("abort",i),t.dispose(),_(o,n)}}async function pn(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=fn(e);return n.runId="pending",await n.ready,n}return new Promise(n=>{e.waiters.push(o=>{o.runId="pending",n(o)})})}function fn(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 _(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()},St);await n,clearTimeout(o)}function vt(e,r){return e instanceof ln&&e.code===un?{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 wt(e,r,n){let o=await pn(n);if(o.runId="explore",!o.alive)return _(o,n),{error:{detail:"worker-dead",source:"transport"},kind:"error"};let t=new sn,i={cancel:()=>{}},a=()=>{t.cancel();let l=setTimeout(()=>{o.worker.kill()},ht);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 xt(l)}finally{i.cancel(),r.removeEventListener("abort",a),t.dispose(),_(o,n)}}function xt(e){return e instanceof ln&&e.code===un?{kind:"aborted",ranCount:0}:{error:{detail:e instanceof Error?e.message.slice(0,120):"unknown",source:"transport"},kind:"error"}}function bt(e,r){r.size=e,e>an.availableParallelism()&&s.warn({cores:an.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)}),mn(r)}function mn(e){e.closed||Array.from({length:Math.max(0,e.size-e.workers.length)}).forEach(()=>{fn(e)})}var Ct=6e4,yn=500,At=15e3,Dt=Sn(`
|
|
126
|
+
mutation HeartbeatDevSessionWatch($id: String!) {
|
|
127
|
+
heartbeatDevSession(id: $id) {
|
|
128
|
+
__typename
|
|
129
|
+
... on DevSession {
|
|
130
|
+
id
|
|
131
|
+
}
|
|
132
|
+
... on DevSessionEndedError {
|
|
133
|
+
message
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
`),Lt=Sn(`
|
|
138
|
+
query WatchLocalConcurrency {
|
|
139
|
+
currentUser {
|
|
140
|
+
id
|
|
141
|
+
maxLocalConcurrentRuns
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
`);async function qs({exploreDebug:e}){Jt();let r=Kt(process.cwd()),n=r.cwd,o=Rt(),t=Gt(n),i={current:null},a={handler:()=>{}},l=en({config:r,onChanged:()=>{a.handler()}}),d={handler:()=>{}},c=zt(),u=Tr(),p=rr({config:r,cwd:n,executor:l.current,ready:c.promise,explorationStatus:()=>i.current?.status()??qt(),onShutdownRequest:()=>{d.handler()},sseHealth:()=>u.snapshot()}),m=await Bt({cwd:n,ipc:p,releasePid:t}),G=await P(n);G.isErr()&&(process.stderr.write(`ripplo: ${C(G.error)}
|
|
145
|
+
`),process.exit(1));let hn=G.value,v=await $t({config:r,synchronize:()=>Le({config:r,cwd:n,lockfile:hn})}),ne=await h(n);ne!=null&&Ze(ne);let g={devSessionId:v.devSessionId,targetGeneration:gn({devSessionId:v.devSessionId,nonce:o})},kn=Pr({config:r,cwd:n});b({cwd:n,paused:v.hooksPaused});let oe=Ae(n);oe!=null&&s.info("watching branch %s in %s",oe,n);let vn=Pt({fetchFn:Ir(),headers:{Authorization:`Bearer ${r.token}`},retry:pr,retryAttempts:1/0,url:`${r.ripploServerUrl}/graphql`});tn({config:r,cwd:n}).catch(()=>{});let w=await Ft({config:r,devSessionId:g.devSessionId,ipc:p,targetGeneration:g.targetGeneration}),E=Ht({config:r,exploreDebug:e,pool:w,currentSession:()=>g,executorIsLocal:()=>l.current()==="local"});i.current=E,a.handler=E.notifyQueueChange;let wn=await Mt({cwd:n,pool:w}),te=wr({claim:p.claim,config:r,devSessionId:v.devSessionId,executorSwitch:l,exploration:E,pool:w,sseClient:vn,sseHealth:u,onSynchronized:ie=>{g.devSessionId=ie.devSessionId,g.targetGeneration=gn({devSessionId:ie.devSessionId,nonce:o}),w.updateSession(g)}}),xn=Ut({config:r,session:te}),bn=Qt();c.resolve(),Ot(v.devSessionId),nn({config:r,executorSwitch:l,exploration:E,pool:w,releasePid:t,session:te,shutdownRef:d,socketHandle:m,spanReceiver:wn,stops:[xn,bn,kn]}),await new Promise(()=>{})}function qt(){return{explorer:{kind:"off"},exploring:0,progress:{attempts:0,findings:0}}}function Ht({config:e,currentSession:r,executorIsLocal:n,exploreDebug:o,pool:t}){return _r({appUrl:e.appUrl,cwd:e.cwd,executorIsLocal:n,onPlannerTrace:o?Wt: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 gn({devSessionId:e,nonce:r}){return{kind:"dev-session",value:`${e}:${r}`}}function Wt(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 Mt({cwd:e,pool:r}){return Ie({localDir:Et.join(e,".ripplo",".local"),writePortFile:!0,onRrwebBatch:()=>{},onSpan:n=>{let o=n.attributes["ripplo.run"];o!=null&&r.routeSpan(o,n)}})}function Ot(e){process.stdout.write(`${$e({devSessionId:e,version:se()})}
|
|
146
|
+
`)}function Ut({config:e,session:r}){let n=async()=>{try{let t=await f({config:e,document:Dt,variables:{id:r.getId()}});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()},At);return()=>{clearInterval(o)}}function $t({config:e,synchronize:r}){let n=e.ripploServerUrl.includes("localhost")||e.ripploServerUrl.includes("127.0.0.1");return It(async()=>{try{return await r()}catch(o){if(jt({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 Tt(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 jt({config:e,error:r}){let n=de(r);n==="UNAUTHENTICATED"&&(process.stderr.write(`ripplo: ${Ue()}
|
|
147
|
+
`),process.exit(1)),n==="FORBIDDEN"&&(process.stderr.write(`ripplo: ${Oe({projectId:e.projectId,serverUrl:e.ripploServerUrl})}
|
|
148
|
+
`),process.exit(1))}async function Ft({config:e,devSessionId:r,ipc:n,targetGeneration:o}){let t=await Xt(e);return _t({cwd:e.cwd,devSessionId:r,initialConcurrency:t,onProgress:n.progress,targetGeneration:o})}function _t({cwd:e,devSessionId:r,initialConcurrency:n,onProgress:o,targetGeneration:t}){return cn({devSessionId:r,initialSize:n,onProgress:o,spawn:dn(Yt(),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 Gt(e){try{return fe({cwd:e,onCompromised:Nt})}catch(r){throw r instanceof pe&&(process.stderr.write(`${je({cwd:r.cwd,pid:r.pid})}
|
|
149
|
+
`),process.exit(1)),r}}function Nt(){s.error("daemon lock compromised; shutting down"),process.stderr.write(`${Fe()}
|
|
150
|
+
`),process.exit(1)}function zt(){let e={handler:()=>{}};return{promise:new Promise(n=>{e.handler=n}),resolve:()=>{e.handler()}}}async function Bt({cwd:e,ipc:r,releasePid:n}){return(await Hr({cwd:e,onConnection:r.handleConnection})).match(t=>t,t=>{process.stderr.write(`${Me(t)}
|
|
151
|
+
`),n(),process.exit(1)})}function Kt(e){return y(e).match(r=>r,r=>{process.stderr.write(`${He(r)}
|
|
152
|
+
`),process.exit(1)})}function Qt(){N({maxRuns:yn});let e=setInterval(()=>{N({maxRuns:yn})},Ct);return()=>{clearInterval(e)}}function Jt(){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 Vt=4;async function Xt(e){try{let n=(await f({config:e,document:Lt,variables:void 0})).currentUser?.maxLocalConcurrentRuns;if(n!=null)return D(n),n}catch(r){s.warn({err:r},"failed to fetch local concurrency setting; using default")}return Vt}function Yt(){let e=process.argv[1];if(e==null)throw new Error("cli entry unavailable");return e}export{qs 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}from"./chunk-
|
|
4
|
+
import{a,b,c,d,e,f}from"./chunk-RIASQHPG.js";import"./chunk-C7SV6AR2.js";import"./chunk-HEOMRXZE.js";import"./chunk-NNH3YVVO.js";import"./chunk-KMZ3L5YA.js";export{e as DevLockHeldError,f as acquireDevLock,d as devPidPath,c as isDevSessionAlive,a as readDevPid,b as stopDevDaemon};
|
|
@@ -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{j as a,k as b,l as c,m as d,n as e}from"./chunk-7JKCHASU.js";import"./chunk-ZHDR7LXB.js";import"./chunk-KMZ3L5YA.js";export{a as LOCKFILE_RELATIVE_PATH,d as loadRipplo,b as loadRipploCached,c as loadRipploCachedWithFingerprint,e as ripploFingerprint};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __ripploCreateRequire } from "node:module";
|
|
3
|
+
const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
|
|
4
|
+
import"./chunk-KMZ3L5YA.js";import d from"fs";import r from"path";import o from"typescript";function l(t){let i=r.join(t,"index.ts"),e=g(t);d.mkdirSync(r.dirname(e.tsBuildInfoFile??""),{recursive:!0});let a=o.createIncrementalCompilerHost(e),s=o.createIncrementalProgram({host:a,options:e,rootNames:[i]}),u=[...s.getSyntacticDiagnostics(),...s.getSemanticDiagnostics()];s.emit();let c=u.filter(n=>f(n,t));if(c.length===0)return{diagnostics:[],ok:!0};let m={getCanonicalFileName:n=>n,getCurrentDirectory:()=>r.dirname(t),getNewLine:()=>`
|
|
5
|
+
`};return{diagnostics:o.formatDiagnosticsWithColorAndContext(c,m).split(`
|
|
6
|
+
`).filter(n=>n.length>0),ok:!1}}function f(t,i){let e=t.file?.fileName;return e==null?!0:e.startsWith(i)}var p=r.join(".local","tsbuildinfo");function g(t){return{allowImportingTsExtensions:!0,allowJs:!1,esModuleInterop:!0,incremental:!0,module:o.ModuleKind.Preserve,moduleResolution:o.ModuleResolutionKind.Bundler,noEmit:!0,noUncheckedIndexedAccess:!0,resolveJsonModule:!0,skipLibCheck:!0,strict:!0,target:o.ScriptTarget.ES2022,tsBuildInfoFile:r.join(t,p)}}function h(){let t=process.argv[2];if(t==null)throw new Error("DSL typecheck worker needs the .ripplo directory");process.stdout.write(JSON.stringify(l(t)))}h();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __ripploCreateRequire } from "node:module";
|
|
3
3
|
const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
|
|
4
|
-
import{
|
|
4
|
+
import{a as n}from"./chunk-MHNGR6M7.js";import{c as r}from"./chunk-KOKEEAEF.js";import{f as s}from"./chunk-KH4QH23U.js";import"./chunk-RIASQHPG.js";import"./chunk-C7SV6AR2.js";import"./chunk-HEOMRXZE.js";import"./chunk-NNH3YVVO.js";import"./chunk-KMZ3L5YA.js";import t from"fs";import a from"os";import l from"path";var w=r("PreToolUse",o=>{if(o.tool_name!=="ExitPlanMode"||!s(o.cwd))return;let i=p();if(i==null)return{hookSpecificOutput:{additionalContext:`Ripplo plan gate: no plan file found \u2014 the "Tests to implement" requirement was not checked. Before implementing, stub a .ripplo/workflows/ workflow per affected flow. ${n("discover")}`,hookEventName:"PreToolUse"}};let e=t.readFileSync(i,"utf8");if(!/\.ripplo\/tests|Tests to implement|No e2e coverage needed/.test(e))return{hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"deny",permissionDecisionReason:`Plan must cite ripplo test stubs. Add a "Tests to implement" section listing .ripplo/workflows/<id>.ts per affected flow, OR add "No e2e coverage needed: <reason>" if this plan touches no user-facing behavior. ${n("discover")}`}}});function p(){let o=l.join(a.homedir(),".claude","plans");return t.existsSync(o)?t.readdirSync(o).filter(e=>e.endsWith(".md")).map(e=>l.join(o,e)).map(e=>({full:e,mtime:t.statSync(e).mtimeMs})).sort((e,m)=>m.mtime-e.mtime)[0]?.full??null:null}export{w as exitPlanGateHook};
|
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
|
|
4
|
+
import{a as r,c as s}from"./chunk-4YAC72LW.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-6PUIWNIT.js");process.stderr.write(`${p(t)}
|
|
5
5
|
`),process.exit(1)});
|