@fangorn-network/westmarch 2026.10.28 → 2026.11.3
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 +4 -4
- package/dist/ts/eval.js +0 -0
- package/docs/app-to-agent.md +56 -552
- package/package.json +17 -19
- package/plugin/scripts/fx.mjs +3 -3
- package/site/dist/assets/__vite-browser-external-D2U8RZpp.js +1 -0
- package/site/dist/assets/embed.worker-CmS57Zti.js +1 -0
- package/site/dist/assets/index-Djs8f08m.js +8 -0
- package/site/dist/assets/roles-BDPDWrwo.js +1 -0
- package/site/dist/assets/roles-DKPW79Ca.js +1 -0
- package/site/dist/assets/rolldown-runtime-COiEfhsA.js +1 -0
- package/site/dist/assets/transformers.web-CUZUFjAK.js +49 -0
- package/site/dist/assets/transformers.web-CwR_IYQV.js +40 -0
- package/site/dist/index.html +20 -0
- package/site/dist/theme.css +7 -0
- package/site/worker.js +111 -337
- package/src/agent/agent-card.js +33 -45
- package/src/agent/mcp.js +139 -90
- package/src/agent/view-tools.js +0 -54
- package/src/agent/x402.js +182 -367
- package/src/core/embed.js +7 -3
- package/src/core/roles.js +6 -6
- package/src/core/shard.js +4 -4
- package/src/discover/apps.js +67 -81
- package/src/discover/directory.js +2 -2
- package/src/discover/explore.js +50 -114
- package/src/market/reactions.js +21 -15
- package/src/publish/devnet.js +67 -18
- package/src/publish/ship.js +70 -272
- package/src/publish/view.js +45 -47
- package/template/README.md +2 -2
- package/template/package.json +1 -1
- package/src/market/settle.js +0 -165
- package/src/market/terms.js +0 -200
- package/src/publish/cli.js +0 -336
- package/src/publish/envelope.js +0 -185
- package/src/publish/manifest.js +0 -142
package/docs/app-to-agent.md
CHANGED
|
@@ -3,47 +3,34 @@
|
|
|
3
3
|
This walks an app owner from an empty directory to a live app that people can use in a
|
|
4
4
|
browser and any agent can find, verify and query. By the end you have:
|
|
5
5
|
|
|
6
|
-
- **an app
|
|
7
|
-
- **a schema**
|
|
6
|
+
- **an app**: a repo under your wallet, `<your address>:<app>`; repo names are per publisher, so there is nothing to claim;
|
|
7
|
+
- **a schema** in `app.json`: what your data's types are, which field is what, and
|
|
8
8
|
which relations are allowed between them;
|
|
9
|
-
- **your data** committed on chain
|
|
9
|
+
- **your data** committed on chain into that repo;
|
|
10
10
|
- **a view** of it: your committed data embedded and sharded as static files, so people
|
|
11
11
|
and agents can search it by meaning, updated with one command after each commit;
|
|
12
12
|
- **a site**: the view, a page for people, and an MCP endpoint for agents (one Cloudflare
|
|
13
|
-
Worker
|
|
14
|
-
- **an agent card** bound to the app on chain, and registered as an ERC-8004 agent;
|
|
13
|
+
Worker, deployed by `westmarch-ship`);
|
|
14
|
+
- **an agent card** bound to the app on chain (the repo's `@card` record), and registered as an ERC-8004 agent;
|
|
15
15
|
- **agents using it:** anyone running `fangorn-mcp` can `open-app` it by name.
|
|
16
16
|
|
|
17
17
|
Where the data comes from is up to you. The guide starts from a JSON array of objects,
|
|
18
18
|
which anything can produce: a scraper, a database export, a converted spreadsheet.
|
|
19
19
|
|
|
20
20
|
```
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
fangorn-mcp: open-app my-app ─► reads the binding, verifies the card, searches the view
|
|
21
|
+
sources ─► fangorn commit/push ─► chain (<you>:<app>)
|
|
22
|
+
│
|
|
23
|
+
app.json (types) ─► the Worker's CONFIG
|
|
24
|
+
▼
|
|
25
|
+
the Worker's cron ─► embeds what changed ─► view in R2 ─► page, /mcp, data tools
|
|
26
|
+
│
|
|
27
|
+
westmarch-ship ─► card at <site>/.well-known/agent-card.json
|
|
28
|
+
└─► fangorn card <url> --repo <app> ─► the repo's @card = card URL, + ERC-8004 agent
|
|
29
|
+
│
|
|
30
|
+
fangorn-mcp: open-app ─► reads @card, checks the card points back, searches the view
|
|
32
31
|
```
|
|
33
32
|
|
|
34
|
-
|
|
35
|
-
- **Free, local:** `westmarch-view` (step 7). It turns your commits into a view on your
|
|
36
|
-
own machine or CI. It embeds on CPU, ~14 records/s, only what changed since the last
|
|
37
|
-
run, and you host the files with your site.
|
|
38
|
-
- **Hosted:** quickbeam watches apps on chain, embeds on a GPU, and serves the view
|
|
39
|
-
itself. It will also do things one app's files can't, such as state across apps. It
|
|
40
|
-
writes the same files, so moving an app to it means changing the `views` URL in its
|
|
41
|
-
card.
|
|
42
|
-
|
|
43
|
-
It runs on Base Sepolia (new apps) or Arbitrum Sepolia (apps claimed there before the move).
|
|
44
|
-
`"network"` in `app.json` is required: `"baseSepolia"`, or the network the app was claimed on.
|
|
45
|
-
`westmarch-view` and `fangorn-mcp` read Base Sepolia unless `FANGORN_NETWORK=arbitrumSepolia`;
|
|
46
|
-
the CLI signs on `CHAIN_NAME`.
|
|
33
|
+
Everything runs on Base Sepolia: `"network": "baseSepolia"` in `app.json`.
|
|
47
34
|
|
|
48
35
|
## The short way: one config, one command
|
|
49
36
|
|
|
@@ -62,14 +49,14 @@ update: each step checks the chain (or Cloudflare) first and acts only on a diff
|
|
|
62
49
|
"presentation": { "facets": ["category"] } } },
|
|
63
50
|
"relations": [],
|
|
64
51
|
"sources": [{ "namespace": "things", "command": ["python", "-m", "my_source"] }],
|
|
65
|
-
"network": "baseSepolia", // required
|
|
52
|
+
"network": "baseSepolia", // required
|
|
66
53
|
"fangorn": "fangorn", // the CLI that signs
|
|
67
54
|
"paid": { "price": "0.01", "description": "the full record" } // optional: USDC on the app's network, x402 v2
|
|
68
55
|
}
|
|
69
56
|
```
|
|
70
57
|
|
|
71
58
|
```sh
|
|
72
|
-
npx westmarch-ship app.json #
|
|
59
|
+
npx westmarch-ship app.json # repo, crawl + publish, site, card, deploy, agent
|
|
73
60
|
npx westmarch-ship app.json --dry-run # every step, printed, none done
|
|
74
61
|
npx westmarch-ship app.json --no-crawl # rebuild view, site and card from what is on chain
|
|
75
62
|
npx westmarch-ship app.json --replace # each source's crawl becomes its namespace's whole state
|
|
@@ -79,10 +66,9 @@ npx westmarch-ship app.json --index # build the deployed app's view once, on
|
|
|
79
66
|
The app is one Cloudflare Worker: a cron that indexes the chain into R2 (embedding with
|
|
80
67
|
Workers AI), the view, `/mcp`, and the page. What `ship` does, in order:
|
|
81
68
|
|
|
82
|
-
1. **
|
|
83
|
-
the claimer is the app's first member;
|
|
69
|
+
1. **create the app's repo** (`fangorn repo init <app>`) on the first run, and record that block (the card's `fromBlock`);
|
|
84
70
|
2. **run each source**: a command that publishes into `--namespace` when given `--publish`.
|
|
85
|
-
|
|
71
|
+
A source with `"each": "rows.json"` is a template,
|
|
86
72
|
one source per row (`{field}`, `{field|slug}`, `{args...}`), so adding a town, a feed or
|
|
87
73
|
an account is adding a row;
|
|
88
74
|
3. **the site** in `.ship/site`: the stock page (search, plus a feed of what is coming up and
|
|
@@ -94,20 +80,12 @@ Workers AI), the view, `/mcp`, and the page. What `ship` does, in order:
|
|
|
94
80
|
the cron (`site.cron`, default every 5 minutes) and its CONFIG, which carries the schema. With `paid`, it sells each
|
|
95
81
|
record over x402; only records whose sha256 a live row carries are for sale. If the app
|
|
96
82
|
has no view yet, ship builds the first one here (`--index`) rather than wait for the cron;
|
|
97
|
-
5. **
|
|
98
|
-
agent is minted
|
|
83
|
+
5. **bind the card** (`fangorn card <url> --repo <app>`): the repo's `@card` record names the
|
|
84
|
+
card URL, and an ERC-8004 agent is minted from the card. Only when `@card` points
|
|
85
|
+
elsewhere; an agent is minted once, later runs only rebind.
|
|
99
86
|
|
|
100
87
|
State lives in `.ship/` next to `app.json`. In CI, cache `.ship/cache` and `.ship/stage`
|
|
101
|
-
and commit `.ship/state.json
|
|
102
|
-
(daily cron, and on every push to its config).
|
|
103
|
-
|
|
104
|
-
**What was run:** all of it, for Quorum (`https://quorum-bua.pages.dev`, agent `421614:245`):
|
|
105
|
-
five towns' meetings crawled, published, embedded and deployed by `westmarch-ship`, then
|
|
106
|
-
searched and bought (x402, settled on Arbitrum Sepolia) from `fangorn-mcp` in a fresh
|
|
107
|
-
session. FAR Desk (`https://far-desk.quickbeam.workers.dev`, agent `84532:10323`) is the
|
|
108
|
-
private one: 3,113 sealed FAR sections, registered on Base Sepolia and selling in real USDC on
|
|
109
|
-
Base, searched per call and with a pass; its `search` tool is in PayAI's Bazaar.
|
|
110
|
-
Kingsfoil, the reference at the end, predates `ship` and was built by hand.
|
|
88
|
+
and commit `.ship/state.json`.
|
|
111
89
|
|
|
112
90
|
## A private app: the data is the product
|
|
113
91
|
|
|
@@ -192,450 +170,13 @@ Without labels, it also searches 200 sampled rows by their own titles (`known@1`
|
|
|
192
170
|
|
|
193
171
|
Worse is: mean precision or `known@10` down more than 0.05, any question the base
|
|
194
172
|
answered now answered by nothing, a `hard` record check rising, or any floor or ceiling
|
|
195
|
-
missed.
|
|
196
|
-
|
|
197
|
-
required check on `main`, and put `eval/`, `.github/` and `app.json` under `CODEOWNERS`,
|
|
173
|
+
missed. Run it in CI on every pull request, from the records and vectors a scheduled
|
|
174
|
+
`westmarch-ship` leaves in its cache, with no secrets; make it a required check on `main`, and put `eval/`, `.github/` and `app.json` under `CODEOWNERS`,
|
|
198
175
|
or a PR can change the gate along with what it gates.
|
|
199
176
|
|
|
200
177
|
What is not graded yet: a change to how a source *parses*. `--local` reads what the
|
|
201
178
|
sources last staged; it does not replay their parsing over the raw documents.
|
|
202
179
|
|
|
203
|
-
## The long way, by hand
|
|
204
|
-
|
|
205
|
-
What `ship` does, one step at a time: for understanding it, or for doing one step differently.
|
|
206
|
-
|
|
207
|
-
### What you need
|
|
208
|
-
|
|
209
|
-
- Node 22.
|
|
210
|
-
- The Fangorn CLI: `npm i -g @fangorn-network/sdk@2026.10.20-dev` (gives `fangorn`).
|
|
211
|
-
- A wallet on the app's network (Base Sepolia, or Arbitrum Sepolia for older apps) with a little ETH. **It owns the app forever**, so use the
|
|
212
|
-
wallet that will publish the data.
|
|
213
|
-
- A Pinata JWT. Registering the ERC-8004 agent (step 11) pins a file to IPFS.
|
|
214
|
-
- A static host that serves `/.well-known/` and custom headers. Cloudflare Pages does
|
|
215
|
-
both, and is what the commands below use.
|
|
216
|
-
|
|
217
|
-
Start the project:
|
|
218
|
-
|
|
219
|
-
```sh
|
|
220
|
-
mkdir my-app && cd my-app && npm init -y && npm pkg set type=module
|
|
221
|
-
npm i @fangorn-network/westmarch @huggingface/transformers vite
|
|
222
|
-
mkdir -p data schema pipeline app
|
|
223
|
-
```
|
|
224
|
-
|
|
225
|
-
The Fangorn SDK and viem come with westmarch as peer dependencies. transformers embeds:
|
|
226
|
-
your records in `westmarch-view`, and the reader's query in their browser.
|
|
227
|
-
|
|
228
|
-
## 1. Set up the CLI
|
|
229
|
-
|
|
230
|
-
```sh
|
|
231
|
-
fangorn init # writes ~/.fangorn/config.json: key, Pinata JWT, gateway
|
|
232
|
-
fangorn wallet # confirm which address will sign
|
|
233
|
-
fangorn set-app my-app # the app every later command uses; --app <name> overrides it once
|
|
234
|
-
```
|
|
235
|
-
|
|
236
|
-
> The config file wins over `ETH_PRIVATE_KEY` in the environment. If `fangorn wallet`
|
|
237
|
-
> shows the wrong address, that's why.
|
|
238
|
-
|
|
239
|
-
## 2. Claim the app
|
|
240
|
-
|
|
241
|
-
First, note the current block. It becomes the card's `fromBlock` (step 9), which is where
|
|
242
|
-
readers start scanning the chain for your app:
|
|
243
|
-
|
|
244
|
-
```sh
|
|
245
|
-
node -e 'const {createPublicClient,http}=require("viem");const {baseSepolia}=require("viem/chains");
|
|
246
|
-
createPublicClient({chain:baseSepolia,transport:http()}).getBlockNumber().then(String).then(console.log)' # arbitrumSepolia for older apps
|
|
247
|
-
```
|
|
248
|
-
|
|
249
|
-
Then claim the name:
|
|
250
|
-
|
|
251
|
-
```sh
|
|
252
|
-
fangorn app info # "unclaimed", and the wallet you expect
|
|
253
|
-
fangorn app claim # first come, first served; permanent
|
|
254
|
-
```
|
|
255
|
-
|
|
256
|
-
With no flags, `claim` uses placeholder terms. Publish real ones later with
|
|
257
|
-
`fangorn app terms <hash> <uri>`; anyone who joined under the old terms has to accept again.
|
|
258
|
-
`--fee <wei>` sets what joining costs other publishers.
|
|
259
|
-
|
|
260
|
-
## 3. Become a publisher in it
|
|
261
|
-
|
|
262
|
-
Owning the app makes you its first publisher. You still need global standing:
|
|
263
|
-
|
|
264
|
-
```sh
|
|
265
|
-
fangorn register # DataRegistry.register(), then joins this app
|
|
266
|
-
fangorn app info # DataRegistry: registered · This app: joined
|
|
267
|
-
```
|
|
268
|
-
|
|
269
|
-
Without the join, every push reverts with `NotRegisteredForApp`.
|
|
270
|
-
|
|
271
|
-
## 4. Your data, as a graph
|
|
272
|
-
|
|
273
|
-
A commit is a graph: vertices, each with an `id`, a `tag` (its type) and a `payload` (the
|
|
274
|
-
record), and optional edges between them. Start from rows, `data/rows.json`:
|
|
275
|
-
|
|
276
|
-
```json
|
|
277
|
-
[
|
|
278
|
-
{ "id": "oak", "name": "Oak", "species": "Quercus robur", "family": "Fagaceae", "region": "Europe",
|
|
279
|
-
"description": "Long-lived deciduous tree with lobed leaves and acorns; hard durable timber …" },
|
|
280
|
-
{ "id": "baobab", "name": "Baobab", "species": "Adansonia digitata", "family": "Malvaceae", "region": "Africa",
|
|
281
|
-
"description": "Massive trunk stores water through the dry season; fruit pulp is rich in vitamin C." }
|
|
282
|
-
]
|
|
283
|
-
```
|
|
284
|
-
|
|
285
|
-
```js
|
|
286
|
-
// pipeline/graph.mjs — data/rows.json → data/graph.json
|
|
287
|
-
import { readFileSync, writeFileSync } from "node:fs";
|
|
288
|
-
const rows = JSON.parse(readFileSync("data/rows.json", "utf8"));
|
|
289
|
-
writeFileSync("data/graph.json", JSON.stringify({
|
|
290
|
-
vertices: rows.map((r) => ({ id: r.id, tag: "my-app.tree.v1", payload: r })),
|
|
291
|
-
// edges: [{ rel: "grows_in", from: "oak", to: "europe" }] // between vertex ids, if you have them
|
|
292
|
-
}));
|
|
293
|
-
```
|
|
294
|
-
|
|
295
|
-
What makes records work well:
|
|
296
|
-
|
|
297
|
-
- **A stable id.** The same thing keeps the same id across commits.
|
|
298
|
-
- **Text that says what the record is, in words.** This is what gets embedded, so it's
|
|
299
|
-
what "search by meaning" matches. A title alone is weak; a sentence or a paragraph is good.
|
|
300
|
-
- **Fields worth filtering or counting on**, such as a category, a region, or a date. Agents
|
|
301
|
-
use these with `where` and `count`.
|
|
302
|
-
- **One tag per kind of thing.** Version it (`.v1`) so a later shape can be a new type.
|
|
303
|
-
|
|
304
|
-
## 5. Declare the schema
|
|
305
|
-
|
|
306
|
-
The schema says what your data is. It lives in `app.json` and nowhere else; nothing is
|
|
307
|
-
committed on chain:
|
|
308
|
-
- **`types`:** one entry per type tag: `description`, `role_map`, `presentation`.
|
|
309
|
-
- **`relations`:** the references allowed between types, `{ "rel", "from", "to" }`.
|
|
310
|
-
|
|
311
|
-
`westmarch-ship` hands it to the Worker in its CONFIG, and `westmarch-view` reads it with
|
|
312
|
-
`--config app.json`. It is applied to every record they embed, so it decides:
|
|
313
|
-
- **what gets embedded:** the `text` role, plus title, subtitle and tags;
|
|
314
|
-
- **what readers see:** titles, links, labels;
|
|
315
|
-
- **what agents can do:** filters, counts, and choosing among views by their description.
|
|
316
|
-
|
|
317
|
-
In `app.json`:
|
|
318
|
-
|
|
319
|
-
```json
|
|
320
|
-
"types": {
|
|
321
|
-
"my-app.tree.v1": {
|
|
322
|
-
"description": "Tree species: what they are, where they grow, and what they are good for.",
|
|
323
|
-
"role_map": { "identity": "id", "title": "name", "subtitle": "species",
|
|
324
|
-
"tags": ["family", "region"], "text": ["description"] },
|
|
325
|
-
"presentation": { "externalUrl": { "my-app.tree.v1": "https://en.wikipedia.org/wiki/{species}" } } }
|
|
326
|
-
},
|
|
327
|
-
"relations": []
|
|
328
|
-
```
|
|
329
|
-
|
|
330
|
-
**`role_map`** says which field is what:
|
|
331
|
-
|
|
332
|
-
| role | means | used for |
|
|
333
|
-
|---|---|---|
|
|
334
|
-
| `identity` | the id field | `get`, links, updates |
|
|
335
|
-
| `text` | the field(s) whose words get embedded | search by meaning |
|
|
336
|
-
| `title`, `subtitle` | what a record is called | result lists, and embedded too |
|
|
337
|
-
| `tags` | categories | filters, `count`, and embedded too |
|
|
338
|
-
| `temporal`, `spatial`, `measures`, `relations`, `media` | dates, places, numbers, links to other records, playable media | sorting, facets, previews |
|
|
339
|
-
|
|
340
|
-
**Rules:**
|
|
341
|
-
- **Declared means declared.** A role you leave out stays empty; it isn't guessed.
|
|
342
|
-
- **Undeclared types are still guessed:** a type the schema doesn't mention gets a role
|
|
343
|
-
map inferred from its fields. That works for display and often fails for search: a
|
|
344
|
-
field called `desc` or `nct` isn't recognized, and a `price` can end up as the date.
|
|
345
|
-
Declare every type you publish.
|
|
346
|
-
- **You can change it at any time**: edit `app.json` and ship again. The view takes the new
|
|
347
|
-
role map and description on the Worker's next cron run (or the next `westmarch-view`). **Records already embedded keep the text they were embedded
|
|
348
|
-
with** until they're re-embedded, so change the `text` role early.
|
|
349
|
-
- **Relations** (e.g. `{ "rel": "grows_in", "from": "my-app.tree.v1", "to": "my-app.region.v1" }`) declare which edges the app allows. Nothing enforces them yet; they
|
|
350
|
-
are what publisher graphs will be validated against.
|
|
351
|
-
|
|
352
|
-
## 6. Commit and push the data
|
|
353
|
-
|
|
354
|
-
```sh
|
|
355
|
-
node pipeline/graph.mjs
|
|
356
|
-
fangorn repo init my-app # the data namespace, tracked in ./.fangorn
|
|
357
|
-
fangorn commit data/graph.json -m "first data" --replace # local; builds and uploads the commit
|
|
358
|
-
fangorn push # the on-chain transaction
|
|
359
|
-
```
|
|
360
|
-
|
|
361
|
-
`--replace` makes the file the namespace's whole state, so records you removed are
|
|
362
|
-
removed. Without it, the commit adds to what's already there. `fangorn status` compares
|
|
363
|
-
your local tip with the one on chain.
|
|
364
|
-
|
|
365
|
-
## 7. Publish the view
|
|
366
|
-
|
|
367
|
-
```sh
|
|
368
|
-
npx westmarch-view --app my-app --namespace my-app --out site/view --from-block 311700000
|
|
369
|
-
# my-app: 1 publisher(s) since block 311700000
|
|
370
|
-
# …-my-app: +20 embedded, -0 removed, 20 live
|
|
371
|
-
```
|
|
372
|
-
|
|
373
|
-
It reads the chain and writes files; it needs no key. For every publisher of each
|
|
374
|
-
`--namespace` in the app, it:
|
|
375
|
-
- reads their records;
|
|
376
|
-
- embeds the ones the view doesn't hold yet, with your schema's roles;
|
|
377
|
-
- marks the ones that were removed as deleted;
|
|
378
|
-
- writes a new shard;
|
|
379
|
-
- refits the coverage sketch once the view has doubled.
|
|
380
|
-
|
|
381
|
-
The view's own files are its state, so a second run with nothing new on chain changes
|
|
382
|
-
nothing, and it runs the same on a laptop, in CI, or from an agent. The first run
|
|
383
|
-
downloads the embedding model (131 MB, kept in `~/.cache/fangorn-mcp/models`, shared with
|
|
384
|
-
`fangorn-mcp`). Use `--from-block` with the block you noted in step 2.
|
|
385
|
-
|
|
386
|
-
```
|
|
387
|
-
site/view/cdn/catalog every publisher's domain, with descriptions and coverage
|
|
388
|
-
site/view/cdn/domains/<app>-<publisher>-<ns>/manifest role map, embedder, shards with their sha256, tombstones
|
|
389
|
-
site/view/cdn/domains/<app>-<publisher>-<ns>/shards/shard-NNNN-<sha>.ndjson.gz
|
|
390
|
-
```
|
|
391
|
-
|
|
392
|
-
Check it the way a reader will:
|
|
393
|
-
|
|
394
|
-
```sh
|
|
395
|
-
(cd site && python3 -m http.server 8765 &)
|
|
396
|
-
npx westmarch-lint http://127.0.0.1:8765/view
|
|
397
|
-
# …-my-app — 20 rows — nothing to fix
|
|
398
|
-
```
|
|
399
|
-
|
|
400
|
-
`lint.js` reports three levels:
|
|
401
|
-
- **blocking:** readers can't find you (no coverage, wrong model);
|
|
402
|
-
- **findable, but not readable** (no text role);
|
|
403
|
-
- **readable, but a dead end** (nowhere for a hit to link to).
|
|
404
|
-
|
|
405
|
-
The fix for most findings is in the schema (step 5).
|
|
406
|
-
|
|
407
|
-
A view remembers which embedder made it, and `westmarch-view` refuses to add to a view
|
|
408
|
-
another one built. Vectors from two encoders don't compare. Pass `--rebake` to start
|
|
409
|
-
a view over.
|
|
410
|
-
|
|
411
|
-
## 8. The page
|
|
412
|
-
|
|
413
|
-
A page for people, with the same search exposed to agents in the browser as WebMCP tools.
|
|
414
|
-
It reads the view: shards are checked against their manifests' sha256, the query is
|
|
415
|
-
embedded in the reader's tab, and nothing about the query leaves it.
|
|
416
|
-
|
|
417
|
-
```js
|
|
418
|
-
// app/agent.js — the page's tools for agents in a browser. `ctx` holds the loaded rows.
|
|
419
|
-
import { search, getRow } from "@fangorn-network/westmarch/tools";
|
|
420
|
-
|
|
421
|
-
const ok = (o) => ({ content: [{ type: "text", text: JSON.stringify(o) }] });
|
|
422
|
-
|
|
423
|
-
export function registerAgent(ctx) {
|
|
424
|
-
const mc = document.modelContext;
|
|
425
|
-
if (!mc?.registerTool) return; // most browsers have no WebMCP yet
|
|
426
|
-
mc.registerTool({
|
|
427
|
-
name: "search-trees",
|
|
428
|
-
description: "Search tree species by meaning: a question in plain words. Call this first.",
|
|
429
|
-
inputSchema: { type: "object", properties: { query: { type: "string" }, limit: { type: "number" } }, required: ["query"] },
|
|
430
|
-
execute: async ({ query, limit = 10 }) =>
|
|
431
|
-
ok(search(ctx.rows, query, ctx.roles, { qv: await ctx.queryVector(query), limit })),
|
|
432
|
-
});
|
|
433
|
-
mc.registerTool({
|
|
434
|
-
name: "get-tree",
|
|
435
|
-
description: "One tree species in full, by the id search returns.",
|
|
436
|
-
inputSchema: { type: "object", properties: { id: { type: "string" } }, required: ["id"] },
|
|
437
|
-
execute: async ({ id }) => ok(getRow(ctx.rows, id, ctx.roles) ?? { error: `no tree ${id}` }),
|
|
438
|
-
});
|
|
439
|
-
}
|
|
440
|
-
```
|
|
441
|
-
|
|
442
|
-
```js
|
|
443
|
-
// app/main.js
|
|
444
|
-
import { configure, loadShard } from "@fangorn-network/westmarch/shard";
|
|
445
|
-
import { rolesFrom, textOf } from "@fangorn-network/westmarch/roles";
|
|
446
|
-
import { search } from "@fangorn-network/westmarch/tools";
|
|
447
|
-
import { embedQuery } from "@fangorn-network/westmarch/embed";
|
|
448
|
-
import { registerAgent } from "./agent.js";
|
|
449
|
-
|
|
450
|
-
export const VIEW = new URL("view", location.href).href; // step 7
|
|
451
|
-
|
|
452
|
-
const ctx = { rows: [], roles: rolesFrom([]), queryVector: (q) => embedQuery(q).catch(() => null) };
|
|
453
|
-
configure({ onManifests: (ms) => { ctx.roles = rolesFrom(ms); }, rowText: (f) => textOf(f, ctx.roles) });
|
|
454
|
-
ctx.rows = await loadShard(VIEW); // checked against the manifests' sha256
|
|
455
|
-
registerAgent(ctx); // only now: a tool called before its data loads answers wrong, silently
|
|
456
|
-
|
|
457
|
-
// The human side: the same search, as a list.
|
|
458
|
-
const input = document.querySelector("input"), list = document.querySelector("ul");
|
|
459
|
-
input.placeholder = `Search ${ctx.rows.length} trees…`;
|
|
460
|
-
input.oninput = async () => {
|
|
461
|
-
const q = input.value;
|
|
462
|
-
const hits = search(ctx.rows, q, ctx.roles, { qv: await ctx.queryVector(q), limit: 10 });
|
|
463
|
-
if (q !== input.value) return; // a newer keystroke won
|
|
464
|
-
list.replaceChildren(...hits.map((h) => {
|
|
465
|
-
const li = document.createElement("li"), a = document.createElement("a");
|
|
466
|
-
a.textContent = h.title; if (h.url) a.href = h.url;
|
|
467
|
-
li.append(a, ` — ${h.subtitle ?? ""}`);
|
|
468
|
-
return li;
|
|
469
|
-
}));
|
|
470
|
-
};
|
|
471
|
-
```
|
|
472
|
-
|
|
473
|
-
```html
|
|
474
|
-
<!-- app/index.html -->
|
|
475
|
-
<!doctype html>
|
|
476
|
-
<meta charset="utf-8">
|
|
477
|
-
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
478
|
-
<title>My App</title>
|
|
479
|
-
<h1>My App</h1>
|
|
480
|
-
<input type="search" autofocus placeholder="Loading…">
|
|
481
|
-
<ul></ul>
|
|
482
|
-
<script type="module" src="./main.js"></script>
|
|
483
|
-
```
|
|
484
|
-
|
|
485
|
-
```js
|
|
486
|
-
// app/vite.config.js
|
|
487
|
-
export default {
|
|
488
|
-
base: "./",
|
|
489
|
-
// westmarch's embedder finds its worker by `new URL(…, import.meta.url)`;
|
|
490
|
-
// pre-bundling loses that and search silently drops to word matching.
|
|
491
|
-
optimizeDeps: { exclude: ["@fangorn-network/westmarch"] },
|
|
492
|
-
build: { outDir: "../site", emptyOutDir: false }, // keep site/view
|
|
493
|
-
};
|
|
494
|
-
```
|
|
495
|
-
|
|
496
|
-
```sh
|
|
497
|
-
(cd app && npx vite build)
|
|
498
|
-
```
|
|
499
|
-
|
|
500
|
-
`@fangorn-network/westmarch/tools` also has `describe`, `browse`, `facet` and `neighbors`,
|
|
501
|
-
if the page needs more than search. `watchShard(fn)` tells the page when the view gains
|
|
502
|
-
shards, if it should update without a reload.
|
|
503
|
-
|
|
504
|
-
## 9. The agent card
|
|
505
|
-
|
|
506
|
-
A WebMCP tool only exists inside a loaded tab, so the card is the only machine-readable
|
|
507
|
-
record that the app, its tools and its view exist. The tool list isn't written by hand:
|
|
508
|
-
`captureTools` runs your register function against a recording stub, so the card lists
|
|
509
|
-
exactly what the page registers. No `execute` runs.
|
|
510
|
-
|
|
511
|
-
```js
|
|
512
|
-
// pipeline/agent-card.mjs — site/ → site/.well-known/agent-card.json + site/_headers
|
|
513
|
-
import { mkdirSync, readdirSync, writeFileSync } from "node:fs";
|
|
514
|
-
import { agentCard, captureTools } from "@fangorn-network/westmarch/agent-card";
|
|
515
|
-
import { registerAgent } from "../app/agent.js";
|
|
516
|
-
|
|
517
|
-
const SITE = "https://my-app.pages.dev";
|
|
518
|
-
const VIEW = `${SITE}/view`; // step 7; a hosted quickbeam view's URL goes here instead
|
|
519
|
-
|
|
520
|
-
const card = agentCard({
|
|
521
|
-
name: "My App",
|
|
522
|
-
description: "Tree species: what they are, where they grow, and what they are good for. Search by meaning.",
|
|
523
|
-
url: `${SITE}/`, // the page that registers the tools
|
|
524
|
-
version: "1",
|
|
525
|
-
tools: await captureTools(() => registerAgent({})),
|
|
526
|
-
tags: ["trees"],
|
|
527
|
-
fangorn: {
|
|
528
|
-
app: "my-app", // the name you claimed
|
|
529
|
-
fromBlock: 311700000, // the block you noted before claiming
|
|
530
|
-
namespaces: ["my-app"], // your data namespace(s)
|
|
531
|
-
views: [VIEW],
|
|
532
|
-
},
|
|
533
|
-
});
|
|
534
|
-
mkdirSync("site/.well-known", { recursive: true });
|
|
535
|
-
writeFileSync("site/.well-known/agent-card.json", JSON.stringify(card, null, 1));
|
|
536
|
-
|
|
537
|
-
// The card is read from other origins, so it needs CORS, and so does the view, for
|
|
538
|
-
// agents and pages elsewhere. Bundles and shards are named by their digest, so they
|
|
539
|
-
// never change: tell caches so. Shards only in the reader's own browser (`private`): a
|
|
540
|
-
// retracted record's bytes must stop being served by shared caches once the deploy drops
|
|
541
|
-
// its shard. (Pages allows one * per rule, hence a rule per domain.)
|
|
542
|
-
const immutable = " Cache-Control: public, max-age=31536000, immutable\n";
|
|
543
|
-
const mine = " Cache-Control: private, max-age=31536000, immutable\n";
|
|
544
|
-
writeFileSync("site/_headers",
|
|
545
|
-
"/.well-known/agent-card.json\n Access-Control-Allow-Origin: *\n"
|
|
546
|
-
+ "/view/*\n Access-Control-Allow-Origin: *\n"
|
|
547
|
-
+ `/assets/*\n${immutable}`
|
|
548
|
-
+ readdirSync("site/view/cdn/domains").map((d) => `/view/cdn/domains/${d}/shards/*\n${mine}`).join(""));
|
|
549
|
-
```
|
|
550
|
-
|
|
551
|
-
```sh
|
|
552
|
-
node pipeline/agent-card.mjs
|
|
553
|
-
```
|
|
554
|
-
|
|
555
|
-
- **The `fangorn` block** becomes an A2A extension (`https://fangorn.network/a2a/app/v1`).
|
|
556
|
-
It holds the chain, the registry addresses (taken from the SDK, so they can't drift), your
|
|
557
|
-
appId, `fromBlock`, `namespaces` and `views`. `agentCard` validates them the same way
|
|
558
|
-
readers will, so a bad card fails your build, not someone else's discovery.
|
|
559
|
-
- **`views` is what agents search:** `fangorn-mcp` reads it directly, with no browser.
|
|
560
|
-
- **`url` is the page that registers the tools,** not just any page on the site.
|
|
561
|
-
- **`fromBlock`** only affects speed: readers query logs 1000 blocks per call, so an early
|
|
562
|
-
block is slow, and 0 means hundreds of thousands of calls.
|
|
563
|
-
- **Keep these values fixed.** A rebuild that drops the extension or changes `url`
|
|
564
|
-
publishes a card every reader rejects.
|
|
565
|
-
|
|
566
|
-
## 10. Deploy and check
|
|
567
|
-
|
|
568
|
-
```sh
|
|
569
|
-
npx wrangler pages deploy site --project-name my-app
|
|
570
|
-
curl -sD - https://my-app.pages.dev/.well-known/agent-card.json -o /dev/null | grep -iE "^HTTP|access-control"
|
|
571
|
-
# HTTP/2 200 · access-control-allow-origin: *
|
|
572
|
-
```
|
|
573
|
-
|
|
574
|
-
Open `https://my-app.pages.dev/` and search: that's the app for people. The card must be
|
|
575
|
-
live before step 11, because the CLI fetches it.
|
|
576
|
-
|
|
577
|
-
## 11. Register the agent and bind the card
|
|
578
|
-
|
|
579
|
-
```sh
|
|
580
|
-
fangorn app agent https://my-app.pages.dev/.well-known/agent-card.json
|
|
581
|
-
# Agent ID: 84532:…
|
|
582
|
-
# Card: https://my-app.pages.dev/.well-known/agent-card.json
|
|
583
|
-
# Tx: 0x…
|
|
584
|
-
```
|
|
585
|
-
|
|
586
|
-
This does two things:
|
|
587
|
-
|
|
588
|
-
1. **ERC-8004.** It builds a registration file from the card (name, description, A2A
|
|
589
|
-
endpoint = the card URL, trust = reputation, x402 only if a skill is tagged `x402`),
|
|
590
|
-
pins it to Pinata, and mints an agent in the identity registry at
|
|
591
|
-
`0x8004A818BFB912233c491871b3d84c89A494BD9e`. That's the same address as on Ethereum
|
|
592
|
-
and Base Sepolia. [8004scan](https://8004scan.io) indexes it within minutes.
|
|
593
|
-
2. **Fangorn.** It calls `setAppAgentUri(cardUrl)`, which emits `AppAgentChanged`. That log
|
|
594
|
-
is the app directory: `list-apps` and `listApps` read it.
|
|
595
|
-
|
|
596
|
-
**Mint once.** Every run without flags mints a new agent. After the first:
|
|
597
|
-
|
|
598
|
-
- `--update <agentId>` refreshes the existing agent's registration from the card as it is now
|
|
599
|
-
(name, description, skills, `x402Support`), re-pins it and sets its URI. It rebinds only if
|
|
600
|
-
the chain points elsewhere.
|
|
601
|
-
- `--skip-register` does only the second step, e.g. to move a card to a new URL.
|
|
602
|
-
|
|
603
|
-
The bind retries on a nonce race (`replacement transaction underpriced`), which load-balanced
|
|
604
|
-
RPCs cause right after the mint. If a run failed after `Agent ID:` printed, the agent exists:
|
|
605
|
-
finish with `--skip-register`, don't run it again.
|
|
606
|
-
|
|
607
|
-
## 12. Use it as an agent would
|
|
608
|
-
|
|
609
|
-
Register `fangorn-mcp` once (see [Using Fangorn apps from an agent](#using-fangorn-apps-from-an-agent)),
|
|
610
|
-
then in any agent:
|
|
611
|
-
|
|
612
|
-
```
|
|
613
|
-
open-app my-app → verified: true, data_tools: true
|
|
614
|
-
my-app__describe → the view's domains, with the schema's description
|
|
615
|
-
my-app__search "trees that survive fire" → cork oak, oak, redwood (ranked by meaning)
|
|
616
|
-
my-app__get "baobab" → the whole record
|
|
617
|
-
```
|
|
618
|
-
|
|
619
|
-
`open-app` reads your app's binding from the registry, fetches the card, and checks that
|
|
620
|
-
the binding points back at exactly that URL. Only then does it add the tools.
|
|
621
|
-
|
|
622
|
-
## 13. Update it
|
|
623
|
-
|
|
624
|
-
New or changed data is a commit, then the view, then a deploy:
|
|
625
|
-
|
|
626
|
-
```sh
|
|
627
|
-
node pipeline/graph.mjs && fangorn commit data/graph.json -m "…" --replace && fangorn push
|
|
628
|
-
npx westmarch-view --app my-app --namespace my-app --out site/view --from-block 311700000
|
|
629
|
-
node pipeline/agent-card.mjs && npx wrangler pages deploy site --project-name my-app
|
|
630
|
-
```
|
|
631
|
-
|
|
632
|
-
Only what changed is embedded and uploaded. The page and agents see it on their next
|
|
633
|
-
load, since the view URL, the card and the on-chain binding all stay the same. Run
|
|
634
|
-
`fangorn app agent` again only if the card moves. Anything that can run those three lines
|
|
635
|
-
can keep an app current: a cron job, a CI workflow, or an agent that just published.
|
|
636
|
-
|
|
637
|
-
---
|
|
638
|
-
|
|
639
180
|
## Using Fangorn apps from an agent
|
|
640
181
|
|
|
641
182
|
`fangorn-mcp` is one MCP server for every Fangorn app: a new app needs no new
|
|
@@ -654,8 +195,7 @@ claude mcp add fangorn -- \
|
|
|
654
195
|
```
|
|
655
196
|
|
|
656
197
|
Without `-p @huggingface/transformers`, the install is ~500 MB lighter and `search` ranks by
|
|
657
|
-
words, not meaning.
|
|
658
|
-
before `--` for those still on Arbitrum Sepolia. For private apps, `FANGORN_MCP_WALLET_KEY` lets it pay
|
|
198
|
+
words, not meaning. For private apps, `FANGORN_MCP_WALLET_KEY` lets it pay
|
|
659
199
|
(see [A private app](#a-private-app-the-data-is-the-product)); the plugin reads it from your
|
|
660
200
|
environment, while `-e` stores it in `~/.claude.json` in plain text.
|
|
661
201
|
|
|
@@ -665,8 +205,8 @@ published yet.
|
|
|
665
205
|
|
|
666
206
|
It starts with three tools:
|
|
667
207
|
- **`list-apps`** reads the apps off the chain and keeps the ones whose cards verify.
|
|
668
|
-
- **`open-app <name>`** reads that app's
|
|
669
|
-
|
|
208
|
+
- **`open-app <name>`** reads that app's `@card` (one call), verifies its card, and adds the
|
|
209
|
+
app's tools as `<name>__<tool>`.
|
|
670
210
|
- **`call-app-tool`** reaches the same tools, for clients that don't refresh their tool list.
|
|
671
211
|
|
|
672
212
|
**Two kinds of tools.**
|
|
@@ -677,7 +217,7 @@ It starts with three tools:
|
|
|
677
217
|
- **Page tools:** `open-app` with `page: true` also opens `card.url` in a browser for the
|
|
678
218
|
page's own WebMCP tools. An app with no views gets only these.
|
|
679
219
|
|
|
680
|
-
**How fast** (
|
|
220
|
+
**How fast** (measured on a 60,760-record app in 23 views):
|
|
681
221
|
|
|
682
222
|
| | time |
|
|
683
223
|
|---|---|
|
|
@@ -709,61 +249,51 @@ shared by every session on the machine and closes when the last one exits. Its p
|
|
|
709
249
|
|
|
710
250
|
## Discovering apps in code
|
|
711
251
|
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
- the card carries the Fangorn extension for **this** chain and **this** AppRegistry, and
|
|
715
|
-
- `appAgentUri(card.appId)` on chain is **exactly** the card URL.
|
|
252
|
+
An app is a publisher's repo whose `@card` record points at an agent card that points back.
|
|
253
|
+
`discoverCard(cardUrl)` accepts a card only if:
|
|
716
254
|
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
```sh
|
|
721
|
-
node examples/demo/discover.mjs card https://kingsfoil.pages.dev/.well-known/agent-card.json
|
|
722
|
-
node examples/demo/discover.mjs chain 311637349 # every app bound since this block
|
|
723
|
-
node examples/demo/discover.mjs search Kingsfoil # the public ERC-8004 index
|
|
724
|
-
```
|
|
255
|
+
- the card carries the Fangorn repo extension for **this** chain and **this** DataRegistry,
|
|
256
|
+
naming a publisher and a repo, and
|
|
257
|
+
- that repo's `@card` on chain is **exactly** the card URL.
|
|
725
258
|
|
|
726
259
|
**From a card URL:**
|
|
727
260
|
|
|
728
261
|
```js
|
|
729
|
-
import { Fangorn
|
|
262
|
+
import { Fangorn } from "@fangorn-network/sdk";
|
|
730
263
|
import { generatePrivateKey } from "viem/accounts";
|
|
731
264
|
// Fangorn.create needs a signer; a throwaway key is fine for reading.
|
|
732
|
-
const fangorn = Fangorn.create({ privateKey: generatePrivateKey()
|
|
733
|
-
const { card,
|
|
265
|
+
const fangorn = Fangorn.create({ privateKey: generatePrivateKey() });
|
|
266
|
+
const { card, publisher, repo } = await fangorn.discoverCard(cardUrl);
|
|
734
267
|
```
|
|
735
268
|
|
|
736
269
|
**From the chain** (every Fangorn app; no index, no server):
|
|
737
270
|
|
|
738
271
|
```js
|
|
739
272
|
import { listApps } from "@fangorn-network/westmarch/apps";
|
|
740
|
-
const { apps, rejected } = await listApps(fangorn
|
|
741
|
-
// apps:
|
|
742
|
-
// rejected: [{ card, why }]: unreachable or not bound, reported rather than dropped
|
|
273
|
+
const { apps, rejected } = await listApps(fangorn);
|
|
274
|
+
// apps: one per repo whose card verifies; rejected: [{ card, why }], reported rather than dropped
|
|
743
275
|
```
|
|
744
276
|
|
|
745
277
|
**From ERC-8004** (for general-purpose agents that know nothing about Fangorn):
|
|
746
278
|
|
|
747
279
|
```js
|
|
748
280
|
const api = "https://8004scan.io/api/v1/agents";
|
|
749
|
-
const { items } = await (await fetch(`${api}?chain_id=
|
|
750
|
-
const detail = await (await fetch(`${api}/
|
|
751
|
-
const found = await fangorn.
|
|
281
|
+
const { items } = await (await fetch(`${api}?chain_id=84532&search=My%20App`)).json();
|
|
282
|
+
const detail = await (await fetch(`${api}/84532/${items[0].token_id}`)).json();
|
|
283
|
+
const found = await fangorn.discoverCard(detail.services.a2a.endpoint);
|
|
752
284
|
```
|
|
753
285
|
|
|
754
286
|
**The committed data itself:**
|
|
755
287
|
|
|
756
288
|
```js
|
|
757
|
-
fangorn.
|
|
758
|
-
const timelines = await fangorn.appNamespaces({ namespace: namespaces[0], fromBlock });
|
|
759
|
-
const { contents } = await fangorn.readNamespace(timelines[0].owner, namespaces[0]);
|
|
289
|
+
const { contents } = await fangorn.readRepo(publisher, repo);
|
|
760
290
|
```
|
|
761
291
|
|
|
762
292
|
## What the binding proves, and what it doesn't
|
|
763
293
|
|
|
764
|
-
- **Proves:**
|
|
765
|
-
|
|
766
|
-
URL. This is tested (`src/discover-
|
|
294
|
+
- **Proves:** the repo's publisher chose this card URL. Anyone can serve a card naming any
|
|
295
|
+
repo, and `discoverCard` rejects it unless the repo's `@card` points back at that exact
|
|
296
|
+
URL. This is tested in the SDK (`src/discover-card.test.ts`, `src/e2e/cards.e2e.test.ts`).
|
|
767
297
|
- **Doesn't prove:** that the page behind `card.url` behaves as described, or that the card
|
|
768
298
|
wasn't changed after binding. The card is live HTTP, not content-addressed, and the
|
|
769
299
|
binding is to the URL. That's deliberate: the card is mostly endpoints, which change, and
|
|
@@ -774,50 +304,24 @@ const { contents } = await fangorn.readNamespace(timelines[0].owner, namespaces[
|
|
|
774
304
|
|
|
775
305
|
| symptom | cause |
|
|
776
306
|
|---|---|
|
|
777
|
-
|
|
|
778
|
-
| `not bound to app … on-chain agent_uri is …` | URLs must match exactly. A trailing slash, `http` vs `https`, or a different path counts as a different card. |
|
|
307
|
+
| card rejected as not bound | URLs must match exactly. A trailing slash, `http` vs `https`, or a different path counts as a different card. |
|
|
779
308
|
| card rejected after a rebuild | the build dropped the `fangorn` block or changed `fromBlock`/`url`; keep them fixed |
|
|
780
309
|
| discovery works in Node, fails in a browser | no `Access-Control-Allow-Origin` on the card |
|
|
781
310
|
| `listApps` takes forever | `fromBlock` is too early; the scan is 1000 blocks per RPC call |
|
|
782
|
-
| `
|
|
783
|
-
| `
|
|
784
|
-
| `
|
|
785
|
-
| the 8004 registration says `x402Support: false` | no card skill is tagged `x402`; rebuild the card, then `fangorn
|
|
311
|
+
| `fangorn card`: "ERC-8004 registration pins the registration file to IPFS" | no Pinata JWT in `fangorn init` |
|
|
312
|
+
| `fangorn card` signs as the wrong wallet | `~/.fangorn/config.json` beats `ETH_PRIVATE_KEY` |
|
|
313
|
+
| `fangorn card`: "replacement transaction underpriced" | a nonce race after the mint; the agent exists, so rerun with `--skip-register` |
|
|
314
|
+
| the 8004 registration says `x402Support: false` | no card skill is tagged `x402`; rebuild the card, then `fangorn card <card> --repo <app> --update <agentId>` |
|
|
786
315
|
| a private app's page says the data is still being indexed | the cron hasn't run yet; `westmarch-ship app.json --index` |
|
|
787
316
|
| search on the page matches words, never meaning | the bundler pre-bundled westmarch; `optimizeDeps.exclude` it |
|
|
788
|
-
| an agent's first call returns empty, later calls work | the tools registered before their data loaded
|
|
317
|
+
| an agent's first call returns empty, later calls work | the tools registered before their data loaded |
|
|
789
318
|
| an agent opens the page and finds no tools | `card.url` is not the page that registers them |
|
|
790
|
-
| `search` ignores what records say, or titles are ids | the type isn't declared in the schema, so its roles were guessed; declare it
|
|
319
|
+
| `search` ignores what records say, or titles are ids | the type isn't declared in the schema, so its roles were guessed; declare it in `app.json` |
|
|
791
320
|
| a schema change didn't change search results | records keep the text they were embedded with; only newly embedded records use the new `text` role |
|
|
792
|
-
| the view is empty after a push |
|
|
793
|
-
| `westmarch-view`: "vectors from two encoders are not comparable" | the view was built by another embedder
|
|
794
|
-
| `westmarch-view` runs for minutes before doing anything | `--from-block` is far too early; the log scan is 1000 blocks per call |
|
|
321
|
+
| the view is empty after a push | the Worker's cron hasn't run yet (`westmarch-ship app.json --index`), or the push hasn't landed (`fangorn status`) |
|
|
322
|
+
| `westmarch-view`: "vectors from two encoders are not comparable" | the view was built by another embedder; `--rebake`, or keep publishing it with that tool |
|
|
795
323
|
| lint: "nowhere to go" | no `presentation.externalUrl` in the schema, so a hit links nowhere |
|
|
796
324
|
| `fangorn-mcp`: "this browser has no WebMCP" | page tools only: the browser lacks `document.modelContext`; it needs Chrome 150+ with `--enable-features=WebMCP` |
|
|
797
325
|
| `fangorn-mcp`: "no browser: cannot launch google-chrome" | page tools only: no local Chrome; set `FANGORN_MCP_CDP` |
|
|
798
|
-
| a log scan misses a transaction you just sent | fixed in the SDK (uncached head block); upgrade to ≥ 2026.9.22-dev |
|
|
799
326
|
| IPFS reads return "switching to a service worker gateway" | ipfs.io stopped serving raw content; use a Pinata gateway |
|
|
800
327
|
| the page isn't listed as a "Web" service on 8004scan | agent0-sdk has no web endpoint type; agents find the page through the card's `url` |
|
|
801
|
-
|
|
802
|
-
## Reference: Kingsfoil
|
|
803
|
-
|
|
804
|
-
Kingsfoil has 60,760 clinical trials in 23 views. It predates the schema and quickbeam
|
|
805
|
-
path: it embeds and bakes its own views (`kingsfoil/pipeline/bake.mjs`) and serves them
|
|
806
|
-
from its own site. That works, but every update is a manual rebake and redeploy.
|
|
807
|
-
|
|
808
|
-
| | |
|
|
809
|
-
|---|---|
|
|
810
|
-
| site | https://kingsfoil.pages.dev |
|
|
811
|
-
| tools page (`card.url`) | https://kingsfoil.pages.dev/provider.html (the root is the patient view, with no tools) |
|
|
812
|
-
| card | https://kingsfoil.pages.dev/.well-known/agent-card.json |
|
|
813
|
-
| app | `kingsfoil` = `0x3069aaab9c73b01fb147a97106c7e595534850af5cab0e0ff7f2a55554d5c8ca` |
|
|
814
|
-
| owner | `0x7a7849231cF7Ab1EA003BcF0063CB89704D7Cce9` |
|
|
815
|
-
| fromBlock | 311671082 |
|
|
816
|
-
| claim tx | `0x881a88e4775c6360f799503b098f00ef470806278f7b282045d6cc881df3cf72` |
|
|
817
|
-
| ERC-8004 | agent `421614:226`, registration `ipfs://bafkreigmy2ubgzrsp55fnf77fykabapuv4y42nk6peq4ko3oi3w2x7u7ay` |
|
|
818
|
-
| bind tx | `0xc7d8726d31bb9698ba2bfae3bc107a6111062d4b7e26526301a984638ab94c9f` |
|
|
819
|
-
| card script | `kingsfoil/pipeline/agent-card.mjs` |
|
|
820
|
-
|
|
821
|
-
Deployment (Arbitrum Sepolia, 421614): AppRegistry `0x11d228c4774af3d9cae3b4b6874a12576a1a83ec`,
|
|
822
|
-
DataRegistry `0x775026e905d7b58b34d16bcbd385fa630ee36c26`, earliest AppRegistry event at block
|
|
823
|
-
311637349.
|