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,48 +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 b}from"./chunk-HEOMRXZE.js";import{a as F}from"./chunk-NNH3YVVO.js";import{b as O}from"./chunk-KMZ3L5YA.js";var U=15e3,G=3,L=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}},u=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 u)return e.errors[0]?.extensions?.code}var j={attempts:G,timeoutMs:U},V={attempts:1,timeoutMs:3e3};async function E(e){return T(e,j)}async function W(e){return T(e,V)}async function T(e,r){let{print:t}=await import("graphql"),n=t(e.document),o=JSON.stringify({query:n,variables:e.variables}),a=`${e.config.ripploServerUrl}/graphql`,s=await B({init:{body:o,headers:{Authorization:`Bearer ${e.config.token}`,"Content-Type":"application/json",...b()},method:"POST"},policy:r,serverUrl:e.config.ripploServerUrl,url:a}),l=await J({res:s,url:a});if(!Q(l))throw new Error("Invalid GraphQL response");if(X(l))throw new u(l.errors);if(l.data==null)throw new Error("No data returned from server");return l.data}async function B({init:e,policy:r,serverUrl:t,url:n}){let o=1,a=await x({init:e,timeoutMs:r.timeoutMs,url:n});for(;a.retryable&&o<r.attempts;)await K(H(o)),o+=1,a=await x({init:e,timeoutMs:r.timeoutMs,url:n});let{response:s}=a;if(s!=null&&s.status<500)return s;throw new f({detail:s==null?a.detail:`server returned status ${String(s.status)}`,serverUrl:t})}async function x({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 H(e){return L*3**(e-1)*(.5+Math.random())}function K(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 X(e){return Array.isArray(e.errors)&&e.errors.length>0}import Y from"pino";import z from"pino-pretty";var y=Y({level:process.env.LOG_LEVEL??"info"},z({ignore:"pid,hostname"}));import{readdir as Z,rm as ee,stat as re}from"fs/promises";import{existsSync as k}from"fs";import w from"path";var v=".uploaded";var C=w.join(process.cwd(),".ripplo","debug"),D=360*60*1e3;async function te({maxRuns:e}){try{let t=(await Z(C,{withFileTypes:!0})).filter(i=>i.isDirectory()),n=Date.now(),o=await Promise.all(t.map(async i=>{let m=w.join(C,i.name),$=await re(m);return{dirPath:m,mtime:$.mtimeMs,pendingUpload:ne(m)}})),a=o.filter(i=>n-i.mtime>D),s=o.filter(i=>n-i.mtime<=D&&!i.pendingUpload).toSorted((i,m)=>m.mtime-i.mtime).slice(e),l=[...a,...s];if(l.length===0)return;await Promise.allSettled(l.map(i=>ee(i.dirPath,{force:!0,recursive:!0}))),y.debug("Pruned %d old debug run(s)",l.length)}catch{y.warn("Debug run pruning failed, ignoring")}}function ne(e){return k(w.join(e,"behavior.jsonl"))&&!k(w.join(e,v))}import d from"fs";import oe from"os";import g from"path";var ie=".local",ae=".ripplo";function h(e){return g.join(e,".ripplo",ie)}function se(e){let r=h(e);d.existsSync(r)||d.mkdirSync(r,{recursive:!0});let t=g.join(r,".gitignore");return d.existsSync(t)||d.writeFileSync(t,`*
5
- `),r}function le(e,r){return g.join(h(e),r)}function P(){return g.join(oe.homedir(),ae)}function S(){let e=P();return d.existsSync(e)?d.chmodSync(e,448):d.mkdirSync(e,{mode:448,recursive:!0}),e}function A(e){return g.join(P(),e)}import{Agent as de,RetryAgent as ce,setGlobalDispatcher as me}from"undici";var ue=1500,ge=4e3,pe=3,fe=50,ye=100,I=!1;function we(){if(I)return;I=!0;let e=new de({connections:ye,keepAliveMaxTimeout:ge,keepAliveTimeout:ue}),r=new ce(e,{errorCodes:["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT","UND_ERR_SOCKET"],maxRetries:pe,methods:["GET","POST","HEAD","OPTIONS","PUT","DELETE"],minTimeout:fe,statusCodes:[]});me(r)}import{graphql as p}from"gql.tada";var We=p(`
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 Be=p(`
20
- mutation StartAgentReviewWorker($reviewId: String!) {
21
- startAgentReview(reviewId: $reviewId)
22
- }
23
- `);var He=p(`
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 Ke=p(`
40
- mutation UpdateAgentReviewProgressWorker($reviewId: String!, $text: String!) {
41
- updateAgentReviewProgress(reviewId: $reviewId, text: $text)
42
- }
43
- `);var Je=p(`
44
- mutation FailAgentReviewWorker($reviewId: String!, $reason: String!) {
45
- failAgentReview(reviewId: $reviewId, reason: $reason)
46
- }
47
- `);import c from"fs";import q from"path";function Re(e){let r=process.env.RIPPLO_TOKEN;if(r!=null&&r.trim().length>0)return r.trim();let t=R(e);if(!c.existsSync(t))return null;let n=c.readFileSync(t,"utf8").trim();return n.length===0?null:n}function ve({serverUrl:e,token:r}){S();let t=R(e);c.mkdirSync(q.dirname(t),{mode:448,recursive:!0}),c.writeFileSync(t,r+`
48
- `,{mode:384})}function he(e){let r=R(e);return c.existsSync(r)?(c.unlinkSync(r),!0):!1}function R(e){return A(q.join("tokens",Pe(e)))}function Pe(e){return new URL(e).host.replaceAll(/[^a-zA-Z0-9.]/g,"_")}var M=O(F(),1);import _ from"crypto";function Se({body:e,secret:r}){let t=new M.Webhook(r),n=`msg_${_.randomUUID()}`,o=new Date,a=t.sign(n,o,e),s=Math.floor(o.getTime()/1e3);return{"webhook-id":n,"webhook-signature":a,"webhook-timestamp":String(s)}}function Ae(){return`whsec_${_.randomBytes(24).toString("base64")}`}export{f as a,u as b,N as c,E as d,W as e,y as f,v as g,te as h,se as i,le as j,Re as k,ve as l,he as m,R as n,we as o,Se as p,Ae as q};
@@ -1,107 +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 o,d as r}from"./chunk-G6J2WIHJ.js";import{a}from"./chunk-7WZ3VIUU.js";var n=`# How Ripplo thinks
5
-
6
- This model drives compile errors, run failures, and explorer findings.
7
-
8
- **Done has two halves.** The app delivers the behavior, and a passing workflow proves the complete
9
- user journey. Neither half is optional.
10
-
11
- ## Workflow, test, and run
12
-
13
- A **workflow** is the authored model of one critical user intent. It follows the real multi-step
14
- click path from a natural entry point and declares what each action makes true.
15
-
16
- A **test** is one concrete state synthesized from that workflow for a reachable named \`when\`
17
- branch. A workflow without branches has one \`main\` test. A **run** executes one test. Authors edit
18
- workflows, not concrete test state.
19
-
20
- ## One typed application-state model
21
-
22
- One root Zod schema defines application state. Each top-level key is a source that returns one
23
- validated state blob. Sources can be served over HTTP or from the browser without changing workflow
24
- selectors. Authentication is separate because signing in creates a browser session.
25
-
26
- Use \`setup.value\`, \`setup.generated\`, and \`setup.record\` only where workflows may create
27
- starting state. Plain Zod fields remain observable. TypeScript derives each source's setup and read
28
- contract from the schema.
29
-
30
- ## Start wide and stay connected
31
-
32
- \`given\` is not a fixture. It describes the widest set of starting states compatible with the
33
- entire journey. Add only structural presence, absence, relations, permissions, actor, viewport, and
34
- other preconditions every step truly needs.
35
-
36
- Omit irrelevant record fields. Setup generates them from the schema, and returned record handles
37
- expose their values. Use \`arbitrary(field)\` for a workflow input that can be any schema-valid
38
- value. Reuse that binding in actions and effects. Use \`exact(value)\` only when the concrete string
39
- or number drives behavior.
40
-
41
- State-rendered names, ids, slugs, counts, amounts, inputs, and URLs come from handles or expressions.
42
- Repeating a setup literal in a locator or action creates drift and narrows the journey.
43
-
44
- When starting state changes an outcome but the intent and click path stay the same, use
45
- \`optional()\` and named \`when\` branches. Branch conditions constrain synthesis directly. Use
46
- another workflow only when the intent or path differs.
47
-
48
- ## Steps declare complete transitions
49
-
50
- A step declares the user action, its page result, and every application-state effect. A toast or
51
- closed dialog does not prove a write persisted. Declare \`created\`, \`updated\`, \`deleted\`,
52
- \`set\`, or \`transform\` alongside visible evidence.
53
-
54
- Every effect must definitely change state from what \`given\`, its branch, and earlier steps
55
- establish. A possible no-op is invalid. Use a before/after relation that excludes equality or model
56
- the real precondition. Do not hardcode a convenient previous value solely to satisfy the proof.
57
-
58
- Ripplo applies a frame rule: state persists until a declared effect changes it. Any observed change
59
- outside the declared effects is a frame violation. Cascades must be declared completely.
60
-
61
- ## Reachability and page state
62
-
63
- An action can touch only an element an earlier durable \`visible(...)\` established. Assert the
64
- surface or control when it first appears. Use semantic roles such as \`button\`, \`textbox\`,
65
- \`heading\`, and \`link\`. Add an accessible name to the app when one is missing.
66
-
67
- \`text(locator, "x")\` and \`value(locator, "x")\` are exact. Use \`contains("x")\` or
68
- \`startsWith("x")\` only when that broader relationship is intended.
69
-
70
- ## Facts keep their conditions
71
-
72
- Workflow assertions become facts under the complete application and page state declared at that
73
- step. They are not generalized beyond those conditions. The explorer reuses those exact facts on
74
- compatible composed paths.
75
-
76
- Two facts that disagree on overlapping state are a compile error. Add the missing distinguishing
77
- state or split the outcome with \`when\`.
78
-
79
- Use \`fact()\` only for a true app-wide invariant or permission boundary that no journey owns. Do
80
- not replace a journey, branch, or missing effect with a broad fact.
81
-
82
- ## What each gate proves
83
-
84
- - \`npx ripplo compile\` validates authoring, branch reachability, definite effects, fact
85
- consistency, interaction reachability, and the lockfile.
86
- - \`npx ripplo run\` compares every declared page and application-state expectation with the live
87
- app after each step.
88
- - The explorer composes declared steps and reports contradictions on paths no workflow wrote.
89
-
90
- On failure, run \`npx ripplo explain <runId>\` and inspect \`behavior.jsonl\` before re-running.
91
- Form one evidence-backed hypothesis, make one change, then run once.
92
-
93
- \`.wait("slow")\` gives a page predicate more time. \`consistency.eventual(schema)\` marks a state
94
- field whose source may legitimately expose intermediate values before converging. A longer wait
95
- must not hide a wrong value.
96
-
97
- ## Scope and the prime directive
98
-
99
- Testing Scope is the set of workflows this session must leave green. Add every affected journey.
100
- A stub \`workflow("Intent")\` is a promise that must be implemented before finishing.
101
-
102
- Fix broken behavior in the app. Strengthen an incomplete model in the workflow. Never weaken a
103
- declaration, replace state-derived values with literals, or narrow starting state merely to turn a
104
- failure green.
105
-
106
- \`.ripplo/ripplo.lock\` is committed, regenerated by \`npx ripplo compile\`, and never hand-edited.
107
- `;function l(e,t){return!a(e)||r(e,t)?null:(o(e,t),n)}export{l as a};
@@ -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 g from"fs";import a from"path";import{config as I}from"dotenv";import*as s from"zod/mini";import{err as L,ok as v}from"neverthrow";import c from"fs";import f from"path";import{err as p,ok as m}from"neverthrow";import*as n from"zod/mini";var F=f.join(".ripplo","project.json"),u=[".env",".env.local"],y=n.object({envFiles:n.optional(n.array(n.string().check(n.minLength(1)))),projectId:n.string().check(n.minLength(1))});function P(e){return f.join(e,F)}function h(e){let r=P(e);return c.existsSync(r)?E(r).andThen(t=>{let i=y.safeParse(t);return i.success?m({envFiles:i.data.envFiles??u,projectId:i.data.projectId}):p({issues:i.error.issues.map(o=>`${o.path.join(".")}: ${o.message}`),kind:"project-file-invalid",path:r})}):p({kind:"project-file-missing",path:r})}function d(e){return h(e).match(r=>r,()=>{})}function E(e){try{return m(JSON.parse(c.readFileSync(e,"utf8")))}catch(r){return p({issues:[r instanceof Error?r.message:String(r)],kind:"project-file-invalid",path:e})}}function C({cwd:e,envFiles:r,projectId:t}){let i=P(e);c.mkdirSync(f.dirname(i),{recursive:!0});let o={projectId:t};r!=null&&!R(r)&&(o.envFiles=[...r]),c.writeFileSync(i,JSON.stringify(o,null,2)+`
5
- `)}function R(e){return e.length!==u.length?!1:e.every((r,t)=>r===u[t])}function T(e){let t=d(e)?.envFiles??[".env",".env.local"],i=a.join(e,".ripplo");t.forEach(o=>{let j=a.resolve(i,o);g.existsSync(j)&&I({override:!0,path:j,quiet:!0})}),l=void 0}var S=s.object({RIPPLO_APP_URL:s.url(),RIPPLO_ENGINE_URL:s.url(),RIPPLO_WEBHOOK_SECRET:s.string().check(s.minLength(1))}),l;function J(){return l!=null?v(l):z().map(e=>(l=e,e))}function _(e){let t=d(e)?.envFiles??[],i=a.join(e,".ripplo");return t.map(o=>a.resolve(i,o)).filter(o=>!g.existsSync(o))}function z(){let e=S.safeParse(process.env);if(!e.success)return L({issues:e.error.issues.map(t=>`${t.path.join(".")}: ${t.message}`),kind:"env-invalid",missingEnvFiles:_(process.cwd())});let r=e.data;return v({appUrl:r.RIPPLO_APP_URL,engineUrl:r.RIPPLO_ENGINE_URL,webhookSecret:r.RIPPLO_WEBHOOK_SECRET})}export{h as a,C as b,T as c,J as d,_ as e};
@@ -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{existsSync as l,mkdirSync as g,writeFileSync as c}from"fs";import t from"path";function d(r,n,i){let o=s(r,n,i);g(t.dirname(o),{recursive:!0}),c(o,"")}function a(r,n,i){return l(s(r,n,i))}function p(r,n){d(r,n,e)}function k(r,n){return a(r,n,e)}var e="__model__";function s(r,n,i){return t.join(u(r,n),i)}function u(r,n){return t.join(r,".ripplo",".local","skills-loaded",n)}export{d as a,a as b,p as c,k as d};
@@ -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
- var e=null;function p(n){e=n}function f(){return e==null?{}:{"x-ripplo-client-version":e}}import{execFileSync as l}from"child_process";import u from"fs";import i from"path";function R(n){let r=c(n);return r??o(n)}function o(n){let r=i.dirname(n);return s(i.join(n,".ripplo"))?n:r===n?null:o(r)}function s(n){try{return u.statSync(n).isDirectory()}catch{return!1}}function c(n){let r=g(["rev-parse","--show-toplevel"],n);if(r==null)return null;let t=r.trim();return t.length===0?null:i.isAbsolute(t)?t:i.resolve(n,t)}function g(n,r){try{return l("git",n,{cwd:r,encoding:"utf8",stdio:["ignore","pipe","ignore"]})}catch{return null}}export{R as a,p as b,f as c};