@relvehq/agent-ready 0.3.0 → 0.4.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 (29) hide show
  1. package/README.md +24 -3
  2. package/SETUP.md +354 -354
  3. package/dist/core/report.d.ts +9 -3
  4. package/dist/core/report.js +30 -10
  5. package/dist/core/version.d.ts +1 -0
  6. package/dist/core/version.js +8 -0
  7. package/dist/index.d.ts +2 -1
  8. package/dist/index.js +5 -1
  9. package/dist/refine/check.d.ts +3 -1
  10. package/dist/refine/check.js +43 -0
  11. package/dist/refine/remote.d.ts +3 -2
  12. package/dist/refine/remote.js +3 -2
  13. package/dist/wp/relve-agent-ready/includes/class-relve-ar-admin.php +560 -550
  14. package/dist/wp/relve-agent-ready/includes/class-relve-ar-converter.php +762 -762
  15. package/dist/wp/relve-agent-ready/includes/class-relve-ar-llms.php +192 -192
  16. package/dist/wp/relve-agent-ready/includes/class-relve-ar-markdown-builder.php +455 -455
  17. package/dist/wp/relve-agent-ready/includes/class-relve-ar-negotiation.php +334 -334
  18. package/dist/wp/relve-agent-ready/includes/class-relve-ar-refiner.php +894 -894
  19. package/dist/wp/relve-agent-ready/includes/class-relve-ar-reporter.php +147 -0
  20. package/dist/wp/relve-agent-ready/includes/class-relve-ar-response.php +226 -226
  21. package/dist/wp/relve-agent-ready/includes/class-relve-ar-router.php +422 -421
  22. package/dist/wp/relve-agent-ready/includes/class-relve-ar-settings.php +210 -201
  23. package/dist/wp/relve-agent-ready/includes/class-relve-ar-store.php +583 -583
  24. package/dist/wp/relve-agent-ready/includes/index.php +2 -2
  25. package/dist/wp/relve-agent-ready/index.php +2 -2
  26. package/dist/wp/relve-agent-ready/readme.txt +119 -108
  27. package/dist/wp/relve-agent-ready/relve-agent-ready.php +82 -81
  28. package/dist/wp/relve-agent-ready/uninstall.php +35 -35
  29. package/package.json +1 -1
package/README.md CHANGED
@@ -104,7 +104,7 @@ frameworks" below. For WordPress, the plugin ships inside this package
104
104
  | `enabled` | `AGENT_READY_ENABLED` is `1` or `true` |
105
105
  | `exclude` | `/api`, `/_next`, auth and admin paths, plus common private pages (account, checkout, cart, dashboard, settings, billing…) and yours; `excludeCommon: false` drops the common list |
106
106
  | `llms` | `/llms.txt` built from your `sitemap.xml`; `llms: false` for none |
107
- | `onHit` | sends each visit to a dashboard when `AGENT_READY_KEY` and `AGENT_READY_ENDPOINT` are set |
107
+ | `onHit` | sends each visit's stats to Relve when `AGENT_READY_KEY` is set (opt-in; `AGENT_READY_ENDPOINT` for another dashboard), see [Share visit stats](#share-visit-stats-with-relve-opt-in) |
108
108
 
109
109
  Anything you pass wins:
110
110
 
@@ -186,9 +186,13 @@ Markdown. The command saves `<out>/<path>.md` plus `<out>/<path>.json`
186
186
  (default out: `.agent-ready/md`).
187
187
 
188
188
  - **Cost:** your own OpenAI usage, one model call per changed page (roughly
189
- a few thousand tokens each with the default `gpt-4o-mini`). Relve charges nothing.
189
+ a few thousand tokens each with the default `gpt-4o`, about 1 to 2 cents a
190
+ page). Relve charges nothing.
190
191
  - **Your key:** used for that call only. Relve does not store or log it, and
191
192
  it is never written to the output files.
193
+ - **What Relve logs:** for each call, the page URL, the model, the outcome
194
+ and the size of the result (bytes, words, lines, tokens, headings, links,
195
+ tables). Not the HTML, not the Markdown, not your key.
192
196
  - **Re-run when content changes.** Each saved `.json` holds the page's
193
197
  fingerprint; it is sent along, and an unchanged page comes back as
194
198
  `unchanged` with no model call (free). `--force` rewrites everything.
@@ -198,7 +202,7 @@ Markdown. The command saves `<out>/<path>.md` plus `<out>/<path>.json`
198
202
  | Option | |
199
203
  |---|---|
200
204
  | `--sitemap` / `--paths /a,/b` | which pages (sitemap at `<site>/sitemap.xml`) |
201
- | `--model` | `gpt-4o-mini` (default, fastest), `gpt-4o`, `gpt-4.1`, `gpt-4.1-mini` |
205
+ | `--model` | `gpt-4o` (default, most accurate), `gpt-4.1`, `gpt-4.1-mini`, `gpt-4o-mini` (cheapest; can mix up whose price is whose on busy pages) |
202
206
  | `--site-name` | your brand name, used in the documents |
203
207
  | `--out`, `--limit`, `--concurrency` (2), `--force`, `--dry-run` | `--dry-run` lists the pages: no API call, nothing written |
204
208
  | `AGENT_READY_REFINE_ENDPOINT` | another API URL (testing) |
@@ -287,6 +291,23 @@ writes a log that `npx agent-ready stats --log <file>` summarises. On
287
291
  serverless hosts (Vercel, Amplify) memory and local files don't last between
288
292
  requests: implement `HitStore` on your database.
289
293
 
294
+ ### Share visit stats with Relve (opt-in)
295
+
296
+ ```
297
+ AGENT_READY_KEY=ar_live_yoursite
298
+ ```
299
+
300
+ With that one variable set, `createAgentReady` reports each Markdown request
301
+ an agent makes to `https://relvehq.com/api/agent-ready/v1/hits`: your key, the
302
+ package version, the time, host, path, how the Markdown was asked for, where
303
+ it came from, status, tokens, bytes, the agent's user agent and the time
304
+ taken. Never the Markdown and never the visitor's IP. The report is
305
+ fire-and-forget with a 2 second timeout and never changes the agent's
306
+ response. The key is a label you choose (`ar_` plus 3 to 64 letters, digits,
307
+ `_` or `-`), not a secret. Without it nothing is sent.
308
+ `AGENT_READY_ENDPOINT` sends the same reports to another dashboard instead;
309
+ in code, `reporter({ key, endpoint? })` is the `onHit`.
310
+
290
311
  ## Other frameworks
291
312
 
292
313
  Express, Connect, Polka, Fastify (via `@fastify/middie`) or a plain `http`