ripplo 0.8.1 → 0.8.3
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-NWWET7CM.js → chunk-2MT2MZJW.js} +1 -1
- package/dist/{chunk-GD2AESFG.js → chunk-4FKGHWCC.js} +1 -1
- package/dist/{chunk-HGL5SE75.js → chunk-4W6WIT7T.js} +1 -1
- package/dist/{chunk-OAXYJKXD.js → chunk-5SM4TCSW.js} +2 -2
- package/dist/{chunk-TPTG6RR4.js → chunk-7TYUZIUO.js} +1 -1
- package/dist/chunk-7Z7RVHEL.js +7 -0
- package/dist/{chunk-WK7VO5JE.js → chunk-A7SHHSB3.js} +1 -1
- package/dist/{chunk-KSNZWWHX.js → chunk-AQ3DMGAY.js} +1 -1
- package/dist/{chunk-7YPITJA2.js → chunk-AVBP7Q2M.js} +1 -1
- package/dist/{chunk-WOHPPHUD.js → chunk-DBIXYJRB.js} +1 -1
- package/dist/{chunk-FCEWYZLQ.js → chunk-EGETJKAQ.js} +1 -1
- package/dist/chunk-EK6TENV6.js +4 -0
- package/dist/{chunk-ZH3HY7BS.js → chunk-ESOXRGIY.js} +1 -1
- package/dist/chunk-GD63CZVP.js +242 -0
- package/dist/{chunk-4AGLYPJ5.js → chunk-I2M24U3N.js} +2 -2
- package/dist/{chunk-PBL3TBB7.js → chunk-I5BHCICM.js} +1 -1
- package/dist/chunk-KOKEEAEF.js +6 -0
- package/dist/{chunk-CLFA4JSB.js → chunk-L7GWKDGD.js} +1 -1
- package/dist/{chunk-42LZFMNX.js → chunk-LEFXRK53.js} +1 -1
- package/dist/{chunk-VYQ5CDRX.js → chunk-LKYTQXPR.js} +1 -1
- package/dist/{chunk-EXV2RD7Z.js → chunk-M7VQD4VO.js} +1 -1
- package/dist/{chunk-G22LPS47.js → chunk-N2B5GZPU.js} +1 -1
- package/dist/{chunk-FZIMQTFG.js → chunk-OY6HNCAZ.js} +1 -1
- package/dist/chunk-PE5WVWI5.js +48 -0
- package/dist/{chunk-TEP6ETHQ.js → chunk-PXZV5X3C.js} +1 -1
- package/dist/{chunk-U4LC56T3.js → chunk-SWOTFHBR.js} +1 -1
- package/dist/{chunk-XGMM2RKR.js → chunk-T5VLZ43M.js} +1 -1
- package/dist/{chunk-4DXOF4WS.js → chunk-UVYCSHOJ.js} +1 -1
- package/dist/{chunk-VETETUHZ.js → chunk-XBD3OTIW.js} +1 -1
- package/dist/{chunk-3SCOYB4C.js → chunk-XWUIRXMS.js} +1 -1
- package/dist/{cli-error-J7LD2VWZ.js → cli-error-SLG6JHK2.js} +1 -1
- package/dist/compile-write-7AV66JUA.js +4 -0
- package/dist/daemon-EGU25OUV.js +139 -0
- package/dist/{daemon-JJ6MZPIA.js → daemon-LFFCR3TB.js} +1 -1
- package/dist/{daemon-lock-FLZHWM2F.js → daemon-lock-LTQMLU4Q.js} +1 -1
- package/dist/{dsl-loader-IOQUYVQH.js → dsl-loader-H25XGSHJ.js} +1 -1
- package/dist/{exit-plan-gate-TTJ7U2AP.js → exit-plan-gate-BNAUL4FC.js} +1 -1
- package/dist/hook.js +1 -1
- package/dist/index.js +210 -211
- package/dist/{plan-reminder-Q4A5WM2G.js → plan-reminder-VMBDQTAP.js} +1 -1
- package/dist/post-edit-2VFE6QND.js +4 -0
- package/dist/post-edit-analyze-VETPP5Z4.js +4 -0
- package/dist/post-edit-flag-stubs-J3MCGLXI.js +4 -0
- package/dist/{pre-bash-run-gate-C73XUNRE.js → pre-bash-run-gate-PWLARIYK.js} +1 -1
- package/dist/pre-edit-Q4U5LSWG.js +4 -0
- package/dist/{pre-edit-ripplo-skill-gate-63HGCUPG.js → pre-edit-ripplo-skill-gate-JD4BDCA3.js} +1 -1
- package/dist/{pre-edit-scope-gate-WIORRC2B.js → pre-edit-scope-gate-NZO4HVGT.js} +1 -1
- package/dist/{pre-edit-watch-gate-3VSMTCE4.js → pre-edit-watch-gate-EUZGEH2J.js} +1 -1
- package/dist/prompt-submit-MPRVCWOI.js +4 -0
- package/dist/scope-reminder-CBY4I5SG.js +4 -0
- package/dist/{session-preamble-HNQKBR27.js → session-preamble-IHBGHKCW.js} +1 -1
- package/dist/solve-worker.js +1 -1
- package/dist/status-UBUNHH5O.js +4 -0
- package/dist/{stop-enforce-I27VU4IR.js → stop-enforce-UXBQRTFP.js} +1 -1
- package/dist/{tasks-reminder-A4AIFNQJ.js → tasks-reminder-LKSUZUFD.js} +1 -1
- package/dist/{track-skill-load-3IPC45UX.js → track-skill-load-CJ74GD3Q.js} +1 -1
- package/package.json +4 -4
- package/dist/chunk-G7ZQUZ2X.js +0 -242
- package/dist/chunk-HYHAOKYP.js +0 -7
- package/dist/chunk-IW2P4NKR.js +0 -4
- package/dist/chunk-LB2L72ZU.js +0 -48
- package/dist/chunk-S7GMY5LS.js +0 -6
- package/dist/compile-write-OKTXD7JL.js +0 -4
- package/dist/daemon-O2VR45XP.js +0 -139
- package/dist/post-edit-PMSJ6CLE.js +0 -4
- package/dist/post-edit-analyze-2AJVDFTK.js +0 -4
- package/dist/post-edit-flag-stubs-ORFV452V.js +0 -4
- package/dist/pre-edit-H6ZOQSXF.js +0 -4
- package/dist/prompt-submit-PSXSUTY3.js +0 -4
- package/dist/scope-reminder-TGDQCKLN.js +0 -4
- package/dist/status-QBBCVTXV.js +0 -4
|
@@ -0,0 +1,242 @@
|
|
|
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 We,f as Le,g as _e,j as He,n as Be,o as Ve,p as Ke,q as Je,r as Qe}from"./chunk-OY6HNCAZ.js";import{c as ze,e as Ge,g as Ye}from"./chunk-UVYCSHOJ.js";import{c as F}from"./chunk-LEFXRK53.js";import{d as qe}from"./chunk-4W6WIT7T.js";import{a as T}from"./chunk-R4ZTRVDQ.js";import{d as me}from"./chunk-FEHVIHVA.js";import{b as we}from"./chunk-2MT2MZJW.js";import{a as ve}from"./chunk-AVBP7Q2M.js";import{g as Ue,h as Ne}from"./chunk-EK6TENV6.js";import{b as Re,f as ke,g as he,h as Se}from"./chunk-AQ3DMGAY.js";import{c as j}from"./chunk-DBIXYJRB.js";import{a as ye,d as c,f as p}from"./chunk-PE5WVWI5.js";import{B as Ce,D as v,E as Ae,G as Te,H as Me,J as $e,O as Fe,U as je,V as Oe,Y as De,Z as $,a as be,b as xe,c as Y,d as k,e as I,f as Ee,g as Ie,i as M,z as Pe}from"./chunk-ESOXRGIY.js";import{M as A,N as g,i as C,l as E,m as ge}from"./chunk-5SM4TCSW.js";import zn from"p-retry";import{graphql as Xe}from"gql.tada";var Gn=Xe(`
|
|
5
|
+
query OpenFindingsForRetire($projectId: String!) {
|
|
6
|
+
exploreFindings(projectId: $projectId, status: open) {
|
|
7
|
+
signature
|
|
8
|
+
reproRun {
|
|
9
|
+
reproJson
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
`),Yn=Xe(`
|
|
14
|
+
mutation RetireStaleFinding($projectId: String!, $signature: String!) {
|
|
15
|
+
retireStaleFinding(projectId: $projectId, signature: $signature)
|
|
16
|
+
}
|
|
17
|
+
`);function Ze(e){zn(()=>Xn(e),{factor:2,minTimeout:200,retries:10}).catch(n=>{p.warn({err:n},"retire stale findings failed")})}async function Xn({config:e,cwd:n,lockfile:r}){let o=(await c({config:e,document:Gn,variables:{projectId:e.projectId}})).exploreFindings,i=await Ne(n,r);if(i==null){p.info("skipping finding retire \u2014 lockfile stamps stale, next compile writes them");return}let a=await Zn(o,i);a.length!==0&&(await Promise.all(a.map(s=>nr(e,s))),p.info({count:a.length},"retired findings whose trail no longer replays"))}async function Zn(e,n){return(await Promise.all(e.map(async t=>await er(t,n)?t.signature:null))).filter(t=>t!=null)}async function er(e,n){let r=e.reproRun?.reproJson;if(r==null)return!1;let t=Fe.safeParse(JSON.parse(r));return t.success?(await $(n,t.data)).kind==="unplannable":!1}function nr(e,n){return c({config:e,document:Yn,variables:{projectId:e.projectId,signature:n}})}import rr from"p-queue";var tr=4,or={"p0-ui":3,"p1-cli":2,"p2-cover":1,"p3-explore":0},O=new rr({concurrency:tr}),h={headedActive:0,interactiveActive:0,interactiveQueued:0},en={current:null};function Oo({headed:e,task:n,workClass:r}){let t=or[r];return r==="p3-explore"?O.add(n,{priority:t}):(h.interactiveQueued+=1,D(),O.add(()=>ir({headed:e,task:n}),{priority:t}))}function Do(e){!Number.isFinite(e)||e<1||(O.concurrency=Math.floor(e),D())}function X(){return{active:h.interactiveActive,headedActive:h.headedActive,poolSize:O.concurrency,queued:h.interactiveQueued}}function Uo(e){en.current=e}async function ir({headed:e,task:n}){h.interactiveQueued-=1,h.interactiveActive+=1,h.headedActive+=e?1:0,D();try{return await n()}finally{h.interactiveActive-=1,h.headedActive-=e?1:0,D()}}function D(){en.current?.()}import{randomUUID as xr}from"crypto";import{createId as Er}from"@paralleldrive/cuid2";import{CancellationTokenSource as Ir,ResponseError as Pr}from"vscode-jsonrpc/node";async function nn(e){try{return await fetch(e,{method:"HEAD",signal:AbortSignal.timeout(2e3)}),null}catch(n){return n instanceof Error?n.message:String(n)}}async function rn(e){try{return await fetch(e,{method:"HEAD",signal:AbortSignal.timeout(25e3)}),null}catch(n){return n instanceof Error?n.message:String(n)}}import{graphql as ar}from"gql.tada";var sr=ar(`
|
|
18
|
+
mutation DaemonCreateRun(
|
|
19
|
+
$id: String
|
|
20
|
+
$workflowId: String!
|
|
21
|
+
$testId: String
|
|
22
|
+
$clientVersion: String
|
|
23
|
+
$executor: RunExecutor
|
|
24
|
+
$target: RunTarget
|
|
25
|
+
$lockfileHash: String
|
|
26
|
+
) {
|
|
27
|
+
createRun(
|
|
28
|
+
id: $id
|
|
29
|
+
workflowId: $workflowId
|
|
30
|
+
testId: $testId
|
|
31
|
+
executor: $executor
|
|
32
|
+
target: $target
|
|
33
|
+
clientVersion: $clientVersion
|
|
34
|
+
lockfileHash: $lockfileHash
|
|
35
|
+
) {
|
|
36
|
+
__typename
|
|
37
|
+
... on MutationCreateRunSuccess {
|
|
38
|
+
data {
|
|
39
|
+
id
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
... on LimitExceededError {
|
|
43
|
+
code
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
`);async function tn(e){try{let r=(await c({config:e.config,document:sr,variables:lr(e)})).createRun;return r==null?U({detail:"create-run-null",type:"generic"}):r.__typename==="MutationCreateRunSuccess"?null:r.__typename==="LimitExceededError"?U({code:r.code,type:"limit"}):U({detail:r.__typename,type:"generic"})}catch(n){return dr(n)}}function lr({executor:e,lockfileHash:n,runId:r,target:t}){return{clientVersion:T(),executor:e,id:r,lockfileHash:n,target:e==="cloud"?"tunnel":void 0,testId:t.testId,workflowId:t.workflowId}}function U(e){return{kind:"dispatch-error",reason:e}}function dr(e){return e instanceof ye?{detail:e.message,kind:"infra-error"}:U({detail:e instanceof Error?e.message:String(e),type:"generic"})}import{graphql as ur}from"gql.tada";async function on(e,n){let t=(await c({config:e,document:cr,variables:{cwd:n,projectId:e.projectId}})).project?.devSession?.workflows??[];return new Map(t.flatMap(o=>o.tests.map(i=>[`${o.slug}/${i.slug}`,{testId:i.id,workflowId:o.id}])))}var cr=ur(`
|
|
48
|
+
query DaemonWorkflows($projectId: String!, $cwd: String!) {
|
|
49
|
+
project(id: $projectId) {
|
|
50
|
+
id
|
|
51
|
+
devSession(cwd: $cwd) {
|
|
52
|
+
id
|
|
53
|
+
workflows {
|
|
54
|
+
id
|
|
55
|
+
slug
|
|
56
|
+
tests {
|
|
57
|
+
id
|
|
58
|
+
slug
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
`);import{CancellationTokenSource as pr}from"vscode-jsonrpc/node";function Z(e){return`${e.workflowSlug}/${e.testSlug}`}function an(e){let{headed:n,inflight:r,jobId:t,lockfileHashValue:o,onExpire:i,runId:a,selection:s,timeoutMs:d}=e,u=Z(s),l=`${u}@${o}@${String(n)}`,f=r.get(l);if(f!=null)return f.jobIds.add(t),null;let y={cancellation:new pr,claimed:!1,claimKey:u,headed:n,inflightKey:l,jobIds:new Set([t]),runId:a,testName:s.testName,timer:null,workflowName:s.workflowName};return y.timer=setTimeout(()=>{N(r,y),i(y)},d),r.set(l,y),y}function N(e,n){n.timer!=null&&(clearTimeout(n.timer),n.timer=null),e.delete(n.inflightKey)}function ee(e,n){let r=[...e.values()].find(t=>t.runId===n&&!t.claimed);return r==null?null:(r.claimed=!0,r.timer!=null&&(clearTimeout(r.timer),r.timer=null),r)}function sn(e,n){[...e.values()].filter(r=>r.jobIds.has(n)).forEach(r=>{r.jobIds.delete(n),r.jobIds.size===0&&(N(e,r),r.cancellation.cancel())})}import{err as ne,ok as ln}from"neverthrow";function un({all:e,ids:n,lockfile:r}){if(e&&n.length>0)return ne({kind:"conflicting-flags"});if(e)return ln(r.workflows.filter(i=>!i.stub).flatMap(i=>i.tests.map(a=>k(a))));if(n.length===0)return ne({kind:"nothing-selected"});let t=n.map(i=>({id:i,refs:yr(r,i)})),o=t.filter(i=>i.refs.length===0).map(i=>i.id);return o.length>0?ne({kind:"unknown-ids",known:fr(r),unknown:o}):ln([...new Set(t.flatMap(i=>i.refs))])}function cn(e,n){let r=new Map(I(e).map(t=>[t.ref,{testName:t.test.name,testSlug:t.test.slug,workflowName:t.workflow.name,workflowSlug:g(t.workflow.name)}]));return n.map(t=>{let o=r.get(t);if(o==null)throw new Error(`selectionsFor: ref not in lockfile: ${t}`);return o})}function fr(e){return e.workflows.map(n=>g(n.name))}function yr(e,n){let r=e.workflows.find(t=>t.name===n||g(t.name)===g(n));return r!=null?r.tests.map(t=>k(t)):I(e).filter(t=>t.ref===n||dn(t.ref)===dn(n)).map(t=>t.ref)}function dn(e){let n=e.lastIndexOf("/");return n===-1?g(e):`${g(e.slice(0,n))}/${g(e.slice(n+1))}`}import{err as re,ok as pn}from"neverthrow";import{graphql as fn}from"gql.tada";async function yn({config:e,cwd:n,lockfile:r}){await gr({config:e,cwd:n,lockfile:r});let t=await kr(e);if(t.isErr())return re(t.error);let o=new Map(r.workflows.filter(a=>!a.stub).map(a=>[g(a.name),a])),i=[...new Set(t.value)].flatMap(a=>{let s=o.get(a);return s==null?[]:s.tests.map(d=>k(d))});return i.length===0?re({kind:"scope-empty"}):pn(i)}var mr=fn(`
|
|
65
|
+
mutation AddDirtyTestsToScope($projectId: String!, $cwd: String!, $workflowSlugs: [String!]!) {
|
|
66
|
+
addDirtyTestsToScope(projectId: $projectId, cwd: $cwd, workflowSlugs: $workflowSlugs) {
|
|
67
|
+
__typename
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
`);async function gr({config:e,cwd:n,lockfile:r}){let t=new Set(Ye(n)),o=r.workflows.filter(i=>i.sourcePath!=null&&t.has(i.sourcePath)).map(i=>g(i.name));o.length!==0&&await c({config:e,document:mr,variables:{cwd:e.cwd,projectId:e.projectId,workflowSlugs:o}}).catch(i=>{p.warn({err:i},"auto-scope of dirty tests failed")})}var Rr=fn(`
|
|
71
|
+
query ScopeSelection($projectId: String!, $cwd: String!) {
|
|
72
|
+
project(id: $projectId) {
|
|
73
|
+
id
|
|
74
|
+
devSession(cwd: $cwd) {
|
|
75
|
+
id
|
|
76
|
+
scopeItems {
|
|
77
|
+
id
|
|
78
|
+
workflow {
|
|
79
|
+
id
|
|
80
|
+
slug
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
`);async function kr(e){try{let r=(await c({config:e,document:Rr,variables:{cwd:e.cwd,projectId:e.projectId}})).project?.devSession?.scopeItems??[];return pn(r.flatMap(t=>t.workflow==null?[]:[t.workflow.slug]))}catch(n){return re({detail:n instanceof Error?n.message:String(n),kind:"scope-fetch-failed"})}}import{graphql as hr}from"gql.tada";var Sr=2e3,vr=hr(`
|
|
87
|
+
query DaemonCloudRunStatus($runId: String!) {
|
|
88
|
+
run(id: $runId) {
|
|
89
|
+
status
|
|
90
|
+
failureReason
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
`);function gn({config:e,onComplete:n,onStarted:r,runId:t,signal:o}){let i=!1,a,s=!1,d=async()=>{if(i||o.aborted)return;let u=await wr(e,t).catch(()=>"unknown");if(!(i||o.aborted)){if(!s&&(u==="running"||mn(u))&&(s=!0,r()),mn(u)){i=!0,n(br(u));return}a=setTimeout(()=>{d()},Sr)}};return d(),{stop:()=>{i=!0,a!=null&&clearTimeout(a)}}}async function wr(e,n){let t=(await c({config:e,document:vr,variables:{runId:n}})).run?.status;return t??"unknown"}function mn(e){return e==="passed"||e==="failed"||e==="cancelled"||e==="unready"}function br(e){return e==="passed"?{kind:"pass"}:e==="failed"?{detail:"failed",kind:"error"}:e==="cancelled"?{detail:"cancelled",kind:"error"}:e==="unready"?{detail:"unready",kind:"error"}:{detail:"unknown",kind:"error"}}var Cr=We(process.argv[1]),Ar=12e4,Tr=-32099,te=new Set,Rn=new Map;function Pi(e){te.add(e)}function Mr(e){let n=new AbortController;return e.isCancellationRequested?(n.abort(),n.signal):(e.onCancellationRequested(()=>{n.abort()}),n.signal)}function Ci(e){let n={...e,inflight:new Map,jobs:new Map};return{claim:r=>Dr(n,r),handleConnection:r=>{$r(n,r)},idle:()=>Sn(n)}}function $r(e,n){let r=Le(n);r.onRequest(Be,(t,o)=>Fr({connection:r,ctx:e,params:t,token:o})),r.onRequest(Ve,()=>{let t=X();return{active:t.active,bundleMtimeMs:Cr,queued:t.queued,sseHealth:e.sseHealth(),version:T(),...e.explorationStatus()}}),r.onRequest(Ke,()=>{let t=Sn(e);return t&&e.onShutdownRequest(),t}),r.onClose(()=>{jr(e,r)}),r.onError(t=>{p.warn({err:t},"ipc connection error")}),n.on("error",t=>{p.warn({err:t},"ipc socket error")}),r.listen()}function Sn(e){let n=X();return e.jobs.size===0&&n.active===0&&n.queued===0}async function Fr({connection:e,ctx:n,params:r,token:t}){let o=_e.safeParse(r);if(!o.success)throw kn({code:"bad-message"});await n.ready;let i=await Nr({config:n.config,cwd:n.cwd,message:o.data});if(i.kind==="error")throw kn(i.error);let a=xr(),s=new Ir;return t.onCancellationRequested(()=>{vn(n,a)}),n.jobs.set(a,{cancellation:s,connection:e,failed:0,notRun:0,passed:0,total:i.selections.length}),Vr({ctx:n,headed:o.data.headed,jobId:a,lockfileHashValue:i.lockfileHashValue,selections:i.selections,targetsByClaimKey:i.targetsByClaimKey,token:s.token}).catch(d=>{p.error({err:d},"ipc dispatch failed")}),{jobId:a,total:i.selections.length}}function kn(e){return new Pr(Tr,e.code,e)}function vn(e,n){let r=e.jobs.get(n);r!=null&&(r.cancellation.cancel(),e.jobs.delete(n),sn(e.inflight,n))}function jr(e,n){[...e.jobs.entries()].filter(([,r])=>r.connection===n).forEach(([r])=>{vn(e,r)})}function wn(e,n,r){let t=e.jobs.get(n);t!=null&&(hn(()=>t.connection.sendNotification(Je,{event:r,jobId:n})),r.kind==="test-outcome"&&(Or(t,r.outcome.kind),t.passed+t.failed+t.notRun>=t.total&&(hn(()=>t.connection.sendNotification(Qe,{failed:t.failed,jobId:n,notRun:t.notRun,passed:t.passed})),e.jobs.delete(n))))}function hn(e){Promise.resolve().then(e).catch(n=>{p.warn({err:n},"ipc notification failed")})}function Or(e,n){if(n==="pass"){e.passed+=1;return}if(n==="dispatch-error"||n==="dispatch-timeout"||n==="infra-error"){e.notRun+=1;return}e.failed+=1}function w(e,n,r){n.jobIds.forEach(t=>{wn(e,t,r)})}function Dr(e,n){let r=ee(e.inflight,n);return r==null?null:{headed:r.headed,token:r.cancellation.token,finished:(t,o)=>{e.inflight.delete(r.inflightKey),w(e,r,{kind:"test-outcome",outcome:o,runId:r.runId,testName:r.testName,workflowName:r.workflowName})},started:()=>{w(e,r,{kind:"test-started",runId:r.runId,testName:r.testName,workflowName:r.workflowName})}}}function Ur(e){return e.kind==="typecheck-failed"?e.diagnostics.slice(0,5):e.kind==="invalid-lockfile"?e.issues.slice(0,5):e.kind==="load-threw"?[e.message]:[]}async function Nr({config:e,cwd:n,message:r}){return(await ke(n)).match(o=>qr({config:e,cwd:n,lockfile:o,message:r}),o=>Promise.resolve({error:{code:"compile-failed",detail:o.kind,diagnostics:[...Ur(o)]},kind:"error"}))}async function qr({config:e,cwd:n,lockfile:r,message:t}){let o=await nn(e.appUrl);if(o!=null)return{error:{code:"app-unreachable",detail:o,url:e.appUrl},kind:"error"};let i=await rn(e.engineUrl);if(i!=null)return{error:{code:"engine-unreachable",detail:i,url:e.engineUrl},kind:"error"};let a=await Ge(n);if(a==null)return{error:{code:"sync-failed",detail:"lockfile-missing"},kind:"error"};if(!te.has(a)){let d=await Lr({config:e,cwd:n,lockfile:r});if(d!=null)return{error:{code:"sync-failed",detail:d},kind:"error"};te.add(a),Ze({config:e,cwd:n,lockfile:r})}return(await _r({config:e,cwd:n,lockfile:r,message:t})).match(async d=>({kind:"ready",lockfileHashValue:a,selections:cn(r,d),targetsByClaimKey:await Wr({config:e,cwd:n,hash:a})}),d=>Promise.resolve({error:d,kind:"error"}))}async function Wr({config:e,cwd:n,hash:r}){let t=Rn.get(r);if(t!=null)return t;let o=await on(e,n);return Rn.set(r,o),o}async function Lr(e){try{return await ze(e),null}catch(n){return n instanceof Error?n.message:String(n)}}async function _r({config:e,cwd:n,lockfile:r,message:t}){return!t.all&&t.tests.length===0?(await yn({config:e,cwd:n,lockfile:r})).mapErr(Hr):un({all:t.all,ids:t.tests,lockfile:r}).mapErr(Br)}function Hr(e){return e.kind==="scope-empty"?{code:"selection-nothing-selected"}:{code:"scope-failed",detail:e.detail}}function Br(e){switch(e.kind){case"conflicting-flags":return{code:"selection-conflicting-flags"};case"nothing-selected":return{code:"selection-nothing-selected"};case"unknown-ids":return{code:"selection-unknown-ids",known:[...e.known],unknown:[...e.unknown]}}}async function Vr(e){await e.selections.reduce((n,r)=>n.then(()=>Kr(e,r)),Promise.resolve())}async function Kr(e,n){let{ctx:r,headed:t,jobId:o,lockfileHashValue:i,targetsByClaimKey:a,token:s}=e;if(s.isCancellationRequested)return;let d=Z(n),u=a.get(d);if(u==null){wn(r,o,{kind:"test-outcome",outcome:{kind:"dispatch-error",reason:{detail:"test-not-found",type:"generic"}},runId:"",testName:n.testName,workflowName:n.workflowName});return}let l=an({headed:t,inflight:r.inflight,jobId:o,lockfileHashValue:i,runId:Er(),selection:n,timeoutMs:Ar,onExpire:m=>{w(r,m,{kind:"test-outcome",outcome:{detail:"dispatch-timeout",kind:"dispatch-timeout"},runId:"",testName:m.testName,workflowName:m.workflowName})}});if(l==null)return;let f=r.executor(),y=await Jr({ctx:r,executor:f,lockfileHashValue:i,run:l,target:u});if(y!=null){N(r.inflight,l),w(r,l,{kind:"test-outcome",outcome:y,runId:"",testName:n.testName,workflowName:n.workflowName});return}f==="cloud"&&Qr(r,l)}function Jr({ctx:e,executor:n,lockfileHashValue:r,run:t,target:o}){return tn({config:e.config,executor:n,lockfileHash:r,runId:t.runId,target:o})}function Qr(e,n){let r=ee(e.inflight,n.runId);r!=null&&gn({config:e.config,runId:r.runId,signal:Mr(r.cancellation.token),onComplete:t=>{e.inflight.delete(r.inflightKey),w(e,r,{kind:"test-outcome",outcome:t,runId:r.runId,testName:r.testName,workflowName:r.workflowName})},onStarted:()=>{w(e,r,{kind:"test-started",runId:r.runId,testName:r.testName,workflowName:r.workflowName})}})}import zr from"fs";import Gr from"path";async function Di(e){let n=Gr.join(e,".ripplo","index.ts");if(!zr.existsSync(n))return{appUrl:void 0,engineUrl:void 0,errors:[{message:".ripplo/index.ts not found",path:""}],valid:!1,warnings:[]};let r=await Se(e);return r.isErr()?{appUrl:void 0,engineUrl:void 0,errors:[{message:ve(r.error),path:".ripplo/"}],valid:!1,warnings:[]}:me().match(t=>({appUrl:t.appUrl,engineUrl:t.engineUrl,errors:[],valid:!0,warnings:[]}),t=>({appUrl:void 0,engineUrl:void 0,errors:[{message:we(t),path:""}],valid:!1,warnings:[]}))}async function Ui(e){try{await fetch(e,{method:"HEAD",signal:AbortSignal.timeout(5e3)});return}catch{return`appUrl (${e}) is not responding. Make sure your dev server is running on that port.`}}async function Ni({appUrl:e,engineUrl:n}){let r=n.startsWith("http://")||n.startsWith("https://")?n:`${e}${n}`;try{return(await fetch(`${r}/setup`,{body:JSON.stringify({}),headers:{"Content-Type":"application/json"},method:"PUT",signal:AbortSignal.timeout(5e3)})).ok?"Engine endpoint accepted an unsigned request \u2014 webhook signature verification may be missing.":void 0}catch{return}}import{createMessageConnection as bn,IPCMessageReader as xn,IPCMessageWriter as En,NotificationType as Yr,NotificationType0 as In,RequestType as Pn,RequestType0 as Xr}from"vscode-jsonrpc/node";import{z as R}from"zod";var Bi=R.object({headed:R.boolean(),runId:R.string().min(1),testRef:R.string().min(1)}),Vi=R.object({lockfileJson:R.string().optional(),unavailable:R.string().optional()}),Ki=R.object({runId:R.string().min(1),span:ge}),Ji=R.object({outcome:He,serverNotified:R.boolean()}),Qi=new In("worker/ready"),zi=new Pn("worker/run"),Gi=new Xr("worker/lockfile"),Yi=new Pn("worker/exploreTrail"),Xi=new Yr("worker/span"),Zi=new In("worker/shutdown");function ea(e){let n=bn(new xn(e),new En(e));return n.listen(),n}function na(){let e=bn(new xn(process),new En(process));return e.listen(),e}import{gzipSync as st}from"zlib";import{appendFileSync as lt,existsSync as W,readFileSync as $n,writeFileSync as Mn}from"fs";import S from"path";import{graphql as ie}from"gql.tada";function q(e){return[e.kind,e.target,e.value].filter(n=>n.length>0).join(" ")}function Cn(e,n){return{kind:"finding",payload:rt(e),source:"verifier",step:n.step,stepIndex:n.stepIndex,timeNanos:n.timeNanos}}var Zr={"no-effect":"noEffect","required-state-unsatisfied":"requiredStateUnsatisfied",unresolvable:"unresolvable"},et={"data-rule":"dataRule",fact:"fact",step:"step"},nt={aborted:"aborted","action-failed":"actionFailed","app-not-ready":"appNotReady","check-failed":"checkFailed","client-mount-missing":"clientMountMissing","conflicting-sessions":"conflictingSessions","driver-launch":"driverLaunch","engine-decode":"engineDecode","engine-http":"engineHttp","engine-network":"engineNetwork","engine-unreachable":"engineUnreachable","setup-missing-row":"setupMissingRow","state-identity":"stateIdentity"};function rt(e){return e.kind==="consistency"?{kind:"mismatch",mismatch:at(e.mismatch),pending:e.pending,wait:e.budget,waitMs:Y[e.budget]}:e.kind==="pending-check"?{...tt(e.source),kind:"pendingCheck",source:et[e.source.kind],wait:e.budget,waitMs:Y[e.budget]}:e.kind==="unrunnable"?{kind:"unrunnable",reason:Zr[e.reason],unmet:e.unmet==null?void 0:Me(e.unmet)}:e.kind==="impossible-action"?{action:ot(e.step.action),kind:"impossibleAction",subject:Tn(e.step.action)}:e.kind==="lift-visibility"?{declaredIndex:e.declaredIndex,kind:"liftVisibility",subject:E(e.locator),visibleIndex:e.visibleIndex}:{errorKind:nt[e.error.kind],kind:"driverError",message:it(e.error)}}function tt(e){return"check"in e?An(e.check,!1):{checkKind:null,expected:null,negated:!1,subject:Ce(e.dataRule)}}function An(e,n){return e.kind==="not"?An(e.inner,!n):e.kind==="browser"?{checkKind:"browser",expected:e.value??null,negated:n,subject:be(e.key)}:e.kind==="value"||e.kind==="text"?{checkKind:e.kind,expected:e.value,negated:n,subject:E(e.locator)}:{checkKind:e.kind,expected:null,negated:n,subject:E(e.locator)}}function ot(e){return`${e.kind} ${Tn(e)}`.trim()}function Tn(e){return e.locator==null?e.url??"":E(e.locator)}function it(e){return"message"in e?e.message:"detail"in e?e.detail:null}function at(e){if(e.kind==="wrong-value")return{actual:v(e.sut),entity:e.entity,expected:v(e.snapshot),field:e.field,key:e.key,kind:"wrongValue"};if(e.kind==="expected-change"){let n=e.direction==null?"change":e.direction.replace(/d$/,"");return{actual:v(e.value),entity:e.entity,expected:`${n} from ${v(e.from)}`,field:e.field,key:e.key,kind:"expectedChange"}}return e.kind==="scalar-mismatch"?{actual:v(e.sut),expected:Ae(e.want),kind:"scalarMismatch",subject:Pe(e.subject),subjectKey:xe(e.subject)}:e.kind==="missing-row"?{entity:e.entity,key:e.key,kind:"missingRow"}:{entity:e.entity,key:e.key,kind:"unexpectedRow"}}function _({config:e,fixturesDir:n,headed:r}){return{baseUrl:e.appUrl,engineUrl:e.engineUrl,fixturesDir:n,generate:C,headed:r,secret:e.webhookSecret}}async function ae(e){let n=H(e);await se(e.config,e.runId,n)}function H({debugDir:e,events:n,recordingOptional:r,runId:t,stepSources:o}){let i=le(n),a=gt(e,t);if(a==null&&!r)throw new Error("recording-missing");let s=i.map((u,l)=>Pt({aliases:[...ht(n),...St(i)],generated:vt(n),generatedSingletons:wt(n),origin:a==null?mt(i):a.origin,record:u,rrwebEvents:a==null?[]:a.events,sourceTest:o?.[l]??null})),d=i.flatMap(u=>u.findings.map(l=>Cn(l,{step:q(A(u.source,u.index)),stepIndex:u.index,timeNanos:Fn(u)})));return dt({debugDir:e,events:[...s,...d],runId:t}),i}function dt({debugDir:e,events:n,runId:r}){if(n.length===0)return;let t=S.join(e,r,"behavior.jsonl");if(!W(t))return;let o=n.map(i=>JSON.stringify(i)).join(`
|
|
94
|
+
`);lt(t,`${o}
|
|
95
|
+
`)}function Fn(e){return String(BigInt(Math.max(0,Math.round(e.endMs)))*1000000n)}async function se(e,n,r){let t=r.filter(a=>a.findings.length>0).length,o=r.length-t,i=r.reduce((a,s)=>a+Math.max(0,s.endMs-s.startMs),0);await c({config:e,document:Tt,variables:{items:[{duration:i,failCount:t,firstFailedStepTitle:ut(r),passCount:o,runId:n,status:t>0?"failed":"passed"}]}})}function ut(e){let n=e.filter(r=>r.findings.length>0).toSorted((r,t)=>r.index-t.index).at(0);return n==null?null:q(A(n.source,n.index))}function le(e){return e.flatMap(n=>n.kind==="step"?[{annotations:n.annotations,endMs:n.endMs,findings:n.findings,index:n.index,source:n.source,startMs:n.startMs,state:n.state,url:n.url}]:[])}async function jn(e,n){await c({config:e,document:Mt,variables:{runIds:[n]}})}var L=".uploaded";async function ct({config:e,debugDir:n,runId:r}){let t=S.join(n,r),o=S.join(t,"behavior.jsonl");if(W(S.join(t,L)))return;if(!W(o)){p.warn({runId:r},"behavior upload skipped: behavior.jsonl missing on disk");return}await[0,1e3,3e3].reduce((a,s)=>a.then(async d=>d?!0:(await new Promise(u=>setTimeout(u,s)),pt({behaviorPath:o,config:e,runDir:t,runId:r}))),Promise.resolve(!1))}async function pt({behaviorPath:e,config:n,runDir:r,runId:t}){try{let o=await c({config:n,document:At,variables:{runId:t}}),i=await fetch(o.debugArtifactUploadUrl,{body:st($n(e)),headers:{"content-type":yt},method:"PUT"});return i.ok?(await jn(n,t),Mn(S.join(r,L),""),!0):(p.warn({runId:t,status:i.status},"behavior upload PUT failed"),!1)}catch(o){return ft(o)?(p.warn({runId:t},"behavior upload refused by server; run unknown \u2014 not retrying"),Mn(S.join(r,L),""),!0):(p.warn({error:o,runId:t},"behavior upload failed"),!1)}}function ft(e){if(typeof e!="object"||e==null||!("errors"in e))return!1;let{errors:n}=e;return Array.isArray(n)&&n.some(r=>{if(typeof r!="object"||r==null||!("extensions"in r))return!1;let{extensions:t}=r;return typeof t=="object"&&t!=null&&"code"in t&&t.code==="FORBIDDEN"})}var yt="application/x-ndjson";function mt(e){return e.reduce((n,r)=>Math.min(n,r.startMs),e[0]?.startMs??0)}function gt(e,n){let r=S.join(e,n,"behavior.jsonl");if(!W(r))return null;let t=$n(r,"utf8").split(`
|
|
96
|
+
`).filter(i=>i.length>0).map(i=>Rt(i)).flatMap(i=>kt(i)?[i.event]:[]),o=t[0];return o==null?null:{events:t,origin:o.timestamp}}function Rt(e){return JSON.parse(e)}function kt(e){return typeof e=="object"&&e!=null&&Reflect.get(e,"kind")==="rrweb"}function ht(e){return e.flatMap(n=>n.kind==="world"?n.aliases:[])}function St(e){return e.flatMap(n=>{let r=bt(n.source);return r.flatMap(t=>{let i=r.filter(s=>s.entity===t.entity).indexOf(t),a=n.state.rows.filter(s=>s.status==="created"&&s.entity===t.entity).at(i);return a==null?[]:[{alias:t.as,entity:t.entity,key:a.key}]})})}function vt(e){return new Set(e.flatMap(n=>n.kind==="world"?n.generated.map(r=>On(r)):[]))}function On({entity:e,field:n,key:r}){return`${e} ${r} ${n}`}function wt(e){return new Set(e.flatMap(n=>n.kind==="world"?n.generatedSingletons:[]))}function bt(e){return e==null?[]:e.expect.flatMap(n=>oe(n))}function oe(e){return e.kind==="state"&&e.assertion.kind==="created"?[{as:e.assertion.as,entity:e.entity}]:e.kind==="and"?e.predicates.flatMap(n=>oe(n)):e.kind==="when"?e.branches.flatMap(n=>n.consequence.flatMap(r=>oe(r))):[]}var xt=3,Et=0;function It({endMs:e,rrwebEvents:n,startMs:r}){let t=n.find(o=>o.type===xt&&o.data?.source===Et&&o.timestamp>=r&&o.timestamp<=e);return t==null?r:t.timestamp}function Pt({aliases:e,generated:n,generatedSingletons:r,origin:t,record:o,rrwebEvents:i,sourceTest:a}){let s=A(o.source,o.index),d=It({endMs:o.endMs,rrwebEvents:i,startMs:o.startMs});return{annotations:[...o.annotations.map(l=>({ephemeral:l.ephemeral,kind:l.kind,label:l.label,outcome:l.outcome,recordingStartMs:Math.max(0,(l.kind==="action"?d:l.atMs)-t),rrwebIds:[...l.rrwebIds],url:l.url,value:l.value??null}))],duration:Math.max(0,o.endMs-o.startMs),kind:"step",nodeType:s.kind,pageUrl:o.url,recordingEndMs:Math.max(0,o.endMs-t),recordingStartMs:Math.max(0,d-t),source:"verifier",sourceTest:a,stateRows:o.state.rows.map(l=>Ct({aliases:e,generated:n,row:l})),stateSingletons:o.state.singletons.map(l=>({changed:l.changed,generated:r.has(l.name),name:l.name,value:l.value==null?null:String(l.value)})),stepIndex:o.index,timeNanos:Fn(o),title:q(s)}}function Ct({aliases:e,generated:n,row:r}){let t=e.find(o=>o.entity===r.entity&&o.key===r.key);return{entity:r.entity,fields:r.fields.map(o=>({changed:o.changed,field:o.field,generated:n.has(On({entity:r.entity,field:o.field,key:r.key})),value:o.value==null?null:String(o.value)})),key:r.key,label:t?.alias??r.key,status:r.status}}var At=ie(`
|
|
97
|
+
mutation DebugArtifactUploadUrl($runId: String!) {
|
|
98
|
+
debugArtifactUploadUrl(runId: $runId)
|
|
99
|
+
}
|
|
100
|
+
`),Tt=ie(`
|
|
101
|
+
mutation CompleteRunsBatch($items: [CompleteRunItem!]!) {
|
|
102
|
+
completeRunsBatch(items: $items) {
|
|
103
|
+
id
|
|
104
|
+
status
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
`),Mt=ie(`
|
|
108
|
+
mutation MarkRunArtifactsUploadedBatch($runIds: [String!]!) {
|
|
109
|
+
markRunArtifactsUploadedBatch(runIds: $runIds)
|
|
110
|
+
}
|
|
111
|
+
`);import{graphql as b}from"gql.tada";function $t(e){let n=e.trail;if(!(n==null||!Ft(e.kind)))return{baseLabel:n.baseLabel,baseState:n.baseState,durationMs:n.durationMs,outcome:e.kind,runId:e.runId,signature:n.signature,steps:n.steps}}function Ft(e){return e==="clean"||e==="flaky"||e==="finding"}async function de({baseState:e,category:n,config:r,debugDir:t,devSessionId:o,events:i,lockfileHash:a,reproJson:s,runId:d,signature:u,spec:l,stepSources:f,summary:y,workflowSlug:m}){await c({config:r,document:Nt,variables:{devSessionId:o??null,lockfileHash:a??null,projectId:r.projectId,reproJson:s,runId:d,spec:l??null,workflowSlug:m??null}}),await ae({config:r,debugDir:t,events:i,recordingOptional:!0,runId:d,stepSources:f}),await c({config:r,document:qt,variables:{baseState:e,category:n,projectId:r.projectId,reproRunId:d,signature:u,summary:y}})}async function B(e,n,r){return(await c({config:e,document:Wt,variables:{lockfileHash:r,projectId:e.projectId,signature:n}})).exploreFindingExists}async function jt({attempts:e,config:n,devSessionId:r,findings:t,trail:o}){await c({config:n,document:Dt,variables:{attempts:e,devSessionId:r,findings:t,trail:o==null?null:{baseLabel:o.baseLabel,baseState:o.baseState,durationMs:o.durationMs,findingRunId:o.runId??null,findingSignature:o.signature??null,outcome:o.outcome,steps:o.steps.map(i=>({test:i.test,text:i.text}))}}})}async function Ot(e,n){return(await c({config:e,document:Ut,variables:{devSessionId:n}}).catch(t=>(p.warn({error:t},"reportExploreUnhealthy failed"),null)))?.reportExploreUnhealthy??!1}var Dt=b(`
|
|
112
|
+
mutation RecordExplorationProgress(
|
|
113
|
+
$devSessionId: String!
|
|
114
|
+
$attempts: Int!
|
|
115
|
+
$findings: Int!
|
|
116
|
+
$trail: ExploreTrailInput
|
|
117
|
+
) {
|
|
118
|
+
recordExplorationProgress(
|
|
119
|
+
devSessionId: $devSessionId
|
|
120
|
+
attempts: $attempts
|
|
121
|
+
findings: $findings
|
|
122
|
+
trail: $trail
|
|
123
|
+
)
|
|
124
|
+
}
|
|
125
|
+
`),Ut=b(`
|
|
126
|
+
mutation ReportExploreUnhealthy($devSessionId: String!) {
|
|
127
|
+
reportExploreUnhealthy(devSessionId: $devSessionId)
|
|
128
|
+
}
|
|
129
|
+
`),Nt=b(`
|
|
130
|
+
mutation CreateExploreRun(
|
|
131
|
+
$projectId: String!
|
|
132
|
+
$runId: String!
|
|
133
|
+
$devSessionId: String
|
|
134
|
+
$lockfileHash: String
|
|
135
|
+
$spec: String
|
|
136
|
+
$reproJson: String
|
|
137
|
+
$workflowSlug: String
|
|
138
|
+
) {
|
|
139
|
+
createExploreRun(
|
|
140
|
+
projectId: $projectId
|
|
141
|
+
runId: $runId
|
|
142
|
+
devSessionId: $devSessionId
|
|
143
|
+
lockfileHash: $lockfileHash
|
|
144
|
+
spec: $spec
|
|
145
|
+
reproJson: $reproJson
|
|
146
|
+
workflowSlug: $workflowSlug
|
|
147
|
+
) {
|
|
148
|
+
id
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
`),qt=b(`
|
|
152
|
+
mutation SubmitExploreFinding(
|
|
153
|
+
$projectId: String!
|
|
154
|
+
$signature: String!
|
|
155
|
+
$summary: String!
|
|
156
|
+
$baseState: String!
|
|
157
|
+
$category: ExploreFindingCategory!
|
|
158
|
+
$reproRunId: String!
|
|
159
|
+
) {
|
|
160
|
+
submitExploreFinding(
|
|
161
|
+
projectId: $projectId
|
|
162
|
+
signature: $signature
|
|
163
|
+
summary: $summary
|
|
164
|
+
baseState: $baseState
|
|
165
|
+
category: $category
|
|
166
|
+
reproRunId: $reproRunId
|
|
167
|
+
) {
|
|
168
|
+
id
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
`),Sa=b(`
|
|
172
|
+
mutation SetExploreFindingStatus(
|
|
173
|
+
$projectId: String!
|
|
174
|
+
$signature: String!
|
|
175
|
+
$status: ExploreFindingStatus!
|
|
176
|
+
) {
|
|
177
|
+
setExploreFindingStatus(projectId: $projectId, signature: $signature, status: $status)
|
|
178
|
+
}
|
|
179
|
+
`),Wt=b(`
|
|
180
|
+
query ExploreFindingExists($projectId: String!, $signature: String!, $lockfileHash: String!) {
|
|
181
|
+
exploreFindingExists(projectId: $projectId, signature: $signature, lockfileHash: $lockfileHash)
|
|
182
|
+
}
|
|
183
|
+
`);import Ht from"path";import{graphql as Bt}from"gql.tada";import{graphql as V}from"gql.tada";function ue(e){switch(e.kind){case"app-not-ready":return"appNotReady";case"client-mount-missing":return"appNotReady";case"engine-network":case"engine-http":return"backendUnreachable";case"engine-unreachable":return"engineUnreachable";case"engine-decode":case"state-identity":case"setup-missing-row":case"conflicting-sessions":case"driver-launch":case"action-failed":case"check-failed":case"aborted":return null}}async function ce(e,n,r){await c({config:e,document:Lt,variables:{reason:r,runId:n}}).catch(t=>{p.error(t,"failRun submission failed")})}async function pe(e,n,r){await c({config:e,document:_t,variables:{cause:r,runId:n}}).catch(t=>{p.error(t,"markRunUnready submission failed")})}var xa=V(`
|
|
184
|
+
mutation ReleaseRun($runId: String!) {
|
|
185
|
+
releaseRun(runId: $runId)
|
|
186
|
+
}
|
|
187
|
+
`),Ea=V(`
|
|
188
|
+
mutation HeartbeatRun($runId: String!) {
|
|
189
|
+
heartbeatRun(runId: $runId)
|
|
190
|
+
}
|
|
191
|
+
`),Lt=V(`
|
|
192
|
+
mutation FailRun($runId: String!, $reason: String!) {
|
|
193
|
+
failRun(runId: $runId, reason: $reason)
|
|
194
|
+
}
|
|
195
|
+
`),_t=V(`
|
|
196
|
+
mutation MarkRunUnready($runId: String!, $cause: RunUnreadyCause!) {
|
|
197
|
+
markRunUnready(runId: $runId, cause: $cause)
|
|
198
|
+
}
|
|
199
|
+
`);async function Vt({config:e,cwd:n,errorSettle:r,fixturesDir:t,headed:o,lockfile:i,onPhase:a,runId:s,session:d,signal:u,test:l}){if(!await Jt(e,s))return{outcome:{kind:"dispatch-failed",reason:"already-claimed",runId:s},persisted:Promise.resolve()};let y=Ht.join(n,".ripplo","debug"),m=[];return(await d.runOnce({capture:!0,lockfile:i,onPhase:a,options:_({config:e,fixturesDir:t,headed:o}),params:void 0,runId:s,sequence:void 0,test:l,onEvent:x=>{m.push(x)}},u)).match(async x=>{let fe=le(m),z=fe.flatMap(Qn=>Qn.findings),G=Kt(z);if(G!=null)return H({config:e,debugDir:y,events:m,recordingOptional:!0,runId:s,stepSources:void 0}),await Dn({config:e,error:G,errorSettle:r,runId:s}),{outcome:{error:G,kind:"error",runId:s},persisted:Promise.resolve()};await se(e,s,fe),H({config:e,debugDir:y,events:m,recordingOptional:!0,runId:s,stepSources:void 0});let Jn=Promise.resolve();return{outcome:z.length>0?{findings:z,kind:"findings",runId:s}:{kind:"pass",runId:s},persisted:Jn}},async x=>(await Dn({config:e,error:x,errorSettle:r,runId:s}),{outcome:{error:x,kind:"error",runId:s},persisted:Promise.resolve()}))}async function Dn({config:e,error:n,errorSettle:r,runId:t}){if(r==="defer")return;let o=ue(n);if(o!=null){await pe(e,t,o);return}await ce(e,t,M(n))}function Kt(e){let n=e.find(r=>r.kind==="driver-error"&&Ie(r.error));return n!=null&&n.kind==="driver-error"?n.error:void 0}async function Jt(e,n){return((await c({config:e,document:Qt,variables:{runIds:[n]}})).startRunsBatch??[]).some(t=>t.id===n)}var Qt=Bt(`
|
|
200
|
+
mutation StartRunsBatch($runIds: [String!]!) {
|
|
201
|
+
startRunsBatch(runIds: $runIds) {
|
|
202
|
+
id
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
`);import{randomUUID as zt}from"crypto";async function Gt({assign:e,config:n,debugDir:r,devSessionId:t,fixturesDir:o,headed:i,lockfile:a,report:s,session:d,signal:u}){let l=Ee(a);if(e.stepRuns.length===0)return{kind:"error",reason:"empty-trail"};let f=ao(l,e.stepRuns),y=await De({baseState:{name:k(e.baseStateTest),test:e.baseStateTest},corpus:l,lockfile:a,options:_({config:n,fixturesDir:o,headed:i}),seenSignature:s?P=>B(n,P,e.lockfileHash):void 0,session:d,stepRuns:e.stepRuns,runIdFor:P=>`explore-${zt()}-${String(P)}`},u),m=s?await ro({baseStateTest:e.baseStateTest,config:n,debugDir:r,devSessionId:t,lockfileHash:e.lockfileHash,outcome:y,reproJson:eo(l,e),stepSources:no(f)}):!1;return Zt(y,f.length),so(y,m,Yt(f,e,y))}function Yt(e,n,r){if(r.kind==="error"||r.kind==="aborted")return;let t=r.timing.confirm;return{baseLabel:n.baseStateTest.intent,baseState:k(n.baseStateTest),durationMs:Math.round(K(r.timing.detect)+(t==null?0:K(t))),signature:r.kind==="finding"||r.kind==="seen"?r.signature:void 0,steps:Xt(e.slice(0,r.ranCount))}}function Xt(e){return e.flatMap(n=>{let r=n.label.split("#")[0]??n.label;return n.actions.map(t=>({test:r,text:t}))})}function K(e){return e.engineMs+e.worldMs+e.browserMs+e.driveMs+e.teardownMs}function Zt(e,n){if(e.kind==="error"){p.info({detail:M(e.error),kind:e.kind,reason:e.error.kind,steps:n},"explore trail");return}if(e.kind==="aborted"||e.kind==="seen"){p.info({kind:e.kind,steps:n},"explore trail");return}let r=e.timing.detect,t=e.timing.confirm;p.info({browserMs:r.browserMs,confirmMs:t==null?void 0:K(t),detectMs:K(r),driveMs:r.driveMs,engineMs:r.engineMs,kind:e.kind,steps:n,teardownMs:r.teardownMs,worldMs:r.worldMs},"explore trail")}function eo(e,n){let r=n.stepRuns.flatMap(o=>{let i=e[o.idx];return i==null?[]:[{index:i.index,params:o.params,test:i.test}]}),t={baseStateRef:k(n.baseStateTest),steps:r};return JSON.stringify(t)}function no(e){return e.flatMap(n=>{let r=n.label.split("#")[0]??n.label;return n.actions.map(()=>r)})}async function ro({baseStateTest:e,config:n,debugDir:r,devSessionId:t,lockfileHash:o,outcome:i,reproJson:a,stepSources:s}){return i.kind!=="finding"||i.captureEvents.length===0?!1:await B(n,i.signature,o)?(p.info({devSessionId:t,signature:i.signature},"explore finding already reported, skipping duplicate"),!1):(await de({baseState:i.baseState,category:to(i.verifierLayer),config:n,debugDir:r,devSessionId:t,events:i.captureEvents,lockfileHash:o,reproJson:a,runId:i.runId,signature:i.signature,spec:io(e,i.captureEvents),stepSources:s,summary:oo(i.captureEvents,i.title),workflowSlug:i.sourceTest?.split("/")[0]}).catch(d=>{p.warn({error:d},"explore finding report failed")}),!0)}function to(e){return e==="data-rule"?"dataRule":e==="model-drift"?"modelDrift":e}function oo(e,n){let r=e.flatMap(t=>t.kind==="step"?[...t.findings]:[]).at(0);if(r!=null)return Te(r);if(n!=null)return n;throw new Error("explore finding has no findings to summarize")}function io(e,n){let r=n.flatMap(o=>o.kind==="step"?[o.source]:[]),t={absent:e.absent,actor:e.actor,exclusive:e.exclusive,intent:e.intent,maybe:[],name:e.name,params:e.params,singletons:e.singletons,steps:r,stub:!1,tests:[],viewports:[e.viewport],world:e.world};return JSON.stringify(t)}function ao(e,n){return n.flatMap(r=>{let t=e[r.idx];return t==null?[]:[{actions:[...t.nav,...t.steps].map(o=>$e(o.action)),label:`${t.test}#${String(t.index)}`}]})}function so(e,n,r){return e.kind==="error"?{kind:e.kind,reason:`runtime:${e.error.kind}`}:e.kind==="finding"?{kind:e.kind,runId:n?e.runId:void 0,trail:r}:{kind:e.kind,trail:r}}import lo from"path";import{randomUUID as uo}from"crypto";async function rs({cwd:e,onReady:n,signal:r,step:t,target:o}){let i=F(e).match(f=>({config:f}),f=>({failure:f}));if("failure"in i)return{failure:i.failure,kind:"config-failed"};let a=i.config,s=await he(e);if(s.result.isErr())return{error:s.result.error,kind:"compile-failed"};let d=await Ue(e,s.result.value),u=await co(d,o);return u.kind!=="ok"?u:(await je({lockfile:d,onReady:n,options:po(a),runId:`teleport-${uo()}`,sequence:u.sequence,stopAfterStep:t,test:u.test},r)).match(f=>({kind:"done",result:f}),f=>({error:f,kind:"run-failed"}))}async function co(e,n){if(n.kind==="explore"){let t=await $(e,n.repro);return t.kind==="unplannable"?{kind:"unplannable"}:{kind:"ok",sequence:t.sequence,test:t.baseTest}}let r=I(e).find(t=>t.ref===n.ref);return r==null?{kind:"no-test",ref:n.ref}:{kind:"ok",sequence:Oe(e,r.test,void 0),test:r.test}}function po(e){return{baseUrl:e.appUrl,engineUrl:e.engineUrl,fixturesDir:lo.join(e.cwd,Re),generate:C,headed:!0,secret:e.webhookSecret}}function fo(e){let{backoffActive:n,exploreEnabled:r,headedActive:t,interactiveActive:o,interactiveQueued:i}=e,{explorationActive:a,exploreConcurrency:s,poolSize:d}=e;if(!r||t||o>0||i>0)return{abortCount:a,refillCount:0};if(n)return{abortCount:0,refillCount:0};let u=Math.min(s,d-1);return{abortCount:0,refillCount:Math.max(0,u-a)}}function os(e){let n={active:new Map,backoffUntil:0,cancelBackoffTimer:null,cancelHeartbeat:null,prevInteractiveActive:e.probe().interactiveActive,stopped:!1};return qn(n,e),{explorationActive:()=>n.active.size,notifyQueueChange:()=>{mo(n,e)},stalled:()=>Ro(n,e),stop:()=>{n.stopped=!0,n.cancelBackoffTimer?.(),n.cancelBackoffTimer=null,n.cancelHeartbeat?.(),n.cancelHeartbeat=null,Ln(n,n.active.size)}}}function qn(e,n){e.stopped||(e.cancelHeartbeat=n.setTimer(()=>{J(e,n),qn(e,n)},15e3))}function J(e,n){if(e.stopped)return;yo(e,n);let r=n.probe(),t=fo({backoffActive:n.now()<e.backoffUntil,explorationActive:e.active.size,exploreConcurrency:n.exploreConcurrency(),exploreEnabled:n.exploreEnabled(),headedActive:r.headedActive>0,interactiveActive:r.interactiveActive,interactiveQueued:r.interactiveQueued,poolSize:r.poolSize});Ln(e,t.abortCount),_n({count:t.refillCount,params:n,state:e})}function yo(e,n){Wn(e,n).forEach(({controller:r})=>{r.abort()})}function Wn(e,n){let r=n.now()-9e4;return[...e.active.values()].filter(t=>t.startedAt<=r)}function Ln(e,n){[...e.active.values()].slice(0,n).forEach(({controller:r})=>{r.abort()})}function mo(e,n){let r=n.probe();r.interactiveActive<e.prevInteractiveActive&&go(e,n),e.prevInteractiveActive=r.interactiveActive,J(e,n)}function go(e,n){e.backoffUntil=n.now()+3e4,e.cancelBackoffTimer?.(),e.cancelBackoffTimer=n.setTimer(()=>{e.cancelBackoffTimer=null,J(e,n)},3e4)}function Ro(e,n){return Wn(e,n).length}function _n({count:e,params:n,state:r}){if(e<=0)return;let t=ko(n.sources);t!=null&&(ho({params:n,pulled:t,state:r}),_n({count:e-1,params:n,state:r}))}function ko(e){return e.reduce((n,r)=>{if(n!=null)return n;let t=r.next();return t==null?null:{job:t,source:r}},null)}function ho({params:e,pulled:n,state:r}){let{job:t,source:o}=n,i=new AbortController;r.active.set(t.id,{controller:i,job:t,source:o,startedAt:e.now()}),e.execute({job:t,priority:o.priority,signal:i.signal}).then(()=>{Nn({job:t,outcome:Un(i.signal,null),params:e,source:o,state:r})}).catch(a=>{Nn({job:t,outcome:Un(i.signal,{error:a}),params:e,source:o,state:r})})}function Un(e,n){return e.aborted?{kind:"aborted"}:n==null?{kind:"completed"}:{error:n.error,kind:"error"}}function Nn({job:e,outcome:n,params:r,source:t,state:o}){o.active.delete(e.id),t.onResult(e,n),J(o,r)}import{graphql as Eo}from"gql.tada";import{err as Q,ok as Vn}from"neverthrow";import So,{AbortError as vo}from"p-retry";import{graphql as Hn}from"gql.tada";var wo=Hn(`
|
|
206
|
+
query AwaitDevSession($projectId: String!, $cwd: String!) {
|
|
207
|
+
project(id: $projectId) {
|
|
208
|
+
devSession(cwd: $cwd) {
|
|
209
|
+
id
|
|
210
|
+
executor
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
`);async function Bn(e){return So(async()=>{let t=(await c({config:e,document:wo,variables:{cwd:e.cwd,projectId:e.projectId}})).project?.devSession;if(t!=null)return{executor:t.executor,id:t.id,kind:"active"};throw j(e.cwd)?new Error("starting"):new vo("missing")},{factor:1,maxTimeout:400,minTimeout:400,retries:25}).catch(()=>j(e.cwd)?{kind:"starting"}:{kind:"missing"})}var bo=Hn(`
|
|
215
|
+
query DevSessionCheckHealth($projectId: String!, $cwd: String!) {
|
|
216
|
+
activeDevSessions(projectId: $projectId) {
|
|
217
|
+
id
|
|
218
|
+
cwd
|
|
219
|
+
branch
|
|
220
|
+
}
|
|
221
|
+
project(id: $projectId) {
|
|
222
|
+
id
|
|
223
|
+
devSession(cwd: $cwd) {
|
|
224
|
+
id
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
`);function ps(e){switch(e.status){case"active":return e.gitMidOperation?"\u2713 Dev session: ripplo daemon is live (hooks auto-paused while git is mid-merge/rebase/cherry-pick \u2014 they resume when the operation ends)":"\u2713 Dev session: ripplo daemon is live for this directory";case"starting":return"! Dev session: the daemon is running locally but hasn't registered with the server yet. Wait a few seconds and re-run `npx ripplo doctor`. If it persists, check the daemon output for auth or network errors.";case"missing":{let n="\u2717 Dev session: no daemon running for this directory. Start `npx ripplo daemon` as a background process (separate from your app's dev server). Without it, `npx ripplo run` refuses to dispatch and scope/coverage hooks won't arm.";return e.elsewhere.length===0?n:[n," A daemon is running for a different directory:",...xo(e.elsewhere)].join(`
|
|
229
|
+
`)}}}async function fs(e){let n=j(e),r=qe(e),t=F(e).unwrapOr(void 0);if(t==null)return{elsewhere:[],gitMidOperation:r,status:n?"starting":"missing",type:"dev-session"};let o=await c({config:t,document:bo,variables:{cwd:t.cwd,projectId:t.projectId}}).catch(()=>null);return o?.project?.devSession!=null?{elsewhere:[],gitMidOperation:r,status:"active",type:"dev-session"}:{elsewhere:(o?.activeDevSessions??[]).filter(s=>s.cwd!==t.cwd).map(s=>({branch:s.branch,cwd:s.cwd})),gitMidOperation:r,status:n?"starting":"missing",type:"dev-session"}}function xo(e){return e.map(n=>{let r=n.branch==null?"":` (${n.branch})`;return` - ${n.cwd}${r}`})}var Io=Eo(`
|
|
230
|
+
mutation SetDevSessionExecutor($devSessionId: String!, $executor: RunExecutor!) {
|
|
231
|
+
setDevSessionExecutor(devSessionId: $devSessionId, executor: $executor) {
|
|
232
|
+
__typename
|
|
233
|
+
... on DevSession {
|
|
234
|
+
id
|
|
235
|
+
executor
|
|
236
|
+
}
|
|
237
|
+
... on DevSessionEndedError {
|
|
238
|
+
message
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
`);async function hs(e){return(await Kn(e)).map(r=>r.executor)}async function Ss(e,n){let r=await Kn(e);if(r.isErr())return Q(r.error);let o=(await c({config:e,document:Io,variables:{devSessionId:r.value.id,executor:n}})).setDevSessionExecutor;return o==null?Q({kind:"empty-response"}):o.__typename!=="DevSession"?Q({kind:"session-ended"}):Vn(o.executor)}async function Kn(e){let n=await Bn(e);return n.kind==="active"?Vn({executor:n.executor,id:n.id}):Q({kind:n.kind==="starting"?"starting":"no-session"})}export{Bn as a,ps as b,fs as c,Di as d,Ui as e,Ni as f,Bi as g,Ki as h,Ji as i,Qi as j,zi as k,Gi as l,Yi as m,Xi as n,Zi as o,ea as p,na as q,Ze as r,Oo as s,Do as t,X as u,Uo as v,Pi as w,Mr as x,Ci as y,L as z,ct as A,ce as B,Vt as C,$t as D,jt as E,Ot as F,Gt as G,rs as H,os as I,hs as J,Ss as K};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __ripploCreateRequire } from "node:module";
|
|
3
3
|
const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
|
|
4
|
-
import{a as d,b as f,c as g}from"./chunk-
|
|
4
|
+
import{a as d,b as f,c as g}from"./chunk-T5VLZ43M.js";import{a as w}from"./chunk-I5BHCICM.js";import{c as u}from"./chunk-LEFXRK53.js";import{a as c}from"./chunk-7WZ3VIUU.js";import{f as m}from"./chunk-4W6WIT7T.js";import{a as i}from"./chunk-MHNGR6M7.js";import{e as a}from"./chunk-PE5WVWI5.js";import{graphql as h}from"gql.tada";var S=h(`
|
|
5
5
|
query ScopeReminder($projectId: String!, $cwd: String!) {
|
|
6
6
|
project(id: $projectId) {
|
|
7
7
|
id
|
|
@@ -18,6 +18,6 @@ import{a as d,b as f,c as g}from"./chunk-XGMM2RKR.js";import{a as w}from"./chunk
|
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
`),x=async t=>{let{cwd:e}=t;if(!c(e)||!m(e))return;let
|
|
21
|
+
`),x=async t=>{let{cwd:e}=t;if(!c(e)||!m(e))return;let p=d(e);if(f(e,"scope-reminder")===p)return;let r=u(e).unwrapOr(void 0);if(r==null)return;let s=await a({config:r,document:S,variables:{cwd:r.cwd,projectId:r.projectId}}).catch(()=>null);g(e,"scope-reminder",p);let n=s?.project?.devSession?.scopeItems??[];return w({cwd:e,scope:{available:s!=null,items:n.map(o=>b(o))}}),s==null?{hookSpecificOutput:{additionalContext:`Ripplo scope: unknown \u2014 server unreachable, scope guardrails are not enforcing. Check the dev session (\`npx ripplo doctor\`). ${i("start")}`,hookEventName:"UserPromptSubmit"}}:{hookSpecificOutput:{additionalContext:n.length===0?`Ripplo scope: empty. ${i("run")}`:`Ripplo scope (${String(n.length)}):
|
|
22
22
|
${n.map(o=>{let l=o.workflow;return l==null?` [intent] (${o.id}) ${o.label??""}`:` [${l.spec==null?"stub":"implemented"}] (${o.id}) ${l.slug}`}).join(`
|
|
23
23
|
`)}`,hookEventName:"UserPromptSubmit"}}};function b(t){let e=t.workflow;return e==null?{label:t.label,slug:null,status:"intent"}:{label:t.label,slug:e.slug,status:e.spec==null?"stub":"implemented"}}export{x as a};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __ripploCreateRequire } from "node:module";
|
|
3
3
|
const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
|
|
4
|
-
import{a as p}from"./chunk-JJ4QQPAV.js";import{b as l}from"./chunk-
|
|
4
|
+
import{a as p}from"./chunk-JJ4QQPAV.js";import{b as l}from"./chunk-4W6WIT7T.js";import{i as c}from"./chunk-PE5WVWI5.js";import{createHash as S}from"crypto";import{mkdirSync as b,readFileSync as v,writeFileSync as A}from"fs";import x from"path";import*as e from"zod/mini";import{createHash as P}from"crypto";import a from"picomatch";function m(t){return l(["diff","--name-only","HEAD"],t).split(`
|
|
5
5
|
`).filter(r=>r.length>0)}function g({cwd:t,ignoreGlobs:r,watchGlobs:n}){let o=a([...n]),i=a([...r]);return m(t).filter(s=>o(s)&&!i(s))}function z(t){return l(["ls-files","--others","--exclude-standard"],t).split(`
|
|
6
6
|
`).filter(r=>r.length>0)}function d({cwd:t,ignoreGlobs:r,watchGlobs:n}){let o=a([...n]),i=a([...r]);return z(t).filter(s=>o(s)&&!i(s))}var F=e.object({label:e.nullable(e.string()),slug:e.nullable(e.string()),status:e.enum(["intent","stub","implemented"])}),C=e.object({intent:e.string(),name:e.string(),sourcePath:e.nullable(e.string()),stub:e.boolean()}),R=e.object({changedAppFiles:e.readonly(e.array(e.string())),scope:e.object({available:e.boolean(),items:e.readonly(e.array(F))}),tests:e._default(e.readonly(e.array(C)),[]),untrackedAppFiles:e.readonly(e.array(e.string()))});function O({cwd:t,scope:r}){let n=h(t);u(t,{...f(t),scope:r,tests:n?.tests??[]})}function T({cwd:t,tests:r}){let n=h(t);u(t,{...f(t),scope:n?.scope??{available:!1,items:[]},tests:r??n?.tests??[]})}function h(t){let r=R.safeParse(k(y(t)));return r.success?r.data:null}function k(t){try{return JSON.parse(v(t,"utf8"))}catch{return null}}function y(t){return c(t,"coverage-context.json")}function u(t,r){let n=y(t);b(x.dirname(n),{recursive:!0});let o=S("sha256").update(JSON.stringify(r)).digest("hex");A(n,JSON.stringify({...r,inputHash:o},null,2))}function f(t){let{ignorePaths:r,watchPaths:n}=p(),o={cwd:t,ignoreGlobs:r,watchGlobs:n};return{changedAppFiles:g(o),untrackedAppFiles:d(o)}}export{O as a,T as b};
|
|
@@ -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
|
+
async function y(o,n){try{let t=n.trim()===""?{}:JSON.parse(n),u=await o.run(t);return{kind:"output",stdout:u==null?void 0:JSON.stringify(u)}}catch(t){return{error:t,kind:"crash"}}}function O({event:o,handlers:n,note:t}){return l(o,async u=>{let r=n.map(async e=>e(u)),s=Promise.all(r),k=r.map(async e=>{let i=await e;return i!=null&&H(i)?i:f()}),a=await Promise.race([s.then(()=>null),...k]);if(a!=null)return a;let c=(await s).filter(e=>e!=null).flatMap(e=>{let i=e.hookSpecificOutput,p=i!=null&&"additionalContext"in i?i.additionalContext:null;return p==null?[]:[p]});if(c.length!==0)return t(c.join(`
|
|
5
|
+
|
|
6
|
+
`))})}function l(o,n){return{event:o,run:async t=>{if(!d(o,t))throw new Error(`hook input is not a ${o} payload`);return await n(t)??void 0}}}function d(o,n){return typeof n=="object"&&n!==null&&"hook_event_name"in n&&n.hook_event_name===o}function H(o){if(o.decision==="block")return!0;let n=o.hookSpecificOutput;return n!=null&&"permissionDecision"in n&&n.permissionDecision==="deny"}function f(){return new Promise(()=>{})}export{y as a,O as b,l as c};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __ripploCreateRequire } from "node:module";
|
|
3
3
|
const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
|
|
4
|
-
import{b as a}from"./chunk-OWN4P2K7.js";import{a as s}from"./chunk-7WZ3VIUU.js";import{f as l}from"./chunk-
|
|
4
|
+
import{b as a}from"./chunk-OWN4P2K7.js";import{a as s}from"./chunk-7WZ3VIUU.js";import{f as l}from"./chunk-4W6WIT7T.js";import p from"path";import*as t from"zod/mini";var n=new Set(["Edit","Write","NotebookEdit"]),d=t.looseObject({file_path:t.string()}),c="create",k=e=>{if(!n.has(e.tool_name))return;let i=d.safeParse(e.tool_input);if(!i.success)return;let{cwd:o}=e;if(!s(o)||!l(o))return;let r=p.relative(o,i.data.file_path);if(!(r.startsWith("..")||r!==".ripplo"&&!r.startsWith(".ripplo/"))&&!a(o,e.session_id,c))return{hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"deny",permissionDecisionReason:`Editing \`.ripplo/\` files (${r}) requires the \`/ripplo:create\` skill loaded first. Load \`/ripplo:create\` then retry \u2014 it carries the DSL builder shape, model rules, and the parallelization guidance you'll need.`}}};export{k as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __ripploCreateRequire } from "node:module";
|
|
3
3
|
const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
|
|
4
|
-
import{a as c,d as s}from"./chunk-FEHVIHVA.js";import{
|
|
4
|
+
import{a as c,d as s}from"./chunk-FEHVIHVA.js";import{j as l}from"./chunk-PE5WVWI5.js";import{err as h,ok as P}from"neverthrow";import{z as n}from"zod";var g="https://ripplo.ai";function a(){return u().RIPPLO_SERVER_URL}function m(){return u().RIPPLO_PROJECT_ID}var v=n.object({RIPPLO_PROJECT_ID:n.string().min(1).optional(),RIPPLO_SERVER_URL:n.string().min(1).default(g)}),f;function u(){return f??=v.parse(process.env),f}import d from"fs";import i from"path";function R(o){let t=d.realpathSync(o),r=t,e=i.dirname(r);for(;e!==r;){if(d.existsSync(i.join(r,".git")))return r;r=e,e=i.dirname(r)}return t}function x(o){return c(o).andThen(t=>s().andThen(r=>{let e=a(),p=l(e);return p==null?h({kind:"not-authenticated"}):P({appUrl:r.appUrl,cwd:R(o),engineUrl:r.engineUrl,projectId:m()??t.projectId,ripploServerUrl:e,token:p,webhookSecret:r.webhookSecret})}))}export{a,u as b,x as c};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __ripploCreateRequire } from "node:module";
|
|
3
3
|
const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
|
|
4
|
-
import{a as c}from"./chunk-OQ6KNYPG.js";import{c as p}from"./chunk-
|
|
4
|
+
import{a as c}from"./chunk-OQ6KNYPG.js";import{c as p}from"./chunk-LEFXRK53.js";import{c as l}from"./chunk-FEHVIHVA.js";import{a}from"./chunk-MHNGR6M7.js";import{I as u,w as t}from"./chunk-ESOXRGIY.js";import{N as d}from"./chunk-5SM4TCSW.js";var f=3e3;async function S(e){l(e);let n=p(e).unwrapOr(void 0);if(n==null)return null;try{return await fetch(`${n.ripploServerUrl}/health`,{signal:AbortSignal.timeout(f)}),null}catch(r){return{detail:r instanceof Error?r.message:String(r),serverUrl:n.ripploServerUrl}}}function m(e){return e.includes("localhost")||e.includes("127.0.0.1")}import g from"fuse.js";function s(e){switch(e.kind){case"conflicting-flags":return"Pass either --all or test ids, not both.";case"nothing-selected":return`No tests selected \u2014 scope empty, no dirty .ripplo/workflows files. Pass test ids, add to scope (${a("run")}), or use --all.`;case"unknown-ids":{let n=e.known,r=e.unknown.flatMap(i=>y(i,n)),o=r.length>0?[`Did you mean: ${[...new Set(r)].join(", ")}`]:[];return[`Unknown ${e.unknown.length===1?"id":"ids"}: ${e.unknown.join(", ")}`,...o,"Pass a workflow slug for all its tests, or workflow/test for one. Known workflows:",...n.map(i=>` ${i}`)].join(`
|
|
5
5
|
`)}}}function L({failed:e,notRun:n,passed:r}){let o=n>0?`, ${String(n)} not run`:"";return`${String(r)} passed, ${String(e)} failed${o} (${String(r+e+n)} total)`}function A({debugDir:e,event:n}){let r=`${n.workflowName} \u2192 ${n.testName}`;if(n.kind==="test-started")return`${t.dim("run ")} ${r}`;switch(n.outcome.kind){case"pass":return`${t.good("pass")} ${r} ${t.dim(n.runId)}`;case"findings":return[`${t.bad("fail")} ${r} \u2014 ${c(n.outcome.findingLines.length,"finding")}`,...n.outcome.findingLines,u({debugDir:e,runId:n.runId}),`${t.dim("why")} npx ripplo explain ${n.runId}`].join(`
|
|
6
6
|
`);case"error":return`${t.bad("error")} ${r} \u2014 ${n.outcome.detail} ${t.dim(n.runId)}`;case"dispatch-error":return`${t.bad("error")} ${r} \u2014 ${w(n.outcome.reason)}`;case"dispatch-timeout":return`${t.bad("error")} ${r} \u2014 not run: dispatch timed out (transient): ${n.outcome.detail}`;case"infra-error":return`${t.bad("error")} ${r} \u2014 not run: Ripplo server unreachable: ${n.outcome.detail}`}}var h={MAX_AGENTS:"agent limit reached for your plan \u2014 upgrade to add more",MAX_CONCURRENT_RUNS:"concurrent run limit reached for your plan \u2014 upgrade or wait for runs to finish",MAX_PROJECTS:"project limit reached for your plan \u2014 upgrade to add more",MAX_RUNS:"run limit reached for your plan \u2014 enable overage or upgrade",OVERAGE_CAP:"overage cap reached \u2014 raise the cap or upgrade"};function j({detail:e,serverUrl:n}){return m(n)?`Ripplo server at ${n} not running (${e}). Start the dev server with \`pnpm dev\`.`:`Ripplo server at ${n} unreachable (${e}) \u2014 server-side, not your local environment.`}function N(e){switch(e.code){case"compile-failed":{let n=e.diagnostics.length===0?[]:["",...e.diagnostics];return[`Compilation failed in the daemon (${e.detail}). Run \`npx ripplo compile\` for full output.`,...n].join(`
|
|
7
7
|
`)}case"selection-conflicting-flags":return s({kind:"conflicting-flags"});case"selection-nothing-selected":return s({kind:"nothing-selected"});case"selection-unknown-ids":return s({kind:"unknown-ids",known:e.known,unknown:e.unknown});case"app-unreachable":return`Your dev server not responding at ${e.url} (${e.detail}) \u2014 your local environment, not the Ripplo server.`;case"engine-unreachable":return`Ripplo engine not responding at ${e.url} (${e.detail}) \u2014 adapter unmounted, behind a build error, or RIPPLO_ENGINE_URL points at the wrong path.`;case"scope-failed":return`Could not resolve the dev-session scope: ${e.detail}
|
|
@@ -1,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 i,C as s,F as d,i as o}from"./chunk-
|
|
4
|
+
import{A as i,C as s,F as d,i as o}from"./chunk-ESOXRGIY.js";function y(n){switch(n.kind){case"empty-response":return"ripplo daemon: cloud tunnel provisioning returned no result. Check server logs and retry.";case"server-error":return`ripplo daemon: cloud tunnel provisioning failed (${n.typename}). Run \`npx ripplo doctor\` to check your setup.`}}function x(n){switch(n.kind){case"already-running":return`ripplo daemon: daemon already running (socket ${n.socketPath}).`;case"bind-failed":return`ripplo daemon: failed to bind IPC socket: ${n.message}`}}function $({projectId:n,serverUrl:e}){return[`Project "${n}" (from .ripplo/project.json) was not found on ${e}, 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 b(){return"Not signed in. Run `npx ripplo auth login`, then start the daemon again."}function v({devSessionId:n,version:e}){return`ripplo daemon: v${e} ready as local executor for session ${n} (switch with \`npx ripplo executor cloud\` \u2014 Ctrl-C to stop)`}function S({cwd:n,pid:e}){return`ripplo daemon: another daemon is already running for this project${e==null?"":` (pid ${String(e)})`} (cwd ${n}) \u2014 this one is exiting. Run \`npx ripplo daemon status\` to inspect it, or \`npx ripplo daemon stop\` to stop it.`}function w(n){switch(n.kind){case"not-running":return"ripplo daemon: not running.";case"stopped":return`ripplo daemon: stopped (pid ${String(n.pid)}).`;case"timeout":return`ripplo daemon: pid ${String(n.pid)} did not exit within 10s \u2014 it may be finishing a run. Check again with \`npx ripplo daemon status\`.`}}function j(){return"ripplo daemon: lock compromised \u2014 another daemon likely took over this project. Shutting down."}function R(n){if(n.kind==="not-running")return"daemon: not running";if(n.kind==="unresponsive")return`daemon: running but no reply within ${String(n.timeoutMs/1e3)}s \u2014 likely busy executing runs, retry when the batch drains`;let{status:e}=n,r=e.version==null?"version unknown (pre-0.7.8)":`v${e.version}`,p=`${String(e.active)} active, ${String(e.queued)} queued`,u=m(e.explorer,e.exploring),t=`daemon: running (${r} | ${p} | ${u} | ${c(e.progress)})`;if(e.sseHealth!=null&&!e.sseHealth.ok){let l=e.sseHealth.detail==null?"":`: ${e.sseHealth.detail}`;return`${t}
|
|
6
6
|
daemon: cannot subscribe to run dispatch${l} \u2014 server-side, restarting the daemon will not help`}return t}function c(n){return n.attempts===0?"explore: idle":`explore: ${String(n.attempts)} attempts, ${String(n.findings)} findings`}function P(n){let e=n.daemonVersion==null?"an older build":`v${n.daemonVersion}`;return n.kind==="restarted"?`ripplo: daemon was on ${e} \u2014 restarted on the current build`:`ripplo: daemon is on a stale build (${e}) with runs in flight \u2014 rerun once it drains, or npx ripplo daemon restart`}function D(n){switch(n.kind){case"pass":return{kind:"pass"};case"findings":return{findingLines:g(n.findings).map(e=>d({evidencePath:`.ripplo/debug/${n.runId}/behavior.jsonl`,finding:e})),kind:"findings"};case"error":return{detail:o(n.error),kind:"error"};case"dispatch-failed":return{kind:"dispatch-error",reason:{detail:n.reason,type:"generic"}}}}function m(n,e){return n==="stalled"?"explorer: stalled \u2014 a wedged trail is restarting on its own, no action needed":`explorer: ${n}, ${String(e)} exploring`}function g(n){let e=new Set(n.flatMap(r=>h(r)?[a(r)]:[]));return n.filter(r=>!(f(r)&&e.has(a(r))))}function h(n){return n.kind==="pending-check"&&n.source.kind==="step"}function a(n){return n.kind!=="pending-check"||n.source.kind==="data-rule"?"":`${i(n.source.check)}|${s(n.step)}`}function f(n){return n.kind==="pending-check"&&n.source.kind==="fact"}export{y as a,x as b,$ as c,b as d,v as e,S as f,w as g,j as h,R as i,c as j,P as k,D as l};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __ripploCreateRequire } from "node:module";
|
|
3
3
|
const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
|
|
4
|
-
import{a as s}from"./chunk-7WZ3VIUU.js";import{e as p}from"./chunk-
|
|
4
|
+
import{a as s}from"./chunk-7WZ3VIUU.js";import{e as p}from"./chunk-4W6WIT7T.js";import{a as i}from"./chunk-MHNGR6M7.js";import{h as n}from"./chunk-AQ3DMGAY.js";import{c as a}from"./chunk-DBIXYJRB.js";import l from"fs";import d from"path";import*as r from"zod/mini";var c=new Set(["Edit","Write","NotebookEdit"]),u=r.looseObject({file_path:r.string()}),D=async t=>{if(!c.has(t.tool_name))return;let e=m(t);if(e==null)return;let{cwd:o}=t;return l.existsSync(p(o))||a(o)?void 0:(await n(o)).isErr()?{hookSpecificOutput:{additionalContext:`\`ripplo daemon\` isn't running and the DSL isn't compiling, so this edit is allowed through without dev-mode guardrails. Run \`npx ripplo compile\` to see the errors, or \`/ripplo:start\` to bring the daemon up. ${i("create","DSL authoring rules")}`,hookEventName:"PreToolUse"}}:{hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"deny",permissionDecisionReason:`\`ripplo daemon\` is not running \u2014 this edit to \`${e}\` won't sync and dev-mode guardrails won't fire. Run \`/ripplo:start\`, then retry (\`npx ripplo doctor\` checks the daemon and dev server). If the daemon can't start, the user can bypass with \`npx ripplo hooks pause\`. ${i("start")}`}}};function m(t){let e=u.safeParse(t.tool_input);if(!e.success||!s(t.cwd))return null;let o=d.relative(t.cwd,e.data.file_path);return o.startsWith("..")||o!==".ripplo"&&!o.startsWith(".ripplo/")?null:o}export{D as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __ripploCreateRequire } from "node:module";
|
|
3
3
|
const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
|
|
4
|
-
import{
|
|
4
|
+
import{i as c}from"./chunk-PE5WVWI5.js";import{spawnSync as y}from"child_process";import{existsSync as s,readdirSync as d,readFileSync as g,realpathSync as u,statSync as m}from"fs";import i from"path";var h=2e3;function L(t){if(t!=null)try{return m(u(t)).mtimeMs}catch{return}}function _(t){return y("pnpm",["turbo","run","build","--filter=ripplo..."],{cwd:t,stdio:"inherit"}).status===0}function D(){let t=process.argv[1];if(t==null)return{kind:"fresh"};let n=u(t),r=n.includes(`${i.sep}src${i.sep}`),o=p(i.dirname(n));if(o!=null)return r?{kind:"fresh"}:j(o);let a=p(process.cwd());return a!=null&&k(a)?{kind:"foreign-binary",workspaceRoot:a}:{kind:"fresh"}}function p(t){let n=i.dirname(t);return s(i.join(t,"pnpm-workspace.yaml"))?t:n===t?void 0:p(n)}function j(t){let n=i.join(t,"packages");if(!s(n))return{kind:"fresh"};let r=d(n).map(o=>({dist:i.join(n,o,"dist"),name:o,src:i.join(n,o,"src")})).filter(o=>s(o.src)&&s(o.dist)).filter(o=>l(o.src)>l(o.dist)+h).map(o=>o.name);return r.length===0?{kind:"fresh"}:{kind:"stale",packages:r,workspaceRoot:t}}function l(t){let n=m(t);if(!n.isDirectory())return n.mtimeMs;let r=d(t).map(o=>l(i.join(t,o)));return Math.max(n.mtimeMs,...r)}function k(t){let n=i.join(t,"packages","cli","package.json");if(!s(n))return!1;let r=JSON.parse(g(n,"utf8"));return typeof r=="object"&&r!=null&&"name"in r&&r.name==="ripplo"}import{createMessageConnection as S,NotificationType as f,RequestType as x,RequestType0 as b,SocketMessageReader as R,SocketMessageWriter as w}from"vscode-jsonrpc/node";import{z as e}from"zod";var E="daemon.sock",P="daemon.log";function J(t){return c(t,E)}function X(t){return c(t,P)}function G(t){return S(new R(t),new w(t))}var K=e.object({all:e.boolean(),headed:e.boolean(),tests:e.array(e.string())}),$=e.object({jobId:e.string(),total:e.number()}),M=e.enum(["on","off","stalled"]),q=e.object({attempts:e.number(),findings:e.number()}),B=e.object({active:e.number(),bundleMtimeMs:e.number().optional(),explorer:M,exploring:e.number(),progress:q,queued:e.number(),sseHealth:e.object({detail:e.string().optional(),ok:e.boolean()}).optional(),version:e.string().optional()}),v=e.enum(["MAX_RUNS","OVERAGE_CAP","MAX_AGENTS","MAX_CONCURRENT_RUNS","MAX_PROJECTS"]),I=e.discriminatedUnion("type",[e.object({code:v,type:e.literal("limit")}),e.object({detail:e.string(),type:e.literal("generic")})]),z=e.discriminatedUnion("kind",[e.object({kind:e.literal("pass")}),e.object({findingLines:e.array(e.string()),kind:e.literal("findings")}),e.object({detail:e.string(),kind:e.literal("error")}),e.object({kind:e.literal("dispatch-error"),reason:I}),e.object({detail:e.string(),kind:e.literal("dispatch-timeout")}),e.object({detail:e.string(),kind:e.literal("infra-error")})]),A=e.discriminatedUnion("kind",[e.object({kind:e.literal("test-started"),runId:e.string(),testName:e.string(),workflowName:e.string()}),e.object({kind:e.literal("test-outcome"),outcome:z,runId:e.string(),testName:e.string(),workflowName:e.string()})]),H=e.object({event:A,jobId:e.string()}),V=e.object({failed:e.number(),jobId:e.string(),notRun:e.number(),passed:e.number()}),Q=e.discriminatedUnion("code",[e.object({code:e.literal("compile-failed"),detail:e.string(),diagnostics:e.array(e.string()).default([])}),e.object({code:e.literal("selection-conflicting-flags")}),e.object({code:e.literal("selection-nothing-selected")}),e.object({code:e.literal("selection-unknown-ids"),known:e.array(e.string()),unknown:e.array(e.string())}),e.object({code:e.literal("scope-failed"),detail:e.string()}),e.object({code:e.literal("app-unreachable"),detail:e.string(),url:e.string()}),e.object({code:e.literal("engine-unreachable"),detail:e.string(),url:e.string()}),e.object({code:e.literal("sync-failed"),detail:e.string()}),e.object({code:e.literal("bad-message")})]),Y=new x("ripplo/enqueue"),Z=new b("ripplo/status"),ee=new b("ripplo/shutdownIfIdle"),te=new f("ripplo/jobEvent"),ne=new f("ripplo/jobDone");export{L as a,_ as b,D as c,J as d,X as e,G as f,K as g,$ as h,B as i,z as j,H as k,V as l,Q as m,Y as n,Z as o,ee as p,te as q,ne as r};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __ripploCreateRequire } from "node:module";
|
|
3
|
+
const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
|
|
4
|
+
import{b as T}from"./chunk-CJUKILIO.js";import{a as F}from"./chunk-NNH3YVVO.js";import{b as $}from"./chunk-KMZ3L5YA.js";var G=15e3,O=3,U=300,f=class extends Error{detail;serverUrl;constructor({detail:r,serverUrl:t}){super(`Failed to connect to Ripplo server at ${t}. Check the server is running and reachable. Details: ${r}`),this.name="GqlConnectionError",this.detail=r,this.serverUrl=t}},c=class extends Error{errors;constructor(r){super(r.map(t=>t.message).join(", ")),this.name="GqlRequestError",this.errors=r}};function N(e){if(e instanceof c)return e.errors[0]?.extensions?.code}var L={attempts:O,timeoutMs:G},V={attempts:1,timeoutMs:3e3};async function A(e){return E(e,L)}async function j(e){return E(e,V)}async function E(e,r){let{print:t}=await import("graphql"),n=t(e.document),o=JSON.stringify({query:n,variables:e.variables}),i=`${e.config.ripploServerUrl}/graphql`,g=await W({init:{body:o,headers:{Authorization:`Bearer ${e.config.token}`,"Content-Type":"application/json",...T()},method:"POST"},policy:r,serverUrl:e.config.ripploServerUrl,url:i}),s=await J({res:g,url:i});if(!Q(s))throw new Error("Invalid GraphQL response");if(K(s))throw new c(s.errors);if(s.data==null)throw new Error("No data returned from server");return s.data}async function W({init:e,policy:r,serverUrl:t,url:n}){let o=1,i=await b({init:e,timeoutMs:r.timeoutMs,url:n});for(;i.retryable&&o<r.attempts;)await H(B(o)),o+=1,i=await b({init:e,timeoutMs:r.timeoutMs,url:n});if(i.response!=null)return i.response;throw new f({detail:i.detail,serverUrl:t})}async function b({init:e,timeoutMs:r,url:t}){try{let n=await fetch(t,{...e,signal:AbortSignal.timeout(r)});return{detail:"",response:n,retryable:n.status>=500}}catch(n){return{detail:n instanceof Error?n.message:String(n),response:void 0,retryable:!0}}}function B(e){return U*3**(e-1)*(.5+Math.random())}function H(e){return new Promise(r=>{setTimeout(r,e)})}async function J({res:e,url:r}){let t=await e.text();if(t.length===0)throw new Error(`Empty response from Ripplo server at ${r} (status ${String(e.status)}). The server may have restarted or the request was rejected before a body was sent.`);try{return JSON.parse(t)}catch{throw new Error(`Non-JSON response from Ripplo server at ${r} (status ${String(e.status)}): ${t.slice(0,200)}`)}}function Q(e){return typeof e=="object"&&e!=null&&("data"in e||"errors"in e)}function K(e){return Array.isArray(e.errors)&&e.errors.length>0}import X from"pino";import Y from"pino-pretty";var y=X({level:process.env.LOG_LEVEL??"info"},Y({ignore:"pid,hostname"}));import{readdir as z,rm as Z,stat as ee}from"fs/promises";import C from"path";var x=C.join(process.cwd(),".ripplo","debug"),k=360*60*1e3;async function re({maxRuns:e}){try{let t=(await z(x,{withFileTypes:!0})).filter(a=>a.isDirectory()),n=Date.now(),o=await Promise.all(t.map(async a=>{let p=C.join(x,a.name),M=await ee(p);return{dirPath:p,mtime:M.mtimeMs}})),i=o.filter(a=>n-a.mtime>k),s=o.filter(a=>n-a.mtime<=k).toSorted((a,p)=>p.mtime-a.mtime).slice(e),v=[...i,...s];if(v.length===0)return;await Promise.allSettled(v.map(a=>Z(a.dirPath,{force:!0,recursive:!0}))),y.debug("Pruned %d old debug run(s)",v.length)}catch{y.warn("Debug run pruning failed, ignoring")}}import l from"fs";import te from"os";import m from"path";var ne=".local",oe=".ripplo";function R(e){return m.join(e,".ripplo",ne)}function ie(e){let r=R(e);l.existsSync(r)||l.mkdirSync(r,{recursive:!0});let t=m.join(r,".gitignore");return l.existsSync(t)||l.writeFileSync(t,`*
|
|
5
|
+
`),r}function ae(e,r){return m.join(R(e),r)}function h(){return m.join(te.homedir(),oe)}function P(){let e=h();return l.existsSync(e)?l.chmodSync(e,448):l.mkdirSync(e,{mode:448,recursive:!0}),e}function S(e){return m.join(h(),e)}import{Agent as se,RetryAgent as le,setGlobalDispatcher as de}from"undici";var ce=1500,me=4e3,ue=3,ge=50,pe=100,I=!1;function fe(){if(I)return;I=!0;let e=new se({connections:pe,keepAliveMaxTimeout:me,keepAliveTimeout:ce}),r=new le(e,{errorCodes:["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT","UND_ERR_REQ_CONTENT_LENGTH_MISMATCH","UND_ERR_SOCKET"],maxRetries:ue,methods:["GET","POST","HEAD","OPTIONS","PUT","DELETE"],minTimeout:ge});de(r)}import{graphql as u}from"gql.tada";var Ue=u(`
|
|
6
|
+
query AgentReviewContextWorker($reviewId: String!) {
|
|
7
|
+
agentReview(id: $reviewId) {
|
|
8
|
+
id
|
|
9
|
+
runId
|
|
10
|
+
agentProfile {
|
|
11
|
+
id
|
|
12
|
+
name
|
|
13
|
+
description
|
|
14
|
+
output
|
|
15
|
+
successCriteria
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
`);var Ne=u(`
|
|
20
|
+
mutation StartAgentReviewWorker($reviewId: String!) {
|
|
21
|
+
startAgentReview(reviewId: $reviewId)
|
|
22
|
+
}
|
|
23
|
+
`);var Le=u(`
|
|
24
|
+
mutation CompleteAgentReviewWorker(
|
|
25
|
+
$reviewId: String!
|
|
26
|
+
$markdown: String!
|
|
27
|
+
$shortSummary: String!
|
|
28
|
+
$verdict: AgentReviewVerdict!
|
|
29
|
+
$comments: [AgentReviewCommentInput!]!
|
|
30
|
+
) {
|
|
31
|
+
completeAgentReview(
|
|
32
|
+
reviewId: $reviewId
|
|
33
|
+
markdown: $markdown
|
|
34
|
+
shortSummary: $shortSummary
|
|
35
|
+
verdict: $verdict
|
|
36
|
+
comments: $comments
|
|
37
|
+
)
|
|
38
|
+
}
|
|
39
|
+
`);var Ve=u(`
|
|
40
|
+
mutation UpdateAgentReviewProgressWorker($reviewId: String!, $text: String!) {
|
|
41
|
+
updateAgentReviewProgress(reviewId: $reviewId, text: $text)
|
|
42
|
+
}
|
|
43
|
+
`);var je=u(`
|
|
44
|
+
mutation FailAgentReviewWorker($reviewId: String!, $reason: String!) {
|
|
45
|
+
failAgentReview(reviewId: $reviewId, reason: $reason)
|
|
46
|
+
}
|
|
47
|
+
`);import d from"fs";import D from"path";function ye(e){let r=process.env.RIPPLO_TOKEN;if(r!=null&&r.trim().length>0)return r.trim();let t=w(e);if(!d.existsSync(t))return null;let n=d.readFileSync(t,"utf8").trim();return n.length===0?null:n}function we({serverUrl:e,token:r}){P();let t=w(e);d.mkdirSync(D.dirname(t),{mode:448,recursive:!0}),d.writeFileSync(t,r+`
|
|
48
|
+
`,{mode:384})}function ve(e){let r=w(e);return d.existsSync(r)?(d.unlinkSync(r),!0):!1}function w(e){return S(D.join("tokens",Re(e)))}function Re(e){return new URL(e).host.replaceAll(/[^a-zA-Z0-9.]/g,"_")}var q=$(F(),1);import _ from"crypto";function he({body:e,secret:r}){let t=new q.Webhook(r),n=`msg_${_.randomUUID()}`,o=new Date,i=t.sign(n,o,e),g=Math.floor(o.getTime()/1e3);return{"webhook-id":n,"webhook-signature":i,"webhook-timestamp":String(g)}}function Pe(){return`whsec_${_.randomBytes(24).toString("base64")}`}export{f as a,c as b,N as c,A as d,j as e,y as f,re as g,ie as h,ae as i,ye as j,we as k,ve as l,w as m,fe as n,he as o,Pe as p};
|
|
@@ -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 r}from"./chunk-OQ6KNYPG.js";import{a as s}from"./chunk-MHNGR6M7.js";import{a as k,b as C,c as F,d as b}from"./chunk-
|
|
4
|
+
import{a as r}from"./chunk-OQ6KNYPG.js";import{a as s}from"./chunk-MHNGR6M7.js";import{a as k,b as C,c as F,d as b}from"./chunk-EK6TENV6.js";import{L as $,f as u,k as c,n as f,p as m,q as p,r as g,s as y,t as h,u as S,v,w as o}from"./chunk-ESOXRGIY.js";import{A as d,H as l}from"./chunk-5SM4TCSW.js";async function P({cwd:e,lockfile:n}){let i=c(n),a=b(d(l,n));if(C({context:i,cwd:e})===a)return[];k({context:i,cwd:e});let t=await x(n);return F({cleanLockfileHash:t.length===0?a:null,context:i,cwd:e}),t}async function x(e){let n=u(e),i=await f(e),a=await m({context:c(e),facts:i.facts});return[...g(e).map(t=>({kind:"missing-precondition",missing:t})),...p(n,i.dataRules).map(t=>({gap:t,kind:"cascade-gap"})),...a.map(t=>({conflict:t,kind:"fact-conflict"})),...y(e).map(t=>({kind:"unreachable-interaction",violation:t})),...h(e).map(t=>({kind:"redundant-assertion",redundancy:t})),...S(e).map(t=>({kind:"unmodeled-surface",surface:t})),...v(e).map(t=>({content:t,kind:"unpinned-surface-content"}))]}function U(e){return`${o.good("ok")} \u2014 no static model violations (${r(e,"test")})`}function O(e){let i=e.some(a=>a.kind==="unmodeled-surface")?[`Elements that hide together are one surface. ${s("create","surfaces")}`]:[];return[`${o.bad("fail")} \u2014 ${r(e.length,"static model violation")}:`,...e.map(a=>$(a)),...i].join(`
|
|
5
5
|
|
|
6
6
|
`)}function E(e){return[`${o.warn("warn")} \u2014 ${r(e.length,"model coverage gap")} (not blocking):`,...e.map(n=>` ${A(n)}`),`Stub the missing flows. ${s("discover")}`].join(`
|
|
7
7
|
`)}function A(e){switch(e.kind){case"entity-never-given":return`${e.entity} \u2014 declared but no test seeds it`;case"entity-never-mutated":return`${e.entity} \u2014 seeded but never asserted created/updated/deleted`;case"unmatchable-delete-key":return`test ${e.workflow}/${e.testSlug} asserts ${e.entity} deleted with literal ${e.field} but no seeded ${e.entity} sets ${e.field} \u2014 solver treats it as no-match`}}export{P as a,U as b,O as c,E as d};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __ripploCreateRequire } from "node:module";
|
|
3
3
|
const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
|
|
4
|
-
import{b as u}from"./chunk-
|
|
4
|
+
import{b as u}from"./chunk-I5BHCICM.js";import{a as f}from"./chunk-JJ4QQPAV.js";import{a as m}from"./chunk-7WZ3VIUU.js";import{f as c}from"./chunk-4W6WIT7T.js";import{i as p}from"./chunk-EK6TENV6.js";import{h as l}from"./chunk-AQ3DMGAY.js";import v from"path";import h from"picomatch";import*as s from"zod/mini";var w=s.looseObject({file_path:s.string()}),R=async n=>{let i=w.safeParse(n.tool_input);if(!i.success)return;let d=i.data.file_path,{cwd:t}=n;if(!m(t)||!c(t))return;let r=v.relative(t,d);if(r.startsWith(".."))return;let{ignorePaths:b,watchPaths:k}=f(),P=h([...k]),g=h([...b]);if(!P(r)||g(r))return;let o=await l(t);if(u({cwd:t,tests:o.isOk()?o.value.workflows.map(e=>({intent:e.intent,name:e.name,sourcePath:e.sourcePath??null,stub:e.stub})):void 0}),o.isErr())return;let a=p(o.value);if(a.length!==0)return{hookSpecificOutput:{additionalContext:`Reminder: stub workflows still unimplemented \u2014 ${a.join(", ")}. Implement with \`workflow("Intent", () => ({ given, steps }))\`.`,hookEventName:"PostToolUse"}}};export{R as a};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __ripploCreateRequire } from "node:module";
|
|
3
3
|
const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
|
|
4
|
-
import{b as s,c as u}from"./chunk-
|
|
4
|
+
import{b as s,c as u}from"./chunk-4W6WIT7T.js";import{createHash as d}from"crypto";import{mkdirSync as h,readdirSync as g,readFileSync as p,writeFileSync as m}from"fs";import i from"path";var l=[".ts",".tsx",".js",".jsx"],y=new Set([".local","debug"]);function v(r){let t=d("sha256");return u(r)?(t.update(s(["rev-parse","HEAD"],r)),t.update("\0"),t.update(s(["diff","HEAD"],r)),t.update("\0"),s(["ls-files","--others","--exclude-standard"],r).split(`
|
|
5
5
|
`).filter(e=>e.length>0).filter(e=>l.some(n=>e.endsWith(n))).toSorted((e,n)=>e.localeCompare(n)).forEach(e=>{t.update(e),t.update("\0"),t.update(c(i.join(r,e))),t.update("\0")}),t.digest("hex")):S(r,t)}function A(r,t){try{return p(f(r,t),"utf8").trim()}catch{return null}}function D(r,t,o){let e=f(r,t);h(i.dirname(e),{recursive:!0}),m(e,o)}function S(r,t){let o=i.join(r,".ripplo");return x(o).filter(n=>l.some(a=>n.endsWith(a))).filter(n=>!y.has(n.split(i.sep)[0]??"")).toSorted((n,a)=>n.localeCompare(a)).forEach(n=>{t.update(n),t.update("\0"),t.update(c(i.join(o,n))),t.update("\0")}),t.digest("hex")}function x(r){try{return g(r,{recursive:!0}).filter(t=>typeof t=="string")}catch{return[]}}function c(r){try{return p(r)}catch{return Buffer.alloc(0)}}function f(r,t){return i.join(r,".ripplo",".local",`${t}.hash`)}export{v as a,A as b,D as c};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __ripploCreateRequire } from "node:module";
|
|
3
3
|
const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
|
|
4
|
-
import{c as k}from"./chunk-
|
|
4
|
+
import{c as k}from"./chunk-LEFXRK53.js";import{a as P,f as I}from"./chunk-4W6WIT7T.js";import{b as m,e as h,h as w}from"./chunk-AQ3DMGAY.js";import{d as c,f as d}from"./chunk-PE5WVWI5.js";import{L as g,N as S}from"./chunk-5SM4TCSW.js";import u from"fs";import f from"path";function v(e){try{let n=A(e);if(n==null)return;let t=f.join(n,"HEAD"),o=u.readFileSync(t,"utf8").trim(),i="ref: refs/heads/";return o.startsWith(i)?o.slice(i.length):o.length===0?void 0:o.slice(0,7)}catch{return}}function A(e){let n=f.join(e,".git");if(u.statSync(n).isDirectory())return n;let o=u.readFileSync(n,"utf8").trim(),i="gitdir:";if(!o.startsWith(i))return;let s=o.slice(i.length).trim();if(s.length!==0)return f.resolve(e,s)}import b from"crypto";import{readFile as D}from"fs/promises";import x from"path";import{graphql as y}from"gql.tada";import{err as E,ok as L}from"neverthrow";var T=y(`
|
|
5
5
|
mutation SyncDevSession(
|
|
6
6
|
$projectId: String!
|
|
7
7
|
$cwd: String!
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __ripploCreateRequire } from "node:module";
|
|
3
3
|
const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
|
|
4
|
-
import{f as a}from"./chunk-
|
|
4
|
+
import{f as a}from"./chunk-EGETJKAQ.js";import{a as n}from"./chunk-AVBP7Q2M.js";import{i}from"./chunk-EK6TENV6.js";import{h as e}from"./chunk-AQ3DMGAY.js";import{i as u}from"./chunk-M7VQD4VO.js";async function x(m){let o=process.cwd(),r=await e(o);r.isErr()&&(process.stderr.write(`${n(r.error)}
|
|
5
5
|
`),process.exit(1));let s=i(r.value),t=await a(o);if(m.format==="summary"){s.length>0&&process.stdout.write(`stub workflows: ${s.join(", ")}
|
|
6
6
|
`),process.stdout.write(`${u(t)}
|
|
7
7
|
`);return}let p={daemon:t.kind==="running"?{active:t.status.active,explorer:t.status.explorer,exploring:t.status.exploring,progress:t.status.progress,queued:t.status.queued,running:!0}:{running:t.kind==="unresponsive",state:t.kind},tests:s.map(d=>({id:d,implemented:!1}))};process.stdout.write(`${JSON.stringify(p,null,2)}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __ripploCreateRequire } from "node:module";
|
|
3
3
|
const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
|
|
4
|
-
import{a as l}from"./chunk-JJ4QQPAV.js";import{c}from"./chunk-
|
|
4
|
+
import{a as l}from"./chunk-JJ4QQPAV.js";import{c}from"./chunk-LEFXRK53.js";import{a as p}from"./chunk-7WZ3VIUU.js";import{f as d}from"./chunk-4W6WIT7T.js";import{b as a}from"./chunk-MHNGR6M7.js";import{e as s}from"./chunk-PE5WVWI5.js";import f from"path";import u from"picomatch";import{graphql as m}from"gql.tada";import*as n from"zod/mini";var h=new Set(["Edit","Write","NotebookEdit"]),g=n.looseObject({file_path:n.string()}),S=m(`
|
|
5
5
|
query PreEditScopeGate($projectId: String!, $cwd: String!) {
|
|
6
6
|
project(id: $projectId) {
|
|
7
7
|
id
|