create-ailk 0.44.0 → 0.46.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.
- package/README.md +6 -3
- package/component-catalog.json +24 -1
- package/component-catalog.md +6 -5
- package/dist/add-module.d.ts +7 -0
- package/dist/add-module.js +17 -2
- package/dist/apply-design.js +1 -12
- package/dist/lib/env-catalog.js +2 -2
- package/dist/lib/import-mdx.js +10 -2
- package/dist/lib/license-key-files.d.ts +2 -0
- package/dist/lib/license-key-files.js +11 -0
- package/dist/paid-sections.d.ts +19 -0
- package/dist/paid-sections.js +41 -0
- package/dist/programmatic.js +56 -6
- package/dist/seed-workspace.d.ts +1 -1
- package/dist/seed-workspace.js +10 -3
- package/dist/surfaces.js +1 -1
- package/dist/update.d.ts +21 -2
- package/dist/update.js +188 -10
- package/package.json +3 -3
- package/templates/apps/api/.env.example +23 -0
- package/templates/apps/api/CLAUDE.md +17 -7
- package/templates/apps/api/src/lib/__mocks__/prisma.ts +11 -0
- package/templates/apps/mcp/.env.example +14 -3
- package/templates/apps/mcp/CLAUDE.md +47 -24
- package/templates/apps/mcp/src/index.ts +1 -1
- package/templates/apps/web/.env.example +1 -1
- package/templates/apps/web/CLAUDE.md +47 -16
- package/templates/apps/web/app/.well-known/mcp.json/build-manifest.ts +44 -41
- package/templates/apps/web/app/.well-known/mcp.json/route.ts +24 -33
- package/templates/apps/web/app/[locale]/layout.tsx +10 -7
- package/templates/apps/web/app/api/site-status/__tests__/route.test.ts +120 -0
- package/templates/apps/web/app/api/site-status/route.ts +62 -0
- package/templates/apps/web/app/llms.txt/route.ts +3 -3
- package/templates/apps/web/app/openapi.json/__tests__/route.test.ts +21 -4
- package/templates/apps/web/app/openapi.json/route.ts +10 -9
- package/templates/apps/web/app/sitemap.xml/route.ts +3 -3
- package/templates/apps/web/auth.ts +25 -1
- package/templates/apps/web/lib/__tests__/fixtures/mcp-stub-server.ts +245 -0
- package/templates/apps/web/lib/__tests__/mcp-served-tools.test.ts +395 -0
- package/templates/apps/web/lib/__tests__/offerings-pricing.test.ts +112 -0
- package/templates/apps/web/lib/__tests__/pricing-page.test.ts +280 -0
- package/templates/apps/web/lib/__tests__/site-brand.test.ts +5 -6
- package/templates/apps/web/lib/__tests__/site-visibility.test.ts +64 -0
- package/templates/apps/web/lib/__tests__/structured-data.test.tsx +108 -11
- package/templates/apps/web/lib/license-key-store.ts +1 -1
- package/templates/apps/web/lib/mcp-oauth.ts +64 -0
- package/templates/apps/web/lib/mcp-served-tools.ts +231 -0
- package/templates/apps/web/lib/offerings-pricing.ts +30 -6
- package/templates/apps/web/lib/pricing-page.ts +142 -35
- package/templates/apps/web/lib/site-brand.tsx +1 -7
- package/templates/apps/web/lib/site-visibility.ts +45 -0
- package/templates/apps/web/messages/en.json +8 -0
- package/templates/apps/web/middleware.ts +16 -1
- package/templates/apps/web/src/lib/routes.ts +3 -3
- package/versions.json +51 -51
- package/templates/apps/web/app/.well-known/ai-plugin.json/route.ts +0 -93
- package/templates/apps/web/lib/release-scope.ts +0 -47
|
@@ -26,8 +26,9 @@ ships to every scaffold and fails on any other import):
|
|
|
26
26
|
`import()` each, rendered by create-ailk from `MODULE_SLICES` (`paidMcpToolPackages`) and
|
|
27
27
|
`apps/mcp/package.json`; `// oss: false` on line 1 exactly when a pack is present. The
|
|
28
28
|
monorepo copy carries all three. A module-gated or signed-in tool resolves from the union of
|
|
29
|
-
the loaded packs at call time
|
|
30
|
-
|
|
29
|
+
the loaded packs at call time. A module-gated anonymous tool registers only while a loaded
|
|
30
|
+
pack serves it (#11950), so a site that does not carry its pack never lists it; the tool error
|
|
31
|
+
`MCP slice drift: no installed package serves '<name>'` is left as the drift backstop.
|
|
31
32
|
|
|
32
33
|
The suites that stay here are the composition root's: `api-parity`, `pro-tool-call-gate`,
|
|
33
34
|
`workspace-surface`, `write-tool-guard` and `create-booking-guard` (they call paid handlers through
|
|
@@ -64,6 +65,15 @@ now mean `packages/mcp-server/src/<file>`.
|
|
|
64
65
|
reader's 15-second shared answer; a failed read keeps the last answer, then on.
|
|
65
66
|
`/mcp/workspace`, its protected-resource metadata and stdio are untouched. A hub's own tool
|
|
66
67
|
server needs the hub site's `AILK_SPOKE_KEY`, or its hub refuses the read and the server stays on.
|
|
68
|
+
The switch is the Admin's **Site visibility** (Live or Hidden, #11978). `STEALTH` on this
|
|
69
|
+
server's own hosting project (read once through `parseStealth`, `@working-theory/web-i18n/stealth`;
|
|
70
|
+
an unknown value fails the boot) makes `discoverable` answer false with no hub read — the website's
|
|
71
|
+
STEALTH cannot reach this hosting project, so a hidden site sets it on both.
|
|
72
|
+
- **The installed capability (#11978 D4).** `createMcpServer()` names the loaded packs' tool names —
|
|
73
|
+
gated ones included — under `capabilities.experimental["ailk/installed"].tools` in every
|
|
74
|
+
`initialize` answer (`mcpInstalledTools()`, `lib/public-agent-tools.ts`). The website's
|
|
75
|
+
`GET /api/site-status` reads it so the Admin's Installed column can tell an absent pack from one
|
|
76
|
+
the hub gates off. It names the build's module set, never a workspace's data.
|
|
67
77
|
- **Content root.** Every content tool and `audit` take their root from `mcpContentRoot()`
|
|
68
78
|
(`lib/content-adapter.ts`): `AILK_CONTENT_ROOT`, else `<cwd>/content`, else
|
|
69
79
|
`<cwd>/../../content`. Never build a content path from `process.cwd()` in a tool — the one
|
|
@@ -124,47 +134,54 @@ Every tool maps 1:1 to an `apps/api` endpoint. When you change a tool, change th
|
|
|
124
134
|
|
|
125
135
|
## The free anonymous tools (enabled at launch)
|
|
126
136
|
|
|
127
|
-
**The HTTP write branch (6).** `WRITE_TOOLS` in `src/http-transport.ts` — `capture_lead`, `subscribe_newsletter`, `request_callback`, `start_purchase`, `create_booking`, `submit_flow_step` — takes the write-origin allow-list and the AbuseGuard (
|
|
137
|
+
**The HTTP write branch (6).** `WRITE_TOOLS` in `src/http-transport.ts` — `capture_lead`, `subscribe_newsletter`, `request_callback`, `start_purchase`, `create_booking`, `submit_flow_step` — takes the write-origin allow-list and the AbuseGuard (the operator's `MCP_ABUSE_BLOCKED_USER_AGENTS` list, honeypot, email format, per-IP daily cap); every other tool takes the read branch, which refuses no caller by its User-Agent (#11959). A tool that sends caller-chosen data to the hub belongs in it: `__tests__/write-tool-guard.test.ts` fails when a catalog tool that sends a non-GET request through `@working-theory/api-client` is missing, and makes every new catalog tool pick a branch (#8071).
|
|
128
138
|
|
|
129
139
|
**Read (9):** `list_pages`, `read_content`, `search_content`, `get_site_info`, `get_business_hours`, `get_locations`, `get_offerings`, `get_pricing`, `get_faq`. The first three adopted their `apps/api` routes' arguments and results (#7167, #7168, #7169 — the operator's decision of 2026-10-19): `search_content` takes `q` and answers the route's `ItemList` (`query`, `items`, `totalItems`); `list_pages` requires `type`, takes `page`/`pageSize` and answers the paginated `ItemList` (`items`, `pagination`); `read_content` takes `include` and answers the page's JSON-LD at the root with `page`, plus `body` only with `include: "body"` — a miss is the not-found body. Each parses the same `@working-theory/validation` export its route parses with and answers through the same `@working-theory/content-adapters` builder, so the parity guard holds them as `twin`s
|
|
130
140
|
**Conversion-write (3):** `capture_lead`, `subscribe_newsletter`, `request_callback` — each takes the body its `POST /v1/leads/{submit,subscribe,callback}` route parses (`leadSubmitBodySchema`: `source`, `email`, `consent`, `payload`; `leadSubscribeBodySchema`: `email`, `source`; `leadCallbackBodySchema`: `name`, `phone`, `preferredTime`, `payload`) and returns the route's 201 body `{ id, persisted, email }` unchanged (#7171, #7172, #7173 — the operator's decision of 2026-10-19), so the parity guard holds the three as `twin`s. `source` is the agent's to choose — `mcp` unless the operator says otherwise — and a consent-bearing source needs `consent: true`, exactly as a form does; `capture_lead` still spreads the spoke marker `payload.site` from `AILK_LEAD_SITE` last. The AbuseGuard reads the first two's `email` at the top level, else inside `payload` (the route lifts it from there), so a malformed address is refused wherever it sits
|
|
131
141
|
**Maintenance (2):** `audit`, `create_project` (stdio only, #9965 D13)
|
|
132
|
-
**Flow (
|
|
133
|
-
**Booking (4):** `list_availability`, `get_event_meta`, `list_meetings`, `create_booking` — module-gated (`module: "scheduling"`) and licence-feature-tagged (`feature: "scheduling"`, #7136), gated on the deployment's `scheduling` licence feature under `MCP_FEATURE_GATE_MODE`. `create_booking` takes the HTTP write branch (its own daily cap, `MCP_ABUSE_CREATE_BOOKING_DAILY_CAP`, default 20, and an `attendee.email` format check — #8071). `list_meetings` (#8843 D5) twins `GET /v1/schedule/meetings`: it takes no argument and returns the site's Live meetings — slug, visibility, position and whether each can be booked, plus a bookable one's calLink, title, length, description and price; `private` means unlisted, not secret
|
|
134
|
-
**Redirect (1):** `get_redirect` (#10202 D8) — module-gated (`module: "content-write"`) and licence-feature-tagged (`feature: "workspace"`, the content-write claim), gated on the deployment's `workspace` licence feature under `MCP_FEATURE_GATE_MODE`. It twins `GET /v1/redirects`: given an old site path (and an optional locale) it returns where the site permanently redirects it — `{ from, to, permanent: true }` — or the route's not-found body. Its handler rides `@working-theory/mcp-workspace`'s anonymous `tools` (`redirect.ts`), the pack the `workspace` and `multi-tenant` modules carry, and calls the module-level `apiClient` with no agent key
|
|
142
|
+
**Flow (3):** `list_flows`, `get_flow`, `submit_flow_step` — `list_flows` (#11954) twins `GET /v1/flows`: it takes no argument and returns each live visitor magnet's slug, kind, title and purpose line, so an agent learns a slug before `get_flow`. All three are module-gated (`module: "signal-collectors"`, D-48, #5366) and licence-feature-tagged (`feature: "flows-deliverables"`, #7136): identity-blind like every tool in this list, registered only when its pack is installed and the hub's `GET /v1/content/agent-tools` answers `signal-collectors` licensed, ready (a live visitor magnet) and on (#11950), and gated on the deployment's `flows-deliverables` licence feature under `MCP_FEATURE_GATE_MODE`, the same shape Booking below has. `submit_flow_step` takes the HTTP write branch (its own daily cap, `MCP_ABUSE_SUBMIT_FLOW_STEP_DAILY_CAP`, default 50 — #8071)
|
|
143
|
+
**Booking (4):** `list_availability`, `get_event_meta`, `list_meetings`, `create_booking` — module-gated (`module: "scheduling"`: registered only when its pack is installed and the hub answers `scheduling` licensed, ready — a connected calendar — and on, #11950) and licence-feature-tagged (`feature: "scheduling"`, #7136), gated on the deployment's `scheduling` licence feature under `MCP_FEATURE_GATE_MODE`. `create_booking` takes the HTTP write branch (its own daily cap, `MCP_ABUSE_CREATE_BOOKING_DAILY_CAP`, default 20, and an `attendee.email` format check — #8071). `list_meetings` (#8843 D5) twins `GET /v1/schedule/meetings`: it takes no argument and returns the site's public Live meetings — the ones its `/meet` page lists — slug, visibility, position and whether each can be booked, plus a bookable one's calLink, title, length, description and price; since #11977 (amending #8843 D2 for the list) a meeting the owner keeps unlisted is left out for every caller, and its calLink still works with `get_event_meta`, `list_availability` and `create_booking`; `private` means unlisted, not secret
|
|
144
|
+
**Redirect (1):** `get_redirect` (#10202 D8) — module-gated (`module: "content-write"`: registered only when its pack is installed and the hub answers `content-write` licensed — its redirect route served — and on, #11950) and licence-feature-tagged (`feature: "workspace"`, the content-write claim), gated on the deployment's `workspace` licence feature under `MCP_FEATURE_GATE_MODE`. It twins `GET /v1/redirects`: given an old site path (and an optional locale) it returns where the site permanently redirects it — `{ from, to, permanent: true }` — or the route's not-found body. Its handler rides `@working-theory/mcp-workspace`'s anonymous `tools` (`redirect.ts`), the pack the `workspace` and `multi-tenant` modules carry, and calls the module-level `apiClient` with no agent key
|
|
135
145
|
|
|
136
|
-
### Why the parity test counts
|
|
146
|
+
### Why the parity test counts 23 and a keyless server registers 21 (22 over stdio once Free is released)
|
|
137
147
|
|
|
138
|
-
- **
|
|
139
|
-
`packages/metadata/src/mcp-tool-catalog.ts` defines
|
|
148
|
+
- **23 in the `TOOLS` array / parity test**: the `TOOLS` array in
|
|
149
|
+
`packages/metadata/src/mcp-tool-catalog.ts` defines 23 anonymous tools; the
|
|
140
150
|
parity test counts that full array. It also holds the sixty-two signed-in
|
|
141
151
|
workspace tools (#3591; the content-suggestion pair `draft_page_suggestions`
|
|
142
152
|
and `decide_page_suggestion` since #10218; the draft pair `save_draft` and
|
|
143
153
|
`read_report` since #10336; the knowledge-base pair `read_knowledge` and
|
|
144
154
|
`read_knowledge_doc` since #10345), which no anonymous view returns — see § The
|
|
145
155
|
signed-in workspace surface below.
|
|
146
|
-
- **
|
|
147
|
-
while the Free level is held or over HTTP —
|
|
148
|
-
released** (#5971, #9534, #9965 D13): `createMcpServer` (`apps/mcp/src/server.ts`) registers
|
|
156
|
+
- **21 registered on a KEYLESS deployment, 22 on a commerce-claimed one,
|
|
157
|
+
while the Free level is held or over HTTP — 22 and 23 over stdio once it is
|
|
158
|
+
released, with every module's tools served** (#5971, #9534, #9965 D13): `createMcpServer` (`apps/mcp/src/server.ts`) registers
|
|
149
159
|
`getMcpToolRegistrations()` minus the topology seam's `UNSERVED_MCP_TOOLS`,
|
|
150
160
|
minus `create_project` while create-ailk's `release-scope.json` holds
|
|
151
161
|
`levels.free` (the release-scope filter, #9534) and on any transport but
|
|
152
162
|
stdio (the transport filter, #9965 D13), minus `OSS_DISABLED_TOOLS`
|
|
153
|
-
(now empty), minus module-gated tools
|
|
163
|
+
(now empty), minus module-gated tools not served from state (#11950: the
|
|
164
|
+
tool's pack is installed and the hub's `GET /v1/content/agent-tools` answers
|
|
165
|
+
its capability licensed, ready and on — read at boot, every
|
|
166
|
+
`MCP_CLAIM_REFRESH_MS` and on a `POST /mcp` that finds the memo stale, by
|
|
167
|
+
`lib/public-agent-tools.ts`; a failed read keeps the last good answer for
|
|
168
|
+
up to `MCP_CLAIM_REFRESH_MS` plus one minute, and with none no module tool
|
|
169
|
+
is listed;
|
|
170
|
+
`AILK_ENABLED_MODULES` gates `/mcp/workspace` only), minus any
|
|
154
171
|
`addon`-tagged tool whose claim this deployment does not hold.
|
|
155
172
|
`start_purchase` carries `addon: "commerce"`, so it is the one entry whose
|
|
156
173
|
presence depends on the licence — one fewer without the claim.
|
|
157
|
-
- **
|
|
174
|
+
- **21 anonymous tools while Free is held or over HTTP (22 over stdio once released)**: since #5853 retired the three content-write
|
|
158
175
|
tools, every registered tool remains anonymous — call-time gating checks a
|
|
159
|
-
licence claim, never an identity. The
|
|
160
|
-
(`get_flow`, `submit_flow_step`, `list_availability`, `get_event_meta`,
|
|
176
|
+
licence claim, never an identity. The eight carrying `tier: "pro"`
|
|
177
|
+
(`list_flows`, `get_flow`, `submit_flow_step`, `list_availability`, `get_event_meta`,
|
|
161
178
|
`list_meetings`, `create_booking`, `get_redirect`) are gated at REGISTRATION **and at call time** (#7315):
|
|
162
|
-
each needs its
|
|
179
|
+
each needs its pack installed and its capability served by the hub (#11950), and each catalog row names the licence `feature:`
|
|
163
180
|
that entitles it. `start_purchase` is gated at call time by both this
|
|
164
181
|
server-wide gate and its own Gate 2 in `tools/purchase.ts`.
|
|
165
182
|
`MCP_FEATURE_GATE_MODE` (`packages/metadata`) decides what an unheld
|
|
166
|
-
feature does. In `"warn"` mode (this release) the
|
|
167
|
-
|
|
183
|
+
feature does. In `"warn"` mode (this release) the eight register on the four
|
|
184
|
+
facts above alone, and the boot (`bootMcp()`) logs one warning (stderr) per tool
|
|
168
185
|
served without its feature. In `"refuse"` mode (the next release) they
|
|
169
186
|
also need the deployment's licence to hold the feature, and
|
|
170
187
|
`/.well-known/mcp.json` drops them in step. The claim is resolved at boot
|
|
@@ -182,12 +199,12 @@ here. Spec: `docs/specs/3591-tenant-scoped-agent-auth-secure-spec.md` D13–D16.
|
|
|
182
199
|
anonymous path: POST only and always stateless (a fresh transport and
|
|
183
200
|
`createWorkspaceMcpServer()` per request, no session map), so GET and DELETE are 405. A POST
|
|
184
201
|
needs `Authorization: Bearer ailk_agt_<43 base64url>` — anything else, a personal `tok_` token
|
|
185
|
-
included, is 401 before the body is read. A JSON-RPC batch is 400.
|
|
186
|
-
|
|
202
|
+
included, is 401 before the body is read. A JSON-RPC batch is 400. Rate limiting is apps/api's
|
|
203
|
+
per-agent limiter.
|
|
187
204
|
- **apps/mcp checks only the key's shape.** The key is attached as the SDK's `req.auth` for that
|
|
188
205
|
request alone and reaches a tool as `extra.authInfo.token`. apps/api is the one place it is
|
|
189
206
|
checked, and its tenant guard and the caller's clamped role decide every answer.
|
|
190
|
-
- **
|
|
207
|
+
- **Ninety tools (eighty-seven plus three deprecated aliases), each a `twin`.** The catalog rows carry `surface: "workspace"`, `tier: "pro"`
|
|
191
208
|
and `modulesAnyOf` (the modules any one of which registers the tool — its twin route's gate):
|
|
192
209
|
`get_agent_context`, (#9683) `get_workspace_knowledge` — twin of `GET
|
|
193
210
|
/v1/workspaces/:workspaceId/knowledge`: the business's shown offerings, live magnets, listed
|
|
@@ -209,7 +226,7 @@ here. Spec: `docs/specs/3591-tenant-scoped-agent-auth-secure-spec.md` D13–D16.
|
|
|
209
226
|
tools, `list_proposals` and `create_proposal`, twinning `GET`/`POST
|
|
210
227
|
/v1/workspaces/:workspaceId/people/:personId/proposals` with the same grant: a proposal is
|
|
211
228
|
private to one client, `payments` says whether approval leads to a Stripe page, and an agent's
|
|
212
|
-
price is refused `proposal_needs_person` (a person prices) — and (#10957) `send_person_message`, twinning `POST …/people/:personId/messages`: one message on a client's member feed, saved then emailed (an agent's only to a proved address), needing `inbox-act` with `people-read` or `member-pieces-manage`, and `assets-write` for a file; the operator's message list has no tool, by decision — and (#9681) the four person-thread tools, `get_person_thread`, `set_person_thread_state`, `list_external_threads` and `add_external_thread`, twinning `GET`/`PATCH …/people/:personId/thread` and `GET`/`POST …/people/:personId/external-threads`: a client's whole thread page by page with its read/archived/resolved state, and pointers to email and Slack threads (never message text); reading needs the `people-read` grant, writing also `inbox-act`, and the client erasure route has no tool, by decision — and (#9682) the three person-memory tools, `list_person_memories`, `get_person_memory` and `propose_person_memory`, twinning `GET …/people/:personId/memories`, `GET …/memories/:path` and `POST …/memories`: an agent reads only live, unexpired memories (confirmed by a person, read within 180 days) and its proposal is never live — a new path is a draft, a confirmed one gets a pending version — needing the `people-read` or `people-memory-propose` grant to read and `people-memory-propose` to propose; the six person-only memory routes (edit, delete, confirm, redact, the versions list, restore) have no tool, by decision — and (#9749) `get_slack_connection_status`, twin of `GET /v1/workspaces/:workspaceId/slack-connection` (registered with `workspace`/`multi-tenant`, its route's `TENANCY` row: whether the Organization's Slack is connected, its team name and the date, never a credential; connect and disconnect are a person's act and have no tool, by decision), and `get_prospect_channel_settings` / `set_prospect_channel_settings`, twins of `GET`/`PUT …/prospect-channel` (registered with `scheduling`, their routes' module): the update replaces every field, needs the `meeting-types-manage` grant, is refused `slack_not_connected` while the Organization has no Slack connection, and an agent may change only `enabled`, `channelPrefix` and `archiveDays` — a change to `memberIds` or `welcomeTemplate` is refused `prospect_channel_needs_person` — and (#10950) the three meeting tools, `list_meeting_types`, `save_meeting_types` and `list_appointments`, twinning `GET`/`PUT …/meetings` and `GET /v1/schedule/appointments` (registered with `scheduling`): the meeting types from the connected calendar, each with whether it is Live (`enabled`) and who can book it (`visibility`: `public`, `private` or `authenticated`), the provider's `providerEventTypeId` and `createdAt` when it serves them, and, with the `meeting-types-manage` grant, `providerEditUrl` — the read takes no `include` (#11122 D4); the save needs that grant and its required `enabledSlugs` replaces the Live list, while `customerSlugs` (Authenticated) and `privateSlugs` (Private) are exclusive — a slug in both is refused — and an omitted one keeps the stored list less the sent list's slugs, and no price is set there; the appointments read is every role's, and an agent's only with the `people-read` grant (#10986), takes `eventTypeId` for one type's bookings (#11122 D12) and `workspaceId` when the connection reaches several workspaces (#11753), and its attendee names and emails are public-written text; the three scheduling-connection routes have no tool, by decision — and (#10218) the content-suggestion pair, `draft_page_suggestions` and `decide_page_suggestion` — and (#10336) the draft pair, `save_draft` and `read_report`, twinning `PATCH`/`GET …/content/:type/:slug` with the `content-edit` grant: `save_draft` takes the page's `content` whole as the PATCH body and its `version` as `X-Draft-Version`, writes a draft version that never goes live, and answers 409 `conflict` with `currentVersion` when the draft moved; `read_report` returns the draft tip, the version a save must send, the page's stored layout (`structure`, #10962) and the token `save_structure` must send, its open suggestions and the route's check report (`ready`, `needs repair` or `needs your words`), computed by the route and never by the tool — and (#10956) `create_page`, twinning `POST …/content` with the `content-edit` grant: it creates a page and its first draft from `content` sent whole (its `type` and `slug` are the address) — a page type laid out in sections sent no words (no body, an empty one, or only its template's headings) starts from its template (#11793): the hub lays out the template's sections, each headed by its default headline with an empty field to write under, and stores the words and the layout together, refusing a title or description the words rules refuse, or a `sections` key, 422 `invalid` — never publishes, and answers 409 `conflict` when the page exists and 409 `slug_taken` when another page holds the link — and (#11791) `save_page`, twinning `PUT …/content/:type/:slug` with the `content-edit` grant, under the common names of `docs/internal/decisions/one-way-common-names.md`: it saves a page laid out in sections — its `fields` and its `words` (its sections in order, each `{ id, type, data }`) — in one draft version that holds the body the hub builds from the words and the layout together; `address` (type, slug, locale) rides the URL, and `version` with `structureToken` is what the save was based on, both `null` for a new page; a save whose basis is no longer the tip, or `null` for a page that exists, answers 409 `stale` with `currentVersion` and `currentStructureToken`, and a wrong field or word 422 `invalid` with `issues` (`path`, `message`), the one refusal pair whose details reach the tool; it never publishes; since #11811 it also saves an editorial page, whose `words` are `{ body }`, its Markdown, carrying the stored layout forward; since #11808 (#11852) a page laid out in sections may send `workingCopy`, `{ document, settings }` — the two tabs of a working copy as exported — in place of `fields` and `words`: the hub converts it against the tip it was based on (409 `stale` before converting), keeps the stored fields a Settings table cannot carry, refuses a wrong copy 422 `invalid` at `workingCopy.settings`, `workingCopy.document` or the envelope path, and answers the page as a working copy — and (#11811) `save_document`, twinning `POST …/documents/save` with the `content-edit` grant: it saves a `Document` (Instructions, Knowledge or a plugin-owned document) in the same common shape — `address` (`type` always `Document`, slug, locale) rides the body, as `save_asset`'s does, `version` is `null` for a new document, `fields` are the page save's, and `words` is `{ body }`; a moved tip or a `null` on an existing document answers 409 `stale` with `currentVersion` alone, and a wrong field or word — a plugin contract's misfit included, each issue at its path (`fields.contract_version`, `words.body`) — 422 `invalid`, both details rebuilt in `workspace-server.ts`; a document never goes live; since #11808 it takes, at a plugin-owned contract address only, `workingCopy` (`{ document, settings }`, the two tabs of a working copy as exported) in place of `fields` and `words`, which the hub converts against the tip it was based on and answers in the same form (the record form when the copy would outgrow its bounds) — and (#11808) `open_document`, twinning `GET …/documents/open` with the `content-edit` grant: the read twin of `save_document`, its `address` in the query, answering the envelope as the record or, with `as: "working-copy"` and only at a plugin-owned address (else 422 `invalid` at the key sent), the working copy (409 `not_representable` when it would outgrow its bounds); since #11882 `open_page` and `open_document` take `as` where they took `form`, which stays the old name for one release (the catalog keeps it, so the SDK never strips it), and the route refuses the two sent with different values 422 `invalid` at `as`; it never writes, and its `invalid` keeps `issues` (`path`, `message`, each cut to 200 characters). — and (#11809) `open_language_item` and `open_asset` (`mcp-workspace`'s `language.ts` and `library.ts`), twinning `GET …/language/:kind/:slug/open` and `GET …/assets/open` under the gate of the read each parallels (`docs-read`, `assets-read`): each takes `{ workspaceId, address }` (plus `locale` for an item) and answers the thing in the common envelope with the `version` its save takes, or — nothing at the address, or nothing the caller may read there — an item's blank, `version: null` and its kind's empty words, which the save with `version: null` starts; a file is never blank (`404 not_found`); and `open_page` and `open_document` answer the same kind of blank where they answered 404 — a page its template's starting sections, headed by the slug, and a document at a plugin-owned contract address its contract's constant fields and required headings, else nothing; no open writes, and the section map lists `open_` tools as reads. While both ways live, `create_page`, `save_draft` and `save_structure` open their descriptions with a deprecation naming `save_page` or `save_document`; nothing else about them changes until the removal (#11811 D2, D6) — and (#10661) `publish_draft`, twinning `POST …/content/:type/:slug/publish` with the `content-publish` grant: it publishes the draft tip (or a named version) exactly as a person holding that permission does, an agent without the grant is refused 403 `agent_refused` before anything is read, and it never widens Audience or re-enables a doc — and (#10345) the knowledge-base pair, `read_knowledge` and `read_knowledge_doc`, twinning `GET …/knowledge-base` and `GET …/knowledge-base/:type/:slug` with no grant (`docs-read` is every role's): the docs a named member may read (`userId`, by default the agent's own person), at the lower of the agent's person's role and that member's, so naming someone only narrows; Live does not gate them and a disabled doc never appears; `filter: "workspace-memory"` answers the always-loaded set with its `totalTokens` and an 8000-token `warning` — and (#10951) `get_workspace_settings`, twin of `GET /v1/workspaces/:workspaceId/general` (`mcp-workspace`'s `workspace_settings.ts`, no grant): the workspace's name, its own logo (`null` when the organization's applies) and the deployment's deliverable sender (`null` when none is configured, so a magnet's results and completion emails do not go out); the PUT, which renames the workspace and sets its logo, has no tool, by decision — it needs `workspace-settings`, which is never agent-grantable — and (#11806) `get_workspace_overview`, twin of `GET /v1/workspaces/:workspaceId/overview` (`mcp-workspace`'s `workspace_overview.ts`, registered with `workspace` or `multi-tenant`, `gate: "tenant"`, no query): a command's starting picture in one call — the site identity's name and SEO description, the default locale, the Knowledge docs `read_knowledge` lists for the caller with each one's draft `version` where `read_report` would answer it (`content-edit`, and the caller's own role reads the doc), and the Language items by kind and the magnets by state (`draft` only with `magnets-manage`); a part the caller's grants or the site's modules do not allow is `null` or left out and named in `withheld` (`grant` or `module`), never a refusal of the read — and the six site-profile tools, `get_site_identity`, `set_site_identity`, `get_site_seo`, `set_site_seo`, `get_welcome_email` and `set_welcome_email` (`mcp-workspace`'s `site_profile.ts`), twinning `GET`/`PUT …/identity`, `…/seo` and `…/welcome-email`: any member reads; each write needs the `site-profile` grant (`ailk:site-profile`), under which every logo and every SEO field but the description — robots and indexing above all — must be sent as read, else `site_profile_field_locked`; the theme pair has no tool, by decision — and (#10733, issue 10905, #10952) the six Language tools, `list_language_items`, `get_language_item`, `save_language_item`, `set_language_item_live`, `list_language_item_pages` and `get_topic_brief`, twinning `GET …/language`, `GET`/`PUT …/language/:kind/:slug`, `POST …/language/:kind/:slug/live`, `GET …/language/:kind/:slug/appears-on` and `GET …/language/topic/:slug/brief` (`mcp-workspace`'s `language.ts`): a workspace's glossary terms, FAQs and topics; reading needs no grant, saving the `content-edit` grant (`version: null` creates, a tip id updates, 409 `slug_taken` / `stale` otherwise), the Live switch `content-publish` with the `version` the person reviewed — `live: false` is how an agent takes an item off the site; the `DELETE` has no tool, by decision (#11802): it is permanent (nothing restores the item and its slug stays taken), so a person deletes in the Admin and the route refuses every agent `agent_refused`; tags are the hub's and never written by a tool; a topic is a keyword cluster for agents and is never shown to visitors, and `get_topic_brief` reads it as a writing brief — its kept rows scored best bets first, from the Live version when Live; the Topic's Keyword Planner import and the value-thresholds pair are a person's and have no tool, by decision — and (#10948) the three magnet tools, `list_magnets`, `get_magnet` and `save_magnet`, twinning `GET …/magnets`, `GET …/magnets/:id` and (#11810) `POST …/magnets/save` (`mcp-workspace`'s `magnets.ts`, registered with `multi-tenant` or `signal-collectors`): with the `magnets-manage` grant every magnet in full, without it only live ones as `{ id, slug, kind, title, landingPage, tags }`; `save_magnet` takes the save body whole, the magnet's `id` in it, so going live is `status: "live"` and the route alone refuses it (`402 plan_required`, `409 conversion_needs_email`), and an agent cannot set or change what a magnet charges (`403 magnet_pricing_needs_person`); with no `id` and `version: null` it creates a draft magnet — a slug another magnet holds is `409 stale` with its `currentVersion`, a slug the site reads by name `409 slug_reserved`, and the plan check is the Admin create's; the Admin's PATCH and create (which refuses every agent `403 agent_refused`) and the four captured-people lists have no tool, by decision — and (#10949) `get_workspace_offerings`, twin of `GET /v1/workspaces/:workspaceId/offerings` (registered with `multi-tenant` alone, its route's module; `mcp-workspace`'s `offerings.ts`): the Offerings tab's view — unavailable with `no_commerce` or `no_connection`, or the Organization's enabled products with this workspace's shown Prices and Recommended — read with no grant; its PUT, which switches a Price on or off, needs `workspace-settings`, which is never agent-grantable, and has no tool, by decision — and the two library reads, `list_workspace_pages` and `list_assets` (`mcp-workspace`'s `library.ts`, registered with `workspace` or `multi-tenant`), twinning `GET …/library/pages` and `GET …/library/assets`: every page with drafts included and its status (`live`, `draft`, or `disabled` — a person editor's alone), needing the `content-edit` grant, and the asset library read-only with each file's whole record (#11801) — its public path, title, description and record version, its size, an image's pixel size as the Admin's Details panel shows it, and its audience — for every role; both filter, page and name the workspace `{ id, name }` they read, and uploading has no tool — and (#11803) `save_asset` (`library.ts`, `gate: { allows: "assets-write" }`), twinning `POST …/assets/save`: it saves a file's title and description — and (#11879) its type, `fields.type`, one of the ten asset types — by its key, based on the record version `list_assets` returned; a stale save is `409 stale` and its tool error carries `details.currentVersion`, a wrong argument `422 invalid` with `details.issues` (`{ path, message }`, at most twenty, each cut to 200 characters, rebuilt in `workspace-server.ts`); it never replaces, renames, re-privacies or deletes a file, and never reaches a private, Knowledge or disabled one — and (#11680) the two site-vocabulary reads, `list_page_types` and `get_tag_vocabulary` (`mcp-workspace`'s `site_vocabulary.ts`, registered with `workspace` or `multi-tenant`, `gate: "tenant"` — any tenant of the workspace, no grant), twinning `GET …/page-types` and `GET …/tag-vocabulary`: the page types this hub's site can serve (the registry filtered by the modules the hub runs), each with its address, whether a site has only one, its template and that template's headings, and the context classes, Knowledge topic tags and status tags, each with what it means and who may set it; both are platform data and read no row; and (#11790) the third, `list_section_types` (same file, registration and gate), twinning `GET …/section-types` with an optional `type`: every section type a page's layout can hold with every field of its data — words or data, the Markdown form, whether it is required and inside which optional field, its values and bounds — plus its bounded lists and rules, or that one section type's; platform data, read no row; and (#11805) the fourth, `list_kinds` (same file, registration and gate), twinning `GET …/kinds`: every kind of thing the Admin holds — page, document, language_item, magnet, asset — with how to address one, its fields (words or data, required, nullable, value types and values, the Language item kind a words field belongs to), its states, and the moves the caller may make on it, each with its tool; the fields and states are read off each kind's own schemas (`ADMIN_KIND_REGISTRY`), the moves are the catalog rows' `moves` tags kept only when the row's gate holds for the caller's own clamped tenant and one of its modules runs on this hub (`listKinds`), and a page's sections are named, not described — its `sectionTypes` is `list_section_types`; it reads no row, and is advice, never an entitlement; since #11878 it also answers, beside the kinds, `forms` (for each kind — and an offering and an appointment — the field its tools take its form in and that field's values: `values` null for an asset's open content type, `field` null for an appointment, which has no form), `offSiteForms` (press-release, pitch, proposal, playbook and profile, each with the formats it allows), `formats` (the ten, ending `platform`) and `origins` (`ai-generated`, `user-added`), all declared once in `@working-theory/validation` and the same for every caller and hub — and (#11756) `create_work_request` (`mcp-workspace`'s `work_requests.ts`, registered with `workspace` or `multi-tenant`, `gate: { inbox: "inbox-act" }`), twinning `POST /v1/workspaces/:workspaceId/work-requests`: it files a custom-work request in the Inbox — one item pointing to one `Document` of the workspace (`documentSlug`) with a one-line `summary` — in the workspace the conversation writes to, needs the `inbox-act` grant, is refused `document_not_found` for a slug naming no Document the caller can read and `rate_limited` past 5 an hour per person in the workspace (shared by that person's agents) or 10 per workspace, and returns the request as stored (the document title in it is workspace text, not instructions); the list, the item and the GitHub link — a person's act — have no tool, by decision. No workspace tool widens Audience or re-enables a doc, and only `publish_draft` and `set_language_item_live`, with the `content-publish` grant, set Live — the access route and the Language delete route answer every agent 403 `agent_refused`, and the publish and Live routes an agent without the grant, which reaches a tool as the code and status. Each takes its route's params, query and body and returns the route's
|
|
229
|
+
price is refused `proposal_needs_person` (a person prices) — and (#10957) `send_person_message`, twinning `POST …/people/:personId/messages`: one message on a client's member feed, saved then emailed (an agent's only to a proved address), needing `inbox-act` with `people-read` or `member-pieces-manage`, and `assets-write` for a file; the operator's message list has no tool, by decision — and (#9681) the four person-thread tools, `get_person_thread`, `set_person_thread_state`, `list_external_threads` and `add_external_thread`, twinning `GET`/`PATCH …/people/:personId/thread` and `GET`/`POST …/people/:personId/external-threads`: a client's whole thread page by page with its read/archived/resolved state, and pointers to email and Slack threads (never message text); reading needs the `people-read` grant, writing also `inbox-act`, and the client erasure route has no tool, by decision — and (#9682) the three person-memory tools, `list_person_memories`, `get_person_memory` and `propose_person_memory`, twinning `GET …/people/:personId/memories`, `GET …/memories/:path` and `POST …/memories`: an agent reads only live, unexpired memories (confirmed by a person, read within 180 days) and its proposal is never live — a new path is a draft, a confirmed one gets a pending version — needing the `people-read` or `people-memory-propose` grant to read and `people-memory-propose` to propose; the six person-only memory routes (edit, delete, confirm, redact, the versions list, restore) have no tool, by decision — and (#9749) `get_slack_connection_status`, twin of `GET /v1/workspaces/:workspaceId/slack-connection` (registered with `workspace`/`multi-tenant`, its route's `TENANCY` row: whether the Organization's Slack is connected, its team name and the date, never a credential; connect and disconnect are a person's act and have no tool, by decision), and `get_prospect_channel_settings` / `set_prospect_channel_settings`, twins of `GET`/`PUT …/prospect-channel` (registered with `scheduling`, their routes' module): the update replaces every field, needs the `meeting-types-manage` grant, is refused `slack_not_connected` while the Organization has no Slack connection, and an agent may change only `enabled`, `channelPrefix` and `archiveDays` — a change to `memberIds` or `welcomeTemplate` is refused `prospect_channel_needs_person` — and (#10950) the three meeting tools, `list_meeting_types`, `save_meeting_types` and `list_appointments`, twinning `GET`/`PUT …/meetings` and `GET /v1/schedule/appointments` (registered with `scheduling`): the meeting types from the connected calendar, each with whether it is Live (`enabled`) and who can book it (`visibility`: `public`, `private` or `authenticated`), the provider's `providerEventTypeId` and `createdAt` when it serves them, and, with the `meeting-types-manage` grant, `providerEditUrl` — the read takes no `include` (#11122 D4); the save needs that grant and its required `enabledSlugs` replaces the Live list, while `customerSlugs` (Authenticated) and `privateSlugs` (Private) are exclusive — a slug in both is refused — and an omitted one keeps the stored list less the sent list's slugs, and no price is set there; the appointments read is every role's, and an agent's only with the `people-read` grant (#10986), takes `eventTypeId` for one type's bookings (#11122 D12) and `workspaceId` when the connection reaches several workspaces (#11753), and its attendee names and emails are public-written text; the three scheduling-connection routes have no tool, by decision — and (#10218) the content-suggestion pair, `draft_page_suggestions` and `decide_page_suggestion` — and (#10336) the draft pair, `save_draft` and `read_report`, twinning `PATCH`/`GET …/content/:type/:slug` with the `content-edit` grant: `save_draft` takes the page's `content` whole as the PATCH body and its `version` as `X-Draft-Version`, writes a draft version that never goes live, and answers 409 `conflict` with `currentVersion` when the draft moved; `read_report` returns the draft tip, the version a save must send, the page's stored layout (`structure`, #10962) and the token `save_structure` must send, its open suggestions and the route's check report (`ready`, `needs repair` or `needs your words`), computed by the route and never by the tool — and (#10956) `create_page`, twinning `POST …/content` with the `content-edit` grant: it creates a page and its first draft from `content` sent whole (its `type` and `slug` are the address) — a page type laid out in sections sent no words (no body, an empty one, or only its template's headings) starts from its template (#11793): the hub lays out the template's sections, each headed by its default headline with an empty field to write under, and stores the words and the layout together, refusing a title or description the words rules refuse, or a `sections` key, 422 `invalid` — never publishes, and answers 409 `conflict` when the page exists and 409 `slug_taken` when another page holds the link — and (#11791) `save_page`, twinning `PUT …/content/:type/:slug` with the `content-edit` grant, under the common names of `docs/internal/decisions/one-way-common-names.md`: it saves a page laid out in sections — its `fields` and its `words` (its sections in order, each `{ id, type, data }`) — in one draft version that holds the body the hub builds from the words and the layout together; `address` (type, slug, locale) rides the URL, and `version` with `structureToken` is what the save was based on, both `null` for a new page; a save whose basis is no longer the tip, or `null` for a page that exists, answers 409 `stale` with `currentVersion` and `currentStructureToken`, and a wrong field or word 422 `invalid` with `issues` (`path`, `message`), the one refusal pair whose details reach the tool; it never publishes; since #11811 it also saves an editorial page, whose `words` are `{ body }`, its Markdown, carrying the stored layout forward; since #11808 (#11852) a page laid out in sections may send `workingCopy`, `{ document, settings }` — the two tabs of a working copy as exported — in place of `fields` and `words`: the hub converts it against the tip it was based on (409 `stale` before converting), keeps the stored fields a Settings table cannot carry, refuses a wrong copy 422 `invalid` at `workingCopy.settings`, `workingCopy.document` or the envelope path, and answers the page as a working copy — and (#11811) `save_document`, twinning `POST …/documents/save` with the `content-edit` grant: it saves a `Document` (Instructions, Knowledge or a plugin-owned document) in the same common shape — `address` (`type` always `Document`, slug, locale) rides the body, as `save_asset`'s does, `version` is `null` for a new document, `fields` are the page save's, and `words` is `{ body }`; a moved tip or a `null` on an existing document answers 409 `stale` with `currentVersion` alone, and a wrong field or word — a plugin contract's misfit included, each issue at its path (`fields.contract_version`, `words.body`) — 422 `invalid`, both details rebuilt in `workspace-server.ts`; a document never goes live; since #11808 it takes, at a plugin-owned contract address only, `workingCopy` (`{ document, settings }`, the two tabs of a working copy as exported) in place of `fields` and `words`, which the hub converts against the tip it was based on and answers in the same form (the record form when the copy would outgrow its bounds) — and (#11808) `open_document`, twinning `GET …/documents/open` with the `content-edit` grant: the read twin of `save_document`, its `address` in the query, answering the envelope as the record or, with `as: "working-copy"` and only at a plugin-owned address (else 422 `invalid` at the key sent), the working copy (409 `not_representable` when it would outgrow its bounds); since #11882 `open_page` and `open_document` take `as` where they took `form`, which stays the old name for one release (the catalog keeps it, so the SDK never strips it), and the route refuses the two sent with different values 422 `invalid` at `as`; it never writes, and its `invalid` keeps `issues` (`path`, `message`, each cut to 200 characters). — and (#11809) `open_language_item` and `open_asset` (`mcp-workspace`'s `language.ts` and `library.ts`), twinning `GET …/language/:kind/:slug/open` and `GET …/assets/open` under the gate of the read each parallels (`docs-read`, `assets-read`): each takes `{ workspaceId, address }` (plus `locale` for an item) and answers the thing in the common envelope with the `version` its save takes, or — nothing at the address, or nothing the caller may read there — an item's blank, `version: null` and its kind's empty words, which the save with `version: null` starts; a file is never blank (`404 not_found`); and `open_page` and `open_document` answer the same kind of blank where they answered 404 — a page its template's starting sections, headed by the slug, and a document at a plugin-owned contract address its contract's constant fields and required headings, else nothing; no open writes, and the section map lists `open_` tools as reads. While both ways live, `create_page`, `save_draft` and `save_structure` open their descriptions with a deprecation naming `save_page` or `save_document`; nothing else about them changes until the removal (#11811 D2, D6) — and (#10661) `publish_draft`, twinning `POST …/content/:type/:slug/publish` with the `content-publish` grant: it publishes the draft tip (or a named version) exactly as a person holding that permission does, an agent without the grant is refused 403 `agent_refused` before anything is read, and it never widens Audience or re-enables a doc — and (#10345) the knowledge-base pair, `read_knowledge` and `read_knowledge_doc`, twinning `GET …/knowledge-base` and `GET …/knowledge-base/:type/:slug` with no grant (`docs-read` is every role's): the docs a named member may read (`userId`, by default the agent's own person), at the lower of the agent's person's role and that member's, so naming someone only narrows; Live does not gate them and a disabled doc never appears; `filter: "workspace-memory"` answers the always-loaded set with its `totalTokens` and an 8000-token `warning` — and (#10951) `get_workspace_settings`, twin of `GET /v1/workspaces/:workspaceId/general` (`mcp-workspace`'s `workspace_settings.ts`, no grant): the workspace's name, its own logo (`null` when the organization's applies) and the deployment's deliverable sender (`null` when none is configured, so a magnet's results and completion emails do not go out); the PUT, which renames the workspace and sets its logo, has no tool, by decision — it needs `workspace-settings`, which is never agent-grantable — and (#11806) `get_workspace_overview`, twin of `GET /v1/workspaces/:workspaceId/overview` (`mcp-workspace`'s `workspace_overview.ts`, registered with `workspace` or `multi-tenant`, `gate: "tenant"`, no query): a command's starting picture in one call — the site identity's name and SEO description, the default locale, the Knowledge docs `read_knowledge` lists for the caller with each one's draft `version` where `read_report` would answer it (`content-edit`, and the caller's own role reads the doc), and the Language items by kind and the magnets by state (`draft` only with `magnets-manage`); a part the caller's grants or the site's modules do not allow is `null` or left out and named in `withheld` (`grant` or `module`), never a refusal of the read — and (#12015) `get_command_craft`, twin of `GET /v1/workspaces/:workspaceId/craft/:command` (`mcp-workspace`'s `command_craft.ts`, registered with `workspace` or `multi-tenant`, `gate: "tenant"`): one command's craft for the session, `{ command, pack, minShellVersion, craft }`, served only to a workspace that has the command's pack; a `pack_required` refusal carries `details` rebuilt from `pack`, `name` and `where` alone, and a `craft_unavailable` carries `service` alone (`entitlements`, `delivery` or `null`) — and the six site-profile tools, `get_site_identity`, `set_site_identity`, `get_site_seo`, `set_site_seo`, `get_welcome_email` and `set_welcome_email` (`mcp-workspace`'s `site_profile.ts`), twinning `GET`/`PUT …/identity`, `…/seo` and `…/welcome-email`: any member reads; each write needs the `site-profile` grant (`ailk:site-profile`), under which every logo and every SEO field but the description — robots and indexing above all — must be sent as read, else `site_profile_field_locked`; the theme pair has no tool, by decision — and (#10733, issue 10905, #10952) the six Language tools, `list_language_items`, `get_language_item`, `save_language_item`, `set_language_item_live`, `list_language_item_pages` and `get_topic_brief`, twinning `GET …/language`, `GET`/`PUT …/language/:kind/:slug`, `POST …/language/:kind/:slug/live`, `GET …/language/:kind/:slug/appears-on` and `GET …/language/topic/:slug/brief` (`mcp-workspace`'s `language.ts`): a workspace's glossary terms, FAQs and topics; reading needs no grant, saving the `content-edit` grant (`version: null` creates, a tip id updates, 409 `slug_taken` / `stale` otherwise), the Live switch `content-publish` with the `version` the person reviewed — `live: false` is how an agent takes an item off the site; the `DELETE` has no tool, by decision (#11802): it is permanent (nothing restores the item and its slug stays taken), so a person deletes in the Admin and the route refuses every agent `agent_refused`; tags are the hub's and never written by a tool; a topic is a keyword cluster for agents and is never shown to visitors, and `get_topic_brief` reads it as a writing brief — its kept rows scored best bets first, from the Live version when Live; the Topic's Keyword Planner import and the value-thresholds pair are a person's and have no tool, by decision — and (#10948) the three magnet tools, `list_magnets`, `get_magnet` and `save_magnet`, twinning `GET …/magnets`, `GET …/magnets/:id` and (#11810) `POST …/magnets/save` (`mcp-workspace`'s `magnets.ts`, registered with `multi-tenant` or `signal-collectors`): with the `magnets-manage` grant every magnet in full, without it only live ones as `{ id, slug, kind, title, landingPage, tags }`; `save_magnet` takes the save body whole, the magnet's `id` in it, so going live is `status: "live"` and the route alone refuses it (`402 plan_required`, `409 conversion_needs_email`), and an agent cannot set or change what a magnet charges (`403 magnet_pricing_needs_person`); with no `id` and `version: null` it creates a draft magnet — a slug another magnet holds is `409 stale` with its `currentVersion`, a slug the site reads by name `409 slug_reserved`, and the plan check is the Admin create's; the Admin's PATCH and create (which refuses every agent `403 agent_refused`) and the four captured-people lists have no tool, by decision — and (#10949) `get_workspace_offerings`, twin of `GET /v1/workspaces/:workspaceId/offerings` (registered with `multi-tenant` alone, its route's module; `mcp-workspace`'s `offerings.ts`): the Offerings tab's view — unavailable with `no_commerce` or `no_connection`, or the Organization's enabled products with this workspace's shown Prices and Recommended — read with no grant; its PUT, which switches a Price on or off, needs `workspace-settings`, which is never agent-grantable, and has no tool, by decision — and the two library reads, `list_workspace_pages` and `list_assets` (`mcp-workspace`'s `library.ts`, registered with `workspace` or `multi-tenant`), twinning `GET …/library/pages` and `GET …/library/assets`: every page with drafts included and its status (`live`, `draft`, or `disabled` — a person editor's alone), needing the `content-edit` grant, and the asset library read-only with each file's whole record (#11801) — its public path, title, description and record version, its size, an image's pixel size as the Admin's Details panel shows it, and its audience — for every role; both filter, page and name the workspace `{ id, name }` they read, and uploading has no tool — and (#11803) `save_asset` (`library.ts`, `gate: { allows: "assets-write" }`), twinning `POST …/assets/save`: it saves a file's title and description — and (#11879) its type, `fields.type`, one of the ten asset types — by its key, based on the record version `list_assets` returned; a stale save is `409 stale` and its tool error carries `details.currentVersion`, a wrong argument `422 invalid` with `details.issues` (`{ path, message }`, at most twenty, each cut to 200 characters, rebuilt in `workspace-server.ts`); it never replaces, renames, re-privacies or deletes a file, and never reaches a private, Knowledge or disabled one — and (#11680) the two site-vocabulary reads, `list_page_types` and `get_tag_vocabulary` (`mcp-workspace`'s `site_vocabulary.ts`, registered with `workspace` or `multi-tenant`, `gate: "tenant"` — any tenant of the workspace, no grant), twinning `GET …/page-types` and `GET …/tag-vocabulary`: the page types this hub's site can serve (the registry filtered by the modules the hub runs), each with its address, whether a site has only one, its template and that template's headings, and the context classes, Knowledge topic tags and status tags, each with what it means and who may set it; both are platform data and read no row; and (#11790) the third, `list_section_types` (same file, registration and gate), twinning `GET …/section-types` with an optional `type`: every section type a page's layout can hold with every field of its data — words or data, the Markdown form, whether it is required and inside which optional field, its values and bounds — plus its bounded lists and rules, or that one section type's; platform data, read no row; and (#11805) the fourth, `list_kinds` (same file, registration and gate), twinning `GET …/kinds`: every kind of thing the Admin holds — page, document, language_item, magnet, asset — with how to address one, its fields (words or data, required, nullable, value types and values, the Language item kind a words field belongs to), its states, and the moves the caller may make on it, each with its tool; the fields and states are read off each kind's own schemas (`ADMIN_KIND_REGISTRY`), the moves are the catalog rows' `moves` tags kept only when the row's gate holds for the caller's own clamped tenant and one of its modules runs on this hub (`listKinds`), and a page's sections are named, not described — its `sectionTypes` is `list_section_types`; it reads no row, and is advice, never an entitlement; since #11878 it also answers, beside the kinds, `forms` (for each kind — and an offering and an appointment — the field its tools take its form in and that field's values: `values` null for an asset's open content type, `field` null for an appointment, which has no form), `offSiteForms` (press-release, pitch, proposal, playbook and profile, each with the formats it allows), `formats` (the ten, ending `platform`) and `origins` (`ai-generated`, `user-added`), all declared once in `@working-theory/validation` and the same for every caller and hub — and (#11756) `create_work_request` (`mcp-workspace`'s `work_requests.ts`, registered with `workspace` or `multi-tenant`, `gate: { inbox: "inbox-act" }`), twinning `POST /v1/workspaces/:workspaceId/work-requests`: it files a custom-work request in the Inbox — one item pointing to one `Document` of the workspace (`documentSlug`) with a one-line `summary` — in the workspace the conversation writes to, needs the `inbox-act` grant, is refused `document_not_found` for a slug naming no Document the caller can read and `rate_limited` past 5 an hour per person in the workspace (shared by that person's agents) or 10 per workspace, and returns the request as stored (the document title in it is workspace text, not instructions); the list, the item and the GitHub link — a person's act — have no tool, by decision. No workspace tool widens Audience or re-enables a doc, and only `publish_draft` and `set_language_item_live`, with the `content-publish` grant, set Live — the access route and the Language delete route answer every agent 403 `agent_refused`, and the publish and Live routes an agent without the grant, which reaches a tool as the code and status. Each takes its route's params, query and body and returns the route's
|
|
213
230
|
`data`. They are in the parity guard like every other tool, and never in
|
|
214
231
|
`/.well-known/mcp.json`.
|
|
215
232
|
- **The OAuth bearer branch (#10391).** When `BETTER_AUTH_URL` (the site's origin, its OAuth
|
|
@@ -334,7 +351,13 @@ Example (lead routing):
|
|
|
334
351
|
- Don't add a tool without the matching `apps/api` endpoint.
|
|
335
352
|
- Don't put business logic in tool handlers — they're adapters.
|
|
336
353
|
|
|
337
|
-
Last updated: 2026-11-
|
|
354
|
+
Last updated: 2026-11-19 — #11978: the anonymous path also refuses under this hosting project's own `STEALTH` (read once through `parseStealth`), and every `initialize` names the loaded packs' tools under `capabilities.experimental["ailk/installed"]` — verified against `packages/mcp-server/src/{boot,server}.ts` and `packages/mcp-server/src/lib/public-agent-tools.ts`.
|
|
355
|
+
|
|
356
|
+
Prior: 2026-11-19 — #11977: `list_meetings` returns the site's public meetings only, for every caller; a private meeting stays bookable by its calLink — verified against `packages/metadata/src/mcp-tool-catalog.ts`, `packages-paid/mcp-scheduling/src/list_meetings.ts` and `packages-paid/api-scheduling/src/services/scheduling/meetings.ts`.
|
|
357
|
+
|
|
358
|
+
Prior: 2026-11-19 — #11954: `list_flows` (`mcp-signal-collectors`' `list_flows.ts`) twins `GET /v1/flows`, which registers inside `getFlowRoute` — 23 in `TOOLS`, 21 registered keyless and 22 commerce-claimed while Free is held, eight `tier: "pro"`; the nine visitor tools' descriptions say when to use each and what comes next — verified against `packages/metadata/src/mcp-tool-catalog.ts`, `packages-paid/mcp-signal-collectors/src/index.ts`, `packages-paid/api-signal-collectors/src/routes/flows/index.ts` and `tests/parity/api-parity/kinds/site.ts`.
|
|
359
|
+
|
|
360
|
+
Prior: 2026-11-18 — #11909: `list_kinds` and `GET /v1/workspaces/:workspaceId/kinds` answer ten formats, the tenth `platform`, and five off-site forms, the fifth `profile` (`platform` only), with `proposal` also allowing `platform`; only the two constants change, and the pair stays a twin — verified against `packages/validation/src/contract/admin-kinds.ts`, `packages/metadata/src/mcp-tool-catalog.ts` and `tests/parity/api-parity/fixtures/site-wire.ts`.
|
|
338
361
|
|
|
339
362
|
Prior: 2026-11-17 — #11882: `open_page` and `open_document` take `as` (`record` or `working-copy`), with `form` its old name for one release; the route refuses the two when they disagree, and the pair stays a twin — verified against `packages/metadata/src/mcp-tool-catalog.ts`, `packages-paid/mcp-workspace/src/content_draft.ts` and `tests/parity/api-parity/kinds/site.ts`.
|
|
340
363
|
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* MCP_ABUSE_START_PURCHASE_DAILY_CAP=20
|
|
18
18
|
* MCP_ABUSE_CREATE_BOOKING_DAILY_CAP=20
|
|
19
19
|
* MCP_ABUSE_SUBMIT_FLOW_STEP_DAILY_CAP=50
|
|
20
|
-
* MCP_ABUSE_BLOCKED_USER_AGENTS= (comma-separated substrings)
|
|
20
|
+
* MCP_ABUSE_BLOCKED_USER_AGENTS= (comma-separated substrings; write tools only)
|
|
21
21
|
*
|
|
22
22
|
* Content adapter (all optional; `CONTENT_ADAPTER` default: mdx):
|
|
23
23
|
* CONTENT_ADAPTER=mdx|projection|database
|
|
@@ -315,7 +315,7 @@ CONTENT_ADAPTER=mdx
|
|
|
315
315
|
# =============================================================================
|
|
316
316
|
# No variable here. /meet, /private and /meet/<slug> read every meeting fact
|
|
317
317
|
# — which meetings are Live, public or private, their titles, lengths and
|
|
318
|
-
# Cal.com links — from apps/api's GET /v1/schedule/
|
|
318
|
+
# Cal.com links — from apps/api's GET /v1/schedule/meeting-pages, which resolves
|
|
319
319
|
# the workspace from this site (the site alias keyless, a spoke by its key)
|
|
320
320
|
# and composes each Cal.com link from that workspace's own account. The
|
|
321
321
|
# one-meeting "<owner>/<event-slug>" variable this block used to set is
|
|
@@ -462,8 +462,10 @@ Cal.com edit and the page.
|
|
|
462
462
|
`i18n/request.ts` through `lib/paid-sections.generated.ts`'s
|
|
463
463
|
`loadUiScheduling()`; `messages/en.json` keeps `schedule.bookLength` (the
|
|
464
464
|
flows results layout's key) and a site key there is an override.
|
|
465
|
-
- **One builder.** `meetings.tsx` reads `GET /v1/schedule/
|
|
466
|
-
through `schedule.
|
|
465
|
+
- **One builder.** `meetings.tsx` reads `GET /v1/schedule/meeting-pages`
|
|
466
|
+
through `schedule.meetingPages()` (#11977 D3: the booking pages' read, its
|
|
467
|
+
private meetings included; `GET /v1/schedule/meetings` is the public list
|
|
468
|
+
an agent gets), re-parses the body with `MeetingListSchema`
|
|
467
469
|
and shares the result per server instance for 15 seconds (concurrent and
|
|
468
470
|
failed reads too, the contact page's #8731 shape). Any failure is
|
|
469
471
|
`{ ok: false }`. It builds the index cards (`meetingCardsSection`: `items`
|
|
@@ -620,11 +622,34 @@ key), so the page names none. It renders one of three pages:
|
|
|
620
622
|
fragment and an add-ons fragment. The first `pricing` section that is not
|
|
621
623
|
`addons` becomes the Stripe plans, and the first `addons` one the Stripe
|
|
622
624
|
add-ons, each keeping only its authored section copy (eyebrow, headline,
|
|
623
|
-
description and layout knobs
|
|
624
|
-
|
|
625
|
-
|
|
625
|
+
description and layout knobs, its `cardLayout` included over the mapper's
|
|
626
|
+
centred default), never an authored plan or price. A `pricing` section may
|
|
627
|
+
list its own Stripe plans as `offeringPlans` (#12103 D2): each such section
|
|
628
|
+
shows exactly those plans' cards, with its own toggle and pill, and is
|
|
629
|
+
removed only when none of them is shown; the first unlisted plans section
|
|
630
|
+
shows the page's `plans` less every listed one, and on a page whose plans
|
|
631
|
+
sections are all listed the leftover plans get no inserted section. Every
|
|
632
|
+
other `pricing` section is removed; a fragment with no section to replace
|
|
633
|
+
goes after a leading hero. `?plan=` moves the recommendation only for a
|
|
626
634
|
`{plan}`-grammar value (`LOOKUP_KEY_PLAN_PATTERN`), so `?plan=Growth` keeps
|
|
627
|
-
the workspace's own
|
|
635
|
+
the workspace's own, and each section applies it to its own cards. The
|
|
636
|
+
workspace's own Recommended plan and add-on — the pill with no `?plan=` —
|
|
637
|
+
are set and cleared by an owner or admin from the Admin's Offerings page (a
|
|
638
|
+
Live row's status menu, `PUT /v1/workspaces/:workspaceId/offerings`'s
|
|
639
|
+
Recommended body). Two Stripe Product metadata keys are the seller's own
|
|
640
|
+
card text, shown as written: `ailk_cta`, a plan's or add-on's button label
|
|
641
|
+
(absent → the translated `cta`), and `ailk_eyebrow`, an add-on tile's
|
|
642
|
+
eyebrow (the recommended add-on keeps the Recommended label); an add-on's
|
|
643
|
+
`ailk_note` is its tile's note line, as a plan's is its `priceSubhead`. Copy
|
|
644
|
+
comes from the `pricingOfferings` namespace.
|
|
645
|
+
- **Rollout of the two keys (#12103 D8).** A site's strict shown-set readers
|
|
646
|
+
refuse a product carrying `ctaLabel` or `eyebrow` until they take this
|
|
647
|
+
release, and such a site then shows the contact email in place of its
|
|
648
|
+
Stripe cards. A seller sets `ailk_cta` or `ailk_eyebrow` on a Product only
|
|
649
|
+
after every site reading that workspace's shown set has updated. Rolling the
|
|
650
|
+
hub back past this release after a snapshot with either key was written
|
|
651
|
+
reads that snapshot as empty until the bounded refresh rewrites it, within
|
|
652
|
+
about a minute of the first read.
|
|
628
653
|
- **Anything else** — an expired or empty shown set, `empty`, a non-2xx, an
|
|
629
654
|
unknown body or a throw: every `pricing` section gives way to one
|
|
630
655
|
`contact-form` section holding `ContactFallback` with the site's contact
|
|
@@ -786,23 +811,25 @@ A list page whose frontmatter sets `navOnly: true` (valid on a registry list typ
|
|
|
786
811
|
- **Not honoured.** The docs-blog module's Fumadocs `/blog` and `/docs`; `DownloadsList` (`/downloads` is a routes-map redirect to `/reports`); `LocationsList` (no route). `/sitemap.xml` and `/llms.txt` still list a Nav-only list's URL.
|
|
787
812
|
- **The nav is untouched.** `lib/nav-config.ts` is generated from route surfaces, not from list pages, so the heading and its children stay in the menu.
|
|
788
813
|
|
|
789
|
-
##
|
|
814
|
+
## Site visibility
|
|
790
815
|
|
|
791
|
-
**One switch
|
|
816
|
+
**One switch, Live or Hidden, decides whether the site can be found (#10510, #11978).** The Admin's MCP tab writes the workspace's `discoverable` setting (`true` or no row is Live, `false` is Hidden); this app reads it through `siteDiscoverable()` from `@working-theory/api-client` (`GET /v1/content/discovery`, the workspace the API resolves for this site's key), shared per server instance for 15 seconds, the last answer on a failed read and on when there is none — it never rejects. `STEALTH` on this hosting project is a lock over it: Hidden whatever the switch says.
|
|
792
817
|
|
|
793
|
-
- **The
|
|
794
|
-
- **
|
|
795
|
-
- **
|
|
796
|
-
-
|
|
818
|
+
- **The one rule.** `lib/site-visibility.ts`: `siteLock()` is `"hosting"` when `parseStealth(process.env["STEALTH"])` is true; `siteHidden()` is the lock or the switch off, with no hub read under the lock; `HIDDEN_ROBOTS_HEADER` is STEALTH's own `noindex, nofollow, noarchive`. The middleware, the locale layout, mcp.json, openapi.json and `/api/site-status` read it there, so what the surfaces do and what the status route reports cannot disagree. Edge-safe: no `node:` import.
|
|
819
|
+
- **Every response and page.** While Hidden, `middleware.ts` stamps `X-Robots-Tag: noindex, nofollow, noarchive` on whatever every branch returns (one `siteHidden()` await per request), and the locale layout answers `noindex, nofollow` on every page that sets no robots of its own (`STEALTH`'s robots still win). Paths the matcher skips (`_next/*`, files with a dot) carry the header only under STEALTH's `next.config.mjs` rule; under the switch robots.txt's `Disallow: /` covers them.
|
|
820
|
+
- **The discovery files.** `robots.txt`, `sitemap.xml`, `llms.txt` (both copies — the docs + blog module's `lib/slices/docs-blog/llms-route.ts` too), `.well-known/mcp.json` and `openapi.json` are `force-dynamic` and read it once per request, after the checks each already makes and before any other work. `createSitemapHandler` and `createLlmsHandler` take a `discoverable` dep (default `siteLive`, `!siteHidden()`); every test caller passes one or mocks the reader, so no suite reads a hub. **Live** is today, byte for byte. **Hidden**: robots.txt answers `User-agent: *` / `Disallow: /` with no Sitemap line; the other four answer 404 with no body (mcp.json keeps its CORS headers; its `OPTIONS` is unchanged). Every hidden answer is `cache-control: no-store`, so a crawler asks again. With no public page (`PUBLIC_PAGES` false), robots.txt answers its disallow-all and makes no read, and sitemap.xml and llms.txt 404 before any read. Under `STEALTH`, robots.txt answers its disallow-all and the other four answer 404 with no hub read (`siteHidden()`).
|
|
821
|
+
- **`/.well-known/ai-plugin.json` is gone** (#11978 D9): the retired ChatGPT-plugin manifest; no current client reads it. `openapi.json` stays at its conventional path.
|
|
822
|
+
- **The status route.** `GET /api/site-status` (`app/api/site-status/route.ts`) answers `siteStatusSchema` (`@working-theory/validation`), bare: `visibility`, `lock`, `publicPages` and `mcp` — what this site's MCP server (`MCP_PUBLIC_HTTP_URL`) answered its own `initialize` through `readMcpServer` (`lib/mcp-served-tools.ts`, shared per URL for 60 s): `answering` with its tool names and the installed names its `initialize` reports (`capabilities.experimental["ailk/installed"]`), `refused` (404), `unreachable`, or `none`. No input, no cookie, `no-store`, always noindex. The Admin reads it to show the lock, judge its status line and fill the What agents can do card's Installed column.
|
|
823
|
+
- **Not access control.** Hidden is a preference about discovery: pages still answer people with the link. `STEALTH` remains the hard, deploy-time hide; the MCP server reads its own hosting project's `STEALTH` (`apps/mcp/CLAUDE.md`).
|
|
797
824
|
|
|
798
825
|
## A hub-connected site's identity
|
|
799
826
|
|
|
800
|
-
**A site connected to its hub reads its name, description, legal name, contact
|
|
827
|
+
**A site connected to its hub reads its name, description, legal name, contact and sameAs from the hub (#11456).** Hub-connected means a spoke key on the wire (`sendsSpokeKey()`), whatever the content adapter — a site serving file content with a key reads the hub too (#11515); `lib/hub-site-config.ts`'s `readHubSite()` then reads `GET /v1/content/site-config` through `siteConfig.get()` — the key's own workspace's identity and seo rows, 401 to any other caller — cached by `unstable_cache` under `siteConfigTag()` for at most 300 s. A site with no spoke key makes no call and renders from `_site.mdx` exactly as before.
|
|
801
828
|
|
|
802
|
-
- **Who reads it.** `resolveSiteBrand()` (`lib/site-brand.tsx`) gives the locale layout's title, description, og/twitter copy, Nav/Footer `siteName` and copyright holder, and both llms.txt headings; `lib/site-identity.ts` registers a JSON-LD reader (`setSiteIdentityReader`) whose registration keeps the file's `baseUrl`, so no hub value moves an `@id`; the contact email and the closing footer's contact lines read the value the last read resolved (`heldHubSite()`), because their seam is synchronous. `SITE_NAME`'s other readers (og image, icons, auth, mcp.json
|
|
829
|
+
- **Who reads it.** `resolveSiteBrand()` (`lib/site-brand.tsx`) gives the locale layout's title, description, og/twitter copy, Nav/Footer `siteName` and copyright holder, and both llms.txt headings; `lib/site-identity.ts` registers a JSON-LD reader (`setSiteIdentityReader`) whose registration keeps the file's `baseUrl`, so no hub value moves an `@id`; the contact email and the closing footer's contact lines read the value the last read resolved (`heldHubSite()`), because their seam is synchronous. `SITE_NAME`'s other readers (og image, icons, auth, mcp.json) keep the file value. The seo row's `robots.index` (the retired Allow search indexing) is read by nothing (#11978 D7).
|
|
803
830
|
- **A hub row is the whole identity.** A field the operator cleared is absent, never refilled from the file; only a missing row, an unreadable one or a failed read falls back to `_site.mdx`. The file's top-level `contactEmail` stays the contact email's fallback. Hub values are collapsed to one line.
|
|
804
831
|
- **A save shows without a redeploy.** A 200 PUT of `identity` or `seo` sends the signed `site-config` revalidate event (`notifySiteConfigRevalidate`) to the site and its spokes; `app/api/revalidate/route.ts` answers it by purging `siteConfigTag()`. The 300 s expiry is the net for a spoke with no `revalidateUrl`.
|
|
805
|
-
- **A hub outage never breaks a page**: a failed read writes no cache entry and serves the instance's last good value, else the file.
|
|
832
|
+
- **A hub outage never breaks a page**: a failed read writes no cache entry and serves the instance's last good value, else the file.
|
|
806
833
|
|
|
807
834
|
## AEO & performance
|
|
808
835
|
|
|
@@ -820,7 +847,11 @@ A list page whose frontmatter sets `navOnly: true` (valid on a registry list typ
|
|
|
820
847
|
- Don't reach into `apps/api` or `apps/mcp` from `apps/web`. They're peer apps — talk via HTTP/MCP.
|
|
821
848
|
- Don't commit images to `screenshots/` — only the `.gitkeep` is tracked.
|
|
822
849
|
|
|
823
|
-
Last updated: 2026-11-
|
|
850
|
+
Last updated: 2026-11-21 — § Pricing page: a section's `offeringPlans` plan groups, the kept `cardLayout`, the Admin-set Recommended, the `ailk_cta` button label and the add-on's `ailk_eyebrow` and note, and the two keys' rollout order (#12103) — verified against `lib/pricing-page.ts`, `lib/offerings-pricing.ts`, `packages/api/src/services/offerings/catalog.ts` and `packages-paid/api-multi-tenant/src/routes/workspaces/offerings.ts`.
|
|
851
|
+
|
|
852
|
+
Prior: 2026-11-19 — § Site visibility: one rule for Hidden (`lib/site-visibility.ts`) stamps noindex on every middleware response and page, every discovery file hides under STEALTH, `GET /api/site-status` reports the state, and ai-plugin.json is dropped; § A hub-connected site's identity loses the indexing switch (#11978) — verified against `lib/site-visibility.ts`, `middleware.ts`, `app/[locale]/layout.tsx`, `app/api/site-status/route.ts`, `app/{.well-known/mcp.json,openapi.json}/route.ts` and `lib/{mcp-served-tools,site-brand}.ts`.
|
|
853
|
+
|
|
854
|
+
Prior: 2026-11-14 — § Renaming a route family: one `path` key on a family's `_site.mdx` entry moves its route files, public URLs, nav, breadcrumbs, hub cards and booking CSP, with a 308 from the old segment (#11385) — verified against `packages/templates/src/{route-paths,routes-map}.ts`, `packages/create-ailk/src/routes.ts`, `next.config.mjs`, `middleware.ts` and `lib/{route-paths,page-chrome}.ts`.
|
|
824
855
|
|
|
825
856
|
Prior: 2026-11-13 — § Magnet pages: the magnet pages ship in `@working-theory/ui-signal-collectors` beside the flows pages, the careers walks adopted from site-pages' prefix, the `reports` strings in the package, and `/downloads` a routes-map redirect; `/dev/purchase` and its Server Action are retired (#11657) — verified against `packages-paid/ui-signal-collectors/{routes.json,src/pages/}`, `app/[locale]/{reports,trial,careers/apply,careers/[slug]/apply}/`, `packages/templates/src/routes-map.ts` and `next.config.mjs`.
|
|
826
857
|
|
|
@@ -14,26 +14,30 @@
|
|
|
14
14
|
* endpoint when MCP_PUBLIC_HTTP_URL is configured.
|
|
15
15
|
* Issue #4157 — `name` resolves from SITE_NAME (env → _site.mdx → neutral
|
|
16
16
|
* default) instead of a hardcoded vendor-brand literal.
|
|
17
|
-
* Issue #7136 — the five `feature`-tagged tools are gated on the licence
|
|
18
|
-
* features the route passes in (`heldFeatures`), as registration is.
|
|
19
17
|
* Issue #7396 — `mcpEndpoint` is the configured MCP HTTP host or absent. It
|
|
20
18
|
* was `${baseUrl}/api/mcp`, a path apps/web does not serve, so every agent
|
|
21
19
|
* that followed it got a 404.
|
|
22
|
-
* Issue #8070 — `unservedTools` drops the tools this topology's MCP server
|
|
23
|
-
* does not register (`create_project` on a spoke).
|
|
24
20
|
* Issue #8057 — `description` resolves from SITE_DESCRIPTION
|
|
25
21
|
* (`siteIdentity.description` in _site.mdx → neutral default) instead of the
|
|
26
22
|
* template's own blurb on every site.
|
|
27
23
|
* Issue #10392 — `authorization` names where an OAuth client signs in to the
|
|
28
24
|
* workspace tools, when the site pins its issuer and advertises its MCP host.
|
|
25
|
+
* Issue #11951 — `tools` is the site's MCP server's own `tools/list`
|
|
26
|
+
* (`servedTools`), in its order, in place of the catalog gated by the licence
|
|
27
|
+
* (#5971, #7136) and the topology's unserved list (#8070): only the MCP
|
|
28
|
+
* deployment knows which modules it installed. The catalog is a lookup — a
|
|
29
|
+
* name it knows renders as its entry, one it does not from the server's own.
|
|
29
30
|
*/
|
|
30
31
|
|
|
31
32
|
import {
|
|
32
33
|
getMcpToolCatalog,
|
|
33
|
-
type McpCatalogOptions,
|
|
34
34
|
type McpToolCatalogEntry,
|
|
35
35
|
} from "@working-theory/metadata";
|
|
36
36
|
|
|
37
|
+
import {
|
|
38
|
+
MCP_PROTOCOL_VERSION,
|
|
39
|
+
type ServedMcpTool,
|
|
40
|
+
} from "../../../lib/mcp-served-tools";
|
|
37
41
|
import { SITE_DESCRIPTION, SITE_NAME } from "../../../lib/site-brand";
|
|
38
42
|
|
|
39
43
|
/**
|
|
@@ -111,38 +115,27 @@ export interface BuildMcpManifestOptions {
|
|
|
111
115
|
*/
|
|
112
116
|
authIssuer?: string;
|
|
113
117
|
/**
|
|
114
|
-
*
|
|
115
|
-
* (#
|
|
116
|
-
*
|
|
117
|
-
*
|
|
118
|
-
*
|
|
119
|
-
* Injected rather than resolved here: this builder is PURE (same input →
|
|
120
|
-
* same output), a property its own suite asserts. `route.ts` resolves the
|
|
121
|
-
* claim and passes it in. Omitted ⇒ false, the fail-closed default.
|
|
122
|
-
*/
|
|
123
|
-
commerceClaimed?: boolean;
|
|
124
|
-
/**
|
|
125
|
-
* The licence features this deployment holds (#7136). In refuse mode a
|
|
126
|
-
* `feature`-tagged tool is advertised only when its feature is held — the
|
|
127
|
-
* same gate the MCP server's registration applies. Injected, like
|
|
128
|
-
* `commerceClaimed`. Omitted ⇒ none, the fail-closed default.
|
|
129
|
-
*/
|
|
130
|
-
heldFeatures?: readonly string[];
|
|
131
|
-
/** Overrides `MCP_FEATURE_GATE_MODE` — a test seam; `route.ts` never
|
|
132
|
-
* passes it. */
|
|
133
|
-
featureGate?: McpCatalogOptions["featureGate"];
|
|
134
|
-
/**
|
|
135
|
-
* Tool names this site's MCP server does not serve (#8070 D7) — the
|
|
136
|
-
* topology seam's `UNSERVED_MCP_TOOLS`: `create_project` on a spoke, none
|
|
137
|
-
* on a hub. Dropped from `tools`, so the manifest never advertises a tool
|
|
138
|
-
* the server will not register. Injected, like `commerceClaimed`. Omitted ⇒
|
|
139
|
-
* none dropped.
|
|
118
|
+
* The tools the site's MCP server serves — its `tools/list`, in its order
|
|
119
|
+
* (#11951 D4). `route.ts` reads it (`readServedMcpTools`) and passes it in,
|
|
120
|
+
* `[]` when there is no server or the read failed. Injected, like
|
|
121
|
+
* `mcpHttpUrl`, so the builder stays pure.
|
|
140
122
|
*/
|
|
141
|
-
|
|
123
|
+
servedTools: readonly ServedMcpTool[];
|
|
142
124
|
}
|
|
143
125
|
|
|
144
|
-
/**
|
|
145
|
-
|
|
126
|
+
/**
|
|
127
|
+
* The builder's lookup table (#11951 D4) — every anonymous-surface entry: a
|
|
128
|
+
* lookup, not a gate. Built once, on first use: its inputs never change.
|
|
129
|
+
*/
|
|
130
|
+
let catalogByName: ReadonlyMap<string, McpToolCatalogEntry> | undefined;
|
|
131
|
+
function catalogLookup(): ReadonlyMap<string, McpToolCatalogEntry> {
|
|
132
|
+
catalogByName ??= new Map(
|
|
133
|
+
getMcpToolCatalog({ addons: { commerce: true }, featureGate: "warn" }).map(
|
|
134
|
+
(entry) => [entry.name, entry] as const,
|
|
135
|
+
),
|
|
136
|
+
);
|
|
137
|
+
return catalogByName;
|
|
138
|
+
}
|
|
146
139
|
|
|
147
140
|
const LOOPBACK_HOSTS = ["localhost", "127.0.0.1", "[::1]"];
|
|
148
141
|
|
|
@@ -192,12 +185,14 @@ export function buildMcpManifest(opts: BuildMcpManifestOptions): McpManifest {
|
|
|
192
185
|
transports.push({
|
|
193
186
|
type: "http",
|
|
194
187
|
url: opts.mcpHttpUrl,
|
|
195
|
-
version
|
|
188
|
+
// The version the discovery read speaks, so the two cannot drift (#11951 D2).
|
|
189
|
+
version: MCP_PROTOCOL_VERSION,
|
|
196
190
|
label: "HTTP (Streamable HTTP transport)",
|
|
197
191
|
});
|
|
198
192
|
}
|
|
199
193
|
|
|
200
194
|
const authorization = authorizationFor(opts.authIssuer, opts.mcpHttpUrl);
|
|
195
|
+
const catalog = catalogLookup();
|
|
201
196
|
|
|
202
197
|
return {
|
|
203
198
|
schemaVersion: "1",
|
|
@@ -206,14 +201,22 @@ export function buildMcpManifest(opts: BuildMcpManifestOptions): McpManifest {
|
|
|
206
201
|
// Spread conditional to satisfy exactOptionalPropertyTypes: the key is
|
|
207
202
|
// absent, not undefined, when no MCP HTTP host is configured.
|
|
208
203
|
...(opts.mcpHttpUrl ? { mcpEndpoint: opts.mcpHttpUrl } : {}),
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
204
|
+
// A served name the catalog knows renders as its entry; one it does not
|
|
205
|
+
// (an MCP deployment newer than this site) in the server's own words,
|
|
206
|
+
// `outputSchema: {}` — the schema that admits anything, since the server
|
|
207
|
+
// publishes none (#11951 D4).
|
|
208
|
+
tools: opts.servedTools.map(
|
|
209
|
+
(tool) =>
|
|
210
|
+
catalog.get(tool.name) ?? {
|
|
211
|
+
name: tool.name,
|
|
212
|
+
description: tool.description ?? "",
|
|
213
|
+
inputSchema: tool.inputSchema,
|
|
214
|
+
outputSchema: {},
|
|
215
|
+
},
|
|
216
|
+
),
|
|
214
217
|
transport: {
|
|
215
218
|
type: "http",
|
|
216
|
-
version:
|
|
219
|
+
version: MCP_PROTOCOL_VERSION,
|
|
217
220
|
},
|
|
218
221
|
transports,
|
|
219
222
|
ailk: { version: opts.ailkVersion },
|