ripplo 0.13.0 → 0.14.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.
Files changed (39) hide show
  1. package/dist/{chunk-TLSVFIET.js → chunk-3ZQRLG7C.js} +1 -1
  2. package/dist/{chunk-5JD26R53.js → chunk-56MARCN3.js} +1 -1
  3. package/dist/{chunk-37NZ5HM2.js → chunk-6JXOIP2T.js} +1 -1
  4. package/dist/{chunk-CAGQ4M2W.js → chunk-75T33SK5.js} +1 -1
  5. package/dist/{chunk-NRJUY625.js → chunk-AVBTPZUU.js} +1 -1
  6. package/dist/{chunk-JTML352F.js → chunk-B5HDXHPI.js} +2 -2
  7. package/dist/{chunk-D5F6DIXU.js → chunk-BQ25IGJS.js} +1 -1
  8. package/dist/{chunk-IUEJNPB6.js → chunk-EOBWMMVC.js} +1 -1
  9. package/dist/{chunk-BOMK6ZXG.js → chunk-GTB7NYDE.js} +1 -1
  10. package/dist/{chunk-MBQEVGUG.js → chunk-LEYSGMW2.js} +1 -1
  11. package/dist/{chunk-NAXGHRI7.js → chunk-NIC2DOQW.js} +1 -1
  12. package/dist/{chunk-KGCLJTPO.js → chunk-NXKOUVSC.js} +22 -22
  13. package/dist/chunk-PVRM4YWS.js +83 -0
  14. package/dist/{chunk-K4GNKQB5.js → chunk-PWDBRLJP.js} +1 -1
  15. package/dist/{chunk-FAYHW72O.js → chunk-Q7FIZGKZ.js} +1 -1
  16. package/dist/{chunk-XUZZKRZB.js → chunk-R3FZ2JEW.js} +1 -1
  17. package/dist/{chunk-C63HR3XQ.js → chunk-U4LFIMDP.js} +1 -1
  18. package/dist/{chunk-4GIORBIH.js → chunk-ULIHURY6.js} +1 -1
  19. package/dist/{chunk-GMOMT4D5.js → chunk-ZGWV564Y.js} +1 -1
  20. package/dist/{cli-error-UKCCFGND.js → cli-error-N7X2CREI.js} +1 -1
  21. package/dist/{compile-write-HYPPASGM.js → compile-write-XMVD5PX2.js} +1 -1
  22. package/dist/{daemon-JCI3PIF2.js → daemon-DARMT5AV.js} +1 -1
  23. package/dist/{daemon-FPJC6UTS.js → daemon-ZUDQ7ERI.js} +1 -1
  24. package/dist/{dsl-loader-3PR7GLST.js → dsl-loader-SSXMC5EE.js} +1 -1
  25. package/dist/hook.js +1 -1
  26. package/dist/index.js +2 -2
  27. package/dist/{plan-reminder-5IW6CHBL.js → plan-reminder-K7HOFGJN.js} +1 -1
  28. package/dist/{post-edit-FXAZHTN6.js → post-edit-OI6DDU25.js} +1 -1
  29. package/dist/post-edit-analyze-6V5YI3CR.js +4 -0
  30. package/dist/{post-edit-flag-stubs-QMRDE3JW.js → post-edit-flag-stubs-IKIH5DAH.js} +1 -1
  31. package/dist/{pre-edit-PGV7XSGT.js → pre-edit-IOWNUOZY.js} +1 -1
  32. package/dist/{pre-edit-watch-gate-DQD7CWGN.js → pre-edit-watch-gate-N7FI5HBA.js} +1 -1
  33. package/dist/{prompt-submit-PC4QIGY3.js → prompt-submit-ZU466ET5.js} +1 -1
  34. package/dist/status-OSHZ3JGU.js +4 -0
  35. package/dist/{stop-enforce-U7PURAF5.js → stop-enforce-4UUK36YU.js} +1 -1
  36. package/package.json +4 -4
  37. package/dist/chunk-7E3AM2KY.js +0 -83
  38. package/dist/post-edit-analyze-ZSZ6AO3U.js +0 -4
  39. package/dist/status-VQ57DB6M.js +0 -4
