create-ailk 0.41.0 → 0.42.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.
Files changed (39) hide show
  1. package/README.md +31 -1
  2. package/component-catalog.json +6 -0
  3. package/dist/add-route.d.ts +2 -6
  4. package/dist/add-route.js +2 -43
  5. package/dist/export-content.d.ts +10 -3
  6. package/dist/export-content.js +61 -9
  7. package/dist/language-import.js +5 -2
  8. package/dist/lib/env-catalog.js +4 -0
  9. package/dist/lib/import-mdx.d.ts +2 -0
  10. package/dist/lib/import-mdx.js +46 -22
  11. package/dist/magnet-page.d.ts +36 -0
  12. package/dist/magnet-page.js +70 -0
  13. package/dist/migrate-content.d.ts +12 -3
  14. package/dist/migrate-content.js +62 -11
  15. package/dist/routes.d.ts +38 -2
  16. package/dist/routes.js +586 -27
  17. package/dist/surfaces.d.ts +16 -0
  18. package/dist/surfaces.js +36 -0
  19. package/dist/update.d.ts +1 -1
  20. package/dist/update.js +24 -2
  21. package/package.json +3 -3
  22. package/templates/.claude/hooks/template-guard.sh +145 -36
  23. package/templates/CLAUDE.md +1 -1
  24. package/templates/apps/api/CLAUDE.md +2 -0
  25. package/templates/apps/mcp/CLAUDE.md +9 -3
  26. package/templates/apps/web/CLAUDE.md +16 -2
  27. package/templates/apps/web/app/[locale]/layout.tsx +6 -3
  28. package/templates/apps/web/app/llms.txt/__tests__/site-listing.test.ts +28 -0
  29. package/templates/apps/web/app/sitemap.xml/__tests__/site-listing.test.ts +28 -0
  30. package/templates/apps/web/lib/__tests__/page-chrome.test.ts +24 -0
  31. package/templates/apps/web/lib/__tests__/route-paths.test.ts +57 -0
  32. package/templates/apps/web/lib/mcp-oauth.ts +14 -10
  33. package/templates/apps/web/lib/page-chrome.ts +8 -5
  34. package/templates/apps/web/lib/route-paths.ts +22 -0
  35. package/templates/apps/web/lib/services-path.ts +27 -18
  36. package/templates/apps/web/middleware.ts +2 -1
  37. package/templates/apps/web/next.config.mjs +123 -2
  38. package/templates/apps/web/src/lib/routes.ts +4 -2
  39. package/versions.json +51 -51
