Cap'n Web subs in for the WP ability
How the Cap'n Web frag pattern replaces the WordPress-plugin-as-ability. 2026-08-30.
The Cap'n Web pattern — what it is
- A frag is a WorkerEntrypoint that is an RpcTarget; the client opens a websocket to the door and speaks Cap'n Web to it directly.
- describe() returns the frag's methods AND its live state in one compact call — nothing hidden, no separate registry.
- Proven live on the pilot door: describe() over the socket returned methods + state, and a fresh isolate read its own honest state.
Subbing it in for the WordPress ability
- connect exposes add-listing, read and describe as an RpcTarget over the same Cap'n Web door as every frag — not a resident PHP agent.
- describe() reads GeoDirectory's own field definitions for the post type and returns them as the method's parameters, so the form IS the API.
- Underneath it still writes through GD's real route (POST geodir/v2/listings), unchanged — only how it is reached changes, never what it writes.
Why it is better
- Form and API cannot drift: they are one description, so a field the owner adds shows up with no release and validation stays GD's own.
- BEB-1580's twenty interfaces collapse to one stub calling one method — twenty things become one.
- It is a gatekeeper with a declarative whitelist: connect enumerates every operation before performing it, so blast radius is one install.
It IS an MCP app
- describe() returning methods-plus-state is exactly an MCP tool listing — the same shape an assistant reads and calls.
- One primitive serves both faces: it renders our progressive form for a person and answers an agent on identical parameters.
- So a WP ability becomes an MCP app the same way every frag does — no adapter per consumer, one surface.
The next move
- Backfill add-listing on touch.abilifi.net: every listing created through the primitive over Cap'n Web.
- That proves the primitive and seeds the directory in one job — if it can build our own directory, it can build anyone's.
- Tracked on BEB-1580 (add-listing / dynamic form) and BEB-8198 (touch directory + persistent GD store).