ripplo 0.15.2 → 0.17.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 (77) hide show
  1. package/README.md +26 -138
  2. package/dist/chunk-HA3VCAP6.js +3 -0
  3. package/dist/graphql-Z4UDRCDF.js +185 -0
  4. package/dist/index.js +345 -625
  5. package/package.json +10 -45
  6. package/dist/assets/browser-trace.js +0 -1
  7. package/dist/assets/rrweb.js +0 -54
  8. package/dist/capture-worker.js +0 -13892
  9. package/dist/chunk-3BPQWAUL.js +0 -4
  10. package/dist/chunk-47LLHHJH.js +0 -9
  11. package/dist/chunk-5HFJIZLI.js +0 -4
  12. package/dist/chunk-5RKZ44OU.js +0 -4
  13. package/dist/chunk-7WZ3VIUU.js +0 -4
  14. package/dist/chunk-AXROBTLA.js +0 -4
  15. package/dist/chunk-BFAWQ5U2.js +0 -61
  16. package/dist/chunk-BGY5F3IU.js +0 -5
  17. package/dist/chunk-BIB4JJKD.js +0 -84
  18. package/dist/chunk-C7SV6AR2.js +0 -48
  19. package/dist/chunk-CI6273ZU.js +0 -107
  20. package/dist/chunk-FEHVIHVA.js +0 -5
  21. package/dist/chunk-G6J2WIHJ.js +0 -4
  22. package/dist/chunk-HEOMRXZE.js +0 -4
  23. package/dist/chunk-HN55QF5N.js +0 -405
  24. package/dist/chunk-JJ4QQPAV.js +0 -4
  25. package/dist/chunk-JQ2CRYVX.js +0 -4
  26. package/dist/chunk-JS3DLVVI.js +0 -4
  27. package/dist/chunk-KH4QH23U.js +0 -4
  28. package/dist/chunk-KMZ3L5YA.js +0 -4
  29. package/dist/chunk-KOKEEAEF.js +0 -6
  30. package/dist/chunk-LCCJPRT5.js +0 -5
  31. package/dist/chunk-MHNGR6M7.js +0 -4
  32. package/dist/chunk-NNH3YVVO.js +0 -4
  33. package/dist/chunk-OQ6KNYPG.js +0 -4
  34. package/dist/chunk-PYDYI3AA.js +0 -23
  35. package/dist/chunk-Q2TF5WLS.js +0 -6
  36. package/dist/chunk-QEE4CNMY.js +0 -6
  37. package/dist/chunk-R4ZTRVDQ.js +0 -4
  38. package/dist/chunk-RIASQHPG.js +0 -4
  39. package/dist/chunk-RLB66SU3.js +0 -4
  40. package/dist/chunk-SXVWB7TZ.js +0 -6
  41. package/dist/chunk-T6WA2F3S.js +0 -16
  42. package/dist/chunk-TZPYILZK.js +0 -4
  43. package/dist/chunk-VHFITVRX.js +0 -13
  44. package/dist/chunk-W3CXPVVB.js +0 -7
  45. package/dist/chunk-WB3HHOCG.js +0 -11
  46. package/dist/chunk-XA6BMQTW.js +0 -8
  47. package/dist/chunk-XAMVRZJH.js +0 -23
  48. package/dist/chunk-Y52M43LO.js +0 -8
  49. package/dist/chunk-YD4VBOBY.js +0 -4
  50. package/dist/chunk-YRU6BOIP.js +0 -9
  51. package/dist/chunk-ZSD6QDYB.js +0 -56
  52. package/dist/cli-error-UYWIDE4L.js +0 -4
  53. package/dist/compile-write-QNV2EA5B.js +0 -4
  54. package/dist/daemon-D4UCHMHS.js +0 -175
  55. package/dist/daemon-LZTY7W4M.js +0 -4
  56. package/dist/daemon-lock-RPKO5SNE.js +0 -4
  57. package/dist/dsl-loader-G2CRA252.js +0 -4
  58. package/dist/dsl-typecheck-worker.js +0 -6
  59. package/dist/exit-plan-gate-44YWEKYS.js +0 -4
  60. package/dist/hook.js +0 -5
  61. package/dist/plan-reminder-EDDIUY43.js +0 -4
  62. package/dist/post-edit-4CM5P2G2.js +0 -4
  63. package/dist/post-edit-analyze-HKOTNA2H.js +0 -4
  64. package/dist/post-edit-flag-stubs-2HZMK4NQ.js +0 -4
  65. package/dist/pre-bash-run-gate-CDFNAIK3.js +0 -4
  66. package/dist/pre-edit-JZX36QX6.js +0 -4
  67. package/dist/pre-edit-ripplo-skill-gate-A6ETC3QN.js +0 -4
  68. package/dist/pre-edit-scope-gate-HNIQ7KOQ.js +0 -4
  69. package/dist/pre-edit-watch-gate-T2TWL66C.js +0 -4
  70. package/dist/prompt-submit-GVZHK3CI.js +0 -4
  71. package/dist/scope-reminder-A6GVTTVE.js +0 -4
  72. package/dist/session-preamble-IZQPIWST.js +0 -4
  73. package/dist/status-CNSPYNYP.js +0 -4
  74. package/dist/stop-enforce-NKKP2X4U.js +0 -64
  75. package/dist/tasks-reminder-TDWPD3KV.js +0 -4
  76. package/dist/track-skill-load-SXSDMHFO.js +0 -4
  77. package/dist/track-skill-prompt-7N4TQAD2.js +0 -4
