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.
Files changed (137) hide show
  1. package/README.md +192 -43
  2. package/component-catalog.json +223 -285
  3. package/component-catalog.md +1 -1
  4. package/dist/apply-design.d.ts +26 -68
  5. package/dist/apply-design.js +150 -322
  6. package/dist/cli.js +152 -17
  7. package/dist/compare-chrome.d.ts +108 -0
  8. package/dist/compare-chrome.js +481 -0
  9. package/dist/compare-look.d.ts +94 -0
  10. package/dist/compare-look.js +378 -0
  11. package/dist/copy.js +1 -1
  12. package/dist/design-compile.d.ts +17 -21
  13. package/dist/design-compile.js +32 -56
  14. package/dist/design-files.d.ts +93 -0
  15. package/dist/design-files.js +312 -0
  16. package/dist/design-home.d.ts +4 -2
  17. package/dist/design-home.js +88 -6
  18. package/dist/design-names.d.ts +13 -0
  19. package/dist/design-names.js +76 -0
  20. package/dist/design-package.d.ts +46 -56
  21. package/dist/design-package.js +285 -288
  22. package/dist/design-presets.d.ts +41 -0
  23. package/dist/design-presets.js +83 -4
  24. package/dist/design-scaffold.d.ts +12 -2
  25. package/dist/design-scaffold.js +72 -34
  26. package/dist/generated/design-settings.d.ts +56 -0
  27. package/dist/generated/design-settings.js +237 -0
  28. package/dist/index.d.ts +1 -1
  29. package/dist/index.js +2 -2
  30. package/dist/inventory.d.ts +3 -2
  31. package/dist/inventory.js +10 -4
  32. package/dist/lib/design-checks.d.ts +46 -0
  33. package/dist/lib/design-checks.js +79 -1
  34. package/dist/lib/env-catalog.js +1 -1
  35. package/dist/lib/module-license-gate.d.ts +1 -1
  36. package/dist/lib/module-license-gate.js +1 -1
  37. package/dist/lib/render-verdict.d.ts +13 -1
  38. package/dist/lib/render-verdict.js +41 -1
  39. package/dist/look-hub.d.ts +44 -0
  40. package/dist/look-hub.js +130 -0
  41. package/dist/look-record.d.ts +35 -0
  42. package/dist/look-record.js +85 -0
  43. package/dist/look-samples.d.ts +66 -0
  44. package/dist/look-samples.js +456 -0
  45. package/dist/look-settings.d.ts +53 -0
  46. package/dist/look-settings.js +807 -0
  47. package/dist/module-architecture.js +12 -0
  48. package/dist/parse-args.d.ts +10 -6
  49. package/dist/parse-args.js +26 -13
  50. package/dist/programmatic.d.ts +1 -19
  51. package/dist/programmatic.js +65 -103
  52. package/dist/retired-design-bodies.d.ts +29 -0
  53. package/dist/retired-design-bodies.js +51 -0
  54. package/dist/seed-flows.d.ts +1 -1
  55. package/dist/seed-flows.js +12 -14
  56. package/dist/seed-workspace.d.ts +4 -1
  57. package/dist/seed-workspace.js +139 -17
  58. package/dist/site-chrome.d.ts +42 -41
  59. package/dist/site-chrome.js +51 -70
  60. package/dist/site-fonts.d.ts +14 -14
  61. package/dist/site-fonts.js +9 -4
  62. package/dist/starter-grid.d.ts +2 -2
  63. package/dist/strip-look-copies.d.ts +67 -0
  64. package/dist/strip-look-copies.js +591 -0
  65. package/dist/template-manifest.d.ts +6 -14
  66. package/dist/template-manifest.js +0 -9
  67. package/dist/template-record.d.ts +3 -1
  68. package/dist/template-record.js +3 -1
  69. package/dist/topology.d.ts +15 -0
  70. package/dist/topology.js +60 -0
  71. package/dist/update.d.ts +57 -1
  72. package/dist/update.js +742 -13
  73. package/package.json +3 -4
  74. package/site-templates/aliases/hub.TEMPLATE-MANIFEST.json +2 -31
  75. package/site-templates/designs/minimalism/DESIGN.md +163 -297
  76. package/site-templates/designs/minimalism/LOOK.md +42 -0
  77. package/site-templates/designs/minimalism/design.yaml +167 -0
  78. package/site-templates/designs/standard/DESIGN.md +145 -149
  79. package/site-templates/designs/standard/LOOK.md +42 -0
  80. package/site-templates/designs/standard/design.yaml +72 -0
  81. package/site-templates/marketing-site/TEMPLATE-MANIFEST.json +2 -31
  82. package/site-templates/marketing-site/TEMPLATE-MANIFEST.md +1 -25
  83. package/site-templates/marketing-site-free/TEMPLATE-MANIFEST.json +2 -31
  84. package/site-templates/marketing-site-free/TEMPLATE-MANIFEST.md +1 -25
  85. package/site-templates/shapes/local-business-service/TEMPLATE-MANIFEST.json +2 -31
  86. package/site-templates/shapes/local-business-service/TEMPLATE-MANIFEST.md +1 -25
  87. package/site-templates/shapes/organization-service/TEMPLATE-MANIFEST.json +2 -31
  88. package/site-templates/shapes/organization-service/TEMPLATE-MANIFEST.md +1 -25
  89. package/site-templates/shapes/person-service/TEMPLATE-MANIFEST.json +2 -31
  90. package/site-templates/shapes/person-service/TEMPLATE-MANIFEST.md +1 -25
  91. package/site-templates/shapes/person-service/content/_site.mdx +0 -26
  92. package/templates/.claude/rules/extending.md +3 -2
  93. package/templates/.env.example +11 -4
  94. package/templates/CLAUDE.md +1 -1
  95. package/templates/DESIGN.md +145 -149
  96. package/templates/README.md +15 -16
  97. package/templates/apps/api/.env.example +11 -4
  98. package/templates/apps/api/CLAUDE.md +6 -4
  99. package/templates/apps/api/src/lib/__mocks__/prisma.ts +15 -5
  100. package/templates/apps/mcp/CLAUDE.md +4 -2
  101. package/templates/apps/web/.env.example +10 -3
  102. package/templates/apps/web/CLAUDE.md +14 -3
  103. package/templates/apps/web/app/[locale]/layout.tsx +53 -50
  104. package/templates/apps/web/app/not-found.tsx +11 -11
  105. package/templates/apps/web/auth.ts +48 -35
  106. package/templates/apps/web/jest.config.cjs +5 -0
  107. package/templates/apps/web/lib/__tests__/hub-site-config.test.ts +179 -31
  108. package/templates/apps/web/lib/__tests__/library-fonts.test.ts +35 -0
  109. package/templates/apps/web/lib/__tests__/page-chrome-navigation.test.ts +71 -32
  110. package/templates/apps/web/lib/__tests__/page-chrome.test.ts +123 -26
  111. package/templates/apps/web/lib/__tests__/section-look.test.ts +150 -0
  112. package/templates/apps/web/lib/__tests__/site-theme.test.ts +81 -289
  113. package/templates/apps/web/lib/deck-page.ts +3 -10
  114. package/templates/apps/web/lib/deploy-fonts.ts +12 -0
  115. package/templates/apps/web/lib/hub-site-config.ts +97 -14
  116. package/templates/apps/web/lib/library-fonts.ts +41 -0
  117. package/templates/apps/web/lib/mcp-oauth.ts +11 -4
  118. package/templates/apps/web/lib/page-chrome.ts +52 -34
  119. package/templates/apps/web/lib/section-look.ts +28 -0
  120. package/templates/apps/web/lib/site-design.ts +205 -0
  121. package/templates/apps/web/lib/site-theme-head.ts +98 -13
  122. package/templates/apps/web/lib/site-theme.ts +40 -62
  123. package/templates/apps/web/messages/en.json +0 -6
  124. package/templates/apps/web/next.config.mjs +195 -6
  125. package/templates/apps/web/package.json +2 -0
  126. package/templates/apps/web/site-pages.config.tsx +4 -2
  127. package/templates/content/_site.mdx +0 -26
  128. package/templates/design.yaml +75 -0
  129. package/templates/project.yaml +14 -0
  130. package/versions.json +52 -51
  131. package/site-templates/marketing-site/DESIGN.md +0 -259
  132. package/site-templates/marketing-site-free/DESIGN.md +0 -259
  133. package/site-templates/saas-product/DESIGN.md +0 -259
  134. package/templates/apps/web/lib/__tests__/deck-page.test.ts +0 -288
  135. package/templates/apps/web/lib/__tests__/site-theme-head.test.ts +0 -70
  136. package/templates/apps/web/lib/site-chrome.ts +0 -46
  137. package/templates/apps/web/lib/site-fonts.ts +0 -15