@@ -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 g}from"./chunk-OQ6KNYPG.js";import{c as d}from"./chunk-JS3DLVVI.js";import{c as u}from"./chunk-FEHVIHVA.js";import{a}from"./chunk-MHNGR6M7.js";import{f as t,k as c}from"./chunk-7E3AM2KY.js";import{Ga as l}from"./chunk-KGCLJTPO.js";var f=3e3;async function U(e){u(e);let r=d(e).unwrapOr(void 0);if(r==null)return null;try{return await fetch(`${r.ripploServerUrl}/health`,{signal:AbortSignal.timeout(f)}),null}catch(n){return{detail:n instanceof Error?n.message:String(n),serverUrl:r.ripploServerUrl}}}function p(e){return e.includes("localhost")||e.includes("127.0.0.1")}import C from"fuse.js";function m(e){let r=h(e.activity),n=E(e);return n.length===0?r:`${r} \u2014 ${n}`}function h(e){switch(e.kind){case"waitingForRunner":return $(e);case"settingUpState":{let r=e.activeSources.length===0?"":` from ${e.activeSources.join(", ")}`;return`${S(e.stage)}${r}`}case"signingIn":return"Signing in the test user";case"startingBrowser":return"Starting the test browser";case"executingStep":return`${`Step ${String(e.stepIndex+1)} of ${String(e.stepCount)}`}: ${y(e.stage)}`;case"finishing":return e.stage==="cleaningUp"?"Cleaning up the test state":"Saving the run result";case"uploadingReplay":return"Uploading the replay"}}function $(e){let r=e.capacity==null?"":` (${String(e.capacity.active)} of ${String(e.capacity.limit)} runners active)`;switch(e.reason){case"cloudCapacity":return`Waiting for cloud capacity${r}`;case"runnerStarting":return"Starting a test runner";case"localRunnerBusy":return"Waiting for an available local runner"}}function S(e){switch(e){case"clearing":return"Clearing existing test state";case"materializing":return"Creating the starting state";case"verifying":return"Verifying the starting state"}}function y(e){switch(e.kind){case"performingAction":return k(e.action);case"waitingForApp":return`Waiting for the app at ${e.path}`;case"readingState":return"Reading application state";case"verifyingEffects":return"Verifying the declared state changes";case"checkingExpectations":return w(e.remaining)}}function k(e){switch(e.kind){case"goto":return`Opening ${e.path}`;case"fill":return`Filling ${e.target}`;case"clear":return`Clearing ${e.target}`;case"click":return`Clicking ${e.target}`;case"dblclick":return`Double-clicking ${e.target}`;case"select":return`Selecting an option in ${e.target}`;case"check":return`Checking ${e.target}`;case"uncheck":return`Unchecking ${e.target}`;case"hover":return`Hovering over ${e.target}`;case"upload":return`Uploading a file through ${e.target}`;case"press":return e.target==null?`Pressing ${e.key}`:`Pressing ${e.key} in ${e.target}`;case"drag":return`Dragging ${e.source} to ${e.target}`;case"actor":return"Switching the signed-in user"}}function w(e){if(e.length===0)return"All expectations passed";let r=e.map(n=>R(n)).join("; ");return`Checking ${String(e.length)} ${e.length===1?"expectation":"expectations"}: ${r}`}function R(e){let r=e.negated?"not ":"";return e.kind==="browser"?`${r}${e.subject}`:`${r}${e.check} ${e.target}`}function E(e){let r=b(e.retry);return[e.deadlineAt==null?null:`${String(Math.max(0,Math.ceil((Date.parse(e.deadlineAt)-Date.now())/1e3)))}s until timeout`,r].filter(i=>i!=null).join(", ")}function b(e){return e==null?null:e.limit==null?`attempt ${String(e.attempt)}`:`attempt ${String(e.attempt)} of ${String(e.limit)}`}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 r=e.known,n=e.unknown.flatMap(o=>I(o,r)),i=n.length>0?[`Did you mean: ${[...new Set(n)].join(", ")}`]:[];return[`Unknown ${e.unknown.length===1?"id":"ids"}: ${e.unknown.join(", ")}`,...i,"Pass a workflow slug for all its tests, or workflow/test for one. Known workflows:",...r.map(o=>` ${o}`)].join(`
4
+ import{a as g}from"./chunk-OQ6KNYPG.js";import{c as d}from"./chunk-JS3DLVVI.js";import{c as u}from"./chunk-FEHVIHVA.js";import{a}from"./chunk-MHNGR6M7.js";import{f as t,k as c}from"./chunk-PVRM4YWS.js";import{Ma as l}from"./chunk-NXKOUVSC.js";var f=3e3;async function U(e){u(e);let r=d(e).unwrapOr(void 0);if(r==null)return null;try{return await fetch(`${r.ripploServerUrl}/health`,{signal:AbortSignal.timeout(f)}),null}catch(n){return{detail:n instanceof Error?n.message:String(n),serverUrl:r.ripploServerUrl}}}function p(e){return e.includes("localhost")||e.includes("127.0.0.1")}import C from"fuse.js";function m(e){let r=h(e.activity),n=E(e);return n.length===0?r:`${r} \u2014 ${n}`}function h(e){switch(e.kind){case"waitingForRunner":return $(e);case"settingUpState":{let r=e.activeSources.length===0?"":` from ${e.activeSources.join(", ")}`;return`${S(e.stage)}${r}`}case"signingIn":return"Signing in the test user";case"startingBrowser":return"Starting the test browser";case"executingStep":return`${`Step ${String(e.stepIndex+1)} of ${String(e.stepCount)}`}: ${y(e.stage)}`;case"finishing":return e.stage==="cleaningUp"?"Cleaning up the test state":"Saving the run result";case"uploadingReplay":return"Uploading the replay"}}function $(e){let r=e.capacity==null?"":` (${String(e.capacity.active)} of ${String(e.capacity.limit)} runners active)`;switch(e.reason){case"cloudCapacity":return`Waiting for cloud capacity${r}`;case"runnerStarting":return"Starting a test runner";case"localRunnerBusy":return"Waiting for an available local runner"}}function S(e){switch(e){case"clearing":return"Clearing existing test state";case"materializing":return"Creating the starting state";case"verifying":return"Verifying the starting state"}}function y(e){switch(e.kind){case"performingAction":return k(e.action);case"waitingForApp":return`Waiting for the app at ${e.path}`;case"readingState":return"Reading application state";case"verifyingEffects":return"Verifying the declared state changes";case"checkingExpectations":return w(e.remaining)}}function k(e){switch(e.kind){case"goto":return`Opening ${e.path}`;case"fill":return`Filling ${e.target}`;case"clear":return`Clearing ${e.target}`;case"click":return`Clicking ${e.target}`;case"dblclick":return`Double-clicking ${e.target}`;case"select":return`Selecting an option in ${e.target}`;case"check":return`Checking ${e.target}`;case"uncheck":return`Unchecking ${e.target}`;case"hover":return`Hovering over ${e.target}`;case"upload":return`Uploading a file through ${e.target}`;case"press":return e.target==null?`Pressing ${e.key}`:`Pressing ${e.key} in ${e.target}`;case"drag":return`Dragging ${e.source} to ${e.target}`;case"actor":return"Switching the signed-in user"}}function w(e){if(e.length===0)return"All expectations passed";let r=e.map(n=>R(n)).join("; ");return`Checking ${String(e.length)} ${e.length===1?"expectation":"expectations"}: ${r}`}function R(e){let r=e.negated?"not ":"";return e.kind==="browser"?`${r}${e.subject}`:`${r}${e.check} ${e.target}`}function E(e){let r=b(e.retry);return[e.deadlineAt==null?null:`${String(Math.max(0,Math.ceil((Date.parse(e.deadlineAt)-Date.now())/1e3)))}s until timeout`,r].filter(i=>i!=null).join(", ")}function b(e){return e==null?null:e.limit==null?`attempt ${String(e.attempt)}`:`attempt ${String(e.attempt)} of ${String(e.limit)}`}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 r=e.known,n=e.unknown.flatMap(o=>I(o,r)),i=n.length>0?[`Did you mean: ${[...new Set(n)].join(", ")}`]:[];return[`Unknown ${e.unknown.length===1?"id":"ids"}: ${e.unknown.join(", ")}`,...i,"Pass a workflow slug for all its tests, or workflow/test for one. Known workflows:",...r.map(o=>` ${o}`)].join(`
5
5
  `)}}}function W({failed:e,notRun:r,passed:n}){let i=r>0?`, ${String(r)} not run`:"";return`${String(n)} passed, ${String(e)} failed${i} (${String(n+e+r)} total)`}function X({debugDir:e,event:r}){let n=`${r.workflowName} \u2192 ${r.testName}`;if(r.kind==="run-progress")return`${t.dim("progress")} ${n} \u2014 ${m(r.signal)}`;if(r.kind==="test-started")return`${t.dim("run ")} ${n}`;switch(r.outcome.kind){case"pass":return`${t.good("pass")} ${n} ${t.dim(r.runId)}`;case"findings":return[`${t.bad("fail")} ${n} \u2014 ${g(r.outcome.findingLines.length,"finding")}`,...r.outcome.findingLines,c({debugDir:e,runId:r.runId}),`${t.dim("why")} npx ripplo explain ${r.runId}`].join(`
6
6
  `);case"error":return`${t.bad("error")} ${n} \u2014 ${P(r.outcome.detail)} ${t.dim(r.runId)}`;case"dispatch-error":return`${t.bad("error")} ${n} \u2014 ${v(r.outcome.reason)}`;case"dispatch-timeout":return`${t.bad("error")} ${n} \u2014 not run: dispatch timed out (transient): ${r.outcome.detail}`;case"infra-error":return`${t.bad("error")} ${n} \u2014 not run: Ripplo server unreachable: ${r.outcome.detail}`}}var x={CLOUD_EXECUTOR:"cloud runs are not included on your plan \u2014 upgrade to run in the cloud",MAX_AGENTS:"agent limit reached for your plan \u2014 upgrade to add more",MAX_CONCURRENT_RUNS:"concurrent run limit reached for your plan \u2014 upgrade or wait for runs to finish",MAX_PROJECTS:"project limit reached for your plan \u2014 upgrade to add more",MAX_RUNS:"run limit reached for your plan \u2014 enable overage or upgrade",MEMBER_CEILING:"member ceiling reached for the target plan \u2014 remove members or pick a bigger plan",OVERAGE_CAP:"overage cap reached \u2014 raise the cap or upgrade",REVIEW_QUOTA:"review quota reached for your plan \u2014 set an overage cap or upgrade"};function J({detail:e,serverUrl:r}){return p(r)?`Ripplo server at ${r} not running (${e}). Start the dev server with \`pnpm dev\`.`:`Ripplo server at ${r} unreachable (${e}) \u2014 server-side, not your local environment.`}function V(e){switch(e.code){case"compile-failed":{let r=e.diagnostics.length===0?[]:["",...e.diagnostics];return[`Compilation failed in the daemon (${e.detail}). Run \`npx ripplo compile\` for full output.`,...r].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,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __ripploCreateRequire } from "node:module";
3
3
  const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
4
- import{g as m}from"./chunk-NAXGHRI7.js";import{a as f,c as k}from"./chunk-CAGQ4M2W.js";import{a as h}from"./chunk-OQ6KNYPG.js";import{a as y}from"./chunk-IUEJNPB6.js";import{a as s}from"./chunk-MHNGR6M7.js";import{h as d,i as p}from"./chunk-BOMK6ZXG.js";import{o as u}from"./chunk-7E3AM2KY.js";import{a as c}from"./chunk-7WZ3VIUU.js";import{f as l}from"./chunk-KH4QH23U.js";import*as a from"zod/mini";var S=a.looseObject({file_path:a.string()}),H=async e=>{let n=S.safeParse(e.tool_input);if(!n.success||!/\/\.ripplo\/.*\.ts$/.test(n.data.file_path))return;let{cwd:o}=e;if(!c(o))return;if(!l(o))return{hookSpecificOutput:{additionalContext:"Ripplo hooks are paused \u2014 DSL compile and lockfile sync did not run for this edit. Resume with `npx ripplo hooks resume` when ready.",hookEventName:"PostToolUse"}};let r=await d(o);if(r.isErr())return{decision:"block",reason:`${y(r.error)}
4
+ import{g as m}from"./chunk-NIC2DOQW.js";import{a as f,c as k}from"./chunk-75T33SK5.js";import{a as h}from"./chunk-OQ6KNYPG.js";import{a as y}from"./chunk-EOBWMMVC.js";import{a as s}from"./chunk-MHNGR6M7.js";import{h as d,i as p}from"./chunk-GTB7NYDE.js";import{o as u}from"./chunk-PVRM4YWS.js";import{a as c}from"./chunk-7WZ3VIUU.js";import{f as l}from"./chunk-KH4QH23U.js";import*as a from"zod/mini";var S=a.looseObject({file_path:a.string()}),H=async e=>{let n=S.safeParse(e.tool_input);if(!n.success||!/\/\.ripplo\/.*\.ts$/.test(n.data.file_path))return;let{cwd:o}=e;if(!c(o))return;if(!l(o))return{hookSpecificOutput:{additionalContext:"Ripplo hooks are paused \u2014 DSL compile and lockfile sync did not run for this edit. Resume with `npx ripplo hooks resume` when ready.",hookEventName:"PostToolUse"}};let r=await d(o);if(r.isErr())return{decision:"block",reason:`${y(r.error)}
5
5
  ${s("create","DSL authoring rules")}`};let t=await b({cwd:o,filePath:n.data.file_path,lockfile:r.value});if("block"in t)return{decision:"block",reason:t.block};let{addedSlugs:i}=await m({cwd:o,editedPath:n.data.file_path,lockfile:r.value,requireHooks:!0,syncFirst:!0});return z(P({addedSlugs:i,elsewhere:t.elsewhere}))};function P({addedSlugs:e,elsewhere:n}){return[...e.length>0?[`Auto-scoped ${e.join(", ")} (dirty tests).`]:[],...n>0?[g(n).trimStart()]:[]]}async function b({cwd:e,filePath:n,lockfile:o}){let r=f({cwd:e,lockfile:o});await p(e,o);let t=A(r,o,n),i=r.length-t.length;return t.length===0?{elsewhere:i}:{block:`${k(t)}${g(i)}
6
6
  ${s("create")}`}}function A(e,n,o){let r=new Set(u(n).filter(({workflow:t})=>t.sourcePath!=null&&o.endsWith(t.sourcePath)).map(({ref:t})=>t));return r.size===0?e:e.filter(t=>{let i=w(t);return i==null||r.has(i)})}function w(e){return e.kind==="unreachable-interaction"?e.violation.test:e.kind==="redundant-assertion"?e.redundancy.test:e.kind==="undecided-action-consequence"?e.consequence.test:null}function g(e){return e===0?"":`
7
7
  ${h(e,"finding")} in other files \u2014 \`npx ripplo compile\` for the full list.`}function z(e){if(e.length!==0)return{hookSpecificOutput:{additionalContext:e.join(`
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __ripploCreateRequire } from "node:module";
3
3
  const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
4
- import{D as i,e as t}from"./chunk-7E3AM2KY.js";function f(e){switch(e.kind){case"already-running":return`ripplo daemon: daemon already running (socket ${e.socketPath}).`;case"bind-failed":return`ripplo daemon: failed to bind IPC socket: ${e.message}`}}function g({projectId:e,serverUrl:n}){return[`Project "${e}" (from .ripplo/project.json) was not found on ${n}, or this account does not have access to it.`,"Run `npx ripplo projects list` to see your projects, then update .ripplo/project.json (or re-run `npx ripplo init --project <id>`)."].join(`
4
+ import{D as i,e as t}from"./chunk-PVRM4YWS.js";function f(e){switch(e.kind){case"already-running":return`ripplo daemon: daemon already running (socket ${e.socketPath}).`;case"bind-failed":return`ripplo daemon: failed to bind IPC socket: ${e.message}`}}function g({projectId:e,serverUrl:n}){return[`Project "${e}" (from .ripplo/project.json) was not found on ${n}, or this account does not have access to it.`,"Run `npx ripplo projects list` to see your projects, then update .ripplo/project.json (or re-run `npx ripplo init --project <id>`)."].join(`
5
5
  `)}function h(){return"Not signed in. Run `npx ripplo auth login`, then start the daemon again."}function x({devSessionId:e,version:n}){return`ripplo daemon: v${n} ready as local executor for session ${e} (switch with \`npx ripplo executor cloud\` \u2014 Ctrl-C to stop)`}function k({cwd:e,pid:n}){return`ripplo daemon: another daemon is already running for this project${n==null?"":` (pid ${String(n)})`} (cwd ${e}) \u2014 this one is exiting. Run \`npx ripplo daemon status\` to inspect it, or \`npx ripplo daemon stop\` to stop it.`}function w(e){switch(e.kind){case"not-running":return"ripplo daemon: not running.";case"stopped":return`ripplo daemon: stopped (pid ${String(e.pid)}).`;case"timeout":return`ripplo daemon: pid ${String(e.pid)} did not exit within 10s \u2014 it may be finishing a run. Check again with \`npx ripplo daemon status\`.`}}function y(){return"ripplo daemon: lock compromised \u2014 another daemon likely took over this project. Shutting down."}function $(e){if(e.kind==="not-running")return"daemon: not running";if(e.kind==="unresponsive")return`daemon: running but no reply within ${String(e.timeoutMs/1e3)}s \u2014 likely busy executing runs, retry when the batch drains`;let{status:n}=e,r=n.version==null?"version unknown (pre-0.7.8)":`v${n.version}`,s=`${String(n.active)} active, ${String(n.queued)} queued`,a=l(n.explorer,n.exploring),o=`daemon: running (${r} | ${s} | ${a} | ${p(n.progress)})`;if(n.sseHealth!=null&&!n.sseHealth.ok){let d=n.sseHealth.detail==null?"":`: ${n.sseHealth.detail}`;return`${o}
6
6
  daemon: cannot subscribe to run dispatch${d} \u2014 server-side, restarting the daemon will not help`}return o}function p(e){return e.attempts===0?"explore: idle":`explore: ${String(e.attempts)} attempts, ${String(e.findings)} findings`}function b(e){let n=e.daemonVersion==null?"an older build":`v${e.daemonVersion}`;return e.kind==="restarted"?`ripplo: daemon was on ${n} \u2014 restarted on the current build`:`ripplo: daemon is on a stale build (${n}) with runs in flight \u2014 rerun once it drains, or npx ripplo daemon restart`}function S(e){switch(e.kind){case"pass":return{kind:"pass"};case"findings":return{findingLines:e.contradictions.map(n=>i({contradiction:n,evidencePath:`.ripplo/debug/${e.runId}/behavior.jsonl`})),kind:"findings"};case"error":return{detail:t(e.error),kind:"error"};case"dispatch-failed":return{kind:"dispatch-error",reason:{detail:e.reason,type:"generic"}}}}function l(e,n){switch(e.kind){case"off":return"explorer: off";case"on":return`explorer: on, ${String(n)} exploring`;case"paused":return`explorer: ${u(e.reason)}`;case"waiting":return"explorer: waiting for more workflow coverage \u2014 run npx ripplo explore analyze";case"blocked":return`explorer: blocked \u2014 ${c(e.reason)}`}}function u(e){return e==="interactive-runs"?"paused while your runs execute \u2014 resumes when they finish":e==="loading"?"paused while the model loads":"paused for a short cooldown \u2014 resumes on its own"}function c(e){switch(e){case"no-lockfile":return"no lockfile found, run npx ripplo compile";case"unstamped":return"lockfile has no compiled checks, run npx ripplo compile";case"dsl-drift":return"workflow sources changed since the last compile, run npx ripplo compile";case"load-failed":return"workflow definitions do not compile, run npx ripplo compile for details";case"model-empty":return"no workflow interactions can be explored, run npx ripplo explore analyze"}}export{f as a,g as b,h as c,x as d,k as e,w as f,y as g,$ as h,p as i,b as j,S as k};
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __ripploCreateRequire } from "node:module";
3
3
  const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
4
- import{a as o}from"./chunk-OQ6KNYPG.js";import{a as r}from"./chunk-MHNGR6M7.js";import{a as h,c as y,d as F,e as k,f as C,g as b}from"./chunk-BOMK6ZXG.js";import{A as p,B as u,C as g,G as S,f as a,t as c,v as d,w as s,x as f,y as l,z as m}from"./chunk-7E3AM2KY.js";import A from"safe-stable-stringify";function z({cwd:i,lockfile:e}){let t=b(A(h(e)));if(k({cwd:i})===t)return[];y({cwd:i});let n=H(e);return F({cwd:i}),C({cleanLockfileHash:n.length===0?t:null,cwd:i}),n}function H(i){let e=c(i),t=d({facts:e.facts});return[...s(i).map(n=>({effect:n,kind:"possible-noop-effect"})),...f(i).map(n=>({consequence:n,kind:"undecided-action-consequence"})),...t.map(n=>({conflict:n,kind:"fact-conflict"})),...l(i).map(n=>({kind:"unreachable-interaction",violation:n})),...m(i).map(n=>({kind:"redundant-assertion",redundancy:n})),...p(i).map(n=>({kind:"unmodeled-surface",surface:n})),...g(i).map(n=>({content:n,kind:"unpinned-surface-content"})),...u(i).map(n=>({binding:n,kind:"stringified-binding"}))]}function q(i){return`${a.good("ok")} \u2014 no static model violations (${o(i,"test")})`}function E(i){let t=i.some(n=>n.kind==="unmodeled-surface")?[`Elements that hide together are one surface. ${r("create","surfaces")}`]:[];return[`${a.bad("fail")} \u2014 ${o(i.length,"static model violation")}:`,...i.map(n=>S(n)),...t].join(`
4
+ import{a as o}from"./chunk-OQ6KNYPG.js";import{a as r}from"./chunk-MHNGR6M7.js";import{a as h,c as y,d as F,e as k,f as C,g as b}from"./chunk-GTB7NYDE.js";import{A as p,B as u,C as g,G as S,f as a,t as c,v as d,w as s,x as f,y as l,z as m}from"./chunk-PVRM4YWS.js";import A from"safe-stable-stringify";function z({cwd:i,lockfile:e}){let t=b(A(h(e)));if(k({cwd:i})===t)return[];y({cwd:i});let n=H(e);return F({cwd:i}),C({cleanLockfileHash:n.length===0?t:null,cwd:i}),n}function H(i){let e=c(i),t=d({facts:e.facts});return[...s(i).map(n=>({effect:n,kind:"possible-noop-effect"})),...f(i).map(n=>({consequence:n,kind:"undecided-action-consequence"})),...t.map(n=>({conflict:n,kind:"fact-conflict"})),...l(i).map(n=>({kind:"unreachable-interaction",violation:n})),...m(i).map(n=>({kind:"redundant-assertion",redundancy:n})),...p(i).map(n=>({kind:"unmodeled-surface",surface:n})),...g(i).map(n=>({content:n,kind:"unpinned-surface-content"})),...u(i).map(n=>({binding:n,kind:"stringified-binding"}))]}function q(i){return`${a.good("ok")} \u2014 no static model violations (${o(i,"test")})`}function E(i){let t=i.some(n=>n.kind==="unmodeled-surface")?[`Elements that hide together are one surface. ${r("create","surfaces")}`]:[];return[`${a.bad("fail")} \u2014 ${o(i.length,"static model violation")}:`,...i.map(n=>S(n)),...t].join(`
5
5
 
6
6
  `)}export{z as a,q as b,E as c};
@@ -1,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 sn,f as ln,g as dn,j as un,n as cn,o as pn,p as gn,q as fn,r as yn}from"./chunk-C63HR3XQ.js";import{b as mn}from"./chunk-K4GNKQB5.js";import{c as rn,e as tn,g as on}from"./chunk-NAXGHRI7.js";import{a as an}from"./chunk-IUEJNPB6.js";import{c as L}from"./chunk-JS3DLVVI.js";import{a as U}from"./chunk-R4ZTRVDQ.js";import{d as be}from"./chunk-FEHVIHVA.js";import{i as en,j as nn}from"./chunk-BOMK6ZXG.js";import{F as Ke,I as oe,L as Je,M as Qe,Q as ze,R as Ge,V as Xe,a as te,aa as Ye,b as Ne,ba as Ze,c as Le,d as He,e as I,i as _e,j as Be,l as We,n as M,o as O,p as Ve,r as C}from"./chunk-7E3AM2KY.js";import{f as je,k as Ue,l as De,m as qe}from"./chunk-D5F6DIXU.js";import{Ca as $e,Fa as Fe,Ga as k,K as Ae,M as re,V as N,W as Te,X as Me,Y as Oe,a as ne,t as q}from"./chunk-KGCLJTPO.js";import{d as Ce}from"./chunk-KH4QH23U.js";import{c as D}from"./chunk-RIASQHPG.js";import{a as Ie,d as u,f as g,g as T}from"./chunk-C7SV6AR2.js";import wr from"p-queue";var vr=4,Er={"p0-ui":3,"p1-cli":2,"p2-cover":1,"p3-explore":0},H=new wr({concurrency:vr}),w={headedActive:0,interactiveActive:0,interactiveQueued:0},Rn={current:null};function hi({headed:e,task:n,workClass:r}){let t=Er[r];return r==="p3-explore"?H.add(n,{priority:t}):(w.interactiveQueued+=1,_(),H.add(()=>xr({headed:e,task:n}),{priority:t}))}function ki(e){!Number.isFinite(e)||e<1||(H.concurrency=Math.floor(e),_())}function ie(){return{active:w.interactiveActive,headedActive:w.headedActive,poolSize:H.concurrency,queued:w.interactiveQueued}}function Si(e){Rn.current=e}async function xr({headed:e,task:n}){w.interactiveQueued-=1,w.interactiveActive+=1,w.headedActive+=e?1:0,_();try{return await n()}finally{w.interactiveActive-=1,w.headedActive-=e?1:0,_()}}function _(){Rn.current?.()}async function hn(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 kn(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 Pr}from"gql.tada";async function Sn(e,n){let t=(await u({config:e,document:br,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 br=Pr(`
4
+ import{a as sn,f as ln,g as dn,j as un,n as cn,o as pn,p as gn,q as fn,r as yn}from"./chunk-U4LFIMDP.js";import{b as mn}from"./chunk-PWDBRLJP.js";import{c as rn,e as tn,g as on}from"./chunk-NIC2DOQW.js";import{a as an}from"./chunk-EOBWMMVC.js";import{c as L}from"./chunk-JS3DLVVI.js";import{a as U}from"./chunk-R4ZTRVDQ.js";import{d as be}from"./chunk-FEHVIHVA.js";import{i as en,j as nn}from"./chunk-GTB7NYDE.js";import{F as Ke,I as oe,L as Je,M as Qe,Q as ze,R as Ge,V as Xe,a as te,aa as Ye,b as Ne,ba as Ze,c as Le,d as He,e as I,i as _e,j as Be,l as We,n as M,o as O,p as Ve,r as C}from"./chunk-PVRM4YWS.js";import{f as je,k as Ue,l as De,m as qe}from"./chunk-BQ25IGJS.js";import{Ia as $e,L as Ae,La as Fe,Ma as k,N as re,W as N,X as Te,Y as Me,Z as Oe,a as ne,t as q}from"./chunk-NXKOUVSC.js";import{d as Ce}from"./chunk-KH4QH23U.js";import{c as D}from"./chunk-RIASQHPG.js";import{a as Ie,d as u,f as g,g as T}from"./chunk-C7SV6AR2.js";import wr from"p-queue";var vr=4,Er={"p0-ui":3,"p1-cli":2,"p2-cover":1,"p3-explore":0},H=new wr({concurrency:vr}),w={headedActive:0,interactiveActive:0,interactiveQueued:0},Rn={current:null};function hi({headed:e,task:n,workClass:r}){let t=Er[r];return r==="p3-explore"?H.add(n,{priority:t}):(w.interactiveQueued+=1,_(),H.add(()=>xr({headed:e,task:n}),{priority:t}))}function ki(e){!Number.isFinite(e)||e<1||(H.concurrency=Math.floor(e),_())}function ie(){return{active:w.interactiveActive,headedActive:w.headedActive,poolSize:H.concurrency,queued:w.interactiveQueued}}function Si(e){Rn.current=e}async function xr({headed:e,task:n}){w.interactiveQueued-=1,w.interactiveActive+=1,w.headedActive+=e?1:0,_();try{return await n()}finally{w.interactiveActive-=1,w.headedActive-=e?1:0,_()}}function _(){Rn.current?.()}async function hn(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 kn(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 Pr}from"gql.tada";async function Sn(e,n){let t=(await u({config:e,document:br,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 br=Pr(`
5
5
  query DaemonWorkflows($projectId: String!, $cwd: String!) {
6
6
  project(id: $projectId) {
7
7
  id
@@ -2,6 +2,6 @@
2
2
  import { createRequire as __ripploCreateRequire } from "node:module";
3
3
  const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
4
4
  import{a as p,c as t}from"./chunk-KOKEEAEF.js";import{a as s}from"./chunk-HEOMRXZE.js";function l(){let o=process.cwd(),e=s(o);e!=null&&e!==o&&(process.chdir(e),process.stderr.write(`ripplo: resolved .ripplo/ at ${e}
5
- `))}var d={"exit-plan-gate":()=>import("./exit-plan-gate-44YWEKYS.js").then(o=>o.exitPlanGateHook),"plan-reminder":()=>import("./plan-reminder-5IW6CHBL.js").then(o=>t("UserPromptSubmit",o.planReminder)),"post-edit":()=>import("./post-edit-FXAZHTN6.js").then(o=>o.postEditHook),"post-edit-analyze":()=>import("./post-edit-analyze-ZSZ6AO3U.js").then(o=>t("PostToolUse",o.postEditAnalyze)),"post-edit-flag-stubs":()=>import("./post-edit-flag-stubs-QMRDE3JW.js").then(o=>t("PostToolUse",o.postEditFlagStubs)),"pre-bash-run-gate":()=>import("./pre-bash-run-gate-CDFNAIK3.js").then(o=>o.preBashRunGateHook),"pre-edit":()=>import("./pre-edit-PGV7XSGT.js").then(o=>o.preEditHook),"pre-edit-ripplo-skill-gate":()=>import("./pre-edit-ripplo-skill-gate-A6ETC3QN.js").then(o=>t("PreToolUse",o.preEditRipploSkillGate)),"pre-edit-scope-gate":()=>import("./pre-edit-scope-gate-HNIQ7KOQ.js").then(o=>t("PreToolUse",o.preEditScopeGate)),"pre-edit-watch-gate":()=>import("./pre-edit-watch-gate-DQD7CWGN.js").then(o=>t("PreToolUse",o.preEditWatchGate)),"prompt-submit":()=>import("./prompt-submit-PC4QIGY3.js").then(o=>o.promptSubmitHook),"scope-reminder":()=>import("./scope-reminder-A6GVTTVE.js").then(o=>t("UserPromptSubmit",o.scopeReminder)),"session-preamble":()=>import("./session-preamble-IZQPIWST.js").then(o=>o.sessionPreambleHook),"stop-enforce":()=>import("./stop-enforce-U7PURAF5.js").then(o=>o.stopEnforceHook),"tasks-reminder":()=>import("./tasks-reminder-TDWPD3KV.js").then(o=>t("UserPromptSubmit",o.tasksReminder)),"tasks-reminder-tool":()=>Promise.resolve(t("PostToolUse",()=>{})),"track-skill-load":()=>import("./track-skill-load-SXSDMHFO.js").then(o=>o.trackSkillLoadHook),"track-skill-prompt":()=>import("./track-skill-prompt-7N4TQAD2.js").then(o=>t("UserPromptSubmit",o.trackSkillPrompt))},n=d;async function P(o){let e=n[o];e==null&&(process.stderr.write(`Unknown hook: ${o}
6
- `),process.exit(1));let i=await m(),r=await p(await e(),i);if(r.kind==="crash"){let{renderHookCrash:a}=await import("./cli-error-UKCCFGND.js");process.stderr.write(`${a(o,r.error)}
5
+ `))}var d={"exit-plan-gate":()=>import("./exit-plan-gate-44YWEKYS.js").then(o=>o.exitPlanGateHook),"plan-reminder":()=>import("./plan-reminder-K7HOFGJN.js").then(o=>t("UserPromptSubmit",o.planReminder)),"post-edit":()=>import("./post-edit-OI6DDU25.js").then(o=>o.postEditHook),"post-edit-analyze":()=>import("./post-edit-analyze-6V5YI3CR.js").then(o=>t("PostToolUse",o.postEditAnalyze)),"post-edit-flag-stubs":()=>import("./post-edit-flag-stubs-IKIH5DAH.js").then(o=>t("PostToolUse",o.postEditFlagStubs)),"pre-bash-run-gate":()=>import("./pre-bash-run-gate-CDFNAIK3.js").then(o=>o.preBashRunGateHook),"pre-edit":()=>import("./pre-edit-IOWNUOZY.js").then(o=>o.preEditHook),"pre-edit-ripplo-skill-gate":()=>import("./pre-edit-ripplo-skill-gate-A6ETC3QN.js").then(o=>t("PreToolUse",o.preEditRipploSkillGate)),"pre-edit-scope-gate":()=>import("./pre-edit-scope-gate-HNIQ7KOQ.js").then(o=>t("PreToolUse",o.preEditScopeGate)),"pre-edit-watch-gate":()=>import("./pre-edit-watch-gate-N7FI5HBA.js").then(o=>t("PreToolUse",o.preEditWatchGate)),"prompt-submit":()=>import("./prompt-submit-ZU466ET5.js").then(o=>o.promptSubmitHook),"scope-reminder":()=>import("./scope-reminder-A6GVTTVE.js").then(o=>t("UserPromptSubmit",o.scopeReminder)),"session-preamble":()=>import("./session-preamble-IZQPIWST.js").then(o=>o.sessionPreambleHook),"stop-enforce":()=>import("./stop-enforce-4UUK36YU.js").then(o=>o.stopEnforceHook),"tasks-reminder":()=>import("./tasks-reminder-TDWPD3KV.js").then(o=>t("UserPromptSubmit",o.tasksReminder)),"tasks-reminder-tool":()=>Promise.resolve(t("PostToolUse",()=>{})),"track-skill-load":()=>import("./track-skill-load-SXSDMHFO.js").then(o=>o.trackSkillLoadHook),"track-skill-prompt":()=>import("./track-skill-prompt-7N4TQAD2.js").then(o=>t("UserPromptSubmit",o.trackSkillPrompt))},n=d;async function P(o){let e=n[o];e==null&&(process.stderr.write(`Unknown hook: ${o}
6
+ `),process.exit(1));let i=await m(),r=await p(await e(),i);if(r.kind==="crash"){let{renderHookCrash:a}=await import("./cli-error-N7X2CREI.js");process.stderr.write(`${a(o,r.error)}
7
7
  `),process.exit(0)}r.stdout!=null&&process.stdout.write(r.stdout),process.exit(0)}function m(){return new Promise((o,e)=>{if(process.stdin.isTTY){o("");return}let i=[];process.stdin.on("data",r=>i.push(r)),process.stdin.on("end",()=>{o(Buffer.concat(i).toString("utf8"))}),process.stdin.on("error",e)})}export{l as a,n as b,P as c};
@@ -1,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{Ha as $,T as M,U as _,pa as z,qa as I,ra as g}from"./chunk-KGCLJTPO.js";import w from"fs";import s from"path";import{createHash as ve}from"crypto";import{pathToFileURL as Me}from"url";import{build as _e}from"esbuild";import{err as l,ok as F,ResultAsync as ze}from"neverthrow";import b from"fs";import{execFile as se}from"child_process";import{promisify as ae}from"util";import{fileURLToPath as C}from"url";import{z as L}from"zod";var ce=ae(se),le=L.object({diagnostics:L.array(L.string()),ok:L.boolean()});async function H(e){let r=de(),{stdout:n}=await ce(process.execPath,[...r.args,e],{maxBuffer:10*1024*1024}),t=JSON.parse(n);return le.parse(t)}function de(){let e=C(new URL("dsl-typecheck-worker.js",import.meta.url));if(b.existsSync(e))return{args:[e]};let r=C(new URL("../../dist/dsl-typecheck-worker.js",import.meta.url));if(b.existsSync(r))return{args:[r]};let n=C(new URL("../dsl-typecheck-worker.ts",import.meta.url));if(b.existsSync(n))return{args:["--experimental-strip-types",n]};throw new Error("DSL typecheck worker missing")}import ge from"safe-stable-stringify";import{err as he,ok as K,Result as ke}from"neverthrow";import{z as xe}from"zod";import k from"fs";import U from"path";import{z as u}from"zod";import{createHash as ue}from"crypto";function c(e){return ue("sha256").update(e).digest("base64")}var fe="fd3",pe="fold2";function T(){return`${String(g.currentVersion)}:${fe}:${pe}`}function x(e){return c([T(),...e].join("\0"))}function R({cwd:e,key:r,kind:n}){return D(e,n)?.entries.find(([o])=>o===r)?.[1]}function P({cwd:e,keep:r,key:n,kind:t,value:o}){let p=(D(e,t)?.entries??[]).filter(([a])=>a!==n),S=[n,o],v=[...p,S].slice(-r),y=N(e,t),d={entries:v,epoch:T()};k.mkdirSync(U.dirname(y),{recursive:!0}),k.writeFileSync(y,JSON.stringify(d)),h=new Map([...h,[y,{signature:B(y),store:d}]])}var ye=u.object({entries:u.array(u.tuple([u.string(),u.unknown()])),epoch:u.string()}),h=new Map;function D(e,r){let n=N(e,r),t=B(n),o=h.get(n);if(o!=null&&o.signature===t)return o.store;let i=me({signature:t,storePath:n});return h=new Map([...h,[n,{signature:t,store:i}]]),i}function me({signature:e,storePath:r}){if(e!=null)try{let n=ye.safeParse(JSON.parse(k.readFileSync(r,"utf8")));return!n.success||n.data.epoch!==T()?void 0:n.data}catch{return}}function B(e){if(!k.existsSync(e))return;let r=k.statSync(e);return`${String(r.mtimeMs)}:${String(r.size)}`}function N(e,r){return U.join(e,".ripplo",".local","cache",`${r}.json`)}async function J(e,r){let n=await V({cwd:r,workflows:e.workflows});return ke.combine(n).map(t=>({...e,workflows:[...t]}))}var Ee=xe.array(z),X=4;async function V({cwd:e,workflows:r}){if(r.length===0)return[];let n=r.slice(0,X),t=await Promise.all(n.map(i=>we({cwd:e,workflow:i}))),o=await V({cwd:e,workflows:r.slice(X)});return[...t,...o]}async function we({cwd:e,workflow:r}){let n=x(["expand",Se(r)]),t=Ee.safeParse(R({cwd:e,key:n,kind:"expand"}));if(t.success)return K({...r,tests:t.data});try{let o=await $({workflow:r});return P({cwd:e,keep:2e3,key:n,kind:"expand",value:o.tests}),K(o)}catch(o){let i=o instanceof Error?o.message:String(o);return he({kind:"expand-failed",message:i,workflow:r.name})}}function Se(e){let r=ge({...e,tests:[]});if(r==null)throw new Error("solver: workflow is not serializable");return r}import{createHash as Le}from"crypto";import G from"fs/promises";import j from"path";import{err as f,ok as A,Result as Re}from"neverthrow";var Pe=".ripplo/fixtures",Fe=10*1024*1024,be=50*1024*1024;async function Y(e,r){let n=Ce(r);if(n.length===0)return A({});let t=j.join(e,Pe),o=await Promise.all(n.map(i=>Te({fixturesRoot:t,name:i})));return Re.combine(o).andThen(je)}function Ce(e){let n=e.workflows.flatMap(t=>[...t.steps,...t.tests.flatMap(o=>o.steps)]).flatMap(t=>t.action.kind==="upload"?t.action.files:[]);return[...new Set(n)].toSorted((t,o)=>t.localeCompare(o))}async function Te({fixturesRoot:e,name:r}){if(r.includes("..")||j.isAbsolute(r))return f({kind:"fixture-invalid-name",name:r});let n=j.join(e,r),t=await G.lstat(n).catch(()=>null);if(t==null)return f({kind:"fixture-missing",name:r,path:n});if(t.isSymbolicLink())return f({kind:"fixture-symlink",name:r});if(!t.isFile())return f({kind:"fixture-not-file",name:r});let o=await G.readFile(n);if(o.byteLength>Fe)return f({kind:"fixture-too-large",name:r,size:o.byteLength});let i=Le("sha256").update(o).digest("hex");return A([r,{sha256:i,size:o.byteLength}])}function je(e){let r=e.reduce((n,[,t])=>n+t.size,0);return r>be?f({kind:"fixtures-total-too-large",total:r}):A(Object.fromEntries(e))}import Z from"fs";import Ae from"path";import{z as O}from"zod";function q({cwd:e,fingerprint:r}){let n=ee(e);if(n==null||n.fingerprint!==c(r))return;let t=Ae.join(e,".ripplo","ripplo.lock");if(!Z.existsSync(t))return;let o=Z.readFileSync(t,"utf8");if(c(o)===n.lockfileHash)try{let i=_(g,o);return Oe(i)?void 0:i}catch{return}}function Oe(e){return e.workflows.some(({sourcePath:r})=>r?.startsWith(".local/")===!0)}function Q({cwd:e,fingerprint:r,lockfile:n}){re(e,{fingerprint:c(r),lockfileHash:c(M(g,n))})}function jr(e,r){let n=ee(e);n!=null&&re(e,{...n,lockfileHash:c(r)})}var We=O.object({fingerprint:O.string(),lockfileHash:O.string()});function ee(e){let r=We.safeParse(R({cwd:e,key:x(["load"]),kind:"load"}));return r.success?r.data:void 0}function re(e,r){P({cwd:e,keep:1,key:x(["load"]),kind:"load",value:r})}var Br=".ripplo/ripplo.lock",E;async function Nr(e){let{result:r}=await Ie(e);return r}async function Ie(e){let r=te(s.join(e,".ripplo"));if(E!=null&&E.fingerprint===r&&E.result.isOk())return{fingerprint:r,result:E.result};let n=await $e(e);return E={fingerprint:r,result:n},{fingerprint:r,result:n}}async function $e(e){let r=s.join(e,".ripplo"),n=s.join(r,"index.ts"),t=te(r),o=q({cwd:e,fingerprint:t});if(o!=null)return F(o);let i=Xe(n);i.catch(()=>{});let p=await He(r);if(p.isErr())return l(p.error);let S=p.value;if(!S.ok)return l({diagnostics:S.diagnostics,kind:"typecheck-failed"});let d=await(await Je(n,i)).andThen(a=>Ye({entryPath:n,exported:a})).match(async a=>(await Y(e,a)).map(m=>({...a,fixtures:m})).mapErr(m=>({error:m,kind:"fixture-failed"})).asyncAndThen(m=>new ze(J(m,e)).mapErr(ie=>ie)),a=>Promise.resolve(l(a)));return d.isOk()&&Q({cwd:e,fingerprint:t,lockfile:d.value}),d}async function He(e){try{return F(await H(e))}catch(r){return l(ne(r))}}function ne(e){return Ue(e)?{kind:"authoring-error",message:e.message}:{kind:"load-threw",message:Ge(e)}}function Ue(e){return e instanceof Error&&e.name==="RipploAuthoringError"}var De=new Set([".local",".turbo","debug","node_modules","ripplo.lock"]);function te(e){let r=s.join(e,"..","node_modules","@ripplo","testing");return[...W(e),...Ne(s.join(r,"package.json")),...Ke(r)].toSorted((n,t)=>n.localeCompare(t)).join("|")}function W(e){return Be(e).flatMap(r=>{if(De.has(r.name))return[];let n=s.join(e,r.name);if(r.isDirectory())return W(n);let t=oe(n);return t==null?[]:[`${n}:${String(t.mtimeMs)}:${String(t.size)}`]})}function Be(e){try{return w.readdirSync(e,{withFileTypes:!0})}catch{return[]}}function oe(e){try{return w.statSync(e)}catch{return}}function Ne(e){let r=oe(e);return r==null?[]:[`${e}:${String(r.mtimeMs)}:${String(r.size)}`]}function Ke(e){let r=s.join(e,"src");return w.existsSync(r)?W(r):[]}async function Xe(e){let n=(await _e({bundle:!0,entryPoints:[e],format:"esm",logLevel:"silent",platform:"node",sourcemap:"inline",target:"node22",write:!1})).outputFiles[0];if(n==null)throw new Error("dsl bundle produced no output");return n.text}async function Je(e,r){try{let n=await r;process.setSourceMapsEnabled(!0);let t=await import(Ve(e,n)),o=t!=null&&typeof t=="object"&&"default"in t?Reflect.get(t,"default"):t;return F(o)}catch(n){return l(ne(n))}}function Ve(e,r){let n=s.join(s.dirname(e),".local");w.mkdirSync(n,{recursive:!0});let t=ve("sha256").update(r).digest("hex").slice(0,16),o=s.join(n,`dsl-bundle-${t}.mjs`);return w.writeFileSync(o,r),Me(o).href}function Ge(e){return e instanceof Error?e.message:String(e)}function Ye({entryPath:e,exported:r}){if(r==null||typeof r!="object"||!("lockfile"in r))return l({entryPath:e,kind:"not-ripplo"});let n=I.safeParse(Reflect.get(r,"lockfile"));return n.success?F(n.data):l({issues:n.error.issues.map(t=>`${t.path.join(".")}: ${t.message}`),kind:"invalid-lockfile"})}export{c as a,T as b,x as c,R as d,P as e,Pe as f,Fe as g,be as h,jr as i,Br as j,Nr as k,Ie as l,$e as m,te as n};
4
+ import{Na as $,U as M,V as _,qa as z,ra as I,sa as g}from"./chunk-NXKOUVSC.js";import w from"fs";import s from"path";import{createHash as ve}from"crypto";import{pathToFileURL as Me}from"url";import{build as _e}from"esbuild";import{err as l,ok as F,ResultAsync as ze}from"neverthrow";import b from"fs";import{execFile as se}from"child_process";import{promisify as ae}from"util";import{fileURLToPath as C}from"url";import{z as L}from"zod";var ce=ae(se),le=L.object({diagnostics:L.array(L.string()),ok:L.boolean()});async function H(e){let r=de(),{stdout:n}=await ce(process.execPath,[...r.args,e],{maxBuffer:10*1024*1024}),t=JSON.parse(n);return le.parse(t)}function de(){let e=C(new URL("dsl-typecheck-worker.js",import.meta.url));if(b.existsSync(e))return{args:[e]};let r=C(new URL("../../dist/dsl-typecheck-worker.js",import.meta.url));if(b.existsSync(r))return{args:[r]};let n=C(new URL("../dsl-typecheck-worker.ts",import.meta.url));if(b.existsSync(n))return{args:["--experimental-strip-types",n]};throw new Error("DSL typecheck worker missing")}import ge from"safe-stable-stringify";import{err as he,ok as K,Result as ke}from"neverthrow";import{z as xe}from"zod";import k from"fs";import U from"path";import{z as u}from"zod";import{createHash as ue}from"crypto";function c(e){return ue("sha256").update(e).digest("base64")}var fe="fd4",pe="fold4";function T(){return`${String(g.currentVersion)}:${fe}:${pe}`}function x(e){return c([T(),...e].join("\0"))}function R({cwd:e,key:r,kind:n}){return D(e,n)?.entries.find(([o])=>o===r)?.[1]}function P({cwd:e,keep:r,key:n,kind:t,value:o}){let p=(D(e,t)?.entries??[]).filter(([a])=>a!==n),S=[n,o],v=[...p,S].slice(-r),y=N(e,t),d={entries:v,epoch:T()};k.mkdirSync(U.dirname(y),{recursive:!0}),k.writeFileSync(y,JSON.stringify(d)),h=new Map([...h,[y,{signature:B(y),store:d}]])}var ye=u.object({entries:u.array(u.tuple([u.string(),u.unknown()])),epoch:u.string()}),h=new Map;function D(e,r){let n=N(e,r),t=B(n),o=h.get(n);if(o!=null&&o.signature===t)return o.store;let i=me({signature:t,storePath:n});return h=new Map([...h,[n,{signature:t,store:i}]]),i}function me({signature:e,storePath:r}){if(e!=null)try{let n=ye.safeParse(JSON.parse(k.readFileSync(r,"utf8")));return!n.success||n.data.epoch!==T()?void 0:n.data}catch{return}}function B(e){if(!k.existsSync(e))return;let r=k.statSync(e);return`${String(r.mtimeMs)}:${String(r.size)}`}function N(e,r){return U.join(e,".ripplo",".local","cache",`${r}.json`)}async function J(e,r){let n=await V({cwd:r,workflows:e.workflows});return ke.combine(n).map(t=>({...e,workflows:[...t]}))}var Ee=xe.array(z),X=4;async function V({cwd:e,workflows:r}){if(r.length===0)return[];let n=r.slice(0,X),t=await Promise.all(n.map(i=>we({cwd:e,workflow:i}))),o=await V({cwd:e,workflows:r.slice(X)});return[...t,...o]}async function we({cwd:e,workflow:r}){let n=x(["expand",Se(r)]),t=Ee.safeParse(R({cwd:e,key:n,kind:"expand"}));if(t.success)return K({...r,tests:t.data});try{let o=await $({workflow:r});return P({cwd:e,keep:2e3,key:n,kind:"expand",value:o.tests}),K(o)}catch(o){let i=o instanceof Error?o.message:String(o);return he({kind:"expand-failed",message:i,workflow:r.name})}}function Se(e){let r=ge({...e,tests:[]});if(r==null)throw new Error("solver: workflow is not serializable");return r}import{createHash as Le}from"crypto";import G from"fs/promises";import j from"path";import{err as f,ok as A,Result as Re}from"neverthrow";var Pe=".ripplo/fixtures",Fe=10*1024*1024,be=50*1024*1024;async function Y(e,r){let n=Ce(r);if(n.length===0)return A({});let t=j.join(e,Pe),o=await Promise.all(n.map(i=>Te({fixturesRoot:t,name:i})));return Re.combine(o).andThen(je)}function Ce(e){let n=e.workflows.flatMap(t=>[...t.steps,...t.tests.flatMap(o=>o.steps)]).flatMap(t=>t.action.kind==="upload"?t.action.files:[]);return[...new Set(n)].toSorted((t,o)=>t.localeCompare(o))}async function Te({fixturesRoot:e,name:r}){if(r.includes("..")||j.isAbsolute(r))return f({kind:"fixture-invalid-name",name:r});let n=j.join(e,r),t=await G.lstat(n).catch(()=>null);if(t==null)return f({kind:"fixture-missing",name:r,path:n});if(t.isSymbolicLink())return f({kind:"fixture-symlink",name:r});if(!t.isFile())return f({kind:"fixture-not-file",name:r});let o=await G.readFile(n);if(o.byteLength>Fe)return f({kind:"fixture-too-large",name:r,size:o.byteLength});let i=Le("sha256").update(o).digest("hex");return A([r,{sha256:i,size:o.byteLength}])}function je(e){let r=e.reduce((n,[,t])=>n+t.size,0);return r>be?f({kind:"fixtures-total-too-large",total:r}):A(Object.fromEntries(e))}import Z from"fs";import Ae from"path";import{z as O}from"zod";function q({cwd:e,fingerprint:r}){let n=ee(e);if(n==null||n.fingerprint!==c(r))return;let t=Ae.join(e,".ripplo","ripplo.lock");if(!Z.existsSync(t))return;let o=Z.readFileSync(t,"utf8");if(c(o)===n.lockfileHash)try{let i=_(g,o);return Oe(i)?void 0:i}catch{return}}function Oe(e){return e.workflows.some(({sourcePath:r})=>r?.startsWith(".local/")===!0)}function Q({cwd:e,fingerprint:r,lockfile:n}){re(e,{fingerprint:c(r),lockfileHash:c(M(g,n))})}function jr(e,r){let n=ee(e);n!=null&&re(e,{...n,lockfileHash:c(r)})}var We=O.object({fingerprint:O.string(),lockfileHash:O.string()});function ee(e){let r=We.safeParse(R({cwd:e,key:x(["load"]),kind:"load"}));return r.success?r.data:void 0}function re(e,r){P({cwd:e,keep:1,key:x(["load"]),kind:"load",value:r})}var Br=".ripplo/ripplo.lock",E;async function Nr(e){let{result:r}=await Ie(e);return r}async function Ie(e){let r=te(s.join(e,".ripplo"));if(E!=null&&E.fingerprint===r&&E.result.isOk())return{fingerprint:r,result:E.result};let n=await $e(e);return E={fingerprint:r,result:n},{fingerprint:r,result:n}}async function $e(e){let r=s.join(e,".ripplo"),n=s.join(r,"index.ts"),t=te(r),o=q({cwd:e,fingerprint:t});if(o!=null)return F(o);let i=Xe(n);i.catch(()=>{});let p=await He(r);if(p.isErr())return l(p.error);let S=p.value;if(!S.ok)return l({diagnostics:S.diagnostics,kind:"typecheck-failed"});let d=await(await Je(n,i)).andThen(a=>Ye({entryPath:n,exported:a})).match(async a=>(await Y(e,a)).map(m=>({...a,fixtures:m})).mapErr(m=>({error:m,kind:"fixture-failed"})).asyncAndThen(m=>new ze(J(m,e)).mapErr(ie=>ie)),a=>Promise.resolve(l(a)));return d.isOk()&&Q({cwd:e,fingerprint:t,lockfile:d.value}),d}async function He(e){try{return F(await H(e))}catch(r){return l(ne(r))}}function ne(e){return Ue(e)?{kind:"authoring-error",message:e.message}:{kind:"load-threw",message:Ge(e)}}function Ue(e){return e instanceof Error&&e.name==="RipploAuthoringError"}var De=new Set([".local",".turbo","debug","node_modules","ripplo.lock"]);function te(e){let r=s.join(e,"..","node_modules","@ripplo","testing");return[...W(e),...Ne(s.join(r,"package.json")),...Ke(r)].toSorted((n,t)=>n.localeCompare(t)).join("|")}function W(e){return Be(e).flatMap(r=>{if(De.has(r.name))return[];let n=s.join(e,r.name);if(r.isDirectory())return W(n);let t=oe(n);return t==null?[]:[`${n}:${String(t.mtimeMs)}:${String(t.size)}`]})}function Be(e){try{return w.readdirSync(e,{withFileTypes:!0})}catch{return[]}}function oe(e){try{return w.statSync(e)}catch{return}}function Ne(e){let r=oe(e);return r==null?[]:[`${e}:${String(r.mtimeMs)}:${String(r.size)}`]}function Ke(e){let r=s.join(e,"src");return w.existsSync(r)?W(r):[]}async function Xe(e){let n=(await _e({bundle:!0,entryPoints:[e],format:"esm",logLevel:"silent",platform:"node",sourcemap:"inline",target:"node22",write:!1})).outputFiles[0];if(n==null)throw new Error("dsl bundle produced no output");return n.text}async function Je(e,r){try{let n=await r;process.setSourceMapsEnabled(!0);let t=await import(Ve(e,n)),o=t!=null&&typeof t=="object"&&"default"in t?Reflect.get(t,"default"):t;return F(o)}catch(n){return l(ne(n))}}function Ve(e,r){let n=s.join(s.dirname(e),".local");w.mkdirSync(n,{recursive:!0});let t=ve("sha256").update(r).digest("hex").slice(0,16),o=s.join(n,`dsl-bundle-${t}.mjs`);return w.writeFileSync(o,r),Me(o).href}function Ge(e){return e instanceof Error?e.message:String(e)}function Ye({entryPath:e,exported:r}){if(r==null||typeof r!="object"||!("lockfile"in r))return l({entryPath:e,kind:"not-ripplo"});let n=I.safeParse(Reflect.get(r,"lockfile"));return n.success?F(n.data):l({issues:n.error.issues.map(t=>`${t.path.join(".")}: ${t.message}`),kind:"invalid-lockfile"})}export{c as a,T as b,x as c,R as d,P as e,Pe as f,Fe as g,be as h,jr as i,Br as j,Nr as k,Ie as l,$e as m,te as n};
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __ripploCreateRequire } from "node:module";
3
3
  const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
4
- import{a as t}from"./chunk-MHNGR6M7.js";import{g as o,h as a,j as i}from"./chunk-D5F6DIXU.js";function h(e){return e.kind==="authoring-error"?["Compilation failed",e.message,t("create","DSL authoring rules")].join(`
4
+ import{a as t}from"./chunk-MHNGR6M7.js";import{g as o,h as a,j as i}from"./chunk-BQ25IGJS.js";function h(e){return e.kind==="authoring-error"?["Compilation failed",e.message,t("create","DSL authoring rules")].join(`
5
5
 
6
6
  `):[`Compilation failed: ${l(e)}`,t("create","DSL authoring rules")].join(`
7
7
  `)}function x(){return`${i} is up to date`}function $(e){return[`${i} is ${e==="missing"?"missing":"out of date"} \u2014 run \`npx ripplo compile\` and commit it`,t("setup")].join(`
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __ripploCreateRequire } from "node:module";
3
3
  const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
4
- import{u as O}from"./chunk-7E3AM2KY.js";import{a as x,b as h,c as f,d as c,e as s,i as w,j as L,m as E}from"./chunk-D5F6DIXU.js";import{Ja as v,Ka as S,Ma as P,Na as b,T as d,U as u,ka as g,ra as n,sa as k}from"./chunk-KGCLJTPO.js";import{readFile as D,writeFile as W}from"fs/promises";import H from"path";import{err as C,ok as q}from"neverthrow";import j from"safe-stable-stringify";function m(e){return{...e,checks:void 0}}function y(e,t){return j(m(e))===j(m(t))}import{z as i}from"zod";function R({cwd:e}){let t=K.safeParse(c({cwd:e,key:p(),kind:"verdicts"}));t.success&&(P(new Map(Object.entries(t.data.cosat))),v(new Map(Object.entries(t.data.subsume))))}function F({cwd:e}){let t=b(),o=S();s({cwd:e,keep:8,key:p(),kind:"verdicts",value:{cosat:Object.fromEntries(t),subsume:Object.fromEntries(o)}})}function Z({cwd:e}){let t=M.safeParse(c({cwd:e,key:p(),kind:"lint-clean"}));return t.success?t.data.cleanLockfile:void 0}function $({cleanLockfileHash:e,cwd:t}){e!=null&&s({cwd:t,keep:8,key:p(),kind:"lint-clean",value:{cleanLockfile:e}})}function ee(e){return x(e)}var K=i.object({cosat:i.record(i.string(),i.boolean()),subsume:i.record(i.string(),i.boolean())}),M=i.object({cleanLockfile:i.string()});function p(){return f(["patterns"])}import I from"safe-stable-stringify";async function de(e){let t=await E(e);return t.isOk()&&await J(e,t.value),t}async function J(e,t){let o=await T(e,t),r=d(n,o);return await W(H.join(e,L),r),w(e,r),o}var A=new WeakMap;function T(e,t){let o=A.get(t);if(o!=null)return o;let r=V(e,t).then(a=>a.match(l=>Promise.resolve(l),()=>_(e,t)));return A.set(t,r),r}function ue(e,t){return V(e,t)}function ke(e){return e.workflows.filter(t=>t.stub).map(t=>t.name)}async function he(e,t){let o=await B(e);return o==null?"missing":o.checks==null?"stale":y(o,t)?"match":"stale"}async function V(e,t){let o=await B(e);return o==null?C({kind:"no-lockfile"}):o.checks==null||o.checks.epoch!==h()?C({kind:"unstamped"}):y(o,t)?q(k(o)):C({kind:"dsl-drift"})}async function B(e){try{let t=await D(H.join(e,L),"utf8");return u(n,t)}catch{return null}}function _(e,t){R({cwd:e});let o={...z(e,t),epoch:h()};F({cwd:e});let r={...t,checks:o};return k(u(n,d(n,r)))}function z(e,t){let o=I(m(t)),r=f(["checks",o]),a=g.safeParse(c({cwd:e,key:r,kind:"checks"}));if(a.success)return a.data;let l=O(t);return s({cwd:e,keep:4,key:r,kind:"checks",value:l}),l}export{m as a,y as b,R as c,F as d,Z as e,$ as f,ee as g,de as h,J as i,T as j,ue as k,ke as l,he as m};
4
+ import{u as O}from"./chunk-PVRM4YWS.js";import{a as x,b as h,c as f,d as c,e as s,i as w,j as L,m as E}from"./chunk-BQ25IGJS.js";import{Pa as v,Qa as S,Sa as P,Ta as b,U as d,V as u,la as g,sa as n,ta as k}from"./chunk-NXKOUVSC.js";import{readFile as D,writeFile as W}from"fs/promises";import H from"path";import{err as C,ok as q}from"neverthrow";import j from"safe-stable-stringify";function m(e){return{...e,checks:void 0}}function y(e,t){return j(m(e))===j(m(t))}import{z as i}from"zod";function R({cwd:e}){let t=K.safeParse(c({cwd:e,key:p(),kind:"verdicts"}));t.success&&(P(new Map(Object.entries(t.data.cosat))),v(new Map(Object.entries(t.data.subsume))))}function F({cwd:e}){let t=b(),o=S();s({cwd:e,keep:8,key:p(),kind:"verdicts",value:{cosat:Object.fromEntries(t),subsume:Object.fromEntries(o)}})}function Z({cwd:e}){let t=M.safeParse(c({cwd:e,key:p(),kind:"lint-clean"}));return t.success?t.data.cleanLockfile:void 0}function $({cleanLockfileHash:e,cwd:t}){e!=null&&s({cwd:t,keep:8,key:p(),kind:"lint-clean",value:{cleanLockfile:e}})}function ee(e){return x(e)}var K=i.object({cosat:i.record(i.string(),i.boolean()),subsume:i.record(i.string(),i.boolean())}),M=i.object({cleanLockfile:i.string()});function p(){return f(["patterns"])}import I from"safe-stable-stringify";async function de(e){let t=await E(e);return t.isOk()&&await J(e,t.value),t}async function J(e,t){let o=await T(e,t),r=d(n,o);return await W(H.join(e,L),r),w(e,r),o}var A=new WeakMap;function T(e,t){let o=A.get(t);if(o!=null)return o;let r=V(e,t).then(a=>a.match(l=>Promise.resolve(l),()=>_(e,t)));return A.set(t,r),r}function ue(e,t){return V(e,t)}function ke(e){return e.workflows.filter(t=>t.stub).map(t=>t.name)}async function he(e,t){let o=await B(e);return o==null?"missing":o.checks==null?"stale":y(o,t)?"match":"stale"}async function V(e,t){let o=await B(e);return o==null?C({kind:"no-lockfile"}):o.checks==null||o.checks.epoch!==h()?C({kind:"unstamped"}):y(o,t)?q(k(o)):C({kind:"dsl-drift"})}async function B(e){try{let t=await D(H.join(e,L),"utf8");return u(n,t)}catch{return null}}function _(e,t){R({cwd:e});let o={...z(e,t),epoch:h()};F({cwd:e});let r={...t,checks:o};return k(u(n,d(n,r)))}function z(e,t){let o=I(m(t)),r=f(["checks",o]),a=g.safeParse(c({cwd:e,key:r,kind:"checks"}));if(a.success)return a.data;let l=O(t);return s({cwd:e,keep:4,key:r,kind:"checks",value:l}),l}export{m as a,y as b,R as c,F as d,Z as e,$ as f,ee as g,de as h,J as i,T as j,ue as k,ke as l,he as m};
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __ripploCreateRequire } from "node:module";
3
3
  const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
4
- import{a as n}from"./chunk-7WZ3VIUU.js";import{f as r}from"./chunk-KH4QH23U.js";var m=async o=>{if(o.permission_mode!=="plan"||!n(o.cwd)||!r(o.cwd))return;let{loadRipplo:s}=await import("./dsl-loader-3PR7GLST.js"),{stubbedWorkflows:a}=await import("./compile-write-HYPPASGM.js"),t=await s(o.cwd);if(t.isErr())return;let e=a(t.value),i=['Plan must include "Tests to implement" with a .ripplo/workflows/ file per affected flow (ExitPlanMode blocks otherwise). Stub each with `workflow("Intent")` (no body).'];return e.length>0&&i.push(`Existing stubs: ${e.join(", ")}`),{hookSpecificOutput:{additionalContext:i.join(`
4
+ import{a as n}from"./chunk-7WZ3VIUU.js";import{f as r}from"./chunk-KH4QH23U.js";var m=async o=>{if(o.permission_mode!=="plan"||!n(o.cwd)||!r(o.cwd))return;let{loadRipplo:s}=await import("./dsl-loader-SSXMC5EE.js"),{stubbedWorkflows:a}=await import("./compile-write-XMVD5PX2.js"),t=await s(o.cwd);if(t.isErr())return;let e=a(t.value),i=['Plan must include "Tests to implement" with a .ripplo/workflows/ file per affected flow (ExitPlanMode blocks otherwise). Stub each with `workflow("Intent")` (no body).'];return e.length>0&&i.push(`Existing stubs: ${e.join(", ")}`),{hookSpecificOutput:{additionalContext:i.join(`
5
5
  `),hookEventName:"UserPromptSubmit"}}};export{m as a};
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __ripploCreateRequire } from "node:module";
3
3
  const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
4
- import{c as R}from"./chunk-JS3DLVVI.js";import{f as I,j as v,m as x}from"./chunk-D5F6DIXU.js";import{Ea as k,Ga as P,T as h,ra as w}from"./chunk-KGCLJTPO.js";import{a as S,f as m}from"./chunk-KH4QH23U.js";import{d as a,f}from"./chunk-C7SV6AR2.js";import y from"fs";import p from"path";function D(e){try{let n=C(e);if(n==null)return;let t=p.join(n,"HEAD"),o=y.readFileSync(t,"utf8").trim(),r="ref: refs/heads/";return o.startsWith(r)?o.slice(r.length):o.length===0?void 0:o.slice(0,7)}catch{return}}function C(e){let n=p.join(e,".git");if(y.statSync(n).isDirectory())return n;let o=y.readFileSync(n,"utf8").trim(),r="gitdir:";if(!o.startsWith(r))return;let i=o.slice(r.length).trim();if(i.length!==0)return p.resolve(e,i)}import T from"crypto";import{readFile as j}from"fs/promises";import $ from"path";import{graphql as g}from"gql.tada";import{err as F,ok as W}from"neverthrow";var O=g(`
4
+ import{c as R}from"./chunk-JS3DLVVI.js";import{f as I,j as v,m as x}from"./chunk-BQ25IGJS.js";import{Ka as k,Ma as P,U as h,sa as w}from"./chunk-NXKOUVSC.js";import{a as S,f as m}from"./chunk-KH4QH23U.js";import{d as a,f}from"./chunk-C7SV6AR2.js";import y from"fs";import p from"path";function D(e){try{let n=C(e);if(n==null)return;let t=p.join(n,"HEAD"),o=y.readFileSync(t,"utf8").trim(),r="ref: refs/heads/";return o.startsWith(r)?o.slice(r.length):o.length===0?void 0:o.slice(0,7)}catch{return}}function C(e){let n=p.join(e,".git");if(y.statSync(n).isDirectory())return n;let o=y.readFileSync(n,"utf8").trim(),r="gitdir:";if(!o.startsWith(r))return;let i=o.slice(r.length).trim();if(i.length!==0)return p.resolve(e,i)}import T from"crypto";import{readFile as j}from"fs/promises";import $ from"path";import{graphql as g}from"gql.tada";import{err as F,ok as W}from"neverthrow";var O=g(`
5
5
  mutation SyncDevSession(
6
6
  $projectId: String!
7
7
  $cwd: String!