@@ -1,4 +0,0 @@
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 i}from"./chunk-MHNGR6M7.js";import{m as p}from"./chunk-RLB66SU3.js";import{a}from"./chunk-7WZ3VIUU.js";import{e as s}from"./chunk-KH4QH23U.js";import{c as n}from"./chunk-RIASQHPG.js";import l from"fs";import d from"path";import*as r from"zod/mini";var c=new Set(["Edit","Write","NotebookEdit"]),u=r.looseObject({file_path:r.string()}),D=async t=>{if(!c.has(t.tool_name))return;let e=m(t);if(e==null)return;let{cwd:o}=t;return l.existsSync(s(o))||n(o)?void 0:(await p(o)).isErr()?{hookSpecificOutput:{additionalContext:`\`ripplo daemon\` isn't running and the DSL isn't compiling, so this edit is allowed through without dev-mode guardrails. Run \`npx ripplo compile\` to see the errors, or \`/ripplo:start\` to bring the daemon up. ${i("create","DSL authoring rules")}`,hookEventName:"PreToolUse"}}:{hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"deny",permissionDecisionReason:`\`ripplo daemon\` is not running \u2014 this edit to \`${e}\` won't sync and dev-mode guardrails won't fire. Run \`/ripplo:start\`, then retry (\`npx ripplo doctor\` checks the daemon and dev server). If the daemon can't start, the user can bypass with \`npx ripplo hooks pause\`. ${i("start")}`}}};function m(t){let e=u.safeParse(t.tool_input);if(!e.success||!a(t.cwd))return null;let o=d.relative(t.cwd,e.data.file_path);return o.startsWith("..")||o!==".ripplo"&&!o.startsWith(".ripplo/")?null:o}export{D as a};
@@ -1,9 +0,0 @@
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 o}from"./chunk-OQ6KNYPG.js";import{a as i}from"./chunk-MHNGR6M7.js";function y(n){if(n.length===0)return"No open tasks.";let e=n.map(r=>` [${a(r.status)}] [${r.kind}] (${r.id}) ${l(r)}`);return[`${o(n.length,"open task")}:`,...e].join(`
5
- `)}function m(n){let e=`[${a(n.status)}] [${n.kind}] (${n.id}) ${n.title??""}`.trim(),r=n.messages.flatMap(t=>u(t));return[e,...r,"",$()].join(`
6
- `)}function x(n){let e=n.map(r=>` [${a(r.status)}] [${r.kind}] (${r.id}) ${l(r)}`);return[`New or updated Ripplo tasks (${o(n.length,"open task")}):`,...e,i("tasks","picking each up")].join(`
7
- `)}function T(n){let{task:e}=n,r=e.title??e.latestMessage??"(no description)",t=i("tasks");return n.type==="new"?`New task [${e.kind}] (${e.id}) ${r} \u2014 ${t}`:n.type==="reopened"?`Reopened task (${e.id}) ${r} \u2014 earlier resolution didn't hold. ${t}`:`User replied on task (${e.id}): ${e.latestMessage??r} \u2014 ${t}`}function b(n){return`No task with id ${n}. List them with \`npx ripplo tasks list\`.`}function w(n){return`Commented on task ${n}.`}function S(){return"Clarification needs a message \u2014 say what's ambiguous and what you need."}function N(n,e){let r=e==null?"an element node's id":`its parent element id ${String(e)}`;return`rrweb id ${String(n)} is a text node \u2014 no box to highlight. Anchor to ${r}.`}function M(n,e){return`rrweb id ${String(n)} is not in run ${e}. Pick an element id from .ripplo/debug/${e}/behavior.jsonl.`}function A(n){return`rrweb id ${String(n)} is not an element node. Anchor to an element so it can be highlighted.`}function R(n){return`Resolved task ${n}.`}function C(n){return`Started task ${n} \u2014 in progress until resolved, dismissed, or sent back for clarification.`}function I(n){return`Marked task ${n} as needing clarification \u2014 the user will follow up.`}function v(n){return`Dismissed task ${n}.`}function a(n){return n==="needsClarification"?"needs clarification":n}function l(n){return n.title??n.lastMessage??"(no description)"}function u(n){let e=n.authorName??n.author;return n.runId==null?[` ${e}: ${n.body}`]:[` ${e} @ ${n.runId}${c(n.frameMs)}: ${n.body}`,...p(n,n.runId)]}function c(n){return n==null?"":` (${String(n)}ms)`}function p(n,e){let r=f(n),t=n.frameMs==null?null:` see it: npx ripplo snapshot ${e} --offset ${String(n.frameMs)}`;return[r,t].filter(s=>s!=null)}function f(n){return n.element!=null?` element: ${g(n.element)}`:n.rrwebId==null?null:` element: rrweb id ${String(n.rrwebId)}`}function g(n){let e=n.role==null?"":`[role=${n.role}]`,r=n.testId==null?"":` testid=${n.testId}`,t=n.ariaName==null?"":` aria="${n.ariaName}"`,s=n.text==null?"":` "${n.text}"`,d=n.selector==null?"":`
8
- selector: ${n.selector}`;return`${n.tagName??"element"}${e}${r}${t}${s}${d}`}function $(){return["Snapshot the frame above and Read the PNG \u2014 the rendered frame is the evidence, not the thread text.","Read the whole run with `npx ripplo explain <runId>` \u2014 auto-pulls a cloud run's stream if not on disk.","Add `--full` for the synthesized starting state and a step-by-step timeline.",i("tasks","picking this up")].join(`
9
- `)}export{y as a,m as b,x as c,T as d,b as e,w as f,S as g,N as h,M as i,A as j,R as k,C as l,I as m,v as n};
@@ -1,4 +0,0 @@
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 n}from"./chunk-G6J2WIHJ.js";import{a}from"./chunk-7WZ3VIUU.js";import{f as s}from"./chunk-KH4QH23U.js";import l from"path";import*as r from"zod/mini";var p=new Set(["Edit","Write","NotebookEdit"]),c=r.looseObject({file_path:r.string()}),d="create",k=o=>{if(!p.has(o.tool_name))return;let i=c.safeParse(o.tool_input);if(!i.success)return;let{cwd:e}=o;if(!a(e)||!s(e))return;let t=l.relative(e,i.data.file_path);if(!(t.startsWith("..")||t!==".ripplo"&&!t.startsWith(".ripplo/"))&&!n(e,o.session_id,d))return{hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"deny",permissionDecisionReason:`Editing \`.ripplo/\` files (${t}) requires the \`/ripplo:create\` skill loaded first. Load \`/ripplo:create\` and retry. It contains the current state model, workflow authoring model, and DSL rules.`}}};export{k as a};
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire as __ripploCreateRequire } from "node:module";
3
- const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
4
- import{u as O}from"./chunk-BIB4JJKD.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-RLB66SU3.js";import{Qa as v,Ra as S,Ta as P,U as d,Ua as b,V as u,la as g,sa as n,ta as k}from"./chunk-ZSD6QDYB.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,4 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire as __ripploCreateRequire } from "node:module";
3
- const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
4
- import r from"fs";import i from"path";function n(o){return r.existsSync(i.join(o,".ripplo"))}export{n as a};
@@ -1,4 +0,0 @@
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 l}from"./chunk-CI6273ZU.js";import{a as i}from"./chunk-G6J2WIHJ.js";import{a as m}from"./chunk-7WZ3VIUU.js";var s=/(?:^|\s)\/ripplo:([a-z][a-z0-9-]*)\b/gi,c=o=>{if(!m(o.cwd))return;let t=[...o.prompt.matchAll(s)].map(r=>r[1]).filter(r=>r!=null);if(t.forEach(r=>{i(o.cwd,o.session_id,r)}),t.length===0)return;let e=l(o.cwd,o.session_id);if(e!=null)return{hookSpecificOutput:{additionalContext:e,hookEventName:"UserPromptSubmit"}}};export{c as a};
@@ -1,61 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire as __ripploCreateRequire } from "node:module";
3
- const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
4
- import{c as x}from"./chunk-JS3DLVVI.js";import{f as I,j as R,m as v}from"./chunk-RLB66SU3.js";import{Ka as P,Ma as k,U as h,sa as w}from"./chunk-ZSD6QDYB.js";import{a as S,f as m}from"./chunk-KH4QH23U.js";import{d as l,f}from"./chunk-C7SV6AR2.js";import y from"fs";import p from"path";function D(e){try{let o=L(e);if(o==null)return;let t=p.join(o,"HEAD"),n=y.readFileSync(t,"utf8").trim(),r="ref: refs/heads/";return n.startsWith(r)?n.slice(r.length):n.length===0?void 0:n.slice(0,7)}catch{return}}function L(e){let o=p.join(e,".git");if(y.statSync(o).isDirectory())return o;let n=y.readFileSync(o,"utf8").trim(),r="gitdir:";if(!n.startsWith(r))return;let i=n.slice(r.length).trim();if(i.length!==0)return p.resolve(e,i)}import C from"crypto";import{readFile as $}from"fs/promises";import j from"path";import{graphql as g}from"gql.tada";import{err as _,ok as F}from"neverthrow";var W=g(`
5
- mutation SyncDevSession(
6
- $projectId: String!
7
- $cwd: String!
8
- $branch: String
9
- $lockfileContent: String
10
- $fixtures: [SyncDevFixtureInput!]
11
- $teleportProtocolVersion: Int!
12
- $workflows: [SyncDevWorkflowInput!]!
13
- ) {
14
- syncDevSession(
15
- projectId: $projectId
16
- cwd: $cwd
17
- branch: $branch
18
- lockfileContent: $lockfileContent
19
- fixtures: $fixtures
20
- teleportProtocolVersion: $teleportProtocolVersion
21
- workflows: $workflows
22
- ) {
23
- id
24
- hooksPaused
25
- }
26
- }
27
- `);async function ue(e,o){let t=await v(e);if(t.isErr())return _({error:t.error,kind:"compilation-failed"});let n=await u({config:o,cwd:e,lockfile:t.value});return F({devSessionId:n.devSessionId,lockfile:t.value})}async function u(e){let o=P(e.lockfile);return M({config:e.config,cwd:e.cwd,fixtures:e.lockfile.fixtures,payload:o})}var V=g(`
28
- query DevSessionSyncState($projectId: String!, $cwd: String!) {
29
- project(id: $projectId) {
30
- devSession(cwd: $cwd) {
31
- id
32
- hooksPaused
33
- lockfileHash
34
- }
35
- }
36
- }
37
- `),H=g(`
38
- mutation AnnounceDevSessionActive(
39
- $projectId: String!
40
- $cwd: String!
41
- $teleportProtocolVersion: Int!
42
- ) {
43
- announceDevSessionActive(
44
- projectId: $projectId
45
- cwd: $cwd
46
- teleportProtocolVersion: $teleportProtocolVersion
47
- )
48
- }
49
- `);async function fe(e){let o=await q(e.cwd);if(o!=null){let n=(await l({config:e.config,document:V,variables:{cwd:e.cwd,projectId:e.config.projectId}}).catch(()=>null))?.project?.devSession;if(n!=null&&n.lockfileHash===o)return await l({config:e.config,document:H,variables:{cwd:e.cwd,projectId:e.config.projectId,teleportProtocolVersion:2}}).catch(()=>null),{devSessionId:n.id,hooksPaused:n.hooksPaused}}return u(e)}async function q(e){let o=await b(e);return o==null?null:T(o)}function ye(e){return T(h(w,e))}function T(e){return C.createHash("sha256").update(e).digest("hex")}async function M({config:e,cwd:o,fixtures:t,payload:n}){let r=D(o),i=await b(o),a=await N(o,t),s=await l({config:e,document:W,variables:{branch:r??null,cwd:o,fixtures:a,lockfileContent:i,projectId:e.projectId,teleportProtocolVersion:2,workflows:n.workflows.map(c=>({expectedOutcome:c.expectedOutcome,name:c.name,slug:c.slug,sourcePath:c.sourcePath,spec:JSON.stringify(c.spec)}))}});if(s.syncDevSession==null)throw new Error("syncDevSession returned null");return{devSessionId:s.syncDevSession.id,hooksPaused:s.syncDevSession.hooksPaused}}async function N(e,o){let t=Object.entries(o);return Promise.all(t.map(async([n,r])=>({contentBase64:(await $(j.join(e,I,n))).toString("base64"),sha256:r.sha256})))}async function b(e){try{return await $(j.join(e,R),"utf8")}catch{return null}}import{graphql as B}from"gql.tada";var G=B(`
50
- mutation AutoScopeAddDirty($projectId: String!, $cwd: String!, $workflowSlugs: [String!]!) {
51
- addDirtyTestsToScope(projectId: $projectId, cwd: $cwd, workflowSlugs: $workflowSlugs) {
52
- __typename
53
- ... on MutationAddDirtyTestsToScopeSuccess {
54
- data {
55
- id
56
- }
57
- }
58
- }
59
- }
60
- `);async function Ie({cwd:e,editedPath:o,lockfile:t,requireHooks:n,syncFirst:r}){if(n&&!m(e))return{addedSlugs:[]};let i=new Set(K(e)),a=t.workflows.filter(d=>d.sourcePath!=null&&J({dirtySet:i,editedPath:o,sourcePath:d.sourcePath})).map(d=>k(d.name));if(a.length===0)return{addedSlugs:[]};let s=x(e).unwrapOr(void 0);return s==null?{addedSlugs:[]}:r&&!await U({cfg:s,cwd:e,lockfile:t})?{addedSlugs:[]}:{addedSlugs:await X({cfg:s,slugs:a})?a:[]}}async function U({cfg:e,cwd:o,lockfile:t}){return await u({config:e,cwd:o,lockfile:t}).catch(r=>(f.warn("auto-sync failed: %s",r instanceof Error?r.message:String(r)),null))!=null}async function X({cfg:e,slugs:o}){let n=(await l({config:e,document:G,variables:{cwd:e.cwd,projectId:e.projectId,workflowSlugs:[...o]}}).catch(r=>(f.warn("auto-scope failed: %s",r instanceof Error?r.message:String(r)),null)))?.addDirtyTestsToScope;return n?.__typename!=="MutationAddDirtyTestsToScopeSuccess"?!1:n.data.length>0}function J({dirtySet:e,editedPath:o,sourcePath:t}){return e.has(t)||o!=null&&o.endsWith(t)}var A=".ripplo/workflows/",O=" -> ";function K(e){let o;try{o=S(["status","--porcelain","-uall","--",".ripplo/workflows"],e)}catch{return[]}return o.split(`
61
- `).map(t=>t.slice(3).trim()).map(t=>t.includes(O)?t.split(O)[1]:t).filter(t=>t!=null).filter(t=>t.startsWith(A)&&t.endsWith(".ts")).map(t=>t.slice(A.length)).filter(t=>t!=="index.ts"&&!t.endsWith("/index.ts"))}export{D as a,ue as b,u as c,fe as d,q as e,ye as f,Ie as g};
@@ -1,5 +0,0 @@
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 s,c as u}from"./chunk-KH4QH23U.js";import{createHash as d}from"crypto";import{mkdirSync as g,readdirSync as h,readFileSync as p,writeFileSync as m}from"fs";import n from"path";var f=[".ts",".tsx",".js",".jsx"],y=new Set([".local","debug"]);function A(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
- `).filter(e=>e.length>0).filter(e=>f.some(i=>e.endsWith(i))).toSorted((e,i)=>e.localeCompare(i)).forEach(e=>{t.update(e),t.update("\0"),t.update(l(n.join(r,e))),t.update("\0")}),t.digest("hex")):S(r,t)}function D(r,t){try{return p(c(r,t),"utf8").trim()}catch{return null}}function F(r,t,o){let e=c(r,t);g(n.dirname(e),{recursive:!0}),m(e,o)}function S(r,t){let o=n.join(r,".ripplo");return x(o).filter(i=>f.some(a=>i.endsWith(a))).filter(i=>!y.has(i.split(n.sep)[0]??"")).toSorted((i,a)=>i.localeCompare(a)).forEach(i=>{t.update(i),t.update("\0"),t.update(l(n.join(o,i))),t.update("\0")}),t.digest("hex")}function x(r){try{return h(r,{recursive:!0}).filter(t=>typeof t=="string")}catch{return[]}}function l(r){try{return p(r)}catch{return Buffer.alloc(0)}}function c(r,t){return n.join(r,".ripplo",".local",`${t}.hash`)}export{A as a,D as b,F as c};