@sdxc/kit 2026.10.17 → 2026.10.20

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 (282) hide show
  1. package/README.md +390 -20
  2. package/changelog.jsonl +1160 -1092
  3. package/config.schema.json +47 -1
  4. package/dist/cli.js +12 -0
  5. package/dist/commands/deploy.d.ts +23 -0
  6. package/dist/commands/deploy.js +167 -0
  7. package/dist/commands/destroy.d.ts +22 -0
  8. package/dist/commands/destroy.js +92 -0
  9. package/dist/commands/doctor.d.ts +26 -0
  10. package/dist/commands/doctor.js +65 -0
  11. package/dist/commands/initializers.d.ts +16 -0
  12. package/dist/commands/initializers.js +23 -0
  13. package/dist/commands/make.d.ts +72 -6
  14. package/dist/commands/make.js +127 -19
  15. package/dist/commands/middleware.d.ts +16 -0
  16. package/dist/commands/middleware.js +21 -0
  17. package/dist/commands/models.d.ts +18 -0
  18. package/dist/commands/models.js +29 -0
  19. package/dist/commands/notes.d.ts +17 -0
  20. package/dist/commands/notes.js +27 -0
  21. package/dist/commands/routes.d.ts +25 -0
  22. package/dist/commands/routes.js +50 -0
  23. package/dist/commands/run.d.ts +16 -0
  24. package/dist/commands/run.js +32 -11
  25. package/dist/commands/scaffold.d.ts +29 -0
  26. package/dist/commands/scaffold.js +33 -0
  27. package/dist/commands/schedule.d.ts +16 -0
  28. package/dist/commands/schedule.js +21 -0
  29. package/dist/commands/stats.d.ts +16 -0
  30. package/dist/commands/stats.js +21 -0
  31. package/dist/commands/ui/update.d.ts +6 -3
  32. package/dist/commands/ui/update.js +24 -7
  33. package/dist/commands/upgrade.d.ts +3 -1
  34. package/dist/commands/upgrade.js +88 -23
  35. package/dist/config.d.ts +18 -0
  36. package/dist/config.js +28 -1
  37. package/dist/contract.d.ts +97 -3
  38. package/dist/contract.js +360 -26
  39. package/dist/create/templates.js +3 -2
  40. package/dist/dependencies.d.ts +4 -1
  41. package/dist/dependencies.js +13 -1
  42. package/dist/deploy/plan.d.ts +49 -0
  43. package/dist/deploy/plan.js +68 -0
  44. package/dist/destroy.d.ts +40 -0
  45. package/dist/destroy.js +311 -0
  46. package/dist/doctor/check.d.ts +71 -0
  47. package/dist/doctor/check.js +53 -0
  48. package/dist/doctor/checks.d.ts +23 -0
  49. package/dist/doctor/checks.js +68 -0
  50. package/dist/doctor/define.d.ts +59 -0
  51. package/dist/doctor/define.js +16 -0
  52. package/dist/doctor/emails.d.ts +18 -0
  53. package/dist/doctor/emails.js +243 -0
  54. package/dist/doctor/env.d.ts +26 -0
  55. package/dist/doctor/env.js +88 -0
  56. package/dist/doctor/files.d.ts +14 -0
  57. package/dist/doctor/files.js +34 -0
  58. package/dist/doctor/fixture.d.ts +23 -0
  59. package/dist/doctor/fixture.js +46 -0
  60. package/dist/doctor/install.d.ts +17 -0
  61. package/dist/doctor/install.js +37 -0
  62. package/dist/doctor/installed.d.ts +11 -0
  63. package/dist/doctor/installed.js +79 -0
  64. package/dist/doctor/layout.d.ts +23 -0
  65. package/dist/doctor/layout.js +83 -0
  66. package/dist/doctor/migrations.d.ts +16 -0
  67. package/dist/doctor/migrations.js +96 -0
  68. package/dist/doctor/models.d.ts +13 -0
  69. package/dist/doctor/models.js +69 -0
  70. package/dist/doctor/pins.d.ts +15 -0
  71. package/dist/doctor/pins.js +79 -0
  72. package/dist/doctor/project.d.ts +58 -0
  73. package/dist/doctor/project.js +261 -0
  74. package/dist/doctor/remix.d.ts +14 -0
  75. package/dist/doctor/remix.js +44 -0
  76. package/dist/doctor/routes.d.ts +11 -0
  77. package/dist/doctor/routes.js +49 -0
  78. package/dist/doctor/typegen.d.ts +13 -0
  79. package/dist/doctor/typegen.js +57 -0
  80. package/dist/doctor/ui.d.ts +14 -0
  81. package/dist/doctor/ui.js +51 -0
  82. package/dist/initializers.d.ts +25 -0
  83. package/dist/initializers.js +89 -0
  84. package/dist/lock.d.ts +2 -2
  85. package/dist/make/actions.d.ts +23 -0
  86. package/dist/make/actions.js +82 -0
  87. package/dist/make/declare.d.ts +31 -3
  88. package/dist/make/declare.js +284 -9
  89. package/dist/make/email.d.ts +23 -0
  90. package/dist/make/email.js +111 -0
  91. package/dist/make/from-fields.d.ts +30 -0
  92. package/dist/make/from-fields.js +162 -0
  93. package/dist/make/from-model.d.ts +39 -0
  94. package/dist/make/from-model.js +161 -0
  95. package/dist/make/generate.d.ts +16 -5
  96. package/dist/make/generate.js +38 -15
  97. package/dist/make/guard.d.ts +35 -0
  98. package/dist/make/guard.js +73 -0
  99. package/dist/make/imports.d.ts +6 -0
  100. package/dist/make/imports.js +19 -0
  101. package/dist/make/index.d.ts +47 -4
  102. package/dist/make/index.js +287 -29
  103. package/dist/make/kinds.d.ts +29 -2
  104. package/dist/make/kinds.js +79 -7
  105. package/dist/make/mount.d.ts +25 -0
  106. package/dist/make/mount.js +135 -0
  107. package/dist/make/schema-diff.d.ts +58 -0
  108. package/dist/make/schema-diff.js +609 -0
  109. package/dist/make/schema.d.ts +76 -0
  110. package/dist/make/schema.js +206 -0
  111. package/dist/make/stubs.d.ts +7 -5
  112. package/dist/make/stubs.js +16 -5
  113. package/dist/make/test.d.ts +43 -0
  114. package/dist/make/test.js +149 -0
  115. package/dist/make/trigger.d.ts +31 -0
  116. package/dist/make/trigger.js +163 -0
  117. package/dist/models.d.ts +42 -0
  118. package/dist/models.js +149 -0
  119. package/dist/notes.d.ts +28 -0
  120. package/dist/notes.js +66 -0
  121. package/dist/reference.d.ts +27 -0
  122. package/dist/reference.js +103 -0
  123. package/dist/releases.d.ts +9 -0
  124. package/dist/releases.js +29 -8
  125. package/dist/routes/chains.d.ts +34 -0
  126. package/dist/routes/chains.js +95 -0
  127. package/dist/routes/filter.d.ts +53 -0
  128. package/dist/routes/filter.js +147 -0
  129. package/dist/routes/format.d.ts +23 -0
  130. package/dist/routes/format.js +123 -0
  131. package/dist/routes/helpers.d.ts +21 -0
  132. package/dist/routes/helpers.js +165 -0
  133. package/dist/routes/index.d.ts +56 -0
  134. package/dist/routes/index.js +167 -0
  135. package/dist/routes/modules.d.ts +116 -0
  136. package/dist/routes/modules.js +235 -0
  137. package/dist/routes/parse.d.ts +161 -0
  138. package/dist/routes/parse.js +621 -0
  139. package/dist/routes/routers.d.ts +69 -0
  140. package/dist/routes/routers.js +327 -0
  141. package/dist/scaffold/fields.d.ts +129 -0
  142. package/dist/scaffold/fields.js +421 -0
  143. package/dist/scaffold/index.d.ts +37 -0
  144. package/dist/scaffold/index.js +613 -0
  145. package/dist/scaffold/render.d.ts +51 -0
  146. package/dist/scaffold/render.js +332 -0
  147. package/dist/schedule.d.ts +45 -0
  148. package/dist/schedule.js +124 -0
  149. package/dist/stats.d.ts +37 -0
  150. package/dist/stats.js +126 -0
  151. package/dist/ui/commands.d.ts +10 -3
  152. package/dist/ui/commands.js +85 -15
  153. package/dist/ui/registry.d.ts +8 -8
  154. package/dist/upgrade/agents.d.ts +49 -0
  155. package/dist/upgrade/agents.js +110 -0
  156. package/dist/upgrade/changelog.d.ts +2 -2
  157. package/dist/upgrade/project.d.ts +4 -0
  158. package/dist/upgrade/project.js +11 -1
  159. package/dist/upgrade/prompt.d.ts +11 -0
  160. package/dist/upgrade/prompt.js +50 -7
  161. package/package.json +6 -4
  162. package/registry/ui/alert-dialog.json +2 -2
  163. package/registry/ui/attachment.json +2 -2
  164. package/registry/ui/calendar.json +2 -2
  165. package/registry/ui/color-picker.json +2 -2
  166. package/registry/ui/command.json +2 -2
  167. package/registry/ui/date-picker.json +2 -2
  168. package/registry/ui/date-range-picker.json +2 -2
  169. package/registry/ui/dialog.json +2 -2
  170. package/registry/ui/file-trigger.json +2 -2
  171. package/registry/ui/heading-scope.json +2 -2
  172. package/registry/ui/message-scroller.json +2 -2
  173. package/registry/ui/number-field.json +2 -2
  174. package/registry/ui/range-calendar.json +2 -2
  175. package/registry/ui/resizable.json +2 -2
  176. package/registry/ui/select.json +2 -2
  177. package/registry/ui/shared-element.json +2 -2
  178. package/stubs/controller.api.resource.stub +23 -0
  179. package/stubs/controller.form.stub +2 -2
  180. package/stubs/controller.form.test.stub +2 -2
  181. package/stubs/controller.resource.form.stub +67 -0
  182. package/stubs/controller.resource.stub +28 -0
  183. package/stubs/email.stub +9 -14
  184. package/stubs/email.test.stub +9 -9
  185. package/stubs/factory.stub +1 -1
  186. package/stubs/model.stub +3 -3
  187. package/stubs/policy.test.stub +34 -8
  188. package/stubs/scaffold.api.create.stub +34 -0
  189. package/stubs/scaffold.api.create.test.stub +37 -0
  190. package/stubs/scaffold.api.destroy.stub +34 -0
  191. package/stubs/scaffold.api.destroy.test.stub +44 -0
  192. package/stubs/scaffold.api.index.stub +23 -0
  193. package/stubs/scaffold.api.index.test.stub +31 -0
  194. package/stubs/scaffold.api.show.stub +27 -0
  195. package/stubs/scaffold.api.show.test.stub +41 -0
  196. package/stubs/scaffold.api.update.stub +44 -0
  197. package/stubs/scaffold.api.update.test.stub +46 -0
  198. package/stubs/scaffold.command.create.stub +22 -0
  199. package/stubs/scaffold.command.create.test.stub +30 -0
  200. package/stubs/scaffold.command.delete.stub +20 -0
  201. package/stubs/scaffold.command.delete.test.stub +39 -0
  202. package/stubs/scaffold.command.list.stub +18 -0
  203. package/stubs/scaffold.command.list.test.stub +31 -0
  204. package/stubs/scaffold.command.show.stub +19 -0
  205. package/stubs/scaffold.command.show.test.stub +37 -0
  206. package/stubs/scaffold.controller.destroy.stub +35 -0
  207. package/stubs/scaffold.controller.destroy.test.stub +65 -0
  208. package/stubs/scaffold.controller.edit.stub +97 -0
  209. package/stubs/scaffold.controller.edit.test.stub +91 -0
  210. package/stubs/scaffold.controller.index.stub +55 -0
  211. package/stubs/scaffold.controller.index.test.stub +32 -0
  212. package/stubs/scaffold.controller.new.stub +70 -0
  213. package/stubs/scaffold.controller.new.test.stub +81 -0
  214. package/stubs/scaffold.controller.show.stub +59 -0
  215. package/stubs/scaffold.controller.show.test.stub +43 -0
  216. package/stubs/scaffold.factory.stub +16 -0
  217. package/stubs/scaffold.form.stub +75 -0
  218. package/stubs/scaffold.mcp.create.stub +24 -0
  219. package/stubs/scaffold.mcp.create.test.stub +36 -0
  220. package/stubs/scaffold.mcp.delete.stub +31 -0
  221. package/stubs/scaffold.mcp.delete.test.stub +43 -0
  222. package/stubs/scaffold.mcp.get.stub +21 -0
  223. package/stubs/scaffold.mcp.get.test.stub +31 -0
  224. package/stubs/scaffold.mcp.list.stub +23 -0
  225. package/stubs/scaffold.mcp.list.test.stub +25 -0
  226. package/stubs/scaffold.mcp.update.stub +37 -0
  227. package/stubs/scaffold.mcp.update.test.stub +40 -0
  228. package/stubs/scaffold.migration.stub +2 -0
  229. package/stubs/scaffold.model.stub +35 -0
  230. package/stubs/scaffold.model.test.stub +25 -0
  231. package/stubs/scaffold.test-database.stub +33 -0
  232. package/stubs/scaffold.test-mcp.stub +92 -0
  233. package/stubs/scaffold.validator.stub +18 -0
  234. package/stubs/scaffold.validator.test.stub +26 -0
  235. package/templates/app/AGENTS.md +163 -0
  236. package/templates/app/CLAUDE.md +1 -0
  237. package/templates/app/README.md +28 -13
  238. package/templates/app/app/commands/console.test.ts +26 -0
  239. package/templates/app/app/commands/console.ts +19 -0
  240. package/templates/app/app/commands/db/fresh.test.ts +57 -0
  241. package/templates/app/app/commands/db/fresh.ts +37 -0
  242. package/templates/app/app/commands/db/migrate.test.ts +17 -1
  243. package/templates/app/app/commands/db/migrate.ts +51 -18
  244. package/templates/app/app/commands/db/prepare.test.ts +39 -0
  245. package/templates/app/app/commands/db/prepare.ts +35 -0
  246. package/templates/app/app/commands/db/seed.test.ts +38 -0
  247. package/templates/app/app/commands/db/seed.ts +26 -0
  248. package/templates/app/app/commands/deploy.test.ts +34 -0
  249. package/templates/app/app/commands/deploy.ts +18 -0
  250. package/templates/app/app/commands/emails/preview.test.tsx +63 -0
  251. package/templates/app/app/commands/emails/preview.ts +24 -0
  252. package/templates/app/app/commands/index.ts +57 -2
  253. package/templates/app/app/emails/index.ts +10 -0
  254. package/templates/app/app/http/middleware/access.test.ts +43 -0
  255. package/templates/app/app/http/middleware/access.ts +41 -0
  256. package/templates/app/app/http/middleware/api.ts +12 -3
  257. package/templates/app/app/http/middleware/page.test.ts +4 -1
  258. package/templates/app/app/http/middleware/page.ts +7 -5
  259. package/templates/app/app/initializers/cli.ts +28 -2
  260. package/templates/app/app/initializers/dispatcher.ts +9 -1
  261. package/templates/app/app/initializers/mail-transport.test.ts +27 -0
  262. package/templates/app/app/initializers/mail-transport.ts +26 -0
  263. package/templates/app/app/initializers/mail.test.ts +17 -17
  264. package/templates/app/app/initializers/mail.ts +15 -7
  265. package/templates/app/app/initializers/router.test.ts +7 -0
  266. package/templates/app/app/initializers/router.tsx +13 -3
  267. package/templates/app/app/jobs/email.test.tsx +70 -0
  268. package/templates/app/app/jobs/email.ts +16 -0
  269. package/templates/app/app/jobs/index.ts +6 -2
  270. package/templates/app/app/policies/abilities.ts +13 -0
  271. package/templates/app/app/policies/policy.test.ts +15 -0
  272. package/templates/app/app/policies/policy.ts +30 -0
  273. package/templates/app/app/services/commands.ts +30 -0
  274. package/templates/app/app/services/migrations.test.ts +48 -1
  275. package/templates/app/app/services/migrations.ts +66 -9
  276. package/templates/app/app/test/local-database.ts +67 -0
  277. package/templates/app/app/test/session.ts +28 -0
  278. package/templates/app/bootstrap/console.ts +13 -0
  279. package/templates/app/cloudflare.config.ts +3 -3
  280. package/templates/app/database/seed.ts +12 -0
  281. package/templates/app/package.json +2 -1
  282. package/stubs/policy.stub +0 -16
