create-ailk 0.45.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/lib/env-catalog.js +1 -1
- package/dist/lib/import-mdx.js +10 -2
- package/dist/seed-workspace.d.ts +1 -1
- package/dist/seed-workspace.js +10 -3
- package/dist/surfaces.js +1 -1
- package/package.json +3 -3
- package/templates/apps/api/.env.example +23 -0
- package/templates/apps/api/CLAUDE.md +13 -6
- package/templates/apps/api/src/lib/__mocks__/prisma.ts +11 -0
- package/templates/apps/mcp/.env.example +8 -0
- package/templates/apps/mcp/CLAUDE.md +22 -6
- 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/route.ts +6 -7
- 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 +10 -3
- package/templates/apps/web/lib/__tests__/mcp-served-tools.test.ts +61 -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/mcp-oauth.ts +64 -0
- package/templates/apps/web/lib/mcp-served-tools.ts +51 -9
- 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
|
@@ -65,6 +65,15 @@ now mean `packages/mcp-server/src/<file>`.
|
|
|
65
65
|
reader's 15-second shared answer; a failed read keeps the last answer, then on.
|
|
66
66
|
`/mcp/workspace`, its protected-resource metadata and stdio are untouched. A hub's own tool
|
|
67
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.
|
|
68
77
|
- **Content root.** Every content tool and `audit` take their root from `mcpContentRoot()`
|
|
69
78
|
(`lib/content-adapter.ts`): `AILK_CONTENT_ROOT`, else `<cwd>/content`, else
|
|
70
79
|
`<cwd>/../../content`. Never build a content path from `process.cwd()` in a tool — the one
|
|
@@ -131,7 +140,7 @@ Every tool maps 1:1 to an `apps/api` endpoint. When you change a tool, change th
|
|
|
131
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
|
|
132
141
|
**Maintenance (2):** `audit`, `create_project` (stdio only, #9965 D13)
|
|
133
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)
|
|
134
|
-
**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 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
|
|
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
|
|
135
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
|
|
136
145
|
|
|
137
146
|
### Why the parity test counts 23 and a keyless server registers 21 (22 over stdio once Free is released)
|
|
@@ -153,8 +162,11 @@ Every tool maps 1:1 to an `apps/api` endpoint. When you change a tool, change th
|
|
|
153
162
|
stdio (the transport filter, #9965 D13), minus `OSS_DISABLED_TOOLS`
|
|
154
163
|
(now empty), minus module-gated tools not served from state (#11950: the
|
|
155
164
|
tool's pack is installed and the hub's `GET /v1/content/agent-tools` answers
|
|
156
|
-
its capability licensed, ready and on — read at boot
|
|
157
|
-
`MCP_CLAIM_REFRESH_MS`
|
|
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;
|
|
158
170
|
`AILK_ENABLED_MODULES` gates `/mcp/workspace` only), minus any
|
|
159
171
|
`addon`-tagged tool whose claim this deployment does not hold.
|
|
160
172
|
`start_purchase` carries `addon: "commerce"`, so it is the one entry whose
|
|
@@ -192,7 +204,7 @@ here. Spec: `docs/specs/3591-tenant-scoped-agent-auth-secure-spec.md` D13–D16.
|
|
|
192
204
|
- **apps/mcp checks only the key's shape.** The key is attached as the SDK's `req.auth` for that
|
|
193
205
|
request alone and reaches a tool as `extra.authInfo.token`. apps/api is the one place it is
|
|
194
206
|
checked, and its tenant guard and the caller's clamped role decide every answer.
|
|
195
|
-
- **
|
|
207
|
+
- **Ninety tools (eighty-seven plus three deprecated aliases), each a `twin`.** The catalog rows carry `surface: "workspace"`, `tier: "pro"`
|
|
196
208
|
and `modulesAnyOf` (the modules any one of which registers the tool — its twin route's gate):
|
|
197
209
|
`get_agent_context`, (#9683) `get_workspace_knowledge` — twin of `GET
|
|
198
210
|
/v1/workspaces/:workspaceId/knowledge`: the business's shown offerings, live magnets, listed
|
|
@@ -214,7 +226,7 @@ here. Spec: `docs/specs/3591-tenant-scoped-agent-auth-secure-spec.md` D13–D16.
|
|
|
214
226
|
tools, `list_proposals` and `create_proposal`, twinning `GET`/`POST
|
|
215
227
|
/v1/workspaces/:workspaceId/people/:personId/proposals` with the same grant: a proposal is
|
|
216
228
|
private to one client, `payments` says whether approval leads to a Stripe page, and an agent's
|
|
217
|
-
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
|
|
218
230
|
`data`. They are in the parity guard like every other tool, and never in
|
|
219
231
|
`/.well-known/mcp.json`.
|
|
220
232
|
- **The OAuth bearer branch (#10391).** When `BETTER_AUTH_URL` (the site's origin, its OAuth
|
|
@@ -339,7 +351,11 @@ Example (lead routing):
|
|
|
339
351
|
- Don't add a tool without the matching `apps/api` endpoint.
|
|
340
352
|
- Don't put business logic in tool handlers — they're adapters.
|
|
341
353
|
|
|
342
|
-
Last updated: 2026-11-19 — #
|
|
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`.
|
|
343
359
|
|
|
344
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`.
|
|
345
361
|
|
|
@@ -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
|
|
|
@@ -20,17 +20,16 @@
|
|
|
20
20
|
* catalog in @working-theory/metadata only supplies each known tool's entry;
|
|
21
21
|
* the AILK version is read from this app's package.json.
|
|
22
22
|
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
23
|
+
* Response.json with a conservative cache-control header (a day; `no-store`
|
|
24
|
+
* on a failed read).
|
|
25
25
|
*
|
|
26
26
|
* CORS: MCP discovery clients are cross-origin by design. The open GET is
|
|
27
27
|
* public — no credentials, no session-scoped data — so Access-Control-Allow-Origin: *
|
|
28
28
|
* is appropriate per the MCP discovery spec.
|
|
29
29
|
*/
|
|
30
30
|
|
|
31
|
-
import { siteDiscoverable } from "@working-theory/api-client";
|
|
32
|
-
|
|
33
31
|
import { readServedMcpTools } from "../../../lib/mcp-served-tools";
|
|
32
|
+
import { siteHidden } from "../../../lib/site-visibility";
|
|
34
33
|
import packageJson from "../../../package.json";
|
|
35
34
|
|
|
36
35
|
import { buildMcpManifest } from "./build-manifest";
|
|
@@ -53,9 +52,9 @@ export function OPTIONS(): Response {
|
|
|
53
52
|
}
|
|
54
53
|
|
|
55
54
|
export async function GET(): Promise<Response> {
|
|
56
|
-
// #
|
|
57
|
-
// is asked (#11951).
|
|
58
|
-
if (
|
|
55
|
+
// #11978 D2 — Hidden (STEALTH or the owner's switch): 404, never cached,
|
|
56
|
+
// before the MCP server is asked (#11951).
|
|
57
|
+
if (await siteHidden()) {
|
|
59
58
|
return new Response(null, {
|
|
60
59
|
status: 404,
|
|
61
60
|
headers: { "cache-control": "no-store", ...CORS_HEADERS },
|
|
@@ -131,6 +131,7 @@ import "../../lib/site-identity";
|
|
|
131
131
|
// (#7521). Inert without AILK_LISTING_PUBLIC_KEY or the paid package.
|
|
132
132
|
import "../../lib/listings";
|
|
133
133
|
import { siteThemeHead } from "../../lib/site-theme-head";
|
|
134
|
+
import { siteHidden } from "../../lib/site-visibility";
|
|
134
135
|
import {
|
|
135
136
|
SIGN_IN_PATH,
|
|
136
137
|
SIGN_UP_PATH,
|
|
@@ -298,9 +299,15 @@ export async function generateMetadata(): Promise<Metadata> {
|
|
|
298
299
|
// none of its own: the request's own URL, never the home page's.
|
|
299
300
|
const requestUrl = pathname === "/" ? baseUrl : `${baseUrl}${pathname}`;
|
|
300
301
|
|
|
301
|
-
// #
|
|
302
|
-
//
|
|
302
|
+
// #11978 D2 — `STEALTH` wins; otherwise Site visibility Hidden answers
|
|
303
|
+
// `noindex, nofollow` on every page that sets no robots of its own.
|
|
303
304
|
const stealthRobots = getStealthRobots();
|
|
305
|
+
const robots =
|
|
306
|
+
"robots" in stealthRobots
|
|
307
|
+
? stealthRobots
|
|
308
|
+
: (await siteHidden())
|
|
309
|
+
? { robots: { index: false, follow: false } }
|
|
310
|
+
: {};
|
|
304
311
|
|
|
305
312
|
return {
|
|
306
313
|
title: brand.siteName,
|
|
@@ -318,11 +325,7 @@ export async function generateMetadata(): Promise<Metadata> {
|
|
|
318
325
|
description: brand.description,
|
|
319
326
|
images: [ogImageUrl],
|
|
320
327
|
},
|
|
321
|
-
...
|
|
322
|
-
? stealthRobots
|
|
323
|
-
: brand.indexable
|
|
324
|
-
? {}
|
|
325
|
-
: { robots: { index: false, follow: true } }),
|
|
328
|
+
...robots,
|
|
326
329
|
alternates: {
|
|
327
330
|
canonical: requestUrl,
|
|
328
331
|
languages,
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jest-environment node
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* GET /api/site-status (#11978 D3, AC-3 (a), AC-5 (b)). The owner's switch is
|
|
7
|
+
* mocked at its HTTP boundary (`siteDiscoverable`), STEALTH is the env var,
|
|
8
|
+
* and the MCP server is a `node:http` stub of its `/mcp` route.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { siteStatusSchema } from "@working-theory/validation";
|
|
12
|
+
|
|
13
|
+
import { __resetServedMcpToolsForTests } from "../../../../lib/mcp-served-tools";
|
|
14
|
+
import { PUBLIC_PAGES } from "../../../../lib/modules.generated";
|
|
15
|
+
import {
|
|
16
|
+
startMcpStub,
|
|
17
|
+
type McpStub,
|
|
18
|
+
} from "../../../../lib/__tests__/fixtures/mcp-stub-server";
|
|
19
|
+
import { GET } from "../route";
|
|
20
|
+
|
|
21
|
+
const mockSiteDiscoverable = jest.fn<Promise<boolean>, []>();
|
|
22
|
+
jest.mock("@working-theory/api-client", () => ({
|
|
23
|
+
...jest.requireActual<typeof import("@working-theory/api-client")>(
|
|
24
|
+
"@working-theory/api-client",
|
|
25
|
+
),
|
|
26
|
+
siteDiscoverable: () => mockSiteDiscoverable(),
|
|
27
|
+
}));
|
|
28
|
+
|
|
29
|
+
const ENV = ["STEALTH", "MCP_PUBLIC_HTTP_URL"] as const;
|
|
30
|
+
const saved = new Map(ENV.map((key) => [key, process.env[key]]));
|
|
31
|
+
const stubs: McpStub[] = [];
|
|
32
|
+
|
|
33
|
+
beforeEach(() => {
|
|
34
|
+
__resetServedMcpToolsForTests();
|
|
35
|
+
mockSiteDiscoverable.mockReset().mockResolvedValue(true);
|
|
36
|
+
for (const key of ENV) delete process.env[key];
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
afterEach(async () => {
|
|
40
|
+
await Promise.all(stubs.splice(0).map((s) => s.close()));
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
afterAll(() => {
|
|
44
|
+
for (const [key, value] of saved) {
|
|
45
|
+
if (value === undefined) delete process.env[key];
|
|
46
|
+
else process.env[key] = value;
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
async function report(): Promise<{ response: Response; body: unknown }> {
|
|
51
|
+
const response = await GET();
|
|
52
|
+
return { response, body: await response.json() };
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function expectMachineHeaders(response: Response): void {
|
|
56
|
+
expect(response.status).toBe(200);
|
|
57
|
+
expect(response.headers.get("cache-control")).toBe("no-store");
|
|
58
|
+
expect(response.headers.get("x-robots-tag")).toBe("noindex, nofollow, noarchive");
|
|
59
|
+
expect(response.headers.get("set-cookie")).toBeNull();
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
describe("GET /api/site-status — visibility and the hosting lock (AC-3 (a))", () => {
|
|
63
|
+
it("STEALTH: hidden, locked by hosting, and no hub read", async () => {
|
|
64
|
+
process.env["STEALTH"] = "true";
|
|
65
|
+
const { response, body } = await report();
|
|
66
|
+
expectMachineHeaders(response);
|
|
67
|
+
expect(body).toEqual({
|
|
68
|
+
visibility: "hidden",
|
|
69
|
+
lock: "hosting",
|
|
70
|
+
// The module list decides it: a site with no public page (a hub) reads false.
|
|
71
|
+
publicPages: PUBLIC_PAGES,
|
|
72
|
+
mcp: { state: "none" },
|
|
73
|
+
});
|
|
74
|
+
expect(mockSiteDiscoverable).not.toHaveBeenCalled();
|
|
75
|
+
expect(siteStatusSchema.parse(body)).toEqual(body);
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
it("STEALTH unset, the switch off: hidden, no lock", async () => {
|
|
79
|
+
mockSiteDiscoverable.mockResolvedValue(false);
|
|
80
|
+
const { response, body } = await report();
|
|
81
|
+
expectMachineHeaders(response);
|
|
82
|
+
expect(body).toMatchObject({ visibility: "hidden", lock: null });
|
|
83
|
+
expect(siteStatusSchema.safeParse(body).success).toBe(true);
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
it("STEALTH unset, the switch on: live, no lock", async () => {
|
|
87
|
+
const { response, body } = await report();
|
|
88
|
+
expectMachineHeaders(response);
|
|
89
|
+
expect(body).toMatchObject({ visibility: "live", lock: null });
|
|
90
|
+
expect(siteStatusSchema.safeParse(body).success).toBe(true);
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
describe("GET /api/site-status — the MCP server's answer (AC-5 (b))", () => {
|
|
95
|
+
it("MCP_PUBLIC_HTTP_URL unset → none", async () => {
|
|
96
|
+
expect((await report()).body).toMatchObject({ mcp: { state: "none" } });
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
it("an answering server → its tool names and installed names, nothing else", async () => {
|
|
100
|
+
const server = await startMcpStub({
|
|
101
|
+
mode: "stateless",
|
|
102
|
+
tools: [{ name: "search_content", description: "Search.", inputSchema: { type: "object" } }],
|
|
103
|
+
experimental: { "ailk/installed": { tools: ["create_booking"] } },
|
|
104
|
+
});
|
|
105
|
+
stubs.push(server);
|
|
106
|
+
process.env["MCP_PUBLIC_HTTP_URL"] = server.url;
|
|
107
|
+
const { body } = await report();
|
|
108
|
+
expect(body).toMatchObject({
|
|
109
|
+
mcp: { state: "answering", tools: ["search_content"], installed: ["create_booking"] },
|
|
110
|
+
});
|
|
111
|
+
expect(JSON.stringify(body)).not.toContain(server.url);
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
it("a server refusing initialize with 404 → refused", async () => {
|
|
115
|
+
const server = await startMcpStub({ mode: "stateless", tools: [], override: () => ({ status: 404 }) });
|
|
116
|
+
stubs.push(server);
|
|
117
|
+
process.env["MCP_PUBLIC_HTTP_URL"] = server.url;
|
|
118
|
+
expect((await report()).body).toMatchObject({ mcp: { state: "refused" } });
|
|
119
|
+
});
|
|
120
|
+
});
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GET /api/site-status — the site's own report of its visibility (#11978 D3,
|
|
3
|
+
* spec docs/specs/11978-one-site-visibility-control-with-spec.md).
|
|
4
|
+
*
|
|
5
|
+
* The Admin reads it to show the hosting lock (STEALTH, which the hub never
|
|
6
|
+
* learns), to judge its status line against the owner's chosen state, and to
|
|
7
|
+
* fill the What agents can do card's Installed column on every topology —
|
|
8
|
+
* the site answers for its own deployment, a spoke included. The body is
|
|
9
|
+
* `siteStatusSchema` (`@working-theory/validation`), bare, no envelope:
|
|
10
|
+
*
|
|
11
|
+
* - `visibility` — `lib/site-visibility.ts`'s `siteHidden()`, the one rule
|
|
12
|
+
* every surface acts on;
|
|
13
|
+
* - `lock` — `"hosting"` under STEALTH;
|
|
14
|
+
* - `publicPages` — `PUBLIC_PAGES` (#10040);
|
|
15
|
+
* - `mcp` — what the site's MCP server (`MCP_PUBLIC_HTTP_URL`) answered its
|
|
16
|
+
* own `initialize` (`readMcpServer`, shared per URL for 60 s): its tool
|
|
17
|
+
* names and installed names, `refused`, `unreachable`, or `none` when the
|
|
18
|
+
* site has no MCP server.
|
|
19
|
+
*
|
|
20
|
+
* It takes no input (any query is ignored), reads and sets no cookie, and
|
|
21
|
+
* sends no URL, key or setting value. Every answer is `no-store` and
|
|
22
|
+
* noindex: a machine report is never indexed. Its two reads are the shared,
|
|
23
|
+
* cached ones, so a burst of callers costs at most one hub read per 15 s and
|
|
24
|
+
* one MCP exchange per minute per instance.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
import type { SiteStatus } from "@working-theory/validation";
|
|
28
|
+
|
|
29
|
+
import { readMcpServer } from "../../../lib/mcp-served-tools";
|
|
30
|
+
import { PUBLIC_PAGES } from "../../../lib/modules.generated";
|
|
31
|
+
import { HIDDEN_ROBOTS_HEADER, siteHidden, siteLock } from "../../../lib/site-visibility";
|
|
32
|
+
|
|
33
|
+
export const dynamic = "force-dynamic";
|
|
34
|
+
|
|
35
|
+
async function mcpStatus(): Promise<SiteStatus["mcp"]> {
|
|
36
|
+
const url = process.env["MCP_PUBLIC_HTTP_URL"];
|
|
37
|
+
if (!url) return { state: "none" };
|
|
38
|
+
const answer = await readMcpServer(url);
|
|
39
|
+
if (answer.state !== "answering") return answer;
|
|
40
|
+
return {
|
|
41
|
+
state: "answering",
|
|
42
|
+
tools: answer.tools.map((tool) => tool.name),
|
|
43
|
+
installed: answer.installed,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export async function GET(): Promise<Response> {
|
|
48
|
+
const [hidden, mcp] = await Promise.all([siteHidden(), mcpStatus()]);
|
|
49
|
+
const status: SiteStatus = {
|
|
50
|
+
visibility: hidden ? "hidden" : "live",
|
|
51
|
+
lock: siteLock(),
|
|
52
|
+
publicPages: PUBLIC_PAGES,
|
|
53
|
+
mcp,
|
|
54
|
+
};
|
|
55
|
+
return Response.json(status, {
|
|
56
|
+
status: 200,
|
|
57
|
+
headers: {
|
|
58
|
+
"cache-control": "no-store",
|
|
59
|
+
"X-Robots-Tag": HIDDEN_ROBOTS_HEADER,
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
}
|
|
@@ -34,7 +34,6 @@
|
|
|
34
34
|
* 2026-11-11 on #11423.
|
|
35
35
|
*/
|
|
36
36
|
|
|
37
|
-
import { siteDiscoverable } from "@working-theory/api-client";
|
|
38
37
|
import {
|
|
39
38
|
SCHEMA_ORG_TYPES,
|
|
40
39
|
resolvedAdapterKind,
|
|
@@ -55,6 +54,7 @@ import {
|
|
|
55
54
|
import { MARKETING_PAGES, PUBLIC_PAGES } from "../../lib/modules.generated";
|
|
56
55
|
import { resolveSiteBrand } from "../../lib/site-brand";
|
|
57
56
|
import { SITE_LISTING } from "../../lib/site-listing";
|
|
57
|
+
import { siteLive } from "../../lib/site-visibility";
|
|
58
58
|
import { agentContactLines, pagePathFor, resolveBaseUrl } from "../../src/lib/routes";
|
|
59
59
|
|
|
60
60
|
// #10510 D4 — read per request: the owner's discovery switch is a runtime
|
|
@@ -77,7 +77,7 @@ export interface LlmsHandlerDeps {
|
|
|
77
77
|
getBlogPages?: () => Array<{ url: string; data: { title: string; description?: string } }>;
|
|
78
78
|
/** The docs pages (#10041). Defaults to `listDocsPages` over this app's docs directory. */
|
|
79
79
|
getDocsPages?: () => DocsIndexPage[];
|
|
80
|
-
/** The owner's discovery switch (#10510 D4). Defaults to `
|
|
80
|
+
/** The owner's discovery switch (#10510 D4). Defaults to `siteLive` — Hidden under STEALTH too (#11978). */
|
|
81
81
|
discoverable?: () => Promise<boolean>;
|
|
82
82
|
/** The site's own listing (#10940 D3). Defaults to `SITE_LISTING`. */
|
|
83
83
|
getSiteListing?: () => SiteListing;
|
|
@@ -93,7 +93,7 @@ export function createLlmsHandler(deps: LlmsHandlerDeps = {}) {
|
|
|
93
93
|
const resolveAdapter = deps.getContentAdapter ?? defaultGetContentAdapter;
|
|
94
94
|
const resolveBlogPages = deps.getBlogPages ?? (() => []);
|
|
95
95
|
const resolveDocsPages = deps.getDocsPages ?? listDocsPages;
|
|
96
|
-
const isDiscoverable = deps.discoverable ??
|
|
96
|
+
const isDiscoverable = deps.discoverable ?? siteLive;
|
|
97
97
|
const resolveSiteListing = deps.getSiteListing ?? (() => SITE_LISTING);
|
|
98
98
|
const resolveHasContactPage = deps.hasContactPage ?? (() => MARKETING_PAGES);
|
|
99
99
|
|