create-ailk 0.47.0 → 0.48.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +192 -43
- package/component-catalog.json +223 -285
- package/component-catalog.md +1 -1
- package/dist/apply-design.d.ts +26 -68
- package/dist/apply-design.js +150 -322
- package/dist/cli.js +152 -17
- package/dist/compare-chrome.d.ts +108 -0
- package/dist/compare-chrome.js +481 -0
- package/dist/compare-look.d.ts +94 -0
- package/dist/compare-look.js +378 -0
- package/dist/copy.js +1 -1
- package/dist/design-compile.d.ts +17 -21
- package/dist/design-compile.js +32 -56
- package/dist/design-files.d.ts +93 -0
- package/dist/design-files.js +312 -0
- package/dist/design-home.d.ts +4 -2
- package/dist/design-home.js +88 -6
- package/dist/design-names.d.ts +13 -0
- package/dist/design-names.js +76 -0
- package/dist/design-package.d.ts +46 -56
- package/dist/design-package.js +285 -288
- package/dist/design-presets.d.ts +41 -0
- package/dist/design-presets.js +83 -4
- package/dist/design-scaffold.d.ts +12 -2
- package/dist/design-scaffold.js +72 -34
- package/dist/generated/design-settings.d.ts +56 -0
- package/dist/generated/design-settings.js +237 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/inventory.d.ts +3 -2
- package/dist/inventory.js +10 -4
- package/dist/lib/design-checks.d.ts +46 -0
- package/dist/lib/design-checks.js +79 -1
- package/dist/lib/env-catalog.js +1 -1
- package/dist/lib/module-license-gate.d.ts +1 -1
- package/dist/lib/module-license-gate.js +1 -1
- package/dist/lib/render-verdict.d.ts +13 -1
- package/dist/lib/render-verdict.js +41 -1
- package/dist/look-hub.d.ts +44 -0
- package/dist/look-hub.js +130 -0
- package/dist/look-record.d.ts +35 -0
- package/dist/look-record.js +85 -0
- package/dist/look-samples.d.ts +66 -0
- package/dist/look-samples.js +456 -0
- package/dist/look-settings.d.ts +53 -0
- package/dist/look-settings.js +807 -0
- package/dist/module-architecture.js +12 -0
- package/dist/parse-args.d.ts +10 -6
- package/dist/parse-args.js +26 -13
- package/dist/programmatic.d.ts +1 -19
- package/dist/programmatic.js +65 -103
- package/dist/retired-design-bodies.d.ts +29 -0
- package/dist/retired-design-bodies.js +51 -0
- package/dist/seed-flows.d.ts +1 -1
- package/dist/seed-flows.js +12 -14
- package/dist/seed-workspace.d.ts +4 -1
- package/dist/seed-workspace.js +139 -17
- package/dist/site-chrome.d.ts +42 -41
- package/dist/site-chrome.js +51 -70
- package/dist/site-fonts.d.ts +14 -14
- package/dist/site-fonts.js +9 -4
- package/dist/starter-grid.d.ts +2 -2
- package/dist/strip-look-copies.d.ts +67 -0
- package/dist/strip-look-copies.js +591 -0
- package/dist/template-manifest.d.ts +6 -14
- package/dist/template-manifest.js +0 -9
- package/dist/template-record.d.ts +3 -1
- package/dist/template-record.js +3 -1
- package/dist/topology.d.ts +15 -0
- package/dist/topology.js +60 -0
- package/dist/update.d.ts +57 -1
- package/dist/update.js +742 -13
- package/package.json +3 -4
- package/site-templates/aliases/hub.TEMPLATE-MANIFEST.json +2 -31
- package/site-templates/designs/minimalism/DESIGN.md +163 -297
- package/site-templates/designs/minimalism/LOOK.md +42 -0
- package/site-templates/designs/minimalism/design.yaml +167 -0
- package/site-templates/designs/standard/DESIGN.md +145 -149
- package/site-templates/designs/standard/LOOK.md +42 -0
- package/site-templates/designs/standard/design.yaml +72 -0
- package/site-templates/marketing-site/TEMPLATE-MANIFEST.json +2 -31
- package/site-templates/marketing-site/TEMPLATE-MANIFEST.md +1 -25
- package/site-templates/marketing-site-free/TEMPLATE-MANIFEST.json +2 -31
- package/site-templates/marketing-site-free/TEMPLATE-MANIFEST.md +1 -25
- package/site-templates/shapes/local-business-service/TEMPLATE-MANIFEST.json +2 -31
- package/site-templates/shapes/local-business-service/TEMPLATE-MANIFEST.md +1 -25
- package/site-templates/shapes/organization-service/TEMPLATE-MANIFEST.json +2 -31
- package/site-templates/shapes/organization-service/TEMPLATE-MANIFEST.md +1 -25
- package/site-templates/shapes/person-service/TEMPLATE-MANIFEST.json +2 -31
- package/site-templates/shapes/person-service/TEMPLATE-MANIFEST.md +1 -25
- package/site-templates/shapes/person-service/content/_site.mdx +0 -26
- package/templates/.claude/rules/extending.md +3 -2
- package/templates/.env.example +11 -4
- package/templates/CLAUDE.md +1 -1
- package/templates/DESIGN.md +145 -149
- package/templates/README.md +15 -16
- package/templates/apps/api/.env.example +11 -4
- package/templates/apps/api/CLAUDE.md +6 -4
- package/templates/apps/api/src/lib/__mocks__/prisma.ts +15 -5
- package/templates/apps/mcp/CLAUDE.md +4 -2
- package/templates/apps/web/.env.example +10 -3
- package/templates/apps/web/CLAUDE.md +14 -3
- package/templates/apps/web/app/[locale]/layout.tsx +53 -50
- package/templates/apps/web/app/not-found.tsx +11 -11
- package/templates/apps/web/auth.ts +48 -35
- package/templates/apps/web/jest.config.cjs +5 -0
- package/templates/apps/web/lib/__tests__/hub-site-config.test.ts +179 -31
- package/templates/apps/web/lib/__tests__/library-fonts.test.ts +35 -0
- package/templates/apps/web/lib/__tests__/page-chrome-navigation.test.ts +71 -32
- package/templates/apps/web/lib/__tests__/page-chrome.test.ts +123 -26
- package/templates/apps/web/lib/__tests__/section-look.test.ts +150 -0
- package/templates/apps/web/lib/__tests__/site-theme.test.ts +81 -289
- package/templates/apps/web/lib/deck-page.ts +3 -10
- package/templates/apps/web/lib/deploy-fonts.ts +12 -0
- package/templates/apps/web/lib/hub-site-config.ts +97 -14
- package/templates/apps/web/lib/library-fonts.ts +41 -0
- package/templates/apps/web/lib/mcp-oauth.ts +11 -4
- package/templates/apps/web/lib/page-chrome.ts +52 -34
- package/templates/apps/web/lib/section-look.ts +28 -0
- package/templates/apps/web/lib/site-design.ts +205 -0
- package/templates/apps/web/lib/site-theme-head.ts +98 -13
- package/templates/apps/web/lib/site-theme.ts +40 -62
- package/templates/apps/web/messages/en.json +0 -6
- package/templates/apps/web/next.config.mjs +195 -6
- package/templates/apps/web/package.json +2 -0
- package/templates/apps/web/site-pages.config.tsx +4 -2
- package/templates/content/_site.mdx +0 -26
- package/templates/design.yaml +75 -0
- package/templates/project.yaml +14 -0
- package/versions.json +52 -51
- package/site-templates/marketing-site/DESIGN.md +0 -259
- package/site-templates/marketing-site-free/DESIGN.md +0 -259
- package/site-templates/saas-product/DESIGN.md +0 -259
- package/templates/apps/web/lib/__tests__/deck-page.test.ts +0 -288
- package/templates/apps/web/lib/__tests__/site-theme-head.test.ts +0 -70
- package/templates/apps/web/lib/site-chrome.ts +0 -46
- package/templates/apps/web/lib/site-fonts.ts +0 -15
|
@@ -198,11 +198,6 @@ export const prisma = {
|
|
|
198
198
|
findMany: jest.fn(),
|
|
199
199
|
},
|
|
200
200
|
// ── Config namespace (per-workspace site config — #3641/#3634) ───────────
|
|
201
|
-
workspaceTheme: {
|
|
202
|
-
findUnique: jest.fn(),
|
|
203
|
-
upsert: jest.fn(),
|
|
204
|
-
deleteMany: jest.fn(),
|
|
205
|
-
},
|
|
206
201
|
workspaceSiteIdentity: {
|
|
207
202
|
findUnique: jest.fn(),
|
|
208
203
|
upsert: jest.fn(),
|
|
@@ -229,6 +224,21 @@ export const prisma = {
|
|
|
229
224
|
create: jest.fn(),
|
|
230
225
|
deleteMany: jest.fn(),
|
|
231
226
|
},
|
|
227
|
+
// #12470 D4 — the design record and its versions: the accessor's guarded
|
|
228
|
+
// save, list and read, the site's hub read and the workspace-delete helper.
|
|
229
|
+
workspaceSiteDesign: {
|
|
230
|
+
findUnique: jest.fn(),
|
|
231
|
+
createManyAndReturn: jest.fn(),
|
|
232
|
+
updateManyAndReturn: jest.fn(),
|
|
233
|
+
deleteMany: jest.fn(),
|
|
234
|
+
},
|
|
235
|
+
workspaceSiteDesignVersion: {
|
|
236
|
+
findUnique: jest.fn(),
|
|
237
|
+
findFirst: jest.fn(),
|
|
238
|
+
findMany: jest.fn(),
|
|
239
|
+
create: jest.fn(),
|
|
240
|
+
deleteMany: jest.fn(),
|
|
241
|
+
},
|
|
232
242
|
// `findUnique` — the public meetings read (`lib/public-meetings-config.ts`),
|
|
233
243
|
// which a spoke's meeting-types read and booking gate reach (#7532 D3/D4).
|
|
234
244
|
workspaceMeetings: {
|
|
@@ -226,7 +226,7 @@ here. Spec: `docs/specs/3591-tenant-scoped-agent-auth-secure-spec.md` D13–D16.
|
|
|
226
226
|
tools, `list_proposals` and `create_proposal`, twinning `GET`/`POST
|
|
227
227
|
/v1/workspaces/:workspaceId/people/:personId/proposals` with the same grant: a proposal is
|
|
228
228
|
private to one client, `payments` says whether approval leads to a Stripe page, and an agent'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 (#12419) `list_image_slots` (`mcp-workspace`'s `content_draft.ts`, registered with `workspace` or `multi-tenant`, `gate: { allows: "content-edit" }`), twinning `GET …/image-slots` with an optional `address` and `sectionType`: what each section image slot needs — its shapes, how it is drawn (`fit`), its smallest useful width and height and its purpose — for every section type, or for the slots on one page's draft with each slot's section id, path, the need its own section's fields pick (`chosenBy`) and whether it is filled, at most 500 (`truncated`), a blank's slots where nothing is, as `open_page`; its `invalid` keeps `issues`, and `save_page` refuses an `asset:` image smaller than its slot needs; 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 sections a new page of the type starts with, read off that template (#12516), 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 what it is for, when to choose it and the parts of a page's pyramid it can carry (the answer, the kinds of support a claim may rest on, the frame parts; #12514), and 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 (#12419) `list_image_slots` (`mcp-workspace`'s `content_draft.ts`, registered with `workspace` or `multi-tenant`, `gate: { allows: "content-edit" }`), twinning `GET …/image-slots` with an optional `address` and `sectionType`: what each section image slot needs — its shapes, how it is drawn (`fit`), its smallest useful width and height and its purpose — for every section type, or for the slots on one page's draft with each slot's section id, path, the need its own section's fields pick (`chosenBy`) and whether it is filled, at most 500 (`truncated`), a blank's slots where nothing is, as `open_page`; its `invalid` keeps `issues`, and `save_page` refuses an `asset:` image smaller than its slot needs; 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
|
|
230
230
|
`data`. They are in the parity guard like every other tool, and never in
|
|
231
231
|
`/.well-known/mcp.json`.
|
|
232
232
|
- **The OAuth bearer branch (#10391).** When `BETTER_AUTH_URL` (the site's origin, its OAuth
|
|
@@ -351,7 +351,9 @@ Example (lead routing):
|
|
|
351
351
|
- Don't add a tool without the matching `apps/api` endpoint.
|
|
352
352
|
- Don't put business logic in tool handlers — they're adapters.
|
|
353
353
|
|
|
354
|
-
Last updated: 2026-11-
|
|
354
|
+
Last updated: 2026-11-28 — #12516: `list_page_types` answers each type's starting sections beside its template's headings — verified against `packages/metadata/src/mcp-tool-catalog.ts` and `packages-paid/api-content-write/src/routes/workspaces/site-vocabulary.ts`.
|
|
355
|
+
|
|
356
|
+
Prior: 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
357
|
|
|
356
358
|
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
359
|
|
|
@@ -185,10 +185,17 @@ CONTENT_ADAPTER=mdx
|
|
|
185
185
|
# only sign-in. It must be an https: URL (http: only on a loopback host).
|
|
186
186
|
# BETTER_AUTH_URL=http://localhost:3000
|
|
187
187
|
#
|
|
188
|
-
# The hub Admin's absolute https URL (admin-team-invitation-accept).
|
|
189
|
-
#
|
|
188
|
+
# The hub Admin's absolute https URL (admin-team-invitation-accept).
|
|
189
|
+
# Required when the Admin is not at admin.<BETTER_AUTH_URL host> — a site at
|
|
190
|
+
# account.example.com derives admin.account.example.com, so an Admin at
|
|
191
|
+
# admin.example.com needs it set, here and on apps/api, whose invitation links
|
|
192
|
+
# use it (the Admin's Workforce page refuses to send until they open the
|
|
193
|
+
# Admin). A team invitation link mailed before invitations moved to the Admin
|
|
190
194
|
# (/account/invitations/<id>) is sent on to <Admin>/invitations/<id>. Unset,
|
|
191
|
-
# or not a valid https URL, it uses admin.<BETTER_AUTH_URL host>.
|
|
195
|
+
# or not a valid https URL, it uses admin.<BETTER_AUTH_URL host>. Use the
|
|
196
|
+
# production Admin's address, never a preview deployment's. For local
|
|
197
|
+
# development only: a stack on localhost derives no address, so set it to the
|
|
198
|
+
# local Admin's http://localhost:<port>.
|
|
192
199
|
# AILK_ADMIN_URL=https://admin.example.com
|
|
193
200
|
#
|
|
194
201
|
# Secret used to sign session cookies AND the email-verification tokens.
|
|
@@ -43,7 +43,7 @@ Raw HTML is allowed only when no `@working-theory/ui` component fits. Flag it in
|
|
|
43
43
|
- Animations: only `transform` and `opacity`. Never `transition-all`.
|
|
44
44
|
- Every interactive element needs hover, focus-visible, and active states.
|
|
45
45
|
|
|
46
|
-
The four widths above are the responsive contract. Brand reference files (logos, photos, colour and type notes) live in `brand_assets/` at the repo root; the site's own brand colours and fonts are set in `content/_site.mdx` under `brand.colors` and `brand.fonts`. The signed-out header button is set there too, as `header.cta` (`label`, `href`), with `header.signIn: link | hidden` choosing whether Sign in stays beside it as a text link — never by editing `app/[locale]/layout.tsx`. Each page's chrome is set there too (#10049, resolved by `lib/page-chrome.ts`): `header.style` (`full | bare | none`), `footer.style` (`columns | centered | closing | none`), `layout` (`deck | default`, the home's) and one `{ header, footer }` key per route family (`blog`, `docs`, `services`, …), with a page's own `header:` / `footer:` / `layout:` frontmatter winning over all of them. The closing footer alone also reads three site-level keys (#10550): `footer.locality` (the line above the email, winning over the identity's address), `footer.actions` (one or two `{ label, href }` site paths — the primary, then the secondary — in place of the auth links) and `footer.legalBar` (off by default: `true` moves the legal line into a full-width bottom bar, on the deck's closing slide its bottom edge). The cookie notice's look is set there too (#10555, #10721): `consent.appearance` is `compact` (the floating card, bottom-left) or `hairline` (the full-width band on the page ground); absent, it follows the design's `chromeStyle` — the band under `minimal`, else the card. Only the band waits for the minimal deck home's first slide to leave view (#7782); the card shows on load on every page.
|
|
46
|
+
The four widths above are the responsive contract. Brand reference files (logos, photos, colour and type notes) live in `brand_assets/` at the repo root; the site's own brand colours and fonts are set in `content/_site.mdx` under `brand.colors` and `brand.fonts`. The signed-out header button is set there too, as `header.cta` (`label`, `href`), with `header.signIn: link | hidden` choosing whether Sign in stays beside it as a text link — never by editing `app/[locale]/layout.tsx`. Each page's chrome is set there too (#10049, resolved by `lib/page-chrome.ts`): `header.style` (`full | mark-only | bare | none`), `footer.style` (`columns | centered | closing | none`) — one set of values each, `HEADER_STYLES` and `FOOTER_STYLES` in `@working-theory/validation`, shared with a look's `layout.nav` / `layout.footer` and the hub's design record (#12470 D7), `layout` (`deck | default`, the home's) and one `{ header, footer }` key per route family (`blog`, `docs`, `services`, …), with a page's own `header:` / `footer:` / `layout:` frontmatter winning over all of them. The closing footer alone also reads three site-level keys (#10550): `footer.locality` (the line above the email, winning over the identity's address), `footer.actions` (one or two `{ label, href }` site paths — the primary, then the secondary — in place of the auth links) and `footer.legalBar` (off by default: `true` moves the legal line into a full-width bottom bar, on the deck's closing slide its bottom edge). The cookie notice's look is set there too (#10555, #10721): `consent.appearance` is `compact` (the floating card, bottom-left) or `hairline` (the full-width band on the page ground); absent, it follows the design's `chromeStyle` — the band under `minimal`, else the card. Only the band waits for the minimal deck home's first slide to leave view (#7782); the card shows on load on every page.
|
|
47
47
|
|
|
48
48
|
## Local dev
|
|
49
49
|
|
|
@@ -1129,9 +1129,18 @@ A list page whose frontmatter sets `navOnly: true` (valid on a registry list typ
|
|
|
1129
1129
|
- **What is read as no record.** An absent `navigation` key (a hub older than #12400), `null`, a version that is not a positive integer, or a record this site's schema refuses — the last two with one warning per distinct refused field path (`[hub-site-config] navigation unreadable at <path>`), never a value. The schema check is the only barrier between a hub value and a link (`localeHref` passes any scheme through), so only its parsed output is kept; `identity` and `seo` are parsed as before in every case.
|
|
1130
1130
|
- **One translator.** `lib/site-navigation.ts`'s `navigationChrome(record, locale)` turns the record into the existing `Nav` and `Footer` props — no `@working-theory/ui` prop changes. A `page` target goes to the page's public path (`pagePath` at `SERVICES_PATH`, then `toPublicDocsHref`); a `path` or `url` target is used as stored, and the layout's three rewrite passes never run on a record. A label is the visitor's locale's text (a case-insensitive `byLocale` match), else its default text. Keys are positional and every one contains a dot (`rec.h0`, `rec.h1.g0.l2`, `rec.f0`), so a record label never replaces a `nav` message. Order is the record's; the hub has already removed every item whose page is not live. Every emitted address must be a site path or an `http:`/`https:` URL, else it throws; `safeNavigationChrome` catches that, logs one `[site-navigation] record not rendered (<error name>)` and answers `null`.
|
|
1131
1131
|
- **The layout.** With a translation (`app/[locale]/layout.tsx`), the header items and menus, the header button (its Sign in display the record's where it sets one, else `_site.mdx`'s `header.signIn`), the footer columns, the bottom bar (the record's links, then the cookie-settings link; no FAQ) and the closing footer's locality and actions come from it; a part the record leaves out is absent, never refilled from the files. The legal bar, the mark-only rule, "Your account", the bare header's back arrow, the social links and the logo are unchanged. Every page carries one `<meta name="ailk-nav-source">` in `<head>`, `content="record"` with `data-version="<n>"` or `content="files"`, whatever the header style; the element wrapping the site header, when one renders, carries the same as `data-nav-source` / `data-nav-version` (for #12403's and #12404's proof of render).
|
|
1132
|
-
- **Styles.** `resolveHomeChrome` (`lib/page-chrome.ts`) lays the record's `header
|
|
1132
|
+
- **Styles.** Style belongs to the hub's design record, not the navigation record (#12470 D7): `resolveHomeChrome` (`lib/page-chrome.ts`) lays the design record's `chrome` — `header`, `footer` and each route family's `header` / `footer` — over `_site.mdx`'s through `withDesignChrome`, where the record sets them, whenever the hub read carries a design record. A family's `path` stays the file's, and a page's own frontmatter still wins over both. The navigation record holds words and links only; a stored navigation row an older hub wrote with style keys is read without them. It answers the rendered navigation record as `navigation`, which is the layout's one read of it. A resolved `mark-only` header draws the logomark alone with no menus, whether a look, `_site.mdx`, a page or the design record set it.
|
|
1133
1133
|
- **The fallback, until #12404.** With no record, no hub read, or a failed read with nothing held, every page renders from `lib/nav-config.ts`, its `nav` labels and `_site.mdx` exactly as before; those stay read on every request until #12404 removes them.
|
|
1134
1134
|
|
|
1135
|
+
## A site's look from its hub
|
|
1136
|
+
|
|
1137
|
+
**A hub-connected site renders its colours, type treatments, layout and fonts from its workspace's design record when its hub read carries one (#12473).** The record (#12470, `siteDesignSchema`) rides the same `readHubSite()` read as the identity and the navigation: one request, one cache entry under `siteConfigTag()`, refreshed by the `site-config` purge a save awaits, so a save shows on the next request with no deploy. `lib/site-design.ts`'s `readSiteDesign()` reads two parts of it and nothing else: the settings the hub worked out from the record's library look and its differences (`design.settings`, `resolveDesign` on the hub — the site never works a look out and never imports the look catalogue) and the record's `brand.colors` / `brand.fonts`. `chrome` (the header and footer styles) is #12470's, laid over `_site.mdx` by `withDesignChrome` (§ A site's navigation from its hub); `look`, `from`, `changes`, `brand.logo` and every free-text field are never read.
|
|
1138
|
+
|
|
1139
|
+
- **What renders.** With worked-out settings, the theme is `compileDesignTheme(settings)` (`@working-theory/theme`, the compile `create-ailk` runs, held equal to it by `packages/create-ailk/__tests__/design-compile-parity.test.ts`) in both modes with its band set, and the layout knobs are `compileDesignLayout(settings.layout)` in place of the generated `lib/site-chrome.ts` — in the locale layout, `resolveHomeChrome` (its `knobs`, which the home's deck knobs default to), the deck pages' `inputsFor` and the root 404, by one rule: `design?.layout ?? siteChrome`. The record's brand colours and fonts lie over whichever theme renders (`hubBrandToSiteBrand`: the primary in both modes with a readable `primaryFg` for a plain hex, the first secondary as `accent`, one font for both roles or two for display and body). Each part the record leaves out is the files': `_site.mdx`'s `theme:` and `brand:`, the generated `site-chrome.ts` and `site-fonts.ts`. The ground is `matchedGround` of the rendered colours (#12500 D3).
|
|
1140
|
+
- **No record renders today's page.** `readSiteDesign()` answers `null` — and the theme head, `<html>` class and knobs are character for character the files' — with no record, a record whose `settings` is `null` and whose brand sets no colours or fonts (a record holding only `chrome`, as #12470's migration writes), no hub read, or a failed read with nothing held. A failed read serves the last good record.
|
|
1141
|
+
- **All or nothing, and the barrier.** Every check and translation runs in one `try`: the shared schemas again at render (a cached entry may predate a tightened grammar), no newline and balanced quotes in every font stack, a 65,536-character bound on what is compiled, and `recordThemeHead` — the one function that writes record CSS — refusing a record value holding a `<` or CSS holding `</`. Any failure renders theme, faces and layout from the files with one `[site-design] record not rendered (<error name>)` warning per record version.
|
|
1142
|
+
- **Fonts.** Every face in `LIBRARY_FONTS` (`@working-theory/theme`) is built into every site from its `@fontsource-variable` package by `lib/library-fonts.ts` (`next/font/local`, never preloaded, so a page downloads only the face it uses), and the record switches among them live: a stack's library family is written as its `var(--font-lib-<slug>)`, and `<html>` carries the classes of the faces the rendered stacks use. A face outside the library is built in at the next deploy: on a hub-connected production build, `next.config.mjs` reads the record once (5 s bound) and rewrites `lib/deploy-fonts.ts` with one `next/font/google` call per family next/font can build without a weight (a variable font with a `latin` subset), skipping any other with one warning naming its role; every other build, and any failed read, leaves the committed empty default, so a local hub-connected `next build` can leave that file changed. `designFontEffects` (`@working-theory/theme`) answers which of a record's font roles are `live` and which wait for the next deploy, for the record's read to answer the Admin.
|
|
1143
|
+
|
|
1135
1144
|
## AEO & performance
|
|
1136
1145
|
|
|
1137
1146
|
- Static rendering is the default. Don't introduce client rendering without a reason.
|
|
@@ -1148,7 +1157,9 @@ A list page whose frontmatter sets `navOnly: true` (valid on a registry list typ
|
|
|
1148
1157
|
- Don't reach into `apps/api` or `apps/mcp` from `apps/web`. They're peer apps — talk via HTTP/MCP.
|
|
1149
1158
|
- Don't commit images to `screenshots/` — only the `.gitkeep` is tracked.
|
|
1150
1159
|
|
|
1151
|
-
Last updated: 2026-11-
|
|
1160
|
+
Last updated: 2026-11-28 — § A site's look from its hub: the design record's worked-out settings and brand render the theme, layout knobs and fonts, each part else the files', with library faces built in and switched live and other faces written at the next deploy (#12473) — verified against `lib/{site-design,site-theme-head,library-fonts,deploy-fonts,page-chrome,deck-page}.ts`, `app/[locale]/layout.tsx`, `app/not-found.tsx`, `next.config.mjs` and `packages/theme/src/{design-compile,library-fonts}.ts`.
|
|
1161
|
+
|
|
1162
|
+
Prior: 2026-11-26 — § A site's navigation from its hub: the hub read carries the workspace's navigation record, one translator turns it into the Nav and Footer props, the record's styles win over `_site.mdx`'s where it sets them and only when it renders, and the `<head>` meta and the header wrapper name its source (#12401) — verified against `lib/{hub-site-config,site-navigation,page-chrome}.ts` and `app/[locale]/layout.tsx`.
|
|
1152
1163
|
|
|
1153
1164
|
Prior: 2026-11-25 — § A hub-connected site's identity: a single-tenant site with no spoke key reads its one workspace's identity and seo when it names an API address over `https:` or loopback, a refused keyless read is held as no rows, and a failed one waits 15 s (#12390) — verified against `lib/hub-site-config.ts`, `packages/api-client/src/http.ts`, `packages/api/src/routes/content/site-config.ts` and `packages/api/src/services/revalidation.ts`.
|
|
1154
1165
|
|
|
@@ -6,8 +6,7 @@
|
|
|
6
6
|
// Session-aware Nav actions — Sign in signed out, one "Your account" link signed in (#4984, #11095 D6)
|
|
7
7
|
// Auth route group — the marketing chrome is dropped on the five (auth) paths (#5963)
|
|
8
8
|
// Account area — the marketing chrome AND the consent Banner are dropped on /account paths (#7430)
|
|
9
|
-
// Site
|
|
10
|
-
// Design web faces — generated `lib/site-fonts.ts` → beneath `brand.fonts` (#7720)
|
|
9
|
+
// Site look — the hub design record, else the base look under `_site.mdx` `brand:` (#12473, #12477)
|
|
11
10
|
//
|
|
12
11
|
// Sits under app/[locale]/ and sets the <html lang> attribute to the
|
|
13
12
|
// active locale. next-intl's NextIntlClientProvider is wired here so
|
|
@@ -49,6 +48,7 @@ import {
|
|
|
49
48
|
} from "@working-theory/ui/chrome";
|
|
50
49
|
import {
|
|
51
50
|
cookiePurpose,
|
|
51
|
+
isBarHeader,
|
|
52
52
|
NEWSLETTER_FLOW_SLUG,
|
|
53
53
|
resolveConsentStatement,
|
|
54
54
|
SITE_CONSENT_CONFIG_DEFAULTS,
|
|
@@ -117,7 +117,7 @@ import {
|
|
|
117
117
|
withPublicServicesPaths,
|
|
118
118
|
} from "../../lib/services-path";
|
|
119
119
|
import { resolveContentRoot, resolveSiteBrand } from "../../lib/site-brand";
|
|
120
|
-
import {
|
|
120
|
+
import { BASE_SITE_LAYOUT, readSiteDesign, type SiteLayoutKnobs } from "../../lib/site-design";
|
|
121
121
|
import {
|
|
122
122
|
ACCOUNT_LABEL_KEY,
|
|
123
123
|
HEADER_CTA_LABEL_KEY,
|
|
@@ -134,6 +134,14 @@ import "../../lib/site-identity";
|
|
|
134
134
|
// live listicle's landing page gets its shelves and each entry its page
|
|
135
135
|
// (#7521). Inert without AILK_LISTING_PUBLIC_KEY or the paid package.
|
|
136
136
|
import "../../lib/listings";
|
|
137
|
+
// The design library's faces (#12473 D6): every page's stylesheet carries
|
|
138
|
+
// their `@font-face` rules, so a hub design record switches among them with
|
|
139
|
+
// no build. None is preloaded; a browser fetches one only when it is used.
|
|
140
|
+
import "../../lib/library-fonts";
|
|
141
|
+
// Registers the hub's look for each page type's sections with page-renderer,
|
|
142
|
+
// so a section takes the look's settings when shown (#12474). Inert on a site
|
|
143
|
+
// that is not hub-connected.
|
|
144
|
+
import "../../lib/section-look";
|
|
137
145
|
import { siteThemeHead } from "../../lib/site-theme-head";
|
|
138
146
|
import { siteHidden } from "../../lib/site-visibility";
|
|
139
147
|
import {
|
|
@@ -147,19 +155,6 @@ import { ConsentBanner } from "./consent-banner";
|
|
|
147
155
|
|
|
148
156
|
import { readSiteContactLines } from "../../lib/site-contact-lines";
|
|
149
157
|
|
|
150
|
-
/**
|
|
151
|
-
* The generated `siteChrome`, read through a widened type (#7740 D8): a
|
|
152
|
-
* scaffold generated before `deckPresentation` existed has no such member,
|
|
153
|
-
* so this compiles against both shapes of the generated file, as the home
|
|
154
|
-
* page reads `deckGrounds`. `colorMode` and `chromeStyle` (#7742 D1) likewise.
|
|
155
|
-
*/
|
|
156
|
-
const chrome: SiteChrome & {
|
|
157
|
-
deckPresentation?: true;
|
|
158
|
-
colorMode?: "light";
|
|
159
|
-
chromeStyle?: "minimal";
|
|
160
|
-
closingFooterPaths?: readonly string[];
|
|
161
|
-
} = siteChrome;
|
|
162
|
-
|
|
163
158
|
// ── Constants ────────────────────────────────────────────────────────────────
|
|
164
159
|
|
|
165
160
|
const DEFAULT_LOCALE = "en";
|
|
@@ -395,10 +390,21 @@ export default async function LocaleLayout({
|
|
|
395
390
|
// #11456 D4 — awaited before `readSiteContactLines`, so the held hub value
|
|
396
391
|
// the contact lines read is this render's.
|
|
397
392
|
const brand = await resolveSiteBrand();
|
|
398
|
-
// #
|
|
399
|
-
//
|
|
400
|
-
|
|
401
|
-
|
|
393
|
+
// #12473 D3/D4 — the hub design record, read once: its theme head (both
|
|
394
|
+
// theme modes gated by [data-theme="dark"], #1532 — one helper, shared with
|
|
395
|
+
// the minimal 404, #7742 D6), and its layout knobs. #12477 D1 — with no
|
|
396
|
+
// record, the base look: the theme's defaults under `_site.mdx`'s `brand:`,
|
|
397
|
+
// no face class on <html>, and `BASE_SITE_LAYOUT` (`resolveHomeChrome`
|
|
398
|
+
// applies the same rule).
|
|
399
|
+
const design = await readSiteDesign();
|
|
400
|
+
const chrome: SiteLayoutKnobs = design?.layout ?? BASE_SITE_LAYOUT;
|
|
401
|
+
const themeHead = siteThemeHead(design);
|
|
402
|
+
// #12500 D3 — a site whose light and dark palettes match is drawn on one
|
|
403
|
+
// ground in every mode, worked out from its colours: every cookie gets the
|
|
404
|
+
// same page, so no flash script runs and no theme switch renders. A site
|
|
405
|
+
// whose palettes differ follows the visitor's cookie, then their device.
|
|
406
|
+
const ground = themeHead.ground;
|
|
407
|
+
const themeMode: ThemeMode = ground ?? (await resolveThemeMode());
|
|
402
408
|
// #7742 D3/D5 — the minimal chrome: the closing slide, the hairline consent
|
|
403
409
|
// bar and the cue offset.
|
|
404
410
|
const isMinimalChrome = chrome.chromeStyle === "minimal";
|
|
@@ -465,7 +471,7 @@ export default async function LocaleLayout({
|
|
|
465
471
|
// from `nav-config.ts` and `_site.mdx` (removed by #12404). The home's
|
|
466
472
|
// chrome resolution (below) answers it, so the record's styles apply
|
|
467
473
|
// exactly when its links render.
|
|
468
|
-
const home = await resolveHomeChrome(locale,
|
|
474
|
+
const home = await resolveHomeChrome(locale, BASE_SITE_LAYOUT);
|
|
469
475
|
const recordNavigation = home.navigation;
|
|
470
476
|
const recordChrome = recordNavigation?.chrome ?? null;
|
|
471
477
|
if (recordChrome) Object.assign(navItemLabels, recordChrome.labels);
|
|
@@ -540,7 +546,7 @@ export default async function LocaleLayout({
|
|
|
540
546
|
// path is `/` for the default locale and `/<locale>` for every other one.
|
|
541
547
|
const homePath = locale === DEFAULT_LOCALE ? "/" : `/${locale}`;
|
|
542
548
|
|
|
543
|
-
// Deck home (#5612 D3): `
|
|
549
|
+
// Deck home (#5612 D3): a `home: "deck"` knob only ever applies
|
|
544
550
|
// `snap="mandatory"` + `deckHero` on the locale-root route — every other
|
|
545
551
|
// path renders byte-identically regardless of the knob. `x-pathname` is the
|
|
546
552
|
// same header `generateMetadata` above reads (forwarded by middleware.ts);
|
|
@@ -573,7 +579,10 @@ export default async function LocaleLayout({
|
|
|
573
579
|
locales: readLocales(),
|
|
574
580
|
}),
|
|
575
581
|
});
|
|
576
|
-
|
|
582
|
+
// #12470 D7 — `mark-only` is the full bar with the logomark alone, so it
|
|
583
|
+
// is a full header everywhere below but the mark and the menus.
|
|
584
|
+
const headerIsFull = isBarHeader(pageChrome.header);
|
|
585
|
+
const headerIsMarkOnly = pageChrome.header === "mark-only";
|
|
577
586
|
|
|
578
587
|
// Only a full header carries actions (#7718 D1, #10049). Under a bare or no
|
|
579
588
|
// header the auth links move to the footer — the auth pair signed out,
|
|
@@ -716,7 +725,8 @@ export default async function LocaleLayout({
|
|
|
716
725
|
// #10049 D5 — the hybrid deck home (a full header) keeps the full bar,
|
|
717
726
|
// pinned, with no `deckMorph`; a bare header on a non-deck home is the
|
|
718
727
|
// bare bar, unpinned.
|
|
719
|
-
|
|
728
|
+
// #12470 D7 — keyed on the resolved header, whoever set `mark-only`.
|
|
729
|
+
...(headerIsMarkOnly ? { logoDisplay: "mark" as const } : {}),
|
|
720
730
|
...(isHome && pageChrome.header === "bare"
|
|
721
731
|
? { ...(isDeckHome ? { sticky: true, deckMorph: true } : {}), bar: "bare" as const }
|
|
722
732
|
: {}),
|
|
@@ -823,20 +833,11 @@ export default async function LocaleLayout({
|
|
|
823
833
|
{ label: "Privacy Policy", href: "/privacy" },
|
|
824
834
|
{ label: "Terms of Service", href: "/terms" },
|
|
825
835
|
cookieSettingsLink,
|
|
826
|
-
...(
|
|
836
|
+
...(chrome.footer === "centered"
|
|
827
837
|
? [{ label: tNav("faq"), href: "/faq" }]
|
|
828
838
|
: []),
|
|
829
839
|
];
|
|
830
840
|
|
|
831
|
-
// The site's own declared colours (`content/_site.mdx` `theme:` + `brand:`)
|
|
832
|
-
// as a token overlay, the design's web faces (#7720) beneath `brand.fonts`,
|
|
833
|
-
// both theme modes gated by [data-theme="dark"] (#1532) and the site's shape
|
|
834
|
-
// settings after them — one helper, shared with the minimal 404 (#7742 D6).
|
|
835
|
-
// A site that declares no theme gets byte-for-byte the CSS it got before
|
|
836
|
-
// this wiring existed; with no design faces <html> gets no class.
|
|
837
|
-
// themeMode still drives the initial data-theme attribute below.
|
|
838
|
-
const themeHead = siteThemeHead();
|
|
839
|
-
|
|
840
841
|
return (
|
|
841
842
|
<html
|
|
842
843
|
lang={locale}
|
|
@@ -848,9 +849,9 @@ export default async function LocaleLayout({
|
|
|
848
849
|
>
|
|
849
850
|
<head>
|
|
850
851
|
{/* Flash-prevention: runs synchronously before any styled element.
|
|
851
|
-
Not
|
|
852
|
-
the script would apply the OS dark preference. */}
|
|
853
|
-
{
|
|
852
|
+
Not on a matching look (#12500 D3) — no mode changes what is
|
|
853
|
+
painted, and the script would apply the OS dark preference. */}
|
|
854
|
+
{ground !== undefined ? null : (
|
|
854
855
|
<script
|
|
855
856
|
data-testid="theme-flash-prevention"
|
|
856
857
|
dangerouslySetInnerHTML={{ __html: FLASH_PREVENTION_SCRIPT }}
|
|
@@ -904,6 +905,14 @@ export default async function LocaleLayout({
|
|
|
904
905
|
content={recordNavigation ? "record" : "files"}
|
|
905
906
|
{...(recordNavigation ? { "data-version": String(recordNavigation.version) } : {})}
|
|
906
907
|
/>
|
|
908
|
+
{/* #12476 D7 — which look this page renders, from the record (at its
|
|
909
|
+
version) or, as "files", none: the base look since #12477. One
|
|
910
|
+
per page. */}
|
|
911
|
+
<meta
|
|
912
|
+
name="ailk-design-source"
|
|
913
|
+
content={design ? "record" : "files"}
|
|
914
|
+
{...(design ? { "data-version": String(design.version) } : {})}
|
|
915
|
+
/>
|
|
907
916
|
</head>
|
|
908
917
|
<body>
|
|
909
918
|
{/* Skip link (operator ruling 2026-09-23): the first Tab stop on every
|
|
@@ -952,7 +961,7 @@ export default async function LocaleLayout({
|
|
|
952
961
|
// footer divider on that same edge.
|
|
953
962
|
gutters="none"
|
|
954
963
|
bannerPlacement="above-nav"
|
|
955
|
-
{...(
|
|
964
|
+
{...(chrome.announcementBanner
|
|
956
965
|
? {
|
|
957
966
|
banner: (
|
|
958
967
|
<Banner
|
|
@@ -1023,8 +1032,9 @@ export default async function LocaleLayout({
|
|
|
1023
1032
|
// 2026-11-09 — the arrow goes to the page's served parent
|
|
1024
1033
|
// (`bareBackLink` above), superseding #7744 D7's
|
|
1025
1034
|
// people-slide rule.
|
|
1026
|
-
// #10049 D1 — `none` renders no header;
|
|
1027
|
-
// header shows
|
|
1035
|
+
// #10049 D1 — `none` renders no header; #12470 D7 — a
|
|
1036
|
+
// resolved `mark-only` header shows no menus, and a `full`
|
|
1037
|
+
// one shows them even on a `mark-only` design.
|
|
1028
1038
|
// #12401 (SEC-12403-3) — the wrapper names the header's
|
|
1029
1039
|
// source, `record` with its version or `files`, so the
|
|
1030
1040
|
// import (#12403) can prove which one a site renders;
|
|
@@ -1042,14 +1052,7 @@ export default async function LocaleLayout({
|
|
|
1042
1052
|
) : (
|
|
1043
1053
|
<Nav
|
|
1044
1054
|
{...navProps}
|
|
1045
|
-
navItems={
|
|
1046
|
-
siteChrome.nav === "mark-only" &&
|
|
1047
|
-
(session !== null ||
|
|
1048
|
-
pageChrome.header === "bare" ||
|
|
1049
|
-
pageChrome.headerFromTemplate)
|
|
1050
|
-
? []
|
|
1051
|
-
: publicNavItems
|
|
1052
|
-
}
|
|
1055
|
+
navItems={headerIsMarkOnly ? [] : publicNavItems}
|
|
1053
1056
|
/>
|
|
1054
1057
|
)}
|
|
1055
1058
|
</div>
|
|
@@ -1113,8 +1116,8 @@ export default async function LocaleLayout({
|
|
|
1113
1116
|
// #7823 — the minimal closing slide's actions are a button,
|
|
1114
1117
|
// then a text link; Footer reads the style from this.
|
|
1115
1118
|
{...(isMinimalChrome ? { chromeStyle: "minimal" as const } : {})}
|
|
1116
|
-
// #
|
|
1117
|
-
showThemeToggle={
|
|
1119
|
+
// #12500 D3 — no theme switch on a matching look: it would change nothing.
|
|
1120
|
+
showThemeToggle={ground === undefined}
|
|
1118
1121
|
{...(footerSignup !== undefined && { subscribe: footerSignup })}
|
|
1119
1122
|
bottomBarAlign="content"
|
|
1120
1123
|
copyrightText={copyrightText}
|
|
@@ -11,8 +11,10 @@
|
|
|
11
11
|
// theme instead: its own <html> and <body> (the documented pattern for a root
|
|
12
12
|
// not-found under a pass-through root layout), the theme variables and font
|
|
13
13
|
// class the locale layout emits (`siteThemeHead`), the site's mark, one
|
|
14
|
-
// statement and a back link. `data-theme` is
|
|
15
|
-
//
|
|
14
|
+
// statement and a back link. `data-theme` is the site's ground when its two
|
|
15
|
+
// palettes match (#12500 D3), else light. Without the knob it renders today's
|
|
16
|
+
// markup. #12473 D4 / #12477 D1 — the knob and the theme are the hub design
|
|
17
|
+
// record's; with no record the knob is unset, so the base 404 renders.
|
|
16
18
|
import "./globals.css";
|
|
17
19
|
|
|
18
20
|
import { BrandLogo } from "@working-theory/ui/blocks";
|
|
@@ -20,17 +22,14 @@ import { Heading, Link, Text } from "@working-theory/ui/primitives";
|
|
|
20
22
|
import type { ReactElement } from "react";
|
|
21
23
|
|
|
22
24
|
import { SITE_NAME } from "../lib/site-brand";
|
|
23
|
-
import {
|
|
25
|
+
import { readSiteDesign, type RenderedDesign } from "../lib/site-design";
|
|
24
26
|
import { siteLogo } from "../lib/site-logo";
|
|
25
27
|
import { siteThemeHead } from "../lib/site-theme-head";
|
|
26
28
|
|
|
27
|
-
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
function ThemedNotFound(): ReactElement {
|
|
31
|
-
const head = siteThemeHead();
|
|
29
|
+
function ThemedNotFound({ design }: { design: RenderedDesign | null }): ReactElement {
|
|
30
|
+
const head = siteThemeHead(design);
|
|
32
31
|
return (
|
|
33
|
-
<html lang="en" data-theme="light" className={head.fontClassName}>
|
|
32
|
+
<html lang="en" data-theme={head.ground ?? "light"} className={head.fontClassName}>
|
|
34
33
|
<head>
|
|
35
34
|
<style data-ailk="theme-vars" dangerouslySetInnerHTML={{ __html: head.css }} />
|
|
36
35
|
</head>
|
|
@@ -57,8 +56,9 @@ function ThemedNotFound(): ReactElement {
|
|
|
57
56
|
);
|
|
58
57
|
}
|
|
59
58
|
|
|
60
|
-
export default function NotFound(): ReactElement {
|
|
61
|
-
|
|
59
|
+
export default async function NotFound(): Promise<ReactElement> {
|
|
60
|
+
const design = await readSiteDesign();
|
|
61
|
+
if (design?.layout?.chromeStyle === "minimal") return <ThemedNotFound design={design} />;
|
|
62
62
|
return (
|
|
63
63
|
<main className="flex min-h-screen flex-col items-center justify-center gap-4 bg-(--color-bg) p-card text-(--color-fg)">
|
|
64
64
|
<Heading level={1} visual={3}>
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
|
|
28
28
|
import { sealMcpCallbacks } from "@working-theory/auth/mcp-continuation";
|
|
29
29
|
import type { PrismaClient } from "@working-theory/database";
|
|
30
|
-
import { MCP_SCOPES } from "@working-theory/validation";
|
|
30
|
+
import { DEFAULT_MCP_SCOPES, MCP_SCOPES, membershipReaches } from "@working-theory/validation";
|
|
31
31
|
import { type BetterAuthPlugin, betterAuth } from "better-auth";
|
|
32
32
|
import { prismaAdapter } from "better-auth/adapters/prisma";
|
|
33
33
|
import type { AuthMiddleware } from "better-auth/api";
|
|
@@ -265,7 +265,8 @@ export function mcpAuthorizationServer(deps: McpOAuthDeps) {
|
|
|
265
265
|
accessTokenExpiresIn: MCP_ACCESS_TOKEN_TTL_SECONDS,
|
|
266
266
|
refreshTokenExpiresIn: MCP_REFRESH_TOKEN_TTL_SECONDS,
|
|
267
267
|
scopes: [...MCP_SCOPES],
|
|
268
|
-
|
|
268
|
+
// #12470 D3 — a client naming no scope is never given an opt-in one.
|
|
269
|
+
defaultScope: ["offline_access", ...DEFAULT_MCP_SCOPES].join(" "),
|
|
269
270
|
metadata: { scopes_supported: ["offline_access", ...MCP_SCOPES] },
|
|
270
271
|
},
|
|
271
272
|
}),
|
|
@@ -569,6 +570,50 @@ export interface CreateAuthDeps {
|
|
|
569
570
|
prisma?: PrismaClient;
|
|
570
571
|
}
|
|
571
572
|
|
|
573
|
+
/**
|
|
574
|
+
* The person's workspaces for the MCP consent step and token self-check
|
|
575
|
+
* (#10357 D4): `listTenancy`'s rule — every workspace of every organization
|
|
576
|
+
* they belong to that their membership reaches (#12463 D3), with that
|
|
577
|
+
* membership's role. Exported so the consent flow suite drives this read.
|
|
578
|
+
*/
|
|
579
|
+
/**
|
|
580
|
+
* A deactivated membership counts as none (#11106 D6): its organization's
|
|
581
|
+
* workspaces leave the consent list and the token self-check, and return on
|
|
582
|
+
* reactivation.
|
|
583
|
+
*/
|
|
584
|
+
export function readMembershipsFrom(
|
|
585
|
+
prisma: { membership: Pick<PrismaClient["membership"], "findMany"> },
|
|
586
|
+
): (userId: string) => Promise<McpMembership[]> {
|
|
587
|
+
return async (userId) => {
|
|
588
|
+
const memberships = await prisma.membership.findMany({
|
|
589
|
+
where: { userId, deactivatedAt: null },
|
|
590
|
+
select: {
|
|
591
|
+
role: true,
|
|
592
|
+
allWorkspaces: true,
|
|
593
|
+
workspaceGrants: { select: { workspaceId: true } },
|
|
594
|
+
organization: {
|
|
595
|
+
select: {
|
|
596
|
+
name: true,
|
|
597
|
+
workspaces: { select: { id: true, name: true }, orderBy: { createdAt: "asc" } },
|
|
598
|
+
},
|
|
599
|
+
},
|
|
600
|
+
},
|
|
601
|
+
orderBy: { createdAt: "asc" },
|
|
602
|
+
});
|
|
603
|
+
// #12463 D3 — only the workspaces each membership reaches.
|
|
604
|
+
return memberships.flatMap((m) =>
|
|
605
|
+
m.organization.workspaces
|
|
606
|
+
.filter((w) => membershipReaches(m, w.id))
|
|
607
|
+
.map((w) => ({
|
|
608
|
+
workspaceId: w.id,
|
|
609
|
+
workspaceName: w.name,
|
|
610
|
+
organizationName: m.organization.name,
|
|
611
|
+
role: m.role,
|
|
612
|
+
})),
|
|
613
|
+
);
|
|
614
|
+
};
|
|
615
|
+
}
|
|
616
|
+
|
|
572
617
|
/**
|
|
573
618
|
* Build a Better Auth instance parameterised by deps.
|
|
574
619
|
*
|
|
@@ -798,39 +843,7 @@ export function createAuth(deps: CreateAuthDeps = {}) {
|
|
|
798
843
|
}
|
|
799
844
|
};
|
|
800
845
|
|
|
801
|
-
|
|
802
|
-
* The person's workspaces for the MCP consent step and token self-check
|
|
803
|
-
* (#10357 D4): `listTenancy`'s rule — every workspace of every organization
|
|
804
|
-
* they belong to, with that membership's role.
|
|
805
|
-
*/
|
|
806
|
-
/**
|
|
807
|
-
* A deactivated membership counts as none (#11106 D6): its organization's
|
|
808
|
-
* workspaces leave the consent list and the token self-check, and return on
|
|
809
|
-
* reactivation.
|
|
810
|
-
*/
|
|
811
|
-
const readMemberships = async (userId: string): Promise<McpMembership[]> => {
|
|
812
|
-
const memberships = await prisma.membership.findMany({
|
|
813
|
-
where: { userId, deactivatedAt: null },
|
|
814
|
-
select: {
|
|
815
|
-
role: true,
|
|
816
|
-
organization: {
|
|
817
|
-
select: {
|
|
818
|
-
name: true,
|
|
819
|
-
workspaces: { select: { id: true, name: true }, orderBy: { createdAt: "asc" } },
|
|
820
|
-
},
|
|
821
|
-
},
|
|
822
|
-
},
|
|
823
|
-
orderBy: { createdAt: "asc" },
|
|
824
|
-
});
|
|
825
|
-
return memberships.flatMap((m) =>
|
|
826
|
-
m.organization.workspaces.map((w) => ({
|
|
827
|
-
workspaceId: w.id,
|
|
828
|
-
workspaceName: w.name,
|
|
829
|
-
organizationName: m.organization.name,
|
|
830
|
-
role: m.role,
|
|
831
|
-
})),
|
|
832
|
-
);
|
|
833
|
-
};
|
|
846
|
+
const readMemberships = readMembershipsFrom(prisma);
|
|
834
847
|
const mcpServer = baseURL ? mcpAuthorizationServer({ readMemberships, clearOutsideSendSwitches }) : [];
|
|
835
848
|
|
|
836
849
|
/** The phone step (#11106 D9); its sign-in and reset paths close with it. */
|