@relvehq/agent-ready 0.2.1 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +52 -25
- package/SETUP.md +354 -337
- package/dist/bin/agent-ready.js +105 -11
- package/dist/refine/check.d.ts +3 -1
- package/dist/refine/check.js +43 -0
- package/dist/refine/remote.d.ts +57 -0
- package/dist/refine/remote.js +238 -0
- package/dist/wp/relve-agent-ready/includes/class-relve-ar-admin.php +550 -363
- package/dist/wp/relve-agent-ready/includes/class-relve-ar-converter.php +762 -762
- package/dist/wp/relve-agent-ready/includes/class-relve-ar-llms.php +192 -192
- package/dist/wp/relve-agent-ready/includes/class-relve-ar-markdown-builder.php +455 -447
- package/dist/wp/relve-agent-ready/includes/class-relve-ar-negotiation.php +334 -334
- package/dist/wp/relve-agent-ready/includes/class-relve-ar-refiner.php +894 -0
- package/dist/wp/relve-agent-ready/includes/class-relve-ar-response.php +226 -226
- package/dist/wp/relve-agent-ready/includes/class-relve-ar-router.php +421 -421
- package/dist/wp/relve-agent-ready/includes/class-relve-ar-settings.php +204 -115
- package/dist/wp/relve-agent-ready/includes/class-relve-ar-store.php +583 -543
- package/dist/wp/relve-agent-ready/includes/index.php +2 -2
- package/dist/wp/relve-agent-ready/index.php +2 -2
- package/dist/wp/relve-agent-ready/readme.txt +112 -75
- package/dist/wp/relve-agent-ready/relve-agent-ready.php +81 -70
- package/dist/wp/relve-agent-ready/uninstall.php +35 -24
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -8,10 +8,10 @@ they got before.
|
|
|
8
8
|
- **Serve**: Markdown on `Accept: text/markdown`, on `<page>.md` and on
|
|
9
9
|
`?format=md`, plus a generated [`/llms.txt`](https://llmstxt.org). No AI
|
|
10
10
|
runs per request: it is plain code, in milliseconds.
|
|
11
|
-
- **Refine** (optional, with your own
|
|
12
|
-
better Markdown file for each page ahead of time
|
|
13
|
-
number and URL against the page,
|
|
14
|
-
|
|
11
|
+
- **Refine** (optional, with your own OpenAI key): one command writes a
|
|
12
|
+
better Markdown file for each page ahead of time with Relve's prompt, a
|
|
13
|
+
check compares every number and URL against the page, and unchanged pages
|
|
14
|
+
are skipped (free) on the next run.
|
|
15
15
|
- **Proof**: a free checker that scores any site out of 100, and a dashboard
|
|
16
16
|
of which AI agents read which pages.
|
|
17
17
|
|
|
@@ -168,28 +168,50 @@ Most CDNs (CloudFront included) don't vary their cache on `Accept`, so:
|
|
|
168
168
|
HTML. Safe, just not Markdown. `.md` URLs always work; reliable negotiation
|
|
169
169
|
needs `Accept` in the CDN cache key.
|
|
170
170
|
|
|
171
|
-
## Refine: better Markdown
|
|
171
|
+
## Refine: better Markdown with your own OpenAI key
|
|
172
|
+
|
|
173
|
+
One command, run from your project root with `OPENAI_API_KEY` in `.env.local`,
|
|
174
|
+
`.env` or the shell:
|
|
172
175
|
|
|
173
176
|
```
|
|
174
|
-
npx agent-ready refine --site https://your-site.com --
|
|
175
|
-
npx agent-ready refine --site https://your-site.com --
|
|
177
|
+
npx agent-ready refine --site https://your-site.com --sitemap --dry-run
|
|
178
|
+
npx agent-ready refine --site https://your-site.com --sitemap
|
|
176
179
|
```
|
|
177
180
|
|
|
178
|
-
For each page
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
and
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
181
|
+
For each page the command fetches the HTML itself and sends it to the Relve
|
|
182
|
+
API (`relvehq.com`) with your key in a header. Relve's prompt runs on Relve's
|
|
183
|
+
server: it extracts the page, calls OpenAI with your key, checks the result
|
|
184
|
+
(every number and URL must be on the page; one retry), and returns the
|
|
185
|
+
Markdown. The command saves `<out>/<path>.md` plus `<out>/<path>.json`
|
|
186
|
+
(default out: `.agent-ready/md`).
|
|
187
|
+
|
|
188
|
+
- **Cost:** your own OpenAI usage, one model call per changed page (roughly
|
|
189
|
+
a few thousand tokens each with the default `gpt-4o`, about 1 to 2 cents a
|
|
190
|
+
page). Relve charges nothing.
|
|
191
|
+
- **Your key:** used for that call only. Relve does not store or log it, and
|
|
192
|
+
it is never written to the output files.
|
|
193
|
+
- **Re-run when content changes.** Each saved `.json` holds the page's
|
|
194
|
+
fingerprint; it is sent along, and an unchanged page comes back as
|
|
195
|
+
`unchanged` with no model call (free). `--force` rewrites everything.
|
|
196
|
+
- **Optional in CI or deploy:** run the command before `next build` (with
|
|
197
|
+
`OPENAI_API_KEY` as a secret) and commit or ship `.agent-ready/md`.
|
|
198
|
+
|
|
199
|
+
| Option | |
|
|
185
200
|
|---|---|
|
|
186
|
-
| `
|
|
187
|
-
| `
|
|
188
|
-
| `
|
|
201
|
+
| `--sitemap` / `--paths /a,/b` | which pages (sitemap at `<site>/sitemap.xml`) |
|
|
202
|
+
| `--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) |
|
|
203
|
+
| `--site-name` | your brand name, used in the documents |
|
|
204
|
+
| `--out`, `--limit`, `--concurrency` (2), `--force`, `--dry-run` | `--dry-run` lists the pages: no API call, nothing written |
|
|
205
|
+
| `AGENT_READY_REFINE_ENDPOINT` | another API URL (testing) |
|
|
206
|
+
|
|
207
|
+
The run ends with `written / unchanged / rejected / errors` and the token
|
|
208
|
+
total. Rejected and failed pages are listed with their code (for example
|
|
209
|
+
`too_little_text`) and nothing is saved for them; the exit code is then 1.
|
|
210
|
+
If OpenAI rejects the key or your account is out of quota, the run stops at
|
|
211
|
+
the first page and says so.
|
|
189
212
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
which the Edge middleware imports):
|
|
213
|
+
Serve the files from the route file (`fileStore` is Node only, so keep it
|
|
214
|
+
out of `agent-ready.config.ts`, which the Edge middleware imports):
|
|
193
215
|
|
|
194
216
|
```ts
|
|
195
217
|
// app/%5F%5Fmd/[[...path]]/route.ts
|
|
@@ -209,10 +231,14 @@ required section is missing, it has more or fewer than one H1, HTML tags, a
|
|
|
209
231
|
wrong fingerprint, or it is over the token budget. It cannot catch a reworded
|
|
210
232
|
claim, so read a sample before you switch on.
|
|
211
233
|
|
|
212
|
-
**
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
234
|
+
**Advanced: your own prompts.** The package ships no prompt. With
|
|
235
|
+
`--prompts <dir>` (several: `a,b`) or the `AGENT_READY_PROMPTS` variable
|
|
236
|
+
(`.env.local`, `.env` or the shell), `refine` runs your prompt files on your
|
|
237
|
+
machine instead of calling the Relve API, with `OPENAI_API_KEY` (default
|
|
238
|
+
model `gpt-4o`) or `ANTHROPIC_API_KEY` (default `claude-opus-5-5`);
|
|
239
|
+
`AGENT_READY_MODEL` picks another model. The steps are the same: fetch,
|
|
240
|
+
extract, skip unchanged, fill the prompt, one model call, check, one retry,
|
|
241
|
+
save. A prompt file is Markdown with `## SYSTEM`, `## USER`
|
|
216
242
|
(`{{PAGE_URL}}`, `{{PAGE_TEXT}}`, `{{PAGE_LINKS}}`, `{{JSON_LD}}`,
|
|
217
243
|
`{{SOURCE_HASH}}`) and a `## Settings` table (`page_type`, `version`,
|
|
218
244
|
`required_sections`, `token_budget`). A `page_type` of `page` takes every
|
|
@@ -327,8 +353,9 @@ if (d.markdown) {
|
|
|
327
353
|
```
|
|
328
354
|
agent-ready init [--stack next|node|wordpress] [--dry-run] [--force] [--cwd <dir>]
|
|
329
355
|
agent-ready check <url> [--json]
|
|
330
|
-
agent-ready refine --site <origin> (--paths /a,/b | --sitemap) --
|
|
356
|
+
agent-ready refine --site <origin> (--paths /a,/b | --sitemap) [--model <id>] [--site-name <name>]
|
|
331
357
|
[--out <dir>] [--limit <n>] [--force] [--concurrency <n>] [--dry-run]
|
|
358
|
+
[--prompts <dir>] (advanced: your own prompts, run locally)
|
|
332
359
|
agent-ready stats --log <hits.jsonl> [--days <n>] [--json]
|
|
333
360
|
```
|
|
334
361
|
|