@@ -0,0 +1,25 @@
1
+ /**
2
+ * The `sdxc routes` handler: prints every route of the project, its controller and the
3
+ * middleware that runs for it, as a table, one block per route, or JSON an agent parses,
4
+ * narrowed by its filters first. Diagnostics go to stderr, so stdout holds the listing alone.
5
+ *
6
+ * @author [Sergio Xalambrí](https://sergiodxa.com)
7
+ * @copyright Sergio Xalambrí 2026
8
+ */
9
+ /** Reads the project's contracts and routers and prints what they declare and map. */
10
+ declare const _default: import("@sdxc/cli").CommandAction<import("@sdxc/cli").Command<Readonly<Record<string, import("@sdxc/cli").Argument<unknown>>>, {
11
+ readonly json: import("@sdxc/cli").Flag<boolean>;
12
+ readonly expanded: import("@sdxc/cli").Flag<boolean>;
13
+ readonly grep: import("@sdxc/cli").ValueFlag<string, false, false, false>;
14
+ readonly controller: import("@sdxc/cli").ValueFlag<string, false, false, false>;
15
+ readonly method: import("@sdxc/cli").ValueFlag<string, false, false, false>;
16
+ readonly contract: import("@sdxc/cli").ValueFlag<string, false, false, false>;
17
+ readonly unused: import("@sdxc/cli").Flag<boolean>;
18
+ readonly exceptPath: import("@sdxc/cli").ValueFlag<string, false, true, false>;
19
+ readonly sort: import("@sdxc/cli").ValueFlag<"name" | "pattern" | "controller" | "method", false, false, false>;
20
+ }>, readonly [import("@sdxc/cli").CommandMiddleware<{
21
+ key: typeof import("../middleware.js").CurrentProject;
22
+ value: import("../middleware.js").Project;
23
+ property: "project";
24
+ }>]>;
25
+ export default _default;
@@ -0,0 +1,50 @@
1
+ /**
2
+ * The `sdxc routes` handler: prints every route of the project, its controller and the
3
+ * middleware that runs for it, as a table, one block per route, or JSON an agent parses,
4
+ * narrowed by its filters first. Diagnostics go to stderr, so stdout holds the listing alone.
5
+ *
6
+ * @author [Sergio Xalambrí](https://sergiodxa.com)
7
+ * @copyright Sergio Xalambrí 2026
8
+ */
9
+ import { createCommand, success } from "@sdxc/cli";
10
+ import { SDXC_COMMANDS } from "../contract.js";
11
+ import { project } from "../middleware.js";
12
+ import { filterRoutes, hasFilters, sortRoutes, unmappedControllers } from "../routes/filter.js";
13
+ import { formatExpanded, formatJSON, formatTable } from "../routes/format.js";
14
+ import { listRoutes, unimportedControllers } from "../routes/index.js";
15
+ /** Reads the project's contracts and routers and prints what they declare and map. */
16
+ export default createCommand(SDXC_COMMANDS.routes, {
17
+ middleware: [project()],
18
+ /**
19
+ * Always succeeds once the project is found: a route it cannot read is a diagnostic, and a
20
+ * filter that matches nothing prints an empty result. With `--unused`, each controller file
21
+ * no route maps is reported on stderr too, so `--json` stays an array of routes.
22
+ */
23
+ async handler(ctx) {
24
+ let listing = await listRoutes(ctx.project.root);
25
+ let filters = {
26
+ grep: ctx.flags.grep,
27
+ controller: ctx.flags.controller,
28
+ method: ctx.flags.method,
29
+ contract: ctx.flags.contract,
30
+ unused: ctx.flags.unused,
31
+ exceptPath: ctx.flags.exceptPath,
32
+ };
33
+ let filtered = sortRoutes(filterRoutes(listing, filters), ctx.flags.sort);
34
+ if (ctx.flags.json)
35
+ ctx.stdout(formatJSON(filtered));
36
+ else if (filtered.routes.length === 0 && hasFilters(filters)) {
37
+ ctx.stdout(filters.unused ? "No unused routes found.\n" : "No routes match.\n");
38
+ }
39
+ else
40
+ ctx.stdout(ctx.flags.expanded ? formatExpanded(filtered) : formatTable(filtered));
41
+ for (let diagnostic of listing.diagnostics)
42
+ ctx.stderr(`${diagnostic}\n`);
43
+ if (filters.unused) {
44
+ let files = unmappedControllers(await unimportedControllers(ctx.project.root), listing, filters);
45
+ for (let file of files)
46
+ ctx.stderr(`${file}: no route maps this controller\n`);
47
+ }
48
+ return success();
49
+ },
50
+ });
@@ -6,8 +6,24 @@
6
6
  * @author [Sergio Xalambrí](https://sergiodxa.com)
7
7
  * @copyright Sergio Xalambrí 2026
8
8
  */
9
+ import type { Result } from "@sdxc/result";
9
10
  /** Where the app layout puts an app's command line, relative to the project root. */
10
11
  export declare const CLI_ENTRY = "bootstrap/cli.ts";
12
+ /**
13
+ * `PATH` with the project's `node_modules/.bin` first, as a package script has it, so a child
14
+ * runs the project's own `cf` or `vp` in place of a global one.
15
+ *
16
+ * @param root - The project root
17
+ * @param path - The run's `PATH`
18
+ */
19
+ export declare function projectPath(root: string, path: string | undefined): string;
20
+ /**
21
+ * The command that starts the project's command line with `args`: under Bun for a project on
22
+ * Bun and under Node otherwise.
23
+ *
24
+ * @param root - The project root, whose `package.json` and lock file name the package manager
25
+ */
26
+ export declare function commandLine(root: string, args: readonly string[]): Promise<Result<string[], Error>>;
11
27
  /**
12
28
  * Runs `bootstrap/cli.ts` under Bun for a project on Bun and under Node otherwise, with its
13
29
  * output on the terminal and the project's `node_modules/.bin` first on `PATH`, as a package
@@ -16,6 +16,33 @@ import { lockFileAtOrAbove, packageManager } from "../package-manager.js";
16
16
  import { readManifest } from "../upgrade/project.js";
17
17
  /** Where the app layout puts an app's command line, relative to the project root. */
18
18
  export const CLI_ENTRY = "bootstrap/cli.ts";
19
+ /**
20
+ * `PATH` with the project's `node_modules/.bin` first, as a package script has it, so a child
21
+ * runs the project's own `cf` or `vp` in place of a global one.
22
+ *
23
+ * @param root - The project root
24
+ * @param path - The run's `PATH`
25
+ */
26
+ export function projectPath(root, path) {
27
+ let bin = join(root, "node_modules", ".bin");
28
+ return path === undefined ? bin : `${bin}${delimiter}${path}`;
29
+ }
30
+ /**
31
+ * The command that starts the project's command line with `args`: under Bun for a project on
32
+ * Bun and under Node otherwise.
33
+ *
34
+ * @param root - The project root, whose `package.json` and lock file name the package manager
35
+ */
36
+ export async function commandLine(root, args) {
37
+ let manifest = await readManifest(root);
38
+ if (isFailure(manifest))
39
+ return manifest;
40
+ let manager = await packageManager({
41
+ declared: manifest.data.manifest.packageManager,
42
+ findLockFile: lockFileAtOrAbove(root),
43
+ });
44
+ return success([manager.name === "bun" ? "bun" : "node", CLI_ENTRY, ...args]);
45
+ }
19
46
  /**
20
47
  * Runs `bootstrap/cli.ts` under Bun for a project on Bun and under Node otherwise, with its
21
48
  * output on the terminal and the project's `node_modules/.bin` first on `PATH`, as a package
@@ -30,19 +57,13 @@ export default createCommand(SDXC_COMMANDS.run, {
30
57
  if (!isSuccess(await wrap(() => stat(entry)))) {
31
58
  return failure(new Error(`${CLI_ENTRY} not found in ${root}; an app's command line starts there`));
32
59
  }
33
- let manifest = await readManifest(root);
34
- if (isFailure(manifest))
35
- return manifest;
36
- let manager = await packageManager({
37
- declared: manifest.data.manifest.packageManager,
38
- findLockFile: lockFileAtOrAbove(root),
39
- });
40
- let runtime = manager.name === "bun" ? "bun" : "node";
41
- let bin = join(root, "node_modules", ".bin");
42
- let ran = await ctx.exec([runtime, CLI_ENTRY, ...ctx.arguments.args], {
60
+ let command = await commandLine(root, ctx.arguments.args);
61
+ if (isFailure(command))
62
+ return command;
63
+ let ran = await ctx.exec(command.data, {
43
64
  cwd: root,
44
65
  stdio: "inherit",
45
- env: { PATH: ctx.env.PATH === undefined ? bin : `${bin}${delimiter}${ctx.env.PATH}` },
66
+ env: { PATH: projectPath(root, ctx.env.PATH) },
46
67
  });
47
68
  if (isSuccess(ran))
48
69
  return success();
@@ -0,0 +1,29 @@
1
+ /**
2
+ * The `sdxc scaffold` handler: a resource's model, migration, factory, validator, abilities, pages
3
+ * and, on request, MCP tools and app commands, each declared and mapped as `sdxc make` does.
4
+ * `createSDXC()` maps it through `lazy()`.
5
+ *
6
+ * @author [Sergio Xalambrí](https://sergiodxa.com)
7
+ * @copyright Sergio Xalambrí 2026
8
+ */
9
+ declare const _default: import("@sdxc/cli").CommandAction<import("@sdxc/cli").Command<{
10
+ readonly name: import("@sdxc/cli").Argument<string>;
11
+ readonly fields: import("@sdxc/cli").Argument<string[]>;
12
+ }, {
13
+ readonly plural: import("@sdxc/cli").ValueFlag<string, false, false, false>;
14
+ readonly mcp: import("@sdxc/cli").Flag<boolean>;
15
+ readonly command: import("@sdxc/cli").Flag<boolean>;
16
+ readonly api: import("@sdxc/cli").Flag<boolean>;
17
+ readonly skip: import("@sdxc/cli").ValueFlag<"validator" | "model" | "migration" | "factory" | "policy" | "pages", false, true, false>;
18
+ readonly test: import("@sdxc/cli").Flag<boolean | undefined>;
19
+ readonly dryRun: import("@sdxc/cli").Flag<boolean>;
20
+ }>, readonly [import("@sdxc/cli").CommandMiddleware<{
21
+ key: typeof import("../middleware.js").CurrentProject;
22
+ value: import("../middleware.js").Project;
23
+ property: "project";
24
+ }>, import("@sdxc/cli").CommandMiddleware<{
25
+ key: typeof import("../middleware.js").PackageRoot;
26
+ value: string;
27
+ property: "packageRoot";
28
+ }>]>;
29
+ export default _default;
@@ -0,0 +1,33 @@
1
+ /**
2
+ * The `sdxc scaffold` handler: a resource's model, migration, factory, validator, abilities, pages
3
+ * and, on request, MCP tools and app commands, each declared and mapped as `sdxc make` does.
4
+ * `createSDXC()` maps it through `lazy()`.
5
+ *
6
+ * @author [Sergio Xalambrí](https://sergiodxa.com)
7
+ * @copyright Sergio Xalambrí 2026
8
+ */
9
+ import { createCommand, success } from "@sdxc/cli";
10
+ import { isFailure } from "@sdxc/result";
11
+ import { SDXC_COMMANDS } from "../contract.js";
12
+ import { packageRoot, project } from "../middleware.js";
13
+ import { scaffold } from "../scaffold/index.js";
14
+ export default createCommand(SDXC_COMMANDS.scaffold, {
15
+ middleware: [project(), packageRoot()],
16
+ /** Writes nothing when any part of the plan is refused; `--dry-run` prints the plan instead. */
17
+ async handler(ctx) {
18
+ let made = await scaffold(ctx, ctx.project, ctx.packageRoot, {
19
+ name: ctx.arguments.name,
20
+ fields: ctx.arguments.fields,
21
+ plural: ctx.flags.plural,
22
+ mcp: ctx.flags.mcp,
23
+ command: ctx.flags.command,
24
+ test: ctx.flags.test,
25
+ dryRun: ctx.flags.dryRun,
26
+ skip: ctx.flags.skip,
27
+ api: ctx.flags.api,
28
+ });
29
+ if (isFailure(made))
30
+ return made;
31
+ return success();
32
+ },
33
+ });
@@ -0,0 +1,16 @@
1
+ /**
2
+ * The `sdxc schedule` handler: prints every scheduled job with its next run and the trigger
3
+ * that fires it, as a table, or as JSON for an agent.
4
+ *
5
+ * @author [Sergio Xalambrí](https://sergiodxa.com)
6
+ * @copyright Sergio Xalambrí 2026
7
+ */
8
+ /** Reads the job declarations and the trigger files and prints the schedule. */
9
+ declare const _default: import("@sdxc/cli").CommandAction<import("@sdxc/cli").Command<Readonly<Record<string, import("@sdxc/cli").Argument<unknown>>>, {
10
+ readonly json: import("@sdxc/cli").Flag<boolean>;
11
+ }>, readonly [import("@sdxc/cli").CommandMiddleware<{
12
+ key: typeof import("../middleware.js").CurrentProject;
13
+ value: import("../middleware.js").Project;
14
+ property: "project";
15
+ }>]>;
16
+ export default _default;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * The `sdxc schedule` handler: prints every scheduled job with its next run and the trigger
3
+ * that fires it, as a table, or as JSON for an agent.
4
+ *
5
+ * @author [Sergio Xalambrí](https://sergiodxa.com)
6
+ * @copyright Sergio Xalambrí 2026
7
+ */
8
+ import { createCommand, success } from "@sdxc/cli";
9
+ import { SDXC_COMMANDS } from "../contract.js";
10
+ import { project } from "../middleware.js";
11
+ import { formatSchedule, listSchedule } from "../schedule.js";
12
+ /** Reads the job declarations and the trigger files and prints the schedule. */
13
+ export default createCommand(SDXC_COMMANDS.schedule, {
14
+ middleware: [project()],
15
+ /** Always succeeds once the project is found; a job no trigger fires is a row that says so. */
16
+ async handler(ctx) {
17
+ let listing = await listSchedule(ctx.project.root);
18
+ ctx.stdout(ctx.flags.json ? `${JSON.stringify(listing, null, 2)}\n` : formatSchedule(listing));
19
+ return success();
20
+ },
21
+ });
@@ -0,0 +1,16 @@
1
+ /**
2
+ * The `sdxc stats` handler: prints the lines of code per kind of code the app layout names and
3
+ * the code to test ratio, as a table, or as JSON for an agent.
4
+ *
5
+ * @author [Sergio Xalambrí](https://sergiodxa.com)
6
+ * @copyright Sergio Xalambrí 2026
7
+ */
8
+ /** Counts the project's code and prints the table. */
9
+ declare const _default: import("@sdxc/cli").CommandAction<import("@sdxc/cli").Command<Readonly<Record<string, import("@sdxc/cli").Argument<unknown>>>, {
10
+ readonly json: import("@sdxc/cli").Flag<boolean>;
11
+ }>, readonly [import("@sdxc/cli").CommandMiddleware<{
12
+ key: typeof import("../middleware.js").CurrentProject;
13
+ value: import("../middleware.js").Project;
14
+ property: "project";
15
+ }>]>;
16
+ export default _default;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * The `sdxc stats` handler: prints the lines of code per kind of code the app layout names and
3
+ * the code to test ratio, as a table, or as JSON for an agent.
4
+ *
5
+ * @author [Sergio Xalambrí](https://sergiodxa.com)
6
+ * @copyright Sergio Xalambrí 2026
7
+ */
8
+ import { createCommand, success } from "@sdxc/cli";
9
+ import { SDXC_COMMANDS } from "../contract.js";
10
+ import { project } from "../middleware.js";
11
+ import { formatStats, projectStats } from "../stats.js";
12
+ /** Counts the project's code and prints the table. */
13
+ export default createCommand(SDXC_COMMANDS.stats, {
14
+ middleware: [project()],
15
+ /** Always succeeds once the project is found; an empty project prints a table of totals. */
16
+ async handler(ctx) {
17
+ let stats = await projectStats(ctx.project.root);
18
+ ctx.stdout(ctx.flags.json ? `${JSON.stringify(stats, null, 2)}\n` : formatStats(stats));
19
+ return success();
20
+ },
21
+ });
@@ -1,14 +1,17 @@
1
1
  /**
2
2
  * The `sdxc ui update` handler: replaces copied files with the installed version. A file the
3
- * project edited is replaced only with `--force`, or when the user says yes on a terminal.
3
+ * project edited is replaced only with `--force`, or when the user says yes on a terminal;
4
+ * `--all` covers every copy and leaves edited files without asking, so it is safe unattended.
4
5
  *
5
6
  * @author [Sergio Xalambrí](https://sergiodxa.com)
6
7
  * @copyright Sergio Xalambrí 2026
7
8
  */
8
- /** Updates the named copies and prints what it replaced and what it left. */
9
+ /** Updates the named copies, or every copy with `--all`, and prints what it replaced and left. */
9
10
  declare const _default: import("@sdxc/cli").CommandAction<import("@sdxc/cli").Command<{
10
- readonly components: import("@sdxc/cli").Argument<[string, ...string[]]>;
11
+ readonly components: import("@sdxc/cli").Argument<string[]>;
11
12
  }, {
13
+ readonly all: import("@sdxc/cli").Flag<boolean>;
14
+ readonly withDeps: import("@sdxc/cli").Flag<boolean>;
12
15
  readonly force: import("@sdxc/cli").Flag<boolean>;
13
16
  readonly dryRun: import("@sdxc/cli").Flag<boolean>;
14
17
  }>, readonly [import("@sdxc/cli").CommandMiddleware<{
@@ -1,26 +1,43 @@
1
1
  /**
2
2
  * The `sdxc ui update` handler: replaces copied files with the installed version. A file the
3
- * project edited is replaced only with `--force`, or when the user says yes on a terminal.
3
+ * project edited is replaced only with `--force`, or when the user says yes on a terminal;
4
+ * `--all` covers every copy and leaves edited files without asking, so it is safe unattended.
4
5
  *
5
6
  * @author [Sergio Xalambrí](https://sergiodxa.com)
6
7
  * @copyright Sergio Xalambrí 2026
7
8
  */
8
- import { createCommand, success } from "@sdxc/cli";
9
+ import { createCommand, success, usage } from "@sdxc/cli";
9
10
  import { isFailure, success as succeed } from "@sdxc/result";
10
11
  import { SDXC_COMMANDS } from "../../contract.js";
12
+ import { uiEntries } from "../../lock.js";
11
13
  import { packageRoot, project } from "../../middleware.js";
12
14
  import { finishPlan, loadContext, planUpdate } from "../../ui/commands.js";
13
- /** Updates the named copies and prints what it replaced and what it left. */
15
+ /** Updates the named copies, or every copy with `--all`, and prints what it replaced and left. */
14
16
  export default createCommand(SDXC_COMMANDS.ui.update, {
15
17
  middleware: [project(), packageRoot()],
16
- /** Without a terminal and without `--force`, every edited file is left as it is. */
18
+ /**
19
+ * Exits 2 when neither names nor `--all` are given, or both are. Without a terminal and
20
+ * without `--force`, every edited file is left as it is.
21
+ */
17
22
  async handler(ctx) {
23
+ let named = ctx.arguments.components;
24
+ let all = ctx.flags.all;
25
+ if (named.length === 0 && !all)
26
+ return usage("Name the copies to update, or pass --all");
27
+ if (named.length > 0 && all)
28
+ return usage("Name the copies to update or pass --all, not both");
18
29
  let context = await loadContext(ctx.project, ctx.packageRoot);
19
30
  if (isFailure(context))
20
31
  return context;
21
- let plan = await planUpdate(context.data, ctx.arguments.components, {
22
- overwrite: (path) => ctx.flags.force
23
- ? Promise.resolve(succeed(true))
32
+ let names = all ? uiEntries(context.data.lock).map((entry) => entry.name) : named;
33
+ if (names.length === 0) {
34
+ ctx.stdout("No component is copied; sdxc ui add copies one\n");
35
+ return success();
36
+ }
37
+ let plan = await planUpdate(context.data, names, {
38
+ withDeps: ctx.flags.withDeps,
39
+ overwrite: (path) => ctx.flags.force || all
40
+ ? Promise.resolve(succeed(ctx.flags.force))
24
41
  : ctx.prompt.confirm({
25
42
  message: `${path} is edited; replace it with the installed version?`,
26
43
  default: false,
@@ -8,7 +8,8 @@
8
8
  */
9
9
  /**
10
10
  * Exits 0 when done or already up to date, 1 when the upgrade failed or the target is older.
11
- * Progress goes to stderr; stdout carries only the prompt.
11
+ * A target equal to the project's release still re-pins what lags behind it, `remix` included,
12
+ * so "up to date" means no pin moves. Progress goes to stderr; stdout carries only the prompt.
12
13
  */
13
14
  declare const _default: import("@sdxc/cli").CommandAction<import("@sdxc/cli").Command<{
14
15
  readonly version: import("@sdxc/cli").Argument<string | undefined>;
@@ -17,6 +18,7 @@ declare const _default: import("@sdxc/cli").CommandAction<import("@sdxc/cli").Co
17
18
  readonly output: import("@sdxc/cli").ValueFlag<string, false, false, false>;
18
19
  readonly prompt: import("@sdxc/cli").Flag<boolean>;
19
20
  readonly from: import("@sdxc/cli").ValueFlag<string, false, false, false>;
21
+ readonly since: import("@sdxc/cli").ValueFlag<string, false, true, false>;
20
22
  readonly remixFrom: import("@sdxc/cli").ValueFlag<string, false, false, false>;
21
23
  }>, readonly [import("@sdxc/cli").CommandMiddleware<{
22
24
  key: typeof import("../middleware.js").CurrentProject;
@@ -14,16 +14,17 @@ import { compare } from "@sdxc/semver";
14
14
  import { SDXC_COMMANDS } from "../contract.js";
15
15
  import { packageRoot, project } from "../middleware.js";
16
16
  import { lockFileAtOrAbove, packageManager } from "../package-manager.js";
17
- import { resolveRelease, scopedPackageOf } from "../releases.js";
18
- import { entriesBetween } from "../upgrade/changelog.js";
19
- import { bumpManifest, currentRelease, listedScopedPackages, lists, projectImports, readManifest, } from "../upgrade/project.js";
17
+ import { datedPin, fetchPackuments, scopedPackageOf, versionAtRelease, versionsAt, } from "../releases.js";
18
+ import { AGENTS_FILE, planAgentsFile, writeAgentsFile } from "../upgrade/agents.js";
19
+ import { bumpManifest, currentRelease, listedScopedPackages, lists, pinnedRelease, projectImports, readManifest, } from "../upgrade/project.js";
20
20
  import { buildPrompt } from "../upgrade/prompt.js";
21
21
  import { fetchChangelog, fetchRelease, RELEASE_PACKAGE } from "../upgrade/registry.js";
22
22
  /** The middleware `upgrade` runs behind. */
23
23
  const UPGRADE_MIDDLEWARE = [project(), packageRoot()];
24
24
  /**
25
25
  * Exits 0 when done or already up to date, 1 when the upgrade failed or the target is older.
26
- * Progress goes to stderr; stdout carries only the prompt.
26
+ * A target equal to the project's release still re-pins what lags behind it, `remix` included,
27
+ * so "up to date" means no pin moves. Progress goes to stderr; stdout carries only the prompt.
27
28
  */
28
29
  export default createCommand(SDXC_COMMANDS.upgrade, {
29
30
  middleware: UPGRADE_MIDDLEWARE,
@@ -57,13 +58,37 @@ export default createCommand(SDXC_COMMANDS.upgrade, {
57
58
  if (order < 0) {
58
59
  return failure(new Error(`Release ${release.version} is older than the project's ${current}; upgrade only moves forward`));
59
60
  }
60
- if (order === 0) {
61
- ctx.stderr(`The @sdxc packages are up to date at ${current}\n`);
61
+ let pins = await ctx.task(`Resolving ${scoped.length} @sdxc packages at ${release.version}`, async (task) => {
62
+ let packuments = await fetchPackuments(scoped, task.signal);
63
+ if (isFailure(packuments))
64
+ return packuments;
65
+ let versions = versionsAt(packuments.data, release.version);
66
+ if (isFailure(versions))
67
+ return versions;
68
+ return success({
69
+ versions: versions.data,
70
+ since: laggingSince(manifest, packuments.data, current),
71
+ });
72
+ });
73
+ if (isFailure(pins))
74
+ return pins;
75
+ let { since } = pins.data;
76
+ let versions = Object.fromEntries(pins.data.versions);
77
+ if (release.remix !== null && lists(manifest, "remix"))
78
+ versions.remix = release.remix;
79
+ let bumped = bumpManifest(text, versions);
80
+ if (bumped.bumps.length === 0) {
81
+ ctx.stderr(`The @sdxc packages are up to date at ${release.version}\n`);
62
82
  return success();
63
83
  }
64
- let imports = await projectImports(root);
65
84
  if (changelog !== null) {
66
- let proceed = await confirmBreaking(ctx, changelog, current, release.version, imports);
85
+ let imports = await projectImports(root);
86
+ let proceed = await confirmBreaking(ctx, changelog, {
87
+ from: current,
88
+ since,
89
+ to: release.version,
90
+ imports,
91
+ });
67
92
  if (isFailure(proceed))
68
93
  return proceed;
69
94
  if (!proceed.data) {
@@ -71,13 +96,6 @@ export default createCommand(SDXC_COMMANDS.upgrade, {
71
96
  return success();
72
97
  }
73
98
  }
74
- let pins = await ctx.task(`Resolving ${scoped.length} @sdxc packages at ${release.version}`, (task) => resolveRelease(scoped, release.version, task.signal));
75
- if (isFailure(pins))
76
- return pins;
77
- let versions = Object.fromEntries(pins.data);
78
- if (release.remix !== null && lists(manifest, "remix"))
79
- versions.remix = release.remix;
80
- let bumped = bumpManifest(text, versions);
81
99
  let written = await wrap(() => writeFile(resolve(root, "package.json"), bumped.text));
82
100
  if (isFailure(written))
83
101
  return written;
@@ -96,6 +114,7 @@ export default createCommand(SDXC_COMMANDS.upgrade, {
96
114
  "--prompt",
97
115
  "--from",
98
116
  current,
117
+ ...[...since].flatMap(([name, pinned]) => ["--since", `${name}@${pinned}`]),
99
118
  ...(remixFrom === null ? [] : ["--remix-from", remixFrom]),
100
119
  ...(output === null ? [] : ["--output", output]),
101
120
  ];
@@ -113,16 +132,41 @@ export default createCommand(SDXC_COMMANDS.upgrade, {
113
132
  return success();
114
133
  },
115
134
  });
116
- /** Prints the prompt for this kit's release, or writes it to `output`. */
135
+ /**
136
+ * Rewrites the sdxc section of the project's `AGENTS.md` from this kit's release, then prints
137
+ * the prompt for that release, or writes it to `output`.
138
+ */
117
139
  async function printPrompt(ctx, from, output) {
140
+ let since = new Map();
141
+ for (let value of ctx.flags.since) {
142
+ let at = value.lastIndexOf("@");
143
+ let pinned = at > 0 ? datedPin(value.slice(at + 1)) : null;
144
+ if (pinned === null) {
145
+ return usage("--since takes <package>@<version>, such as @sdxc/jwt@2026.9.4");
146
+ }
147
+ since.set(value.slice(0, at), pinned);
148
+ }
149
+ let agents = await planAgentsFile(ctx.project.root, ctx.packageRoot);
150
+ if (isFailure(agents))
151
+ return agents;
118
152
  let prompt = await buildPrompt({
119
153
  root: ctx.project.root,
120
154
  packageRoot: ctx.packageRoot,
121
155
  from,
122
156
  remixFrom: ctx.flags.remixFrom ?? null,
157
+ since,
158
+ ...(agents.data === null ? {} : { agents: agents.data.status }),
123
159
  });
124
160
  if (isFailure(prompt))
125
161
  return prompt;
162
+ if (agents.data !== null) {
163
+ let refreshed = await writeAgentsFile(ctx.project.root, agents.data);
164
+ if (isFailure(refreshed))
165
+ return refreshed;
166
+ if (agents.data.status === "refreshed") {
167
+ ctx.stderr(`${AGENTS_FILE}: refreshed the sdxc section\n`);
168
+ }
169
+ }
126
170
  if (output === null) {
127
171
  ctx.stdout(prompt.data);
128
172
  return success();
@@ -135,7 +179,7 @@ async function printPrompt(ctx, from, output) {
135
179
  return success();
136
180
  }
137
181
  /**
138
- * Finds the release `version` names on npm, and, when it is newer than `current`, the
182
+ * Finds the release `version` names on npm, and, unless it is older than `current`, the
139
183
  * changelog it ships. A changelog the CDN cannot serve is `null`, which skips the question
140
184
  * about breaking changes rather than the upgrade.
141
185
  */
@@ -145,7 +189,7 @@ async function lookUp(ctx, version, current) {
145
189
  if (isFailure(release))
146
190
  return release;
147
191
  task.update(`Found release ${release.data.version}`);
148
- if (compare(release.data.version, current) <= 0) {
192
+ if (compare(release.data.version, current) < 0) {
149
193
  return success({ release: release.data, changelog: null });
150
194
  }
151
195
  let changelog = await fetchChangelog(release.data.version, task.signal);
@@ -156,21 +200,42 @@ async function lookUp(ctx, version, current) {
156
200
  });
157
201
  }
158
202
  /**
159
- * Lists the breaking changes between `from` and `to` in packages the project imports and asks
160
- * whether to go on. Without a terminal the upgrade goes on; with none to list nothing is asked.
203
+ * The release each listed `@sdxc/*` package is pinned to when that pin is older than its version
204
+ * at `current`, by name, so the prompt covers its changes from its own pin; a package at its
205
+ * version, or pinned to no dated release, is left out and covered from `current`.
206
+ */
207
+ function laggingSince(manifest, packuments, current) {
208
+ let since = new Map();
209
+ for (let packument of packuments) {
210
+ let pinned = pinnedRelease(manifest, packument.name);
211
+ let expected = versionAtRelease(packument, current);
212
+ if (pinned !== null && expected !== null && compare(pinned, expected) < 0) {
213
+ since.set(packument.name, pinned);
214
+ }
215
+ }
216
+ return since;
217
+ }
218
+ /**
219
+ * Lists the breaking changes the move brings to packages the project imports, each package's
220
+ * from its entry in `since` or else `from`, up to `to`, and asks whether to go on. Without a
221
+ * terminal the upgrade goes on; with none to list nothing is asked.
161
222
  *
162
223
  * @returns Whether to bump `package.json`
163
224
  */
164
- async function confirmBreaking(ctx, changelog, from, to, imports) {
225
+ async function confirmBreaking(ctx, changelog, range) {
165
226
  let imported = new Set();
166
- for (let specifier of imports.keys()) {
227
+ for (let specifier of range.imports.keys()) {
167
228
  let name = scopedPackageOf(specifier);
168
229
  if (name !== null)
169
230
  imported.add(name);
170
231
  }
171
- let breaking = entriesBetween(changelog, from, to).filter((entry) => entry.breaking && imported.has(entry.package));
232
+ let breaking = changelog.filter((entry) => entry.breaking &&
233
+ imported.has(entry.package) &&
234
+ compare(entry.release, range.since.get(entry.package) ?? range.from) > 0 &&
235
+ compare(entry.release, range.to) <= 0);
172
236
  if (breaking.length === 0)
173
237
  return success(true);
238
+ let to = range.to;
174
239
  let count = breaking.length === 1 ? "1 breaking change" : `${breaking.length} breaking changes`;
175
240
  ctx.stderr(`Release ${to} brings ${count} to packages this project imports:\n`);
176
241
  for (let entry of breaking) {
package/dist/config.d.ts CHANGED
@@ -29,6 +29,15 @@ export declare const CONFIG_SCHEMA: s.Schema<{
29
29
  migrations?: Record<string, string> | undefined;
30
30
  stubs?: string | undefined;
31
31
  } | undefined;
32
+ doctor?: {
33
+ migrations?: {
34
+ accept?: {
35
+ file: string;
36
+ column: string;
37
+ }[] | undefined;
38
+ } | undefined;
39
+ checks?: string | undefined;
40
+ } | undefined;
32
41
  lock?: string | undefined;
33
42
  }, {
34
43
  ui: {
@@ -42,6 +51,15 @@ export declare const CONFIG_SCHEMA: s.Schema<{
42
51
  migrations: Record<string, string>;
43
52
  stubs: string;
44
53
  };
54
+ doctor: {
55
+ migrations: {
56
+ accept: {
57
+ file: string;
58
+ column: string;
59
+ }[];
60
+ };
61
+ checks: string;
62
+ };
45
63
  lock: string;
46
64
  $schema?: string | undefined;
47
65
  format?: string[] | undefined;