@@ -31,8 +31,17 @@ export interface MigrateContentOptions {
31
31
  * A fetch that sends `GET`s through `inner` and never sends a write: a `POST`
32
32
  * is answered `201` and a `PATCH` `200` locally, with the one member of a
33
33
  * write's answer `importMdx` reads (`data.locale`), and the structure write's
34
- * `PUT` (#10534) `200` as a layout unchanged (`data.written: false`). Any
35
- * other method throws.
34
+ * `PUT` (#10534) `200`. Any other method throws.
35
+ *
36
+ * The `PUT` answers `data.written` from the layout the hub's draft read
37
+ * returned (#11749 D4): each 200 `GET`'s `data.structure` is kept per page
38
+ * address, and a `PUT` to that address's `/structure` URL answers
39
+ * `written: true` when its body's `structure` is not `isDeepStrictEqual` to
40
+ * it — the hub's own comparison. Any other `PUT` (an equal layout, an address
41
+ * never read, a read with no `structure` member, no string body, a `Request`
42
+ * input) answers `written: false`. It never answers 409: a live tip with a
43
+ * changed layout is planned `update`, what `--apply` reports after its
44
+ * re-draft. The memory lasts one run, as the transport does.
36
45
  */
37
46
  export declare function readOnlyFetch(inner: typeof globalThis.fetch, locale: string): typeof globalThis.fetch;
38
47
  /** What a dry run prints when the site's contract cannot give a verdict. */
@@ -51,5 +60,5 @@ export interface MigrateContentArgs {
51
60
  languageSeed: string | undefined;
52
61
  help: boolean;
53
62
  }
54
- export declare const MIGRATE_CONTENT_HELP = "create-ailk migrate-content \u2014 import an existing site's pages into its workspace.\n\nUsage:\n AILK_AGENT_KEY=<key> create-ailk migrate-content [<dir>] [--apply] [--api-url <origin>] [--workspace <wksp_id>] [--language-seed <file>]\n\nArguments:\n <dir> The site. Defaults to the current dir.\n\nOptions:\n --apply Write the pages. Without it the command reads the\n workspace, prints what it would do, and writes\n nothing.\n --api-url <origin> The API origin that holds the workspace \u2014 on a\n spoke, its hub's. Else AILK_API_URL. https: only\n (http: on localhost or 127.0.0.1).\n --workspace <wksp_id> The workspace the pages are written to. Else\n AILK_WORKSPACE_ID.\n --language-seed <file> A Language seed file (language/<entity>.json).\n Each of its topics becomes one Topic holding all\n its keywords. Its items are not read.\n -h, --help Show this help.\n\nEach content/en/<Type>/<slug>.mdx page (and each legacy\ncontent/<Type>/<slug>.mdx) is written to the workspace as a draft through\nthe API's content routes, with the agent key, which is read from\nAILK_AGENT_KEY only and needs the content-edit grant. Nothing is published,\nso the live site does not change. The site needs no .ailk-site-manifest.json\nand may be a spoke; its dependencies must be installed. A page whose\nfrontmatter carries sections is converted: its words are written to the\npage's Markdown and its sections to its layout.\n\nEach FAQ item and glossary-index term becomes one Language item of its kind,\nset Live when the run creates it, and its section pins the items in the\norder the file lists them. A question on several pages is one item, with\nthe FAQ page's words (the glossary page's, for a term). Lines prefixed\nlanguage: report each item, and each page the database read will not show\nas its file does. An API with no Language collection leaves them inline.\n\nWith --language-seed, each topic in the seed file is written after the\npages as one Topic: its name, its pillar page, and every keyword with its\nmonthly searches and as-of date, its primary marked. A Topic the workspace\nalready holds keeps its spelling, notes and newer numbers, and gains what it\nlacks. Lines prefixed language: topic/ report each one; a second --apply\nreports every topic unchanged. A seed file that is not readable, or whose\ntopics the hub would refuse, is refused before anything is sent.\n\nWhen the site has apps/web/content, each blog post and docs page in it is\nwritten too: apps/web/content/en/blog/<slug>.mdx (or <slug>/index.mdx) as a\nBlogPosting, or one series down, blog/<series>/<post>.mdx, as a BlogPosting\nwhose parent is the series; the same under docs as a DocsDetail, and each\ndirectory's own index.mdx as its BlogList or DocsList index. A file the walk\nskips is listed with the rule it failed. Their lines are prefixed\neditorial: \u2014 each outcome's root is content or editorial.\n\nA dry run prints create, update, unchanged, skipped or failed per page. It\ncannot see a write the API would refuse at --apply (a conflict or a server\nerror), nor a layout change on a page whose words did not change, and a\npage whose content fails its page type is planned and saved\nwith errors the editor shows, not failed. --apply prints created, updated,\nunchanged, skipped or failed per page, so a re-run is safe. Exit 0 when no\npage failed, 1 when any did, 2 on a refusal (nothing is sent).\n\nEvery page is written with a live-source mark: its words already ship on the\nlive site, so the hub lists a heading the page type's template asks for and\nthe page lacks as advisory, and publish takes the page. Editing the page's\nwords in the hub drops the mark. A dry run prints a publish line after each\npage: publishable, the advisory headings the hub will list, or the status and\nfindings that will stop the publish. The verdict is the site's installed\n@working-theory/validation's, not the hub's; it sees no library-file finding\nand no layout the hub repairs differently. A site whose validation predates\nthe live-source report prints one \"publish: not checked\" line instead.\n";
63
+ export declare const MIGRATE_CONTENT_HELP = "create-ailk migrate-content \u2014 import an existing site's pages into its workspace.\n\nUsage:\n AILK_AGENT_KEY=<key> create-ailk migrate-content [<dir>] [--apply] [--api-url <origin>] [--workspace <wksp_id>] [--language-seed <file>]\n\nArguments:\n <dir> The site. Defaults to the current dir.\n\nOptions:\n --apply Write the pages. Without it the command reads the\n workspace, prints what it would do, and writes\n nothing.\n --api-url <origin> The API origin that holds the workspace \u2014 on a\n spoke, its hub's. Else AILK_API_URL. https: only\n (http: on localhost or 127.0.0.1).\n --workspace <wksp_id> The workspace the pages are written to. Else\n AILK_WORKSPACE_ID.\n --language-seed <file> A Language seed file (language/<entity>.json).\n Each of its topics becomes one Topic holding all\n its keywords. Its items are not read.\n -h, --help Show this help.\n\nEach content/en/<Type>/<slug>.mdx page (and each legacy\ncontent/<Type>/<slug>.mdx) is written to the workspace as a draft through\nthe API's content routes, with the agent key, which is read from\nAILK_AGENT_KEY only and needs the content-edit grant. Nothing is published,\nso the live site does not change. The site needs no .ailk-site-manifest.json\nand may be a spoke; its dependencies must be installed. A page whose\nfrontmatter carries sections is converted: its words are written to the\npage's Markdown and its sections to its layout.\n\nEach FAQ item and glossary-index term becomes one Language item of its kind,\nset Live when the run creates it, and its section pins the items in the\norder the file lists them. A question on several pages is one item, with\nthe FAQ page's words (the glossary page's, for a term). Lines prefixed\nlanguage: report each item, and each page the database read will not show\nas its file does. An API with no Language collection leaves them inline.\n\nWith --language-seed, each topic in the seed file is written after the\npages as one Topic: its name, its pillar page, and every keyword with its\nmonthly searches and as-of date, its primary marked. A Topic the workspace\nalready holds keeps its spelling, notes and newer numbers, and gains what it\nlacks. Lines prefixed language: topic/ report each one; a second --apply\nreports every topic unchanged. A seed file that is not readable, or whose\ntopics the hub would refuse, is refused before anything is sent.\n\nWhen the site has apps/web/content, each blog post and docs page in it is\nwritten too: apps/web/content/en/blog/<slug>.mdx (or <slug>/index.mdx) as a\nBlogPosting, or one series down, blog/<series>/<post>.mdx, as a BlogPosting\nwhose parent is the series; the same under docs as a DocsDetail, and each\ndirectory's own index.mdx as its BlogList or DocsList index. A file the walk\nskips is listed with the rule it failed. Their lines are prefixed\neditorial: \u2014 each outcome's root is content or editorial.\n\nA dry run prints create, update, unchanged, skipped or failed per page. It\ncannot see a write the API would refuse at --apply (a conflict or a server\nerror), and a page whose content fails its page type is planned and saved\nwith errors the editor shows, not failed. An update whose words already\nmatch the workspace prints \"update \u2014 layout only\". A layout change to a page\nwhose draft is its live version is saved as a new draft with the same words,\nso the live site does not change until the page is published. --apply prints created, updated,\nunchanged, skipped or failed per page, so a re-run is safe. Exit 0 when no\npage failed, 1 when any did, 2 on a refusal (nothing is sent).\n\nEvery page is written with a live-source mark: its words already ship on the\nlive site, so the hub lists a heading the page type's template asks for and\nthe page lacks as advisory, and publish takes the page. Editing the page's\nwords in the hub drops the mark. A dry run prints a publish line after each\npage: publishable, the advisory headings the hub will list, or the status and\nfindings that will stop the publish. The verdict is the site's installed\n@working-theory/validation's, not the hub's; it sees no library-file finding\nand no layout the hub repairs differently. A site whose validation predates\nthe live-source report prints one \"publish: not checked\" line instead.\n";
55
64
  export declare function parseMigrateContentArgs(argv: string[]): MigrateContentArgs;
@@ -34,7 +34,7 @@
34
34
  */
35
35
  import { readFileSync } from "node:fs";
36
36
  import { join, resolve } from "node:path";
37
- import { parseArgs } from "node:util";
37
+ import { isDeepStrictEqual, parseArgs } from "node:util";
38
38
  import { languageLines, languageOffLine, seedTopics, seedTopicsOf, topicSeedLines, withLanguage, } from "./language-import.js";
39
39
  import { formatImportMdxReport, importMdx, isDirectory, loadSiteMdxAdapter, outcomePath, } from "./lib/import-mdx.js";
40
40
  import { ParseError } from "./parse-args.js";
@@ -63,18 +63,64 @@ function given(value) {
63
63
  * A fetch that sends `GET`s through `inner` and never sends a write: a `POST`
64
64
  * is answered `201` and a `PATCH` `200` locally, with the one member of a
65
65
  * write's answer `importMdx` reads (`data.locale`), and the structure write's
66
- * `PUT` (#10534) `200` as a layout unchanged (`data.written: false`). Any
67
- * other method throws.
66
+ * `PUT` (#10534) `200`. Any other method throws.
67
+ *
68
+ * The `PUT` answers `data.written` from the layout the hub's draft read
69
+ * returned (#11749 D4): each 200 `GET`'s `data.structure` is kept per page
70
+ * address, and a `PUT` to that address's `/structure` URL answers
71
+ * `written: true` when its body's `structure` is not `isDeepStrictEqual` to
72
+ * it — the hub's own comparison. Any other `PUT` (an equal layout, an address
73
+ * never read, a read with no `structure` member, no string body, a `Request`
74
+ * input) answers `written: false`. It never answers 409: a live tip with a
75
+ * changed layout is planned `update`, what `--apply` reports after its
76
+ * re-draft. The memory lasts one run, as the transport does.
68
77
  */
69
78
  export function readOnlyFetch(inner, locale) {
79
+ const layouts = new Map();
80
+ /** Whether the hub would write a dry run's layout `PUT` (#11749 D4). */
81
+ function layoutWritten(input, init) {
82
+ if (input instanceof Request || typeof init?.body !== "string")
83
+ return false;
84
+ const url = String(input);
85
+ const address = url.replace(/\/structure(?=\?|$)/, "");
86
+ if (address === url || !layouts.has(address))
87
+ return false;
88
+ let sent;
89
+ try {
90
+ sent = JSON.parse(init.body)?.structure;
91
+ }
92
+ catch {
93
+ return false;
94
+ }
95
+ return !isDeepStrictEqual(sent, layouts.get(address));
96
+ }
70
97
  return (async (input, init) => {
71
98
  const method = (init?.method ?? (input instanceof Request ? input.method : "GET")).toUpperCase();
72
- if (method === "GET")
73
- return inner(input, init);
99
+ if (method === "GET") {
100
+ const response = await inner(input, init);
101
+ if (response.status === 200) {
102
+ const url = input instanceof Request ? input.url : String(input);
103
+ try {
104
+ // Parsed here, never by `Response.json()`, so both sides of the
105
+ // comparison are this module's plain objects.
106
+ const data = JSON.parse(await response.clone().text())?.data;
107
+ if (data !== null && typeof data === "object" && "structure" in data) {
108
+ layouts.set(url, data.structure);
109
+ }
110
+ else {
111
+ layouts.delete(url);
112
+ }
113
+ }
114
+ catch {
115
+ // Not JSON: nothing is recorded; the response goes back as it came.
116
+ }
117
+ }
118
+ return response;
119
+ }
74
120
  if (method !== "POST" && method !== "PATCH" && method !== "PUT") {
75
121
  throw new Error(`a dry run sends no ${method} request`);
76
122
  }
77
- const data = method === "PUT" ? { locale, written: false } : { locale };
123
+ const data = method === "PUT" ? { locale, written: layoutWritten(input, init) } : { locale };
78
124
  return new Response(JSON.stringify({ ok: true, data }), {
79
125
  status: method === "POST" ? 201 : 200,
80
126
  headers: { "content-type": "application/json" },
@@ -92,8 +138,11 @@ const PLAN_VERB = {
92
138
  };
93
139
  function planLine(outcome) {
94
140
  const verb = PLAN_VERB[outcome.result];
95
- return "reason" in outcome
96
- ? `${outcomePath(outcome)}: ${verb} — ${outcome.reason}`
141
+ if ("reason" in outcome)
142
+ return `${outcomePath(outcome)}: ${verb} — ${outcome.reason}`;
143
+ // #11749 D5 — an update whose words already match says so.
144
+ return outcome.layoutOnly === true
145
+ ? `${outcomePath(outcome)}: ${verb} — layout only`
97
146
  : `${outcomePath(outcome)}: ${verb}`;
98
147
  }
99
148
  // ── The publish verdict (#10898 D6) ─────────────────────────────────────────
@@ -321,9 +370,11 @@ editorial: — each outcome's root is content or editorial.
321
370
 
322
371
  A dry run prints create, update, unchanged, skipped or failed per page. It
323
372
  cannot see a write the API would refuse at --apply (a conflict or a server
324
- error), nor a layout change on a page whose words did not change, and a
325
- page whose content fails its page type is planned and saved
326
- with errors the editor shows, not failed. --apply prints created, updated,
373
+ error), and a page whose content fails its page type is planned and saved
374
+ with errors the editor shows, not failed. An update whose words already
375
+ match the workspace prints "update — layout only". A layout change to a page
376
+ whose draft is its live version is saved as a new draft with the same words,
377
+ so the live site does not change until the page is published. --apply prints created, updated,
327
378
  unchanged, skipped or failed per page, so a re-run is safe. Exit 0 when no
328
379
  page failed, 1 when any did, 2 on a refusal (nothing is sent).
329
380
 
package/dist/routes.d.ts CHANGED
@@ -87,6 +87,22 @@ export declare function isGenerated(text: string): boolean;
87
87
  export declare function customizationsRecord(siteDir: string): (sitePath: string) => string | undefined;
88
88
  /** Whether `<siteDir>/customizations.yaml` records `sitePath` — any entry, any path form or glob (the generator's own reading). */
89
89
  export declare function isRecordedRoute(siteDir: string, sitePath: string): boolean;
90
+ /**
91
+ * The site's route renames (#11385 D6): `content/_site.mdx`'s renamable
92
+ * family paths as `{ <convention segment>: <served segment> }` —
93
+ * `{ meet: "meetings" }`, `{ "case-studies": "work" }`. Throws
94
+ * `RoutesRefusedError`, naming the key and the line, for frontmatter it
95
+ * cannot read with certainty; no file is `{}`.
96
+ */
97
+ export declare function readSiteRouteRenames(siteDir: string): Record<string, string>;
98
+ /**
99
+ * A copy of `@working-theory/templates`' `routeRenameRefusals` (#11385 D7),
100
+ * message for message — `tests/routes/route-renames-parity.test.ts` runs both
101
+ * over one table. `renames` is family-keyed; the served set is
102
+ * `ROUTES_FIRST_SEGMENTS` (the routes map's first segments) plus
103
+ * `extraServed`.
104
+ */
105
+ export declare function routeRenameRefusals(renames: Readonly<Record<string, string>>, conventions: Readonly<Record<string, string>>, reserved: readonly string[], extraServed?: readonly string[]): string[];
90
106
  export interface RecordedRoute {
91
107
  path: string;
92
108
  state: "replaced" | "removed";
@@ -107,6 +123,17 @@ export interface RoutesDrift {
107
123
  seamAliasMissing: string[];
108
124
  /** A roster page route the site carries that no page file serves: `<route> → <expected page path>` (#11511). */
109
125
  unservedRoster: string[];
126
+ /** Site pages, and recorded package routes, with no decided customizations.yaml entry; `id` names an undecided one (#11700). */
127
+ undecidedPages: Array<{
128
+ path: string;
129
+ id?: string;
130
+ }>;
131
+ /** Site pages outside every prefix that a decided entry keeps (#11700). */
132
+ decidedPages: RecordedRoute[];
133
+ /** For a reported `page.tsx`: the package page or generator that already serves its address (#11700 D6). */
134
+ routeSuggestions: Record<string, string>;
135
+ /** No `.ailk-template-files.json`, so site pages outside every prefix were not checked (#11700 D4). */
136
+ sitePagesUnchecked: boolean;
110
137
  /** The manifest entries in force — recorded ones included, not-carried ones not. */
111
138
  generated: number;
112
139
  }
@@ -117,7 +144,7 @@ export interface RoutesDrift {
117
144
  * site with no readable header carries every surface.
118
145
  */
119
146
  export declare function siteGate(siteDir: string): (sitePath: string) => boolean;
120
- /** The count check mode fails on: missing, stale and stray route files, orphaned overrides, missing seam aliases and unserved roster routes. */
147
+ /** The count check mode fails on: missing, stale and stray route files, orphaned overrides, missing seam aliases, unserved roster routes and undecided pages. */
121
148
  export declare function routesFailing(drift: RoutesDrift): number;
122
149
  /** How the site's route files and message overrides differ from the installed page packages. `routesFailing` zero means in sync. */
123
150
  export declare function checkRoutes(siteDir: string): RoutesDrift;
@@ -127,6 +154,8 @@ export interface WriteRoutesResult {
127
154
  recorded: RecordedRoute[];
128
155
  /** Routing files at an entry's path that the generator did not write — a site's own handler — left as they are (#11257 D10). */
129
156
  kept: string[];
157
+ /** Generated files deleted from a renamed family's old directory (#11385 D5). */
158
+ removed: string[];
130
159
  }
131
160
  /** Write every generated file that is missing or stale; a recorded route is left exactly as it is. */
132
161
  export declare function writeRoutes(siteDir: string): WriteRoutesResult;
@@ -136,7 +165,14 @@ export interface RoutesArgs {
136
165
  check: boolean;
137
166
  help: boolean;
138
167
  }
139
- export declare const ROUTES_HELP = "create-ailk routes \u2014 generate the route files for the pages a site's packages ship.\n\nUsage:\n create-ailk routes --write [<target-dir>]\n create-ailk routes --check [<target-dir>]\n\nArguments:\n <target-dir> The site root (holds apps/web). Defaults to the\n current dir.\n\nOptions:\n --write Write one generated file per route the installed\n page packages declare, under apps/web/app/[locale]/.\n A file already current is left alone.\n --check Write nothing; exit 1 naming each generated file\n that is missing, stale (differs from what --write\n would write) or stray (a page.tsx, layout.tsx or\n route.ts under a package's route prefix that is\n neither generated, recorded, nor one the package\n leaves to the site). It also names each orphaned\n override: a key in apps/web/messages/<locale>.json\n under a namespace a package's catalog ships that\n the catalog no longer has. And it names each roster\n page route (.ailk-site-manifest.json) that no page\n file serves \u2014 neither a site page nor a generated\n re-export.\n --help, -h Print this message.\n\nA page package is an installed @working-theory/* dependency of apps/web whose\npackage.json declares \"ailk\": { \"routes\": \"<manifest>\" }. A generated file\nre-exports the package's page and copies its route-segment config; when the\npage takes the site's config it imports the manifest's config file from the\napp root (apps/web/account.config.tsx, say) and passes it in. Replace or remove a shipped route by recording it in\ncustomizations.yaml (an entry whose paths match the route file): a recorded\nroute is reported as replaced or removed, never failed, and --write never\ntouches it. A manifest may list several prefixes, and one manifest with\n\"root\": true may ship the locale-root page.tsx. No two manifests may claim the\nsame prefix; one may claim a prefix strictly inside another's, which then\nships no route under it. A manifest with\n\"siteGated\": true ships only the routes the site selected: its public pages\nare not carried when .ailk-site-manifest.json lists no marketing module, and\nneither is any page under a surface the architecture.yaml \"# Surfaces:\" header\nleaves out. Run --write after `pnpm install` (the manifests are read from the\ninstalled packages); the scaffold's preflight runs --check as `pnpm routes:check`.\n";
168
+ /**
169
+ * The order an agent or a person adds a page in (#11700 D8). The same
170
+ * sentence is in this help, the check's failure header, the scaffold
171
+ * CLAUDE.md, the `add-page` and `extend-site` skill text and
172
+ * `template-guard.sh`'s refusal; `routes.test.ts` reads all six.
173
+ */
174
+ export declare const PAGE_DECISION_GUIDANCE = "Before you add a page, look up its page type and the package route that serves it, and use that package page when it exists. Otherwise record the decision in customizations.yaml (build-in: site \u2014 <decider>, <YYYY-MM-DD>, <reason>) before you write the file.";
175
+ export declare const ROUTES_HELP = "create-ailk routes \u2014 generate the route files for the pages a site's packages ship.\n\nUsage:\n create-ailk routes --write [<target-dir>]\n create-ailk routes --check [<target-dir>]\n\nArguments:\n <target-dir> The site root (holds apps/web). Defaults to the\n current dir.\n\nOptions:\n --write Write one generated file per route the installed\n page packages declare, under apps/web/app/[locale]/.\n A file already current is left alone.\n --check Write nothing; exit 1 naming each generated file\n that is missing, stale (differs from what --write\n would write) or stray (a page.tsx, layout.tsx or\n route.ts under a package's route prefix that is\n neither generated, recorded, nor one the package\n leaves to the site). It also names each orphaned\n override: a key in apps/web/messages/<locale>.json\n under a namespace a package's catalog ships that\n the catalog no longer has. And it names each roster\n page route (.ailk-site-manifest.json) that no page\n file serves \u2014 neither a site page nor a generated\n re-export. And it names each undecided page: a\n routing file under app/[locale]/ that no package,\n generator or template wrote, or a recorded package\n route, with no decided customizations.yaml entry\n (an undecided entry fails too). A reported\n page.tsx names the package page or the add-route\n magnet command that already serves its address.\n --help, -h Print this message.\n\nA page package is an installed @working-theory/* dependency of apps/web whose\npackage.json declares \"ailk\": { \"routes\": \"<manifest>\" }. A generated file\nre-exports the package's page and copies its route-segment config; when the\npage takes the site's config it imports the manifest's config file from the\napp root (apps/web/account.config.tsx, say) and passes it in. Replace or remove a shipped route by recording it in\ncustomizations.yaml (an entry whose paths match the route file): a recorded\nroute is reported as replaced or removed, never failed, and --write never\ntouches it. A manifest may list several prefixes, and one manifest with\n\"root\": true may ship the locale-root page.tsx. No two manifests may claim the\nsame prefix; one may claim a prefix strictly inside another's, which then\nships no route under it. A manifest with\n\"siteGated\": true ships only the routes the site selected: its public pages\nare not carried when .ailk-site-manifest.json lists no marketing module, and\nneither is any page under a surface the architecture.yaml \"# Surfaces:\" header\nleaves out. Run --write after `pnpm install` (the manifests are read from the\ninstalled packages); the scaffold's preflight runs --check as `pnpm routes:check`.\n\nBefore you add a page, look up its page type and the package route that serves it, and use that package page when it exists. Otherwise record the decision in customizations.yaml (build-in: site \u2014 <decider>, <YYYY-MM-DD>, <reason>) before you write the file. A decided entry is\n\"build-in: site \u2014 <decider>, <YYYY-MM-DD>, <reason>\" or \"build-in: ailk#<N>\";\nundecided_ok_until does not apply to a page. With no .ailk-template-files.json\na page outside every package prefix is not checked, and the report says so.\n";
140
176
  /** Parse the argv AFTER the `routes` word. Strict `node:util` parseArgs, like `parseSyncRoutesArgs`. */
141
177
  export declare function parseRoutesArgs(argv: string[]): RoutesArgs;
142
178
  /** The printed report: one line per file, grouped by state; the recorded routes last, under their decision. */