@@ -246,6 +246,21 @@ export declare function writeHubOriginEnv(targetDir: string, origin: string): vo
246
246
  * and `.env.local` gitignored either way. `true` when the line was written.
247
247
  */
248
248
  export declare function writeWebEnv(targetDir: string, name: string, value: () => string): boolean;
249
+ /** The value `apps/web/<file>` assigns `name` — the last assignment, as dotenv reads it — or `undefined`. */
250
+ export declare function readWebEnvValue(siteDir: string, file: string, name: string): string | undefined;
251
+ /**
252
+ * Why a run on a spoke may not reach `workspaceId`: a different
253
+ * `AILK_WORKSPACE_ID` set by the spoke's `apps/web/.env` or `.env.local`,
254
+ * naming both. `undefined` when neither file sets another.
255
+ */
256
+ export declare function spokeWorkspaceMismatch(siteDir: string, workspaceId: string): string | undefined;
257
+ /**
258
+ * Why a run on a spoke may not reach the normalized `origin`: the
259
+ * `AILK_API_URL` the spoke's `apps/web/.env.local` sets (where the scaffold
260
+ * writes its hub's origin) is another, or is not set. `undefined` when they
261
+ * are the same origin.
262
+ */
263
+ export declare function spokeOriginMismatch(siteDir: string, origin: string): string | undefined;
249
264
  /**
250
265
  * `<name>=<value()>` into `apps/api/.env` — the one file the API's
251
266
  * `dotenv.config()` reads — under `writeWebEnv`'s never-clobber rule, and
package/dist/topology.js CHANGED
@@ -1217,6 +1217,66 @@ export function writeHubOriginEnv(targetDir, origin) {
1217
1217
  export function writeWebEnv(targetDir, name, value) {
1218
1218
  return writeEnvLine(join(targetDir, "apps", "web"), NEXT_ENV_FILES, ".env.local", targetDir, ENV_LOCAL_IGNORE_LINES, name, value);
1219
1219
  }
1220
+ /** The value `apps/web/<file>` assigns `name` — the last assignment, as dotenv reads it — or `undefined`. */
1221
+ export function readWebEnvValue(siteDir, file, name) {
1222
+ const path = join(siteDir, "apps", "web", file);
1223
+ if (!existsSync(path))
1224
+ return undefined;
1225
+ const pattern = new RegExp(`^\\s*(?:export\\s+)?${name}\\s*=\\s*(.*)$`);
1226
+ let value;
1227
+ for (const line of readFileSync(path, "utf8").split(/\r?\n/)) {
1228
+ const m = pattern.exec(line);
1229
+ if (m !== null)
1230
+ value = (m[1] ?? "").trim().replace(/^(["'])(.*)\1$/, "$2");
1231
+ }
1232
+ return value === "" ? undefined : value;
1233
+ }
1234
+ // The spoke binds (#12477): on a spoke, the seed, `apply-design`,
1235
+ // `strip-look-copies` and `resolveWorkspaceAccess` (`inventory`, `cutover`,
1236
+ // `export-content`) refuse a workspace or hub origin other than the one the
1237
+ // spoke's own env files name; `update` and `seed-flows`, which name no
1238
+ // workspace, refuse another origin. A shell still holding another site's
1239
+ // variables cannot reach that site's workspace. (`migrate-content` reads no
1240
+ // topology and is not bound.)
1241
+ /** The environment variable the workspace id is read from (the seed's). */
1242
+ const WORKSPACE_ID_ENV_VAR = "AILK_WORKSPACE_ID";
1243
+ /**
1244
+ * Why a run on a spoke may not reach `workspaceId`: a different
1245
+ * `AILK_WORKSPACE_ID` set by the spoke's `apps/web/.env` or `.env.local`,
1246
+ * naming both. `undefined` when neither file sets another.
1247
+ */
1248
+ export function spokeWorkspaceMismatch(siteDir, workspaceId) {
1249
+ for (const file of [".env", ".env.local"]) {
1250
+ const own = readWebEnvValue(siteDir, file, WORKSPACE_ID_ENV_VAR);
1251
+ if (own !== undefined && own !== workspaceId) {
1252
+ return `this spoke's apps/web/${file} sets ${WORKSPACE_ID_ENV_VAR}=${own}, not ${workspaceId}`;
1253
+ }
1254
+ }
1255
+ return undefined;
1256
+ }
1257
+ /**
1258
+ * Why a run on a spoke may not reach the normalized `origin`: the
1259
+ * `AILK_API_URL` the spoke's `apps/web/.env.local` sets (where the scaffold
1260
+ * writes its hub's origin) is another, or is not set. `undefined` when they
1261
+ * are the same origin.
1262
+ */
1263
+ export function spokeOriginMismatch(siteDir, origin) {
1264
+ const own = readWebEnvValue(siteDir, ".env.local", HUB_ORIGIN_ENV_VAR);
1265
+ if (own === undefined) {
1266
+ return `this spoke's apps/web/.env.local sets no ${HUB_ORIGIN_ENV_VAR}, so ${origin} cannot be checked as its hub`;
1267
+ }
1268
+ let normalized;
1269
+ try {
1270
+ normalized = normalizeHubUrl(own);
1271
+ }
1272
+ catch (err) {
1273
+ if (!(err instanceof TopologyError))
1274
+ throw err;
1275
+ }
1276
+ return normalized === origin
1277
+ ? undefined
1278
+ : `this spoke's apps/web/.env.local sets ${HUB_ORIGIN_ENV_VAR}=${own}, not ${origin}`;
1279
+ }
1220
1280
  /** The lines that gitignore `apps/api/.env`; `.env` is appended when none is there. */
1221
1281
  const ENV_IGNORE_LINES = new Set([".env", "**/.env", ".env*"]);
1222
1282
  /**
package/dist/update.d.ts CHANGED
@@ -38,6 +38,15 @@ export interface UpdateSiteOptions {
38
38
  env?: NodeJS.ProcessEnv;
39
39
  /** #11952 D4 — forwarded to deriveLevel as registryUrl. Default: AILK_MODULE_REGISTRY_URL / fetchModule's default. */
40
40
  moduleRegistryUrl?: string;
41
+ /** #12468 D6 — the shipped designs a moved site's guide is copied from. Default: `site-templates/designs` beside `templatesDir`. */
42
+ designsDir?: string;
43
+ /**
44
+ * #12477 D6 — `--look-from <origin>`: the API origin the site reads, whose
45
+ * site read must carry the site's look before its look files are removed.
46
+ */
47
+ look?: {
48
+ from: string;
49
+ };
41
50
  }
42
51
  export interface UpdateResult {
43
52
  targetDir: string;
@@ -145,6 +154,8 @@ export interface UpdateResult {
145
154
  version: string;
146
155
  files: number;
147
156
  };
157
+ /** #12477 D6 — the hub read that replaced the site's look files, when this run checked one. */
158
+ look?: LookSource;
148
159
  }
149
160
  /**
150
161
  * Whether `diskBytes` is `templateBytes` with the `jest-config` /
@@ -196,12 +207,57 @@ export declare function updateSite(opts: UpdateSiteOptions): Promise<UpdateResul
196
207
  */
197
208
  export declare function loadSiteMdxParse(targetDir: string): Promise<MdxParse | undefined>;
198
209
  export type { MdxParse } from "./mdx-braces.js";
210
+ /**
211
+ * #12500 D7 — move a site's design settings forward, once, after
212
+ * `moveDesignSettings`. Plan first, then check, then write:
213
+ *
214
+ * - **design steps** run only when the root `design.yaml` is a regular file
215
+ * (a symlink or anything else: a review row and nothing written) with no
216
+ * top-level `version:` — each missing dark key filled with its old fallback,
217
+ * then `version: 1` after `name:`;
218
+ * - **pinned steps** run while the retired pin's texts are present (the
219
+ * generated `site-chrome.ts` line, or `design.yaml`'s `layout.colorMode:
220
+ * light`), with or without a `design.yaml`: its band set takes the dark
221
+ * values and its dark set the light ones; the generator's three pin texts
222
+ * leave `site-chrome.ts`; and `_site.mdx`'s `theme:` and `brand:` blocks are
223
+ * moved the same way when they are in the form create-ailk writes, else a
224
+ * review row and `_site.mdx` untouched (SEC-12500-10).
225
+ *
226
+ * The moved `design.yaml` is read as a design before anything is written; when
227
+ * it does not read, nothing is written and a review row carries the reader's
228
+ * message. Each file is written only when it is a regular file, not a symlink,
229
+ * and its real path sits inside the site's (SEC-12500-6); else a review row
230
+ * names it. Each write replaces the whole file with text read from it.
231
+ *
232
+ * `retired` (#12477 D6) is the run's look retirement: a retired
233
+ * `site-chrome.ts` is still read to decide the pin, so `design.yaml` moves as
234
+ * on any pinned site, but loses no pin texts, and a retired `theme:` block is
235
+ * not moved (no review row about it either); the `brand:` step still runs.
236
+ */
237
+ export declare function upgradeDesignSettings(siteDir: string, retired?: ReadonlySet<string>): {
238
+ updated: string[];
239
+ review: Array<{
240
+ path: string;
241
+ reason: string;
242
+ }>;
243
+ };
244
+ /** What the hub's read for the site carries: the record's version and the library look it names. */
245
+ export interface LookSource {
246
+ origin: string;
247
+ version: number;
248
+ from: {
249
+ look: string;
250
+ version: string;
251
+ } | null;
252
+ }
199
253
  /** The printed report (D9): one section per non-empty list, in order. */
200
254
  export declare function formatUpdateReport(result: UpdateResult): string;
201
255
  export interface UpdateArgs {
202
256
  target: string | undefined;
257
+ /** #12477 D6 — `--look-from <origin>`. */
258
+ lookFrom: string | undefined;
203
259
  help: boolean;
204
260
  }
205
- export declare const UPDATE_HELP = "create-ailk update \u2014 bring template fixes into a site's copied app code.\n\nUsage:\n create-ailk update [<target-dir>]\n\nArguments:\n <target-dir> The existing site. Defaults to the current dir.\n\nOptions:\n --help, -h Print this message.\n\nReads .ailk-template-files.json (written beside .ailk-site-manifest.json by\nevery template scaffold) to tell an untouched copy from an edit. An\nuntouched apps/web, apps/api or apps/mcp file, or a root tools/jest file the\napp jest configs require, whose template copy changed is overwritten. An\nedited file whose template copy also changed is three-way merged with\n`git` (git must be on PATH); a conflict leaves the file alone and is\nlisted under \"Needs review\"; an apps/web/messages catalog instead gains the\ntemplate's new keys and keeps every value it has \u2014 also when its recorded\nversion's copy cannot be read \u2014 and is reviewed only when a key is an object\non one side and a value on the other; a written apps/web file that uses\nthrough t(...) a key the catalog then lacks is held with it, listed under\n\"Held back with <catalog>\". Each @working-theory/* package a written apps/web\nfile imports that apps/web/package.json does not declare is added to its\ndependencies at this release's version. A site missing a paid MCP package\nits licence level ships gets it in apps/mcp/package.json; the level is read\nfrom the site's key (ailk.key, else AILK_LICENSE_KEY) through the module\nregistry, and a run with no key adds none. apps/web/package.json's\nscripts.build is set to this template's when it is a published create-ailk\ntemplate's, listed under \"Build scripts carried\"; a build script matching no\ntemplate's is left as it is and listed under \"Needs review\". An edited file whose\nbytes are another published create-ailk version's copy is a stale copy, not\nan edit: it is overwritten or removed as an untouched file is, listed with\nthe version it matched. An edit that touches only comment lines is listed as\n\"comment-only edit\"; on a conflict the template's copy lands. A file at a\ntemplate path that is not in the record (one an earlier sync-routes --apply\nor add-route copied without recording it) whose bytes are a published\ncreate-ailk version's copy \u2014 from the version the site was scaffolded at to\nthis one \u2014 is adopted: recorded and moved forward as an untouched file is,\nlisted under \"Adopted\" with the version it matched. One whose bytes are the\nrunning copy with this site's modules' patches applied (a module's\njest.config.cjs or next.config.mjs edit) is left as it is and not listed.\nOne whose bytes match no published copy is a site edit: skipped, never overwritten, and counted under\n\"Held as site edits, not in the record\". No file under a route the site\nlists in customizations.yaml declined_routes is written: each is listed under\n\"Skipped\" naming the declined route. Every template\ntest, and every site-edited template file, that imports a file left under\n\"Needs review\" (by a relative or @/ import, transitively) is held\nat the site's version with it, its record entry is not advanced, and it is\nlisted under \"Held back with <file>\" \u2014 reconcile the file, then run update\nagain to bring it forward. A skipped file never holds another. A file whose\nown bytes are the record's is not held by what it imports: it moves, unless\nit names an export the held copy lacks, and the held file is listed as\n\"Held back: <file> \u2014 imported by N moved files; the site edit is <hunk\nsummary>\". A written file whose import names a file the site lacks gets it\nadded when this template supplies it; otherwise it is held the same way,\nunder \"Held back with <file> (not in this site)\", unless its own copy\nalready named the file \u2014 then it moves and the path is listed under \"Not in\nthis site or the template: <file>\". A file the template removed is kept\nwhile any file still in the site imports it. A file a customizations.yaml\nentry records is never removed, nor anything it imports: it keeps its record\nrow and is listed under \"Skipped\" as kept. Every other file in the run\nstill updates. When project.yaml has an env_contract block, each\nenv var the written files read that has no row gains one; no row is edited.\nA record row at a path create-ailk no longer records is dropped and listed.\nA surface the site's .ailk-site-manifest.json names a page on but\narchitecture.yaml does not declare (one no module owns, such as projects)\ngets its route files added and is declared, listed under \"Surfaces declared\nfrom the roster\". A code-route row of that roster no page file serves is\ndropped, listed under \"Roster rows dropped, no route serves them\".\nA site with no record gets one on its first run, from the version its\n.ailk-site-manifest.json already records. A site scaffolded before\n@working-theory/mcp-server has its copied apps/mcp moved to the boot set:\nthe server and each module's paid MCP pack join apps/mcp/package.json, the\ncopied server files go, and apps/mcp/src/lib/paid-tools.generated.ts is\nrewritten on every run. A site scaffolded before @working-theory/api has its\ncopied apps/api moved to the boot file: the app becomes @working-theory/app-api,\nthe package and the six @working-theory/api-<module> packages join\napps/api/package.json, its bins and build:vercel delegate to the package, and\nthe copied server files go. Run `pnpm install` after either move, since the\napp's package.json gained dependencies. Each mdx-body page in content/ with no\n'# ' heading gets its title and description written into its body as its\nheading and intro, listed under \"Page heading added\"; a page with one heading\nis left as it is, and one with several, or one whose frontmatter it cannot\nread, is listed under \"Needs review\". Each bare { on an mdx-body page is\nescaped as \\{ when the site's own MDX parser then reads the page clean, listed\nunder \"Placeholder brace escaped\"; a page it cannot escape safely, or any page\nwith one while the site's dependencies are not installed, is listed under\n\"Needs review\". Each topology seam (*.generated.* \u2014 the web seam, the\n(authed) gate, the API origin and the MCP seam) is rendered again for the\ntopology and sign-in mode .ailk-site-manifest.json records and listed under\n\"Regenerated\", when its bytes are still the render .ailk-template-files.json\nrecords; one edited by hand, or with no recorded render, is listed under\n\"Needs review\" and left as it is. Last, the generated route files of every installed page\npackage (one whose package.json declares \"ailk\": { \"routes\" }) are rewritten\nfrom its manifest, listed under \"Route files regenerated\"; run\n`create-ailk routes --write` after the install when the packages were not\ninstalled yet. Each hand-written page `routes --check` then fails on \u2014 no\ndecided customizations.yaml entry, under a package's prefix, or at a\npackage's own route \u2014 is listed under \"Needs review\". Commit before running,\nand review the diff after.\n";
261
+ export declare const UPDATE_HELP = "create-ailk update \u2014 bring template fixes into a site's copied app code.\n\nUsage:\n create-ailk update [<target-dir>] [--look-from <origin>]\n\nArguments:\n <target-dir> The existing site. Defaults to the current dir.\n\nOptions:\n --look-from <origin> The API origin the site reads its config from. A\n site still carrying its look files\n (content/_site.mdx theme:, apps/web/lib/site-chrome.ts,\n apps/web/lib/site-fonts.ts) needs it: they are\n removed only once that origin's site read carries\n the site's look (imported into its hub design\n record). On a spoke it must be the AILK_API_URL\n apps/web/.env.local sets, and the read carries\n AILK_SPOKE_KEY; on a hub it carries no key.\n --help, -h Print this message.\n\nA site that still carries its look files is refused with no --look-from,\nnaming the import: the site's look comes only from its hub design record.\nWith it, one GET of <origin>/v1/content/site-config (no redirect, 10 s, 2 MB)\nmust answer a design record holding a look; then the two files are removed and\nthe theme: block leaves content/_site.mdx, every other byte kept, as the run's\nlast writes, and the report names the look that replaced them. A file is kept\ninstead, and listed under \"Needs review\", while a file the run leaves still\nimports it, or (site-chrome.ts) while apps/web/lib/nav-config.ts stays.\n\nReads .ailk-template-files.json (written beside .ailk-site-manifest.json by\nevery template scaffold) to tell an untouched copy from an edit. An\nuntouched apps/web, apps/api or apps/mcp file, or a root tools/jest file the\napp jest configs require, whose template copy changed is overwritten. An\nedited file whose template copy also changed is three-way merged with\n`git` (git must be on PATH); a conflict leaves the file alone and is\nlisted under \"Needs review\"; an apps/web/messages catalog instead gains the\ntemplate's new keys and keeps every value it has \u2014 also when its recorded\nversion's copy cannot be read \u2014 and is reviewed only when a key is an object\non one side and a value on the other; a written apps/web file that uses\nthrough t(...) a key the catalog then lacks is held with it, listed under\n\"Held back with <catalog>\". Each @working-theory/* package a written apps/web\nfile imports that apps/web/package.json does not declare is added to its\ndependencies at this release's version. A site missing a paid MCP package\nits licence level ships gets it in apps/mcp/package.json; the level is read\nfrom the site's key (ailk.key, else AILK_LICENSE_KEY) through the module\nregistry, and a run with no key adds none. apps/web/package.json's\nscripts.build is set to this template's when it is a published create-ailk\ntemplate's, listed under \"Build scripts carried\"; a build script matching no\ntemplate's is left as it is and listed under \"Needs review\". An edited file whose\nbytes are another published create-ailk version's copy is a stale copy, not\nan edit: it is overwritten or removed as an untouched file is, listed with\nthe version it matched. An edit that touches only comment lines is listed as\n\"comment-only edit\"; on a conflict the template's copy lands. A file at a\ntemplate path that is not in the record (one an earlier sync-routes --apply\nor add-route copied without recording it) whose bytes are a published\ncreate-ailk version's copy \u2014 from the version the site was scaffolded at to\nthis one \u2014 is adopted: recorded and moved forward as an untouched file is,\nlisted under \"Adopted\" with the version it matched. One whose bytes are the\nrunning copy with this site's modules' patches applied (a module's\njest.config.cjs or next.config.mjs edit) is left as it is and not listed.\nOne whose bytes match no published copy is a site edit: skipped, never overwritten, and counted under\n\"Held as site edits, not in the record\". No file under a route the site\nlists in customizations.yaml declined_routes is written: each is listed under\n\"Skipped\" naming the declined route. Every template\ntest, and every site-edited template file, that imports a file left under\n\"Needs review\" (by a relative or @/ import, transitively) is held\nat the site's version with it, its record entry is not advanced, and it is\nlisted under \"Held back with <file>\" \u2014 reconcile the file, then run update\nagain to bring it forward. A skipped file never holds another. A file whose\nown bytes are the record's is not held by what it imports: it moves, unless\nit names an export the held copy lacks, and the held file is listed as\n\"Held back: <file> \u2014 imported by N moved files; the site edit is <hunk\nsummary>\". A written file whose import names a file the site lacks gets it\nadded when this template supplies it; otherwise it is held the same way,\nunder \"Held back with <file> (not in this site)\", unless its own copy\nalready named the file \u2014 then it moves and the path is listed under \"Not in\nthis site or the template: <file>\". A file the template removed is kept\nwhile any file still in the site imports it. A file a customizations.yaml\nentry records is never removed, nor anything it imports: it keeps its record\nrow and is listed under \"Skipped\" as kept. Every other file in the run\nstill updates. When project.yaml has an env_contract block, each\nenv var the written files read that has no row gains one; no row is edited.\nA record row at a path create-ailk no longer records is dropped and listed.\nA surface the site's .ailk-site-manifest.json names a page on but\narchitecture.yaml does not declare (one no module owns, such as projects)\ngets its route files added and is declared, listed under \"Surfaces declared\nfrom the roster\". A code-route row of that roster no page file serves is\ndropped, listed under \"Roster rows dropped, no route serves them\".\nA site with no record gets one on its first run, from the version its\n.ailk-site-manifest.json already records. A site scaffolded before\n@working-theory/mcp-server has its copied apps/mcp moved to the boot set:\nthe server and each module's paid MCP pack join apps/mcp/package.json, the\ncopied server files go, and apps/mcp/src/lib/paid-tools.generated.ts is\nrewritten on every run. A site scaffolded before @working-theory/api has its\ncopied apps/api moved to the boot file: the app becomes @working-theory/app-api,\nthe package and the six @working-theory/api-<module> packages join\napps/api/package.json, its bins and build:vercel delegate to the package, and\nthe copied server files go. Run `pnpm install` after either move, since the\napp's package.json gained dependencies. Each mdx-body page in content/ with no\n'# ' heading gets its title and description written into its body as its\nheading and intro, listed under \"Page heading added\"; a page with one heading\nis left as it is, and one with several, or one whose frontmatter it cannot\nread, is listed under \"Needs review\". Each bare { on an mdx-body page is\nescaped as \\{ when the site's own MDX parser then reads the page clean, listed\nunder \"Placeholder brace escaped\"; a page it cannot escape safely, or any page\nwith one while the site's dependencies are not installed, is listed under\n\"Needs review\". Each topology seam (*.generated.* \u2014 the web seam, the\n(authed) gate, the API origin and the MCP seam) is rendered again for the\ntopology and sign-in mode .ailk-site-manifest.json records and listed under\n\"Regenerated\", when its bytes are still the render .ailk-template-files.json\nrecords; one edited by hand, or with no recorded render, is listed under\n\"Needs review\" and left as it is. Last, the generated route files of every installed page\npackage (one whose package.json declares \"ailk\": { \"routes\" }) are rewritten\nfrom its manifest, listed under \"Route files regenerated\"; run\n`create-ailk routes --write` after the install when the packages were not\ninstalled yet. Each hand-written page `routes --check` then fails on \u2014 no\ndecided customizations.yaml entry, under a package's prefix, or at a\npackage's own route \u2014 is listed under \"Needs review\". Commit before running,\nand review the diff after.\n";
206
262
  /** Parse the argv AFTER the `update` word. Strict `node:util` parseArgs, like `parseAdoptArgs`. */
207
263
  export declare function parseUpdateArgs(argv: string[]): UpdateArgs;